@farris/ui-vue 1.2.8 → 1.3.0
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 +180 -180
- package/components/accordion/index.umd.cjs +1 -0
- package/components/avatar/index.esm.js +419 -331
- package/components/avatar/index.umd.cjs +1 -0
- package/components/border-editor/index.umd.cjs +1 -0
- package/components/button/index.umd.cjs +1 -0
- package/components/button-edit/index.css +1 -1
- package/components/button-edit/index.esm.js +346 -326
- package/components/button-edit/index.umd.cjs +1 -0
- package/components/button-group/index.umd.cjs +1 -0
- package/components/calculator/index.umd.cjs +1 -0
- package/components/calendar/index.esm.js +384 -384
- package/components/calendar/index.umd.cjs +1 -0
- package/components/capsule/index.esm.js +205 -205
- package/components/capsule/index.umd.cjs +1 -0
- package/components/checkbox/index.esm.js +555 -467
- package/components/checkbox/index.umd.cjs +1 -0
- package/components/color-picker/index.esm.js +239 -239
- package/components/color-picker/index.umd.cjs +3 -0
- package/components/combo-list/index.css +1 -0
- package/components/combo-list/index.esm.js +1072 -364
- package/components/combo-list/index.umd.cjs +1 -0
- package/components/combo-tree/index.esm.js +129 -129
- package/components/combo-tree/index.umd.cjs +1 -0
- package/components/common/index.esm.js +778 -700
- package/components/common/index.umd.cjs +1 -0
- package/components/component/index.esm.js +582 -327
- package/components/component/index.umd.cjs +1 -0
- package/components/condition/index.css +1 -0
- package/components/condition/index.esm.js +2433 -1134
- package/components/condition/index.umd.cjs +1 -0
- package/components/content-container/index.esm.js +307 -234
- package/components/content-container/index.umd.cjs +1 -0
- package/components/data-grid/index.css +1 -1
- package/components/data-grid/index.esm.js +6762 -4946
- package/components/data-grid/index.umd.cjs +1 -0
- package/components/data-view/index.css +1 -0
- package/components/data-view/index.esm.js +4977 -3489
- package/components/data-view/index.umd.cjs +1 -0
- package/components/date-picker/index.css +1 -1
- package/components/date-picker/index.esm.js +3525 -2811
- package/components/date-picker/index.umd.cjs +1 -0
- package/components/designer-canvas/index.css +1 -1
- package/components/designer-canvas/index.esm.js +938 -928
- package/components/designer-canvas/index.umd.cjs +1 -0
- package/components/designer-outline/index.css +1 -1
- package/components/designer-outline/index.esm.js +38 -37
- package/components/designer-outline/index.umd.cjs +1 -0
- package/components/designer-toolbox/index.esm.js +36 -12
- package/components/designer-toolbox/index.umd.cjs +1 -0
- package/components/discussion-editor/index.umd.cjs +3 -0
- package/components/discussion-list/index.umd.cjs +1 -0
- package/components/drawer/index.umd.cjs +1 -0
- package/components/dropdown/index.esm.js +282 -282
- package/components/dropdown/index.umd.cjs +2 -0
- package/components/dynamic-form/index.css +1 -0
- package/components/dynamic-form/index.esm.js +2684 -1039
- package/components/dynamic-form/index.umd.cjs +1 -0
- package/components/dynamic-resolver/index.esm.js +149 -101
- package/components/dynamic-resolver/index.umd.cjs +1 -0
- package/components/dynamic-view/index.esm.js +303 -290
- package/components/dynamic-view/index.umd.cjs +1 -0
- package/components/enum-editor/index.umd.cjs +1 -0
- package/components/events-editor/index.esm.js +573 -518
- package/components/events-editor/index.umd.cjs +1 -0
- package/components/expression-editor/index.esm.js +99 -99
- package/components/expression-editor/index.umd.cjs +1 -0
- package/components/external-container/index.css +1 -1
- package/components/external-container/index.esm.js +3607 -2799
- package/components/external-container/index.umd.cjs +1 -0
- package/components/field-selector/index.css +1 -1
- package/components/field-selector/index.esm.js +5438 -8236
- package/components/field-selector/index.umd.cjs +1 -0
- package/components/filter-bar/index.css +1 -1
- package/components/filter-bar/index.esm.js +1679 -1759
- package/components/filter-bar/index.umd.cjs +1 -0
- package/components/flow-canvas/index.css +1 -1
- package/components/flow-canvas/index.esm.js +1062 -1052
- package/components/flow-canvas/index.umd.cjs +1 -0
- package/components/image-cropper/index.esm.js +421 -421
- package/components/image-cropper/index.umd.cjs +1 -0
- package/components/input-group/index.esm.js +677 -593
- package/components/input-group/index.umd.cjs +1 -0
- package/components/layout/index.esm.js +326 -326
- package/components/layout/index.umd.cjs +1 -0
- package/components/list-nav/index.esm.js +272 -199
- package/components/list-nav/index.umd.cjs +1 -0
- package/components/list-view/index.css +1 -1
- package/components/list-view/index.esm.js +3739 -2273
- package/components/list-view/index.umd.cjs +1 -0
- package/components/loading/index.umd.cjs +8 -0
- package/components/locale/index.umd.cjs +1 -0
- package/components/lookup/index.css +1 -1
- package/components/lookup/index.esm.js +11255 -9004
- package/components/lookup/index.umd.cjs +1 -0
- package/components/mapping-editor/index.css +1 -1
- package/components/mapping-editor/index.esm.js +6046 -5314
- package/components/mapping-editor/index.umd.cjs +1 -0
- 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 -0
- package/components/modal/index.css +1 -1
- package/components/modal/index.esm.js +438 -398
- package/components/modal/index.umd.cjs +1 -0
- package/components/nav/index.esm.js +588 -444
- package/components/nav/index.umd.cjs +3 -0
- package/components/notify/index.esm.js +59 -53
- package/components/notify/index.umd.cjs +1 -0
- package/components/number-range/index.esm.js +568 -485
- package/components/number-range/index.umd.cjs +1 -0
- package/components/number-spinner/index.esm.js +542 -454
- package/components/number-spinner/index.umd.cjs +1 -0
- package/components/order/index.css +1 -1
- package/components/order/index.esm.js +1967 -1105
- package/components/order/index.umd.cjs +1 -0
- package/components/page-footer/index.esm.js +160 -160
- package/components/page-footer/index.umd.cjs +1 -0
- package/components/page-header/index.esm.js +1282 -1151
- package/components/page-header/index.umd.cjs +1 -0
- package/components/pagination/index.esm.js +705 -555
- package/components/pagination/index.umd.cjs +1 -0
- package/components/popover/index.esm.js +71 -70
- package/components/popover/index.umd.cjs +1 -0
- package/components/progress/index.esm.js +270 -270
- package/components/progress/index.umd.cjs +3 -0
- package/components/property-editor/index.css +1 -1
- package/components/property-editor/index.esm.js +2231 -1517
- package/components/property-editor/index.umd.cjs +3 -0
- package/components/property-panel/index.esm.js +813 -909
- package/components/property-panel/index.umd.cjs +1 -0
- package/components/query-solution/index.css +1 -1
- package/components/query-solution/index.esm.js +3781 -2566
- package/components/query-solution/index.umd.cjs +1 -0
- package/components/radio-button/index.esm.js +101 -101
- package/components/radio-button/index.umd.cjs +1 -0
- package/components/radio-group/index.esm.js +538 -450
- package/components/radio-group/index.umd.cjs +1 -0
- package/components/rate/index.esm.js +238 -233
- package/components/rate/index.umd.cjs +1 -0
- package/components/response-layout/index.esm.js +155 -155
- package/components/response-layout/index.umd.cjs +1 -0
- package/components/response-layout-editor/index.css +1 -1
- package/components/response-layout-editor/index.esm.js +1243 -1180
- package/components/response-layout-editor/index.umd.cjs +1 -0
- package/components/response-toolbar/index.esm.js +988 -877
- package/components/response-toolbar/index.umd.cjs +1 -0
- package/components/schema-selector/index.css +1 -1
- package/components/schema-selector/index.esm.js +5413 -4867
- package/components/schema-selector/index.umd.cjs +8 -0
- package/components/search-box/index.esm.js +199 -199
- package/components/search-box/index.umd.cjs +1 -0
- package/components/section/index.esm.js +646 -503
- package/components/section/index.umd.cjs +1 -0
- package/components/smoke-detector/index.esm.js +144 -144
- package/components/smoke-detector/index.umd.cjs +1 -0
- package/components/spacing-editor/index.umd.cjs +1 -0
- package/components/splitter/index.esm.js +464 -391
- package/components/splitter/index.umd.cjs +1 -0
- package/components/step/index.esm.js +249 -249
- package/components/step/index.umd.cjs +1 -0
- package/components/switch/index.esm.js +483 -394
- package/components/switch/index.umd.cjs +1 -0
- package/components/tabs/index.css +1 -1
- package/components/tabs/index.esm.js +2366 -2208
- package/components/tabs/index.umd.cjs +1 -0
- package/components/tags/index.esm.js +397 -399
- package/components/tags/index.umd.cjs +1 -0
- package/components/text/index.esm.js +394 -394
- package/components/text/index.umd.cjs +1 -0
- package/components/textarea/index.esm.js +451 -367
- package/components/textarea/index.umd.cjs +1 -0
- package/components/time-picker/index.css +1 -1
- package/components/time-picker/index.esm.js +1252 -1144
- package/components/time-picker/index.umd.cjs +1 -0
- package/components/tooltip/index.umd.cjs +1 -0
- package/components/transfer/index.css +1 -1
- package/components/transfer/index.esm.js +510 -499
- package/components/transfer/index.umd.cjs +1 -0
- package/components/tree-grid/index.css +1 -1
- package/components/tree-grid/index.esm.js +5463 -9330
- package/components/tree-grid/index.umd.cjs +1 -0
- package/components/tree-view/index.css +1 -0
- package/components/tree-view/index.esm.js +4058 -2597
- package/components/tree-view/index.umd.cjs +1 -0
- package/components/uploader/index.esm.js +510 -504
- package/components/uploader/index.umd.cjs +2 -0
- package/components/verify-detail/index.esm.js +220 -220
- package/components/verify-detail/index.umd.cjs +1 -0
- package/components/video/index.esm.js +653 -394
- package/components/video/index.umd.cjs +1 -0
- package/components/weather/index.esm.js +1028 -1028
- package/components/weather/index.umd.cjs +16 -0
- package/farris.all.esm.js +20407 -18556
- package/farris.all.umd.cjs +8 -8
- 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/capsule/src/capsule.props.d.ts +2 -2
- package/types/combo-list/src/components/list-container.props.d.ts +1 -1
- package/types/common/entity/entity-schema.d.ts +258 -0
- package/types/common/index.d.ts +1 -0
- package/types/common/types.d.ts +1 -1
- package/types/common/utils/encrypt.d.ts +2 -0
- package/types/component/src/component-ref.props.d.ts +4 -0
- package/types/component/src/component.props.d.ts +7 -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/component/src/property-config/component.property-config.d.ts +9 -0
- package/types/components.d.ts +1 -0
- package/types/data-grid/index.d.ts +8 -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 +3 -1
- package/types/data-grid/src/data-grid.props.d.ts +3 -2
- 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 +36 -7
- package/types/data-view/composition/use-edit.d.ts +2 -1
- package/types/data-view/composition/visualization/use-virtual-scroll.d.ts +0 -15
- package/types/designer-canvas/src/composition/dg-control.d.ts +5 -0
- package/types/designer-canvas/src/composition/function/use-dragula.d.ts +2 -2
- package/types/designer-canvas/src/composition/types.d.ts +1 -1
- package/types/designer-canvas/src/types.d.ts +2 -2
- package/types/dynamic-form/index.d.ts +2 -1
- package/types/dynamic-form/src/composition/response-form-component-creator.service.d.ts +31 -0
- 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/use-designer-rules.d.ts +2 -2
- 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 +3 -1
- package/types/dynamic-form/src/types.d.ts +12 -1
- package/types/dynamic-resolver/index.d.ts +1 -0
- package/types/dynamic-resolver/src/event-handler-resolver.d.ts +4 -0
- package/types/dynamic-resolver/src/schema-resolver.d.ts +2 -1
- package/types/dynamic-resolver/src/types.d.ts +12 -2
- package/types/dynamic-view/index.d.ts +1 -0
- package/types/dynamic-view/src/event-dispatcher.d.ts +1 -1
- package/types/index.d.ts +2 -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/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/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/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/property-config/tab-page.property-config.d.ts +60 -0
- package/types/tabs/src/schema/schema-resolver.d.ts +2 -1
- package/types/tabs/src/tabs.props.d.ts +1 -0
- package/types/tags/index.d.ts +36 -5
- package/types/tree-grid/index.d.ts +8 -2
- package/types/tree-grid/src/tree-grid.component.d.ts +3 -1
- package/types/modal/src/composition/use-esc.d.ts +0 -1
- 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,56 +1,57 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { withInstall as De } from "../common/index.esm.js";
|
|
2
|
+
import { ref as i, defineComponent as ye, computed as I, watch as q, nextTick as ue, createVNode as T, inject as Be, onMounted as Ae } from "vue";
|
|
3
|
+
import { isPlainObject as he, cloneDeep as Ce } from "lodash-es";
|
|
4
|
+
function Se(a, e, v) {
|
|
4
5
|
return e;
|
|
5
6
|
}
|
|
6
7
|
const be = {}, Te = {};
|
|
7
|
-
function fe(
|
|
8
|
-
const { properties: e, title: v } =
|
|
9
|
-
return g.id = `${v}-${Date.now()}
|
|
8
|
+
function fe(a) {
|
|
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]) : Ce(e[w].default)), y), {});
|
|
10
|
+
return (!n || !g.find((y) => y == "id")) && (h.id = `${v}-${Date.now()}`), h;
|
|
10
11
|
}
|
|
11
|
-
function ie(
|
|
12
|
-
const
|
|
13
|
-
if (
|
|
14
|
-
let
|
|
15
|
-
const
|
|
16
|
-
return
|
|
12
|
+
function ie(a, e = {}, v) {
|
|
13
|
+
const g = be[a];
|
|
14
|
+
if (g) {
|
|
15
|
+
let n = fe(g);
|
|
16
|
+
const h = Te[a];
|
|
17
|
+
return n = h ? h({ getSchemaByType: ie }, n, e, v) : n, n;
|
|
17
18
|
}
|
|
18
19
|
return null;
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
+
function Oe(a, e) {
|
|
21
22
|
const v = fe(e);
|
|
22
|
-
return Object.keys(
|
|
23
|
+
return Object.keys(a).reduce((g, n) => (g[n] && he(g[n]) && he(a[n]) ? Object.assign(g[n], a[n]) : g[n] = a[n], g), v), v;
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
-
return Object.keys(
|
|
26
|
-
if (e.has(
|
|
27
|
-
const h = e.get(
|
|
25
|
+
function je(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] =
|
|
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
|
-
const g =
|
|
41
|
-
return
|
|
40
|
+
function Me(a, e, v = /* @__PURE__ */ new Map()) {
|
|
41
|
+
const g = Oe(a, e);
|
|
42
|
+
return je(g, v);
|
|
42
43
|
}
|
|
43
|
-
function
|
|
44
|
+
function Ee(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;
|
|
@@ -62,52 +63,52 @@ function je(t = {}) {
|
|
|
62
63
|
["length", e],
|
|
63
64
|
["getProperty", v]
|
|
64
65
|
]);
|
|
65
|
-
Object.keys(
|
|
66
|
-
function
|
|
66
|
+
Object.keys(a).reduce((c, p) => (c.set(p, a[p]), c), g);
|
|
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
|
-
function
|
|
92
|
-
const d = Object.keys(c), f = d.includes("allOf"),
|
|
93
|
-
return f ? !
|
|
92
|
+
function C(c, p) {
|
|
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
|
-
return { parseValueSchema:
|
|
96
|
+
return { parseValueSchema: C };
|
|
96
97
|
}
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
function
|
|
100
|
-
return be[e.title] = e, Te[e.title] = g,
|
|
101
|
-
const
|
|
102
|
-
return Object.assign(
|
|
98
|
+
const Pe = {}, Ie = {};
|
|
99
|
+
Ee();
|
|
100
|
+
function Le(a, e, v = /* @__PURE__ */ new Map(), g = (y, w, C) => w, n = {}, h = (y) => y) {
|
|
101
|
+
return be[e.title] = e, Te[e.title] = g, Pe[e.title] = n, Ie[e.title] = h, (y = {}) => {
|
|
102
|
+
const w = Me(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 Re(
|
|
106
|
+
function Re(a, e) {
|
|
106
107
|
return { customClass: e.class, customStyle: e.style };
|
|
107
108
|
}
|
|
108
|
-
const
|
|
109
|
+
const Ne = /* @__PURE__ */ new Map([
|
|
109
110
|
["appearance", Re]
|
|
110
|
-
]),
|
|
111
|
+
]), $e = "tags", Ve = "A Farris Component", Fe = "object", We = {
|
|
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
|
+
}, xe = {
|
|
134
|
+
title: $e,
|
|
135
|
+
description: Ve,
|
|
136
|
+
type: Fe,
|
|
137
|
+
categories: We
|
|
138
|
+
}, qe = "https://json-schema.org/draft/2020-12/schema", He = "https://farris-design.gitee.io/tags.schema.json", _e = "tags", Xe = "A Farris Component", Je = "object", ze = {
|
|
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
|
+
}, Ge = [
|
|
200
201
|
"id",
|
|
201
202
|
"type"
|
|
202
|
-
],
|
|
203
|
-
$schema:
|
|
204
|
-
$id:
|
|
205
|
-
title:
|
|
206
|
-
description:
|
|
207
|
-
type:
|
|
208
|
-
properties:
|
|
209
|
-
required:
|
|
203
|
+
], Qe = {
|
|
204
|
+
$schema: qe,
|
|
205
|
+
$id: He,
|
|
206
|
+
title: _e,
|
|
207
|
+
description: Xe,
|
|
208
|
+
type: Je,
|
|
209
|
+
properties: ze,
|
|
210
|
+
required: Ge
|
|
210
211
|
}, de = {
|
|
211
212
|
activeTag: { type: String, default: "" },
|
|
212
213
|
addButtonText: { type: String, default: "" },
|
|
@@ -223,117 +224,117 @@ 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
|
-
function
|
|
228
|
-
const
|
|
229
|
-
function
|
|
227
|
+
}, ke = Le(de, Qe, Ne, Se, xe);
|
|
228
|
+
function we(a, e, v, g) {
|
|
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
|
-
function
|
|
241
|
+
function C(p, d) {
|
|
241
242
|
p.preventDefault(), p.dataTransfer && (p.dataTransfer.dropEffect = "move");
|
|
242
243
|
}
|
|
243
244
|
function c(p, d) {
|
|
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:
|
|
249
|
-
dragover:
|
|
248
|
+
dragstart: y,
|
|
249
|
+
dragenter: w,
|
|
250
|
+
dragover: C,
|
|
250
251
|
dragend: c,
|
|
251
252
|
isDragging: h
|
|
252
253
|
};
|
|
253
254
|
}
|
|
254
|
-
const
|
|
255
|
+
const G = /* @__PURE__ */ ye({
|
|
255
256
|
name: "FTags",
|
|
256
257
|
props: de,
|
|
257
258
|
emits: ["remove", "selectionChange", "change"],
|
|
258
|
-
setup(
|
|
259
|
-
const v = i(
|
|
260
|
-
i(
|
|
259
|
+
setup(a, e) {
|
|
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();
|
|
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
|
-
payload:
|
|
266
|
+
payload: s
|
|
266
267
|
}));
|
|
267
|
-
return
|
|
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 = we(a, e, n, b), {
|
|
277
|
+
dragstart: L,
|
|
277
278
|
dragenter: m,
|
|
278
|
-
dragover:
|
|
279
|
-
dragend:
|
|
280
|
-
} =
|
|
281
|
-
q(() =>
|
|
282
|
-
|
|
283
|
-
}), q(() =>
|
|
284
|
-
|
|
285
|
-
}), q(() =>
|
|
286
|
-
c.value =
|
|
287
|
-
}), q(B, (
|
|
288
|
-
const
|
|
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((
|
|
305
|
+
return g.value.split(" ").reduce((s, u) => (s[u] = !0, s), r), r;
|
|
305
306
|
});
|
|
306
|
-
function
|
|
307
|
-
const
|
|
307
|
+
function V(r) {
|
|
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}`;
|
|
316
|
-
|
|
317
|
+
s[u] = !0;
|
|
317
318
|
}
|
|
318
|
-
return
|
|
319
|
+
return s;
|
|
319
320
|
}
|
|
320
|
-
const
|
|
321
|
-
const
|
|
322
|
-
return
|
|
321
|
+
const R = I(() => {
|
|
322
|
+
const r = {};
|
|
323
|
+
return C.value && C.value.split(";").reduce((s, u) => {
|
|
323
324
|
const j = u.split(":");
|
|
324
|
-
return
|
|
325
|
-
},
|
|
325
|
+
return s[j[0]] = j[1], s;
|
|
326
|
+
}, r), r;
|
|
326
327
|
});
|
|
327
|
-
function H(
|
|
328
|
-
!
|
|
329
|
-
u.checked = !
|
|
330
|
-
}), e.emit("change",
|
|
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) => {
|
|
330
|
+
u.checked = !s.checked;
|
|
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,143 +343,143 @@ 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
|
-
"farris-tag-add-button-disabled": !
|
|
360
|
+
"farris-tag-add-button-disabled": !a.enableAddButton
|
|
360
361
|
}));
|
|
361
|
-
function
|
|
362
|
-
|
|
363
|
-
}
|
|
364
|
-
function
|
|
365
|
-
return !
|
|
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
|
-
|
|
376
|
-
name:
|
|
375
|
+
function _(r, s, u) {
|
|
376
|
+
r > -1 && (n.value.splice(r, 0, {
|
|
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
|
|
384
|
-
_(u,
|
|
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
|
|
390
|
-
|
|
389
|
+
function ee(r) {
|
|
390
|
+
const s = r.target;
|
|
391
|
+
s && s.value ? X(s) : B.value = !1;
|
|
391
392
|
}
|
|
392
|
-
function ge(
|
|
393
|
-
|
|
393
|
+
function ge(r) {
|
|
394
|
+
r.key === "Enter" && X(r.target);
|
|
394
395
|
}
|
|
395
|
-
function
|
|
396
|
-
return !
|
|
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
403
|
onKeyup: ge,
|
|
403
|
-
onBlur:
|
|
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
|
-
onDragenter: (u) => m(u,
|
|
418
|
-
onDragend: (u) =>
|
|
419
|
-
onDragover: (u) =>
|
|
420
|
-
}, [
|
|
421
|
-
title:
|
|
417
|
+
onDragstart: (u) => L(u, r, s),
|
|
418
|
+
onDragenter: (u) => m(u, s),
|
|
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
|
|
448
|
-
f.value.scrollLeft =
|
|
447
|
+
function ne(r) {
|
|
448
|
+
const s = Math.max(f.value.scrollLeft - r.deltaX, 0);
|
|
449
|
+
f.value.scrollLeft = s;
|
|
449
450
|
}
|
|
450
|
-
function
|
|
451
|
+
function re(r) {
|
|
451
452
|
var u;
|
|
452
|
-
|
|
453
|
-
const
|
|
454
|
-
if (
|
|
455
|
-
const j =
|
|
456
|
-
[...
|
|
453
|
+
r.preventDefault(), r.stopPropagation();
|
|
454
|
+
const s = (u = r.dataTransfer) == null ? void 0 : u.getData("Text");
|
|
455
|
+
if (s) {
|
|
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 se(
|
|
460
|
-
|
|
460
|
+
function se(r) {
|
|
461
|
+
r.preventDefault();
|
|
461
462
|
}
|
|
462
|
-
return () =>
|
|
463
|
-
class:
|
|
464
|
-
onDrop:
|
|
463
|
+
return () => T("div", {
|
|
464
|
+
class: M.value,
|
|
465
|
+
onDrop: re,
|
|
465
466
|
onDragover: se
|
|
466
|
-
}, [
|
|
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 Ue(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
|
-
function
|
|
482
|
+
function C() {
|
|
482
483
|
return !1;
|
|
483
484
|
}
|
|
484
485
|
function c() {
|
|
@@ -492,14 +493,14 @@ function Ge(t, 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,121 +508,121 @@ function Ge(t, 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:
|
|
531
|
-
canSelectParent:
|
|
530
|
+
return y.value = {
|
|
531
|
+
canMove: w(),
|
|
532
|
+
canSelectParent: C(),
|
|
532
533
|
canDelete: c(),
|
|
533
534
|
canNested: !p(),
|
|
534
535
|
contents: e == null ? void 0 : e.schema.contents,
|
|
535
|
-
elementRef:
|
|
536
|
-
parent: (
|
|
536
|
+
elementRef: a,
|
|
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 Ye = /* @__PURE__ */ ye({
|
|
556
557
|
name: "FTagsDesign",
|
|
557
558
|
props: de,
|
|
558
559
|
emits: ["remove", "selectionChange", "change"],
|
|
559
|
-
setup(
|
|
560
|
-
const v = i(
|
|
561
|
-
i(
|
|
562
|
-
const B = i(),
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
}), e.expose(
|
|
566
|
-
function
|
|
567
|
-
const
|
|
560
|
+
setup(a, e) {
|
|
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);
|
|
562
|
+
i(a.placeholder), i(""), i();
|
|
563
|
+
const B = i(), P = i(a.wrapText), b = i(), $ = i(), F = Be("design-item-context"), W = Ue($, F);
|
|
564
|
+
Ae(() => {
|
|
565
|
+
$.value.componentInstance = W;
|
|
566
|
+
}), e.expose(W.value);
|
|
567
|
+
function L() {
|
|
568
|
+
const t = n.value.map((l) => ({
|
|
568
569
|
type: "Tag",
|
|
569
|
-
payload:
|
|
570
|
+
payload: l
|
|
570
571
|
}));
|
|
571
|
-
return d.value &&
|
|
572
|
+
return d.value && t.push({
|
|
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 = we(a, e, n, m), {
|
|
581
|
+
dragstart: V,
|
|
582
|
+
dragenter: R,
|
|
582
583
|
dragover: H,
|
|
583
|
-
dragend:
|
|
584
|
-
} =
|
|
585
|
-
q(() =>
|
|
586
|
-
const
|
|
587
|
-
const
|
|
584
|
+
dragend: Q
|
|
585
|
+
} = M;
|
|
586
|
+
q(() => a.data, (t) => O(t));
|
|
587
|
+
const U = I(() => {
|
|
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
|
-
return g.value.split(" ").reduce((
|
|
593
|
+
return g.value.split(" ").reduce((l, o) => (l[o] = !0, l), t), t;
|
|
593
594
|
});
|
|
594
|
-
function
|
|
595
|
-
const
|
|
595
|
+
function Y(t) {
|
|
596
|
+
const l = {
|
|
596
597
|
"farris-tag-item": !0,
|
|
597
|
-
"farris-tag-item-checked": v.value &&
|
|
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-actived":
|
|
600
|
+
"farris-tag-item-has-color": w.value,
|
|
601
|
+
"farris-tag-item-actived": C.value === t.name
|
|
601
602
|
};
|
|
602
603
|
if (h.value) {
|
|
603
604
|
const o = `farris-tag-item-${h.value}`;
|
|
604
|
-
|
|
605
|
+
l[o] = !0;
|
|
605
606
|
}
|
|
606
|
-
return
|
|
607
|
-
}
|
|
608
|
-
const
|
|
609
|
-
const
|
|
610
|
-
return c.value && c.value.split(";").reduce((
|
|
611
|
-
const
|
|
612
|
-
return
|
|
613
|
-
},
|
|
607
|
+
return l;
|
|
608
|
+
}
|
|
609
|
+
const Z = I(() => {
|
|
610
|
+
const t = {};
|
|
611
|
+
return c.value && c.value.split(";").reduce((l, o) => {
|
|
612
|
+
const S = o.split(":");
|
|
613
|
+
return l[S[0]] = S[1], l;
|
|
614
|
+
}, t), t;
|
|
614
615
|
});
|
|
615
|
-
function
|
|
616
|
-
v.value &&
|
|
617
|
-
o.checked = !
|
|
618
|
-
}), e.emit("change",
|
|
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) => {
|
|
618
|
+
o.checked = !l.checked;
|
|
619
|
+
}), e.emit("change", n.value), e.emit("selectionChange", l));
|
|
619
620
|
}
|
|
620
|
-
function _(
|
|
621
|
+
function _(t, l) {
|
|
621
622
|
let o;
|
|
622
|
-
switch (
|
|
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;
|
|
@@ -630,179 +631,176 @@ const Qe = /* @__PURE__ */ ye({
|
|
|
630
631
|
o = Math.max(B.value.scrollLeft - 20, 0), B.value.scrollLeft = o;
|
|
631
632
|
}
|
|
632
633
|
}
|
|
633
|
-
function X(
|
|
634
|
-
const o =
|
|
634
|
+
function X(t, l) {
|
|
635
|
+
const o = n.value.findIndex((S) => S.name === l.name);
|
|
635
636
|
if (o > -1) {
|
|
636
|
-
const [
|
|
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 ge(
|
|
647
|
+
function ge(t) {
|
|
647
648
|
}
|
|
648
|
-
function
|
|
649
|
-
return
|
|
650
|
-
class:
|
|
651
|
-
onClick: (
|
|
652
|
-
}, [
|
|
649
|
+
function te() {
|
|
650
|
+
return T("li", {
|
|
651
|
+
class: ee.value,
|
|
652
|
+
onClick: (t) => void 0
|
|
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
|
-
}
|
|
658
|
-
function
|
|
659
|
-
if (
|
|
660
|
-
const
|
|
661
|
-
if (
|
|
662
|
-
const [o] =
|
|
663
|
-
m.value.splice(
|
|
657
|
+
}, [k.value])]);
|
|
658
|
+
}
|
|
659
|
+
function ae(t) {
|
|
660
|
+
if (t && !t.innerText) {
|
|
661
|
+
const l = A.value;
|
|
662
|
+
if (l > 0) {
|
|
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
|
-
function J(
|
|
668
|
-
|
|
669
|
-
name:
|
|
668
|
+
function J(t, l, o) {
|
|
669
|
+
t > -1 && (n.value.splice(t, 0, {
|
|
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
|
-
function z(
|
|
675
|
-
if (
|
|
676
|
-
const
|
|
677
|
-
J(o,
|
|
675
|
+
function z(t) {
|
|
676
|
+
if (t && t.innerText) {
|
|
677
|
+
const l = t.innerText, o = A.value;
|
|
678
|
+
J(o, l, l), t.innerText = "";
|
|
678
679
|
}
|
|
679
680
|
}
|
|
680
|
-
function
|
|
681
|
-
const
|
|
682
|
-
|
|
681
|
+
function ne(t) {
|
|
682
|
+
const l = t.target;
|
|
683
|
+
l && (l.innerText ? z(l) : e.emit("change", n.value));
|
|
683
684
|
}
|
|
684
|
-
function
|
|
685
|
-
|
|
686
|
-
var
|
|
687
|
-
|
|
685
|
+
function re(t) {
|
|
686
|
+
t.key === "Enter" && z(t.target), t.key === "Backspace" && (ae(t.target), ue(() => {
|
|
687
|
+
var l;
|
|
688
|
+
b.value && ((l = b.value) == null || l.focus());
|
|
688
689
|
}));
|
|
689
690
|
}
|
|
690
691
|
function se() {
|
|
691
|
-
return
|
|
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
|
-
id:
|
|
707
|
-
key:
|
|
708
|
-
onClick: (o) =>
|
|
709
|
-
onKeydown: (o) => _(o,
|
|
707
|
+
id: t.name,
|
|
708
|
+
key: t.name,
|
|
709
|
+
onClick: (o) => K(o, t),
|
|
710
|
+
onKeydown: (o) => _(o, t),
|
|
710
711
|
draggable: "true",
|
|
711
|
-
onDragstart: (o) =>
|
|
712
|
-
onDragenter: (o) =>
|
|
713
|
-
onDragend: (o) =>
|
|
714
|
-
onDragover: (o) => H(o,
|
|
715
|
-
}, [
|
|
716
|
-
title:
|
|
712
|
+
onDragstart: (o) => V(o, t, l),
|
|
713
|
+
onDragenter: (o) => R(o, l),
|
|
714
|
+
onDragend: (o) => Q(o, t),
|
|
715
|
+
onDragover: (o) => H(o, l)
|
|
716
|
+
}, [T("div", {
|
|
717
|
+
title: t.name,
|
|
717
718
|
class: "tag-box"
|
|
718
|
-
}, [
|
|
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
|
-
onClick: (o) => X(o,
|
|
723
|
+
onClick: (o) => X(o, t)
|
|
723
724
|
}, null)])]);
|
|
724
725
|
}
|
|
725
|
-
function
|
|
726
|
-
return m.value.map((
|
|
727
|
-
switch (
|
|
726
|
+
function s() {
|
|
727
|
+
return m.value.map((t, l) => {
|
|
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
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
|
-
function j(
|
|
742
|
-
const
|
|
743
|
-
B.value.scrollLeft =
|
|
744
|
-
}
|
|
745
|
-
function le(
|
|
746
|
-
const
|
|
747
|
-
if (
|
|
748
|
-
const
|
|
749
|
-
const
|
|
750
|
-
return
|
|
742
|
+
function j(t) {
|
|
743
|
+
const l = Math.max(B.value.scrollLeft - t.deltaX, 0);
|
|
744
|
+
B.value.scrollLeft = l;
|
|
745
|
+
}
|
|
746
|
+
function le(t) {
|
|
747
|
+
const l = B.value, o = n.value.length - 1;
|
|
748
|
+
if (l) {
|
|
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
|
-
if (
|
|
753
|
-
return
|
|
753
|
+
if (S > -1)
|
|
754
|
+
return S;
|
|
754
755
|
}
|
|
755
756
|
return o;
|
|
756
757
|
}
|
|
757
|
-
function x(
|
|
758
|
+
function x(t) {
|
|
758
759
|
if (f.value) {
|
|
759
|
-
const o = le(
|
|
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 pe(
|
|
769
|
+
function pe(t) {
|
|
769
770
|
var o;
|
|
770
|
-
|
|
771
|
-
const
|
|
772
|
-
if (
|
|
773
|
-
const
|
|
774
|
-
[...
|
|
771
|
+
t.preventDefault(), t.stopPropagation();
|
|
772
|
+
const l = (o = t.dataTransfer) == null ? void 0 : o.getData("Text");
|
|
773
|
+
if (l) {
|
|
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
|
-
function ve(
|
|
778
|
-
|
|
778
|
+
function ve(t) {
|
|
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
785
|
onDrop: pe,
|
|
785
786
|
onDragover: ve
|
|
786
|
-
}, [
|
|
787
|
+
}, [T("ul", {
|
|
787
788
|
ref: B,
|
|
788
789
|
class: u.value,
|
|
789
|
-
onWheel: (
|
|
790
|
-
}, [
|
|
791
|
-
}
|
|
792
|
-
}), Ze = {
|
|
793
|
-
install(t) {
|
|
794
|
-
t.component(ce.name, ce);
|
|
795
|
-
},
|
|
796
|
-
register(t, e, v, g) {
|
|
797
|
-
t.tags = ce, e.tags = he;
|
|
798
|
-
},
|
|
799
|
-
registerDesigner(t, e, v) {
|
|
800
|
-
t.tags = Qe, e.tags = he;
|
|
790
|
+
onWheel: (t) => j(t)
|
|
791
|
+
}, [s()])]);
|
|
801
792
|
}
|
|
793
|
+
});
|
|
794
|
+
G.register = (a, e, v, g) => {
|
|
795
|
+
a.tags = G, e.tags = ke;
|
|
796
|
+
};
|
|
797
|
+
G.registerDesigner = (a, e, v) => {
|
|
798
|
+
a.tags = Ye, e.tags = ke;
|
|
802
799
|
};
|
|
800
|
+
const tt = De(G);
|
|
803
801
|
export {
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
802
|
+
G as FTags,
|
|
803
|
+
tt as default,
|
|
804
|
+
ke as propsResolver,
|
|
807
805
|
de as tagsProps
|
|
808
806
|
};
|