vue-spear-tip 0.2.1 → 0.2.2
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/dist/.vite/manifest.json +17 -17
- package/dist/{Button-C5m9ByFN.js → Button-DZlKBvlw.js} +1 -1
- package/dist/{Button-BEdTx9u1.cjs → Button-DpDqwLlR.cjs} +1 -1
- package/dist/{CodeHighlight-BQ1d2aqx.js → CodeHighlight-BONqkePV.js} +1 -1
- package/dist/{CodeHighlight-nbryO056.cjs → CodeHighlight-WaVjepT3.cjs} +1 -1
- package/dist/{DateField-DxsK3GG9.cjs → DateField-BwOE2XuE.cjs} +4 -4
- package/dist/{DateField-CFvAUmKN.js → DateField-DCshiDON.js} +324 -317
- package/dist/Interfaces/IGlobalVST.d.ts +6 -0
- package/dist/{SelectField-BOx6vfDK.js → SelectField-C97iZqqJ.js} +140 -133
- package/dist/{SelectField-ClKKyDbm.cjs → SelectField-DJg-e6r7.cjs} +7 -7
- package/dist/{StringField-DRfphhbX.cjs → StringField-BiddnfN1.cjs} +1 -1
- package/dist/{StringField-DdPq8L1n.js → StringField-q2EjZuwT.js} +121 -123
- package/dist/Tabs--qXAltMn.cjs +1 -0
- package/dist/Tabs-i2bTEtg7.js +77 -0
- package/dist/{index-B5vZ3Sg-.cjs → index-BmhExWks.cjs} +1 -1
- package/dist/{index-D38VsUaN.js → index-hQ1VmssH.js} +338 -317
- package/dist/replaceable/BaseComponent.vue +1 -0
- package/dist/vue-spear-tip.cjs.js +1 -1
- package/dist/vue-spear-tip.css +1 -1
- package/dist/vue-spear-tip.es.js +1 -1
- package/docs/index.html +2 -2
- package/docs/static/{Button-gIUrdnJP.js → Button-BI5BLid9.js} +1 -1
- package/docs/static/{ButtonInherited-D2Mzenov.js → ButtonInherited-Dwuz_QB-.js} +1 -1
- package/docs/static/{CodeHighlight-DrpNg95H.js → CodeHighlight-DwP55Obc.js} +1 -1
- package/docs/static/{DateField-BvSvZnWx.js → DateField-BD-4IMMe.js} +4 -4
- package/docs/static/{DateField-BvE8SnW6.css → DateField-DfbnkNv3.css} +1 -1
- package/docs/static/{FieldComponent.vue_vue_type_script_lang-C1h8xGCf.js → FieldComponent.vue_vue_type_script_lang-Dwp-wLcy.js} +1 -1
- package/docs/static/{SelectField-CM692gdJ.css → SelectField-BMU3NQkW.css} +1 -1
- package/docs/static/{SelectField-BqYtVfX-.js → SelectField-DdvXIk4C.js} +7 -7
- package/docs/static/StringField-BqYql_dk.js +1 -0
- package/docs/static/StringField-DV9336PV.css +1 -0
- package/docs/static/Tabs-Co8T0Qi9.css +1 -0
- package/docs/static/Tabs-CwTc00Yi.js +1 -0
- package/docs/static/index-BXtpWRTc.js +2 -0
- package/docs/static/index-BeNEN9J-.js +2 -0
- package/docs/static/index-CMpYTAiF.js +2 -0
- package/docs/static/index-DMKgrxE1.js +2 -0
- package/docs/static/index-Dsi6A5t5.js +2 -0
- package/docs/static/index-Nc0Poa_J.js +2 -0
- package/docs/static/main-C7jrUur6.css +1 -0
- package/docs/static/main-C8MaaDZb.js +103 -0
- package/package.json +1 -1
- package/dist/Tabs-BGaFVFbD.js +0 -57
- package/dist/Tabs-CSkFtqJi.cjs +0 -1
- package/docs/static/StringField-Dyl3XDRE.js +0 -1
- package/docs/static/StringField-ifygx7YK.css +0 -1
- package/docs/static/Tabs-BB0HZDmo.css +0 -1
- package/docs/static/Tabs-BNUXJT3V.js +0 -1
- package/docs/static/index-BDibxxvJ.js +0 -2
- package/docs/static/index-BvlNGib6.js +0 -2
- package/docs/static/index-CVDxaFb5.js +0 -2
- package/docs/static/index-DsOd_0-n.js +0 -2
- package/docs/static/index-aQmObjQp.js +0 -2
- package/docs/static/index-hac6GmDh.js +0 -2
- package/docs/static/main-21CU6hww.css +0 -1
- package/docs/static/main-BwdfadvU.js +0 -103
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
var St = Object.defineProperty;
|
|
2
2
|
var r = (t, e) => St(t, "name", { value: e, configurable: !0 });
|
|
3
|
-
import { F as xt, P as
|
|
3
|
+
import { F as xt, P as G, W as ot, V as Dt } from "./index-hQ1VmssH.js";
|
|
4
4
|
import { createElementBlock as It, openBlock as Nt, normalizeClass as Et, createElementVNode as Mt } from "vue";
|
|
5
5
|
import { _ as _t } from "./_plugin-vue_export-helper-B9nE8o7z.js";
|
|
6
6
|
var lt = "​";
|
|
7
|
-
function
|
|
7
|
+
function Y(t, e) {
|
|
8
8
|
(e == null || e > t.length) && (e = t.length);
|
|
9
9
|
for (var i = 0, n = new Array(e); i < e; i++) n[i] = t[i];
|
|
10
10
|
return n;
|
|
11
11
|
}
|
|
12
|
-
r(
|
|
12
|
+
r(Y, "e");
|
|
13
13
|
function dt(t) {
|
|
14
14
|
return (function(e) {
|
|
15
|
-
if (Array.isArray(e)) return
|
|
15
|
+
if (Array.isArray(e)) return Y(e);
|
|
16
16
|
})(t) || (function(e) {
|
|
17
17
|
if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
|
|
18
18
|
})(t) || (function(e, i) {
|
|
19
19
|
if (e) {
|
|
20
|
-
if (typeof e == "string") return
|
|
20
|
+
if (typeof e == "string") return Y(e, i);
|
|
21
21
|
var n = Object.prototype.toString.call(e).slice(8, -1);
|
|
22
22
|
if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(n);
|
|
23
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return
|
|
23
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Y(e, i);
|
|
24
24
|
}
|
|
25
25
|
})(t) || (function() {
|
|
26
26
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
27
27
|
})();
|
|
28
28
|
}
|
|
29
29
|
r(dt, "i");
|
|
30
|
-
var
|
|
30
|
+
var V = { isEnabled: /* @__PURE__ */ r(function() {
|
|
31
31
|
var t;
|
|
32
32
|
return (t = window.TAGIFY_DEBUG) === null || t === void 0 || t;
|
|
33
33
|
}, "isEnabled"), log: /* @__PURE__ */ r(function() {
|
|
@@ -42,27 +42,27 @@ var L = { isEnabled: /* @__PURE__ */ r(function() {
|
|
|
42
42
|
return t = "" + t, e = "" + e, n && (t = t.trim(), e = e.trim()), i ? t == e : t.toLowerCase() == e.toLowerCase();
|
|
43
43
|
}, "s"), ut = /* @__PURE__ */ r(function(t, e) {
|
|
44
44
|
return t && Array.isArray(t) && t.map((function(i) {
|
|
45
|
-
return
|
|
45
|
+
return at(i, e);
|
|
46
46
|
}));
|
|
47
47
|
}, "a");
|
|
48
|
-
function
|
|
48
|
+
function at(t, e) {
|
|
49
49
|
var i, n = {};
|
|
50
50
|
for (i in t) e.indexOf(i) < 0 && (n[i] = t[i]);
|
|
51
51
|
return n;
|
|
52
52
|
}
|
|
53
|
-
r(
|
|
54
|
-
function
|
|
53
|
+
r(at, "o");
|
|
54
|
+
function Z(t) {
|
|
55
55
|
return new DOMParser().parseFromString(t.trim(), "text/html").body.firstElementChild;
|
|
56
56
|
}
|
|
57
|
-
r(
|
|
57
|
+
r(Z, "r");
|
|
58
58
|
function ct(t, e) {
|
|
59
59
|
for (e = e || "previous"; t = t[e + "Sibling"]; ) if (t.nodeType == 3) return t;
|
|
60
60
|
}
|
|
61
61
|
r(ct, "l");
|
|
62
|
-
function
|
|
62
|
+
function R(t) {
|
|
63
63
|
return typeof t == "string" ? t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/`|'/g, "'") : t;
|
|
64
64
|
}
|
|
65
|
-
r(
|
|
65
|
+
r(R, "d");
|
|
66
66
|
function M(t) {
|
|
67
67
|
var e = Object.prototype.toString.call(t).split(" ")[1].slice(0, -1);
|
|
68
68
|
return t === Object(t) && e != "Array" && e != "Function" && e != "RegExp" && e != "HTMLUnknownElement";
|
|
@@ -131,11 +131,11 @@ function pt() {
|
|
|
131
131
|
}));
|
|
132
132
|
}
|
|
133
133
|
r(pt, "f");
|
|
134
|
-
function
|
|
134
|
+
function H(t) {
|
|
135
135
|
var e, i = wt.call(this, t), n = t == null || (e = t.classList) === null || e === void 0 ? void 0 : e.contains(this.settings.classNames.tag);
|
|
136
136
|
return i && n;
|
|
137
137
|
}
|
|
138
|
-
r(
|
|
138
|
+
r(H, "m");
|
|
139
139
|
function ft(t) {
|
|
140
140
|
return wt.call(this, t) && t?.closest(this.settings.classNames.tagSelector);
|
|
141
141
|
}
|
|
@@ -151,7 +151,7 @@ function Tt(t, e) {
|
|
|
151
151
|
}
|
|
152
152
|
r(Tt, "w");
|
|
153
153
|
function y(t, e, i) {
|
|
154
|
-
return t ? (e && (t.__tagifyTagData = i ? e : w({}, t.__tagifyTagData || {}, e)), t.__tagifyTagData) : (
|
|
154
|
+
return t ? (e && (t.__tagifyTagData = i ? e : w({}, t.__tagifyTagData || {}, e)), t.__tagifyTagData) : (V.warn("tag element doesn't exist", { tagElm: t, data: e }), e);
|
|
155
155
|
}
|
|
156
156
|
r(y, "y");
|
|
157
157
|
function k(t) {
|
|
@@ -170,7 +170,7 @@ function Ot(t, e) {
|
|
|
170
170
|
}));
|
|
171
171
|
}
|
|
172
172
|
r(Ot, "O");
|
|
173
|
-
var
|
|
173
|
+
var tt = { delimiters: ",", pattern: null, tagTextProp: "value", maxTags: 1 / 0, callbacks: {}, addTagOnBlur: !0, addTagOn: ["blur", "tab", "enter"], onChangeAfterBlur: !0, duplicates: !1, whitelist: [], blacklist: [], enforceWhitelist: !1, userInput: !0, focusable: !0, focusInputOnRemove: !0, keepInvalidTags: !1, createInvalidTags: !0, mixTagsAllowedAfter: /,|\.|\:|\s/, mixTagsInterpolator: ["[[", "]]"], backspace: !0, skipInvalid: !1, pasteAsTags: !0, editTags: { clicks: 2, keepInvalid: !0 }, transformTag: /* @__PURE__ */ r(function() {
|
|
174
174
|
}, "transformTag"), trim: !0, a11y: { focusableTags: !1 }, mixMode: { insertAfterTag: " " }, autoComplete: { enabled: !0, rightKey: !1, tabKey: !1 }, classNames: { namespace: "tagify", mixMode: "tagify--mix", selectMode: "tagify--select", input: "tagify__input", focus: "tagify--focus", tagNoAnimation: "tagify--noAnim", tagInvalid: "tagify--invalid", tagNotAllowed: "tagify--notAllowed", scopeLoading: "tagify--loading", hasMaxTags: "tagify--hasMaxTags", hasNoTags: "tagify--noTags", empty: "tagify--empty", inputInvalid: "tagify__input--invalid", dropdown: "tagify__dropdown", dropdownWrapper: "tagify__dropdown__wrapper", dropdownHeader: "tagify__dropdown__header", dropdownFooter: "tagify__dropdown__footer", dropdownItem: "tagify__dropdown__item", dropdownItemActive: "tagify__dropdown__item--active", dropdownItemHidden: "tagify__dropdown__item--hidden", dropdownItemSelected: "tagify__dropdown__item--selected", dropdownInital: "tagify__dropdown--initial", tag: "tagify__tag", tagText: "tagify__tag-text", tagX: "tagify__tag__removeBtn", tagLoading: "tagify__tag--loading", tagEditing: "tagify__tag--editable", tagFlash: "tagify__tag--flash", tagHide: "tagify__tag--hide" }, dropdown: { classname: "", enabled: 2, maxItems: 10, searchKeys: ["value", "searchBy"], fuzzySearch: !0, caseSensitive: !1, accentedSearch: !0, includeSelectedTags: !1, escapeHTML: !0, highlightFirst: !0, closeOnSelect: !0, clearOnSelect: !0, position: "all", appendTarget: null }, hooks: { beforeRemoveTag: /* @__PURE__ */ r(function() {
|
|
175
175
|
return Promise.resolve();
|
|
176
176
|
}, "beforeRemoveTag"), beforePaste: /* @__PURE__ */ r(function() {
|
|
@@ -209,33 +209,33 @@ function kt(t, e) {
|
|
|
209
209
|
})), t;
|
|
210
210
|
}
|
|
211
211
|
r(kt, "I");
|
|
212
|
-
function
|
|
212
|
+
function et(t, e) {
|
|
213
213
|
(e == null || e > t.length) && (e = t.length);
|
|
214
214
|
for (var i = 0, n = new Array(e); i < e; i++) n[i] = t[i];
|
|
215
215
|
return n;
|
|
216
216
|
}
|
|
217
|
-
r(
|
|
218
|
-
function
|
|
217
|
+
r(et, "E");
|
|
218
|
+
function Vt(t, e, i) {
|
|
219
219
|
return e in t ? Object.defineProperty(t, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = i, t;
|
|
220
220
|
}
|
|
221
|
-
r(
|
|
222
|
-
function
|
|
221
|
+
r(Vt, "M");
|
|
222
|
+
function Lt(t) {
|
|
223
223
|
return (function(e) {
|
|
224
|
-
if (Array.isArray(e)) return
|
|
224
|
+
if (Array.isArray(e)) return et(e);
|
|
225
225
|
})(t) || (function(e) {
|
|
226
226
|
if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
|
|
227
227
|
})(t) || (function(e, i) {
|
|
228
228
|
if (e) {
|
|
229
|
-
if (typeof e == "string") return
|
|
229
|
+
if (typeof e == "string") return et(e, i);
|
|
230
230
|
var n = Object.prototype.toString.call(e).slice(8, -1);
|
|
231
231
|
if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(n);
|
|
232
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return
|
|
232
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return et(e, i);
|
|
233
233
|
}
|
|
234
234
|
})(t) || (function() {
|
|
235
235
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
236
236
|
})();
|
|
237
237
|
}
|
|
238
|
-
r(
|
|
238
|
+
r(Lt, "N");
|
|
239
239
|
function Pt() {
|
|
240
240
|
for (var t in this.dropdown = {}, this._dropdown) this.dropdown[t] = typeof this._dropdown[t] == "function" ? this._dropdown[t].bind(this) : this._dropdown[t];
|
|
241
241
|
this.dropdown.refs(), this.DOM.dropdown.__tagify = this;
|
|
@@ -247,7 +247,7 @@ var K, B, jt = (K = (function(t) {
|
|
|
247
247
|
typeof Object.getOwnPropertySymbols == "function" && (n = n.concat(Object.getOwnPropertySymbols(i).filter((function(s) {
|
|
248
248
|
return Object.getOwnPropertyDescriptor(i, s).enumerable;
|
|
249
249
|
})))), n.forEach((function(s) {
|
|
250
|
-
|
|
250
|
+
Vt(t, s, i[s]);
|
|
251
251
|
}));
|
|
252
252
|
}
|
|
253
253
|
return t;
|
|
@@ -313,7 +313,7 @@ var K, B, jt = (K = (function(t) {
|
|
|
313
313
|
}));
|
|
314
314
|
} else e.dropdown.hide(), o || e.addTags(e.state.inputText.trim(), !0);
|
|
315
315
|
})).catch((function(b) {
|
|
316
|
-
return
|
|
316
|
+
return V.warn(b);
|
|
317
317
|
}));
|
|
318
318
|
break;
|
|
319
319
|
case "Backspace":
|
|
@@ -337,7 +337,7 @@ var K, B, jt = (K = (function(t) {
|
|
|
337
337
|
}), 100), this.settings.hooks.suggestionClick(t, { tagify: this, tagData: n, suggestionElm: i }).then((function() {
|
|
338
338
|
i ? e.dropdown.selectOption(i, t) : e.dropdown.hide();
|
|
339
339
|
})).catch((function(s) {
|
|
340
|
-
return
|
|
340
|
+
return V.warn(s);
|
|
341
341
|
}));
|
|
342
342
|
}
|
|
343
343
|
}, "onClick"), onScroll: /* @__PURE__ */ r(function(t) {
|
|
@@ -390,19 +390,19 @@ var K, B, jt = (K = (function(t) {
|
|
|
390
390
|
return t || (e = this.state.dropdown.suggestions), this.addTags(e, !0), this;
|
|
391
391
|
}, "selectAll"), filterListItems: /* @__PURE__ */ r(function(t, e) {
|
|
392
392
|
var i, n, s, a, o, l, d = /* @__PURE__ */ r(function() {
|
|
393
|
-
var b, C,
|
|
393
|
+
var b, C, P = void 0, j = void 0;
|
|
394
394
|
b = p[I], n = ((C = Object) != null && typeof Symbol < "u" && C[Symbol.hasInstance] ? C[Symbol.hasInstance](b) : b instanceof C) ? p[I] : { value: p[I] };
|
|
395
395
|
var O, S = Object.keys(n).some((function(x) {
|
|
396
396
|
return D.includes(x);
|
|
397
397
|
})) ? D : ["value"];
|
|
398
398
|
g.fuzzySearch && !e.exact ? (a = S.reduce((function(x, E) {
|
|
399
399
|
return x + " " + (n[E] || "");
|
|
400
|
-
}), "").toLowerCase().trim(), g.accentedSearch && (a = J(a), l = J(l)),
|
|
400
|
+
}), "").toLowerCase().trim(), g.accentedSearch && (a = J(a), l = J(l)), P = a.indexOf(l) == 0, j = a === l, O = a, s = l.toLowerCase().split(" ").every((function(x) {
|
|
401
401
|
return O.includes(x.toLowerCase());
|
|
402
|
-
}))) : (
|
|
402
|
+
}))) : (P = !0, s = S.some((function(x) {
|
|
403
403
|
var E = "" + (n[x] || "");
|
|
404
|
-
return g.accentedSearch && (E = J(E), l = J(l)), g.caseSensitive || (E = E.toLowerCase()),
|
|
405
|
-
}))), o = !g.includeSelectedTags && i.isTagDuplicate(M(n) ? n.value : n), s && !o && (
|
|
404
|
+
return g.accentedSearch && (E = J(E), l = J(l)), g.caseSensitive || (E = E.toLowerCase()), j = E === l, e.exact ? E === l : E.indexOf(l) == 0;
|
|
405
|
+
}))), o = !g.includeSelectedTags && i.isTagDuplicate(M(n) ? n.value : n), s && !o && (j && P ? f.push(n) : g.sortby == "startsWith" && P ? h.unshift(n) : h.push(n));
|
|
406
406
|
}, "l"), u = this, c = this.settings, g = c.dropdown, h = (e = e || {}, []), f = [], p = c.whitelist, m = g.maxItems >= 0 ? g.maxItems : 1 / 0, v = g.includeSelectedTags, T = typeof g.sortby == "function", D = g.searchKeys, I = 0;
|
|
407
407
|
if (!(t = c.mode == "select" && this.value.length && this.value[0][c.tagTextProp] == t ? "" : t) || !D.length) {
|
|
408
408
|
h = v ? p : p.filter((function(b) {
|
|
@@ -421,7 +421,7 @@ var K, B, jt = (K = (function(t) {
|
|
|
421
421
|
return w([], t).map((function(i, n) {
|
|
422
422
|
typeof i != "string" && typeof i != "number" || (i = { value: i });
|
|
423
423
|
var s = e.dropdown.getMappedValue(i);
|
|
424
|
-
return s = typeof s == "string" && e.settings.dropdown.escapeHTML ?
|
|
424
|
+
return s = typeof s == "string" && e.settings.dropdown.escapeHTML ? R(s) : s, e.settings.templates.dropdownItem.apply(e, [kt(Ct({}, i), { mappedValue: s }), e]);
|
|
425
425
|
})).join("");
|
|
426
426
|
}, "createListHTML") }), B = (B = { refs: /* @__PURE__ */ r(function() {
|
|
427
427
|
this.DOM.dropdown = this.parseTemplate("dropdown", [this.settings]), this.DOM.dropdown.content = this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-wrapper']");
|
|
@@ -430,7 +430,7 @@ var K, B, jt = (K = (function(t) {
|
|
|
430
430
|
}, "getHeaderRef"), getFooterRef: /* @__PURE__ */ r(function() {
|
|
431
431
|
return this.DOM.dropdown.querySelector("[data-selector='tagify-suggestions-footer']");
|
|
432
432
|
}, "getFooterRef"), getAllSuggestionsRefs: /* @__PURE__ */ r(function() {
|
|
433
|
-
return
|
|
433
|
+
return Lt(this.DOM.dropdown.content.querySelectorAll(this.settings.classNames.dropdownItemSelector));
|
|
434
434
|
}, "getAllSuggestionsRefs"), show: /* @__PURE__ */ r(function(t) {
|
|
435
435
|
var e, i, n, s = this, a = this.settings, o = a.mode == "mix" && !a.enforceWhitelist, l = !a.whitelist || !a.whitelist.length, d = a.dropdown.position == "manual";
|
|
436
436
|
if (t = t === void 0 ? this.state.inputText : t, !(l && !o && !a.templates.dropdownItemNoMatch || a.dropdown.enabled === !1 || this.state.isLoading || this.settings.readonly)) {
|
|
@@ -478,8 +478,8 @@ var K, B, jt = (K = (function(t) {
|
|
|
478
478
|
if (b == "text" ? (a = (n = (function() {
|
|
479
479
|
var O = document.getSelection();
|
|
480
480
|
if (O.rangeCount) {
|
|
481
|
-
var S, x, E = O.getRangeAt(0), z = E.startContainer,
|
|
482
|
-
if (
|
|
481
|
+
var S, x, E = O.getRangeAt(0), z = E.startContainer, Q = E.startOffset;
|
|
482
|
+
if (Q > 0) return (x = document.createRange()).setStart(z, Q - 1), x.setEnd(z, Q), { left: (S = x.getBoundingClientRect()).right, top: S.top, bottom: S.bottom };
|
|
483
483
|
if (z.getBoundingClientRect) return z.getBoundingClientRect();
|
|
484
484
|
}
|
|
485
485
|
return { left: -9999, top: -9999 };
|
|
@@ -488,14 +488,14 @@ var K, B, jt = (K = (function(t) {
|
|
|
488
488
|
for (O = O.parentNode; O && O != D; ) S += O.offsetTop || 0, x += O.offsetLeft || 0, O = O.parentNode;
|
|
489
489
|
return { top: S, left: x };
|
|
490
490
|
})(i), n = C.getBoundingClientRect(), s = v ? -1 : n.top - d.top, a = (v ? n.height : n.bottom - d.top) - 1, o = v ? -1 : n.left - d.left, l = n.width + "px"), !m) {
|
|
491
|
-
var
|
|
491
|
+
var P = (function() {
|
|
492
492
|
for (var O = 0, S = e.appendTarget.parentNode; S; ) O += S.scrollTop || 0, S = S.parentNode;
|
|
493
493
|
return O;
|
|
494
494
|
})();
|
|
495
|
-
s +=
|
|
495
|
+
s += P, a += P;
|
|
496
496
|
}
|
|
497
|
-
var
|
|
498
|
-
s = Math.floor(s), a = Math.ceil(a), c = N - o < 120, g = ((u = (
|
|
497
|
+
var j;
|
|
498
|
+
s = Math.floor(s), a = Math.ceil(a), c = N - o < 120, g = ((u = (j = e.placeAbove) !== null && j !== void 0 ? j : I - n.bottom < t) ? s : a) + T, h = o + (p && n.width || 0) + window.pageXOffset, h = b == "text" && c ? "right: 0;" : "left: ".concat(h, "px;"), f.style.cssText = "".concat(h, " top: ").concat(g, "px; min-width: ").concat(l, "; max-width: ").concat(l), f.setAttribute("placement", u ? "top" : "bottom"), f.setAttribute("position", b);
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
501
|
}, "position") }) != null ? B : {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(K, Object.getOwnPropertyDescriptors(B)) : (function(t, e) {
|
|
@@ -605,16 +605,16 @@ function Ht(t, e) {
|
|
|
605
605
|
})();
|
|
606
606
|
}
|
|
607
607
|
r(Ht, "F");
|
|
608
|
-
function
|
|
608
|
+
function it(t, e) {
|
|
609
609
|
(e == null || e > t.length) && (e = t.length);
|
|
610
610
|
for (var i = 0, n = new Array(e); i < e; i++) n[i] = t[i];
|
|
611
611
|
return n;
|
|
612
612
|
}
|
|
613
|
-
r(
|
|
614
|
-
function
|
|
613
|
+
r(it, "H");
|
|
614
|
+
function F(t, e, i) {
|
|
615
615
|
return e in t ? Object.defineProperty(t, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = i, t;
|
|
616
616
|
}
|
|
617
|
-
r(
|
|
617
|
+
r(F, "B");
|
|
618
618
|
function yt(t, e) {
|
|
619
619
|
return e != null && typeof Symbol < "u" && e[Symbol.hasInstance] ? !!e[Symbol.hasInstance](t) : t instanceof e;
|
|
620
620
|
}
|
|
@@ -632,23 +632,23 @@ function Bt(t, e) {
|
|
|
632
632
|
})), t;
|
|
633
633
|
}
|
|
634
634
|
r(Bt, "q");
|
|
635
|
-
function
|
|
635
|
+
function nt(t) {
|
|
636
636
|
return (function(e) {
|
|
637
|
-
if (Array.isArray(e)) return
|
|
637
|
+
if (Array.isArray(e)) return it(e);
|
|
638
638
|
})(t) || (function(e) {
|
|
639
639
|
if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
|
|
640
640
|
})(t) || (function(e, i) {
|
|
641
641
|
if (e) {
|
|
642
|
-
if (typeof e == "string") return
|
|
642
|
+
if (typeof e == "string") return it(e, i);
|
|
643
643
|
var n = Object.prototype.toString.call(e).slice(8, -1);
|
|
644
644
|
if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(n);
|
|
645
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return
|
|
645
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return it(e, i);
|
|
646
646
|
}
|
|
647
647
|
})(t) || (function() {
|
|
648
648
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
649
649
|
})();
|
|
650
650
|
}
|
|
651
|
-
r(
|
|
651
|
+
r(nt, "U");
|
|
652
652
|
var Wt = { customBinding: /* @__PURE__ */ r(function() {
|
|
653
653
|
var t = this;
|
|
654
654
|
this.customEventsList.forEach((function(e) {
|
|
@@ -685,7 +685,7 @@ var Wt = { customBinding: /* @__PURE__ */ r(function() {
|
|
|
685
685
|
}, "bindGlobal"), unbindGlobal: /* @__PURE__ */ r(function() {
|
|
686
686
|
this.events.bindGlobal.call(this, !0);
|
|
687
687
|
}, "unbindGlobal"), callbacks: { onFocusBlur: /* @__PURE__ */ r(function(t) {
|
|
688
|
-
var e, i, n = this.settings, s = ft.call(this, t.relatedTarget), a =
|
|
688
|
+
var e, i, n = this.settings, s = ft.call(this, t.relatedTarget), a = H.call(this, t.target), o = t.target.classList.contains(n.classNames.tagX), l = t.type == "focusin", d = t.type == "focusout";
|
|
689
689
|
o && n.mode != "mix" && n.focusInputOnRemove && this.DOM.input.focus(), s && l && !a && !o && this.toggleFocusClass(this.state.hasFocus = +/* @__PURE__ */ new Date());
|
|
690
690
|
var u = t.target ? this.trim(this.DOM.input.textContent) : "", c = (i = this.value) === null || i === void 0 || (e = i[0]) === null || e === void 0 ? void 0 : e[n.tagTextProp], g = n.dropdown.enabled >= 0, h = { relatedTarget: t.relatedTarget }, f = this.state.actions.selectOption && (g || !n.dropdown.closeOnSelect), p = this.state.actions.addNew && g;
|
|
691
691
|
if (d) {
|
|
@@ -725,7 +725,7 @@ var Wt = { customBinding: /* @__PURE__ */ r(function() {
|
|
|
725
725
|
break;
|
|
726
726
|
case "Enter":
|
|
727
727
|
if (u) return void this.removeTags(t.target.parentNode);
|
|
728
|
-
i.a11y.focusableTags &&
|
|
728
|
+
i.a11y.focusableTags && H.call(this, n) && setTimeout(this.editTag.bind(this), 0, n);
|
|
729
729
|
break;
|
|
730
730
|
case "ArrowDown":
|
|
731
731
|
this.state.dropdown.visible || i.mode == "mix" || this.dropdown.show();
|
|
@@ -859,7 +859,7 @@ var Wt = { customBinding: /* @__PURE__ */ r(function() {
|
|
|
859
859
|
typeof Object.getOwnPropertySymbols == "function" && (l = l.concat(Object.getOwnPropertySymbols(o).filter((function(d) {
|
|
860
860
|
return Object.getOwnPropertyDescriptor(o, d).enumerable;
|
|
861
861
|
})))), l.forEach((function(d) {
|
|
862
|
-
|
|
862
|
+
F(s, d, o[d]);
|
|
863
863
|
}));
|
|
864
864
|
}
|
|
865
865
|
return s;
|
|
@@ -878,7 +878,7 @@ var Wt = { customBinding: /* @__PURE__ */ r(function() {
|
|
|
878
878
|
}, "onPaste"), onDrop: /* @__PURE__ */ r(function(t) {
|
|
879
879
|
t.preventDefault();
|
|
880
880
|
}, "onDrop"), onEditTagInput: /* @__PURE__ */ r(function(t, e) {
|
|
881
|
-
var i, n = t.closest("." + this.settings.classNames.tag), s = this.getNodeIndex(n), a = y(n), o = this.input.normalize.call(this, t), l = (
|
|
881
|
+
var i, n = t.closest("." + this.settings.classNames.tag), s = this.getNodeIndex(n), a = y(n), o = this.input.normalize.call(this, t), l = (F(i = {}, this.settings.tagTextProp, o), F(i, "__tagId", a.__tagId), i), d = this.validateTag(l);
|
|
882
882
|
this.editTagChangeDetected(w(a, l)) || t.originalIsValid !== !0 || (d = !0), n.classList.toggle(this.settings.classNames.tagInvalid, d !== !0), a.__isValid = d, n.title = d === !0 ? a.title || a.value : d, o.length >= this.settings.dropdown.enabled && (this.state.editing && (this.state.editing.value = o), this.dropdown.show(o)), this.trigger("edit:input", { tag: n, index: s, data: w({}, this.value[s], { newValue: o }), event: e });
|
|
883
883
|
}, "onEditTagInput"), onEditTagPaste: /* @__PURE__ */ r(function(t, e) {
|
|
884
884
|
var i = (e.clipboardData || window.clipboardData).getData("Text");
|
|
@@ -890,13 +890,13 @@ var Wt = { customBinding: /* @__PURE__ */ r(function() {
|
|
|
890
890
|
}, "onEditTagClick"), onEditTagFocus: /* @__PURE__ */ r(function(t) {
|
|
891
891
|
this.state.editing = { scope: t, input: t.querySelector("[contenteditable]") };
|
|
892
892
|
}, "onEditTagFocus"), onEditTagBlur: /* @__PURE__ */ r(function(t, e) {
|
|
893
|
-
var i =
|
|
893
|
+
var i = H.call(this, e.relatedTarget);
|
|
894
894
|
if (this.settings.mode == "select" && i && e.relatedTarget.contains(e.target)) this.dropdown.hide();
|
|
895
895
|
else if (this.state.editing && (this.state.hasFocus || this.toggleFocusClass(), this.DOM.scope.contains(document.activeElement) || this.trigger("blur", {}), this.DOM.scope.contains(t))) {
|
|
896
|
-
var n, s, a, o = this.settings, l = t.closest("." + o.classNames.tag), d = y(l), u = this.input.normalize.call(this, t), c = (
|
|
896
|
+
var n, s, a, o = this.settings, l = t.closest("." + o.classNames.tag), d = y(l), u = this.input.normalize.call(this, t), c = (F(n = {}, o.tagTextProp, u), F(n, "__tagId", d.__tagId), n), g = d.__originalData, h = this.editTagChangeDetected(w(d, c)), f = this.validateTag(c);
|
|
897
897
|
if (u) if (h) {
|
|
898
898
|
var p;
|
|
899
|
-
if (s = this.hasMaxTags(), a = w({}, g, (
|
|
899
|
+
if (s = this.hasMaxTags(), a = w({}, g, (F(p = {}, o.tagTextProp, this.trim(u)), F(p, "__isValid", f), p)), o.transformTag.call(this, a, g), (f = (!s || g.__isValid === !0) && this.validateTag(a)) !== !0) {
|
|
900
900
|
if (this.trigger("invalid", { data: a, tag: l, message: f }), o.editTags.keepInvalid) return;
|
|
901
901
|
o.keepInvalidTags ? a.__isValid = f : a = g;
|
|
902
902
|
} else o.keepInvalidTags && (delete a.title, delete a["aria-invalid"], delete a.class);
|
|
@@ -930,8 +930,8 @@ var Wt = { customBinding: /* @__PURE__ */ r(function() {
|
|
|
930
930
|
else if (s.nodeType == 1 && s.querySelector(e.settings.classNames.tagSelector)) {
|
|
931
931
|
var a, o = document.createTextNode("");
|
|
932
932
|
s.childNodes[0].nodeType == 3 && s.previousSibling.nodeName != "BR" && (o = document.createTextNode(`
|
|
933
|
-
`)), (a = s).replaceWith.apply(a,
|
|
934
|
-
} else if (
|
|
933
|
+
`)), (a = s).replaceWith.apply(a, nt([o].concat(nt(nt(s.childNodes).slice(0, -1))))), k(o);
|
|
934
|
+
} else if (H.call(e, s)) {
|
|
935
935
|
var l;
|
|
936
936
|
if (((l = s.previousSibling) === null || l === void 0 ? void 0 : l.nodeType) != 3 || s.previousSibling.textContent || s.previousSibling.remove(), s.previousSibling && s.previousSibling.nodeName == "BR") {
|
|
937
937
|
s.previousSibling.replaceWith(`
|
|
@@ -941,58 +941,58 @@ var Wt = { customBinding: /* @__PURE__ */ r(function() {
|
|
|
941
941
|
} else s.previousSibling && !y(s.previousSibling) || s.before("");
|
|
942
942
|
}
|
|
943
943
|
})), n.removedNodes.forEach((function(s) {
|
|
944
|
-
s && s.nodeName == "BR" &&
|
|
944
|
+
s && s.nodeName == "BR" && H.call(e, i) && (e.removeTags(i), e.fixFirefoxLastTagNoCaret());
|
|
945
945
|
}));
|
|
946
946
|
}));
|
|
947
947
|
var i = this.DOM.input.lastChild;
|
|
948
948
|
i && i.nodeValue == "" && i.remove(), i && i.nodeName == "BR" || this.DOM.input.appendChild(document.createElement("br"));
|
|
949
949
|
}, "onInputDOMChange") } };
|
|
950
|
-
function
|
|
950
|
+
function st(t, e) {
|
|
951
951
|
(e == null || e > t.length) && (e = t.length);
|
|
952
952
|
for (var i = 0, n = new Array(e); i < e; i++) n[i] = t[i];
|
|
953
953
|
return n;
|
|
954
954
|
}
|
|
955
|
-
r(
|
|
956
|
-
function
|
|
955
|
+
r(st, "z");
|
|
956
|
+
function rt(t, e, i) {
|
|
957
957
|
return e in t ? Object.defineProperty(t, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = i, t;
|
|
958
958
|
}
|
|
959
|
-
r(
|
|
960
|
-
function
|
|
959
|
+
r(rt, "X");
|
|
960
|
+
function A(t, e) {
|
|
961
961
|
return e != null && typeof Symbol < "u" && e[Symbol.hasInstance] ? !!e[Symbol.hasInstance](t) : t instanceof e;
|
|
962
962
|
}
|
|
963
|
-
r(
|
|
963
|
+
r(A, "J");
|
|
964
964
|
function bt(t) {
|
|
965
965
|
for (var e = 1; e < arguments.length; e++) {
|
|
966
966
|
var i = arguments[e] != null ? arguments[e] : {}, n = Object.keys(i);
|
|
967
967
|
typeof Object.getOwnPropertySymbols == "function" && (n = n.concat(Object.getOwnPropertySymbols(i).filter((function(s) {
|
|
968
968
|
return Object.getOwnPropertyDescriptor(i, s).enumerable;
|
|
969
969
|
})))), n.forEach((function(s) {
|
|
970
|
-
|
|
970
|
+
rt(t, s, i[s]);
|
|
971
971
|
}));
|
|
972
972
|
}
|
|
973
973
|
return t;
|
|
974
974
|
}
|
|
975
975
|
r(bt, "G");
|
|
976
|
-
function
|
|
976
|
+
function $(t) {
|
|
977
977
|
return (function(e) {
|
|
978
|
-
if (Array.isArray(e)) return
|
|
978
|
+
if (Array.isArray(e)) return st(e);
|
|
979
979
|
})(t) || (function(e) {
|
|
980
980
|
if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
|
|
981
981
|
})(t) || (function(e, i) {
|
|
982
982
|
if (e) {
|
|
983
|
-
if (typeof e == "string") return
|
|
983
|
+
if (typeof e == "string") return st(e, i);
|
|
984
984
|
var n = Object.prototype.toString.call(e).slice(8, -1);
|
|
985
985
|
if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(n);
|
|
986
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return
|
|
986
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return st(e, i);
|
|
987
987
|
}
|
|
988
988
|
})(t) || (function() {
|
|
989
989
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
990
990
|
})();
|
|
991
991
|
}
|
|
992
|
-
r(
|
|
993
|
-
function
|
|
992
|
+
r($, "$");
|
|
993
|
+
function X(t, e) {
|
|
994
994
|
if (!t) {
|
|
995
|
-
|
|
995
|
+
V.warn("input element not found", t);
|
|
996
996
|
var i = new Proxy(this, { get: /* @__PURE__ */ r(function() {
|
|
997
997
|
return function() {
|
|
998
998
|
return i;
|
|
@@ -1000,7 +1000,7 @@ function $(t, e) {
|
|
|
1000
1000
|
}, "get") });
|
|
1001
1001
|
return i;
|
|
1002
1002
|
}
|
|
1003
|
-
if (t.__tagify) return
|
|
1003
|
+
if (t.__tagify) return V.warn("input element is already Tagified - Same instance is returned.", t), t.__tagify;
|
|
1004
1004
|
var n;
|
|
1005
1005
|
w(this, (function(s) {
|
|
1006
1006
|
var a = document.createTextNode(""), o = {};
|
|
@@ -1036,7 +1036,7 @@ function $(t, e) {
|
|
|
1036
1036
|
if ((h = c.cloneData ? w({}, h) : h).tagify = this, u.event && (h.event = this.cloneEvent(u.event)), vt(u, Object)) for (var f in u) vt(u[f], HTMLElement) && (h[f] = u[f]);
|
|
1037
1037
|
g = new CustomEvent(d, { detail: h });
|
|
1038
1038
|
} catch (p) {
|
|
1039
|
-
|
|
1039
|
+
V.warn(p);
|
|
1040
1040
|
}
|
|
1041
1041
|
a.dispatchEvent(g);
|
|
1042
1042
|
}
|
|
@@ -1066,11 +1066,11 @@ function $(t, e) {
|
|
|
1066
1066
|
};
|
|
1067
1067
|
})(e.id), this.applySettings(t, e), this.state = { inputText: "", editing: !1, composing: !1, actions: {}, mixMode: {}, dropdown: {}, flaggedTags: {} }, this.value = [], this.listeners = {}, this.DOM = {}, this.build(t), Pt.call(this), this.getCSSVars(), this.loadOriginalValues(), this.events.customBinding.call(this), this.events.binding.call(this), t.autofocus && this.DOM.input.focus(), t.__tagify = this;
|
|
1068
1068
|
}
|
|
1069
|
-
r(
|
|
1070
|
-
|
|
1069
|
+
r(X, "Q");
|
|
1070
|
+
X.prototype = { _dropdown: jt, placeCaretAfterNode: k, getSetTagData: y, helpers: { sameStr: U, removeCollectionProp: ut, omit: at, isObject: M, parseHTML: Z, escapeHTML: R, extend: w, concatWithoutDups: gt, getUID: pt, isNodeTag: H }, customEventsList: ["change", "add", "remove", "invalid", "input", "paste", "click", "keydown", "focus", "blur", "edit:input", "edit:beforeUpdate", "edit:updated", "edit:start", "edit:keydown", "dropdown:show", "dropdown:hide", "dropdown:select", "dropdown:updated", "dropdown:noMatch", "dropdown:scroll"], dataProps: ["__isValid", "__removed", "__originalData", "__originalHTML", "__tagId"], trim: /* @__PURE__ */ r(function(t) {
|
|
1071
1071
|
return this.settings.trim && t && typeof t == "string" ? t.trim() : t;
|
|
1072
|
-
}, "trim"), parseHTML:
|
|
1073
|
-
return
|
|
1072
|
+
}, "trim"), parseHTML: Z, templates: Rt, parseTemplate: /* @__PURE__ */ r(function(t, e) {
|
|
1073
|
+
return Z((t = this.settings.templates[t] || t).apply(this, e));
|
|
1074
1074
|
}, "parseTemplate"), set whitelist(t) {
|
|
1075
1075
|
var e = t && Array.isArray(t);
|
|
1076
1076
|
this.settings.whitelist = e ? t : [], this.setPersistedData(e ? t : [], "whitelist");
|
|
@@ -1090,12 +1090,12 @@ $.prototype = { _dropdown: jt, placeCaretAfterNode: k, getSetTagData: y, helpers
|
|
|
1090
1090
|
for (var i in t) e(i);
|
|
1091
1091
|
}, "generateClassSelectors"), applySettings: /* @__PURE__ */ r(function(t, e) {
|
|
1092
1092
|
var i, n;
|
|
1093
|
-
|
|
1094
|
-
var s = w({},
|
|
1095
|
-
if (a.disabled = t.hasAttribute("disabled"), a.readonly = a.readonly || t.hasAttribute("readonly"), a.placeholder =
|
|
1093
|
+
tt.templates = this.templates;
|
|
1094
|
+
var s = w({}, tt, e.mode == "mix" ? { dropdown: { position: "text" } } : {}), a = this.settings = w({}, s, e);
|
|
1095
|
+
if (a.disabled = t.hasAttribute("disabled"), a.readonly = a.readonly || t.hasAttribute("readonly"), a.placeholder = R(t.getAttribute("placeholder") || a.placeholder || ""), a.required = t.hasAttribute("required"), this.generateClassSelectors(a.classNames), this.isIE && (a.autoComplete = !1), ["whitelist", "blacklist"].forEach((function(l) {
|
|
1096
1096
|
var d = t.getAttribute("data-" + l);
|
|
1097
|
-
d &&
|
|
1098
|
-
})), "autoComplete" in e && !M(e.autoComplete) && (a.autoComplete =
|
|
1097
|
+
d && A(d = d.split(a.delimiters), Array) && (a[l] = d);
|
|
1098
|
+
})), "autoComplete" in e && !M(e.autoComplete) && (a.autoComplete = tt.autoComplete, a.autoComplete.enabled = e.autoComplete), a.mode == "mix" && (a.pattern = a.pattern || /@/, a.autoComplete.rightKey = !0, a.delimiters = e.delimiters || null, a.tagTextProp && !a.dropdown.searchKeys.includes(a.tagTextProp) && a.dropdown.searchKeys.push(a.tagTextProp)), t.pattern) try {
|
|
1099
1099
|
a.pattern = new RegExp(t.pattern);
|
|
1100
1100
|
} catch {
|
|
1101
1101
|
}
|
|
@@ -1116,7 +1116,7 @@ $.prototype = { _dropdown: jt, placeCaretAfterNode: k, getSetTagData: y, helpers
|
|
|
1116
1116
|
}, "getAttributes"), getCustomAttributes: /* @__PURE__ */ r(function(t) {
|
|
1117
1117
|
if (!M(t)) return "";
|
|
1118
1118
|
var e, i = {};
|
|
1119
|
-
for (e in t) e.slice(0, 2) != "__" && e != "class" && t.hasOwnProperty(e) && t[e] !== void 0 && (i[e] =
|
|
1119
|
+
for (e in t) e.slice(0, 2) != "__" && e != "class" && t.hasOwnProperty(e) && t[e] !== void 0 && (i[e] = R(t[e]));
|
|
1120
1120
|
return i;
|
|
1121
1121
|
}, "getCustomAttributes"), setStateSelection: /* @__PURE__ */ r(function() {
|
|
1122
1122
|
var t = window.getSelection(), e = { anchorOffset: t.anchorOffset, anchorNode: t.anchorNode, range: t.getRangeAt && t.rangeCount && t.getRangeAt(0) };
|
|
@@ -1147,7 +1147,7 @@ $.prototype = { _dropdown: jt, placeCaretAfterNode: k, getSetTagData: y, helpers
|
|
|
1147
1147
|
if (this.removeAllTags(), t) if (i.mode == "mix") this.parseMixTags(t), (e = this.DOM.input.lastChild) && e.tagName == "BR" || this.DOM.input.insertAdjacentHTML("beforeend", "<br>");
|
|
1148
1148
|
else {
|
|
1149
1149
|
try {
|
|
1150
|
-
|
|
1150
|
+
A(JSON.parse(t), Array) && (t = JSON.parse(t));
|
|
1151
1151
|
} catch {
|
|
1152
1152
|
}
|
|
1153
1153
|
this.addTags(t, !0).forEach((function(s) {
|
|
@@ -1186,7 +1186,7 @@ $.prototype = { _dropdown: jt, placeCaretAfterNode: k, getSetTagData: y, helpers
|
|
|
1186
1186
|
if (e) {
|
|
1187
1187
|
t = typeof t == "number" ? t : !!t, e = e.lastChild || e;
|
|
1188
1188
|
var i = document.getSelection();
|
|
1189
|
-
if (
|
|
1189
|
+
if (A(i.focusNode, Element) && !this.DOM.input.contains(i.focusNode)) return !0;
|
|
1190
1190
|
try {
|
|
1191
1191
|
i.rangeCount >= 1 && ["Start", "End"].forEach((function(n) {
|
|
1192
1192
|
return i.getRangeAt(0)["set" + n](e, t || e.length);
|
|
@@ -1204,20 +1204,20 @@ $.prototype = { _dropdown: jt, placeCaretAfterNode: k, getSetTagData: y, helpers
|
|
|
1204
1204
|
}, "editTagChangeDetected"), getTagTextNode: /* @__PURE__ */ r(function(t) {
|
|
1205
1205
|
return t.querySelector(this.settings.classNames.tagTextSelector);
|
|
1206
1206
|
}, "getTagTextNode"), setTagTextNode: /* @__PURE__ */ r(function(t, e) {
|
|
1207
|
-
this.getTagTextNode(t).innerHTML =
|
|
1207
|
+
this.getTagTextNode(t).innerHTML = R(e);
|
|
1208
1208
|
}, "setTagTextNode"), editTag: /* @__PURE__ */ r(function(t, e) {
|
|
1209
1209
|
var i = this;
|
|
1210
1210
|
t = t || this.getLastTag(), e = e || {};
|
|
1211
1211
|
var n = this.settings, s = this.getTagTextNode(t), a = this.getNodeIndex(t), o = y(t), l = this.events.callbacks, d = !0, u = n.mode == "select";
|
|
1212
1212
|
if (!u && this.dropdown.hide(), s) {
|
|
1213
|
-
if (!
|
|
1213
|
+
if (!A(o, Object) || !("editable" in o) || o.editable) return o = y(t, { __originalData: w({}, o), __originalHTML: t.cloneNode(!0) }), y(o.__originalHTML, o.__originalData), s.setAttribute("contenteditable", !0), t.classList.add(n.classNames.tagEditing), this.events.callbacks.onEditTagFocus.call(this, t), s.addEventListener("click", l.onEditTagClick.bind(this, t)), s.addEventListener("blur", l.onEditTagBlur.bind(this, this.getTagTextNode(t))), s.addEventListener("input", l.onEditTagInput.bind(this, s)), s.addEventListener("paste", l.onEditTagPaste.bind(this, s)), s.addEventListener("keydown", (function(c) {
|
|
1214
1214
|
return l.onEditTagkeydown.call(i, c, t);
|
|
1215
1215
|
})), s.addEventListener("compositionstart", l.onCompositionStart.bind(this)), s.addEventListener("compositionend", l.onCompositionEnd.bind(this)), e.skipValidation || (d = this.editTagToggleValidity(t)), s.originalIsValid = d, this.trigger("edit:start", { tag: t, index: a, data: o, isValid: d }), s.focus(), !u && this.setRangeAtStartEnd(!1, s), n.dropdown.enabled === 0 && !u && this.dropdown.show(), this.state.hasFocus = !0, this;
|
|
1216
|
-
} else
|
|
1216
|
+
} else V.warn("Cannot find element in Tag template: .", n.classNames.tagTextSelector);
|
|
1217
1217
|
}, "editTag"), editTagToggleValidity: /* @__PURE__ */ r(function(t, e) {
|
|
1218
1218
|
var i;
|
|
1219
1219
|
if (e = e || y(t)) return (i = !("__isValid" in e) || e.__isValid === !0) || this.removeTagsFromValue(t), this.update(), t.classList.toggle(this.settings.classNames.tagNotAllowed, !i), e.__isValid = i, e.__isValid;
|
|
1220
|
-
|
|
1220
|
+
V.warn("tag has no data: ", t, e);
|
|
1221
1221
|
}, "editTagToggleValidity"), onEditTagDone: /* @__PURE__ */ r(function(t, e) {
|
|
1222
1222
|
t = t || this.state.editing.scope, e = e || {};
|
|
1223
1223
|
var i, n, s = this.settings, a = { tag: t, index: this.getNodeIndex(t), previousData: y(t), data: e };
|
|
@@ -1231,7 +1231,7 @@ $.prototype = { _dropdown: jt, placeCaretAfterNode: k, getSetTagData: y, helpers
|
|
|
1231
1231
|
this.value.length = 0;
|
|
1232
1232
|
var e = this.settings.classNames, i = [e.tagNotAllowed.split(" ")[0], e.tagHide];
|
|
1233
1233
|
[].forEach.call(this.getTagElms(), (function(n) {
|
|
1234
|
-
|
|
1234
|
+
$(n.classList).some((function(s) {
|
|
1235
1235
|
return i.includes(s);
|
|
1236
1236
|
})) || t.value.push(y(n));
|
|
1237
1237
|
})), this.update(), this.dropdown.refilter();
|
|
@@ -1243,7 +1243,7 @@ $.prototype = { _dropdown: jt, placeCaretAfterNode: k, getSetTagData: y, helpers
|
|
|
1243
1243
|
return this.setRangeAtStartEnd(!1, n), this.updateValueByDOMTags(), this.update(), this;
|
|
1244
1244
|
}, "injectAtCaret"), input: { set: /* @__PURE__ */ r(function() {
|
|
1245
1245
|
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", e = !(arguments.length > 1 && arguments[1] !== void 0) || arguments[1], i = this.settings, n = i.dropdown.closeOnSelect;
|
|
1246
|
-
this.state.inputText = t, e && (this.DOM.input.innerHTML =
|
|
1246
|
+
this.state.inputText = t, e && (this.DOM.input.innerHTML = R("" + t), t && this.toggleClass(i.classNames.empty, !this.DOM.input.innerHTML)), !t && n && this.dropdown.hide.bind(this), this.input.autocomplete.suggest.call(this), this.input.validate.call(this);
|
|
1247
1247
|
}, "set"), raw: /* @__PURE__ */ r(function() {
|
|
1248
1248
|
return this.DOM.input.textContent;
|
|
1249
1249
|
}, "raw"), validate: /* @__PURE__ */ r(function() {
|
|
@@ -1282,7 +1282,7 @@ $.prototype = { _dropdown: jt, placeCaretAfterNode: k, getSetTagData: y, helpers
|
|
|
1282
1282
|
return e;
|
|
1283
1283
|
}, "getNodeIndex"), getTagElms: /* @__PURE__ */ r(function() {
|
|
1284
1284
|
for (var t = arguments.length, e = new Array(t), i = 0; i < t; i++) e[i] = arguments[i];
|
|
1285
|
-
var n = "." +
|
|
1285
|
+
var n = "." + $(this.settings.classNames.tag.split(" ")).concat($(e)).join(".");
|
|
1286
1286
|
return [].slice.call(this.DOM.scope.querySelectorAll(n));
|
|
1287
1287
|
}, "getTagElms"), getLastTag: /* @__PURE__ */ r(function() {
|
|
1288
1288
|
var t = this.settings.classNames, e = this.DOM.scope.querySelectorAll("".concat(t.tagSelector, ":not(.").concat(t.tagHide, "):not([readonly])"));
|
|
@@ -1332,7 +1332,7 @@ $.prototype = { _dropdown: jt, placeCaretAfterNode: k, getSetTagData: y, helpers
|
|
|
1332
1332
|
})), n || e != "value" || s.tagTextProp == "value" || (n = this.getWhitelistItem(t, s.tagTextProp, i)), n;
|
|
1333
1333
|
}, "getWhitelistItem"), validateTag: /* @__PURE__ */ r(function(t) {
|
|
1334
1334
|
var e = this.settings, i = "value" in t ? "value" : e.tagTextProp, n = this.trim(t[i] + "");
|
|
1335
|
-
return (t[i] + "").trim() ? e.mode != "mix" && e.pattern &&
|
|
1335
|
+
return (t[i] + "").trim() ? e.mode != "mix" && e.pattern && A(e.pattern, RegExp) && !e.pattern.test(n) ? this.TEXTS.pattern : !e.duplicates && this.isTagDuplicate(n, e.dropdown.caseSensitive, t.__tagId) ? this.TEXTS.duplicate : this.isTagBlacklisted(n) || e.enforceWhitelist && !this.isTagWhitelisted(n) ? this.TEXTS.notAllowed : !e.validate || e.validate(t) : this.TEXTS.empty;
|
|
1336
1336
|
}, "validateTag"), getInvalidTagAttrs: /* @__PURE__ */ r(function(t, e) {
|
|
1337
1337
|
return { "aria-invalid": !0, class: "".concat(t.class || "", " ").concat(this.settings.classNames.tagNotAllowed).trim(), title: e };
|
|
1338
1338
|
}, "getInvalidTagAttrs"), hasMaxTags: /* @__PURE__ */ r(function() {
|
|
@@ -1347,10 +1347,10 @@ $.prototype = { _dropdown: jt, placeCaretAfterNode: k, getSetTagData: y, helpers
|
|
|
1347
1347
|
}, "setContentEditable"), setDisabled: /* @__PURE__ */ r(function(t) {
|
|
1348
1348
|
this.setReadonly(t, "disabled");
|
|
1349
1349
|
}, "setDisabled"), normalizeTags: /* @__PURE__ */ r(function(t) {
|
|
1350
|
-
var e = this, i = this.settings, n = i.whitelist, s = i.delimiters, a = i.mode, o = i.tagTextProp, l = [], d = !!n &&
|
|
1350
|
+
var e = this, i = this.settings, n = i.whitelist, s = i.delimiters, a = i.mode, o = i.tagTextProp, l = [], d = !!n && A(n[0], Object), u = Array.isArray(t), c = u && t[0].value, g = /* @__PURE__ */ r(function(h) {
|
|
1351
1351
|
return (h + "").split(s).reduce((function(f, p) {
|
|
1352
1352
|
var m, v = e.trim(p);
|
|
1353
|
-
return v && f.push((
|
|
1353
|
+
return v && f.push((rt(m = {}, o, v), rt(m, "value", v), m)), f;
|
|
1354
1354
|
}), []);
|
|
1355
1355
|
}, "h");
|
|
1356
1356
|
if (typeof t == "number" && (t = t.toString()), typeof t == "string") {
|
|
@@ -1362,7 +1362,7 @@ $.prototype = { _dropdown: jt, placeCaretAfterNode: k, getSetTagData: y, helpers
|
|
|
1362
1362
|
o in p || (o = "value"), p[o] = e.trim(p[o]), (p[o] || p[o] === 0) && h.push(p);
|
|
1363
1363
|
} else if (f != null && f !== "" && f !== void 0) {
|
|
1364
1364
|
var m;
|
|
1365
|
-
(m = h).push.apply(m,
|
|
1365
|
+
(m = h).push.apply(m, $(g(f)));
|
|
1366
1366
|
}
|
|
1367
1367
|
return h;
|
|
1368
1368
|
}), []));
|
|
@@ -1374,7 +1374,7 @@ $.prototype = { _dropdown: jt, placeCaretAfterNode: k, getSetTagData: y, helpers
|
|
|
1374
1374
|
return !f.includes(v.value);
|
|
1375
1375
|
})));
|
|
1376
1376
|
var m = p.length > 1 ? e.getWhitelistItem(h[o], o, p) : p[0];
|
|
1377
|
-
m &&
|
|
1377
|
+
m && A(m, Object) ? l.push(m) : a != "mix" && (h.value == null && (h.value = h[o]), l.push(h));
|
|
1378
1378
|
})), l.length && (t = l)), t;
|
|
1379
1379
|
}, "normalizeTags"), parseMixTags: /* @__PURE__ */ r(function(t) {
|
|
1380
1380
|
var e = this, i = this.settings, n = i.mixTagsInterpolator, s = i.duplicates, a = i.transformTag, o = i.enforceWhitelist, l = i.maxTags, d = i.tagTextProp, u = [];
|
|
@@ -1471,7 +1471,7 @@ $.prototype = { _dropdown: jt, placeCaretAfterNode: k, getSetTagData: y, helpers
|
|
|
1471
1471
|
e.scope.insertBefore(t, i);
|
|
1472
1472
|
}, "appendTag"), createTagElem: /* @__PURE__ */ r(function(t, e) {
|
|
1473
1473
|
t.__tagId = pt();
|
|
1474
|
-
var i, n = w({}, t, bt({ value:
|
|
1474
|
+
var i, n = w({}, t, bt({ value: R(t.value + "") }, e));
|
|
1475
1475
|
return (function(s) {
|
|
1476
1476
|
for (var a, o = document.createNodeIterator(s, NodeFilter.SHOW_TEXT, null, !1); a = o.nextNode(); ) a.textContent.trim() || a.parentNode.removeChild(a);
|
|
1477
1477
|
})(i = this.parseTemplate("tag", [n, this])), y(i, t), i;
|
|
@@ -1484,7 +1484,7 @@ $.prototype = { _dropdown: jt, placeCaretAfterNode: k, getSetTagData: y, helpers
|
|
|
1484
1484
|
}));
|
|
1485
1485
|
}, "reCheckInvalidTags"), removeTags: /* @__PURE__ */ r(function(t, e, i) {
|
|
1486
1486
|
var n, s = this, a = this.settings;
|
|
1487
|
-
if (t = t &&
|
|
1487
|
+
if (t = t && A(t, HTMLElement) ? [t] : A(t, Array) ? t : t ? [t] : [this.getLastTag()].filter((function(o) {
|
|
1488
1488
|
return o;
|
|
1489
1489
|
})), n = t.reduce((function(o, l) {
|
|
1490
1490
|
l && typeof l == "string" && (l = s.getTagElmByValue(l));
|
|
@@ -1543,27 +1543,31 @@ $.prototype = { _dropdown: jt, placeCaretAfterNode: k, getSetTagData: y, helpers
|
|
|
1543
1543
|
if (l.nodeType == 1) {
|
|
1544
1544
|
var d = y(l);
|
|
1545
1545
|
if (l.tagName == "BR" && (t += `\r
|
|
1546
|
-
`), d &&
|
|
1546
|
+
`), d && H.call(e, l)) {
|
|
1547
1547
|
if (d.__removed) return;
|
|
1548
|
-
t += s[0] + n(
|
|
1548
|
+
t += s[0] + n(at(d, e.dataProps)) + s[1];
|
|
1549
1549
|
} else l.getAttribute("style") || ["B", "I", "U"].includes(l.tagName) ? t += l.textContent : l.tagName != "DIV" && l.tagName != "P" || (t += `\r
|
|
1550
1550
|
`, a(l));
|
|
1551
1551
|
} else t += l.textContent;
|
|
1552
1552
|
}));
|
|
1553
1553
|
}, "i"))(this.DOM.input), t;
|
|
1554
|
-
}, "getMixedTagsAsString") },
|
|
1555
|
-
var qt = Object.defineProperty, Ut = Object.getOwnPropertyDescriptor,
|
|
1554
|
+
}, "getMixedTagsAsString") }, X.prototype.removeTag = X.prototype.removeTags;
|
|
1555
|
+
var qt = Object.defineProperty, Ut = Object.getOwnPropertyDescriptor, L = /* @__PURE__ */ r((t, e, i, n) => {
|
|
1556
1556
|
for (var s = n > 1 ? void 0 : n ? Ut(e, i) : e, a = t.length - 1, o; a >= 0; a--)
|
|
1557
1557
|
(o = t[a]) && (s = (n ? o(e, i, s) : o(s)) || s);
|
|
1558
1558
|
return n && s && qt(e, i, s), s;
|
|
1559
1559
|
}, "__decorateClass"), W;
|
|
1560
|
-
let
|
|
1560
|
+
let _ = (W = class extends xt {
|
|
1561
1561
|
emits = [
|
|
1562
1562
|
"click"
|
|
1563
1563
|
];
|
|
1564
1564
|
autofocus = !1;
|
|
1565
1565
|
mode = "select";
|
|
1566
1566
|
items = null;
|
|
1567
|
+
placeholder = {
|
|
1568
|
+
en: "Select value",
|
|
1569
|
+
ru: "Выберите значение"
|
|
1570
|
+
};
|
|
1567
1571
|
tagify;
|
|
1568
1572
|
reactiveValue = null;
|
|
1569
1573
|
randomClass = "";
|
|
@@ -1574,7 +1578,7 @@ let A = (W = class extends xt {
|
|
|
1574
1578
|
_isFirstValueSet = !1;
|
|
1575
1579
|
_isIgnoreSetTags = !1;
|
|
1576
1580
|
mountedParent() {
|
|
1577
|
-
this.tagify = new
|
|
1581
|
+
this.tagify = new X(this.$refs.selectInput, {
|
|
1578
1582
|
enforceWhitelist: this.mode == "select" ? void 0 : this.mode != "tags",
|
|
1579
1583
|
mode: this.mode == "select" ? "select" : void 0,
|
|
1580
1584
|
escapeHTML: !1,
|
|
@@ -1591,7 +1595,7 @@ let A = (W = class extends xt {
|
|
|
1591
1595
|
},
|
|
1592
1596
|
onChangeAfterBlur: !1,
|
|
1593
1597
|
delimiters: null,
|
|
1594
|
-
placeholder: this.placeholder || "Выберите значение",
|
|
1598
|
+
placeholder: this.placeholder?.[this.VST.$r.locale] || this.placeholder?.en || this.placeholder || "Выберите значение",
|
|
1595
1599
|
callbacks: {
|
|
1596
1600
|
change: /* @__PURE__ */ r((e) => {
|
|
1597
1601
|
let i = "";
|
|
@@ -1599,9 +1603,9 @@ let A = (W = class extends xt {
|
|
|
1599
1603
|
const n = JSON.parse(JSON.stringify(this.itemsInner.find(
|
|
1600
1604
|
(s) => s?.key === i
|
|
1601
1605
|
)?.value ?? null));
|
|
1602
|
-
n && (this.tagify.addTags(this.reactiveValue = n), this.value = i);
|
|
1606
|
+
n && (this.tagify.addTags(this.reactiveValue = n), this.$emit("update:modelValue", this.value = i));
|
|
1603
1607
|
}, 4)) : this.mode == "multi" ? (this.tagify.removeAllTags(), i = JSON.parse(e.detail?.value), i = Array.isArray(i) ? i.map((n) => n.key) : [i], this.tagify.addTags(JSON.parse(e.detail?.value)), this.nextTick(() => {
|
|
1604
|
-
this.value = i, this.reactiveValue = e.detail?.value;
|
|
1608
|
+
this.$emit("update:modelValue", this.value = i), this.reactiveValue = e.detail?.value;
|
|
1605
1609
|
}, 4)) : this.mode == "tags" && (this.tagify.removeAllTags(), i = JSON.parse(e.detail?.value), this.tagify.addTags(i), this.nextTick(() => {
|
|
1606
1610
|
this.reactiveValue = e.detail?.value, this.nextTick(() => {
|
|
1607
1611
|
this._isFirstValueSet = !0, this._isIgnoreSetTags = !0, this.$emit("update:modelValue", this.value = i);
|
|
@@ -1609,8 +1613,8 @@ let A = (W = class extends xt {
|
|
|
1609
1613
|
}, 4)));
|
|
1610
1614
|
}, "change"),
|
|
1611
1615
|
remove: /* @__PURE__ */ r((e) => {
|
|
1612
|
-
this.mode == "select" && !(e.detail?.tagify?.value ?? []).length && this.value !== null ? (this.tagify.removeAllTags(), this.reactiveValue = null, this.value = null) : this.mode == "tags" ? !JSON.parse(this.reactiveValue)?.filter((n) => n.key != e.detail?.data?.key)?.length && this.reactiveValue != "[]" && (this.tagify.removeAllTags(), this.value = [], this.reactiveValue = "[]") : typeof this.reactiveValue == "string" && (this.reactiveValue?.startsWith("{") || this.reactiveValue?.startsWith("[")) && this.nextTick(() => {
|
|
1613
|
-
!JSON.parse(this.reactiveValue)?.filter((n) => n.key != e.detail?.data?.key)?.length && this.reactiveValue != "[]" && (this.reactiveValue = "[]", this.tagify.removeAllTags(), this.value = []);
|
|
1616
|
+
this.mode == "select" && !(e.detail?.tagify?.value ?? []).length && this.value !== null ? (this.tagify.removeAllTags(), this.reactiveValue = null, this.$emit("update:modelValue", this.value = null)) : this.mode == "tags" ? !JSON.parse(this.reactiveValue)?.filter((n) => n.key != e.detail?.data?.key)?.length && this.reactiveValue != "[]" && (this.tagify.removeAllTags(), this.$emit("update:modelValue", this.value = []), this.reactiveValue = "[]") : typeof this.reactiveValue == "string" && (this.reactiveValue?.startsWith("{") || this.reactiveValue?.startsWith("[")) && this.nextTick(() => {
|
|
1617
|
+
!JSON.parse(this.reactiveValue)?.filter((n) => n.key != e.detail?.data?.key)?.length && this.reactiveValue != "[]" && (this.reactiveValue = "[]", this.tagify.removeAllTags(), this.$emit("update:modelValue", this.value = []));
|
|
1614
1618
|
}, 4);
|
|
1615
1619
|
}, "remove")
|
|
1616
1620
|
},
|
|
@@ -1671,27 +1675,30 @@ let A = (W = class extends xt {
|
|
|
1671
1675
|
this.nextTick(() => this.setTags());
|
|
1672
1676
|
}
|
|
1673
1677
|
}, r(W, "SelectField"), W);
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
],
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
],
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
],
|
|
1683
|
-
|
|
1678
|
+
L([
|
|
1679
|
+
G(Boolean)
|
|
1680
|
+
], _.prototype, "autofocus", 2);
|
|
1681
|
+
L([
|
|
1682
|
+
G(String)
|
|
1683
|
+
], _.prototype, "mode", 2);
|
|
1684
|
+
L([
|
|
1685
|
+
G(Array)
|
|
1686
|
+
], _.prototype, "items", 2);
|
|
1687
|
+
L([
|
|
1688
|
+
G(String, Object)
|
|
1689
|
+
], _.prototype, "placeholder", 2);
|
|
1690
|
+
L([
|
|
1684
1691
|
ot("items", !0)
|
|
1685
|
-
],
|
|
1686
|
-
|
|
1692
|
+
], _.prototype, "_itemsWatch", 1);
|
|
1693
|
+
L([
|
|
1687
1694
|
ot("value", !0)
|
|
1688
|
-
],
|
|
1689
|
-
|
|
1695
|
+
], _.prototype, "_valueWatch", 1);
|
|
1696
|
+
L([
|
|
1690
1697
|
ot("modelValue", !0)
|
|
1691
|
-
],
|
|
1692
|
-
|
|
1698
|
+
], _.prototype, "_modelValueWatch", 1);
|
|
1699
|
+
_ = L([
|
|
1693
1700
|
Dt
|
|
1694
|
-
],
|
|
1701
|
+
], _);
|
|
1695
1702
|
const zt = ["value", "autofocus"];
|
|
1696
1703
|
function Jt(t, e, i, n, s, a) {
|
|
1697
1704
|
return Nt(), It("div", {
|
|
@@ -1707,7 +1714,7 @@ function Jt(t, e, i, n, s, a) {
|
|
|
1707
1714
|
], 2);
|
|
1708
1715
|
}
|
|
1709
1716
|
r(Jt, "render");
|
|
1710
|
-
const Qt = /* @__PURE__ */ _t(
|
|
1717
|
+
const Qt = /* @__PURE__ */ _t(_, [["render", Jt]]);
|
|
1711
1718
|
export {
|
|
1712
1719
|
Qt as default
|
|
1713
1720
|
};
|