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