@efficiency-point/design-system 0.0.11 → 0.0.12
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
|
@@ -58,11 +58,11 @@ var v = {
|
|
|
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
|
-
type: s,
|
|
62
61
|
className: `${S.button} ${S[n]} ${S[r]} ${c}`,
|
|
63
62
|
disabled: o || i,
|
|
64
63
|
"aria-busy": i || void 0,
|
|
65
64
|
...l,
|
|
65
|
+
type: s,
|
|
66
66
|
children: i ? /* @__PURE__ */ t(x, {
|
|
67
67
|
variant: "light",
|
|
68
68
|
label: a
|
|
@@ -207,47 +207,47 @@ var w = {
|
|
|
207
207
|
}
|
|
208
208
|
let n = new Date(t === "date" ? `${e}T00:00` : e);
|
|
209
209
|
return Number.isNaN(n.getTime()) ? null : n;
|
|
210
|
-
},
|
|
210
|
+
}, I = (e, t) => {
|
|
211
211
|
if (!e) return "";
|
|
212
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
|
+
}, L = (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
|
-
},
|
|
220
|
+
}, ee = (e, t) => !!(e && e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate()), te = (e, t, n) => {
|
|
221
221
|
let r = N(e).getTime();
|
|
222
222
|
return !!(t && r < N(t).getTime() || n && r > N(n).getTime());
|
|
223
|
-
},
|
|
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), [
|
|
223
|
+
}, R = ({ value: r, onChange: i, mode: a = "date", label: o, placeholder: f, hint: p, error: m, disabled: h = !1, readOnly: g = !1, required: _ = !1, min: v, max: y, id: b, name: x, className: S = "" }) => {
|
|
224
|
+
let C = c(), w = b ?? `ds-date-time-${x ?? C}`, D = p ? `${w}-hint` : void 0, O = m ? `${w}-error` : void 0, M = u(null), N = u(null), [R, z] = d(!1), [B, V] = d(r ?? /* @__PURE__ */ new Date()), [H, ne] = d(P(r, "time")), U = l(() => L(B), [B]), re = a !== "time", W = a !== "date";
|
|
225
225
|
s(() => {
|
|
226
|
-
r &&
|
|
226
|
+
r && V(r), ne(P(r, "time"));
|
|
227
227
|
}, [r]), s(() => {
|
|
228
228
|
let e = (e) => {
|
|
229
|
-
M.current?.contains(e.target) ||
|
|
229
|
+
M.current?.contains(e.target) || z(!1);
|
|
230
230
|
}, t = (e) => {
|
|
231
|
-
e.key === "Escape" && (
|
|
231
|
+
e.key === "Escape" && (z(!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 ie = (e) => {
|
|
238
|
+
if (te(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" && z(!1);
|
|
241
|
+
}, ae = (e) => {
|
|
242
|
+
if (ne(e), !e) {
|
|
243
243
|
i?.(null);
|
|
244
244
|
return;
|
|
245
245
|
}
|
|
246
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 ?? B : /* @__PURE__ */ new Date());
|
|
249
249
|
n.setHours(t.getHours(), t.getMinutes(), 0, 0), !(v && n < v || y && n > y) && i?.(n);
|
|
250
|
-
},
|
|
250
|
+
}, G = f ?? (a === "date" ? "Выберите дату" : a === "time" ? "Введите время" : "Выберите дату и время"), oe = [D, O].filter(Boolean).join(" ") || void 0;
|
|
251
251
|
return /* @__PURE__ */ n("div", {
|
|
252
252
|
ref: M,
|
|
253
253
|
className: `${k.wrapper} ${S}`,
|
|
@@ -266,25 +266,25 @@ var w = {
|
|
|
266
266
|
className: `${k.trigger} ${m ? k.error : ""}`,
|
|
267
267
|
disabled: h,
|
|
268
268
|
"aria-readonly": g || void 0,
|
|
269
|
-
"aria-expanded":
|
|
269
|
+
"aria-expanded": R,
|
|
270
270
|
"aria-haspopup": "dialog",
|
|
271
|
-
"aria-describedby":
|
|
271
|
+
"aria-describedby": oe,
|
|
272
272
|
onClick: () => {
|
|
273
|
-
g ||
|
|
273
|
+
g || z((e) => !e);
|
|
274
274
|
},
|
|
275
275
|
children: [/* @__PURE__ */ t("span", {
|
|
276
276
|
className: r ? k.value : k.placeholder,
|
|
277
|
-
children:
|
|
277
|
+
children: I(r, a) || G
|
|
278
278
|
}), /* @__PURE__ */ t("span", {
|
|
279
279
|
"aria-hidden": "true",
|
|
280
280
|
children: "▾"
|
|
281
281
|
})]
|
|
282
282
|
}),
|
|
283
|
-
|
|
283
|
+
R && !g && /* @__PURE__ */ n("div", {
|
|
284
284
|
className: k.panel,
|
|
285
285
|
role: "dialog",
|
|
286
|
-
"aria-label": o ??
|
|
287
|
-
children: [
|
|
286
|
+
"aria-label": o ?? G,
|
|
287
|
+
children: [re && /* @__PURE__ */ n(e, { children: [
|
|
288
288
|
/* @__PURE__ */ n("div", {
|
|
289
289
|
className: k.calendarHeader,
|
|
290
290
|
children: [
|
|
@@ -292,14 +292,14 @@ var w = {
|
|
|
292
292
|
type: "button",
|
|
293
293
|
className: k.nav,
|
|
294
294
|
"aria-label": "Предыдущий месяц",
|
|
295
|
-
onClick: () =>
|
|
295
|
+
onClick: () => V(new Date(B.getFullYear(), B.getMonth() - 1, 1)),
|
|
296
296
|
children: "‹"
|
|
297
297
|
}),
|
|
298
298
|
/* @__PURE__ */ t("select", {
|
|
299
299
|
className: k.monthSelect,
|
|
300
300
|
"aria-label": "Месяц",
|
|
301
|
-
value:
|
|
302
|
-
onChange: (e) =>
|
|
301
|
+
value: B.getMonth(),
|
|
302
|
+
onChange: (e) => V(new Date(B.getFullYear(), Number(e.target.value), 1)),
|
|
303
303
|
children: j.map((e, n) => /* @__PURE__ */ t("option", {
|
|
304
304
|
value: n,
|
|
305
305
|
children: e
|
|
@@ -309,14 +309,14 @@ var w = {
|
|
|
309
309
|
className: k.yearInput,
|
|
310
310
|
type: "number",
|
|
311
311
|
"aria-label": "Год",
|
|
312
|
-
value:
|
|
313
|
-
onChange: (e) =>
|
|
312
|
+
value: B.getFullYear(),
|
|
313
|
+
onChange: (e) => V(new Date(Number(e.target.value), B.getMonth(), 1))
|
|
314
314
|
}),
|
|
315
315
|
/* @__PURE__ */ t("button", {
|
|
316
316
|
type: "button",
|
|
317
317
|
className: k.nav,
|
|
318
318
|
"aria-label": "Следующий месяц",
|
|
319
|
-
onClick: () =>
|
|
319
|
+
onClick: () => V(new Date(B.getFullYear(), B.getMonth() + 1, 1)),
|
|
320
320
|
children: "›"
|
|
321
321
|
})
|
|
322
322
|
]
|
|
@@ -327,25 +327,25 @@ var w = {
|
|
|
327
327
|
}),
|
|
328
328
|
/* @__PURE__ */ t("div", {
|
|
329
329
|
className: k.days,
|
|
330
|
-
children:
|
|
331
|
-
let n =
|
|
330
|
+
children: U.map((e) => {
|
|
331
|
+
let n = ee(r, e);
|
|
332
332
|
return /* @__PURE__ */ t("button", {
|
|
333
333
|
type: "button",
|
|
334
|
-
className: `${k.day} ${e.getMonth() ===
|
|
335
|
-
disabled:
|
|
334
|
+
className: `${k.day} ${e.getMonth() === B.getMonth() ? "" : k.outside} ${n ? k.selected : ""}`,
|
|
335
|
+
disabled: te(e, v, y),
|
|
336
336
|
"aria-pressed": n,
|
|
337
|
-
onClick: () =>
|
|
337
|
+
onClick: () => ie(e),
|
|
338
338
|
children: e.getDate()
|
|
339
339
|
}, e.toISOString());
|
|
340
340
|
})
|
|
341
341
|
})
|
|
342
|
-
] }),
|
|
342
|
+
] }), W && /* @__PURE__ */ n("label", {
|
|
343
343
|
className: k.timeLabel,
|
|
344
344
|
children: [/* @__PURE__ */ t("span", { children: "Время" }), /* @__PURE__ */ t("input", {
|
|
345
345
|
className: k.timeInput,
|
|
346
346
|
type: "time",
|
|
347
|
-
value:
|
|
348
|
-
onChange: (e) =>
|
|
347
|
+
value: H,
|
|
348
|
+
onChange: (e) => ae(e.target.value)
|
|
349
349
|
})]
|
|
350
350
|
})]
|
|
351
351
|
}),
|
|
@@ -360,20 +360,20 @@ var w = {
|
|
|
360
360
|
})
|
|
361
361
|
]
|
|
362
362
|
});
|
|
363
|
-
},
|
|
363
|
+
}, z = {
|
|
364
364
|
root: "_root_1q42e_1",
|
|
365
365
|
legend: "_legend_1q42e_3",
|
|
366
366
|
range: "_range_1q42e_5"
|
|
367
|
-
},
|
|
367
|
+
}, B = (e) => !!(e.from && e.to && e.from.getTime() <= e.to.getTime()), V = ({ value: e, onChange: r, onDraftChange: i, mode: a = "date", fromLabel: o = "От", toLabel: s = "До", hint: c, error: l, min: u, max: d, disabled: f = !1, readOnly: p = !1, required: m = !1, className: h = "" }) => {
|
|
368
368
|
let g = l ?? (e.from && e.to && e.from > e.to ? "Дата «От» не может быть позже даты «До»" : void 0), _ = (e) => {
|
|
369
|
-
i?.(e),
|
|
369
|
+
i?.(e), B(e) && r?.(e);
|
|
370
370
|
};
|
|
371
371
|
return /* @__PURE__ */ n("fieldset", {
|
|
372
|
-
className: `${
|
|
372
|
+
className: `${z.root} ${h}`,
|
|
373
373
|
disabled: f,
|
|
374
374
|
children: [/* @__PURE__ */ n("div", {
|
|
375
|
-
className:
|
|
376
|
-
children: [/* @__PURE__ */ t(
|
|
375
|
+
className: z.range,
|
|
376
|
+
children: [/* @__PURE__ */ t(R, {
|
|
377
377
|
value: e.from,
|
|
378
378
|
mode: a === "datetime" ? "datetime" : a,
|
|
379
379
|
label: o,
|
|
@@ -387,7 +387,7 @@ var w = {
|
|
|
387
387
|
...e,
|
|
388
388
|
from: t
|
|
389
389
|
})
|
|
390
|
-
}), /* @__PURE__ */ t(
|
|
390
|
+
}), /* @__PURE__ */ t(R, {
|
|
391
391
|
value: e.to,
|
|
392
392
|
mode: a === "datetime" ? "datetime" : a,
|
|
393
393
|
label: s,
|
|
@@ -404,7 +404,7 @@ var w = {
|
|
|
404
404
|
})]
|
|
405
405
|
}), c && !g && /* @__PURE__ */ t(E, { children: c })]
|
|
406
406
|
});
|
|
407
|
-
},
|
|
407
|
+
}, H = {
|
|
408
408
|
group: "_group_1fs9e_1",
|
|
409
409
|
skeleton: "_skeleton_1fs9e_3",
|
|
410
410
|
text: "_text_1fs9e_5",
|
|
@@ -412,17 +412,17 @@ var w = {
|
|
|
412
412
|
circular: "_circular_1fs9e_9",
|
|
413
413
|
animated: "_animated_1fs9e_11",
|
|
414
414
|
"ds-skeleton": "_ds-skeleton_1fs9e_1"
|
|
415
|
-
},
|
|
416
|
-
className: `${
|
|
415
|
+
}, ne = ({ variant: e = "text", width: n = "100%", height: r, lines: i = 1, animated: a = !0, className: o = "" }) => /* @__PURE__ */ t("span", {
|
|
416
|
+
className: `${H.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: `${H.skeleton} ${H[e]} ${a ? H.animated : ""}`,
|
|
420
420
|
style: {
|
|
421
421
|
width: s === i - 1 && i > 1 ? "70%" : n,
|
|
422
422
|
height: r
|
|
423
423
|
}
|
|
424
424
|
}, s))
|
|
425
|
-
}),
|
|
425
|
+
}), U = {
|
|
426
426
|
wrapper: "_wrapper_dkn63_1",
|
|
427
427
|
label: "_label_dkn63_17",
|
|
428
428
|
container: "_container_dkn63_29",
|
|
@@ -438,13 +438,13 @@ var w = {
|
|
|
438
438
|
message: "_message_dkn63_265",
|
|
439
439
|
error: "_error_dkn63_267",
|
|
440
440
|
errorState: "_errorState_dkn63_293"
|
|
441
|
-
},
|
|
441
|
+
}, re = (e, t, n) => {
|
|
442
442
|
for (let r = 0; r < e.length; r += 1) {
|
|
443
443
|
let i = (t + r * n + e.length) % e.length;
|
|
444
444
|
if (!e[i]?.disabled) return i;
|
|
445
445
|
}
|
|
446
446
|
return -1;
|
|
447
|
-
},
|
|
447
|
+
}, W = ({ options: r, value: i, onChange: a, placeholder: o = "Выберите опцию", disabled: f = !1, stringWhileDisabled: p = !1, label: m, error: h, hint: g, className: _ = "", name: v, id: y, needMark: b = !0, maxMenuHeight: x }) => {
|
|
448
448
|
let S = c(), C = y ?? `ds-dropdown-${v ?? S}`, [w, T] = d(!1), E = u(null), D = u(null), O = u([]), k = l(() => r.find((e) => e.value === i), [r, i]), A = g ? `${C}-hint` : void 0, j = h ? `${C}-error` : void 0, M = [A, j].filter(Boolean).join(" ") || void 0, N = f && p;
|
|
449
449
|
s(() => {
|
|
450
450
|
let e = (e) => {
|
|
@@ -457,7 +457,7 @@ var w = {
|
|
|
457
457
|
};
|
|
458
458
|
}, [w]);
|
|
459
459
|
let P = (e, t) => {
|
|
460
|
-
let n =
|
|
460
|
+
let n = re(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());
|
|
@@ -465,21 +465,21 @@ var w = {
|
|
|
465
465
|
return /* @__PURE__ */ n("div", {
|
|
466
466
|
ref: E,
|
|
467
467
|
className: [
|
|
468
|
-
|
|
469
|
-
h ?
|
|
468
|
+
U.wrapper,
|
|
469
|
+
h ? U.errorState : "",
|
|
470
470
|
_
|
|
471
471
|
].filter(Boolean).join(" "),
|
|
472
472
|
children: [
|
|
473
473
|
m && /* @__PURE__ */ t("label", {
|
|
474
474
|
htmlFor: N ? void 0 : C,
|
|
475
|
-
className:
|
|
475
|
+
className: U.label,
|
|
476
476
|
children: m
|
|
477
477
|
}),
|
|
478
478
|
/* @__PURE__ */ t("div", {
|
|
479
|
-
className:
|
|
479
|
+
className: U.container,
|
|
480
480
|
children: N ? /* @__PURE__ */ t("div", {
|
|
481
481
|
id: C,
|
|
482
|
-
className:
|
|
482
|
+
className: U.disabledText,
|
|
483
483
|
"aria-describedby": M,
|
|
484
484
|
children: k?.label ?? o
|
|
485
485
|
}) : /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ n("button", {
|
|
@@ -487,7 +487,7 @@ var w = {
|
|
|
487
487
|
id: C,
|
|
488
488
|
type: "button",
|
|
489
489
|
name: v,
|
|
490
|
-
className:
|
|
490
|
+
className: U.trigger,
|
|
491
491
|
disabled: f,
|
|
492
492
|
"aria-haspopup": "listbox",
|
|
493
493
|
"aria-expanded": w,
|
|
@@ -503,10 +503,10 @@ var w = {
|
|
|
503
503
|
}
|
|
504
504
|
},
|
|
505
505
|
children: [/* @__PURE__ */ t("span", {
|
|
506
|
-
className: k ?
|
|
506
|
+
className: k ? U.value : U.placeholder,
|
|
507
507
|
children: k?.label ?? o
|
|
508
508
|
}), /* @__PURE__ */ t("span", {
|
|
509
|
-
className: `${
|
|
509
|
+
className: `${U.chevron} ${w ? U.chevronOpen : ""}`,
|
|
510
510
|
"aria-hidden": "true",
|
|
511
511
|
children: /* @__PURE__ */ t("svg", {
|
|
512
512
|
viewBox: "0 0 20 20",
|
|
@@ -522,7 +522,7 @@ var w = {
|
|
|
522
522
|
})]
|
|
523
523
|
}), w && /* @__PURE__ */ t("ul", {
|
|
524
524
|
id: `${C}-listbox`,
|
|
525
|
-
className:
|
|
525
|
+
className: U.menu,
|
|
526
526
|
role: "listbox",
|
|
527
527
|
"aria-label": m,
|
|
528
528
|
style: { maxHeight: x },
|
|
@@ -538,7 +538,7 @@ var w = {
|
|
|
538
538
|
role: "option",
|
|
539
539
|
"aria-selected": o,
|
|
540
540
|
disabled: e.disabled,
|
|
541
|
-
className: `${
|
|
541
|
+
className: `${U.option} ${o ? U.selected : ""}`,
|
|
542
542
|
onClick: () => F(e),
|
|
543
543
|
onKeyDown: (e) => {
|
|
544
544
|
if ((e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), P(a + (e.key === "ArrowDown" ? 1 : -1), e.key === "ArrowDown" ? 1 : -1)), e.key === "Tab" && T(!1), e.key === "Home" || e.key === "End") {
|
|
@@ -558,35 +558,35 @@ var w = {
|
|
|
558
558
|
}),
|
|
559
559
|
g && !h && /* @__PURE__ */ t("span", {
|
|
560
560
|
id: A,
|
|
561
|
-
className:
|
|
561
|
+
className: U.message,
|
|
562
562
|
children: g
|
|
563
563
|
}),
|
|
564
564
|
h && /* @__PURE__ */ t("span", {
|
|
565
565
|
id: j,
|
|
566
|
-
className:
|
|
566
|
+
className: U.error,
|
|
567
567
|
children: h
|
|
568
568
|
})
|
|
569
569
|
]
|
|
570
570
|
});
|
|
571
|
-
},
|
|
571
|
+
}, ie = (e) => `${e.id}:${e.direction}`, ae = ({ 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: ie({
|
|
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: ie({
|
|
581
581
|
id: e.id,
|
|
582
582
|
direction: "desc"
|
|
583
583
|
}),
|
|
584
584
|
label: e.descLabel ?? `${e.label} · по убыванию`,
|
|
585
585
|
disabled: e.disabled
|
|
586
586
|
}]);
|
|
587
|
-
return /* @__PURE__ */ t(
|
|
587
|
+
return /* @__PURE__ */ t(W, {
|
|
588
588
|
options: c,
|
|
589
|
-
value: n ?
|
|
589
|
+
value: n ? ie(n) : "",
|
|
590
590
|
label: i,
|
|
591
591
|
placeholder: a,
|
|
592
592
|
disabled: o,
|
|
@@ -599,7 +599,7 @@ var w = {
|
|
|
599
599
|
});
|
|
600
600
|
}
|
|
601
601
|
});
|
|
602
|
-
},
|
|
602
|
+
}, G = {
|
|
603
603
|
root: "_root_1h9ti_1",
|
|
604
604
|
tableWrap: "_tableWrap_1h9ti_3",
|
|
605
605
|
table: "_table_1h9ti_3",
|
|
@@ -613,10 +613,10 @@ var w = {
|
|
|
613
613
|
default: "_default_1h9ti_41",
|
|
614
614
|
tableOnMobile: "_tableOnMobile_1h9ti_41",
|
|
615
615
|
wide: "_wide_1h9ti_45"
|
|
616
|
-
},
|
|
616
|
+
}, oe = m({
|
|
617
617
|
rowSortingFeature: p,
|
|
618
618
|
sortedRowModel: f()
|
|
619
|
-
}),
|
|
619
|
+
}), se = (e, t) => {
|
|
620
620
|
let n = /* @__PURE__ */ new Set();
|
|
621
621
|
for (let t of e) {
|
|
622
622
|
if (!t.id.trim()) return "Идентификатор колонки не может быть пустым";
|
|
@@ -628,36 +628,36 @@ var w = {
|
|
|
628
628
|
for (let t of e) if (typeof t.accessor == "string" && !(t.accessor in r)) return `В строке ${n + 1} отсутствует колонка «${t.id}»`;
|
|
629
629
|
}
|
|
630
630
|
return null;
|
|
631
|
-
},
|
|
631
|
+
}, ce = (e, t) => typeof e == "function" ? e(t) : t[e], le = (e) => {
|
|
632
632
|
if (e == null || e === "") return null;
|
|
633
633
|
let t = Date.parse(String(e));
|
|
634
634
|
return Number.isNaN(t) ? null : t;
|
|
635
|
-
},
|
|
636
|
-
let r =
|
|
635
|
+
}, ue = (e, t, n) => {
|
|
636
|
+
let r = le(e.getValue(n)), i = le(t.getValue(n));
|
|
637
637
|
return r === null && i === null ? 0 : r === null ? -1 : i === null ? 1 : r - i;
|
|
638
|
-
},
|
|
638
|
+
}, de = (e, t, n) => {
|
|
639
639
|
let r = e.getValue(n), i = t.getValue(n);
|
|
640
640
|
return r == null && i == null ? 0 : r == null ? -1 : i == null ? 1 : Number(r) - Number(i);
|
|
641
|
-
},
|
|
641
|
+
}, fe = (e, t, n) => {
|
|
642
642
|
let r = e.getValue(n), i = t.getValue(n);
|
|
643
643
|
return r == null && i == null ? 0 : r == null ? -1 : i == null ? 1 : Number(!!r) - Number(!!i);
|
|
644
|
-
},
|
|
644
|
+
}, pe = (e, t, n) => {
|
|
645
645
|
let r = String(e.getValue(n) ?? ""), i = String(t.getValue(n) ?? "");
|
|
646
646
|
return r.localeCompare(i, void 0, {
|
|
647
647
|
numeric: !0,
|
|
648
648
|
sensitivity: "base"
|
|
649
649
|
});
|
|
650
|
-
},
|
|
650
|
+
}, me = (e) => {
|
|
651
651
|
switch (e) {
|
|
652
|
-
case "date": return
|
|
653
|
-
case "number": return
|
|
654
|
-
case "boolean": return
|
|
652
|
+
case "date": return ue;
|
|
653
|
+
case "number": return de;
|
|
654
|
+
case "boolean": return fe;
|
|
655
655
|
case "text":
|
|
656
|
-
case void 0: return
|
|
656
|
+
case void 0: return pe;
|
|
657
657
|
case "custom": return;
|
|
658
658
|
}
|
|
659
|
-
},
|
|
660
|
-
let t = (t) =>
|
|
659
|
+
}, he = (e) => {
|
|
660
|
+
let t = (t) => ce(e.accessor, t), n = e.sortFn ?? me(e.dataType), r = e.enableSorting ?? (e.dataType !== "custom" && n !== void 0), i = {
|
|
661
661
|
id: e.id,
|
|
662
662
|
accessorFn: t,
|
|
663
663
|
header: () => e.header,
|
|
@@ -669,9 +669,9 @@ var w = {
|
|
|
669
669
|
sortDescFirst: e.sortDescFirst
|
|
670
670
|
};
|
|
671
671
|
return n !== void 0 && (i.sortFn = n), i;
|
|
672
|
-
},
|
|
673
|
-
let [x, S] = d([]), C = o ?? x, w = l(() =>
|
|
674
|
-
features:
|
|
672
|
+
}, ge = ({ 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(() => se(e, r), [e, r]), T = l(() => e.map(he), [e]), E = h({
|
|
674
|
+
features: oe,
|
|
675
675
|
columns: T,
|
|
676
676
|
data: r,
|
|
677
677
|
state: { sorting: C },
|
|
@@ -684,17 +684,17 @@ var w = {
|
|
|
684
684
|
id: e.id,
|
|
685
685
|
label: typeof e.header == "string" ? e.header : e.id
|
|
686
686
|
})), k = [
|
|
687
|
-
|
|
688
|
-
a === "wide" ?
|
|
689
|
-
i ?
|
|
687
|
+
G.root,
|
|
688
|
+
a === "wide" ? G.wide : G.default,
|
|
689
|
+
i ? G.tableOnMobile : "",
|
|
690
690
|
b
|
|
691
691
|
].filter(Boolean).join(" "), A = w ?? g;
|
|
692
692
|
return /* @__PURE__ */ n("section", {
|
|
693
693
|
className: k,
|
|
694
694
|
"aria-busy": m,
|
|
695
695
|
children: [
|
|
696
|
-
!i && !m && !A && D.length > 0 && O.length > 0 && /* @__PURE__ */ t(
|
|
697
|
-
className:
|
|
696
|
+
!i && !m && !A && D.length > 0 && O.length > 0 && /* @__PURE__ */ t(ae, {
|
|
697
|
+
className: G.mobileSort,
|
|
698
698
|
options: O,
|
|
699
699
|
value: C[0] ? {
|
|
700
700
|
id: C[0].id,
|
|
@@ -706,15 +706,15 @@ var w = {
|
|
|
706
706
|
}])
|
|
707
707
|
}),
|
|
708
708
|
/* @__PURE__ */ t("div", {
|
|
709
|
-
className:
|
|
709
|
+
className: G.tableWrap,
|
|
710
710
|
style: { maxHeight: y },
|
|
711
711
|
children: /* @__PURE__ */ n("table", {
|
|
712
|
-
className:
|
|
712
|
+
className: G.table,
|
|
713
713
|
"aria-label": p,
|
|
714
714
|
children: [
|
|
715
715
|
f && /* @__PURE__ */ t("caption", { children: f }),
|
|
716
716
|
/* @__PURE__ */ t("thead", {
|
|
717
|
-
className: v ?
|
|
717
|
+
className: v ? G.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", {
|
|
@@ -722,7 +722,7 @@ var w = {
|
|
|
722
722
|
"aria-sort": r === "asc" ? "ascending" : r === "desc" ? "descending" : "none",
|
|
723
723
|
children: /* @__PURE__ */ n("button", {
|
|
724
724
|
type: "button",
|
|
725
|
-
className:
|
|
725
|
+
className: G.sortButton,
|
|
726
726
|
disabled: !i,
|
|
727
727
|
onClick: a,
|
|
728
728
|
children: [/* @__PURE__ */ t(E.FlexRender, { header: e }), /* @__PURE__ */ t("span", {
|
|
@@ -735,13 +735,13 @@ var w = {
|
|
|
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(ne, { lines: 3 })
|
|
739
739
|
}) }) : A ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
740
|
-
className:
|
|
740
|
+
className: G.state,
|
|
741
741
|
colSpan: e.length,
|
|
742
742
|
children: A
|
|
743
743
|
}) }) : D.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
744
|
-
className:
|
|
744
|
+
className: G.state,
|
|
745
745
|
colSpan: e.length,
|
|
746
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)) })
|
|
@@ -749,14 +749,14 @@ var w = {
|
|
|
749
749
|
})
|
|
750
750
|
}),
|
|
751
751
|
!i && /* @__PURE__ */ t("div", {
|
|
752
|
-
className:
|
|
752
|
+
className: G.cards,
|
|
753
753
|
role: "list",
|
|
754
754
|
"aria-label": p ?? f,
|
|
755
|
-
children: m ? /* @__PURE__ */ t(
|
|
756
|
-
className:
|
|
755
|
+
children: m ? /* @__PURE__ */ t(ne, { lines: 4 }) : A ? /* @__PURE__ */ t("div", {
|
|
756
|
+
className: G.state,
|
|
757
757
|
children: A
|
|
758
758
|
}) : D.length === 0 ? /* @__PURE__ */ t("div", {
|
|
759
|
-
className:
|
|
759
|
+
className: G.state,
|
|
760
760
|
children: _
|
|
761
761
|
}) : D.map((r) => {
|
|
762
762
|
if (c) return /* @__PURE__ */ t("div", {
|
|
@@ -766,14 +766,14 @@ var w = {
|
|
|
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) => ce(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
|
-
className:
|
|
772
|
+
className: G.card,
|
|
773
773
|
children: [
|
|
774
774
|
/* @__PURE__ */ t("h3", { children: a ? s(a) : `Строка ${r.index + 1}` }),
|
|
775
775
|
/* @__PURE__ */ t("dl", { children: i.filter((e) => e !== a && e.mobile?.mobileVariant !== "actions").map((e) => /* @__PURE__ */ n("div", {
|
|
776
|
-
className: e.mobile?.mobileSpan === 2 ?
|
|
776
|
+
className: e.mobile?.mobileSpan === 2 ? G.spanTwo : "",
|
|
777
777
|
children: [/* @__PURE__ */ t("dt", { children: e.mobile?.mobileLabel ?? e.header }), /* @__PURE__ */ t("dd", { children: s(e) })]
|
|
778
778
|
}, e.id)) }),
|
|
779
779
|
i.filter((e) => e.mobile?.mobileVariant === "actions").map((e) => /* @__PURE__ */ t("footer", { children: s(e) }, e.id))
|
|
@@ -783,7 +783,7 @@ var w = {
|
|
|
783
783
|
})
|
|
784
784
|
]
|
|
785
785
|
});
|
|
786
|
-
},
|
|
786
|
+
}, _e = ({ 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,30 +800,30 @@ var w = {
|
|
|
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 = re(e, t, n);
|
|
804
804
|
E.current[r]?.focus(), E.current[r]?.scrollIntoView({ block: "nearest" });
|
|
805
805
|
};
|
|
806
806
|
return /* @__PURE__ */ n("div", {
|
|
807
807
|
ref: w,
|
|
808
808
|
className: [
|
|
809
|
-
|
|
810
|
-
p ?
|
|
809
|
+
U.wrapper,
|
|
810
|
+
p ? U.errorState : "",
|
|
811
811
|
h
|
|
812
812
|
].filter(Boolean).join(" "),
|
|
813
813
|
children: [
|
|
814
814
|
f && /* @__PURE__ */ t("label", {
|
|
815
815
|
htmlFor: x,
|
|
816
|
-
className:
|
|
816
|
+
className: U.label,
|
|
817
817
|
children: f
|
|
818
818
|
}),
|
|
819
819
|
/* @__PURE__ */ n("div", {
|
|
820
|
-
className:
|
|
820
|
+
className: U.container,
|
|
821
821
|
children: [/* @__PURE__ */ n("button", {
|
|
822
822
|
ref: T,
|
|
823
823
|
id: x,
|
|
824
824
|
type: "button",
|
|
825
825
|
name: g,
|
|
826
|
-
className:
|
|
826
|
+
className: U.trigger,
|
|
827
827
|
disabled: o,
|
|
828
828
|
"aria-haspopup": "listbox",
|
|
829
829
|
"aria-expanded": S,
|
|
@@ -839,16 +839,16 @@ var w = {
|
|
|
839
839
|
}
|
|
840
840
|
},
|
|
841
841
|
children: [/* @__PURE__ */ t("span", {
|
|
842
|
-
className: D.length ?
|
|
842
|
+
className: D.length ? U.value : U.placeholder,
|
|
843
843
|
children: O || a
|
|
844
844
|
}), /* @__PURE__ */ t("span", {
|
|
845
|
-
className: `${
|
|
845
|
+
className: `${U.chevron} ${S ? U.chevronOpen : ""}`,
|
|
846
846
|
"aria-hidden": "true",
|
|
847
847
|
children: "⌄"
|
|
848
848
|
})]
|
|
849
849
|
}), S && /* @__PURE__ */ t("ul", {
|
|
850
850
|
id: `${x}-listbox`,
|
|
851
|
-
className:
|
|
851
|
+
className: U.menu,
|
|
852
852
|
role: "listbox",
|
|
853
853
|
"aria-label": f,
|
|
854
854
|
"aria-multiselectable": "true",
|
|
@@ -865,7 +865,7 @@ var w = {
|
|
|
865
865
|
role: "option",
|
|
866
866
|
"aria-selected": o,
|
|
867
867
|
disabled: i.disabled,
|
|
868
|
-
className: `${
|
|
868
|
+
className: `${U.option} ${o ? U.selected : ""}`,
|
|
869
869
|
onClick: () => j(i),
|
|
870
870
|
onKeyDown: (t) => {
|
|
871
871
|
if (t.key === "ArrowDown" || t.key === "ArrowUp") {
|
|
@@ -891,17 +891,17 @@ var w = {
|
|
|
891
891
|
}),
|
|
892
892
|
m && !p && /* @__PURE__ */ t("span", {
|
|
893
893
|
id: k,
|
|
894
|
-
className:
|
|
894
|
+
className: U.message,
|
|
895
895
|
children: m
|
|
896
896
|
}),
|
|
897
897
|
p && /* @__PURE__ */ t("span", {
|
|
898
898
|
id: A,
|
|
899
|
-
className:
|
|
899
|
+
className: U.error,
|
|
900
900
|
children: p
|
|
901
901
|
})
|
|
902
902
|
]
|
|
903
903
|
});
|
|
904
|
-
},
|
|
904
|
+
}, ve = {
|
|
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 w = {
|
|
|
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
|
+
}, ye = ({ 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,27 +923,27 @@ var w = {
|
|
|
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:
|
|
927
|
-
}),
|
|
926
|
+
children: [r && /* @__PURE__ */ t("title", { children: r }), /* @__PURE__ */ t("path", { d: ve[e] })]
|
|
927
|
+
}), K = {
|
|
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
|
+
}, be = ({ 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
|
-
className: `${
|
|
936
|
+
className: `${K.root} ${l}`,
|
|
937
937
|
"aria-labelledby": u,
|
|
938
938
|
children: [/* @__PURE__ */ n("header", {
|
|
939
|
-
className:
|
|
939
|
+
className: K.header,
|
|
940
940
|
children: [/* @__PURE__ */ t(s, {
|
|
941
941
|
id: u,
|
|
942
|
-
className:
|
|
942
|
+
className: K.title,
|
|
943
943
|
children: e
|
|
944
944
|
}), i && /* @__PURE__ */ t("button", {
|
|
945
945
|
type: "button",
|
|
946
|
-
className:
|
|
946
|
+
className: K.dismiss,
|
|
947
947
|
onClick: a,
|
|
948
948
|
"aria-label": o,
|
|
949
949
|
children: /* @__PURE__ */ t("svg", {
|
|
@@ -959,23 +959,23 @@ var w = {
|
|
|
959
959
|
})
|
|
960
960
|
})]
|
|
961
961
|
}), /* @__PURE__ */ t("div", {
|
|
962
|
-
className:
|
|
962
|
+
className: K.content,
|
|
963
963
|
children: r
|
|
964
964
|
})]
|
|
965
965
|
});
|
|
966
|
-
},
|
|
966
|
+
}, q = {
|
|
967
967
|
wrapper: "_wrapper_1tz82_1",
|
|
968
968
|
control: "_control_1tz82_3",
|
|
969
969
|
input: "_input_1tz82_5",
|
|
970
970
|
disabledText: "_disabledText_1tz82_5",
|
|
971
971
|
inputError: "_inputError_1tz82_11",
|
|
972
972
|
trailingAction: "_trailingAction_1tz82_13"
|
|
973
|
-
},
|
|
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,
|
|
973
|
+
}, xe = ({ 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, I = String(e ?? ""), L = [P, F].filter(Boolean).join(" ") || void 0, ee = S ? M ? "text" : "password" : i;
|
|
975
975
|
return s(() => {
|
|
976
976
|
S || N(!1);
|
|
977
977
|
}, [S]), /* @__PURE__ */ n("div", {
|
|
978
|
-
className: `${
|
|
978
|
+
className: `${q.wrapper} ${g}`,
|
|
979
979
|
children: [
|
|
980
980
|
p && /* @__PURE__ */ t(T, {
|
|
981
981
|
htmlFor: A,
|
|
@@ -985,25 +985,25 @@ var w = {
|
|
|
985
985
|
}),
|
|
986
986
|
o && f ? /* @__PURE__ */ t("div", {
|
|
987
987
|
id: A,
|
|
988
|
-
className:
|
|
989
|
-
"aria-describedby":
|
|
990
|
-
children:
|
|
988
|
+
className: q.disabledText,
|
|
989
|
+
"aria-describedby": L,
|
|
990
|
+
children: I || a
|
|
991
991
|
}) : /* @__PURE__ */ n("div", {
|
|
992
|
-
className:
|
|
992
|
+
className: q.control,
|
|
993
993
|
children: [
|
|
994
994
|
/* @__PURE__ */ t("input", {
|
|
995
995
|
ref: j,
|
|
996
996
|
id: A,
|
|
997
997
|
name: _,
|
|
998
|
-
type:
|
|
999
|
-
value:
|
|
998
|
+
type: ee,
|
|
999
|
+
value: I,
|
|
1000
1000
|
placeholder: a,
|
|
1001
1001
|
disabled: o,
|
|
1002
1002
|
readOnly: l,
|
|
1003
1003
|
required: b,
|
|
1004
1004
|
"aria-invalid": !!m,
|
|
1005
|
-
"aria-describedby":
|
|
1006
|
-
className: `${
|
|
1005
|
+
"aria-describedby": L,
|
|
1006
|
+
className: `${q.input} ${m ? q.inputError : ""}`,
|
|
1007
1007
|
onChange: (e) => {
|
|
1008
1008
|
if (i === "number" && !S) {
|
|
1009
1009
|
let t = e.target.value === "" ? "" : Number(e.target.value);
|
|
@@ -1019,7 +1019,7 @@ var w = {
|
|
|
1019
1019
|
}),
|
|
1020
1020
|
S && /* @__PURE__ */ t("button", {
|
|
1021
1021
|
type: "button",
|
|
1022
|
-
className:
|
|
1022
|
+
className: q.trailingAction,
|
|
1023
1023
|
disabled: o,
|
|
1024
1024
|
"aria-label": M ? C : w,
|
|
1025
1025
|
"aria-pressed": M,
|
|
@@ -1038,9 +1038,9 @@ var w = {
|
|
|
1038
1038
|
})]
|
|
1039
1039
|
})
|
|
1040
1040
|
}),
|
|
1041
|
-
!S && y &&
|
|
1041
|
+
!S && y && I && !o && !l && /* @__PURE__ */ t("button", {
|
|
1042
1042
|
type: "button",
|
|
1043
|
-
className:
|
|
1043
|
+
className: q.trailingAction,
|
|
1044
1044
|
"aria-label": "Очистить поле",
|
|
1045
1045
|
onClick: () => {
|
|
1046
1046
|
let e = j.current;
|
|
@@ -1061,22 +1061,22 @@ var w = {
|
|
|
1061
1061
|
})
|
|
1062
1062
|
]
|
|
1063
1063
|
});
|
|
1064
|
-
},
|
|
1064
|
+
}, J = {
|
|
1065
1065
|
wrapper: "_wrapper_vu1ob_1",
|
|
1066
1066
|
input: "_input_vu1ob_21",
|
|
1067
1067
|
switch: "_switch_vu1ob_35",
|
|
1068
1068
|
thumb: "_thumb_vu1ob_67",
|
|
1069
1069
|
label: "_label_vu1ob_111",
|
|
1070
1070
|
disabled: "_disabled_vu1ob_123"
|
|
1071
|
-
},
|
|
1071
|
+
}, Se = ({ 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,
|
|
1075
|
-
className: `${
|
|
1075
|
+
className: `${J.wrapper} ${a ? J.disabled : ""} ${s}`,
|
|
1076
1076
|
children: [
|
|
1077
1077
|
/* @__PURE__ */ t("input", {
|
|
1078
1078
|
id: p,
|
|
1079
|
-
className:
|
|
1079
|
+
className: J.input,
|
|
1080
1080
|
type: "checkbox",
|
|
1081
1081
|
role: "switch",
|
|
1082
1082
|
name: l,
|
|
@@ -1089,21 +1089,21 @@ var w = {
|
|
|
1089
1089
|
}
|
|
1090
1090
|
}),
|
|
1091
1091
|
/* @__PURE__ */ t("span", {
|
|
1092
|
-
className:
|
|
1092
|
+
className: J.switch,
|
|
1093
1093
|
"aria-hidden": "true",
|
|
1094
|
-
children: /* @__PURE__ */ t("span", { className:
|
|
1094
|
+
children: /* @__PURE__ */ t("span", { className: J.thumb })
|
|
1095
1095
|
}),
|
|
1096
1096
|
i && /* @__PURE__ */ t("span", {
|
|
1097
|
-
className:
|
|
1097
|
+
className: J.label,
|
|
1098
1098
|
children: i
|
|
1099
1099
|
})
|
|
1100
1100
|
]
|
|
1101
1101
|
});
|
|
1102
|
-
},
|
|
1102
|
+
}, Ce = {
|
|
1103
1103
|
root: "_root_kepgo_1",
|
|
1104
1104
|
grid: "_grid_kepgo_3",
|
|
1105
1105
|
actions: "_actions_kepgo_5"
|
|
1106
|
-
},
|
|
1106
|
+
}, we = ({ 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,34 +1112,33 @@ var w = {
|
|
|
1112
1112
|
i?.(n, e), s === "instant" && a?.(n);
|
|
1113
1113
|
};
|
|
1114
1114
|
return /* @__PURE__ */ n("section", {
|
|
1115
|
-
className: `${
|
|
1115
|
+
className: `${Ce.root} ${u}`,
|
|
1116
1116
|
"aria-label": "Фильтры",
|
|
1117
1117
|
"aria-busy": c,
|
|
1118
1118
|
children: [/* @__PURE__ */ t("div", {
|
|
1119
|
-
className:
|
|
1119
|
+
className: Ce.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") {
|
|
1123
1123
|
let r = {
|
|
1124
|
-
key: e.id,
|
|
1125
1124
|
label: e.label,
|
|
1126
1125
|
hint: e.hint,
|
|
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(xe, {
|
|
1131
1130
|
...r,
|
|
1132
1131
|
type: "number",
|
|
1133
1132
|
value: i ?? "",
|
|
1134
1133
|
onChange: (t) => d(e.id, t)
|
|
1135
|
-
}) : /* @__PURE__ */ t(
|
|
1134
|
+
}, e.id) : /* @__PURE__ */ t(xe, {
|
|
1136
1135
|
...r,
|
|
1137
1136
|
type: "text",
|
|
1138
1137
|
value: String(i ?? ""),
|
|
1139
1138
|
onChange: (t) => d(e.id, t)
|
|
1140
|
-
});
|
|
1139
|
+
}, e.id);
|
|
1141
1140
|
}
|
|
1142
|
-
if (e.type === "dropdown") return /* @__PURE__ */ t(
|
|
1141
|
+
if (e.type === "dropdown") return /* @__PURE__ */ t(W, {
|
|
1143
1142
|
label: e.label,
|
|
1144
1143
|
hint: e.hint,
|
|
1145
1144
|
placeholder: e.placeholder,
|
|
@@ -1148,7 +1147,7 @@ var w = {
|
|
|
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(_e, {
|
|
1152
1151
|
label: e.label,
|
|
1153
1152
|
hint: e.hint,
|
|
1154
1153
|
placeholder: e.placeholder,
|
|
@@ -1164,7 +1163,7 @@ var w = {
|
|
|
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(Se, {
|
|
1168
1167
|
label: e.label,
|
|
1169
1168
|
checked: !!i,
|
|
1170
1169
|
disabled: n,
|
|
@@ -1174,7 +1173,7 @@ var w = {
|
|
|
1174
1173
|
from: null,
|
|
1175
1174
|
to: null
|
|
1176
1175
|
};
|
|
1177
|
-
return /* @__PURE__ */ t(
|
|
1176
|
+
return /* @__PURE__ */ t(V, {
|
|
1178
1177
|
hint: e.hint,
|
|
1179
1178
|
mode: e.mode,
|
|
1180
1179
|
min: e.min,
|
|
@@ -1185,7 +1184,7 @@ var w = {
|
|
|
1185
1184
|
}, e.id);
|
|
1186
1185
|
})
|
|
1187
1186
|
}), (o || s === "manual") && /* @__PURE__ */ n("div", {
|
|
1188
|
-
className:
|
|
1187
|
+
className: Ce.actions,
|
|
1189
1188
|
children: [o && /* @__PURE__ */ t(C, {
|
|
1190
1189
|
variant: "destructiveOutline",
|
|
1191
1190
|
disabled: l || c,
|
|
@@ -1199,7 +1198,7 @@ var w = {
|
|
|
1199
1198
|
})]
|
|
1200
1199
|
})]
|
|
1201
1200
|
});
|
|
1202
|
-
},
|
|
1201
|
+
}, Y = {
|
|
1203
1202
|
wrapper: "_wrapper_1ymdr_1",
|
|
1204
1203
|
dropzone: "_dropzone_1ymdr_3",
|
|
1205
1204
|
dragActive: "_dragActive_1ymdr_5",
|
|
@@ -1213,12 +1212,12 @@ var w = {
|
|
|
1213
1212
|
file: "_file_1ymdr_19",
|
|
1214
1213
|
fileName: "_fileName_1ymdr_23",
|
|
1215
1214
|
fileSize: "_fileSize_1ymdr_25"
|
|
1216
|
-
},
|
|
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,
|
|
1218
|
-
let t = [], n = new Set(r.map(
|
|
1215
|
+
}, Te = (e) => `${e.name}:${e.size}:${e.lastModified}`, Ee = (e) => e < 1024 ? `${e} Б` : e < 1048576 ? `${(e / 1024).toFixed(1)} КБ` : `${(e / 1024 / 1024).toFixed(1)} МБ`, De = (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), Oe = ({ 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, I = [P, F].filter(Boolean).join(" ") || void 0, L = !g && !_, ee = (e) => {
|
|
1217
|
+
let t = [], n = new Set(r.map(Te)), c = e.filter((e) => De(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(Te(e)) && (n.add(Te(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);
|
|
@@ -1228,7 +1227,7 @@ var w = {
|
|
|
1228
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
|
-
className: `${
|
|
1230
|
+
className: `${Y.wrapper} ${b}`,
|
|
1232
1231
|
children: [
|
|
1233
1232
|
f && /* @__PURE__ */ t(T, {
|
|
1234
1233
|
htmlFor: k,
|
|
@@ -1237,47 +1236,47 @@ var w = {
|
|
|
1237
1236
|
children: f
|
|
1238
1237
|
}),
|
|
1239
1238
|
/* @__PURE__ */ n("div", {
|
|
1240
|
-
className: `${
|
|
1239
|
+
className: `${Y.dropzone} ${M ? Y.dragActive : ""} ${g ? Y.disabled : ""} ${m ? Y.error : ""}`,
|
|
1241
1240
|
onDragEnter: (e) => {
|
|
1242
|
-
e.preventDefault(),
|
|
1241
|
+
e.preventDefault(), L && ++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), L && ee(Array.from(e.dataTransfer.files));
|
|
1250
1249
|
},
|
|
1251
1250
|
children: [/* @__PURE__ */ t("input", {
|
|
1252
1251
|
ref: A,
|
|
1253
1252
|
id: k,
|
|
1254
1253
|
name: v,
|
|
1255
|
-
className:
|
|
1254
|
+
className: Y.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: !L,
|
|
1260
|
+
"aria-describedby": I,
|
|
1262
1261
|
"aria-invalid": !!m,
|
|
1263
|
-
onChange: (e) =>
|
|
1262
|
+
onChange: (e) => ee(Array.from(e.target.files ?? []))
|
|
1264
1263
|
}), r.length ? /* @__PURE__ */ n(e, { children: [
|
|
1265
1264
|
/* @__PURE__ */ t("ul", {
|
|
1266
|
-
className:
|
|
1265
|
+
className: Y.files,
|
|
1267
1266
|
"aria-live": "polite",
|
|
1268
1267
|
children: r.map((e, a) => /* @__PURE__ */ n("li", {
|
|
1269
|
-
className:
|
|
1268
|
+
className: Y.file,
|
|
1270
1269
|
children: [
|
|
1271
1270
|
/* @__PURE__ */ t("span", {
|
|
1272
|
-
className:
|
|
1271
|
+
className: Y.fileName,
|
|
1273
1272
|
title: e.name,
|
|
1274
1273
|
children: e.name
|
|
1275
1274
|
}),
|
|
1276
1275
|
/* @__PURE__ */ t("span", {
|
|
1277
|
-
className:
|
|
1278
|
-
children:
|
|
1276
|
+
className: Y.fileSize,
|
|
1277
|
+
children: Ee(e.size)
|
|
1279
1278
|
}),
|
|
1280
|
-
|
|
1279
|
+
L && /* @__PURE__ */ t(C, {
|
|
1281
1280
|
variant: "empty",
|
|
1282
1281
|
size: "sm",
|
|
1283
1282
|
"aria-label": `Удалить файл ${e.name}`,
|
|
@@ -1285,31 +1284,31 @@ var w = {
|
|
|
1285
1284
|
children: "×"
|
|
1286
1285
|
})
|
|
1287
1286
|
]
|
|
1288
|
-
},
|
|
1287
|
+
}, Te(e)))
|
|
1289
1288
|
}),
|
|
1290
|
-
|
|
1291
|
-
className:
|
|
1289
|
+
L && (a || r.length === 0) && /* @__PURE__ */ t(C, {
|
|
1290
|
+
className: Y.browseButton,
|
|
1292
1291
|
size: "sm",
|
|
1293
1292
|
onClick: () => A.current?.click(),
|
|
1294
1293
|
children: w
|
|
1295
1294
|
}),
|
|
1296
|
-
|
|
1297
|
-
className:
|
|
1295
|
+
L && !a && /* @__PURE__ */ t(C, {
|
|
1296
|
+
className: Y.browseButton,
|
|
1298
1297
|
size: "sm",
|
|
1299
1298
|
onClick: () => A.current?.click(),
|
|
1300
1299
|
children: S
|
|
1301
1300
|
})
|
|
1302
1301
|
] }) : /* @__PURE__ */ n("div", {
|
|
1303
|
-
className:
|
|
1302
|
+
className: Y.empty,
|
|
1304
1303
|
children: [
|
|
1305
1304
|
/* @__PURE__ */ t("span", {
|
|
1306
|
-
className:
|
|
1305
|
+
className: Y.uploadIcon,
|
|
1307
1306
|
"aria-hidden": "true",
|
|
1308
1307
|
children: "↑"
|
|
1309
1308
|
}),
|
|
1310
1309
|
/* @__PURE__ */ t("strong", { children: M ? "Отпустите файлы здесь" : x }),
|
|
1311
|
-
!M &&
|
|
1312
|
-
className:
|
|
1310
|
+
!M && L && /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", { children: "или" }), /* @__PURE__ */ t(C, {
|
|
1311
|
+
className: Y.browseButton,
|
|
1313
1312
|
onClick: () => A.current?.click(),
|
|
1314
1313
|
children: S
|
|
1315
1314
|
})] })
|
|
@@ -1328,11 +1327,11 @@ var w = {
|
|
|
1328
1327
|
})
|
|
1329
1328
|
]
|
|
1330
1329
|
});
|
|
1331
|
-
},
|
|
1330
|
+
}, ke = 0, X = _((e) => ({
|
|
1332
1331
|
modals: [],
|
|
1333
1332
|
openModal: (t, n = {}, r = {}) => {
|
|
1334
|
-
|
|
1335
|
-
let i = `ds-modal-${
|
|
1333
|
+
ke += 1;
|
|
1334
|
+
let i = `ds-modal-${ke}`;
|
|
1336
1335
|
return e((e) => ({ modals: [...e.modals, {
|
|
1337
1336
|
id: i,
|
|
1338
1337
|
name: t,
|
|
@@ -1344,7 +1343,7 @@ var w = {
|
|
|
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
|
+
})), Ae = () => X.setState({ modals: [] }), Z = {
|
|
1348
1347
|
layer: "_layer_1nb2z_1",
|
|
1349
1348
|
backdrop: "_backdrop_1nb2z_3",
|
|
1350
1349
|
panel: "_panel_1nb2z_5",
|
|
@@ -1352,14 +1351,14 @@ var w = {
|
|
|
1352
1351
|
title: "_title_1nb2z_11",
|
|
1353
1352
|
description: "_description_1nb2z_13",
|
|
1354
1353
|
content: "_content_1nb2z_15"
|
|
1355
|
-
},
|
|
1356
|
-
let f = c(), p = c(), m = u(null), h =
|
|
1354
|
+
}, je = "button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"])", Me = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "Закрыть модальное окно", className: l = "", role: d = "dialog" }) => {
|
|
1355
|
+
let f = c(), p = c(), m = u(null), h = X((e) => e.closeModal);
|
|
1357
1356
|
return s(() => {
|
|
1358
1357
|
let e = document.activeElement, t = m.current;
|
|
1359
|
-
return (t?.querySelector(
|
|
1358
|
+
return (t?.querySelector(je) ?? t)?.focus(), () => e?.focus();
|
|
1360
1359
|
}, []), /* @__PURE__ */ n("div", {
|
|
1361
1360
|
ref: m,
|
|
1362
|
-
className: `${
|
|
1361
|
+
className: `${Z.panel} ${l}`,
|
|
1363
1362
|
role: d,
|
|
1364
1363
|
"aria-modal": "true",
|
|
1365
1364
|
"aria-labelledby": r ? f : void 0,
|
|
@@ -1367,7 +1366,7 @@ var w = {
|
|
|
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(je) ?? []);
|
|
1371
1370
|
if (!t.length) {
|
|
1372
1371
|
e.preventDefault();
|
|
1373
1372
|
return;
|
|
@@ -1377,10 +1376,10 @@ var w = {
|
|
|
1377
1376
|
},
|
|
1378
1377
|
children: [
|
|
1379
1378
|
(r || o) && /* @__PURE__ */ n("header", {
|
|
1380
|
-
className:
|
|
1379
|
+
className: Z.header,
|
|
1381
1380
|
children: [r && /* @__PURE__ */ t("h2", {
|
|
1382
1381
|
id: f,
|
|
1383
|
-
className:
|
|
1382
|
+
className: Z.title,
|
|
1384
1383
|
children: r
|
|
1385
1384
|
}), /* @__PURE__ */ t(C, {
|
|
1386
1385
|
variant: "empty",
|
|
@@ -1392,31 +1391,31 @@ var w = {
|
|
|
1392
1391
|
}),
|
|
1393
1392
|
i && /* @__PURE__ */ t("p", {
|
|
1394
1393
|
id: p,
|
|
1395
|
-
className:
|
|
1394
|
+
className: Z.description,
|
|
1396
1395
|
children: i
|
|
1397
1396
|
}),
|
|
1398
1397
|
/* @__PURE__ */ t("div", {
|
|
1399
|
-
className:
|
|
1398
|
+
className: Z.content,
|
|
1400
1399
|
children: e
|
|
1401
1400
|
})
|
|
1402
1401
|
]
|
|
1403
1402
|
});
|
|
1404
|
-
},
|
|
1405
|
-
let n =
|
|
1403
|
+
}, Ne = ({ registry: e }) => {
|
|
1404
|
+
let n = X((e) => e.modals), r = X((e) => e.closeModal), i = X((e) => e.closeAllModals);
|
|
1406
1405
|
return s(() => {
|
|
1407
1406
|
let e = (e) => {
|
|
1408
1407
|
if (e.key !== "Escape") return;
|
|
1409
|
-
let t =
|
|
1408
|
+
let t = X.getState().modals.at(-1);
|
|
1410
1409
|
t?.closeOnEscape && r(t.id);
|
|
1411
1410
|
};
|
|
1412
1411
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
1413
1412
|
}, [r]), !n.length || typeof document > "u" ? null : g(/* @__PURE__ */ t("div", {
|
|
1414
|
-
className:
|
|
1413
|
+
className: Z.layer,
|
|
1415
1414
|
"aria-label": "Модальные окна",
|
|
1416
1415
|
children: n.map((a, o) => {
|
|
1417
1416
|
let s = e[a.name];
|
|
1418
1417
|
return s ? /* @__PURE__ */ t("div", {
|
|
1419
|
-
className:
|
|
1418
|
+
className: Z.backdrop,
|
|
1420
1419
|
"aria-hidden": o !== n.length - 1 || void 0,
|
|
1421
1420
|
onMouseDown: (e) => {
|
|
1422
1421
|
e.target === e.currentTarget && a.closeOnBackdrop && r(a.id);
|
|
@@ -1430,31 +1429,31 @@ var w = {
|
|
|
1430
1429
|
}, a.id) : null;
|
|
1431
1430
|
})
|
|
1432
1431
|
}), document.body);
|
|
1433
|
-
},
|
|
1434
|
-
let o =
|
|
1432
|
+
}, Pe = ({ registry: r, children: i, lockBodyScroll: a = !0 }) => {
|
|
1433
|
+
let o = X((e) => e.modals.length);
|
|
1435
1434
|
return s(() => {
|
|
1436
1435
|
if (!a || o === 0) return;
|
|
1437
1436
|
let e = document.body.style.overflow;
|
|
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(Ne, { registry: r })] });
|
|
1441
|
+
}, Fe = (e) => e, Ie = {
|
|
1443
1442
|
message: "_message_1vtru_1",
|
|
1444
1443
|
actions: "_actions_1vtru_3"
|
|
1445
|
-
},
|
|
1444
|
+
}, Le = /* @__PURE__ */ new Map(), Re = 0, ze = ({ modalId: e, close: r, title: i = "Подтверждение", message: a = "Продолжить действие?", confirmLabel: o = "Подтвердить", cancelLabel: s = "Отмена", tone: c = "default", requestId: l }) => {
|
|
1446
1445
|
let u = (e) => {
|
|
1447
|
-
|
|
1446
|
+
Le.get(l)?.(e), Le.delete(l), r();
|
|
1448
1447
|
};
|
|
1449
|
-
return /* @__PURE__ */ n(
|
|
1448
|
+
return /* @__PURE__ */ n(Me, {
|
|
1450
1449
|
modalId: e,
|
|
1451
1450
|
title: i,
|
|
1452
1451
|
role: "alertdialog",
|
|
1453
1452
|
children: [/* @__PURE__ */ t("p", {
|
|
1454
|
-
className:
|
|
1453
|
+
className: Ie.message,
|
|
1455
1454
|
children: a
|
|
1456
1455
|
}), /* @__PURE__ */ n("div", {
|
|
1457
|
-
className:
|
|
1456
|
+
className: Ie.actions,
|
|
1458
1457
|
children: [/* @__PURE__ */ t(C, {
|
|
1459
1458
|
variant: "outline",
|
|
1460
1459
|
onClick: () => u(!1),
|
|
@@ -1466,59 +1465,59 @@ var w = {
|
|
|
1466
1465
|
})]
|
|
1467
1466
|
})]
|
|
1468
1467
|
});
|
|
1469
|
-
},
|
|
1468
|
+
}, Be = ({ modalId: e, close: r, title: i = "Ошибка", message: a, closeLabel: o = "Закрыть" }) => /* @__PURE__ */ n(Me, {
|
|
1470
1469
|
modalId: e,
|
|
1471
1470
|
title: i,
|
|
1472
1471
|
role: "alertdialog",
|
|
1473
1472
|
children: [/* @__PURE__ */ t("p", {
|
|
1474
|
-
className:
|
|
1473
|
+
className: Ie.message,
|
|
1475
1474
|
children: a
|
|
1476
1475
|
}), /* @__PURE__ */ t("div", {
|
|
1477
|
-
className:
|
|
1476
|
+
className: Ie.actions,
|
|
1478
1477
|
children: /* @__PURE__ */ t(C, {
|
|
1479
1478
|
onClick: r,
|
|
1480
1479
|
children: o
|
|
1481
1480
|
})
|
|
1482
1481
|
})]
|
|
1483
|
-
}),
|
|
1484
|
-
ConfirmModal:
|
|
1485
|
-
ErrorModal:
|
|
1486
|
-
}),
|
|
1487
|
-
let e =
|
|
1482
|
+
}), Ve = Fe({
|
|
1483
|
+
ConfirmModal: ze,
|
|
1484
|
+
ErrorModal: Be
|
|
1485
|
+
}), He = () => {
|
|
1486
|
+
let e = X((e) => e.openModal);
|
|
1488
1487
|
return (t = {}) => new Promise((n) => {
|
|
1489
|
-
|
|
1490
|
-
let r = `confirm-${
|
|
1491
|
-
|
|
1488
|
+
Re += 1;
|
|
1489
|
+
let r = `confirm-${Re}`;
|
|
1490
|
+
Le.set(r, n), e("ConfirmModal", {
|
|
1492
1491
|
...t,
|
|
1493
1492
|
requestId: r
|
|
1494
1493
|
}, { closeOnEscape: !1 });
|
|
1495
1494
|
});
|
|
1496
|
-
},
|
|
1497
|
-
let e =
|
|
1495
|
+
}, Ue = (e) => e instanceof Error ? e.message : typeof e == "string" ? e : e && typeof e == "object" && "message" in e && typeof e.message == "string" ? e.message : "Произошла неизвестная ошибка", We = () => {
|
|
1496
|
+
let e = X((e) => e.openModal);
|
|
1498
1497
|
return { showError: (t, n) => e("ErrorModal", {
|
|
1499
1498
|
title: n,
|
|
1500
|
-
message:
|
|
1499
|
+
message: Ue(t)
|
|
1501
1500
|
}) };
|
|
1502
|
-
},
|
|
1503
|
-
let e =
|
|
1501
|
+
}, Ge = _(() => ({})), Ke = _(() => ({})), qe = () => {
|
|
1502
|
+
let e = X((e) => e.modals), t = X((e) => e.openModal);
|
|
1504
1503
|
return {
|
|
1505
1504
|
openModal: (e, n = {}, r) => t(e, n, r),
|
|
1506
|
-
closeModal:
|
|
1507
|
-
closeTopModal:
|
|
1508
|
-
closeAllModals:
|
|
1505
|
+
closeModal: X((e) => e.closeModal),
|
|
1506
|
+
closeTopModal: X((e) => e.closeTopModal),
|
|
1507
|
+
closeAllModals: X((e) => e.closeAllModals),
|
|
1509
1508
|
isOpen: (t) => e.some((e) => e.name === t),
|
|
1510
1509
|
count: e.length
|
|
1511
1510
|
};
|
|
1512
|
-
},
|
|
1513
|
-
className: `${
|
|
1511
|
+
}, Je = { root: "_root_1x7h7_1" }, Ye = ({ label: e = "Загрузка страницы", className: r = "" }) => /* @__PURE__ */ n("div", {
|
|
1512
|
+
className: `${Je.root} ${r}`,
|
|
1514
1513
|
role: "status",
|
|
1515
1514
|
"aria-label": e,
|
|
1516
1515
|
children: [/* @__PURE__ */ t(x, { decorative: !0 }), /* @__PURE__ */ t("span", { children: e })]
|
|
1517
|
-
}),
|
|
1516
|
+
}), Xe = {
|
|
1518
1517
|
root: "_root_elask_1",
|
|
1519
1518
|
legend: "_legend_elask_3",
|
|
1520
1519
|
range: "_range_elask_5"
|
|
1521
|
-
},
|
|
1520
|
+
}, Ze = [
|
|
1522
1521
|
{
|
|
1523
1522
|
value: "1",
|
|
1524
1523
|
label: "День"
|
|
@@ -1531,19 +1530,19 @@ var w = {
|
|
|
1531
1530
|
value: "3",
|
|
1532
1531
|
label: "Месяц"
|
|
1533
1532
|
}
|
|
1534
|
-
],
|
|
1533
|
+
], Qe = {
|
|
1535
1534
|
day: 1,
|
|
1536
1535
|
week: 2,
|
|
1537
1536
|
month: 3
|
|
1538
|
-
},
|
|
1539
|
-
className: `${
|
|
1537
|
+
}, $e = ({ value: e, onChange: r, label: i, hint: a, error: o, disabled: s = !1, min: c, max: l, className: u = "", periodTypeOptions: d = Ze }) => /* @__PURE__ */ n("fieldset", {
|
|
1538
|
+
className: `${Xe.root} ${u}`,
|
|
1540
1539
|
disabled: s,
|
|
1541
1540
|
children: [
|
|
1542
1541
|
i && /* @__PURE__ */ t("legend", {
|
|
1543
|
-
className:
|
|
1542
|
+
className: Xe.legend,
|
|
1544
1543
|
children: i
|
|
1545
1544
|
}),
|
|
1546
|
-
/* @__PURE__ */ t(
|
|
1545
|
+
/* @__PURE__ */ t(W, {
|
|
1547
1546
|
options: d,
|
|
1548
1547
|
value: String(e.periodType),
|
|
1549
1548
|
disabled: s,
|
|
@@ -1554,8 +1553,8 @@ var w = {
|
|
|
1554
1553
|
label: "Тип периода"
|
|
1555
1554
|
}),
|
|
1556
1555
|
/* @__PURE__ */ n("div", {
|
|
1557
|
-
className:
|
|
1558
|
-
children: [/* @__PURE__ */ t(
|
|
1556
|
+
className: Xe.range,
|
|
1557
|
+
children: [/* @__PURE__ */ t(R, {
|
|
1559
1558
|
value: e.startDate,
|
|
1560
1559
|
onChange: (t) => r?.({
|
|
1561
1560
|
...e,
|
|
@@ -1565,7 +1564,7 @@ var w = {
|
|
|
1565
1564
|
min: c,
|
|
1566
1565
|
max: l,
|
|
1567
1566
|
disabled: s
|
|
1568
|
-
}), /* @__PURE__ */ t(
|
|
1567
|
+
}), /* @__PURE__ */ t(R, {
|
|
1569
1568
|
value: e.endDate,
|
|
1570
1569
|
onChange: (t) => r?.({
|
|
1571
1570
|
...e,
|
|
@@ -1583,7 +1582,7 @@ var w = {
|
|
|
1583
1582
|
children: o
|
|
1584
1583
|
})
|
|
1585
1584
|
]
|
|
1586
|
-
}),
|
|
1585
|
+
}), et = {
|
|
1587
1586
|
viewport: "_viewport_15mi5_1",
|
|
1588
1587
|
"top-right": "_top-right_15mi5_3",
|
|
1589
1588
|
"top-left": "_top-left_15mi5_5",
|
|
@@ -1596,7 +1595,93 @@ var w = {
|
|
|
1596
1595
|
success: "_success_15mi5_19",
|
|
1597
1596
|
warning: "_warning_15mi5_21",
|
|
1598
1597
|
error: "_error_15mi5_23"
|
|
1599
|
-
}, tt = (
|
|
1598
|
+
}, tt = (e) => {
|
|
1599
|
+
let r;
|
|
1600
|
+
return r = e === "info" ? /* @__PURE__ */ n("svg", {
|
|
1601
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1602
|
+
width: "24",
|
|
1603
|
+
height: "24",
|
|
1604
|
+
viewBox: "0 0 24 24",
|
|
1605
|
+
fill: "none",
|
|
1606
|
+
stroke: "#179cf0",
|
|
1607
|
+
strokeWidth: "2",
|
|
1608
|
+
strokeLinecap: "round",
|
|
1609
|
+
strokeLinejoin: "round",
|
|
1610
|
+
children: [
|
|
1611
|
+
/* @__PURE__ */ t("circle", {
|
|
1612
|
+
cx: "12",
|
|
1613
|
+
cy: "12",
|
|
1614
|
+
r: "10"
|
|
1615
|
+
}),
|
|
1616
|
+
/* @__PURE__ */ t("path", { d: "M12 16v-4" }),
|
|
1617
|
+
/* @__PURE__ */ t("path", { d: "M12 8h.01" })
|
|
1618
|
+
]
|
|
1619
|
+
}) : e === "success" ? /* @__PURE__ */ n("svg", {
|
|
1620
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1621
|
+
width: "24",
|
|
1622
|
+
height: "24",
|
|
1623
|
+
viewBox: "0 0 24 24",
|
|
1624
|
+
fill: "none",
|
|
1625
|
+
stroke: "#179c66",
|
|
1626
|
+
strokeWidth: "2",
|
|
1627
|
+
strokeLinecap: "round",
|
|
1628
|
+
strokeLinejoin: "round",
|
|
1629
|
+
children: [/* @__PURE__ */ t("circle", {
|
|
1630
|
+
cx: "12",
|
|
1631
|
+
cy: "12",
|
|
1632
|
+
r: "10"
|
|
1633
|
+
}), /* @__PURE__ */ t("path", { d: "m9 12 2 2 4-4" })]
|
|
1634
|
+
}) : e === "warning" ? /* @__PURE__ */ n("svg", {
|
|
1635
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1636
|
+
width: "24",
|
|
1637
|
+
height: "24",
|
|
1638
|
+
viewBox: "0 0 24 24",
|
|
1639
|
+
fill: "none",
|
|
1640
|
+
stroke: "#f59e0b",
|
|
1641
|
+
strokeWidth: "2",
|
|
1642
|
+
strokeLinecap: "round",
|
|
1643
|
+
strokeLinejoin: "round",
|
|
1644
|
+
children: [
|
|
1645
|
+
/* @__PURE__ */ t("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }),
|
|
1646
|
+
/* @__PURE__ */ t("path", { d: "M12 9v4" }),
|
|
1647
|
+
/* @__PURE__ */ t("path", { d: "M12 17h.01" })
|
|
1648
|
+
]
|
|
1649
|
+
}) : e === "error" ? /* @__PURE__ */ n("svg", {
|
|
1650
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1651
|
+
width: "24",
|
|
1652
|
+
height: "24",
|
|
1653
|
+
viewBox: "0 0 24 24",
|
|
1654
|
+
fill: "none",
|
|
1655
|
+
stroke: "#dc2626",
|
|
1656
|
+
strokeWidth: "2",
|
|
1657
|
+
strokeLinecap: "round",
|
|
1658
|
+
strokeLinejoin: "round",
|
|
1659
|
+
children: [
|
|
1660
|
+
/* @__PURE__ */ t("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }),
|
|
1661
|
+
/* @__PURE__ */ t("path", { d: "M12 9v4" }),
|
|
1662
|
+
/* @__PURE__ */ t("path", { d: "M12 17h.01" })
|
|
1663
|
+
]
|
|
1664
|
+
}) : /* @__PURE__ */ n("svg", {
|
|
1665
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1666
|
+
width: "24",
|
|
1667
|
+
height: "24",
|
|
1668
|
+
viewBox: "0 0 24 24",
|
|
1669
|
+
fill: "none",
|
|
1670
|
+
stroke: "currentColor",
|
|
1671
|
+
strokeWidth: "2",
|
|
1672
|
+
strokeLinecap: "round",
|
|
1673
|
+
strokeLinejoin: "round",
|
|
1674
|
+
children: [
|
|
1675
|
+
/* @__PURE__ */ t("circle", {
|
|
1676
|
+
cx: "12",
|
|
1677
|
+
cy: "12",
|
|
1678
|
+
r: "10"
|
|
1679
|
+
}),
|
|
1680
|
+
/* @__PURE__ */ t("path", { d: "m15 9-6 6" }),
|
|
1681
|
+
/* @__PURE__ */ t("path", { d: "m9 9 6 6" })
|
|
1682
|
+
]
|
|
1683
|
+
}), r;
|
|
1684
|
+
}, nt = ({ toast: e, onClose: r }) => {
|
|
1600
1685
|
let [i, a] = d(!1), o = u(e.duration), c = u(Date.now());
|
|
1601
1686
|
return s(() => {
|
|
1602
1687
|
if (i || e.duration <= 0) return;
|
|
@@ -1611,7 +1696,7 @@ var w = {
|
|
|
1611
1696
|
e.duration,
|
|
1612
1697
|
e.id
|
|
1613
1698
|
]), /* @__PURE__ */ n("article", {
|
|
1614
|
-
className: `${
|
|
1699
|
+
className: `${et.toast} ${et[e.variant]}`,
|
|
1615
1700
|
role: e.variant === "error" ? "alert" : "status",
|
|
1616
1701
|
"aria-live": e.variant === "error" ? "assertive" : "polite",
|
|
1617
1702
|
onMouseEnter: () => a(!0),
|
|
@@ -1619,12 +1704,9 @@ var w = {
|
|
|
1619
1704
|
onFocus: () => a(!0),
|
|
1620
1705
|
onBlur: () => a(!1),
|
|
1621
1706
|
children: [
|
|
1622
|
-
/* @__PURE__ */ t(
|
|
1623
|
-
name: e.variant === "warning" ? "warning" : "info",
|
|
1624
|
-
className: Z.icon
|
|
1625
|
-
}),
|
|
1707
|
+
/* @__PURE__ */ t("div", { children: tt(e.variant) }),
|
|
1626
1708
|
/* @__PURE__ */ n("div", {
|
|
1627
|
-
className:
|
|
1709
|
+
className: et.body,
|
|
1628
1710
|
children: [
|
|
1629
1711
|
e.title && /* @__PURE__ */ t("strong", { children: e.title }),
|
|
1630
1712
|
/* @__PURE__ */ t("div", { children: e.message }),
|
|
@@ -1643,15 +1725,26 @@ var w = {
|
|
|
1643
1725
|
size: "sm",
|
|
1644
1726
|
"aria-label": "Закрыть уведомление",
|
|
1645
1727
|
onClick: () => r(e.id),
|
|
1646
|
-
children: "
|
|
1728
|
+
children: /* @__PURE__ */ n("svg", {
|
|
1729
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1730
|
+
width: "24",
|
|
1731
|
+
height: "24",
|
|
1732
|
+
viewBox: "0 0 24 24",
|
|
1733
|
+
fill: "none",
|
|
1734
|
+
stroke: "currentColor",
|
|
1735
|
+
strokeWidth: "2",
|
|
1736
|
+
strokeLinecap: "round",
|
|
1737
|
+
strokeLinejoin: "round",
|
|
1738
|
+
children: [/* @__PURE__ */ t("path", { d: "M18 6 6 18" }), /* @__PURE__ */ t("path", { d: "m6 6 12 12" })]
|
|
1739
|
+
})
|
|
1647
1740
|
})
|
|
1648
1741
|
]
|
|
1649
1742
|
});
|
|
1650
|
-
},
|
|
1743
|
+
}, rt = 0, Q = _((e) => ({
|
|
1651
1744
|
toasts: [],
|
|
1652
1745
|
showToast: (t) => {
|
|
1653
|
-
|
|
1654
|
-
let n = `ds-toast-${
|
|
1746
|
+
rt += 1;
|
|
1747
|
+
let n = `ds-toast-${rt}`;
|
|
1655
1748
|
return e((e) => ({ toasts: [...e.toasts, {
|
|
1656
1749
|
variant: "info",
|
|
1657
1750
|
duration: 5e3,
|
|
@@ -1662,17 +1755,17 @@ var w = {
|
|
|
1662
1755
|
},
|
|
1663
1756
|
removeToast: (t) => e((e) => ({ toasts: e.toasts.filter((e) => e.id !== t) })),
|
|
1664
1757
|
clearToasts: () => e({ toasts: [] })
|
|
1665
|
-
})),
|
|
1758
|
+
})), it = () => Q.setState({ toasts: [] }), at = ({ position: e = "top-right" }) => {
|
|
1666
1759
|
let n = Q((e) => e.toasts), r = Q((e) => e.removeToast);
|
|
1667
1760
|
return /* @__PURE__ */ t("div", {
|
|
1668
|
-
className: `${
|
|
1761
|
+
className: `${et.viewport} ${et[e]}`,
|
|
1669
1762
|
"aria-label": "Уведомления",
|
|
1670
|
-
children: n.map((e) => /* @__PURE__ */ t(
|
|
1763
|
+
children: n.map((e) => /* @__PURE__ */ t(nt, {
|
|
1671
1764
|
toast: e,
|
|
1672
1765
|
onClose: r
|
|
1673
1766
|
}, e.id))
|
|
1674
1767
|
});
|
|
1675
|
-
},
|
|
1768
|
+
}, ot = () => {
|
|
1676
1769
|
let e = Q((e) => e.showToast), t = Q((e) => e.removeToast), n = Q((e) => e.clearToasts), r = o((t) => e({
|
|
1677
1770
|
...t,
|
|
1678
1771
|
variant: "info"
|
|
@@ -1703,7 +1796,7 @@ var w = {
|
|
|
1703
1796
|
i,
|
|
1704
1797
|
a
|
|
1705
1798
|
]);
|
|
1706
|
-
},
|
|
1799
|
+
}, st = {
|
|
1707
1800
|
root: "_root_s9o0g_1",
|
|
1708
1801
|
tooltip: "_tooltip_s9o0g_3",
|
|
1709
1802
|
"ds-tooltip-in": "_ds-tooltip-in_s9o0g_1",
|
|
@@ -1711,7 +1804,7 @@ var w = {
|
|
|
1711
1804
|
bottom: "_bottom_s9o0g_7",
|
|
1712
1805
|
left: "_left_s9o0g_9",
|
|
1713
1806
|
right: "_right_s9o0g_11"
|
|
1714
|
-
},
|
|
1807
|
+
}, ct = ({ content: e, children: i, placement: o = "top", delay: l = 450, disabled: f = !1, maxWidth: p = 280, className: m = "" }) => {
|
|
1715
1808
|
let h = c(), [g, _] = d(!1), v = u(null), y = () => {
|
|
1716
1809
|
f || !e || (v.current = setTimeout(() => _(!0), l));
|
|
1717
1810
|
}, b = () => {
|
|
@@ -1733,12 +1826,12 @@ var w = {
|
|
|
1733
1826
|
onBlur: b
|
|
1734
1827
|
});
|
|
1735
1828
|
return /* @__PURE__ */ n("span", {
|
|
1736
|
-
className: `${
|
|
1829
|
+
className: `${st.root} ${m}`,
|
|
1737
1830
|
onPointerDown: g ? b : y,
|
|
1738
1831
|
children: [x, g && /* @__PURE__ */ t("span", {
|
|
1739
1832
|
id: h,
|
|
1740
1833
|
role: "tooltip",
|
|
1741
|
-
className: `${
|
|
1834
|
+
className: `${st.tooltip} ${st[o]}`,
|
|
1742
1835
|
style: { maxWidth: p },
|
|
1743
1836
|
children: e
|
|
1744
1837
|
})]
|
|
@@ -1750,7 +1843,7 @@ var w = {
|
|
|
1750
1843
|
overlay: "_overlay_1ue3g_7",
|
|
1751
1844
|
error: "_error_1ue3g_7",
|
|
1752
1845
|
caption: "_caption_1ue3g_13"
|
|
1753
|
-
},
|
|
1846
|
+
}, lt = ({ 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
1847
|
let [h, g] = d(!1), _ = c ?? (h ? "Не удалось воспроизвести видео" : void 0);
|
|
1755
1848
|
return /* @__PURE__ */ n("figure", {
|
|
1756
1849
|
className: `${$.root} ${u}`,
|
|
@@ -1787,4 +1880,4 @@ var w = {
|
|
|
1787
1880
|
});
|
|
1788
1881
|
};
|
|
1789
1882
|
//#endregion
|
|
1790
|
-
export {
|
|
1883
|
+
export { ze as ConfirmModal, y as DSBadge, C as DSButton, O as DSCheckbox, ge as DSDataTable, V as DSDateRange, R as DSDateTimePicker, W as DSDropDown, _e as DSDropDownMultiple, T as DSFieldLabel, E as DSFieldMessage, Oe as DSFileInput, we as DSFilters, ye as DSIcon, be as DSInfoBlock, xe as DSInput, x as DSLoader, Ne as DSModal, Me as DSModalFrame, Ye as DSPageLoader, Se as DSRadioButton, ne as DSSkeleton, ae as DSSort, $e as DSTimePeriodPicker, nt as DSToast, at as DSToastProvider, ct as DSTooltip, lt as DSVideoPlayerFrame, Qe as DS_PERIOD_TYPE_CODES, Be as ErrorModal, Pe as ModalSystemProvider, Ve as builtInModalRegistry, Fe as defineModalRegistry, P as formatDateTimeLocalValue, Ue as getErrorMessage, re as getNextEnabledOptionIndex, B as isValidDateRange, F as parseDateTimeLocalValue, Ae as resetModalStore, it as resetToastStore, He as useConfirmModal, Ge as useConfirmModalStore, We as useErrorModal, Ke as useErrorModalStore, qe as useModals, X as useModalsStore, ot as useToast, Q as useToastStore, se as validateDSDataTableData };
|