@efficiency-point/design-system 0.0.14 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/DSDataTable/DSDataTable.d.ts +2 -1
- package/dist/components/DSDataTable/DSDataTable.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +284 -256
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -220,34 +220,34 @@ var w = {
|
|
|
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, U] = d(P(r, "time")), W = l(() => L(B), [B]), ne = a !== "time", re = a !== "date";
|
|
225
225
|
s(() => {
|
|
226
|
-
r &&
|
|
226
|
+
r && V(r), U(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
|
|
237
|
+
let ie = (e) => {
|
|
238
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 (U(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: I(r, a) ||
|
|
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: [ne && /* @__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:
|
|
330
|
+
children: W.map((e) => {
|
|
331
331
|
let n = ee(r, e);
|
|
332
332
|
return /* @__PURE__ */ t("button", {
|
|
333
333
|
type: "button",
|
|
334
|
-
className: `${k.day} ${e.getMonth() ===
|
|
334
|
+
className: `${k.day} ${e.getMonth() === B.getMonth() ? "" : k.outside} ${n ? k.selected : ""}`,
|
|
335
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
|
+
] }), re && /* @__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
|
+
}, U = ({ 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
|
+
}), W = {
|
|
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
|
+
}, ne = (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
|
+
}, re = ({ 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 = ne(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
|
+
W.wrapper,
|
|
469
|
+
h ? W.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: W.label,
|
|
476
476
|
children: m
|
|
477
477
|
}),
|
|
478
478
|
/* @__PURE__ */ t("div", {
|
|
479
|
-
className:
|
|
479
|
+
className: W.container,
|
|
480
480
|
children: N ? /* @__PURE__ */ t("div", {
|
|
481
481
|
id: C,
|
|
482
|
-
className:
|
|
482
|
+
className: W.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: W.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 ? W.value : W.placeholder,
|
|
507
507
|
children: k?.label ?? o
|
|
508
508
|
}), /* @__PURE__ */ t("span", {
|
|
509
|
-
className: `${
|
|
509
|
+
className: `${W.chevron} ${w ? W.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: W.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: `${W.option} ${o ? W.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: W.message,
|
|
562
562
|
children: g
|
|
563
563
|
}),
|
|
564
564
|
h && /* @__PURE__ */ t("span", {
|
|
565
565
|
id: j,
|
|
566
|
-
className:
|
|
566
|
+
className: W.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(re, {
|
|
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,24 +599,25 @@ var w = {
|
|
|
599
599
|
});
|
|
600
600
|
}
|
|
601
601
|
});
|
|
602
|
-
},
|
|
603
|
-
root: "
|
|
604
|
-
tableWrap: "
|
|
605
|
-
table: "
|
|
606
|
-
sticky: "
|
|
607
|
-
sortButton: "
|
|
608
|
-
state: "
|
|
609
|
-
cards: "
|
|
610
|
-
mobileSort: "
|
|
611
|
-
card: "
|
|
612
|
-
spanTwo: "
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
602
|
+
}, G = {
|
|
603
|
+
root: "_root_epm0h_1",
|
|
604
|
+
tableWrap: "_tableWrap_epm0h_3",
|
|
605
|
+
table: "_table_epm0h_3",
|
|
606
|
+
sticky: "_sticky_epm0h_15",
|
|
607
|
+
sortButton: "_sortButton_epm0h_17",
|
|
608
|
+
state: "_state_epm0h_21",
|
|
609
|
+
cards: "_cards_epm0h_23",
|
|
610
|
+
mobileSort: "_mobileSort_epm0h_23",
|
|
611
|
+
card: "_card_epm0h_23",
|
|
612
|
+
spanTwo: "_spanTwo_epm0h_37",
|
|
613
|
+
clickableRow: "_clickableRow_epm0h_39",
|
|
614
|
+
default: "_default_epm0h_47",
|
|
615
|
+
tableOnMobile: "_tableOnMobile_epm0h_47",
|
|
616
|
+
wide: "_wide_epm0h_51"
|
|
617
|
+
}, oe = m({
|
|
617
618
|
rowSortingFeature: p,
|
|
618
619
|
sortedRowModel: f()
|
|
619
|
-
}),
|
|
620
|
+
}), se = (e, t) => {
|
|
620
621
|
let n = /* @__PURE__ */ new Set();
|
|
621
622
|
for (let t of e) {
|
|
622
623
|
if (!t.id.trim()) return "Идентификатор колонки не может быть пустым";
|
|
@@ -628,36 +629,36 @@ var w = {
|
|
|
628
629
|
for (let t of e) if (typeof t.accessor == "string" && !(t.accessor in r)) return `В строке ${n + 1} отсутствует колонка «${t.id}»`;
|
|
629
630
|
}
|
|
630
631
|
return null;
|
|
631
|
-
},
|
|
632
|
+
}, ce = (e, t) => typeof e == "function" ? e(t) : t[e], le = (e) => {
|
|
632
633
|
if (e == null || e === "") return null;
|
|
633
634
|
let t = Date.parse(String(e));
|
|
634
635
|
return Number.isNaN(t) ? null : t;
|
|
635
|
-
},
|
|
636
|
-
let r =
|
|
636
|
+
}, ue = (e, t, n) => {
|
|
637
|
+
let r = le(e.getValue(n)), i = le(t.getValue(n));
|
|
637
638
|
return r === null && i === null ? 0 : r === null ? -1 : i === null ? 1 : r - i;
|
|
638
|
-
},
|
|
639
|
+
}, de = (e, t, n) => {
|
|
639
640
|
let r = e.getValue(n), i = t.getValue(n);
|
|
640
641
|
return r == null && i == null ? 0 : r == null ? -1 : i == null ? 1 : Number(r) - Number(i);
|
|
641
|
-
},
|
|
642
|
+
}, fe = (e, t, n) => {
|
|
642
643
|
let r = e.getValue(n), i = t.getValue(n);
|
|
643
644
|
return r == null && i == null ? 0 : r == null ? -1 : i == null ? 1 : Number(!!r) - Number(!!i);
|
|
644
|
-
},
|
|
645
|
+
}, pe = (e, t, n) => {
|
|
645
646
|
let r = String(e.getValue(n) ?? ""), i = String(t.getValue(n) ?? "");
|
|
646
647
|
return r.localeCompare(i, void 0, {
|
|
647
648
|
numeric: !0,
|
|
648
649
|
sensitivity: "base"
|
|
649
650
|
});
|
|
650
|
-
},
|
|
651
|
+
}, me = (e) => {
|
|
651
652
|
switch (e) {
|
|
652
|
-
case "date": return
|
|
653
|
-
case "number": return
|
|
654
|
-
case "boolean": return
|
|
653
|
+
case "date": return ue;
|
|
654
|
+
case "number": return de;
|
|
655
|
+
case "boolean": return fe;
|
|
655
656
|
case "text":
|
|
656
|
-
case void 0: return
|
|
657
|
+
case void 0: return pe;
|
|
657
658
|
case "custom": return;
|
|
658
659
|
}
|
|
659
|
-
},
|
|
660
|
-
let t = (t) =>
|
|
660
|
+
}, he = (e) => {
|
|
661
|
+
let t = (t) => ce(e.accessor, t), n = e.sortFn ?? me(e.dataType), r = e.enableSorting ?? (e.dataType !== "custom" && n !== void 0), i = {
|
|
661
662
|
id: e.id,
|
|
662
663
|
accessorFn: t,
|
|
663
664
|
header: () => e.header,
|
|
@@ -669,63 +670,63 @@ var w = {
|
|
|
669
670
|
sortDescFirst: e.sortDescFirst
|
|
670
671
|
};
|
|
671
672
|
return n !== void 0 && (i.sortFn = n), i;
|
|
672
|
-
},
|
|
673
|
-
let [
|
|
674
|
-
features:
|
|
675
|
-
columns:
|
|
673
|
+
}, 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 = "", onRowClick: x }) => {
|
|
674
|
+
let [S, C] = d([]), w = o ?? S, T = l(() => se(e, r), [e, r]), E = l(() => e.map(he), [e]), D = h({
|
|
675
|
+
features: oe,
|
|
676
|
+
columns: E,
|
|
676
677
|
data: r,
|
|
677
|
-
state: { sorting:
|
|
678
|
+
state: { sorting: w },
|
|
678
679
|
onSortingChange: (e) => {
|
|
679
|
-
let t = typeof e == "function" ? e(
|
|
680
|
-
o === void 0 &&
|
|
680
|
+
let t = typeof e == "function" ? e(w) : e;
|
|
681
|
+
o === void 0 && C(t), s?.(t);
|
|
681
682
|
},
|
|
682
683
|
getRowId: u
|
|
683
|
-
}),
|
|
684
|
+
}), O = D.getRowModel().rows, k = e.filter((e) => e.enableSorting ?? e.dataType !== "custom").map((e) => ({
|
|
684
685
|
id: e.id,
|
|
685
686
|
label: typeof e.header == "string" ? e.header : e.id
|
|
686
|
-
})),
|
|
687
|
-
|
|
688
|
-
a === "wide" ?
|
|
689
|
-
i ?
|
|
687
|
+
})), A = [
|
|
688
|
+
G.root,
|
|
689
|
+
a === "wide" ? G.wide : G.default,
|
|
690
|
+
i ? G.tableOnMobile : "",
|
|
690
691
|
b
|
|
691
|
-
].filter(Boolean).join(" "),
|
|
692
|
+
].filter(Boolean).join(" "), j = T ?? g;
|
|
692
693
|
return /* @__PURE__ */ n("section", {
|
|
693
|
-
className:
|
|
694
|
+
className: A,
|
|
694
695
|
"aria-busy": m,
|
|
695
696
|
children: [
|
|
696
|
-
!i && !m && !
|
|
697
|
-
className:
|
|
698
|
-
options:
|
|
699
|
-
value:
|
|
700
|
-
id:
|
|
701
|
-
direction:
|
|
697
|
+
!i && !m && !j && O.length > 0 && k.length > 0 && /* @__PURE__ */ t(ae, {
|
|
698
|
+
className: G.mobileSort,
|
|
699
|
+
options: k,
|
|
700
|
+
value: w[0] ? {
|
|
701
|
+
id: w[0].id,
|
|
702
|
+
direction: w[0].desc ? "desc" : "asc"
|
|
702
703
|
} : null,
|
|
703
|
-
onChange: (e) =>
|
|
704
|
+
onChange: (e) => D.setSorting([{
|
|
704
705
|
id: e.id,
|
|
705
706
|
desc: e.direction === "desc"
|
|
706
707
|
}])
|
|
707
708
|
}),
|
|
708
709
|
/* @__PURE__ */ t("div", {
|
|
709
|
-
className:
|
|
710
|
+
className: G.tableWrap,
|
|
710
711
|
style: { maxHeight: y },
|
|
711
712
|
children: /* @__PURE__ */ n("table", {
|
|
712
|
-
className:
|
|
713
|
+
className: G.table,
|
|
713
714
|
"aria-label": p,
|
|
714
715
|
children: [
|
|
715
716
|
f && /* @__PURE__ */ t("caption", { children: f }),
|
|
716
717
|
/* @__PURE__ */ t("thead", {
|
|
717
|
-
className: v ?
|
|
718
|
-
children:
|
|
718
|
+
className: v ? G.sticky : "",
|
|
719
|
+
children: D.getHeaderGroups().map((e) => /* @__PURE__ */ t("tr", { children: e.headers.map((e) => {
|
|
719
720
|
let r = e.column.getIsSorted(), i = e.column.getCanSort(), a = e.column.getToggleSortingHandler();
|
|
720
721
|
return /* @__PURE__ */ t("th", {
|
|
721
722
|
scope: "col",
|
|
722
723
|
"aria-sort": r === "asc" ? "ascending" : r === "desc" ? "descending" : "none",
|
|
723
724
|
children: /* @__PURE__ */ n("button", {
|
|
724
725
|
type: "button",
|
|
725
|
-
className:
|
|
726
|
+
className: G.sortButton,
|
|
726
727
|
disabled: !i,
|
|
727
728
|
onClick: a,
|
|
728
|
-
children: [/* @__PURE__ */ t(
|
|
729
|
+
children: [/* @__PURE__ */ t(D.FlexRender, { header: e }), /* @__PURE__ */ t("span", {
|
|
729
730
|
"aria-hidden": "true",
|
|
730
731
|
children: r === "asc" ? "↑" : r === "desc" ? "↓" : "↕"
|
|
731
732
|
})]
|
|
@@ -735,30 +736,39 @@ var w = {
|
|
|
735
736
|
}),
|
|
736
737
|
/* @__PURE__ */ t("tbody", { children: m ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
737
738
|
colSpan: e.length,
|
|
738
|
-
children: /* @__PURE__ */ t(
|
|
739
|
-
}) }) :
|
|
740
|
-
className:
|
|
739
|
+
children: /* @__PURE__ */ t(U, { lines: 3 })
|
|
740
|
+
}) }) : j ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
741
|
+
className: G.state,
|
|
741
742
|
colSpan: e.length,
|
|
742
|
-
children:
|
|
743
|
-
}) }) :
|
|
744
|
-
className:
|
|
743
|
+
children: j
|
|
744
|
+
}) }) : O.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
745
|
+
className: G.state,
|
|
745
746
|
colSpan: e.length,
|
|
746
747
|
children: _
|
|
747
|
-
}) }) :
|
|
748
|
+
}) }) : O.map((e) => /* @__PURE__ */ t("tr", {
|
|
749
|
+
className: x ? G.clickableRow : void 0,
|
|
750
|
+
onClick: () => x?.(e.original),
|
|
751
|
+
onKeyDown: (t) => {
|
|
752
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), x?.(e.original));
|
|
753
|
+
},
|
|
754
|
+
tabIndex: x ? 0 : void 0,
|
|
755
|
+
role: x ? "button" : void 0,
|
|
756
|
+
children: e.getAllCells().map((e) => /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t(D.FlexRender, { cell: e }) }, e.id))
|
|
757
|
+
}, e.id)) })
|
|
748
758
|
]
|
|
749
759
|
})
|
|
750
760
|
}),
|
|
751
761
|
!i && /* @__PURE__ */ t("div", {
|
|
752
|
-
className:
|
|
762
|
+
className: G.cards,
|
|
753
763
|
role: "list",
|
|
754
764
|
"aria-label": p ?? f,
|
|
755
|
-
children: m ? /* @__PURE__ */ t(
|
|
756
|
-
className:
|
|
757
|
-
children:
|
|
758
|
-
}) :
|
|
759
|
-
className:
|
|
765
|
+
children: m ? /* @__PURE__ */ t(U, { lines: 4 }) : j ? /* @__PURE__ */ t("div", {
|
|
766
|
+
className: G.state,
|
|
767
|
+
children: j
|
|
768
|
+
}) : O.length === 0 ? /* @__PURE__ */ t("div", {
|
|
769
|
+
className: G.state,
|
|
760
770
|
children: _
|
|
761
|
-
}) :
|
|
771
|
+
}) : O.map((r) => {
|
|
762
772
|
if (c) return /* @__PURE__ */ t("div", {
|
|
763
773
|
role: "listitem",
|
|
764
774
|
children: c({
|
|
@@ -766,14 +776,14 @@ var w = {
|
|
|
766
776
|
columns: e
|
|
767
777
|
})
|
|
768
778
|
}, 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) =>
|
|
779
|
+
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
780
|
return /* @__PURE__ */ n("article", {
|
|
771
781
|
role: "listitem",
|
|
772
|
-
className:
|
|
782
|
+
className: G.card,
|
|
773
783
|
children: [
|
|
774
784
|
/* @__PURE__ */ t("h3", { children: a ? s(a) : `Строка ${r.index + 1}` }),
|
|
775
785
|
/* @__PURE__ */ t("dl", { children: i.filter((e) => e !== a && e.mobile?.mobileVariant !== "actions").map((e) => /* @__PURE__ */ n("div", {
|
|
776
|
-
className: e.mobile?.mobileSpan === 2 ?
|
|
786
|
+
className: e.mobile?.mobileSpan === 2 ? G.spanTwo : "",
|
|
777
787
|
children: [/* @__PURE__ */ t("dt", { children: e.mobile?.mobileLabel ?? e.header }), /* @__PURE__ */ t("dd", { children: s(e) })]
|
|
778
788
|
}, e.id)) }),
|
|
779
789
|
i.filter((e) => e.mobile?.mobileVariant === "actions").map((e) => /* @__PURE__ */ t("footer", { children: s(e) }, e.id))
|
|
@@ -783,7 +793,7 @@ var w = {
|
|
|
783
793
|
})
|
|
784
794
|
]
|
|
785
795
|
});
|
|
786
|
-
},
|
|
796
|
+
}, _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
797
|
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
798
|
s(() => {
|
|
789
799
|
let e = (e) => {
|
|
@@ -800,30 +810,30 @@ var w = {
|
|
|
800
810
|
let n = r.includes(t.value) ? r.filter((e) => e !== t.value) : [...r, t.value];
|
|
801
811
|
i?.(n, e.filter((e) => n.includes(e.value))), v && (C(!1), T.current?.focus());
|
|
802
812
|
}, M = (t, n) => {
|
|
803
|
-
let r =
|
|
813
|
+
let r = ne(e, t, n);
|
|
804
814
|
E.current[r]?.focus(), E.current[r]?.scrollIntoView({ block: "nearest" });
|
|
805
815
|
};
|
|
806
816
|
return /* @__PURE__ */ n("div", {
|
|
807
817
|
ref: w,
|
|
808
818
|
className: [
|
|
809
|
-
|
|
810
|
-
p ?
|
|
819
|
+
W.wrapper,
|
|
820
|
+
p ? W.errorState : "",
|
|
811
821
|
h
|
|
812
822
|
].filter(Boolean).join(" "),
|
|
813
823
|
children: [
|
|
814
824
|
f && /* @__PURE__ */ t("label", {
|
|
815
825
|
htmlFor: x,
|
|
816
|
-
className:
|
|
826
|
+
className: W.label,
|
|
817
827
|
children: f
|
|
818
828
|
}),
|
|
819
829
|
/* @__PURE__ */ n("div", {
|
|
820
|
-
className:
|
|
830
|
+
className: W.container,
|
|
821
831
|
children: [/* @__PURE__ */ n("button", {
|
|
822
832
|
ref: T,
|
|
823
833
|
id: x,
|
|
824
834
|
type: "button",
|
|
825
835
|
name: g,
|
|
826
|
-
className:
|
|
836
|
+
className: W.trigger,
|
|
827
837
|
disabled: o,
|
|
828
838
|
"aria-haspopup": "listbox",
|
|
829
839
|
"aria-expanded": S,
|
|
@@ -839,16 +849,16 @@ var w = {
|
|
|
839
849
|
}
|
|
840
850
|
},
|
|
841
851
|
children: [/* @__PURE__ */ t("span", {
|
|
842
|
-
className: D.length ?
|
|
852
|
+
className: D.length ? W.value : W.placeholder,
|
|
843
853
|
children: O || a
|
|
844
854
|
}), /* @__PURE__ */ t("span", {
|
|
845
|
-
className: `${
|
|
855
|
+
className: `${W.chevron} ${S ? W.chevronOpen : ""}`,
|
|
846
856
|
"aria-hidden": "true",
|
|
847
857
|
children: "⌄"
|
|
848
858
|
})]
|
|
849
859
|
}), S && /* @__PURE__ */ t("ul", {
|
|
850
860
|
id: `${x}-listbox`,
|
|
851
|
-
className:
|
|
861
|
+
className: W.menu,
|
|
852
862
|
role: "listbox",
|
|
853
863
|
"aria-label": f,
|
|
854
864
|
"aria-multiselectable": "true",
|
|
@@ -865,7 +875,7 @@ var w = {
|
|
|
865
875
|
role: "option",
|
|
866
876
|
"aria-selected": o,
|
|
867
877
|
disabled: i.disabled,
|
|
868
|
-
className: `${
|
|
878
|
+
className: `${W.option} ${o ? W.selected : ""}`,
|
|
869
879
|
onClick: () => j(i),
|
|
870
880
|
onKeyDown: (t) => {
|
|
871
881
|
if (t.key === "ArrowDown" || t.key === "ArrowUp") {
|
|
@@ -891,17 +901,17 @@ var w = {
|
|
|
891
901
|
}),
|
|
892
902
|
m && !p && /* @__PURE__ */ t("span", {
|
|
893
903
|
id: k,
|
|
894
|
-
className:
|
|
904
|
+
className: W.message,
|
|
895
905
|
children: m
|
|
896
906
|
}),
|
|
897
907
|
p && /* @__PURE__ */ t("span", {
|
|
898
908
|
id: A,
|
|
899
|
-
className:
|
|
909
|
+
className: W.error,
|
|
900
910
|
children: p
|
|
901
911
|
})
|
|
902
912
|
]
|
|
903
913
|
});
|
|
904
|
-
},
|
|
914
|
+
}, ve = {
|
|
905
915
|
approve: "M4 12l5 5L20 6",
|
|
906
916
|
reject: "M5 5l14 14M19 5L5 19",
|
|
907
917
|
edit: "M4 20h4L19 9l-4-4L4 16v4z",
|
|
@@ -910,7 +920,7 @@ var w = {
|
|
|
910
920
|
basket: "M4 7h16l-1 13H5L4 7zm3 0V4h10v3",
|
|
911
921
|
info: "M12 10v7m0-10v.01",
|
|
912
922
|
warning: "M12 4L3 20h18L12 4zm0 5v5m0 3v.01"
|
|
913
|
-
},
|
|
923
|
+
}, ye = ({ name: e, title: r, width: i = 24, height: a = 24, ...o }) => /* @__PURE__ */ n("svg", {
|
|
914
924
|
viewBox: "0 0 24 24",
|
|
915
925
|
width: i,
|
|
916
926
|
height: a,
|
|
@@ -923,27 +933,27 @@ var w = {
|
|
|
923
933
|
"aria-hidden": !r || void 0,
|
|
924
934
|
focusable: "false",
|
|
925
935
|
...o,
|
|
926
|
-
children: [r && /* @__PURE__ */ t("title", { children: r }), /* @__PURE__ */ t("path", { d:
|
|
927
|
-
}),
|
|
936
|
+
children: [r && /* @__PURE__ */ t("title", { children: r }), /* @__PURE__ */ t("path", { d: ve[e] })]
|
|
937
|
+
}), K = {
|
|
928
938
|
root: "_root_1y2s8_1",
|
|
929
939
|
header: "_header_1y2s8_21",
|
|
930
940
|
title: "_title_1y2s8_41",
|
|
931
941
|
dismiss: "_dismiss_1y2s8_55",
|
|
932
942
|
content: "_content_1y2s8_113"
|
|
933
|
-
},
|
|
943
|
+
}, be = ({ title: e, children: r, dismissible: i = !1, onDismiss: a, dismissLabel: o = "Закрыть информационный блок", headingAs: s = "h3", className: l = "" }) => {
|
|
934
944
|
let u = `ds-info-block-${c()}`;
|
|
935
945
|
return /* @__PURE__ */ n("section", {
|
|
936
|
-
className: `${
|
|
946
|
+
className: `${K.root} ${l}`,
|
|
937
947
|
"aria-labelledby": u,
|
|
938
948
|
children: [/* @__PURE__ */ n("header", {
|
|
939
|
-
className:
|
|
949
|
+
className: K.header,
|
|
940
950
|
children: [/* @__PURE__ */ t(s, {
|
|
941
951
|
id: u,
|
|
942
|
-
className:
|
|
952
|
+
className: K.title,
|
|
943
953
|
children: e
|
|
944
954
|
}), i && /* @__PURE__ */ t("button", {
|
|
945
955
|
type: "button",
|
|
946
|
-
className:
|
|
956
|
+
className: K.dismiss,
|
|
947
957
|
onClick: a,
|
|
948
958
|
"aria-label": o,
|
|
949
959
|
children: /* @__PURE__ */ t("svg", {
|
|
@@ -959,23 +969,23 @@ var w = {
|
|
|
959
969
|
})
|
|
960
970
|
})]
|
|
961
971
|
}), /* @__PURE__ */ t("div", {
|
|
962
|
-
className:
|
|
972
|
+
className: K.content,
|
|
963
973
|
children: r
|
|
964
974
|
})]
|
|
965
975
|
});
|
|
966
|
-
},
|
|
976
|
+
}, q = {
|
|
967
977
|
wrapper: "_wrapper_ip6vf_1",
|
|
968
978
|
control: "_control_ip6vf_3",
|
|
969
979
|
input: "_input_ip6vf_5",
|
|
970
980
|
disabledText: "_disabledText_ip6vf_5",
|
|
971
981
|
inputError: "_inputError_ip6vf_39",
|
|
972
982
|
trailingAction: "_trailingAction_ip6vf_41"
|
|
973
|
-
},
|
|
983
|
+
}, 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
984
|
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
985
|
return s(() => {
|
|
976
986
|
S || N(!1);
|
|
977
987
|
}, [S]), /* @__PURE__ */ n("div", {
|
|
978
|
-
className: `${
|
|
988
|
+
className: `${q.wrapper} ${g}`,
|
|
979
989
|
children: [
|
|
980
990
|
p && /* @__PURE__ */ t(T, {
|
|
981
991
|
htmlFor: A,
|
|
@@ -985,11 +995,11 @@ var w = {
|
|
|
985
995
|
}),
|
|
986
996
|
o && f ? /* @__PURE__ */ t("div", {
|
|
987
997
|
id: A,
|
|
988
|
-
className:
|
|
998
|
+
className: q.disabledText,
|
|
989
999
|
"aria-describedby": L,
|
|
990
1000
|
children: I || a
|
|
991
1001
|
}) : /* @__PURE__ */ n("div", {
|
|
992
|
-
className:
|
|
1002
|
+
className: q.control,
|
|
993
1003
|
children: [
|
|
994
1004
|
/* @__PURE__ */ t("input", {
|
|
995
1005
|
ref: j,
|
|
@@ -1003,7 +1013,7 @@ var w = {
|
|
|
1003
1013
|
required: b,
|
|
1004
1014
|
"aria-invalid": !!m,
|
|
1005
1015
|
"aria-describedby": L,
|
|
1006
|
-
className: `${
|
|
1016
|
+
className: `${q.input} ${m ? q.inputError : ""}`,
|
|
1007
1017
|
onChange: (e) => {
|
|
1008
1018
|
if (i === "number" && !S) {
|
|
1009
1019
|
let t = e.target.value === "" ? "" : Number(e.target.value);
|
|
@@ -1019,7 +1029,7 @@ var w = {
|
|
|
1019
1029
|
}),
|
|
1020
1030
|
S && /* @__PURE__ */ t("button", {
|
|
1021
1031
|
type: "button",
|
|
1022
|
-
className:
|
|
1032
|
+
className: q.trailingAction,
|
|
1023
1033
|
disabled: o,
|
|
1024
1034
|
"aria-label": M ? C : w,
|
|
1025
1035
|
"aria-pressed": M,
|
|
@@ -1040,7 +1050,7 @@ var w = {
|
|
|
1040
1050
|
}),
|
|
1041
1051
|
!S && y && I && !o && !l && /* @__PURE__ */ t("button", {
|
|
1042
1052
|
type: "button",
|
|
1043
|
-
className:
|
|
1053
|
+
className: q.trailingAction,
|
|
1044
1054
|
"aria-label": "Очистить поле",
|
|
1045
1055
|
onClick: () => {
|
|
1046
1056
|
let e = j.current;
|
|
@@ -1061,22 +1071,22 @@ var w = {
|
|
|
1061
1071
|
})
|
|
1062
1072
|
]
|
|
1063
1073
|
});
|
|
1064
|
-
},
|
|
1074
|
+
}, J = {
|
|
1065
1075
|
wrapper: "_wrapper_vu1ob_1",
|
|
1066
1076
|
input: "_input_vu1ob_21",
|
|
1067
1077
|
switch: "_switch_vu1ob_35",
|
|
1068
1078
|
thumb: "_thumb_vu1ob_67",
|
|
1069
1079
|
label: "_label_vu1ob_111",
|
|
1070
1080
|
disabled: "_disabled_vu1ob_123"
|
|
1071
|
-
},
|
|
1081
|
+
}, Se = ({ checked: e, onChange: r, label: i, disabled: a = !1, readOnly: o = !1, className: s = "", name: l, id: u, value: d }) => {
|
|
1072
1082
|
let f = c(), p = u ?? `ds-radio-button-${l ?? f}`;
|
|
1073
1083
|
return /* @__PURE__ */ n("label", {
|
|
1074
1084
|
htmlFor: p,
|
|
1075
|
-
className: `${
|
|
1085
|
+
className: `${J.wrapper} ${a ? J.disabled : ""} ${s}`,
|
|
1076
1086
|
children: [
|
|
1077
1087
|
/* @__PURE__ */ t("input", {
|
|
1078
1088
|
id: p,
|
|
1079
|
-
className:
|
|
1089
|
+
className: J.input,
|
|
1080
1090
|
type: "checkbox",
|
|
1081
1091
|
role: "switch",
|
|
1082
1092
|
name: l,
|
|
@@ -1089,21 +1099,21 @@ var w = {
|
|
|
1089
1099
|
}
|
|
1090
1100
|
}),
|
|
1091
1101
|
/* @__PURE__ */ t("span", {
|
|
1092
|
-
className:
|
|
1102
|
+
className: J.switch,
|
|
1093
1103
|
"aria-hidden": "true",
|
|
1094
|
-
children: /* @__PURE__ */ t("span", { className:
|
|
1104
|
+
children: /* @__PURE__ */ t("span", { className: J.thumb })
|
|
1095
1105
|
}),
|
|
1096
1106
|
i && /* @__PURE__ */ t("span", {
|
|
1097
|
-
className:
|
|
1107
|
+
className: J.label,
|
|
1098
1108
|
children: i
|
|
1099
1109
|
})
|
|
1100
1110
|
]
|
|
1101
1111
|
});
|
|
1102
|
-
},
|
|
1112
|
+
}, Ce = {
|
|
1103
1113
|
root: "_root_kepgo_1",
|
|
1104
1114
|
grid: "_grid_kepgo_3",
|
|
1105
1115
|
actions: "_actions_kepgo_5"
|
|
1106
|
-
},
|
|
1116
|
+
}, we = ({ filters: e, values: r, onChange: i, onApply: a, onReset: o, applyMode: s = "instant", loading: c = !1, disabled: l = !1, className: u = "" }) => {
|
|
1107
1117
|
let d = (e, t) => {
|
|
1108
1118
|
let n = {
|
|
1109
1119
|
...r,
|
|
@@ -1112,11 +1122,11 @@ var w = {
|
|
|
1112
1122
|
i?.(n, e), s === "instant" && a?.(n);
|
|
1113
1123
|
};
|
|
1114
1124
|
return /* @__PURE__ */ n("section", {
|
|
1115
|
-
className: `${
|
|
1125
|
+
className: `${Ce.root} ${u}`,
|
|
1116
1126
|
"aria-label": "Фильтры",
|
|
1117
1127
|
"aria-busy": c,
|
|
1118
1128
|
children: [/* @__PURE__ */ t("div", {
|
|
1119
|
-
className:
|
|
1129
|
+
className: Ce.grid,
|
|
1120
1130
|
children: e.filter((e) => !e.hidden).map((e) => {
|
|
1121
1131
|
let n = l || c || e.disabled, i = r[e.id];
|
|
1122
1132
|
if (e.type === "input") {
|
|
@@ -1126,19 +1136,19 @@ var w = {
|
|
|
1126
1136
|
placeholder: e.placeholder,
|
|
1127
1137
|
disabled: n
|
|
1128
1138
|
};
|
|
1129
|
-
return e.inputType === "number" ? /* @__PURE__ */ t(
|
|
1139
|
+
return e.inputType === "number" ? /* @__PURE__ */ t(xe, {
|
|
1130
1140
|
...r,
|
|
1131
1141
|
type: "number",
|
|
1132
1142
|
value: i ?? "",
|
|
1133
1143
|
onChange: (t) => d(e.id, t)
|
|
1134
|
-
}, e.id) : /* @__PURE__ */ t(
|
|
1144
|
+
}, e.id) : /* @__PURE__ */ t(xe, {
|
|
1135
1145
|
...r,
|
|
1136
1146
|
type: "text",
|
|
1137
1147
|
value: String(i ?? ""),
|
|
1138
1148
|
onChange: (t) => d(e.id, t)
|
|
1139
1149
|
}, e.id);
|
|
1140
1150
|
}
|
|
1141
|
-
if (e.type === "dropdown") return /* @__PURE__ */ t(
|
|
1151
|
+
if (e.type === "dropdown") return /* @__PURE__ */ t(re, {
|
|
1142
1152
|
label: e.label,
|
|
1143
1153
|
hint: e.hint,
|
|
1144
1154
|
placeholder: e.placeholder,
|
|
@@ -1147,7 +1157,7 @@ var w = {
|
|
|
1147
1157
|
disabled: n,
|
|
1148
1158
|
onChange: (t) => d(e.id, t)
|
|
1149
1159
|
}, e.id);
|
|
1150
|
-
if (e.type === "multiple") return /* @__PURE__ */ t(
|
|
1160
|
+
if (e.type === "multiple") return /* @__PURE__ */ t(_e, {
|
|
1151
1161
|
label: e.label,
|
|
1152
1162
|
hint: e.hint,
|
|
1153
1163
|
placeholder: e.placeholder,
|
|
@@ -1163,7 +1173,7 @@ var w = {
|
|
|
1163
1173
|
disabled: n,
|
|
1164
1174
|
onChange: (t) => d(e.id, t)
|
|
1165
1175
|
}, e.id);
|
|
1166
|
-
if (e.type === "radio") return /* @__PURE__ */ t(
|
|
1176
|
+
if (e.type === "radio") return /* @__PURE__ */ t(Se, {
|
|
1167
1177
|
label: e.label,
|
|
1168
1178
|
checked: !!i,
|
|
1169
1179
|
disabled: n,
|
|
@@ -1173,7 +1183,7 @@ var w = {
|
|
|
1173
1183
|
from: null,
|
|
1174
1184
|
to: null
|
|
1175
1185
|
};
|
|
1176
|
-
return /* @__PURE__ */ t(
|
|
1186
|
+
return /* @__PURE__ */ t(V, {
|
|
1177
1187
|
hint: e.hint,
|
|
1178
1188
|
mode: e.mode,
|
|
1179
1189
|
min: e.min,
|
|
@@ -1184,7 +1194,7 @@ var w = {
|
|
|
1184
1194
|
}, e.id);
|
|
1185
1195
|
})
|
|
1186
1196
|
}), (o || s === "manual") && /* @__PURE__ */ n("div", {
|
|
1187
|
-
className:
|
|
1197
|
+
className: Ce.actions,
|
|
1188
1198
|
children: [o && /* @__PURE__ */ t(C, {
|
|
1189
1199
|
variant: "destructiveOutline",
|
|
1190
1200
|
disabled: l || c,
|
|
@@ -1198,7 +1208,7 @@ var w = {
|
|
|
1198
1208
|
})]
|
|
1199
1209
|
})]
|
|
1200
1210
|
});
|
|
1201
|
-
},
|
|
1211
|
+
}, Y = {
|
|
1202
1212
|
wrapper: "_wrapper_1ymdr_1",
|
|
1203
1213
|
dropzone: "_dropzone_1ymdr_3",
|
|
1204
1214
|
dragActive: "_dragActive_1ymdr_5",
|
|
@@ -1212,12 +1222,12 @@ var w = {
|
|
|
1212
1222
|
file: "_file_1ymdr_19",
|
|
1213
1223
|
fileName: "_fileName_1ymdr_23",
|
|
1214
1224
|
fileSize: "_fileSize_1ymdr_25"
|
|
1215
|
-
},
|
|
1225
|
+
}, 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
1226
|
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(
|
|
1227
|
+
let t = [], n = new Set(r.map(Te)), c = e.filter((e) => De(e, o) ? s !== void 0 && e.size > s ? (t.push({
|
|
1218
1228
|
file: e,
|
|
1219
1229
|
reason: "maxSize"
|
|
1220
|
-
}), !1) : !n.has(
|
|
1230
|
+
}), !1) : !n.has(Te(e)) && (n.add(Te(e)), !0) : (t.push({
|
|
1221
1231
|
file: e,
|
|
1222
1232
|
reason: "accept"
|
|
1223
1233
|
}), !1)), u = a ? l : 1, d = a ? [...r, ...c] : c.slice(-1);
|
|
@@ -1227,7 +1237,7 @@ var w = {
|
|
|
1227
1237
|
})), d = d.slice(0, u)), t.length && D?.(t), c.length && i?.(d), A.current && (A.current.value = "");
|
|
1228
1238
|
};
|
|
1229
1239
|
return /* @__PURE__ */ n("div", {
|
|
1230
|
-
className: `${
|
|
1240
|
+
className: `${Y.wrapper} ${b}`,
|
|
1231
1241
|
children: [
|
|
1232
1242
|
f && /* @__PURE__ */ t(T, {
|
|
1233
1243
|
htmlFor: k,
|
|
@@ -1236,7 +1246,7 @@ var w = {
|
|
|
1236
1246
|
children: f
|
|
1237
1247
|
}),
|
|
1238
1248
|
/* @__PURE__ */ n("div", {
|
|
1239
|
-
className: `${
|
|
1249
|
+
className: `${Y.dropzone} ${M ? Y.dragActive : ""} ${g ? Y.disabled : ""} ${m ? Y.error : ""}`,
|
|
1240
1250
|
onDragEnter: (e) => {
|
|
1241
1251
|
e.preventDefault(), L && ++j.current === 1 && N(!0);
|
|
1242
1252
|
},
|
|
@@ -1251,7 +1261,7 @@ var w = {
|
|
|
1251
1261
|
ref: A,
|
|
1252
1262
|
id: k,
|
|
1253
1263
|
name: v,
|
|
1254
|
-
className:
|
|
1264
|
+
className: Y.nativeInput,
|
|
1255
1265
|
type: "file",
|
|
1256
1266
|
multiple: a,
|
|
1257
1267
|
accept: o,
|
|
@@ -1262,19 +1272,19 @@ var w = {
|
|
|
1262
1272
|
onChange: (e) => ee(Array.from(e.target.files ?? []))
|
|
1263
1273
|
}), r.length ? /* @__PURE__ */ n(e, { children: [
|
|
1264
1274
|
/* @__PURE__ */ t("ul", {
|
|
1265
|
-
className:
|
|
1275
|
+
className: Y.files,
|
|
1266
1276
|
"aria-live": "polite",
|
|
1267
1277
|
children: r.map((e, a) => /* @__PURE__ */ n("li", {
|
|
1268
|
-
className:
|
|
1278
|
+
className: Y.file,
|
|
1269
1279
|
children: [
|
|
1270
1280
|
/* @__PURE__ */ t("span", {
|
|
1271
|
-
className:
|
|
1281
|
+
className: Y.fileName,
|
|
1272
1282
|
title: e.name,
|
|
1273
1283
|
children: e.name
|
|
1274
1284
|
}),
|
|
1275
1285
|
/* @__PURE__ */ t("span", {
|
|
1276
|
-
className:
|
|
1277
|
-
children:
|
|
1286
|
+
className: Y.fileSize,
|
|
1287
|
+
children: Ee(e.size)
|
|
1278
1288
|
}),
|
|
1279
1289
|
L && /* @__PURE__ */ t(C, {
|
|
1280
1290
|
variant: "empty",
|
|
@@ -1284,31 +1294,31 @@ var w = {
|
|
|
1284
1294
|
children: "×"
|
|
1285
1295
|
})
|
|
1286
1296
|
]
|
|
1287
|
-
},
|
|
1297
|
+
}, Te(e)))
|
|
1288
1298
|
}),
|
|
1289
1299
|
L && (a || r.length === 0) && /* @__PURE__ */ t(C, {
|
|
1290
|
-
className:
|
|
1300
|
+
className: Y.browseButton,
|
|
1291
1301
|
size: "sm",
|
|
1292
1302
|
onClick: () => A.current?.click(),
|
|
1293
1303
|
children: w
|
|
1294
1304
|
}),
|
|
1295
1305
|
L && !a && /* @__PURE__ */ t(C, {
|
|
1296
|
-
className:
|
|
1306
|
+
className: Y.browseButton,
|
|
1297
1307
|
size: "sm",
|
|
1298
1308
|
onClick: () => A.current?.click(),
|
|
1299
1309
|
children: S
|
|
1300
1310
|
})
|
|
1301
1311
|
] }) : /* @__PURE__ */ n("div", {
|
|
1302
|
-
className:
|
|
1312
|
+
className: Y.empty,
|
|
1303
1313
|
children: [
|
|
1304
1314
|
/* @__PURE__ */ t("span", {
|
|
1305
|
-
className:
|
|
1315
|
+
className: Y.uploadIcon,
|
|
1306
1316
|
"aria-hidden": "true",
|
|
1307
1317
|
children: "↑"
|
|
1308
1318
|
}),
|
|
1309
1319
|
/* @__PURE__ */ t("strong", { children: M ? "Отпустите файлы здесь" : x }),
|
|
1310
1320
|
!M && L && /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", { children: "или" }), /* @__PURE__ */ t(C, {
|
|
1311
|
-
className:
|
|
1321
|
+
className: Y.browseButton,
|
|
1312
1322
|
onClick: () => A.current?.click(),
|
|
1313
1323
|
children: S
|
|
1314
1324
|
})] })
|
|
@@ -1327,11 +1337,11 @@ var w = {
|
|
|
1327
1337
|
})
|
|
1328
1338
|
]
|
|
1329
1339
|
});
|
|
1330
|
-
},
|
|
1340
|
+
}, ke = 0, X = _((e) => ({
|
|
1331
1341
|
modals: [],
|
|
1332
1342
|
openModal: (t, n = {}, r = {}) => {
|
|
1333
|
-
|
|
1334
|
-
let i = `ds-modal-${
|
|
1343
|
+
ke += 1;
|
|
1344
|
+
let i = `ds-modal-${ke}`;
|
|
1335
1345
|
return e((e) => ({ modals: [...e.modals, {
|
|
1336
1346
|
id: i,
|
|
1337
1347
|
name: t,
|
|
@@ -1343,7 +1353,7 @@ var w = {
|
|
|
1343
1353
|
closeModal: (t) => e((e) => ({ modals: e.modals.filter((e) => e.id !== t) })),
|
|
1344
1354
|
closeTopModal: () => e((e) => ({ modals: e.modals.slice(0, -1) })),
|
|
1345
1355
|
closeAllModals: () => e({ modals: [] })
|
|
1346
|
-
})),
|
|
1356
|
+
})), Ae = () => X.setState({ modals: [] }), Z = {
|
|
1347
1357
|
layer: "_layer_1nb2z_1",
|
|
1348
1358
|
backdrop: "_backdrop_1nb2z_3",
|
|
1349
1359
|
panel: "_panel_1nb2z_5",
|
|
@@ -1351,14 +1361,14 @@ var w = {
|
|
|
1351
1361
|
title: "_title_1nb2z_11",
|
|
1352
1362
|
description: "_description_1nb2z_13",
|
|
1353
1363
|
content: "_content_1nb2z_15"
|
|
1354
|
-
},
|
|
1355
|
-
let f = c(), p = c(), m = u(null), h =
|
|
1364
|
+
}, 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" }) => {
|
|
1365
|
+
let f = c(), p = c(), m = u(null), h = X((e) => e.closeModal);
|
|
1356
1366
|
return s(() => {
|
|
1357
1367
|
let e = document.activeElement, t = m.current;
|
|
1358
|
-
return (t?.querySelector(
|
|
1368
|
+
return (t?.querySelector(je) ?? t)?.focus(), () => e?.focus();
|
|
1359
1369
|
}, []), /* @__PURE__ */ n("div", {
|
|
1360
1370
|
ref: m,
|
|
1361
|
-
className: `${
|
|
1371
|
+
className: `${Z.panel} ${l}`,
|
|
1362
1372
|
role: d,
|
|
1363
1373
|
"aria-modal": "true",
|
|
1364
1374
|
"aria-labelledby": r ? f : void 0,
|
|
@@ -1366,7 +1376,7 @@ var w = {
|
|
|
1366
1376
|
tabIndex: -1,
|
|
1367
1377
|
onKeyDown: (e) => {
|
|
1368
1378
|
if (e.key !== "Tab") return;
|
|
1369
|
-
let t = Array.from(m.current?.querySelectorAll(
|
|
1379
|
+
let t = Array.from(m.current?.querySelectorAll(je) ?? []);
|
|
1370
1380
|
if (!t.length) {
|
|
1371
1381
|
e.preventDefault();
|
|
1372
1382
|
return;
|
|
@@ -1376,10 +1386,10 @@ var w = {
|
|
|
1376
1386
|
},
|
|
1377
1387
|
children: [
|
|
1378
1388
|
(r || o) && /* @__PURE__ */ n("header", {
|
|
1379
|
-
className:
|
|
1389
|
+
className: Z.header,
|
|
1380
1390
|
children: [r && /* @__PURE__ */ t("h2", {
|
|
1381
1391
|
id: f,
|
|
1382
|
-
className:
|
|
1392
|
+
className: Z.title,
|
|
1383
1393
|
children: r
|
|
1384
1394
|
}), /* @__PURE__ */ t(C, {
|
|
1385
1395
|
variant: "empty",
|
|
@@ -1402,31 +1412,31 @@ var w = {
|
|
|
1402
1412
|
}),
|
|
1403
1413
|
i && /* @__PURE__ */ t("p", {
|
|
1404
1414
|
id: p,
|
|
1405
|
-
className:
|
|
1415
|
+
className: Z.description,
|
|
1406
1416
|
children: i
|
|
1407
1417
|
}),
|
|
1408
1418
|
/* @__PURE__ */ t("div", {
|
|
1409
|
-
className:
|
|
1419
|
+
className: Z.content,
|
|
1410
1420
|
children: e
|
|
1411
1421
|
})
|
|
1412
1422
|
]
|
|
1413
1423
|
});
|
|
1414
|
-
},
|
|
1415
|
-
let n =
|
|
1424
|
+
}, Ne = ({ registry: e }) => {
|
|
1425
|
+
let n = X((e) => e.modals), r = X((e) => e.closeModal), i = X((e) => e.closeAllModals);
|
|
1416
1426
|
return s(() => {
|
|
1417
1427
|
let e = (e) => {
|
|
1418
1428
|
if (e.key !== "Escape") return;
|
|
1419
|
-
let t =
|
|
1429
|
+
let t = X.getState().modals.at(-1);
|
|
1420
1430
|
t?.closeOnEscape && r(t.id);
|
|
1421
1431
|
};
|
|
1422
1432
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
1423
1433
|
}, [r]), !n.length || typeof document > "u" ? null : g(/* @__PURE__ */ t("div", {
|
|
1424
|
-
className:
|
|
1434
|
+
className: Z.layer,
|
|
1425
1435
|
"aria-label": "Модальные окна",
|
|
1426
1436
|
children: n.map((a, o) => {
|
|
1427
1437
|
let s = e[a.name];
|
|
1428
1438
|
return s ? /* @__PURE__ */ t("div", {
|
|
1429
|
-
className:
|
|
1439
|
+
className: Z.backdrop,
|
|
1430
1440
|
"aria-hidden": o !== n.length - 1 || void 0,
|
|
1431
1441
|
onMouseDown: (e) => {
|
|
1432
1442
|
e.target === e.currentTarget && a.closeOnBackdrop && r(a.id);
|
|
@@ -1440,31 +1450,31 @@ var w = {
|
|
|
1440
1450
|
}, a.id) : null;
|
|
1441
1451
|
})
|
|
1442
1452
|
}), document.body);
|
|
1443
|
-
},
|
|
1444
|
-
let o =
|
|
1453
|
+
}, Pe = ({ registry: r, children: i, lockBodyScroll: a = !0 }) => {
|
|
1454
|
+
let o = X((e) => e.modals.length);
|
|
1445
1455
|
return s(() => {
|
|
1446
1456
|
if (!a || o === 0) return;
|
|
1447
1457
|
let e = document.body.style.overflow;
|
|
1448
1458
|
return document.body.style.overflow = "hidden", () => {
|
|
1449
1459
|
document.body.style.overflow = e;
|
|
1450
1460
|
};
|
|
1451
|
-
}, [a, o]), /* @__PURE__ */ n(e, { children: [i, /* @__PURE__ */ t(
|
|
1452
|
-
},
|
|
1461
|
+
}, [a, o]), /* @__PURE__ */ n(e, { children: [i, /* @__PURE__ */ t(Ne, { registry: r })] });
|
|
1462
|
+
}, Fe = (e) => e, Ie = {
|
|
1453
1463
|
message: "_message_1vtru_1",
|
|
1454
1464
|
actions: "_actions_1vtru_3"
|
|
1455
|
-
},
|
|
1465
|
+
}, Le = /* @__PURE__ */ new Map(), Re = 0, ze = ({ modalId: e, close: r, title: i = "Подтверждение", message: a = "Продолжить действие?", confirmLabel: o = "Подтвердить", cancelLabel: s = "Отмена", tone: c = "default", requestId: l }) => {
|
|
1456
1466
|
let u = (e) => {
|
|
1457
|
-
|
|
1467
|
+
Le.get(l)?.(e), Le.delete(l), r();
|
|
1458
1468
|
};
|
|
1459
|
-
return /* @__PURE__ */ n(
|
|
1469
|
+
return /* @__PURE__ */ n(Me, {
|
|
1460
1470
|
modalId: e,
|
|
1461
1471
|
title: i,
|
|
1462
1472
|
role: "alertdialog",
|
|
1463
1473
|
children: [/* @__PURE__ */ t("p", {
|
|
1464
|
-
className:
|
|
1474
|
+
className: Ie.message,
|
|
1465
1475
|
children: a
|
|
1466
1476
|
}), /* @__PURE__ */ n("div", {
|
|
1467
|
-
className:
|
|
1477
|
+
className: Ie.actions,
|
|
1468
1478
|
children: [/* @__PURE__ */ t(C, {
|
|
1469
1479
|
variant: "outline",
|
|
1470
1480
|
onClick: () => u(!1),
|
|
@@ -1476,55 +1486,55 @@ var w = {
|
|
|
1476
1486
|
})]
|
|
1477
1487
|
})]
|
|
1478
1488
|
});
|
|
1479
|
-
},
|
|
1489
|
+
}, Be = ({ modalId: e, close: r, title: i = "Ошибка", message: a, closeLabel: o = "Закрыть" }) => /* @__PURE__ */ n(Me, {
|
|
1480
1490
|
modalId: e,
|
|
1481
1491
|
title: i,
|
|
1482
1492
|
role: "alertdialog",
|
|
1483
1493
|
children: [/* @__PURE__ */ t("p", {
|
|
1484
|
-
className:
|
|
1494
|
+
className: Ie.message,
|
|
1485
1495
|
children: a
|
|
1486
1496
|
}), /* @__PURE__ */ t("div", {
|
|
1487
|
-
className:
|
|
1497
|
+
className: Ie.actions,
|
|
1488
1498
|
children: /* @__PURE__ */ t(C, {
|
|
1489
1499
|
onClick: r,
|
|
1490
1500
|
children: o
|
|
1491
1501
|
})
|
|
1492
1502
|
})]
|
|
1493
|
-
}),
|
|
1494
|
-
ConfirmModal:
|
|
1495
|
-
ErrorModal:
|
|
1496
|
-
}),
|
|
1497
|
-
let e =
|
|
1503
|
+
}), Ve = Fe({
|
|
1504
|
+
ConfirmModal: ze,
|
|
1505
|
+
ErrorModal: Be
|
|
1506
|
+
}), He = () => {
|
|
1507
|
+
let e = X((e) => e.openModal);
|
|
1498
1508
|
return (t = {}) => new Promise((n) => {
|
|
1499
|
-
|
|
1500
|
-
let r = `confirm-${
|
|
1501
|
-
|
|
1509
|
+
Re += 1;
|
|
1510
|
+
let r = `confirm-${Re}`;
|
|
1511
|
+
Le.set(r, n), e("ConfirmModal", {
|
|
1502
1512
|
...t,
|
|
1503
1513
|
requestId: r
|
|
1504
1514
|
}, { closeOnEscape: !1 });
|
|
1505
1515
|
});
|
|
1506
|
-
},
|
|
1507
|
-
let e =
|
|
1516
|
+
}, 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 = () => {
|
|
1517
|
+
let e = X((e) => e.openModal);
|
|
1508
1518
|
return { showError: (t, n) => e("ErrorModal", {
|
|
1509
1519
|
title: n,
|
|
1510
|
-
message:
|
|
1520
|
+
message: Ue(t)
|
|
1511
1521
|
}) };
|
|
1512
|
-
},
|
|
1513
|
-
let e =
|
|
1522
|
+
}, Ge = _(() => ({})), Ke = _(() => ({})), qe = () => {
|
|
1523
|
+
let e = X((e) => e.modals), t = X((e) => e.openModal);
|
|
1514
1524
|
return {
|
|
1515
1525
|
openModal: (e, n = {}, r) => t(e, n, r),
|
|
1516
|
-
closeModal:
|
|
1517
|
-
closeTopModal:
|
|
1518
|
-
closeAllModals:
|
|
1526
|
+
closeModal: X((e) => e.closeModal),
|
|
1527
|
+
closeTopModal: X((e) => e.closeTopModal),
|
|
1528
|
+
closeAllModals: X((e) => e.closeAllModals),
|
|
1519
1529
|
isOpen: (t) => e.some((e) => e.name === t),
|
|
1520
1530
|
count: e.length
|
|
1521
1531
|
};
|
|
1522
|
-
},
|
|
1523
|
-
className: `${
|
|
1532
|
+
}, Je = { root: "_root_1x7h7_1" }, Ye = ({ label: e = "Загрузка страницы", className: r = "" }) => /* @__PURE__ */ n("div", {
|
|
1533
|
+
className: `${Je.root} ${r}`,
|
|
1524
1534
|
role: "status",
|
|
1525
1535
|
"aria-label": e,
|
|
1526
1536
|
children: [/* @__PURE__ */ t(x, { decorative: !0 }), /* @__PURE__ */ t("span", { children: e })]
|
|
1527
|
-
}),
|
|
1537
|
+
}), Xe = {
|
|
1528
1538
|
viewport: "_viewport_15mi5_1",
|
|
1529
1539
|
"top-right": "_top-right_15mi5_3",
|
|
1530
1540
|
"top-left": "_top-left_15mi5_5",
|
|
@@ -1638,7 +1648,7 @@ var w = {
|
|
|
1638
1648
|
e.duration,
|
|
1639
1649
|
e.id
|
|
1640
1650
|
]), /* @__PURE__ */ n("article", {
|
|
1641
|
-
className: `${
|
|
1651
|
+
className: `${Xe.toast} ${Xe[e.variant]}`,
|
|
1642
1652
|
role: e.variant === "error" ? "alert" : "status",
|
|
1643
1653
|
"aria-live": e.variant === "error" ? "assertive" : "polite",
|
|
1644
1654
|
onMouseEnter: () => a(!0),
|
|
@@ -1648,7 +1658,7 @@ var w = {
|
|
|
1648
1658
|
children: [
|
|
1649
1659
|
/* @__PURE__ */ t("div", { children: Ze(e.variant) }),
|
|
1650
1660
|
/* @__PURE__ */ n("div", {
|
|
1651
|
-
className:
|
|
1661
|
+
className: Xe.body,
|
|
1652
1662
|
children: [
|
|
1653
1663
|
e.title && /* @__PURE__ */ t("strong", { children: e.title }),
|
|
1654
1664
|
/* @__PURE__ */ t("div", { children: e.message }),
|
|
@@ -1700,7 +1710,7 @@ var w = {
|
|
|
1700
1710
|
})), et = () => Q.setState({ toasts: [] }), tt = ({ position: e = "top-right" }) => {
|
|
1701
1711
|
let n = Q((e) => e.toasts), r = Q((e) => e.removeToast);
|
|
1702
1712
|
return /* @__PURE__ */ t("div", {
|
|
1703
|
-
className: `${
|
|
1713
|
+
className: `${Xe.viewport} ${Xe[e]}`,
|
|
1704
1714
|
"aria-label": "Уведомления",
|
|
1705
1715
|
children: n.map((e) => /* @__PURE__ */ t(Qe, {
|
|
1706
1716
|
toast: e,
|
|
@@ -1820,6 +1830,24 @@ var w = {
|
|
|
1820
1830
|
children: i
|
|
1821
1831
|
})]
|
|
1822
1832
|
});
|
|
1823
|
-
}
|
|
1833
|
+
}, ot = {
|
|
1834
|
+
popup: "_popup_15ovj_1",
|
|
1835
|
+
trigger: "_trigger_15ovj_15",
|
|
1836
|
+
content: "_content_15ovj_23",
|
|
1837
|
+
top: "_top_15ovj_107",
|
|
1838
|
+
right: "_right_15ovj_141",
|
|
1839
|
+
bottom: "_bottom_15ovj_175",
|
|
1840
|
+
left: "_left_15ovj_209"
|
|
1841
|
+
}, st = ({ content: r, children: i, placement: a = "top", disabled: o = !1 }) => o ? /* @__PURE__ */ t(e, { children: i }) : /* @__PURE__ */ n("span", {
|
|
1842
|
+
className: `${ot.popup} ${ot[a]}`,
|
|
1843
|
+
children: [/* @__PURE__ */ t("span", {
|
|
1844
|
+
className: ot.trigger,
|
|
1845
|
+
children: i
|
|
1846
|
+
}), /* @__PURE__ */ t("span", {
|
|
1847
|
+
className: ot.content,
|
|
1848
|
+
role: "tooltip",
|
|
1849
|
+
children: r
|
|
1850
|
+
})]
|
|
1851
|
+
});
|
|
1824
1852
|
//#endregion
|
|
1825
|
-
export {
|
|
1853
|
+
export { ze as ConfirmModal, y as DSBadge, C as DSButton, O as DSCheckbox, ge as DSDataTable, V as DSDateRange, R as DSDateTimePicker, re 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, st as DSPopup, Se as DSRadioButton, U as DSSkeleton, ae as DSSort, Qe as DSToast, tt as DSToastProvider, it as DSTooltip, at as DSVideoPlayerFrame, Be as ErrorModal, Pe as ModalSystemProvider, Ve as builtInModalRegistry, Fe as defineModalRegistry, P as formatDateTimeLocalValue, Ue as getErrorMessage, ne as getNextEnabledOptionIndex, B as isValidDateRange, F as parseDateTimeLocalValue, Ae as resetModalStore, et as resetToastStore, He as useConfirmModal, Ge as useConfirmModalStore, We as useErrorModal, Ke as useErrorModalStore, qe as useModals, X as useModalsStore, nt as useToast, Q as useToastStore, se as validateDSDataTableData };
|