vue-spear-tip 0.2.2 → 0.2.4

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.
Files changed (56) hide show
  1. package/dist/.vite/manifest.json +45 -17
  2. package/dist/{Button-DZlKBvlw.js → Button-B9kTMsWx.js} +1 -1
  3. package/dist/{Button-DpDqwLlR.cjs → Button-n3ORJB24.cjs} +1 -1
  4. package/dist/{CodeHighlight-WaVjepT3.cjs → CodeHighlight-DKD4c3o1.cjs} +1 -1
  5. package/dist/{CodeHighlight-BONqkePV.js → CodeHighlight-zWW7mCKo.js} +1 -1
  6. package/dist/{DateField-BwOE2XuE.cjs → DateField-B15N_Er2.cjs} +4 -4
  7. package/dist/{DateField-DCshiDON.js → DateField-CLsz3fl7.js} +8 -7
  8. package/dist/FieldComponent.vue_vue_type_script_lang-CuwGxCct.cjs +1 -0
  9. package/dist/FieldComponent.vue_vue_type_script_lang-a0D3sf1R.js +10 -0
  10. package/dist/{SelectField-DJg-e6r7.cjs → SelectField-C8v92730.cjs} +6 -6
  11. package/dist/{SelectField-C97iZqqJ.js → SelectField-Dg0c03Hn.js} +100 -93
  12. package/dist/{StringField-q2EjZuwT.js → StringField-CN2J5hnc.js} +36 -35
  13. package/dist/StringField-SQwneDFM.cjs +1 -0
  14. package/dist/{Tabs-i2bTEtg7.js → Tabs-Btq9At3D.js} +1 -1
  15. package/dist/{Tabs--qXAltMn.cjs → Tabs-bdR0rIkV.cjs} +1 -1
  16. package/dist/TextField-CEstqDvf.js +19365 -0
  17. package/dist/TextField-DwbNmleH.cjs +149 -0
  18. package/dist/components/Fields/TextField/index.d.ts +2 -0
  19. package/dist/components/LazyComponents.d.ts +3 -6
  20. package/dist/{index-hQ1VmssH.js → index-Bm3M_ugz.js} +139 -138
  21. package/dist/{index-BmhExWks.cjs → index-pJmyVDoY.cjs} +1 -1
  22. package/dist/index.d.ts +1 -1
  23. package/dist/kit/fields/index.d.ts +2 -1
  24. package/dist/replaceable/FieldComponent.vue +1 -3
  25. package/dist/vue-spear-tip.cjs.js +1 -1
  26. package/dist/vue-spear-tip.css +1 -1
  27. package/dist/vue-spear-tip.es.js +10 -9
  28. package/docs/index.html +2 -2
  29. package/docs/static/Button-BUq3qi9I.js +1 -0
  30. package/docs/static/{CodeHighlight-DwP55Obc.js → CodeHighlight-BKaQtkER.js} +1 -1
  31. package/docs/static/DateField-BOXDZRGA.js +31 -0
  32. package/docs/static/FieldComponent.vue_vue_type_script_lang-CKikbrmF.js +1 -0
  33. package/docs/static/{SelectField-DdvXIk4C.js → SelectField-CWS45VNb.js} +7 -7
  34. package/docs/static/{StringField-BqYql_dk.js → StringField-DWX_WNoM.js} +1 -1
  35. package/docs/static/{StringField-DV9336PV.css → StringField-whdxCITB.css} +1 -1
  36. package/docs/static/Tabs-BNDTIJ3z.js +1 -0
  37. package/docs/static/TextField-CXCoqL3z.js +149 -0
  38. package/docs/static/TextField-DInjI1Vp.css +1 -0
  39. package/docs/static/index-D8NZNe9k.js +2 -0
  40. package/docs/static/main-D7RDfHbv.css +1 -0
  41. package/docs/static/main-b2Vu8ssu.js +103 -0
  42. package/package.json +23 -1
  43. package/dist/StringField-BiddnfN1.cjs +0 -1
  44. package/docs/static/Button-BI5BLid9.js +0 -1
  45. package/docs/static/ButtonInherited-Dwuz_QB-.js +0 -1
  46. package/docs/static/DateField-BD-4IMMe.js +0 -31
  47. package/docs/static/FieldComponent.vue_vue_type_script_lang-Dwp-wLcy.js +0 -1
  48. package/docs/static/Tabs-CwTc00Yi.js +0 -1
  49. package/docs/static/index-BXtpWRTc.js +0 -2
  50. package/docs/static/index-BeNEN9J-.js +0 -2
  51. package/docs/static/index-CMpYTAiF.js +0 -2
  52. package/docs/static/index-DMKgrxE1.js +0 -2
  53. package/docs/static/index-Dsi6A5t5.js +0 -2
  54. package/docs/static/index-Nc0Poa_J.js +0 -2
  55. package/docs/static/main-C7jrUur6.css +0 -1
  56. package/docs/static/main-C8MaaDZb.js +0 -103
@@ -1,6 +1,7 @@
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 G, W as ot, V as Dt } from "./index-hQ1VmssH.js";
3
+ import { P as K, W as ot, V as xt } from "./index-Bm3M_ugz.js";
4
+ import { F as Dt } from "./FieldComponent.vue_vue_type_script_lang-a0D3sf1R.js";
4
5
  import { createElementBlock as It, openBlock as Nt, normalizeClass as Et, createElementVNode as Mt } from "vue";
5
6
  import { _ as _t } from "./_plugin-vue_export-helper-B9nE8o7z.js";
6
7
  var lt = "​";
@@ -27,7 +28,7 @@ function dt(t) {
27
28
  })();
28
29
  }
29
30
  r(dt, "i");
30
- var V = { isEnabled: /* @__PURE__ */ r(function() {
31
+ var L = { isEnabled: /* @__PURE__ */ r(function() {
31
32
  var t;
32
33
  return (t = window.TAGIFY_DEBUG) === null || t === void 0 || t;
33
34
  }, "isEnabled"), log: /* @__PURE__ */ r(function() {
@@ -38,7 +39,7 @@ var V = { isEnabled: /* @__PURE__ */ r(function() {
38
39
  for (var t = arguments.length, e = new Array(t), i = 0; i < t; i++) e[i] = arguments[i];
39
40
  var n;
40
41
  this.isEnabled() && (n = console).warn.apply(n, ["[Tagify]:"].concat(dt(e)));
41
- }, "warn") }, U = /* @__PURE__ */ r(function(t, e, i, n) {
42
+ }, "warn") }, q = /* @__PURE__ */ r(function(t, e, i, n) {
42
43
  return t = "" + t, e = "" + e, n && (t = t.trim(), e = e.trim()), i ? t == e : t.toLowerCase() == e.toLowerCase();
43
44
  }, "s"), ut = /* @__PURE__ */ r(function(t, e) {
44
45
  return t && Array.isArray(t) && t.map((function(i) {
@@ -151,21 +152,21 @@ function Tt(t, e) {
151
152
  }
152
153
  r(Tt, "w");
153
154
  function y(t, e, i) {
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
+ return t ? (e && (t.__tagifyTagData = i ? e : w({}, t.__tagifyTagData || {}, e)), t.__tagifyTagData) : (L.warn("tag element doesn't exist", { tagElm: t, data: e }), e);
155
156
  }
156
157
  r(y, "y");
157
- function k(t) {
158
+ function V(t) {
158
159
  if (t && t.parentNode) {
159
160
  var e = t, i = window.getSelection(), n = i.getRangeAt(0);
160
161
  i.rangeCount && (n.setStartAfter(e), n.collapse(!0), i.removeAllRanges(), i.addRange(n));
161
162
  }
162
163
  }
163
- r(k, "T");
164
+ r(V, "T");
164
165
  function Ot(t, e) {
165
166
  t.forEach((function(i) {
166
167
  if (y(i.previousSibling) || !i.previousSibling) {
167
168
  var n = document.createTextNode("​");
168
- i.before(n), e && k(n);
169
+ i.before(n), e && V(n);
169
170
  }
170
171
  }));
171
172
  }
@@ -241,7 +242,7 @@ function Pt() {
241
242
  this.dropdown.refs(), this.DOM.dropdown.__tagify = this;
242
243
  }
243
244
  r(Pt, "A");
244
- var K, B, jt = (K = (function(t) {
245
+ var $, B, jt = ($ = (function(t) {
245
246
  for (var e = 1; e < arguments.length; e++) {
246
247
  var i = arguments[e] != null ? arguments[e] : {}, n = Object.keys(i);
247
248
  typeof Object.getOwnPropertySymbols == "function" && (n = n.concat(Object.getOwnPropertySymbols(i).filter((function(s) {
@@ -307,13 +308,13 @@ var K, B, jt = (K = (function(t) {
307
308
  var b = n ? s : e.dropdown.getNextOrPrevOption(s, !c);
308
309
  e.dropdown.selectOption(s, t, (function() {
309
310
  if (b) {
310
- var C = b.getAttribute("value");
311
- b = e.dropdown.getSuggestionNodeByValue(C), e.dropdown.highlightOption(b);
311
+ var k = b.getAttribute("value");
312
+ b = e.dropdown.getSuggestionNodeByValue(k), e.dropdown.highlightOption(b);
312
313
  }
313
314
  }));
314
315
  } else e.dropdown.hide(), o || e.addTags(e.state.inputText.trim(), !0);
315
316
  })).catch((function(b) {
316
- return V.warn(b);
317
+ return L.warn(b);
317
318
  }));
318
319
  break;
319
320
  case "Backspace":
@@ -337,7 +338,7 @@ var K, B, jt = (K = (function(t) {
337
338
  }), 100), this.settings.hooks.suggestionClick(t, { tagify: this, tagData: n, suggestionElm: i }).then((function() {
338
339
  i ? e.dropdown.selectOption(i, t) : e.dropdown.hide();
339
340
  })).catch((function(s) {
340
- return V.warn(s);
341
+ return L.warn(s);
341
342
  }));
342
343
  }
343
344
  }, "onClick"), onScroll: /* @__PURE__ */ r(function(t) {
@@ -390,8 +391,8 @@ var K, B, jt = (K = (function(t) {
390
391
  return t || (e = this.state.dropdown.suggestions), this.addTags(e, !0), this;
391
392
  }, "selectAll"), filterListItems: /* @__PURE__ */ r(function(t, e) {
392
393
  var i, n, s, a, o, l, d = /* @__PURE__ */ r(function() {
393
- var b, C, P = void 0, j = void 0;
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] };
394
+ var b, k, P = void 0, j = void 0;
395
+ b = p[I], n = ((k = Object) != null && typeof Symbol < "u" && k[Symbol.hasInstance] ? k[Symbol.hasInstance](b) : b instanceof k) ? p[I] : { value: p[I] };
395
396
  var O, S = Object.keys(n).some((function(x) {
396
397
  return D.includes(x);
397
398
  })) ? D : ["value"];
@@ -435,7 +436,7 @@ var K, B, jt = (K = (function(t) {
435
436
  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
437
  if (t = t === void 0 ? this.state.inputText : t, !(l && !o && !a.templates.dropdownItemNoMatch || a.dropdown.enabled === !1 || this.state.isLoading || this.settings.readonly)) {
437
438
  if (clearTimeout(this.dropdownHide__bindEventsTimeout), this.suggestedListItems = this.dropdown.filterListItems(t), t && !this.suggestedListItems.length && (this.trigger("dropdown:noMatch", t), a.templates.dropdownItemNoMatch && (n = a.templates.dropdownItemNoMatch.call(this, { value: t }))), !n) {
438
- if (this.suggestedListItems.length) t && o && !this.state.editing.scope && !U(this.suggestedListItems[0].value, t) && this.suggestedListItems.unshift({ value: t });
439
+ if (this.suggestedListItems.length) t && o && !this.state.editing.scope && !q(this.suggestedListItems[0].value, t) && this.suggestedListItems.unshift({ value: t });
439
440
  else {
440
441
  if (!t || !o || this.state.editing.scope) return this.input.autocomplete.suggest.call(this), void this.dropdown.hide();
441
442
  this.suggestedListItems = [{ value: t }];
@@ -473,7 +474,7 @@ var K, B, jt = (K = (function(t) {
473
474
  }, "fillHeaderFooter"), position: /* @__PURE__ */ r(function(t) {
474
475
  var e = this.settings.dropdown, i = this.dropdown.getAppendTarget();
475
476
  if (e.position != "manual" && i) {
476
- var n, s, a, o, l, d, u, c, g, h, f = this.DOM.dropdown, p = e.RTL, m = i === document.body, v = i === this.DOM.scope, T = m ? window.pageYOffset : i.scrollTop, D = document.fullscreenElement || document.webkitFullscreenElement || document.documentElement, I = D.clientHeight, N = Math.max(D.clientWidth || 0, window.innerWidth || 0), b = N > 480 ? e.position : "all", C = this.DOM[b == "input" ? "input" : "scope"];
477
+ var n, s, a, o, l, d, u, c, g, h, f = this.DOM.dropdown, p = e.RTL, m = i === document.body, v = i === this.DOM.scope, T = m ? window.pageYOffset : i.scrollTop, D = document.fullscreenElement || document.webkitFullscreenElement || document.documentElement, I = D.clientHeight, N = Math.max(D.clientWidth || 0, window.innerWidth || 0), b = N > 480 ? e.position : "all", k = this.DOM[b == "input" ? "input" : "scope"];
477
478
  if (t = t || f.clientHeight, this.state.dropdown.visible) {
478
479
  if (b == "text" ? (a = (n = (function() {
479
480
  var O = document.getSelection();
@@ -487,7 +488,7 @@ var K, B, jt = (K = (function(t) {
487
488
  var S = 0, x = 0;
488
489
  for (O = O.parentNode; O && O != D; ) S += O.offsetTop || 0, x += O.offsetLeft || 0, O = O.parentNode;
489
490
  return { top: S, left: x };
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
+ })(i), n = k.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
492
  var P = (function() {
492
493
  for (var O = 0, S = e.appendTarget.parentNode; S; ) O += S.scrollTop || 0, S = S.parentNode;
493
494
  return O;
@@ -498,7 +499,7 @@ var K, B, jt = (K = (function(t) {
498
499
  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
500
  }
500
501
  }
501
- }, "position") }) != null ? B : {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(K, Object.getOwnPropertyDescriptors(B)) : (function(t, e) {
502
+ }, "position") }) != null ? B : {}, Object.getOwnPropertyDescriptors ? Object.defineProperties($, Object.getOwnPropertyDescriptors(B)) : (function(t, e) {
502
503
  var i = Object.keys(t);
503
504
  if (Object.getOwnPropertySymbols) {
504
505
  var n = Object.getOwnPropertySymbols(t);
@@ -506,8 +507,8 @@ var K, B, jt = (K = (function(t) {
506
507
  }
507
508
  return i;
508
509
  })(Object(B)).forEach((function(t) {
509
- Object.defineProperty(K, t, Object.getOwnPropertyDescriptor(B, t));
510
- })), K), q = "@yaireo/tagify/", Ft = { empty: "empty", exceed: "number of tags exceeded", pattern: "pattern mismatch", duplicate: "already exists", notAllowed: "not allowed" }, Rt = { wrapper: /* @__PURE__ */ r(function(t, e) {
510
+ Object.defineProperty($, t, Object.getOwnPropertyDescriptor(B, t));
511
+ })), $), U = "@yaireo/tagify/", Ft = { empty: "empty", exceed: "number of tags exceeded", pattern: "pattern mismatch", duplicate: "already exists", notAllowed: "not allowed" }, Rt = { wrapper: /* @__PURE__ */ r(function(t, e) {
511
512
  return '<tags class="'.concat(e.classNames.namespace, " ").concat(e.mode ? "".concat(e.classNames[e.mode + "Mode"]) : "", " ").concat(t.className, `"
512
513
  `).concat(e.readonly ? "readonly" : "", `
513
514
  `).concat(e.disabled ? "disabled" : "", `
@@ -759,11 +760,11 @@ var Wt = { customBinding: /* @__PURE__ */ r(function() {
759
760
  var u, c, g, h = e.getTagElms(), f = a.anchorNode.length === 1 && a.anchorNode.nodeValue == "​";
760
761
  if (i.backspace == "edit" && d) return u = a.anchorNode.nodeType == 1 ? null : a.anchorNode.previousElementSibling, setTimeout(e.editTag.bind(e), 0, u), void t.preventDefault();
761
762
  if (ht() && yt(d, Element)) return g = ct(d), d.hasAttribute("readonly") || d.remove(), e.DOM.input.focus(), void setTimeout((function() {
762
- k(g), e.DOM.input.click();
763
+ V(g), e.DOM.input.click();
763
764
  }));
764
765
  if (a.anchorNode.nodeName == "BR") return;
765
766
  if ((o || d) && a.anchorNode.nodeType == 1 ? c = a.anchorOffset == 0 ? o ? h[0] : null : h[Math.min(h.length, a.anchorOffset) - 1] : o ? c = a.anchorNode.nextElementSibling : yt(d, Element) && (c = d), a.anchorNode.nodeType == 3 && !a.anchorNode.nodeValue && a.anchorNode.previousElementSibling && t.preventDefault(), (d || o) && !i.backspace || a.type != "Range" && !a.anchorOffset && a.anchorNode == e.DOM.input && t.key != "Delete") return void t.preventDefault();
766
- if (a.type != "Range" && c && c.hasAttribute("readonly")) return void k(ct(c));
767
+ if (a.type != "Range" && c && c.hasAttribute("readonly")) return void V(ct(c));
767
768
  t.key == "Delete" && f && y(a.anchorNode.nextSibling) && e.removeTags(a.anchorNode.nextSibling);
768
769
  break;
769
770
  case "Enter":
@@ -930,14 +931,14 @@ var Wt = { customBinding: /* @__PURE__ */ r(function() {
930
931
  else if (s.nodeType == 1 && s.querySelector(e.settings.classNames.tagSelector)) {
931
932
  var a, o = document.createTextNode("");
932
933
  s.childNodes[0].nodeType == 3 && s.previousSibling.nodeName != "BR" && (o = document.createTextNode(`
933
- `)), (a = s).replaceWith.apply(a, nt([o].concat(nt(nt(s.childNodes).slice(0, -1))))), k(o);
934
+ `)), (a = s).replaceWith.apply(a, nt([o].concat(nt(nt(s.childNodes).slice(0, -1))))), V(o);
934
935
  } else if (H.call(e, s)) {
935
936
  var l;
936
937
  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
938
  s.previousSibling.replaceWith(`
938
939
  ​`);
939
940
  for (var d = s.nextSibling, u = ""; d; ) u += d.textContent, d = d.nextSibling;
940
- u.trim() && k(s.previousSibling);
941
+ u.trim() && V(s.previousSibling);
941
942
  } else s.previousSibling && !y(s.previousSibling) || s.before("​");
942
943
  }
943
944
  })), n.removedNodes.forEach((function(s) {
@@ -973,7 +974,7 @@ function bt(t) {
973
974
  return t;
974
975
  }
975
976
  r(bt, "G");
976
- function $(t) {
977
+ function X(t) {
977
978
  return (function(e) {
978
979
  if (Array.isArray(e)) return st(e);
979
980
  })(t) || (function(e) {
@@ -989,10 +990,10 @@ function $(t) {
989
990
  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
991
  })();
991
992
  }
992
- r($, "$");
993
- function X(t, e) {
993
+ r(X, "$");
994
+ function G(t, e) {
994
995
  if (!t) {
995
- V.warn("input element not found", t);
996
+ L.warn("input element not found", t);
996
997
  var i = new Proxy(this, { get: /* @__PURE__ */ r(function() {
997
998
  return function() {
998
999
  return i;
@@ -1000,7 +1001,7 @@ function X(t, e) {
1000
1001
  }, "get") });
1001
1002
  return i;
1002
1003
  }
1003
- if (t.__tagify) return V.warn("input element is already Tagified - Same instance is returned.", t), t.__tagify;
1004
+ if (t.__tagify) return L.warn("input element is already Tagified - Same instance is returned.", t), t.__tagify;
1004
1005
  var n;
1005
1006
  w(this, (function(s) {
1006
1007
  var a = document.createTextNode(""), o = {};
@@ -1036,7 +1037,7 @@ function X(t, e) {
1036
1037
  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
1038
  g = new CustomEvent(d, { detail: h });
1038
1039
  } catch (p) {
1039
- V.warn(p);
1040
+ L.warn(p);
1040
1041
  }
1041
1042
  a.dispatchEvent(g);
1042
1043
  }
@@ -1045,29 +1046,29 @@ function X(t, e) {
1045
1046
  var a;
1046
1047
  if (n) {
1047
1048
  var o, l = "/" + s;
1048
- if (((a = localStorage) === null || a === void 0 ? void 0 : a.getItem(q + n + "/v")) === 1) try {
1049
- o = JSON.parse(localStorage[q + n + l]);
1049
+ if (((a = localStorage) === null || a === void 0 ? void 0 : a.getItem(U + n + "/v")) === 1) try {
1050
+ o = JSON.parse(localStorage[U + n + l]);
1050
1051
  } catch {
1051
1052
  }
1052
1053
  return o;
1053
1054
  }
1054
1055
  }), this.setPersistedData = (function(s) {
1055
1056
  var a;
1056
- return s ? ((a = localStorage) === null || a === void 0 || a.setItem(q + s + "/v", 1), function(o, l) {
1057
+ return s ? ((a = localStorage) === null || a === void 0 || a.setItem(U + s + "/v", 1), function(o, l) {
1057
1058
  var d, u = "/" + l, c = JSON.stringify(o);
1058
- o && l && ((d = localStorage) === null || d === void 0 || d.setItem(q + s + u, c), dispatchEvent(new Event("storage")));
1059
+ o && l && ((d = localStorage) === null || d === void 0 || d.setItem(U + s + u, c), dispatchEvent(new Event("storage")));
1059
1060
  }) : function() {
1060
1061
  };
1061
1062
  })(e.id), this.clearPersistedData = /* @__PURE__ */ (function(s) {
1062
1063
  return function(a) {
1063
- var o = q + "/" + s + "/";
1064
+ var o = U + "/" + s + "/";
1064
1065
  if (a) localStorage.removeItem(o + a);
1065
1066
  else for (var l in localStorage) l.includes(o) && localStorage.removeItem(l);
1066
1067
  };
1067
1068
  })(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
1069
  }
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) {
1070
+ r(G, "Q");
1071
+ G.prototype = { _dropdown: jt, placeCaretAfterNode: V, getSetTagData: y, helpers: { sameStr: q, 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
1072
  return this.settings.trim && t && typeof t == "string" ? t.trim() : t;
1072
1073
  }, "trim"), parseHTML: Z, templates: Rt, parseTemplate: /* @__PURE__ */ r(function(t, e) {
1073
1074
  return Z((t = this.settings.templates[t] || t).apply(this, e));
@@ -1213,15 +1214,15 @@ X.prototype = { _dropdown: jt, placeCaretAfterNode: k, getSetTagData: y, helpers
1213
1214
  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
1215
  return l.onEditTagkeydown.call(i, c, t);
1215
1216
  })), 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 V.warn("Cannot find element in Tag template: .", n.classNames.tagTextSelector);
1217
+ } else L.warn("Cannot find element in Tag template: .", n.classNames.tagTextSelector);
1217
1218
  }, "editTag"), editTagToggleValidity: /* @__PURE__ */ r(function(t, e) {
1218
1219
  var i;
1219
1220
  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
- V.warn("tag has no data: ", t, e);
1221
+ L.warn("tag has no data: ", t, e);
1221
1222
  }, "editTagToggleValidity"), onEditTagDone: /* @__PURE__ */ r(function(t, e) {
1222
1223
  t = t || this.state.editing.scope, e = e || {};
1223
1224
  var i, n, s = this.settings, a = { tag: t, index: this.getNodeIndex(t), previousData: y(t), data: e };
1224
- this.trigger("edit:beforeUpdate", a, { cloneData: !1 }), this.state.editing = !1, delete e.__originalData, delete e.__originalHTML, t && t.parentNode && (((n = e[s.tagTextProp]) !== void 0 ? !((i = (n += "").trim) === null || i === void 0) && i.call(n) : !(s.tagTextProp in e) && e.value) ? (t = this.replaceTag(t, e), this.editTagToggleValidity(t, e), s.a11y.focusableTags ? t.focus() : s.mode != "select" && k(t)) : this.removeTags(t)), this.trigger("edit:updated", a), s.dropdown.closeOnSelect && this.dropdown.hide(), this.settings.keepInvalidTags && this.reCheckInvalidTags();
1225
+ this.trigger("edit:beforeUpdate", a, { cloneData: !1 }), this.state.editing = !1, delete e.__originalData, delete e.__originalHTML, t && t.parentNode && (((n = e[s.tagTextProp]) !== void 0 ? !((i = (n += "").trim) === null || i === void 0) && i.call(n) : !(s.tagTextProp in e) && e.value) ? (t = this.replaceTag(t, e), this.editTagToggleValidity(t, e), s.a11y.focusableTags ? t.focus() : s.mode != "select" && V(t)) : this.removeTags(t)), this.trigger("edit:updated", a), s.dropdown.closeOnSelect && this.dropdown.hide(), this.settings.keepInvalidTags && this.reCheckInvalidTags();
1225
1226
  }, "onEditTagDone"), replaceTag: /* @__PURE__ */ r(function(t, e) {
1226
1227
  e && e.value !== "" && e.value !== void 0 || (e = t.__tagifyTagData), e.__isValid && e.__isValid != 1 && w(e, this.getInvalidTagAttrs(e, e.__isValid));
1227
1228
  var i = this.createTagElem(e);
@@ -1231,7 +1232,7 @@ X.prototype = { _dropdown: jt, placeCaretAfterNode: k, getSetTagData: y, helpers
1231
1232
  this.value.length = 0;
1232
1233
  var e = this.settings.classNames, i = [e.tagNotAllowed.split(" ")[0], e.tagHide];
1233
1234
  [].forEach.call(this.getTagElms(), (function(n) {
1234
- $(n.classList).some((function(s) {
1235
+ X(n.classList).some((function(s) {
1235
1236
  return i.includes(s);
1236
1237
  })) || t.value.push(y(n));
1237
1238
  })), this.update(), this.dropdown.refilter();
@@ -1282,7 +1283,7 @@ X.prototype = { _dropdown: jt, placeCaretAfterNode: k, getSetTagData: y, helpers
1282
1283
  return e;
1283
1284
  }, "getNodeIndex"), getTagElms: /* @__PURE__ */ r(function() {
1284
1285
  for (var t = arguments.length, e = new Array(t), i = 0; i < t; i++) e[i] = arguments[i];
1285
- var n = "." + $(this.settings.classNames.tag.split(" ")).concat($(e)).join(".");
1286
+ var n = "." + X(this.settings.classNames.tag.split(" ")).concat(X(e)).join(".");
1286
1287
  return [].slice.call(this.DOM.scope.querySelectorAll(n));
1287
1288
  }, "getTagElms"), getLastTag: /* @__PURE__ */ r(function() {
1288
1289
  var t = this.settings.classNames, e = this.DOM.scope.querySelectorAll("".concat(t.tagSelector, ":not(.").concat(t.tagHide, "):not([readonly])"));
@@ -1292,7 +1293,7 @@ X.prototype = { _dropdown: jt, placeCaretAfterNode: k, getSetTagData: y, helpers
1292
1293
  try {
1293
1294
  for (var l, d = this.value[Symbol.iterator](); !(s = (l = d.next()).done); s = !0) {
1294
1295
  var u = l.value;
1295
- U(this.trim("" + t), u.value, e) && i != u.__tagId && n++;
1296
+ q(this.trim("" + t), u.value, e) && i != u.__tagId && n++;
1296
1297
  }
1297
1298
  } catch (c) {
1298
1299
  a = !0, o = c;
@@ -1307,7 +1308,7 @@ X.prototype = { _dropdown: jt, placeCaretAfterNode: k, getSetTagData: y, helpers
1307
1308
  }, "isTagDuplicate"), getTagIndexByValue: /* @__PURE__ */ r(function(t) {
1308
1309
  var e = this, i = [], n = this.settings.dropdown.caseSensitive;
1309
1310
  return this.getTagElms().forEach((function(s, a) {
1310
- s.__tagifyTagData && U(e.trim(s.__tagifyTagData.value), t, n) && i.push(a);
1311
+ s.__tagifyTagData && q(e.trim(s.__tagifyTagData.value), t, n) && i.push(a);
1311
1312
  })), i;
1312
1313
  }, "getTagIndexByValue"), getTagElmByValue: /* @__PURE__ */ r(function(t) {
1313
1314
  var e = this.getTagIndexByValue(t)[0];
@@ -1328,7 +1329,7 @@ X.prototype = { _dropdown: jt, placeCaretAfterNode: k, getSetTagData: y, helpers
1328
1329
  var n, s = this.settings;
1329
1330
  return (i = i || s.whitelist).some((function(a) {
1330
1331
  var o = typeof a == "object" ? a[e] || a.value : a;
1331
- if (U(o, t, s.dropdown.caseSensitive, s.trim)) return n = typeof a == "object" ? a : { value: a }, !0;
1332
+ if (q(o, t, s.dropdown.caseSensitive, s.trim)) return n = typeof a == "object" ? a : { value: a }, !0;
1332
1333
  })), n || e != "value" || s.tagTextProp == "value" || (n = this.getWhitelistItem(t, s.tagTextProp, i)), n;
1333
1334
  }, "getWhitelistItem"), validateTag: /* @__PURE__ */ r(function(t) {
1334
1335
  var e = this.settings, i = "value" in t ? "value" : e.tagTextProp, n = this.trim(t[i] + "");
@@ -1362,7 +1363,7 @@ X.prototype = { _dropdown: jt, placeCaretAfterNode: k, getSetTagData: y, helpers
1362
1363
  o in p || (o = "value"), p[o] = e.trim(p[o]), (p[o] || p[o] === 0) && h.push(p);
1363
1364
  } else if (f != null && f !== "" && f !== void 0) {
1364
1365
  var m;
1365
- (m = h).push.apply(m, $(g(f)));
1366
+ (m = h).push.apply(m, X(g(f)));
1366
1367
  }
1367
1368
  return h;
1368
1369
  }), []));
@@ -1463,7 +1464,7 @@ X.prototype = { _dropdown: jt, placeCaretAfterNode: k, getSetTagData: y, helpers
1463
1464
  return i.classList.add(s.settings.classNames.tagNoAnimation);
1464
1465
  }), 300), this.update(), !o) {
1465
1466
  var l = this.insertAfterTag(i) || i;
1466
- setTimeout(k, 0, l);
1467
+ setTimeout(V, 0, l);
1467
1468
  }
1468
1469
  return this.state.tag = null, this.postProcessNewTagNode(i, n.tagData), this.trigger("add", { tag: n, data: t }), i;
1469
1470
  }, "prefixedTextToTag"), appendTag: /* @__PURE__ */ r(function(t) {
@@ -1551,17 +1552,18 @@ X.prototype = { _dropdown: jt, placeCaretAfterNode: k, getSetTagData: y, helpers
1551
1552
  } else t += l.textContent;
1552
1553
  }));
1553
1554
  }, "i"))(this.DOM.input), t;
1554
- }, "getMixedTagsAsString") }, X.prototype.removeTag = X.prototype.removeTags;
1555
- var qt = Object.defineProperty, Ut = Object.getOwnPropertyDescriptor, L = /* @__PURE__ */ r((t, e, i, n) => {
1556
- for (var s = n > 1 ? void 0 : n ? Ut(e, i) : e, a = t.length - 1, o; a >= 0; a--)
1555
+ }, "getMixedTagsAsString") }, G.prototype.removeTag = G.prototype.removeTags;
1556
+ var Ut = Object.defineProperty, qt = Object.getOwnPropertyDescriptor, C = /* @__PURE__ */ r((t, e, i, n) => {
1557
+ for (var s = n > 1 ? void 0 : n ? qt(e, i) : e, a = t.length - 1, o; a >= 0; a--)
1557
1558
  (o = t[a]) && (s = (n ? o(e, i, s) : o(s)) || s);
1558
- return n && s && qt(e, i, s), s;
1559
+ return n && s && Ut(e, i, s), s;
1559
1560
  }, "__decorateClass"), W;
1560
- let _ = (W = class extends xt {
1561
+ let _ = (W = class extends Dt {
1561
1562
  emits = [
1562
1563
  "click"
1563
1564
  ];
1564
1565
  autofocus = !1;
1566
+ inputValidatePattern = null;
1565
1567
  mode = "select";
1566
1568
  items = null;
1567
1569
  placeholder = {
@@ -1578,14 +1580,11 @@ let _ = (W = class extends xt {
1578
1580
  _isFirstValueSet = !1;
1579
1581
  _isIgnoreSetTags = !1;
1580
1582
  mountedParent() {
1581
- this.tagify = new X(this.$refs.selectInput, {
1582
- enforceWhitelist: this.mode == "select" ? void 0 : this.mode != "tags",
1583
+ let e = {
1583
1584
  mode: this.mode == "select" ? "select" : void 0,
1584
- escapeHTML: !1,
1585
1585
  whitelist: this.itemsInner,
1586
- editTags: this.mode == "tags",
1587
1586
  dropdown: {
1588
- maxTags: 5,
1587
+ // maxTags: 5,
1589
1588
  // fetchSuggestions: this.mode != 'select',
1590
1589
  highlightFirst: !0,
1591
1590
  clearOnSelect: !0,
@@ -1594,27 +1593,27 @@ let _ = (W = class extends xt {
1594
1593
  maxItems: 2e3
1595
1594
  },
1596
1595
  onChangeAfterBlur: !1,
1597
- delimiters: null,
1598
- placeholder: this.placeholder?.[this.VST.$r.locale] || this.placeholder?.en || this.placeholder || "Выберите значение",
1596
+ // delimiters: null,
1597
+ placeholder: typeof this.placeholder == "string" ? this.placeholder : this.placeholder?.[this.VST.$r.locale] || this.placeholder?.en || "Выберите значение",
1599
1598
  callbacks: {
1600
- change: /* @__PURE__ */ r((e) => {
1601
- let i = "";
1602
- e.detail?.value?.trim?.()?.length && e.detail?.value != "null" && (this.mode == "select" ? (i = typeof e.detail?.value == "string" && (e.detail?.value?.trim?.()?.startsWith("{") || e.detail?.value?.trim?.()?.startsWith("[")) ? JSON.parse(e.detail?.value)?.[0]?.key : e.detail?.value?.[0]?.key || e.detail?.value?.key, this.nextTick(() => {
1603
- const n = JSON.parse(JSON.stringify(this.itemsInner.find(
1604
- (s) => s?.key === i
1599
+ change: /* @__PURE__ */ r((i) => {
1600
+ let n = "";
1601
+ i.detail?.value?.trim?.()?.length && i.detail?.value != "null" && (this.mode == "select" ? (n = typeof i.detail?.value == "string" && (i.detail?.value?.trim?.()?.startsWith("{") || i.detail?.value?.trim?.()?.startsWith("[")) ? JSON.parse(i.detail?.value)?.[0]?.key : i.detail?.value?.[0]?.key || i.detail?.value?.key, this.nextTick(() => {
1602
+ const s = JSON.parse(JSON.stringify(this.itemsInner.find(
1603
+ (a) => a?.key === n
1605
1604
  )?.value ?? null));
1606
- n && (this.tagify.addTags(this.reactiveValue = n), this.$emit("update:modelValue", this.value = i));
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(() => {
1608
- this.$emit("update:modelValue", this.value = i), this.reactiveValue = e.detail?.value;
1609
- }, 4)) : this.mode == "tags" && (this.tagify.removeAllTags(), i = JSON.parse(e.detail?.value), this.tagify.addTags(i), this.nextTick(() => {
1610
- this.reactiveValue = e.detail?.value, this.nextTick(() => {
1611
- this._isFirstValueSet = !0, this._isIgnoreSetTags = !0, this.$emit("update:modelValue", this.value = i);
1605
+ s && (this.tagify.addTags(this.reactiveValue = s), this.$emit("update:modelValue", this.value = n));
1606
+ }, 4)) : this.mode == "multi" ? (this.tagify.removeAllTags(), n = JSON.parse(i.detail?.value), n = Array.isArray(n) ? n.map((s) => s.key) : [n], this.tagify.addTags(JSON.parse(i.detail?.value)), this.nextTick(() => {
1607
+ this.$emit("update:modelValue", this.value = n), this.reactiveValue = i.detail?.value;
1608
+ }, 4)) : this.mode == "tags" && (this.tagify.removeAllTags(), n = JSON.parse(i.detail?.value), this.tagify.addTags(n), this.nextTick(() => {
1609
+ this.reactiveValue = i.detail?.value, this.nextTick(() => {
1610
+ this._isFirstValueSet = !0, this._isIgnoreSetTags = !0, this.$emit("update:modelValue", this.value = n);
1612
1611
  });
1613
1612
  }, 4)));
1614
1613
  }, "change"),
1615
- remove: /* @__PURE__ */ r((e) => {
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
+ remove: /* @__PURE__ */ r((i) => {
1615
+ this.mode == "select" && !(i.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((s) => s.key != i.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(() => {
1616
+ !JSON.parse(this.reactiveValue)?.filter((s) => s.key != i.detail?.data?.key)?.length && this.reactiveValue != "[]" && (this.reactiveValue = "[]", this.tagify.removeAllTags(), this.$emit("update:modelValue", this.value = []));
1618
1617
  }, 4);
1619
1618
  }, "remove")
1620
1619
  },
@@ -1643,7 +1642,11 @@ let _ = (W = class extends xt {
1643
1642
  // // return `<div class='tagify__dropdown'>${t.value}</div>`
1644
1643
  // // }
1645
1644
  }
1646
- }), this.setTags();
1645
+ };
1646
+ this.mode !== "tags" ? e.editTags = !1 : this.inputValidatePattern?.trim?.() && (e.pattern = new RegExp(this.inputValidatePattern.trim(), "i"), e.editTags = {
1647
+ clicks: 1,
1648
+ keepInvalid: !0
1649
+ }), this.tagify = new G(this.$refs.selectInput, e), this.setTags();
1647
1650
  }
1648
1651
  setTags() {
1649
1652
  if (this.tagify?.removeAllTags?.(), this.mode == "select") {
@@ -1675,32 +1678,35 @@ let _ = (W = class extends xt {
1675
1678
  this.nextTick(() => this.setTags());
1676
1679
  }
1677
1680
  }, r(W, "SelectField"), W);
1678
- L([
1679
- G(Boolean)
1681
+ C([
1682
+ K(Boolean)
1680
1683
  ], _.prototype, "autofocus", 2);
1681
- L([
1682
- G(String)
1684
+ C([
1685
+ K(String)
1686
+ ], _.prototype, "inputValidatePattern", 2);
1687
+ C([
1688
+ K(String)
1683
1689
  ], _.prototype, "mode", 2);
1684
- L([
1685
- G(Array)
1690
+ C([
1691
+ K(Array)
1686
1692
  ], _.prototype, "items", 2);
1687
- L([
1688
- G(String, Object)
1693
+ C([
1694
+ K(String, Object)
1689
1695
  ], _.prototype, "placeholder", 2);
1690
- L([
1696
+ C([
1691
1697
  ot("items", !0)
1692
1698
  ], _.prototype, "_itemsWatch", 1);
1693
- L([
1699
+ C([
1694
1700
  ot("value", !0)
1695
1701
  ], _.prototype, "_valueWatch", 1);
1696
- L([
1702
+ C([
1697
1703
  ot("modelValue", !0)
1698
1704
  ], _.prototype, "_modelValueWatch", 1);
1699
- _ = L([
1700
- Dt
1705
+ _ = C([
1706
+ xt
1701
1707
  ], _);
1702
- const zt = ["value", "autofocus"];
1703
- function Jt(t, e, i, n, s, a) {
1708
+ const Kt = ["id", "value", "autofocus"];
1709
+ function zt(t, e, i, n, s, a) {
1704
1710
  return Nt(), It("div", {
1705
1711
  class: Et(["d-inline-block mx2px my1px w100%", {
1706
1712
  "vst-select-multi": t.mode == "multi" || t.mode == "tags"
@@ -1708,13 +1714,14 @@ function Jt(t, e, i, n, s, a) {
1708
1714
  }, [
1709
1715
  Mt("input", {
1710
1716
  ref: "selectInput",
1717
+ id: "vst-select-" + t.VST.generateRandomKey(),
1711
1718
  value: t.reactiveValue,
1712
1719
  autofocus: t.autofocus
1713
- }, null, 8, zt)
1720
+ }, null, 8, Kt)
1714
1721
  ], 2);
1715
1722
  }
1716
- r(Jt, "render");
1717
- const Qt = /* @__PURE__ */ _t(_, [["render", Jt]]);
1723
+ r(zt, "render");
1724
+ const Yt = /* @__PURE__ */ _t(_, [["render", zt]]);
1718
1725
  export {
1719
- Qt as default
1726
+ Yt as default
1720
1727
  };