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