@topvisor/ui 0.9.34-utils-components-2 → 0.9.34-utils-components-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 (122) hide show
  1. package/.chunks/datepicker-B-QNMaqL.es.js +289 -0
  2. package/.chunks/datepicker-B-QNMaqL.es.js.map +1 -0
  3. package/.chunks/datepicker-BtTKGtP7.amd.js +247 -0
  4. package/.chunks/datepicker-BtTKGtP7.amd.js.map +1 -0
  5. package/.chunks/{forms-CRAV8PiZ.es.js → forms-CRdPxA6a.es.js} +116 -116
  6. package/.chunks/forms-CRdPxA6a.es.js.map +1 -0
  7. package/.chunks/{forms-Cksc7Rb7.amd.js → forms-CbJDUr1_.amd.js} +3 -3
  8. package/.chunks/forms-CbJDUr1_.amd.js.map +1 -0
  9. package/.chunks/{listItem.vue_vue_type_script_setup_true_lang-C2XaxeNZ.es.js → listItem.vue_vue_type_script_setup_true_lang-D5EXHsIJ.es.js} +2 -2
  10. package/.chunks/listItem.vue_vue_type_script_setup_true_lang-D5EXHsIJ.es.js.map +1 -0
  11. package/.chunks/{listItem.vue_vue_type_script_setup_true_lang-CpNwVBHY.amd.js → listItem.vue_vue_type_script_setup_true_lang-W45jLCVb.amd.js} +2 -2
  12. package/.chunks/listItem.vue_vue_type_script_setup_true_lang-W45jLCVb.amd.js.map +1 -0
  13. package/.chunks/{menu-BX8GV8-v.amd.js → menu-BNQ5GpPq.amd.js} +2 -2
  14. package/.chunks/menu-BNQ5GpPq.amd.js.map +1 -0
  15. package/.chunks/{menu-BWjYRHkQ.es.js → menu-D8Pkjvdh.es.js} +2 -2
  16. package/.chunks/menu-D8Pkjvdh.es.js.map +1 -0
  17. package/.chunks/{popup-BWTP6yaC.es.js → popup-DUd8G4iQ.es.js} +485 -485
  18. package/.chunks/popup-DUd8G4iQ.es.js.map +1 -0
  19. package/.chunks/{popup-3fVBIqu0.amd.js → popup-DcfMTbwU.amd.js} +440 -440
  20. package/.chunks/popup-DcfMTbwU.amd.js.map +1 -0
  21. package/.chunks/store-Bl79G7T_.amd.js.map +1 -1
  22. package/.chunks/store-PoMCiuBr.es.js.map +1 -1
  23. package/README.md +86 -86
  24. package/assets/forms.css +1 -1
  25. package/assets/formsExt.css +1 -1
  26. package/core/core.amd.js +1 -1
  27. package/core/core.js +1 -1
  28. package/core/directives/focus.amd.js +1 -1
  29. package/core/directives/focus.js +1 -1
  30. package/core/directives/sticky.amd.js +1 -1
  31. package/core/directives/sticky.js +1 -1
  32. package/core/directives/swimUp.amd.js +1 -1
  33. package/core/directives/swimUp.js +1 -1
  34. package/core/directives/tooltip.amd.js +1 -1
  35. package/core/directives/tooltip.js +1 -1
  36. package/core/plugin/plugin.amd.js +1 -1
  37. package/core/plugin/plugin.amd.js.map +1 -1
  38. package/core/plugin/plugin.js +2 -2
  39. package/core/plugin/plugin.js.map +1 -1
  40. package/forms/forms.amd.js +1 -1
  41. package/forms/forms.js +1 -1
  42. package/forms/helpers.amd.js.map +1 -1
  43. package/forms/helpers.js.map +1 -1
  44. package/formsExt/formsExt.amd.js +1 -1
  45. package/formsExt/formsExt.amd.js.map +1 -1
  46. package/formsExt/formsExt.js +362 -122
  47. package/formsExt/formsExt.js.map +1 -1
  48. package/icomoon/Read Me.txt +7 -7
  49. package/icomoon/demo-files/demo.css +161 -161
  50. package/icomoon/demo-files/demo.js +30 -30
  51. package/icomoon/demo.html +3379 -3379
  52. package/icomoon/fonts/Topvisor-2.svg +263 -263
  53. package/icomoon/style.css +740 -740
  54. package/package.json +32 -32
  55. package/popup/popup.amd.js +1 -1
  56. package/popup/popup.amd.js.map +1 -1
  57. package/popup/popup.js +2 -2
  58. package/popup/popup.js.map +1 -1
  59. package/popup/worker.amd.js +1 -1
  60. package/popup/worker.amd.js.map +1 -1
  61. package/popup/worker.js +2 -2
  62. package/popup/worker.js.map +1 -1
  63. package/project/project.amd.js +1 -1
  64. package/project/project.amd.js.map +1 -1
  65. package/project/project.js +3 -3
  66. package/project/project.js.map +1 -1
  67. package/require/css.amd.js +11 -11
  68. package/src/components/formsExt/formsExt.d.ts +2 -0
  69. package/src/components/formsExt/selector2/itemMulti.vue.d.ts +18 -0
  70. package/src/components/formsExt/selector2/selector2.vue.d.ts +132 -0
  71. package/tabs/tabs.amd.js +1 -1
  72. package/tabs/tabs.amd.js.map +1 -1
  73. package/tabs/tabs.js +1 -1
  74. package/tabs/tabs.js.map +1 -1
  75. package/tabsView/tabsView.amd.js +1 -1
  76. package/tabsView/tabsView.amd.js.map +1 -1
  77. package/tabsView/tabsView.js +1 -1
  78. package/tabsView/tabsView.js.map +1 -1
  79. package/utils/check.amd.js.map +1 -1
  80. package/utils/check.js.map +1 -1
  81. package/utils/css.amd.js.map +1 -1
  82. package/utils/css.js.map +1 -1
  83. package/utils/date.amd.js +1 -1
  84. package/utils/date.js +1 -1
  85. package/utils/device.amd.js +1 -1
  86. package/utils/device.js +1 -1
  87. package/utils/dom.amd.js.map +1 -1
  88. package/utils/dom.js.map +1 -1
  89. package/utils/image.amd.js.map +1 -1
  90. package/utils/image.js.map +1 -1
  91. package/utils/keyboard.amd.js.map +1 -1
  92. package/utils/keyboard.js.map +1 -1
  93. package/utils/number.amd.js.map +1 -1
  94. package/utils/number.js.map +1 -1
  95. package/utils/price.amd.js.map +1 -1
  96. package/utils/price.js.map +1 -1
  97. package/utils/route.amd.js.map +1 -1
  98. package/utils/route.js.map +1 -1
  99. package/utils/scroll.amd.js +1 -1
  100. package/utils/scroll.amd.js.map +1 -1
  101. package/utils/scroll.js +1 -1
  102. package/utils/scroll.js.map +1 -1
  103. package/utils/string.amd.js.map +1 -1
  104. package/utils/string.js.map +1 -1
  105. package/utils/system.amd.js.map +1 -1
  106. package/utils/system.js.map +1 -1
  107. package/utils/url.amd.js.map +1 -1
  108. package/utils/url.js.map +1 -1
  109. package/utils/window.amd.js +1 -1
  110. package/utils/window.js +1 -1
  111. package/.chunks/datepicker-BGhDjLcn.es.js +0 -289
  112. package/.chunks/datepicker-BGhDjLcn.es.js.map +0 -1
  113. package/.chunks/datepicker-DM6aPyRB.amd.js +0 -247
  114. package/.chunks/datepicker-DM6aPyRB.amd.js.map +0 -1
  115. package/.chunks/forms-CRAV8PiZ.es.js.map +0 -1
  116. package/.chunks/forms-Cksc7Rb7.amd.js.map +0 -1
  117. package/.chunks/listItem.vue_vue_type_script_setup_true_lang-C2XaxeNZ.es.js.map +0 -1
  118. package/.chunks/listItem.vue_vue_type_script_setup_true_lang-CpNwVBHY.amd.js.map +0 -1
  119. package/.chunks/menu-BWjYRHkQ.es.js.map +0 -1
  120. package/.chunks/menu-BX8GV8-v.amd.js.map +0 -1
  121. package/.chunks/popup-3fVBIqu0.amd.js.map +0 -1
  122. package/.chunks/popup-BWTP6yaC.es.js.map +0 -1
@@ -1,10 +1,13 @@
1
- import { insertToPage as P } from "../utils/css.js";
2
- import { defineComponent as G, ref as T, computed as g, resolveDirective as z, openBlock as d, createElementBlock as c, normalizeClass as m, toDisplayString as V, createCommentVNode as f, createElementVNode as A, withDirectives as E, createVNode as I, withKeys as h, withModifiers as _, createBlock as B, withCtx as w, createTextVNode as C, watch as S, toRef as F, mergeProps as K, renderSlot as N, mergeModels as M, useModel as U, Fragment as q, renderList as D, vModelRadio as O } from "vue";
3
- import { v as X, r as k, q as $, u as L } from "../.chunks/forms-CRAV8PiZ.es.js";
4
- import { M as j } from "../.chunks/menu-BWjYRHkQ.es.js";
5
- const R = ["../assets/formsExt.css"].map((u) => import.meta.resolve(u));
6
- P(R, !0);
7
- const J = { class: "top-editArea_footer" }, Q = /* @__PURE__ */ G({
1
+ import { insertToPage as Z } from "../utils/css.js";
2
+ import { defineComponent as K, ref as V, computed as N, resolveDirective as q, openBlock as c, createElementBlock as v, normalizeClass as $, toDisplayString as C, createCommentVNode as T, createElementVNode as E, withDirectives as Y, createVNode as F, withKeys as O, withModifiers as B, createBlock as I, withCtx as _, createTextVNode as M, watch as k, toRef as ee, mergeProps as X, renderSlot as j, mergeModels as D, useModel as Q, Fragment as G, renderList as H, vModelRadio as te, unref as S } from "vue";
3
+ import { v as oe, r as z, q as L, u as le, C as ae } from "../.chunks/forms-CRdPxA6a.es.js";
4
+ import { invertKeyboardLayout as se } from "../utils/keyboard.js";
5
+ import { TopPopup as re, TopPopupWidgetInput as ne, TopPopupListItem as R } from "../popup/popup.js";
6
+ import { debounce as ie } from "lodash";
7
+ import { M as ue } from "../.chunks/menu-D8Pkjvdh.es.js";
8
+ const x = ["../assets/formsExt.css"].map((r) => import.meta.resolve(r));
9
+ Z(x, !0);
10
+ const de = { class: "top-editArea_footer" }, pe = /* @__PURE__ */ K({
8
11
  __name: "editArea",
9
12
  props: {
10
13
  defaultValue: { default: "" },
@@ -27,91 +30,91 @@ const J = { class: "top-editArea_footer" }, Q = /* @__PURE__ */ G({
27
30
  hint: {}
28
31
  },
29
32
  emits: ["submit", "close", "clickOnTitle"],
30
- setup(u, { emit: v }) {
31
- const e = u, l = v, r = T(e.defaultValue), n = T(e.isFocused), t = g(() => r.value !== e.defaultValue), s = g(() => e.attachToKeyboard ? "" : e.forceShowCloseBtn && !t.value ? e.closeText : e.cancelText), a = (o) => {
32
- l("submit", o), r.value = e.defaultValue;
33
- }, p = () => {
34
- if (e.forceShowCloseBtn && !t.value) {
35
- l("close");
33
+ setup(r, { emit: d }) {
34
+ const e = r, a = d, m = V(e.defaultValue), f = V(e.isFocused), s = N(() => m.value !== e.defaultValue), p = N(() => e.attachToKeyboard ? "" : e.forceShowCloseBtn && !s.value ? e.closeText : e.cancelText), i = (u) => {
35
+ a("submit", u), m.value = e.defaultValue;
36
+ }, y = () => {
37
+ if (e.forceShowCloseBtn && !s.value) {
38
+ a("close");
36
39
  return;
37
40
  }
38
- r.value = e.defaultValue;
39
- }, y = () => {
40
- e.attachToKeyboard && l("clickOnTitle");
41
+ m.value = e.defaultValue;
42
+ }, A = () => {
43
+ e.attachToKeyboard && a("clickOnTitle");
41
44
  };
42
- return (o, i) => {
43
- const H = z("focus");
44
- return d(), c("div", {
45
- class: m({
45
+ return (u, o) => {
46
+ const g = q("top-focus");
47
+ return c(), v("div", {
48
+ class: $({
46
49
  "top-editArea": !0,
47
- "top-editArea-attachedToKeyboard": o.attachToKeyboard
50
+ "top-editArea-attachedToKeyboard": u.attachToKeyboard
48
51
  })
49
52
  }, [
50
- o.title ? (d(), c("div", {
53
+ u.title ? (c(), v("div", {
51
54
  key: 0,
52
55
  class: "top-editArea_title",
53
- onClick: i[0] || (i[0] = (b) => y())
54
- }, V(o.title), 1)) : f("", !0),
55
- A("div", {
56
- class: m({
56
+ onClick: o[0] || (o[0] = (h) => A())
57
+ }, C(u.title), 1)) : T("", !0),
58
+ E("div", {
59
+ class: $({
57
60
  "top-editArea_form": !0,
58
- "top-error": o.isError,
59
- "top-focus": n.value
61
+ "top-error": u.isError,
62
+ "top-focus": f.value
60
63
  })
61
64
  }, [
62
- E(I(X, {
63
- modelValue: r.value,
64
- "onUpdate:modelValue": i[1] || (i[1] = (b) => r.value = b),
65
- name: o.name,
66
- placeholder: o.placeholder,
67
- rows: o.rows,
68
- minHeight: o.minHeight,
69
- expandable: o.expandable,
70
- disabled: o.disabled,
71
- readonly: o.readonly,
72
- isError: o.isError,
73
- hint: o.hint,
65
+ Y(F(oe, {
66
+ modelValue: m.value,
67
+ "onUpdate:modelValue": o[1] || (o[1] = (h) => m.value = h),
68
+ name: u.name,
69
+ placeholder: u.placeholder,
70
+ rows: u.rows,
71
+ minHeight: u.minHeight,
72
+ expandable: u.expandable,
73
+ disabled: u.disabled,
74
+ readonly: u.readonly,
75
+ isError: u.isError,
76
+ hint: u.hint,
74
77
  class: "top-editArea_element",
75
- onFocus: i[2] || (i[2] = () => n.value = !0),
76
- onBlur: i[3] || (i[3] = () => n.value = !1),
78
+ onFocus: o[2] || (o[2] = () => f.value = !0),
79
+ onBlur: o[3] || (o[3] = () => f.value = !1),
77
80
  onKeyup: [
78
- h(p, ["esc"]),
79
- i[4] || (i[4] = h(_((b) => a(r.value), ["ctrl"]), ["enter"]))
81
+ O(y, ["esc"]),
82
+ o[4] || (o[4] = O(B((h) => i(m.value), ["ctrl"]), ["enter"]))
80
83
  ]
81
84
  }, null, 8, ["modelValue", "name", "placeholder", "rows", "minHeight", "expandable", "disabled", "readonly", "isError", "hint"]), [
82
- [H, n.value]
85
+ [g, f.value]
83
86
  ]),
84
- A("div", J, [
85
- t.value || o.forceShowCloseBtn ? (d(), B(k, {
87
+ E("div", de, [
88
+ s.value || u.forceShowCloseBtn ? (c(), I(z, {
86
89
  key: 0,
87
90
  class: "top-editArea_button",
88
91
  color: "theme",
89
92
  styling: "soft",
90
- icon: o.attachToKeyboard ? "" : "",
91
- onClick: p
93
+ icon: u.attachToKeyboard ? "" : "",
94
+ onClick: y
92
95
  }, {
93
- default: w(() => [
94
- C(V(s.value), 1)
96
+ default: _(() => [
97
+ M(C(p.value), 1)
95
98
  ]),
96
99
  _: 1
97
- }, 8, ["icon"])) : f("", !0),
98
- t.value ? (d(), B(k, {
100
+ }, 8, ["icon"])) : T("", !0),
101
+ s.value ? (c(), I(z, {
99
102
  key: 1,
100
103
  class: "top-editArea_button",
101
- icon: o.attachToKeyboard ? "" : "",
102
- onClick: i[5] || (i[5] = (b) => a(r.value))
104
+ icon: u.attachToKeyboard ? "" : "",
105
+ onClick: o[5] || (o[5] = (h) => i(m.value))
103
106
  }, {
104
- default: w(() => [
105
- C(V(o.attachToKeyboard ? "" : o.submitText), 1)
107
+ default: _(() => [
108
+ M(C(u.attachToKeyboard ? "" : u.submitText), 1)
106
109
  ]),
107
110
  _: 1
108
- }, 8, ["icon"])) : f("", !0)
111
+ }, 8, ["icon"])) : T("", !0)
109
112
  ])
110
113
  ], 2)
111
114
  ], 2);
112
115
  };
113
116
  }
114
- }), W = {
117
+ }), ce = {
115
118
  "top-editArea": "top-editArea",
116
119
  "top-editArea_title": "top-editArea_title",
117
120
  "top-editArea_form": "top-editArea_form",
@@ -123,9 +126,9 @@ const J = { class: "top-editArea_footer" }, Q = /* @__PURE__ */ G({
123
126
  "top-editArea-attachedToKeyboard": "top-editArea-attachedToKeyboard",
124
127
  "top-button": "top-button",
125
128
  "top-editArea_button": "top-editArea_button"
126
- }, Y = {
127
- $style: W
128
- }, Z = /* @__PURE__ */ $(Q, [["__cssModules", Y]]), x = { class: "top-editInput" }, ee = /* @__PURE__ */ G({
129
+ }, me = {
130
+ $style: ce
131
+ }, fe = /* @__PURE__ */ L(pe, [["__cssModules", me]]), ve = { class: "top-editInput" }, ye = /* @__PURE__ */ K({
129
132
  __name: "editInput",
130
133
  props: {
131
134
  modelValue: {},
@@ -133,44 +136,44 @@ const J = { class: "top-editArea_footer" }, Q = /* @__PURE__ */ G({
133
136
  button: {}
134
137
  },
135
138
  emits: ["update:modelValue"],
136
- setup(u, { emit: v }) {
137
- const e = u, l = T(e.modelValue);
138
- S(F(e.modelValue), () => {
139
- l.value = e.modelValue;
139
+ setup(r, { emit: d }) {
140
+ const e = r, a = V(e.modelValue);
141
+ k(ee(e.modelValue), () => {
142
+ a.value = e.modelValue;
140
143
  });
141
- const r = v, n = () => {
142
- r("update:modelValue", l.value);
144
+ const m = d, f = () => {
145
+ m("update:modelValue", a.value);
143
146
  };
144
- return (t, s) => (d(), c("div", x, [
145
- I(L, K(t.input, {
146
- onKeydownCapture: s[0] || (s[0] = h(_((a) => l.value = t.modelValue, ["stop"]), ["esc"])),
147
- onKeydown: h(_(n, ["stop"]), ["enter"]),
148
- modelValue: l.value,
149
- "onUpdate:modelValue": s[1] || (s[1] = (a) => l.value = a)
147
+ return (s, p) => (c(), v("div", ve, [
148
+ F(le, X(s.input, {
149
+ onKeydownCapture: p[0] || (p[0] = O(B((i) => a.value = s.modelValue, ["stop"]), ["esc"])),
150
+ onKeydown: O(B(f, ["stop"]), ["enter"]),
151
+ modelValue: a.value,
152
+ "onUpdate:modelValue": p[1] || (p[1] = (i) => a.value = i)
150
153
  }), null, 16, ["onKeydown", "modelValue"]),
151
- l.value !== t.modelValue ? (d(), B(k, K({
154
+ a.value !== s.modelValue ? (c(), I(z, X({
152
155
  key: 0,
153
156
  icon: "",
154
157
  styling: "soft"
155
- }, t.button, { onClick: n }), {
156
- default: w(() => [
157
- N(t.$slots, "default")
158
+ }, s.button, { onClick: f }), {
159
+ default: _(() => [
160
+ j(s.$slots, "default")
158
161
  ]),
159
162
  _: 3
160
- }, 16)) : f("", !0)
163
+ }, 16)) : T("", !0)
161
164
  ]));
162
165
  }
163
- }), oe = {
166
+ }), he = {
164
167
  "top-editInput": "top-editInput",
165
168
  "top-input": "top-input"
166
- }, te = {
167
- $style: oe
168
- }, ae = /* @__PURE__ */ $(ee, [["__cssModules", te]]), le = ["data-top-icon", "onClick"], re = {
169
+ }, Ae = {
170
+ $style: he
171
+ }, be = /* @__PURE__ */ L(ye, [["__cssModules", Ae]]), ge = ["data-top-icon", "onClick"], Te = {
169
172
  key: 0,
170
173
  class: "top-radioGroup_circle"
171
- }, se = ["value", "disabled"], ie = /* @__PURE__ */ G({
174
+ }, Ve = ["value", "disabled"], _e = /* @__PURE__ */ K({
172
175
  __name: "radioGroup",
173
- props: /* @__PURE__ */ M({
176
+ props: /* @__PURE__ */ D({
174
177
  modelValue: {},
175
178
  radiosProps: {},
176
179
  showIndicator: { type: Boolean },
@@ -182,52 +185,52 @@ const J = { class: "top-editArea_footer" }, Q = /* @__PURE__ */ G({
182
185
  },
183
186
  modelModifiers: {}
184
187
  }),
185
- emits: /* @__PURE__ */ M(["update:modelValue"], ["update:modelValue"]),
186
- setup(u, { emit: v }) {
187
- const e = U(u, "modelValue"), l = u, r = T(null);
188
- S(e, () => {
189
- var t, s, a, p, y;
190
- (t = l.radiosProps) != null && t.some((o) => o.value === e.value) || (e.value = ((a = (s = l.radiosProps) == null ? void 0 : s[0]) == null ? void 0 : a.value) ?? ""), (y = (p = r.value) == null ? void 0 : p.querySelector(".radioGroup_item-selected")) == null || y.scrollIntoView();
188
+ emits: /* @__PURE__ */ D(["update:modelValue"], ["update:modelValue"]),
189
+ setup(r, { emit: d }) {
190
+ const e = Q(r, "modelValue"), a = r, m = V(null);
191
+ k(e, () => {
192
+ var s, p, i, y, A;
193
+ (s = a.radiosProps) != null && s.some((u) => u.value === e.value) || (e.value = ((i = (p = a.radiosProps) == null ? void 0 : p[0]) == null ? void 0 : i.value) ?? ""), (A = (y = m.value) == null ? void 0 : y.querySelector(".radioGroup_item-selected")) == null || A.scrollIntoView();
191
194
  }, { immediate: !0 });
192
- const n = "radioGroup-" + Math.random();
193
- return (t, s) => (d(), c("div", {
195
+ const f = "radioGroup-" + Math.random();
196
+ return (s, p) => (c(), v("div", {
194
197
  ref_key: "elRef",
195
- ref: r,
196
- class: m({
198
+ ref: m,
199
+ class: $({
197
200
  "top-radioGroup": !0,
198
201
  "top-scrollBarXHidding": !0,
199
- ["top-size_" + t.size]: !!t.size,
200
- "top-error": t.isError
202
+ ["top-size_" + s.size]: !!s.size,
203
+ "top-error": s.isError
201
204
  })
202
205
  }, [
203
- (d(!0), c(q, null, D(t.radiosProps, (a) => (d(), c("label", {
204
- class: m({
205
- "top-radioGroup_item-selected": a.value === e.value,
206
+ (c(!0), v(G, null, H(s.radiosProps, (i) => (c(), v("label", {
207
+ class: $({
208
+ "top-radioGroup_item-selected": i.value === e.value,
206
209
  "top-radioGroup_item": !0,
207
210
  "top-forms-focusable": !0,
208
- "top-disabled": a.disabled
211
+ "top-disabled": i.disabled
209
212
  }),
210
- "data-top-icon": a.icon,
211
- onClick: (p) => e.value = a.value
213
+ "data-top-icon": i.icon,
214
+ onClick: (y) => e.value = i.value
212
215
  }, [
213
- C(V(a.title) + " ", 1),
214
- t.showIndicator ? (d(), c("span", re)) : f("", !0),
215
- E(A("input", {
216
- "onUpdate:modelValue": s[0] || (s[0] = (p) => e.value = p),
217
- name: n,
216
+ M(C(i.title) + " ", 1),
217
+ s.showIndicator ? (c(), v("span", Te)) : T("", !0),
218
+ Y(E("input", {
219
+ "onUpdate:modelValue": p[0] || (p[0] = (y) => e.value = y),
220
+ name: f,
218
221
  type: "radio",
219
- class: m({
222
+ class: $({
220
223
  "top-unvisible": !0
221
224
  }),
222
- value: a.value,
223
- disabled: a.disabled
224
- }, null, 8, se), [
225
- [O, e.value]
225
+ value: i.value,
226
+ disabled: i.disabled
227
+ }, null, 8, Ve), [
228
+ [te, e.value]
226
229
  ])
227
- ], 10, le))), 256))
230
+ ], 10, ge))), 256))
228
231
  ], 2));
229
232
  }
230
- }), de = {
233
+ }), we = {
231
234
  "top-scrollBarXHidding": "top-scrollBarXHidding",
232
235
  "top-radioGroup": "top-radioGroup",
233
236
  "top-radioGroup_item": "top-radioGroup_item",
@@ -235,13 +238,250 @@ const J = { class: "top-editArea_footer" }, Q = /* @__PURE__ */ G({
235
238
  "top-radioGroup_circle": "top-radioGroup_circle",
236
239
  "top-disabled": "top-disabled",
237
240
  "top-error": "top-error"
238
- }, ne = {
239
- $style: de
240
- }, ue = /* @__PURE__ */ $(ie, [["__cssModules", ne]]), ve = Z, ye = ae, be = ue, Ve = j;
241
+ }, Ie = {
242
+ $style: we
243
+ }, $e = /* @__PURE__ */ L(_e, [["__cssModules", Ie]]), Ce = (r, d, e) => {
244
+ const a = V([]), m = V(!1);
245
+ let f = "", s;
246
+ r && !r.params.limit && (r.params.limit = 100);
247
+ const p = async () => {
248
+ if (!r) return;
249
+ let o, g;
250
+ if (e && (r.cache ??= /* @__PURE__ */ new Map(), g = JSON.stringify(r.params), o = r.cache.get(g), o))
251
+ return o;
252
+ if (m.value = !0, o = await r.call(), m.value = !1, o.errors) return;
253
+ if (!Array.isArray(o.result)) {
254
+ console.warn("В result ожидался массив");
255
+ return;
256
+ }
257
+ const h = o.result.findIndex((P) => P.id === void 0 || P.name === void 0);
258
+ if (h !== -1) {
259
+ console.warn(`В result[${h}] нет id или name`);
260
+ return;
261
+ }
262
+ return e && r.cache.set(g, o), o;
263
+ }, i = async () => {
264
+ if (!r) return;
265
+ r.params.offset = 0, r.params.search = f;
266
+ const o = await p();
267
+ o && (s = o.nextOffset, a.value = o.result);
268
+ }, y = async () => {
269
+ if (!r || !s || m.value) return;
270
+ r.params.offset = s, r.params.search = f;
271
+ const o = await p();
272
+ o && (s = o.nextOffset, a.value = a.value.concat(o.result));
273
+ }, A = ie(() => i(), 200);
274
+ return {
275
+ items: a,
276
+ isLoading: m,
277
+ loadAppend: y,
278
+ setSearchTextAndLoad: (o, g = !0) => {
279
+ r && (o.length < d || o === f && a.value.length || (f = o, g ? A() : i()));
280
+ }
281
+ };
282
+ }, Be = { class: "top-selector2_itemMulti top-ellipsis" }, Me = /* @__PURE__ */ K({
283
+ __name: "itemMulti",
284
+ props: {
285
+ id: {},
286
+ name: {}
287
+ },
288
+ emits: ["delete"],
289
+ setup(r) {
290
+ return (d, e) => (c(), v("div", Be, [
291
+ M(C(d.name) + " ", 1),
292
+ E("span", {
293
+ class: "top-selector2_itemMultiDelete",
294
+ "data-top-icon": "",
295
+ onClick: e[0] || (e[0] = (a) => d.$emit("delete", d.id)),
296
+ onMousedown: e[1] || (e[1] = B(() => {
297
+ }, ["stop"]))
298
+ }, null, 32)
299
+ ]));
300
+ }
301
+ }), Se = {
302
+ "top-selector2_itemMulti": "top-selector2_itemMulti",
303
+ "top-selector2_itemMultiDelete": "top-selector2_itemMultiDelete",
304
+ "top-selector2": "top-selector2",
305
+ "top-active": "top-active"
306
+ }, ke = {
307
+ $style: Se
308
+ }, Ee = /* @__PURE__ */ L(Me, [["__cssModules", ke]]), Ke = {
309
+ key: 0,
310
+ class: "top-selector2_activeItems"
311
+ }, Le = {
312
+ key: 1,
313
+ class: "top-selector2_activeName top-ellipsis"
314
+ }, Pe = /* @__PURE__ */ K({
315
+ __name: "selector2",
316
+ props: /* @__PURE__ */ D({
317
+ modelValue: {},
318
+ items: { default: () => [] },
319
+ multiselect: { type: Boolean },
320
+ disabled: { type: Boolean },
321
+ size: { default: "s" },
322
+ isError: { type: Boolean },
323
+ apiRequest: {},
324
+ minLength: { default: 0 },
325
+ useCache: { type: Boolean },
326
+ appendSearchToResult: { type: Boolean },
327
+ appendAllValue: { type: Boolean },
328
+ addChanger: { type: Boolean },
329
+ placeholder: {},
330
+ showSelectedInInput: { type: Boolean, default: !0 }
331
+ }, {
332
+ modelValue: {},
333
+ modelModifiers: {}
334
+ }),
335
+ emits: ["update:modelValue"],
336
+ setup(r) {
337
+ const d = r, e = Q(r, "modelValue"), a = V(""), m = {
338
+ id: 0,
339
+ name: "Все"
340
+ }, f = V(null), s = () => {
341
+ var t;
342
+ return (t = f.value) == null ? void 0 : t.popup;
343
+ };
344
+ window.__STORYBOOK_PREVIEW__ && !d.modelValue && k(
345
+ () => d.multiselect,
346
+ () => {
347
+ e.value = d.multiselect ? [] : { id: null, name: "" };
348
+ },
349
+ { immediate: !0 }
350
+ );
351
+ const p = Ce(d.apiRequest, d.minLength, d.useCache), i = N(() => {
352
+ const t = [];
353
+ return !d.multiselect && d.appendAllValue && t.push(m), d.items.forEach((n) => t.push({ ...n })), t;
354
+ }), y = (t, n = !0) => n && t.id === null ? Array.isArray(e.value) ? e.value.some((l) => l.id === t.id && l.name === t.name) : t.name === e.value.name : Array.isArray(e.value) ? e.value.some((l) => l.id === t.id) : t.id === e.value.id, A = N(() => {
355
+ const t = a.value.toLowerCase(), n = se(t);
356
+ let l = [];
357
+ return i.value.forEach((b) => {
358
+ const w = b.name.toLowerCase();
359
+ (b.id === Number(t) || w.includes(t) || w.includes(n)) && (w === t || w === n ? l.unshift(b) : l.push(b));
360
+ }), l.push(...p.items.value), d.appendSearchToResult && a.value && (!l.length || l[0].name.toLowerCase() !== t) && l.push({
361
+ id: null,
362
+ name: a.value
363
+ }), d.multiselect && (l = l.filter((b) => !y(b))), l;
364
+ }), u = async (t) => {
365
+ var n, l;
366
+ if (d.multiselect) {
367
+ if (!Array.isArray(e.value) || y(t))
368
+ return;
369
+ const b = [...e.value];
370
+ b.push({ ...t }), e.value = b, ae.state.isMobile ? (n = s()) == null || n.close() : setTimeout(() => {
371
+ var w, U, W, J;
372
+ (w = s()) == null || w.recalcPosition(), (J = (W = (U = s()) == null ? void 0 : U.elPopupWidget) == null ? void 0 : W.querySelector("input")) == null || J.focus(), a.value && (A.value.length || (a.value = "", p.items.value = []));
373
+ });
374
+ } else
375
+ a.value && (a.value = "", p.items.value = []), JSON.stringify(t) !== JSON.stringify(e.value) && (e.value = { ...t }), (l = s()) == null || l.close();
376
+ }, o = () => {
377
+ if (!Array.isArray(e.value)) {
378
+ const n = (i.value.findIndex((l) => l.id === e.value.id) + 1) % i.value.length;
379
+ e.value = { ...i.value[n] };
380
+ }
381
+ }, g = async (t) => {
382
+ Array.isArray(e.value) && (e.value = e.value.filter((n) => n.id !== t), setTimeout(() => {
383
+ var n;
384
+ (n = s()) == null || n.recalcPosition();
385
+ }));
386
+ }, h = V(!1);
387
+ d.apiRequest && (k(h, () => {
388
+ h.value && p.setSearchTextAndLoad(a.value, !1);
389
+ }), k(a, () => p.setSearchTextAndLoad(a.value)));
390
+ const P = (t) => {
391
+ const n = t.target;
392
+ n.scrollTop / (n.scrollHeight - n.offsetHeight) > 0.8 && p.loadAppend();
393
+ };
394
+ return (t, n) => (c(), I(S(re), {
395
+ ref_key: "popupRef",
396
+ ref: f,
397
+ onOpen: n[1] || (n[1] = (l) => h.value = !0),
398
+ onClose: n[2] || (n[2] = (l) => h.value = !1),
399
+ onScrollContentList: n[3] || (n[3] = (l) => t.apiRequest ? P(l) : void 0),
400
+ notch: !1,
401
+ transitionDuration: 0
402
+ }, {
403
+ opener: _(() => [
404
+ E("div", {
405
+ class: $({
406
+ "top-selector2": !0,
407
+ "top-selector2-multiselect": t.multiselect,
408
+ ["top-size_" + t.size]: !0,
409
+ "top-disabled": t.disabled,
410
+ "top-forms-focusable": !t.disabled,
411
+ "top-error": t.isError
412
+ })
413
+ }, [
414
+ t.multiselect ? (c(), v("div", Ke, [
415
+ (c(!0), v(G, null, H(e.value, (l) => (c(), I(Ee, {
416
+ id: l.id,
417
+ name: l.name,
418
+ onDelete: g
419
+ }, null, 8, ["id", "name"]))), 256))
420
+ ])) : T("", !0),
421
+ t.multiselect ? T("", !0) : (c(), v("span", Le, C(Array.isArray(e.value) ? "" : e.value.name), 1)),
422
+ t.addChanger && !t.multiselect && i.value.length > 1 && !t.disabled ? (c(), v("span", {
423
+ key: 2,
424
+ class: "top-changer top-changer-selector",
425
+ onClick: B(o, ["stop"])
426
+ })) : T("", !0)
427
+ ], 2)
428
+ ]),
429
+ widget: _(() => [
430
+ F(S(ne), {
431
+ title: "Поиск",
432
+ icon: "",
433
+ modelValue: a.value,
434
+ "onUpdate:modelValue": n[0] || (n[0] = (l) => a.value = l),
435
+ isLoading: S(p).isLoading.value,
436
+ placeholder: !Array.isArray(e.value) && !t.multiselect && t.showSelectedInInput ? e.value.name : t.placeholder
437
+ }, null, 8, ["modelValue", "isLoading", "placeholder"])
438
+ ]),
439
+ contentList: _(() => [
440
+ (c(!0), v(G, null, H(A.value, (l) => (c(), I(S(R), {
441
+ class: $({
442
+ "top-active": !Array.isArray(e.value) && !t.multiselect && e.value.name === l.name
443
+ }),
444
+ key: l.id ?? void 0,
445
+ onClick: B((b) => u(l), ["stop"])
446
+ }, {
447
+ default: _(() => [
448
+ t.$slots.item ? j(t.$slots, "item", {
449
+ key: 0,
450
+ item: l
451
+ }) : (c(), v(G, { key: 1 }, [
452
+ M(C(l.name), 1)
453
+ ], 64))
454
+ ]),
455
+ _: 2
456
+ }, 1032, ["class", "onClick"]))), 128)),
457
+ A.value.length ? T("", !0) : (c(), I(S(R), {
458
+ key: 0,
459
+ type: "regular"
460
+ }, {
461
+ default: _(() => [
462
+ M(" Нет результатов ")
463
+ ]),
464
+ _: 1
465
+ }))
466
+ ]),
467
+ _: 3
468
+ }, 512));
469
+ }
470
+ }), Ge = {
471
+ "top-selector2": "top-selector2",
472
+ "top-selector2-multiselect": "top-selector2-multiselect",
473
+ "top-active": "top-active",
474
+ "top-selector2_activeItems": "top-selector2_activeItems",
475
+ "top-selector2_activeName": "top-selector2_activeName",
476
+ "top-changer-selector": "top-changer-selector"
477
+ }, Ne = {
478
+ $style: Ge
479
+ }, Oe = /* @__PURE__ */ L(Pe, [["__cssModules", Ne]]), Xe = fe, Re = be, Ye = $e, je = Oe, Qe = ue;
241
480
  export {
242
- ve as TopEditArea,
243
- ye as TopEditInput,
244
- Ve as TopMenu,
245
- be as TopRadioGroup
481
+ Xe as TopEditArea,
482
+ Re as TopEditInput,
483
+ Qe as TopMenu,
484
+ Ye as TopRadioGroup,
485
+ je as TopSelector2
246
486
  };
247
487
  //# sourceMappingURL=formsExt.js.map