@efficiency-point/design-system 0.0.9 → 0.0.11
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/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
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 { createSortedRowModel as f, rowSortingFeature as p,
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { create as
|
|
6
|
-
var
|
|
3
|
+
import { createSortedRowModel as f, rowSortingFeature as p, tableFeatures as m, useTable as h } from "@tanstack/react-table";
|
|
4
|
+
import { createPortal as g } from "react-dom";
|
|
5
|
+
import { create as _ } from "zustand";
|
|
6
|
+
var v = {
|
|
7
7
|
badge: "_badge_1pk53_1",
|
|
8
8
|
sm: "_sm_1pk53_3",
|
|
9
9
|
md: "_md_1pk53_5",
|
|
@@ -15,36 +15,36 @@ var x = {
|
|
|
15
15
|
dot: "_dot_1pk53_17",
|
|
16
16
|
icon: "_icon_1pk53_19",
|
|
17
17
|
label: "_label_1pk53_21"
|
|
18
|
-
},
|
|
19
|
-
className: `${
|
|
18
|
+
}, y = ({ children: e, variant: r = "neutral", size: i = "md", dot: a = !1, icon: o, className: s = "" }) => /* @__PURE__ */ n("span", {
|
|
19
|
+
className: `${v.badge} ${v[r]} ${v[i]} ${s}`,
|
|
20
20
|
children: [
|
|
21
21
|
a && /* @__PURE__ */ t("span", {
|
|
22
|
-
className:
|
|
22
|
+
className: v.dot,
|
|
23
23
|
"aria-hidden": "true"
|
|
24
24
|
}),
|
|
25
25
|
o && /* @__PURE__ */ t("span", {
|
|
26
|
-
className:
|
|
26
|
+
className: v.icon,
|
|
27
27
|
"aria-hidden": "true",
|
|
28
28
|
children: o
|
|
29
29
|
}),
|
|
30
30
|
/* @__PURE__ */ t("span", {
|
|
31
|
-
className:
|
|
31
|
+
className: v.label,
|
|
32
32
|
children: e
|
|
33
33
|
})
|
|
34
34
|
]
|
|
35
|
-
}),
|
|
35
|
+
}), b = {
|
|
36
36
|
loader: "_loader_1tjcf_1",
|
|
37
37
|
"ds-spin": "_ds-spin_1tjcf_1",
|
|
38
38
|
primary: "_primary_1tjcf_21",
|
|
39
39
|
secondary: "_secondary_1tjcf_23",
|
|
40
40
|
light: "_light_1tjcf_25",
|
|
41
41
|
danger: "_danger_1tjcf_27"
|
|
42
|
-
},
|
|
43
|
-
className: `${
|
|
42
|
+
}, x = ({ variant: e = "primary", label: n = "Загрузка", className: r = "", decorative: i = !1 }) => /* @__PURE__ */ t("span", {
|
|
43
|
+
className: `${b.loader} ${b[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
|
+
}), S = {
|
|
48
48
|
button: "_button_1jisp_1",
|
|
49
49
|
sm: "_sm_1jisp_31",
|
|
50
50
|
md: "_md_1jisp_33",
|
|
@@ -56,20 +56,20 @@ var x = {
|
|
|
56
56
|
empty: "_empty_1jisp_57",
|
|
57
57
|
destructive: "_destructive_1jisp_67",
|
|
58
58
|
destructiveOutline: "_destructiveOutline_1jisp_69"
|
|
59
|
-
},
|
|
59
|
+
}, C = 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: `${S.button} ${S[n]} ${S[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(x, {
|
|
67
67
|
variant: "light",
|
|
68
68
|
label: a
|
|
69
69
|
}) : e
|
|
70
70
|
}));
|
|
71
|
-
|
|
72
|
-
var
|
|
71
|
+
C.displayName = "DSButton";
|
|
72
|
+
var w = {
|
|
73
73
|
label: "_label_1lsqq_1",
|
|
74
74
|
required: "_required_1lsqq_23",
|
|
75
75
|
error: "_error_1lsqq_25",
|
|
@@ -78,43 +78,43 @@ var D = {
|
|
|
78
78
|
disabled: "_disabled_1lsqq_47",
|
|
79
79
|
message: "_message_1lsqq_55",
|
|
80
80
|
success: "_success_1lsqq_71"
|
|
81
|
-
},
|
|
82
|
-
className: `${
|
|
81
|
+
}, T = ({ children: e, required: r = !1, optionalText: i, disabled: a = !1, className: o = "", ...s }) => /* @__PURE__ */ n("label", {
|
|
82
|
+
className: `${w.label} ${a ? w.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: w.required,
|
|
88
88
|
"aria-hidden": "true",
|
|
89
89
|
children: "*"
|
|
90
90
|
}),
|
|
91
91
|
i && /* @__PURE__ */ t("span", {
|
|
92
|
-
className:
|
|
92
|
+
className: w.optional,
|
|
93
93
|
children: i
|
|
94
94
|
})
|
|
95
95
|
]
|
|
96
|
-
}),
|
|
96
|
+
}), E = ({ children: e, variant: n = "hint", id: r, live: i = !1, className: a = "" }) => /* @__PURE__ */ t("span", {
|
|
97
97
|
id: r,
|
|
98
|
-
className: `${
|
|
98
|
+
className: `${w.message} ${w[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
|
+
}), D = {
|
|
103
103
|
wrapper: "_wrapper_1gq36_1",
|
|
104
104
|
label: "_label_1gq36_3",
|
|
105
105
|
input: "_input_1gq36_5",
|
|
106
106
|
control: "_control_1gq36_7",
|
|
107
107
|
disabled: "_disabled_1gq36_13",
|
|
108
108
|
controlError: "_controlError_1gq36_17"
|
|
109
|
-
},
|
|
109
|
+
}, O = ({ 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
110
|
let _ = c(), v = m ?? `ds-checkbox-${p ?? _}`, y = u(null), b = a ? `${v}-hint` : void 0, x = o ? `${v}-error` : void 0;
|
|
111
111
|
return s(() => {
|
|
112
112
|
y.current && (y.current.indeterminate = h && !e);
|
|
113
113
|
}, [e, h]), /* @__PURE__ */ n("div", {
|
|
114
|
-
className: `${
|
|
114
|
+
className: `${D.wrapper} ${f}`,
|
|
115
115
|
children: [
|
|
116
116
|
/* @__PURE__ */ n("label", {
|
|
117
|
-
className: `${
|
|
117
|
+
className: `${D.label} ${l ? D.disabled : ""}`,
|
|
118
118
|
htmlFor: v,
|
|
119
119
|
children: [
|
|
120
120
|
/* @__PURE__ */ t("input", {
|
|
@@ -127,32 +127,32 @@ var D = {
|
|
|
127
127
|
"aria-readonly": d || void 0,
|
|
128
128
|
"aria-invalid": !!o,
|
|
129
129
|
"aria-describedby": [b, x].filter(Boolean).join(" ") || void 0,
|
|
130
|
-
className:
|
|
130
|
+
className: D.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: `${D.control} ${o ? D.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 && !o && /* @__PURE__ */ t(
|
|
144
|
+
a && !o && /* @__PURE__ */ t(E, {
|
|
145
145
|
id: b,
|
|
146
146
|
children: a
|
|
147
147
|
}),
|
|
148
|
-
o && /* @__PURE__ */ t(
|
|
148
|
+
o && /* @__PURE__ */ t(E, {
|
|
149
149
|
id: x,
|
|
150
150
|
variant: "error",
|
|
151
151
|
children: o
|
|
152
152
|
})
|
|
153
153
|
]
|
|
154
154
|
});
|
|
155
|
-
},
|
|
155
|
+
}, k = {
|
|
156
156
|
wrapper: "_wrapper_1528c_1",
|
|
157
157
|
trigger: "_trigger_1528c_17",
|
|
158
158
|
nav: "_nav_1528c_53",
|
|
@@ -170,7 +170,7 @@ var D = {
|
|
|
170
170
|
outside: "_outside_1528c_263",
|
|
171
171
|
selected: "_selected_1528c_271",
|
|
172
172
|
timeLabel: "_timeLabel_1528c_291"
|
|
173
|
-
},
|
|
173
|
+
}, A = [
|
|
174
174
|
"Пн",
|
|
175
175
|
"Вт",
|
|
176
176
|
"Ср",
|
|
@@ -178,7 +178,7 @@ var D = {
|
|
|
178
178
|
"Пт",
|
|
179
179
|
"Сб",
|
|
180
180
|
"Вс"
|
|
181
|
-
],
|
|
181
|
+
], j = [
|
|
182
182
|
"Январь",
|
|
183
183
|
"Февраль",
|
|
184
184
|
"Март",
|
|
@@ -191,11 +191,11 @@ var D = {
|
|
|
191
191
|
"Октябрь",
|
|
192
192
|
"Ноябрь",
|
|
193
193
|
"Декабрь"
|
|
194
|
-
],
|
|
194
|
+
], M = (e) => String(e).padStart(2, "0"), N = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), P = (e, t) => {
|
|
195
195
|
if (!e) return "";
|
|
196
|
-
let n = `${e.getFullYear()}-${
|
|
196
|
+
let n = `${e.getFullYear()}-${M(e.getMonth() + 1)}-${M(e.getDate())}`, r = `${M(e.getHours())}:${M(e.getMinutes())}`;
|
|
197
197
|
return t === "date" ? n : t === "time" ? r : `${n}T${r}`;
|
|
198
|
-
},
|
|
198
|
+
}, F = (e, t) => {
|
|
199
199
|
if (!e) return null;
|
|
200
200
|
if (t === "time") {
|
|
201
201
|
let t = /^(\d{2}):(\d{2})$/.exec(e);
|
|
@@ -209,171 +209,171 @@ var D = {
|
|
|
209
209
|
return Number.isNaN(n.getTime()) ? null : n;
|
|
210
210
|
}, ee = (e, t) => {
|
|
211
211
|
if (!e) return "";
|
|
212
|
-
let n = `${
|
|
212
|
+
let n = `${M(e.getDate())}.${M(e.getMonth() + 1)}.${e.getFullYear()}`, r = `${M(e.getHours())}:${M(e.getMinutes())}`;
|
|
213
213
|
return t === "date" ? n : t === "time" ? r : `${n} ${r}`;
|
|
214
|
-
},
|
|
214
|
+
}, I = (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 = c(), w = b ?? `ds-date-time-${x ?? C}`,
|
|
220
|
+
}, te = (e, t) => !!(e && e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate()), ne = (e, t, n) => {
|
|
221
|
+
let r = N(e).getTime();
|
|
222
|
+
return !!(t && r < N(t).getTime() || n && r > N(n).getTime());
|
|
223
|
+
}, L = ({ 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}`, D = p ? `${w}-hint` : void 0, O = m ? `${w}-error` : void 0, M = u(null), N = u(null), [L, R] = d(!1), [z, B] = d(r ?? /* @__PURE__ */ new Date()), [V, re] = d(P(r, "time")), H = l(() => I(z), [z]), ie = a !== "time", U = a !== "date";
|
|
225
225
|
s(() => {
|
|
226
|
-
r &&
|
|
226
|
+
r && B(r), re(P(r, "time"));
|
|
227
227
|
}, [r]), s(() => {
|
|
228
228
|
let e = (e) => {
|
|
229
|
-
|
|
229
|
+
M.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 ae = (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" &&
|
|
241
|
-
},
|
|
242
|
-
if (
|
|
240
|
+
t.setHours(r?.getHours() ?? 0, r?.getMinutes() ?? 0, 0, 0), i?.(t), a === "date" && R(!1);
|
|
241
|
+
}, oe = (e) => {
|
|
242
|
+
if (re(e), !e) {
|
|
243
243
|
i?.(null);
|
|
244
244
|
return;
|
|
245
245
|
}
|
|
246
|
-
let t =
|
|
246
|
+
let t = F(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
|
+
}, W = f ?? (a === "date" ? "Выберите дату" : a === "time" ? "Введите время" : "Выберите дату и время"), se = [D, O].filter(Boolean).join(" ") || void 0;
|
|
251
251
|
return /* @__PURE__ */ n("div", {
|
|
252
|
-
ref:
|
|
253
|
-
className: `${
|
|
252
|
+
ref: M,
|
|
253
|
+
className: `${k.wrapper} ${S}`,
|
|
254
254
|
children: [
|
|
255
|
-
o && /* @__PURE__ */ t(
|
|
255
|
+
o && /* @__PURE__ */ t(T, {
|
|
256
256
|
htmlFor: w,
|
|
257
257
|
required: _,
|
|
258
258
|
disabled: h,
|
|
259
259
|
children: o
|
|
260
260
|
}),
|
|
261
261
|
/* @__PURE__ */ n("button", {
|
|
262
|
-
ref:
|
|
262
|
+
ref: N,
|
|
263
263
|
id: w,
|
|
264
264
|
name: x,
|
|
265
265
|
type: "button",
|
|
266
|
-
className: `${
|
|
266
|
+
className: `${k.trigger} ${m ? k.error : ""}`,
|
|
267
267
|
disabled: h,
|
|
268
268
|
"aria-readonly": g || void 0,
|
|
269
|
-
"aria-expanded":
|
|
269
|
+
"aria-expanded": L,
|
|
270
270
|
"aria-haspopup": "dialog",
|
|
271
|
-
"aria-describedby":
|
|
271
|
+
"aria-describedby": se,
|
|
272
272
|
onClick: () => {
|
|
273
|
-
g ||
|
|
273
|
+
g || R((e) => !e);
|
|
274
274
|
},
|
|
275
275
|
children: [/* @__PURE__ */ t("span", {
|
|
276
|
-
className: r ?
|
|
277
|
-
children: ee(r, a) ||
|
|
276
|
+
className: r ? k.value : k.placeholder,
|
|
277
|
+
children: ee(r, a) || W
|
|
278
278
|
}), /* @__PURE__ */ t("span", {
|
|
279
279
|
"aria-hidden": "true",
|
|
280
280
|
children: "▾"
|
|
281
281
|
})]
|
|
282
282
|
}),
|
|
283
|
-
|
|
284
|
-
className:
|
|
283
|
+
L && !g && /* @__PURE__ */ n("div", {
|
|
284
|
+
className: k.panel,
|
|
285
285
|
role: "dialog",
|
|
286
|
-
"aria-label": o ??
|
|
287
|
-
children: [
|
|
286
|
+
"aria-label": o ?? W,
|
|
287
|
+
children: [ie && /* @__PURE__ */ n(e, { children: [
|
|
288
288
|
/* @__PURE__ */ n("div", {
|
|
289
|
-
className:
|
|
289
|
+
className: k.calendarHeader,
|
|
290
290
|
children: [
|
|
291
291
|
/* @__PURE__ */ t("button", {
|
|
292
292
|
type: "button",
|
|
293
|
-
className:
|
|
293
|
+
className: k.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: k.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: j.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: k.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: k.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: k.weekdays,
|
|
326
|
+
children: A.map((e) => /* @__PURE__ */ t("span", { children: e }, e))
|
|
327
327
|
}),
|
|
328
328
|
/* @__PURE__ */ t("div", {
|
|
329
|
-
className:
|
|
330
|
-
children:
|
|
331
|
-
let n =
|
|
329
|
+
className: k.days,
|
|
330
|
+
children: H.map((e) => {
|
|
331
|
+
let n = te(r, e);
|
|
332
332
|
return /* @__PURE__ */ t("button", {
|
|
333
333
|
type: "button",
|
|
334
|
-
className: `${
|
|
335
|
-
disabled:
|
|
334
|
+
className: `${k.day} ${e.getMonth() === z.getMonth() ? "" : k.outside} ${n ? k.selected : ""}`,
|
|
335
|
+
disabled: ne(e, v, y),
|
|
336
336
|
"aria-pressed": n,
|
|
337
|
-
onClick: () =>
|
|
337
|
+
onClick: () => ae(e),
|
|
338
338
|
children: e.getDate()
|
|
339
339
|
}, e.toISOString());
|
|
340
340
|
})
|
|
341
341
|
})
|
|
342
|
-
] }),
|
|
343
|
-
className:
|
|
342
|
+
] }), U && /* @__PURE__ */ n("label", {
|
|
343
|
+
className: k.timeLabel,
|
|
344
344
|
children: [/* @__PURE__ */ t("span", { children: "Время" }), /* @__PURE__ */ t("input", {
|
|
345
|
-
className:
|
|
345
|
+
className: k.timeInput,
|
|
346
346
|
type: "time",
|
|
347
|
-
value:
|
|
348
|
-
onChange: (e) =>
|
|
347
|
+
value: V,
|
|
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(E, {
|
|
353
|
+
id: D,
|
|
354
354
|
children: p
|
|
355
355
|
}),
|
|
356
|
-
m && /* @__PURE__ */ t(
|
|
357
|
-
id:
|
|
356
|
+
m && /* @__PURE__ */ t(E, {
|
|
357
|
+
id: O,
|
|
358
358
|
variant: "error",
|
|
359
359
|
children: m
|
|
360
360
|
})
|
|
361
361
|
]
|
|
362
362
|
});
|
|
363
|
-
},
|
|
363
|
+
}, R = {
|
|
364
364
|
root: "_root_1q42e_1",
|
|
365
365
|
legend: "_legend_1q42e_3",
|
|
366
366
|
range: "_range_1q42e_5"
|
|
367
|
-
},
|
|
367
|
+
}, z = (e) => !!(e.from && e.to && e.from.getTime() <= e.to.getTime()), B = ({ 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), z(e) && r?.(e);
|
|
370
370
|
};
|
|
371
371
|
return /* @__PURE__ */ n("fieldset", {
|
|
372
|
-
className: `${
|
|
372
|
+
className: `${R.root} ${h}`,
|
|
373
373
|
disabled: f,
|
|
374
374
|
children: [/* @__PURE__ */ n("div", {
|
|
375
|
-
className:
|
|
376
|
-
children: [/* @__PURE__ */ t(
|
|
375
|
+
className: R.range,
|
|
376
|
+
children: [/* @__PURE__ */ t(L, {
|
|
377
377
|
value: e.from,
|
|
378
378
|
mode: a === "datetime" ? "datetime" : a,
|
|
379
379
|
label: o,
|
|
@@ -387,7 +387,7 @@ var D = {
|
|
|
387
387
|
...e,
|
|
388
388
|
from: t
|
|
389
389
|
})
|
|
390
|
-
}), /* @__PURE__ */ t(
|
|
390
|
+
}), /* @__PURE__ */ t(L, {
|
|
391
391
|
value: e.to,
|
|
392
392
|
mode: a === "datetime" ? "datetime" : a,
|
|
393
393
|
label: s,
|
|
@@ -402,9 +402,9 @@ var D = {
|
|
|
402
402
|
to: t
|
|
403
403
|
})
|
|
404
404
|
})]
|
|
405
|
-
}), c && !g && /* @__PURE__ */ t(
|
|
405
|
+
}), c && !g && /* @__PURE__ */ t(E, { children: c })]
|
|
406
406
|
});
|
|
407
|
-
},
|
|
407
|
+
}, V = {
|
|
408
408
|
group: "_group_1fs9e_1",
|
|
409
409
|
skeleton: "_skeleton_1fs9e_3",
|
|
410
410
|
text: "_text_1fs9e_5",
|
|
@@ -412,11 +412,11 @@ var D = {
|
|
|
412
412
|
circular: "_circular_1fs9e_9",
|
|
413
413
|
animated: "_animated_1fs9e_11",
|
|
414
414
|
"ds-skeleton": "_ds-skeleton_1fs9e_1"
|
|
415
|
-
},
|
|
416
|
-
className: `${
|
|
415
|
+
}, re = ({ 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
|
|
@@ -438,7 +438,7 @@ var D = {
|
|
|
438
438
|
message: "_message_dkn63_265",
|
|
439
439
|
error: "_error_dkn63_267",
|
|
440
440
|
errorState: "_errorState_dkn63_293"
|
|
441
|
-
},
|
|
441
|
+
}, ie = (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;
|
|
@@ -457,7 +457,7 @@ var D = {
|
|
|
457
457
|
};
|
|
458
458
|
}, [w]);
|
|
459
459
|
let P = (e, t) => {
|
|
460
|
-
let n =
|
|
460
|
+
let n = ie(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());
|
|
@@ -568,16 +568,16 @@ var D = {
|
|
|
568
568
|
})
|
|
569
569
|
]
|
|
570
570
|
});
|
|
571
|
-
},
|
|
571
|
+
}, ae = (e) => `${e.id}:${e.direction}`, oe = ({ 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: ae({
|
|
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: ae({
|
|
581
581
|
id: e.id,
|
|
582
582
|
direction: "desc"
|
|
583
583
|
}),
|
|
@@ -586,7 +586,7 @@ var D = {
|
|
|
586
586
|
}]);
|
|
587
587
|
return /* @__PURE__ */ t(U, {
|
|
588
588
|
options: c,
|
|
589
|
-
value: n ?
|
|
589
|
+
value: n ? ae(n) : "",
|
|
590
590
|
label: i,
|
|
591
591
|
placeholder: a,
|
|
592
592
|
disabled: o,
|
|
@@ -613,15 +613,10 @@ var D = {
|
|
|
613
613
|
default: "_default_1h9ti_41",
|
|
614
614
|
tableOnMobile: "_tableOnMobile_1h9ti_41",
|
|
615
615
|
wide: "_wide_1h9ti_45"
|
|
616
|
-
},
|
|
616
|
+
}, se = m({
|
|
617
617
|
rowSortingFeature: p,
|
|
618
|
-
sortedRowModel: f()
|
|
619
|
-
|
|
620
|
-
alphanumeric: m,
|
|
621
|
-
basic: h,
|
|
622
|
-
text: g
|
|
623
|
-
}
|
|
624
|
-
}), de = (e, t) => {
|
|
618
|
+
sortedRowModel: f()
|
|
619
|
+
}), ce = (e, t) => {
|
|
625
620
|
let n = /* @__PURE__ */ new Set();
|
|
626
621
|
for (let t of e) {
|
|
627
622
|
if (!t.id.trim()) return "Идентификатор колонки не может быть пустым";
|
|
@@ -633,29 +628,36 @@ var D = {
|
|
|
633
628
|
for (let t of e) if (typeof t.accessor == "string" && !(t.accessor in r)) return `В строке ${n + 1} отсутствует колонка «${t.id}»`;
|
|
634
629
|
}
|
|
635
630
|
return null;
|
|
636
|
-
},
|
|
631
|
+
}, le = (e, t) => typeof e == "function" ? e(t) : t[e], ue = (e) => {
|
|
637
632
|
if (e == null || e === "") return null;
|
|
638
633
|
let t = Date.parse(String(e));
|
|
639
634
|
return Number.isNaN(t) ? null : t;
|
|
640
|
-
},
|
|
641
|
-
let r =
|
|
635
|
+
}, de = (e, t, n) => {
|
|
636
|
+
let r = ue(e.getValue(n)), i = ue(t.getValue(n));
|
|
642
637
|
return r === null && i === null ? 0 : r === null ? -1 : i === null ? 1 : r - i;
|
|
643
|
-
},
|
|
638
|
+
}, fe = (e, t, n) => {
|
|
644
639
|
let r = e.getValue(n), i = t.getValue(n);
|
|
645
640
|
return r == null && i == null ? 0 : r == null ? -1 : i == null ? 1 : Number(r) - Number(i);
|
|
646
|
-
},
|
|
641
|
+
}, pe = (e, t, n) => {
|
|
647
642
|
let r = e.getValue(n), i = t.getValue(n);
|
|
648
643
|
return r == null && i == null ? 0 : r == null ? -1 : i == null ? 1 : Number(!!r) - Number(!!i);
|
|
649
|
-
},
|
|
644
|
+
}, me = (e, t, n) => {
|
|
645
|
+
let r = String(e.getValue(n) ?? ""), i = String(t.getValue(n) ?? "");
|
|
646
|
+
return r.localeCompare(i, void 0, {
|
|
647
|
+
numeric: !0,
|
|
648
|
+
sensitivity: "base"
|
|
649
|
+
});
|
|
650
|
+
}, he = (e) => {
|
|
650
651
|
switch (e) {
|
|
651
|
-
case "date": return
|
|
652
|
-
case "number": return
|
|
653
|
-
case "boolean": return
|
|
654
|
-
case "text":
|
|
655
|
-
|
|
652
|
+
case "date": return de;
|
|
653
|
+
case "number": return fe;
|
|
654
|
+
case "boolean": return pe;
|
|
655
|
+
case "text":
|
|
656
|
+
case void 0: return me;
|
|
657
|
+
case "custom": return;
|
|
656
658
|
}
|
|
657
|
-
},
|
|
658
|
-
let t =
|
|
659
|
+
}, ge = (e) => {
|
|
660
|
+
let t = (t) => le(e.accessor, t), n = e.sortFn ?? he(e.dataType), r = e.enableSorting ?? (e.dataType !== "custom" && n !== void 0), i = {
|
|
659
661
|
id: e.id,
|
|
660
662
|
accessorFn: t,
|
|
661
663
|
header: () => e.header,
|
|
@@ -663,13 +665,13 @@ var D = {
|
|
|
663
665
|
let n = t.getValue();
|
|
664
666
|
return e.cell?.(t.row.original, n) ?? String(n ?? "");
|
|
665
667
|
},
|
|
666
|
-
enableSorting:
|
|
668
|
+
enableSorting: r,
|
|
667
669
|
sortDescFirst: e.sortDescFirst
|
|
668
670
|
};
|
|
669
|
-
return
|
|
670
|
-
},
|
|
671
|
-
let [x, S] = d([]), C = o ?? x, w = l(() =>
|
|
672
|
-
features:
|
|
671
|
+
return n !== void 0 && (i.sortFn = n), i;
|
|
672
|
+
}, _e = ({ columns: e, data: r, tableOnMobile: i = !1, breakpoint: a = "default", sorting: o, onSortingChange: s, renderMobileCard: c, getRowId: u, caption: f, ariaLabel: p, loading: m = !1, error: g, emptyState: _ = "Нет данных", stickyHeader: v = !1, maxHeight: y, className: b = "" }) => {
|
|
673
|
+
let [x, S] = d([]), C = o ?? x, w = l(() => ce(e, r), [e, r]), T = l(() => e.map(ge), [e]), E = h({
|
|
674
|
+
features: se,
|
|
673
675
|
columns: T,
|
|
674
676
|
data: r,
|
|
675
677
|
state: { sorting: C },
|
|
@@ -678,7 +680,7 @@ var D = {
|
|
|
678
680
|
o === void 0 && S(t), s?.(t);
|
|
679
681
|
},
|
|
680
682
|
getRowId: u
|
|
681
|
-
}
|
|
683
|
+
}), D = E.getRowModel().rows, O = e.filter((e) => e.enableSorting ?? e.dataType !== "custom").map((e) => ({
|
|
682
684
|
id: e.id,
|
|
683
685
|
label: typeof e.header == "string" ? e.header : e.id
|
|
684
686
|
})), k = [
|
|
@@ -686,24 +688,22 @@ var D = {
|
|
|
686
688
|
a === "wide" ? W.wide : W.default,
|
|
687
689
|
i ? W.tableOnMobile : "",
|
|
688
690
|
b
|
|
689
|
-
].filter(Boolean).join(" "), A = w ??
|
|
691
|
+
].filter(Boolean).join(" "), A = w ?? g;
|
|
690
692
|
return /* @__PURE__ */ n("section", {
|
|
691
693
|
className: k,
|
|
692
694
|
"aria-busy": m,
|
|
693
695
|
children: [
|
|
694
|
-
!i && !m && !A && D.length > 0 && O.length > 0 && /* @__PURE__ */ t(
|
|
696
|
+
!i && !m && !A && D.length > 0 && O.length > 0 && /* @__PURE__ */ t(oe, {
|
|
695
697
|
className: W.mobileSort,
|
|
696
698
|
options: O,
|
|
697
699
|
value: C[0] ? {
|
|
698
700
|
id: C[0].id,
|
|
699
701
|
direction: C[0].desc ? "desc" : "asc"
|
|
700
702
|
} : null,
|
|
701
|
-
onChange: (e) => {
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
}]);
|
|
706
|
-
}
|
|
703
|
+
onChange: (e) => E.setSorting([{
|
|
704
|
+
id: e.id,
|
|
705
|
+
desc: e.direction === "desc"
|
|
706
|
+
}])
|
|
707
707
|
}),
|
|
708
708
|
/* @__PURE__ */ t("div", {
|
|
709
709
|
className: W.tableWrap,
|
|
@@ -714,7 +714,7 @@ var D = {
|
|
|
714
714
|
children: [
|
|
715
715
|
f && /* @__PURE__ */ t("caption", { children: f }),
|
|
716
716
|
/* @__PURE__ */ t("thead", {
|
|
717
|
-
className:
|
|
717
|
+
className: v ? W.sticky : "",
|
|
718
718
|
children: E.getHeaderGroups().map((e) => /* @__PURE__ */ t("tr", { children: e.headers.map((e) => {
|
|
719
719
|
let r = e.column.getIsSorted(), i = e.column.getCanSort(), a = e.column.getToggleSortingHandler();
|
|
720
720
|
return /* @__PURE__ */ t("th", {
|
|
@@ -735,7 +735,7 @@ var D = {
|
|
|
735
735
|
}),
|
|
736
736
|
/* @__PURE__ */ t("tbody", { children: m ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
737
737
|
colSpan: e.length,
|
|
738
|
-
children: /* @__PURE__ */ t(
|
|
738
|
+
children: /* @__PURE__ */ t(re, { lines: 3 })
|
|
739
739
|
}) }) : A ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
740
740
|
className: W.state,
|
|
741
741
|
colSpan: e.length,
|
|
@@ -743,7 +743,7 @@ var D = {
|
|
|
743
743
|
}) }) : D.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
744
744
|
className: W.state,
|
|
745
745
|
colSpan: e.length,
|
|
746
|
-
children:
|
|
746
|
+
children: _
|
|
747
747
|
}) }) : D.map((e) => /* @__PURE__ */ t("tr", { children: e.getAllCells().map((e) => /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t(E.FlexRender, { cell: e }) }, e.id)) }, e.id)) })
|
|
748
748
|
]
|
|
749
749
|
})
|
|
@@ -752,12 +752,12 @@ var D = {
|
|
|
752
752
|
className: W.cards,
|
|
753
753
|
role: "list",
|
|
754
754
|
"aria-label": p ?? f,
|
|
755
|
-
children: m ? /* @__PURE__ */ t(
|
|
755
|
+
children: m ? /* @__PURE__ */ t(re, { lines: 4 }) : A ? /* @__PURE__ */ t("div", {
|
|
756
756
|
className: W.state,
|
|
757
757
|
children: A
|
|
758
758
|
}) : D.length === 0 ? /* @__PURE__ */ t("div", {
|
|
759
759
|
className: W.state,
|
|
760
|
-
children:
|
|
760
|
+
children: _
|
|
761
761
|
}) : D.map((r) => {
|
|
762
762
|
if (c) return /* @__PURE__ */ t("div", {
|
|
763
763
|
role: "listitem",
|
|
@@ -766,7 +766,7 @@ var D = {
|
|
|
766
766
|
columns: e
|
|
767
767
|
})
|
|
768
768
|
}, r.id);
|
|
769
|
-
let i = e.filter((e) => !e.mobile?.hideOnMobile).sort((e, t) => (e.mobile?.mobileOrder ?? 0) - (t.mobile?.mobileOrder ?? 0)), a = i.find((e) => e.mobile?.primary) ?? i.find((e) => e.mobile?.mobileVariant !== "actions"), o = (e) =>
|
|
769
|
+
let i = e.filter((e) => !e.mobile?.hideOnMobile).sort((e, t) => (e.mobile?.mobileOrder ?? 0) - (t.mobile?.mobileOrder ?? 0)), a = i.find((e) => e.mobile?.primary) ?? i.find((e) => e.mobile?.mobileVariant !== "actions"), o = (e) => le(e.accessor, r.original), s = (e) => e.mobile?.renderMobile?.(r.original, o(e)) ?? e.cell?.(r.original, o(e)) ?? String(o(e) ?? "");
|
|
770
770
|
return /* @__PURE__ */ n("article", {
|
|
771
771
|
role: "listitem",
|
|
772
772
|
className: W.card,
|
|
@@ -783,7 +783,7 @@ var D = {
|
|
|
783
783
|
})
|
|
784
784
|
]
|
|
785
785
|
});
|
|
786
|
-
},
|
|
786
|
+
}, ve = ({ 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 }) => {
|
|
787
787
|
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;
|
|
788
788
|
s(() => {
|
|
789
789
|
let e = (e) => {
|
|
@@ -800,7 +800,7 @@ var D = {
|
|
|
800
800
|
let n = r.includes(t.value) ? r.filter((e) => e !== t.value) : [...r, t.value];
|
|
801
801
|
i?.(n, e.filter((e) => n.includes(e.value))), v && (C(!1), T.current?.focus());
|
|
802
802
|
}, M = (t, n) => {
|
|
803
|
-
let r =
|
|
803
|
+
let r = ie(e, t, n);
|
|
804
804
|
E.current[r]?.focus(), E.current[r]?.scrollIntoView({ block: "nearest" });
|
|
805
805
|
};
|
|
806
806
|
return /* @__PURE__ */ n("div", {
|
|
@@ -901,7 +901,7 @@ var D = {
|
|
|
901
901
|
})
|
|
902
902
|
]
|
|
903
903
|
});
|
|
904
|
-
},
|
|
904
|
+
}, ye = {
|
|
905
905
|
approve: "M4 12l5 5L20 6",
|
|
906
906
|
reject: "M5 5l14 14M19 5L5 19",
|
|
907
907
|
edit: "M4 20h4L19 9l-4-4L4 16v4z",
|
|
@@ -910,7 +910,7 @@ var D = {
|
|
|
910
910
|
basket: "M4 7h16l-1 13H5L4 7zm3 0V4h10v3",
|
|
911
911
|
info: "M12 10v7m0-10v.01",
|
|
912
912
|
warning: "M12 4L3 20h18L12 4zm0 5v5m0 3v.01"
|
|
913
|
-
},
|
|
913
|
+
}, be = ({ name: e, title: r, width: i = 24, height: a = 24, ...o }) => /* @__PURE__ */ n("svg", {
|
|
914
914
|
viewBox: "0 0 24 24",
|
|
915
915
|
width: i,
|
|
916
916
|
height: a,
|
|
@@ -923,14 +923,14 @@ var D = {
|
|
|
923
923
|
"aria-hidden": !r || void 0,
|
|
924
924
|
focusable: "false",
|
|
925
925
|
...o,
|
|
926
|
-
children: [r && /* @__PURE__ */ t("title", { children: r }), /* @__PURE__ */ t("path", { d:
|
|
926
|
+
children: [r && /* @__PURE__ */ t("title", { children: r }), /* @__PURE__ */ t("path", { d: ye[e] })]
|
|
927
927
|
}), G = {
|
|
928
928
|
root: "_root_1y2s8_1",
|
|
929
929
|
header: "_header_1y2s8_21",
|
|
930
930
|
title: "_title_1y2s8_41",
|
|
931
931
|
dismiss: "_dismiss_1y2s8_55",
|
|
932
932
|
content: "_content_1y2s8_113"
|
|
933
|
-
},
|
|
933
|
+
}, xe = ({ title: e, children: r, dismissible: i = !1, onDismiss: a, dismissLabel: o = "Закрыть информационный блок", headingAs: s = "h3", className: l = "" }) => {
|
|
934
934
|
let u = `ds-info-block-${c()}`;
|
|
935
935
|
return /* @__PURE__ */ n("section", {
|
|
936
936
|
className: `${G.root} ${l}`,
|
|
@@ -970,14 +970,14 @@ var D = {
|
|
|
970
970
|
disabledText: "_disabledText_1tz82_5",
|
|
971
971
|
inputError: "_inputError_1tz82_11",
|
|
972
972
|
trailingAction: "_trailingAction_1tz82_13"
|
|
973
|
-
},
|
|
974
|
-
let
|
|
973
|
+
}, Se = ({ 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: D, ...O }) => {
|
|
974
|
+
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, ee = String(e ?? ""), I = [P, F].filter(Boolean).join(" ") || void 0, te = S ? M ? "text" : "password" : i;
|
|
975
975
|
return s(() => {
|
|
976
976
|
S || N(!1);
|
|
977
977
|
}, [S]), /* @__PURE__ */ n("div", {
|
|
978
978
|
className: `${K.wrapper} ${g}`,
|
|
979
979
|
children: [
|
|
980
|
-
p && /* @__PURE__ */ t(
|
|
980
|
+
p && /* @__PURE__ */ t(T, {
|
|
981
981
|
htmlFor: A,
|
|
982
982
|
required: b,
|
|
983
983
|
disabled: o,
|
|
@@ -986,8 +986,8 @@ var D = {
|
|
|
986
986
|
o && f ? /* @__PURE__ */ t("div", {
|
|
987
987
|
id: A,
|
|
988
988
|
className: K.disabledText,
|
|
989
|
-
"aria-describedby":
|
|
990
|
-
children:
|
|
989
|
+
"aria-describedby": I,
|
|
990
|
+
children: ee || a
|
|
991
991
|
}) : /* @__PURE__ */ n("div", {
|
|
992
992
|
className: K.control,
|
|
993
993
|
children: [
|
|
@@ -995,14 +995,14 @@ var D = {
|
|
|
995
995
|
ref: j,
|
|
996
996
|
id: A,
|
|
997
997
|
name: _,
|
|
998
|
-
type:
|
|
999
|
-
value:
|
|
998
|
+
type: te,
|
|
999
|
+
value: ee,
|
|
1000
1000
|
placeholder: a,
|
|
1001
1001
|
disabled: o,
|
|
1002
1002
|
readOnly: l,
|
|
1003
1003
|
required: b,
|
|
1004
1004
|
"aria-invalid": !!m,
|
|
1005
|
-
"aria-describedby":
|
|
1005
|
+
"aria-describedby": I,
|
|
1006
1006
|
className: `${K.input} ${m ? K.inputError : ""}`,
|
|
1007
1007
|
onChange: (e) => {
|
|
1008
1008
|
if (i === "number" && !S) {
|
|
@@ -1013,9 +1013,9 @@ var D = {
|
|
|
1013
1013
|
r?.(e.target.value, e);
|
|
1014
1014
|
},
|
|
1015
1015
|
onFocus: (e) => {
|
|
1016
|
-
x && e.currentTarget.value && e.currentTarget.select(),
|
|
1016
|
+
x && e.currentTarget.value && e.currentTarget.select(), D?.(e);
|
|
1017
1017
|
},
|
|
1018
|
-
...
|
|
1018
|
+
...O
|
|
1019
1019
|
}),
|
|
1020
1020
|
S && /* @__PURE__ */ t("button", {
|
|
1021
1021
|
type: "button",
|
|
@@ -1038,7 +1038,7 @@ var D = {
|
|
|
1038
1038
|
})]
|
|
1039
1039
|
})
|
|
1040
1040
|
}),
|
|
1041
|
-
!S && y &&
|
|
1041
|
+
!S && y && ee && !o && !l && /* @__PURE__ */ t("button", {
|
|
1042
1042
|
type: "button",
|
|
1043
1043
|
className: K.trailingAction,
|
|
1044
1044
|
"aria-label": "Очистить поле",
|
|
@@ -1050,11 +1050,11 @@ var D = {
|
|
|
1050
1050
|
})
|
|
1051
1051
|
]
|
|
1052
1052
|
}),
|
|
1053
|
-
h && !m && /* @__PURE__ */ t(
|
|
1053
|
+
h && !m && /* @__PURE__ */ t(E, {
|
|
1054
1054
|
id: P,
|
|
1055
1055
|
children: h
|
|
1056
1056
|
}),
|
|
1057
|
-
m && /* @__PURE__ */ t(
|
|
1057
|
+
m && /* @__PURE__ */ t(E, {
|
|
1058
1058
|
id: F,
|
|
1059
1059
|
variant: "error",
|
|
1060
1060
|
children: m
|
|
@@ -1068,7 +1068,7 @@ var D = {
|
|
|
1068
1068
|
thumb: "_thumb_vu1ob_67",
|
|
1069
1069
|
label: "_label_vu1ob_111",
|
|
1070
1070
|
disabled: "_disabled_vu1ob_123"
|
|
1071
|
-
},
|
|
1071
|
+
}, Ce = ({ checked: e, onChange: r, label: i, disabled: a = !1, readOnly: o = !1, className: s = "", name: l, id: u, value: d }) => {
|
|
1072
1072
|
let f = c(), p = u ?? `ds-radio-button-${l ?? f}`;
|
|
1073
1073
|
return /* @__PURE__ */ n("label", {
|
|
1074
1074
|
htmlFor: p,
|
|
@@ -1099,11 +1099,11 @@ var D = {
|
|
|
1099
1099
|
})
|
|
1100
1100
|
]
|
|
1101
1101
|
});
|
|
1102
|
-
},
|
|
1102
|
+
}, we = {
|
|
1103
1103
|
root: "_root_kepgo_1",
|
|
1104
1104
|
grid: "_grid_kepgo_3",
|
|
1105
1105
|
actions: "_actions_kepgo_5"
|
|
1106
|
-
},
|
|
1106
|
+
}, Te = ({ filters: e, values: r, onChange: i, onApply: a, onReset: o, applyMode: s = "instant", loading: c = !1, disabled: l = !1, className: u = "" }) => {
|
|
1107
1107
|
let d = (e, t) => {
|
|
1108
1108
|
let n = {
|
|
1109
1109
|
...r,
|
|
@@ -1112,11 +1112,11 @@ var D = {
|
|
|
1112
1112
|
i?.(n, e), s === "instant" && a?.(n);
|
|
1113
1113
|
};
|
|
1114
1114
|
return /* @__PURE__ */ n("section", {
|
|
1115
|
-
className: `${
|
|
1115
|
+
className: `${we.root} ${u}`,
|
|
1116
1116
|
"aria-label": "Фильтры",
|
|
1117
1117
|
"aria-busy": c,
|
|
1118
1118
|
children: [/* @__PURE__ */ t("div", {
|
|
1119
|
-
className:
|
|
1119
|
+
className: we.grid,
|
|
1120
1120
|
children: e.filter((e) => !e.hidden).map((e) => {
|
|
1121
1121
|
let n = l || c || e.disabled, i = r[e.id];
|
|
1122
1122
|
if (e.type === "input") {
|
|
@@ -1127,12 +1127,12 @@ var D = {
|
|
|
1127
1127
|
placeholder: e.placeholder,
|
|
1128
1128
|
disabled: n
|
|
1129
1129
|
};
|
|
1130
|
-
return e.inputType === "number" ? /* @__PURE__ */ t(
|
|
1130
|
+
return e.inputType === "number" ? /* @__PURE__ */ t(Se, {
|
|
1131
1131
|
...r,
|
|
1132
1132
|
type: "number",
|
|
1133
1133
|
value: i ?? "",
|
|
1134
1134
|
onChange: (t) => d(e.id, t)
|
|
1135
|
-
}) : /* @__PURE__ */ t(
|
|
1135
|
+
}) : /* @__PURE__ */ t(Se, {
|
|
1136
1136
|
...r,
|
|
1137
1137
|
type: "text",
|
|
1138
1138
|
value: String(i ?? ""),
|
|
@@ -1148,7 +1148,7 @@ var D = {
|
|
|
1148
1148
|
disabled: n,
|
|
1149
1149
|
onChange: (t) => d(e.id, t)
|
|
1150
1150
|
}, e.id);
|
|
1151
|
-
if (e.type === "multiple") return /* @__PURE__ */ t(
|
|
1151
|
+
if (e.type === "multiple") return /* @__PURE__ */ t(ve, {
|
|
1152
1152
|
label: e.label,
|
|
1153
1153
|
hint: e.hint,
|
|
1154
1154
|
placeholder: e.placeholder,
|
|
@@ -1157,14 +1157,14 @@ var D = {
|
|
|
1157
1157
|
disabled: n,
|
|
1158
1158
|
onChange: (t) => d(e.id, t)
|
|
1159
1159
|
}, e.id);
|
|
1160
|
-
if (e.type === "checkbox") return /* @__PURE__ */ t(
|
|
1160
|
+
if (e.type === "checkbox") return /* @__PURE__ */ t(O, {
|
|
1161
1161
|
label: e.label,
|
|
1162
1162
|
hint: e.hint,
|
|
1163
1163
|
checked: !!i,
|
|
1164
1164
|
disabled: n,
|
|
1165
1165
|
onChange: (t) => d(e.id, t)
|
|
1166
1166
|
}, e.id);
|
|
1167
|
-
if (e.type === "radio") return /* @__PURE__ */ t(
|
|
1167
|
+
if (e.type === "radio") return /* @__PURE__ */ t(Ce, {
|
|
1168
1168
|
label: e.label,
|
|
1169
1169
|
checked: !!i,
|
|
1170
1170
|
disabled: n,
|
|
@@ -1174,7 +1174,7 @@ var D = {
|
|
|
1174
1174
|
from: null,
|
|
1175
1175
|
to: null
|
|
1176
1176
|
};
|
|
1177
|
-
return /* @__PURE__ */ t(
|
|
1177
|
+
return /* @__PURE__ */ t(B, {
|
|
1178
1178
|
hint: e.hint,
|
|
1179
1179
|
mode: e.mode,
|
|
1180
1180
|
min: e.min,
|
|
@@ -1185,13 +1185,13 @@ var D = {
|
|
|
1185
1185
|
}, e.id);
|
|
1186
1186
|
})
|
|
1187
1187
|
}), (o || s === "manual") && /* @__PURE__ */ n("div", {
|
|
1188
|
-
className:
|
|
1189
|
-
children: [o && /* @__PURE__ */ t(
|
|
1188
|
+
className: we.actions,
|
|
1189
|
+
children: [o && /* @__PURE__ */ t(C, {
|
|
1190
1190
|
variant: "destructiveOutline",
|
|
1191
1191
|
disabled: l || c,
|
|
1192
1192
|
onClick: o,
|
|
1193
1193
|
children: "Сбросить"
|
|
1194
|
-
}), s === "manual" && /* @__PURE__ */ t(
|
|
1194
|
+
}), s === "manual" && /* @__PURE__ */ t(C, {
|
|
1195
1195
|
isLoading: c,
|
|
1196
1196
|
disabled: l,
|
|
1197
1197
|
onClick: () => a?.(r),
|
|
@@ -1213,25 +1213,25 @@ var D = {
|
|
|
1213
1213
|
file: "_file_1ymdr_19",
|
|
1214
1214
|
fileName: "_fileName_1ymdr_23",
|
|
1215
1215
|
fileSize: "_fileSize_1ymdr_25"
|
|
1216
|
-
},
|
|
1217
|
-
let
|
|
1218
|
-
let t = [], n = new Set(r.map(
|
|
1216
|
+
}, Ee = (e) => `${e.name}:${e.size}:${e.lastModified}`, De = (e) => e < 1024 ? `${e} Б` : e < 1048576 ? `${(e / 1024).toFixed(1)} КБ` : `${(e / 1024 / 1024).toFixed(1)} МБ`, Oe = (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: f, hint: p, error: m, required: h = !1, disabled: g = !1, readOnly: _ = !1, name: v, id: y, className: b = "", dropLabel: x = "Перетащите файлы в эту область", browseLabel: S = "Выбрать файлы", addMoreLabel: w = "Добавить ещё", onReject: D }) => {
|
|
1217
|
+
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, ee = [P, F].filter(Boolean).join(" ") || void 0, I = !g && !_, te = (e) => {
|
|
1218
|
+
let t = [], n = new Set(r.map(Ee)), c = e.filter((e) => Oe(e, o) ? s !== void 0 && e.size > s ? (t.push({
|
|
1219
1219
|
file: e,
|
|
1220
1220
|
reason: "maxSize"
|
|
1221
|
-
}), !1) : !n.has(
|
|
1221
|
+
}), !1) : !n.has(Ee(e)) && (n.add(Ee(e)), !0) : (t.push({
|
|
1222
1222
|
file: e,
|
|
1223
1223
|
reason: "accept"
|
|
1224
1224
|
}), !1)), u = a ? l : 1, d = a ? [...r, ...c] : c.slice(-1);
|
|
1225
1225
|
u !== void 0 && d.length > u && (d.slice(u).forEach((e) => t.push({
|
|
1226
1226
|
file: e,
|
|
1227
1227
|
reason: "maxFiles"
|
|
1228
|
-
})), d = d.slice(0, u)), t.length &&
|
|
1228
|
+
})), d = d.slice(0, u)), t.length && D?.(t), c.length && i?.(d), A.current && (A.current.value = "");
|
|
1229
1229
|
};
|
|
1230
1230
|
return /* @__PURE__ */ n("div", {
|
|
1231
1231
|
className: `${J.wrapper} ${b}`,
|
|
1232
1232
|
children: [
|
|
1233
|
-
f && /* @__PURE__ */ t(
|
|
1234
|
-
htmlFor:
|
|
1233
|
+
f && /* @__PURE__ */ t(T, {
|
|
1234
|
+
htmlFor: k,
|
|
1235
1235
|
required: h,
|
|
1236
1236
|
disabled: g,
|
|
1237
1237
|
children: f
|
|
@@ -1239,28 +1239,28 @@ var D = {
|
|
|
1239
1239
|
/* @__PURE__ */ n("div", {
|
|
1240
1240
|
className: `${J.dropzone} ${M ? J.dragActive : ""} ${g ? J.disabled : ""} ${m ? J.error : ""}`,
|
|
1241
1241
|
onDragEnter: (e) => {
|
|
1242
|
-
e.preventDefault(),
|
|
1242
|
+
e.preventDefault(), I && ++j.current === 1 && N(!0);
|
|
1243
1243
|
},
|
|
1244
1244
|
onDragOver: (e) => e.preventDefault(),
|
|
1245
1245
|
onDragLeave: (e) => {
|
|
1246
1246
|
e.preventDefault(), --j.current <= 0 && (j.current = 0, N(!1));
|
|
1247
1247
|
},
|
|
1248
1248
|
onDrop: (e) => {
|
|
1249
|
-
e.preventDefault(), j.current = 0, N(!1),
|
|
1249
|
+
e.preventDefault(), j.current = 0, N(!1), I && te(Array.from(e.dataTransfer.files));
|
|
1250
1250
|
},
|
|
1251
1251
|
children: [/* @__PURE__ */ t("input", {
|
|
1252
1252
|
ref: A,
|
|
1253
|
-
id:
|
|
1253
|
+
id: k,
|
|
1254
1254
|
name: v,
|
|
1255
1255
|
className: J.nativeInput,
|
|
1256
1256
|
type: "file",
|
|
1257
1257
|
multiple: a,
|
|
1258
1258
|
accept: o,
|
|
1259
1259
|
required: h && r.length === 0,
|
|
1260
|
-
disabled: !
|
|
1261
|
-
"aria-describedby":
|
|
1260
|
+
disabled: !I,
|
|
1261
|
+
"aria-describedby": ee,
|
|
1262
1262
|
"aria-invalid": !!m,
|
|
1263
|
-
onChange: (e) =>
|
|
1263
|
+
onChange: (e) => te(Array.from(e.target.files ?? []))
|
|
1264
1264
|
}), r.length ? /* @__PURE__ */ n(e, { children: [
|
|
1265
1265
|
/* @__PURE__ */ t("ul", {
|
|
1266
1266
|
className: J.files,
|
|
@@ -1275,9 +1275,9 @@ var D = {
|
|
|
1275
1275
|
}),
|
|
1276
1276
|
/* @__PURE__ */ t("span", {
|
|
1277
1277
|
className: J.fileSize,
|
|
1278
|
-
children:
|
|
1278
|
+
children: De(e.size)
|
|
1279
1279
|
}),
|
|
1280
|
-
|
|
1280
|
+
I && /* @__PURE__ */ t(C, {
|
|
1281
1281
|
variant: "empty",
|
|
1282
1282
|
size: "sm",
|
|
1283
1283
|
"aria-label": `Удалить файл ${e.name}`,
|
|
@@ -1285,15 +1285,15 @@ var D = {
|
|
|
1285
1285
|
children: "×"
|
|
1286
1286
|
})
|
|
1287
1287
|
]
|
|
1288
|
-
},
|
|
1288
|
+
}, Ee(e)))
|
|
1289
1289
|
}),
|
|
1290
|
-
|
|
1290
|
+
I && (a || r.length === 0) && /* @__PURE__ */ t(C, {
|
|
1291
1291
|
className: J.browseButton,
|
|
1292
1292
|
size: "sm",
|
|
1293
1293
|
onClick: () => A.current?.click(),
|
|
1294
|
-
children:
|
|
1294
|
+
children: w
|
|
1295
1295
|
}),
|
|
1296
|
-
|
|
1296
|
+
I && !a && /* @__PURE__ */ t(C, {
|
|
1297
1297
|
className: J.browseButton,
|
|
1298
1298
|
size: "sm",
|
|
1299
1299
|
onClick: () => A.current?.click(),
|
|
@@ -1308,7 +1308,7 @@ var D = {
|
|
|
1308
1308
|
children: "↑"
|
|
1309
1309
|
}),
|
|
1310
1310
|
/* @__PURE__ */ t("strong", { children: M ? "Отпустите файлы здесь" : x }),
|
|
1311
|
-
!M &&
|
|
1311
|
+
!M && I && /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", { children: "или" }), /* @__PURE__ */ t(C, {
|
|
1312
1312
|
className: J.browseButton,
|
|
1313
1313
|
onClick: () => A.current?.click(),
|
|
1314
1314
|
children: S
|
|
@@ -1316,11 +1316,11 @@ var D = {
|
|
|
1316
1316
|
]
|
|
1317
1317
|
})]
|
|
1318
1318
|
}),
|
|
1319
|
-
p && !m && /* @__PURE__ */ t(
|
|
1319
|
+
p && !m && /* @__PURE__ */ t(E, {
|
|
1320
1320
|
id: P,
|
|
1321
1321
|
children: p
|
|
1322
1322
|
}),
|
|
1323
|
-
m && /* @__PURE__ */ t(
|
|
1323
|
+
m && /* @__PURE__ */ t(E, {
|
|
1324
1324
|
id: F,
|
|
1325
1325
|
variant: "error",
|
|
1326
1326
|
live: !0,
|
|
@@ -1328,11 +1328,11 @@ var D = {
|
|
|
1328
1328
|
})
|
|
1329
1329
|
]
|
|
1330
1330
|
});
|
|
1331
|
-
},
|
|
1331
|
+
}, Ae = 0, Y = _((e) => ({
|
|
1332
1332
|
modals: [],
|
|
1333
1333
|
openModal: (t, n = {}, r = {}) => {
|
|
1334
|
-
|
|
1335
|
-
let i = `ds-modal-${
|
|
1334
|
+
Ae += 1;
|
|
1335
|
+
let i = `ds-modal-${Ae}`;
|
|
1336
1336
|
return e((e) => ({ modals: [...e.modals, {
|
|
1337
1337
|
id: i,
|
|
1338
1338
|
name: t,
|
|
@@ -1344,7 +1344,7 @@ var D = {
|
|
|
1344
1344
|
closeModal: (t) => e((e) => ({ modals: e.modals.filter((e) => e.id !== t) })),
|
|
1345
1345
|
closeTopModal: () => e((e) => ({ modals: e.modals.slice(0, -1) })),
|
|
1346
1346
|
closeAllModals: () => e({ modals: [] })
|
|
1347
|
-
})),
|
|
1347
|
+
})), je = () => Y.setState({ modals: [] }), X = {
|
|
1348
1348
|
layer: "_layer_1nb2z_1",
|
|
1349
1349
|
backdrop: "_backdrop_1nb2z_3",
|
|
1350
1350
|
panel: "_panel_1nb2z_5",
|
|
@@ -1352,11 +1352,11 @@ var D = {
|
|
|
1352
1352
|
title: "_title_1nb2z_11",
|
|
1353
1353
|
description: "_description_1nb2z_13",
|
|
1354
1354
|
content: "_content_1nb2z_15"
|
|
1355
|
-
},
|
|
1355
|
+
}, Me = "button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"])", Ne = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "Закрыть модальное окно", className: l = "", role: d = "dialog" }) => {
|
|
1356
1356
|
let f = c(), p = c(), m = u(null), h = Y((e) => e.closeModal);
|
|
1357
1357
|
return s(() => {
|
|
1358
1358
|
let e = document.activeElement, t = m.current;
|
|
1359
|
-
return (t?.querySelector(
|
|
1359
|
+
return (t?.querySelector(Me) ?? t)?.focus(), () => e?.focus();
|
|
1360
1360
|
}, []), /* @__PURE__ */ n("div", {
|
|
1361
1361
|
ref: m,
|
|
1362
1362
|
className: `${X.panel} ${l}`,
|
|
@@ -1367,7 +1367,7 @@ var D = {
|
|
|
1367
1367
|
tabIndex: -1,
|
|
1368
1368
|
onKeyDown: (e) => {
|
|
1369
1369
|
if (e.key !== "Tab") return;
|
|
1370
|
-
let t = Array.from(m.current?.querySelectorAll(
|
|
1370
|
+
let t = Array.from(m.current?.querySelectorAll(Me) ?? []);
|
|
1371
1371
|
if (!t.length) {
|
|
1372
1372
|
e.preventDefault();
|
|
1373
1373
|
return;
|
|
@@ -1382,7 +1382,7 @@ var D = {
|
|
|
1382
1382
|
id: f,
|
|
1383
1383
|
className: X.title,
|
|
1384
1384
|
children: r
|
|
1385
|
-
}), /* @__PURE__ */ t(
|
|
1385
|
+
}), /* @__PURE__ */ t(C, {
|
|
1386
1386
|
variant: "empty",
|
|
1387
1387
|
size: "sm",
|
|
1388
1388
|
"aria-label": o,
|
|
@@ -1401,7 +1401,7 @@ var D = {
|
|
|
1401
1401
|
})
|
|
1402
1402
|
]
|
|
1403
1403
|
});
|
|
1404
|
-
},
|
|
1404
|
+
}, Pe = ({ registry: e }) => {
|
|
1405
1405
|
let n = Y((e) => e.modals), r = Y((e) => e.closeModal), i = Y((e) => e.closeAllModals);
|
|
1406
1406
|
return s(() => {
|
|
1407
1407
|
let e = (e) => {
|
|
@@ -1410,7 +1410,7 @@ var D = {
|
|
|
1410
1410
|
t?.closeOnEscape && r(t.id);
|
|
1411
1411
|
};
|
|
1412
1412
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
1413
|
-
}, [r]), !n.length || typeof document > "u" ? null :
|
|
1413
|
+
}, [r]), !n.length || typeof document > "u" ? null : g(/* @__PURE__ */ t("div", {
|
|
1414
1414
|
className: X.layer,
|
|
1415
1415
|
"aria-label": "Модальные окна",
|
|
1416
1416
|
children: n.map((a, o) => {
|
|
@@ -1430,7 +1430,7 @@ var D = {
|
|
|
1430
1430
|
}, a.id) : null;
|
|
1431
1431
|
})
|
|
1432
1432
|
}), document.body);
|
|
1433
|
-
},
|
|
1433
|
+
}, Fe = ({ registry: r, children: i, lockBodyScroll: a = !0 }) => {
|
|
1434
1434
|
let o = Y((e) => e.modals.length);
|
|
1435
1435
|
return s(() => {
|
|
1436
1436
|
if (!a || o === 0) return;
|
|
@@ -1438,68 +1438,68 @@ var D = {
|
|
|
1438
1438
|
return document.body.style.overflow = "hidden", () => {
|
|
1439
1439
|
document.body.style.overflow = e;
|
|
1440
1440
|
};
|
|
1441
|
-
}, [a, o]), /* @__PURE__ */ n(e, { children: [i, /* @__PURE__ */ t(
|
|
1442
|
-
},
|
|
1441
|
+
}, [a, o]), /* @__PURE__ */ n(e, { children: [i, /* @__PURE__ */ t(Pe, { registry: r })] });
|
|
1442
|
+
}, Ie = (e) => e, Le = {
|
|
1443
1443
|
message: "_message_1vtru_1",
|
|
1444
1444
|
actions: "_actions_1vtru_3"
|
|
1445
|
-
},
|
|
1445
|
+
}, Re = /* @__PURE__ */ new Map(), ze = 0, Be = ({ modalId: e, close: r, title: i = "Подтверждение", message: a = "Продолжить действие?", confirmLabel: o = "Подтвердить", cancelLabel: s = "Отмена", tone: c = "default", requestId: l }) => {
|
|
1446
1446
|
let u = (e) => {
|
|
1447
|
-
|
|
1447
|
+
Re.get(l)?.(e), Re.delete(l), r();
|
|
1448
1448
|
};
|
|
1449
|
-
return /* @__PURE__ */ n(
|
|
1449
|
+
return /* @__PURE__ */ n(Ne, {
|
|
1450
1450
|
modalId: e,
|
|
1451
1451
|
title: i,
|
|
1452
1452
|
role: "alertdialog",
|
|
1453
1453
|
children: [/* @__PURE__ */ t("p", {
|
|
1454
|
-
className:
|
|
1454
|
+
className: Le.message,
|
|
1455
1455
|
children: a
|
|
1456
1456
|
}), /* @__PURE__ */ n("div", {
|
|
1457
|
-
className:
|
|
1458
|
-
children: [/* @__PURE__ */ t(
|
|
1457
|
+
className: Le.actions,
|
|
1458
|
+
children: [/* @__PURE__ */ t(C, {
|
|
1459
1459
|
variant: "outline",
|
|
1460
1460
|
onClick: () => u(!1),
|
|
1461
1461
|
children: s
|
|
1462
|
-
}), /* @__PURE__ */ t(
|
|
1462
|
+
}), /* @__PURE__ */ t(C, {
|
|
1463
1463
|
variant: c === "danger" ? "destructive" : "primary",
|
|
1464
1464
|
onClick: () => u(!0),
|
|
1465
1465
|
children: o
|
|
1466
1466
|
})]
|
|
1467
1467
|
})]
|
|
1468
1468
|
});
|
|
1469
|
-
},
|
|
1469
|
+
}, Ve = ({ modalId: e, close: r, title: i = "Ошибка", message: a, closeLabel: o = "Закрыть" }) => /* @__PURE__ */ n(Ne, {
|
|
1470
1470
|
modalId: e,
|
|
1471
1471
|
title: i,
|
|
1472
1472
|
role: "alertdialog",
|
|
1473
1473
|
children: [/* @__PURE__ */ t("p", {
|
|
1474
|
-
className:
|
|
1474
|
+
className: Le.message,
|
|
1475
1475
|
children: a
|
|
1476
1476
|
}), /* @__PURE__ */ t("div", {
|
|
1477
|
-
className:
|
|
1478
|
-
children: /* @__PURE__ */ t(
|
|
1477
|
+
className: Le.actions,
|
|
1478
|
+
children: /* @__PURE__ */ t(C, {
|
|
1479
1479
|
onClick: r,
|
|
1480
1480
|
children: o
|
|
1481
1481
|
})
|
|
1482
1482
|
})]
|
|
1483
|
-
}),
|
|
1484
|
-
ConfirmModal:
|
|
1485
|
-
ErrorModal:
|
|
1486
|
-
}),
|
|
1483
|
+
}), He = Ie({
|
|
1484
|
+
ConfirmModal: Be,
|
|
1485
|
+
ErrorModal: Ve
|
|
1486
|
+
}), Ue = () => {
|
|
1487
1487
|
let e = Y((e) => e.openModal);
|
|
1488
1488
|
return (t = {}) => new Promise((n) => {
|
|
1489
|
-
|
|
1490
|
-
let r = `confirm-${
|
|
1491
|
-
|
|
1489
|
+
ze += 1;
|
|
1490
|
+
let r = `confirm-${ze}`;
|
|
1491
|
+
Re.set(r, n), e("ConfirmModal", {
|
|
1492
1492
|
...t,
|
|
1493
1493
|
requestId: r
|
|
1494
1494
|
}, { closeOnEscape: !1 });
|
|
1495
1495
|
});
|
|
1496
|
-
},
|
|
1496
|
+
}, We = (e) => e instanceof Error ? e.message : typeof e == "string" ? e : e && typeof e == "object" && "message" in e && typeof e.message == "string" ? e.message : "Произошла неизвестная ошибка", Ge = () => {
|
|
1497
1497
|
let e = Y((e) => e.openModal);
|
|
1498
1498
|
return { showError: (t, n) => e("ErrorModal", {
|
|
1499
1499
|
title: n,
|
|
1500
|
-
message:
|
|
1500
|
+
message: We(t)
|
|
1501
1501
|
}) };
|
|
1502
|
-
},
|
|
1502
|
+
}, Ke = _(() => ({})), qe = _(() => ({})), Je = () => {
|
|
1503
1503
|
let e = Y((e) => e.modals), t = Y((e) => e.openModal);
|
|
1504
1504
|
return {
|
|
1505
1505
|
openModal: (e, n = {}, r) => t(e, n, r),
|
|
@@ -1509,16 +1509,16 @@ var D = {
|
|
|
1509
1509
|
isOpen: (t) => e.some((e) => e.name === t),
|
|
1510
1510
|
count: e.length
|
|
1511
1511
|
};
|
|
1512
|
-
},
|
|
1513
|
-
className: `${
|
|
1512
|
+
}, Ye = { root: "_root_1x7h7_1" }, Xe = ({ label: e = "Загрузка страницы", className: r = "" }) => /* @__PURE__ */ n("div", {
|
|
1513
|
+
className: `${Ye.root} ${r}`,
|
|
1514
1514
|
role: "status",
|
|
1515
1515
|
"aria-label": e,
|
|
1516
|
-
children: [/* @__PURE__ */ t(
|
|
1517
|
-
}),
|
|
1516
|
+
children: [/* @__PURE__ */ t(x, { decorative: !0 }), /* @__PURE__ */ t("span", { children: e })]
|
|
1517
|
+
}), Ze = {
|
|
1518
1518
|
root: "_root_elask_1",
|
|
1519
1519
|
legend: "_legend_elask_3",
|
|
1520
1520
|
range: "_range_elask_5"
|
|
1521
|
-
},
|
|
1521
|
+
}, Qe = [
|
|
1522
1522
|
{
|
|
1523
1523
|
value: "1",
|
|
1524
1524
|
label: "День"
|
|
@@ -1531,16 +1531,16 @@ var D = {
|
|
|
1531
1531
|
value: "3",
|
|
1532
1532
|
label: "Месяц"
|
|
1533
1533
|
}
|
|
1534
|
-
],
|
|
1534
|
+
], $e = {
|
|
1535
1535
|
day: 1,
|
|
1536
1536
|
week: 2,
|
|
1537
1537
|
month: 3
|
|
1538
|
-
},
|
|
1539
|
-
className: `${
|
|
1538
|
+
}, et = ({ value: e, onChange: r, label: i, hint: a, error: o, disabled: s = !1, min: c, max: l, className: u = "", periodTypeOptions: d = Qe }) => /* @__PURE__ */ n("fieldset", {
|
|
1539
|
+
className: `${Ze.root} ${u}`,
|
|
1540
1540
|
disabled: s,
|
|
1541
1541
|
children: [
|
|
1542
1542
|
i && /* @__PURE__ */ t("legend", {
|
|
1543
|
-
className:
|
|
1543
|
+
className: Ze.legend,
|
|
1544
1544
|
children: i
|
|
1545
1545
|
}),
|
|
1546
1546
|
/* @__PURE__ */ t(U, {
|
|
@@ -1554,8 +1554,8 @@ var D = {
|
|
|
1554
1554
|
label: "Тип периода"
|
|
1555
1555
|
}),
|
|
1556
1556
|
/* @__PURE__ */ n("div", {
|
|
1557
|
-
className:
|
|
1558
|
-
children: [/* @__PURE__ */ t(
|
|
1557
|
+
className: Ze.range,
|
|
1558
|
+
children: [/* @__PURE__ */ t(L, {
|
|
1559
1559
|
value: e.startDate,
|
|
1560
1560
|
onChange: (t) => r?.({
|
|
1561
1561
|
...e,
|
|
@@ -1565,7 +1565,7 @@ var D = {
|
|
|
1565
1565
|
min: c,
|
|
1566
1566
|
max: l,
|
|
1567
1567
|
disabled: s
|
|
1568
|
-
}), /* @__PURE__ */ t(
|
|
1568
|
+
}), /* @__PURE__ */ t(L, {
|
|
1569
1569
|
value: e.endDate,
|
|
1570
1570
|
onChange: (t) => r?.({
|
|
1571
1571
|
...e,
|
|
@@ -1577,8 +1577,8 @@ var D = {
|
|
|
1577
1577
|
disabled: s
|
|
1578
1578
|
})]
|
|
1579
1579
|
}),
|
|
1580
|
-
a && !o && /* @__PURE__ */ t(
|
|
1581
|
-
o && /* @__PURE__ */ t(
|
|
1580
|
+
a && !o && /* @__PURE__ */ t(E, { children: a }),
|
|
1581
|
+
o && /* @__PURE__ */ t(E, {
|
|
1582
1582
|
variant: "error",
|
|
1583
1583
|
children: o
|
|
1584
1584
|
})
|
|
@@ -1596,7 +1596,7 @@ var D = {
|
|
|
1596
1596
|
success: "_success_15mi5_19",
|
|
1597
1597
|
warning: "_warning_15mi5_21",
|
|
1598
1598
|
error: "_error_15mi5_23"
|
|
1599
|
-
},
|
|
1599
|
+
}, tt = ({ toast: e, onClose: r }) => {
|
|
1600
1600
|
let [i, a] = d(!1), o = u(e.duration), c = u(Date.now());
|
|
1601
1601
|
return s(() => {
|
|
1602
1602
|
if (i || e.duration <= 0) return;
|
|
@@ -1619,7 +1619,7 @@ var D = {
|
|
|
1619
1619
|
onFocus: () => a(!0),
|
|
1620
1620
|
onBlur: () => a(!1),
|
|
1621
1621
|
children: [
|
|
1622
|
-
/* @__PURE__ */ t(
|
|
1622
|
+
/* @__PURE__ */ t(be, {
|
|
1623
1623
|
name: e.variant === "warning" ? "warning" : "info",
|
|
1624
1624
|
className: Z.icon
|
|
1625
1625
|
}),
|
|
@@ -1628,7 +1628,7 @@ var D = {
|
|
|
1628
1628
|
children: [
|
|
1629
1629
|
e.title && /* @__PURE__ */ t("strong", { children: e.title }),
|
|
1630
1630
|
/* @__PURE__ */ t("div", { children: e.message }),
|
|
1631
|
-
e.action && /* @__PURE__ */ t(
|
|
1631
|
+
e.action && /* @__PURE__ */ t(C, {
|
|
1632
1632
|
variant: "empty",
|
|
1633
1633
|
size: "sm",
|
|
1634
1634
|
onClick: () => {
|
|
@@ -1638,7 +1638,7 @@ var D = {
|
|
|
1638
1638
|
})
|
|
1639
1639
|
]
|
|
1640
1640
|
}),
|
|
1641
|
-
e.closable && /* @__PURE__ */ t(
|
|
1641
|
+
e.closable && /* @__PURE__ */ t(C, {
|
|
1642
1642
|
variant: "empty",
|
|
1643
1643
|
size: "sm",
|
|
1644
1644
|
"aria-label": "Закрыть уведомление",
|
|
@@ -1647,11 +1647,11 @@ var D = {
|
|
|
1647
1647
|
})
|
|
1648
1648
|
]
|
|
1649
1649
|
});
|
|
1650
|
-
},
|
|
1650
|
+
}, nt = 0, Q = _((e) => ({
|
|
1651
1651
|
toasts: [],
|
|
1652
1652
|
showToast: (t) => {
|
|
1653
|
-
|
|
1654
|
-
let n = `ds-toast-${
|
|
1653
|
+
nt += 1;
|
|
1654
|
+
let n = `ds-toast-${nt}`;
|
|
1655
1655
|
return e((e) => ({ toasts: [...e.toasts, {
|
|
1656
1656
|
variant: "info",
|
|
1657
1657
|
duration: 5e3,
|
|
@@ -1662,17 +1662,17 @@ var D = {
|
|
|
1662
1662
|
},
|
|
1663
1663
|
removeToast: (t) => e((e) => ({ toasts: e.toasts.filter((e) => e.id !== t) })),
|
|
1664
1664
|
clearToasts: () => e({ toasts: [] })
|
|
1665
|
-
})),
|
|
1665
|
+
})), rt = () => Q.setState({ toasts: [] }), it = ({ position: e = "top-right" }) => {
|
|
1666
1666
|
let n = Q((e) => e.toasts), r = Q((e) => e.removeToast);
|
|
1667
1667
|
return /* @__PURE__ */ t("div", {
|
|
1668
1668
|
className: `${Z.viewport} ${Z[e]}`,
|
|
1669
1669
|
"aria-label": "Уведомления",
|
|
1670
|
-
children: n.map((e) => /* @__PURE__ */ t(
|
|
1670
|
+
children: n.map((e) => /* @__PURE__ */ t(tt, {
|
|
1671
1671
|
toast: e,
|
|
1672
1672
|
onClose: r
|
|
1673
1673
|
}, e.id))
|
|
1674
1674
|
});
|
|
1675
|
-
},
|
|
1675
|
+
}, at = () => {
|
|
1676
1676
|
let e = Q((e) => e.showToast), t = Q((e) => e.removeToast), n = Q((e) => e.clearToasts), r = o((t) => e({
|
|
1677
1677
|
...t,
|
|
1678
1678
|
variant: "info"
|
|
@@ -1703,7 +1703,7 @@ var D = {
|
|
|
1703
1703
|
i,
|
|
1704
1704
|
a
|
|
1705
1705
|
]);
|
|
1706
|
-
},
|
|
1706
|
+
}, ot = {
|
|
1707
1707
|
root: "_root_s9o0g_1",
|
|
1708
1708
|
tooltip: "_tooltip_s9o0g_3",
|
|
1709
1709
|
"ds-tooltip-in": "_ds-tooltip-in_s9o0g_1",
|
|
@@ -1711,7 +1711,7 @@ var D = {
|
|
|
1711
1711
|
bottom: "_bottom_s9o0g_7",
|
|
1712
1712
|
left: "_left_s9o0g_9",
|
|
1713
1713
|
right: "_right_s9o0g_11"
|
|
1714
|
-
},
|
|
1714
|
+
}, st = ({ content: e, children: i, placement: o = "top", delay: l = 450, disabled: f = !1, maxWidth: p = 280, className: m = "" }) => {
|
|
1715
1715
|
let h = c(), [g, _] = d(!1), v = u(null), y = () => {
|
|
1716
1716
|
f || !e || (v.current = setTimeout(() => _(!0), l));
|
|
1717
1717
|
}, b = () => {
|
|
@@ -1733,12 +1733,12 @@ var D = {
|
|
|
1733
1733
|
onBlur: b
|
|
1734
1734
|
});
|
|
1735
1735
|
return /* @__PURE__ */ n("span", {
|
|
1736
|
-
className: `${
|
|
1736
|
+
className: `${ot.root} ${m}`,
|
|
1737
1737
|
onPointerDown: g ? b : y,
|
|
1738
1738
|
children: [x, g && /* @__PURE__ */ t("span", {
|
|
1739
1739
|
id: h,
|
|
1740
1740
|
role: "tooltip",
|
|
1741
|
-
className: `${
|
|
1741
|
+
className: `${ot.tooltip} ${ot[o]}`,
|
|
1742
1742
|
style: { maxWidth: p },
|
|
1743
1743
|
children: e
|
|
1744
1744
|
})]
|
|
@@ -1750,7 +1750,7 @@ var D = {
|
|
|
1750
1750
|
overlay: "_overlay_1ue3g_7",
|
|
1751
1751
|
error: "_error_1ue3g_7",
|
|
1752
1752
|
caption: "_caption_1ue3g_13"
|
|
1753
|
-
},
|
|
1753
|
+
}, ct = ({ 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 }) => {
|
|
1754
1754
|
let [h, g] = d(!1), _ = c ?? (h ? "Не удалось воспроизвести видео" : void 0);
|
|
1755
1755
|
return /* @__PURE__ */ n("figure", {
|
|
1756
1756
|
className: `${$.root} ${u}`,
|
|
@@ -1772,7 +1772,7 @@ var D = {
|
|
|
1772
1772
|
}),
|
|
1773
1773
|
s && /* @__PURE__ */ t("div", {
|
|
1774
1774
|
className: $.overlay,
|
|
1775
|
-
children: /* @__PURE__ */ t(
|
|
1775
|
+
children: /* @__PURE__ */ t(x, { label: "Загрузка видео" })
|
|
1776
1776
|
}),
|
|
1777
1777
|
(_ || e.length === 0) && /* @__PURE__ */ t("div", {
|
|
1778
1778
|
className: $.error,
|
|
@@ -1787,4 +1787,4 @@ var D = {
|
|
|
1787
1787
|
});
|
|
1788
1788
|
};
|
|
1789
1789
|
//#endregion
|
|
1790
|
-
export {
|
|
1790
|
+
export { Be as ConfirmModal, y as DSBadge, C as DSButton, O as DSCheckbox, _e as DSDataTable, B as DSDateRange, L as DSDateTimePicker, U as DSDropDown, ve as DSDropDownMultiple, T as DSFieldLabel, E as DSFieldMessage, ke as DSFileInput, Te as DSFilters, be as DSIcon, xe as DSInfoBlock, Se as DSInput, x as DSLoader, Pe as DSModal, Ne as DSModalFrame, Xe as DSPageLoader, Ce as DSRadioButton, re as DSSkeleton, oe as DSSort, et as DSTimePeriodPicker, tt as DSToast, it as DSToastProvider, st as DSTooltip, ct as DSVideoPlayerFrame, $e as DS_PERIOD_TYPE_CODES, Ve as ErrorModal, Fe as ModalSystemProvider, He as builtInModalRegistry, Ie as defineModalRegistry, P as formatDateTimeLocalValue, We as getErrorMessage, ie as getNextEnabledOptionIndex, z as isValidDateRange, F as parseDateTimeLocalValue, je as resetModalStore, rt as resetToastStore, Ue as useConfirmModal, Ke as useConfirmModalStore, Ge as useErrorModal, qe as useErrorModalStore, Je as useModals, Y as useModalsStore, at as useToast, Q as useToastStore, ce as validateDSDataTableData };
|