@topvisor/ui 0.9.34-utils-components-3 → 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.
- package/.chunks/datepicker-B-QNMaqL.es.js +289 -0
- package/.chunks/datepicker-B-QNMaqL.es.js.map +1 -0
- package/.chunks/datepicker-BtTKGtP7.amd.js +247 -0
- package/.chunks/datepicker-BtTKGtP7.amd.js.map +1 -0
- package/.chunks/{forms-zlyhVXZ9.es.js → forms-CRdPxA6a.es.js} +90 -90
- package/.chunks/forms-CRdPxA6a.es.js.map +1 -0
- package/.chunks/{forms-CvUw0pdr.amd.js → forms-CbJDUr1_.amd.js} +3 -3
- package/.chunks/forms-CbJDUr1_.amd.js.map +1 -0
- package/.chunks/{listItem.vue_vue_type_script_setup_true_lang-C1JdWeQq.es.js → listItem.vue_vue_type_script_setup_true_lang-D5EXHsIJ.es.js} +2 -2
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-D5EXHsIJ.es.js.map +1 -0
- package/.chunks/{listItem.vue_vue_type_script_setup_true_lang-C0vCVRTn.amd.js → listItem.vue_vue_type_script_setup_true_lang-W45jLCVb.amd.js} +2 -2
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-W45jLCVb.amd.js.map +1 -0
- package/.chunks/{menu-D8OY3zle.amd.js → menu-BNQ5GpPq.amd.js} +2 -2
- package/.chunks/menu-BNQ5GpPq.amd.js.map +1 -0
- package/.chunks/{menu-DFQAjecc.es.js → menu-D8Pkjvdh.es.js} +2 -2
- package/.chunks/menu-D8Pkjvdh.es.js.map +1 -0
- package/.chunks/{popup-BoqfTf-1.es.js → popup-DUd8G4iQ.es.js} +485 -485
- package/.chunks/popup-DUd8G4iQ.es.js.map +1 -0
- package/.chunks/{popup-31lyEYe3.amd.js → popup-DcfMTbwU.amd.js} +440 -440
- package/.chunks/popup-DcfMTbwU.amd.js.map +1 -0
- package/.chunks/store-Bl79G7T_.amd.js.map +1 -1
- package/.chunks/store-PoMCiuBr.es.js.map +1 -1
- package/README.md +86 -86
- package/assets/forms.css +1 -1
- package/assets/formsExt.css +1 -1
- package/core/core.amd.js +1 -1
- package/core/core.js +1 -1
- package/core/directives/focus.amd.js +1 -1
- package/core/directives/focus.js +1 -1
- package/core/directives/sticky.amd.js +1 -1
- package/core/directives/sticky.js +1 -1
- package/core/directives/swimUp.amd.js +1 -1
- package/core/directives/swimUp.js +1 -1
- package/core/directives/tooltip.amd.js +1 -1
- package/core/directives/tooltip.js +1 -1
- package/core/plugin/plugin.amd.js +1 -1
- package/core/plugin/plugin.amd.js.map +1 -1
- package/core/plugin/plugin.js +2 -2
- package/core/plugin/plugin.js.map +1 -1
- package/forms/forms.amd.js +1 -1
- package/forms/forms.js +1 -1
- package/forms/helpers.amd.js.map +1 -1
- package/forms/helpers.js.map +1 -1
- package/formsExt/formsExt.amd.js +1 -1
- package/formsExt/formsExt.amd.js.map +1 -1
- package/formsExt/formsExt.js +362 -122
- package/formsExt/formsExt.js.map +1 -1
- package/icomoon/Read Me.txt +7 -7
- package/icomoon/demo-files/demo.css +161 -161
- package/icomoon/demo-files/demo.js +30 -30
- package/icomoon/demo.html +3379 -3379
- package/icomoon/fonts/Topvisor-2.svg +263 -263
- package/icomoon/style.css +740 -740
- package/package.json +32 -32
- package/popup/popup.amd.js +1 -1
- package/popup/popup.amd.js.map +1 -1
- package/popup/popup.js +2 -2
- package/popup/popup.js.map +1 -1
- package/popup/worker.amd.js +1 -1
- package/popup/worker.amd.js.map +1 -1
- package/popup/worker.js +2 -2
- package/popup/worker.js.map +1 -1
- package/project/project.amd.js +1 -1
- package/project/project.amd.js.map +1 -1
- package/project/project.js +3 -3
- package/project/project.js.map +1 -1
- package/require/css.amd.js +11 -11
- package/src/components/formsExt/formsExt.d.ts +2 -0
- package/src/components/formsExt/selector2/itemMulti.vue.d.ts +18 -0
- package/src/components/formsExt/selector2/selector2.vue.d.ts +132 -0
- package/tabs/tabs.amd.js +1 -1
- package/tabs/tabs.amd.js.map +1 -1
- package/tabs/tabs.js +1 -1
- package/tabs/tabs.js.map +1 -1
- package/tabsView/tabsView.amd.js +1 -1
- package/tabsView/tabsView.amd.js.map +1 -1
- package/tabsView/tabsView.js +1 -1
- package/tabsView/tabsView.js.map +1 -1
- package/utils/check.amd.js.map +1 -1
- package/utils/check.js.map +1 -1
- package/utils/css.amd.js.map +1 -1
- package/utils/css.js.map +1 -1
- package/utils/date.amd.js +1 -1
- package/utils/date.js +1 -1
- package/utils/device.amd.js +1 -1
- package/utils/device.js +1 -1
- package/utils/dom.amd.js.map +1 -1
- package/utils/dom.js.map +1 -1
- package/utils/image.amd.js.map +1 -1
- package/utils/image.js.map +1 -1
- package/utils/keyboard.amd.js.map +1 -1
- package/utils/keyboard.js.map +1 -1
- package/utils/number.amd.js.map +1 -1
- package/utils/number.js.map +1 -1
- package/utils/price.amd.js.map +1 -1
- package/utils/price.js.map +1 -1
- package/utils/route.amd.js.map +1 -1
- package/utils/route.js.map +1 -1
- package/utils/scroll.amd.js +1 -1
- package/utils/scroll.amd.js.map +1 -1
- package/utils/scroll.js +1 -1
- package/utils/scroll.js.map +1 -1
- package/utils/string.amd.js.map +1 -1
- package/utils/string.js.map +1 -1
- package/utils/system.amd.js.map +1 -1
- package/utils/system.js.map +1 -1
- package/utils/url.amd.js.map +1 -1
- package/utils/url.js.map +1 -1
- package/utils/window.amd.js +1 -1
- package/utils/window.js +1 -1
- package/web-types.json +62 -62
- package/.chunks/datepicker-CtnkRS5e.es.js +0 -289
- package/.chunks/datepicker-CtnkRS5e.es.js.map +0 -1
- package/.chunks/datepicker-DquD9mIq.amd.js +0 -247
- package/.chunks/datepicker-DquD9mIq.amd.js.map +0 -1
- package/.chunks/forms-CvUw0pdr.amd.js.map +0 -1
- package/.chunks/forms-zlyhVXZ9.es.js.map +0 -1
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-C0vCVRTn.amd.js.map +0 -1
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-C1JdWeQq.es.js.map +0 -1
- package/.chunks/menu-D8OY3zle.amd.js.map +0 -1
- package/.chunks/menu-DFQAjecc.es.js.map +0 -1
- package/.chunks/popup-31lyEYe3.amd.js.map +0 -1
- package/.chunks/popup-BoqfTf-1.es.js.map +0 -1
package/formsExt/formsExt.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { insertToPage as
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { v as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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(
|
|
31
|
-
const e =
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
if (e.forceShowCloseBtn && !
|
|
35
|
-
|
|
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
|
-
|
|
39
|
-
},
|
|
40
|
-
e.attachToKeyboard &&
|
|
41
|
+
m.value = e.defaultValue;
|
|
42
|
+
}, A = () => {
|
|
43
|
+
e.attachToKeyboard && a("clickOnTitle");
|
|
41
44
|
};
|
|
42
|
-
return (
|
|
43
|
-
const
|
|
44
|
-
return
|
|
45
|
-
class:
|
|
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":
|
|
50
|
+
"top-editArea-attachedToKeyboard": u.attachToKeyboard
|
|
48
51
|
})
|
|
49
52
|
}, [
|
|
50
|
-
|
|
53
|
+
u.title ? (c(), v("div", {
|
|
51
54
|
key: 0,
|
|
52
55
|
class: "top-editArea_title",
|
|
53
|
-
onClick:
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
class:
|
|
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":
|
|
59
|
-
"top-focus":
|
|
61
|
+
"top-error": u.isError,
|
|
62
|
+
"top-focus": f.value
|
|
60
63
|
})
|
|
61
64
|
}, [
|
|
62
|
-
|
|
63
|
-
modelValue:
|
|
64
|
-
"onUpdate:modelValue":
|
|
65
|
-
name:
|
|
66
|
-
placeholder:
|
|
67
|
-
rows:
|
|
68
|
-
minHeight:
|
|
69
|
-
expandable:
|
|
70
|
-
disabled:
|
|
71
|
-
readonly:
|
|
72
|
-
isError:
|
|
73
|
-
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:
|
|
76
|
-
onBlur:
|
|
78
|
+
onFocus: o[2] || (o[2] = () => f.value = !0),
|
|
79
|
+
onBlur: o[3] || (o[3] = () => f.value = !1),
|
|
77
80
|
onKeyup: [
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
[
|
|
85
|
+
[g, f.value]
|
|
83
86
|
]),
|
|
84
|
-
|
|
85
|
-
|
|
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:
|
|
91
|
-
onClick:
|
|
93
|
+
icon: u.attachToKeyboard ? "" : "",
|
|
94
|
+
onClick: y
|
|
92
95
|
}, {
|
|
93
|
-
default:
|
|
94
|
-
C(
|
|
96
|
+
default: _(() => [
|
|
97
|
+
M(C(p.value), 1)
|
|
95
98
|
]),
|
|
96
99
|
_: 1
|
|
97
|
-
}, 8, ["icon"])) :
|
|
98
|
-
|
|
100
|
+
}, 8, ["icon"])) : T("", !0),
|
|
101
|
+
s.value ? (c(), I(z, {
|
|
99
102
|
key: 1,
|
|
100
103
|
class: "top-editArea_button",
|
|
101
|
-
icon:
|
|
102
|
-
onClick:
|
|
104
|
+
icon: u.attachToKeyboard ? "" : "",
|
|
105
|
+
onClick: o[5] || (o[5] = (h) => i(m.value))
|
|
103
106
|
}, {
|
|
104
|
-
default:
|
|
105
|
-
C(
|
|
107
|
+
default: _(() => [
|
|
108
|
+
M(C(u.attachToKeyboard ? "" : u.submitText), 1)
|
|
106
109
|
]),
|
|
107
110
|
_: 1
|
|
108
|
-
}, 8, ["icon"])) :
|
|
111
|
+
}, 8, ["icon"])) : T("", !0)
|
|
109
112
|
])
|
|
110
113
|
], 2)
|
|
111
114
|
], 2);
|
|
112
115
|
};
|
|
113
116
|
}
|
|
114
|
-
}),
|
|
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
|
-
},
|
|
127
|
-
$style:
|
|
128
|
-
},
|
|
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(
|
|
137
|
-
const e =
|
|
138
|
-
|
|
139
|
-
|
|
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
|
|
142
|
-
|
|
144
|
+
const m = d, f = () => {
|
|
145
|
+
m("update:modelValue", a.value);
|
|
143
146
|
};
|
|
144
|
-
return (
|
|
145
|
-
|
|
146
|
-
onKeydownCapture:
|
|
147
|
-
onKeydown:
|
|
148
|
-
modelValue:
|
|
149
|
-
"onUpdate:modelValue":
|
|
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
|
-
|
|
154
|
+
a.value !== s.modelValue ? (c(), I(z, X({
|
|
152
155
|
key: 0,
|
|
153
156
|
icon: "",
|
|
154
157
|
styling: "soft"
|
|
155
|
-
},
|
|
156
|
-
default:
|
|
157
|
-
|
|
158
|
+
}, s.button, { onClick: f }), {
|
|
159
|
+
default: _(() => [
|
|
160
|
+
j(s.$slots, "default")
|
|
158
161
|
]),
|
|
159
162
|
_: 3
|
|
160
|
-
}, 16)) :
|
|
163
|
+
}, 16)) : T("", !0)
|
|
161
164
|
]));
|
|
162
165
|
}
|
|
163
|
-
}),
|
|
166
|
+
}), he = {
|
|
164
167
|
"top-editInput": "top-editInput",
|
|
165
168
|
"top-input": "top-input"
|
|
166
|
-
},
|
|
167
|
-
$style:
|
|
168
|
-
},
|
|
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
|
-
},
|
|
174
|
+
}, Ve = ["value", "disabled"], _e = /* @__PURE__ */ K({
|
|
172
175
|
__name: "radioGroup",
|
|
173
|
-
props: /* @__PURE__ */
|
|
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__ */
|
|
186
|
-
setup(
|
|
187
|
-
const e =
|
|
188
|
-
|
|
189
|
-
var
|
|
190
|
-
(
|
|
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
|
|
193
|
-
return (
|
|
195
|
+
const f = "radioGroup-" + Math.random();
|
|
196
|
+
return (s, p) => (c(), v("div", {
|
|
194
197
|
ref_key: "elRef",
|
|
195
|
-
ref:
|
|
196
|
-
class:
|
|
198
|
+
ref: m,
|
|
199
|
+
class: $({
|
|
197
200
|
"top-radioGroup": !0,
|
|
198
201
|
"top-scrollBarXHidding": !0,
|
|
199
|
-
["top-size_" +
|
|
200
|
-
"top-error":
|
|
202
|
+
["top-size_" + s.size]: !!s.size,
|
|
203
|
+
"top-error": s.isError
|
|
201
204
|
})
|
|
202
205
|
}, [
|
|
203
|
-
(
|
|
204
|
-
class:
|
|
205
|
-
"top-radioGroup_item-selected":
|
|
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":
|
|
211
|
+
"top-disabled": i.disabled
|
|
209
212
|
}),
|
|
210
|
-
"data-top-icon":
|
|
211
|
-
onClick: (
|
|
213
|
+
"data-top-icon": i.icon,
|
|
214
|
+
onClick: (y) => e.value = i.value
|
|
212
215
|
}, [
|
|
213
|
-
C(
|
|
214
|
-
|
|
215
|
-
E(
|
|
216
|
-
"onUpdate:modelValue":
|
|
217
|
-
name:
|
|
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:
|
|
222
|
+
class: $({
|
|
220
223
|
"top-unvisible": !0
|
|
221
224
|
}),
|
|
222
|
-
value:
|
|
223
|
-
disabled:
|
|
224
|
-
}, null, 8,
|
|
225
|
-
[
|
|
225
|
+
value: i.value,
|
|
226
|
+
disabled: i.disabled
|
|
227
|
+
}, null, 8, Ve), [
|
|
228
|
+
[te, e.value]
|
|
226
229
|
])
|
|
227
|
-
], 10,
|
|
230
|
+
], 10, ge))), 256))
|
|
228
231
|
], 2));
|
|
229
232
|
}
|
|
230
|
-
}),
|
|
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
|
-
},
|
|
239
|
-
$style:
|
|
240
|
-
},
|
|
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
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
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
|