@efficiency-point/design-system 0.1.44 → 0.1.46
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
|
@@ -2235,7 +2235,16 @@ var M = {
|
|
|
2235
2235
|
}, St = b({
|
|
2236
2236
|
rowSortingFeature: y,
|
|
2237
2237
|
sortedRowModel: v()
|
|
2238
|
-
}), Ct =
|
|
2238
|
+
}), Ct = [
|
|
2239
|
+
10,
|
|
2240
|
+
30,
|
|
2241
|
+
50,
|
|
2242
|
+
-1
|
|
2243
|
+
];
|
|
2244
|
+
function wt(e, t) {
|
|
2245
|
+
return t.includes(e) ? e : t.includes(30) ? 30 : t.find((e) => Number.isSafeInteger(e) && e > 0) ?? 30;
|
|
2246
|
+
}
|
|
2247
|
+
var Tt = ({ field: e, value: n, setValue: r, disabled: i, error: a }) => {
|
|
2239
2248
|
let o = e.type === "multi-select" ? e.options : void 0, [s, c] = g(Array.isArray(o) ? o : []), [l, u] = g(!1);
|
|
2240
2249
|
return d(() => {
|
|
2241
2250
|
if (o === void 0) return;
|
|
@@ -2278,20 +2287,20 @@ var M = {
|
|
|
2278
2287
|
error: a,
|
|
2279
2288
|
onChange: (e) => r(e)
|
|
2280
2289
|
});
|
|
2281
|
-
},
|
|
2290
|
+
}, Et = (e, t, n) => {
|
|
2282
2291
|
let r = new Set(e);
|
|
2283
2292
|
return t.forEach((e) => {
|
|
2284
2293
|
n ? r.add(e) : r.delete(e);
|
|
2285
2294
|
}), Array.from(r);
|
|
2286
|
-
},
|
|
2295
|
+
}, Dt = (e) => {
|
|
2287
2296
|
if (!(!e || e.width === void 0 && e.minWidth === void 0 && e.maxWidth === void 0)) return {
|
|
2288
2297
|
width: e.width,
|
|
2289
2298
|
minWidth: e.minWidth,
|
|
2290
2299
|
maxWidth: e.maxWidth
|
|
2291
2300
|
};
|
|
2292
|
-
},
|
|
2301
|
+
}, Ot = (e) => {
|
|
2293
2302
|
if (e?.sticky) return e.sticky === "start" ? { insetInlineStart: e.stickyOffset ?? 0 } : { insetInlineEnd: e.stickyOffset ?? 0 };
|
|
2294
|
-
},
|
|
2303
|
+
}, kt = (e, t) => t <= 7 ? Array.from({ length: t }, (e, t) => t) : e <= 3 ? [
|
|
2295
2304
|
0,
|
|
2296
2305
|
1,
|
|
2297
2306
|
2,
|
|
@@ -2315,7 +2324,7 @@ var M = {
|
|
|
2315
2324
|
e + 1,
|
|
2316
2325
|
"ellipsis-end",
|
|
2317
2326
|
t - 1
|
|
2318
|
-
],
|
|
2327
|
+
], At = (e, t) => {
|
|
2319
2328
|
let n = /* @__PURE__ */ new Set();
|
|
2320
2329
|
for (let t of e) {
|
|
2321
2330
|
if (!t.id.trim()) return "Идентификатор колонки не может быть пустым";
|
|
@@ -2327,36 +2336,36 @@ var M = {
|
|
|
2327
2336
|
for (let t of e) if (typeof t.accessor == "string" && !(t.accessor in r)) return `В строке ${n + 1} отсутствует колонка «${t.id}»`;
|
|
2328
2337
|
}
|
|
2329
2338
|
return null;
|
|
2330
|
-
},
|
|
2339
|
+
}, jt = (e, t) => typeof e == "function" ? e(t) : t[e], Mt = (e) => {
|
|
2331
2340
|
if (e == null || e === "") return null;
|
|
2332
2341
|
let t = Date.parse(String(e));
|
|
2333
2342
|
return Number.isNaN(t) ? null : t;
|
|
2334
|
-
},
|
|
2335
|
-
let r =
|
|
2343
|
+
}, Nt = (e, t, n) => {
|
|
2344
|
+
let r = Mt(e.getValue(n)), i = Mt(t.getValue(n));
|
|
2336
2345
|
return r === null && i === null ? 0 : r === null ? -1 : i === null ? 1 : r - i;
|
|
2337
|
-
},
|
|
2346
|
+
}, Pt = (e, t, n) => {
|
|
2338
2347
|
let r = e.getValue(n), i = t.getValue(n);
|
|
2339
2348
|
return r == null && i == null ? 0 : r == null ? -1 : i == null ? 1 : Number(r) - Number(i);
|
|
2340
|
-
},
|
|
2349
|
+
}, Ft = (e, t, n) => {
|
|
2341
2350
|
let r = e.getValue(n), i = t.getValue(n);
|
|
2342
2351
|
return r == null && i == null ? 0 : r == null ? -1 : i == null ? 1 : Number(!!r) - Number(!!i);
|
|
2343
|
-
},
|
|
2352
|
+
}, It = (e, t, n) => {
|
|
2344
2353
|
let r = String(e.getValue(n) ?? ""), i = String(t.getValue(n) ?? "");
|
|
2345
2354
|
return r.localeCompare(i, void 0, {
|
|
2346
2355
|
numeric: !0,
|
|
2347
2356
|
sensitivity: "base"
|
|
2348
2357
|
});
|
|
2349
|
-
},
|
|
2358
|
+
}, Lt = (e) => {
|
|
2350
2359
|
switch (e) {
|
|
2351
|
-
case "date": return
|
|
2352
|
-
case "number": return
|
|
2353
|
-
case "boolean": return
|
|
2360
|
+
case "date": return Nt;
|
|
2361
|
+
case "number": return Pt;
|
|
2362
|
+
case "boolean": return Ft;
|
|
2354
2363
|
case "text":
|
|
2355
|
-
case void 0: return
|
|
2364
|
+
case void 0: return It;
|
|
2356
2365
|
case "custom": return;
|
|
2357
2366
|
}
|
|
2358
|
-
},
|
|
2359
|
-
let t = (t) =>
|
|
2367
|
+
}, Rt = (e) => {
|
|
2368
|
+
let t = (t) => jt(e.accessor, t), n = e.sortFn ?? Lt(e.dataType), r = e.enableSorting ?? (e.dataType !== "custom" && n !== void 0), i = {
|
|
2360
2369
|
id: e.id,
|
|
2361
2370
|
accessorFn: t,
|
|
2362
2371
|
header: () => e.header,
|
|
@@ -2368,21 +2377,12 @@ var M = {
|
|
|
2368
2377
|
sortDescFirst: e.sortDescFirst
|
|
2369
2378
|
};
|
|
2370
2379
|
return n !== void 0 && (i.sortFn = n), i;
|
|
2371
|
-
},
|
|
2372
|
-
|
|
2373
|
-
30,
|
|
2374
|
-
50,
|
|
2375
|
-
-1
|
|
2376
|
-
], pageSizeDraft: W, onPageSizeDraftChange: te, pageSizeApplyMode: ne = "table", totalCount: re, onPageChange: ie, visibleColumnIds: ae, density: oe = "comfortable", renderBulkActions: se, renderExpandedRow: ce, expandedRowIds: G, onExpandedRowIdsChange: le, getRowExpansionLabel: ue, resultsAnnouncement: de, filterBar: K }) => {
|
|
2377
|
-
let [fe, pe] = g([]), [me, he] = g([]), [ge, _e] = g([]), [ve, ye] = g(0), [be, xe] = g(V === -1 ? -1 : [
|
|
2378
|
-
10,
|
|
2379
|
-
30,
|
|
2380
|
-
50
|
|
2381
|
-
].includes(V) ? V : 30), Se = c ?? fe, Ce = Se.map((e) => `${e.id}:${e.desc ? "desc" : "asc"}`).join("|"), we = V === -1, Te = we ? Math.max(1, (z === "server" ? Number(re) : i.length) || i.length || 1) : Number.isFinite(V) && V > 0 ? Math.floor(V) : 30, Ee = R && z === "server", q = m(() => {
|
|
2380
|
+
}, zt = ({ columns: e, data: i, tableOnMobile: a = !1, mobileView: o, breakpoint: s = "default", sorting: c, onSortingChange: l, renderMobileCard: u, getRowId: f, getRowClassName: p, getRowStyle: h, toolbarContent: _, totalCountVariant: v = "default", totalCountLabel: y = "Всего", caption: b, ariaLabel: S, loading: C = !1, error: w, emptyState: T = "Нет данных", stickyHeader: E = !1, maxHeight: D, className: O = "", onRowClick: k, selectable: A = !1, selectedRowIds: M, onSelectedRowIdsChange: ee, onRowDoubleClick: N, getRowSelectionLabel: P, selectAllRowsLabel: F = "Выбрать все строки на этой странице", resetSelectionLabel: I = "Сбросить выбор", openRowLabel: L = "Открыть строку", pagination: R = !1, paginationMode: z = "client", page: B = 1, pageSize: V = 30, onPageSizeChange: H, pageSizeOptions: U = Ct, pageSizeDraft: W, onPageSizeDraftChange: te, pageSizeApplyMode: ne = "table", totalCount: re, onPageChange: ie, visibleColumnIds: ae, density: oe = "comfortable", renderBulkActions: se, renderExpandedRow: ce, expandedRowIds: G, onExpandedRowIdsChange: le, getRowExpansionLabel: ue, resultsAnnouncement: de, filterBar: K }) => {
|
|
2381
|
+
let [fe, pe] = g([]), [me, he] = g([]), [ge, _e] = g([]), [ve, ye] = g(0), [be, xe] = g(() => wt(V, U)), Se = c ?? fe, Ce = Se.map((e) => `${e.id}:${e.desc ? "desc" : "asc"}`).join("|"), we = V === -1, Te = we ? Math.max(1, (z === "server" ? Number(re) : i.length) || i.length || 1) : Number.isFinite(V) && V > 0 ? Math.floor(V) : 30, Ee = R && z === "server", q = m(() => {
|
|
2382
2382
|
if (ae === void 0) return e;
|
|
2383
2383
|
let t = new Set(ae);
|
|
2384
2384
|
return e.filter((e) => t.has(e.id));
|
|
2385
|
-
}, [e, ae]), De = m(() => q.length === 0 ? "Должна быть видима хотя бы одна колонка" :
|
|
2385
|
+
}, [e, ae]), De = m(() => q.length === 0 ? "Должна быть видима хотя бы одна колонка" : At(q, i), [i, q]), Oe = m(() => q.map(Rt), [q]), ke = q.some((e) => Dt(e) !== void 0), J = x({
|
|
2386
2386
|
features: St,
|
|
2387
2387
|
columns: Oe,
|
|
2388
2388
|
data: i,
|
|
@@ -2401,7 +2401,7 @@ var M = {
|
|
|
2401
2401
|
]), Ie = M ?? me, Le = m(() => new Set(Ie), [Ie]), Re = G ?? ge, ze = m(() => new Set(Re), [Re]), Be = m(() => Fe.map((e) => e.id), [Fe]), Ve = Be.filter((e) => Le.has(e)).length, He = Be.length > 0 && Ve === Be.length, Ue = Ve > 0 && !He, We = m(() => q.filter((e) => e.enableSorting ?? e.dataType !== "custom").map((e) => ({
|
|
2402
2402
|
id: e.id,
|
|
2403
2403
|
label: typeof e.header == "string" ? e.header : e.id
|
|
2404
|
-
})), [q]), Ge = m(() =>
|
|
2404
|
+
})), [q]), Ge = m(() => kt(Pe, Me), [Me, Pe]), Ke = o === void 0 ? a : o === "table", qe = [
|
|
2405
2405
|
Q.root,
|
|
2406
2406
|
s === "wide" ? Q.wide : Q.default,
|
|
2407
2407
|
Ke ? Q.tableOnMobile : "",
|
|
@@ -2481,7 +2481,7 @@ var M = {
|
|
|
2481
2481
|
let t = new Set(Le);
|
|
2482
2482
|
t.has(e) ? t.delete(e) : t.add(e), ot(t);
|
|
2483
2483
|
}, ct = () => {
|
|
2484
|
-
let e =
|
|
2484
|
+
let e = Et(Le, Be, !He);
|
|
2485
2485
|
M === void 0 && he(e), ee?.(e);
|
|
2486
2486
|
}, lt = () => ot(/* @__PURE__ */ new Set()), ut = (e) => {
|
|
2487
2487
|
let t = new Set(ze);
|
|
@@ -2508,12 +2508,8 @@ var M = {
|
|
|
2508
2508
|
Me,
|
|
2509
2509
|
ve
|
|
2510
2510
|
]), d(() => {
|
|
2511
|
-
xe(V
|
|
2512
|
-
|
|
2513
|
-
30,
|
|
2514
|
-
50
|
|
2515
|
-
].includes(V) ? V : 30);
|
|
2516
|
-
}, [V]), /* @__PURE__ */ n("section", {
|
|
2511
|
+
xe(wt(V, U));
|
|
2512
|
+
}, [V, U]), /* @__PURE__ */ n("section", {
|
|
2517
2513
|
className: qe,
|
|
2518
2514
|
"aria-busy": C,
|
|
2519
2515
|
children: [
|
|
@@ -2546,7 +2542,7 @@ var M = {
|
|
|
2546
2542
|
children: [
|
|
2547
2543
|
/* @__PURE__ */ t("div", {
|
|
2548
2544
|
className: Q.filterFields,
|
|
2549
|
-
children: K.fields.map((e) => /* @__PURE__ */ t(
|
|
2545
|
+
children: K.fields.map((e) => /* @__PURE__ */ t(Tt, {
|
|
2550
2546
|
field: e,
|
|
2551
2547
|
value: K.draftValues[e.key],
|
|
2552
2548
|
disabled: !!(e.disabled || K.applying || C),
|
|
@@ -2620,7 +2616,7 @@ var M = {
|
|
|
2620
2616
|
(ke || A || !!ce) && /* @__PURE__ */ n("colgroup", { children: [
|
|
2621
2617
|
ce && /* @__PURE__ */ t("col", { className: Q.expansionColumn }),
|
|
2622
2618
|
A && /* @__PURE__ */ t("col", { className: Q.selectionColumn }),
|
|
2623
|
-
q.map((e) => /* @__PURE__ */ t("col", { style:
|
|
2619
|
+
q.map((e) => /* @__PURE__ */ t("col", { style: Dt(e) }, e.id))
|
|
2624
2620
|
] }),
|
|
2625
2621
|
/* @__PURE__ */ t("thead", {
|
|
2626
2622
|
className: E ? Q.sticky : "",
|
|
@@ -2666,8 +2662,8 @@ var M = {
|
|
|
2666
2662
|
"aria-sort": r === "asc" ? "ascending" : r === "desc" ? "descending" : "none",
|
|
2667
2663
|
className: q.find((t) => t.id === e.column.id)?.sticky ? Q.stickyColumn : void 0,
|
|
2668
2664
|
style: {
|
|
2669
|
-
...
|
|
2670
|
-
...
|
|
2665
|
+
...Dt(q.find((t) => t.id === e.column.id)),
|
|
2666
|
+
...Ot(q.find((t) => t.id === e.column.id))
|
|
2671
2667
|
},
|
|
2672
2668
|
children: /* @__PURE__ */ n("button", {
|
|
2673
2669
|
type: "button",
|
|
@@ -2751,8 +2747,8 @@ var M = {
|
|
|
2751
2747
|
e.getAllCells().map((e) => /* @__PURE__ */ t("td", {
|
|
2752
2748
|
className: q.find((t) => t.id === e.column.id)?.sticky ? Q.stickyColumn : void 0,
|
|
2753
2749
|
style: {
|
|
2754
|
-
...
|
|
2755
|
-
...
|
|
2750
|
+
...Dt(q.find((t) => t.id === e.column.id)),
|
|
2751
|
+
...Ot(q.find((t) => t.id === e.column.id))
|
|
2756
2752
|
},
|
|
2757
2753
|
children: /* @__PURE__ */ t(J.FlexRender, { cell: e })
|
|
2758
2754
|
}, e.id))
|
|
@@ -2858,7 +2854,7 @@ var M = {
|
|
|
2858
2854
|
})
|
|
2859
2855
|
]
|
|
2860
2856
|
}, e.id);
|
|
2861
|
-
let c = q.filter((e) => !e.mobile?.hideOnMobile).sort((e, t) => (e.mobile?.mobileOrder ?? 0) - (t.mobile?.mobileOrder ?? 0)), l = c.find((e) => e.mobile?.primary) ?? c.find((e) => e.mobile?.mobileVariant !== "actions"), d = (t) =>
|
|
2857
|
+
let c = q.filter((e) => !e.mobile?.hideOnMobile).sort((e, t) => (e.mobile?.mobileOrder ?? 0) - (t.mobile?.mobileOrder ?? 0)), l = c.find((e) => e.mobile?.primary) ?? c.find((e) => e.mobile?.mobileVariant !== "actions"), d = (t) => jt(t.accessor, e.original), f = (t) => t.mobile?.renderMobile?.(e.original, d(t)) ?? t.cell?.(e.original, d(t)) ?? String(d(t) ?? "");
|
|
2862
2858
|
return /* @__PURE__ */ n("article", {
|
|
2863
2859
|
role: "listitem",
|
|
2864
2860
|
className: [
|
|
@@ -2968,17 +2964,17 @@ var M = {
|
|
|
2968
2964
|
})
|
|
2969
2965
|
]
|
|
2970
2966
|
});
|
|
2971
|
-
},
|
|
2967
|
+
}, Bt = (e, t) => {
|
|
2972
2968
|
let n = t.trim().toLocaleLowerCase();
|
|
2973
2969
|
return n ? e.filter((e) => e.label.toLocaleLowerCase().includes(n) || e.value.toLocaleLowerCase().includes(n)) : e;
|
|
2974
|
-
},
|
|
2970
|
+
}, Vt = (e, t, n) => {
|
|
2975
2971
|
if (!e.length) return -1;
|
|
2976
2972
|
for (let r = 0; r < e.length; r += 1) {
|
|
2977
2973
|
let i = (t + r * n + e.length) % e.length;
|
|
2978
2974
|
if (!e[i]?.disabled) return i;
|
|
2979
2975
|
}
|
|
2980
2976
|
return -1;
|
|
2981
|
-
},
|
|
2977
|
+
}, Ht = {
|
|
2982
2978
|
wrapper: "_wrapper_1os84_1",
|
|
2983
2979
|
control: "_control_1os84_17",
|
|
2984
2980
|
inputHost: "_inputHost_1os84_25",
|
|
@@ -2997,23 +2993,23 @@ var M = {
|
|
|
2997
2993
|
active: "_active_1os84_321",
|
|
2998
2994
|
actionOption: "_actionOption_1os84_341",
|
|
2999
2995
|
visuallyHidden: "_visuallyHidden_1os84_375"
|
|
3000
|
-
},
|
|
2996
|
+
}, Ut = 8, Wt = 6, Gt = 5, Kt = 10, qt = {
|
|
3001
2997
|
sm: 30,
|
|
3002
2998
|
md: 40,
|
|
3003
2999
|
lg: 50
|
|
3004
|
-
},
|
|
3000
|
+
}, Jt = ({ options: e, value: r, onChange: i, placeholder: a = "Начните вводить", noResultsText: o = "Ничего не найдено", disabled: s = !1, readOnly: c = !1, stringWhileDisabled: u = !1, label: v, error: y, hint: b, size: x = "md", required: S = !1, className: C = "", name: w, id: T, needMark: E = !0 }) => {
|
|
3005
3001
|
let D = f(), O = T ?? `ds-search-dropdown-${w ?? D}`, k = `${O}-listbox`, A = `${O}-status`, j = b ? `${O}-hint` : void 0, M = y ? `${O}-error` : void 0, P = [
|
|
3006
3002
|
A,
|
|
3007
3003
|
j,
|
|
3008
3004
|
M
|
|
3009
|
-
].filter(Boolean).join(" "), F = h(null), I = h(null), L = h([]), [R, z] = g(!1), [B, V] = g(""), [H, U] = g(-1), [W, te] = g(null), ne = m(() => e.find((e) => e.value === r), [e, r]), re = m(() =>
|
|
3005
|
+
].filter(Boolean).join(" "), F = h(null), I = h(null), L = h([]), [R, z] = g(!1), [B, V] = g(""), [H, U] = g(-1), [W, te] = g(null), ne = m(() => e.find((e) => e.value === r), [e, r]), re = m(() => Bt(e, B), [e, B]), ie = s && u, ae = H >= 0 ? re[H] : void 0;
|
|
3010
3006
|
d(() => V(ne?.label ?? ""), [ne?.label, r]);
|
|
3011
|
-
let oe = l(() => F.current?.querySelector("input") ?? null, []), se = l((e, t) =>
|
|
3007
|
+
let oe = l(() => F.current?.querySelector("input") ?? null, []), se = l((e, t) => Vt(re, e, t), [re]), ce = l((e) => {
|
|
3012
3008
|
U(e), !(e < 0) && requestAnimationFrame(() => L.current[e]?.scrollIntoView({ block: "nearest" }));
|
|
3013
3009
|
}, []), G = l(() => {
|
|
3014
3010
|
let e = oe();
|
|
3015
3011
|
if (!e) return;
|
|
3016
|
-
let t = e.getBoundingClientRect(), n = Math.max(1, Math.min(re.length,
|
|
3012
|
+
let t = e.getBoundingClientRect(), n = Math.max(1, Math.min(re.length, Gt)) * qt[x] + Kt, r = window.innerHeight - t.bottom - Ut, i = t.top - Ut, a = r < n && i > r, o = a ? i : r, s = Math.max(qt[x] + Kt, Math.min(n, o)), c = window.innerWidth - t.width - Ut, l = Math.max(Ut, Math.min(t.left, c)), u = a ? Math.max(Ut, t.top - s - Wt) : t.bottom + Wt;
|
|
3017
3013
|
te({
|
|
3018
3014
|
top: u,
|
|
3019
3015
|
left: l,
|
|
@@ -3048,7 +3044,7 @@ var M = {
|
|
|
3048
3044
|
}, de = R ? /* @__PURE__ */ t("ul", {
|
|
3049
3045
|
ref: I,
|
|
3050
3046
|
id: k,
|
|
3051
|
-
className: `${
|
|
3047
|
+
className: `${Ht.menu} ${re.length === 0 ? Ht.menuEmpty : ""}`,
|
|
3052
3048
|
role: "listbox",
|
|
3053
3049
|
"aria-label": v,
|
|
3054
3050
|
style: W ? {
|
|
@@ -3063,7 +3059,7 @@ var M = {
|
|
|
3063
3059
|
maxHeight: 0
|
|
3064
3060
|
},
|
|
3065
3061
|
children: re.length === 0 ? /* @__PURE__ */ t("li", {
|
|
3066
|
-
className: `${
|
|
3062
|
+
className: `${Ht.empty} ${Ht[x]}`,
|
|
3067
3063
|
children: o
|
|
3068
3064
|
}) : re.map((e, i) => {
|
|
3069
3065
|
let a = e.value === r, o = i === H;
|
|
@@ -3082,11 +3078,11 @@ var M = {
|
|
|
3082
3078
|
"aria-selected": a,
|
|
3083
3079
|
"data-option-variant": e.variant ?? "default",
|
|
3084
3080
|
className: [
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
e.variant === "action" ?
|
|
3088
|
-
a ?
|
|
3089
|
-
o ?
|
|
3081
|
+
Ht.option,
|
|
3082
|
+
Ht[x],
|
|
3083
|
+
e.variant === "action" ? Ht.actionOption : "",
|
|
3084
|
+
a ? Ht.selected : "",
|
|
3085
|
+
o ? Ht.active : ""
|
|
3090
3086
|
].filter(Boolean).join(" "),
|
|
3091
3087
|
onPointerMove: () => {
|
|
3092
3088
|
e.disabled || U(i);
|
|
@@ -3104,8 +3100,8 @@ var M = {
|
|
|
3104
3100
|
return /* @__PURE__ */ n("div", {
|
|
3105
3101
|
ref: F,
|
|
3106
3102
|
className: [
|
|
3107
|
-
|
|
3108
|
-
y ?
|
|
3103
|
+
Ht.wrapper,
|
|
3104
|
+
y ? Ht.errorState : "",
|
|
3109
3105
|
C
|
|
3110
3106
|
].filter(Boolean).join(" "),
|
|
3111
3107
|
children: [
|
|
@@ -3116,10 +3112,10 @@ var M = {
|
|
|
3116
3112
|
children: v
|
|
3117
3113
|
}),
|
|
3118
3114
|
ie ? /* @__PURE__ */ t("div", {
|
|
3119
|
-
className: `${
|
|
3115
|
+
className: `${Ht.disabledText} ${Ht[x]}`,
|
|
3120
3116
|
children: ne?.label ?? a
|
|
3121
3117
|
}) : /* @__PURE__ */ n("div", {
|
|
3122
|
-
className:
|
|
3118
|
+
className: Ht.control,
|
|
3123
3119
|
children: [/* @__PURE__ */ t(mt, {
|
|
3124
3120
|
id: O,
|
|
3125
3121
|
name: w,
|
|
@@ -3131,11 +3127,11 @@ var M = {
|
|
|
3131
3127
|
size: x,
|
|
3132
3128
|
clearable: !1,
|
|
3133
3129
|
autoComplete: "off",
|
|
3134
|
-
className: `${
|
|
3130
|
+
className: `${Ht.inputHost} ${Ht[x]}`,
|
|
3135
3131
|
onFocus: le,
|
|
3136
3132
|
onChange: (t) => {
|
|
3137
|
-
let n = String(t), r =
|
|
3138
|
-
V(n), z(!0), U(
|
|
3133
|
+
let n = String(t), r = Bt(e, n);
|
|
3134
|
+
V(n), z(!0), U(Vt(r, 0, 1));
|
|
3139
3135
|
},
|
|
3140
3136
|
role: "combobox",
|
|
3141
3137
|
"aria-autocomplete": "list",
|
|
@@ -3160,7 +3156,7 @@ var M = {
|
|
|
3160
3156
|
}
|
|
3161
3157
|
}
|
|
3162
3158
|
}), /* @__PURE__ */ t("span", {
|
|
3163
|
-
className: `${
|
|
3159
|
+
className: `${Ht.chevron} ${R ? Ht.chevronOpen : ""}`,
|
|
3164
3160
|
"aria-hidden": "true",
|
|
3165
3161
|
children: /* @__PURE__ */ t(Y, {
|
|
3166
3162
|
name: "IconChevron",
|
|
@@ -3172,7 +3168,7 @@ var M = {
|
|
|
3172
3168
|
R && typeof document < "u" && _(de, document.body),
|
|
3173
3169
|
/* @__PURE__ */ n("span", {
|
|
3174
3170
|
id: A,
|
|
3175
|
-
className:
|
|
3171
|
+
className: Ht.visuallyHidden,
|
|
3176
3172
|
"aria-live": "polite",
|
|
3177
3173
|
children: ["Найдено вариантов: ", re.length]
|
|
3178
3174
|
}),
|
|
@@ -3187,25 +3183,25 @@ var M = {
|
|
|
3187
3183
|
})
|
|
3188
3184
|
]
|
|
3189
3185
|
});
|
|
3190
|
-
},
|
|
3186
|
+
}, Yt = {
|
|
3191
3187
|
root: "_root_11adi_1",
|
|
3192
3188
|
header: "_header_11adi_21",
|
|
3193
3189
|
title: "_title_11adi_41",
|
|
3194
3190
|
dismiss: "_dismiss_11adi_55",
|
|
3195
3191
|
content: "_content_11adi_65"
|
|
3196
|
-
},
|
|
3192
|
+
}, Xt = ({ title: e, children: r, dismissible: i = !1, onDismiss: a, dismissLabel: o = "Закрыть информационный блок", headingAs: s = "h3", className: c = "" }) => {
|
|
3197
3193
|
let l = `ds-info-block-${f()}`;
|
|
3198
3194
|
return /* @__PURE__ */ n("section", {
|
|
3199
|
-
className: `${
|
|
3195
|
+
className: `${Yt.root} ${c}`,
|
|
3200
3196
|
"aria-labelledby": l,
|
|
3201
3197
|
children: [/* @__PURE__ */ n("header", {
|
|
3202
|
-
className:
|
|
3198
|
+
className: Yt.header,
|
|
3203
3199
|
children: [/* @__PURE__ */ t(s, {
|
|
3204
3200
|
id: l,
|
|
3205
|
-
className:
|
|
3201
|
+
className: Yt.title,
|
|
3206
3202
|
children: e
|
|
3207
3203
|
}), i && /* @__PURE__ */ t(j, {
|
|
3208
|
-
className:
|
|
3204
|
+
className: Yt.dismiss,
|
|
3209
3205
|
variant: "empty",
|
|
3210
3206
|
onClick: a,
|
|
3211
3207
|
"aria-label": o,
|
|
@@ -3216,15 +3212,15 @@ var M = {
|
|
|
3216
3212
|
})
|
|
3217
3213
|
})]
|
|
3218
3214
|
}), /* @__PURE__ */ t("div", {
|
|
3219
|
-
className:
|
|
3215
|
+
className: Yt.content,
|
|
3220
3216
|
children: r
|
|
3221
3217
|
})]
|
|
3222
3218
|
});
|
|
3223
|
-
},
|
|
3219
|
+
}, Zt = {
|
|
3224
3220
|
root: "_root_1ecm3_1",
|
|
3225
3221
|
grid: "_grid_1ecm3_13",
|
|
3226
3222
|
actions: "_actions_1ecm3_27"
|
|
3227
|
-
},
|
|
3223
|
+
}, Qt = ({ filters: e, values: r, onChange: i, onApply: a, onReset: o, applyMode: s = "instant", loading: c = !1, disabled: l = !1, className: u = "" }) => {
|
|
3228
3224
|
let d = (e, t) => {
|
|
3229
3225
|
let n = {
|
|
3230
3226
|
...r,
|
|
@@ -3233,11 +3229,11 @@ var M = {
|
|
|
3233
3229
|
i?.(n, e), s === "instant" && a?.(n);
|
|
3234
3230
|
};
|
|
3235
3231
|
return /* @__PURE__ */ n("section", {
|
|
3236
|
-
className: `${
|
|
3232
|
+
className: `${Zt.root} ${u}`,
|
|
3237
3233
|
"aria-label": "Фильтры",
|
|
3238
3234
|
"aria-busy": c,
|
|
3239
3235
|
children: [/* @__PURE__ */ t("div", {
|
|
3240
|
-
className:
|
|
3236
|
+
className: Zt.grid,
|
|
3241
3237
|
children: e.filter((e) => !e.hidden).map((e) => {
|
|
3242
3238
|
let n = l || c || e.disabled, i = r[e.id];
|
|
3243
3239
|
if (e.type === "input") {
|
|
@@ -3305,7 +3301,7 @@ var M = {
|
|
|
3305
3301
|
}, e.id);
|
|
3306
3302
|
})
|
|
3307
3303
|
}), (o || s === "manual") && /* @__PURE__ */ n("div", {
|
|
3308
|
-
className:
|
|
3304
|
+
className: Zt.actions,
|
|
3309
3305
|
children: [o && /* @__PURE__ */ t(j, {
|
|
3310
3306
|
variant: "destructiveOutline",
|
|
3311
3307
|
disabled: l || c,
|
|
@@ -3319,7 +3315,7 @@ var M = {
|
|
|
3319
3315
|
})]
|
|
3320
3316
|
})]
|
|
3321
3317
|
});
|
|
3322
|
-
},
|
|
3318
|
+
}, $t = {
|
|
3323
3319
|
grid: "_grid_1q540_1",
|
|
3324
3320
|
comfortable: "_comfortable_1q540_11",
|
|
3325
3321
|
compact: "_compact_1q540_19",
|
|
@@ -3336,23 +3332,23 @@ var M = {
|
|
|
3336
3332
|
summary: "_summary_1q540_101",
|
|
3337
3333
|
summaryTitle: "_summaryTitle_1q540_137",
|
|
3338
3334
|
summaryList: "_summaryList_1q540_145"
|
|
3339
|
-
},
|
|
3335
|
+
}, en = ({ columns: e = 2, density: n = "comfortable", className: r = "", ...i }) => /* @__PURE__ */ t("div", {
|
|
3340
3336
|
...i,
|
|
3341
|
-
className: `${
|
|
3342
|
-
}),
|
|
3337
|
+
className: `${$t.grid} ${$t[`columns${e}`]} ${$t[n]} ${r}`
|
|
3338
|
+
}), tn = ({ span: e = 1, className: n = "", ...r }) => /* @__PURE__ */ t("div", {
|
|
3343
3339
|
...r,
|
|
3344
|
-
className: `${
|
|
3345
|
-
}),
|
|
3340
|
+
className: `${$t.item} ${$t[`span${e}`]} ${n}`
|
|
3341
|
+
}), nn = ({ title: e = "Проверьте заполнение формы", items: r, focusField: i, className: a = "", ...o }) => r.length === 0 ? null : /* @__PURE__ */ n("div", {
|
|
3346
3342
|
...o,
|
|
3347
|
-
className: `${
|
|
3343
|
+
className: `${$t.summary} ${a}`,
|
|
3348
3344
|
role: "alert",
|
|
3349
3345
|
"aria-atomic": "true",
|
|
3350
3346
|
tabIndex: -1,
|
|
3351
3347
|
children: [/* @__PURE__ */ t("strong", {
|
|
3352
|
-
className:
|
|
3348
|
+
className: $t.summaryTitle,
|
|
3353
3349
|
children: e
|
|
3354
3350
|
}), /* @__PURE__ */ t("ul", {
|
|
3355
|
-
className:
|
|
3351
|
+
className: $t.summaryList,
|
|
3356
3352
|
children: r.map((e) => /* @__PURE__ */ t("li", { children: e.fieldId ? /* @__PURE__ */ t("a", {
|
|
3357
3353
|
href: `#${e.fieldId}`,
|
|
3358
3354
|
onClick: (t) => {
|
|
@@ -3361,7 +3357,7 @@ var M = {
|
|
|
3361
3357
|
children: e.message
|
|
3362
3358
|
}) : e.message }, e.id))
|
|
3363
3359
|
})]
|
|
3364
|
-
}),
|
|
3360
|
+
}), rn = {
|
|
3365
3361
|
wrapper: "_wrapper_i20hz_1",
|
|
3366
3362
|
dropzone: "_dropzone_i20hz_15",
|
|
3367
3363
|
dragActive: "_dragActive_i20hz_45",
|
|
@@ -3374,12 +3370,12 @@ var M = {
|
|
|
3374
3370
|
file: "_file_i20hz_133",
|
|
3375
3371
|
fileName: "_fileName_i20hz_175",
|
|
3376
3372
|
fileSize: "_fileSize_i20hz_187"
|
|
3377
|
-
},
|
|
3373
|
+
}, an = (e) => `${e.name}:${e.size}:${e.lastModified}`, on = (e) => e < 1024 ? `${e} Б` : e < 1048576 ? `${(e / 1024).toFixed(1)} КБ` : `${(e / 1024 / 1024).toFixed(1)} МБ`, sn = (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), cn = ({ value: r, onChange: i, multiple: a = !1, accept: o, maxSize: s, maxFiles: c, label: l, hint: u, error: d, required: p = !1, disabled: m = !1, readOnly: _ = !1, name: v, id: y, className: b = "", dropLabel: x = "Перетащите файлы в эту область", browseLabel: S = "Выбрать файлы", addMoreLabel: C = "Добавить ещё", onReject: w }) => {
|
|
3378
3374
|
let T = f(), E = y ?? `ds-file-input-${v ?? T}`, D = h(null), O = h(0), [k, A] = g(!1), M = u ? `${E}-hint` : void 0, P = d ? `${E}-error` : void 0, F = [M, P].filter(Boolean).join(" ") || void 0, I = !m && !_, L = (e) => {
|
|
3379
|
-
let t = [], n = new Set(r.map(
|
|
3375
|
+
let t = [], n = new Set(r.map(an)), l = e.filter((e) => sn(e, o) ? s !== void 0 && e.size > s ? (t.push({
|
|
3380
3376
|
file: e,
|
|
3381
3377
|
reason: "maxSize"
|
|
3382
|
-
}), !1) : !n.has(
|
|
3378
|
+
}), !1) : !n.has(an(e)) && (n.add(an(e)), !0) : (t.push({
|
|
3383
3379
|
file: e,
|
|
3384
3380
|
reason: "accept"
|
|
3385
3381
|
}), !1)), u = a ? c : 1, d = a ? [...r, ...l] : l.slice(-1);
|
|
@@ -3389,7 +3385,7 @@ var M = {
|
|
|
3389
3385
|
})), d = d.slice(0, u)), t.length && w?.(t), l.length && i?.(d), D.current && (D.current.value = "");
|
|
3390
3386
|
};
|
|
3391
3387
|
return /* @__PURE__ */ n("div", {
|
|
3392
|
-
className: `${
|
|
3388
|
+
className: `${rn.wrapper} ${b}`,
|
|
3393
3389
|
children: [
|
|
3394
3390
|
l && /* @__PURE__ */ t(ee, {
|
|
3395
3391
|
htmlFor: E,
|
|
@@ -3398,7 +3394,7 @@ var M = {
|
|
|
3398
3394
|
children: l
|
|
3399
3395
|
}),
|
|
3400
3396
|
/* @__PURE__ */ n("div", {
|
|
3401
|
-
className: `${
|
|
3397
|
+
className: `${rn.dropzone} ${k ? rn.dragActive : ""} ${m ? rn.disabled : ""} ${d ? rn.error : ""}`,
|
|
3402
3398
|
onDragEnter: (e) => {
|
|
3403
3399
|
e.preventDefault(), I && ++O.current === 1 && A(!0);
|
|
3404
3400
|
},
|
|
@@ -3413,7 +3409,7 @@ var M = {
|
|
|
3413
3409
|
ref: D,
|
|
3414
3410
|
id: E,
|
|
3415
3411
|
name: v,
|
|
3416
|
-
className:
|
|
3412
|
+
className: rn.nativeInput,
|
|
3417
3413
|
type: "file",
|
|
3418
3414
|
multiple: a,
|
|
3419
3415
|
accept: o,
|
|
@@ -3424,19 +3420,19 @@ var M = {
|
|
|
3424
3420
|
onChange: (e) => L(Array.from(e.target.files ?? []))
|
|
3425
3421
|
}), r.length ? /* @__PURE__ */ n(e, { children: [
|
|
3426
3422
|
/* @__PURE__ */ t("ul", {
|
|
3427
|
-
className:
|
|
3423
|
+
className: rn.files,
|
|
3428
3424
|
"aria-live": "polite",
|
|
3429
3425
|
children: r.map((e, a) => /* @__PURE__ */ n("li", {
|
|
3430
|
-
className:
|
|
3426
|
+
className: rn.file,
|
|
3431
3427
|
children: [
|
|
3432
3428
|
/* @__PURE__ */ t("span", {
|
|
3433
|
-
className:
|
|
3429
|
+
className: rn.fileName,
|
|
3434
3430
|
title: e.name,
|
|
3435
3431
|
children: e.name
|
|
3436
3432
|
}),
|
|
3437
3433
|
/* @__PURE__ */ t("span", {
|
|
3438
|
-
className:
|
|
3439
|
-
children:
|
|
3434
|
+
className: rn.fileSize,
|
|
3435
|
+
children: on(e.size)
|
|
3440
3436
|
}),
|
|
3441
3437
|
I && /* @__PURE__ */ t(j, {
|
|
3442
3438
|
variant: "empty",
|
|
@@ -3450,25 +3446,25 @@ var M = {
|
|
|
3450
3446
|
})
|
|
3451
3447
|
})
|
|
3452
3448
|
]
|
|
3453
|
-
},
|
|
3449
|
+
}, an(e)))
|
|
3454
3450
|
}),
|
|
3455
3451
|
I && (a || r.length === 0) && /* @__PURE__ */ t(j, {
|
|
3456
|
-
className:
|
|
3452
|
+
className: rn.browseButton,
|
|
3457
3453
|
size: "sm",
|
|
3458
3454
|
onClick: () => D.current?.click(),
|
|
3459
3455
|
children: C
|
|
3460
3456
|
}),
|
|
3461
3457
|
I && !a && /* @__PURE__ */ t(j, {
|
|
3462
|
-
className:
|
|
3458
|
+
className: rn.browseButton,
|
|
3463
3459
|
size: "sm",
|
|
3464
3460
|
onClick: () => D.current?.click(),
|
|
3465
3461
|
children: S
|
|
3466
3462
|
})
|
|
3467
3463
|
] }) : /* @__PURE__ */ n("div", {
|
|
3468
|
-
className:
|
|
3464
|
+
className: rn.empty,
|
|
3469
3465
|
children: [
|
|
3470
3466
|
/* @__PURE__ */ t("span", {
|
|
3471
|
-
className:
|
|
3467
|
+
className: rn.uploadIcon,
|
|
3472
3468
|
"aria-hidden": "true",
|
|
3473
3469
|
children: /* @__PURE__ */ t(Y, {
|
|
3474
3470
|
name: "IconUpload",
|
|
@@ -3496,7 +3492,7 @@ var M = {
|
|
|
3496
3492
|
})
|
|
3497
3493
|
]
|
|
3498
3494
|
});
|
|
3499
|
-
},
|
|
3495
|
+
}, ln = ({ children: e, containerId: t = "overlay-root" }) => {
|
|
3500
3496
|
let [n, r] = g(null);
|
|
3501
3497
|
return d(() => {
|
|
3502
3498
|
let e = document.getElementById(t);
|
|
@@ -3509,37 +3505,47 @@ var M = {
|
|
|
3509
3505
|
n.childElementCount === 0 && n.parentElement && n.remove();
|
|
3510
3506
|
};
|
|
3511
3507
|
}, [t]), n ? _(e, n) : null;
|
|
3512
|
-
},
|
|
3513
|
-
let o =
|
|
3508
|
+
}, un = typeof window > "u" ? d : p, dn = ({ anchorRef: e, children: n, matchAnchorWidth: r = !1, offset: i = 4, className: a }) => {
|
|
3509
|
+
let [o, s] = g(null), [c, u] = g({
|
|
3514
3510
|
position: "fixed",
|
|
3515
3511
|
visibility: "hidden",
|
|
3516
3512
|
zIndex: 1100
|
|
3517
|
-
}),
|
|
3518
|
-
let t = e.current, n = o
|
|
3513
|
+
}), d = l(() => {
|
|
3514
|
+
let t = e.current, n = o;
|
|
3519
3515
|
if (!t || !n) return;
|
|
3520
|
-
let a = t.getBoundingClientRect(), s = n.getBoundingClientRect(),
|
|
3521
|
-
c({
|
|
3516
|
+
let a = t.getBoundingClientRect(), s = n.getBoundingClientRect(), c = window.innerHeight - a.bottom - 8, l = a.top - 8, d = (c >= s.height || c >= l ? "bottom" : "top") == "bottom" ? a.bottom + i : a.top - s.height - i, f = a.left, p = window.innerWidth - s.width - 8, m = Math.max(8, Math.min(f, p)), h = {
|
|
3522
3517
|
position: "fixed",
|
|
3523
|
-
top:
|
|
3518
|
+
top: Math.max(8, Math.min(d, window.innerHeight - s.height - 8)),
|
|
3524
3519
|
left: m,
|
|
3525
3520
|
...r ? { width: a.width } : {},
|
|
3526
3521
|
zIndex: 1100,
|
|
3527
3522
|
visibility: "visible"
|
|
3528
|
-
}
|
|
3523
|
+
};
|
|
3524
|
+
u((e) => e.top === h.top && e.left === h.left && e.width === h.width && e.visibility === h.visibility ? e : h);
|
|
3529
3525
|
}, [
|
|
3530
3526
|
e,
|
|
3531
3527
|
r,
|
|
3528
|
+
o,
|
|
3532
3529
|
i
|
|
3533
3530
|
]);
|
|
3534
|
-
return
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3531
|
+
return un(() => {
|
|
3532
|
+
if (!o) return;
|
|
3533
|
+
d(), window.addEventListener("resize", d), window.addEventListener("scroll", d, !0);
|
|
3534
|
+
let t = typeof ResizeObserver > "u" ? null : new ResizeObserver(d);
|
|
3535
|
+
return t?.observe(o), e.current && t?.observe(e.current), () => {
|
|
3536
|
+
window.removeEventListener("resize", d), window.removeEventListener("scroll", d, !0), t?.disconnect();
|
|
3537
|
+
};
|
|
3538
|
+
}, [
|
|
3539
|
+
e,
|
|
3540
|
+
o,
|
|
3541
|
+
d
|
|
3542
|
+
]), /* @__PURE__ */ t(ln, { children: /* @__PURE__ */ t("div", {
|
|
3543
|
+
ref: s,
|
|
3538
3544
|
className: a,
|
|
3539
|
-
style:
|
|
3545
|
+
style: c,
|
|
3540
3546
|
children: n
|
|
3541
3547
|
}) });
|
|
3542
|
-
},
|
|
3548
|
+
}, fn = {
|
|
3543
3549
|
wrapper: "_wrapper_x2gki_1",
|
|
3544
3550
|
control: "_control_x2gki_15",
|
|
3545
3551
|
textarea: "_textarea_x2gki_25",
|
|
@@ -3553,12 +3559,12 @@ var M = {
|
|
|
3553
3559
|
clearAction: "_clearAction_x2gki_171",
|
|
3554
3560
|
messages: "_messages_x2gki_251",
|
|
3555
3561
|
counter: "_counter_x2gki_265"
|
|
3556
|
-
},
|
|
3557
|
-
function
|
|
3562
|
+
}, pn = 2;
|
|
3563
|
+
function mn(e) {
|
|
3558
3564
|
let t = window.getComputedStyle(e), n = Number.parseFloat(t.lineHeight);
|
|
3559
3565
|
return Number.isFinite(n) ? n : Number.parseFloat(t.fontSize) * 1.4;
|
|
3560
3566
|
}
|
|
3561
|
-
function
|
|
3567
|
+
function hn({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, readOnly: o = !1, stringWhileDisabled: s = !1, label: c, error: u, hint: p, className: m = "", name: g, id: _, size: v = "md", clearable: y = !1, required: b = !1, maxLength: x, showCount: S = !1, minRows: C = pn, maxRows: w, autoResize: T = !0, ...E }) {
|
|
3562
3568
|
let D = f(), O = _ ?? `ds-textarea-${g ?? D}`, k = h(null), A = p ? `${O}-hint` : void 0, j = u ? `${O}-error` : void 0, M = S && x ? `${O}-count` : void 0, P = [
|
|
3563
3569
|
A,
|
|
3564
3570
|
j,
|
|
@@ -3566,7 +3572,7 @@ function fn({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
|
|
|
3566
3572
|
].filter(Boolean).join(" ") || void 0, F = Math.max(1, C), I = w === void 0 ? void 0 : Math.max(F, w), L = l(() => {
|
|
3567
3573
|
let e = k.current;
|
|
3568
3574
|
if (!e || !T) return;
|
|
3569
|
-
let t = window.getComputedStyle(e), n =
|
|
3575
|
+
let t = window.getComputedStyle(e), n = mn(e), r = Number.parseFloat(t.paddingTop) + Number.parseFloat(t.paddingBottom) + Number.parseFloat(t.borderTopWidth) + Number.parseFloat(t.borderBottomWidth), i = n * F + r, a = I === void 0 ? Infinity : n * I + r;
|
|
3570
3576
|
e.style.height = "auto";
|
|
3571
3577
|
let o = Math.min(Math.max(e.scrollHeight, i), a);
|
|
3572
3578
|
e.style.height = `${o}px`, e.style.overflowY = e.scrollHeight > a ? "auto" : "hidden";
|
|
@@ -3598,7 +3604,7 @@ function fn({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
|
|
|
3598
3604
|
e && ((Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set)?.call(e, ""), e.dispatchEvent(new Event("input", { bubbles: !0 })), e.focus(), L());
|
|
3599
3605
|
}, B = { "--ds-textarea-min-rows": F };
|
|
3600
3606
|
return /* @__PURE__ */ n("div", {
|
|
3601
|
-
className: `${
|
|
3607
|
+
className: `${fn.wrapper} ${m}`,
|
|
3602
3608
|
children: [
|
|
3603
3609
|
c && /* @__PURE__ */ t(ee, {
|
|
3604
3610
|
htmlFor: O,
|
|
@@ -3608,12 +3614,12 @@ function fn({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
|
|
|
3608
3614
|
}),
|
|
3609
3615
|
a && s ? /* @__PURE__ */ t("div", {
|
|
3610
3616
|
id: O,
|
|
3611
|
-
className: `${
|
|
3617
|
+
className: `${fn.disabledText} ${fn[v]}`,
|
|
3612
3618
|
style: B,
|
|
3613
3619
|
"aria-describedby": P,
|
|
3614
3620
|
children: e || i
|
|
3615
3621
|
}) : /* @__PURE__ */ n("div", {
|
|
3616
|
-
className:
|
|
3622
|
+
className: fn.control,
|
|
3617
3623
|
children: [/* @__PURE__ */ t("textarea", {
|
|
3618
3624
|
ref: k,
|
|
3619
3625
|
id: O,
|
|
@@ -3628,12 +3634,12 @@ function fn({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
|
|
|
3628
3634
|
style: B,
|
|
3629
3635
|
"aria-invalid": !!u,
|
|
3630
3636
|
"aria-describedby": P,
|
|
3631
|
-
className: `${
|
|
3637
|
+
className: `${fn.textarea} ${fn[v]} ${T ? fn.autoResize : fn.manualResize} ${u ? fn.textareaError : ""}`,
|
|
3632
3638
|
onChange: R,
|
|
3633
3639
|
...E
|
|
3634
3640
|
}), y && e && !a && !o && /* @__PURE__ */ t("button", {
|
|
3635
3641
|
type: "button",
|
|
3636
|
-
className:
|
|
3642
|
+
className: fn.clearAction,
|
|
3637
3643
|
"aria-label": "Очистить поле",
|
|
3638
3644
|
onClick: z,
|
|
3639
3645
|
children: /* @__PURE__ */ t(Y, {
|
|
@@ -3644,7 +3650,7 @@ function fn({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
|
|
|
3644
3650
|
})]
|
|
3645
3651
|
}),
|
|
3646
3652
|
(p || u || M) && /* @__PURE__ */ n("div", {
|
|
3647
|
-
className:
|
|
3653
|
+
className: fn.messages,
|
|
3648
3654
|
children: [
|
|
3649
3655
|
p && !u && /* @__PURE__ */ t(N, {
|
|
3650
3656
|
id: A,
|
|
@@ -3657,7 +3663,7 @@ function fn({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
|
|
|
3657
3663
|
}),
|
|
3658
3664
|
M && /* @__PURE__ */ n("span", {
|
|
3659
3665
|
id: M,
|
|
3660
|
-
className:
|
|
3666
|
+
className: fn.counter,
|
|
3661
3667
|
children: [
|
|
3662
3668
|
e.length,
|
|
3663
3669
|
" / ",
|
|
@@ -3671,11 +3677,11 @@ function fn({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
|
|
|
3671
3677
|
}
|
|
3672
3678
|
//#endregion
|
|
3673
3679
|
//#region src/components/DSModal/modal.store.ts
|
|
3674
|
-
var
|
|
3680
|
+
var gn = 0, _n = S((e, t) => ({
|
|
3675
3681
|
modals: [],
|
|
3676
3682
|
openModal: (t, n = {}, r = {}) => {
|
|
3677
|
-
|
|
3678
|
-
let i = `ds-modal-${
|
|
3683
|
+
gn += 1;
|
|
3684
|
+
let i = `ds-modal-${gn}`;
|
|
3679
3685
|
return e((e) => ({ modals: [...e.modals, {
|
|
3680
3686
|
id: i,
|
|
3681
3687
|
name: t,
|
|
@@ -3699,10 +3705,10 @@ var pn = 0, mn = S((e, t) => ({
|
|
|
3699
3705
|
let n = t().modals;
|
|
3700
3706
|
n.length && (e({ modals: [] }), n.forEach((e) => e.onClose?.()));
|
|
3701
3707
|
}
|
|
3702
|
-
})),
|
|
3703
|
-
|
|
3704
|
-
},
|
|
3705
|
-
function
|
|
3708
|
+
})), vn = () => {
|
|
3709
|
+
_n.getState().closeAllModals(), gn = 0;
|
|
3710
|
+
}, yn = 8, bn = 96, xn = .55;
|
|
3711
|
+
function Sn(e, t, n) {
|
|
3706
3712
|
return {
|
|
3707
3713
|
startX: e,
|
|
3708
3714
|
startY: t,
|
|
@@ -3710,16 +3716,16 @@ function yn(e, t, n) {
|
|
|
3710
3716
|
intent: "pending"
|
|
3711
3717
|
};
|
|
3712
3718
|
}
|
|
3713
|
-
function
|
|
3719
|
+
function Cn(e, t, n) {
|
|
3714
3720
|
let r = t - e.startX, i = n - e.startY;
|
|
3715
|
-
return e.intent === "pending" && Math.max(Math.abs(r), Math.abs(i)) >=
|
|
3721
|
+
return e.intent === "pending" && Math.max(Math.abs(r), Math.abs(i)) >= yn && (e.intent = Math.abs(i) > Math.abs(r) ? "vertical" : "horizontal"), e.intent === "vertical" ? Math.max(0, i) : 0;
|
|
3716
3722
|
}
|
|
3717
|
-
function
|
|
3723
|
+
function wn(e, t, n) {
|
|
3718
3724
|
if (e.intent !== "vertical") return !1;
|
|
3719
3725
|
let r = Math.max(0, t - e.startY), i = Math.max(1, n - e.startTime);
|
|
3720
|
-
return r >=
|
|
3726
|
+
return r >= bn || r >= 32 && r / i >= xn;
|
|
3721
3727
|
}
|
|
3722
|
-
var
|
|
3728
|
+
var Tn = {
|
|
3723
3729
|
layer: "_layer_w9isk_1",
|
|
3724
3730
|
backdrop: "_backdrop_w9isk_15",
|
|
3725
3731
|
"backdrop-enter": "_backdrop-enter_w9isk_1",
|
|
@@ -3732,10 +3738,10 @@ var Sn = {
|
|
|
3732
3738
|
close: "_close_w9isk_141",
|
|
3733
3739
|
dragHandle: "_dragHandle_w9isk_149",
|
|
3734
3740
|
"sheet-enter": "_sheet-enter_w9isk_1"
|
|
3735
|
-
},
|
|
3736
|
-
function
|
|
3741
|
+
}, En = "button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"])", Dn = a({});
|
|
3742
|
+
function On(e) {
|
|
3737
3743
|
if (e.key !== "Tab") return;
|
|
3738
|
-
let t = Array.from(e.currentTarget.querySelectorAll(
|
|
3744
|
+
let t = Array.from(e.currentTarget.querySelectorAll(En));
|
|
3739
3745
|
if (!t.length) {
|
|
3740
3746
|
e.preventDefault();
|
|
3741
3747
|
return;
|
|
@@ -3743,18 +3749,18 @@ function Tn(e) {
|
|
|
3743
3749
|
let n = t[0], r = t.at(-1);
|
|
3744
3750
|
e.shiftKey && document.activeElement === n ? (e.preventDefault(), r?.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n?.focus());
|
|
3745
3751
|
}
|
|
3746
|
-
var
|
|
3747
|
-
let l = u(
|
|
3752
|
+
var kn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "Закрыть модальное окно", className: s = "", role: c = "dialog" }) => {
|
|
3753
|
+
let l = u(Dn), p = r ?? l.title, m = i ?? l.description, _ = f(), v = f(), y = h(null), b = h(null), x = h(null), [S, C] = g(0), [w, T] = g(!1), E = _n((e) => e.closeModal), D = l.requestClose ?? (() => E(a)), O = p != null, k = m != null;
|
|
3748
3754
|
d(() => {
|
|
3749
3755
|
let e = document.activeElement, t = y.current;
|
|
3750
|
-
return (t?.querySelector(
|
|
3756
|
+
return (t?.querySelector(En) ?? t)?.focus(), () => e?.focus();
|
|
3751
3757
|
}, []);
|
|
3752
3758
|
let A = (e) => {
|
|
3753
3759
|
e && x.current !== null && e.hasPointerCapture(x.current) && e.releasePointerCapture(x.current), b.current = null, x.current = null, T(!1), C(0);
|
|
3754
3760
|
};
|
|
3755
3761
|
return /* @__PURE__ */ n("div", {
|
|
3756
3762
|
ref: y,
|
|
3757
|
-
className: `${
|
|
3763
|
+
className: `${Tn.panel} ${s}`,
|
|
3758
3764
|
"data-closing": l.closing || void 0,
|
|
3759
3765
|
"data-dragging": w || void 0,
|
|
3760
3766
|
style: { "--ds-modal-drag-offset": `${S}px` },
|
|
@@ -3763,36 +3769,36 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3763
3769
|
"aria-labelledby": O ? _ : void 0,
|
|
3764
3770
|
"aria-describedby": k ? v : void 0,
|
|
3765
3771
|
tabIndex: -1,
|
|
3766
|
-
onKeyDown:
|
|
3772
|
+
onKeyDown: On,
|
|
3767
3773
|
children: [
|
|
3768
3774
|
/* @__PURE__ */ t("button", {
|
|
3769
3775
|
type: "button",
|
|
3770
|
-
className:
|
|
3776
|
+
className: Tn.dragHandle,
|
|
3771
3777
|
"aria-label": "Потяните вниз, чтобы закрыть модальное окно",
|
|
3772
3778
|
onPointerDown: (e) => {
|
|
3773
|
-
(e.pointerType !== "mouse" || e.button === 0) && (x.current = e.pointerId, b.current =
|
|
3779
|
+
(e.pointerType !== "mouse" || e.button === 0) && (x.current = e.pointerId, b.current = Sn(e.clientX, e.clientY, e.timeStamp), e.currentTarget.setPointerCapture(e.pointerId));
|
|
3774
3780
|
},
|
|
3775
3781
|
onPointerMove: (e) => {
|
|
3776
3782
|
if (e.pointerId !== x.current || !b.current) return;
|
|
3777
|
-
let t =
|
|
3783
|
+
let t = Cn(b.current, e.clientX, e.clientY);
|
|
3778
3784
|
b.current.intent === "vertical" && (e.preventDefault(), T(!0), C(t));
|
|
3779
3785
|
},
|
|
3780
3786
|
onPointerUp: (e) => {
|
|
3781
3787
|
if (e.pointerId !== x.current || !b.current) return;
|
|
3782
|
-
let t =
|
|
3788
|
+
let t = wn(b.current, e.clientY, e.timeStamp);
|
|
3783
3789
|
A(e.currentTarget), t && D();
|
|
3784
3790
|
},
|
|
3785
3791
|
onPointerCancel: (e) => A(e.currentTarget),
|
|
3786
3792
|
children: /* @__PURE__ */ t("span", {})
|
|
3787
3793
|
}),
|
|
3788
3794
|
(O || o) && /* @__PURE__ */ n("header", {
|
|
3789
|
-
className:
|
|
3795
|
+
className: Tn.header,
|
|
3790
3796
|
children: [O && /* @__PURE__ */ t("h2", {
|
|
3791
3797
|
id: _,
|
|
3792
|
-
className:
|
|
3798
|
+
className: Tn.title,
|
|
3793
3799
|
children: p
|
|
3794
3800
|
}), /* @__PURE__ */ t(j, {
|
|
3795
|
-
className:
|
|
3801
|
+
className: Tn.close,
|
|
3796
3802
|
variant: "empty",
|
|
3797
3803
|
size: "sm",
|
|
3798
3804
|
"aria-label": o,
|
|
@@ -3806,17 +3812,17 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3806
3812
|
}),
|
|
3807
3813
|
k && /* @__PURE__ */ t("p", {
|
|
3808
3814
|
id: v,
|
|
3809
|
-
className:
|
|
3815
|
+
className: Tn.description,
|
|
3810
3816
|
children: m
|
|
3811
3817
|
}),
|
|
3812
3818
|
/* @__PURE__ */ t("div", {
|
|
3813
|
-
className:
|
|
3819
|
+
className: Tn.content,
|
|
3814
3820
|
children: e
|
|
3815
3821
|
})
|
|
3816
3822
|
]
|
|
3817
3823
|
});
|
|
3818
|
-
},
|
|
3819
|
-
let n =
|
|
3824
|
+
}, An = ({ registry: e }) => {
|
|
3825
|
+
let n = _n((e) => e.modals), r = _n((e) => e.closeModal), [i, a] = g(() => /* @__PURE__ */ new Set()), o = h(/* @__PURE__ */ new Map()), s = (e) => {
|
|
3820
3826
|
if (o.current.has(e)) return;
|
|
3821
3827
|
a((t) => new Set(t).add(e));
|
|
3822
3828
|
let t = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
@@ -3832,7 +3838,7 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3832
3838
|
return () => e.forEach((e) => window.clearTimeout(e));
|
|
3833
3839
|
}, []), d(() => {
|
|
3834
3840
|
let e = (e) => {
|
|
3835
|
-
let t =
|
|
3841
|
+
let t = _n.getState().modals.at(-1);
|
|
3836
3842
|
e.key === "Escape" && t?.closeOnEscape && s(t.id);
|
|
3837
3843
|
};
|
|
3838
3844
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
@@ -3845,21 +3851,21 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3845
3851
|
n,
|
|
3846
3852
|
e
|
|
3847
3853
|
]), !n.length || typeof document > "u" ? null : _(/* @__PURE__ */ t("div", {
|
|
3848
|
-
className:
|
|
3854
|
+
className: Tn.layer,
|
|
3849
3855
|
"aria-label": "Модальные окна",
|
|
3850
3856
|
children: n.map((r, a) => {
|
|
3851
3857
|
let o = e[r.name];
|
|
3852
3858
|
if (!o) return null;
|
|
3853
3859
|
let c = i.has(r.id);
|
|
3854
3860
|
return /* @__PURE__ */ t("div", {
|
|
3855
|
-
className:
|
|
3861
|
+
className: Tn.backdrop,
|
|
3856
3862
|
"data-closing": c || void 0,
|
|
3857
3863
|
"aria-hidden": a !== n.length - 1 || void 0,
|
|
3858
3864
|
inert: a !== n.length - 1 || void 0,
|
|
3859
3865
|
onMouseDown: (e) => {
|
|
3860
3866
|
e.target === e.currentTarget && r.closeOnBackdrop && s(r.id);
|
|
3861
3867
|
},
|
|
3862
|
-
children: /* @__PURE__ */ t(
|
|
3868
|
+
children: /* @__PURE__ */ t(Dn.Provider, {
|
|
3863
3869
|
value: {
|
|
3864
3870
|
title: r.title ?? r.payload.title,
|
|
3865
3871
|
description: r.description ?? r.payload.description,
|
|
@@ -3876,31 +3882,31 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3876
3882
|
}, r.id);
|
|
3877
3883
|
})
|
|
3878
3884
|
}), document.body);
|
|
3879
|
-
},
|
|
3880
|
-
let o =
|
|
3885
|
+
}, jn = ({ registry: r, children: i, lockBodyScroll: a = !0 }) => {
|
|
3886
|
+
let o = _n((e) => e.modals.length);
|
|
3881
3887
|
return d(() => {
|
|
3882
3888
|
if (!a || o === 0) return;
|
|
3883
3889
|
let e = document.body.style.overflow;
|
|
3884
3890
|
return document.body.style.overflow = "hidden", () => {
|
|
3885
3891
|
document.body.style.overflow = e;
|
|
3886
3892
|
};
|
|
3887
|
-
}, [a, o]), /* @__PURE__ */ n(e, { children: [i, /* @__PURE__ */ t(
|
|
3888
|
-
},
|
|
3893
|
+
}, [a, o]), /* @__PURE__ */ n(e, { children: [i, /* @__PURE__ */ t(An, { registry: r })] });
|
|
3894
|
+
}, Mn = (e) => e, Nn = {
|
|
3889
3895
|
message: "_message_c23ie_1",
|
|
3890
3896
|
actions: "_actions_c23ie_13"
|
|
3891
|
-
},
|
|
3897
|
+
}, Pn = /* @__PURE__ */ new Map(), Fn = 0, In = ({ modalId: e, close: r, title: i = "Подтверждение", message: a = "Продолжить действие?", confirmLabel: o = "Подтвердить", cancelLabel: s = "Отмена", tone: c = "default", requestId: l }) => {
|
|
3892
3898
|
let u = (e) => {
|
|
3893
|
-
|
|
3899
|
+
Pn.get(l)?.(e), Pn.delete(l), r();
|
|
3894
3900
|
};
|
|
3895
|
-
return /* @__PURE__ */ n(
|
|
3901
|
+
return /* @__PURE__ */ n(kn, {
|
|
3896
3902
|
modalId: e,
|
|
3897
3903
|
title: i,
|
|
3898
3904
|
role: "alertdialog",
|
|
3899
3905
|
children: [/* @__PURE__ */ t("p", {
|
|
3900
|
-
className:
|
|
3906
|
+
className: Nn.message,
|
|
3901
3907
|
children: a
|
|
3902
3908
|
}), /* @__PURE__ */ n("div", {
|
|
3903
|
-
className:
|
|
3909
|
+
className: Nn.actions,
|
|
3904
3910
|
children: [/* @__PURE__ */ t(j, {
|
|
3905
3911
|
variant: "outline",
|
|
3906
3912
|
onClick: () => u(!1),
|
|
@@ -3912,46 +3918,46 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3912
3918
|
})]
|
|
3913
3919
|
})]
|
|
3914
3920
|
});
|
|
3915
|
-
},
|
|
3921
|
+
}, Ln = ({ modalId: e, close: r, title: i = "Ошибка", message: a, closeLabel: o = "Закрыть" }) => /* @__PURE__ */ n(kn, {
|
|
3916
3922
|
modalId: e,
|
|
3917
3923
|
title: i,
|
|
3918
3924
|
role: "alertdialog",
|
|
3919
3925
|
children: [/* @__PURE__ */ t("p", {
|
|
3920
|
-
className:
|
|
3926
|
+
className: Nn.message,
|
|
3921
3927
|
children: a
|
|
3922
3928
|
}), /* @__PURE__ */ t("div", {
|
|
3923
|
-
className:
|
|
3929
|
+
className: Nn.actions,
|
|
3924
3930
|
children: /* @__PURE__ */ t(j, {
|
|
3925
3931
|
onClick: r,
|
|
3926
3932
|
children: o
|
|
3927
3933
|
})
|
|
3928
3934
|
})]
|
|
3929
|
-
}),
|
|
3930
|
-
ConfirmModal:
|
|
3931
|
-
ErrorModal:
|
|
3932
|
-
}),
|
|
3933
|
-
let e =
|
|
3935
|
+
}), Rn = Mn({
|
|
3936
|
+
ConfirmModal: In,
|
|
3937
|
+
ErrorModal: Ln
|
|
3938
|
+
}), zn = () => {
|
|
3939
|
+
let e = _n((e) => e.openModal);
|
|
3934
3940
|
return (t = {}) => new Promise((n) => {
|
|
3935
|
-
|
|
3936
|
-
let r = `confirm-${
|
|
3937
|
-
|
|
3941
|
+
Fn += 1;
|
|
3942
|
+
let r = `confirm-${Fn}`;
|
|
3943
|
+
Pn.set(r, n), e("ConfirmModal", {
|
|
3938
3944
|
...t,
|
|
3939
3945
|
requestId: r
|
|
3940
3946
|
}, {
|
|
3941
3947
|
closeOnEscape: !1,
|
|
3942
3948
|
onClose: () => {
|
|
3943
|
-
|
|
3949
|
+
Pn.get(r)?.(!1), Pn.delete(r);
|
|
3944
3950
|
}
|
|
3945
3951
|
});
|
|
3946
3952
|
});
|
|
3947
|
-
},
|
|
3948
|
-
let e =
|
|
3953
|
+
}, Bn = (e) => e instanceof Error ? e.message : typeof e == "string" ? e : e && typeof e == "object" && "message" in e && typeof e.message == "string" ? e.message : "Произошла неизвестная ошибка", Vn = () => {
|
|
3954
|
+
let e = _n((e) => e.openModal);
|
|
3949
3955
|
return { showError: (t, n) => e("ErrorModal", {
|
|
3950
3956
|
title: n,
|
|
3951
|
-
message:
|
|
3957
|
+
message: Bn(t)
|
|
3952
3958
|
}) };
|
|
3953
|
-
},
|
|
3954
|
-
let e =
|
|
3959
|
+
}, Hn = S(() => ({})), Un = S(() => ({})), Wn = () => {
|
|
3960
|
+
let e = _n((e) => e.modals), t = _n((e) => e.openModal), n = _n((e) => e.closeModal), r = _n((e) => e.closeTopModal), i = _n((e) => e.closeAllModals), a = l((e, n = {}, r) => t(e, n, r), [t]), o = l((t) => e.some((e) => e.name === t), [e]);
|
|
3955
3961
|
return m(() => ({
|
|
3956
3962
|
openModal: a,
|
|
3957
3963
|
closeModal: n,
|
|
@@ -3967,7 +3973,7 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3967
3973
|
e.length,
|
|
3968
3974
|
a
|
|
3969
3975
|
]);
|
|
3970
|
-
},
|
|
3976
|
+
}, Gn = {
|
|
3971
3977
|
layer: "_layer_ct7yp_1",
|
|
3972
3978
|
backdrop: "_backdrop_ct7yp_13",
|
|
3973
3979
|
panel: "_panel_ct7yp_27",
|
|
@@ -3987,16 +3993,16 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3987
3993
|
"enter-right": "_enter-right_ct7yp_1",
|
|
3988
3994
|
"enter-left": "_enter-left_ct7yp_1",
|
|
3989
3995
|
"enter-bottom": "_enter-bottom_ct7yp_1"
|
|
3990
|
-
},
|
|
3996
|
+
}, Kn = "button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"])", qn = a(null), Jn = (e) => {
|
|
3991
3997
|
if (e.key !== "Tab") return;
|
|
3992
|
-
let t = Array.from(e.currentTarget.querySelectorAll(
|
|
3998
|
+
let t = Array.from(e.currentTarget.querySelectorAll(Kn));
|
|
3993
3999
|
if (!t.length) {
|
|
3994
4000
|
e.preventDefault();
|
|
3995
4001
|
return;
|
|
3996
4002
|
}
|
|
3997
4003
|
let n = t[0], r = t.at(-1);
|
|
3998
4004
|
e.shiftKey && document.activeElement === n ? (e.preventDefault(), r?.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus());
|
|
3999
|
-
},
|
|
4005
|
+
}, Yn = () => u(qn), Xn = ({ open: e, onCloseRequest: r, children: i, title: a, description: o, headerActions: s, footer: c, placement: l = "right", size: u = "md", closeOnEscape: p = !0, closeOnBackdrop: m = !0, preventClose: g = !1, closeLabel: v = "Закрыть", initialFocusRef: y, returnFocusRef: b, className: x = "" }) => {
|
|
4000
4006
|
let S = h(null), C = f(), w = f(), T = (e) => {
|
|
4001
4007
|
g || r(e);
|
|
4002
4008
|
};
|
|
@@ -4005,7 +4011,7 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4005
4011
|
let t = document.activeElement, n = b?.current, i = document.body.style.overflow;
|
|
4006
4012
|
document.body.style.overflow = "hidden";
|
|
4007
4013
|
let a = S.current;
|
|
4008
|
-
(y?.current ?? a?.querySelector(
|
|
4014
|
+
(y?.current ?? a?.querySelector(Kn) ?? a)?.focus();
|
|
4009
4015
|
let o = (e) => {
|
|
4010
4016
|
e.key === "Escape" && p && !g && r("escape");
|
|
4011
4017
|
};
|
|
@@ -4020,29 +4026,29 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4020
4026
|
g,
|
|
4021
4027
|
b
|
|
4022
4028
|
]), !e || typeof document > "u" ? null : _(/* @__PURE__ */ t("div", {
|
|
4023
|
-
className:
|
|
4029
|
+
className: Gn.layer,
|
|
4024
4030
|
children: /* @__PURE__ */ t("div", {
|
|
4025
|
-
className:
|
|
4031
|
+
className: Gn.backdrop,
|
|
4026
4032
|
onMouseDown: (e) => {
|
|
4027
4033
|
e.target === e.currentTarget && m && T("backdrop");
|
|
4028
4034
|
},
|
|
4029
|
-
children: /* @__PURE__ */ t(
|
|
4035
|
+
children: /* @__PURE__ */ t(qn.Provider, {
|
|
4030
4036
|
value: { requestClose: T },
|
|
4031
4037
|
children: /* @__PURE__ */ n("section", {
|
|
4032
4038
|
ref: S,
|
|
4033
|
-
className: `${
|
|
4039
|
+
className: `${Gn.panel} ${Gn[l]} ${Gn[u]} ${x}`,
|
|
4034
4040
|
role: "dialog",
|
|
4035
4041
|
"aria-modal": "true",
|
|
4036
4042
|
"aria-labelledby": a ? C : void 0,
|
|
4037
4043
|
"aria-describedby": o ? w : void 0,
|
|
4038
4044
|
tabIndex: -1,
|
|
4039
|
-
onKeyDown:
|
|
4045
|
+
onKeyDown: Jn,
|
|
4040
4046
|
children: [
|
|
4041
4047
|
/* @__PURE__ */ n("header", {
|
|
4042
|
-
className:
|
|
4048
|
+
className: Gn.header,
|
|
4043
4049
|
children: [
|
|
4044
4050
|
/* @__PURE__ */ n("div", {
|
|
4045
|
-
className:
|
|
4051
|
+
className: Gn.heading,
|
|
4046
4052
|
children: [a && /* @__PURE__ */ t("h2", {
|
|
4047
4053
|
id: C,
|
|
4048
4054
|
children: a
|
|
@@ -4052,7 +4058,7 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4052
4058
|
})]
|
|
4053
4059
|
}),
|
|
4054
4060
|
s && /* @__PURE__ */ t("div", {
|
|
4055
|
-
className:
|
|
4061
|
+
className: Gn.headerActions,
|
|
4056
4062
|
children: s
|
|
4057
4063
|
}),
|
|
4058
4064
|
/* @__PURE__ */ t(j, {
|
|
@@ -4070,11 +4076,11 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4070
4076
|
]
|
|
4071
4077
|
}),
|
|
4072
4078
|
/* @__PURE__ */ t("div", {
|
|
4073
|
-
className:
|
|
4079
|
+
className: Gn.content,
|
|
4074
4080
|
children: i
|
|
4075
4081
|
}),
|
|
4076
4082
|
c && /* @__PURE__ */ t("footer", {
|
|
4077
|
-
className:
|
|
4083
|
+
className: Gn.footer,
|
|
4078
4084
|
children: c
|
|
4079
4085
|
})
|
|
4080
4086
|
]
|
|
@@ -4082,17 +4088,17 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4082
4088
|
})
|
|
4083
4089
|
})
|
|
4084
4090
|
}), document.body);
|
|
4085
|
-
},
|
|
4091
|
+
}, Zn = ({ placement: e = "right", ...n }) => /* @__PURE__ */ t(Xn, {
|
|
4086
4092
|
...n,
|
|
4087
4093
|
placement: e
|
|
4088
|
-
}),
|
|
4094
|
+
}), Qn = (e) => /* @__PURE__ */ t(Xn, {
|
|
4089
4095
|
...e,
|
|
4090
4096
|
placement: "bottom"
|
|
4091
|
-
}),
|
|
4097
|
+
}), $n = (e) => /* @__PURE__ */ t(Xn, {
|
|
4092
4098
|
...e,
|
|
4093
4099
|
placement: "fullscreen",
|
|
4094
4100
|
size: "xl"
|
|
4095
|
-
}),
|
|
4101
|
+
}), er = {
|
|
4096
4102
|
wrapper: "_wrapper_1hyyy_1",
|
|
4097
4103
|
container: "_container_1hyyy_15",
|
|
4098
4104
|
inner: "_inner_1hyyy_35",
|
|
@@ -4107,29 +4113,29 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4107
4113
|
empty: "_empty_1hyyy_153",
|
|
4108
4114
|
destructive: "_destructive_1hyyy_161",
|
|
4109
4115
|
destructiveOutline: "_destructiveOutline_1hyyy_169"
|
|
4110
|
-
},
|
|
4111
|
-
className:
|
|
4116
|
+
}, tr = ({ variant: e = "primary" }) => /* @__PURE__ */ t("div", {
|
|
4117
|
+
className: er.wrapper,
|
|
4112
4118
|
children: /* @__PURE__ */ t("div", {
|
|
4113
|
-
className:
|
|
4119
|
+
className: er.container,
|
|
4114
4120
|
children: /* @__PURE__ */ n("div", {
|
|
4115
|
-
className:
|
|
4121
|
+
className: er.inner,
|
|
4116
4122
|
children: [
|
|
4117
4123
|
/* @__PURE__ */ t("div", {
|
|
4118
|
-
className:
|
|
4119
|
-
children: /* @__PURE__ */ t("div", { className: `${
|
|
4124
|
+
className: er.cube,
|
|
4125
|
+
children: /* @__PURE__ */ t("div", { className: `${er.cube__inner} ${er[e]}` })
|
|
4120
4126
|
}),
|
|
4121
4127
|
/* @__PURE__ */ t("div", {
|
|
4122
|
-
className:
|
|
4123
|
-
children: /* @__PURE__ */ t("div", { className: `${
|
|
4128
|
+
className: er.cube,
|
|
4129
|
+
children: /* @__PURE__ */ t("div", { className: `${er.cube__inner} ${er[e]}` })
|
|
4124
4130
|
}),
|
|
4125
4131
|
/* @__PURE__ */ t("div", {
|
|
4126
|
-
className:
|
|
4127
|
-
children: /* @__PURE__ */ t("div", { className: `${
|
|
4132
|
+
className: er.cube,
|
|
4133
|
+
children: /* @__PURE__ */ t("div", { className: `${er.cube__inner} ${er[e]}` })
|
|
4128
4134
|
})
|
|
4129
4135
|
]
|
|
4130
4136
|
})
|
|
4131
4137
|
})
|
|
4132
|
-
}),
|
|
4138
|
+
}), nr = {
|
|
4133
4139
|
viewport: "_viewport_bu4eh_1",
|
|
4134
4140
|
"top-right": "_top-right_bu4eh_21",
|
|
4135
4141
|
"top-left": "_top-left_bu4eh_31",
|
|
@@ -4145,12 +4151,12 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4145
4151
|
success: "_success_bu4eh_195",
|
|
4146
4152
|
warning: "_warning_bu4eh_203",
|
|
4147
4153
|
error: "_error_bu4eh_211"
|
|
4148
|
-
},
|
|
4154
|
+
}, rr = {
|
|
4149
4155
|
info: "IconInfoCircle",
|
|
4150
4156
|
success: "IconSuccessCircle",
|
|
4151
4157
|
warning: "IconWarning",
|
|
4152
4158
|
error: "IconWarning"
|
|
4153
|
-
},
|
|
4159
|
+
}, ir = ({ toast: e, onClose: r }) => {
|
|
4154
4160
|
let [i, a] = g(!1), [o, s] = g(() => typeof document < "u" && document.hidden), c = h(e.duration), l = h(Date.now());
|
|
4155
4161
|
return d(() => {
|
|
4156
4162
|
if (i || o || e.duration <= 0) return;
|
|
@@ -4170,7 +4176,7 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4170
4176
|
let e = () => s(document.hidden);
|
|
4171
4177
|
return document.addEventListener("visibilitychange", e), () => document.removeEventListener("visibilitychange", e);
|
|
4172
4178
|
}, []), /* @__PURE__ */ n("article", {
|
|
4173
|
-
className: `${
|
|
4179
|
+
className: `${nr.toast} ${nr[e.variant]}`,
|
|
4174
4180
|
role: e.variant === "error" ? "alert" : "status",
|
|
4175
4181
|
"aria-live": e.variant === "error" ? "assertive" : "polite",
|
|
4176
4182
|
onMouseEnter: () => a(!0),
|
|
@@ -4179,24 +4185,24 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4179
4185
|
onBlur: () => a(!1),
|
|
4180
4186
|
children: [
|
|
4181
4187
|
/* @__PURE__ */ t("div", {
|
|
4182
|
-
className:
|
|
4188
|
+
className: nr.icon,
|
|
4183
4189
|
"aria-hidden": "true",
|
|
4184
4190
|
children: /* @__PURE__ */ t(Y, {
|
|
4185
|
-
name:
|
|
4191
|
+
name: rr[e.variant],
|
|
4186
4192
|
color: "var(--ds-toast-accent)",
|
|
4187
4193
|
width: 20,
|
|
4188
4194
|
height: 20
|
|
4189
4195
|
})
|
|
4190
4196
|
}),
|
|
4191
4197
|
/* @__PURE__ */ n("div", {
|
|
4192
|
-
className:
|
|
4198
|
+
className: nr.body,
|
|
4193
4199
|
children: [
|
|
4194
4200
|
e.title && /* @__PURE__ */ t("strong", {
|
|
4195
|
-
className:
|
|
4201
|
+
className: nr.title,
|
|
4196
4202
|
children: e.title
|
|
4197
4203
|
}),
|
|
4198
4204
|
/* @__PURE__ */ t("div", {
|
|
4199
|
-
className:
|
|
4205
|
+
className: nr.message,
|
|
4200
4206
|
children: e.message
|
|
4201
4207
|
}),
|
|
4202
4208
|
e.action && /* @__PURE__ */ t(j, {
|
|
@@ -4222,15 +4228,15 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4222
4228
|
})
|
|
4223
4229
|
]
|
|
4224
4230
|
});
|
|
4225
|
-
},
|
|
4231
|
+
}, ar = 0, or = S((e, t) => ({
|
|
4226
4232
|
toasts: [],
|
|
4227
4233
|
showToast: (n) => {
|
|
4228
4234
|
if (n.dedupeKey) {
|
|
4229
4235
|
let e = t().toasts.find((e) => e.dedupeKey === n.dedupeKey);
|
|
4230
4236
|
if (e) return e.id;
|
|
4231
4237
|
}
|
|
4232
|
-
|
|
4233
|
-
let r = `ds-toast-${
|
|
4238
|
+
ar += 1;
|
|
4239
|
+
let r = `ds-toast-${ar}`;
|
|
4234
4240
|
return e((e) => ({ toasts: [...e.toasts, {
|
|
4235
4241
|
variant: "info",
|
|
4236
4242
|
duration: 5e3,
|
|
@@ -4241,18 +4247,18 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4241
4247
|
},
|
|
4242
4248
|
removeToast: (t) => e((e) => ({ toasts: e.toasts.filter((e) => e.id !== t) })),
|
|
4243
4249
|
clearToasts: () => e({ toasts: [] })
|
|
4244
|
-
})),
|
|
4245
|
-
let r =
|
|
4250
|
+
})), sr = () => or.setState({ toasts: [] }), cr = ({ position: e = "top-right", maxVisible: n }) => {
|
|
4251
|
+
let r = or((e) => e.toasts), i = or((e) => e.removeToast), a = n === void 0 ? r : r.slice(0, Math.max(0, Math.floor(n)));
|
|
4246
4252
|
return /* @__PURE__ */ t("div", {
|
|
4247
|
-
className: `${
|
|
4253
|
+
className: `${nr.viewport} ${nr[e]}`,
|
|
4248
4254
|
"aria-label": "Уведомления",
|
|
4249
|
-
children: a.map((e) => /* @__PURE__ */ t(
|
|
4255
|
+
children: a.map((e) => /* @__PURE__ */ t(ir, {
|
|
4250
4256
|
toast: e,
|
|
4251
4257
|
onClose: i
|
|
4252
4258
|
}, e.id))
|
|
4253
4259
|
});
|
|
4254
|
-
},
|
|
4255
|
-
let e =
|
|
4260
|
+
}, lr = () => {
|
|
4261
|
+
let e = or((e) => e.showToast), t = or((e) => e.removeToast), n = or((e) => e.clearToasts), r = l((t) => e({
|
|
4256
4262
|
...t,
|
|
4257
4263
|
variant: "info"
|
|
4258
4264
|
}), [e]), i = l((t) => e({
|
|
@@ -4282,24 +4288,24 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4282
4288
|
i,
|
|
4283
4289
|
a
|
|
4284
4290
|
]);
|
|
4285
|
-
},
|
|
4291
|
+
}, ur = {
|
|
4286
4292
|
root: "_root_ncmxp_1",
|
|
4287
4293
|
tooltip: "_tooltip_ncmxp_11",
|
|
4288
4294
|
"ds-tooltip-in": "_ds-tooltip-in_ncmxp_1"
|
|
4289
|
-
},
|
|
4295
|
+
}, dr = 8, fr = 16, pr = {
|
|
4290
4296
|
top: "bottom",
|
|
4291
4297
|
right: "left",
|
|
4292
4298
|
bottom: "top",
|
|
4293
4299
|
left: "right"
|
|
4294
|
-
},
|
|
4300
|
+
}, mr = (e, t, n) => e === "top" ? t.top >= n.height + dr + fr : e === "bottom" ? window.innerHeight - t.bottom >= n.height + dr + fr : e === "left" ? t.left >= n.width + dr + fr : window.innerWidth - t.right >= n.width + dr + fr, hr = (e, t, n) => {
|
|
4295
4301
|
if (!(t.bottom > 0 && t.right > 0 && t.top < window.innerHeight && t.left < window.innerWidth)) return null;
|
|
4296
|
-
let r =
|
|
4297
|
-
return r === "top" && (a = t.top - n.height -
|
|
4302
|
+
let r = mr(e, t, n) ? e : mr(pr[e], t, n) ? pr[e] : e, i = t.left + (t.width - n.width) / 2, a = t.top + (t.height - n.height) / 2;
|
|
4303
|
+
return r === "top" && (a = t.top - n.height - dr), r === "bottom" && (a = t.bottom + dr), r === "left" && (i = t.left - n.width - dr), r === "right" && (i = t.right + dr), i = Math.min(Math.max(i, fr), Math.max(fr, window.innerWidth - n.width - fr)), a = Math.min(Math.max(a, fr), Math.max(fr, window.innerHeight - n.height - fr)), {
|
|
4298
4304
|
left: i,
|
|
4299
4305
|
top: a,
|
|
4300
4306
|
visibility: "visible"
|
|
4301
4307
|
};
|
|
4302
|
-
},
|
|
4308
|
+
}, gr = ({ content: e, children: r, placement: a = "top", delay: o = 450, disabled: s = !1, maxWidth: u = 280, className: p = "" }) => {
|
|
4303
4309
|
let m = f(), [_, v] = g(!1), [y, b] = g({ visibility: "hidden" }), [x, S] = g(null), C = h(null), w = h(null), T = l(() => {
|
|
4304
4310
|
C.current && clearTimeout(C.current), C.current = null, v(!1);
|
|
4305
4311
|
}, []), E = l(() => {
|
|
@@ -4317,7 +4323,7 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4317
4323
|
let e = () => {
|
|
4318
4324
|
let e = w.current;
|
|
4319
4325
|
if (!e || !x) return;
|
|
4320
|
-
let t =
|
|
4326
|
+
let t = hr(a, e.getBoundingClientRect(), x.getBoundingClientRect());
|
|
4321
4327
|
if (!t) {
|
|
4322
4328
|
T();
|
|
4323
4329
|
return;
|
|
@@ -4354,24 +4360,24 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4354
4360
|
});
|
|
4355
4361
|
return /* @__PURE__ */ n("span", {
|
|
4356
4362
|
ref: w,
|
|
4357
|
-
className: `${
|
|
4363
|
+
className: `${ur.root} ${p}`,
|
|
4358
4364
|
onPointerDown: _ ? T : E,
|
|
4359
|
-
children: [O, _ && /* @__PURE__ */ t(
|
|
4365
|
+
children: [O, _ && /* @__PURE__ */ t(ln, { children: /* @__PURE__ */ t("span", {
|
|
4360
4366
|
ref: S,
|
|
4361
4367
|
id: m,
|
|
4362
4368
|
role: "tooltip",
|
|
4363
|
-
className:
|
|
4369
|
+
className: ur.tooltip,
|
|
4364
4370
|
style: D,
|
|
4365
4371
|
children: e
|
|
4366
4372
|
}) })]
|
|
4367
4373
|
});
|
|
4368
|
-
},
|
|
4374
|
+
}, _r = {
|
|
4369
4375
|
root: "_root_bs28m_1",
|
|
4370
4376
|
tabList: "_tabList_bs28m_11",
|
|
4371
4377
|
tab: "_tab_bs28m_11",
|
|
4372
4378
|
panels: "_panels_bs28m_127",
|
|
4373
4379
|
panel: "_panel_bs28m_127"
|
|
4374
|
-
},
|
|
4380
|
+
}, vr = ({ items: e, value: r, onChange: i, ariaLabel: a = "Вкладки", disabled: o = !1, loading: s = !1, className: c = "" }) => {
|
|
4375
4381
|
let l = `ds-tabs-${f().replace(/:/g, "")}`, u = h([]), d = o || s, p = e.findIndex((e) => e.id === r), m = e.findIndex((e) => !e.disabled), g = p >= 0 && !e[p]?.disabled ? p : m, _ = (t) => {
|
|
4376
4382
|
let n = e[t];
|
|
4377
4383
|
!n || n.disabled || d || (i(n.id), u.current[t]?.focus(), u.current[t]?.scrollIntoView({
|
|
@@ -4401,10 +4407,10 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4401
4407
|
t.preventDefault(), _(a);
|
|
4402
4408
|
};
|
|
4403
4409
|
return /* @__PURE__ */ n("div", {
|
|
4404
|
-
className: `${
|
|
4410
|
+
className: `${_r.root} ${c}`,
|
|
4405
4411
|
"aria-busy": s || void 0,
|
|
4406
4412
|
children: [/* @__PURE__ */ t("div", {
|
|
4407
|
-
className:
|
|
4413
|
+
className: _r.tabList,
|
|
4408
4414
|
role: "tablist",
|
|
4409
4415
|
"aria-label": a,
|
|
4410
4416
|
"aria-orientation": "horizontal",
|
|
@@ -4416,7 +4422,7 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4416
4422
|
u.current[n] = e;
|
|
4417
4423
|
},
|
|
4418
4424
|
id: a,
|
|
4419
|
-
className:
|
|
4425
|
+
className: _r.tab,
|
|
4420
4426
|
type: "button",
|
|
4421
4427
|
role: "tab",
|
|
4422
4428
|
"aria-selected": i,
|
|
@@ -4429,12 +4435,12 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4429
4435
|
}, e.id);
|
|
4430
4436
|
})
|
|
4431
4437
|
}), /* @__PURE__ */ t("div", {
|
|
4432
|
-
className:
|
|
4438
|
+
className: _r.panels,
|
|
4433
4439
|
children: e.map((e, n) => {
|
|
4434
4440
|
let i = e.id === r;
|
|
4435
4441
|
return /* @__PURE__ */ t("div", {
|
|
4436
4442
|
id: `${l}-panel-${n}`,
|
|
4437
|
-
className:
|
|
4443
|
+
className: _r.panel,
|
|
4438
4444
|
role: "tabpanel",
|
|
4439
4445
|
"aria-labelledby": `${l}-tab-${n}`,
|
|
4440
4446
|
tabIndex: 0,
|
|
@@ -4444,7 +4450,7 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4444
4450
|
})
|
|
4445
4451
|
})]
|
|
4446
4452
|
});
|
|
4447
|
-
},
|
|
4453
|
+
}, yr = (e) => {
|
|
4448
4454
|
if (!Number.isFinite(e) || e < 0) return "00:00";
|
|
4449
4455
|
let t = Math.floor(e), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60, a = `${String(r).padStart(2, "0")}:${String(i).padStart(2, "0")}`;
|
|
4450
4456
|
return n ? `${n}:${a}` : a;
|
|
@@ -4477,19 +4483,19 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4477
4483
|
settingsActionLabel: "_settingsActionLabel_14cqp_693",
|
|
4478
4484
|
caption: "_caption_14cqp_705",
|
|
4479
4485
|
fullscreen: "_fullscreen_14cqp_719"
|
|
4480
|
-
},
|
|
4486
|
+
}, br = 2500, xr = 5, Sr = .05, Cr = [
|
|
4481
4487
|
.5,
|
|
4482
4488
|
.75,
|
|
4483
4489
|
1,
|
|
4484
4490
|
1.25,
|
|
4485
4491
|
1.5,
|
|
4486
4492
|
2
|
|
4487
|
-
],
|
|
4493
|
+
], wr = ({ sources: r, tracks: i = [], title: a, aspectRatio: o = "16 / 9", objectFit: s = "contain", loading: c = !1, error: u, fallback: f, className: p = "", controls: m = !0, playsInline: _ = !0, ...v }) => {
|
|
4488
4494
|
let y = h(null), b = h(null), x = h(null), S = h(void 0), [C, w] = g(!1), [T, E] = g(r.length > 0), [D, O] = g(!1), [A, M] = g(!1), [ee, N] = g(!1), [P, F] = g(0), [I, L] = g(0), [R, z] = g(0), [B, V] = g(1), [H, U] = g(!!v.muted), [W, te] = g(1), [ne, re] = g(!!v.loop), [ie, ae] = g(-1), [oe, se] = g(!1), [ce, G] = g(!0), [le, ue] = g(!1), [de, K] = g(!1), fe = r.map(({ src: e, type: t }) => `${e}:${t ?? ""}`).join("|"), pe = i.map((e, t) => ({
|
|
4489
4495
|
track: e,
|
|
4490
4496
|
index: t
|
|
4491
4497
|
})).filter(({ track: e }) => e.kind === "captions" || e.kind === "subtitles"), me = u ?? (C ? "Не удалось воспроизвести видео" : void 0), he = c || T && !me && r.length > 0, ge = !he && !me && r.length === 0, _e = typeof document < "u" && "pictureInPictureEnabled" in document && document.pictureInPictureEnabled, ve = l(() => {
|
|
4492
|
-
G(!0), window.clearTimeout(S.current), A && !oe && (S.current = window.setTimeout(() => G(!1),
|
|
4498
|
+
G(!0), window.clearTimeout(S.current), A && !oe && (S.current = window.setTimeout(() => G(!1), br));
|
|
4493
4499
|
}, [A, oe]);
|
|
4494
4500
|
d(() => {
|
|
4495
4501
|
w(!1), E(r.length > 0), O(!1), M(!1), N(!1), F(0), L(0), z(0);
|
|
@@ -4548,7 +4554,7 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4548
4554
|
let t = e.target;
|
|
4549
4555
|
if (/^(INPUT|SELECT|BUTTON)$/.test(t.tagName)) return;
|
|
4550
4556
|
let n = e.key.toLowerCase();
|
|
4551
|
-
n === " " || n === "k" ? (e.preventDefault(), ye()) : n === "m" ? (e.preventDefault(), be()) : n === "f" ? (e.preventDefault(), Ce()) : n === "c" && pe.length ? (e.preventDefault(), Te(ie === -1 ? pe[0].index : -1)) : e.key === "ArrowLeft" || e.key === "ArrowRight" ? (e.preventDefault(), Se(P + (e.key === "ArrowRight" ?
|
|
4557
|
+
n === " " || n === "k" ? (e.preventDefault(), ye()) : n === "m" ? (e.preventDefault(), be()) : n === "f" ? (e.preventDefault(), Ce()) : n === "c" && pe.length ? (e.preventDefault(), Te(ie === -1 ? pe[0].index : -1)) : e.key === "ArrowLeft" || e.key === "ArrowRight" ? (e.preventDefault(), Se(P + (e.key === "ArrowRight" ? xr : -5))) : e.key === "ArrowUp" || e.key === "ArrowDown" ? (e.preventDefault(), xe(B + (e.key === "ArrowUp" ? Sr : -.05))) : e.key === "Escape" && se(!1), ve();
|
|
4552
4558
|
}, q = () => {
|
|
4553
4559
|
let e = x.current;
|
|
4554
4560
|
w(!1), E(!0), e?.load();
|
|
@@ -4647,7 +4653,7 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4647
4653
|
"aria-hidden": "true",
|
|
4648
4654
|
children: /* @__PURE__ */ t("div", {
|
|
4649
4655
|
className: $.loaderScale,
|
|
4650
|
-
children: /* @__PURE__ */ t(
|
|
4656
|
+
children: /* @__PURE__ */ t(tr, {})
|
|
4651
4657
|
})
|
|
4652
4658
|
}), /* @__PURE__ */ t("span", { children: "Загрузка видео" })]
|
|
4653
4659
|
}),
|
|
@@ -4715,7 +4721,7 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4715
4721
|
let t = Number(e.target.value);
|
|
4716
4722
|
x.current && (x.current.playbackRate = t);
|
|
4717
4723
|
},
|
|
4718
|
-
children:
|
|
4724
|
+
children: Cr.map((e) => /* @__PURE__ */ n("option", {
|
|
4719
4725
|
value: e,
|
|
4720
4726
|
children: [e, "×"]
|
|
4721
4727
|
}, e))
|
|
@@ -4802,7 +4808,7 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4802
4808
|
children: [
|
|
4803
4809
|
/* @__PURE__ */ t("span", {
|
|
4804
4810
|
className: $.time,
|
|
4805
|
-
children:
|
|
4811
|
+
children: yr(P)
|
|
4806
4812
|
}),
|
|
4807
4813
|
/* @__PURE__ */ t("input", {
|
|
4808
4814
|
className: $.timeline,
|
|
@@ -4813,12 +4819,12 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4813
4819
|
step: .01,
|
|
4814
4820
|
value: Math.min(P, I || 0),
|
|
4815
4821
|
"aria-label": "Позиция воспроизведения",
|
|
4816
|
-
"aria-valuetext": `${
|
|
4822
|
+
"aria-valuetext": `${yr(P)} из ${yr(I)}`,
|
|
4817
4823
|
onChange: (e) => Se(Number(e.target.value))
|
|
4818
4824
|
}),
|
|
4819
4825
|
/* @__PURE__ */ t("span", {
|
|
4820
4826
|
className: $.time,
|
|
4821
|
-
children:
|
|
4827
|
+
children: yr(I)
|
|
4822
4828
|
})
|
|
4823
4829
|
]
|
|
4824
4830
|
}),
|
|
@@ -4858,7 +4864,7 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4858
4864
|
children: a
|
|
4859
4865
|
})]
|
|
4860
4866
|
});
|
|
4861
|
-
},
|
|
4867
|
+
}, Tr = {
|
|
4862
4868
|
root: "_root_ymidq_1",
|
|
4863
4869
|
trigger: "_trigger_ymidq_15",
|
|
4864
4870
|
heading: "_heading_ymidq_41",
|
|
@@ -4868,7 +4874,7 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4868
4874
|
open: "_open_ymidq_91",
|
|
4869
4875
|
content: "_content_ymidq_99",
|
|
4870
4876
|
contentInner: "_contentInner_ymidq_119"
|
|
4871
|
-
},
|
|
4877
|
+
}, Er = (e, t, n, r = 16) => {
|
|
4872
4878
|
if (t > Math.max(0, n - r * 2)) {
|
|
4873
4879
|
let t = e - r;
|
|
4874
4880
|
return Math.abs(t) <= 1 ? {
|
|
@@ -4890,7 +4896,7 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4890
4896
|
alignment: "none",
|
|
4891
4897
|
delta: 0
|
|
4892
4898
|
};
|
|
4893
|
-
},
|
|
4899
|
+
}, Dr = ({ title: e, subtitle: r, children: i, defaultOpen: a = !1, open: o, onOpenChange: s, autoScrollOnOpen: c = !0, scrollOffset: l = 16, className: u = "" }) => {
|
|
4894
4900
|
let p = f(), [m, _] = g(a), v = o ?? m, y = h(null), b = h(null), x = h(v);
|
|
4895
4901
|
return d(() => {
|
|
4896
4902
|
let e = x.current;
|
|
@@ -4900,7 +4906,7 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4900
4906
|
let r = !1, i = () => {
|
|
4901
4907
|
if (r) return;
|
|
4902
4908
|
r = !0;
|
|
4903
|
-
let e = t.getBoundingClientRect(), n =
|
|
4909
|
+
let e = t.getBoundingClientRect(), n = Er(e.top, e.height, window.innerHeight, l);
|
|
4904
4910
|
if (n.alignment === "none") return;
|
|
4905
4911
|
let i = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
|
4906
4912
|
window.scrollBy({
|
|
@@ -4921,10 +4927,10 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4921
4927
|
l
|
|
4922
4928
|
]), /* @__PURE__ */ n("section", {
|
|
4923
4929
|
ref: y,
|
|
4924
|
-
className: `${
|
|
4930
|
+
className: `${Tr.root} ${v ? Tr.open : ""} ${u}`,
|
|
4925
4931
|
children: [/* @__PURE__ */ n("button", {
|
|
4926
4932
|
type: "button",
|
|
4927
|
-
className:
|
|
4933
|
+
className: Tr.trigger,
|
|
4928
4934
|
"aria-expanded": v,
|
|
4929
4935
|
"aria-controls": p,
|
|
4930
4936
|
onClick: () => {
|
|
@@ -4932,16 +4938,16 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4932
4938
|
o === void 0 && _(e), s?.(e);
|
|
4933
4939
|
},
|
|
4934
4940
|
children: [/* @__PURE__ */ n("span", {
|
|
4935
|
-
className:
|
|
4941
|
+
className: Tr.heading,
|
|
4936
4942
|
children: [/* @__PURE__ */ t("span", {
|
|
4937
|
-
className:
|
|
4943
|
+
className: Tr.title,
|
|
4938
4944
|
children: e
|
|
4939
4945
|
}), r && /* @__PURE__ */ t("span", {
|
|
4940
|
-
className:
|
|
4946
|
+
className: Tr.subtitle,
|
|
4941
4947
|
children: r
|
|
4942
4948
|
})]
|
|
4943
4949
|
}), /* @__PURE__ */ t("span", {
|
|
4944
|
-
className:
|
|
4950
|
+
className: Tr.icon,
|
|
4945
4951
|
"aria-hidden": "true",
|
|
4946
4952
|
children: /* @__PURE__ */ t(Y, {
|
|
4947
4953
|
name: "IconChevron",
|
|
@@ -4952,15 +4958,15 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4952
4958
|
}), /* @__PURE__ */ t("div", {
|
|
4953
4959
|
ref: b,
|
|
4954
4960
|
id: p,
|
|
4955
|
-
className:
|
|
4961
|
+
className: Tr.content,
|
|
4956
4962
|
"aria-hidden": !v,
|
|
4957
4963
|
children: /* @__PURE__ */ t("div", {
|
|
4958
|
-
className:
|
|
4964
|
+
className: Tr.contentInner,
|
|
4959
4965
|
children: i
|
|
4960
4966
|
})
|
|
4961
4967
|
})]
|
|
4962
4968
|
});
|
|
4963
|
-
},
|
|
4969
|
+
}, Or = {
|
|
4964
4970
|
root: "_root_14ewt_1",
|
|
4965
4971
|
topSlot: "_topSlot_14ewt_29",
|
|
4966
4972
|
searchSlot: "_searchSlot_14ewt_31",
|
|
@@ -4978,14 +4984,14 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4978
4984
|
description: "_description_14ewt_235",
|
|
4979
4985
|
badge: "_badge_14ewt_269",
|
|
4980
4986
|
empty: "_empty_14ewt_281"
|
|
4981
|
-
},
|
|
4987
|
+
}, kr = (e, t, n) => {
|
|
4982
4988
|
if (e.length === 0) return -1;
|
|
4983
4989
|
for (let r = 1; r <= e.length; r += 1) {
|
|
4984
4990
|
let i = (t + n * r + e.length) % e.length;
|
|
4985
4991
|
if (!e[i]?.disabled) return i;
|
|
4986
4992
|
}
|
|
4987
4993
|
return -1;
|
|
4988
|
-
},
|
|
4994
|
+
}, Ar = ({ groups: r, currentItemId: i, ariaLabel: a = "Основная навигация", searchSlot: o, topSlot: s, bottomSlot: c, emptyState: l, renderLink: u, onItemSelect: d, className: p = "" }) => {
|
|
4989
4995
|
let m = f(), g = h(null), _ = h({
|
|
4990
4996
|
value: "",
|
|
4991
4997
|
time: 0
|
|
@@ -4997,7 +5003,7 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4997
5003
|
let n = v.findIndex((e) => e.id === t.id);
|
|
4998
5004
|
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
4999
5005
|
e.preventDefault();
|
|
5000
|
-
let t =
|
|
5006
|
+
let t = kr(v, n, e.key === "ArrowDown" ? 1 : -1);
|
|
5001
5007
|
x(v[t]);
|
|
5002
5008
|
return;
|
|
5003
5009
|
}
|
|
@@ -5017,26 +5023,26 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
5017
5023
|
let a = r.id === i, o = {
|
|
5018
5024
|
children: /* @__PURE__ */ n(e, { children: [
|
|
5019
5025
|
r.icon && /* @__PURE__ */ t("span", {
|
|
5020
|
-
className:
|
|
5026
|
+
className: Or.icon,
|
|
5021
5027
|
"aria-hidden": "true",
|
|
5022
5028
|
children: r.icon
|
|
5023
5029
|
}),
|
|
5024
5030
|
/* @__PURE__ */ n("span", {
|
|
5025
|
-
className:
|
|
5031
|
+
className: Or.copy,
|
|
5026
5032
|
children: [/* @__PURE__ */ t("span", {
|
|
5027
|
-
className:
|
|
5033
|
+
className: Or.label,
|
|
5028
5034
|
children: r.label
|
|
5029
5035
|
}), r.description && /* @__PURE__ */ t("span", {
|
|
5030
|
-
className:
|
|
5036
|
+
className: Or.description,
|
|
5031
5037
|
children: r.description
|
|
5032
5038
|
})]
|
|
5033
5039
|
}),
|
|
5034
5040
|
r.badge && /* @__PURE__ */ t("span", {
|
|
5035
|
-
className:
|
|
5041
|
+
className: Or.badge,
|
|
5036
5042
|
children: r.badge
|
|
5037
5043
|
})
|
|
5038
5044
|
] }),
|
|
5039
|
-
className: `${
|
|
5045
|
+
className: `${Or.link} ${a ? Or.current : ""}`,
|
|
5040
5046
|
tabIndex: r.id === b ? 0 : -1,
|
|
5041
5047
|
"aria-current": a ? "page" : void 0,
|
|
5042
5048
|
"aria-disabled": r.disabled ? !0 : void 0,
|
|
@@ -5052,7 +5058,7 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
5052
5058
|
onKeyDown: (e) => S(e, r)
|
|
5053
5059
|
};
|
|
5054
5060
|
return /* @__PURE__ */ t("li", {
|
|
5055
|
-
className:
|
|
5061
|
+
className: Or.item,
|
|
5056
5062
|
children: u ? u(r, o) : r.href ? /* @__PURE__ */ t("a", {
|
|
5057
5063
|
href: r.href,
|
|
5058
5064
|
...o,
|
|
@@ -5067,45 +5073,45 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
5067
5073
|
};
|
|
5068
5074
|
return /* @__PURE__ */ n("nav", {
|
|
5069
5075
|
ref: g,
|
|
5070
|
-
className: `${
|
|
5076
|
+
className: `${Or.root} ${p}`,
|
|
5071
5077
|
"aria-label": a,
|
|
5072
5078
|
children: [
|
|
5073
5079
|
s && /* @__PURE__ */ t("div", {
|
|
5074
|
-
className:
|
|
5080
|
+
className: Or.topSlot,
|
|
5075
5081
|
children: s
|
|
5076
5082
|
}),
|
|
5077
5083
|
o && /* @__PURE__ */ t("div", {
|
|
5078
|
-
className:
|
|
5084
|
+
className: Or.searchSlot,
|
|
5079
5085
|
children: o
|
|
5080
5086
|
}),
|
|
5081
5087
|
/* @__PURE__ */ n("div", {
|
|
5082
|
-
className:
|
|
5088
|
+
className: Or.groups,
|
|
5083
5089
|
children: [r.map((e) => {
|
|
5084
5090
|
let r = `${m}-${e.id}`;
|
|
5085
5091
|
return /* @__PURE__ */ n("section", {
|
|
5086
|
-
className:
|
|
5092
|
+
className: Or.group,
|
|
5087
5093
|
"aria-labelledby": e.label ? r : void 0,
|
|
5088
5094
|
children: [e.label && /* @__PURE__ */ t("div", {
|
|
5089
5095
|
id: r,
|
|
5090
|
-
className:
|
|
5096
|
+
className: Or.groupLabel,
|
|
5091
5097
|
children: e.label
|
|
5092
5098
|
}), /* @__PURE__ */ t("ul", {
|
|
5093
|
-
className:
|
|
5099
|
+
className: Or.list,
|
|
5094
5100
|
children: e.items.map(C)
|
|
5095
5101
|
})]
|
|
5096
5102
|
}, e.id);
|
|
5097
5103
|
}), v.length === 0 && l && /* @__PURE__ */ t("div", {
|
|
5098
|
-
className:
|
|
5104
|
+
className: Or.empty,
|
|
5099
5105
|
children: l
|
|
5100
5106
|
})]
|
|
5101
5107
|
}),
|
|
5102
5108
|
c && /* @__PURE__ */ t("div", {
|
|
5103
|
-
className:
|
|
5109
|
+
className: Or.bottomSlot,
|
|
5104
5110
|
children: c
|
|
5105
5111
|
})
|
|
5106
5112
|
]
|
|
5107
5113
|
});
|
|
5108
|
-
},
|
|
5114
|
+
}, jr = {
|
|
5109
5115
|
root: "_root_2mdgb_1",
|
|
5110
5116
|
list: "_list_2mdgb_19",
|
|
5111
5117
|
item: "_item_2mdgb_37",
|
|
@@ -5115,7 +5121,7 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
5115
5121
|
icon: "_icon_2mdgb_141",
|
|
5116
5122
|
badge: "_badge_2mdgb_149",
|
|
5117
5123
|
label: "_label_2mdgb_163"
|
|
5118
|
-
},
|
|
5124
|
+
}, Mr = ({ items: r, currentItemId: i, ariaLabel: a = "Мобильная навигация", renderLink: o, onItemSelect: s, className: c = "" }) => {
|
|
5119
5125
|
let l = h(null), u = r.filter((e) => !e.disabled), d = u.some((e) => e.id === i) ? i : u[0]?.id, f = (e) => {
|
|
5120
5126
|
l.current?.querySelectorAll("[data-ds-navigation-item]")[e]?.focus();
|
|
5121
5127
|
}, p = (e, t) => {
|
|
@@ -5132,27 +5138,27 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
5132
5138
|
};
|
|
5133
5139
|
return /* @__PURE__ */ t("nav", {
|
|
5134
5140
|
ref: l,
|
|
5135
|
-
className: `${
|
|
5141
|
+
className: `${jr.root} ${c}`,
|
|
5136
5142
|
"aria-label": a,
|
|
5137
5143
|
children: /* @__PURE__ */ t("ul", {
|
|
5138
|
-
className:
|
|
5144
|
+
className: jr.list,
|
|
5139
5145
|
children: r.map((r) => {
|
|
5140
5146
|
let a = r.id === i, c = {
|
|
5141
5147
|
children: /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ n("span", {
|
|
5142
|
-
className:
|
|
5148
|
+
className: jr.visual,
|
|
5143
5149
|
children: [r.icon && /* @__PURE__ */ t("span", {
|
|
5144
|
-
className:
|
|
5150
|
+
className: jr.icon,
|
|
5145
5151
|
"aria-hidden": "true",
|
|
5146
5152
|
children: r.icon
|
|
5147
5153
|
}), r.badge && /* @__PURE__ */ t("span", {
|
|
5148
|
-
className:
|
|
5154
|
+
className: jr.badge,
|
|
5149
5155
|
children: r.badge
|
|
5150
5156
|
})]
|
|
5151
5157
|
}), /* @__PURE__ */ t("span", {
|
|
5152
|
-
className:
|
|
5158
|
+
className: jr.label,
|
|
5153
5159
|
children: r.label
|
|
5154
5160
|
})] }),
|
|
5155
|
-
className: `${
|
|
5161
|
+
className: `${jr.link} ${a ? jr.current : ""}`,
|
|
5156
5162
|
tabIndex: r.id === d ? 0 : -1,
|
|
5157
5163
|
"aria-current": a ? "page" : void 0,
|
|
5158
5164
|
"aria-disabled": r.disabled ? !0 : void 0,
|
|
@@ -5168,7 +5174,7 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
5168
5174
|
onKeyDown: (e) => p(e, r)
|
|
5169
5175
|
};
|
|
5170
5176
|
return /* @__PURE__ */ t("li", {
|
|
5171
|
-
className:
|
|
5177
|
+
className: jr.item,
|
|
5172
5178
|
children: o ? o(r, c) : r.href ? /* @__PURE__ */ t("a", {
|
|
5173
5179
|
href: r.href,
|
|
5174
5180
|
...c,
|
|
@@ -5185,4 +5191,4 @@ var En = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
5185
5191
|
});
|
|
5186
5192
|
};
|
|
5187
5193
|
//#endregion
|
|
5188
|
-
export {
|
|
5194
|
+
export { In as ConfirmModal, Dr as DSAccordion, w as DSBadge, Mr as DSBottomNavigation, Qn as DSBottomSheet, j as DSButton, Ne as DSCheckbox, D as DSCounterBadge, zt as DSDataTable, nt as DSDateRange, $e as DSDateTimePicker, Zn as DSDrawer, ut as DSDropDown, yt as DSDropDownMultiple, ee as DSFieldLabel, N as DSFieldMessage, cn as DSFileInput, Qt as DSFilters, dn as DSFloatingMenu, en as DSFormGrid, tn as DSFormGridItem, $n as DSFullscreenDialog, Y as DSIcon, je as DSIconNames, Xt as DSInfoBlock, mt as DSInput, k as DSLoader, An as DSModal, kn as DSModalFrame, Ar as DSNavigationSurface, Xn as DSOverlay, tr as DSPageLoader, ln as DSPortal, xt as DSRadioButton, Jt as DSSearchDropDown, it as DSSkeleton, ft as DSSort, vr as DSTabs, hn as DSTextarea, ir as DSToast, cr as DSToastProvider, gr as DSTooltip, nn as DSValidationSummary, wr as DSVideoPlayerFrame, Ln as ErrorModal, jn as ModalSystemProvider, Rn as builtInModalRegistry, Mn as defineModalRegistry, E as formatDSCounterValue, ze as formatDateInputValue, Ge as formatDateTimeLocalValue, Er as getDSAccordionScrollTarget, Dt as getDSDataTableColumnStyle, kt as getDSDataTablePaginationItems, Ot as getDSDataTableStickyColumnStyle, Bn as getErrorMessage, Et as getNextDSDataTablePageSelection, ct as getNextEnabledOptionIndex, He as isValidDateInputPrefix, tt as isValidDateRange, Be as maskDateInputValue, Ue as parseDateInputValue, Ke as parseDateTimeLocalValue, vn as resetModalStore, sr as resetToastStore, zn as useConfirmModal, Hn as useConfirmModalStore, Yn as useDSOverlay, Vn as useErrorModal, Un as useErrorModalStore, Wn as useModals, _n as useModalsStore, lr as useToast, or as useToastStore, At as validateDSDataTableData };
|