@efficiency-point/design-system 0.1.3 → 0.1.5
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/README.md +18 -0
- package/dist/components/DSAccordion/DSAccordion.d.ts +9 -3
- package/dist/components/DSAccordion/DSAccordion.d.ts.map +1 -1
- package/dist/components/DSButton/DSButton.d.ts +0 -1
- package/dist/components/DSButton/DSButton.d.ts.map +1 -1
- package/dist/components/DSDateTimePicker/DSDateTimePicker.d.ts.map +1 -1
- package/dist/components/DSDropDownMultiple/DSDropDownMultiple.d.ts +6 -2
- package/dist/components/DSDropDownMultiple/DSDropDownMultiple.d.ts.map +1 -1
- package/dist/components/DSLoader/DSLoader.d.ts +3 -7
- package/dist/components/DSLoader/DSLoader.d.ts.map +1 -1
- package/dist/components/DSPageLoader/DSPageLoader.d.ts +1 -5
- package/dist/components/DSPageLoader/DSPageLoader.d.ts.map +1 -1
- package/dist/components/DSSearchDropDown/DSSearchDropDown.d.ts +22 -0
- package/dist/components/DSSearchDropDown/DSSearchDropDown.d.ts.map +1 -0
- package/dist/components/DSSearchDropDown/DSSearchDropDown.utils.d.ts +4 -0
- package/dist/components/DSSearchDropDown/DSSearchDropDown.utils.d.ts.map +1 -0
- package/dist/components/DSVideoPlayerFrame/DSVideoPlayerFrame.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +1022 -573
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/components/DSPopup/DSPopup.d.ts +0 -9
- package/dist/components/DSPopup/DSPopup.d.ts.map +0 -1
package/dist/index.es.js
CHANGED
|
@@ -33,17 +33,28 @@ var y = {
|
|
|
33
33
|
})
|
|
34
34
|
]
|
|
35
35
|
}), x = {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
"
|
|
36
|
+
container: "_container_dhg26_1",
|
|
37
|
+
inner: "_inner_dhg26_21",
|
|
38
|
+
line: "_line_dhg26_39",
|
|
39
|
+
primary: "_primary_dhg26_57",
|
|
40
|
+
secondary: "_secondary_dhg26_63",
|
|
41
|
+
outline: "_outline_dhg26_69",
|
|
42
|
+
ghost: "_ghost_dhg26_75",
|
|
43
|
+
empty: "_empty_dhg26_81",
|
|
44
|
+
destructive: "_destructive_dhg26_87",
|
|
45
|
+
destructiveOutline: "_destructiveOutline_dhg26_93",
|
|
46
|
+
grow: "_grow_dhg26_1"
|
|
47
|
+
}, S = ({ variant: e = "primary" }) => /* @__PURE__ */ t("div", {
|
|
48
|
+
className: `${x.container} ${x[e]}`,
|
|
49
|
+
children: /* @__PURE__ */ n("div", {
|
|
50
|
+
className: `${x.inner} ${x[e]}`,
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ t("div", { className: `${x.line} ${x[e]}` }),
|
|
53
|
+
/* @__PURE__ */ t("div", { className: `${x.line} ${x[e]}` }),
|
|
54
|
+
/* @__PURE__ */ t("div", { className: `${x.line} ${x[e]}` }),
|
|
55
|
+
/* @__PURE__ */ t("div", { className: `${x.line} ${x[e]}` })
|
|
56
|
+
]
|
|
57
|
+
})
|
|
47
58
|
}), C = {
|
|
48
59
|
button: "_button_1gql6_1",
|
|
49
60
|
sm: "_sm_1gql6_43",
|
|
@@ -56,17 +67,14 @@ var y = {
|
|
|
56
67
|
empty: "_empty_1gql6_127",
|
|
57
68
|
destructive: "_destructive_1gql6_139",
|
|
58
69
|
destructiveOutline: "_destructiveOutline_1gql6_147"
|
|
59
|
-
}, w = i(({ children: e, variant: n = "primary", size: r = "md", isLoading: i = !1,
|
|
60
|
-
ref:
|
|
61
|
-
className: `${C.button} ${C[n]} ${C[r]} ${
|
|
62
|
-
disabled:
|
|
70
|
+
}, w = i(({ children: e, variant: n = "primary", size: r = "md", isLoading: i = !1, disabled: a, type: o = "button", className: s = "", ...c }, l) => /* @__PURE__ */ t("button", {
|
|
71
|
+
ref: l,
|
|
72
|
+
className: `${C.button} ${C[n]} ${C[r]} ${s}`,
|
|
73
|
+
disabled: a || i,
|
|
63
74
|
"aria-busy": i || void 0,
|
|
64
|
-
...
|
|
65
|
-
type:
|
|
66
|
-
children: i ? /* @__PURE__ */ t(S, {
|
|
67
|
-
variant: "light",
|
|
68
|
-
label: a
|
|
69
|
-
}) : e
|
|
75
|
+
...c,
|
|
76
|
+
type: o,
|
|
77
|
+
children: i ? /* @__PURE__ */ t(S, { variant: n }) : e
|
|
70
78
|
}));
|
|
71
79
|
w.displayName = "DSButton";
|
|
72
80
|
var T = {
|
|
@@ -78,7 +86,7 @@ var T = {
|
|
|
78
86
|
disabled: "_disabled_fa00b_47",
|
|
79
87
|
message: "_message_fa00b_55",
|
|
80
88
|
success: "_success_fa00b_71"
|
|
81
|
-
},
|
|
89
|
+
}, ee = ({ children: e, required: r = !1, optionalText: i, disabled: a = !1, className: o = "", ...s }) => /* @__PURE__ */ n("label", {
|
|
82
90
|
className: `${T.label} ${a ? T.disabled : ""} ${o}`,
|
|
83
91
|
...s,
|
|
84
92
|
children: [
|
|
@@ -93,28 +101,28 @@ var T = {
|
|
|
93
101
|
children: i
|
|
94
102
|
})
|
|
95
103
|
]
|
|
96
|
-
}),
|
|
104
|
+
}), E = ({ children: e, variant: n = "hint", id: r, live: i = !1, className: a = "" }) => /* @__PURE__ */ t("span", {
|
|
97
105
|
id: r,
|
|
98
106
|
className: `${T.message} ${T[n]} ${a}`,
|
|
99
107
|
role: i && n === "error" ? "alert" : void 0,
|
|
100
108
|
"aria-live": i && n !== "error" ? "polite" : void 0,
|
|
101
109
|
children: e
|
|
102
|
-
}),
|
|
110
|
+
}), D = {
|
|
103
111
|
wrapper: "_wrapper_1gq36_1",
|
|
104
112
|
label: "_label_1gq36_3",
|
|
105
113
|
input: "_input_1gq36_5",
|
|
106
114
|
control: "_control_1gq36_7",
|
|
107
115
|
disabled: "_disabled_1gq36_13",
|
|
108
116
|
controlError: "_controlError_1gq36_17"
|
|
109
|
-
},
|
|
117
|
+
}, O = ({ checked: e, onChange: r, label: i, hint: a, error: o, disabled: l = !1, readOnly: u = !1, className: f = "", name: p, id: m, indeterminate: h = !1, ...g }) => {
|
|
110
118
|
let _ = c(), v = m ?? `ds-checkbox-${p ?? _}`, y = d(null), b = a ? `${v}-hint` : void 0, x = o ? `${v}-error` : void 0;
|
|
111
119
|
return s(() => {
|
|
112
120
|
y.current && (y.current.indeterminate = h && !e);
|
|
113
121
|
}, [e, h]), /* @__PURE__ */ n("div", {
|
|
114
|
-
className: `${
|
|
122
|
+
className: `${D.wrapper} ${f}`,
|
|
115
123
|
children: [
|
|
116
124
|
/* @__PURE__ */ n("label", {
|
|
117
|
-
className: `${
|
|
125
|
+
className: `${D.label} ${l ? D.disabled : ""}`,
|
|
118
126
|
htmlFor: v,
|
|
119
127
|
children: [
|
|
120
128
|
/* @__PURE__ */ t("input", {
|
|
@@ -127,32 +135,32 @@ var T = {
|
|
|
127
135
|
"aria-readonly": u || void 0,
|
|
128
136
|
"aria-invalid": !!o,
|
|
129
137
|
"aria-describedby": [b, x].filter(Boolean).join(" ") || void 0,
|
|
130
|
-
className:
|
|
138
|
+
className: D.input,
|
|
131
139
|
onChange: (e) => {
|
|
132
140
|
u || r?.(e.target.checked, e);
|
|
133
141
|
},
|
|
134
142
|
...g
|
|
135
143
|
}),
|
|
136
144
|
/* @__PURE__ */ t("span", {
|
|
137
|
-
className: `${
|
|
145
|
+
className: `${D.control} ${o ? D.controlError : ""}`,
|
|
138
146
|
"aria-hidden": "true",
|
|
139
147
|
children: h && !e ? "−" : e ? "✓" : ""
|
|
140
148
|
}),
|
|
141
149
|
i && /* @__PURE__ */ t("span", { children: i })
|
|
142
150
|
]
|
|
143
151
|
}),
|
|
144
|
-
a && !o && /* @__PURE__ */ t(
|
|
152
|
+
a && !o && /* @__PURE__ */ t(E, {
|
|
145
153
|
id: b,
|
|
146
154
|
children: a
|
|
147
155
|
}),
|
|
148
|
-
o && /* @__PURE__ */ t(
|
|
156
|
+
o && /* @__PURE__ */ t(E, {
|
|
149
157
|
id: x,
|
|
150
158
|
variant: "error",
|
|
151
159
|
children: o
|
|
152
160
|
})
|
|
153
161
|
]
|
|
154
162
|
});
|
|
155
|
-
},
|
|
163
|
+
}, k = {
|
|
156
164
|
wrapper: "_wrapper_1or7y_1",
|
|
157
165
|
trigger: "_trigger_1or7y_17",
|
|
158
166
|
lg: "_lg_1or7y_51",
|
|
@@ -173,7 +181,7 @@ var T = {
|
|
|
173
181
|
outside: "_outside_1or7y_309",
|
|
174
182
|
selected: "_selected_1or7y_317",
|
|
175
183
|
timeLabel: "_timeLabel_1or7y_337"
|
|
176
|
-
},
|
|
184
|
+
}, A = [
|
|
177
185
|
"Пн",
|
|
178
186
|
"Вт",
|
|
179
187
|
"Ср",
|
|
@@ -181,7 +189,7 @@ var T = {
|
|
|
181
189
|
"Пт",
|
|
182
190
|
"Сб",
|
|
183
191
|
"Вс"
|
|
184
|
-
],
|
|
192
|
+
], j = [
|
|
185
193
|
"Январь",
|
|
186
194
|
"Февраль",
|
|
187
195
|
"Март",
|
|
@@ -194,11 +202,11 @@ var T = {
|
|
|
194
202
|
"Октябрь",
|
|
195
203
|
"Ноябрь",
|
|
196
204
|
"Декабрь"
|
|
197
|
-
],
|
|
205
|
+
], M = (e) => String(e).padStart(2, "0"), N = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), P = (e, t) => {
|
|
198
206
|
if (!e) return "";
|
|
199
|
-
let n = `${e.getFullYear()}-${
|
|
207
|
+
let n = `${e.getFullYear()}-${M(e.getMonth() + 1)}-${M(e.getDate())}`, r = `${M(e.getHours())}:${M(e.getMinutes())}`;
|
|
200
208
|
return t === "date" ? n : t === "time" ? r : `${n}T${r}`;
|
|
201
|
-
},
|
|
209
|
+
}, F = (e, t) => {
|
|
202
210
|
if (!e) return null;
|
|
203
211
|
if (t === "time") {
|
|
204
212
|
let t = /^(\d{2}):(\d{2})$/.exec(e);
|
|
@@ -208,33 +216,39 @@ var T = {
|
|
|
208
216
|
let i = /* @__PURE__ */ new Date();
|
|
209
217
|
return i.setHours(n, r, 0, 0), i;
|
|
210
218
|
}
|
|
211
|
-
|
|
219
|
+
if (t === "date") {
|
|
220
|
+
let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e);
|
|
221
|
+
if (!t) return null;
|
|
222
|
+
let n = Number(t[1]), r = Number(t[2]) - 1, i = Number(t[3]), a = new Date(n, r, i, 12);
|
|
223
|
+
return a.getFullYear() !== n || a.getMonth() !== r || a.getDate() !== i ? null : a;
|
|
224
|
+
}
|
|
225
|
+
let n = new Date(e);
|
|
212
226
|
return Number.isNaN(n.getTime()) ? null : n;
|
|
213
|
-
},
|
|
227
|
+
}, I = (e, t) => {
|
|
214
228
|
if (!e) return "";
|
|
215
|
-
let n = `${
|
|
229
|
+
let n = `${M(e.getDate())}.${M(e.getMonth() + 1)}.${e.getFullYear()}`, r = `${M(e.getHours())}:${M(e.getMinutes())}`;
|
|
216
230
|
return t === "date" ? n : t === "time" ? r : `${n} ${r}`;
|
|
217
|
-
},
|
|
231
|
+
}, L = (e) => {
|
|
218
232
|
let t = new Date(e.getFullYear(), e.getMonth(), 1), n = (t.getDay() + 6) % 7, r = new Date(t);
|
|
219
233
|
return r.setDate(t.getDate() - n), Array.from({ length: 42 }, (e, t) => {
|
|
220
234
|
let n = new Date(r);
|
|
221
235
|
return n.setDate(r.getDate() + t), n;
|
|
222
236
|
});
|
|
223
|
-
},
|
|
224
|
-
let r =
|
|
225
|
-
return !!(t && r <
|
|
226
|
-
},
|
|
227
|
-
let
|
|
237
|
+
}, R = (e, t) => !!(e && e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate()), z = (e, t, n) => {
|
|
238
|
+
let r = N(e).getTime();
|
|
239
|
+
return !!(t && r < N(t).getTime() || n && r > N(n).getTime());
|
|
240
|
+
}, B = 8, V = 6, H = ({ value: r, onChange: i, mode: a = "date", label: m, placeholder: h, hint: g, error: _, disabled: v = !1, readOnly: y = !1, required: b = !1, min: x, max: S, size: C = "md", id: w, name: T, className: D = "" }) => {
|
|
241
|
+
let O = c(), M = w ?? `ds-date-time-${T ?? O}`, N = g ? `${M}-hint` : void 0, H = _ ? `${M}-error` : void 0, U = d(null), W = d(null), te = d(null), [G, K] = f(!1), [q, J] = f(r ?? /* @__PURE__ */ new Date()), [ne, re] = f(P(r, "time")), [ie, ae] = f(null), oe = u(() => L(q), [q]), se = a !== "time", ce = a !== "date";
|
|
228
242
|
s(() => {
|
|
229
|
-
r &&
|
|
243
|
+
r && J(r), re(P(r, "time"));
|
|
230
244
|
}, [r]);
|
|
231
245
|
let le = o(() => {
|
|
232
246
|
let e = W.current, t = te.current;
|
|
233
247
|
if (!e || !t) return;
|
|
234
|
-
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight - n.bottom -
|
|
248
|
+
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight - n.bottom - B, o = n.top - B, s = a < r.height && o > a, c = Math.max(120, s ? o : a), l = s ? Math.max(B, n.top - r.height - V) : n.bottom + V, u = n.left, d = i - r.width - B;
|
|
235
249
|
ae({
|
|
236
250
|
top: l,
|
|
237
|
-
left: Math.max(
|
|
251
|
+
left: Math.max(B, Math.min(u, d)),
|
|
238
252
|
maxHeight: c
|
|
239
253
|
});
|
|
240
254
|
}, []);
|
|
@@ -249,42 +263,42 @@ var T = {
|
|
|
249
263
|
}, [
|
|
250
264
|
G,
|
|
251
265
|
le,
|
|
252
|
-
|
|
253
|
-
|
|
266
|
+
q,
|
|
267
|
+
ne
|
|
254
268
|
]), s(() => {
|
|
255
269
|
if (!G) return;
|
|
256
270
|
let e = (e) => {
|
|
257
271
|
let t = e.target, n = U.current?.contains(t), r = te.current?.contains(t);
|
|
258
|
-
!n && !r &&
|
|
272
|
+
!n && !r && K(!1);
|
|
259
273
|
}, t = (e) => {
|
|
260
|
-
e.key === "Escape" && (
|
|
274
|
+
e.key === "Escape" && (K(!1), W.current?.focus());
|
|
261
275
|
};
|
|
262
276
|
return document.addEventListener("pointerdown", e), document.addEventListener("keydown", t), () => {
|
|
263
277
|
document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
|
|
264
278
|
};
|
|
265
279
|
}, [G]);
|
|
266
280
|
let ue = (e) => {
|
|
267
|
-
if (
|
|
268
|
-
let t = new Date(e);
|
|
269
|
-
t.setHours(r?.getHours() ?? 0, r?.getMinutes() ?? 0, 0, 0), i?.(t), a === "date" &&
|
|
281
|
+
if (z(e, x, S)) return;
|
|
282
|
+
let t = a === "date" ? F(P(e, "date"), "date") : new Date(e);
|
|
283
|
+
t && (a !== "date" && t.setHours(r?.getHours() ?? 0, r?.getMinutes() ?? 0, 0, 0), i?.(t), a === "date" && K(!1));
|
|
270
284
|
}, Y = (e) => {
|
|
271
|
-
if (
|
|
285
|
+
if (re(e), !e) {
|
|
272
286
|
i?.(null);
|
|
273
287
|
return;
|
|
274
288
|
}
|
|
275
|
-
let t =
|
|
289
|
+
let t = F(e, "time");
|
|
276
290
|
if (!t) return;
|
|
277
|
-
let n = new Date(a === "datetime" ? r ??
|
|
291
|
+
let n = new Date(a === "datetime" ? r ?? q : /* @__PURE__ */ new Date());
|
|
278
292
|
n.setHours(t.getHours(), t.getMinutes(), 0, 0), !(x && n < x || S && n > S) && i?.(n);
|
|
279
|
-
}, de = h ?? (a === "date" ? "Выберите дату" : a === "time" ? "Введите время" : "Выберите дату и время"), fe = [
|
|
293
|
+
}, de = h ?? (a === "date" ? "Выберите дату" : a === "time" ? "Введите время" : "Выберите дату и время"), fe = [N, H].filter(Boolean).join(" ") || void 0, pe = G && !y ? /* @__PURE__ */ n("div", {
|
|
280
294
|
ref: te,
|
|
281
|
-
className:
|
|
295
|
+
className: k.panel,
|
|
282
296
|
role: "dialog",
|
|
283
297
|
"aria-label": m ?? de,
|
|
284
|
-
style:
|
|
285
|
-
top:
|
|
286
|
-
left:
|
|
287
|
-
maxHeight:
|
|
298
|
+
style: ie ? {
|
|
299
|
+
top: ie.top,
|
|
300
|
+
left: ie.left,
|
|
301
|
+
maxHeight: ie.maxHeight
|
|
288
302
|
} : {
|
|
289
303
|
visibility: "hidden",
|
|
290
304
|
top: 0,
|
|
@@ -292,53 +306,53 @@ var T = {
|
|
|
292
306
|
},
|
|
293
307
|
children: [se && /* @__PURE__ */ n(e, { children: [
|
|
294
308
|
/* @__PURE__ */ n("div", {
|
|
295
|
-
className:
|
|
309
|
+
className: k.calendarHeader,
|
|
296
310
|
children: [
|
|
297
311
|
/* @__PURE__ */ t("button", {
|
|
298
312
|
type: "button",
|
|
299
|
-
className:
|
|
313
|
+
className: k.nav,
|
|
300
314
|
"aria-label": "Предыдущий месяц",
|
|
301
|
-
onClick: () =>
|
|
315
|
+
onClick: () => J(new Date(q.getFullYear(), q.getMonth() - 1, 1)),
|
|
302
316
|
children: "‹"
|
|
303
317
|
}),
|
|
304
318
|
/* @__PURE__ */ t("select", {
|
|
305
|
-
className:
|
|
319
|
+
className: k.monthSelect,
|
|
306
320
|
"aria-label": "Месяц",
|
|
307
|
-
value:
|
|
308
|
-
onChange: (e) =>
|
|
309
|
-
children:
|
|
321
|
+
value: q.getMonth(),
|
|
322
|
+
onChange: (e) => J(new Date(q.getFullYear(), Number(e.target.value), 1)),
|
|
323
|
+
children: j.map((e, n) => /* @__PURE__ */ t("option", {
|
|
310
324
|
value: n,
|
|
311
325
|
children: e
|
|
312
326
|
}, e))
|
|
313
327
|
}),
|
|
314
328
|
/* @__PURE__ */ t("input", {
|
|
315
|
-
className:
|
|
329
|
+
className: k.yearInput,
|
|
316
330
|
type: "number",
|
|
317
331
|
"aria-label": "Год",
|
|
318
|
-
value:
|
|
319
|
-
onChange: (e) =>
|
|
332
|
+
value: q.getFullYear(),
|
|
333
|
+
onChange: (e) => J(new Date(Number(e.target.value), q.getMonth(), 1))
|
|
320
334
|
}),
|
|
321
335
|
/* @__PURE__ */ t("button", {
|
|
322
336
|
type: "button",
|
|
323
|
-
className:
|
|
337
|
+
className: k.nav,
|
|
324
338
|
"aria-label": "Следующий месяц",
|
|
325
|
-
onClick: () =>
|
|
339
|
+
onClick: () => J(new Date(q.getFullYear(), q.getMonth() + 1, 1)),
|
|
326
340
|
children: "›"
|
|
327
341
|
})
|
|
328
342
|
]
|
|
329
343
|
}),
|
|
330
344
|
/* @__PURE__ */ t("div", {
|
|
331
|
-
className:
|
|
332
|
-
children:
|
|
345
|
+
className: k.weekdays,
|
|
346
|
+
children: A.map((e) => /* @__PURE__ */ t("span", { children: e }, e))
|
|
333
347
|
}),
|
|
334
348
|
/* @__PURE__ */ t("div", {
|
|
335
|
-
className:
|
|
349
|
+
className: k.days,
|
|
336
350
|
children: oe.map((e) => {
|
|
337
|
-
let n =
|
|
351
|
+
let n = R(r, e);
|
|
338
352
|
return /* @__PURE__ */ t("button", {
|
|
339
353
|
type: "button",
|
|
340
|
-
className: `${
|
|
341
|
-
disabled:
|
|
354
|
+
className: `${k.day} ${e.getMonth() === q.getMonth() ? "" : k.outside} ${n ? k.selected : ""}`,
|
|
355
|
+
disabled: z(e, x, S),
|
|
342
356
|
"aria-pressed": n,
|
|
343
357
|
onClick: () => ue(e),
|
|
344
358
|
children: e.getDate()
|
|
@@ -346,44 +360,44 @@ var T = {
|
|
|
346
360
|
})
|
|
347
361
|
})
|
|
348
362
|
] }), ce && /* @__PURE__ */ n("label", {
|
|
349
|
-
className:
|
|
363
|
+
className: k.timeLabel,
|
|
350
364
|
children: [/* @__PURE__ */ t("span", { children: "Время" }), /* @__PURE__ */ t("input", {
|
|
351
|
-
className:
|
|
365
|
+
className: k.timeInput,
|
|
352
366
|
type: "time",
|
|
353
|
-
value:
|
|
367
|
+
value: ne,
|
|
354
368
|
onChange: (e) => Y(e.target.value)
|
|
355
369
|
})]
|
|
356
370
|
})]
|
|
357
371
|
}) : null;
|
|
358
372
|
return /* @__PURE__ */ n("div", {
|
|
359
373
|
ref: U,
|
|
360
|
-
className: `${
|
|
374
|
+
className: `${k.wrapper} ${D}`,
|
|
361
375
|
children: [
|
|
362
|
-
m && /* @__PURE__ */ t(
|
|
363
|
-
htmlFor:
|
|
376
|
+
m && /* @__PURE__ */ t(ee, {
|
|
377
|
+
htmlFor: M,
|
|
364
378
|
required: b,
|
|
365
379
|
disabled: v,
|
|
366
380
|
children: m
|
|
367
381
|
}),
|
|
368
382
|
/* @__PURE__ */ n("button", {
|
|
369
383
|
ref: W,
|
|
370
|
-
id:
|
|
384
|
+
id: M,
|
|
371
385
|
name: T,
|
|
372
386
|
type: "button",
|
|
373
|
-
className: `${
|
|
387
|
+
className: `${k.trigger} ${k[C]} ${_ ? k.error : ""}`,
|
|
374
388
|
disabled: v,
|
|
375
389
|
"aria-readonly": y || void 0,
|
|
376
390
|
"aria-expanded": G,
|
|
377
391
|
"aria-haspopup": "dialog",
|
|
378
392
|
"aria-describedby": fe,
|
|
379
393
|
onClick: () => {
|
|
380
|
-
y ||
|
|
394
|
+
y || K((e) => !e);
|
|
381
395
|
},
|
|
382
396
|
children: [/* @__PURE__ */ t("span", {
|
|
383
|
-
className: r ?
|
|
384
|
-
children:
|
|
397
|
+
className: r ? k.value : k.placeholder,
|
|
398
|
+
children: I(r, a) || de
|
|
385
399
|
}), /* @__PURE__ */ t("span", {
|
|
386
|
-
className: [
|
|
400
|
+
className: [k.chevron, pe ? k.chevronOpen : ""].filter(Boolean).join(" "),
|
|
387
401
|
"aria-hidden": "true",
|
|
388
402
|
children: /* @__PURE__ */ t("svg", {
|
|
389
403
|
viewBox: "0 0 20 20",
|
|
@@ -399,11 +413,11 @@ var T = {
|
|
|
399
413
|
})]
|
|
400
414
|
}),
|
|
401
415
|
pe && p(pe, document.body),
|
|
402
|
-
g && !_ && /* @__PURE__ */ t(
|
|
403
|
-
id:
|
|
416
|
+
g && !_ && /* @__PURE__ */ t(E, {
|
|
417
|
+
id: N,
|
|
404
418
|
children: g
|
|
405
419
|
}),
|
|
406
|
-
_ && /* @__PURE__ */ t(
|
|
420
|
+
_ && /* @__PURE__ */ t(E, {
|
|
407
421
|
id: H,
|
|
408
422
|
variant: "error",
|
|
409
423
|
children: _
|
|
@@ -452,7 +466,7 @@ var T = {
|
|
|
452
466
|
to: t
|
|
453
467
|
})
|
|
454
468
|
})]
|
|
455
|
-
}), c && !g && /* @__PURE__ */ t(
|
|
469
|
+
}), c && !g && /* @__PURE__ */ t(E, { children: c })]
|
|
456
470
|
});
|
|
457
471
|
}, G = {
|
|
458
472
|
group: "_group_1fs9e_1",
|
|
@@ -462,7 +476,7 @@ var T = {
|
|
|
462
476
|
circular: "_circular_1fs9e_9",
|
|
463
477
|
animated: "_animated_1fs9e_11",
|
|
464
478
|
"ds-skeleton": "_ds-skeleton_1fs9e_1"
|
|
465
|
-
},
|
|
479
|
+
}, K = ({ variant: e = "text", width: n = "100%", height: r, lines: i = 1, animated: a = !0, className: o = "" }) => /* @__PURE__ */ t("span", {
|
|
466
480
|
className: `${G.group} ${o}`,
|
|
467
481
|
"aria-hidden": "true",
|
|
468
482
|
children: Array.from({ length: Math.max(1, i) }, (o, s) => /* @__PURE__ */ t("span", {
|
|
@@ -472,7 +486,7 @@ var T = {
|
|
|
472
486
|
height: r
|
|
473
487
|
}
|
|
474
488
|
}, s))
|
|
475
|
-
}),
|
|
489
|
+
}), q = {
|
|
476
490
|
wrapper: "_wrapper_1f1hc_1",
|
|
477
491
|
label: "_label_1f1hc_17",
|
|
478
492
|
container: "_container_1f1hc_29",
|
|
@@ -491,7 +505,7 @@ var T = {
|
|
|
491
505
|
message: "_message_1f1hc_349",
|
|
492
506
|
error: "_error_1f1hc_351",
|
|
493
507
|
errorState: "_errorState_1f1hc_377"
|
|
494
|
-
},
|
|
508
|
+
}, J = 8, ne = 6, re = 120, ie = (e, t, n) => {
|
|
495
509
|
if (!e.length) return -1;
|
|
496
510
|
for (let r = 0; r < e.length; r += 1) {
|
|
497
511
|
let i = (t + r * n + e.length) % e.length;
|
|
@@ -506,11 +520,11 @@ var T = {
|
|
|
506
520
|
}
|
|
507
521
|
return Infinity;
|
|
508
522
|
}, oe = ({ options: e, value: r, onChange: i, placeholder: a = "Выберите опцию", disabled: m = !1, stringWhileDisabled: h = !1, label: g, error: _, size: v = "md", hint: y, className: b = "", required: x = !1, name: S, id: C, needMark: w = !0, maxMenuHeight: T }) => {
|
|
509
|
-
let
|
|
510
|
-
let e =
|
|
523
|
+
let E = c(), D = C ?? `ds-dropdown-${S ?? E}`, O = `${D}-listbox`, [k, A] = f(!1), [j, M] = f(null), N = d(null), P = d(null), F = d(null), I = d([]), L = u(() => e.find((e) => e.value === r), [e, r]), R = y ? `${D}-hint` : void 0, z = _ ? `${D}-error` : void 0, B = [R, z].filter(Boolean).join(" ") || void 0, V = m && h, H = o(() => {
|
|
524
|
+
let e = P.current, t = F.current;
|
|
511
525
|
if (!e || !t) return;
|
|
512
|
-
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight - n.bottom -
|
|
513
|
-
|
|
526
|
+
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight - n.bottom - J, o = n.top - J, s = a < r.height && o > a, c = Math.max(re, s ? o : a), l = ae(T), u = Math.min(c, l), d = n.left, f = i - n.width - J, p = Math.max(J, Math.min(d, f)), m = s ? Math.max(J, n.top - r.height - ne) : n.bottom + ne;
|
|
527
|
+
M({
|
|
514
528
|
top: m,
|
|
515
529
|
left: p,
|
|
516
530
|
width: n.width,
|
|
@@ -518,48 +532,48 @@ var T = {
|
|
|
518
532
|
});
|
|
519
533
|
}, [T]);
|
|
520
534
|
l(() => {
|
|
521
|
-
if (!
|
|
522
|
-
|
|
535
|
+
if (!k) {
|
|
536
|
+
M(null);
|
|
523
537
|
return;
|
|
524
538
|
}
|
|
525
539
|
return H(), window.addEventListener("resize", H), window.addEventListener("scroll", H, !0), () => {
|
|
526
540
|
window.removeEventListener("resize", H), window.removeEventListener("scroll", H, !0);
|
|
527
541
|
};
|
|
528
542
|
}, [
|
|
529
|
-
|
|
543
|
+
k,
|
|
530
544
|
H,
|
|
531
545
|
e.length
|
|
532
546
|
]), s(() => {
|
|
533
|
-
if (!
|
|
547
|
+
if (!k) return;
|
|
534
548
|
let e = (e) => {
|
|
535
|
-
let t = e.target, n =
|
|
536
|
-
!n && !r &&
|
|
549
|
+
let t = e.target, n = N.current?.contains(t), r = F.current?.contains(t);
|
|
550
|
+
!n && !r && A(!1);
|
|
537
551
|
}, t = (e) => {
|
|
538
|
-
e.key === "Escape" && (
|
|
552
|
+
e.key === "Escape" && (A(!1), P.current?.focus());
|
|
539
553
|
};
|
|
540
554
|
return document.addEventListener("pointerdown", e), document.addEventListener("keydown", t), () => {
|
|
541
555
|
document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
|
|
542
556
|
};
|
|
543
|
-
}, [
|
|
557
|
+
}, [k]);
|
|
544
558
|
let U = (t, n) => {
|
|
545
|
-
let r =
|
|
559
|
+
let r = ie(e, t, n);
|
|
546
560
|
if (r === -1) return;
|
|
547
|
-
let i =
|
|
561
|
+
let i = I.current[r];
|
|
548
562
|
i?.focus(), i?.scrollIntoView({ block: "nearest" });
|
|
549
563
|
}, W = (e) => {
|
|
550
|
-
e.disabled || (i?.(e.value, e),
|
|
551
|
-
}, te =
|
|
552
|
-
ref:
|
|
553
|
-
id:
|
|
554
|
-
className:
|
|
564
|
+
e.disabled || (i?.(e.value, e), A(!1), P.current?.focus());
|
|
565
|
+
}, te = k ? /* @__PURE__ */ t("ul", {
|
|
566
|
+
ref: F,
|
|
567
|
+
id: O,
|
|
568
|
+
className: q.menu,
|
|
555
569
|
role: "listbox",
|
|
556
570
|
"aria-label": g,
|
|
557
|
-
style:
|
|
571
|
+
style: j ? {
|
|
558
572
|
position: "fixed",
|
|
559
|
-
top:
|
|
560
|
-
left:
|
|
561
|
-
width:
|
|
562
|
-
maxHeight:
|
|
573
|
+
top: j.top,
|
|
574
|
+
left: j.left,
|
|
575
|
+
width: j.width,
|
|
576
|
+
maxHeight: j.maxHeight
|
|
563
577
|
} : {
|
|
564
578
|
position: "fixed",
|
|
565
579
|
top: 0,
|
|
@@ -573,16 +587,16 @@ var T = {
|
|
|
573
587
|
role: "presentation",
|
|
574
588
|
children: /* @__PURE__ */ n("button", {
|
|
575
589
|
ref: (e) => {
|
|
576
|
-
|
|
590
|
+
I.current[a] = e;
|
|
577
591
|
},
|
|
578
592
|
type: "button",
|
|
579
593
|
role: "option",
|
|
580
594
|
"aria-selected": o,
|
|
581
595
|
disabled: i.disabled,
|
|
582
596
|
className: [
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
o ?
|
|
597
|
+
q[v],
|
|
598
|
+
q.option,
|
|
599
|
+
o ? q.selected : ""
|
|
586
600
|
].filter(Boolean).join(" "),
|
|
587
601
|
onClick: () => W(i),
|
|
588
602
|
onKeyDown: (t) => {
|
|
@@ -591,7 +605,7 @@ var T = {
|
|
|
591
605
|
let e = t.key === "ArrowDown" ? 1 : -1;
|
|
592
606
|
U(a + e, e);
|
|
593
607
|
}
|
|
594
|
-
if (t.key === "Tab" &&
|
|
608
|
+
if (t.key === "Tab" && A(!1), t.key === "Home" || t.key === "End") {
|
|
595
609
|
t.preventDefault();
|
|
596
610
|
let n = t.key === "Home" ? 1 : -1;
|
|
597
611
|
U(t.key === "Home" ? 0 : e.length - 1, n);
|
|
@@ -607,59 +621,59 @@ var T = {
|
|
|
607
621
|
})
|
|
608
622
|
}) : null;
|
|
609
623
|
return /* @__PURE__ */ n("div", {
|
|
610
|
-
ref:
|
|
624
|
+
ref: N,
|
|
611
625
|
className: [
|
|
612
|
-
|
|
613
|
-
_ ?
|
|
626
|
+
q.wrapper,
|
|
627
|
+
_ ? q.errorState : "",
|
|
614
628
|
b
|
|
615
629
|
].filter(Boolean).join(" "),
|
|
616
630
|
children: [
|
|
617
|
-
g && /* @__PURE__ */ t(
|
|
631
|
+
g && /* @__PURE__ */ t(ee, {
|
|
618
632
|
required: x,
|
|
619
633
|
disabled: m,
|
|
620
|
-
htmlFor:
|
|
634
|
+
htmlFor: V ? void 0 : D,
|
|
621
635
|
children: g
|
|
622
636
|
}),
|
|
623
637
|
/* @__PURE__ */ t("div", {
|
|
624
|
-
className:
|
|
625
|
-
children:
|
|
626
|
-
id:
|
|
627
|
-
className:
|
|
628
|
-
"aria-describedby":
|
|
629
|
-
children:
|
|
638
|
+
className: q.container,
|
|
639
|
+
children: V ? /* @__PURE__ */ t("div", {
|
|
640
|
+
id: D,
|
|
641
|
+
className: q.disabledText,
|
|
642
|
+
"aria-describedby": B,
|
|
643
|
+
children: L?.label ?? a
|
|
630
644
|
}) : /* @__PURE__ */ n("button", {
|
|
631
|
-
ref:
|
|
632
|
-
id:
|
|
645
|
+
ref: P,
|
|
646
|
+
id: D,
|
|
633
647
|
type: "button",
|
|
634
648
|
name: S,
|
|
635
|
-
className: `${
|
|
649
|
+
className: `${q.trigger} ${q[v]}`,
|
|
636
650
|
disabled: m,
|
|
637
651
|
"aria-haspopup": "listbox",
|
|
638
|
-
"aria-expanded":
|
|
639
|
-
"aria-controls":
|
|
640
|
-
"aria-describedby":
|
|
652
|
+
"aria-expanded": k,
|
|
653
|
+
"aria-controls": O,
|
|
654
|
+
"aria-describedby": B,
|
|
641
655
|
"aria-invalid": !!_,
|
|
642
|
-
onClick: () =>
|
|
656
|
+
onClick: () => A((e) => !e),
|
|
643
657
|
onKeyDown: (t) => {
|
|
644
658
|
if (t.key === "ArrowDown" || t.key === "ArrowUp") {
|
|
645
|
-
t.preventDefault(),
|
|
659
|
+
t.preventDefault(), A(!0);
|
|
646
660
|
let n = t.key === "ArrowDown" ? 1 : -1;
|
|
647
661
|
requestAnimationFrame(() => {
|
|
648
662
|
U(t.key === "ArrowDown" ? 0 : e.length - 1, n);
|
|
649
663
|
});
|
|
650
664
|
}
|
|
651
|
-
if (t.key === "Enter" &&
|
|
665
|
+
if (t.key === "Enter" && k) {
|
|
652
666
|
t.preventDefault();
|
|
653
667
|
let n = e.findIndex((e) => e.value === r);
|
|
654
668
|
U(n >= 0 ? n : 0, 1);
|
|
655
669
|
}
|
|
656
670
|
},
|
|
657
671
|
children: [/* @__PURE__ */ t("span", {
|
|
658
|
-
className: `${
|
|
659
|
-
${
|
|
660
|
-
children:
|
|
672
|
+
className: `${L ? q.value : q.placeholder}
|
|
673
|
+
${q[v]}`,
|
|
674
|
+
children: L?.label ?? a
|
|
661
675
|
}), /* @__PURE__ */ t("span", {
|
|
662
|
-
className: [
|
|
676
|
+
className: [q.chevron, k ? q.chevronOpen : ""].filter(Boolean).join(" "),
|
|
663
677
|
"aria-hidden": "true",
|
|
664
678
|
children: /* @__PURE__ */ t("svg", {
|
|
665
679
|
viewBox: "0 0 20 20",
|
|
@@ -675,15 +689,15 @@ var T = {
|
|
|
675
689
|
})]
|
|
676
690
|
})
|
|
677
691
|
}),
|
|
678
|
-
|
|
692
|
+
k && p(te, document.body),
|
|
679
693
|
y && !_ && /* @__PURE__ */ t("span", {
|
|
680
|
-
id:
|
|
681
|
-
className:
|
|
694
|
+
id: R,
|
|
695
|
+
className: q.message,
|
|
682
696
|
children: y
|
|
683
697
|
}),
|
|
684
698
|
_ && /* @__PURE__ */ t("span", {
|
|
685
|
-
id:
|
|
686
|
-
className:
|
|
699
|
+
id: z,
|
|
700
|
+
className: q.error,
|
|
687
701
|
children: _
|
|
688
702
|
})
|
|
689
703
|
]
|
|
@@ -845,56 +859,56 @@ var T = {
|
|
|
845
859
|
sortDescFirst: e.sortDescFirst
|
|
846
860
|
};
|
|
847
861
|
return n !== void 0 && (i.sortFn = n), i;
|
|
848
|
-
}, Se = ({ columns: e, data: r, tableOnMobile: i = !1, breakpoint: a = "default", sorting: o, onSortingChange: c, renderMobileCard: l, getRowId: d, caption: p, ariaLabel: m, loading: h = !1, error: g, emptyState: v = "Нет данных", stickyHeader: y = !1, maxHeight: b, className: x = "", onRowClick: S, pagination: C = !1, pageSize: T = 30, visibleColumnIds:
|
|
849
|
-
let [
|
|
850
|
-
if (
|
|
851
|
-
let t = new Set(
|
|
862
|
+
}, Se = ({ columns: e, data: r, tableOnMobile: i = !1, breakpoint: a = "default", sorting: o, onSortingChange: c, renderMobileCard: l, getRowId: d, caption: p, ariaLabel: m, loading: h = !1, error: g, emptyState: v = "Нет данных", stickyHeader: y = !1, maxHeight: b, className: x = "", onRowClick: S, pagination: C = !1, pageSize: T = 30, visibleColumnIds: ee }) => {
|
|
863
|
+
let [E, D] = f([]), [O, k] = f(0), A = o ?? E, j = A.map((e) => `${e.id}:${e.desc ? "desc" : "asc"}`).join("|"), M = Number.isFinite(T) && T > 0 ? Math.floor(T) : 30, N = u(() => {
|
|
864
|
+
if (ee === void 0) return e;
|
|
865
|
+
let t = new Set(ee);
|
|
852
866
|
return e.filter((e) => t.has(e.id));
|
|
853
|
-
}, [e,
|
|
867
|
+
}, [e, ee]), P = u(() => N.length === 0 ? "Должна быть видима хотя бы одна колонка" : pe(N, r), [r, N]), F = u(() => N.map(xe), [N]), I = _({
|
|
854
868
|
features: de,
|
|
855
|
-
columns:
|
|
869
|
+
columns: F,
|
|
856
870
|
data: r,
|
|
857
|
-
state: { sorting:
|
|
871
|
+
state: { sorting: A },
|
|
858
872
|
onSortingChange: (e) => {
|
|
859
|
-
let t = typeof e == "function" ? e(
|
|
860
|
-
o === void 0 &&
|
|
873
|
+
let t = typeof e == "function" ? e(A) : e;
|
|
874
|
+
o === void 0 && D(t), k(0), c?.(t);
|
|
861
875
|
},
|
|
862
876
|
getRowId: d
|
|
863
|
-
}),
|
|
864
|
-
|
|
877
|
+
}), L = I.getRowModel().rows, R = C ? Math.max(1, Math.ceil(L.length / M)) : 1, z = Math.min(O, R - 1), B = u(() => C ? L.slice(z * M, (z + 1) * M) : L, [
|
|
878
|
+
M,
|
|
865
879
|
C,
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
]),
|
|
880
|
+
z,
|
|
881
|
+
L
|
|
882
|
+
]), V = u(() => N.filter((e) => e.enableSorting ?? e.dataType !== "custom").map((e) => ({
|
|
869
883
|
id: e.id,
|
|
870
884
|
label: typeof e.header == "string" ? e.header : e.id
|
|
871
|
-
})), [
|
|
885
|
+
})), [N]), H = u(() => fe(z, R), [R, z]), U = [
|
|
872
886
|
Y.root,
|
|
873
887
|
a === "wide" ? Y.wide : Y.default,
|
|
874
888
|
i ? Y.tableOnMobile : "",
|
|
875
889
|
x
|
|
876
|
-
].filter(Boolean).join(" "), W =
|
|
890
|
+
].filter(Boolean).join(" "), W = P ?? g, te = C && !h && !W && L.length > M, G = z * M + 1, q = Math.min((z + 1) * M, L.length);
|
|
877
891
|
return s(() => {
|
|
878
|
-
|
|
892
|
+
k(0);
|
|
879
893
|
}, [
|
|
880
894
|
r,
|
|
881
|
-
|
|
895
|
+
M,
|
|
882
896
|
C,
|
|
883
|
-
|
|
897
|
+
j
|
|
884
898
|
]), s(() => {
|
|
885
|
-
|
|
886
|
-
}, [
|
|
899
|
+
O >= R && k(R - 1);
|
|
900
|
+
}, [R, O]), /* @__PURE__ */ n("section", {
|
|
887
901
|
className: U,
|
|
888
902
|
"aria-busy": h,
|
|
889
903
|
children: [
|
|
890
|
-
!i && !h && !W &&
|
|
904
|
+
!i && !h && !W && B.length > 0 && V.length > 0 && /* @__PURE__ */ t(ce, {
|
|
891
905
|
className: Y.mobileSort,
|
|
892
|
-
options:
|
|
893
|
-
value:
|
|
894
|
-
id:
|
|
895
|
-
direction:
|
|
906
|
+
options: V,
|
|
907
|
+
value: A[0] ? {
|
|
908
|
+
id: A[0].id,
|
|
909
|
+
direction: A[0].desc ? "desc" : "asc"
|
|
896
910
|
} : null,
|
|
897
|
-
onChange: (e) =>
|
|
911
|
+
onChange: (e) => I.setSorting([{
|
|
898
912
|
id: e.id,
|
|
899
913
|
desc: e.direction === "desc"
|
|
900
914
|
}])
|
|
@@ -909,7 +923,7 @@ var T = {
|
|
|
909
923
|
p && /* @__PURE__ */ t("caption", { children: p }),
|
|
910
924
|
/* @__PURE__ */ t("thead", {
|
|
911
925
|
className: y ? Y.sticky : "",
|
|
912
|
-
children:
|
|
926
|
+
children: I.getHeaderGroups().map((e) => /* @__PURE__ */ t("tr", { children: e.headers.map((e) => {
|
|
913
927
|
let r = e.column.getIsSorted(), i = e.column.getCanSort(), a = e.column.getToggleSortingHandler();
|
|
914
928
|
return /* @__PURE__ */ t("th", {
|
|
915
929
|
scope: "col",
|
|
@@ -919,7 +933,7 @@ var T = {
|
|
|
919
933
|
className: Y.sortButton,
|
|
920
934
|
disabled: !i,
|
|
921
935
|
onClick: a,
|
|
922
|
-
children: [/* @__PURE__ */ t(
|
|
936
|
+
children: [/* @__PURE__ */ t(I.FlexRender, { header: e }), /* @__PURE__ */ t("span", {
|
|
923
937
|
"aria-hidden": "true",
|
|
924
938
|
children: r === "asc" ? "↑" : r === "desc" ? "↓" : "↕"
|
|
925
939
|
})]
|
|
@@ -928,17 +942,17 @@ var T = {
|
|
|
928
942
|
}) }, e.id))
|
|
929
943
|
}),
|
|
930
944
|
/* @__PURE__ */ t("tbody", { children: h ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
931
|
-
colSpan:
|
|
932
|
-
children: /* @__PURE__ */ t(
|
|
945
|
+
colSpan: N.length,
|
|
946
|
+
children: /* @__PURE__ */ t(K, { lines: 3 })
|
|
933
947
|
}) }) : W ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
934
948
|
className: Y.state,
|
|
935
|
-
colSpan:
|
|
949
|
+
colSpan: N.length,
|
|
936
950
|
children: W
|
|
937
|
-
}) }) :
|
|
951
|
+
}) }) : B.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
938
952
|
className: Y.state,
|
|
939
|
-
colSpan:
|
|
953
|
+
colSpan: N.length,
|
|
940
954
|
children: v
|
|
941
|
-
}) }) :
|
|
955
|
+
}) }) : B.map((e) => /* @__PURE__ */ t("tr", {
|
|
942
956
|
className: S ? Y.clickableRow : void 0,
|
|
943
957
|
onClick: () => S?.(e.original),
|
|
944
958
|
onKeyDown: (t) => {
|
|
@@ -946,7 +960,7 @@ var T = {
|
|
|
946
960
|
},
|
|
947
961
|
tabIndex: S ? 0 : void 0,
|
|
948
962
|
role: S ? "button" : void 0,
|
|
949
|
-
children: e.getAllCells().map((e) => /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t(
|
|
963
|
+
children: e.getAllCells().map((e) => /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t(I.FlexRender, { cell: e }) }, e.id))
|
|
950
964
|
}, e.id)) })
|
|
951
965
|
]
|
|
952
966
|
})
|
|
@@ -955,21 +969,21 @@ var T = {
|
|
|
955
969
|
className: Y.cards,
|
|
956
970
|
role: "list",
|
|
957
971
|
"aria-label": m ?? p,
|
|
958
|
-
children: h ? /* @__PURE__ */ t(
|
|
972
|
+
children: h ? /* @__PURE__ */ t(K, { lines: 4 }) : W ? /* @__PURE__ */ t("div", {
|
|
959
973
|
className: Y.state,
|
|
960
974
|
children: W
|
|
961
|
-
}) :
|
|
975
|
+
}) : B.length === 0 ? /* @__PURE__ */ t("div", {
|
|
962
976
|
className: Y.state,
|
|
963
977
|
children: v
|
|
964
|
-
}) :
|
|
978
|
+
}) : B.map((e) => {
|
|
965
979
|
if (l) return /* @__PURE__ */ t("div", {
|
|
966
980
|
role: "listitem",
|
|
967
981
|
children: l({
|
|
968
982
|
row: e.original,
|
|
969
|
-
columns:
|
|
983
|
+
columns: N
|
|
970
984
|
})
|
|
971
985
|
}, e.id);
|
|
972
|
-
let r =
|
|
986
|
+
let r = N.filter((e) => !e.mobile?.hideOnMobile).sort((e, t) => (e.mobile?.mobileOrder ?? 0) - (t.mobile?.mobileOrder ?? 0)), i = r.find((e) => e.mobile?.primary) ?? r.find((e) => e.mobile?.mobileVariant !== "actions"), a = (t) => me(t.accessor, e.original), o = (t) => t.mobile?.renderMobile?.(e.original, a(t)) ?? t.cell?.(e.original, a(t)) ?? String(a(t) ?? "");
|
|
973
987
|
return /* @__PURE__ */ n("article", {
|
|
974
988
|
role: "listitem",
|
|
975
989
|
className: Y.card,
|
|
@@ -993,9 +1007,9 @@ var T = {
|
|
|
993
1007
|
children: [
|
|
994
1008
|
G,
|
|
995
1009
|
"–",
|
|
996
|
-
|
|
1010
|
+
q,
|
|
997
1011
|
" из ",
|
|
998
|
-
|
|
1012
|
+
L.length
|
|
999
1013
|
]
|
|
1000
1014
|
}), /* @__PURE__ */ n("div", {
|
|
1001
1015
|
className: Y.paginationControls,
|
|
@@ -1003,10 +1017,10 @@ var T = {
|
|
|
1003
1017
|
/* @__PURE__ */ n(w, {
|
|
1004
1018
|
variant: "empty",
|
|
1005
1019
|
size: "md",
|
|
1006
|
-
disabled:
|
|
1020
|
+
disabled: z === 0,
|
|
1007
1021
|
"aria-label": "Предыдущая страница",
|
|
1008
1022
|
onClick: () => {
|
|
1009
|
-
|
|
1023
|
+
k((e) => Math.max(0, e - 1));
|
|
1010
1024
|
},
|
|
1011
1025
|
children: [/* @__PURE__ */ t(ue, {
|
|
1012
1026
|
name: "chevron",
|
|
@@ -1021,13 +1035,13 @@ var T = {
|
|
|
1021
1035
|
/* @__PURE__ */ t("div", {
|
|
1022
1036
|
className: Y.pageNumbers,
|
|
1023
1037
|
children: H.map((e) => typeof e == "number" ? /* @__PURE__ */ t(w, {
|
|
1024
|
-
variant: e ===
|
|
1038
|
+
variant: e === z ? "secondary" : "empty",
|
|
1025
1039
|
size: "md",
|
|
1026
1040
|
className: Y.pageButton,
|
|
1027
1041
|
"aria-label": `Перейти на страницу ${e + 1}`,
|
|
1028
|
-
"aria-current": e ===
|
|
1042
|
+
"aria-current": e === z ? "page" : void 0,
|
|
1029
1043
|
onClick: () => {
|
|
1030
|
-
|
|
1044
|
+
k(e);
|
|
1031
1045
|
},
|
|
1032
1046
|
children: e + 1
|
|
1033
1047
|
}, e) : /* @__PURE__ */ t("span", {
|
|
@@ -1039,10 +1053,10 @@ var T = {
|
|
|
1039
1053
|
/* @__PURE__ */ n(w, {
|
|
1040
1054
|
variant: "empty",
|
|
1041
1055
|
size: "md",
|
|
1042
|
-
disabled:
|
|
1056
|
+
disabled: z === R - 1,
|
|
1043
1057
|
"aria-label": "Следующая страница",
|
|
1044
1058
|
onClick: () => {
|
|
1045
|
-
|
|
1059
|
+
k((e) => Math.min(R - 1, e + 1));
|
|
1046
1060
|
},
|
|
1047
1061
|
children: [/* @__PURE__ */ t("span", {
|
|
1048
1062
|
className: Y.paginationButtonLabel,
|
|
@@ -1059,164 +1073,190 @@ var T = {
|
|
|
1059
1073
|
})
|
|
1060
1074
|
]
|
|
1061
1075
|
});
|
|
1062
|
-
}, Ce =
|
|
1063
|
-
|
|
1064
|
-
|
|
1076
|
+
}, Ce = 8, we = 6, Te = 120, Ee = (e) => {
|
|
1077
|
+
if (typeof e == "number") return e;
|
|
1078
|
+
if (typeof e == "string") {
|
|
1079
|
+
let t = Number.parseFloat(e);
|
|
1080
|
+
if (Number.isFinite(t)) return t;
|
|
1081
|
+
}
|
|
1082
|
+
return Infinity;
|
|
1083
|
+
}, De = ({ options: e, value: r, onChange: i, placeholder: a = "Выберите опции", disabled: m = !1, stringWhileDisabled: h = !1, label: g, error: _, size: v = "md", required: y = !1, hint: b, className: x = "", name: S, id: C, closeOnSelect: w = !1, needMark: T = !0, maxMenuHeight: E }) => {
|
|
1084
|
+
let D = c(), O = C ?? `ds-dropdown-multiple-${S ?? D}`, k = `${O}-listbox`, [A, j] = f(!1), [M, N] = f(null), P = d(null), F = d(null), I = d(null), L = d([]), R = u(() => e.filter((e) => r.includes(e.value)), [e, r]).map((e) => e.label).join(", "), z = b ? `${O}-hint` : void 0, B = _ ? `${O}-error` : void 0, V = [z, B].filter(Boolean).join(" ") || void 0, H = m && h, U = o(() => {
|
|
1085
|
+
let e = F.current, t = I.current;
|
|
1086
|
+
if (!e || !t) return;
|
|
1087
|
+
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerHeight - n.bottom - Ce, a = n.top - Ce, o = i < r.height && a > i, s = Math.max(Te, o ? a : i), c = window.innerWidth - n.width - Ce;
|
|
1088
|
+
N({
|
|
1089
|
+
top: o ? Math.max(Ce, n.top - r.height - we) : n.bottom + we,
|
|
1090
|
+
left: Math.max(Ce, Math.min(n.left, c)),
|
|
1091
|
+
width: n.width,
|
|
1092
|
+
maxHeight: Math.min(s, Ee(E))
|
|
1093
|
+
});
|
|
1094
|
+
}, [E]);
|
|
1095
|
+
l(() => {
|
|
1096
|
+
if (!A) {
|
|
1097
|
+
N(null);
|
|
1098
|
+
return;
|
|
1099
|
+
}
|
|
1100
|
+
return U(), window.addEventListener("resize", U), window.addEventListener("scroll", U, !0), () => {
|
|
1101
|
+
window.removeEventListener("resize", U), window.removeEventListener("scroll", U, !0);
|
|
1102
|
+
};
|
|
1103
|
+
}, [
|
|
1104
|
+
A,
|
|
1105
|
+
e.length,
|
|
1106
|
+
U
|
|
1107
|
+
]), s(() => {
|
|
1108
|
+
if (!A) return;
|
|
1065
1109
|
let e = (e) => {
|
|
1066
|
-
|
|
1110
|
+
let t = e.target;
|
|
1111
|
+
!P.current?.contains(t) && !I.current?.contains(t) && j(!1);
|
|
1067
1112
|
}, t = (e) => {
|
|
1068
|
-
e.key === "Escape" &&
|
|
1113
|
+
e.key === "Escape" && (j(!1), F.current?.focus());
|
|
1069
1114
|
};
|
|
1070
|
-
return document.addEventListener("
|
|
1071
|
-
document.removeEventListener("
|
|
1115
|
+
return document.addEventListener("pointerdown", e), document.addEventListener("keydown", t), () => {
|
|
1116
|
+
document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
|
|
1072
1117
|
};
|
|
1073
|
-
}, [
|
|
1074
|
-
let
|
|
1118
|
+
}, [A]);
|
|
1119
|
+
let W = (t, n) => {
|
|
1120
|
+
let r = ie(e, t, n);
|
|
1121
|
+
r !== -1 && (L.current[r]?.focus(), L.current[r]?.scrollIntoView({ block: "nearest" }));
|
|
1122
|
+
}, te = (t) => {
|
|
1075
1123
|
if (t.disabled) return;
|
|
1076
1124
|
let n = r.includes(t.value) ? r.filter((e) => e !== t.value) : [...r, t.value];
|
|
1077
|
-
i?.(n, e.filter((e) => n.includes(e.value))),
|
|
1078
|
-
},
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1125
|
+
i?.(n, e.filter((e) => n.includes(e.value))), w && (j(!1), F.current?.focus());
|
|
1126
|
+
}, G = A ? /* @__PURE__ */ t("ul", {
|
|
1127
|
+
ref: I,
|
|
1128
|
+
id: k,
|
|
1129
|
+
className: q.menu,
|
|
1130
|
+
role: "listbox",
|
|
1131
|
+
"aria-label": g,
|
|
1132
|
+
"aria-multiselectable": "true",
|
|
1133
|
+
style: M ? {
|
|
1134
|
+
position: "fixed",
|
|
1135
|
+
top: M.top,
|
|
1136
|
+
left: M.left,
|
|
1137
|
+
width: M.width,
|
|
1138
|
+
maxHeight: M.maxHeight
|
|
1139
|
+
} : {
|
|
1140
|
+
position: "fixed",
|
|
1141
|
+
top: 0,
|
|
1142
|
+
left: 0,
|
|
1143
|
+
visibility: "hidden",
|
|
1144
|
+
maxHeight: 0
|
|
1145
|
+
},
|
|
1146
|
+
children: e.map((i, a) => {
|
|
1147
|
+
let o = r.includes(i.value);
|
|
1148
|
+
return /* @__PURE__ */ t("li", {
|
|
1149
|
+
role: "presentation",
|
|
1150
|
+
children: /* @__PURE__ */ n("button", {
|
|
1151
|
+
ref: (e) => {
|
|
1152
|
+
L.current[a] = e;
|
|
1153
|
+
},
|
|
1154
|
+
type: "button",
|
|
1155
|
+
role: "option",
|
|
1156
|
+
"aria-selected": o,
|
|
1157
|
+
disabled: i.disabled,
|
|
1158
|
+
className: [
|
|
1159
|
+
q[v],
|
|
1160
|
+
q.option,
|
|
1161
|
+
o ? q.selected : ""
|
|
1162
|
+
].filter(Boolean).join(" "),
|
|
1163
|
+
onClick: () => te(i),
|
|
1164
|
+
onKeyDown: (t) => {
|
|
1165
|
+
if (t.key === "ArrowDown" || t.key === "ArrowUp") {
|
|
1166
|
+
t.preventDefault();
|
|
1167
|
+
let e = t.key === "ArrowDown" ? 1 : -1;
|
|
1168
|
+
W(a + e, e);
|
|
1169
|
+
}
|
|
1170
|
+
if (t.key === "Home" || t.key === "End") {
|
|
1171
|
+
t.preventDefault();
|
|
1172
|
+
let n = t.key === "Home" ? 1 : -1;
|
|
1173
|
+
W(t.key === "Home" ? 0 : e.length - 1, n);
|
|
1174
|
+
}
|
|
1175
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), te(i)), t.key === "Tab" && j(!1);
|
|
1176
|
+
},
|
|
1177
|
+
children: [/* @__PURE__ */ t("span", { children: i.label }), o && T && /* @__PURE__ */ t("span", {
|
|
1178
|
+
"aria-hidden": "true",
|
|
1179
|
+
children: "✓"
|
|
1180
|
+
})]
|
|
1181
|
+
})
|
|
1182
|
+
}, i.value);
|
|
1183
|
+
})
|
|
1184
|
+
}) : null;
|
|
1082
1185
|
return /* @__PURE__ */ n("div", {
|
|
1083
|
-
ref:
|
|
1186
|
+
ref: P,
|
|
1084
1187
|
className: [
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1188
|
+
q.wrapper,
|
|
1189
|
+
_ ? q.errorState : "",
|
|
1190
|
+
x
|
|
1088
1191
|
].filter(Boolean).join(" "),
|
|
1089
1192
|
children: [
|
|
1090
|
-
|
|
1091
|
-
htmlFor:
|
|
1092
|
-
|
|
1093
|
-
|
|
1193
|
+
g && /* @__PURE__ */ t(ee, {
|
|
1194
|
+
htmlFor: H ? void 0 : O,
|
|
1195
|
+
required: y,
|
|
1196
|
+
disabled: m,
|
|
1197
|
+
children: g
|
|
1094
1198
|
}),
|
|
1095
|
-
/* @__PURE__ */
|
|
1096
|
-
className:
|
|
1097
|
-
children:
|
|
1098
|
-
|
|
1099
|
-
|
|
1199
|
+
/* @__PURE__ */ t("div", {
|
|
1200
|
+
className: q.container,
|
|
1201
|
+
children: H ? /* @__PURE__ */ t("div", {
|
|
1202
|
+
id: O,
|
|
1203
|
+
className: `${q.disabledText} ${q[v]}`,
|
|
1204
|
+
"aria-describedby": V,
|
|
1205
|
+
children: R || a
|
|
1206
|
+
}) : /* @__PURE__ */ n("button", {
|
|
1207
|
+
ref: F,
|
|
1208
|
+
id: O,
|
|
1100
1209
|
type: "button",
|
|
1101
|
-
name:
|
|
1102
|
-
className:
|
|
1103
|
-
disabled:
|
|
1210
|
+
name: S,
|
|
1211
|
+
className: `${q.trigger} ${q[v]}`,
|
|
1212
|
+
disabled: m,
|
|
1104
1213
|
"aria-haspopup": "listbox",
|
|
1105
|
-
"aria-expanded":
|
|
1106
|
-
"aria-controls":
|
|
1107
|
-
"aria-describedby":
|
|
1108
|
-
"aria-invalid": !!
|
|
1109
|
-
onClick: () =>
|
|
1214
|
+
"aria-expanded": A,
|
|
1215
|
+
"aria-controls": k,
|
|
1216
|
+
"aria-describedby": V,
|
|
1217
|
+
"aria-invalid": !!_,
|
|
1218
|
+
onClick: () => j((e) => !e),
|
|
1110
1219
|
onKeyDown: (t) => {
|
|
1111
1220
|
if (t.key === "ArrowDown" || t.key === "ArrowUp") {
|
|
1112
|
-
t.preventDefault(),
|
|
1221
|
+
t.preventDefault(), j(!0);
|
|
1113
1222
|
let n = t.key === "ArrowDown" ? 1 : -1;
|
|
1114
|
-
requestAnimationFrame(() =>
|
|
1223
|
+
requestAnimationFrame(() => W(t.key === "ArrowDown" ? 0 : e.length - 1, n));
|
|
1115
1224
|
}
|
|
1116
1225
|
},
|
|
1117
1226
|
children: [/* @__PURE__ */ t("span", {
|
|
1118
|
-
className:
|
|
1119
|
-
children:
|
|
1227
|
+
className: `${R ? q.value : q.placeholder} ${q[v]}`,
|
|
1228
|
+
children: R || a
|
|
1120
1229
|
}), /* @__PURE__ */ t("span", {
|
|
1121
|
-
className:
|
|
1230
|
+
className: [q.chevron, A ? q.chevronOpen : ""].filter(Boolean).join(" "),
|
|
1122
1231
|
"aria-hidden": "true",
|
|
1123
|
-
children: "
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
children: e.map((i, a) => {
|
|
1133
|
-
let o = r.includes(i.value);
|
|
1134
|
-
return /* @__PURE__ */ t("li", {
|
|
1135
|
-
role: "presentation",
|
|
1136
|
-
children: /* @__PURE__ */ n("button", {
|
|
1137
|
-
ref: (e) => {
|
|
1138
|
-
E.current[a] = e;
|
|
1139
|
-
},
|
|
1140
|
-
type: "button",
|
|
1141
|
-
role: "option",
|
|
1142
|
-
"aria-selected": o,
|
|
1143
|
-
disabled: i.disabled,
|
|
1144
|
-
className: `${K.option} ${o ? K.selected : ""}`,
|
|
1145
|
-
onClick: () => j(i),
|
|
1146
|
-
onKeyDown: (t) => {
|
|
1147
|
-
if (t.key === "ArrowDown" || t.key === "ArrowUp") {
|
|
1148
|
-
t.preventDefault();
|
|
1149
|
-
let e = t.key === "ArrowDown" ? 1 : -1;
|
|
1150
|
-
M(a + e, e);
|
|
1151
|
-
}
|
|
1152
|
-
if (t.key === "Home" || t.key === "End") {
|
|
1153
|
-
t.preventDefault();
|
|
1154
|
-
let n = t.key === "Home" ? 1 : -1;
|
|
1155
|
-
M(t.key === "Home" ? 0 : e.length - 1, n);
|
|
1156
|
-
}
|
|
1157
|
-
t.key === "Tab" && C(!1);
|
|
1158
|
-
},
|
|
1159
|
-
children: [/* @__PURE__ */ t("span", { children: i.label }), /* @__PURE__ */ t("span", {
|
|
1160
|
-
"aria-hidden": "true",
|
|
1161
|
-
children: o ? "✓" : ""
|
|
1162
|
-
})]
|
|
1232
|
+
children: /* @__PURE__ */ t("svg", {
|
|
1233
|
+
viewBox: "0 0 20 20",
|
|
1234
|
+
fill: "none",
|
|
1235
|
+
children: /* @__PURE__ */ t("path", {
|
|
1236
|
+
d: "M5 7.5L10 12.5L15 7.5",
|
|
1237
|
+
stroke: "currentColor",
|
|
1238
|
+
strokeWidth: "1.8",
|
|
1239
|
+
strokeLinecap: "round",
|
|
1240
|
+
strokeLinejoin: "round"
|
|
1163
1241
|
})
|
|
1164
|
-
}
|
|
1165
|
-
})
|
|
1166
|
-
})
|
|
1242
|
+
})
|
|
1243
|
+
})]
|
|
1244
|
+
})
|
|
1167
1245
|
}),
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1246
|
+
A && p(G, document.body),
|
|
1247
|
+
b && !_ && /* @__PURE__ */ t("span", {
|
|
1248
|
+
id: z,
|
|
1249
|
+
className: q.message,
|
|
1250
|
+
children: b
|
|
1172
1251
|
}),
|
|
1173
|
-
|
|
1174
|
-
id:
|
|
1175
|
-
className:
|
|
1176
|
-
children:
|
|
1252
|
+
_ && /* @__PURE__ */ t("span", {
|
|
1253
|
+
id: B,
|
|
1254
|
+
className: q.error,
|
|
1255
|
+
children: _
|
|
1177
1256
|
})
|
|
1178
1257
|
]
|
|
1179
1258
|
});
|
|
1180
|
-
},
|
|
1181
|
-
root: "_root_1y2s8_1",
|
|
1182
|
-
header: "_header_1y2s8_21",
|
|
1183
|
-
title: "_title_1y2s8_41",
|
|
1184
|
-
dismiss: "_dismiss_1y2s8_55",
|
|
1185
|
-
content: "_content_1y2s8_113"
|
|
1186
|
-
}, Te = ({ title: e, children: r, dismissible: i = !1, onDismiss: a, dismissLabel: o = "Закрыть информационный блок", headingAs: s = "h3", className: l = "" }) => {
|
|
1187
|
-
let u = `ds-info-block-${c()}`;
|
|
1188
|
-
return /* @__PURE__ */ n("section", {
|
|
1189
|
-
className: `${we.root} ${l}`,
|
|
1190
|
-
"aria-labelledby": u,
|
|
1191
|
-
children: [/* @__PURE__ */ n("header", {
|
|
1192
|
-
className: we.header,
|
|
1193
|
-
children: [/* @__PURE__ */ t(s, {
|
|
1194
|
-
id: u,
|
|
1195
|
-
className: we.title,
|
|
1196
|
-
children: e
|
|
1197
|
-
}), i && /* @__PURE__ */ t("button", {
|
|
1198
|
-
type: "button",
|
|
1199
|
-
className: we.dismiss,
|
|
1200
|
-
onClick: a,
|
|
1201
|
-
"aria-label": o,
|
|
1202
|
-
children: /* @__PURE__ */ t("svg", {
|
|
1203
|
-
viewBox: "0 0 20 20",
|
|
1204
|
-
"aria-hidden": "true",
|
|
1205
|
-
children: /* @__PURE__ */ t("path", {
|
|
1206
|
-
d: "M5 5L15 15M15 5L5 15",
|
|
1207
|
-
fill: "none",
|
|
1208
|
-
stroke: "currentColor",
|
|
1209
|
-
strokeWidth: "1.8",
|
|
1210
|
-
strokeLinecap: "round"
|
|
1211
|
-
})
|
|
1212
|
-
})
|
|
1213
|
-
})]
|
|
1214
|
-
}), /* @__PURE__ */ t("div", {
|
|
1215
|
-
className: we.content,
|
|
1216
|
-
children: r
|
|
1217
|
-
})]
|
|
1218
|
-
});
|
|
1219
|
-
}, X = {
|
|
1259
|
+
}, Oe = {
|
|
1220
1260
|
wrapper: "_wrapper_kz2dd_1",
|
|
1221
1261
|
control: "_control_kz2dd_3",
|
|
1222
1262
|
input: "_input_kz2dd_5",
|
|
@@ -1226,40 +1266,40 @@ var T = {
|
|
|
1226
1266
|
lg: "_lg_kz2dd_65",
|
|
1227
1267
|
inputError: "_inputError_kz2dd_77",
|
|
1228
1268
|
trailingAction: "_trailingAction_kz2dd_79"
|
|
1229
|
-
},
|
|
1230
|
-
let
|
|
1269
|
+
}, ke = ({ value: e, onChange: r, type: i = "text", placeholder: a = "", disabled: o = !1, readOnly: l = !1, stringWhileDisabled: u = !1, label: p, error: m, hint: h, className: g = "", name: _, id: v, size: y = "md", clearable: b = !0, required: x = !1, selectTextOnFocus: S = !1, isPassword: C = !1, passwordVisibleLabel: w = "Скрыть пароль", passwordHiddenLabel: T = "Показать пароль", onFocus: D, ...O }) => {
|
|
1270
|
+
let k = c(), A = v ?? `ds-input-${_ ?? k}`, j = d(null), [M, N] = f(!1), P = h ? `${A}-hint` : void 0, F = m ? `${A}-error` : void 0, I = String(e ?? ""), L = [P, F].filter(Boolean).join(" ") || void 0, R = C ? M ? "text" : "password" : i;
|
|
1231
1271
|
return s(() => {
|
|
1232
|
-
C ||
|
|
1272
|
+
C || N(!1);
|
|
1233
1273
|
}, [C]), /* @__PURE__ */ n("div", {
|
|
1234
|
-
className: `${
|
|
1274
|
+
className: `${Oe.wrapper} ${g}`,
|
|
1235
1275
|
children: [
|
|
1236
|
-
p && /* @__PURE__ */ t(
|
|
1237
|
-
htmlFor:
|
|
1276
|
+
p && /* @__PURE__ */ t(ee, {
|
|
1277
|
+
htmlFor: A,
|
|
1238
1278
|
required: x,
|
|
1239
1279
|
disabled: o,
|
|
1240
1280
|
children: p
|
|
1241
1281
|
}),
|
|
1242
1282
|
o && u ? /* @__PURE__ */ t("div", {
|
|
1243
|
-
id:
|
|
1244
|
-
className:
|
|
1245
|
-
"aria-describedby":
|
|
1246
|
-
children:
|
|
1283
|
+
id: A,
|
|
1284
|
+
className: Oe.disabledText,
|
|
1285
|
+
"aria-describedby": L,
|
|
1286
|
+
children: I || a
|
|
1247
1287
|
}) : /* @__PURE__ */ n("div", {
|
|
1248
|
-
className:
|
|
1288
|
+
className: Oe.control,
|
|
1249
1289
|
children: [
|
|
1250
1290
|
/* @__PURE__ */ t("input", {
|
|
1251
|
-
ref:
|
|
1252
|
-
id:
|
|
1291
|
+
ref: j,
|
|
1292
|
+
id: A,
|
|
1253
1293
|
name: _,
|
|
1254
|
-
type:
|
|
1255
|
-
value:
|
|
1294
|
+
type: R,
|
|
1295
|
+
value: I,
|
|
1256
1296
|
placeholder: a,
|
|
1257
1297
|
disabled: o,
|
|
1258
1298
|
readOnly: l,
|
|
1259
1299
|
required: x,
|
|
1260
1300
|
"aria-invalid": !!m,
|
|
1261
|
-
"aria-describedby":
|
|
1262
|
-
className: `${
|
|
1301
|
+
"aria-describedby": L,
|
|
1302
|
+
className: `${Oe.input} ${Oe[y]} ${m ? Oe.inputError : ""}`,
|
|
1263
1303
|
onChange: (e) => {
|
|
1264
1304
|
if (i === "number" && !C) {
|
|
1265
1305
|
let t = e.target.value === "" ? "" : Number(e.target.value);
|
|
@@ -1269,18 +1309,18 @@ var T = {
|
|
|
1269
1309
|
r?.(e.target.value, e);
|
|
1270
1310
|
},
|
|
1271
1311
|
onFocus: (e) => {
|
|
1272
|
-
S && e.currentTarget.value && e.currentTarget.select(),
|
|
1312
|
+
S && e.currentTarget.value && e.currentTarget.select(), D?.(e);
|
|
1273
1313
|
},
|
|
1274
|
-
...
|
|
1314
|
+
...O
|
|
1275
1315
|
}),
|
|
1276
1316
|
C && /* @__PURE__ */ t("button", {
|
|
1277
1317
|
type: "button",
|
|
1278
|
-
className:
|
|
1318
|
+
className: Oe.trailingAction,
|
|
1279
1319
|
disabled: o,
|
|
1280
|
-
"aria-label":
|
|
1281
|
-
"aria-pressed":
|
|
1282
|
-
onClick: () =>
|
|
1283
|
-
children:
|
|
1320
|
+
"aria-label": M ? w : T,
|
|
1321
|
+
"aria-pressed": M,
|
|
1322
|
+
onClick: () => N((e) => !e),
|
|
1323
|
+
children: M ? /* @__PURE__ */ t("svg", {
|
|
1284
1324
|
viewBox: "0 0 24 24",
|
|
1285
1325
|
"aria-hidden": "true",
|
|
1286
1326
|
children: /* @__PURE__ */ t("path", { d: "M3 3l18 18M10.6 10.7a2 2 0 0 0 2.7 2.7M9.9 4.2A10.7 10.7 0 0 1 12 4c5.5 0 9 5.3 9 5.3a14 14 0 0 1-2.3 2.8M6.6 6.6C4.3 8.1 3 10 3 10s3.5 5 9 5c1 0 2-.2 2.8-.5" })
|
|
@@ -1294,45 +1334,304 @@ var T = {
|
|
|
1294
1334
|
})]
|
|
1295
1335
|
})
|
|
1296
1336
|
}),
|
|
1297
|
-
!C && b &&
|
|
1337
|
+
!C && b && I && !o && !l && /* @__PURE__ */ t("button", {
|
|
1298
1338
|
type: "button",
|
|
1299
|
-
className:
|
|
1339
|
+
className: Oe.trailingAction,
|
|
1300
1340
|
"aria-label": "Очистить поле",
|
|
1301
1341
|
onClick: () => {
|
|
1302
|
-
let e =
|
|
1342
|
+
let e = j.current;
|
|
1303
1343
|
e && ((Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set)?.call(e, ""), e.dispatchEvent(new Event("input", { bubbles: !0 })), e.focus());
|
|
1304
1344
|
},
|
|
1305
1345
|
children: "×"
|
|
1306
1346
|
})
|
|
1307
1347
|
]
|
|
1308
1348
|
}),
|
|
1309
|
-
h && !m && /* @__PURE__ */ t(
|
|
1310
|
-
id:
|
|
1349
|
+
h && !m && /* @__PURE__ */ t(E, {
|
|
1350
|
+
id: P,
|
|
1311
1351
|
children: h
|
|
1312
1352
|
}),
|
|
1313
|
-
m && /* @__PURE__ */ t(
|
|
1314
|
-
id:
|
|
1353
|
+
m && /* @__PURE__ */ t(E, {
|
|
1354
|
+
id: F,
|
|
1315
1355
|
variant: "error",
|
|
1316
1356
|
children: m
|
|
1317
1357
|
})
|
|
1318
1358
|
]
|
|
1319
1359
|
});
|
|
1320
|
-
},
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1360
|
+
}, Ae = (e, t) => {
|
|
1361
|
+
let n = t.trim().toLocaleLowerCase();
|
|
1362
|
+
return n ? e.filter((e) => e.label.toLocaleLowerCase().includes(n) || e.value.toLocaleLowerCase().includes(n)) : e;
|
|
1363
|
+
}, je = (e, t, n) => {
|
|
1364
|
+
if (!e.length) return -1;
|
|
1365
|
+
for (let r = 0; r < e.length; r += 1) {
|
|
1366
|
+
let i = (t + r * n + e.length) % e.length;
|
|
1367
|
+
if (!e[i]?.disabled) return i;
|
|
1368
|
+
}
|
|
1369
|
+
return -1;
|
|
1370
|
+
}, X = {
|
|
1371
|
+
wrapper: "_wrapper_1uxs8_1",
|
|
1372
|
+
control: "_control_1uxs8_5",
|
|
1373
|
+
inputHost: "_inputHost_1uxs8_9",
|
|
1374
|
+
sm: "_sm_1uxs8_25",
|
|
1375
|
+
md: "_md_1uxs8_35",
|
|
1376
|
+
lg: "_lg_1uxs8_43",
|
|
1377
|
+
errorState: "_errorState_1uxs8_57",
|
|
1378
|
+
disabledText: "_disabledText_1uxs8_65",
|
|
1379
|
+
chevron: "_chevron_1uxs8_105",
|
|
1380
|
+
chevronOpen: "_chevronOpen_1uxs8_129",
|
|
1381
|
+
menu: "_menu_1uxs8_133",
|
|
1382
|
+
option: "_option_1uxs8_161",
|
|
1383
|
+
empty: "_empty_1uxs8_161",
|
|
1384
|
+
selected: "_selected_1uxs8_205",
|
|
1385
|
+
active: "_active_1uxs8_205",
|
|
1386
|
+
visuallyHidden: "_visuallyHidden_1uxs8_217"
|
|
1387
|
+
}, Me = 8, Ne = 6, Pe = 5, Fe = {
|
|
1388
|
+
sm: 20,
|
|
1389
|
+
md: 30,
|
|
1390
|
+
lg: 40
|
|
1391
|
+
}, Ie = ({ options: e, value: r, onChange: i, placeholder: a = "Начните вводить", noResultsText: m = "Ничего не найдено", disabled: h = !1, readOnly: g = !1, stringWhileDisabled: _ = !1, label: v, error: y, hint: b, size: x = "md", required: S = !1, className: C = "", name: w, id: T, needMark: D = !0 }) => {
|
|
1392
|
+
let O = c(), k = T ?? `ds-search-dropdown-${w ?? O}`, A = `${k}-listbox`, j = `${k}-status`, M = b ? `${k}-hint` : void 0, N = y ? `${k}-error` : void 0, P = [
|
|
1393
|
+
j,
|
|
1394
|
+
M,
|
|
1395
|
+
N
|
|
1396
|
+
].filter(Boolean).join(" "), F = d(null), I = d(null), L = d([]), [R, z] = f(!1), [B, V] = f(""), [H, U] = f(-1), [W, te] = f(null), G = u(() => e.find((e) => e.value === r), [e, r]), K = u(() => Ae(e, B), [e, B]), q = h && _, J = H >= 0 ? K[H] : void 0;
|
|
1397
|
+
s(() => V(G?.label ?? ""), [G?.label, r]);
|
|
1398
|
+
let ne = o(() => F.current?.querySelector("input") ?? null, []), re = o((e, t) => je(K, e, t), [K]), ie = o((e) => {
|
|
1399
|
+
U(e), !(e < 0) && requestAnimationFrame(() => L.current[e]?.scrollIntoView({ block: "nearest" }));
|
|
1400
|
+
}, []), ae = o(() => {
|
|
1401
|
+
let e = ne();
|
|
1402
|
+
if (!e) return;
|
|
1403
|
+
let t = e.getBoundingClientRect(), n = Math.max(1, Math.min(K.length, Pe)) * Fe[x] + 2, r = window.innerHeight - t.bottom - Me, i = t.top - Me, a = r < n && i > r, o = a ? i : r, s = Math.max(Fe[x] + 2, Math.min(n, o)), c = window.innerWidth - t.width - Me, l = Math.max(Me, Math.min(t.left, c)), u = a ? Math.max(Me, t.top - s - Ne) : t.bottom + Ne;
|
|
1404
|
+
te({
|
|
1405
|
+
top: u,
|
|
1406
|
+
left: l,
|
|
1407
|
+
width: t.width,
|
|
1408
|
+
maxHeight: s
|
|
1409
|
+
});
|
|
1410
|
+
}, [
|
|
1411
|
+
K.length,
|
|
1412
|
+
ne,
|
|
1413
|
+
x
|
|
1414
|
+
]);
|
|
1415
|
+
l(() => {
|
|
1416
|
+
if (!R) {
|
|
1417
|
+
te(null);
|
|
1418
|
+
return;
|
|
1419
|
+
}
|
|
1420
|
+
return ae(), window.addEventListener("resize", ae), window.addEventListener("scroll", ae, !0), () => {
|
|
1421
|
+
window.removeEventListener("resize", ae), window.removeEventListener("scroll", ae, !0);
|
|
1422
|
+
};
|
|
1423
|
+
}, [R, ae]), s(() => {
|
|
1424
|
+
if (!R) return;
|
|
1425
|
+
let e = (e) => {
|
|
1426
|
+
let t = e.target;
|
|
1427
|
+
!F.current?.contains(t) && !I.current?.contains(t) && (z(!1), U(-1));
|
|
1428
|
+
};
|
|
1429
|
+
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
1430
|
+
}, [R]);
|
|
1431
|
+
let oe = () => {
|
|
1432
|
+
h || g || (z(!0), U(re(0, 1)));
|
|
1433
|
+
}, se = (e) => {
|
|
1434
|
+
e.disabled || (V(e.label), z(!1), U(-1), i?.(e.value, e), ne()?.focus());
|
|
1435
|
+
}, ce = R ? /* @__PURE__ */ t("ul", {
|
|
1436
|
+
ref: I,
|
|
1437
|
+
id: A,
|
|
1438
|
+
className: X.menu,
|
|
1439
|
+
role: "listbox",
|
|
1440
|
+
"aria-label": v,
|
|
1441
|
+
style: W ? {
|
|
1442
|
+
top: W.top,
|
|
1443
|
+
left: W.left,
|
|
1444
|
+
width: W.width,
|
|
1445
|
+
maxHeight: W.maxHeight
|
|
1446
|
+
} : {
|
|
1447
|
+
top: 0,
|
|
1448
|
+
left: 0,
|
|
1449
|
+
visibility: "hidden",
|
|
1450
|
+
maxHeight: 0
|
|
1451
|
+
},
|
|
1452
|
+
children: K.length === 0 ? /* @__PURE__ */ t("li", {
|
|
1453
|
+
className: `${X.empty} ${X[x]}`,
|
|
1454
|
+
children: m
|
|
1455
|
+
}) : K.map((e, i) => {
|
|
1456
|
+
let a = e.value === r, o = i === H;
|
|
1457
|
+
return /* @__PURE__ */ t("li", {
|
|
1458
|
+
role: "presentation",
|
|
1459
|
+
children: /* @__PURE__ */ n("button", {
|
|
1460
|
+
ref: (e) => {
|
|
1461
|
+
L.current[i] = e;
|
|
1462
|
+
},
|
|
1463
|
+
id: `${k}-option-${i}`,
|
|
1464
|
+
type: "button",
|
|
1465
|
+
role: "option",
|
|
1466
|
+
tabIndex: -1,
|
|
1467
|
+
disabled: e.disabled,
|
|
1468
|
+
"aria-disabled": e.disabled,
|
|
1469
|
+
"aria-selected": a,
|
|
1470
|
+
className: [
|
|
1471
|
+
X.option,
|
|
1472
|
+
X[x],
|
|
1473
|
+
a ? X.selected : "",
|
|
1474
|
+
o ? X.active : ""
|
|
1475
|
+
].filter(Boolean).join(" "),
|
|
1476
|
+
onPointerMove: () => {
|
|
1477
|
+
e.disabled || U(i);
|
|
1478
|
+
},
|
|
1479
|
+
onClick: () => se(e),
|
|
1480
|
+
children: [/* @__PURE__ */ t("span", { children: e.label }), a && D && /* @__PURE__ */ t("span", {
|
|
1481
|
+
"aria-hidden": "true",
|
|
1482
|
+
children: "✓"
|
|
1483
|
+
})]
|
|
1484
|
+
})
|
|
1485
|
+
}, e.value);
|
|
1486
|
+
})
|
|
1487
|
+
}) : null;
|
|
1488
|
+
return /* @__PURE__ */ n("div", {
|
|
1489
|
+
ref: F,
|
|
1490
|
+
className: [
|
|
1491
|
+
X.wrapper,
|
|
1492
|
+
y ? X.errorState : "",
|
|
1493
|
+
C
|
|
1494
|
+
].filter(Boolean).join(" "),
|
|
1495
|
+
children: [
|
|
1496
|
+
v && /* @__PURE__ */ t(ee, {
|
|
1497
|
+
htmlFor: q ? void 0 : k,
|
|
1498
|
+
required: S,
|
|
1499
|
+
disabled: h,
|
|
1500
|
+
children: v
|
|
1501
|
+
}),
|
|
1502
|
+
q ? /* @__PURE__ */ t("div", {
|
|
1503
|
+
className: `${X.disabledText} ${X[x]}`,
|
|
1504
|
+
children: G?.label ?? a
|
|
1505
|
+
}) : /* @__PURE__ */ n("div", {
|
|
1506
|
+
className: X.control,
|
|
1507
|
+
children: [/* @__PURE__ */ t(ke, {
|
|
1508
|
+
id: k,
|
|
1509
|
+
name: w,
|
|
1510
|
+
value: B,
|
|
1511
|
+
placeholder: a,
|
|
1512
|
+
disabled: h,
|
|
1513
|
+
readOnly: g,
|
|
1514
|
+
required: S,
|
|
1515
|
+
size: x,
|
|
1516
|
+
clearable: !1,
|
|
1517
|
+
autoComplete: "off",
|
|
1518
|
+
className: `${X.inputHost} ${X[x]}`,
|
|
1519
|
+
onFocus: oe,
|
|
1520
|
+
onChange: (t) => {
|
|
1521
|
+
let n = String(t), r = Ae(e, n);
|
|
1522
|
+
V(n), z(!0), U(je(r, 0, 1));
|
|
1523
|
+
},
|
|
1524
|
+
role: "combobox",
|
|
1525
|
+
"aria-autocomplete": "list",
|
|
1526
|
+
"aria-expanded": R,
|
|
1527
|
+
"aria-controls": A,
|
|
1528
|
+
"aria-activedescendant": J ? `${k}-option-${H}` : void 0,
|
|
1529
|
+
"aria-invalid": !!y,
|
|
1530
|
+
"aria-describedby": P,
|
|
1531
|
+
onClick: oe,
|
|
1532
|
+
onKeyDown: (e) => {
|
|
1533
|
+
if (!(h || g)) {
|
|
1534
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
1535
|
+
e.preventDefault();
|
|
1536
|
+
let t = e.key === "ArrowDown" ? 1 : -1, n = H >= 0 ? H + t : t === 1 ? 0 : K.length - 1;
|
|
1537
|
+
z(!0), ie(re(n, t));
|
|
1538
|
+
} else if (e.key === "Home" || e.key === "End") {
|
|
1539
|
+
if (!R) return;
|
|
1540
|
+
e.preventDefault();
|
|
1541
|
+
let t = e.key === "Home" ? 1 : -1;
|
|
1542
|
+
ie(re(e.key === "Home" ? 0 : K.length - 1, t));
|
|
1543
|
+
} else e.key === "Enter" && R && J ? (e.preventDefault(), se(J)) : e.key === "Escape" && R ? (e.preventDefault(), z(!1), U(-1)) : e.key === "Tab" && (z(!1), U(-1));
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
}), /* @__PURE__ */ t("span", {
|
|
1547
|
+
className: `${X.chevron} ${R ? X.chevronOpen : ""}`,
|
|
1548
|
+
"aria-hidden": "true",
|
|
1549
|
+
children: /* @__PURE__ */ t("svg", {
|
|
1550
|
+
viewBox: "0 0 20 20",
|
|
1551
|
+
fill: "none",
|
|
1552
|
+
children: /* @__PURE__ */ t("path", {
|
|
1553
|
+
d: "M5 7.5L10 12.5L15 7.5",
|
|
1554
|
+
stroke: "currentColor",
|
|
1555
|
+
strokeWidth: "1.8",
|
|
1556
|
+
strokeLinecap: "round",
|
|
1557
|
+
strokeLinejoin: "round"
|
|
1558
|
+
})
|
|
1559
|
+
})
|
|
1560
|
+
})]
|
|
1561
|
+
}),
|
|
1562
|
+
R && typeof document < "u" && p(ce, document.body),
|
|
1563
|
+
/* @__PURE__ */ n("span", {
|
|
1564
|
+
id: j,
|
|
1565
|
+
className: X.visuallyHidden,
|
|
1566
|
+
"aria-live": "polite",
|
|
1567
|
+
children: ["Найдено вариантов: ", K.length]
|
|
1568
|
+
}),
|
|
1569
|
+
b && !y && /* @__PURE__ */ t(E, {
|
|
1570
|
+
id: M,
|
|
1571
|
+
children: b
|
|
1572
|
+
}),
|
|
1573
|
+
y && /* @__PURE__ */ t(E, {
|
|
1574
|
+
id: N,
|
|
1575
|
+
variant: "error",
|
|
1576
|
+
children: y
|
|
1577
|
+
})
|
|
1578
|
+
]
|
|
1579
|
+
});
|
|
1580
|
+
}, Le = {
|
|
1581
|
+
root: "_root_1y2s8_1",
|
|
1582
|
+
header: "_header_1y2s8_21",
|
|
1583
|
+
title: "_title_1y2s8_41",
|
|
1584
|
+
dismiss: "_dismiss_1y2s8_55",
|
|
1585
|
+
content: "_content_1y2s8_113"
|
|
1586
|
+
}, Re = ({ title: e, children: r, dismissible: i = !1, onDismiss: a, dismissLabel: o = "Закрыть информационный блок", headingAs: s = "h3", className: l = "" }) => {
|
|
1587
|
+
let u = `ds-info-block-${c()}`;
|
|
1588
|
+
return /* @__PURE__ */ n("section", {
|
|
1589
|
+
className: `${Le.root} ${l}`,
|
|
1590
|
+
"aria-labelledby": u,
|
|
1591
|
+
children: [/* @__PURE__ */ n("header", {
|
|
1592
|
+
className: Le.header,
|
|
1593
|
+
children: [/* @__PURE__ */ t(s, {
|
|
1594
|
+
id: u,
|
|
1595
|
+
className: Le.title,
|
|
1596
|
+
children: e
|
|
1597
|
+
}), i && /* @__PURE__ */ t("button", {
|
|
1598
|
+
type: "button",
|
|
1599
|
+
className: Le.dismiss,
|
|
1600
|
+
onClick: a,
|
|
1601
|
+
"aria-label": o,
|
|
1602
|
+
children: /* @__PURE__ */ t("svg", {
|
|
1603
|
+
viewBox: "0 0 20 20",
|
|
1604
|
+
"aria-hidden": "true",
|
|
1605
|
+
children: /* @__PURE__ */ t("path", {
|
|
1606
|
+
d: "M5 5L15 15M15 5L5 15",
|
|
1607
|
+
fill: "none",
|
|
1608
|
+
stroke: "currentColor",
|
|
1609
|
+
strokeWidth: "1.8",
|
|
1610
|
+
strokeLinecap: "round"
|
|
1611
|
+
})
|
|
1612
|
+
})
|
|
1613
|
+
})]
|
|
1614
|
+
}), /* @__PURE__ */ t("div", {
|
|
1615
|
+
className: Le.content,
|
|
1616
|
+
children: r
|
|
1617
|
+
})]
|
|
1618
|
+
});
|
|
1619
|
+
}, ze = {
|
|
1620
|
+
wrapper: "_wrapper_ecmvo_1",
|
|
1621
|
+
input: "_input_ecmvo_21",
|
|
1622
|
+
switch: "_switch_ecmvo_35",
|
|
1623
|
+
thumb: "_thumb_ecmvo_67",
|
|
1624
|
+
label: "_label_ecmvo_113",
|
|
1625
|
+
disabled: "_disabled_ecmvo_125"
|
|
1626
|
+
}, Be = ({ checked: e, onChange: r, label: i, disabled: a = !1, readOnly: o = !1, className: s = "", name: l, id: u, value: d }) => {
|
|
1328
1627
|
let f = c(), p = u ?? `ds-radio-button-${l ?? f}`;
|
|
1329
1628
|
return /* @__PURE__ */ n("label", {
|
|
1330
1629
|
htmlFor: p,
|
|
1331
|
-
className: `${
|
|
1630
|
+
className: `${ze.wrapper} ${a ? ze.disabled : ""} ${s}`,
|
|
1332
1631
|
children: [
|
|
1333
1632
|
/* @__PURE__ */ t("input", {
|
|
1334
1633
|
id: p,
|
|
1335
|
-
className:
|
|
1634
|
+
className: ze.input,
|
|
1336
1635
|
type: "checkbox",
|
|
1337
1636
|
role: "switch",
|
|
1338
1637
|
name: l,
|
|
@@ -1345,21 +1644,21 @@ var T = {
|
|
|
1345
1644
|
}
|
|
1346
1645
|
}),
|
|
1347
1646
|
/* @__PURE__ */ t("span", {
|
|
1348
|
-
className:
|
|
1647
|
+
className: ze.switch,
|
|
1349
1648
|
"aria-hidden": "true",
|
|
1350
|
-
children: /* @__PURE__ */ t("span", { className:
|
|
1649
|
+
children: /* @__PURE__ */ t("span", { className: ze.thumb })
|
|
1351
1650
|
}),
|
|
1352
1651
|
i && /* @__PURE__ */ t("span", {
|
|
1353
|
-
className:
|
|
1652
|
+
className: ze.label,
|
|
1354
1653
|
children: i
|
|
1355
1654
|
})
|
|
1356
1655
|
]
|
|
1357
1656
|
});
|
|
1358
|
-
},
|
|
1657
|
+
}, Ve = {
|
|
1359
1658
|
root: "_root_kepgo_1",
|
|
1360
1659
|
grid: "_grid_kepgo_3",
|
|
1361
1660
|
actions: "_actions_kepgo_5"
|
|
1362
|
-
},
|
|
1661
|
+
}, He = ({ filters: e, values: r, onChange: i, onApply: a, onReset: o, applyMode: s = "instant", loading: c = !1, disabled: l = !1, className: u = "" }) => {
|
|
1363
1662
|
let d = (e, t) => {
|
|
1364
1663
|
let n = {
|
|
1365
1664
|
...r,
|
|
@@ -1368,11 +1667,11 @@ var T = {
|
|
|
1368
1667
|
i?.(n, e), s === "instant" && a?.(n);
|
|
1369
1668
|
};
|
|
1370
1669
|
return /* @__PURE__ */ n("section", {
|
|
1371
|
-
className: `${
|
|
1670
|
+
className: `${Ve.root} ${u}`,
|
|
1372
1671
|
"aria-label": "Фильтры",
|
|
1373
1672
|
"aria-busy": c,
|
|
1374
1673
|
children: [/* @__PURE__ */ t("div", {
|
|
1375
|
-
className:
|
|
1674
|
+
className: Ve.grid,
|
|
1376
1675
|
children: e.filter((e) => !e.hidden).map((e) => {
|
|
1377
1676
|
let n = l || c || e.disabled, i = r[e.id];
|
|
1378
1677
|
if (e.type === "input") {
|
|
@@ -1382,12 +1681,12 @@ var T = {
|
|
|
1382
1681
|
placeholder: e.placeholder,
|
|
1383
1682
|
disabled: n
|
|
1384
1683
|
};
|
|
1385
|
-
return e.inputType === "number" ? /* @__PURE__ */ t(
|
|
1684
|
+
return e.inputType === "number" ? /* @__PURE__ */ t(ke, {
|
|
1386
1685
|
...r,
|
|
1387
1686
|
type: "number",
|
|
1388
1687
|
value: i ?? "",
|
|
1389
1688
|
onChange: (t) => d(e.id, t)
|
|
1390
|
-
}, e.id) : /* @__PURE__ */ t(
|
|
1689
|
+
}, e.id) : /* @__PURE__ */ t(ke, {
|
|
1391
1690
|
...r,
|
|
1392
1691
|
type: "text",
|
|
1393
1692
|
value: String(i ?? ""),
|
|
@@ -1403,7 +1702,7 @@ var T = {
|
|
|
1403
1702
|
disabled: n,
|
|
1404
1703
|
onChange: (t) => d(e.id, t)
|
|
1405
1704
|
}, e.id);
|
|
1406
|
-
if (e.type === "multiple") return /* @__PURE__ */ t(
|
|
1705
|
+
if (e.type === "multiple") return /* @__PURE__ */ t(De, {
|
|
1407
1706
|
label: e.label,
|
|
1408
1707
|
hint: e.hint,
|
|
1409
1708
|
placeholder: e.placeholder,
|
|
@@ -1412,14 +1711,14 @@ var T = {
|
|
|
1412
1711
|
disabled: n,
|
|
1413
1712
|
onChange: (t) => d(e.id, t)
|
|
1414
1713
|
}, e.id);
|
|
1415
|
-
if (e.type === "checkbox") return /* @__PURE__ */ t(
|
|
1714
|
+
if (e.type === "checkbox") return /* @__PURE__ */ t(O, {
|
|
1416
1715
|
label: e.label,
|
|
1417
1716
|
hint: e.hint,
|
|
1418
1717
|
checked: !!i,
|
|
1419
1718
|
disabled: n,
|
|
1420
1719
|
onChange: (t) => d(e.id, t)
|
|
1421
1720
|
}, e.id);
|
|
1422
|
-
if (e.type === "radio") return /* @__PURE__ */ t(
|
|
1721
|
+
if (e.type === "radio") return /* @__PURE__ */ t(Be, {
|
|
1423
1722
|
label: e.label,
|
|
1424
1723
|
checked: !!i,
|
|
1425
1724
|
disabled: n,
|
|
@@ -1440,7 +1739,7 @@ var T = {
|
|
|
1440
1739
|
}, e.id);
|
|
1441
1740
|
})
|
|
1442
1741
|
}), (o || s === "manual") && /* @__PURE__ */ n("div", {
|
|
1443
|
-
className:
|
|
1742
|
+
className: Ve.actions,
|
|
1444
1743
|
children: [o && /* @__PURE__ */ t(w, {
|
|
1445
1744
|
variant: "destructiveOutline",
|
|
1446
1745
|
disabled: l || c,
|
|
@@ -1455,67 +1754,66 @@ var T = {
|
|
|
1455
1754
|
})]
|
|
1456
1755
|
});
|
|
1457
1756
|
}, Z = {
|
|
1458
|
-
wrapper: "
|
|
1459
|
-
dropzone: "
|
|
1460
|
-
dragActive: "
|
|
1461
|
-
disabled: "
|
|
1462
|
-
error: "
|
|
1463
|
-
nativeInput: "
|
|
1464
|
-
empty: "
|
|
1465
|
-
uploadIcon: "
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
let t = [], n = new Set(r.map(je)), c = e.filter((e) => Ne(e, o) ? s !== void 0 && e.size > s ? (t.push({
|
|
1757
|
+
wrapper: "_wrapper_8w6xl_1",
|
|
1758
|
+
dropzone: "_dropzone_8w6xl_3",
|
|
1759
|
+
dragActive: "_dragActive_8w6xl_5",
|
|
1760
|
+
disabled: "_disabled_8w6xl_7",
|
|
1761
|
+
error: "_error_8w6xl_9",
|
|
1762
|
+
nativeInput: "_nativeInput_8w6xl_11",
|
|
1763
|
+
empty: "_empty_8w6xl_13",
|
|
1764
|
+
uploadIcon: "_uploadIcon_8w6xl_15",
|
|
1765
|
+
files: "_files_8w6xl_17",
|
|
1766
|
+
file: "_file_8w6xl_17",
|
|
1767
|
+
fileName: "_fileName_8w6xl_21",
|
|
1768
|
+
fileSize: "_fileSize_8w6xl_23"
|
|
1769
|
+
}, Ue = (e) => `${e.name}:${e.size}:${e.lastModified}`, We = (e) => e < 1024 ? `${e} Б` : e < 1048576 ? `${(e / 1024).toFixed(1)} КБ` : `${(e / 1024 / 1024).toFixed(1)} МБ`, Ge = (e, t) => !t || t.split(",").map((e) => e.trim().toLowerCase()).some((t) => t.startsWith(".") ? e.name.toLowerCase().endsWith(t) : t.endsWith("/*") ? e.type.startsWith(t.slice(0, -1)) : e.type.toLowerCase() === t), Ke = ({ value: r, onChange: i, multiple: a = !1, accept: o, maxSize: s, maxFiles: l, label: u, hint: p, error: m, required: h = !1, disabled: g = !1, readOnly: _ = !1, name: v, id: y, className: b = "", dropLabel: x = "Перетащите файлы в эту область", browseLabel: S = "Выбрать файлы", addMoreLabel: C = "Добавить ещё", onReject: T }) => {
|
|
1770
|
+
let D = c(), O = y ?? `ds-file-input-${v ?? D}`, k = d(null), A = d(0), [j, M] = f(!1), N = p ? `${O}-hint` : void 0, P = m ? `${O}-error` : void 0, F = [N, P].filter(Boolean).join(" ") || void 0, I = !g && !_, L = (e) => {
|
|
1771
|
+
let t = [], n = new Set(r.map(Ue)), c = e.filter((e) => Ge(e, o) ? s !== void 0 && e.size > s ? (t.push({
|
|
1474
1772
|
file: e,
|
|
1475
1773
|
reason: "maxSize"
|
|
1476
|
-
}), !1) : !n.has(
|
|
1774
|
+
}), !1) : !n.has(Ue(e)) && (n.add(Ue(e)), !0) : (t.push({
|
|
1477
1775
|
file: e,
|
|
1478
1776
|
reason: "accept"
|
|
1479
1777
|
}), !1)), u = a ? l : 1, d = a ? [...r, ...c] : c.slice(-1);
|
|
1480
1778
|
u !== void 0 && d.length > u && (d.slice(u).forEach((e) => t.push({
|
|
1481
1779
|
file: e,
|
|
1482
1780
|
reason: "maxFiles"
|
|
1483
|
-
})), d = d.slice(0, u)), t.length && T?.(t), c.length && i?.(d),
|
|
1781
|
+
})), d = d.slice(0, u)), t.length && T?.(t), c.length && i?.(d), k.current && (k.current.value = "");
|
|
1484
1782
|
};
|
|
1485
1783
|
return /* @__PURE__ */ n("div", {
|
|
1486
1784
|
className: `${Z.wrapper} ${b}`,
|
|
1487
1785
|
children: [
|
|
1488
|
-
u && /* @__PURE__ */ t(
|
|
1489
|
-
htmlFor:
|
|
1786
|
+
u && /* @__PURE__ */ t(ee, {
|
|
1787
|
+
htmlFor: O,
|
|
1490
1788
|
required: h,
|
|
1491
1789
|
disabled: g,
|
|
1492
1790
|
children: u
|
|
1493
1791
|
}),
|
|
1494
1792
|
/* @__PURE__ */ n("div", {
|
|
1495
|
-
className: `${Z.dropzone} ${
|
|
1793
|
+
className: `${Z.dropzone} ${j ? Z.dragActive : ""} ${g ? Z.disabled : ""} ${m ? Z.error : ""}`,
|
|
1496
1794
|
onDragEnter: (e) => {
|
|
1497
|
-
e.preventDefault(),
|
|
1795
|
+
e.preventDefault(), I && ++A.current === 1 && M(!0);
|
|
1498
1796
|
},
|
|
1499
1797
|
onDragOver: (e) => e.preventDefault(),
|
|
1500
1798
|
onDragLeave: (e) => {
|
|
1501
|
-
e.preventDefault(), --
|
|
1799
|
+
e.preventDefault(), --A.current <= 0 && (A.current = 0, M(!1));
|
|
1502
1800
|
},
|
|
1503
1801
|
onDrop: (e) => {
|
|
1504
|
-
e.preventDefault(),
|
|
1802
|
+
e.preventDefault(), A.current = 0, M(!1), I && L(Array.from(e.dataTransfer.files));
|
|
1505
1803
|
},
|
|
1506
1804
|
children: [/* @__PURE__ */ t("input", {
|
|
1507
|
-
ref:
|
|
1508
|
-
id:
|
|
1805
|
+
ref: k,
|
|
1806
|
+
id: O,
|
|
1509
1807
|
name: v,
|
|
1510
1808
|
className: Z.nativeInput,
|
|
1511
1809
|
type: "file",
|
|
1512
1810
|
multiple: a,
|
|
1513
1811
|
accept: o,
|
|
1514
1812
|
required: h && r.length === 0,
|
|
1515
|
-
disabled: !
|
|
1516
|
-
"aria-describedby":
|
|
1813
|
+
disabled: !I,
|
|
1814
|
+
"aria-describedby": F,
|
|
1517
1815
|
"aria-invalid": !!m,
|
|
1518
|
-
onChange: (e) =>
|
|
1816
|
+
onChange: (e) => L(Array.from(e.target.files ?? []))
|
|
1519
1817
|
}), r.length ? /* @__PURE__ */ n(e, { children: [
|
|
1520
1818
|
/* @__PURE__ */ t("ul", {
|
|
1521
1819
|
className: Z.files,
|
|
@@ -1530,9 +1828,9 @@ var T = {
|
|
|
1530
1828
|
}),
|
|
1531
1829
|
/* @__PURE__ */ t("span", {
|
|
1532
1830
|
className: Z.fileSize,
|
|
1533
|
-
children:
|
|
1831
|
+
children: We(e.size)
|
|
1534
1832
|
}),
|
|
1535
|
-
|
|
1833
|
+
I && /* @__PURE__ */ t(w, {
|
|
1536
1834
|
variant: "empty",
|
|
1537
1835
|
size: "sm",
|
|
1538
1836
|
"aria-label": `Удалить файл ${e.name}`,
|
|
@@ -1540,18 +1838,18 @@ var T = {
|
|
|
1540
1838
|
children: "×"
|
|
1541
1839
|
})
|
|
1542
1840
|
]
|
|
1543
|
-
},
|
|
1841
|
+
}, Ue(e)))
|
|
1544
1842
|
}),
|
|
1545
|
-
|
|
1843
|
+
I && (a || r.length === 0) && /* @__PURE__ */ t(w, {
|
|
1546
1844
|
className: Z.browseButton,
|
|
1547
1845
|
size: "sm",
|
|
1548
|
-
onClick: () =>
|
|
1846
|
+
onClick: () => k.current?.click(),
|
|
1549
1847
|
children: C
|
|
1550
1848
|
}),
|
|
1551
|
-
|
|
1849
|
+
I && !a && /* @__PURE__ */ t(w, {
|
|
1552
1850
|
className: Z.browseButton,
|
|
1553
1851
|
size: "sm",
|
|
1554
|
-
onClick: () =>
|
|
1852
|
+
onClick: () => k.current?.click(),
|
|
1555
1853
|
children: S
|
|
1556
1854
|
})
|
|
1557
1855
|
] }) : /* @__PURE__ */ n("div", {
|
|
@@ -1562,32 +1860,31 @@ var T = {
|
|
|
1562
1860
|
"aria-hidden": "true",
|
|
1563
1861
|
children: "↑"
|
|
1564
1862
|
}),
|
|
1565
|
-
/* @__PURE__ */ t("strong", { children:
|
|
1566
|
-
!
|
|
1567
|
-
|
|
1568
|
-
onClick: () => A.current?.click(),
|
|
1863
|
+
/* @__PURE__ */ t("strong", { children: j ? "Отпустите файлы здесь" : x }),
|
|
1864
|
+
!j && I && /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", { children: "или" }), /* @__PURE__ */ t(w, {
|
|
1865
|
+
onClick: () => k.current?.click(),
|
|
1569
1866
|
children: S
|
|
1570
1867
|
})] })
|
|
1571
1868
|
]
|
|
1572
1869
|
})]
|
|
1573
1870
|
}),
|
|
1574
|
-
p && !m && /* @__PURE__ */ t(
|
|
1575
|
-
id:
|
|
1871
|
+
p && !m && /* @__PURE__ */ t(E, {
|
|
1872
|
+
id: N,
|
|
1576
1873
|
children: p
|
|
1577
1874
|
}),
|
|
1578
|
-
m && /* @__PURE__ */ t(
|
|
1579
|
-
id:
|
|
1875
|
+
m && /* @__PURE__ */ t(E, {
|
|
1876
|
+
id: P,
|
|
1580
1877
|
variant: "error",
|
|
1581
1878
|
live: !0,
|
|
1582
1879
|
children: m
|
|
1583
1880
|
})
|
|
1584
1881
|
]
|
|
1585
1882
|
});
|
|
1586
|
-
},
|
|
1883
|
+
}, qe = 0, Q = v((e) => ({
|
|
1587
1884
|
modals: [],
|
|
1588
1885
|
openModal: (t, n = {}, r = {}) => {
|
|
1589
|
-
|
|
1590
|
-
let i = `ds-modal-${
|
|
1886
|
+
qe += 1;
|
|
1887
|
+
let i = `ds-modal-${qe}`;
|
|
1591
1888
|
return e((e) => ({ modals: [...e.modals, {
|
|
1592
1889
|
id: i,
|
|
1593
1890
|
name: t,
|
|
@@ -1599,22 +1896,22 @@ var T = {
|
|
|
1599
1896
|
closeModal: (t) => e((e) => ({ modals: e.modals.filter((e) => e.id !== t) })),
|
|
1600
1897
|
closeTopModal: () => e((e) => ({ modals: e.modals.slice(0, -1) })),
|
|
1601
1898
|
closeAllModals: () => e({ modals: [] })
|
|
1602
|
-
})),
|
|
1603
|
-
layer: "
|
|
1604
|
-
backdrop: "
|
|
1605
|
-
panel: "
|
|
1606
|
-
header: "
|
|
1607
|
-
title: "
|
|
1608
|
-
description: "
|
|
1609
|
-
content: "
|
|
1610
|
-
},
|
|
1899
|
+
})), Je = () => Q.setState({ modals: [] }), Ye = {
|
|
1900
|
+
layer: "_layer_p0e8j_1",
|
|
1901
|
+
backdrop: "_backdrop_p0e8j_3",
|
|
1902
|
+
panel: "_panel_p0e8j_5",
|
|
1903
|
+
header: "_header_p0e8j_9",
|
|
1904
|
+
title: "_title_p0e8j_11",
|
|
1905
|
+
description: "_description_p0e8j_13",
|
|
1906
|
+
content: "_content_p0e8j_15"
|
|
1907
|
+
}, Xe = "button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"])", Ze = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "Закрыть модальное окно", className: l = "", role: u = "dialog" }) => {
|
|
1611
1908
|
let f = c(), p = c(), m = d(null), h = Q((e) => e.closeModal);
|
|
1612
1909
|
return s(() => {
|
|
1613
1910
|
let e = document.activeElement, t = m.current;
|
|
1614
|
-
return (t?.querySelector(
|
|
1911
|
+
return (t?.querySelector(Xe) ?? t)?.focus(), () => e?.focus();
|
|
1615
1912
|
}, []), /* @__PURE__ */ n("div", {
|
|
1616
1913
|
ref: m,
|
|
1617
|
-
className: `${
|
|
1914
|
+
className: `${Ye.panel} ${l}`,
|
|
1618
1915
|
role: u,
|
|
1619
1916
|
"aria-modal": "true",
|
|
1620
1917
|
"aria-labelledby": r ? f : void 0,
|
|
@@ -1622,7 +1919,7 @@ var T = {
|
|
|
1622
1919
|
tabIndex: -1,
|
|
1623
1920
|
onKeyDown: (e) => {
|
|
1624
1921
|
if (e.key !== "Tab") return;
|
|
1625
|
-
let t = Array.from(m.current?.querySelectorAll(
|
|
1922
|
+
let t = Array.from(m.current?.querySelectorAll(Xe) ?? []);
|
|
1626
1923
|
if (!t.length) {
|
|
1627
1924
|
e.preventDefault();
|
|
1628
1925
|
return;
|
|
@@ -1632,10 +1929,10 @@ var T = {
|
|
|
1632
1929
|
},
|
|
1633
1930
|
children: [
|
|
1634
1931
|
(r || o) && /* @__PURE__ */ n("header", {
|
|
1635
|
-
className:
|
|
1932
|
+
className: Ye.header,
|
|
1636
1933
|
children: [r && /* @__PURE__ */ t("h2", {
|
|
1637
1934
|
id: f,
|
|
1638
|
-
className:
|
|
1935
|
+
className: Ye.title,
|
|
1639
1936
|
children: r
|
|
1640
1937
|
}), /* @__PURE__ */ t(w, {
|
|
1641
1938
|
variant: "empty",
|
|
@@ -1658,16 +1955,16 @@ var T = {
|
|
|
1658
1955
|
}),
|
|
1659
1956
|
i && /* @__PURE__ */ t("p", {
|
|
1660
1957
|
id: p,
|
|
1661
|
-
className:
|
|
1958
|
+
className: Ye.description,
|
|
1662
1959
|
children: i
|
|
1663
1960
|
}),
|
|
1664
1961
|
/* @__PURE__ */ t("div", {
|
|
1665
|
-
className:
|
|
1962
|
+
className: Ye.content,
|
|
1666
1963
|
children: e
|
|
1667
1964
|
})
|
|
1668
1965
|
]
|
|
1669
1966
|
});
|
|
1670
|
-
},
|
|
1967
|
+
}, Qe = ({ registry: e }) => {
|
|
1671
1968
|
let n = Q((e) => e.modals), r = Q((e) => e.closeModal), i = Q((e) => e.closeAllModals);
|
|
1672
1969
|
return s(() => {
|
|
1673
1970
|
let e = (e) => {
|
|
@@ -1677,12 +1974,12 @@ var T = {
|
|
|
1677
1974
|
};
|
|
1678
1975
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
1679
1976
|
}, [r]), !n.length || typeof document > "u" ? null : p(/* @__PURE__ */ t("div", {
|
|
1680
|
-
className:
|
|
1977
|
+
className: Ye.layer,
|
|
1681
1978
|
"aria-label": "Модальные окна",
|
|
1682
1979
|
children: n.map((a, o) => {
|
|
1683
1980
|
let s = e[a.name];
|
|
1684
1981
|
return s ? /* @__PURE__ */ t("div", {
|
|
1685
|
-
className:
|
|
1982
|
+
className: Ye.backdrop,
|
|
1686
1983
|
"aria-hidden": o !== n.length - 1 || void 0,
|
|
1687
1984
|
onMouseDown: (e) => {
|
|
1688
1985
|
e.target === e.currentTarget && a.closeOnBackdrop && r(a.id);
|
|
@@ -1696,7 +1993,7 @@ var T = {
|
|
|
1696
1993
|
}, a.id) : null;
|
|
1697
1994
|
})
|
|
1698
1995
|
}), document.body);
|
|
1699
|
-
},
|
|
1996
|
+
}, $e = ({ registry: r, children: i, lockBodyScroll: a = !0 }) => {
|
|
1700
1997
|
let o = Q((e) => e.modals.length);
|
|
1701
1998
|
return s(() => {
|
|
1702
1999
|
if (!a || o === 0) return;
|
|
@@ -1704,23 +2001,23 @@ var T = {
|
|
|
1704
2001
|
return document.body.style.overflow = "hidden", () => {
|
|
1705
2002
|
document.body.style.overflow = e;
|
|
1706
2003
|
};
|
|
1707
|
-
}, [a, o]), /* @__PURE__ */ n(e, { children: [i, /* @__PURE__ */ t(
|
|
1708
|
-
},
|
|
2004
|
+
}, [a, o]), /* @__PURE__ */ n(e, { children: [i, /* @__PURE__ */ t(Qe, { registry: r })] });
|
|
2005
|
+
}, et = (e) => e, tt = {
|
|
1709
2006
|
message: "_message_1vtru_1",
|
|
1710
2007
|
actions: "_actions_1vtru_3"
|
|
1711
|
-
},
|
|
2008
|
+
}, nt = /* @__PURE__ */ new Map(), rt = 0, it = ({ modalId: e, close: r, title: i = "Подтверждение", message: a = "Продолжить действие?", confirmLabel: o = "Подтвердить", cancelLabel: s = "Отмена", tone: c = "default", requestId: l }) => {
|
|
1712
2009
|
let u = (e) => {
|
|
1713
|
-
|
|
2010
|
+
nt.get(l)?.(e), nt.delete(l), r();
|
|
1714
2011
|
};
|
|
1715
|
-
return /* @__PURE__ */ n(
|
|
2012
|
+
return /* @__PURE__ */ n(Ze, {
|
|
1716
2013
|
modalId: e,
|
|
1717
2014
|
title: i,
|
|
1718
2015
|
role: "alertdialog",
|
|
1719
2016
|
children: [/* @__PURE__ */ t("p", {
|
|
1720
|
-
className:
|
|
2017
|
+
className: tt.message,
|
|
1721
2018
|
children: a
|
|
1722
2019
|
}), /* @__PURE__ */ n("div", {
|
|
1723
|
-
className:
|
|
2020
|
+
className: tt.actions,
|
|
1724
2021
|
children: [/* @__PURE__ */ t(w, {
|
|
1725
2022
|
variant: "outline",
|
|
1726
2023
|
onClick: () => u(!1),
|
|
@@ -1732,40 +2029,40 @@ var T = {
|
|
|
1732
2029
|
})]
|
|
1733
2030
|
})]
|
|
1734
2031
|
});
|
|
1735
|
-
},
|
|
2032
|
+
}, at = ({ modalId: e, close: r, title: i = "Ошибка", message: a, closeLabel: o = "Закрыть" }) => /* @__PURE__ */ n(Ze, {
|
|
1736
2033
|
modalId: e,
|
|
1737
2034
|
title: i,
|
|
1738
2035
|
role: "alertdialog",
|
|
1739
2036
|
children: [/* @__PURE__ */ t("p", {
|
|
1740
|
-
className:
|
|
2037
|
+
className: tt.message,
|
|
1741
2038
|
children: a
|
|
1742
2039
|
}), /* @__PURE__ */ t("div", {
|
|
1743
|
-
className:
|
|
2040
|
+
className: tt.actions,
|
|
1744
2041
|
children: /* @__PURE__ */ t(w, {
|
|
1745
2042
|
onClick: r,
|
|
1746
2043
|
children: o
|
|
1747
2044
|
})
|
|
1748
2045
|
})]
|
|
1749
|
-
}),
|
|
1750
|
-
ConfirmModal:
|
|
1751
|
-
ErrorModal:
|
|
1752
|
-
}),
|
|
2046
|
+
}), ot = et({
|
|
2047
|
+
ConfirmModal: it,
|
|
2048
|
+
ErrorModal: at
|
|
2049
|
+
}), st = () => {
|
|
1753
2050
|
let e = Q((e) => e.openModal);
|
|
1754
2051
|
return (t = {}) => new Promise((n) => {
|
|
1755
|
-
|
|
1756
|
-
let r = `confirm-${
|
|
1757
|
-
|
|
2052
|
+
rt += 1;
|
|
2053
|
+
let r = `confirm-${rt}`;
|
|
2054
|
+
nt.set(r, n), e("ConfirmModal", {
|
|
1758
2055
|
...t,
|
|
1759
2056
|
requestId: r
|
|
1760
2057
|
}, { closeOnEscape: !1 });
|
|
1761
2058
|
});
|
|
1762
|
-
},
|
|
2059
|
+
}, ct = (e) => e instanceof Error ? e.message : typeof e == "string" ? e : e && typeof e == "object" && "message" in e && typeof e.message == "string" ? e.message : "Произошла неизвестная ошибка", lt = () => {
|
|
1763
2060
|
let e = Q((e) => e.openModal);
|
|
1764
2061
|
return { showError: (t, n) => e("ErrorModal", {
|
|
1765
2062
|
title: n,
|
|
1766
|
-
message:
|
|
2063
|
+
message: ct(t)
|
|
1767
2064
|
}) };
|
|
1768
|
-
},
|
|
2065
|
+
}, ut = v(() => ({})), dt = v(() => ({})), ft = () => {
|
|
1769
2066
|
let e = Q((e) => e.modals), t = Q((e) => e.openModal);
|
|
1770
2067
|
return {
|
|
1771
2068
|
openModal: (e, n = {}, r) => t(e, n, r),
|
|
@@ -1775,12 +2072,37 @@ var T = {
|
|
|
1775
2072
|
isOpen: (t) => e.some((e) => e.name === t),
|
|
1776
2073
|
count: e.length
|
|
1777
2074
|
};
|
|
1778
|
-
},
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
"
|
|
1782
|
-
|
|
1783
|
-
|
|
2075
|
+
}, pt = {
|
|
2076
|
+
wrapper: "_wrapper_1qbyz_1",
|
|
2077
|
+
container: "_container_1qbyz_15",
|
|
2078
|
+
inner: "_inner_1qbyz_35",
|
|
2079
|
+
cube: "_cube_1qbyz_53",
|
|
2080
|
+
jump: "_jump_1qbyz_1",
|
|
2081
|
+
cube__inner: "_cube__inner_1qbyz_67",
|
|
2082
|
+
morph: "_morph_1qbyz_1"
|
|
2083
|
+
}, mt = () => /* @__PURE__ */ t("div", {
|
|
2084
|
+
className: pt.wrapper,
|
|
2085
|
+
children: /* @__PURE__ */ t("div", {
|
|
2086
|
+
className: pt.container,
|
|
2087
|
+
children: /* @__PURE__ */ n("div", {
|
|
2088
|
+
className: pt.inner,
|
|
2089
|
+
children: [
|
|
2090
|
+
/* @__PURE__ */ t("div", {
|
|
2091
|
+
className: pt.cube,
|
|
2092
|
+
children: /* @__PURE__ */ t("div", { className: pt.cube__inner })
|
|
2093
|
+
}),
|
|
2094
|
+
/* @__PURE__ */ t("div", {
|
|
2095
|
+
className: pt.cube,
|
|
2096
|
+
children: /* @__PURE__ */ t("div", { className: pt.cube__inner })
|
|
2097
|
+
}),
|
|
2098
|
+
/* @__PURE__ */ t("div", {
|
|
2099
|
+
className: pt.cube,
|
|
2100
|
+
children: /* @__PURE__ */ t("div", { className: pt.cube__inner })
|
|
2101
|
+
})
|
|
2102
|
+
]
|
|
2103
|
+
})
|
|
2104
|
+
})
|
|
2105
|
+
}), ht = {
|
|
1784
2106
|
viewport: "_viewport_15mi5_1",
|
|
1785
2107
|
"top-right": "_top-right_15mi5_3",
|
|
1786
2108
|
"top-left": "_top-left_15mi5_5",
|
|
@@ -1793,7 +2115,7 @@ var T = {
|
|
|
1793
2115
|
success: "_success_15mi5_19",
|
|
1794
2116
|
warning: "_warning_15mi5_21",
|
|
1795
2117
|
error: "_error_15mi5_23"
|
|
1796
|
-
},
|
|
2118
|
+
}, gt = (e) => {
|
|
1797
2119
|
let r;
|
|
1798
2120
|
return r = e === "info" ? /* @__PURE__ */ n("svg", {
|
|
1799
2121
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1879,7 +2201,7 @@ var T = {
|
|
|
1879
2201
|
/* @__PURE__ */ t("path", { d: "m9 9 6 6" })
|
|
1880
2202
|
]
|
|
1881
2203
|
}), r;
|
|
1882
|
-
},
|
|
2204
|
+
}, _t = ({ toast: e, onClose: r }) => {
|
|
1883
2205
|
let [i, a] = f(!1), o = d(e.duration), c = d(Date.now());
|
|
1884
2206
|
return s(() => {
|
|
1885
2207
|
if (i || e.duration <= 0) return;
|
|
@@ -1894,7 +2216,7 @@ var T = {
|
|
|
1894
2216
|
e.duration,
|
|
1895
2217
|
e.id
|
|
1896
2218
|
]), /* @__PURE__ */ n("article", {
|
|
1897
|
-
className: `${
|
|
2219
|
+
className: `${ht.toast} ${ht[e.variant]}`,
|
|
1898
2220
|
role: e.variant === "error" ? "alert" : "status",
|
|
1899
2221
|
"aria-live": e.variant === "error" ? "assertive" : "polite",
|
|
1900
2222
|
onMouseEnter: () => a(!0),
|
|
@@ -1902,9 +2224,9 @@ var T = {
|
|
|
1902
2224
|
onFocus: () => a(!0),
|
|
1903
2225
|
onBlur: () => a(!1),
|
|
1904
2226
|
children: [
|
|
1905
|
-
/* @__PURE__ */ t("div", { children:
|
|
2227
|
+
/* @__PURE__ */ t("div", { children: gt(e.variant) }),
|
|
1906
2228
|
/* @__PURE__ */ n("div", {
|
|
1907
|
-
className:
|
|
2229
|
+
className: ht.body,
|
|
1908
2230
|
children: [
|
|
1909
2231
|
e.title && /* @__PURE__ */ t("strong", { children: e.title }),
|
|
1910
2232
|
/* @__PURE__ */ t("div", { children: e.message }),
|
|
@@ -1938,11 +2260,11 @@ var T = {
|
|
|
1938
2260
|
})
|
|
1939
2261
|
]
|
|
1940
2262
|
});
|
|
1941
|
-
},
|
|
2263
|
+
}, vt = 0, yt = v((e) => ({
|
|
1942
2264
|
toasts: [],
|
|
1943
2265
|
showToast: (t) => {
|
|
1944
|
-
|
|
1945
|
-
let n = `ds-toast-${
|
|
2266
|
+
vt += 1;
|
|
2267
|
+
let n = `ds-toast-${vt}`;
|
|
1946
2268
|
return e((e) => ({ toasts: [...e.toasts, {
|
|
1947
2269
|
variant: "info",
|
|
1948
2270
|
duration: 5e3,
|
|
@@ -1953,18 +2275,18 @@ var T = {
|
|
|
1953
2275
|
},
|
|
1954
2276
|
removeToast: (t) => e((e) => ({ toasts: e.toasts.filter((e) => e.id !== t) })),
|
|
1955
2277
|
clearToasts: () => e({ toasts: [] })
|
|
1956
|
-
})),
|
|
1957
|
-
let n =
|
|
2278
|
+
})), bt = () => yt.setState({ toasts: [] }), xt = ({ position: e = "top-right" }) => {
|
|
2279
|
+
let n = yt((e) => e.toasts), r = yt((e) => e.removeToast);
|
|
1958
2280
|
return /* @__PURE__ */ t("div", {
|
|
1959
|
-
className: `${
|
|
2281
|
+
className: `${ht.viewport} ${ht[e]}`,
|
|
1960
2282
|
"aria-label": "Уведомления",
|
|
1961
|
-
children: n.map((e) => /* @__PURE__ */ t(
|
|
2283
|
+
children: n.map((e) => /* @__PURE__ */ t(_t, {
|
|
1962
2284
|
toast: e,
|
|
1963
2285
|
onClose: r
|
|
1964
2286
|
}, e.id))
|
|
1965
2287
|
});
|
|
1966
|
-
},
|
|
1967
|
-
let e =
|
|
2288
|
+
}, St = () => {
|
|
2289
|
+
let e = yt((e) => e.showToast), t = yt((e) => e.removeToast), n = yt((e) => e.clearToasts), r = o((t) => e({
|
|
1968
2290
|
...t,
|
|
1969
2291
|
variant: "info"
|
|
1970
2292
|
}), [e]), i = o((t) => e({
|
|
@@ -1994,7 +2316,7 @@ var T = {
|
|
|
1994
2316
|
i,
|
|
1995
2317
|
a
|
|
1996
2318
|
]);
|
|
1997
|
-
},
|
|
2319
|
+
}, Ct = {
|
|
1998
2320
|
root: "_root_s9o0g_1",
|
|
1999
2321
|
tooltip: "_tooltip_s9o0g_3",
|
|
2000
2322
|
"ds-tooltip-in": "_ds-tooltip-in_s9o0g_1",
|
|
@@ -2002,7 +2324,7 @@ var T = {
|
|
|
2002
2324
|
bottom: "_bottom_s9o0g_7",
|
|
2003
2325
|
left: "_left_s9o0g_9",
|
|
2004
2326
|
right: "_right_s9o0g_11"
|
|
2005
|
-
},
|
|
2327
|
+
}, wt = ({ content: e, children: i, placement: o = "top", delay: l = 450, disabled: u = !1, maxWidth: p = 280, className: m = "" }) => {
|
|
2006
2328
|
let h = c(), [g, _] = f(!1), v = d(null), y = () => {
|
|
2007
2329
|
u || !e || (v.current = setTimeout(() => _(!0), l));
|
|
2008
2330
|
}, b = () => {
|
|
@@ -2024,77 +2346,153 @@ var T = {
|
|
|
2024
2346
|
onBlur: b
|
|
2025
2347
|
});
|
|
2026
2348
|
return /* @__PURE__ */ n("span", {
|
|
2027
|
-
className: `${
|
|
2349
|
+
className: `${Ct.root} ${m}`,
|
|
2028
2350
|
onPointerDown: g ? b : y,
|
|
2029
2351
|
children: [x, g && /* @__PURE__ */ t("span", {
|
|
2030
2352
|
id: h,
|
|
2031
2353
|
role: "tooltip",
|
|
2032
|
-
className: `${
|
|
2354
|
+
className: `${Ct.tooltip} ${Ct[o]}`,
|
|
2033
2355
|
style: { maxWidth: p },
|
|
2034
2356
|
children: e
|
|
2035
2357
|
})]
|
|
2036
2358
|
});
|
|
2037
|
-
},
|
|
2038
|
-
root: "
|
|
2039
|
-
frame: "
|
|
2040
|
-
video: "
|
|
2041
|
-
overlay: "
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2359
|
+
}, $ = {
|
|
2360
|
+
root: "_root_3casy_1",
|
|
2361
|
+
frame: "_frame_3casy_15",
|
|
2362
|
+
video: "_video_3casy_35",
|
|
2363
|
+
overlay: "_overlay_3casy_49",
|
|
2364
|
+
state: "_state_3casy_51",
|
|
2365
|
+
loaderViewport: "_loaderViewport_3casy_89",
|
|
2366
|
+
loaderScale: "_loaderScale_3casy_101",
|
|
2367
|
+
stateIcon: "_stateIcon_3casy_115",
|
|
2368
|
+
empty: "_empty_3casy_147",
|
|
2369
|
+
error: "_error_3casy_157",
|
|
2370
|
+
caption: "_caption_3casy_167"
|
|
2371
|
+
}, Tt = () => /* @__PURE__ */ n("svg", {
|
|
2372
|
+
className: $.stateIcon,
|
|
2373
|
+
viewBox: "0 0 24 24",
|
|
2374
|
+
fill: "none",
|
|
2375
|
+
"aria-hidden": "true",
|
|
2376
|
+
children: [
|
|
2377
|
+
/* @__PURE__ */ t("circle", {
|
|
2378
|
+
cx: "12",
|
|
2379
|
+
cy: "12",
|
|
2380
|
+
r: "9",
|
|
2381
|
+
stroke: "currentColor",
|
|
2382
|
+
strokeWidth: "1.7"
|
|
2383
|
+
}),
|
|
2384
|
+
/* @__PURE__ */ t("path", {
|
|
2385
|
+
d: "M12 10.5V16",
|
|
2386
|
+
stroke: "currentColor",
|
|
2387
|
+
strokeWidth: "1.7",
|
|
2388
|
+
strokeLinecap: "round"
|
|
2389
|
+
}),
|
|
2390
|
+
/* @__PURE__ */ t("circle", {
|
|
2391
|
+
cx: "12",
|
|
2392
|
+
cy: "7.5",
|
|
2393
|
+
r: "1",
|
|
2394
|
+
fill: "currentColor"
|
|
2395
|
+
})
|
|
2396
|
+
]
|
|
2397
|
+
}), Et = () => /* @__PURE__ */ n("svg", {
|
|
2398
|
+
className: $.stateIcon,
|
|
2399
|
+
viewBox: "0 0 24 24",
|
|
2400
|
+
fill: "none",
|
|
2401
|
+
"aria-hidden": "true",
|
|
2402
|
+
children: [
|
|
2403
|
+
/* @__PURE__ */ t("path", {
|
|
2404
|
+
d: "M12 3.5L21 19H3L12 3.5Z",
|
|
2405
|
+
stroke: "currentColor",
|
|
2406
|
+
strokeWidth: "1.7",
|
|
2407
|
+
strokeLinejoin: "round"
|
|
2408
|
+
}),
|
|
2409
|
+
/* @__PURE__ */ t("path", {
|
|
2410
|
+
d: "M12 9V13.5",
|
|
2411
|
+
stroke: "currentColor",
|
|
2412
|
+
strokeWidth: "1.7",
|
|
2413
|
+
strokeLinecap: "round"
|
|
2414
|
+
}),
|
|
2415
|
+
/* @__PURE__ */ t("circle", {
|
|
2416
|
+
cx: "12",
|
|
2417
|
+
cy: "16.5",
|
|
2418
|
+
r: "1",
|
|
2419
|
+
fill: "currentColor"
|
|
2420
|
+
})
|
|
2421
|
+
]
|
|
2422
|
+
}), Dt = ({ sources: r, tracks: i = [], title: a, aspectRatio: o = "16 / 9", objectFit: c = "contain", loading: l = !1, error: u, fallback: d, className: p = "", controls: m = !0, playsInline: h = !0, ...g }) => {
|
|
2423
|
+
let [_, v] = f(!1), [y, b] = f(r.length > 0), x = r.map(({ src: e, type: t }) => `${e}:${t ?? ""}`).join("|");
|
|
2424
|
+
s(() => {
|
|
2425
|
+
v(!1), b(r.length > 0);
|
|
2426
|
+
}, [x, r.length]);
|
|
2427
|
+
let S = u ?? (_ ? "Не удалось воспроизвести видео" : void 0), C = l || y && !S && r.length > 0, w = !C && !S && r.length === 0;
|
|
2046
2428
|
return /* @__PURE__ */ n("figure", {
|
|
2047
|
-
className: `${
|
|
2429
|
+
className: `${$.root} ${p}`,
|
|
2048
2430
|
children: [/* @__PURE__ */ n("div", {
|
|
2049
|
-
className:
|
|
2050
|
-
style: { aspectRatio:
|
|
2431
|
+
className: $.frame,
|
|
2432
|
+
style: { aspectRatio: o },
|
|
2433
|
+
"aria-busy": C || void 0,
|
|
2051
2434
|
children: [
|
|
2052
|
-
!
|
|
2053
|
-
...
|
|
2054
|
-
"aria-label":
|
|
2055
|
-
controls:
|
|
2056
|
-
playsInline:
|
|
2057
|
-
className:
|
|
2058
|
-
style: { objectFit:
|
|
2435
|
+
!S && r.length > 0 && /* @__PURE__ */ n("video", {
|
|
2436
|
+
...g,
|
|
2437
|
+
"aria-label": a,
|
|
2438
|
+
controls: m,
|
|
2439
|
+
playsInline: h,
|
|
2440
|
+
className: $.video,
|
|
2441
|
+
style: { objectFit: c },
|
|
2442
|
+
onLoadStart: (e) => {
|
|
2443
|
+
b(!0), g.onLoadStart?.(e);
|
|
2444
|
+
},
|
|
2445
|
+
onLoadedData: (e) => {
|
|
2446
|
+
b(!1), g.onLoadedData?.(e);
|
|
2447
|
+
},
|
|
2448
|
+
onCanPlay: (e) => {
|
|
2449
|
+
b(!1), g.onCanPlay?.(e);
|
|
2450
|
+
},
|
|
2451
|
+
onWaiting: (e) => {
|
|
2452
|
+
b(!0), g.onWaiting?.(e);
|
|
2453
|
+
},
|
|
2454
|
+
onPlaying: (e) => {
|
|
2455
|
+
b(!1), g.onPlaying?.(e);
|
|
2456
|
+
},
|
|
2059
2457
|
onError: (e) => {
|
|
2060
|
-
|
|
2458
|
+
b(!1), v(!0), g.onError?.(e);
|
|
2061
2459
|
},
|
|
2062
|
-
children: [
|
|
2460
|
+
children: [r.map((e) => /* @__PURE__ */ t("source", { ...e }, `${e.src}-${e.type}`)), i.map((e) => /* @__PURE__ */ t("track", { ...e }, `${e.src}-${e.srcLang}`))]
|
|
2063
2461
|
}),
|
|
2064
|
-
|
|
2065
|
-
className:
|
|
2066
|
-
|
|
2462
|
+
C && /* @__PURE__ */ n("div", {
|
|
2463
|
+
className: $.overlay,
|
|
2464
|
+
role: "status",
|
|
2465
|
+
"aria-live": "polite",
|
|
2466
|
+
children: [/* @__PURE__ */ t("div", {
|
|
2467
|
+
className: $.loaderViewport,
|
|
2468
|
+
"aria-hidden": "true",
|
|
2469
|
+
children: /* @__PURE__ */ t("div", {
|
|
2470
|
+
className: $.loaderScale,
|
|
2471
|
+
children: /* @__PURE__ */ t(mt, {})
|
|
2472
|
+
})
|
|
2473
|
+
}), /* @__PURE__ */ t("span", { children: "Загрузка видео" })]
|
|
2067
2474
|
}),
|
|
2068
|
-
|
|
2069
|
-
className:
|
|
2475
|
+
w && /* @__PURE__ */ n("div", {
|
|
2476
|
+
className: `${$.state} ${$.empty}`,
|
|
2477
|
+
role: "status",
|
|
2478
|
+
children: [
|
|
2479
|
+
/* @__PURE__ */ t(Tt, {}),
|
|
2480
|
+
/* @__PURE__ */ t("strong", { children: "Видео отсутствует" }),
|
|
2481
|
+
d ?? /* @__PURE__ */ t("span", { children: "Источник видео не указан" })
|
|
2482
|
+
]
|
|
2483
|
+
}),
|
|
2484
|
+
!C && S && /* @__PURE__ */ n("div", {
|
|
2485
|
+
className: `${$.state} ${$.error}`,
|
|
2070
2486
|
role: "alert",
|
|
2071
|
-
children:
|
|
2487
|
+
children: [/* @__PURE__ */ t(Et, {}), d ?? /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("strong", { children: "Видео недоступно" }), /* @__PURE__ */ t("span", { children: S })] })]
|
|
2072
2488
|
})
|
|
2073
2489
|
]
|
|
2074
2490
|
}), /* @__PURE__ */ t("figcaption", {
|
|
2075
|
-
className:
|
|
2076
|
-
children:
|
|
2491
|
+
className: $.caption,
|
|
2492
|
+
children: a
|
|
2077
2493
|
})]
|
|
2078
2494
|
});
|
|
2079
|
-
},
|
|
2080
|
-
popup: "_popup_15ovj_1",
|
|
2081
|
-
trigger: "_trigger_15ovj_15",
|
|
2082
|
-
content: "_content_15ovj_23",
|
|
2083
|
-
top: "_top_15ovj_107",
|
|
2084
|
-
right: "_right_15ovj_141",
|
|
2085
|
-
bottom: "_bottom_15ovj_175",
|
|
2086
|
-
left: "_left_15ovj_209"
|
|
2087
|
-
}, gt = ({ content: r, children: i, placement: a = "top", disabled: o = !1 }) => o ? /* @__PURE__ */ t(e, { children: i }) : /* @__PURE__ */ n("span", {
|
|
2088
|
-
className: `${ht.popup} ${ht[a]}`,
|
|
2089
|
-
children: [/* @__PURE__ */ t("span", {
|
|
2090
|
-
className: ht.trigger,
|
|
2091
|
-
children: i
|
|
2092
|
-
}), /* @__PURE__ */ t("span", {
|
|
2093
|
-
className: ht.content,
|
|
2094
|
-
role: "tooltip",
|
|
2095
|
-
children: r
|
|
2096
|
-
})]
|
|
2097
|
-
}), $ = {
|
|
2495
|
+
}, Ot = {
|
|
2098
2496
|
root: "_root_1tdda_1",
|
|
2099
2497
|
trigger: "_trigger_1tdda_15",
|
|
2100
2498
|
heading: "_heading_1tdda_41",
|
|
@@ -2104,30 +2502,80 @@ var T = {
|
|
|
2104
2502
|
open: "_open_1tdda_91",
|
|
2105
2503
|
content: "_content_1tdda_99",
|
|
2106
2504
|
contentInner: "_contentInner_1tdda_119"
|
|
2107
|
-
},
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2505
|
+
}, kt = (e, t, n, r = 16) => {
|
|
2506
|
+
if (t > Math.max(0, n - r * 2)) {
|
|
2507
|
+
let t = e - r;
|
|
2508
|
+
return Math.abs(t) <= 1 ? {
|
|
2509
|
+
alignment: "none",
|
|
2510
|
+
delta: 0
|
|
2511
|
+
} : {
|
|
2512
|
+
alignment: "start",
|
|
2513
|
+
delta: t
|
|
2514
|
+
};
|
|
2515
|
+
}
|
|
2516
|
+
let i = e + t, a = n - r;
|
|
2517
|
+
return i > a ? {
|
|
2518
|
+
alignment: "end",
|
|
2519
|
+
delta: i - a
|
|
2520
|
+
} : e < r ? {
|
|
2521
|
+
alignment: "start",
|
|
2522
|
+
delta: e - r
|
|
2523
|
+
} : {
|
|
2524
|
+
alignment: "none",
|
|
2525
|
+
delta: 0
|
|
2526
|
+
};
|
|
2527
|
+
}, At = ({ title: e, subtitle: r, children: i, defaultOpen: a = !1, open: o, onOpenChange: l, autoScrollOnOpen: u = !0, scrollOffset: p = 16, className: m = "" }) => {
|
|
2528
|
+
let h = c(), [g, _] = f(a), v = o ?? g, y = d(null), b = d(null), x = d(v);
|
|
2529
|
+
return s(() => {
|
|
2530
|
+
let e = x.current;
|
|
2531
|
+
if (x.current = v, !v || e || !u) return;
|
|
2532
|
+
let t = y.current, n = b.current;
|
|
2533
|
+
if (!t || !n || typeof window > "u") return;
|
|
2534
|
+
let r = !1, i = () => {
|
|
2535
|
+
if (r) return;
|
|
2536
|
+
r = !0;
|
|
2537
|
+
let e = t.getBoundingClientRect(), n = kt(e.top, e.height, window.innerHeight, p);
|
|
2538
|
+
if (n.alignment === "none") return;
|
|
2539
|
+
let i = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
|
2540
|
+
window.scrollBy({
|
|
2541
|
+
top: n.delta,
|
|
2542
|
+
behavior: i ? "auto" : "smooth"
|
|
2543
|
+
});
|
|
2544
|
+
}, a = (e) => {
|
|
2545
|
+
e.target === n && e.propertyName === "grid-template-rows" && i();
|
|
2546
|
+
};
|
|
2547
|
+
n.addEventListener("transitionend", a);
|
|
2548
|
+
let o = window.setTimeout(i, 280);
|
|
2549
|
+
return () => {
|
|
2550
|
+
n.removeEventListener("transitionend", a), window.clearTimeout(o);
|
|
2551
|
+
};
|
|
2552
|
+
}, [
|
|
2553
|
+
u,
|
|
2554
|
+
v,
|
|
2555
|
+
p
|
|
2556
|
+
]), /* @__PURE__ */ n("section", {
|
|
2557
|
+
ref: y,
|
|
2558
|
+
className: `${Ot.root} ${v ? Ot.open : ""} ${m}`,
|
|
2111
2559
|
children: [/* @__PURE__ */ n("button", {
|
|
2112
2560
|
type: "button",
|
|
2113
|
-
className:
|
|
2114
|
-
"aria-expanded":
|
|
2115
|
-
"aria-controls":
|
|
2561
|
+
className: Ot.trigger,
|
|
2562
|
+
"aria-expanded": v,
|
|
2563
|
+
"aria-controls": h,
|
|
2116
2564
|
onClick: () => {
|
|
2117
|
-
let e = !
|
|
2118
|
-
o === void 0 &&
|
|
2565
|
+
let e = !v;
|
|
2566
|
+
o === void 0 && _(e), l?.(e);
|
|
2119
2567
|
},
|
|
2120
2568
|
children: [/* @__PURE__ */ n("span", {
|
|
2121
|
-
className:
|
|
2569
|
+
className: Ot.heading,
|
|
2122
2570
|
children: [/* @__PURE__ */ t("span", {
|
|
2123
|
-
className:
|
|
2571
|
+
className: Ot.title,
|
|
2124
2572
|
children: e
|
|
2125
2573
|
}), r && /* @__PURE__ */ t("span", {
|
|
2126
|
-
className:
|
|
2574
|
+
className: Ot.subtitle,
|
|
2127
2575
|
children: r
|
|
2128
2576
|
})]
|
|
2129
2577
|
}), /* @__PURE__ */ t("span", {
|
|
2130
|
-
className:
|
|
2578
|
+
className: Ot.icon,
|
|
2131
2579
|
"aria-hidden": "true",
|
|
2132
2580
|
children: /* @__PURE__ */ t("svg", {
|
|
2133
2581
|
viewBox: "0 0 20 20",
|
|
@@ -2142,16 +2590,17 @@ var T = {
|
|
|
2142
2590
|
})
|
|
2143
2591
|
})]
|
|
2144
2592
|
}), /* @__PURE__ */ t("div", {
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2593
|
+
ref: b,
|
|
2594
|
+
id: h,
|
|
2595
|
+
className: Ot.content,
|
|
2596
|
+
"aria-hidden": !v,
|
|
2148
2597
|
children: /* @__PURE__ */ t("div", {
|
|
2149
|
-
className:
|
|
2598
|
+
className: Ot.contentInner,
|
|
2150
2599
|
children: i
|
|
2151
2600
|
})
|
|
2152
2601
|
})]
|
|
2153
2602
|
});
|
|
2154
|
-
},
|
|
2603
|
+
}, jt = ({ children: e, containerId: t = "overlay-root" }) => {
|
|
2155
2604
|
let [n, r] = f(null);
|
|
2156
2605
|
return s(() => {
|
|
2157
2606
|
let e = document.getElementById(t);
|
|
@@ -2166,4 +2615,4 @@ var T = {
|
|
|
2166
2615
|
}, [t]), n ? p(e, n) : null;
|
|
2167
2616
|
};
|
|
2168
2617
|
//#endregion
|
|
2169
|
-
export {
|
|
2618
|
+
export { it as ConfirmModal, At as DSAccordion, b as DSBadge, w as DSButton, O as DSCheckbox, Se as DSDataTable, te as DSDateRange, H as DSDateTimePicker, oe as DSDropDown, De as DSDropDownMultiple, ee as DSFieldLabel, E as DSFieldMessage, Ke as DSFileInput, He as DSFilters, ue as DSIcon, Re as DSInfoBlock, ke as DSInput, S as DSLoader, Qe as DSModal, Ze as DSModalFrame, mt as DSPageLoader, jt as DSPortal, Be as DSRadioButton, Ie as DSSearchDropDown, K as DSSkeleton, ce as DSSort, _t as DSToast, xt as DSToastProvider, wt as DSTooltip, Dt as DSVideoPlayerFrame, at as ErrorModal, $e as ModalSystemProvider, ot as builtInModalRegistry, et as defineModalRegistry, P as formatDateTimeLocalValue, kt as getDSAccordionScrollTarget, fe as getDSDataTablePaginationItems, ct as getErrorMessage, ie as getNextEnabledOptionIndex, W as isValidDateRange, F as parseDateTimeLocalValue, Je as resetModalStore, bt as resetToastStore, st as useConfirmModal, ut as useConfirmModalStore, lt as useErrorModal, dt as useErrorModalStore, ft as useModals, Q as useModalsStore, St as useToast, yt as useToastStore, pe as validateDSDataTableData };
|