@efficiency-point/design-system 0.0.9 → 0.0.10
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,35 @@ 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": return
|
|
652
|
+
case "date": return de;
|
|
653
|
+
case "number": return fe;
|
|
654
|
+
case "boolean": return pe;
|
|
655
|
+
case "text": return me;
|
|
655
656
|
default: return;
|
|
656
657
|
}
|
|
657
|
-
},
|
|
658
|
-
let t =
|
|
658
|
+
}, ge = (e) => {
|
|
659
|
+
let t = (t) => le(e.accessor, t), n = e.sortFn ?? he(e.dataType), r = e.enableSorting ?? n !== void 0, i = {
|
|
659
660
|
id: e.id,
|
|
660
661
|
accessorFn: t,
|
|
661
662
|
header: () => e.header,
|
|
@@ -663,13 +664,13 @@ var D = {
|
|
|
663
664
|
let n = t.getValue();
|
|
664
665
|
return e.cell?.(t.row.original, n) ?? String(n ?? "");
|
|
665
666
|
},
|
|
666
|
-
enableSorting:
|
|
667
|
+
enableSorting: r,
|
|
667
668
|
sortDescFirst: e.sortDescFirst
|
|
668
669
|
};
|
|
669
|
-
return
|
|
670
|
-
},
|
|
671
|
-
let [x, S] = d([]), C = o ?? x, w = l(() =>
|
|
672
|
-
features:
|
|
670
|
+
return n && (i.sortFn = n), i;
|
|
671
|
+
}, _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 = "" }) => {
|
|
672
|
+
let [x, S] = d([]), C = o ?? x, w = l(() => ce(e, r), [e, r]), T = l(() => e.map(ge), [e]), E = h({
|
|
673
|
+
features: se,
|
|
673
674
|
columns: T,
|
|
674
675
|
data: r,
|
|
675
676
|
state: { sorting: C },
|
|
@@ -678,7 +679,7 @@ var D = {
|
|
|
678
679
|
o === void 0 && S(t), s?.(t);
|
|
679
680
|
},
|
|
680
681
|
getRowId: u
|
|
681
|
-
}
|
|
682
|
+
}), D = E.getRowModel().rows, O = e.filter((e) => e.enableSorting ?? (e.dataType !== void 0 && e.dataType !== "custom")).map((e) => ({
|
|
682
683
|
id: e.id,
|
|
683
684
|
label: typeof e.header == "string" ? e.header : e.id
|
|
684
685
|
})), k = [
|
|
@@ -686,24 +687,22 @@ var D = {
|
|
|
686
687
|
a === "wide" ? W.wide : W.default,
|
|
687
688
|
i ? W.tableOnMobile : "",
|
|
688
689
|
b
|
|
689
|
-
].filter(Boolean).join(" "), A = w ??
|
|
690
|
+
].filter(Boolean).join(" "), A = w ?? g;
|
|
690
691
|
return /* @__PURE__ */ n("section", {
|
|
691
692
|
className: k,
|
|
692
693
|
"aria-busy": m,
|
|
693
694
|
children: [
|
|
694
|
-
!i && !m && !A && D.length > 0 && O.length > 0 && /* @__PURE__ */ t(
|
|
695
|
+
!i && !m && !A && D.length > 0 && O.length > 0 && /* @__PURE__ */ t(oe, {
|
|
695
696
|
className: W.mobileSort,
|
|
696
697
|
options: O,
|
|
697
698
|
value: C[0] ? {
|
|
698
699
|
id: C[0].id,
|
|
699
700
|
direction: C[0].desc ? "desc" : "asc"
|
|
700
701
|
} : null,
|
|
701
|
-
onChange: (e) => {
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
}]);
|
|
706
|
-
}
|
|
702
|
+
onChange: (e) => E.setSorting([{
|
|
703
|
+
id: e.id,
|
|
704
|
+
desc: e.direction === "desc"
|
|
705
|
+
}])
|
|
707
706
|
}),
|
|
708
707
|
/* @__PURE__ */ t("div", {
|
|
709
708
|
className: W.tableWrap,
|
|
@@ -714,7 +713,7 @@ var D = {
|
|
|
714
713
|
children: [
|
|
715
714
|
f && /* @__PURE__ */ t("caption", { children: f }),
|
|
716
715
|
/* @__PURE__ */ t("thead", {
|
|
717
|
-
className:
|
|
716
|
+
className: v ? W.sticky : "",
|
|
718
717
|
children: E.getHeaderGroups().map((e) => /* @__PURE__ */ t("tr", { children: e.headers.map((e) => {
|
|
719
718
|
let r = e.column.getIsSorted(), i = e.column.getCanSort(), a = e.column.getToggleSortingHandler();
|
|
720
719
|
return /* @__PURE__ */ t("th", {
|
|
@@ -735,7 +734,7 @@ var D = {
|
|
|
735
734
|
}),
|
|
736
735
|
/* @__PURE__ */ t("tbody", { children: m ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
737
736
|
colSpan: e.length,
|
|
738
|
-
children: /* @__PURE__ */ t(
|
|
737
|
+
children: /* @__PURE__ */ t(re, { lines: 3 })
|
|
739
738
|
}) }) : A ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
740
739
|
className: W.state,
|
|
741
740
|
colSpan: e.length,
|
|
@@ -743,7 +742,7 @@ var D = {
|
|
|
743
742
|
}) }) : D.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
744
743
|
className: W.state,
|
|
745
744
|
colSpan: e.length,
|
|
746
|
-
children:
|
|
745
|
+
children: _
|
|
747
746
|
}) }) : 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
747
|
]
|
|
749
748
|
})
|
|
@@ -752,12 +751,12 @@ var D = {
|
|
|
752
751
|
className: W.cards,
|
|
753
752
|
role: "list",
|
|
754
753
|
"aria-label": p ?? f,
|
|
755
|
-
children: m ? /* @__PURE__ */ t(
|
|
754
|
+
children: m ? /* @__PURE__ */ t(re, { lines: 4 }) : A ? /* @__PURE__ */ t("div", {
|
|
756
755
|
className: W.state,
|
|
757
756
|
children: A
|
|
758
757
|
}) : D.length === 0 ? /* @__PURE__ */ t("div", {
|
|
759
758
|
className: W.state,
|
|
760
|
-
children:
|
|
759
|
+
children: _
|
|
761
760
|
}) : D.map((r) => {
|
|
762
761
|
if (c) return /* @__PURE__ */ t("div", {
|
|
763
762
|
role: "listitem",
|
|
@@ -766,7 +765,7 @@ var D = {
|
|
|
766
765
|
columns: e
|
|
767
766
|
})
|
|
768
767
|
}, 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) =>
|
|
768
|
+
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
769
|
return /* @__PURE__ */ n("article", {
|
|
771
770
|
role: "listitem",
|
|
772
771
|
className: W.card,
|
|
@@ -783,7 +782,7 @@ var D = {
|
|
|
783
782
|
})
|
|
784
783
|
]
|
|
785
784
|
});
|
|
786
|
-
},
|
|
785
|
+
}, 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
786
|
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
787
|
s(() => {
|
|
789
788
|
let e = (e) => {
|
|
@@ -800,7 +799,7 @@ var D = {
|
|
|
800
799
|
let n = r.includes(t.value) ? r.filter((e) => e !== t.value) : [...r, t.value];
|
|
801
800
|
i?.(n, e.filter((e) => n.includes(e.value))), v && (C(!1), T.current?.focus());
|
|
802
801
|
}, M = (t, n) => {
|
|
803
|
-
let r =
|
|
802
|
+
let r = ie(e, t, n);
|
|
804
803
|
E.current[r]?.focus(), E.current[r]?.scrollIntoView({ block: "nearest" });
|
|
805
804
|
};
|
|
806
805
|
return /* @__PURE__ */ n("div", {
|
|
@@ -901,7 +900,7 @@ var D = {
|
|
|
901
900
|
})
|
|
902
901
|
]
|
|
903
902
|
});
|
|
904
|
-
},
|
|
903
|
+
}, ye = {
|
|
905
904
|
approve: "M4 12l5 5L20 6",
|
|
906
905
|
reject: "M5 5l14 14M19 5L5 19",
|
|
907
906
|
edit: "M4 20h4L19 9l-4-4L4 16v4z",
|
|
@@ -910,7 +909,7 @@ var D = {
|
|
|
910
909
|
basket: "M4 7h16l-1 13H5L4 7zm3 0V4h10v3",
|
|
911
910
|
info: "M12 10v7m0-10v.01",
|
|
912
911
|
warning: "M12 4L3 20h18L12 4zm0 5v5m0 3v.01"
|
|
913
|
-
},
|
|
912
|
+
}, be = ({ name: e, title: r, width: i = 24, height: a = 24, ...o }) => /* @__PURE__ */ n("svg", {
|
|
914
913
|
viewBox: "0 0 24 24",
|
|
915
914
|
width: i,
|
|
916
915
|
height: a,
|
|
@@ -923,14 +922,14 @@ var D = {
|
|
|
923
922
|
"aria-hidden": !r || void 0,
|
|
924
923
|
focusable: "false",
|
|
925
924
|
...o,
|
|
926
|
-
children: [r && /* @__PURE__ */ t("title", { children: r }), /* @__PURE__ */ t("path", { d:
|
|
925
|
+
children: [r && /* @__PURE__ */ t("title", { children: r }), /* @__PURE__ */ t("path", { d: ye[e] })]
|
|
927
926
|
}), G = {
|
|
928
927
|
root: "_root_1y2s8_1",
|
|
929
928
|
header: "_header_1y2s8_21",
|
|
930
929
|
title: "_title_1y2s8_41",
|
|
931
930
|
dismiss: "_dismiss_1y2s8_55",
|
|
932
931
|
content: "_content_1y2s8_113"
|
|
933
|
-
},
|
|
932
|
+
}, xe = ({ title: e, children: r, dismissible: i = !1, onDismiss: a, dismissLabel: o = "Закрыть информационный блок", headingAs: s = "h3", className: l = "" }) => {
|
|
934
933
|
let u = `ds-info-block-${c()}`;
|
|
935
934
|
return /* @__PURE__ */ n("section", {
|
|
936
935
|
className: `${G.root} ${l}`,
|
|
@@ -970,14 +969,14 @@ var D = {
|
|
|
970
969
|
disabledText: "_disabledText_1tz82_5",
|
|
971
970
|
inputError: "_inputError_1tz82_11",
|
|
972
971
|
trailingAction: "_trailingAction_1tz82_13"
|
|
973
|
-
},
|
|
974
|
-
let
|
|
972
|
+
}, 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 }) => {
|
|
973
|
+
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
974
|
return s(() => {
|
|
976
975
|
S || N(!1);
|
|
977
976
|
}, [S]), /* @__PURE__ */ n("div", {
|
|
978
977
|
className: `${K.wrapper} ${g}`,
|
|
979
978
|
children: [
|
|
980
|
-
p && /* @__PURE__ */ t(
|
|
979
|
+
p && /* @__PURE__ */ t(T, {
|
|
981
980
|
htmlFor: A,
|
|
982
981
|
required: b,
|
|
983
982
|
disabled: o,
|
|
@@ -986,8 +985,8 @@ var D = {
|
|
|
986
985
|
o && f ? /* @__PURE__ */ t("div", {
|
|
987
986
|
id: A,
|
|
988
987
|
className: K.disabledText,
|
|
989
|
-
"aria-describedby":
|
|
990
|
-
children:
|
|
988
|
+
"aria-describedby": I,
|
|
989
|
+
children: ee || a
|
|
991
990
|
}) : /* @__PURE__ */ n("div", {
|
|
992
991
|
className: K.control,
|
|
993
992
|
children: [
|
|
@@ -995,14 +994,14 @@ var D = {
|
|
|
995
994
|
ref: j,
|
|
996
995
|
id: A,
|
|
997
996
|
name: _,
|
|
998
|
-
type:
|
|
999
|
-
value:
|
|
997
|
+
type: te,
|
|
998
|
+
value: ee,
|
|
1000
999
|
placeholder: a,
|
|
1001
1000
|
disabled: o,
|
|
1002
1001
|
readOnly: l,
|
|
1003
1002
|
required: b,
|
|
1004
1003
|
"aria-invalid": !!m,
|
|
1005
|
-
"aria-describedby":
|
|
1004
|
+
"aria-describedby": I,
|
|
1006
1005
|
className: `${K.input} ${m ? K.inputError : ""}`,
|
|
1007
1006
|
onChange: (e) => {
|
|
1008
1007
|
if (i === "number" && !S) {
|
|
@@ -1013,9 +1012,9 @@ var D = {
|
|
|
1013
1012
|
r?.(e.target.value, e);
|
|
1014
1013
|
},
|
|
1015
1014
|
onFocus: (e) => {
|
|
1016
|
-
x && e.currentTarget.value && e.currentTarget.select(),
|
|
1015
|
+
x && e.currentTarget.value && e.currentTarget.select(), D?.(e);
|
|
1017
1016
|
},
|
|
1018
|
-
...
|
|
1017
|
+
...O
|
|
1019
1018
|
}),
|
|
1020
1019
|
S && /* @__PURE__ */ t("button", {
|
|
1021
1020
|
type: "button",
|
|
@@ -1038,7 +1037,7 @@ var D = {
|
|
|
1038
1037
|
})]
|
|
1039
1038
|
})
|
|
1040
1039
|
}),
|
|
1041
|
-
!S && y &&
|
|
1040
|
+
!S && y && ee && !o && !l && /* @__PURE__ */ t("button", {
|
|
1042
1041
|
type: "button",
|
|
1043
1042
|
className: K.trailingAction,
|
|
1044
1043
|
"aria-label": "Очистить поле",
|
|
@@ -1050,11 +1049,11 @@ var D = {
|
|
|
1050
1049
|
})
|
|
1051
1050
|
]
|
|
1052
1051
|
}),
|
|
1053
|
-
h && !m && /* @__PURE__ */ t(
|
|
1052
|
+
h && !m && /* @__PURE__ */ t(E, {
|
|
1054
1053
|
id: P,
|
|
1055
1054
|
children: h
|
|
1056
1055
|
}),
|
|
1057
|
-
m && /* @__PURE__ */ t(
|
|
1056
|
+
m && /* @__PURE__ */ t(E, {
|
|
1058
1057
|
id: F,
|
|
1059
1058
|
variant: "error",
|
|
1060
1059
|
children: m
|
|
@@ -1068,7 +1067,7 @@ var D = {
|
|
|
1068
1067
|
thumb: "_thumb_vu1ob_67",
|
|
1069
1068
|
label: "_label_vu1ob_111",
|
|
1070
1069
|
disabled: "_disabled_vu1ob_123"
|
|
1071
|
-
},
|
|
1070
|
+
}, Ce = ({ checked: e, onChange: r, label: i, disabled: a = !1, readOnly: o = !1, className: s = "", name: l, id: u, value: d }) => {
|
|
1072
1071
|
let f = c(), p = u ?? `ds-radio-button-${l ?? f}`;
|
|
1073
1072
|
return /* @__PURE__ */ n("label", {
|
|
1074
1073
|
htmlFor: p,
|
|
@@ -1099,11 +1098,11 @@ var D = {
|
|
|
1099
1098
|
})
|
|
1100
1099
|
]
|
|
1101
1100
|
});
|
|
1102
|
-
},
|
|
1101
|
+
}, we = {
|
|
1103
1102
|
root: "_root_kepgo_1",
|
|
1104
1103
|
grid: "_grid_kepgo_3",
|
|
1105
1104
|
actions: "_actions_kepgo_5"
|
|
1106
|
-
},
|
|
1105
|
+
}, Te = ({ filters: e, values: r, onChange: i, onApply: a, onReset: o, applyMode: s = "instant", loading: c = !1, disabled: l = !1, className: u = "" }) => {
|
|
1107
1106
|
let d = (e, t) => {
|
|
1108
1107
|
let n = {
|
|
1109
1108
|
...r,
|
|
@@ -1112,11 +1111,11 @@ var D = {
|
|
|
1112
1111
|
i?.(n, e), s === "instant" && a?.(n);
|
|
1113
1112
|
};
|
|
1114
1113
|
return /* @__PURE__ */ n("section", {
|
|
1115
|
-
className: `${
|
|
1114
|
+
className: `${we.root} ${u}`,
|
|
1116
1115
|
"aria-label": "Фильтры",
|
|
1117
1116
|
"aria-busy": c,
|
|
1118
1117
|
children: [/* @__PURE__ */ t("div", {
|
|
1119
|
-
className:
|
|
1118
|
+
className: we.grid,
|
|
1120
1119
|
children: e.filter((e) => !e.hidden).map((e) => {
|
|
1121
1120
|
let n = l || c || e.disabled, i = r[e.id];
|
|
1122
1121
|
if (e.type === "input") {
|
|
@@ -1127,12 +1126,12 @@ var D = {
|
|
|
1127
1126
|
placeholder: e.placeholder,
|
|
1128
1127
|
disabled: n
|
|
1129
1128
|
};
|
|
1130
|
-
return e.inputType === "number" ? /* @__PURE__ */ t(
|
|
1129
|
+
return e.inputType === "number" ? /* @__PURE__ */ t(Se, {
|
|
1131
1130
|
...r,
|
|
1132
1131
|
type: "number",
|
|
1133
1132
|
value: i ?? "",
|
|
1134
1133
|
onChange: (t) => d(e.id, t)
|
|
1135
|
-
}) : /* @__PURE__ */ t(
|
|
1134
|
+
}) : /* @__PURE__ */ t(Se, {
|
|
1136
1135
|
...r,
|
|
1137
1136
|
type: "text",
|
|
1138
1137
|
value: String(i ?? ""),
|
|
@@ -1148,7 +1147,7 @@ var D = {
|
|
|
1148
1147
|
disabled: n,
|
|
1149
1148
|
onChange: (t) => d(e.id, t)
|
|
1150
1149
|
}, e.id);
|
|
1151
|
-
if (e.type === "multiple") return /* @__PURE__ */ t(
|
|
1150
|
+
if (e.type === "multiple") return /* @__PURE__ */ t(ve, {
|
|
1152
1151
|
label: e.label,
|
|
1153
1152
|
hint: e.hint,
|
|
1154
1153
|
placeholder: e.placeholder,
|
|
@@ -1157,14 +1156,14 @@ var D = {
|
|
|
1157
1156
|
disabled: n,
|
|
1158
1157
|
onChange: (t) => d(e.id, t)
|
|
1159
1158
|
}, e.id);
|
|
1160
|
-
if (e.type === "checkbox") return /* @__PURE__ */ t(
|
|
1159
|
+
if (e.type === "checkbox") return /* @__PURE__ */ t(O, {
|
|
1161
1160
|
label: e.label,
|
|
1162
1161
|
hint: e.hint,
|
|
1163
1162
|
checked: !!i,
|
|
1164
1163
|
disabled: n,
|
|
1165
1164
|
onChange: (t) => d(e.id, t)
|
|
1166
1165
|
}, e.id);
|
|
1167
|
-
if (e.type === "radio") return /* @__PURE__ */ t(
|
|
1166
|
+
if (e.type === "radio") return /* @__PURE__ */ t(Ce, {
|
|
1168
1167
|
label: e.label,
|
|
1169
1168
|
checked: !!i,
|
|
1170
1169
|
disabled: n,
|
|
@@ -1174,7 +1173,7 @@ var D = {
|
|
|
1174
1173
|
from: null,
|
|
1175
1174
|
to: null
|
|
1176
1175
|
};
|
|
1177
|
-
return /* @__PURE__ */ t(
|
|
1176
|
+
return /* @__PURE__ */ t(B, {
|
|
1178
1177
|
hint: e.hint,
|
|
1179
1178
|
mode: e.mode,
|
|
1180
1179
|
min: e.min,
|
|
@@ -1185,13 +1184,13 @@ var D = {
|
|
|
1185
1184
|
}, e.id);
|
|
1186
1185
|
})
|
|
1187
1186
|
}), (o || s === "manual") && /* @__PURE__ */ n("div", {
|
|
1188
|
-
className:
|
|
1189
|
-
children: [o && /* @__PURE__ */ t(
|
|
1187
|
+
className: we.actions,
|
|
1188
|
+
children: [o && /* @__PURE__ */ t(C, {
|
|
1190
1189
|
variant: "destructiveOutline",
|
|
1191
1190
|
disabled: l || c,
|
|
1192
1191
|
onClick: o,
|
|
1193
1192
|
children: "Сбросить"
|
|
1194
|
-
}), s === "manual" && /* @__PURE__ */ t(
|
|
1193
|
+
}), s === "manual" && /* @__PURE__ */ t(C, {
|
|
1195
1194
|
isLoading: c,
|
|
1196
1195
|
disabled: l,
|
|
1197
1196
|
onClick: () => a?.(r),
|
|
@@ -1213,25 +1212,25 @@ var D = {
|
|
|
1213
1212
|
file: "_file_1ymdr_19",
|
|
1214
1213
|
fileName: "_fileName_1ymdr_23",
|
|
1215
1214
|
fileSize: "_fileSize_1ymdr_25"
|
|
1216
|
-
},
|
|
1217
|
-
let
|
|
1218
|
-
let t = [], n = new Set(r.map(
|
|
1215
|
+
}, 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 }) => {
|
|
1216
|
+
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) => {
|
|
1217
|
+
let t = [], n = new Set(r.map(Ee)), c = e.filter((e) => Oe(e, o) ? s !== void 0 && e.size > s ? (t.push({
|
|
1219
1218
|
file: e,
|
|
1220
1219
|
reason: "maxSize"
|
|
1221
|
-
}), !1) : !n.has(
|
|
1220
|
+
}), !1) : !n.has(Ee(e)) && (n.add(Ee(e)), !0) : (t.push({
|
|
1222
1221
|
file: e,
|
|
1223
1222
|
reason: "accept"
|
|
1224
1223
|
}), !1)), u = a ? l : 1, d = a ? [...r, ...c] : c.slice(-1);
|
|
1225
1224
|
u !== void 0 && d.length > u && (d.slice(u).forEach((e) => t.push({
|
|
1226
1225
|
file: e,
|
|
1227
1226
|
reason: "maxFiles"
|
|
1228
|
-
})), d = d.slice(0, u)), t.length &&
|
|
1227
|
+
})), d = d.slice(0, u)), t.length && D?.(t), c.length && i?.(d), A.current && (A.current.value = "");
|
|
1229
1228
|
};
|
|
1230
1229
|
return /* @__PURE__ */ n("div", {
|
|
1231
1230
|
className: `${J.wrapper} ${b}`,
|
|
1232
1231
|
children: [
|
|
1233
|
-
f && /* @__PURE__ */ t(
|
|
1234
|
-
htmlFor:
|
|
1232
|
+
f && /* @__PURE__ */ t(T, {
|
|
1233
|
+
htmlFor: k,
|
|
1235
1234
|
required: h,
|
|
1236
1235
|
disabled: g,
|
|
1237
1236
|
children: f
|
|
@@ -1239,28 +1238,28 @@ var D = {
|
|
|
1239
1238
|
/* @__PURE__ */ n("div", {
|
|
1240
1239
|
className: `${J.dropzone} ${M ? J.dragActive : ""} ${g ? J.disabled : ""} ${m ? J.error : ""}`,
|
|
1241
1240
|
onDragEnter: (e) => {
|
|
1242
|
-
e.preventDefault(),
|
|
1241
|
+
e.preventDefault(), I && ++j.current === 1 && N(!0);
|
|
1243
1242
|
},
|
|
1244
1243
|
onDragOver: (e) => e.preventDefault(),
|
|
1245
1244
|
onDragLeave: (e) => {
|
|
1246
1245
|
e.preventDefault(), --j.current <= 0 && (j.current = 0, N(!1));
|
|
1247
1246
|
},
|
|
1248
1247
|
onDrop: (e) => {
|
|
1249
|
-
e.preventDefault(), j.current = 0, N(!1),
|
|
1248
|
+
e.preventDefault(), j.current = 0, N(!1), I && te(Array.from(e.dataTransfer.files));
|
|
1250
1249
|
},
|
|
1251
1250
|
children: [/* @__PURE__ */ t("input", {
|
|
1252
1251
|
ref: A,
|
|
1253
|
-
id:
|
|
1252
|
+
id: k,
|
|
1254
1253
|
name: v,
|
|
1255
1254
|
className: J.nativeInput,
|
|
1256
1255
|
type: "file",
|
|
1257
1256
|
multiple: a,
|
|
1258
1257
|
accept: o,
|
|
1259
1258
|
required: h && r.length === 0,
|
|
1260
|
-
disabled: !
|
|
1261
|
-
"aria-describedby":
|
|
1259
|
+
disabled: !I,
|
|
1260
|
+
"aria-describedby": ee,
|
|
1262
1261
|
"aria-invalid": !!m,
|
|
1263
|
-
onChange: (e) =>
|
|
1262
|
+
onChange: (e) => te(Array.from(e.target.files ?? []))
|
|
1264
1263
|
}), r.length ? /* @__PURE__ */ n(e, { children: [
|
|
1265
1264
|
/* @__PURE__ */ t("ul", {
|
|
1266
1265
|
className: J.files,
|
|
@@ -1275,9 +1274,9 @@ var D = {
|
|
|
1275
1274
|
}),
|
|
1276
1275
|
/* @__PURE__ */ t("span", {
|
|
1277
1276
|
className: J.fileSize,
|
|
1278
|
-
children:
|
|
1277
|
+
children: De(e.size)
|
|
1279
1278
|
}),
|
|
1280
|
-
|
|
1279
|
+
I && /* @__PURE__ */ t(C, {
|
|
1281
1280
|
variant: "empty",
|
|
1282
1281
|
size: "sm",
|
|
1283
1282
|
"aria-label": `Удалить файл ${e.name}`,
|
|
@@ -1285,15 +1284,15 @@ var D = {
|
|
|
1285
1284
|
children: "×"
|
|
1286
1285
|
})
|
|
1287
1286
|
]
|
|
1288
|
-
},
|
|
1287
|
+
}, Ee(e)))
|
|
1289
1288
|
}),
|
|
1290
|
-
|
|
1289
|
+
I && (a || r.length === 0) && /* @__PURE__ */ t(C, {
|
|
1291
1290
|
className: J.browseButton,
|
|
1292
1291
|
size: "sm",
|
|
1293
1292
|
onClick: () => A.current?.click(),
|
|
1294
|
-
children:
|
|
1293
|
+
children: w
|
|
1295
1294
|
}),
|
|
1296
|
-
|
|
1295
|
+
I && !a && /* @__PURE__ */ t(C, {
|
|
1297
1296
|
className: J.browseButton,
|
|
1298
1297
|
size: "sm",
|
|
1299
1298
|
onClick: () => A.current?.click(),
|
|
@@ -1308,7 +1307,7 @@ var D = {
|
|
|
1308
1307
|
children: "↑"
|
|
1309
1308
|
}),
|
|
1310
1309
|
/* @__PURE__ */ t("strong", { children: M ? "Отпустите файлы здесь" : x }),
|
|
1311
|
-
!M &&
|
|
1310
|
+
!M && I && /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", { children: "или" }), /* @__PURE__ */ t(C, {
|
|
1312
1311
|
className: J.browseButton,
|
|
1313
1312
|
onClick: () => A.current?.click(),
|
|
1314
1313
|
children: S
|
|
@@ -1316,11 +1315,11 @@ var D = {
|
|
|
1316
1315
|
]
|
|
1317
1316
|
})]
|
|
1318
1317
|
}),
|
|
1319
|
-
p && !m && /* @__PURE__ */ t(
|
|
1318
|
+
p && !m && /* @__PURE__ */ t(E, {
|
|
1320
1319
|
id: P,
|
|
1321
1320
|
children: p
|
|
1322
1321
|
}),
|
|
1323
|
-
m && /* @__PURE__ */ t(
|
|
1322
|
+
m && /* @__PURE__ */ t(E, {
|
|
1324
1323
|
id: F,
|
|
1325
1324
|
variant: "error",
|
|
1326
1325
|
live: !0,
|
|
@@ -1328,11 +1327,11 @@ var D = {
|
|
|
1328
1327
|
})
|
|
1329
1328
|
]
|
|
1330
1329
|
});
|
|
1331
|
-
},
|
|
1330
|
+
}, Ae = 0, Y = _((e) => ({
|
|
1332
1331
|
modals: [],
|
|
1333
1332
|
openModal: (t, n = {}, r = {}) => {
|
|
1334
|
-
|
|
1335
|
-
let i = `ds-modal-${
|
|
1333
|
+
Ae += 1;
|
|
1334
|
+
let i = `ds-modal-${Ae}`;
|
|
1336
1335
|
return e((e) => ({ modals: [...e.modals, {
|
|
1337
1336
|
id: i,
|
|
1338
1337
|
name: t,
|
|
@@ -1344,7 +1343,7 @@ var D = {
|
|
|
1344
1343
|
closeModal: (t) => e((e) => ({ modals: e.modals.filter((e) => e.id !== t) })),
|
|
1345
1344
|
closeTopModal: () => e((e) => ({ modals: e.modals.slice(0, -1) })),
|
|
1346
1345
|
closeAllModals: () => e({ modals: [] })
|
|
1347
|
-
})),
|
|
1346
|
+
})), je = () => Y.setState({ modals: [] }), X = {
|
|
1348
1347
|
layer: "_layer_1nb2z_1",
|
|
1349
1348
|
backdrop: "_backdrop_1nb2z_3",
|
|
1350
1349
|
panel: "_panel_1nb2z_5",
|
|
@@ -1352,11 +1351,11 @@ var D = {
|
|
|
1352
1351
|
title: "_title_1nb2z_11",
|
|
1353
1352
|
description: "_description_1nb2z_13",
|
|
1354
1353
|
content: "_content_1nb2z_15"
|
|
1355
|
-
},
|
|
1354
|
+
}, 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
1355
|
let f = c(), p = c(), m = u(null), h = Y((e) => e.closeModal);
|
|
1357
1356
|
return s(() => {
|
|
1358
1357
|
let e = document.activeElement, t = m.current;
|
|
1359
|
-
return (t?.querySelector(
|
|
1358
|
+
return (t?.querySelector(Me) ?? t)?.focus(), () => e?.focus();
|
|
1360
1359
|
}, []), /* @__PURE__ */ n("div", {
|
|
1361
1360
|
ref: m,
|
|
1362
1361
|
className: `${X.panel} ${l}`,
|
|
@@ -1367,7 +1366,7 @@ var D = {
|
|
|
1367
1366
|
tabIndex: -1,
|
|
1368
1367
|
onKeyDown: (e) => {
|
|
1369
1368
|
if (e.key !== "Tab") return;
|
|
1370
|
-
let t = Array.from(m.current?.querySelectorAll(
|
|
1369
|
+
let t = Array.from(m.current?.querySelectorAll(Me) ?? []);
|
|
1371
1370
|
if (!t.length) {
|
|
1372
1371
|
e.preventDefault();
|
|
1373
1372
|
return;
|
|
@@ -1382,7 +1381,7 @@ var D = {
|
|
|
1382
1381
|
id: f,
|
|
1383
1382
|
className: X.title,
|
|
1384
1383
|
children: r
|
|
1385
|
-
}), /* @__PURE__ */ t(
|
|
1384
|
+
}), /* @__PURE__ */ t(C, {
|
|
1386
1385
|
variant: "empty",
|
|
1387
1386
|
size: "sm",
|
|
1388
1387
|
"aria-label": o,
|
|
@@ -1401,7 +1400,7 @@ var D = {
|
|
|
1401
1400
|
})
|
|
1402
1401
|
]
|
|
1403
1402
|
});
|
|
1404
|
-
},
|
|
1403
|
+
}, Pe = ({ registry: e }) => {
|
|
1405
1404
|
let n = Y((e) => e.modals), r = Y((e) => e.closeModal), i = Y((e) => e.closeAllModals);
|
|
1406
1405
|
return s(() => {
|
|
1407
1406
|
let e = (e) => {
|
|
@@ -1410,7 +1409,7 @@ var D = {
|
|
|
1410
1409
|
t?.closeOnEscape && r(t.id);
|
|
1411
1410
|
};
|
|
1412
1411
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
1413
|
-
}, [r]), !n.length || typeof document > "u" ? null :
|
|
1412
|
+
}, [r]), !n.length || typeof document > "u" ? null : g(/* @__PURE__ */ t("div", {
|
|
1414
1413
|
className: X.layer,
|
|
1415
1414
|
"aria-label": "Модальные окна",
|
|
1416
1415
|
children: n.map((a, o) => {
|
|
@@ -1430,7 +1429,7 @@ var D = {
|
|
|
1430
1429
|
}, a.id) : null;
|
|
1431
1430
|
})
|
|
1432
1431
|
}), document.body);
|
|
1433
|
-
},
|
|
1432
|
+
}, Fe = ({ registry: r, children: i, lockBodyScroll: a = !0 }) => {
|
|
1434
1433
|
let o = Y((e) => e.modals.length);
|
|
1435
1434
|
return s(() => {
|
|
1436
1435
|
if (!a || o === 0) return;
|
|
@@ -1438,68 +1437,68 @@ var D = {
|
|
|
1438
1437
|
return document.body.style.overflow = "hidden", () => {
|
|
1439
1438
|
document.body.style.overflow = e;
|
|
1440
1439
|
};
|
|
1441
|
-
}, [a, o]), /* @__PURE__ */ n(e, { children: [i, /* @__PURE__ */ t(
|
|
1442
|
-
},
|
|
1440
|
+
}, [a, o]), /* @__PURE__ */ n(e, { children: [i, /* @__PURE__ */ t(Pe, { registry: r })] });
|
|
1441
|
+
}, Ie = (e) => e, Le = {
|
|
1443
1442
|
message: "_message_1vtru_1",
|
|
1444
1443
|
actions: "_actions_1vtru_3"
|
|
1445
|
-
},
|
|
1444
|
+
}, 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
1445
|
let u = (e) => {
|
|
1447
|
-
|
|
1446
|
+
Re.get(l)?.(e), Re.delete(l), r();
|
|
1448
1447
|
};
|
|
1449
|
-
return /* @__PURE__ */ n(
|
|
1448
|
+
return /* @__PURE__ */ n(Ne, {
|
|
1450
1449
|
modalId: e,
|
|
1451
1450
|
title: i,
|
|
1452
1451
|
role: "alertdialog",
|
|
1453
1452
|
children: [/* @__PURE__ */ t("p", {
|
|
1454
|
-
className:
|
|
1453
|
+
className: Le.message,
|
|
1455
1454
|
children: a
|
|
1456
1455
|
}), /* @__PURE__ */ n("div", {
|
|
1457
|
-
className:
|
|
1458
|
-
children: [/* @__PURE__ */ t(
|
|
1456
|
+
className: Le.actions,
|
|
1457
|
+
children: [/* @__PURE__ */ t(C, {
|
|
1459
1458
|
variant: "outline",
|
|
1460
1459
|
onClick: () => u(!1),
|
|
1461
1460
|
children: s
|
|
1462
|
-
}), /* @__PURE__ */ t(
|
|
1461
|
+
}), /* @__PURE__ */ t(C, {
|
|
1463
1462
|
variant: c === "danger" ? "destructive" : "primary",
|
|
1464
1463
|
onClick: () => u(!0),
|
|
1465
1464
|
children: o
|
|
1466
1465
|
})]
|
|
1467
1466
|
})]
|
|
1468
1467
|
});
|
|
1469
|
-
},
|
|
1468
|
+
}, Ve = ({ modalId: e, close: r, title: i = "Ошибка", message: a, closeLabel: o = "Закрыть" }) => /* @__PURE__ */ n(Ne, {
|
|
1470
1469
|
modalId: e,
|
|
1471
1470
|
title: i,
|
|
1472
1471
|
role: "alertdialog",
|
|
1473
1472
|
children: [/* @__PURE__ */ t("p", {
|
|
1474
|
-
className:
|
|
1473
|
+
className: Le.message,
|
|
1475
1474
|
children: a
|
|
1476
1475
|
}), /* @__PURE__ */ t("div", {
|
|
1477
|
-
className:
|
|
1478
|
-
children: /* @__PURE__ */ t(
|
|
1476
|
+
className: Le.actions,
|
|
1477
|
+
children: /* @__PURE__ */ t(C, {
|
|
1479
1478
|
onClick: r,
|
|
1480
1479
|
children: o
|
|
1481
1480
|
})
|
|
1482
1481
|
})]
|
|
1483
|
-
}),
|
|
1484
|
-
ConfirmModal:
|
|
1485
|
-
ErrorModal:
|
|
1486
|
-
}),
|
|
1482
|
+
}), He = Ie({
|
|
1483
|
+
ConfirmModal: Be,
|
|
1484
|
+
ErrorModal: Ve
|
|
1485
|
+
}), Ue = () => {
|
|
1487
1486
|
let e = Y((e) => e.openModal);
|
|
1488
1487
|
return (t = {}) => new Promise((n) => {
|
|
1489
|
-
|
|
1490
|
-
let r = `confirm-${
|
|
1491
|
-
|
|
1488
|
+
ze += 1;
|
|
1489
|
+
let r = `confirm-${ze}`;
|
|
1490
|
+
Re.set(r, n), e("ConfirmModal", {
|
|
1492
1491
|
...t,
|
|
1493
1492
|
requestId: r
|
|
1494
1493
|
}, { closeOnEscape: !1 });
|
|
1495
1494
|
});
|
|
1496
|
-
},
|
|
1495
|
+
}, 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
1496
|
let e = Y((e) => e.openModal);
|
|
1498
1497
|
return { showError: (t, n) => e("ErrorModal", {
|
|
1499
1498
|
title: n,
|
|
1500
|
-
message:
|
|
1499
|
+
message: We(t)
|
|
1501
1500
|
}) };
|
|
1502
|
-
},
|
|
1501
|
+
}, Ke = _(() => ({})), qe = _(() => ({})), Je = () => {
|
|
1503
1502
|
let e = Y((e) => e.modals), t = Y((e) => e.openModal);
|
|
1504
1503
|
return {
|
|
1505
1504
|
openModal: (e, n = {}, r) => t(e, n, r),
|
|
@@ -1509,16 +1508,16 @@ var D = {
|
|
|
1509
1508
|
isOpen: (t) => e.some((e) => e.name === t),
|
|
1510
1509
|
count: e.length
|
|
1511
1510
|
};
|
|
1512
|
-
},
|
|
1513
|
-
className: `${
|
|
1511
|
+
}, Ye = { root: "_root_1x7h7_1" }, Xe = ({ label: e = "Загрузка страницы", className: r = "" }) => /* @__PURE__ */ n("div", {
|
|
1512
|
+
className: `${Ye.root} ${r}`,
|
|
1514
1513
|
role: "status",
|
|
1515
1514
|
"aria-label": e,
|
|
1516
|
-
children: [/* @__PURE__ */ t(
|
|
1517
|
-
}),
|
|
1515
|
+
children: [/* @__PURE__ */ t(x, { decorative: !0 }), /* @__PURE__ */ t("span", { children: e })]
|
|
1516
|
+
}), Ze = {
|
|
1518
1517
|
root: "_root_elask_1",
|
|
1519
1518
|
legend: "_legend_elask_3",
|
|
1520
1519
|
range: "_range_elask_5"
|
|
1521
|
-
},
|
|
1520
|
+
}, Qe = [
|
|
1522
1521
|
{
|
|
1523
1522
|
value: "1",
|
|
1524
1523
|
label: "День"
|
|
@@ -1531,16 +1530,16 @@ var D = {
|
|
|
1531
1530
|
value: "3",
|
|
1532
1531
|
label: "Месяц"
|
|
1533
1532
|
}
|
|
1534
|
-
],
|
|
1533
|
+
], $e = {
|
|
1535
1534
|
day: 1,
|
|
1536
1535
|
week: 2,
|
|
1537
1536
|
month: 3
|
|
1538
|
-
},
|
|
1539
|
-
className: `${
|
|
1537
|
+
}, 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", {
|
|
1538
|
+
className: `${Ze.root} ${u}`,
|
|
1540
1539
|
disabled: s,
|
|
1541
1540
|
children: [
|
|
1542
1541
|
i && /* @__PURE__ */ t("legend", {
|
|
1543
|
-
className:
|
|
1542
|
+
className: Ze.legend,
|
|
1544
1543
|
children: i
|
|
1545
1544
|
}),
|
|
1546
1545
|
/* @__PURE__ */ t(U, {
|
|
@@ -1554,8 +1553,8 @@ var D = {
|
|
|
1554
1553
|
label: "Тип периода"
|
|
1555
1554
|
}),
|
|
1556
1555
|
/* @__PURE__ */ n("div", {
|
|
1557
|
-
className:
|
|
1558
|
-
children: [/* @__PURE__ */ t(
|
|
1556
|
+
className: Ze.range,
|
|
1557
|
+
children: [/* @__PURE__ */ t(L, {
|
|
1559
1558
|
value: e.startDate,
|
|
1560
1559
|
onChange: (t) => r?.({
|
|
1561
1560
|
...e,
|
|
@@ -1565,7 +1564,7 @@ var D = {
|
|
|
1565
1564
|
min: c,
|
|
1566
1565
|
max: l,
|
|
1567
1566
|
disabled: s
|
|
1568
|
-
}), /* @__PURE__ */ t(
|
|
1567
|
+
}), /* @__PURE__ */ t(L, {
|
|
1569
1568
|
value: e.endDate,
|
|
1570
1569
|
onChange: (t) => r?.({
|
|
1571
1570
|
...e,
|
|
@@ -1577,8 +1576,8 @@ var D = {
|
|
|
1577
1576
|
disabled: s
|
|
1578
1577
|
})]
|
|
1579
1578
|
}),
|
|
1580
|
-
a && !o && /* @__PURE__ */ t(
|
|
1581
|
-
o && /* @__PURE__ */ t(
|
|
1579
|
+
a && !o && /* @__PURE__ */ t(E, { children: a }),
|
|
1580
|
+
o && /* @__PURE__ */ t(E, {
|
|
1582
1581
|
variant: "error",
|
|
1583
1582
|
children: o
|
|
1584
1583
|
})
|
|
@@ -1596,7 +1595,7 @@ var D = {
|
|
|
1596
1595
|
success: "_success_15mi5_19",
|
|
1597
1596
|
warning: "_warning_15mi5_21",
|
|
1598
1597
|
error: "_error_15mi5_23"
|
|
1599
|
-
},
|
|
1598
|
+
}, tt = ({ toast: e, onClose: r }) => {
|
|
1600
1599
|
let [i, a] = d(!1), o = u(e.duration), c = u(Date.now());
|
|
1601
1600
|
return s(() => {
|
|
1602
1601
|
if (i || e.duration <= 0) return;
|
|
@@ -1619,7 +1618,7 @@ var D = {
|
|
|
1619
1618
|
onFocus: () => a(!0),
|
|
1620
1619
|
onBlur: () => a(!1),
|
|
1621
1620
|
children: [
|
|
1622
|
-
/* @__PURE__ */ t(
|
|
1621
|
+
/* @__PURE__ */ t(be, {
|
|
1623
1622
|
name: e.variant === "warning" ? "warning" : "info",
|
|
1624
1623
|
className: Z.icon
|
|
1625
1624
|
}),
|
|
@@ -1628,7 +1627,7 @@ var D = {
|
|
|
1628
1627
|
children: [
|
|
1629
1628
|
e.title && /* @__PURE__ */ t("strong", { children: e.title }),
|
|
1630
1629
|
/* @__PURE__ */ t("div", { children: e.message }),
|
|
1631
|
-
e.action && /* @__PURE__ */ t(
|
|
1630
|
+
e.action && /* @__PURE__ */ t(C, {
|
|
1632
1631
|
variant: "empty",
|
|
1633
1632
|
size: "sm",
|
|
1634
1633
|
onClick: () => {
|
|
@@ -1638,7 +1637,7 @@ var D = {
|
|
|
1638
1637
|
})
|
|
1639
1638
|
]
|
|
1640
1639
|
}),
|
|
1641
|
-
e.closable && /* @__PURE__ */ t(
|
|
1640
|
+
e.closable && /* @__PURE__ */ t(C, {
|
|
1642
1641
|
variant: "empty",
|
|
1643
1642
|
size: "sm",
|
|
1644
1643
|
"aria-label": "Закрыть уведомление",
|
|
@@ -1647,11 +1646,11 @@ var D = {
|
|
|
1647
1646
|
})
|
|
1648
1647
|
]
|
|
1649
1648
|
});
|
|
1650
|
-
},
|
|
1649
|
+
}, nt = 0, Q = _((e) => ({
|
|
1651
1650
|
toasts: [],
|
|
1652
1651
|
showToast: (t) => {
|
|
1653
|
-
|
|
1654
|
-
let n = `ds-toast-${
|
|
1652
|
+
nt += 1;
|
|
1653
|
+
let n = `ds-toast-${nt}`;
|
|
1655
1654
|
return e((e) => ({ toasts: [...e.toasts, {
|
|
1656
1655
|
variant: "info",
|
|
1657
1656
|
duration: 5e3,
|
|
@@ -1662,17 +1661,17 @@ var D = {
|
|
|
1662
1661
|
},
|
|
1663
1662
|
removeToast: (t) => e((e) => ({ toasts: e.toasts.filter((e) => e.id !== t) })),
|
|
1664
1663
|
clearToasts: () => e({ toasts: [] })
|
|
1665
|
-
})),
|
|
1664
|
+
})), rt = () => Q.setState({ toasts: [] }), it = ({ position: e = "top-right" }) => {
|
|
1666
1665
|
let n = Q((e) => e.toasts), r = Q((e) => e.removeToast);
|
|
1667
1666
|
return /* @__PURE__ */ t("div", {
|
|
1668
1667
|
className: `${Z.viewport} ${Z[e]}`,
|
|
1669
1668
|
"aria-label": "Уведомления",
|
|
1670
|
-
children: n.map((e) => /* @__PURE__ */ t(
|
|
1669
|
+
children: n.map((e) => /* @__PURE__ */ t(tt, {
|
|
1671
1670
|
toast: e,
|
|
1672
1671
|
onClose: r
|
|
1673
1672
|
}, e.id))
|
|
1674
1673
|
});
|
|
1675
|
-
},
|
|
1674
|
+
}, at = () => {
|
|
1676
1675
|
let e = Q((e) => e.showToast), t = Q((e) => e.removeToast), n = Q((e) => e.clearToasts), r = o((t) => e({
|
|
1677
1676
|
...t,
|
|
1678
1677
|
variant: "info"
|
|
@@ -1703,7 +1702,7 @@ var D = {
|
|
|
1703
1702
|
i,
|
|
1704
1703
|
a
|
|
1705
1704
|
]);
|
|
1706
|
-
},
|
|
1705
|
+
}, ot = {
|
|
1707
1706
|
root: "_root_s9o0g_1",
|
|
1708
1707
|
tooltip: "_tooltip_s9o0g_3",
|
|
1709
1708
|
"ds-tooltip-in": "_ds-tooltip-in_s9o0g_1",
|
|
@@ -1711,7 +1710,7 @@ var D = {
|
|
|
1711
1710
|
bottom: "_bottom_s9o0g_7",
|
|
1712
1711
|
left: "_left_s9o0g_9",
|
|
1713
1712
|
right: "_right_s9o0g_11"
|
|
1714
|
-
},
|
|
1713
|
+
}, st = ({ content: e, children: i, placement: o = "top", delay: l = 450, disabled: f = !1, maxWidth: p = 280, className: m = "" }) => {
|
|
1715
1714
|
let h = c(), [g, _] = d(!1), v = u(null), y = () => {
|
|
1716
1715
|
f || !e || (v.current = setTimeout(() => _(!0), l));
|
|
1717
1716
|
}, b = () => {
|
|
@@ -1733,12 +1732,12 @@ var D = {
|
|
|
1733
1732
|
onBlur: b
|
|
1734
1733
|
});
|
|
1735
1734
|
return /* @__PURE__ */ n("span", {
|
|
1736
|
-
className: `${
|
|
1735
|
+
className: `${ot.root} ${m}`,
|
|
1737
1736
|
onPointerDown: g ? b : y,
|
|
1738
1737
|
children: [x, g && /* @__PURE__ */ t("span", {
|
|
1739
1738
|
id: h,
|
|
1740
1739
|
role: "tooltip",
|
|
1741
|
-
className: `${
|
|
1740
|
+
className: `${ot.tooltip} ${ot[o]}`,
|
|
1742
1741
|
style: { maxWidth: p },
|
|
1743
1742
|
children: e
|
|
1744
1743
|
})]
|
|
@@ -1750,7 +1749,7 @@ var D = {
|
|
|
1750
1749
|
overlay: "_overlay_1ue3g_7",
|
|
1751
1750
|
error: "_error_1ue3g_7",
|
|
1752
1751
|
caption: "_caption_1ue3g_13"
|
|
1753
|
-
},
|
|
1752
|
+
}, 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
1753
|
let [h, g] = d(!1), _ = c ?? (h ? "Не удалось воспроизвести видео" : void 0);
|
|
1755
1754
|
return /* @__PURE__ */ n("figure", {
|
|
1756
1755
|
className: `${$.root} ${u}`,
|
|
@@ -1772,7 +1771,7 @@ var D = {
|
|
|
1772
1771
|
}),
|
|
1773
1772
|
s && /* @__PURE__ */ t("div", {
|
|
1774
1773
|
className: $.overlay,
|
|
1775
|
-
children: /* @__PURE__ */ t(
|
|
1774
|
+
children: /* @__PURE__ */ t(x, { label: "Загрузка видео" })
|
|
1776
1775
|
}),
|
|
1777
1776
|
(_ || e.length === 0) && /* @__PURE__ */ t("div", {
|
|
1778
1777
|
className: $.error,
|
|
@@ -1787,4 +1786,4 @@ var D = {
|
|
|
1787
1786
|
});
|
|
1788
1787
|
};
|
|
1789
1788
|
//#endregion
|
|
1790
|
-
export {
|
|
1789
|
+
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 };
|