@efficiency-point/design-system 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/DSFileInput/DSFileInput.d.ts +30 -0
- package/dist/components/DSFileInput/DSFileInput.d.ts.map +1 -0
- package/dist/components/DSInput/DSInput.d.ts +3 -0
- package/dist/components/DSInput/DSInput.d.ts.map +1 -1
- package/dist/components/DSToast/useToast.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +534 -362
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
-
import { cloneElement as r, forwardRef as i, isValidElement as a,
|
|
3
|
-
import { createColumnHelper as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { create as
|
|
6
|
-
var
|
|
2
|
+
import { cloneElement as r, forwardRef as i, isValidElement as a, useCallback as o, useEffect as s, useId as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
3
|
+
import { createColumnHelper as f, createSortedRowModel as p, rowSortingFeature as m, tableFeatures as h, useTable as g } from "@tanstack/react-table";
|
|
4
|
+
import { createPortal as _ } from "react-dom";
|
|
5
|
+
import { create as v } from "zustand";
|
|
6
|
+
var y = {
|
|
7
7
|
badge: "_badge_l4qbw_1",
|
|
8
8
|
sm: "_sm_l4qbw_2",
|
|
9
9
|
md: "_md_l4qbw_3",
|
|
@@ -15,36 +15,36 @@ var v = {
|
|
|
15
15
|
dot: "_dot_l4qbw_9",
|
|
16
16
|
icon: "_icon_l4qbw_10",
|
|
17
17
|
label: "_label_l4qbw_11"
|
|
18
|
-
},
|
|
19
|
-
className: `${
|
|
18
|
+
}, b = ({ children: e, variant: r = "neutral", size: i = "md", dot: a = !1, icon: o, className: s = "" }) => /* @__PURE__ */ n("span", {
|
|
19
|
+
className: `${y.badge} ${y[r]} ${y[i]} ${s}`,
|
|
20
20
|
children: [
|
|
21
21
|
a && /* @__PURE__ */ t("span", {
|
|
22
|
-
className:
|
|
22
|
+
className: y.dot,
|
|
23
23
|
"aria-hidden": "true"
|
|
24
24
|
}),
|
|
25
25
|
o && /* @__PURE__ */ t("span", {
|
|
26
|
-
className:
|
|
26
|
+
className: y.icon,
|
|
27
27
|
"aria-hidden": "true",
|
|
28
28
|
children: o
|
|
29
29
|
}),
|
|
30
30
|
/* @__PURE__ */ t("span", {
|
|
31
|
-
className:
|
|
31
|
+
className: y.label,
|
|
32
32
|
children: e
|
|
33
33
|
})
|
|
34
34
|
]
|
|
35
|
-
}),
|
|
35
|
+
}), x = {
|
|
36
36
|
loader: "_loader_pslm9_1",
|
|
37
37
|
"ds-spin": "_ds-spin_pslm9_1",
|
|
38
38
|
primary: "_primary_pslm9_11",
|
|
39
39
|
secondary: "_secondary_pslm9_12",
|
|
40
40
|
light: "_light_pslm9_13",
|
|
41
41
|
danger: "_danger_pslm9_14"
|
|
42
|
-
},
|
|
43
|
-
className: `${
|
|
42
|
+
}, S = ({ variant: e = "primary", label: n = "Загрузка", className: r = "", decorative: i = !1 }) => /* @__PURE__ */ t("span", {
|
|
43
|
+
className: `${x.loader} ${x[e]} ${r}`,
|
|
44
44
|
role: i ? void 0 : "status",
|
|
45
45
|
"aria-label": i ? void 0 : n,
|
|
46
46
|
"aria-hidden": i || void 0
|
|
47
|
-
}),
|
|
47
|
+
}), C = {
|
|
48
48
|
button: "_button_higub_1",
|
|
49
49
|
sm: "_sm_higub_16",
|
|
50
50
|
md: "_md_higub_17",
|
|
@@ -56,20 +56,20 @@ var v = {
|
|
|
56
56
|
empty: "_empty_higub_29",
|
|
57
57
|
destructive: "_destructive_higub_34",
|
|
58
58
|
destructiveOutline: "_destructiveOutline_higub_35"
|
|
59
|
-
},
|
|
59
|
+
}, w = i(({ children: e, variant: n = "primary", size: r = "md", isLoading: i = !1, loadingLabel: a = "Загрузка", disabled: o, type: s = "button", className: c = "", ...l }, u) => /* @__PURE__ */ t("button", {
|
|
60
60
|
ref: u,
|
|
61
61
|
type: s,
|
|
62
|
-
className: `${
|
|
62
|
+
className: `${C.button} ${C[n]} ${C[r]} ${c}`,
|
|
63
63
|
disabled: o || i,
|
|
64
64
|
"aria-busy": i || void 0,
|
|
65
65
|
...l,
|
|
66
|
-
children: i ? /* @__PURE__ */ t(
|
|
66
|
+
children: i ? /* @__PURE__ */ t(S, {
|
|
67
67
|
variant: "light",
|
|
68
68
|
label: a
|
|
69
69
|
}) : e
|
|
70
70
|
}));
|
|
71
|
-
|
|
72
|
-
var
|
|
71
|
+
w.displayName = "DSButton";
|
|
72
|
+
var T = {
|
|
73
73
|
label: "_label_5v0ym_1",
|
|
74
74
|
required: "_required_5v0ym_12",
|
|
75
75
|
error: "_error_5v0ym_13",
|
|
@@ -78,43 +78,43 @@ var w = {
|
|
|
78
78
|
disabled: "_disabled_5v0ym_24",
|
|
79
79
|
message: "_message_5v0ym_28",
|
|
80
80
|
success: "_success_5v0ym_36"
|
|
81
|
-
},
|
|
82
|
-
className: `${
|
|
81
|
+
}, E = ({ children: e, required: r = !1, optionalText: i, disabled: a = !1, className: o = "", ...s }) => /* @__PURE__ */ n("label", {
|
|
82
|
+
className: `${T.label} ${a ? T.disabled : ""} ${o}`,
|
|
83
83
|
...s,
|
|
84
84
|
children: [
|
|
85
85
|
/* @__PURE__ */ t("span", { children: e }),
|
|
86
86
|
r && /* @__PURE__ */ t("span", {
|
|
87
|
-
className:
|
|
87
|
+
className: T.required,
|
|
88
88
|
"aria-hidden": "true",
|
|
89
89
|
children: "*"
|
|
90
90
|
}),
|
|
91
91
|
i && /* @__PURE__ */ t("span", {
|
|
92
|
-
className:
|
|
92
|
+
className: T.optional,
|
|
93
93
|
children: i
|
|
94
94
|
})
|
|
95
95
|
]
|
|
96
|
-
}),
|
|
96
|
+
}), D = ({ children: e, variant: n = "hint", id: r, live: i = !1, className: a = "" }) => /* @__PURE__ */ t("span", {
|
|
97
97
|
id: r,
|
|
98
|
-
className: `${
|
|
98
|
+
className: `${T.message} ${T[n]} ${a}`,
|
|
99
99
|
role: i && n === "error" ? "alert" : void 0,
|
|
100
100
|
"aria-live": i && n !== "error" ? "polite" : void 0,
|
|
101
101
|
children: e
|
|
102
|
-
}),
|
|
102
|
+
}), O = {
|
|
103
103
|
wrapper: "_wrapper_1l5cg_1",
|
|
104
104
|
label: "_label_1l5cg_2",
|
|
105
105
|
input: "_input_1l5cg_3",
|
|
106
106
|
control: "_control_1l5cg_4",
|
|
107
107
|
disabled: "_disabled_1l5cg_7",
|
|
108
108
|
controlError: "_controlError_1l5cg_9"
|
|
109
|
-
},
|
|
110
|
-
let _ =
|
|
111
|
-
return
|
|
109
|
+
}, k = ({ checked: e, onChange: r, label: i, hint: a, error: o, disabled: l = !1, readOnly: d = !1, className: f = "", name: p, id: m, indeterminate: h = !1, ...g }) => {
|
|
110
|
+
let _ = c(), v = m ?? `ds-checkbox-${p ?? _}`, y = u(null), b = a ? `${v}-hint` : void 0, x = o ? `${v}-error` : void 0;
|
|
111
|
+
return s(() => {
|
|
112
112
|
y.current && (y.current.indeterminate = h && !e);
|
|
113
113
|
}, [e, h]), /* @__PURE__ */ n("div", {
|
|
114
|
-
className: `${
|
|
114
|
+
className: `${O.wrapper} ${f}`,
|
|
115
115
|
children: [
|
|
116
116
|
/* @__PURE__ */ n("label", {
|
|
117
|
-
className: `${
|
|
117
|
+
className: `${O.label} ${l ? O.disabled : ""}`,
|
|
118
118
|
htmlFor: v,
|
|
119
119
|
children: [
|
|
120
120
|
/* @__PURE__ */ t("input", {
|
|
@@ -123,36 +123,36 @@ var w = {
|
|
|
123
123
|
name: p,
|
|
124
124
|
type: "checkbox",
|
|
125
125
|
checked: e,
|
|
126
|
-
disabled:
|
|
126
|
+
disabled: l,
|
|
127
127
|
"aria-readonly": d || void 0,
|
|
128
|
-
"aria-invalid": !!
|
|
128
|
+
"aria-invalid": !!o,
|
|
129
129
|
"aria-describedby": [b, x].filter(Boolean).join(" ") || void 0,
|
|
130
|
-
className:
|
|
130
|
+
className: O.input,
|
|
131
131
|
onChange: (e) => {
|
|
132
132
|
d || r?.(e.target.checked, e);
|
|
133
133
|
},
|
|
134
134
|
...g
|
|
135
135
|
}),
|
|
136
136
|
/* @__PURE__ */ t("span", {
|
|
137
|
-
className: `${
|
|
137
|
+
className: `${O.control} ${o ? O.controlError : ""}`,
|
|
138
138
|
"aria-hidden": "true",
|
|
139
139
|
children: h && !e ? "−" : e ? "✓" : ""
|
|
140
140
|
}),
|
|
141
141
|
i && /* @__PURE__ */ t("span", { children: i })
|
|
142
142
|
]
|
|
143
143
|
}),
|
|
144
|
-
a && !
|
|
144
|
+
a && !o && /* @__PURE__ */ t(D, {
|
|
145
145
|
id: b,
|
|
146
146
|
children: a
|
|
147
147
|
}),
|
|
148
|
-
|
|
148
|
+
o && /* @__PURE__ */ t(D, {
|
|
149
149
|
id: x,
|
|
150
150
|
variant: "error",
|
|
151
|
-
children:
|
|
151
|
+
children: o
|
|
152
152
|
})
|
|
153
153
|
]
|
|
154
154
|
});
|
|
155
|
-
},
|
|
155
|
+
}, A = {
|
|
156
156
|
wrapper: "_wrapper_phf7i_1",
|
|
157
157
|
trigger: "_trigger_phf7i_9",
|
|
158
158
|
nav: "_nav_phf7i_27",
|
|
@@ -170,7 +170,7 @@ var w = {
|
|
|
170
170
|
outside: "_outside_phf7i_132",
|
|
171
171
|
selected: "_selected_phf7i_136",
|
|
172
172
|
timeLabel: "_timeLabel_phf7i_146"
|
|
173
|
-
},
|
|
173
|
+
}, j = [
|
|
174
174
|
"Пн",
|
|
175
175
|
"Вт",
|
|
176
176
|
"Ср",
|
|
@@ -178,7 +178,7 @@ var w = {
|
|
|
178
178
|
"Пт",
|
|
179
179
|
"Сб",
|
|
180
180
|
"Вс"
|
|
181
|
-
],
|
|
181
|
+
], M = [
|
|
182
182
|
"Январь",
|
|
183
183
|
"Февраль",
|
|
184
184
|
"Март",
|
|
@@ -191,11 +191,11 @@ var w = {
|
|
|
191
191
|
"Октябрь",
|
|
192
192
|
"Ноябрь",
|
|
193
193
|
"Декабрь"
|
|
194
|
-
],
|
|
194
|
+
], N = (e) => String(e).padStart(2, "0"), P = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), F = (e, t) => {
|
|
195
195
|
if (!e) return "";
|
|
196
|
-
let n = `${e.getFullYear()}-${
|
|
196
|
+
let n = `${e.getFullYear()}-${N(e.getMonth() + 1)}-${N(e.getDate())}`, r = `${N(e.getHours())}:${N(e.getMinutes())}`;
|
|
197
197
|
return t === "date" ? n : t === "time" ? r : `${n}T${r}`;
|
|
198
|
-
},
|
|
198
|
+
}, I = (e, t) => {
|
|
199
199
|
if (!e) return null;
|
|
200
200
|
if (t === "time") {
|
|
201
201
|
let t = /^(\d{2}):(\d{2})$/.exec(e);
|
|
@@ -207,173 +207,173 @@ var w = {
|
|
|
207
207
|
}
|
|
208
208
|
let n = new Date(t === "date" ? `${e}T00:00` : e);
|
|
209
209
|
return Number.isNaN(n.getTime()) ? null : n;
|
|
210
|
-
},
|
|
210
|
+
}, L = (e, t) => {
|
|
211
211
|
if (!e) return "";
|
|
212
|
-
let n = `${
|
|
212
|
+
let n = `${N(e.getDate())}.${N(e.getMonth() + 1)}.${e.getFullYear()}`, r = `${N(e.getHours())}:${N(e.getMinutes())}`;
|
|
213
213
|
return t === "date" ? n : t === "time" ? r : `${n} ${r}`;
|
|
214
|
-
},
|
|
214
|
+
}, ee = (e) => {
|
|
215
215
|
let t = new Date(e.getFullYear(), e.getMonth(), 1), n = (t.getDay() + 6) % 7, r = new Date(t);
|
|
216
216
|
return r.setDate(t.getDate() - n), Array.from({ length: 42 }, (e, t) => {
|
|
217
217
|
let n = new Date(r);
|
|
218
218
|
return n.setDate(r.getDate() + t), n;
|
|
219
219
|
});
|
|
220
|
-
},
|
|
221
|
-
let r =
|
|
222
|
-
return !!(t && r <
|
|
223
|
-
},
|
|
224
|
-
let C =
|
|
225
|
-
|
|
226
|
-
r &&
|
|
227
|
-
}, [r]),
|
|
220
|
+
}, te = (e, t) => !!(e && e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate()), ne = (e, t, n) => {
|
|
221
|
+
let r = P(e).getTime();
|
|
222
|
+
return !!(t && r < P(t).getTime() || n && r > P(n).getTime());
|
|
223
|
+
}, R = ({ value: r, onChange: i, mode: a = "date", label: o, placeholder: f, hint: p, error: m, disabled: h = !1, readOnly: g = !1, required: _ = !1, min: v, max: y, id: b, name: x, className: S = "" }) => {
|
|
224
|
+
let C = c(), w = b ?? `ds-date-time-${x ?? C}`, T = p ? `${w}-hint` : void 0, O = m ? `${w}-error` : void 0, k = u(null), N = u(null), [P, R] = d(!1), [z, B] = d(r ?? /* @__PURE__ */ new Date()), [re, V] = d(F(r, "time")), ie = l(() => ee(z), [z]), H = a !== "time", ae = a !== "date";
|
|
225
|
+
s(() => {
|
|
226
|
+
r && B(r), V(F(r, "time"));
|
|
227
|
+
}, [r]), s(() => {
|
|
228
228
|
let e = (e) => {
|
|
229
|
-
|
|
229
|
+
k.current?.contains(e.target) || R(!1);
|
|
230
230
|
}, t = (e) => {
|
|
231
|
-
e.key === "Escape" && (
|
|
231
|
+
e.key === "Escape" && (R(!1), N.current?.focus());
|
|
232
232
|
};
|
|
233
233
|
return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
|
|
234
234
|
document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
|
|
235
235
|
};
|
|
236
236
|
}, []);
|
|
237
|
-
let
|
|
238
|
-
if (
|
|
237
|
+
let U = (e) => {
|
|
238
|
+
if (ne(e, v, y)) return;
|
|
239
239
|
let t = new Date(e);
|
|
240
|
-
t.setHours(r?.getHours() ?? 0, r?.getMinutes() ?? 0, 0, 0), i?.(t), a === "date" &&
|
|
240
|
+
t.setHours(r?.getHours() ?? 0, r?.getMinutes() ?? 0, 0, 0), i?.(t), a === "date" && R(!1);
|
|
241
241
|
}, oe = (e) => {
|
|
242
|
-
if (
|
|
242
|
+
if (V(e), !e) {
|
|
243
243
|
i?.(null);
|
|
244
244
|
return;
|
|
245
245
|
}
|
|
246
|
-
let t =
|
|
246
|
+
let t = I(e, "time");
|
|
247
247
|
if (!t) return;
|
|
248
|
-
let n = new Date(a === "datetime" ? r ??
|
|
248
|
+
let n = new Date(a === "datetime" ? r ?? z : /* @__PURE__ */ new Date());
|
|
249
249
|
n.setHours(t.getHours(), t.getMinutes(), 0, 0), !(v && n < v || y && n > y) && i?.(n);
|
|
250
|
-
},
|
|
250
|
+
}, se = f ?? (a === "date" ? "Выберите дату" : a === "time" ? "Введите время" : "Выберите дату и время"), W = [T, O].filter(Boolean).join(" ") || void 0;
|
|
251
251
|
return /* @__PURE__ */ n("div", {
|
|
252
|
-
ref:
|
|
253
|
-
className: `${
|
|
252
|
+
ref: k,
|
|
253
|
+
className: `${A.wrapper} ${S}`,
|
|
254
254
|
children: [
|
|
255
|
-
|
|
255
|
+
o && /* @__PURE__ */ t(E, {
|
|
256
256
|
htmlFor: w,
|
|
257
257
|
required: _,
|
|
258
258
|
disabled: h,
|
|
259
|
-
children:
|
|
259
|
+
children: o
|
|
260
260
|
}),
|
|
261
261
|
/* @__PURE__ */ n("button", {
|
|
262
262
|
ref: N,
|
|
263
263
|
id: w,
|
|
264
264
|
name: x,
|
|
265
265
|
type: "button",
|
|
266
|
-
className: `${
|
|
266
|
+
className: `${A.trigger} ${m ? A.error : ""}`,
|
|
267
267
|
disabled: h,
|
|
268
268
|
"aria-readonly": g || void 0,
|
|
269
|
-
"aria-expanded":
|
|
269
|
+
"aria-expanded": P,
|
|
270
270
|
"aria-haspopup": "dialog",
|
|
271
|
-
"aria-describedby":
|
|
271
|
+
"aria-describedby": W,
|
|
272
272
|
onClick: () => {
|
|
273
|
-
g ||
|
|
273
|
+
g || R((e) => !e);
|
|
274
274
|
},
|
|
275
275
|
children: [/* @__PURE__ */ t("span", {
|
|
276
|
-
className: r ?
|
|
277
|
-
children:
|
|
276
|
+
className: r ? A.value : A.placeholder,
|
|
277
|
+
children: L(r, a) || se
|
|
278
278
|
}), /* @__PURE__ */ t("span", {
|
|
279
279
|
"aria-hidden": "true",
|
|
280
280
|
children: "▾"
|
|
281
281
|
})]
|
|
282
282
|
}),
|
|
283
|
-
|
|
284
|
-
className:
|
|
283
|
+
P && !g && /* @__PURE__ */ n("div", {
|
|
284
|
+
className: A.panel,
|
|
285
285
|
role: "dialog",
|
|
286
|
-
"aria-label":
|
|
286
|
+
"aria-label": o ?? se,
|
|
287
287
|
children: [H && /* @__PURE__ */ n(e, { children: [
|
|
288
288
|
/* @__PURE__ */ n("div", {
|
|
289
|
-
className:
|
|
289
|
+
className: A.calendarHeader,
|
|
290
290
|
children: [
|
|
291
291
|
/* @__PURE__ */ t("button", {
|
|
292
292
|
type: "button",
|
|
293
|
-
className:
|
|
293
|
+
className: A.nav,
|
|
294
294
|
"aria-label": "Предыдущий месяц",
|
|
295
|
-
onClick: () =>
|
|
295
|
+
onClick: () => B(new Date(z.getFullYear(), z.getMonth() - 1, 1)),
|
|
296
296
|
children: "‹"
|
|
297
297
|
}),
|
|
298
298
|
/* @__PURE__ */ t("select", {
|
|
299
|
-
className:
|
|
299
|
+
className: A.monthSelect,
|
|
300
300
|
"aria-label": "Месяц",
|
|
301
|
-
value:
|
|
302
|
-
onChange: (e) =>
|
|
303
|
-
children:
|
|
301
|
+
value: z.getMonth(),
|
|
302
|
+
onChange: (e) => B(new Date(z.getFullYear(), Number(e.target.value), 1)),
|
|
303
|
+
children: M.map((e, n) => /* @__PURE__ */ t("option", {
|
|
304
304
|
value: n,
|
|
305
305
|
children: e
|
|
306
306
|
}, e))
|
|
307
307
|
}),
|
|
308
308
|
/* @__PURE__ */ t("input", {
|
|
309
|
-
className:
|
|
309
|
+
className: A.yearInput,
|
|
310
310
|
type: "number",
|
|
311
311
|
"aria-label": "Год",
|
|
312
|
-
value:
|
|
313
|
-
onChange: (e) =>
|
|
312
|
+
value: z.getFullYear(),
|
|
313
|
+
onChange: (e) => B(new Date(Number(e.target.value), z.getMonth(), 1))
|
|
314
314
|
}),
|
|
315
315
|
/* @__PURE__ */ t("button", {
|
|
316
316
|
type: "button",
|
|
317
|
-
className:
|
|
317
|
+
className: A.nav,
|
|
318
318
|
"aria-label": "Следующий месяц",
|
|
319
|
-
onClick: () =>
|
|
319
|
+
onClick: () => B(new Date(z.getFullYear(), z.getMonth() + 1, 1)),
|
|
320
320
|
children: "›"
|
|
321
321
|
})
|
|
322
322
|
]
|
|
323
323
|
}),
|
|
324
324
|
/* @__PURE__ */ t("div", {
|
|
325
|
-
className:
|
|
326
|
-
children:
|
|
325
|
+
className: A.weekdays,
|
|
326
|
+
children: j.map((e) => /* @__PURE__ */ t("span", { children: e }, e))
|
|
327
327
|
}),
|
|
328
328
|
/* @__PURE__ */ t("div", {
|
|
329
|
-
className:
|
|
330
|
-
children:
|
|
331
|
-
let n =
|
|
329
|
+
className: A.days,
|
|
330
|
+
children: ie.map((e) => {
|
|
331
|
+
let n = te(r, e);
|
|
332
332
|
return /* @__PURE__ */ t("button", {
|
|
333
333
|
type: "button",
|
|
334
|
-
className: `${
|
|
335
|
-
disabled:
|
|
334
|
+
className: `${A.day} ${e.getMonth() === z.getMonth() ? "" : A.outside} ${n ? A.selected : ""}`,
|
|
335
|
+
disabled: ne(e, v, y),
|
|
336
336
|
"aria-pressed": n,
|
|
337
|
-
onClick: () =>
|
|
337
|
+
onClick: () => U(e),
|
|
338
338
|
children: e.getDate()
|
|
339
339
|
}, e.toISOString());
|
|
340
340
|
})
|
|
341
341
|
})
|
|
342
|
-
] }),
|
|
343
|
-
className:
|
|
342
|
+
] }), ae && /* @__PURE__ */ n("label", {
|
|
343
|
+
className: A.timeLabel,
|
|
344
344
|
children: [/* @__PURE__ */ t("span", { children: "Время" }), /* @__PURE__ */ t("input", {
|
|
345
|
-
className:
|
|
345
|
+
className: A.timeInput,
|
|
346
346
|
type: "time",
|
|
347
|
-
value:
|
|
347
|
+
value: re,
|
|
348
348
|
onChange: (e) => oe(e.target.value)
|
|
349
349
|
})]
|
|
350
350
|
})]
|
|
351
351
|
}),
|
|
352
|
-
p && !m && /* @__PURE__ */ t(
|
|
353
|
-
id:
|
|
352
|
+
p && !m && /* @__PURE__ */ t(D, {
|
|
353
|
+
id: T,
|
|
354
354
|
children: p
|
|
355
355
|
}),
|
|
356
|
-
m && /* @__PURE__ */ t(
|
|
356
|
+
m && /* @__PURE__ */ t(D, {
|
|
357
357
|
id: O,
|
|
358
358
|
variant: "error",
|
|
359
359
|
children: m
|
|
360
360
|
})
|
|
361
361
|
]
|
|
362
362
|
});
|
|
363
|
-
},
|
|
363
|
+
}, z = {
|
|
364
364
|
root: "_root_9h2e2_1",
|
|
365
365
|
legend: "_legend_9h2e2_2",
|
|
366
366
|
range: "_range_9h2e2_3"
|
|
367
|
-
},
|
|
367
|
+
}, B = (e) => !!(e.from && e.to && e.from.getTime() <= e.to.getTime()), re = ({ value: e, onChange: r, onDraftChange: i, mode: a = "date", fromLabel: o = "От", toLabel: s = "До", hint: c, error: l, min: u, max: d, disabled: f = !1, readOnly: p = !1, required: m = !1, className: h = "" }) => {
|
|
368
368
|
let g = l ?? (e.from && e.to && e.from > e.to ? "Дата «От» не может быть позже даты «До»" : void 0), _ = (e) => {
|
|
369
|
-
i?.(e),
|
|
369
|
+
i?.(e), B(e) && r?.(e);
|
|
370
370
|
};
|
|
371
371
|
return /* @__PURE__ */ n("fieldset", {
|
|
372
|
-
className: `${
|
|
372
|
+
className: `${z.root} ${h}`,
|
|
373
373
|
disabled: f,
|
|
374
374
|
children: [/* @__PURE__ */ n("div", {
|
|
375
|
-
className:
|
|
376
|
-
children: [/* @__PURE__ */ t(
|
|
375
|
+
className: z.range,
|
|
376
|
+
children: [/* @__PURE__ */ t(R, {
|
|
377
377
|
value: e.from,
|
|
378
378
|
mode: a === "datetime" ? "datetime" : a,
|
|
379
379
|
label: o,
|
|
@@ -387,7 +387,7 @@ var w = {
|
|
|
387
387
|
...e,
|
|
388
388
|
from: t
|
|
389
389
|
})
|
|
390
|
-
}), /* @__PURE__ */ t(
|
|
390
|
+
}), /* @__PURE__ */ t(R, {
|
|
391
391
|
value: e.to,
|
|
392
392
|
mode: a === "datetime" ? "datetime" : a,
|
|
393
393
|
label: s,
|
|
@@ -402,9 +402,9 @@ var w = {
|
|
|
402
402
|
to: t
|
|
403
403
|
})
|
|
404
404
|
})]
|
|
405
|
-
}), c && !g && /* @__PURE__ */ t(
|
|
405
|
+
}), c && !g && /* @__PURE__ */ t(D, { children: c })]
|
|
406
406
|
});
|
|
407
|
-
},
|
|
407
|
+
}, V = {
|
|
408
408
|
group: "_group_1st6r_1",
|
|
409
409
|
skeleton: "_skeleton_1st6r_2",
|
|
410
410
|
text: "_text_1st6r_3",
|
|
@@ -412,17 +412,17 @@ var w = {
|
|
|
412
412
|
circular: "_circular_1st6r_5",
|
|
413
413
|
animated: "_animated_1st6r_6",
|
|
414
414
|
"ds-skeleton": "_ds-skeleton_1st6r_1"
|
|
415
|
-
},
|
|
416
|
-
className: `${
|
|
415
|
+
}, ie = ({ variant: e = "text", width: n = "100%", height: r, lines: i = 1, animated: a = !0, className: o = "" }) => /* @__PURE__ */ t("span", {
|
|
416
|
+
className: `${V.group} ${o}`,
|
|
417
417
|
"aria-hidden": "true",
|
|
418
418
|
children: Array.from({ length: Math.max(1, i) }, (o, s) => /* @__PURE__ */ t("span", {
|
|
419
|
-
className: `${
|
|
419
|
+
className: `${V.skeleton} ${V[e]} ${a ? V.animated : ""}`,
|
|
420
420
|
style: {
|
|
421
421
|
width: s === i - 1 && i > 1 ? "70%" : n,
|
|
422
422
|
height: r
|
|
423
423
|
}
|
|
424
424
|
}, s))
|
|
425
|
-
}),
|
|
425
|
+
}), H = {
|
|
426
426
|
wrapper: "_wrapper_dkn63_1",
|
|
427
427
|
label: "_label_dkn63_17",
|
|
428
428
|
container: "_container_dkn63_29",
|
|
@@ -438,15 +438,15 @@ var w = {
|
|
|
438
438
|
message: "_message_dkn63_265",
|
|
439
439
|
error: "_error_dkn63_267",
|
|
440
440
|
errorState: "_errorState_dkn63_293"
|
|
441
|
-
},
|
|
441
|
+
}, ae = (e, t, n) => {
|
|
442
442
|
for (let r = 0; r < e.length; r += 1) {
|
|
443
443
|
let i = (t + r * n + e.length) % e.length;
|
|
444
444
|
if (!e[i]?.disabled) return i;
|
|
445
445
|
}
|
|
446
446
|
return -1;
|
|
447
|
-
}, U = ({ options: r, value: i, onChange: a, placeholder:
|
|
448
|
-
let S =
|
|
449
|
-
|
|
447
|
+
}, U = ({ options: r, value: i, onChange: a, placeholder: o = "Выберите опцию", disabled: f = !1, stringWhileDisabled: p = !1, label: m, error: h, hint: g, className: _ = "", name: v, id: y, needMark: b = !0, maxMenuHeight: x }) => {
|
|
448
|
+
let S = c(), C = y ?? `ds-dropdown-${v ?? S}`, [w, T] = d(!1), E = u(null), D = u(null), O = u([]), k = l(() => r.find((e) => e.value === i), [r, i]), A = g ? `${C}-hint` : void 0, j = h ? `${C}-error` : void 0, M = [A, j].filter(Boolean).join(" ") || void 0, N = f && p;
|
|
449
|
+
s(() => {
|
|
450
450
|
let e = (e) => {
|
|
451
451
|
E.current?.contains(e.target) || T(!1);
|
|
452
452
|
}, t = (e) => {
|
|
@@ -457,37 +457,37 @@ var w = {
|
|
|
457
457
|
};
|
|
458
458
|
}, [w]);
|
|
459
459
|
let P = (e, t) => {
|
|
460
|
-
let n =
|
|
460
|
+
let n = ae(r, e, t);
|
|
461
461
|
O.current[n]?.focus(), O.current[n]?.scrollIntoView({ block: "nearest" });
|
|
462
|
-
},
|
|
462
|
+
}, F = (e) => {
|
|
463
463
|
e.disabled || (a?.(e.value, e), T(!1), D.current?.focus());
|
|
464
464
|
};
|
|
465
465
|
return /* @__PURE__ */ n("div", {
|
|
466
466
|
ref: E,
|
|
467
467
|
className: [
|
|
468
|
-
|
|
469
|
-
h ?
|
|
468
|
+
H.wrapper,
|
|
469
|
+
h ? H.errorState : "",
|
|
470
470
|
_
|
|
471
471
|
].filter(Boolean).join(" "),
|
|
472
472
|
children: [
|
|
473
473
|
m && /* @__PURE__ */ t("label", {
|
|
474
474
|
htmlFor: N ? void 0 : C,
|
|
475
|
-
className:
|
|
475
|
+
className: H.label,
|
|
476
476
|
children: m
|
|
477
477
|
}),
|
|
478
478
|
/* @__PURE__ */ t("div", {
|
|
479
|
-
className:
|
|
479
|
+
className: H.container,
|
|
480
480
|
children: N ? /* @__PURE__ */ t("div", {
|
|
481
481
|
id: C,
|
|
482
|
-
className:
|
|
482
|
+
className: H.disabledText,
|
|
483
483
|
"aria-describedby": M,
|
|
484
|
-
children: k?.label ??
|
|
484
|
+
children: k?.label ?? o
|
|
485
485
|
}) : /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ n("button", {
|
|
486
486
|
ref: D,
|
|
487
487
|
id: C,
|
|
488
488
|
type: "button",
|
|
489
489
|
name: v,
|
|
490
|
-
className:
|
|
490
|
+
className: H.trigger,
|
|
491
491
|
disabled: f,
|
|
492
492
|
"aria-haspopup": "listbox",
|
|
493
493
|
"aria-expanded": w,
|
|
@@ -503,10 +503,10 @@ var w = {
|
|
|
503
503
|
}
|
|
504
504
|
},
|
|
505
505
|
children: [/* @__PURE__ */ t("span", {
|
|
506
|
-
className: k ?
|
|
507
|
-
children: k?.label ??
|
|
506
|
+
className: k ? H.value : H.placeholder,
|
|
507
|
+
children: k?.label ?? o
|
|
508
508
|
}), /* @__PURE__ */ t("span", {
|
|
509
|
-
className: `${
|
|
509
|
+
className: `${H.chevron} ${w ? H.chevronOpen : ""}`,
|
|
510
510
|
"aria-hidden": "true",
|
|
511
511
|
children: /* @__PURE__ */ t("svg", {
|
|
512
512
|
viewBox: "0 0 20 20",
|
|
@@ -522,7 +522,7 @@ var w = {
|
|
|
522
522
|
})]
|
|
523
523
|
}), w && /* @__PURE__ */ t("ul", {
|
|
524
524
|
id: `${C}-listbox`,
|
|
525
|
-
className:
|
|
525
|
+
className: H.menu,
|
|
526
526
|
role: "listbox",
|
|
527
527
|
"aria-label": m,
|
|
528
528
|
style: { maxHeight: x },
|
|
@@ -538,8 +538,8 @@ var w = {
|
|
|
538
538
|
role: "option",
|
|
539
539
|
"aria-selected": o,
|
|
540
540
|
disabled: e.disabled,
|
|
541
|
-
className: `${
|
|
542
|
-
onClick: () =>
|
|
541
|
+
className: `${H.option} ${o ? H.selected : ""}`,
|
|
542
|
+
onClick: () => F(e),
|
|
543
543
|
onKeyDown: (e) => {
|
|
544
544
|
if ((e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), P(a + (e.key === "ArrowDown" ? 1 : -1), e.key === "ArrowDown" ? 1 : -1)), e.key === "Tab" && T(!1), e.key === "Home" || e.key === "End") {
|
|
545
545
|
e.preventDefault();
|
|
@@ -558,26 +558,26 @@ var w = {
|
|
|
558
558
|
}),
|
|
559
559
|
g && !h && /* @__PURE__ */ t("span", {
|
|
560
560
|
id: A,
|
|
561
|
-
className:
|
|
561
|
+
className: H.message,
|
|
562
562
|
children: g
|
|
563
563
|
}),
|
|
564
564
|
h && /* @__PURE__ */ t("span", {
|
|
565
565
|
id: j,
|
|
566
|
-
className:
|
|
566
|
+
className: H.error,
|
|
567
567
|
children: h
|
|
568
568
|
})
|
|
569
569
|
]
|
|
570
570
|
});
|
|
571
|
-
},
|
|
571
|
+
}, oe = (e) => `${e.id}:${e.direction}`, se = ({ options: e, value: n, onChange: r, label: i = "Сортировка", placeholder: a = "Выберите сортировку", disabled: o = !1, className: s }) => {
|
|
572
572
|
let c = e.flatMap((e) => [{
|
|
573
|
-
value:
|
|
573
|
+
value: oe({
|
|
574
574
|
id: e.id,
|
|
575
575
|
direction: "asc"
|
|
576
576
|
}),
|
|
577
577
|
label: e.ascLabel ?? `${e.label} · по возрастанию`,
|
|
578
578
|
disabled: e.disabled
|
|
579
579
|
}, {
|
|
580
|
-
value:
|
|
580
|
+
value: oe({
|
|
581
581
|
id: e.id,
|
|
582
582
|
direction: "desc"
|
|
583
583
|
}),
|
|
@@ -586,7 +586,7 @@ var w = {
|
|
|
586
586
|
}]);
|
|
587
587
|
return /* @__PURE__ */ t(U, {
|
|
588
588
|
options: c,
|
|
589
|
-
value: n ?
|
|
589
|
+
value: n ? oe(n) : "",
|
|
590
590
|
label: i,
|
|
591
591
|
placeholder: a,
|
|
592
592
|
disabled: o,
|
|
@@ -613,10 +613,10 @@ var w = {
|
|
|
613
613
|
default: "_default_i4d62_21",
|
|
614
614
|
tableOnMobile: "_tableOnMobile_i4d62_21",
|
|
615
615
|
wide: "_wide_i4d62_23"
|
|
616
|
-
},
|
|
617
|
-
rowSortingFeature:
|
|
618
|
-
sortedRowModel:
|
|
619
|
-
}),
|
|
616
|
+
}, ce = h({
|
|
617
|
+
rowSortingFeature: m,
|
|
618
|
+
sortedRowModel: p()
|
|
619
|
+
}), le = (e, t) => {
|
|
620
620
|
let n = /* @__PURE__ */ new Set();
|
|
621
621
|
for (let t of e) {
|
|
622
622
|
if (!t.id.trim()) return "Идентификатор колонки не может быть пустым";
|
|
@@ -625,8 +625,8 @@ var w = {
|
|
|
625
625
|
}
|
|
626
626
|
for (let n = 0; n < t.length; n += 1) for (let r of e) if (typeof r.accessor == "string" && !(r.accessor in t[n])) return `В строке ${n + 1} отсутствует колонка «${r.id}»`;
|
|
627
627
|
return null;
|
|
628
|
-
},
|
|
629
|
-
let [S, C] =
|
|
628
|
+
}, ue = ({ columns: e, data: r, tableOnMobile: i = !1, breakpoint: a = "default", sorting: o, onSortingChange: s, renderMobileCard: c, getRowId: u, caption: p, ariaLabel: m, loading: h = !1, error: _, emptyState: v = "Нет данных", stickyHeader: y = !1, maxHeight: b, className: x = "" }) => {
|
|
629
|
+
let [S, C] = d([]), w = o ?? S, T = l(() => le(e, r), [e, r]), E = l(() => f(), []), D = l(() => E.columns(e.map((e) => {
|
|
630
630
|
let t = e.accessor;
|
|
631
631
|
return E.accessor(typeof t == "function" ? t : (e) => e[t], {
|
|
632
632
|
id: e.id,
|
|
@@ -635,8 +635,8 @@ var w = {
|
|
|
635
635
|
enableSorting: !0,
|
|
636
636
|
sortDescFirst: e.sortDescFirst
|
|
637
637
|
});
|
|
638
|
-
})), [e, E]), O =
|
|
639
|
-
features:
|
|
638
|
+
})), [e, E]), O = g({
|
|
639
|
+
features: ce,
|
|
640
640
|
columns: D,
|
|
641
641
|
data: r,
|
|
642
642
|
state: { sorting: w },
|
|
@@ -644,7 +644,7 @@ var w = {
|
|
|
644
644
|
let t = typeof e == "function" ? e(w) : e;
|
|
645
645
|
o === void 0 && C(t), s?.(t);
|
|
646
646
|
},
|
|
647
|
-
getRowId:
|
|
647
|
+
getRowId: u
|
|
648
648
|
}), k = O.getRowModel().rows, A = e.map((e) => ({
|
|
649
649
|
id: e.id,
|
|
650
650
|
label: typeof e.header == "string" ? e.header : e.id
|
|
@@ -656,9 +656,9 @@ var w = {
|
|
|
656
656
|
].filter(Boolean).join(" "), M = T ?? _;
|
|
657
657
|
return /* @__PURE__ */ n("section", {
|
|
658
658
|
className: j,
|
|
659
|
-
"aria-busy":
|
|
659
|
+
"aria-busy": h,
|
|
660
660
|
children: [
|
|
661
|
-
!i && !
|
|
661
|
+
!i && !h && !M && k.length > 0 && /* @__PURE__ */ t(se, {
|
|
662
662
|
className: W.mobileSort,
|
|
663
663
|
options: A,
|
|
664
664
|
value: w[0] ? {
|
|
@@ -697,9 +697,9 @@ var w = {
|
|
|
697
697
|
}, e.id);
|
|
698
698
|
}) }, e.id))
|
|
699
699
|
}),
|
|
700
|
-
/* @__PURE__ */ t("tbody", { children:
|
|
700
|
+
/* @__PURE__ */ t("tbody", { children: h ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
701
701
|
colSpan: e.length,
|
|
702
|
-
children: /* @__PURE__ */ t(
|
|
702
|
+
children: /* @__PURE__ */ t(ie, { lines: 3 })
|
|
703
703
|
}) }) : M ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
704
704
|
className: W.state,
|
|
705
705
|
colSpan: e.length,
|
|
@@ -716,16 +716,16 @@ var w = {
|
|
|
716
716
|
className: W.cards,
|
|
717
717
|
role: "list",
|
|
718
718
|
"aria-label": m ?? p,
|
|
719
|
-
children:
|
|
719
|
+
children: h ? /* @__PURE__ */ t(ie, { lines: 4 }) : M ? /* @__PURE__ */ t("div", {
|
|
720
720
|
className: W.state,
|
|
721
721
|
children: M
|
|
722
722
|
}) : k.length === 0 ? /* @__PURE__ */ t("div", {
|
|
723
723
|
className: W.state,
|
|
724
724
|
children: v
|
|
725
725
|
}) : k.map((r) => {
|
|
726
|
-
if (
|
|
726
|
+
if (c) return /* @__PURE__ */ t("div", {
|
|
727
727
|
role: "listitem",
|
|
728
|
-
children:
|
|
728
|
+
children: c({
|
|
729
729
|
row: r.original,
|
|
730
730
|
columns: e
|
|
731
731
|
})
|
|
@@ -747,9 +747,9 @@ var w = {
|
|
|
747
747
|
})
|
|
748
748
|
]
|
|
749
749
|
});
|
|
750
|
-
},
|
|
751
|
-
let b =
|
|
752
|
-
|
|
750
|
+
}, de = ({ options: e, value: r, onChange: i, placeholder: a = "Выберите опции", disabled: o = !1, label: f, error: p, hint: m, className: h = "", name: g, id: _, closeOnSelect: v = !1, maxMenuHeight: y }) => {
|
|
751
|
+
let b = c(), x = _ ?? `ds-dropdown-multiple-${g ?? b}`, [S, C] = d(!1), w = u(null), T = u(null), E = u([]), D = l(() => e.filter((e) => r.includes(e.value)), [e, r]), O = D.map((e) => e.label).join(", "), k = m ? `${x}-hint` : void 0, A = p ? `${x}-error` : void 0;
|
|
752
|
+
s(() => {
|
|
753
753
|
let e = (e) => {
|
|
754
754
|
w.current?.contains(e.target) || C(!1);
|
|
755
755
|
}, t = (e) => {
|
|
@@ -764,31 +764,31 @@ var w = {
|
|
|
764
764
|
let n = r.includes(t.value) ? r.filter((e) => e !== t.value) : [...r, t.value];
|
|
765
765
|
i?.(n, e.filter((e) => n.includes(e.value))), v && (C(!1), T.current?.focus());
|
|
766
766
|
}, M = (t, n) => {
|
|
767
|
-
let r =
|
|
767
|
+
let r = ae(e, t, n);
|
|
768
768
|
E.current[r]?.focus(), E.current[r]?.scrollIntoView({ block: "nearest" });
|
|
769
769
|
};
|
|
770
770
|
return /* @__PURE__ */ n("div", {
|
|
771
771
|
ref: w,
|
|
772
772
|
className: [
|
|
773
|
-
|
|
774
|
-
p ?
|
|
773
|
+
H.wrapper,
|
|
774
|
+
p ? H.errorState : "",
|
|
775
775
|
h
|
|
776
776
|
].filter(Boolean).join(" "),
|
|
777
777
|
children: [
|
|
778
778
|
f && /* @__PURE__ */ t("label", {
|
|
779
779
|
htmlFor: x,
|
|
780
|
-
className:
|
|
780
|
+
className: H.label,
|
|
781
781
|
children: f
|
|
782
782
|
}),
|
|
783
783
|
/* @__PURE__ */ n("div", {
|
|
784
|
-
className:
|
|
784
|
+
className: H.container,
|
|
785
785
|
children: [/* @__PURE__ */ n("button", {
|
|
786
786
|
ref: T,
|
|
787
787
|
id: x,
|
|
788
788
|
type: "button",
|
|
789
789
|
name: g,
|
|
790
|
-
className:
|
|
791
|
-
disabled:
|
|
790
|
+
className: H.trigger,
|
|
791
|
+
disabled: o,
|
|
792
792
|
"aria-haspopup": "listbox",
|
|
793
793
|
"aria-expanded": S,
|
|
794
794
|
"aria-controls": `${x}-listbox`,
|
|
@@ -803,16 +803,16 @@ var w = {
|
|
|
803
803
|
}
|
|
804
804
|
},
|
|
805
805
|
children: [/* @__PURE__ */ t("span", {
|
|
806
|
-
className: D.length ?
|
|
806
|
+
className: D.length ? H.value : H.placeholder,
|
|
807
807
|
children: O || a
|
|
808
808
|
}), /* @__PURE__ */ t("span", {
|
|
809
|
-
className: `${
|
|
809
|
+
className: `${H.chevron} ${S ? H.chevronOpen : ""}`,
|
|
810
810
|
"aria-hidden": "true",
|
|
811
811
|
children: "⌄"
|
|
812
812
|
})]
|
|
813
813
|
}), S && /* @__PURE__ */ t("ul", {
|
|
814
814
|
id: `${x}-listbox`,
|
|
815
|
-
className:
|
|
815
|
+
className: H.menu,
|
|
816
816
|
role: "listbox",
|
|
817
817
|
"aria-label": f,
|
|
818
818
|
"aria-multiselectable": "true",
|
|
@@ -829,7 +829,7 @@ var w = {
|
|
|
829
829
|
role: "option",
|
|
830
830
|
"aria-selected": o,
|
|
831
831
|
disabled: i.disabled,
|
|
832
|
-
className: `${
|
|
832
|
+
className: `${H.option} ${o ? H.selected : ""}`,
|
|
833
833
|
onClick: () => j(i),
|
|
834
834
|
onKeyDown: (t) => {
|
|
835
835
|
if (t.key === "ArrowDown" || t.key === "ArrowUp") {
|
|
@@ -855,17 +855,17 @@ var w = {
|
|
|
855
855
|
}),
|
|
856
856
|
m && !p && /* @__PURE__ */ t("span", {
|
|
857
857
|
id: k,
|
|
858
|
-
className:
|
|
858
|
+
className: H.message,
|
|
859
859
|
children: m
|
|
860
860
|
}),
|
|
861
861
|
p && /* @__PURE__ */ t("span", {
|
|
862
862
|
id: A,
|
|
863
|
-
className:
|
|
863
|
+
className: H.error,
|
|
864
864
|
children: p
|
|
865
865
|
})
|
|
866
866
|
]
|
|
867
867
|
});
|
|
868
|
-
},
|
|
868
|
+
}, fe = {
|
|
869
869
|
approve: "M4 12l5 5L20 6",
|
|
870
870
|
reject: "M5 5l14 14M19 5L5 19",
|
|
871
871
|
edit: "M4 20h4L19 9l-4-4L4 16v4z",
|
|
@@ -874,7 +874,7 @@ var w = {
|
|
|
874
874
|
basket: "M4 7h16l-1 13H5L4 7zm3 0V4h10v3",
|
|
875
875
|
info: "M12 10v7m0-10v.01",
|
|
876
876
|
warning: "M12 4L3 20h18L12 4zm0 5v5m0 3v.01"
|
|
877
|
-
},
|
|
877
|
+
}, pe = ({ name: e, title: r, width: i = 24, height: a = 24, ...o }) => /* @__PURE__ */ n("svg", {
|
|
878
878
|
viewBox: "0 0 24 24",
|
|
879
879
|
width: i,
|
|
880
880
|
height: a,
|
|
@@ -887,21 +887,21 @@ var w = {
|
|
|
887
887
|
"aria-hidden": !r || void 0,
|
|
888
888
|
focusable: "false",
|
|
889
889
|
...o,
|
|
890
|
-
children: [r && /* @__PURE__ */ t("title", { children: r }), /* @__PURE__ */ t("path", { d:
|
|
890
|
+
children: [r && /* @__PURE__ */ t("title", { children: r }), /* @__PURE__ */ t("path", { d: fe[e] })]
|
|
891
891
|
}), G = {
|
|
892
892
|
root: "_root_1897l_1",
|
|
893
893
|
header: "_header_1897l_11",
|
|
894
894
|
title: "_title_1897l_21",
|
|
895
895
|
dismiss: "_dismiss_1897l_28",
|
|
896
896
|
content: "_content_1897l_57"
|
|
897
|
-
},
|
|
898
|
-
let u = `ds-info-block-${
|
|
897
|
+
}, me = ({ title: e, children: r, dismissible: i = !1, onDismiss: a, dismissLabel: o = "Закрыть информационный блок", headingAs: s = "h3", className: l = "" }) => {
|
|
898
|
+
let u = `ds-info-block-${c()}`;
|
|
899
899
|
return /* @__PURE__ */ n("section", {
|
|
900
900
|
className: `${G.root} ${l}`,
|
|
901
901
|
"aria-labelledby": u,
|
|
902
902
|
children: [/* @__PURE__ */ n("header", {
|
|
903
903
|
className: G.header,
|
|
904
|
-
children: [/* @__PURE__ */ t(
|
|
904
|
+
children: [/* @__PURE__ */ t(s, {
|
|
905
905
|
id: u,
|
|
906
906
|
className: G.title,
|
|
907
907
|
children: e
|
|
@@ -928,74 +928,100 @@ var w = {
|
|
|
928
928
|
})]
|
|
929
929
|
});
|
|
930
930
|
}, K = {
|
|
931
|
-
wrapper: "
|
|
932
|
-
control: "
|
|
933
|
-
input: "
|
|
934
|
-
disabledText: "
|
|
935
|
-
inputError: "
|
|
936
|
-
|
|
937
|
-
},
|
|
938
|
-
let
|
|
939
|
-
return
|
|
940
|
-
|
|
931
|
+
wrapper: "_wrapper_15bo7_1",
|
|
932
|
+
control: "_control_15bo7_3",
|
|
933
|
+
input: "_input_15bo7_5",
|
|
934
|
+
disabledText: "_disabledText_15bo7_5",
|
|
935
|
+
inputError: "_inputError_15bo7_11",
|
|
936
|
+
trailingAction: "_trailingAction_15bo7_13"
|
|
937
|
+
}, he = ({ value: e, onChange: r, type: i = "text", placeholder: a = "", disabled: o = !1, readOnly: l = !1, stringWhileDisabled: f = !1, label: p, error: m, hint: h, className: g = "", name: _, id: v, clearable: y = !0, required: b = !1, selectTextOnFocus: x = !1, isPassword: S = !1, passwordVisibleLabel: C = "Скрыть пароль", passwordHiddenLabel: w = "Показать пароль", onFocus: T, ...O }) => {
|
|
938
|
+
let k = c(), A = v ?? `ds-input-${_ ?? k}`, j = u(null), [M, N] = d(!1), P = h ? `${A}-hint` : void 0, F = m ? `${A}-error` : void 0, I = String(e ?? ""), L = [P, F].filter(Boolean).join(" ") || void 0, ee = S ? M ? "text" : "password" : i;
|
|
939
|
+
return s(() => {
|
|
940
|
+
S || N(!1);
|
|
941
|
+
}, [S]), /* @__PURE__ */ n("div", {
|
|
942
|
+
className: `${K.wrapper} ${g}`,
|
|
941
943
|
children: [
|
|
942
|
-
|
|
943
|
-
htmlFor:
|
|
944
|
-
required:
|
|
944
|
+
p && /* @__PURE__ */ t(E, {
|
|
945
|
+
htmlFor: A,
|
|
946
|
+
required: b,
|
|
945
947
|
disabled: o,
|
|
946
|
-
children:
|
|
948
|
+
children: p
|
|
947
949
|
}),
|
|
948
|
-
o &&
|
|
949
|
-
id:
|
|
950
|
+
o && f ? /* @__PURE__ */ t("div", {
|
|
951
|
+
id: A,
|
|
950
952
|
className: K.disabledText,
|
|
951
|
-
"aria-describedby":
|
|
952
|
-
children:
|
|
953
|
+
"aria-describedby": L,
|
|
954
|
+
children: I || a
|
|
953
955
|
}) : /* @__PURE__ */ n("div", {
|
|
954
956
|
className: K.control,
|
|
955
|
-
children: [
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
957
|
+
children: [
|
|
958
|
+
/* @__PURE__ */ t("input", {
|
|
959
|
+
ref: j,
|
|
960
|
+
id: A,
|
|
961
|
+
name: _,
|
|
962
|
+
type: ee,
|
|
963
|
+
value: I,
|
|
964
|
+
placeholder: a,
|
|
965
|
+
disabled: o,
|
|
966
|
+
readOnly: l,
|
|
967
|
+
required: b,
|
|
968
|
+
"aria-invalid": !!m,
|
|
969
|
+
"aria-describedby": L,
|
|
970
|
+
className: `${K.input} ${m ? K.inputError : ""}`,
|
|
971
|
+
onChange: (e) => {
|
|
972
|
+
if (i === "number" && !S) {
|
|
973
|
+
let t = e.target.value === "" ? "" : Number(e.target.value);
|
|
974
|
+
r?.(t, e);
|
|
975
|
+
return;
|
|
976
|
+
}
|
|
977
|
+
r?.(e.target.value, e);
|
|
978
|
+
},
|
|
979
|
+
onFocus: (e) => {
|
|
980
|
+
x && e.currentTarget.value && e.currentTarget.select(), T?.(e);
|
|
981
|
+
},
|
|
982
|
+
...O
|
|
983
|
+
}),
|
|
984
|
+
S && /* @__PURE__ */ t("button", {
|
|
985
|
+
type: "button",
|
|
986
|
+
className: K.trailingAction,
|
|
987
|
+
disabled: o,
|
|
988
|
+
"aria-label": M ? C : w,
|
|
989
|
+
"aria-pressed": M,
|
|
990
|
+
onClick: () => N((e) => !e),
|
|
991
|
+
children: M ? /* @__PURE__ */ t("svg", {
|
|
992
|
+
viewBox: "0 0 24 24",
|
|
993
|
+
"aria-hidden": "true",
|
|
994
|
+
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" })
|
|
995
|
+
}) : /* @__PURE__ */ n("svg", {
|
|
996
|
+
viewBox: "0 0 24 24",
|
|
997
|
+
"aria-hidden": "true",
|
|
998
|
+
children: [/* @__PURE__ */ t("path", { d: "M3 12s3.5-5 9-5 9 5 9 5-3.5 5-9 5-9-5-9-5Z" }), /* @__PURE__ */ t("circle", {
|
|
999
|
+
cx: "12",
|
|
1000
|
+
cy: "12",
|
|
1001
|
+
r: "2.5"
|
|
1002
|
+
})]
|
|
1003
|
+
})
|
|
1004
|
+
}),
|
|
1005
|
+
!S && y && I && !o && !l && /* @__PURE__ */ t("button", {
|
|
1006
|
+
type: "button",
|
|
1007
|
+
className: K.trailingAction,
|
|
1008
|
+
"aria-label": "Очистить поле",
|
|
1009
|
+
onClick: () => {
|
|
1010
|
+
let e = j.current;
|
|
1011
|
+
e && ((Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set)?.call(e, ""), e.dispatchEvent(new Event("input", { bubbles: !0 })), e.focus());
|
|
1012
|
+
},
|
|
1013
|
+
children: "×"
|
|
1014
|
+
})
|
|
1015
|
+
]
|
|
990
1016
|
}),
|
|
991
|
-
|
|
992
|
-
id:
|
|
993
|
-
children:
|
|
1017
|
+
h && !m && /* @__PURE__ */ t(D, {
|
|
1018
|
+
id: P,
|
|
1019
|
+
children: h
|
|
994
1020
|
}),
|
|
995
|
-
|
|
996
|
-
id:
|
|
1021
|
+
m && /* @__PURE__ */ t(D, {
|
|
1022
|
+
id: F,
|
|
997
1023
|
variant: "error",
|
|
998
|
-
children:
|
|
1024
|
+
children: m
|
|
999
1025
|
})
|
|
1000
1026
|
]
|
|
1001
1027
|
});
|
|
@@ -1006,11 +1032,11 @@ var w = {
|
|
|
1006
1032
|
thumb: "_thumb_8srjz_34",
|
|
1007
1033
|
label: "_label_8srjz_56",
|
|
1008
1034
|
disabled: "_disabled_8srjz_62"
|
|
1009
|
-
},
|
|
1010
|
-
let f =
|
|
1035
|
+
}, ge = ({ checked: e, onChange: r, label: i, disabled: a = !1, readOnly: o = !1, className: s = "", name: l, id: u, value: d }) => {
|
|
1036
|
+
let f = c(), p = u ?? `ds-radio-button-${l ?? f}`;
|
|
1011
1037
|
return /* @__PURE__ */ n("label", {
|
|
1012
1038
|
htmlFor: p,
|
|
1013
|
-
className: `${q.wrapper} ${a ? q.disabled : ""} ${
|
|
1039
|
+
className: `${q.wrapper} ${a ? q.disabled : ""} ${s}`,
|
|
1014
1040
|
children: [
|
|
1015
1041
|
/* @__PURE__ */ t("input", {
|
|
1016
1042
|
id: p,
|
|
@@ -1037,11 +1063,11 @@ var w = {
|
|
|
1037
1063
|
})
|
|
1038
1064
|
]
|
|
1039
1065
|
});
|
|
1040
|
-
},
|
|
1066
|
+
}, _e = {
|
|
1041
1067
|
root: "_root_kepgo_1",
|
|
1042
1068
|
grid: "_grid_kepgo_3",
|
|
1043
1069
|
actions: "_actions_kepgo_5"
|
|
1044
|
-
},
|
|
1070
|
+
}, ve = ({ filters: e, values: r, onChange: i, onApply: a, onReset: o, applyMode: s = "instant", loading: c = !1, disabled: l = !1, className: u = "" }) => {
|
|
1045
1071
|
let d = (e, t) => {
|
|
1046
1072
|
let n = {
|
|
1047
1073
|
...r,
|
|
@@ -1050,11 +1076,11 @@ var w = {
|
|
|
1050
1076
|
i?.(n, e), s === "instant" && a?.(n);
|
|
1051
1077
|
};
|
|
1052
1078
|
return /* @__PURE__ */ n("section", {
|
|
1053
|
-
className: `${
|
|
1079
|
+
className: `${_e.root} ${u}`,
|
|
1054
1080
|
"aria-label": "Фильтры",
|
|
1055
1081
|
"aria-busy": c,
|
|
1056
1082
|
children: [/* @__PURE__ */ t("div", {
|
|
1057
|
-
className:
|
|
1083
|
+
className: _e.grid,
|
|
1058
1084
|
children: e.filter((e) => !e.hidden).map((e) => {
|
|
1059
1085
|
let n = l || c || e.disabled, i = r[e.id];
|
|
1060
1086
|
if (e.type === "input") {
|
|
@@ -1065,12 +1091,12 @@ var w = {
|
|
|
1065
1091
|
placeholder: e.placeholder,
|
|
1066
1092
|
disabled: n
|
|
1067
1093
|
};
|
|
1068
|
-
return e.inputType === "number" ? /* @__PURE__ */ t(
|
|
1094
|
+
return e.inputType === "number" ? /* @__PURE__ */ t(he, {
|
|
1069
1095
|
...r,
|
|
1070
1096
|
type: "number",
|
|
1071
1097
|
value: i ?? "",
|
|
1072
1098
|
onChange: (t) => d(e.id, t)
|
|
1073
|
-
}) : /* @__PURE__ */ t(
|
|
1099
|
+
}) : /* @__PURE__ */ t(he, {
|
|
1074
1100
|
...r,
|
|
1075
1101
|
type: "text",
|
|
1076
1102
|
value: String(i ?? ""),
|
|
@@ -1086,7 +1112,7 @@ var w = {
|
|
|
1086
1112
|
disabled: n,
|
|
1087
1113
|
onChange: (t) => d(e.id, t)
|
|
1088
1114
|
}, e.id);
|
|
1089
|
-
if (e.type === "multiple") return /* @__PURE__ */ t(
|
|
1115
|
+
if (e.type === "multiple") return /* @__PURE__ */ t(de, {
|
|
1090
1116
|
label: e.label,
|
|
1091
1117
|
hint: e.hint,
|
|
1092
1118
|
placeholder: e.placeholder,
|
|
@@ -1095,14 +1121,14 @@ var w = {
|
|
|
1095
1121
|
disabled: n,
|
|
1096
1122
|
onChange: (t) => d(e.id, t)
|
|
1097
1123
|
}, e.id);
|
|
1098
|
-
if (e.type === "checkbox") return /* @__PURE__ */ t(
|
|
1124
|
+
if (e.type === "checkbox") return /* @__PURE__ */ t(k, {
|
|
1099
1125
|
label: e.label,
|
|
1100
1126
|
hint: e.hint,
|
|
1101
1127
|
checked: !!i,
|
|
1102
1128
|
disabled: n,
|
|
1103
1129
|
onChange: (t) => d(e.id, t)
|
|
1104
1130
|
}, e.id);
|
|
1105
|
-
if (e.type === "radio") return /* @__PURE__ */ t(
|
|
1131
|
+
if (e.type === "radio") return /* @__PURE__ */ t(ge, {
|
|
1106
1132
|
label: e.label,
|
|
1107
1133
|
checked: !!i,
|
|
1108
1134
|
disabled: n,
|
|
@@ -1112,7 +1138,7 @@ var w = {
|
|
|
1112
1138
|
from: null,
|
|
1113
1139
|
to: null
|
|
1114
1140
|
};
|
|
1115
|
-
return /* @__PURE__ */ t(
|
|
1141
|
+
return /* @__PURE__ */ t(re, {
|
|
1116
1142
|
hint: e.hint,
|
|
1117
1143
|
mode: e.mode,
|
|
1118
1144
|
min: e.min,
|
|
@@ -1123,13 +1149,13 @@ var w = {
|
|
|
1123
1149
|
}, e.id);
|
|
1124
1150
|
})
|
|
1125
1151
|
}), (o || s === "manual") && /* @__PURE__ */ n("div", {
|
|
1126
|
-
className:
|
|
1127
|
-
children: [o && /* @__PURE__ */ t(
|
|
1152
|
+
className: _e.actions,
|
|
1153
|
+
children: [o && /* @__PURE__ */ t(w, {
|
|
1128
1154
|
variant: "destructiveOutline",
|
|
1129
1155
|
disabled: l || c,
|
|
1130
1156
|
onClick: o,
|
|
1131
1157
|
children: "Сбросить"
|
|
1132
|
-
}), s === "manual" && /* @__PURE__ */ t(
|
|
1158
|
+
}), s === "manual" && /* @__PURE__ */ t(w, {
|
|
1133
1159
|
isLoading: c,
|
|
1134
1160
|
disabled: l,
|
|
1135
1161
|
onClick: () => a?.(r),
|
|
@@ -1137,11 +1163,140 @@ var w = {
|
|
|
1137
1163
|
})]
|
|
1138
1164
|
})]
|
|
1139
1165
|
});
|
|
1140
|
-
},
|
|
1166
|
+
}, J = {
|
|
1167
|
+
wrapper: "_wrapper_17rrt_1",
|
|
1168
|
+
dropzone: "_dropzone_17rrt_2",
|
|
1169
|
+
dragActive: "_dragActive_17rrt_3",
|
|
1170
|
+
disabled: "_disabled_17rrt_4",
|
|
1171
|
+
error: "_error_17rrt_5",
|
|
1172
|
+
nativeInput: "_nativeInput_17rrt_6",
|
|
1173
|
+
empty: "_empty_17rrt_7",
|
|
1174
|
+
uploadIcon: "_uploadIcon_17rrt_8",
|
|
1175
|
+
browseButton: "_browseButton_17rrt_9",
|
|
1176
|
+
files: "_files_17rrt_10",
|
|
1177
|
+
file: "_file_17rrt_10",
|
|
1178
|
+
fileName: "_fileName_17rrt_12",
|
|
1179
|
+
fileSize: "_fileSize_17rrt_13"
|
|
1180
|
+
}, ye = (e) => `${e.name}:${e.size}:${e.lastModified}`, be = (e) => e < 1024 ? `${e} Б` : e < 1048576 ? `${(e / 1024).toFixed(1)} КБ` : `${(e / 1024 / 1024).toFixed(1)} МБ`, xe = (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), Se = ({ value: r, onChange: i, multiple: a = !1, accept: o, maxSize: s, maxFiles: l, label: f, 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 }) => {
|
|
1181
|
+
let O = c(), k = y ?? `ds-file-input-${v ?? O}`, A = u(null), j = u(0), [M, N] = d(!1), P = p ? `${k}-hint` : void 0, F = m ? `${k}-error` : void 0, I = [P, F].filter(Boolean).join(" ") || void 0, L = !g && !_, ee = (e) => {
|
|
1182
|
+
let t = [], n = new Set(r.map(ye)), c = e.filter((e) => xe(e, o) ? s !== void 0 && e.size > s ? (t.push({
|
|
1183
|
+
file: e,
|
|
1184
|
+
reason: "maxSize"
|
|
1185
|
+
}), !1) : !n.has(ye(e)) && (n.add(ye(e)), !0) : (t.push({
|
|
1186
|
+
file: e,
|
|
1187
|
+
reason: "accept"
|
|
1188
|
+
}), !1)), u = a ? l : 1, d = a ? [...r, ...c] : c.slice(-1);
|
|
1189
|
+
u !== void 0 && d.length > u && (d.slice(u).forEach((e) => t.push({
|
|
1190
|
+
file: e,
|
|
1191
|
+
reason: "maxFiles"
|
|
1192
|
+
})), d = d.slice(0, u)), t.length && T?.(t), c.length && i?.(d), A.current && (A.current.value = "");
|
|
1193
|
+
};
|
|
1194
|
+
return /* @__PURE__ */ n("div", {
|
|
1195
|
+
className: `${J.wrapper} ${b}`,
|
|
1196
|
+
children: [
|
|
1197
|
+
f && /* @__PURE__ */ t(E, {
|
|
1198
|
+
htmlFor: k,
|
|
1199
|
+
required: h,
|
|
1200
|
+
disabled: g,
|
|
1201
|
+
children: f
|
|
1202
|
+
}),
|
|
1203
|
+
/* @__PURE__ */ n("div", {
|
|
1204
|
+
className: `${J.dropzone} ${M ? J.dragActive : ""} ${g ? J.disabled : ""} ${m ? J.error : ""}`,
|
|
1205
|
+
onDragEnter: (e) => {
|
|
1206
|
+
e.preventDefault(), L && ++j.current === 1 && N(!0);
|
|
1207
|
+
},
|
|
1208
|
+
onDragOver: (e) => e.preventDefault(),
|
|
1209
|
+
onDragLeave: (e) => {
|
|
1210
|
+
e.preventDefault(), --j.current <= 0 && (j.current = 0, N(!1));
|
|
1211
|
+
},
|
|
1212
|
+
onDrop: (e) => {
|
|
1213
|
+
e.preventDefault(), j.current = 0, N(!1), L && ee(Array.from(e.dataTransfer.files));
|
|
1214
|
+
},
|
|
1215
|
+
children: [/* @__PURE__ */ t("input", {
|
|
1216
|
+
ref: A,
|
|
1217
|
+
id: k,
|
|
1218
|
+
name: v,
|
|
1219
|
+
className: J.nativeInput,
|
|
1220
|
+
type: "file",
|
|
1221
|
+
multiple: a,
|
|
1222
|
+
accept: o,
|
|
1223
|
+
required: h && r.length === 0,
|
|
1224
|
+
disabled: !L,
|
|
1225
|
+
"aria-describedby": I,
|
|
1226
|
+
"aria-invalid": !!m,
|
|
1227
|
+
onChange: (e) => ee(Array.from(e.target.files ?? []))
|
|
1228
|
+
}), r.length ? /* @__PURE__ */ n(e, { children: [
|
|
1229
|
+
/* @__PURE__ */ t("ul", {
|
|
1230
|
+
className: J.files,
|
|
1231
|
+
"aria-live": "polite",
|
|
1232
|
+
children: r.map((e, a) => /* @__PURE__ */ n("li", {
|
|
1233
|
+
className: J.file,
|
|
1234
|
+
children: [
|
|
1235
|
+
/* @__PURE__ */ t("span", {
|
|
1236
|
+
className: J.fileName,
|
|
1237
|
+
title: e.name,
|
|
1238
|
+
children: e.name
|
|
1239
|
+
}),
|
|
1240
|
+
/* @__PURE__ */ t("span", {
|
|
1241
|
+
className: J.fileSize,
|
|
1242
|
+
children: be(e.size)
|
|
1243
|
+
}),
|
|
1244
|
+
L && /* @__PURE__ */ t(w, {
|
|
1245
|
+
variant: "empty",
|
|
1246
|
+
size: "sm",
|
|
1247
|
+
"aria-label": `Удалить файл ${e.name}`,
|
|
1248
|
+
onClick: () => i?.(r.filter((e, t) => t !== a)),
|
|
1249
|
+
children: "×"
|
|
1250
|
+
})
|
|
1251
|
+
]
|
|
1252
|
+
}, ye(e)))
|
|
1253
|
+
}),
|
|
1254
|
+
L && (a || r.length === 0) && /* @__PURE__ */ t(w, {
|
|
1255
|
+
className: J.browseButton,
|
|
1256
|
+
size: "sm",
|
|
1257
|
+
onClick: () => A.current?.click(),
|
|
1258
|
+
children: C
|
|
1259
|
+
}),
|
|
1260
|
+
L && !a && /* @__PURE__ */ t(w, {
|
|
1261
|
+
className: J.browseButton,
|
|
1262
|
+
size: "sm",
|
|
1263
|
+
onClick: () => A.current?.click(),
|
|
1264
|
+
children: S
|
|
1265
|
+
})
|
|
1266
|
+
] }) : /* @__PURE__ */ n("div", {
|
|
1267
|
+
className: J.empty,
|
|
1268
|
+
children: [
|
|
1269
|
+
/* @__PURE__ */ t("span", {
|
|
1270
|
+
className: J.uploadIcon,
|
|
1271
|
+
"aria-hidden": "true",
|
|
1272
|
+
children: "↑"
|
|
1273
|
+
}),
|
|
1274
|
+
/* @__PURE__ */ t("strong", { children: M ? "Отпустите файлы здесь" : x }),
|
|
1275
|
+
!M && L && /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", { children: "или" }), /* @__PURE__ */ t(w, {
|
|
1276
|
+
className: J.browseButton,
|
|
1277
|
+
onClick: () => A.current?.click(),
|
|
1278
|
+
children: S
|
|
1279
|
+
})] })
|
|
1280
|
+
]
|
|
1281
|
+
})]
|
|
1282
|
+
}),
|
|
1283
|
+
p && !m && /* @__PURE__ */ t(D, {
|
|
1284
|
+
id: P,
|
|
1285
|
+
children: p
|
|
1286
|
+
}),
|
|
1287
|
+
m && /* @__PURE__ */ t(D, {
|
|
1288
|
+
id: F,
|
|
1289
|
+
variant: "error",
|
|
1290
|
+
live: !0,
|
|
1291
|
+
children: m
|
|
1292
|
+
})
|
|
1293
|
+
]
|
|
1294
|
+
});
|
|
1295
|
+
}, Ce = 0, Y = v((e) => ({
|
|
1141
1296
|
modals: [],
|
|
1142
1297
|
openModal: (t, n = {}, r = {}) => {
|
|
1143
|
-
|
|
1144
|
-
let i = `ds-modal-${
|
|
1298
|
+
Ce += 1;
|
|
1299
|
+
let i = `ds-modal-${Ce}`;
|
|
1145
1300
|
return e((e) => ({ modals: [...e.modals, {
|
|
1146
1301
|
id: i,
|
|
1147
1302
|
name: t,
|
|
@@ -1153,7 +1308,7 @@ var w = {
|
|
|
1153
1308
|
closeModal: (t) => e((e) => ({ modals: e.modals.filter((e) => e.id !== t) })),
|
|
1154
1309
|
closeTopModal: () => e((e) => ({ modals: e.modals.slice(0, -1) })),
|
|
1155
1310
|
closeAllModals: () => e({ modals: [] })
|
|
1156
|
-
})),
|
|
1311
|
+
})), we = () => Y.setState({ modals: [] }), X = {
|
|
1157
1312
|
layer: "_layer_bl99k_1",
|
|
1158
1313
|
backdrop: "_backdrop_bl99k_2",
|
|
1159
1314
|
panel: "_panel_bl99k_3",
|
|
@@ -1161,14 +1316,14 @@ var w = {
|
|
|
1161
1316
|
title: "_title_bl99k_6",
|
|
1162
1317
|
description: "_description_bl99k_7",
|
|
1163
1318
|
content: "_content_bl99k_8"
|
|
1164
|
-
},
|
|
1165
|
-
let f =
|
|
1166
|
-
return
|
|
1319
|
+
}, Te = "button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"])", Ee = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "Закрыть модальное окно", className: l = "", role: d = "dialog" }) => {
|
|
1320
|
+
let f = c(), p = c(), m = u(null), h = Y((e) => e.closeModal);
|
|
1321
|
+
return s(() => {
|
|
1167
1322
|
let e = document.activeElement, t = m.current;
|
|
1168
|
-
return (t?.querySelector(
|
|
1323
|
+
return (t?.querySelector(Te) ?? t)?.focus(), () => e?.focus();
|
|
1169
1324
|
}, []), /* @__PURE__ */ n("div", {
|
|
1170
1325
|
ref: m,
|
|
1171
|
-
className: `${
|
|
1326
|
+
className: `${X.panel} ${l}`,
|
|
1172
1327
|
role: d,
|
|
1173
1328
|
"aria-modal": "true",
|
|
1174
1329
|
"aria-labelledby": r ? f : void 0,
|
|
@@ -1176,7 +1331,7 @@ var w = {
|
|
|
1176
1331
|
tabIndex: -1,
|
|
1177
1332
|
onKeyDown: (e) => {
|
|
1178
1333
|
if (e.key !== "Tab") return;
|
|
1179
|
-
let t = Array.from(m.current?.querySelectorAll(
|
|
1334
|
+
let t = Array.from(m.current?.querySelectorAll(Te) ?? []);
|
|
1180
1335
|
if (!t.length) {
|
|
1181
1336
|
e.preventDefault();
|
|
1182
1337
|
return;
|
|
@@ -1185,47 +1340,47 @@ var w = {
|
|
|
1185
1340
|
e.shiftKey && document.activeElement === n ? (e.preventDefault(), r?.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n?.focus());
|
|
1186
1341
|
},
|
|
1187
1342
|
children: [
|
|
1188
|
-
(r ||
|
|
1189
|
-
className:
|
|
1343
|
+
(r || o) && /* @__PURE__ */ n("header", {
|
|
1344
|
+
className: X.header,
|
|
1190
1345
|
children: [r && /* @__PURE__ */ t("h2", {
|
|
1191
1346
|
id: f,
|
|
1192
|
-
className:
|
|
1347
|
+
className: X.title,
|
|
1193
1348
|
children: r
|
|
1194
|
-
}), /* @__PURE__ */ t(
|
|
1349
|
+
}), /* @__PURE__ */ t(w, {
|
|
1195
1350
|
variant: "empty",
|
|
1196
1351
|
size: "sm",
|
|
1197
|
-
"aria-label":
|
|
1352
|
+
"aria-label": o,
|
|
1198
1353
|
onClick: () => h(a),
|
|
1199
1354
|
children: "×"
|
|
1200
1355
|
})]
|
|
1201
1356
|
}),
|
|
1202
1357
|
i && /* @__PURE__ */ t("p", {
|
|
1203
1358
|
id: p,
|
|
1204
|
-
className:
|
|
1359
|
+
className: X.description,
|
|
1205
1360
|
children: i
|
|
1206
1361
|
}),
|
|
1207
1362
|
/* @__PURE__ */ t("div", {
|
|
1208
|
-
className:
|
|
1363
|
+
className: X.content,
|
|
1209
1364
|
children: e
|
|
1210
1365
|
})
|
|
1211
1366
|
]
|
|
1212
1367
|
});
|
|
1213
|
-
},
|
|
1214
|
-
let n =
|
|
1215
|
-
return
|
|
1368
|
+
}, De = ({ registry: e }) => {
|
|
1369
|
+
let n = Y((e) => e.modals), r = Y((e) => e.closeModal), i = Y((e) => e.closeAllModals);
|
|
1370
|
+
return s(() => {
|
|
1216
1371
|
let e = (e) => {
|
|
1217
1372
|
if (e.key !== "Escape") return;
|
|
1218
|
-
let t =
|
|
1373
|
+
let t = Y.getState().modals.at(-1);
|
|
1219
1374
|
t?.closeOnEscape && r(t.id);
|
|
1220
1375
|
};
|
|
1221
1376
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
1222
|
-
}, [r]), !n.length || typeof document > "u" ? null :
|
|
1223
|
-
className:
|
|
1377
|
+
}, [r]), !n.length || typeof document > "u" ? null : _(/* @__PURE__ */ t("div", {
|
|
1378
|
+
className: X.layer,
|
|
1224
1379
|
"aria-label": "Модальные окна",
|
|
1225
1380
|
children: n.map((a, o) => {
|
|
1226
1381
|
let s = e[a.name];
|
|
1227
1382
|
return s ? /* @__PURE__ */ t("div", {
|
|
1228
|
-
className:
|
|
1383
|
+
className: X.backdrop,
|
|
1229
1384
|
"aria-hidden": o !== n.length - 1 || void 0,
|
|
1230
1385
|
onMouseDown: (e) => {
|
|
1231
1386
|
e.target === e.currentTarget && a.closeOnBackdrop && r(a.id);
|
|
@@ -1239,95 +1394,95 @@ var w = {
|
|
|
1239
1394
|
}, a.id) : null;
|
|
1240
1395
|
})
|
|
1241
1396
|
}), document.body);
|
|
1242
|
-
},
|
|
1243
|
-
let
|
|
1244
|
-
return
|
|
1245
|
-
if (!a ||
|
|
1397
|
+
}, Oe = ({ registry: r, children: i, lockBodyScroll: a = !0 }) => {
|
|
1398
|
+
let o = Y((e) => e.modals.length);
|
|
1399
|
+
return s(() => {
|
|
1400
|
+
if (!a || o === 0) return;
|
|
1246
1401
|
let e = document.body.style.overflow;
|
|
1247
1402
|
return document.body.style.overflow = "hidden", () => {
|
|
1248
1403
|
document.body.style.overflow = e;
|
|
1249
1404
|
};
|
|
1250
|
-
}, [a,
|
|
1251
|
-
},
|
|
1405
|
+
}, [a, o]), /* @__PURE__ */ n(e, { children: [i, /* @__PURE__ */ t(De, { registry: r })] });
|
|
1406
|
+
}, ke = (e) => e, Ae = {
|
|
1252
1407
|
message: "_message_187g8_1",
|
|
1253
1408
|
actions: "_actions_187g8_2"
|
|
1254
|
-
},
|
|
1409
|
+
}, je = /* @__PURE__ */ new Map(), Me = 0, Ne = ({ modalId: e, close: r, title: i = "Подтверждение", message: a = "Продолжить действие?", confirmLabel: o = "Подтвердить", cancelLabel: s = "Отмена", tone: c = "default", requestId: l }) => {
|
|
1255
1410
|
let u = (e) => {
|
|
1256
|
-
|
|
1411
|
+
je.get(l)?.(e), je.delete(l), r();
|
|
1257
1412
|
};
|
|
1258
|
-
return /* @__PURE__ */ n(
|
|
1413
|
+
return /* @__PURE__ */ n(Ee, {
|
|
1259
1414
|
modalId: e,
|
|
1260
1415
|
title: i,
|
|
1261
1416
|
role: "alertdialog",
|
|
1262
1417
|
children: [/* @__PURE__ */ t("p", {
|
|
1263
|
-
className:
|
|
1418
|
+
className: Ae.message,
|
|
1264
1419
|
children: a
|
|
1265
1420
|
}), /* @__PURE__ */ n("div", {
|
|
1266
|
-
className:
|
|
1267
|
-
children: [/* @__PURE__ */ t(
|
|
1421
|
+
className: Ae.actions,
|
|
1422
|
+
children: [/* @__PURE__ */ t(w, {
|
|
1268
1423
|
variant: "outline",
|
|
1269
1424
|
onClick: () => u(!1),
|
|
1270
1425
|
children: s
|
|
1271
|
-
}), /* @__PURE__ */ t(
|
|
1426
|
+
}), /* @__PURE__ */ t(w, {
|
|
1272
1427
|
variant: c === "danger" ? "destructive" : "primary",
|
|
1273
1428
|
onClick: () => u(!0),
|
|
1274
1429
|
children: o
|
|
1275
1430
|
})]
|
|
1276
1431
|
})]
|
|
1277
1432
|
});
|
|
1278
|
-
},
|
|
1433
|
+
}, Pe = ({ modalId: e, close: r, title: i = "Ошибка", message: a, closeLabel: o = "Закрыть" }) => /* @__PURE__ */ n(Ee, {
|
|
1279
1434
|
modalId: e,
|
|
1280
1435
|
title: i,
|
|
1281
1436
|
role: "alertdialog",
|
|
1282
1437
|
children: [/* @__PURE__ */ t("p", {
|
|
1283
|
-
className:
|
|
1438
|
+
className: Ae.message,
|
|
1284
1439
|
children: a
|
|
1285
1440
|
}), /* @__PURE__ */ t("div", {
|
|
1286
|
-
className:
|
|
1287
|
-
children: /* @__PURE__ */ t(
|
|
1441
|
+
className: Ae.actions,
|
|
1442
|
+
children: /* @__PURE__ */ t(w, {
|
|
1288
1443
|
onClick: r,
|
|
1289
1444
|
children: o
|
|
1290
1445
|
})
|
|
1291
1446
|
})]
|
|
1292
|
-
}),
|
|
1293
|
-
ConfirmModal:
|
|
1294
|
-
ErrorModal:
|
|
1295
|
-
}),
|
|
1296
|
-
let e =
|
|
1447
|
+
}), Fe = ke({
|
|
1448
|
+
ConfirmModal: Ne,
|
|
1449
|
+
ErrorModal: Pe
|
|
1450
|
+
}), Ie = () => {
|
|
1451
|
+
let e = Y((e) => e.openModal);
|
|
1297
1452
|
return (t = {}) => new Promise((n) => {
|
|
1298
|
-
|
|
1299
|
-
let r = `confirm-${
|
|
1300
|
-
|
|
1453
|
+
Me += 1;
|
|
1454
|
+
let r = `confirm-${Me}`;
|
|
1455
|
+
je.set(r, n), e("ConfirmModal", {
|
|
1301
1456
|
...t,
|
|
1302
1457
|
requestId: r
|
|
1303
1458
|
}, { closeOnEscape: !1 });
|
|
1304
1459
|
});
|
|
1305
|
-
},
|
|
1306
|
-
let e =
|
|
1460
|
+
}, Le = (e) => e instanceof Error ? e.message : typeof e == "string" ? e : e && typeof e == "object" && "message" in e && typeof e.message == "string" ? e.message : "Произошла неизвестная ошибка", Re = () => {
|
|
1461
|
+
let e = Y((e) => e.openModal);
|
|
1307
1462
|
return { showError: (t, n) => e("ErrorModal", {
|
|
1308
1463
|
title: n,
|
|
1309
|
-
message:
|
|
1464
|
+
message: Le(t)
|
|
1310
1465
|
}) };
|
|
1311
|
-
},
|
|
1312
|
-
let e =
|
|
1466
|
+
}, ze = v(() => ({})), Be = v(() => ({})), Ve = () => {
|
|
1467
|
+
let e = Y((e) => e.modals), t = Y((e) => e.openModal);
|
|
1313
1468
|
return {
|
|
1314
1469
|
openModal: (e, n = {}, r) => t(e, n, r),
|
|
1315
|
-
closeModal:
|
|
1316
|
-
closeTopModal:
|
|
1317
|
-
closeAllModals:
|
|
1470
|
+
closeModal: Y((e) => e.closeModal),
|
|
1471
|
+
closeTopModal: Y((e) => e.closeTopModal),
|
|
1472
|
+
closeAllModals: Y((e) => e.closeAllModals),
|
|
1318
1473
|
isOpen: (t) => e.some((e) => e.name === t),
|
|
1319
1474
|
count: e.length
|
|
1320
1475
|
};
|
|
1321
|
-
},
|
|
1322
|
-
className: `${
|
|
1476
|
+
}, He = { root: "_root_1j70j_1" }, Ue = ({ label: e = "Загрузка страницы", className: r = "" }) => /* @__PURE__ */ n("div", {
|
|
1477
|
+
className: `${He.root} ${r}`,
|
|
1323
1478
|
role: "status",
|
|
1324
1479
|
"aria-label": e,
|
|
1325
|
-
children: [/* @__PURE__ */ t(
|
|
1326
|
-
}),
|
|
1480
|
+
children: [/* @__PURE__ */ t(S, { decorative: !0 }), /* @__PURE__ */ t("span", { children: e })]
|
|
1481
|
+
}), We = {
|
|
1327
1482
|
root: "_root_ig8lp_1",
|
|
1328
1483
|
legend: "_legend_ig8lp_2",
|
|
1329
1484
|
range: "_range_ig8lp_3"
|
|
1330
|
-
},
|
|
1485
|
+
}, Ge = [
|
|
1331
1486
|
{
|
|
1332
1487
|
value: "1",
|
|
1333
1488
|
label: "День"
|
|
@@ -1340,16 +1495,16 @@ var w = {
|
|
|
1340
1495
|
value: "3",
|
|
1341
1496
|
label: "Месяц"
|
|
1342
1497
|
}
|
|
1343
|
-
],
|
|
1498
|
+
], Ke = {
|
|
1344
1499
|
day: 1,
|
|
1345
1500
|
week: 2,
|
|
1346
1501
|
month: 3
|
|
1347
|
-
},
|
|
1348
|
-
className: `${
|
|
1502
|
+
}, qe = ({ value: e, onChange: r, label: i, hint: a, error: o, disabled: s = !1, min: c, max: l, className: u = "", periodTypeOptions: d = Ge }) => /* @__PURE__ */ n("fieldset", {
|
|
1503
|
+
className: `${We.root} ${u}`,
|
|
1349
1504
|
disabled: s,
|
|
1350
1505
|
children: [
|
|
1351
1506
|
i && /* @__PURE__ */ t("legend", {
|
|
1352
|
-
className:
|
|
1507
|
+
className: We.legend,
|
|
1353
1508
|
children: i
|
|
1354
1509
|
}),
|
|
1355
1510
|
/* @__PURE__ */ t(U, {
|
|
@@ -1363,8 +1518,8 @@ var w = {
|
|
|
1363
1518
|
label: "Тип периода"
|
|
1364
1519
|
}),
|
|
1365
1520
|
/* @__PURE__ */ n("div", {
|
|
1366
|
-
className:
|
|
1367
|
-
children: [/* @__PURE__ */ t(
|
|
1521
|
+
className: We.range,
|
|
1522
|
+
children: [/* @__PURE__ */ t(R, {
|
|
1368
1523
|
value: e.startDate,
|
|
1369
1524
|
onChange: (t) => r?.({
|
|
1370
1525
|
...e,
|
|
@@ -1374,7 +1529,7 @@ var w = {
|
|
|
1374
1529
|
min: c,
|
|
1375
1530
|
max: l,
|
|
1376
1531
|
disabled: s
|
|
1377
|
-
}), /* @__PURE__ */ t(
|
|
1532
|
+
}), /* @__PURE__ */ t(R, {
|
|
1378
1533
|
value: e.endDate,
|
|
1379
1534
|
onChange: (t) => r?.({
|
|
1380
1535
|
...e,
|
|
@@ -1386,8 +1541,8 @@ var w = {
|
|
|
1386
1541
|
disabled: s
|
|
1387
1542
|
})]
|
|
1388
1543
|
}),
|
|
1389
|
-
a && !o && /* @__PURE__ */ t(
|
|
1390
|
-
o && /* @__PURE__ */ t(
|
|
1544
|
+
a && !o && /* @__PURE__ */ t(D, { children: a }),
|
|
1545
|
+
o && /* @__PURE__ */ t(D, {
|
|
1391
1546
|
variant: "error",
|
|
1392
1547
|
children: o
|
|
1393
1548
|
})
|
|
@@ -1405,14 +1560,14 @@ var w = {
|
|
|
1405
1560
|
success: "_success_v7rog_10",
|
|
1406
1561
|
warning: "_warning_v7rog_11",
|
|
1407
1562
|
error: "_error_v7rog_12"
|
|
1408
|
-
},
|
|
1409
|
-
let [i, a] =
|
|
1410
|
-
return
|
|
1563
|
+
}, Je = ({ toast: e, onClose: r }) => {
|
|
1564
|
+
let [i, a] = d(!1), o = u(e.duration), c = u(Date.now());
|
|
1565
|
+
return s(() => {
|
|
1411
1566
|
if (i || e.duration <= 0) return;
|
|
1412
1567
|
c.current = Date.now();
|
|
1413
|
-
let t = setTimeout(() => r(e.id),
|
|
1568
|
+
let t = setTimeout(() => r(e.id), o.current);
|
|
1414
1569
|
return () => {
|
|
1415
|
-
clearTimeout(t),
|
|
1570
|
+
clearTimeout(t), o.current = Math.max(0, o.current - (Date.now() - c.current));
|
|
1416
1571
|
};
|
|
1417
1572
|
}, [
|
|
1418
1573
|
r,
|
|
@@ -1428,7 +1583,7 @@ var w = {
|
|
|
1428
1583
|
onFocus: () => a(!0),
|
|
1429
1584
|
onBlur: () => a(!1),
|
|
1430
1585
|
children: [
|
|
1431
|
-
/* @__PURE__ */ t(
|
|
1586
|
+
/* @__PURE__ */ t(pe, {
|
|
1432
1587
|
name: e.variant === "warning" ? "warning" : "info",
|
|
1433
1588
|
className: Z.icon
|
|
1434
1589
|
}),
|
|
@@ -1437,7 +1592,7 @@ var w = {
|
|
|
1437
1592
|
children: [
|
|
1438
1593
|
e.title && /* @__PURE__ */ t("strong", { children: e.title }),
|
|
1439
1594
|
/* @__PURE__ */ t("div", { children: e.message }),
|
|
1440
|
-
e.action && /* @__PURE__ */ t(
|
|
1595
|
+
e.action && /* @__PURE__ */ t(w, {
|
|
1441
1596
|
variant: "empty",
|
|
1442
1597
|
size: "sm",
|
|
1443
1598
|
onClick: () => {
|
|
@@ -1447,7 +1602,7 @@ var w = {
|
|
|
1447
1602
|
})
|
|
1448
1603
|
]
|
|
1449
1604
|
}),
|
|
1450
|
-
e.closable && /* @__PURE__ */ t(
|
|
1605
|
+
e.closable && /* @__PURE__ */ t(w, {
|
|
1451
1606
|
variant: "empty",
|
|
1452
1607
|
size: "sm",
|
|
1453
1608
|
"aria-label": "Закрыть уведомление",
|
|
@@ -1456,11 +1611,11 @@ var w = {
|
|
|
1456
1611
|
})
|
|
1457
1612
|
]
|
|
1458
1613
|
});
|
|
1459
|
-
},
|
|
1614
|
+
}, Ye = 0, Q = v((e) => ({
|
|
1460
1615
|
toasts: [],
|
|
1461
1616
|
showToast: (t) => {
|
|
1462
|
-
|
|
1463
|
-
let n = `ds-toast-${
|
|
1617
|
+
Ye += 1;
|
|
1618
|
+
let n = `ds-toast-${Ye}`;
|
|
1464
1619
|
return e((e) => ({ toasts: [...e.toasts, {
|
|
1465
1620
|
variant: "info",
|
|
1466
1621
|
duration: 5e3,
|
|
@@ -1471,31 +1626,48 @@ var w = {
|
|
|
1471
1626
|
},
|
|
1472
1627
|
removeToast: (t) => e((e) => ({ toasts: e.toasts.filter((e) => e.id !== t) })),
|
|
1473
1628
|
clearToasts: () => e({ toasts: [] })
|
|
1474
|
-
})),
|
|
1629
|
+
})), Xe = () => Q.setState({ toasts: [] }), Ze = ({ position: e = "top-right" }) => {
|
|
1475
1630
|
let n = Q((e) => e.toasts), r = Q((e) => e.removeToast);
|
|
1476
1631
|
return /* @__PURE__ */ t("div", {
|
|
1477
1632
|
className: `${Z.viewport} ${Z[e]}`,
|
|
1478
1633
|
"aria-label": "Уведомления",
|
|
1479
|
-
children: n.map((e) => /* @__PURE__ */ t(
|
|
1634
|
+
children: n.map((e) => /* @__PURE__ */ t(Je, {
|
|
1480
1635
|
toast: e,
|
|
1481
1636
|
onClose: r
|
|
1482
1637
|
}, e.id))
|
|
1483
1638
|
});
|
|
1484
|
-
},
|
|
1485
|
-
let e = Q((e) => e.showToast), t = Q((e) => e.removeToast), n = Q((e) => e.clearToasts), r = (t) =>
|
|
1486
|
-
...
|
|
1487
|
-
variant:
|
|
1488
|
-
})
|
|
1489
|
-
|
|
1639
|
+
}, Qe = () => {
|
|
1640
|
+
let e = Q((e) => e.showToast), t = Q((e) => e.removeToast), n = Q((e) => e.clearToasts), r = o((t) => e({
|
|
1641
|
+
...t,
|
|
1642
|
+
variant: "info"
|
|
1643
|
+
}), [e]), i = o((t) => e({
|
|
1644
|
+
...t,
|
|
1645
|
+
variant: "success"
|
|
1646
|
+
}), [e]), a = o((t) => e({
|
|
1647
|
+
...t,
|
|
1648
|
+
variant: "warning"
|
|
1649
|
+
}), [e]), s = o((t) => e({
|
|
1650
|
+
...t,
|
|
1651
|
+
variant: "error"
|
|
1652
|
+
}), [e]);
|
|
1653
|
+
return l(() => ({
|
|
1490
1654
|
showToast: e,
|
|
1491
|
-
infoToast: r
|
|
1492
|
-
successToast:
|
|
1493
|
-
warningToast:
|
|
1494
|
-
errorToast:
|
|
1655
|
+
infoToast: r,
|
|
1656
|
+
successToast: i,
|
|
1657
|
+
warningToast: a,
|
|
1658
|
+
errorToast: s,
|
|
1495
1659
|
removeToast: t,
|
|
1496
1660
|
clearToasts: n
|
|
1497
|
-
}
|
|
1498
|
-
|
|
1661
|
+
}), [
|
|
1662
|
+
n,
|
|
1663
|
+
s,
|
|
1664
|
+
r,
|
|
1665
|
+
t,
|
|
1666
|
+
e,
|
|
1667
|
+
i,
|
|
1668
|
+
a
|
|
1669
|
+
]);
|
|
1670
|
+
}, $e = {
|
|
1499
1671
|
root: "_root_2bxal_1",
|
|
1500
1672
|
tooltip: "_tooltip_2bxal_2",
|
|
1501
1673
|
"ds-tooltip-in": "_ds-tooltip-in_2bxal_1",
|
|
@@ -1503,13 +1675,13 @@ var w = {
|
|
|
1503
1675
|
bottom: "_bottom_2bxal_4",
|
|
1504
1676
|
left: "_left_2bxal_5",
|
|
1505
1677
|
right: "_right_2bxal_6"
|
|
1506
|
-
},
|
|
1507
|
-
let h =
|
|
1508
|
-
f || !e || (v.current = setTimeout(() => _(!0),
|
|
1678
|
+
}, et = ({ content: e, children: i, placement: o = "top", delay: l = 450, disabled: f = !1, maxWidth: p = 280, className: m = "" }) => {
|
|
1679
|
+
let h = c(), [g, _] = d(!1), v = u(null), y = () => {
|
|
1680
|
+
f || !e || (v.current = setTimeout(() => _(!0), l));
|
|
1509
1681
|
}, b = () => {
|
|
1510
1682
|
v.current && clearTimeout(v.current), _(!1);
|
|
1511
1683
|
};
|
|
1512
|
-
if (
|
|
1684
|
+
if (s(() => {
|
|
1513
1685
|
let e = (e) => {
|
|
1514
1686
|
e.key === "Escape" && b();
|
|
1515
1687
|
};
|
|
@@ -1525,12 +1697,12 @@ var w = {
|
|
|
1525
1697
|
onBlur: b
|
|
1526
1698
|
});
|
|
1527
1699
|
return /* @__PURE__ */ n("span", {
|
|
1528
|
-
className: `${
|
|
1700
|
+
className: `${$e.root} ${m}`,
|
|
1529
1701
|
onPointerDown: g ? b : y,
|
|
1530
1702
|
children: [x, g && /* @__PURE__ */ t("span", {
|
|
1531
1703
|
id: h,
|
|
1532
1704
|
role: "tooltip",
|
|
1533
|
-
className: `${
|
|
1705
|
+
className: `${$e.tooltip} ${$e[o]}`,
|
|
1534
1706
|
style: { maxWidth: p },
|
|
1535
1707
|
children: e
|
|
1536
1708
|
})]
|
|
@@ -1542,10 +1714,10 @@ var w = {
|
|
|
1542
1714
|
overlay: "_overlay_tgni1_4",
|
|
1543
1715
|
error: "_error_tgni1_4",
|
|
1544
1716
|
caption: "_caption_tgni1_7"
|
|
1545
|
-
},
|
|
1546
|
-
let [h, g] =
|
|
1717
|
+
}, tt = ({ sources: e, tracks: r = [], title: i, aspectRatio: a = "16 / 9", objectFit: o = "contain", loading: s = !1, error: c, fallback: l, className: u = "", controls: f = !0, playsInline: p = !0, ...m }) => {
|
|
1718
|
+
let [h, g] = d(!1), _ = c ?? (h ? "Не удалось воспроизвести видео" : void 0);
|
|
1547
1719
|
return /* @__PURE__ */ n("figure", {
|
|
1548
|
-
className: `${$.root} ${
|
|
1720
|
+
className: `${$.root} ${u}`,
|
|
1549
1721
|
children: [/* @__PURE__ */ n("div", {
|
|
1550
1722
|
className: $.frame,
|
|
1551
1723
|
style: { aspectRatio: a },
|
|
@@ -1564,7 +1736,7 @@ var w = {
|
|
|
1564
1736
|
}),
|
|
1565
1737
|
s && /* @__PURE__ */ t("div", {
|
|
1566
1738
|
className: $.overlay,
|
|
1567
|
-
children: /* @__PURE__ */ t(
|
|
1739
|
+
children: /* @__PURE__ */ t(S, { label: "Загрузка видео" })
|
|
1568
1740
|
}),
|
|
1569
1741
|
(_ || e.length === 0) && /* @__PURE__ */ t("div", {
|
|
1570
1742
|
className: $.error,
|
|
@@ -1579,4 +1751,4 @@ var w = {
|
|
|
1579
1751
|
});
|
|
1580
1752
|
};
|
|
1581
1753
|
//#endregion
|
|
1582
|
-
export {
|
|
1754
|
+
export { Ne as ConfirmModal, b as DSBadge, w as DSButton, k as DSCheckbox, ue as DSDataTable, re as DSDateRange, R as DSDateTimePicker, U as DSDropDown, de as DSDropDownMultiple, E as DSFieldLabel, D as DSFieldMessage, Se as DSFileInput, ve as DSFilters, pe as DSIcon, me as DSInfoBlock, he as DSInput, S as DSLoader, De as DSModal, Ee as DSModalFrame, Ue as DSPageLoader, ge as DSRadioButton, ie as DSSkeleton, se as DSSort, qe as DSTimePeriodPicker, Je as DSToast, Ze as DSToastProvider, et as DSTooltip, tt as DSVideoPlayerFrame, Ke as DS_PERIOD_TYPE_CODES, Pe as ErrorModal, Oe as ModalSystemProvider, Fe as builtInModalRegistry, ke as defineModalRegistry, F as formatDateTimeLocalValue, Le as getErrorMessage, ae as getNextEnabledOptionIndex, B as isValidDateRange, I as parseDateTimeLocalValue, we as resetModalStore, Xe as resetToastStore, Ie as useConfirmModal, ze as useConfirmModalStore, Re as useErrorModal, Be as useErrorModalStore, Ve as useModals, Y as useModalsStore, Qe as useToast, Q as useToastStore, le as validateDSDataTableData };
|