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