@farris/ui-vue 1.2.9 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/accordion/index.esm.js +64 -64
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +521 -336
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.css +1 -1
- package/components/button-edit/index.esm.js +99 -97
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +496 -504
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +251 -259
- package/components/capsule/index.umd.cjs +1 -1
- package/components/checkbox/index.esm.js +696 -519
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +368 -376
- package/components/color-picker/index.umd.cjs +2 -2
- package/components/combo-list/index.css +1 -0
- package/components/combo-list/index.esm.js +1141 -340
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +116 -116
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/common/index.esm.js +986 -798
- package/components/common/index.umd.cjs +1 -1
- package/components/component/index.esm.js +463 -998
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.css +1 -0
- package/components/condition/index.esm.js +2233 -1057
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +335 -1002
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.css +1 -1
- package/components/data-grid/index.esm.js +6193 -4702
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.css +1 -0
- package/components/data-view/index.esm.js +4562 -3294
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.css +1 -1
- package/components/date-picker/index.esm.js +3420 -2623
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.css +1 -1
- package/components/designer-canvas/index.esm.js +914 -883
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/designer-outline/index.esm.js +14 -13
- package/components/designer-outline/index.umd.cjs +1 -1
- package/components/dropdown/index.esm.js +204 -212
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.css +1 -0
- package/components/dynamic-form/index.esm.js +2795 -1835
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +180 -130
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/dynamic-view/index.esm.js +303 -290
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +328 -336
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +65 -65
- package/components/expression-editor/index.umd.cjs +1 -1
- package/components/external-container/index.css +1 -1
- package/components/external-container/index.esm.js +3349 -3626
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.css +1 -1
- package/components/field-selector/index.esm.js +5344 -8588
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.css +1 -1
- package/components/filter-bar/index.esm.js +2179 -2227
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.css +1 -1
- package/components/flow-canvas/index.esm.js +684 -675
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +482 -490
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/input-group/index.esm.js +746 -569
- package/components/input-group/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +409 -385
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +348 -1019
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.css +1 -1
- package/components/list-view/index.esm.js +3606 -2388
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.css +1 -1
- package/components/lookup/index.esm.js +10871 -8970
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.css +1 -1
- package/components/mapping-editor/index.esm.js +6019 -5631
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/message-box/index.css +1 -1
- package/components/message-box/index.esm.js +511 -471
- package/components/message-box/index.umd.cjs +1 -1
- package/components/modal/index.css +1 -1
- package/components/modal/index.esm.js +438 -398
- package/components/modal/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +912 -1281
- package/components/nav/index.umd.cjs +3 -3
- package/components/notify/index.esm.js +59 -53
- package/components/notify/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +660 -484
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +682 -506
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.css +1 -1
- package/components/order/index.esm.js +1848 -1658
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +100 -100
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +1120 -1923
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +875 -1214
- package/components/pagination/index.umd.cjs +1 -1
- package/components/popover/index.esm.js +71 -70
- package/components/popover/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +229 -237
- package/components/progress/index.umd.cjs +3 -3
- package/components/property-editor/index.css +1 -1
- package/components/property-editor/index.esm.js +2314 -1521
- package/components/property-editor/index.umd.cjs +3 -3
- package/components/property-panel/index.esm.js +867 -868
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.css +1 -1
- package/components/query-solution/index.esm.js +4332 -3623
- package/components/query-solution/index.umd.cjs +1 -1
- package/components/radio-button/index.esm.js +72 -72
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/radio-group/index.esm.js +613 -437
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +255 -263
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +144 -152
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.css +1 -1
- package/components/response-layout-editor/index.esm.js +1101 -1038
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +935 -1750
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.css +1 -1
- package/components/schema-selector/index.esm.js +5264 -5677
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/search-box/index.esm.js +151 -154
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +438 -1125
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +93 -101
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/splitter/index.esm.js +563 -1202
- package/components/splitter/index.umd.cjs +1 -1
- package/components/splitter/style.js +2 -0
- package/components/step/index.esm.js +248 -256
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +549 -373
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.css +1 -1
- package/components/tabs/index.esm.js +2436 -3110
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tags/index.esm.js +328 -336
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +339 -347
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +554 -378
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.css +1 -1
- package/components/time-picker/index.esm.js +1322 -1144
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/transfer/index.css +1 -1
- package/components/transfer/index.esm.js +537 -543
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.css +1 -1
- package/components/tree-grid/index.esm.js +5113 -9426
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.css +1 -0
- package/components/tree-view/index.esm.js +3900 -2677
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +568 -570
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +266 -274
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +553 -1052
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +558 -566
- package/components/weather/index.umd.cjs +5 -5
- package/farris.all.esm.js +22009 -22688
- package/farris.all.umd.cjs +9 -9
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/capsule/src/capsule.props.d.ts +2 -2
- package/types/combo-list/src/components/list-container.component.d.ts +0 -3
- package/types/combo-list/src/components/list-container.props.d.ts +0 -4
- package/types/common/directive/area-response.d.ts +10 -0
- package/types/common/index.d.ts +9 -0
- package/types/common/radio-checkbox/radio-checkbox.props.d.ts +1 -0
- package/types/common/types.d.ts +1 -1
- package/types/common/utils/encrypt.d.ts +2 -0
- package/types/common/utils/resolve-field.d.ts +2 -0
- package/types/common/utils/use-class.d.ts +7 -0
- package/types/component/src/component.props.d.ts +7 -0
- package/types/component/src/designer/use-designer-rules.d.ts +2 -2
- package/types/component/src/property-config/component.property-config.d.ts +9 -0
- package/types/components.d.ts +1 -0
- package/types/condition/src/types.d.ts +2 -1
- package/types/content-container/src/designer/use-designer-rules.d.ts +3 -3
- package/types/data-grid/index.d.ts +11 -5
- package/types/data-grid/src/data-grid.component.d.ts +4 -2
- package/types/data-grid/src/data-grid.props.d.ts +1 -0
- package/types/data-grid/src/designer/data-grid.design.component.d.ts +2 -2
- package/types/data-grid/src/designer/use-designer-rules.d.ts +2 -2
- package/types/data-view/components/row/hierarchy-row.component.d.ts +2 -2
- package/types/data-view/composition/data/use-tree-data.d.ts +1 -1
- package/types/data-view/composition/types.d.ts +19 -4
- package/types/data-view/composition/visualization/use-virtual-scroll.d.ts +0 -15
- package/types/designer-canvas/index.d.ts +2 -1
- package/types/designer-canvas/src/composition/dg-control.d.ts +5 -0
- package/types/designer-canvas/src/composition/rule/use-dragula-common-rule.d.ts +4 -0
- package/types/designer-canvas/src/composition/rule/use-template-rule.d.ts +30 -0
- package/types/designer-canvas/src/composition/types.d.ts +2 -3
- package/types/designer-canvas/src/types.d.ts +2 -1
- package/types/dynamic-form/src/composition/use-response-form-layout-setting.d.ts +2 -0
- package/types/dynamic-form/src/designer/response-form-layout-setting.component.d.ts +8 -0
- package/types/dynamic-form/src/designer/response-form-layout-setting.props.d.ts +4 -0
- package/types/dynamic-form/src/designer/response-form.design.component.d.ts +7 -1
- package/types/dynamic-form/src/designer/use-designer-rules.d.ts +1 -1
- package/types/dynamic-form/src/property-config/form.property-config.d.ts +9 -0
- package/types/dynamic-form/src/schema/schema-mapper.d.ts +1 -0
- package/types/dynamic-form/src/schema/schema-resolver.d.ts +1 -0
- package/types/dynamic-form/src/types.d.ts +12 -1
- package/types/dynamic-resolver/index.d.ts +1 -0
- package/types/dynamic-resolver/src/common/toolbar-resolver.d.ts +1 -1
- package/types/dynamic-resolver/src/event-handler-resolver.d.ts +4 -0
- package/types/dynamic-resolver/src/types.d.ts +9 -0
- package/types/dynamic-view/index.d.ts +1 -0
- package/types/dynamic-view/src/event-dispatcher.d.ts +1 -1
- package/types/external-container/src/designer/use-designer-rules.d.ts +3 -3
- package/types/index.d.ts +2 -0
- package/types/layout/src/designer/layout-pane-use-designer-rules.d.ts +3 -3
- package/types/list-nav/src/designer/use-designer-rules.d.ts +3 -0
- package/types/lookup/src/components/favorite/lookup-favorite.component.d.ts +29 -0
- package/types/lookup/src/components/favorite/lookup-favorite.props.d.ts +15 -0
- package/types/lookup/src/components/modal-container.component.d.ts +25 -0
- package/types/lookup/src/components/modal-container.props.d.ts +29 -0
- package/types/lookup/src/composition/types.d.ts +8 -0
- package/types/lookup/src/composition/use-check-props.d.ts +9 -2
- package/types/lookup/src/composition/use-dialog.d.ts +5 -1
- package/types/lookup/src/composition/use-favorite.d.ts +12 -0
- package/types/lookup/src/composition/use-http.d.ts +9 -5
- package/types/lookup/src/composition/use-input-change.d.ts +3 -0
- package/types/lookup/src/composition/use-user-data.d.ts +24 -0
- package/types/lookup/src/property-config/lookup.property-config.d.ts +6 -4
- package/types/mapping-editor/src/mapping-editor.component.d.ts +3 -0
- package/types/mapping-editor/src/mapping-editor.props.d.ts +0 -1
- package/types/modal/src/composition/use-draggable.d.ts +2 -1
- package/types/modal/src/composition/use-shortcut.d.ts +6 -0
- package/types/modal/src/modal.component.d.ts +3 -0
- package/types/modal/src/modal.props.d.ts +4 -0
- package/types/page-header/src/page-header.props.d.ts +1 -0
- package/types/pagination/src/components/buttons/goto-buttons.component.d.ts +2 -2
- package/types/pagination/src/components/buttons/next-buttons.component.d.ts +2 -2
- package/types/pagination/src/components/buttons/previous-buttons.component.d.ts +2 -2
- package/types/pagination/src/components/pages/page-list.component.d.ts +2 -2
- package/types/pagination/src/components/pages/page-number.component.d.ts +2 -2
- package/types/property-panel/index.d.ts +2 -1
- package/types/property-panel/src/composition/entity/base-property.d.ts +8 -0
- package/types/property-panel/src/composition/entity/input-base-property.d.ts +20 -1
- package/types/query-solution/src/designer/query-solution-config/composition/types.d.ts +34 -27
- package/types/query-solution/src/designer/query-solution-config/composition/use-panel.d.ts +2 -16
- package/types/{data-grid/src/designer/use-group-column.d.ts → query-solution/src/designer/query-solution-config/composition/use-property.d.ts} +4 -5
- package/types/query-solution/src/designer/query-solution-config/composition/use-querysolution-rules.d.ts +3 -0
- package/types/query-solution/src/designer/query-solution-config/composition/use-transfer.d.ts +1 -1
- package/types/query-solution/src/property-config/query-solution.property-config.d.ts +60 -0
- package/types/query-solution/src/solutions.d.ts +108 -509
- package/types/response-layout-editor/index.d.ts +3 -1
- package/types/response-layout-editor/src/composition/converter/use-response-layout-editor-setting.d.ts +2 -0
- package/types/response-layout-editor/src/type.d.ts +21 -0
- package/types/response-toolbar/src/designer/use-designer-rules.d.ts +3 -3
- package/types/response-toolbar/src/property-config/response-toolbar-item.property-config.d.ts +1 -0
- package/types/section/src/designer/use-designer-rules.d.ts +3 -3
- package/types/splitter/src/components/splitter-pane.component.d.ts +1 -1
- package/types/splitter/src/designer/splitter-pane-use-designer-rules.d.ts +3 -3
- package/types/splitter/src/designer/splitter-use-designer-rules.d.ts +3 -3
- package/types/tabs/src/designer/tab-page-use-designer-rules.d.ts +3 -3
- package/types/tabs/src/designer/tab-use-designer-rules.d.ts +3 -3
- package/types/tabs/src/tabs.props.d.ts +1 -0
- package/types/tree-grid/index.d.ts +8 -2
- package/types/tree-grid/src/tree-grid.component.d.ts +3 -1
- package/types/designer-canvas/src/composition/rule/use-drag-drop-rules.d.ts +0 -19
- package/types/designer-canvas/src/composition/use-dragula-common-rule.d.ts +0 -4
- package/types/list-nav/src/composition/use-designer-rules.d.ts +0 -3
- package/types/modal/src/composition/use-esc.d.ts +0 -1
- package/types/query-solution/src/designer/query-solution-config/composition/mock-data.d.ts +0 -6
- package/types/response-layout-editor/src/composition/converter/response-layout-editor.converter.d.ts +0 -3
- package/types/response-layout-editor/src/composition/converter/use-convert-property-value.d.ts +0 -20
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { withInstall as
|
|
2
|
-
import { ref as i, defineComponent as he, computed as
|
|
3
|
-
import { cloneDeep as
|
|
4
|
-
function
|
|
1
|
+
import { withInstall as De } from "../common/index.esm.js";
|
|
2
|
+
import { ref as i, defineComponent as he, computed as R, watch as F, nextTick as ue, createVNode as T, inject as Be, onMounted as Ae } from "vue";
|
|
3
|
+
import { isPlainObject as me, cloneDeep as Ce } from "lodash-es";
|
|
4
|
+
function Se(a, e, v) {
|
|
5
5
|
return e;
|
|
6
6
|
}
|
|
7
7
|
const ye = {}, be = {};
|
|
8
|
-
function
|
|
9
|
-
const { properties: e, title: v, ignore: g } = a, n = g && Array.isArray(g),
|
|
10
|
-
return (!n || !g.find((y) => y == "id")) && (
|
|
8
|
+
function ie(a) {
|
|
9
|
+
const { properties: e, title: v, ignore: g } = a, n = g && Array.isArray(g), m = Object.keys(e).reduce((y, D) => ((!n || !g.find((C) => C == D)) && (y[D] = e[D].type === "object" && e[D].properties ? ie(e[D]) : Ce(e[D].default)), y), {});
|
|
10
|
+
return v && (!n || !g.find((y) => y == "id")) && (m.id = `${v}-${Date.now()}`), m;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function Te(a, e = {}, v) {
|
|
13
13
|
const g = ye[a];
|
|
14
14
|
if (g) {
|
|
15
|
-
let n =
|
|
16
|
-
const
|
|
17
|
-
return n =
|
|
15
|
+
let n = ie(g);
|
|
16
|
+
const m = be[a];
|
|
17
|
+
return n = m ? m({ getSchemaByType: Te }, n, e, v) : n, n;
|
|
18
18
|
}
|
|
19
19
|
return null;
|
|
20
20
|
}
|
|
21
|
-
function Se(a, e) {
|
|
22
|
-
const v = fe(e);
|
|
23
|
-
return Object.keys(a).reduce((g, n) => (g[n] && typeof g[n] == "object" ? Object.assign(g[n], a[n]) : g[n] = a[n], g), v), v;
|
|
24
|
-
}
|
|
25
21
|
function Oe(a, e) {
|
|
22
|
+
const v = ie(e);
|
|
23
|
+
return Object.keys(a).reduce((g, n) => (g[n] && me(g[n]) && me(a[n]) ? Object.assign(g[n], a[n]) : g[n] = a[n], g), v), v;
|
|
24
|
+
}
|
|
25
|
+
function je(a, e) {
|
|
26
26
|
return Object.keys(a).filter((g) => a[g] != null).reduce((g, n) => {
|
|
27
27
|
if (e.has(n)) {
|
|
28
|
-
const
|
|
29
|
-
if (typeof
|
|
30
|
-
g[
|
|
28
|
+
const m = e.get(n);
|
|
29
|
+
if (typeof m == "string")
|
|
30
|
+
g[m] = a[n];
|
|
31
31
|
else {
|
|
32
|
-
const y =
|
|
32
|
+
const y = m(n, a[n], a);
|
|
33
33
|
Object.assign(g, y);
|
|
34
34
|
}
|
|
35
35
|
} else
|
|
@@ -37,22 +37,22 @@ function Oe(a, e) {
|
|
|
37
37
|
return g;
|
|
38
38
|
}, {});
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
const g =
|
|
42
|
-
return
|
|
40
|
+
function Me(a, e, v = /* @__PURE__ */ new Map()) {
|
|
41
|
+
const g = Oe(a, e);
|
|
42
|
+
return je(g, v);
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function Ee(a = {}) {
|
|
45
45
|
function e(c, p, d, f) {
|
|
46
46
|
if (typeof d == "number")
|
|
47
47
|
return f[c].length === d;
|
|
48
48
|
if (typeof d == "object") {
|
|
49
|
-
const k = Object.keys(d)[0],
|
|
49
|
+
const k = Object.keys(d)[0], B = d[k];
|
|
50
50
|
if (k === "not")
|
|
51
|
-
return Number(f[c].length) !== Number(
|
|
51
|
+
return Number(f[c].length) !== Number(B);
|
|
52
52
|
if (k === "moreThan")
|
|
53
|
-
return Number(f[c].length) >= Number(
|
|
53
|
+
return Number(f[c].length) >= Number(B);
|
|
54
54
|
if (k === "lessThan")
|
|
55
|
-
return Number(f[c].length) <= Number(
|
|
55
|
+
return Number(f[c].length) <= Number(B);
|
|
56
56
|
}
|
|
57
57
|
return !1;
|
|
58
58
|
}
|
|
@@ -69,11 +69,11 @@ function Me(a = {}) {
|
|
|
69
69
|
return typeof p == "number" ? [{ target: d, operator: "length", param: null, value: Number(p) }] : typeof p == "boolean" ? [{ target: d, operator: "getProperty", param: c, value: !!p }] : typeof p == "object" ? Object.keys(p).map((f) => {
|
|
70
70
|
if (f === "length")
|
|
71
71
|
return { target: d, operator: "length", param: null, value: p[f] };
|
|
72
|
-
const k = f,
|
|
73
|
-
return { target: d, operator: "getProperty", param: k, value:
|
|
72
|
+
const k = f, B = p[f];
|
|
73
|
+
return { target: d, operator: "getProperty", param: k, value: B };
|
|
74
74
|
}) : [];
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function m(c) {
|
|
77
77
|
return Object.keys(c).reduce((d, f) => {
|
|
78
78
|
const k = n(f, c[f]);
|
|
79
79
|
return d.push(...k), d;
|
|
@@ -86,29 +86,29 @@ function Me(a = {}) {
|
|
|
86
86
|
}
|
|
87
87
|
return !1;
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
return
|
|
89
|
+
function D(c, p) {
|
|
90
|
+
return m(c).reduce((k, B) => k && y(B, p), !0);
|
|
91
91
|
}
|
|
92
92
|
function C(c, p) {
|
|
93
|
-
const d = Object.keys(c), f = d.includes("allOf"), k = d.includes("anyOf"),
|
|
93
|
+
const d = Object.keys(c), f = d.includes("allOf"), k = d.includes("anyOf"), B = f || k, b = (B ? c[B ? f ? "allOf" : "anyOf" : "allOf"] : [c]).map((N) => D(N, p));
|
|
94
94
|
return f ? !b.includes(!1) : b.includes(!0);
|
|
95
95
|
}
|
|
96
96
|
return { parseValueSchema: C };
|
|
97
97
|
}
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
function Ie(a, e, v = /* @__PURE__ */ new Map(), g = (y,
|
|
101
|
-
return ye[e.title] = e, be[e.title] = g,
|
|
102
|
-
const
|
|
103
|
-
return Object.assign(C,
|
|
98
|
+
const Pe = {}, Re = {};
|
|
99
|
+
Ee();
|
|
100
|
+
function Ie(a, e, v = /* @__PURE__ */ new Map(), g = (y, D, C) => D, n = {}, m = (y) => y) {
|
|
101
|
+
return ye[e.title] = e, be[e.title] = g, Pe[e.title] = n, Re[e.title] = m, (y = {}) => {
|
|
102
|
+
const D = Me(y, e, v), C = Object.keys(a).reduce((c, p) => (c[p] = a[p].default, c), {});
|
|
103
|
+
return Object.assign(C, D);
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
function Le(a, e) {
|
|
107
107
|
return { customClass: e.class, customStyle: e.style };
|
|
108
108
|
}
|
|
109
|
-
const
|
|
109
|
+
const Ne = /* @__PURE__ */ new Map([
|
|
110
110
|
["appearance", Le]
|
|
111
|
-
]),
|
|
111
|
+
]), $e = "tags", Ve = "A Farris Component", Fe = "object", We = {
|
|
112
112
|
basic: {
|
|
113
113
|
description: "Basic Infomation",
|
|
114
114
|
title: "基本信息",
|
|
@@ -130,12 +130,12 @@ const Re = /* @__PURE__ */ new Map([
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
},
|
|
134
|
-
title:
|
|
135
|
-
description:
|
|
136
|
-
type:
|
|
137
|
-
categories:
|
|
138
|
-
},
|
|
133
|
+
}, qe = {
|
|
134
|
+
title: $e,
|
|
135
|
+
description: Ve,
|
|
136
|
+
type: Fe,
|
|
137
|
+
categories: We
|
|
138
|
+
}, He = "https://json-schema.org/draft/2020-12/schema", xe = "https://farris-design.gitee.io/tags.schema.json", Xe = "tags", _e = "A Farris Component", ze = "object", Ge = {
|
|
139
139
|
id: {
|
|
140
140
|
description: "The unique identifier for tags",
|
|
141
141
|
type: "string"
|
|
@@ -197,18 +197,18 @@ const Re = /* @__PURE__ */ new Map([
|
|
|
197
197
|
type: "boolean",
|
|
198
198
|
default: !0
|
|
199
199
|
}
|
|
200
|
-
},
|
|
200
|
+
}, Je = [
|
|
201
201
|
"id",
|
|
202
202
|
"type"
|
|
203
|
-
],
|
|
204
|
-
$schema:
|
|
205
|
-
$id:
|
|
206
|
-
title:
|
|
203
|
+
], Qe = {
|
|
204
|
+
$schema: He,
|
|
205
|
+
$id: xe,
|
|
206
|
+
title: Xe,
|
|
207
207
|
description: _e,
|
|
208
|
-
type:
|
|
209
|
-
properties:
|
|
210
|
-
required:
|
|
211
|
-
},
|
|
208
|
+
type: ze,
|
|
209
|
+
properties: Ge,
|
|
210
|
+
required: Je
|
|
211
|
+
}, fe = {
|
|
212
212
|
activeTag: { type: String, default: "" },
|
|
213
213
|
addButtonText: { type: String, default: "" },
|
|
214
214
|
customClass: { type: String, default: "" },
|
|
@@ -224,15 +224,15 @@ const Re = /* @__PURE__ */ new Map([
|
|
|
224
224
|
wrapText: { type: Boolean, default: !1 },
|
|
225
225
|
draggable: { type: Boolean, default: !1 },
|
|
226
226
|
disable: { type: Boolean, default: !1 }
|
|
227
|
-
},
|
|
228
|
-
function
|
|
229
|
-
const n = i(-1),
|
|
227
|
+
}, ke = Ie(fe, Qe, Ne, Se, qe);
|
|
228
|
+
function we(a, e, v, g) {
|
|
229
|
+
const n = i(-1), m = i(!1);
|
|
230
230
|
function y(p, d, f) {
|
|
231
231
|
p.stopPropagation(), d && setTimeout(() => {
|
|
232
|
-
n.value = f,
|
|
232
|
+
n.value = f, m.value = !0, d.moving = !0;
|
|
233
233
|
});
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function D(p, d) {
|
|
236
236
|
if (p.preventDefault(), n.value !== d) {
|
|
237
237
|
const f = g.value[n.value], k = g.value;
|
|
238
238
|
k.splice(n.value, 1), k.splice(d, 0, f), n.value = d;
|
|
@@ -242,99 +242,99 @@ function ke(a, e, v, g) {
|
|
|
242
242
|
p.preventDefault(), p.dataTransfer && (p.dataTransfer.dropEffect = "move");
|
|
243
243
|
}
|
|
244
244
|
function c(p, d) {
|
|
245
|
-
d && (d.moving = !1), v.value = g.value.filter((f) => f.type === "Tag").map((f) => f.payload),
|
|
245
|
+
d && (d.moving = !1), v.value = g.value.filter((f) => f.type === "Tag").map((f) => f.payload), m.value = !1, e.emit("change", v.value);
|
|
246
246
|
}
|
|
247
247
|
return {
|
|
248
248
|
dragstart: y,
|
|
249
|
-
dragenter:
|
|
249
|
+
dragenter: D,
|
|
250
250
|
dragover: C,
|
|
251
251
|
dragend: c,
|
|
252
|
-
isDragging:
|
|
252
|
+
isDragging: m
|
|
253
253
|
};
|
|
254
254
|
}
|
|
255
|
-
const
|
|
255
|
+
const _ = /* @__PURE__ */ he({
|
|
256
256
|
name: "FTags",
|
|
257
|
-
props:
|
|
257
|
+
props: fe,
|
|
258
258
|
emits: ["remove", "selectionChange", "change"],
|
|
259
259
|
setup(a, e) {
|
|
260
|
-
const v = i(a.selectable), g = i(a.customClass), n = i(a.data),
|
|
260
|
+
const v = i(a.selectable), g = i(a.customClass), n = i(a.data), m = i(a.tagType), y = i(a.tagStyle), D = i(a.showColor), C = i(a.customStyle), c = i(a.activeTag), p = i(a.showClose), d = i(a.addButtonText), f = i(), k = i(a.wrapText), B = i();
|
|
261
261
|
i(a.disable);
|
|
262
|
-
const
|
|
263
|
-
function
|
|
264
|
-
const
|
|
262
|
+
const A = i(!1);
|
|
263
|
+
function E() {
|
|
264
|
+
const s = n.value.map((l) => ({
|
|
265
265
|
type: "Tag",
|
|
266
|
-
payload:
|
|
266
|
+
payload: l
|
|
267
267
|
}));
|
|
268
|
-
return a.showAddButton &&
|
|
268
|
+
return a.showAddButton && s.push({
|
|
269
269
|
type: "AddButton"
|
|
270
|
-
}),
|
|
271
|
-
}
|
|
272
|
-
const b = i(
|
|
273
|
-
function
|
|
274
|
-
n.value =
|
|
275
|
-
}
|
|
276
|
-
const
|
|
277
|
-
dragstart:
|
|
278
|
-
dragenter:
|
|
279
|
-
dragover:
|
|
280
|
-
dragend:
|
|
281
|
-
} =
|
|
282
|
-
|
|
283
|
-
b.value =
|
|
284
|
-
}),
|
|
285
|
-
b.value =
|
|
286
|
-
}),
|
|
287
|
-
c.value =
|
|
288
|
-
}),
|
|
289
|
-
const
|
|
290
|
-
|
|
270
|
+
}), s;
|
|
271
|
+
}
|
|
272
|
+
const b = i(E());
|
|
273
|
+
function L(s) {
|
|
274
|
+
n.value = s, b.value = E();
|
|
275
|
+
}
|
|
276
|
+
const N = R(() => b.value.findIndex((s) => s.type === "Input")), $ = we(a, e, n, b), {
|
|
277
|
+
dragstart: h,
|
|
278
|
+
dragenter: w,
|
|
279
|
+
dragover: j,
|
|
280
|
+
dragend: P
|
|
281
|
+
} = $;
|
|
282
|
+
F(() => a.data, (s) => L(s)), F(() => a.showAddButton, () => {
|
|
283
|
+
b.value = E();
|
|
284
|
+
}), F(() => a.disable, (s) => {
|
|
285
|
+
b.value = E();
|
|
286
|
+
}), F(() => a.activeTag, (s) => {
|
|
287
|
+
c.value = s;
|
|
288
|
+
}), F(A, (s) => {
|
|
289
|
+
const l = [...b.value];
|
|
290
|
+
s ? l.length > 0 && l[l.length - 1].type !== "Input" && (l.splice(l.length - 1, 1), l.splice(l.length, 0, {
|
|
291
291
|
type: "Input"
|
|
292
|
-
}), b.value =
|
|
292
|
+
}), b.value = l, ue(() => {
|
|
293
293
|
var u;
|
|
294
|
-
|
|
295
|
-
})) :
|
|
294
|
+
B.value && ((u = B.value) == null || u.focus());
|
|
295
|
+
})) : l.length > 0 && l[l.length - 1].type !== "AddButton" && (l.splice(l.length - 1, 1), l.splice(l.length, 0, {
|
|
296
296
|
type: "AddButton"
|
|
297
|
-
}), b.value =
|
|
297
|
+
}), b.value = l);
|
|
298
298
|
});
|
|
299
|
-
const
|
|
300
|
-
const
|
|
299
|
+
const W = R(() => {
|
|
300
|
+
const s = {
|
|
301
301
|
"farris-tags": !0,
|
|
302
302
|
"farris-tags-checkable": v.value,
|
|
303
303
|
"farris-tags-nowrap": !k.value
|
|
304
304
|
};
|
|
305
|
-
return g.value.split(" ").reduce((
|
|
305
|
+
return g.value.split(" ").reduce((l, u) => (l[u] = !0, l), s), s;
|
|
306
306
|
});
|
|
307
|
-
function
|
|
308
|
-
const
|
|
307
|
+
function z(s) {
|
|
308
|
+
const l = {
|
|
309
309
|
"farris-tag-item": !0,
|
|
310
|
-
"farris-tag-item-checked": v.value &&
|
|
310
|
+
"farris-tag-item-checked": v.value && s.checked,
|
|
311
311
|
"farris-tag-item-checkable": v.value,
|
|
312
|
-
"farris-tag-item-has-color":
|
|
313
|
-
"farris-tag-item-actived": c.value ===
|
|
312
|
+
"farris-tag-item-has-color": D.value,
|
|
313
|
+
"farris-tag-item-actived": c.value === s.name
|
|
314
314
|
};
|
|
315
|
-
if (
|
|
316
|
-
const u = `farris-tag-item-${
|
|
317
|
-
|
|
315
|
+
if (m.value) {
|
|
316
|
+
const u = `farris-tag-item-${m.value}`;
|
|
317
|
+
l[u] = !0;
|
|
318
318
|
}
|
|
319
|
-
return
|
|
320
|
-
}
|
|
321
|
-
const
|
|
322
|
-
const
|
|
323
|
-
return C.value && C.value.split(";").reduce((
|
|
324
|
-
const
|
|
325
|
-
return
|
|
326
|
-
},
|
|
319
|
+
return l;
|
|
320
|
+
}
|
|
321
|
+
const G = R(() => {
|
|
322
|
+
const s = {};
|
|
323
|
+
return C.value && C.value.split(";").reduce((l, u) => {
|
|
324
|
+
const O = u.split(":");
|
|
325
|
+
return l[O[0]] = O[1], l;
|
|
326
|
+
}, s), s;
|
|
327
327
|
});
|
|
328
|
-
function
|
|
329
|
-
!a.disable && v.value && (!
|
|
330
|
-
u.checked = !
|
|
331
|
-
}), e.emit("change", n.value), e.emit("selectionChange",
|
|
328
|
+
function J(s, l) {
|
|
329
|
+
!a.disable && v.value && (!l.hasOwnProperty("selectable") || l.selectable) && (l.checked = !l.checked, c.value = l.checked ? l.name : "", l.checked && n.value.filter((u) => u.name !== l.name).forEach((u) => {
|
|
330
|
+
u.checked = !l.checked;
|
|
331
|
+
}), e.emit("change", n.value), e.emit("selectionChange", l));
|
|
332
332
|
}
|
|
333
|
-
function Q(
|
|
333
|
+
function Q(s, l) {
|
|
334
334
|
let u;
|
|
335
|
-
switch (
|
|
335
|
+
switch (s.key) {
|
|
336
336
|
case "Backspace":
|
|
337
|
-
n.value = n.value.filter((
|
|
337
|
+
n.value = n.value.filter((O) => O.name !== l.name), e.emit("change", n.value);
|
|
338
338
|
break;
|
|
339
339
|
case "ArrowLeft":
|
|
340
340
|
u = Math.max(f.value.scrollLeft + 20, 0), f.value.scrollLeft = u;
|
|
@@ -343,96 +343,96 @@ const G = /* @__PURE__ */ he({
|
|
|
343
343
|
u = Math.max(f.value.scrollLeft - 20, 0), f.value.scrollLeft = u;
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
|
-
function U(
|
|
347
|
-
const u = n.value.findIndex((
|
|
346
|
+
function U(s, l) {
|
|
347
|
+
const u = n.value.findIndex((O) => O.name === l.name);
|
|
348
348
|
if (u > -1) {
|
|
349
|
-
const [
|
|
350
|
-
b.value =
|
|
349
|
+
const [O] = n.value.splice(u, 1);
|
|
350
|
+
b.value = E(), e.emit("change", n.value), e.emit("remove", {
|
|
351
351
|
tags: n.value,
|
|
352
|
-
remove:
|
|
352
|
+
remove: O
|
|
353
353
|
});
|
|
354
354
|
}
|
|
355
|
-
|
|
355
|
+
s.stopPropagation();
|
|
356
356
|
}
|
|
357
|
-
const Y =
|
|
357
|
+
const Y = R(() => ({
|
|
358
358
|
"farris-tag-item": !0,
|
|
359
359
|
"farris-tag-add-button": !0,
|
|
360
360
|
"farris-tag-add-button-disabled": !a.enableAddButton
|
|
361
361
|
}));
|
|
362
|
-
function Z(
|
|
363
|
-
|
|
362
|
+
function Z(s) {
|
|
363
|
+
s.stopPropagation(), A.value = !0;
|
|
364
364
|
}
|
|
365
365
|
function K() {
|
|
366
366
|
return !a.disable && T("li", {
|
|
367
367
|
class: Y.value,
|
|
368
|
-
onClick: (
|
|
368
|
+
onClick: (s) => Z(s)
|
|
369
369
|
}, [T("span", {
|
|
370
370
|
class: "f-icon f-icon-amplification"
|
|
371
371
|
}, null), d.value && T("span", {
|
|
372
372
|
class: "farris-tag-add-text"
|
|
373
373
|
}, [d.value])]);
|
|
374
374
|
}
|
|
375
|
-
function
|
|
376
|
-
|
|
377
|
-
name:
|
|
375
|
+
function q(s, l, u) {
|
|
376
|
+
s > -1 && (n.value.splice(s, 0, {
|
|
377
|
+
name: l,
|
|
378
378
|
value: u,
|
|
379
379
|
selectable: v.value
|
|
380
|
-
}), b.value =
|
|
380
|
+
}), b.value = E(), A.value = !1, e.emit("change", n.value));
|
|
381
381
|
}
|
|
382
|
-
function
|
|
383
|
-
if (
|
|
384
|
-
const
|
|
385
|
-
|
|
382
|
+
function H(s) {
|
|
383
|
+
if (s && s.value) {
|
|
384
|
+
const l = s.value, u = N.value;
|
|
385
|
+
q(u, l, l), s.innerText = "";
|
|
386
386
|
} else
|
|
387
|
-
|
|
387
|
+
A.value = !1;
|
|
388
388
|
}
|
|
389
|
-
function ee(
|
|
390
|
-
const
|
|
391
|
-
|
|
389
|
+
function ee(s) {
|
|
390
|
+
const l = s.target;
|
|
391
|
+
l && l.value ? H(l) : A.value = !1;
|
|
392
392
|
}
|
|
393
|
-
function
|
|
394
|
-
|
|
393
|
+
function de(s) {
|
|
394
|
+
s.key === "Enter" && H(s.target);
|
|
395
395
|
}
|
|
396
396
|
function te() {
|
|
397
397
|
return !a.disable && T("li", {
|
|
398
398
|
class: "farris-tag-input-box"
|
|
399
399
|
}, [T("input", {
|
|
400
400
|
title: "farris-tag-input-box",
|
|
401
|
-
ref:
|
|
401
|
+
ref: B,
|
|
402
402
|
class: "form-control",
|
|
403
|
-
onKeyup:
|
|
403
|
+
onKeyup: de,
|
|
404
404
|
onBlur: ee
|
|
405
405
|
}, null)]);
|
|
406
406
|
}
|
|
407
|
-
function ae(
|
|
407
|
+
function ae(s, l) {
|
|
408
408
|
return T("li", {
|
|
409
|
-
class:
|
|
410
|
-
style:
|
|
409
|
+
class: z(s),
|
|
410
|
+
style: G.value,
|
|
411
411
|
tabindex: 0,
|
|
412
|
-
id:
|
|
413
|
-
key:
|
|
414
|
-
onClick: (u) =>
|
|
415
|
-
onKeydown: (u) => Q(u,
|
|
412
|
+
id: s.name,
|
|
413
|
+
key: s.name,
|
|
414
|
+
onClick: (u) => J(u, s),
|
|
415
|
+
onKeydown: (u) => Q(u, s),
|
|
416
416
|
draggable: "true",
|
|
417
|
-
onDragstart: (u) =>
|
|
418
|
-
onDragenter: (u) =>
|
|
419
|
-
onDragend: (u) =>
|
|
420
|
-
onDragover: (u) =>
|
|
417
|
+
onDragstart: (u) => h(u, s, l),
|
|
418
|
+
onDragenter: (u) => w(u, l),
|
|
419
|
+
onDragend: (u) => P(u, s),
|
|
420
|
+
onDragover: (u) => j(u, l)
|
|
421
421
|
}, [T("span", {
|
|
422
|
-
title:
|
|
422
|
+
title: s.name,
|
|
423
423
|
class: "tag-box"
|
|
424
|
-
}, [
|
|
424
|
+
}, [s.name]), !a.disable && p.value && T("span", {
|
|
425
425
|
class: "tag-delete"
|
|
426
426
|
}, [T("i", {
|
|
427
427
|
class: "f-icon f-icon-close",
|
|
428
|
-
onClick: (u) => U(u,
|
|
428
|
+
onClick: (u) => U(u, s)
|
|
429
429
|
}, null)])]);
|
|
430
430
|
}
|
|
431
|
-
function
|
|
432
|
-
return b.value.map((
|
|
433
|
-
switch (
|
|
431
|
+
function x() {
|
|
432
|
+
return b.value.map((s, l) => {
|
|
433
|
+
switch (s.type) {
|
|
434
434
|
case "Tag":
|
|
435
|
-
return ae(
|
|
435
|
+
return ae(s.payload, l);
|
|
436
436
|
case "AddButton":
|
|
437
437
|
return K();
|
|
438
438
|
case "Input":
|
|
@@ -440,43 +440,43 @@ const G = /* @__PURE__ */ he({
|
|
|
440
440
|
}
|
|
441
441
|
});
|
|
442
442
|
}
|
|
443
|
-
const
|
|
443
|
+
const X = R(() => ({
|
|
444
444
|
"farris-tags-item-container": !0,
|
|
445
445
|
"farris-tag-item-capsule": y.value === "capsule"
|
|
446
446
|
}));
|
|
447
|
-
function ne(
|
|
448
|
-
const
|
|
449
|
-
f.value.scrollLeft =
|
|
447
|
+
function ne(s) {
|
|
448
|
+
const l = Math.max(f.value.scrollLeft - s.deltaX, 0);
|
|
449
|
+
f.value.scrollLeft = l;
|
|
450
450
|
}
|
|
451
|
-
function
|
|
451
|
+
function se(s) {
|
|
452
452
|
var u;
|
|
453
|
-
|
|
454
|
-
const
|
|
455
|
-
if (
|
|
456
|
-
const
|
|
457
|
-
[...n.value].findIndex((t) => (console.log(`${t.value} === ${
|
|
453
|
+
s.preventDefault(), s.stopPropagation();
|
|
454
|
+
const l = (u = s.dataTransfer) == null ? void 0 : u.getData("Text");
|
|
455
|
+
if (l) {
|
|
456
|
+
const O = l.split(":"), re = O[0], V = O[1];
|
|
457
|
+
[...n.value].findIndex((t) => (console.log(`${t.value} === ${V} is ${t.value === V}`), t.value === V)) > -1 || q(n.value.length, re, V);
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
|
-
function
|
|
461
|
-
|
|
460
|
+
function le(s) {
|
|
461
|
+
s.preventDefault();
|
|
462
462
|
}
|
|
463
463
|
return () => T("div", {
|
|
464
|
-
class:
|
|
465
|
-
onDrop:
|
|
466
|
-
onDragover:
|
|
464
|
+
class: W.value,
|
|
465
|
+
onDrop: se,
|
|
466
|
+
onDragover: le
|
|
467
467
|
}, [T("ul", {
|
|
468
468
|
ref: f,
|
|
469
|
-
class:
|
|
470
|
-
onWheel: (
|
|
471
|
-
}, [
|
|
469
|
+
class: X.value,
|
|
470
|
+
onWheel: (s) => ne(s)
|
|
471
|
+
}, [x()])]);
|
|
472
472
|
}
|
|
473
473
|
});
|
|
474
|
-
function
|
|
475
|
-
var
|
|
474
|
+
function Ue(a, e, v) {
|
|
475
|
+
var $;
|
|
476
476
|
function g() {
|
|
477
477
|
}
|
|
478
|
-
const n = "",
|
|
479
|
-
function
|
|
478
|
+
const n = "", m = "", y = i();
|
|
479
|
+
function D() {
|
|
480
480
|
return (e == null ? void 0 : e.schema.componentType) !== "frame";
|
|
481
481
|
}
|
|
482
482
|
function C() {
|
|
@@ -488,163 +488,155 @@ function Qe(a, e, v) {
|
|
|
488
488
|
function p() {
|
|
489
489
|
return (e == null ? void 0 : e.schema.componentType) === "frame";
|
|
490
490
|
}
|
|
491
|
-
function d(
|
|
492
|
-
if (!
|
|
491
|
+
function d(h) {
|
|
492
|
+
if (!h || !h.value)
|
|
493
493
|
return null;
|
|
494
|
-
if (
|
|
495
|
-
return
|
|
496
|
-
const
|
|
497
|
-
return
|
|
494
|
+
if (h.value.schema && h.value.schema.type === "component")
|
|
495
|
+
return h.value;
|
|
496
|
+
const w = i(h == null ? void 0 : h.value.parent), j = d(w);
|
|
497
|
+
return j || null;
|
|
498
498
|
}
|
|
499
|
-
function f(
|
|
500
|
-
const { componentInstance:
|
|
501
|
-
return !
|
|
499
|
+
function f(h = e) {
|
|
500
|
+
const { componentInstance: w, designerItemElementRef: j } = h;
|
|
501
|
+
return !w || !w.value ? null : w.value.canMove ? j : f(h.parent);
|
|
502
502
|
}
|
|
503
|
-
function k(
|
|
503
|
+
function k(h) {
|
|
504
504
|
return !!v;
|
|
505
505
|
}
|
|
506
|
-
function D() {
|
|
507
|
-
return (e == null ? void 0 : e.schema.label) || (e == null ? void 0 : e.schema.title) || (e == null ? void 0 : e.schema.name);
|
|
508
|
-
}
|
|
509
506
|
function B() {
|
|
507
|
+
return (e == null ? void 0 : e.schema.label) || (e == null ? void 0 : e.schema.title) || (e == null ? void 0 : e.schema.name);
|
|
510
508
|
}
|
|
511
|
-
function
|
|
509
|
+
function A() {
|
|
512
510
|
}
|
|
513
|
-
function
|
|
514
|
-
const { componentType: A } = m;
|
|
515
|
-
let M = ie(A, m, O);
|
|
516
|
-
const V = A.toLowerCase().replace("-", "_");
|
|
517
|
-
return M && !M.id && M.type === A && (M.id = `${V}_${Math.random().toString().slice(2, 6)}`), M;
|
|
511
|
+
function E(h, w) {
|
|
518
512
|
}
|
|
519
|
-
function
|
|
520
|
-
const
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
return R && !R.id && R.type === A && (R.id = `${H}_${Math.random().toString().slice(2, 6)}`), R;
|
|
513
|
+
function b(h, w) {
|
|
514
|
+
const { componentType: j } = h;
|
|
515
|
+
let P = Te(j, h, w);
|
|
516
|
+
const W = j.toLowerCase().replace("-", "_");
|
|
517
|
+
return P && !P.id && P.type === j && (P.id = `${W}_${Math.random().toString().slice(2, 6)}`), P;
|
|
525
518
|
}
|
|
526
|
-
function
|
|
519
|
+
function L(h) {
|
|
527
520
|
}
|
|
528
|
-
function
|
|
521
|
+
function N(...h) {
|
|
529
522
|
}
|
|
530
523
|
return y.value = {
|
|
531
|
-
canMove:
|
|
524
|
+
canMove: D(),
|
|
532
525
|
canSelectParent: C(),
|
|
533
526
|
canDelete: c(),
|
|
534
527
|
canNested: !p(),
|
|
535
528
|
contents: e == null ? void 0 : e.schema.contents,
|
|
536
529
|
elementRef: a,
|
|
537
|
-
parent: (
|
|
530
|
+
parent: ($ = e == null ? void 0 : e.parent) == null ? void 0 : $.componentInstance,
|
|
538
531
|
schema: e == null ? void 0 : e.schema,
|
|
539
532
|
styles: n,
|
|
540
|
-
designerClass:
|
|
533
|
+
designerClass: m,
|
|
541
534
|
canAccepts: k,
|
|
542
535
|
getBelongedComponentInstance: d,
|
|
543
536
|
getDraggableDesignItemElement: f,
|
|
544
|
-
getDraggingDisplayText:
|
|
545
|
-
getPropConfig:
|
|
546
|
-
getDragScopeElement:
|
|
547
|
-
onAcceptMovedChildElement:
|
|
548
|
-
|
|
549
|
-
onChildElementMovedOut: F,
|
|
537
|
+
getDraggingDisplayText: B,
|
|
538
|
+
getPropConfig: N,
|
|
539
|
+
getDragScopeElement: A,
|
|
540
|
+
onAcceptMovedChildElement: E,
|
|
541
|
+
onChildElementMovedOut: L,
|
|
550
542
|
addNewChildComponentSchema: b,
|
|
551
543
|
updateDragAndDropRules: g,
|
|
552
544
|
triggerBelongedComponentToMoveWhenMoved: i(!1),
|
|
553
545
|
triggerBelongedComponentToDeleteWhenDeleted: i(!1)
|
|
554
546
|
}, y;
|
|
555
547
|
}
|
|
556
|
-
const
|
|
548
|
+
const Ye = /* @__PURE__ */ he({
|
|
557
549
|
name: "FTagsDesign",
|
|
558
|
-
props:
|
|
550
|
+
props: fe,
|
|
559
551
|
emits: ["remove", "selectionChange", "change"],
|
|
560
552
|
setup(a, e) {
|
|
561
|
-
const v = i(a.selectable), g = i(a.customClass), n = i(a.data),
|
|
553
|
+
const v = i(a.selectable), g = i(a.customClass), n = i(a.data), m = i(a.tagType), y = i(a.tagStyle), D = i(a.showColor), C = i(a.activeTag), c = i(a.customStyle), p = i(a.showClose), d = i(a.showAddButton), f = i(a.showInput), k = i(a.addButtonText), B = i(a.enableAddButton);
|
|
562
554
|
i(a.placeholder), i(""), i();
|
|
563
|
-
const
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
}), e.expose(
|
|
567
|
-
function
|
|
568
|
-
const t = n.value.map((
|
|
555
|
+
const A = i(), E = i(a.wrapText), b = i(), L = i(), N = Be("design-item-context"), $ = Ue(L, N);
|
|
556
|
+
Ae(() => {
|
|
557
|
+
L.value.componentInstance = $;
|
|
558
|
+
}), e.expose($.value);
|
|
559
|
+
function h() {
|
|
560
|
+
const t = n.value.map((r) => ({
|
|
569
561
|
type: "Tag",
|
|
570
|
-
payload:
|
|
562
|
+
payload: r
|
|
571
563
|
}));
|
|
572
564
|
return d.value && t.push({
|
|
573
565
|
type: "AddButton"
|
|
574
566
|
}), t;
|
|
575
567
|
}
|
|
576
|
-
const
|
|
577
|
-
function
|
|
578
|
-
n.value = t,
|
|
568
|
+
const w = i(h());
|
|
569
|
+
function j(t) {
|
|
570
|
+
n.value = t, w.value = h();
|
|
579
571
|
}
|
|
580
|
-
const
|
|
581
|
-
dragstart:
|
|
582
|
-
dragenter:
|
|
583
|
-
dragover:
|
|
572
|
+
const P = R(() => w.value.findIndex((t) => t.type === "Input")), W = we(a, e, n, w), {
|
|
573
|
+
dragstart: z,
|
|
574
|
+
dragenter: G,
|
|
575
|
+
dragover: J,
|
|
584
576
|
dragend: Q
|
|
585
|
-
} =
|
|
586
|
-
|
|
587
|
-
const U =
|
|
577
|
+
} = W;
|
|
578
|
+
F(() => a.data, (t) => j(t));
|
|
579
|
+
const U = R(() => {
|
|
588
580
|
const t = {
|
|
589
581
|
"farris-tags": !0,
|
|
590
582
|
"farris-tags-checkable": v.value,
|
|
591
|
-
"farris-tags-nowrap": !
|
|
583
|
+
"farris-tags-nowrap": !E.value
|
|
592
584
|
};
|
|
593
|
-
return g.value.split(" ").reduce((
|
|
585
|
+
return g.value.split(" ").reduce((r, o) => (r[o] = !0, r), t), t;
|
|
594
586
|
});
|
|
595
587
|
function Y(t) {
|
|
596
|
-
const
|
|
588
|
+
const r = {
|
|
597
589
|
"farris-tag-item": !0,
|
|
598
590
|
"farris-tag-item-checked": v.value && t.checked,
|
|
599
591
|
"farris-tag-item-checkable": v.value,
|
|
600
|
-
"farris-tag-item-has-color":
|
|
592
|
+
"farris-tag-item-has-color": D.value,
|
|
601
593
|
"farris-tag-item-actived": C.value === t.name
|
|
602
594
|
};
|
|
603
|
-
if (
|
|
604
|
-
const o = `farris-tag-item-${
|
|
605
|
-
|
|
595
|
+
if (m.value) {
|
|
596
|
+
const o = `farris-tag-item-${m.value}`;
|
|
597
|
+
r[o] = !0;
|
|
606
598
|
}
|
|
607
|
-
return
|
|
599
|
+
return r;
|
|
608
600
|
}
|
|
609
|
-
const Z =
|
|
601
|
+
const Z = R(() => {
|
|
610
602
|
const t = {};
|
|
611
|
-
return c.value && c.value.split(";").reduce((
|
|
603
|
+
return c.value && c.value.split(";").reduce((r, o) => {
|
|
612
604
|
const S = o.split(":");
|
|
613
|
-
return
|
|
605
|
+
return r[S[0]] = S[1], r;
|
|
614
606
|
}, t), t;
|
|
615
607
|
});
|
|
616
|
-
function K(t,
|
|
617
|
-
v.value &&
|
|
618
|
-
o.checked = !
|
|
619
|
-
}), e.emit("change", n.value), e.emit("selectionChange",
|
|
608
|
+
function K(t, r) {
|
|
609
|
+
v.value && r.selectable && (r.checked = !r.checked, C.value = r.checked ? r.name : "", r.checked && n.value.filter((o) => o.name !== r.name).forEach((o) => {
|
|
610
|
+
o.checked = !r.checked;
|
|
611
|
+
}), e.emit("change", n.value), e.emit("selectionChange", r));
|
|
620
612
|
}
|
|
621
|
-
function
|
|
613
|
+
function q(t, r) {
|
|
622
614
|
let o;
|
|
623
615
|
switch (t.key) {
|
|
624
616
|
case "Backspace":
|
|
625
|
-
n.value = n.value.filter((S) => S.name !==
|
|
617
|
+
n.value = n.value.filter((S) => S.name !== r.name), e.emit("change", n.value);
|
|
626
618
|
break;
|
|
627
619
|
case "ArrowLeft":
|
|
628
|
-
o = Math.max(
|
|
620
|
+
o = Math.max(A.value.scrollLeft + 20, 0), A.value.scrollLeft = o;
|
|
629
621
|
break;
|
|
630
622
|
case "ArrowRight":
|
|
631
|
-
o = Math.max(
|
|
623
|
+
o = Math.max(A.value.scrollLeft - 20, 0), A.value.scrollLeft = o;
|
|
632
624
|
}
|
|
633
625
|
}
|
|
634
|
-
function
|
|
635
|
-
const o = n.value.findIndex((S) => S.name ===
|
|
626
|
+
function H(t, r) {
|
|
627
|
+
const o = n.value.findIndex((S) => S.name === r.name);
|
|
636
628
|
if (o > -1) {
|
|
637
629
|
const [S] = n.value.splice(o, 1);
|
|
638
|
-
|
|
630
|
+
w.value = h(), e.emit("change", n.value), e.emit("remove", n.value, S, o);
|
|
639
631
|
}
|
|
640
632
|
t.stopPropagation();
|
|
641
633
|
}
|
|
642
|
-
const ee =
|
|
634
|
+
const ee = R(() => ({
|
|
643
635
|
"farris-tag-item": !0,
|
|
644
636
|
"farris-tag-add-button": !0,
|
|
645
|
-
"farris-tag-add-button-disabled": !
|
|
637
|
+
"farris-tag-add-button-disabled": !B.value
|
|
646
638
|
}));
|
|
647
|
-
function
|
|
639
|
+
function de(t) {
|
|
648
640
|
}
|
|
649
641
|
function te() {
|
|
650
642
|
return T("li", {
|
|
@@ -658,48 +650,48 @@ const Ue = /* @__PURE__ */ he({
|
|
|
658
650
|
}
|
|
659
651
|
function ae(t) {
|
|
660
652
|
if (t && !t.innerText) {
|
|
661
|
-
const
|
|
662
|
-
if (
|
|
663
|
-
const [o] = n.value.splice(
|
|
664
|
-
|
|
653
|
+
const r = P.value;
|
|
654
|
+
if (r > 0) {
|
|
655
|
+
const [o] = n.value.splice(r - 1, 1);
|
|
656
|
+
w.value.splice(r - 1, 1), e.emit("remove", n.value, o, r - 1);
|
|
665
657
|
}
|
|
666
658
|
}
|
|
667
659
|
}
|
|
668
|
-
function
|
|
660
|
+
function x(t, r, o) {
|
|
669
661
|
t > -1 && (n.value.splice(t, 0, {
|
|
670
|
-
name:
|
|
662
|
+
name: r,
|
|
671
663
|
value: o,
|
|
672
664
|
selectable: v.value
|
|
673
|
-
}),
|
|
665
|
+
}), w.value = h(), e.emit("change", n.value));
|
|
674
666
|
}
|
|
675
|
-
function
|
|
667
|
+
function X(t) {
|
|
676
668
|
if (t && t.innerText) {
|
|
677
|
-
const
|
|
678
|
-
|
|
669
|
+
const r = t.innerText, o = P.value;
|
|
670
|
+
x(o, r, r), t.innerText = "";
|
|
679
671
|
}
|
|
680
672
|
}
|
|
681
673
|
function ne(t) {
|
|
682
|
-
const
|
|
683
|
-
|
|
674
|
+
const r = t.target;
|
|
675
|
+
r && (r.innerText ? X(r) : e.emit("change", n.value));
|
|
684
676
|
}
|
|
685
|
-
function
|
|
686
|
-
t.key === "Enter" &&
|
|
687
|
-
var
|
|
688
|
-
b.value && ((
|
|
677
|
+
function se(t) {
|
|
678
|
+
t.key === "Enter" && X(t.target), t.key === "Backspace" && (ae(t.target), ue(() => {
|
|
679
|
+
var r;
|
|
680
|
+
b.value && ((r = b.value) == null || r.focus());
|
|
689
681
|
}));
|
|
690
682
|
}
|
|
691
|
-
function
|
|
683
|
+
function le() {
|
|
692
684
|
return T("li", {
|
|
693
685
|
class: "farris-tag-input-box"
|
|
694
686
|
}, [T("div", {
|
|
695
687
|
ref: b,
|
|
696
688
|
class: "form-control",
|
|
697
689
|
contenteditable: "true",
|
|
698
|
-
onKeyup:
|
|
690
|
+
onKeyup: se,
|
|
699
691
|
onBlur: ne
|
|
700
692
|
}, null)]);
|
|
701
693
|
}
|
|
702
|
-
function
|
|
694
|
+
function s(t, r) {
|
|
703
695
|
return T("li", {
|
|
704
696
|
class: Y(t),
|
|
705
697
|
style: Z.value,
|
|
@@ -707,12 +699,12 @@ const Ue = /* @__PURE__ */ he({
|
|
|
707
699
|
id: t.name,
|
|
708
700
|
key: t.name,
|
|
709
701
|
onClick: (o) => K(o, t),
|
|
710
|
-
onKeydown: (o) =>
|
|
702
|
+
onKeydown: (o) => q(o, t),
|
|
711
703
|
draggable: "true",
|
|
712
|
-
onDragstart: (o) =>
|
|
713
|
-
onDragenter: (o) =>
|
|
704
|
+
onDragstart: (o) => z(o, t, r),
|
|
705
|
+
onDragenter: (o) => G(o, r),
|
|
714
706
|
onDragend: (o) => Q(o, t),
|
|
715
|
-
onDragover: (o) =>
|
|
707
|
+
onDragover: (o) => J(o, r)
|
|
716
708
|
}, [T("div", {
|
|
717
709
|
title: t.name,
|
|
718
710
|
class: "tag-box"
|
|
@@ -720,87 +712,87 @@ const Ue = /* @__PURE__ */ he({
|
|
|
720
712
|
class: "tag-delete"
|
|
721
713
|
}, [T("i", {
|
|
722
714
|
class: "f-icon f-icon-close",
|
|
723
|
-
onClick: (o) =>
|
|
715
|
+
onClick: (o) => H(o, t)
|
|
724
716
|
}, null)])]);
|
|
725
717
|
}
|
|
726
|
-
function
|
|
727
|
-
return
|
|
718
|
+
function l() {
|
|
719
|
+
return w.value.map((t, r) => {
|
|
728
720
|
switch (t.type) {
|
|
729
721
|
case "Tag":
|
|
730
|
-
return
|
|
722
|
+
return s(t.payload, r);
|
|
731
723
|
case "AddButton":
|
|
732
724
|
return te();
|
|
733
725
|
case "Input":
|
|
734
|
-
return
|
|
726
|
+
return le();
|
|
735
727
|
}
|
|
736
728
|
});
|
|
737
729
|
}
|
|
738
|
-
const u =
|
|
730
|
+
const u = R(() => ({
|
|
739
731
|
"farris-tags-item-container": !0,
|
|
740
732
|
"farris-tag-item-capsule": y.value === "capsule"
|
|
741
733
|
}));
|
|
742
|
-
function
|
|
743
|
-
const
|
|
744
|
-
|
|
734
|
+
function O(t) {
|
|
735
|
+
const r = Math.max(A.value.scrollLeft - t.deltaX, 0);
|
|
736
|
+
A.value.scrollLeft = r;
|
|
745
737
|
}
|
|
746
|
-
function
|
|
747
|
-
const
|
|
748
|
-
if (
|
|
749
|
-
const S = Array.from(
|
|
750
|
-
const
|
|
751
|
-
return
|
|
738
|
+
function re(t) {
|
|
739
|
+
const r = A.value, o = n.value.length - 1;
|
|
740
|
+
if (r) {
|
|
741
|
+
const S = Array.from(r.children).filter((I) => I.className.indexOf("farris-tag-item") > -1).findIndex((I) => {
|
|
742
|
+
const M = I.getBoundingClientRect(), oe = window.getComputedStyle(I), ve = parseInt(oe["margin-left"], 10) + M.width + parseInt(oe["margin-right"], 10);
|
|
743
|
+
return M.left + ve > t;
|
|
752
744
|
});
|
|
753
745
|
if (S > -1)
|
|
754
746
|
return S;
|
|
755
747
|
}
|
|
756
748
|
return o;
|
|
757
749
|
}
|
|
758
|
-
function
|
|
750
|
+
function V(t) {
|
|
759
751
|
if (f.value) {
|
|
760
|
-
const o =
|
|
761
|
-
|
|
752
|
+
const o = re(t.clientX) + 1, I = w.value.filter((M) => M.type !== "Input");
|
|
753
|
+
I.splice(o, 0, {
|
|
762
754
|
type: "Input"
|
|
763
|
-
}),
|
|
764
|
-
var
|
|
765
|
-
b.value && ((
|
|
755
|
+
}), w.value = I, ue(() => {
|
|
756
|
+
var M;
|
|
757
|
+
b.value && ((M = b.value) == null || M.focus());
|
|
766
758
|
});
|
|
767
759
|
}
|
|
768
760
|
}
|
|
769
|
-
function
|
|
761
|
+
function ge(t) {
|
|
770
762
|
var o;
|
|
771
763
|
t.preventDefault(), t.stopPropagation();
|
|
772
|
-
const
|
|
773
|
-
if (
|
|
774
|
-
const S =
|
|
775
|
-
[...n.value].findIndex((ce) => (console.log(`${ce.value} === ${
|
|
764
|
+
const r = (o = t.dataTransfer) == null ? void 0 : o.getData("Text");
|
|
765
|
+
if (r) {
|
|
766
|
+
const S = r.split(":"), I = S[0], M = S[1];
|
|
767
|
+
[...n.value].findIndex((ce) => (console.log(`${ce.value} === ${M} is ${ce.value === M}`), ce.value === M)) > -1 || x(n.value.length, I, M);
|
|
776
768
|
}
|
|
777
769
|
}
|
|
778
|
-
function
|
|
770
|
+
function pe(t) {
|
|
779
771
|
t.preventDefault();
|
|
780
772
|
}
|
|
781
773
|
return () => T("div", {
|
|
782
|
-
ref:
|
|
774
|
+
ref: L,
|
|
783
775
|
class: U.value,
|
|
784
|
-
onClick:
|
|
785
|
-
onDrop:
|
|
786
|
-
onDragover:
|
|
776
|
+
onClick: V,
|
|
777
|
+
onDrop: ge,
|
|
778
|
+
onDragover: pe
|
|
787
779
|
}, [T("ul", {
|
|
788
|
-
ref:
|
|
780
|
+
ref: A,
|
|
789
781
|
class: u.value,
|
|
790
|
-
onWheel: (t) =>
|
|
791
|
-
}, [
|
|
782
|
+
onWheel: (t) => O(t)
|
|
783
|
+
}, [l()])]);
|
|
792
784
|
}
|
|
793
785
|
});
|
|
794
|
-
|
|
795
|
-
a.tags =
|
|
786
|
+
_.register = (a, e, v, g) => {
|
|
787
|
+
a.tags = _, e.tags = ke;
|
|
796
788
|
};
|
|
797
|
-
|
|
798
|
-
a.tags =
|
|
789
|
+
_.registerDesigner = (a, e, v) => {
|
|
790
|
+
a.tags = Ye, e.tags = ke;
|
|
799
791
|
};
|
|
800
|
-
const
|
|
792
|
+
const tt = De(_);
|
|
801
793
|
export {
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
794
|
+
_ as FTags,
|
|
795
|
+
tt as default,
|
|
796
|
+
ke as propsResolver,
|
|
797
|
+
fe as tagsProps
|
|
806
798
|
};
|