From 23615147a32fa531350b7750f0b3510c19edf454 Mon Sep 17 00:00:00 2001 From: vdpAdmin Date: Sat, 1 Jan 2022 19:15:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E6=AD=A5=E5=AE=8C=E6=88=90=E5=BA=93?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=89=93=E5=8C=85=E9=85=8D=E7=BD=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install-render.js | 39 ++ install.js | 71 +++ lib/vuedraggable/LICENSE | 21 + lib/vuedraggable/README.md | 424 ++++++++++++++++++ lib/vuedraggable/package.json | 126 ++++++ package-lock.json | 150 ++++++- package.json | 6 +- .../container-widget/grid-col-widget.vue | 4 +- .../container-widget/tab-widget.vue | 4 +- .../container-widget/table-cell-widget.vue | 4 +- .../form-widget/field-widget/fieldMixin.js | 32 +- .../field-widget/number-widget.vue | 2 +- .../form-designer/form-widget/index.vue | 6 - src/components/form-designer/index.vue | 8 +- .../form-designer/setting-panel/index.vue | 12 +- .../setting-panel/option-items-setting.vue | 9 +- .../container-tab/tab-customClass-editor.vue | 4 +- .../event-handler/eventMixin.js | 5 +- .../number-defaultValue-editor.vue | 25 ++ .../form-designer/widget-panel/index.vue | 4 +- .../container-item/sub-form-item.vue | 2 +- src/extension/samples/card/card-widget.vue | 4 +- src/main.js | 6 +- src/utils/emitter.js | 3 +- vite-lib-render.config.js | 67 +++ vite-lib.config.js | 67 +++ vite.config.js | 22 + 27 files changed, 1072 insertions(+), 55 deletions(-) create mode 100644 install-render.js create mode 100644 install.js create mode 100644 lib/vuedraggable/LICENSE create mode 100644 lib/vuedraggable/README.md create mode 100644 lib/vuedraggable/package.json create mode 100644 src/components/form-designer/setting-panel/property-editor/field-number/number-defaultValue-editor.vue create mode 100644 vite-lib-render.config.js create mode 100644 vite-lib.config.js diff --git a/install-render.js b/install-render.js new file mode 100644 index 0000000..baa60a5 --- /dev/null +++ b/install-render.js @@ -0,0 +1,39 @@ +import axios from 'axios' + +import VFormRender from '@/components/form-render/index.vue' +import ContainerItems from '@/components/form-render/container-item/index' + +import { installI18n } from '@/utils/i18n' +import { loadExtension } from '@/extension/extension-loader' + +VFormRender.install = function (app) { + installI18n(app) + loadExtension(app) + + app.use(ContainerItems) + app.component(VFormRender.name, VFormRender) +} + +const components = [ + VFormRender +] + +const install = (app) => { + installI18n(app) + loadExtension(app) + + app.use(ContainerItems) + components.forEach(component => { + app.component(component.name, component) + }) +} + +// if (typeof window !== 'undefined' && window.Vue) { /* script方式引入时主动调用install方法!! */ +// window.axios = axios +// install(window.Vue); +// } + +export default { + install, + VFormRender +} diff --git a/install.js b/install.js new file mode 100644 index 0000000..2fd1a4d --- /dev/null +++ b/install.js @@ -0,0 +1,71 @@ +import axios from 'axios' + +import VFormDesigner from '@/components/form-designer/index.vue' +import VFormRender from '@/components/form-render/index.vue' + +import Draggable from '@/../lib/vuedraggable/dist/vuedraggable.umd.js' +import SvgIcon from '@/components/svg-icon' //svg组件 +import 'virtual:svg-icons-register' + +import ContainerWidgets from '@/components/form-designer/form-widget/container-widget/index' +import ContainerItems from '@/components/form-render/container-item/index' + +import { addDirective } from '@/utils/directive' +import { installI18n } from '@/utils/i18n' +import { loadExtension } from '@/extension/extension-loader' + + +VFormDesigner.install = function (app) { + addDirective(app) + installI18n(app) + loadExtension(app) + + app.use(ContainerWidgets) + app.use(ContainerItems) + + app.component('draggable', Draggable) + app.component('svg-icon', SvgIcon) + app.component(VFormDesigner.name, VFormDesigner) +} + +VFormRender.install = function (app) { + installI18n(app) + loadExtension(app) + + app.use(ContainerItems) + + app.component('svg-icon', SvgIcon) + app.component(VFormRender.name, VFormRender) +} + +const components = [ + VFormDesigner, + VFormRender +] + +const install = (app) => { + addDirective(app) + installI18n(app) + loadExtension(app) + + app.use(ContainerWidgets) + app.use(ContainerItems) + + app.component('draggable', Draggable) + app.component('svg-icon', SvgIcon) + + components.forEach(component => { + app.component(component.name, component) + }) +} + +// if (typeof window !== 'undefined' && window.Vue) { /* script方式引入时主动调用install方法!! */ +// window.axios = axios +// install(window.Vue); +// } + +export default { + install, + VFormDesigner, + VFormRender +} diff --git a/lib/vuedraggable/LICENSE b/lib/vuedraggable/LICENSE new file mode 100644 index 0000000..a95b50a --- /dev/null +++ b/lib/vuedraggable/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016-2019 David Desmaisons + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/vuedraggable/README.md b/lib/vuedraggable/README.md new file mode 100644 index 0000000..1efc2b8 --- /dev/null +++ b/lib/vuedraggable/README.md @@ -0,0 +1,424 @@ +

+

vue.draggable.next

+ +[![CircleCI](https://circleci.com/gh/SortableJS/vue.draggable.next.svg?style=shield)](https://circleci.com/gh/SortableJS/Vue.Draggable) +[![Coverage](https://codecov.io/gh/SortableJS/vue.draggable.next/branch/master/graph/badge.svg)](https://codecov.io/gh/SortableJS/Vue.Draggable) +[![codebeat badge](https://codebeat.co/badges/7a6c27c8-2d0b-47b9-af55-c2eea966e713)](https://codebeat.co/projects/github-com-sortablejs-vue-draggable-master) +[![GitHub open issues](https://img.shields.io/github/issues/SortableJS/vue.draggable.next.svg)](https://github.com/SortableJS/Vue.Draggable/issues?q=is%3Aopen+is%3Aissue) +[![npm download](https://img.shields.io/npm/dt/vuedraggable.svg?maxAge=30)](https://www.npmjs.com/package/vuedraggable) +[![npm download per month](https://img.shields.io/npm/dm/vuedraggable.svg)](https://www.npmjs.com/package/vuedraggable) +[![npm version](https://img.shields.io/npm/v/vuedraggable/next.svg)](https://www.npmjs.com/package/vuedraggable/v/next) +[![MIT License](https://img.shields.io/github/license/SortableJS/vue.draggable.next.svg)](https://github.com/SortableJS/vue.draggable.next/blob/master/LICENSE) + + +Vue component (Vue.js 3.0) allowing drag-and-drop and synchronization with view model array. + +For Vue 2 and Vue 1 version check: https://github.com/SortableJS/Vue.Draggable + +Based on and offering all features of [Sortable.js](https://github.com/RubaXa/Sortable) + +## Demo + +![demo gif](https://raw.githubusercontent.com/SortableJS/vue.draggable.next/master/example.gif) + +## Live Demos + +https://sortablejs.github.io/vue.draggable.next/ + +## Features + +* Full support of [Sortable.js](https://github.com/RubaXa/Sortable) features: + * Supports touch devices + * Supports drag handles and selectable text + * Smart auto-scrolling + * Support drag and drop between different lists + * No jQuery dependency +* Keeps in sync HTML and view model list +* Compatible with Vue.js 3.0 transition-group +* Cancellation support +* Events reporting any changes when full control is needed +* Reuse existing UI library components (such as [vuetify](https://vuetifyjs.com), [element](http://element.eleme.io/), or [vue material](https://vuematerial.io) etc...) and make them draggable using `tag` and `componentData` props + + +## Donate + +Find this project useful? You can buy me a :coffee: or a :beer: + +[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=GYAEKQZJ4FQT2¤cy_code=USD&source=url) + + +## Installation + +### With npm or yarn + +```bash +yarn add vuedraggable@next + +npm i -S vuedraggable@next +``` + +### with direct link +```html + + + + + + + +``` + +[cf example section](https://github.com/SortableJS/Vue.Draggable/tree/master/example) + + +## Typical use: +``` html + + + +``` +``` js + import draggable from 'vuedraggable' + ... + export default { + components: { + draggable, + }, + data() { + return { + drag: false, + } + }, + ... +``` + +The `item` slot should be used to display items of the list. It receives the element value and the element index as slot-props. + +### With `transition-group`: +``` html + + + +``` + +### With footer slot: +``` html + + + + +``` +### With header slot: +``` html + + + + +``` + +### With Vuex: + +```html + +``` + +```javascript +computed: { + myList: { + get() { + return this.$store.state.myList + }, + set(value) { + this.$store.commit('updateList', value) + } + } +} +``` + +### Migrate from vue 2 version: + +Breaking changes: + 1) Use `item` slot instead of default to display elements + 2) Provide a key for items using `itemKey` props + +From: +``` html + + +
{{element.name}}
+
+``` +To: +``` html + + + +``` + +Breaking changes: + 3) When using transition, you should now use the `tag` props and `componentData` to create the transition + +From +``` html + + + +
+ {{element.name}} +
+
+
+``` +to +``` html + + + +``` + +### Props +#### modelValue +Type: `Array`
+Required: `false`
+Default: `null` + +Input array to draggable component. Typically same array as referenced by inner element v-for directive.
+This is the preferred way to use Vue.draggable as it is compatible with Vuex.
+It should not be used directly but only though the `v-model` directive: +```html + +``` + +#### list +Type: `Array`
+Required: `false`
+Default: `null` + +Alternative to the `modelValue` prop, list is an array to be synchronized with drag-and-drop.
+The main difference is that `list` prop is updated by draggable component using splice method, whereas `modelValue` is immutable.
+**Do not use in conjunction with modelValue prop.** + +#### itemKey +Type: `String` or `Function`
+Required: `true`
+ +The property to be used as the element key. Alternatively a function receiving an element of the list and returning its key. + +#### All sortable options +Sortable options can be set directly as vue.draggable props since version 2.19. + +This means that all [sortable option](https://github.com/RubaXa/Sortable#options) are valid sortable props with the notable exception of all the method starting by "on" as draggable component expose the same API via events. + +kebab-case property are supported: for example `ghost-class` props will be converted to `ghostClass` sortable option. + +Example setting handle, sortable and a group option: +```HTML + + + +``` + +#### tag +Type: `String`
+Default: `'div'` + +HTML node type of the element that draggable component create as outer element for the included slot.
+It is also possible to pass the name of vue component as element. In this case, draggable attribute will be passed to the create component.
+See also [componentData](#componentdata) if you need to set props or event to the created component. + +#### clone +Type: `Function`
+Required: `false`
+Default: `(original) => { return original;}`
+ +Function called on the source component to clone element when clone option is true. The unique argument is the viewModel element to be cloned and the returned value is its cloned version.
+By default vue.draggable reuses the viewModel element, so you have to use this hook if you want to clone or deep clone it. + +#### move +Type: `Function`
+Required: `false`
+Default: `null`
+ +If not null this function will be called in a similar way as [Sortable onMove callback](https://github.com/RubaXa/Sortable#move-event-object). +Returning false will cancel the drag operation. + +```javascript +function onMoveCallback(evt, originalEvent){ + ... + // return false; — for cancel +} +``` +evt object has same property as [Sortable onMove event](https://github.com/RubaXa/Sortable#move-event-object), and 3 additional properties: + - `draggedContext`: context linked to dragged element + - `index`: dragged element index + - `element`: dragged element underlying view model element + - `futureIndex`: potential index of the dragged element if the drop operation is accepted + - `relatedContext`: context linked to current drag operation + - `index`: target element index + - `element`: target element view model element + - `list`: target list + - `component`: target VueComponent + +HTML: +```HTML + +``` +javascript: +```javascript +checkMove: function(evt){ + return (evt.draggedContext.element.name!=='apple'); +} +``` +See complete example: [Cancel.html](https://github.com/SortableJS/Vue.Draggable/blob/master/examples/Cancel.html), [cancel.js](https://github.com/SortableJS/Vue.Draggable/blob/master/examples/script/cancel.js) + +#### componentData +Type: `Object`
+Required: `false`
+Default: `null`
+ +This props is used to pass additional information to child component declared by [tag props](#tag).
+Value: an object corresponding to the attributes, props and events we would pass to the component. + +Example (using [element UI library](http://element.eleme.io/#/en-US)): +```HTML + + + +``` +```javascript +methods: { + handleChange() { + console.log('changed'); + }, + inputChanged(value) { + this.activeNames = value; + }, + getComponentData() { + return { + onChange: this.handleChange, + onInput: this.inputChanged, + wrap: true, + value: this.activeNames + }; + } + } +``` + +### Events + +* Support for Sortable events: + + `start`, `add`, `remove`, `update`, `end`, `choose`, `unchoose`, `sort`, `filter`, `clone`
+ Events are called whenever onStart, onAdd, onRemove, onUpdate, onEnd, onChoose, onUnchoose, onSort, onClone are fired by Sortable.js with the same argument.
+ [See here for reference](https://github.com/RubaXa/Sortable#event-object-demo) + + Note that SortableJS OnMove callback is mapped with the [move prop](https://github.com/SortableJS/Vue.Draggable/blob/master/README.md#move) + +HTML: +```HTML + +``` + +* change event + + `change` event is triggered when list prop is not null and the corresponding array is altered due to drag-and-drop operation.
+ This event is called with one argument containing one of the following properties: + - `added`: contains information of an element added to the array + - `newIndex`: the index of the added element + - `element`: the added element + - `removed`: contains information of an element removed from to the array + - `oldIndex`: the index of the element before remove + - `element`: the removed element + - `moved`: contains information of an element moved within the array + - `newIndex`: the current index of the moved element + - `oldIndex`: the old index of the moved element + - `element`: the moved element + +### Slots + +#### item +The `item` slot is used to display one element of the list. Vue.draggable will iterate the list and call this slot for each element. + +Slot props: +- `element` the element in the list +- `index` the element index + +It is the only required slot. + + +```html + + + +``` + +#### Header +Use the `header` slot to add none-draggable element inside the vuedraggable component. +Ex: + +``` html + + + + +``` + +#### Footer +Use the `footer` slot to add none-draggable element inside the vuedraggable component. +Ex: + +``` html + + + + +``` + + ### Example + * [Clone](https://sortablejs.github.io/vue.draggable.next/#/custom-clone) + * [Handle](https://sortablejs.github.io/vue.draggable.next/#/handle) + * [Transition](https://sortablejs.github.io/vue.draggable.next/#/transition-example-2) + * [Nested](https://sortablejs.github.io/vue.draggable.next/#/nested-example) + * [Table](https://sortablejs.github.io/vue.draggable.next/#/table-example) diff --git a/lib/vuedraggable/package.json b/lib/vuedraggable/package.json new file mode 100644 index 0000000..ea8e17d --- /dev/null +++ b/lib/vuedraggable/package.json @@ -0,0 +1,126 @@ +{ + "_from": "vuedraggable@^4.1.0", + "_id": "vuedraggable@4.1.0", + "_inBundle": false, + "_integrity": "sha512-FU5HCWBmsf20GpP3eudURW3WdWTKIbEIQxh9/8GE806hydR9qZqRRxRE3RjqX7PkuLuMQG/A7n3cfj9rCEchww==", + "_location": "/vuedraggable", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "vuedraggable@^4.1.0", + "name": "vuedraggable", + "escapedName": "vuedraggable", + "rawSpec": "^4.1.0", + "saveSpec": null, + "fetchSpec": "^4.1.0" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/vuedraggable/-/vuedraggable-4.1.0.tgz", + "_shasum": "edece68adb8a4d9e06accff9dfc9040e66852270", + "_spec": "vuedraggable@^4.1.0", + "_where": "D:\\dev2021\\vform-next\\variant-form3-vite", + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 8" + ], + "bugs": { + "url": "https://github.com/SortableJS/Vue.Draggable/issues" + }, + "bundleDependencies": false, + "dependencies": { + "sortablejs": "1.14.0" + }, + "deprecated": false, + "description": "draggable component for vue", + "devDependencies": { + "@vue/cli-plugin-babel": "~4.5.0", + "@vue/cli-plugin-eslint": "~4.5.0", + "@vue/cli-plugin-unit-jest": "^4.5.4", + "@vue/cli-service": "~4.5.0", + "@vue/compiler-sfc": "^3.0.0", + "@vue/eslint-config-prettier": "6.0.0", + "@vue/server-renderer": "^3.0.0", + "@vue/test-utils": "^2.0.0-beta.6", + "babel-core": "7.0.0-bridge.0", + "babel-eslint": "^10.0.1", + "babel-jest": "^24.6.0", + "bootstrap": "^4.3.1", + "codecov": "^3.2.0", + "element-plus": "^1.0.1-alpha.12", + "eslint": "^6.7.2", + "eslint-plugin-prettier": "^3.1.0", + "eslint-plugin-vue": "^7.0.0-0", + "font-awesome": "^4.7.0", + "jquery": "^3.5.1", + "popper.js": "^1.16.1", + "typescript": "^4.0.3", + "vue": "^3.0.1", + "vue-jest": "^5.0.0-alpha.5", + "vue-router": "^4.0.0-beta.13", + "vuex": "4.0.0-beta.4" + }, + "eslintConfig": { + "root": true, + "env": { + "node": true + }, + "extends": [ + "plugin:vue/essential", + "@vue/prettier" + ], + "rules": {}, + "parserOptions": { + "parser": "babel-eslint" + } + }, + "files": [ + "dist/*.css", + "dist/*.map", + "dist/*.js", + "src/*" + ], + "homepage": "https://github.com/SortableJS/Vue.Draggable#readme", + "keywords": [ + "vue", + "vuejs", + "drag", + "and", + "drop", + "list", + "Sortable.js", + "component", + "nested" + ], + "license": "MIT", + "main": "dist/vuedraggable.umd.min.js", + "module": "dist/vuedraggable.umd.js", + "name": "vuedraggable", + "peerDependencies": { + "vue": "^3.0.1" + }, + "postcss": { + "plugins": { + "autoprefixer": {} + } + }, + "private": false, + "repository": { + "type": "git", + "url": "git+https://github.com/SortableJS/Vue.Draggable.git" + }, + "scripts": { + "build": "vue-cli-service build --name vuedraggable --entry ./src/vuedraggable.js --target lib", + "build:doc": "vue-cli-service build ./example/main.js --dest docs --mode development", + "lint": "vue-cli-service lint src example", + "prepublishOnly": "npm run lint && npm run test:unit && npm run build:doc && npm run build", + "serve": "vue-cli-service serve ./example/main.js --open --mode local", + "test:coverage": "vue-cli-service test:unit --coverage --verbose && codecov", + "test:unit": "vue-cli-service test:unit --coverage" + }, + "types": "src/vuedraggable.d.ts", + "version": "4.1.0" +} diff --git a/package-lock.json b/package-lock.json index afc2452..a04a1f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -400,6 +400,42 @@ "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.0.tgz", "integrity": "sha512-zrsUxjLOKAzdewIDRWy9nsV1GQsKBCWaGwsZQlCgr6/q+vjyZhFgqedLfFBuI9anTPEUT4APq9Mu0SZBTzIcGQ==" }, + "@rollup/plugin-commonjs": { + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-21.0.1.tgz", + "integrity": "sha512-EA+g22lbNJ8p5kuZJUYyhhDK7WgJckW5g4pNN7n4mAFUM96VuwUnNT3xr2Db2iCZPI1pJPbGyfT5mS9T1dHfMg==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^3.1.0", + "commondir": "^1.0.1", + "estree-walker": "^2.0.1", + "glob": "^7.1.6", + "is-reference": "^1.2.1", + "magic-string": "^0.25.7", + "resolve": "^1.17.0" + }, + "dependencies": { + "@rollup/pluginutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", + "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", + "dev": true, + "requires": { + "@types/estree": "0.0.39", + "estree-walker": "^1.0.1", + "picomatch": "^2.2.2" + }, + "dependencies": { + "estree-walker": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", + "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", + "dev": true + } + } + } + } + }, "@rollup/pluginutils": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.1.2.tgz", @@ -416,6 +452,12 @@ "integrity": "sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==", "dev": true }, + "@types/estree": { + "version": "0.0.39", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", + "dev": true + }, "@types/node": { "version": "17.0.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.0.tgz", @@ -689,6 +731,12 @@ "resolve": "^1.12.0" } }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, "base": { "version": "0.11.2", "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", @@ -728,6 +776,16 @@ "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=", "dev": true }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "braces": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", @@ -884,12 +942,24 @@ "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", "dev": true }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, "component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", "dev": true }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, "convert-source-map": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", @@ -1489,6 +1559,12 @@ "universalify": "^2.0.0" } }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, "fsevents": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", @@ -1523,6 +1599,20 @@ "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", "dev": true }, + "glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, "glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", @@ -1684,6 +1774,16 @@ "integrity": "sha512-zIE9hX70qew5qTUjSS7wi1iwj/l7+m54KWU247nhM3v806UdGj1yDndXj+IOYxxtW9zyLI+xqFNZjTuDaLUqFw==", "dev": true }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -1824,6 +1924,15 @@ "isobject": "^3.0.1" } }, + "is-reference": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", + "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", + "dev": true, + "requires": { + "@types/estree": "*" + } + }, "is-regex": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", @@ -2036,6 +2145,15 @@ } } }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, "minimist": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", @@ -2265,6 +2383,15 @@ "isobject": "^3.0.1" } }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, "parchment": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/parchment/-/parchment-1.1.4.tgz", @@ -2276,6 +2403,12 @@ "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", "dev": true }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, "path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", @@ -2637,11 +2770,6 @@ } } }, - "sortablejs": { - "version": "1.14.0", - "resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.14.0.tgz", - "integrity": "sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w==" - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -3142,13 +3270,11 @@ "vue": "^3.0.11" } }, - "vuedraggable": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/vuedraggable/-/vuedraggable-4.1.0.tgz", - "integrity": "sha512-FU5HCWBmsf20GpP3eudURW3WdWTKIbEIQxh9/8GE806hydR9qZqRRxRE3RjqX7PkuLuMQG/A7n3cfj9rCEchww==", - "requires": { - "sortablejs": "1.14.0" - } + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true } } } diff --git a/package.json b/package.json index dd6c391..e1c3de4 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,8 @@ "scripts": { "serve": "vite", "build": "vite build", + "lib": "vite build --config vite-lib.config.js", + "lib-render": "vite build --config vite-lib-render.config.js", "preview": "vite preview" }, "dependencies": { @@ -16,10 +18,10 @@ "mitt": "^3.0.0", "vue": "^3.0.0", "vue-i18n": "^9.2.0-beta.23", - "vue3-quill": "^0.2.6", - "vuedraggable": "^4.1.0" + "vue3-quill": "^0.2.6" }, "devDependencies": { + "@rollup/plugin-commonjs": "^21.0.1", "@types/node": "^17.0.0", "@vitejs/plugin-vue": "^2.0.0", "@vitejs/plugin-vue-jsx": "^1.3.3", diff --git a/src/components/form-designer/form-widget/container-widget/grid-col-widget.vue b/src/components/form-designer/form-widget/container-widget/grid-col-widget.vue index ed4ac84..a537126 100644 --- a/src/components/form-designer/form-widget/container-widget/grid-col-widget.vue +++ b/src/components/form-designer/form-widget/container-widget/grid-col-widget.vue @@ -43,7 +43,7 @@ + + diff --git a/src/components/form-designer/widget-panel/index.vue b/src/components/form-designer/widget-panel/index.vue index 5848158..5eef9a5 100644 --- a/src/components/form-designer/widget-panel/index.vue +++ b/src/components/form-designer/widget-panel/index.vue @@ -88,7 +88,7 @@