@efficiency-point/design-system 0.1.36 → 0.1.37
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/DSIcon/source/IconBedDouble.d.ts +4 -0
- package/dist/components/DSIcon/source/IconBedDouble.d.ts.map +1 -0
- package/dist/components/DSIcon/source/index.d.ts +1 -0
- package/dist/components/DSIcon/source/index.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.es.js +489 -484
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -149,54 +149,58 @@ var M = {
|
|
|
149
149
|
}), F = (e) => /* @__PURE__ */ t(P, {
|
|
150
150
|
...e,
|
|
151
151
|
children: /* @__PURE__ */ t("path", { d: "M4 7h16l-1 13H5L4 7zm3 0V4h10v3" })
|
|
152
|
-
}), I = (e) => /* @__PURE__ */
|
|
152
|
+
}), I = ({ strokeWidth: e = 2, ...r }) => /* @__PURE__ */ n(P, {
|
|
153
|
+
strokeWidth: e,
|
|
154
|
+
...r,
|
|
155
|
+
children: [/* @__PURE__ */ t("path", { d: "M2 20v-8a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v8" }), /* @__PURE__ */ t("path", { d: "M4 10V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v4M12 4v6M2 18h20M5 18v2M19 18v2" })]
|
|
156
|
+
}), L = (e) => /* @__PURE__ */ t(P, {
|
|
153
157
|
...e,
|
|
154
158
|
children: /* @__PURE__ */ t("path", { d: "m5 12 4 4L19 6" })
|
|
155
|
-
}),
|
|
159
|
+
}), R = (e) => /* @__PURE__ */ t(P, {
|
|
156
160
|
viewBox: "0 0 20 20",
|
|
157
161
|
...e,
|
|
158
162
|
children: /* @__PURE__ */ t("path", { d: "M5 7.5L10 12.5L15 7.5" })
|
|
159
|
-
}),
|
|
163
|
+
}), z = ({ strokeWidth: e = 2, ...n }) => /* @__PURE__ */ t(P, {
|
|
160
164
|
strokeWidth: e,
|
|
161
165
|
...n,
|
|
162
166
|
children: /* @__PURE__ */ t("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
163
|
-
}),
|
|
167
|
+
}), B = (e) => /* @__PURE__ */ t(P, {
|
|
164
168
|
...e,
|
|
165
169
|
children: /* @__PURE__ */ t("path", { d: "M4 20h4L19 9l-4-4L4 16v4z" })
|
|
166
|
-
}),
|
|
170
|
+
}), te = (e) => /* @__PURE__ */ n(P, {
|
|
167
171
|
...e,
|
|
168
172
|
children: [/* @__PURE__ */ t("circle", {
|
|
169
173
|
cx: "12",
|
|
170
174
|
cy: "12",
|
|
171
175
|
r: "10"
|
|
172
176
|
}), /* @__PURE__ */ t("path", { d: "m15 9-6 6M9 9l6 6" })]
|
|
173
|
-
}),
|
|
177
|
+
}), V = (e) => /* @__PURE__ */ n(P, {
|
|
174
178
|
...e,
|
|
175
179
|
children: [/* @__PURE__ */ t("path", { d: "M3 12s3.5-5 9-5 9 5 9 5-3.5 5-9 5-9-5-9-5Z" }), /* @__PURE__ */ t("circle", {
|
|
176
180
|
cx: "12",
|
|
177
181
|
cy: "12",
|
|
178
182
|
r: "2.5"
|
|
179
183
|
})]
|
|
180
|
-
}),
|
|
184
|
+
}), H = (e) => /* @__PURE__ */ t(P, {
|
|
181
185
|
...e,
|
|
182
186
|
children: /* @__PURE__ */ t("path", { d: "M3 3l18 18M10.6 10.7a2 2 0 0 0 2.7 2.7M9.9 4.2A10.7 10.7 0 0 1 12 4c5.5 0 9 5.3 9 5.3a14 14 0 0 1-2.3 2.8M6.6 6.6C4.3 8.1 3 10 3 10s3.5 5 9 5c1 0 2-.2 2.8-.5" })
|
|
183
|
-
}),
|
|
187
|
+
}), U = (e) => /* @__PURE__ */ t(P, {
|
|
184
188
|
...e,
|
|
185
189
|
children: /* @__PURE__ */ t("path", { d: "M12 10v7m0-10v.01" })
|
|
186
|
-
}),
|
|
190
|
+
}), ne = (e) => /* @__PURE__ */ n(P, {
|
|
187
191
|
...e,
|
|
188
192
|
children: [/* @__PURE__ */ t("circle", {
|
|
189
193
|
cx: "12",
|
|
190
194
|
cy: "12",
|
|
191
195
|
r: "10"
|
|
192
196
|
}), /* @__PURE__ */ t("path", { d: "M12 16v-4M12 8v.01" })]
|
|
193
|
-
}),
|
|
197
|
+
}), re = (e) => /* @__PURE__ */ t(P, {
|
|
194
198
|
...e,
|
|
195
199
|
children: /* @__PURE__ */ t("path", { d: "M5 12h14" })
|
|
196
|
-
}),
|
|
200
|
+
}), ie = (e) => /* @__PURE__ */ t(P, {
|
|
197
201
|
...e,
|
|
198
202
|
children: /* @__PURE__ */ t("path", { d: "M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01" })
|
|
199
|
-
}),
|
|
203
|
+
}), ae = (e) => /* @__PURE__ */ n(P, {
|
|
200
204
|
...e,
|
|
201
205
|
children: [/* @__PURE__ */ t("rect", {
|
|
202
206
|
width: "18",
|
|
@@ -205,67 +209,67 @@ var M = {
|
|
|
205
209
|
y: "3",
|
|
206
210
|
rx: "2"
|
|
207
211
|
}), /* @__PURE__ */ t("path", { d: "M3 9h18M9 21V9" })]
|
|
208
|
-
}),
|
|
212
|
+
}), oe = (e) => /* @__PURE__ */ t(P, {
|
|
209
213
|
...e,
|
|
210
214
|
children: /* @__PURE__ */ t("path", {
|
|
211
215
|
d: "M8 5v14M16 5v14",
|
|
212
216
|
strokeWidth: "3"
|
|
213
217
|
})
|
|
214
|
-
}),
|
|
218
|
+
}), se = ({ strokeWidth: e = 2, ...n }) => /* @__PURE__ */ t(P, {
|
|
215
219
|
strokeWidth: e,
|
|
216
220
|
...n,
|
|
217
221
|
children: /* @__PURE__ */ t("path", { d: "M12 5v14M5 12h14" })
|
|
218
|
-
}),
|
|
222
|
+
}), ce = (e) => /* @__PURE__ */ t(P, {
|
|
219
223
|
...e,
|
|
220
224
|
children: /* @__PURE__ */ t("path", { d: "M3 5h18v14H3V5Zm10 7h6v5h-6v-5Z" })
|
|
221
|
-
}),
|
|
225
|
+
}), le = (e) => /* @__PURE__ */ t(P, {
|
|
222
226
|
...e,
|
|
223
227
|
children: /* @__PURE__ */ t("path", {
|
|
224
228
|
d: "m8 5 11 7-11 7V5Z",
|
|
225
229
|
fill: "currentColor",
|
|
226
230
|
stroke: "none"
|
|
227
231
|
})
|
|
228
|
-
}),
|
|
232
|
+
}), W = (e) => /* @__PURE__ */ t(P, {
|
|
229
233
|
...e,
|
|
230
234
|
children: /* @__PURE__ */ t("path", { d: "M4 7v5h5M5.5 11a7 7 0 1 1 1.3 6.3" })
|
|
231
|
-
}),
|
|
235
|
+
}), ue = (e) => /* @__PURE__ */ t(P, {
|
|
232
236
|
...e,
|
|
233
237
|
children: /* @__PURE__ */ t("path", { d: "M12 8.5a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7Zm7.4 5.2.1-1.7-.1-1.7 2-1.5-2-3.4-2.4 1a8 8 0 0 0-2.9-1.7L13.8 2h-3.9l-.4 2.7a8 8 0 0 0-2.8 1.7l-2.5-1-2 3.4 2.1 1.5-.1 1.7.1 1.7-2.1 1.5 2 3.4 2.5-1a8 8 0 0 0 2.8 1.7l.4 2.7h3.9l.3-2.7a8 8 0 0 0 2.9-1.7l2.4 1 2-3.4-2-1.5Z" })
|
|
234
|
-
}),
|
|
238
|
+
}), de = (e) => /* @__PURE__ */ t(P, {
|
|
235
239
|
...e,
|
|
236
240
|
children: /* @__PURE__ */ t("path", { d: "M9 4H4v5m11-5h5v5M9 20H4v-5m11 5h5v-5" })
|
|
237
|
-
}),
|
|
241
|
+
}), fe = (e) => /* @__PURE__ */ t(P, {
|
|
238
242
|
...e,
|
|
239
243
|
children: /* @__PURE__ */ t("path", { d: "M4 9h5V4m6 5h5V4M4 15h5v5m6-5h5v5" })
|
|
240
|
-
}),
|
|
244
|
+
}), pe = (e) => /* @__PURE__ */ t(P, {
|
|
241
245
|
...e,
|
|
242
246
|
children: /* @__PURE__ */ t("path", { d: "M4 6h16v12H4V6Zm7 4a2 2 0 1 0 0 4m7-4a2 2 0 1 0 0 4" })
|
|
243
|
-
}),
|
|
247
|
+
}), me = (e) => /* @__PURE__ */ t(P, {
|
|
244
248
|
...e,
|
|
245
249
|
children: /* @__PURE__ */ t("path", { d: "M5 10v4h4l5 4V6l-5 4H5Zm12-1c1.3 1.5 1.3 4.5 0 6m2.5-8.5c3 3 3 8 0 11" })
|
|
246
|
-
}),
|
|
250
|
+
}), G = (e) => /* @__PURE__ */ t(P, {
|
|
247
251
|
...e,
|
|
248
252
|
children: /* @__PURE__ */ t("path", { d: "M5 10v4h4l5 4V6l-5 4H5Zm12 0 4 4m0-4-4 4" })
|
|
249
|
-
}),
|
|
253
|
+
}), he = (e) => /* @__PURE__ */ t(P, {
|
|
250
254
|
...e,
|
|
251
255
|
children: /* @__PURE__ */ t("path", { d: "M8 17V5m-3 3 3-3 3 3M16 7v12m-3-3 3 3 3-3" })
|
|
252
|
-
}),
|
|
256
|
+
}), ge = (e) => /* @__PURE__ */ t(P, {
|
|
253
257
|
...e,
|
|
254
258
|
children: /* @__PURE__ */ t("path", { d: "M12 19V5m-5 5 5-5 5 5" })
|
|
255
|
-
}),
|
|
259
|
+
}), _e = (e) => /* @__PURE__ */ t(P, {
|
|
256
260
|
...e,
|
|
257
261
|
children: /* @__PURE__ */ t("path", { d: "M12 5v14m-5-5 5 5 5-5" })
|
|
258
|
-
}),
|
|
262
|
+
}), ve = (e) => /* @__PURE__ */ n(P, {
|
|
259
263
|
...e,
|
|
260
264
|
children: [/* @__PURE__ */ t("circle", {
|
|
261
265
|
cx: "12",
|
|
262
266
|
cy: "12",
|
|
263
267
|
r: "10"
|
|
264
268
|
}), /* @__PURE__ */ t("path", { d: "m9 12 2 2 4-4" })]
|
|
265
|
-
}),
|
|
269
|
+
}), ye = (e) => /* @__PURE__ */ t(P, {
|
|
266
270
|
...e,
|
|
267
271
|
children: /* @__PURE__ */ t("path", { d: "M12 19V5m-5 5 5-5 5 5" })
|
|
268
|
-
}),
|
|
272
|
+
}), be = (e) => /* @__PURE__ */ n(P, {
|
|
269
273
|
...e,
|
|
270
274
|
children: [/* @__PURE__ */ t("path", { d: "M12 3.5L21 19H3L12 3.5Z" }), /* @__PURE__ */ t("path", { d: "M12 9v4.5M12 16.5v.01" })]
|
|
271
275
|
}), K = (e) => (n) => /* @__PURE__ */ t(P, {
|
|
@@ -274,7 +278,7 @@ var M = {
|
|
|
274
278
|
...t,
|
|
275
279
|
key: t.key ?? `${e}-${n}`
|
|
276
280
|
}))
|
|
277
|
-
}),
|
|
281
|
+
}), xe = {
|
|
278
282
|
IconActivity: K([["path", {
|
|
279
283
|
d: "M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",
|
|
280
284
|
key: "169zse"
|
|
@@ -325,6 +329,7 @@ var M = {
|
|
|
325
329
|
["path", { d: "M13 17V5" }],
|
|
326
330
|
["path", { d: "M8 17v-3" }]
|
|
327
331
|
]),
|
|
332
|
+
IconBedDouble: I,
|
|
328
333
|
IconBell: K([["path", {
|
|
329
334
|
d: "M10.268 21a2 2 0 0 0 3.464 0",
|
|
330
335
|
key: "vwvbt9"
|
|
@@ -929,39 +934,39 @@ var M = {
|
|
|
929
934
|
key: "d8bk6v"
|
|
930
935
|
}]]),
|
|
931
936
|
IconBasket: F,
|
|
932
|
-
IconCheck:
|
|
933
|
-
IconChevron:
|
|
934
|
-
IconCross:
|
|
935
|
-
IconEdit:
|
|
936
|
-
IconErrorCircle:
|
|
937
|
-
IconEye:
|
|
938
|
-
IconEyeOff:
|
|
939
|
-
IconInfo:
|
|
940
|
-
IconInfoCircle:
|
|
941
|
-
IconMinus:
|
|
942
|
-
IconList:
|
|
943
|
-
IconPanelsTopLeft:
|
|
944
|
-
IconPause:
|
|
945
|
-
IconPlus:
|
|
946
|
-
IconPictureInPicture:
|
|
947
|
-
IconPlay:
|
|
948
|
-
IconReplay:
|
|
949
|
-
IconSettings:
|
|
950
|
-
IconFullscreen:
|
|
951
|
-
IconFullscreenExit:
|
|
952
|
-
IconCaptions:
|
|
953
|
-
IconVolume:
|
|
954
|
-
IconVolumeMuted:
|
|
955
|
-
IconSort:
|
|
956
|
-
IconSortAscending:
|
|
957
|
-
IconSortDescending:
|
|
958
|
-
IconSuccessCircle:
|
|
959
|
-
IconUpload:
|
|
960
|
-
IconWarning:
|
|
937
|
+
IconCheck: L,
|
|
938
|
+
IconChevron: R,
|
|
939
|
+
IconCross: z,
|
|
940
|
+
IconEdit: B,
|
|
941
|
+
IconErrorCircle: te,
|
|
942
|
+
IconEye: V,
|
|
943
|
+
IconEyeOff: H,
|
|
944
|
+
IconInfo: U,
|
|
945
|
+
IconInfoCircle: ne,
|
|
946
|
+
IconMinus: re,
|
|
947
|
+
IconList: ie,
|
|
948
|
+
IconPanelsTopLeft: ae,
|
|
949
|
+
IconPause: oe,
|
|
950
|
+
IconPlus: se,
|
|
951
|
+
IconPictureInPicture: ce,
|
|
952
|
+
IconPlay: le,
|
|
953
|
+
IconReplay: W,
|
|
954
|
+
IconSettings: ue,
|
|
955
|
+
IconFullscreen: de,
|
|
956
|
+
IconFullscreenExit: fe,
|
|
957
|
+
IconCaptions: pe,
|
|
958
|
+
IconVolume: me,
|
|
959
|
+
IconVolumeMuted: G,
|
|
960
|
+
IconSort: he,
|
|
961
|
+
IconSortAscending: ge,
|
|
962
|
+
IconSortDescending: _e,
|
|
963
|
+
IconSuccessCircle: ve,
|
|
964
|
+
IconUpload: ye,
|
|
965
|
+
IconWarning: be
|
|
961
966
|
}, q = ({ name: e, ...n }) => {
|
|
962
|
-
let r =
|
|
967
|
+
let r = xe[e];
|
|
963
968
|
return /* @__PURE__ */ t(r, { ...n });
|
|
964
|
-
},
|
|
969
|
+
}, J = {
|
|
965
970
|
wrapper: "_wrapper_1seon_1",
|
|
966
971
|
label: "_label_1seon_13",
|
|
967
972
|
input: "_input_1seon_35",
|
|
@@ -973,10 +978,10 @@ var M = {
|
|
|
973
978
|
return d(() => {
|
|
974
979
|
b.current && (b.current.indeterminate = m && !e);
|
|
975
980
|
}, [e, m]), /* @__PURE__ */ n("div", {
|
|
976
|
-
className: `${
|
|
981
|
+
className: `${J.wrapper} ${l}`,
|
|
977
982
|
children: [
|
|
978
983
|
/* @__PURE__ */ n("label", {
|
|
979
|
-
className: `${
|
|
984
|
+
className: `${J.label} ${s ? J.disabled : ""}`,
|
|
980
985
|
htmlFor: y,
|
|
981
986
|
children: [
|
|
982
987
|
/* @__PURE__ */ t("input", {
|
|
@@ -990,14 +995,14 @@ var M = {
|
|
|
990
995
|
"aria-invalid": !!o,
|
|
991
996
|
"aria-describedby": [x, S].filter(Boolean).join(" ") || void 0,
|
|
992
997
|
"aria-label": g,
|
|
993
|
-
className:
|
|
998
|
+
className: J.input,
|
|
994
999
|
onChange: (e) => {
|
|
995
1000
|
c || r?.(e.target.checked, e);
|
|
996
1001
|
},
|
|
997
1002
|
..._
|
|
998
1003
|
}),
|
|
999
1004
|
/* @__PURE__ */ n("span", {
|
|
1000
|
-
className: `${
|
|
1005
|
+
className: `${J.control} ${o ? J.controlError : ""}`,
|
|
1001
1006
|
"aria-hidden": "true",
|
|
1002
1007
|
children: [m && !e && /* @__PURE__ */ t(q, {
|
|
1003
1008
|
name: "IconMinus",
|
|
@@ -1023,7 +1028,7 @@ var M = {
|
|
|
1023
1028
|
})
|
|
1024
1029
|
]
|
|
1025
1030
|
});
|
|
1026
|
-
},
|
|
1031
|
+
}, Y = {
|
|
1027
1032
|
wrapper: "_wrapper_su17c_1",
|
|
1028
1033
|
trigger: "_trigger_su17c_17",
|
|
1029
1034
|
sm: "_sm_su17c_53",
|
|
@@ -1075,33 +1080,33 @@ var M = {
|
|
|
1075
1080
|
"Октябрь",
|
|
1076
1081
|
"Ноябрь",
|
|
1077
1082
|
"Декабрь"
|
|
1078
|
-
],
|
|
1079
|
-
let t = e.replace(/\D/g, "").slice(0,
|
|
1083
|
+
], Te = (e) => String(e).padStart(2, "0"), Ee = 8, De = "Некорректная дата", Oe = (e) => e ? `${Te(e.getDate())}.${Te(e.getMonth() + 1)}.${e.getFullYear()}` : "", ke = (e) => {
|
|
1084
|
+
let t = e.replace(/\D/g, "").slice(0, Ee);
|
|
1080
1085
|
return [
|
|
1081
1086
|
t.slice(0, 2),
|
|
1082
1087
|
t.slice(2, 4),
|
|
1083
1088
|
t.slice(4, 8)
|
|
1084
1089
|
].filter(Boolean).join(".");
|
|
1085
|
-
},
|
|
1090
|
+
}, Ae = (e) => {
|
|
1086
1091
|
if (!e) return !0;
|
|
1087
1092
|
let t = Number(e.padEnd(4, "0"));
|
|
1088
1093
|
return Number(e.padEnd(4, "9")) >= 1800 && t <= 2500;
|
|
1089
|
-
},
|
|
1094
|
+
}, je = (e) => {
|
|
1090
1095
|
if (!/^\d{0,8}$/.test(e)) return !1;
|
|
1091
1096
|
let t = e.slice(0, 2), n = e.slice(2, 4), r = e.slice(4, 8);
|
|
1092
|
-
return t.length === 1 && Number(t) > 3 || t.length === 2 && (Number(t) < 1 || Number(t) > 31) || n.length === 1 && Number(n) > 1 || n.length === 2 && (Number(n) < 1 || Number(n) > 12) ? !1 :
|
|
1093
|
-
},
|
|
1097
|
+
return t.length === 1 && Number(t) > 3 || t.length === 2 && (Number(t) < 1 || Number(t) > 31) || n.length === 1 && Number(n) > 1 || n.length === 2 && (Number(n) < 1 || Number(n) > 12) ? !1 : Ae(r);
|
|
1098
|
+
}, Me = (e) => {
|
|
1094
1099
|
let t = /^(\d{2})\.(\d{2})\.(\d{4})$/.exec(e);
|
|
1095
1100
|
if (!t) return null;
|
|
1096
1101
|
let n = Number(t[1]), r = Number(t[2]) - 1, i = Number(t[3]);
|
|
1097
1102
|
if (i < 1800 || i > 2500) return null;
|
|
1098
1103
|
let a = new Date(i, r, n, 12);
|
|
1099
1104
|
return a.getFullYear() !== i || a.getMonth() !== r || a.getDate() !== n ? null : a;
|
|
1100
|
-
},
|
|
1105
|
+
}, Ne = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), Pe = (e, t) => {
|
|
1101
1106
|
if (!e) return "";
|
|
1102
|
-
let n = `${e.getFullYear()}-${
|
|
1107
|
+
let n = `${e.getFullYear()}-${Te(e.getMonth() + 1)}-${Te(e.getDate())}`, r = `${Te(e.getHours())}:${Te(e.getMinutes())}`;
|
|
1103
1108
|
return t === "date" ? n : t === "time" ? r : `${n}T${r}`;
|
|
1104
|
-
},
|
|
1109
|
+
}, Fe = (e, t) => {
|
|
1105
1110
|
if (!e) return null;
|
|
1106
1111
|
if (t === "time") {
|
|
1107
1112
|
let t = /^(\d{2}):(\d{2})$/.exec(e);
|
|
@@ -1119,33 +1124,33 @@ var M = {
|
|
|
1119
1124
|
}
|
|
1120
1125
|
let n = new Date(e);
|
|
1121
1126
|
return Number.isNaN(n.getTime()) ? null : n;
|
|
1122
|
-
},
|
|
1127
|
+
}, Ie = (e, t) => {
|
|
1123
1128
|
if (!e) return "";
|
|
1124
|
-
let n = `${
|
|
1129
|
+
let n = `${Te(e.getDate())}.${Te(e.getMonth() + 1)}.${e.getFullYear()}`, r = `${Te(e.getHours())}:${Te(e.getMinutes())}`;
|
|
1125
1130
|
return t === "date" ? n : t === "time" ? r : `${n} ${r}`;
|
|
1126
|
-
},
|
|
1131
|
+
}, Le = (e) => {
|
|
1127
1132
|
let t = new Date(e.getFullYear(), e.getMonth(), 1), n = (t.getDay() + 6) % 7, r = new Date(t);
|
|
1128
1133
|
return r.setDate(t.getDate() - n), Array.from({ length: 42 }, (e, t) => {
|
|
1129
1134
|
let n = new Date(r);
|
|
1130
1135
|
return n.setDate(r.getDate() + t), n;
|
|
1131
1136
|
});
|
|
1132
|
-
},
|
|
1133
|
-
let r =
|
|
1134
|
-
return !!(t && r <
|
|
1135
|
-
},
|
|
1136
|
-
let D = f(), O = w ?? `ds-date-time-${T ?? D}`, k = c ? `${O}-hint` : void 0, A = u ? `${O}-error` : void 0, j = h(null), M = h(null), P = h(null), F = h(null), [I, L] = g(!1), [R, z] = g(r ?? /* @__PURE__ */ new Date()), [B, te] = g(
|
|
1137
|
+
}, Re = (e, t) => !!(e && e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate()), ze = (e, t, n) => {
|
|
1138
|
+
let r = Ne(e).getTime();
|
|
1139
|
+
return !!(t && r < Ne(t).getTime() || n && r > Ne(n).getTime());
|
|
1140
|
+
}, Be = 8, Ve = 6, He = ({ value: r, onChange: i, mode: a = "date", label: o, placeholder: s, hint: c, error: u, disabled: v = !1, readOnly: y = !1, required: b = !1, min: x, max: S, size: C = "md", id: w, name: T, className: E = "" }) => {
|
|
1141
|
+
let D = f(), O = w ?? `ds-date-time-${T ?? D}`, k = c ? `${O}-hint` : void 0, A = u ? `${O}-error` : void 0, j = h(null), M = h(null), P = h(null), F = h(null), [I, L] = g(!1), [R, z] = g(r ?? /* @__PURE__ */ new Date()), [B, te] = g(Pe(r, "time")), [V, H] = g(Oe(r)), [U, ne] = g(""), [re, ie] = g(0), [ae, oe] = g(null), se = m(() => Le(R), [R]), ce = a !== "time", le = a !== "date";
|
|
1137
1142
|
d(() => {
|
|
1138
|
-
r && z(r), te(
|
|
1143
|
+
r && z(r), te(Pe(r, "time")), H(Oe(r));
|
|
1139
1144
|
}, [r]), d(() => () => {
|
|
1140
1145
|
F.current && clearTimeout(F.current);
|
|
1141
1146
|
}, []);
|
|
1142
1147
|
let W = l(() => {
|
|
1143
1148
|
let e = M.current, t = P.current;
|
|
1144
1149
|
if (!e || !t) return;
|
|
1145
|
-
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight - n.bottom -
|
|
1150
|
+
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight - n.bottom - Be, o = n.top - Be, s = a < r.height && o > a, c = Math.max(120, s ? o : a), l = s ? Math.max(Be, n.top - r.height - Ve) : n.bottom + Ve, u = n.left, d = i - r.width - Be;
|
|
1146
1151
|
oe({
|
|
1147
1152
|
top: l,
|
|
1148
|
-
left: Math.max(
|
|
1153
|
+
left: Math.max(Be, Math.min(u, d)),
|
|
1149
1154
|
maxHeight: c
|
|
1150
1155
|
});
|
|
1151
1156
|
}, []);
|
|
@@ -1175,27 +1180,27 @@ var M = {
|
|
|
1175
1180
|
};
|
|
1176
1181
|
}, [I]);
|
|
1177
1182
|
let ue = (e) => {
|
|
1178
|
-
if (
|
|
1179
|
-
let t = a === "date" ? Pe(
|
|
1180
|
-
t && (a !== "date" && t.setHours(r?.getHours() ?? 0, r?.getMinutes() ?? 0, 0, 0), i?.(t), H(
|
|
1183
|
+
if (ze(e, x, S)) return;
|
|
1184
|
+
let t = a === "date" ? Fe(Pe(e, "date"), "date") : new Date(e);
|
|
1185
|
+
t && (a !== "date" && t.setHours(r?.getHours() ?? 0, r?.getMinutes() ?? 0, 0, 0), i?.(t), H(Oe(t)), a === "date" && L(!1));
|
|
1181
1186
|
}, de = () => {
|
|
1182
|
-
ne(
|
|
1187
|
+
ne(De), ie((e) => e + 1), F.current && clearTimeout(F.current), F.current = setTimeout(() => {
|
|
1183
1188
|
ne(""), F.current = null;
|
|
1184
1189
|
}, 3e3);
|
|
1185
1190
|
}, fe = (e) => {
|
|
1186
|
-
let t = e.replace(/\D/g, "").slice(0,
|
|
1187
|
-
if (!
|
|
1191
|
+
let t = e.replace(/\D/g, "").slice(0, Ee);
|
|
1192
|
+
if (!je(t)) {
|
|
1188
1193
|
de();
|
|
1189
1194
|
return;
|
|
1190
1195
|
}
|
|
1191
|
-
let n =
|
|
1196
|
+
let n = ke(t);
|
|
1192
1197
|
if (H(n), !t) {
|
|
1193
1198
|
i?.(null);
|
|
1194
1199
|
return;
|
|
1195
1200
|
}
|
|
1196
|
-
if (t.length <
|
|
1197
|
-
let o =
|
|
1198
|
-
if (!o ||
|
|
1201
|
+
if (t.length < Ee) return;
|
|
1202
|
+
let o = Me(n);
|
|
1203
|
+
if (!o || ze(o, x, S)) {
|
|
1199
1204
|
de();
|
|
1200
1205
|
return;
|
|
1201
1206
|
}
|
|
@@ -1205,7 +1210,7 @@ var M = {
|
|
|
1205
1210
|
i?.(null);
|
|
1206
1211
|
return;
|
|
1207
1212
|
}
|
|
1208
|
-
let t =
|
|
1213
|
+
let t = Fe(e, "time");
|
|
1209
1214
|
if (!t) return;
|
|
1210
1215
|
let n = new Date(a === "datetime" ? r ?? R : /* @__PURE__ */ new Date());
|
|
1211
1216
|
n.setHours(t.getHours(), t.getMinutes(), 0, 0), !(x && n < x || S && n > S) && i?.(n);
|
|
@@ -1215,7 +1220,7 @@ var M = {
|
|
|
1215
1220
|
G
|
|
1216
1221
|
].filter(Boolean).join(" ") || void 0, ge = I && !y ? /* @__PURE__ */ n("div", {
|
|
1217
1222
|
ref: P,
|
|
1218
|
-
className:
|
|
1223
|
+
className: Y.panel,
|
|
1219
1224
|
role: "dialog",
|
|
1220
1225
|
"aria-label": o ?? me,
|
|
1221
1226
|
style: ae ? {
|
|
@@ -1229,22 +1234,22 @@ var M = {
|
|
|
1229
1234
|
},
|
|
1230
1235
|
children: [ce && /* @__PURE__ */ n(e, { children: [
|
|
1231
1236
|
/* @__PURE__ */ n("div", {
|
|
1232
|
-
className:
|
|
1237
|
+
className: Y.calendarHeader,
|
|
1233
1238
|
children: [
|
|
1234
1239
|
/* @__PURE__ */ t("button", {
|
|
1235
1240
|
type: "button",
|
|
1236
|
-
className:
|
|
1241
|
+
className: Y.nav,
|
|
1237
1242
|
"aria-label": "Предыдущий месяц",
|
|
1238
1243
|
onClick: () => z(new Date(R.getFullYear(), R.getMonth() - 1, 1)),
|
|
1239
1244
|
children: /* @__PURE__ */ t(q, {
|
|
1240
1245
|
name: "IconChevron",
|
|
1241
1246
|
width: 20,
|
|
1242
1247
|
height: 20,
|
|
1243
|
-
className:
|
|
1248
|
+
className: Y.previousMonth
|
|
1244
1249
|
})
|
|
1245
1250
|
}),
|
|
1246
1251
|
/* @__PURE__ */ t("select", {
|
|
1247
|
-
className:
|
|
1252
|
+
className: Y.monthSelect,
|
|
1248
1253
|
"aria-label": "Месяц",
|
|
1249
1254
|
value: R.getMonth(),
|
|
1250
1255
|
onChange: (e) => z(new Date(R.getFullYear(), Number(e.target.value), 1)),
|
|
@@ -1254,7 +1259,7 @@ var M = {
|
|
|
1254
1259
|
}, e))
|
|
1255
1260
|
}),
|
|
1256
1261
|
/* @__PURE__ */ t("input", {
|
|
1257
|
-
className:
|
|
1262
|
+
className: Y.yearInput,
|
|
1258
1263
|
type: "number",
|
|
1259
1264
|
"aria-label": "Год",
|
|
1260
1265
|
value: R.getFullYear(),
|
|
@@ -1262,30 +1267,30 @@ var M = {
|
|
|
1262
1267
|
}),
|
|
1263
1268
|
/* @__PURE__ */ t("button", {
|
|
1264
1269
|
type: "button",
|
|
1265
|
-
className:
|
|
1270
|
+
className: Y.nav,
|
|
1266
1271
|
"aria-label": "Следующий месяц",
|
|
1267
1272
|
onClick: () => z(new Date(R.getFullYear(), R.getMonth() + 1, 1)),
|
|
1268
1273
|
children: /* @__PURE__ */ t(q, {
|
|
1269
1274
|
name: "IconChevron",
|
|
1270
1275
|
width: 20,
|
|
1271
1276
|
height: 20,
|
|
1272
|
-
className:
|
|
1277
|
+
className: Y.nextMonth
|
|
1273
1278
|
})
|
|
1274
1279
|
})
|
|
1275
1280
|
]
|
|
1276
1281
|
}),
|
|
1277
1282
|
/* @__PURE__ */ t("div", {
|
|
1278
|
-
className:
|
|
1283
|
+
className: Y.weekdays,
|
|
1279
1284
|
children: Ce.map((e) => /* @__PURE__ */ t("span", { children: e }, e))
|
|
1280
1285
|
}),
|
|
1281
1286
|
/* @__PURE__ */ t("div", {
|
|
1282
|
-
className:
|
|
1287
|
+
className: Y.days,
|
|
1283
1288
|
children: se.map((e) => {
|
|
1284
|
-
let n =
|
|
1289
|
+
let n = Re(r, e);
|
|
1285
1290
|
return /* @__PURE__ */ t("button", {
|
|
1286
1291
|
type: "button",
|
|
1287
|
-
className: `${
|
|
1288
|
-
disabled:
|
|
1292
|
+
className: `${Y.day} ${e.getMonth() === R.getMonth() ? "" : Y.outside} ${n ? Y.selected : ""}`,
|
|
1293
|
+
disabled: ze(e, x, S),
|
|
1289
1294
|
"aria-pressed": n,
|
|
1290
1295
|
onClick: () => ue(e),
|
|
1291
1296
|
children: e.getDate()
|
|
@@ -1293,9 +1298,9 @@ var M = {
|
|
|
1293
1298
|
})
|
|
1294
1299
|
})
|
|
1295
1300
|
] }), le && /* @__PURE__ */ n("label", {
|
|
1296
|
-
className:
|
|
1301
|
+
className: Y.timeLabel,
|
|
1297
1302
|
children: [/* @__PURE__ */ t("span", { children: "Время" }), /* @__PURE__ */ t("input", {
|
|
1298
|
-
className:
|
|
1303
|
+
className: Y.timeInput,
|
|
1299
1304
|
type: "time",
|
|
1300
1305
|
value: B,
|
|
1301
1306
|
onChange: (e) => pe(e.target.value)
|
|
@@ -1304,7 +1309,7 @@ var M = {
|
|
|
1304
1309
|
}) : null;
|
|
1305
1310
|
return /* @__PURE__ */ n("div", {
|
|
1306
1311
|
ref: j,
|
|
1307
|
-
className: `${
|
|
1312
|
+
className: `${Y.wrapper} ${E}`,
|
|
1308
1313
|
children: [
|
|
1309
1314
|
o && /* @__PURE__ */ t(ee, {
|
|
1310
1315
|
htmlFor: O,
|
|
@@ -1313,13 +1318,13 @@ var M = {
|
|
|
1313
1318
|
children: o
|
|
1314
1319
|
}),
|
|
1315
1320
|
ce ? /* @__PURE__ */ n("div", {
|
|
1316
|
-
className: `${
|
|
1321
|
+
className: `${Y.trigger} ${Y[C]} ${u ? Y.error : ""} ${v ? Y.disabled : ""}`,
|
|
1317
1322
|
children: [
|
|
1318
1323
|
/* @__PURE__ */ t("input", {
|
|
1319
1324
|
ref: M,
|
|
1320
1325
|
id: O,
|
|
1321
1326
|
name: T,
|
|
1322
|
-
className:
|
|
1327
|
+
className: Y.dateInput,
|
|
1323
1328
|
value: V,
|
|
1324
1329
|
placeholder: me.split(" ")[0],
|
|
1325
1330
|
inputMode: "numeric",
|
|
@@ -1340,12 +1345,12 @@ var M = {
|
|
|
1340
1345
|
onChange: (e) => fe(e.target.value)
|
|
1341
1346
|
}),
|
|
1342
1347
|
a === "datetime" && B && /* @__PURE__ */ t("span", {
|
|
1343
|
-
className:
|
|
1348
|
+
className: Y.timeValue,
|
|
1344
1349
|
children: B
|
|
1345
1350
|
}),
|
|
1346
1351
|
/* @__PURE__ */ t("button", {
|
|
1347
1352
|
type: "button",
|
|
1348
|
-
className:
|
|
1353
|
+
className: Y.chevronButton,
|
|
1349
1354
|
disabled: v || y,
|
|
1350
1355
|
"aria-label": I ? "Закрыть календарь" : "Открыть календарь",
|
|
1351
1356
|
tabIndex: -1,
|
|
@@ -1354,7 +1359,7 @@ var M = {
|
|
|
1354
1359
|
L((e) => !e), M.current?.focus();
|
|
1355
1360
|
},
|
|
1356
1361
|
children: /* @__PURE__ */ t("span", {
|
|
1357
|
-
className: `${
|
|
1362
|
+
className: `${Y.chevron} ${ge ? Y.chevronOpen : ""}`,
|
|
1358
1363
|
"aria-hidden": "true",
|
|
1359
1364
|
children: /* @__PURE__ */ t(q, {
|
|
1360
1365
|
name: "IconChevron",
|
|
@@ -1369,7 +1374,7 @@ var M = {
|
|
|
1369
1374
|
id: O,
|
|
1370
1375
|
name: T,
|
|
1371
1376
|
type: "button",
|
|
1372
|
-
className: `${
|
|
1377
|
+
className: `${Y.trigger} ${Y[C]} ${u ? Y.error : ""}`,
|
|
1373
1378
|
disabled: v,
|
|
1374
1379
|
"aria-readonly": y || void 0,
|
|
1375
1380
|
"aria-expanded": I,
|
|
@@ -1379,10 +1384,10 @@ var M = {
|
|
|
1379
1384
|
y || L((e) => !e);
|
|
1380
1385
|
},
|
|
1381
1386
|
children: [/* @__PURE__ */ t("span", {
|
|
1382
|
-
className: r ?
|
|
1383
|
-
children:
|
|
1387
|
+
className: r ? Y.value : Y.placeholder,
|
|
1388
|
+
children: Ie(r, a) || me
|
|
1384
1389
|
}), /* @__PURE__ */ t("span", {
|
|
1385
|
-
className: `${
|
|
1390
|
+
className: `${Y.chevron} ${ge ? Y.chevronOpen : ""}`,
|
|
1386
1391
|
"aria-hidden": "true",
|
|
1387
1392
|
children: /* @__PURE__ */ t(q, {
|
|
1388
1393
|
name: "IconChevron",
|
|
@@ -1393,7 +1398,7 @@ var M = {
|
|
|
1393
1398
|
}),
|
|
1394
1399
|
U && /* @__PURE__ */ t("span", {
|
|
1395
1400
|
id: G,
|
|
1396
|
-
className:
|
|
1401
|
+
className: Y.validationTooltip,
|
|
1397
1402
|
role: "status",
|
|
1398
1403
|
"aria-live": "polite",
|
|
1399
1404
|
children: U
|
|
@@ -1410,19 +1415,19 @@ var M = {
|
|
|
1410
1415
|
})
|
|
1411
1416
|
]
|
|
1412
1417
|
});
|
|
1413
|
-
},
|
|
1418
|
+
}, Ue = {
|
|
1414
1419
|
root: "_root_19vq2_1",
|
|
1415
1420
|
range: "_range_19vq2_21"
|
|
1416
|
-
},
|
|
1421
|
+
}, We = (e) => !!(e.from && e.to && e.from.getTime() <= e.to.getTime()), Ge = ({ 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 = "" }) => {
|
|
1417
1422
|
let g = l ?? (e.from && e.to && e.from > e.to ? "Дата «От» не может быть позже даты «До»" : void 0), _ = (e) => {
|
|
1418
|
-
i?.(e),
|
|
1423
|
+
i?.(e), We(e) && r?.(e);
|
|
1419
1424
|
};
|
|
1420
1425
|
return /* @__PURE__ */ n("fieldset", {
|
|
1421
|
-
className: `${
|
|
1426
|
+
className: `${Ue.root} ${h}`,
|
|
1422
1427
|
disabled: f,
|
|
1423
1428
|
children: [/* @__PURE__ */ n("div", {
|
|
1424
|
-
className:
|
|
1425
|
-
children: [/* @__PURE__ */ t(
|
|
1429
|
+
className: Ue.range,
|
|
1430
|
+
children: [/* @__PURE__ */ t(He, {
|
|
1426
1431
|
value: e.from,
|
|
1427
1432
|
mode: a === "datetime" ? "datetime" : a,
|
|
1428
1433
|
label: o,
|
|
@@ -1436,7 +1441,7 @@ var M = {
|
|
|
1436
1441
|
...e,
|
|
1437
1442
|
from: t
|
|
1438
1443
|
})
|
|
1439
|
-
}), /* @__PURE__ */ t(
|
|
1444
|
+
}), /* @__PURE__ */ t(He, {
|
|
1440
1445
|
value: e.to,
|
|
1441
1446
|
mode: a === "datetime" ? "datetime" : a,
|
|
1442
1447
|
label: s,
|
|
@@ -1453,7 +1458,7 @@ var M = {
|
|
|
1453
1458
|
})]
|
|
1454
1459
|
}), c && !g && /* @__PURE__ */ t(N, { children: c })]
|
|
1455
1460
|
});
|
|
1456
|
-
},
|
|
1461
|
+
}, Ke = {
|
|
1457
1462
|
group: "_group_ey6uk_1",
|
|
1458
1463
|
skeleton: "_skeleton_ey6uk_15",
|
|
1459
1464
|
text: "_text_ey6uk_27",
|
|
@@ -1461,11 +1466,11 @@ var M = {
|
|
|
1461
1466
|
circular: "_circular_ey6uk_47",
|
|
1462
1467
|
animated: "_animated_ey6uk_59",
|
|
1463
1468
|
"ds-skeleton": "_ds-skeleton_ey6uk_1"
|
|
1464
|
-
},
|
|
1465
|
-
className: `${
|
|
1469
|
+
}, qe = ({ variant: e = "text", width: n = "100%", height: r, lines: i = 1, animated: a = !0, className: o = "" }) => /* @__PURE__ */ t("span", {
|
|
1470
|
+
className: `${Ke.group} ${o}`,
|
|
1466
1471
|
"aria-hidden": "true",
|
|
1467
1472
|
children: Array.from({ length: Math.max(1, i) }, (i, o) => /* @__PURE__ */ t("span", {
|
|
1468
|
-
className: `${
|
|
1473
|
+
className: `${Ke.skeleton} ${Ke[e]} ${a ? Ke.animated : ""}`,
|
|
1469
1474
|
style: {
|
|
1470
1475
|
width: n,
|
|
1471
1476
|
height: r
|
|
@@ -1489,25 +1494,25 @@ var M = {
|
|
|
1489
1494
|
message: "_message_6g3qd_359",
|
|
1490
1495
|
error: "_error_6g3qd_361",
|
|
1491
1496
|
errorState: "_errorState_6g3qd_387"
|
|
1492
|
-
},
|
|
1497
|
+
}, Je = 8, Ye = 6, Xe = 120, Ze = (e, t, n) => {
|
|
1493
1498
|
if (!e.length) return -1;
|
|
1494
1499
|
for (let r = 0; r < e.length; r += 1) {
|
|
1495
1500
|
let i = (t + r * n + e.length) % e.length;
|
|
1496
1501
|
if (!e[i]?.disabled) return i;
|
|
1497
1502
|
}
|
|
1498
1503
|
return -1;
|
|
1499
|
-
},
|
|
1504
|
+
}, Qe = (e) => {
|
|
1500
1505
|
if (typeof e == "number") return e;
|
|
1501
1506
|
if (typeof e == "string") {
|
|
1502
1507
|
let t = Number.parseFloat(e);
|
|
1503
1508
|
if (Number.isFinite(t)) return t;
|
|
1504
1509
|
}
|
|
1505
1510
|
return Infinity;
|
|
1506
|
-
},
|
|
1511
|
+
}, $e = ({ options: e, value: r, onChange: i, placeholder: a = "Выберите опцию", disabled: o = !1, stringWhileDisabled: s = !1, label: c, error: u, size: v = "md", hint: y, className: b = "", required: x = !1, name: S, id: C, needMark: w = !0, maxMenuHeight: T }) => {
|
|
1507
1512
|
let E = f(), D = C ?? `ds-dropdown-${S ?? E}`, O = `${D}-listbox`, [k, A] = g(!1), [j, M] = g(null), N = h(null), P = h(null), F = h(null), I = h([]), L = m(() => e.find((e) => e.value === r), [e, r]), R = y ? `${D}-hint` : void 0, z = u ? `${D}-error` : void 0, B = [R, z].filter(Boolean).join(" ") || void 0, te = o && s, V = l(() => {
|
|
1508
1513
|
let e = P.current, t = F.current;
|
|
1509
1514
|
if (!e || !t) return;
|
|
1510
|
-
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight - n.bottom -
|
|
1515
|
+
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight - n.bottom - Je, o = n.top - Je, s = a < r.height && o > a, c = Math.max(Xe, s ? o : a), l = Qe(T), u = Math.min(c, l), d = n.left, f = i - n.width - Je, p = Math.max(Je, Math.min(d, f)), m = s ? Math.max(Je, n.top - r.height - Ye) : n.bottom + Ye;
|
|
1511
1516
|
M({
|
|
1512
1517
|
top: m,
|
|
1513
1518
|
left: p,
|
|
@@ -1540,7 +1545,7 @@ var M = {
|
|
|
1540
1545
|
};
|
|
1541
1546
|
}, [k]);
|
|
1542
1547
|
let H = (t, n) => {
|
|
1543
|
-
let r =
|
|
1548
|
+
let r = Ze(e, t, n);
|
|
1544
1549
|
if (r === -1) return;
|
|
1545
1550
|
let i = I.current[r];
|
|
1546
1551
|
i?.focus(), i?.scrollIntoView({ block: "nearest" });
|
|
@@ -1681,25 +1686,25 @@ var M = {
|
|
|
1681
1686
|
})
|
|
1682
1687
|
]
|
|
1683
1688
|
});
|
|
1684
|
-
},
|
|
1689
|
+
}, et = (e) => `${e.id}:${e.direction}`, tt = ({ options: e, value: n, onChange: r, label: i = "Сортировка", placeholder: a = "Выберите сортировку", disabled: o = !1, className: s }) => {
|
|
1685
1690
|
let c = e.flatMap((e) => [{
|
|
1686
|
-
value:
|
|
1691
|
+
value: et({
|
|
1687
1692
|
id: e.id,
|
|
1688
1693
|
direction: "asc"
|
|
1689
1694
|
}),
|
|
1690
1695
|
label: e.ascLabel ?? `${e.label} · по возрастанию`,
|
|
1691
1696
|
disabled: e.disabled
|
|
1692
1697
|
}, {
|
|
1693
|
-
value:
|
|
1698
|
+
value: et({
|
|
1694
1699
|
id: e.id,
|
|
1695
1700
|
direction: "desc"
|
|
1696
1701
|
}),
|
|
1697
1702
|
label: e.descLabel ?? `${e.label} · по убыванию`,
|
|
1698
1703
|
disabled: e.disabled
|
|
1699
1704
|
}]);
|
|
1700
|
-
return /* @__PURE__ */ t(
|
|
1705
|
+
return /* @__PURE__ */ t($e, {
|
|
1701
1706
|
options: c,
|
|
1702
|
-
value: n ?
|
|
1707
|
+
value: n ? et(n) : "",
|
|
1703
1708
|
label: i,
|
|
1704
1709
|
placeholder: a,
|
|
1705
1710
|
disabled: o,
|
|
@@ -1754,23 +1759,23 @@ var M = {
|
|
|
1754
1759
|
default: "_default_1ekmv_641",
|
|
1755
1760
|
tableOnMobile: "_tableOnMobile_1ekmv_641",
|
|
1756
1761
|
wide: "_wide_1ekmv_671"
|
|
1757
|
-
},
|
|
1762
|
+
}, nt = b({
|
|
1758
1763
|
rowSortingFeature: y,
|
|
1759
1764
|
sortedRowModel: v()
|
|
1760
|
-
}),
|
|
1765
|
+
}), rt = (e, t, n) => {
|
|
1761
1766
|
let r = new Set(e);
|
|
1762
1767
|
return t.forEach((e) => {
|
|
1763
1768
|
n ? r.add(e) : r.delete(e);
|
|
1764
1769
|
}), Array.from(r);
|
|
1765
|
-
},
|
|
1770
|
+
}, it = (e) => {
|
|
1766
1771
|
if (!(!e || e.width === void 0 && e.minWidth === void 0 && e.maxWidth === void 0)) return {
|
|
1767
1772
|
width: e.width,
|
|
1768
1773
|
minWidth: e.minWidth,
|
|
1769
1774
|
maxWidth: e.maxWidth
|
|
1770
1775
|
};
|
|
1771
|
-
},
|
|
1776
|
+
}, at = (e) => {
|
|
1772
1777
|
if (e?.sticky) return e.sticky === "start" ? { insetInlineStart: e.stickyOffset ?? 0 } : { insetInlineEnd: e.stickyOffset ?? 0 };
|
|
1773
|
-
},
|
|
1778
|
+
}, ot = (e, t) => t <= 7 ? Array.from({ length: t }, (e, t) => t) : e <= 3 ? [
|
|
1774
1779
|
0,
|
|
1775
1780
|
1,
|
|
1776
1781
|
2,
|
|
@@ -1794,7 +1799,7 @@ var M = {
|
|
|
1794
1799
|
e + 1,
|
|
1795
1800
|
"ellipsis-end",
|
|
1796
1801
|
t - 1
|
|
1797
|
-
],
|
|
1802
|
+
], st = (e, t) => {
|
|
1798
1803
|
let n = /* @__PURE__ */ new Set();
|
|
1799
1804
|
for (let t of e) {
|
|
1800
1805
|
if (!t.id.trim()) return "Идентификатор колонки не может быть пустым";
|
|
@@ -1806,36 +1811,36 @@ var M = {
|
|
|
1806
1811
|
for (let t of e) if (typeof t.accessor == "string" && !(t.accessor in r)) return `В строке ${n + 1} отсутствует колонка «${t.id}»`;
|
|
1807
1812
|
}
|
|
1808
1813
|
return null;
|
|
1809
|
-
},
|
|
1814
|
+
}, ct = (e, t) => typeof e == "function" ? e(t) : t[e], lt = (e) => {
|
|
1810
1815
|
if (e == null || e === "") return null;
|
|
1811
1816
|
let t = Date.parse(String(e));
|
|
1812
1817
|
return Number.isNaN(t) ? null : t;
|
|
1813
|
-
}, lt = (e, t, n) => {
|
|
1814
|
-
let r = ct(e.getValue(n)), i = ct(t.getValue(n));
|
|
1815
|
-
return r === null && i === null ? 0 : r === null ? -1 : i === null ? 1 : r - i;
|
|
1816
1818
|
}, ut = (e, t, n) => {
|
|
1819
|
+
let r = lt(e.getValue(n)), i = lt(t.getValue(n));
|
|
1820
|
+
return r === null && i === null ? 0 : r === null ? -1 : i === null ? 1 : r - i;
|
|
1821
|
+
}, dt = (e, t, n) => {
|
|
1817
1822
|
let r = e.getValue(n), i = t.getValue(n);
|
|
1818
1823
|
return r == null && i == null ? 0 : r == null ? -1 : i == null ? 1 : Number(r) - Number(i);
|
|
1819
|
-
},
|
|
1824
|
+
}, ft = (e, t, n) => {
|
|
1820
1825
|
let r = e.getValue(n), i = t.getValue(n);
|
|
1821
1826
|
return r == null && i == null ? 0 : r == null ? -1 : i == null ? 1 : Number(!!r) - Number(!!i);
|
|
1822
|
-
},
|
|
1827
|
+
}, pt = (e, t, n) => {
|
|
1823
1828
|
let r = String(e.getValue(n) ?? ""), i = String(t.getValue(n) ?? "");
|
|
1824
1829
|
return r.localeCompare(i, void 0, {
|
|
1825
1830
|
numeric: !0,
|
|
1826
1831
|
sensitivity: "base"
|
|
1827
1832
|
});
|
|
1828
|
-
},
|
|
1833
|
+
}, mt = (e) => {
|
|
1829
1834
|
switch (e) {
|
|
1830
|
-
case "date": return
|
|
1831
|
-
case "number": return
|
|
1832
|
-
case "boolean": return
|
|
1835
|
+
case "date": return ut;
|
|
1836
|
+
case "number": return dt;
|
|
1837
|
+
case "boolean": return ft;
|
|
1833
1838
|
case "text":
|
|
1834
|
-
case void 0: return
|
|
1839
|
+
case void 0: return pt;
|
|
1835
1840
|
case "custom": return;
|
|
1836
1841
|
}
|
|
1837
|
-
},
|
|
1838
|
-
let t = (t) =>
|
|
1842
|
+
}, ht = (e) => {
|
|
1843
|
+
let t = (t) => ct(e.accessor, t), n = e.sortFn ?? mt(e.dataType), r = e.enableSorting ?? (e.dataType !== "custom" && n !== void 0), i = {
|
|
1839
1844
|
id: e.id,
|
|
1840
1845
|
accessorFn: t,
|
|
1841
1846
|
header: () => e.header,
|
|
@@ -1847,13 +1852,13 @@ var M = {
|
|
|
1847
1852
|
sortDescFirst: e.sortDescFirst
|
|
1848
1853
|
};
|
|
1849
1854
|
return n !== void 0 && (i.sortFn = n), i;
|
|
1850
|
-
},
|
|
1855
|
+
}, gt = ({ columns: e, data: i, tableOnMobile: a = !1, mobileView: o, breakpoint: s = "default", sorting: c, onSortingChange: l, renderMobileCard: u, getRowId: f, caption: p, ariaLabel: h, loading: _ = !1, error: v, emptyState: y = "Нет данных", stickyHeader: b = !1, maxHeight: S, className: C = "", onRowClick: w, selectable: T = !1, selectedRowIds: E, onSelectedRowIdsChange: D, onRowDoubleClick: O, getRowSelectionLabel: k, selectAllRowsLabel: A = "Выбрать все строки на этой странице", resetSelectionLabel: M = "Сбросить выбор", openRowLabel: ee = "Открыть строку", pagination: N = !1, paginationMode: P = "client", page: F = 1, pageSize: I = 30, totalCount: L, onPageChange: R, visibleColumnIds: z, density: B = "comfortable", renderBulkActions: te, renderExpandedRow: V, expandedRowIds: H, onExpandedRowIdsChange: U, getRowExpansionLabel: ne, resultsAnnouncement: re }) => {
|
|
1851
1856
|
let [ie, ae] = g([]), [oe, se] = g([]), [ce, le] = g([]), [W, ue] = g(0), de = c ?? ie, fe = de.map((e) => `${e.id}:${e.desc ? "desc" : "asc"}`).join("|"), pe = Number.isFinite(I) && I > 0 ? Math.floor(I) : 30, me = N && P === "server", G = m(() => {
|
|
1852
1857
|
if (z === void 0) return e;
|
|
1853
1858
|
let t = new Set(z);
|
|
1854
1859
|
return e.filter((e) => t.has(e.id));
|
|
1855
|
-
}, [e, z]), he = m(() => G.length === 0 ? "Должна быть видима хотя бы одна колонка" :
|
|
1856
|
-
features:
|
|
1860
|
+
}, [e, z]), he = m(() => G.length === 0 ? "Должна быть видима хотя бы одна колонка" : st(G, i), [i, G]), ge = m(() => G.map(ht), [G]), _e = G.some((e) => it(e) !== void 0), ve = x({
|
|
1861
|
+
features: nt,
|
|
1857
1862
|
columns: ge,
|
|
1858
1863
|
data: i,
|
|
1859
1864
|
state: { sorting: de },
|
|
@@ -1862,23 +1867,23 @@ var M = {
|
|
|
1862
1867
|
c === void 0 && ae(t), ue(0), l?.(t);
|
|
1863
1868
|
},
|
|
1864
1869
|
getRowId: f
|
|
1865
|
-
}), ye = ve.getRowModel().rows,
|
|
1870
|
+
}), ye = ve.getRowModel().rows, be = me && Number.isFinite(L) && Number(L) >= 0 ? Math.floor(Number(L)) : ye.length, K = N ? Math.max(1, Math.ceil(be / pe)) : 1, xe = Number.isFinite(F) && F > 0 ? Math.floor(F) - 1 : 0, J = Math.min(me ? xe : W, K - 1), Y = m(() => N && !me ? ye.slice(J * pe, (J + 1) * pe) : ye, [
|
|
1866
1871
|
me,
|
|
1867
1872
|
pe,
|
|
1868
1873
|
N,
|
|
1869
1874
|
J,
|
|
1870
1875
|
ye
|
|
1871
|
-
]),
|
|
1876
|
+
]), Ce = E ?? oe, we = m(() => new Set(Ce), [Ce]), Te = H ?? ce, Ee = m(() => new Set(Te), [Te]), De = m(() => Y.map((e) => e.id), [Y]), Oe = De.filter((e) => we.has(e)).length, ke = De.length > 0 && Oe === De.length, Ae = Oe > 0 && !ke, je = m(() => G.filter((e) => e.enableSorting ?? e.dataType !== "custom").map((e) => ({
|
|
1872
1877
|
id: e.id,
|
|
1873
1878
|
label: typeof e.header == "string" ? e.header : e.id
|
|
1874
|
-
})), [G]), Me = m(() =>
|
|
1879
|
+
})), [G]), Me = m(() => ot(J, K), [K, J]), Ne = o === void 0 ? a : o === "table", Pe = [
|
|
1875
1880
|
Z.root,
|
|
1876
1881
|
s === "wide" ? Z.wide : Z.default,
|
|
1877
1882
|
Ne ? Z.tableOnMobile : "",
|
|
1878
1883
|
B === "compact" ? Z.compact : "",
|
|
1879
1884
|
C
|
|
1880
|
-
].filter(Boolean).join(" "), Fe = he ?? v, Ie = N && !Fe &&
|
|
1881
|
-
let t = Math.max(0, Math.min(
|
|
1885
|
+
].filter(Boolean).join(" "), Fe = he ?? v, Ie = N && !Fe && be > pe && (!_ || me), Le = J * pe + 1, Re = Math.min((J + 1) * pe, be), ze = (e) => {
|
|
1886
|
+
let t = Math.max(0, Math.min(K - 1, e));
|
|
1882
1887
|
if (me) {
|
|
1883
1888
|
t !== J && R?.(t + 1);
|
|
1884
1889
|
return;
|
|
@@ -1888,21 +1893,21 @@ var M = {
|
|
|
1888
1893
|
let t = Array.from(e);
|
|
1889
1894
|
E === void 0 && se(t), D?.(t);
|
|
1890
1895
|
}, Ve = (e) => {
|
|
1891
|
-
let t = new Set(
|
|
1896
|
+
let t = new Set(we);
|
|
1892
1897
|
t.has(e) ? t.delete(e) : t.add(e), Be(t);
|
|
1893
1898
|
}, He = () => {
|
|
1894
|
-
let e =
|
|
1899
|
+
let e = rt(we, De, !ke);
|
|
1895
1900
|
E === void 0 && se(e), D?.(e);
|
|
1896
1901
|
}, Ue = () => Be(/* @__PURE__ */ new Set()), We = (e) => {
|
|
1897
1902
|
let t = new Set(Ee);
|
|
1898
1903
|
t.has(e) ? t.delete(e) : t.add(e);
|
|
1899
1904
|
let n = Array.from(t);
|
|
1900
1905
|
H === void 0 && le(n), U?.(n);
|
|
1901
|
-
}, Ge = i.filter((e, t) =>
|
|
1902
|
-
visibleCount:
|
|
1903
|
-
totalCount:
|
|
1904
|
-
selectedCount:
|
|
1905
|
-
}) ?? `Показано строк: ${
|
|
1906
|
+
}, Ge = i.filter((e, t) => we.has(f?.(e, t) ?? String(t))), Ke = re?.({
|
|
1907
|
+
visibleCount: Y.length,
|
|
1908
|
+
totalCount: be,
|
|
1909
|
+
selectedCount: we.size
|
|
1910
|
+
}) ?? `Показано строк: ${Y.length} из ${be}. Выбрано: ${we.size}.`;
|
|
1906
1911
|
return d(() => {
|
|
1907
1912
|
me || ue(0);
|
|
1908
1913
|
}, [
|
|
@@ -1912,10 +1917,10 @@ var M = {
|
|
|
1912
1917
|
N,
|
|
1913
1918
|
fe
|
|
1914
1919
|
]), d(() => {
|
|
1915
|
-
!me && W >=
|
|
1920
|
+
!me && W >= K && ue(K - 1);
|
|
1916
1921
|
}, [
|
|
1917
1922
|
me,
|
|
1918
|
-
|
|
1923
|
+
K,
|
|
1919
1924
|
W
|
|
1920
1925
|
]), /* @__PURE__ */ n("section", {
|
|
1921
1926
|
className: Pe,
|
|
@@ -1925,19 +1930,19 @@ var M = {
|
|
|
1925
1930
|
className: Z.srOnly,
|
|
1926
1931
|
"aria-live": "polite",
|
|
1927
1932
|
"aria-atomic": "true",
|
|
1928
|
-
children:
|
|
1933
|
+
children: Ke
|
|
1929
1934
|
}),
|
|
1930
|
-
te &&
|
|
1935
|
+
te && we.size > 0 && /* @__PURE__ */ t("div", {
|
|
1931
1936
|
className: Z.bulkActions,
|
|
1932
1937
|
role: "region",
|
|
1933
1938
|
"aria-label": "Действия с выбранными строками",
|
|
1934
1939
|
children: te({
|
|
1935
|
-
selectedRowIds: Array.from(
|
|
1940
|
+
selectedRowIds: Array.from(we),
|
|
1936
1941
|
selectedRows: Ge,
|
|
1937
1942
|
clearSelection: Ue
|
|
1938
1943
|
})
|
|
1939
1944
|
}),
|
|
1940
|
-
!Ne && !_ && !Fe &&
|
|
1945
|
+
!Ne && !_ && !Fe && Y.length > 0 && je.length > 0 && /* @__PURE__ */ t(tt, {
|
|
1941
1946
|
className: Z.mobileSort,
|
|
1942
1947
|
options: je,
|
|
1943
1948
|
value: de[0] ? {
|
|
@@ -1960,7 +1965,7 @@ var M = {
|
|
|
1960
1965
|
(_e || T || !!V) && /* @__PURE__ */ n("colgroup", { children: [
|
|
1961
1966
|
V && /* @__PURE__ */ t("col", { className: Z.expansionColumn }),
|
|
1962
1967
|
T && /* @__PURE__ */ t("col", { className: Z.selectionColumn }),
|
|
1963
|
-
G.map((e) => /* @__PURE__ */ t("col", { style:
|
|
1968
|
+
G.map((e) => /* @__PURE__ */ t("col", { style: it(e) }, e.id))
|
|
1964
1969
|
] }),
|
|
1965
1970
|
/* @__PURE__ */ t("thead", {
|
|
1966
1971
|
className: b ? Z.sticky : "",
|
|
@@ -1987,7 +1992,7 @@ var M = {
|
|
|
1987
1992
|
}), /* @__PURE__ */ t(j, {
|
|
1988
1993
|
size: "sm",
|
|
1989
1994
|
variant: "empty",
|
|
1990
|
-
disabled:
|
|
1995
|
+
disabled: we.size === 0,
|
|
1991
1996
|
"aria-label": M,
|
|
1992
1997
|
title: M,
|
|
1993
1998
|
onClick: Ue,
|
|
@@ -2006,8 +2011,8 @@ var M = {
|
|
|
2006
2011
|
"aria-sort": r === "asc" ? "ascending" : r === "desc" ? "descending" : "none",
|
|
2007
2012
|
className: G.find((t) => t.id === e.column.id)?.sticky ? Z.stickyColumn : void 0,
|
|
2008
2013
|
style: {
|
|
2009
|
-
...
|
|
2010
|
-
...
|
|
2014
|
+
...it(G.find((t) => t.id === e.column.id)),
|
|
2015
|
+
...at(G.find((t) => t.id === e.column.id))
|
|
2011
2016
|
},
|
|
2012
2017
|
children: /* @__PURE__ */ n("button", {
|
|
2013
2018
|
type: "button",
|
|
@@ -2026,7 +2031,7 @@ var M = {
|
|
|
2026
2031
|
}),
|
|
2027
2032
|
/* @__PURE__ */ t("tbody", { children: _ ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
2028
2033
|
colSpan: G.length + +!!T + +!!V,
|
|
2029
|
-
children: /* @__PURE__ */ t(
|
|
2034
|
+
children: /* @__PURE__ */ t(qe, {
|
|
2030
2035
|
lines: 3,
|
|
2031
2036
|
height: 65
|
|
2032
2037
|
})
|
|
@@ -2034,12 +2039,12 @@ var M = {
|
|
|
2034
2039
|
className: Z.state,
|
|
2035
2040
|
colSpan: G.length + +!!T + +!!V,
|
|
2036
2041
|
children: Fe
|
|
2037
|
-
}) }) :
|
|
2042
|
+
}) }) : Y.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
2038
2043
|
className: Z.state,
|
|
2039
2044
|
colSpan: G.length + +!!T + +!!V,
|
|
2040
2045
|
children: y
|
|
2041
|
-
}) }) :
|
|
2042
|
-
let i =
|
|
2046
|
+
}) }) : Y.map((e) => {
|
|
2047
|
+
let i = we.has(e.id), a = k?.(e.original) ?? `Выбрать строку ${e.index + 1}`, o = Ee.has(e.id);
|
|
2043
2048
|
return /* @__PURE__ */ n(r, { children: [/* @__PURE__ */ n("tr", {
|
|
2044
2049
|
className: [w || T ? Z.clickableRow : "", i ? Z.selectedRow : ""].filter(Boolean).join(" "),
|
|
2045
2050
|
"aria-selected": T ? i : void 0,
|
|
@@ -2086,8 +2091,8 @@ var M = {
|
|
|
2086
2091
|
e.getAllCells().map((e) => /* @__PURE__ */ t("td", {
|
|
2087
2092
|
className: G.find((t) => t.id === e.column.id)?.sticky ? Z.stickyColumn : void 0,
|
|
2088
2093
|
style: {
|
|
2089
|
-
...
|
|
2090
|
-
...
|
|
2094
|
+
...it(G.find((t) => t.id === e.column.id)),
|
|
2095
|
+
...at(G.find((t) => t.id === e.column.id))
|
|
2091
2096
|
},
|
|
2092
2097
|
children: /* @__PURE__ */ t(ve.FlexRender, { cell: e })
|
|
2093
2098
|
}, e.id))
|
|
@@ -2111,7 +2116,7 @@ var M = {
|
|
|
2111
2116
|
className: Z.cards,
|
|
2112
2117
|
role: "list",
|
|
2113
2118
|
"aria-label": h ?? p,
|
|
2114
|
-
children: [T && !_ && !Fe &&
|
|
2119
|
+
children: [T && !_ && !Fe && Y.length > 0 && /* @__PURE__ */ n("div", {
|
|
2115
2120
|
className: Z.mobileSelectionControls,
|
|
2116
2121
|
children: [/* @__PURE__ */ t(Se, {
|
|
2117
2122
|
checked: ke,
|
|
@@ -2122,21 +2127,21 @@ var M = {
|
|
|
2122
2127
|
}), /* @__PURE__ */ t(j, {
|
|
2123
2128
|
size: "sm",
|
|
2124
2129
|
variant: "empty",
|
|
2125
|
-
disabled:
|
|
2130
|
+
disabled: we.size === 0,
|
|
2126
2131
|
onClick: Ue,
|
|
2127
2132
|
children: M
|
|
2128
2133
|
})]
|
|
2129
|
-
}), _ ? /* @__PURE__ */ t(
|
|
2134
|
+
}), _ ? /* @__PURE__ */ t(qe, {
|
|
2130
2135
|
lines: 4,
|
|
2131
2136
|
height: 65
|
|
2132
2137
|
}) : Fe ? /* @__PURE__ */ t("div", {
|
|
2133
2138
|
className: Z.state,
|
|
2134
2139
|
children: Fe
|
|
2135
|
-
}) :
|
|
2140
|
+
}) : Y.length === 0 ? /* @__PURE__ */ t("div", {
|
|
2136
2141
|
className: Z.state,
|
|
2137
2142
|
children: y
|
|
2138
|
-
}) :
|
|
2139
|
-
let r =
|
|
2143
|
+
}) : Y.map((e) => {
|
|
2144
|
+
let r = we.has(e.id), i = Ee.has(e.id), a = k?.(e.original) ?? `Выбрать строку ${e.index + 1}`, o = T && /* @__PURE__ */ n("div", {
|
|
2140
2145
|
className: Z.cardSelectionControls,
|
|
2141
2146
|
onClick: (e) => e.stopPropagation(),
|
|
2142
2147
|
children: [/* @__PURE__ */ t(Se, {
|
|
@@ -2188,7 +2193,7 @@ var M = {
|
|
|
2188
2193
|
})
|
|
2189
2194
|
]
|
|
2190
2195
|
}, e.id);
|
|
2191
|
-
let c = G.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) =>
|
|
2196
|
+
let c = G.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) => ct(t.accessor, e.original), f = (t) => t.mobile?.renderMobile?.(e.original, d(t)) ?? t.cell?.(e.original, d(t)) ?? String(d(t) ?? "");
|
|
2192
2197
|
return /* @__PURE__ */ n("article", {
|
|
2193
2198
|
role: "listitem",
|
|
2194
2199
|
className: `${Z.card} ${r ? Z.selectedCard : ""}`,
|
|
@@ -2228,7 +2233,7 @@ var M = {
|
|
|
2228
2233
|
"–",
|
|
2229
2234
|
Re,
|
|
2230
2235
|
" из ",
|
|
2231
|
-
|
|
2236
|
+
be
|
|
2232
2237
|
]
|
|
2233
2238
|
}), /* @__PURE__ */ n("div", {
|
|
2234
2239
|
className: Z.paginationControls,
|
|
@@ -2273,7 +2278,7 @@ var M = {
|
|
|
2273
2278
|
/* @__PURE__ */ n(j, {
|
|
2274
2279
|
variant: "empty",
|
|
2275
2280
|
size: "md",
|
|
2276
|
-
disabled: _ || J ===
|
|
2281
|
+
disabled: _ || J === K - 1,
|
|
2277
2282
|
"aria-label": "Следующая страница",
|
|
2278
2283
|
onClick: () => {
|
|
2279
2284
|
ze(J + 1);
|
|
@@ -2293,23 +2298,23 @@ var M = {
|
|
|
2293
2298
|
})
|
|
2294
2299
|
]
|
|
2295
2300
|
});
|
|
2296
|
-
},
|
|
2301
|
+
}, _t = 8, vt = 6, yt = 120, bt = (e) => {
|
|
2297
2302
|
if (typeof e == "number") return e;
|
|
2298
2303
|
if (typeof e == "string") {
|
|
2299
2304
|
let t = Number.parseFloat(e);
|
|
2300
2305
|
if (Number.isFinite(t)) return t;
|
|
2301
2306
|
}
|
|
2302
2307
|
return Infinity;
|
|
2303
|
-
},
|
|
2308
|
+
}, xt = ({ options: e, value: r, onChange: i, placeholder: a = "Выберите опции", disabled: o = !1, stringWhileDisabled: s = !1, label: c, error: u, size: v = "md", required: y = !1, hint: b, className: x = "", name: S, id: C, closeOnSelect: w = !1, needMark: T = !0, maxMenuHeight: E }) => {
|
|
2304
2309
|
let D = f(), O = C ?? `ds-dropdown-multiple-${S ?? D}`, k = `${O}-listbox`, [A, j] = g(!1), [M, N] = g(null), P = h(null), F = h(null), I = h(null), L = h([]), R = m(() => e.filter((e) => r.includes(e.value)), [e, r]).map((e) => e.label).join(", "), z = b ? `${O}-hint` : void 0, B = u ? `${O}-error` : void 0, te = [z, B].filter(Boolean).join(" ") || void 0, V = o && s, H = l(() => {
|
|
2305
2310
|
let e = F.current, t = I.current;
|
|
2306
2311
|
if (!e || !t) return;
|
|
2307
|
-
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerHeight - n.bottom -
|
|
2312
|
+
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerHeight - n.bottom - _t, a = n.top - _t, o = i < r.height && a > i, s = Math.max(yt, o ? a : i), c = window.innerWidth - n.width - _t;
|
|
2308
2313
|
N({
|
|
2309
|
-
top: o ? Math.max(
|
|
2310
|
-
left: Math.max(
|
|
2314
|
+
top: o ? Math.max(_t, n.top - r.height - vt) : n.bottom + vt,
|
|
2315
|
+
left: Math.max(_t, Math.min(n.left, c)),
|
|
2311
2316
|
width: n.width,
|
|
2312
|
-
maxHeight: Math.min(s,
|
|
2317
|
+
maxHeight: Math.min(s, bt(E))
|
|
2313
2318
|
});
|
|
2314
2319
|
}, [E]);
|
|
2315
2320
|
p(() => {
|
|
@@ -2337,7 +2342,7 @@ var M = {
|
|
|
2337
2342
|
};
|
|
2338
2343
|
}, [A]);
|
|
2339
2344
|
let U = (t, n) => {
|
|
2340
|
-
let r =
|
|
2345
|
+
let r = Ze(e, t, n);
|
|
2341
2346
|
r !== -1 && (L.current[r]?.focus(), L.current[r]?.scrollIntoView({ block: "nearest" }));
|
|
2342
2347
|
}, ne = (t) => {
|
|
2343
2348
|
if (t.disabled) return;
|
|
@@ -2471,7 +2476,7 @@ var M = {
|
|
|
2471
2476
|
})
|
|
2472
2477
|
]
|
|
2473
2478
|
});
|
|
2474
|
-
},
|
|
2479
|
+
}, St = {
|
|
2475
2480
|
wrapper: "_wrapper_1khfq_1",
|
|
2476
2481
|
control: "_control_1khfq_15",
|
|
2477
2482
|
input: "_input_1khfq_25",
|
|
@@ -2481,12 +2486,12 @@ var M = {
|
|
|
2481
2486
|
lg: "_lg_1khfq_139",
|
|
2482
2487
|
inputError: "_inputError_1khfq_155",
|
|
2483
2488
|
trailingAction: "_trailingAction_1khfq_163"
|
|
2484
|
-
},
|
|
2489
|
+
}, Ct = ({ value: e, onChange: r, type: i = "text", placeholder: a = "", disabled: o = !1, readOnly: s = !1, stringWhileDisabled: c = !1, label: l, error: u, hint: p, className: m = "", name: _, id: v, size: y = "md", clearable: b = !0, required: x = !1, selectTextOnFocus: S = !1, isPassword: C = !1, passwordVisibleLabel: w = "Скрыть пароль", passwordHiddenLabel: T = "Показать пароль", onFocus: E, ...D }) => {
|
|
2485
2490
|
let O = f(), k = v ?? `ds-input-${_ ?? O}`, A = h(null), [j, M] = g(!1), P = p ? `${k}-hint` : void 0, F = u ? `${k}-error` : void 0, I = String(e ?? ""), L = [P, F].filter(Boolean).join(" ") || void 0, R = C ? j ? "text" : "password" : i;
|
|
2486
2491
|
return d(() => {
|
|
2487
2492
|
C || M(!1);
|
|
2488
2493
|
}, [C]), /* @__PURE__ */ n("div", {
|
|
2489
|
-
className: `${
|
|
2494
|
+
className: `${St.wrapper} ${m}`,
|
|
2490
2495
|
children: [
|
|
2491
2496
|
l && /* @__PURE__ */ t(ee, {
|
|
2492
2497
|
htmlFor: k,
|
|
@@ -2496,11 +2501,11 @@ var M = {
|
|
|
2496
2501
|
}),
|
|
2497
2502
|
o && c ? /* @__PURE__ */ t("div", {
|
|
2498
2503
|
id: k,
|
|
2499
|
-
className:
|
|
2504
|
+
className: St.disabledText,
|
|
2500
2505
|
"aria-describedby": L,
|
|
2501
2506
|
children: I || a
|
|
2502
2507
|
}) : /* @__PURE__ */ n("div", {
|
|
2503
|
-
className:
|
|
2508
|
+
className: St.control,
|
|
2504
2509
|
children: [
|
|
2505
2510
|
/* @__PURE__ */ t("input", {
|
|
2506
2511
|
ref: A,
|
|
@@ -2514,7 +2519,7 @@ var M = {
|
|
|
2514
2519
|
required: x,
|
|
2515
2520
|
"aria-invalid": !!u,
|
|
2516
2521
|
"aria-describedby": L,
|
|
2517
|
-
className: `${
|
|
2522
|
+
className: `${St.input} ${St[y]} ${u ? St.inputError : ""}`,
|
|
2518
2523
|
onChange: (e) => {
|
|
2519
2524
|
if (i === "number" && !C) {
|
|
2520
2525
|
let t = e.target.value === "" ? "" : Number(e.target.value);
|
|
@@ -2530,7 +2535,7 @@ var M = {
|
|
|
2530
2535
|
}),
|
|
2531
2536
|
C && /* @__PURE__ */ t("button", {
|
|
2532
2537
|
type: "button",
|
|
2533
|
-
className:
|
|
2538
|
+
className: St.trailingAction,
|
|
2534
2539
|
disabled: o,
|
|
2535
2540
|
"aria-label": j ? w : T,
|
|
2536
2541
|
"aria-pressed": j,
|
|
@@ -2543,7 +2548,7 @@ var M = {
|
|
|
2543
2548
|
}),
|
|
2544
2549
|
!C && b && I && !o && !s && /* @__PURE__ */ t("button", {
|
|
2545
2550
|
type: "button",
|
|
2546
|
-
className:
|
|
2551
|
+
className: St.trailingAction,
|
|
2547
2552
|
"aria-label": "Очистить поле",
|
|
2548
2553
|
onClick: () => {
|
|
2549
2554
|
let e = A.current;
|
|
@@ -2568,10 +2573,10 @@ var M = {
|
|
|
2568
2573
|
})
|
|
2569
2574
|
]
|
|
2570
2575
|
});
|
|
2571
|
-
},
|
|
2576
|
+
}, wt = (e, t) => {
|
|
2572
2577
|
let n = t.trim().toLocaleLowerCase();
|
|
2573
2578
|
return n ? e.filter((e) => e.label.toLocaleLowerCase().includes(n) || e.value.toLocaleLowerCase().includes(n)) : e;
|
|
2574
|
-
},
|
|
2579
|
+
}, Tt = (e, t, n) => {
|
|
2575
2580
|
if (!e.length) return -1;
|
|
2576
2581
|
for (let r = 0; r < e.length; r += 1) {
|
|
2577
2582
|
let i = (t + r * n + e.length) % e.length;
|
|
@@ -2596,23 +2601,23 @@ var M = {
|
|
|
2596
2601
|
selected: "_selected_1v2s8_321",
|
|
2597
2602
|
active: "_active_1v2s8_321",
|
|
2598
2603
|
visuallyHidden: "_visuallyHidden_1v2s8_341"
|
|
2599
|
-
},
|
|
2604
|
+
}, Et = 8, Dt = 6, Ot = 5, kt = 10, At = {
|
|
2600
2605
|
sm: 30,
|
|
2601
2606
|
md: 40,
|
|
2602
2607
|
lg: 50
|
|
2603
|
-
},
|
|
2608
|
+
}, 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 }) => {
|
|
2604
2609
|
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 = [
|
|
2605
2610
|
A,
|
|
2606
2611
|
j,
|
|
2607
2612
|
M
|
|
2608
|
-
].filter(Boolean).join(" "), F = h(null), I = h(null), L = h([]), [R, z] = g(!1), [B, te] = g(""), [V, H] = g(-1), [U, ne] = g(null), re = m(() => e.find((e) => e.value === r), [e, r]), ie = m(() =>
|
|
2613
|
+
].filter(Boolean).join(" "), F = h(null), I = h(null), L = h([]), [R, z] = g(!1), [B, te] = g(""), [V, H] = g(-1), [U, ne] = g(null), re = m(() => e.find((e) => e.value === r), [e, r]), ie = m(() => wt(e, B), [e, B]), ae = s && u, oe = V >= 0 ? ie[V] : void 0;
|
|
2609
2614
|
d(() => te(re?.label ?? ""), [re?.label, r]);
|
|
2610
|
-
let se = l(() => F.current?.querySelector("input") ?? null, []), ce = l((e, t) =>
|
|
2615
|
+
let se = l(() => F.current?.querySelector("input") ?? null, []), ce = l((e, t) => Tt(ie, e, t), [ie]), le = l((e) => {
|
|
2611
2616
|
H(e), !(e < 0) && requestAnimationFrame(() => L.current[e]?.scrollIntoView({ block: "nearest" }));
|
|
2612
2617
|
}, []), W = l(() => {
|
|
2613
2618
|
let e = se();
|
|
2614
2619
|
if (!e) return;
|
|
2615
|
-
let t = e.getBoundingClientRect(), n = Math.max(1, Math.min(ie.length,
|
|
2620
|
+
let t = e.getBoundingClientRect(), n = Math.max(1, Math.min(ie.length, Ot)) * At[x] + kt, r = window.innerHeight - t.bottom - Et, i = t.top - Et, a = r < n && i > r, o = a ? i : r, s = Math.max(At[x] + kt, Math.min(n, o)), c = window.innerWidth - t.width - Et, l = Math.max(Et, Math.min(t.left, c)), u = a ? Math.max(Et, t.top - s - Dt) : t.bottom + Dt;
|
|
2616
2621
|
ne({
|
|
2617
2622
|
top: u,
|
|
2618
2623
|
left: l,
|
|
@@ -2717,7 +2722,7 @@ var M = {
|
|
|
2717
2722
|
children: re?.label ?? a
|
|
2718
2723
|
}) : /* @__PURE__ */ n("div", {
|
|
2719
2724
|
className: Q.control,
|
|
2720
|
-
children: [/* @__PURE__ */ t(
|
|
2725
|
+
children: [/* @__PURE__ */ t(Ct, {
|
|
2721
2726
|
id: O,
|
|
2722
2727
|
name: w,
|
|
2723
2728
|
value: B,
|
|
@@ -2731,8 +2736,8 @@ var M = {
|
|
|
2731
2736
|
className: `${Q.inputHost} ${Q[x]}`,
|
|
2732
2737
|
onFocus: ue,
|
|
2733
2738
|
onChange: (t) => {
|
|
2734
|
-
let n = String(t), r =
|
|
2735
|
-
te(n), z(!0), H(
|
|
2739
|
+
let n = String(t), r = wt(e, n);
|
|
2740
|
+
te(n), z(!0), H(Tt(r, 0, 1));
|
|
2736
2741
|
},
|
|
2737
2742
|
role: "combobox",
|
|
2738
2743
|
"aria-autocomplete": "list",
|
|
@@ -2784,25 +2789,25 @@ var M = {
|
|
|
2784
2789
|
})
|
|
2785
2790
|
]
|
|
2786
2791
|
});
|
|
2787
|
-
},
|
|
2792
|
+
}, Mt = {
|
|
2788
2793
|
root: "_root_11adi_1",
|
|
2789
2794
|
header: "_header_11adi_21",
|
|
2790
2795
|
title: "_title_11adi_41",
|
|
2791
2796
|
dismiss: "_dismiss_11adi_55",
|
|
2792
2797
|
content: "_content_11adi_65"
|
|
2793
|
-
},
|
|
2798
|
+
}, Nt = ({ title: e, children: r, dismissible: i = !1, onDismiss: a, dismissLabel: o = "Закрыть информационный блок", headingAs: s = "h3", className: c = "" }) => {
|
|
2794
2799
|
let l = `ds-info-block-${f()}`;
|
|
2795
2800
|
return /* @__PURE__ */ n("section", {
|
|
2796
|
-
className: `${
|
|
2801
|
+
className: `${Mt.root} ${c}`,
|
|
2797
2802
|
"aria-labelledby": l,
|
|
2798
2803
|
children: [/* @__PURE__ */ n("header", {
|
|
2799
|
-
className:
|
|
2804
|
+
className: Mt.header,
|
|
2800
2805
|
children: [/* @__PURE__ */ t(s, {
|
|
2801
2806
|
id: l,
|
|
2802
|
-
className:
|
|
2807
|
+
className: Mt.title,
|
|
2803
2808
|
children: e
|
|
2804
2809
|
}), i && /* @__PURE__ */ t(j, {
|
|
2805
|
-
className:
|
|
2810
|
+
className: Mt.dismiss,
|
|
2806
2811
|
variant: "empty",
|
|
2807
2812
|
onClick: a,
|
|
2808
2813
|
"aria-label": o,
|
|
@@ -2813,26 +2818,26 @@ var M = {
|
|
|
2813
2818
|
})
|
|
2814
2819
|
})]
|
|
2815
2820
|
}), /* @__PURE__ */ t("div", {
|
|
2816
|
-
className:
|
|
2821
|
+
className: Mt.content,
|
|
2817
2822
|
children: r
|
|
2818
2823
|
})]
|
|
2819
2824
|
});
|
|
2820
|
-
},
|
|
2825
|
+
}, Pt = {
|
|
2821
2826
|
wrapper: "_wrapper_1jspu_1",
|
|
2822
2827
|
input: "_input_1jspu_21",
|
|
2823
2828
|
switch: "_switch_1jspu_35",
|
|
2824
2829
|
thumb: "_thumb_1jspu_67",
|
|
2825
2830
|
label: "_label_1jspu_113",
|
|
2826
2831
|
disabled: "_disabled_1jspu_125"
|
|
2827
|
-
},
|
|
2832
|
+
}, Ft = ({ checked: e, onChange: r, label: i, disabled: a = !1, readOnly: o = !1, className: s = "", name: c, id: l, value: u }) => {
|
|
2828
2833
|
let d = f(), p = l ?? `ds-radio-button-${c ?? d}`;
|
|
2829
2834
|
return /* @__PURE__ */ n("label", {
|
|
2830
2835
|
htmlFor: p,
|
|
2831
|
-
className: `${
|
|
2836
|
+
className: `${Pt.wrapper} ${a ? Pt.disabled : ""} ${s}`,
|
|
2832
2837
|
children: [
|
|
2833
2838
|
/* @__PURE__ */ t("input", {
|
|
2834
2839
|
id: p,
|
|
2835
|
-
className:
|
|
2840
|
+
className: Pt.input,
|
|
2836
2841
|
type: "checkbox",
|
|
2837
2842
|
role: "switch",
|
|
2838
2843
|
name: c,
|
|
@@ -2845,21 +2850,21 @@ var M = {
|
|
|
2845
2850
|
}
|
|
2846
2851
|
}),
|
|
2847
2852
|
/* @__PURE__ */ t("span", {
|
|
2848
|
-
className:
|
|
2853
|
+
className: Pt.switch,
|
|
2849
2854
|
"aria-hidden": "true",
|
|
2850
|
-
children: /* @__PURE__ */ t("span", { className:
|
|
2855
|
+
children: /* @__PURE__ */ t("span", { className: Pt.thumb })
|
|
2851
2856
|
}),
|
|
2852
2857
|
i && /* @__PURE__ */ t("span", {
|
|
2853
|
-
className:
|
|
2858
|
+
className: Pt.label,
|
|
2854
2859
|
children: i
|
|
2855
2860
|
})
|
|
2856
2861
|
]
|
|
2857
2862
|
});
|
|
2858
|
-
},
|
|
2863
|
+
}, It = {
|
|
2859
2864
|
root: "_root_1ecm3_1",
|
|
2860
2865
|
grid: "_grid_1ecm3_13",
|
|
2861
2866
|
actions: "_actions_1ecm3_27"
|
|
2862
|
-
},
|
|
2867
|
+
}, Lt = ({ filters: e, values: r, onChange: i, onApply: a, onReset: o, applyMode: s = "instant", loading: c = !1, disabled: l = !1, className: u = "" }) => {
|
|
2863
2868
|
let d = (e, t) => {
|
|
2864
2869
|
let n = {
|
|
2865
2870
|
...r,
|
|
@@ -2868,11 +2873,11 @@ var M = {
|
|
|
2868
2873
|
i?.(n, e), s === "instant" && a?.(n);
|
|
2869
2874
|
};
|
|
2870
2875
|
return /* @__PURE__ */ n("section", {
|
|
2871
|
-
className: `${
|
|
2876
|
+
className: `${It.root} ${u}`,
|
|
2872
2877
|
"aria-label": "Фильтры",
|
|
2873
2878
|
"aria-busy": c,
|
|
2874
2879
|
children: [/* @__PURE__ */ t("div", {
|
|
2875
|
-
className:
|
|
2880
|
+
className: It.grid,
|
|
2876
2881
|
children: e.filter((e) => !e.hidden).map((e) => {
|
|
2877
2882
|
let n = l || c || e.disabled, i = r[e.id];
|
|
2878
2883
|
if (e.type === "input") {
|
|
@@ -2882,19 +2887,19 @@ var M = {
|
|
|
2882
2887
|
placeholder: e.placeholder,
|
|
2883
2888
|
disabled: n
|
|
2884
2889
|
};
|
|
2885
|
-
return e.inputType === "number" ? /* @__PURE__ */ t(
|
|
2890
|
+
return e.inputType === "number" ? /* @__PURE__ */ t(Ct, {
|
|
2886
2891
|
...r,
|
|
2887
2892
|
type: "number",
|
|
2888
2893
|
value: i ?? "",
|
|
2889
2894
|
onChange: (t) => d(e.id, t)
|
|
2890
|
-
}, e.id) : /* @__PURE__ */ t(
|
|
2895
|
+
}, e.id) : /* @__PURE__ */ t(Ct, {
|
|
2891
2896
|
...r,
|
|
2892
2897
|
type: "text",
|
|
2893
2898
|
value: String(i ?? ""),
|
|
2894
2899
|
onChange: (t) => d(e.id, t)
|
|
2895
2900
|
}, e.id);
|
|
2896
2901
|
}
|
|
2897
|
-
if (e.type === "dropdown") return /* @__PURE__ */ t(
|
|
2902
|
+
if (e.type === "dropdown") return /* @__PURE__ */ t($e, {
|
|
2898
2903
|
label: e.label,
|
|
2899
2904
|
hint: e.hint,
|
|
2900
2905
|
placeholder: e.placeholder,
|
|
@@ -2903,7 +2908,7 @@ var M = {
|
|
|
2903
2908
|
disabled: n,
|
|
2904
2909
|
onChange: (t) => d(e.id, t)
|
|
2905
2910
|
}, e.id);
|
|
2906
|
-
if (e.type === "multiple") return /* @__PURE__ */ t(
|
|
2911
|
+
if (e.type === "multiple") return /* @__PURE__ */ t(xt, {
|
|
2907
2912
|
label: e.label,
|
|
2908
2913
|
hint: e.hint,
|
|
2909
2914
|
placeholder: e.placeholder,
|
|
@@ -2919,7 +2924,7 @@ var M = {
|
|
|
2919
2924
|
disabled: n,
|
|
2920
2925
|
onChange: (t) => d(e.id, t)
|
|
2921
2926
|
}, e.id);
|
|
2922
|
-
if (e.type === "radio") return /* @__PURE__ */ t(
|
|
2927
|
+
if (e.type === "radio") return /* @__PURE__ */ t(Ft, {
|
|
2923
2928
|
label: e.label,
|
|
2924
2929
|
checked: !!i,
|
|
2925
2930
|
disabled: n,
|
|
@@ -2929,7 +2934,7 @@ var M = {
|
|
|
2929
2934
|
from: null,
|
|
2930
2935
|
to: null
|
|
2931
2936
|
};
|
|
2932
|
-
return /* @__PURE__ */ t(
|
|
2937
|
+
return /* @__PURE__ */ t(Ge, {
|
|
2933
2938
|
hint: e.hint,
|
|
2934
2939
|
mode: e.mode,
|
|
2935
2940
|
min: e.min,
|
|
@@ -2940,7 +2945,7 @@ var M = {
|
|
|
2940
2945
|
}, e.id);
|
|
2941
2946
|
})
|
|
2942
2947
|
}), (o || s === "manual") && /* @__PURE__ */ n("div", {
|
|
2943
|
-
className:
|
|
2948
|
+
className: It.actions,
|
|
2944
2949
|
children: [o && /* @__PURE__ */ t(j, {
|
|
2945
2950
|
variant: "destructiveOutline",
|
|
2946
2951
|
disabled: l || c,
|
|
@@ -2954,7 +2959,7 @@ var M = {
|
|
|
2954
2959
|
})]
|
|
2955
2960
|
})]
|
|
2956
2961
|
});
|
|
2957
|
-
},
|
|
2962
|
+
}, Rt = {
|
|
2958
2963
|
grid: "_grid_1q540_1",
|
|
2959
2964
|
comfortable: "_comfortable_1q540_11",
|
|
2960
2965
|
compact: "_compact_1q540_19",
|
|
@@ -2971,23 +2976,23 @@ var M = {
|
|
|
2971
2976
|
summary: "_summary_1q540_101",
|
|
2972
2977
|
summaryTitle: "_summaryTitle_1q540_137",
|
|
2973
2978
|
summaryList: "_summaryList_1q540_145"
|
|
2974
|
-
},
|
|
2979
|
+
}, zt = ({ columns: e = 2, density: n = "comfortable", className: r = "", ...i }) => /* @__PURE__ */ t("div", {
|
|
2975
2980
|
...i,
|
|
2976
|
-
className: `${
|
|
2977
|
-
}),
|
|
2981
|
+
className: `${Rt.grid} ${Rt[`columns${e}`]} ${Rt[n]} ${r}`
|
|
2982
|
+
}), Bt = ({ span: e = 1, className: n = "", ...r }) => /* @__PURE__ */ t("div", {
|
|
2978
2983
|
...r,
|
|
2979
|
-
className: `${
|
|
2980
|
-
}),
|
|
2984
|
+
className: `${Rt.item} ${Rt[`span${e}`]} ${n}`
|
|
2985
|
+
}), Vt = ({ title: e = "Проверьте заполнение формы", items: r, focusField: i, className: a = "", ...o }) => r.length === 0 ? null : /* @__PURE__ */ n("div", {
|
|
2981
2986
|
...o,
|
|
2982
|
-
className: `${
|
|
2987
|
+
className: `${Rt.summary} ${a}`,
|
|
2983
2988
|
role: "alert",
|
|
2984
2989
|
"aria-atomic": "true",
|
|
2985
2990
|
tabIndex: -1,
|
|
2986
2991
|
children: [/* @__PURE__ */ t("strong", {
|
|
2987
|
-
className:
|
|
2992
|
+
className: Rt.summaryTitle,
|
|
2988
2993
|
children: e
|
|
2989
2994
|
}), /* @__PURE__ */ t("ul", {
|
|
2990
|
-
className:
|
|
2995
|
+
className: Rt.summaryList,
|
|
2991
2996
|
children: r.map((e) => /* @__PURE__ */ t("li", { children: e.fieldId ? /* @__PURE__ */ t("a", {
|
|
2992
2997
|
href: `#${e.fieldId}`,
|
|
2993
2998
|
onClick: (t) => {
|
|
@@ -2996,7 +3001,7 @@ var M = {
|
|
|
2996
3001
|
children: e.message
|
|
2997
3002
|
}) : e.message }, e.id))
|
|
2998
3003
|
})]
|
|
2999
|
-
}),
|
|
3004
|
+
}), Ht = {
|
|
3000
3005
|
wrapper: "_wrapper_i20hz_1",
|
|
3001
3006
|
dropzone: "_dropzone_i20hz_15",
|
|
3002
3007
|
dragActive: "_dragActive_i20hz_45",
|
|
@@ -3009,12 +3014,12 @@ var M = {
|
|
|
3009
3014
|
file: "_file_i20hz_133",
|
|
3010
3015
|
fileName: "_fileName_i20hz_175",
|
|
3011
3016
|
fileSize: "_fileSize_i20hz_187"
|
|
3012
|
-
},
|
|
3017
|
+
}, Ut = (e) => `${e.name}:${e.size}:${e.lastModified}`, Wt = (e) => e < 1024 ? `${e} Б` : e < 1048576 ? `${(e / 1024).toFixed(1)} КБ` : `${(e / 1024 / 1024).toFixed(1)} МБ`, Gt = (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), Kt = ({ 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 }) => {
|
|
3013
3018
|
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) => {
|
|
3014
|
-
let t = [], n = new Set(r.map(
|
|
3019
|
+
let t = [], n = new Set(r.map(Ut)), l = e.filter((e) => Gt(e, o) ? s !== void 0 && e.size > s ? (t.push({
|
|
3015
3020
|
file: e,
|
|
3016
3021
|
reason: "maxSize"
|
|
3017
|
-
}), !1) : !n.has(
|
|
3022
|
+
}), !1) : !n.has(Ut(e)) && (n.add(Ut(e)), !0) : (t.push({
|
|
3018
3023
|
file: e,
|
|
3019
3024
|
reason: "accept"
|
|
3020
3025
|
}), !1)), u = a ? c : 1, d = a ? [...r, ...l] : l.slice(-1);
|
|
@@ -3024,7 +3029,7 @@ var M = {
|
|
|
3024
3029
|
})), d = d.slice(0, u)), t.length && w?.(t), l.length && i?.(d), D.current && (D.current.value = "");
|
|
3025
3030
|
};
|
|
3026
3031
|
return /* @__PURE__ */ n("div", {
|
|
3027
|
-
className: `${
|
|
3032
|
+
className: `${Ht.wrapper} ${b}`,
|
|
3028
3033
|
children: [
|
|
3029
3034
|
l && /* @__PURE__ */ t(ee, {
|
|
3030
3035
|
htmlFor: E,
|
|
@@ -3033,7 +3038,7 @@ var M = {
|
|
|
3033
3038
|
children: l
|
|
3034
3039
|
}),
|
|
3035
3040
|
/* @__PURE__ */ n("div", {
|
|
3036
|
-
className: `${
|
|
3041
|
+
className: `${Ht.dropzone} ${k ? Ht.dragActive : ""} ${m ? Ht.disabled : ""} ${d ? Ht.error : ""}`,
|
|
3037
3042
|
onDragEnter: (e) => {
|
|
3038
3043
|
e.preventDefault(), I && ++O.current === 1 && A(!0);
|
|
3039
3044
|
},
|
|
@@ -3048,7 +3053,7 @@ var M = {
|
|
|
3048
3053
|
ref: D,
|
|
3049
3054
|
id: E,
|
|
3050
3055
|
name: v,
|
|
3051
|
-
className:
|
|
3056
|
+
className: Ht.nativeInput,
|
|
3052
3057
|
type: "file",
|
|
3053
3058
|
multiple: a,
|
|
3054
3059
|
accept: o,
|
|
@@ -3059,19 +3064,19 @@ var M = {
|
|
|
3059
3064
|
onChange: (e) => L(Array.from(e.target.files ?? []))
|
|
3060
3065
|
}), r.length ? /* @__PURE__ */ n(e, { children: [
|
|
3061
3066
|
/* @__PURE__ */ t("ul", {
|
|
3062
|
-
className:
|
|
3067
|
+
className: Ht.files,
|
|
3063
3068
|
"aria-live": "polite",
|
|
3064
3069
|
children: r.map((e, a) => /* @__PURE__ */ n("li", {
|
|
3065
|
-
className:
|
|
3070
|
+
className: Ht.file,
|
|
3066
3071
|
children: [
|
|
3067
3072
|
/* @__PURE__ */ t("span", {
|
|
3068
|
-
className:
|
|
3073
|
+
className: Ht.fileName,
|
|
3069
3074
|
title: e.name,
|
|
3070
3075
|
children: e.name
|
|
3071
3076
|
}),
|
|
3072
3077
|
/* @__PURE__ */ t("span", {
|
|
3073
|
-
className:
|
|
3074
|
-
children:
|
|
3078
|
+
className: Ht.fileSize,
|
|
3079
|
+
children: Wt(e.size)
|
|
3075
3080
|
}),
|
|
3076
3081
|
I && /* @__PURE__ */ t(j, {
|
|
3077
3082
|
variant: "empty",
|
|
@@ -3085,25 +3090,25 @@ var M = {
|
|
|
3085
3090
|
})
|
|
3086
3091
|
})
|
|
3087
3092
|
]
|
|
3088
|
-
},
|
|
3093
|
+
}, Ut(e)))
|
|
3089
3094
|
}),
|
|
3090
3095
|
I && (a || r.length === 0) && /* @__PURE__ */ t(j, {
|
|
3091
|
-
className:
|
|
3096
|
+
className: Ht.browseButton,
|
|
3092
3097
|
size: "sm",
|
|
3093
3098
|
onClick: () => D.current?.click(),
|
|
3094
3099
|
children: C
|
|
3095
3100
|
}),
|
|
3096
3101
|
I && !a && /* @__PURE__ */ t(j, {
|
|
3097
|
-
className:
|
|
3102
|
+
className: Ht.browseButton,
|
|
3098
3103
|
size: "sm",
|
|
3099
3104
|
onClick: () => D.current?.click(),
|
|
3100
3105
|
children: S
|
|
3101
3106
|
})
|
|
3102
3107
|
] }) : /* @__PURE__ */ n("div", {
|
|
3103
|
-
className:
|
|
3108
|
+
className: Ht.empty,
|
|
3104
3109
|
children: [
|
|
3105
3110
|
/* @__PURE__ */ t("span", {
|
|
3106
|
-
className:
|
|
3111
|
+
className: Ht.uploadIcon,
|
|
3107
3112
|
"aria-hidden": "true",
|
|
3108
3113
|
children: /* @__PURE__ */ t(q, {
|
|
3109
3114
|
name: "IconUpload",
|
|
@@ -3131,7 +3136,7 @@ var M = {
|
|
|
3131
3136
|
})
|
|
3132
3137
|
]
|
|
3133
3138
|
});
|
|
3134
|
-
},
|
|
3139
|
+
}, qt = ({ children: e, containerId: t = "overlay-root" }) => {
|
|
3135
3140
|
let [n, r] = g(null);
|
|
3136
3141
|
return d(() => {
|
|
3137
3142
|
let e = document.getElementById(t);
|
|
@@ -3144,7 +3149,7 @@ var M = {
|
|
|
3144
3149
|
n.childElementCount === 0 && n.parentElement && n.remove();
|
|
3145
3150
|
};
|
|
3146
3151
|
}, [t]), n ? _(e, n) : null;
|
|
3147
|
-
},
|
|
3152
|
+
}, Jt = ({ anchorRef: e, children: n, matchAnchorWidth: r = !1, offset: i = 4, className: a }) => {
|
|
3148
3153
|
let o = h(null), [s, c] = g({
|
|
3149
3154
|
position: "fixed",
|
|
3150
3155
|
visibility: "hidden",
|
|
@@ -3168,13 +3173,13 @@ var M = {
|
|
|
3168
3173
|
]);
|
|
3169
3174
|
return p(() => (u(), window.addEventListener("resize", u), window.addEventListener("scroll", u, !0), () => {
|
|
3170
3175
|
window.removeEventListener("resize", u), window.removeEventListener("scroll", u, !0);
|
|
3171
|
-
}), [u]), /* @__PURE__ */ t(
|
|
3176
|
+
}), [u]), /* @__PURE__ */ t(qt, { children: /* @__PURE__ */ t("div", {
|
|
3172
3177
|
ref: o,
|
|
3173
3178
|
className: a,
|
|
3174
3179
|
style: s,
|
|
3175
3180
|
children: n
|
|
3176
3181
|
}) });
|
|
3177
|
-
},
|
|
3182
|
+
}, Yt = {
|
|
3178
3183
|
wrapper: "_wrapper_x2gki_1",
|
|
3179
3184
|
control: "_control_x2gki_15",
|
|
3180
3185
|
textarea: "_textarea_x2gki_25",
|
|
@@ -3188,12 +3193,12 @@ var M = {
|
|
|
3188
3193
|
clearAction: "_clearAction_x2gki_171",
|
|
3189
3194
|
messages: "_messages_x2gki_251",
|
|
3190
3195
|
counter: "_counter_x2gki_265"
|
|
3191
|
-
},
|
|
3192
|
-
function
|
|
3196
|
+
}, Xt = 2;
|
|
3197
|
+
function Zt(e) {
|
|
3193
3198
|
let t = window.getComputedStyle(e), n = Number.parseFloat(t.lineHeight);
|
|
3194
3199
|
return Number.isFinite(n) ? n : Number.parseFloat(t.fontSize) * 1.4;
|
|
3195
3200
|
}
|
|
3196
|
-
function
|
|
3201
|
+
function Qt({ 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 = Xt, maxRows: w, autoResize: T = !0, ...E }) {
|
|
3197
3202
|
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 = [
|
|
3198
3203
|
A,
|
|
3199
3204
|
j,
|
|
@@ -3201,7 +3206,7 @@ function Zt({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
|
|
|
3201
3206
|
].filter(Boolean).join(" ") || void 0, F = Math.max(1, C), I = w === void 0 ? void 0 : Math.max(F, w), L = l(() => {
|
|
3202
3207
|
let e = k.current;
|
|
3203
3208
|
if (!e || !T) return;
|
|
3204
|
-
let t = window.getComputedStyle(e), n =
|
|
3209
|
+
let t = window.getComputedStyle(e), n = Zt(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;
|
|
3205
3210
|
e.style.height = "auto";
|
|
3206
3211
|
let o = Math.min(Math.max(e.scrollHeight, i), a);
|
|
3207
3212
|
e.style.height = `${o}px`, e.style.overflowY = e.scrollHeight > a ? "auto" : "hidden";
|
|
@@ -3233,7 +3238,7 @@ function Zt({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
|
|
|
3233
3238
|
e && ((Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set)?.call(e, ""), e.dispatchEvent(new Event("input", { bubbles: !0 })), e.focus(), L());
|
|
3234
3239
|
}, B = { "--ds-textarea-min-rows": F };
|
|
3235
3240
|
return /* @__PURE__ */ n("div", {
|
|
3236
|
-
className: `${
|
|
3241
|
+
className: `${Yt.wrapper} ${m}`,
|
|
3237
3242
|
children: [
|
|
3238
3243
|
c && /* @__PURE__ */ t(ee, {
|
|
3239
3244
|
htmlFor: O,
|
|
@@ -3243,12 +3248,12 @@ function Zt({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
|
|
|
3243
3248
|
}),
|
|
3244
3249
|
a && s ? /* @__PURE__ */ t("div", {
|
|
3245
3250
|
id: O,
|
|
3246
|
-
className: `${
|
|
3251
|
+
className: `${Yt.disabledText} ${Yt[v]}`,
|
|
3247
3252
|
style: B,
|
|
3248
3253
|
"aria-describedby": P,
|
|
3249
3254
|
children: e || i
|
|
3250
3255
|
}) : /* @__PURE__ */ n("div", {
|
|
3251
|
-
className:
|
|
3256
|
+
className: Yt.control,
|
|
3252
3257
|
children: [/* @__PURE__ */ t("textarea", {
|
|
3253
3258
|
ref: k,
|
|
3254
3259
|
id: O,
|
|
@@ -3263,12 +3268,12 @@ function Zt({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
|
|
|
3263
3268
|
style: B,
|
|
3264
3269
|
"aria-invalid": !!u,
|
|
3265
3270
|
"aria-describedby": P,
|
|
3266
|
-
className: `${
|
|
3271
|
+
className: `${Yt.textarea} ${Yt[v]} ${T ? Yt.autoResize : Yt.manualResize} ${u ? Yt.textareaError : ""}`,
|
|
3267
3272
|
onChange: R,
|
|
3268
3273
|
...E
|
|
3269
3274
|
}), y && e && !a && !o && /* @__PURE__ */ t("button", {
|
|
3270
3275
|
type: "button",
|
|
3271
|
-
className:
|
|
3276
|
+
className: Yt.clearAction,
|
|
3272
3277
|
"aria-label": "Очистить поле",
|
|
3273
3278
|
onClick: z,
|
|
3274
3279
|
children: /* @__PURE__ */ t(q, {
|
|
@@ -3279,7 +3284,7 @@ function Zt({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
|
|
|
3279
3284
|
})]
|
|
3280
3285
|
}),
|
|
3281
3286
|
(p || u || M) && /* @__PURE__ */ n("div", {
|
|
3282
|
-
className:
|
|
3287
|
+
className: Yt.messages,
|
|
3283
3288
|
children: [
|
|
3284
3289
|
p && !u && /* @__PURE__ */ t(N, {
|
|
3285
3290
|
id: A,
|
|
@@ -3292,7 +3297,7 @@ function Zt({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
|
|
|
3292
3297
|
}),
|
|
3293
3298
|
M && /* @__PURE__ */ n("span", {
|
|
3294
3299
|
id: M,
|
|
3295
|
-
className:
|
|
3300
|
+
className: Yt.counter,
|
|
3296
3301
|
children: [
|
|
3297
3302
|
e.length,
|
|
3298
3303
|
" / ",
|
|
@@ -3306,11 +3311,11 @@ function Zt({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
|
|
|
3306
3311
|
}
|
|
3307
3312
|
//#endregion
|
|
3308
3313
|
//#region src/components/DSModal/modal.store.ts
|
|
3309
|
-
var
|
|
3314
|
+
var $t = 0, en = S((e, t) => ({
|
|
3310
3315
|
modals: [],
|
|
3311
3316
|
openModal: (t, n = {}, r = {}) => {
|
|
3312
|
-
|
|
3313
|
-
let i = `ds-modal-${
|
|
3317
|
+
$t += 1;
|
|
3318
|
+
let i = `ds-modal-${$t}`;
|
|
3314
3319
|
return e((e) => ({ modals: [...e.modals, {
|
|
3315
3320
|
id: i,
|
|
3316
3321
|
name: t,
|
|
@@ -3334,10 +3339,10 @@ var Qt = 0, $t = S((e, t) => ({
|
|
|
3334
3339
|
let n = t().modals;
|
|
3335
3340
|
n.length && (e({ modals: [] }), n.forEach((e) => e.onClose?.()));
|
|
3336
3341
|
}
|
|
3337
|
-
})),
|
|
3338
|
-
|
|
3339
|
-
},
|
|
3340
|
-
function
|
|
3342
|
+
})), tn = () => {
|
|
3343
|
+
en.getState().closeAllModals(), $t = 0;
|
|
3344
|
+
}, nn = 8, rn = 96, an = .55;
|
|
3345
|
+
function on(e, t, n) {
|
|
3341
3346
|
return {
|
|
3342
3347
|
startX: e,
|
|
3343
3348
|
startY: t,
|
|
@@ -3345,16 +3350,16 @@ function an(e, t, n) {
|
|
|
3345
3350
|
intent: "pending"
|
|
3346
3351
|
};
|
|
3347
3352
|
}
|
|
3348
|
-
function
|
|
3353
|
+
function sn(e, t, n) {
|
|
3349
3354
|
let r = t - e.startX, i = n - e.startY;
|
|
3350
|
-
return e.intent === "pending" && Math.max(Math.abs(r), Math.abs(i)) >=
|
|
3355
|
+
return e.intent === "pending" && Math.max(Math.abs(r), Math.abs(i)) >= nn && (e.intent = Math.abs(i) > Math.abs(r) ? "vertical" : "horizontal"), e.intent === "vertical" ? Math.max(0, i) : 0;
|
|
3351
3356
|
}
|
|
3352
|
-
function
|
|
3357
|
+
function cn(e, t, n) {
|
|
3353
3358
|
if (e.intent !== "vertical") return !1;
|
|
3354
3359
|
let r = Math.max(0, t - e.startY), i = Math.max(1, n - e.startTime);
|
|
3355
|
-
return r >=
|
|
3360
|
+
return r >= rn || r >= 32 && r / i >= an;
|
|
3356
3361
|
}
|
|
3357
|
-
var
|
|
3362
|
+
var ln = {
|
|
3358
3363
|
layer: "_layer_w9isk_1",
|
|
3359
3364
|
backdrop: "_backdrop_w9isk_15",
|
|
3360
3365
|
"backdrop-enter": "_backdrop-enter_w9isk_1",
|
|
@@ -3367,10 +3372,10 @@ var cn = {
|
|
|
3367
3372
|
close: "_close_w9isk_141",
|
|
3368
3373
|
dragHandle: "_dragHandle_w9isk_149",
|
|
3369
3374
|
"sheet-enter": "_sheet-enter_w9isk_1"
|
|
3370
|
-
},
|
|
3371
|
-
function
|
|
3375
|
+
}, un = "button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"])", dn = a({});
|
|
3376
|
+
function fn(e) {
|
|
3372
3377
|
if (e.key !== "Tab") return;
|
|
3373
|
-
let t = Array.from(e.currentTarget.querySelectorAll(
|
|
3378
|
+
let t = Array.from(e.currentTarget.querySelectorAll(un));
|
|
3374
3379
|
if (!t.length) {
|
|
3375
3380
|
e.preventDefault();
|
|
3376
3381
|
return;
|
|
@@ -3378,18 +3383,18 @@ function dn(e) {
|
|
|
3378
3383
|
let n = t[0], r = t.at(-1);
|
|
3379
3384
|
e.shiftKey && document.activeElement === n ? (e.preventDefault(), r?.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n?.focus());
|
|
3380
3385
|
}
|
|
3381
|
-
var
|
|
3382
|
-
let l = u(
|
|
3386
|
+
var pn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "Закрыть модальное окно", className: s = "", role: c = "dialog" }) => {
|
|
3387
|
+
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 = en((e) => e.closeModal), D = l.requestClose ?? (() => E(a)), O = p != null, k = m != null;
|
|
3383
3388
|
d(() => {
|
|
3384
3389
|
let e = document.activeElement, t = y.current;
|
|
3385
|
-
return (t?.querySelector(
|
|
3390
|
+
return (t?.querySelector(un) ?? t)?.focus(), () => e?.focus();
|
|
3386
3391
|
}, []);
|
|
3387
3392
|
let A = (e) => {
|
|
3388
3393
|
e && x.current !== null && e.hasPointerCapture(x.current) && e.releasePointerCapture(x.current), b.current = null, x.current = null, T(!1), C(0);
|
|
3389
3394
|
};
|
|
3390
3395
|
return /* @__PURE__ */ n("div", {
|
|
3391
3396
|
ref: y,
|
|
3392
|
-
className: `${
|
|
3397
|
+
className: `${ln.panel} ${s}`,
|
|
3393
3398
|
"data-closing": l.closing || void 0,
|
|
3394
3399
|
"data-dragging": w || void 0,
|
|
3395
3400
|
style: { "--ds-modal-drag-offset": `${S}px` },
|
|
@@ -3398,36 +3403,36 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3398
3403
|
"aria-labelledby": O ? _ : void 0,
|
|
3399
3404
|
"aria-describedby": k ? v : void 0,
|
|
3400
3405
|
tabIndex: -1,
|
|
3401
|
-
onKeyDown:
|
|
3406
|
+
onKeyDown: fn,
|
|
3402
3407
|
children: [
|
|
3403
3408
|
/* @__PURE__ */ t("button", {
|
|
3404
3409
|
type: "button",
|
|
3405
|
-
className:
|
|
3410
|
+
className: ln.dragHandle,
|
|
3406
3411
|
"aria-label": "Потяните вниз, чтобы закрыть модальное окно",
|
|
3407
3412
|
onPointerDown: (e) => {
|
|
3408
|
-
(e.pointerType !== "mouse" || e.button === 0) && (x.current = e.pointerId, b.current =
|
|
3413
|
+
(e.pointerType !== "mouse" || e.button === 0) && (x.current = e.pointerId, b.current = on(e.clientX, e.clientY, e.timeStamp), e.currentTarget.setPointerCapture(e.pointerId));
|
|
3409
3414
|
},
|
|
3410
3415
|
onPointerMove: (e) => {
|
|
3411
3416
|
if (e.pointerId !== x.current || !b.current) return;
|
|
3412
|
-
let t =
|
|
3417
|
+
let t = sn(b.current, e.clientX, e.clientY);
|
|
3413
3418
|
b.current.intent === "vertical" && (e.preventDefault(), T(!0), C(t));
|
|
3414
3419
|
},
|
|
3415
3420
|
onPointerUp: (e) => {
|
|
3416
3421
|
if (e.pointerId !== x.current || !b.current) return;
|
|
3417
|
-
let t =
|
|
3422
|
+
let t = cn(b.current, e.clientY, e.timeStamp);
|
|
3418
3423
|
A(e.currentTarget), t && D();
|
|
3419
3424
|
},
|
|
3420
3425
|
onPointerCancel: (e) => A(e.currentTarget),
|
|
3421
3426
|
children: /* @__PURE__ */ t("span", {})
|
|
3422
3427
|
}),
|
|
3423
3428
|
(O || o) && /* @__PURE__ */ n("header", {
|
|
3424
|
-
className:
|
|
3429
|
+
className: ln.header,
|
|
3425
3430
|
children: [O && /* @__PURE__ */ t("h2", {
|
|
3426
3431
|
id: _,
|
|
3427
|
-
className:
|
|
3432
|
+
className: ln.title,
|
|
3428
3433
|
children: p
|
|
3429
3434
|
}), /* @__PURE__ */ t(j, {
|
|
3430
|
-
className:
|
|
3435
|
+
className: ln.close,
|
|
3431
3436
|
variant: "empty",
|
|
3432
3437
|
size: "sm",
|
|
3433
3438
|
"aria-label": o,
|
|
@@ -3441,17 +3446,17 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3441
3446
|
}),
|
|
3442
3447
|
k && /* @__PURE__ */ t("p", {
|
|
3443
3448
|
id: v,
|
|
3444
|
-
className:
|
|
3449
|
+
className: ln.description,
|
|
3445
3450
|
children: m
|
|
3446
3451
|
}),
|
|
3447
3452
|
/* @__PURE__ */ t("div", {
|
|
3448
|
-
className:
|
|
3453
|
+
className: ln.content,
|
|
3449
3454
|
children: e
|
|
3450
3455
|
})
|
|
3451
3456
|
]
|
|
3452
3457
|
});
|
|
3453
|
-
},
|
|
3454
|
-
let n =
|
|
3458
|
+
}, mn = ({ registry: e }) => {
|
|
3459
|
+
let n = en((e) => e.modals), r = en((e) => e.closeModal), [i, a] = g(() => /* @__PURE__ */ new Set()), o = h(/* @__PURE__ */ new Map()), s = (e) => {
|
|
3455
3460
|
if (o.current.has(e)) return;
|
|
3456
3461
|
a((t) => new Set(t).add(e));
|
|
3457
3462
|
let t = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
@@ -3467,7 +3472,7 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3467
3472
|
return () => e.forEach((e) => window.clearTimeout(e));
|
|
3468
3473
|
}, []), d(() => {
|
|
3469
3474
|
let e = (e) => {
|
|
3470
|
-
let t =
|
|
3475
|
+
let t = en.getState().modals.at(-1);
|
|
3471
3476
|
e.key === "Escape" && t?.closeOnEscape && s(t.id);
|
|
3472
3477
|
};
|
|
3473
3478
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
@@ -3480,21 +3485,21 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3480
3485
|
n,
|
|
3481
3486
|
e
|
|
3482
3487
|
]), !n.length || typeof document > "u" ? null : _(/* @__PURE__ */ t("div", {
|
|
3483
|
-
className:
|
|
3488
|
+
className: ln.layer,
|
|
3484
3489
|
"aria-label": "Модальные окна",
|
|
3485
3490
|
children: n.map((r, a) => {
|
|
3486
3491
|
let o = e[r.name];
|
|
3487
3492
|
if (!o) return null;
|
|
3488
3493
|
let c = i.has(r.id);
|
|
3489
3494
|
return /* @__PURE__ */ t("div", {
|
|
3490
|
-
className:
|
|
3495
|
+
className: ln.backdrop,
|
|
3491
3496
|
"data-closing": c || void 0,
|
|
3492
3497
|
"aria-hidden": a !== n.length - 1 || void 0,
|
|
3493
3498
|
inert: a !== n.length - 1 || void 0,
|
|
3494
3499
|
onMouseDown: (e) => {
|
|
3495
3500
|
e.target === e.currentTarget && r.closeOnBackdrop && s(r.id);
|
|
3496
3501
|
},
|
|
3497
|
-
children: /* @__PURE__ */ t(
|
|
3502
|
+
children: /* @__PURE__ */ t(dn.Provider, {
|
|
3498
3503
|
value: {
|
|
3499
3504
|
title: r.title ?? r.payload.title,
|
|
3500
3505
|
description: r.description ?? r.payload.description,
|
|
@@ -3511,31 +3516,31 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3511
3516
|
}, r.id);
|
|
3512
3517
|
})
|
|
3513
3518
|
}), document.body);
|
|
3514
|
-
},
|
|
3515
|
-
let o =
|
|
3519
|
+
}, hn = ({ registry: r, children: i, lockBodyScroll: a = !0 }) => {
|
|
3520
|
+
let o = en((e) => e.modals.length);
|
|
3516
3521
|
return d(() => {
|
|
3517
3522
|
if (!a || o === 0) return;
|
|
3518
3523
|
let e = document.body.style.overflow;
|
|
3519
3524
|
return document.body.style.overflow = "hidden", () => {
|
|
3520
3525
|
document.body.style.overflow = e;
|
|
3521
3526
|
};
|
|
3522
|
-
}, [a, o]), /* @__PURE__ */ n(e, { children: [i, /* @__PURE__ */ t(
|
|
3523
|
-
},
|
|
3527
|
+
}, [a, o]), /* @__PURE__ */ n(e, { children: [i, /* @__PURE__ */ t(mn, { registry: r })] });
|
|
3528
|
+
}, gn = (e) => e, _n = {
|
|
3524
3529
|
message: "_message_c23ie_1",
|
|
3525
3530
|
actions: "_actions_c23ie_13"
|
|
3526
|
-
},
|
|
3531
|
+
}, vn = /* @__PURE__ */ new Map(), yn = 0, bn = ({ modalId: e, close: r, title: i = "Подтверждение", message: a = "Продолжить действие?", confirmLabel: o = "Подтвердить", cancelLabel: s = "Отмена", tone: c = "default", requestId: l }) => {
|
|
3527
3532
|
let u = (e) => {
|
|
3528
|
-
|
|
3533
|
+
vn.get(l)?.(e), vn.delete(l), r();
|
|
3529
3534
|
};
|
|
3530
|
-
return /* @__PURE__ */ n(
|
|
3535
|
+
return /* @__PURE__ */ n(pn, {
|
|
3531
3536
|
modalId: e,
|
|
3532
3537
|
title: i,
|
|
3533
3538
|
role: "alertdialog",
|
|
3534
3539
|
children: [/* @__PURE__ */ t("p", {
|
|
3535
|
-
className:
|
|
3540
|
+
className: _n.message,
|
|
3536
3541
|
children: a
|
|
3537
3542
|
}), /* @__PURE__ */ n("div", {
|
|
3538
|
-
className:
|
|
3543
|
+
className: _n.actions,
|
|
3539
3544
|
children: [/* @__PURE__ */ t(j, {
|
|
3540
3545
|
variant: "outline",
|
|
3541
3546
|
onClick: () => u(!1),
|
|
@@ -3547,46 +3552,46 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3547
3552
|
})]
|
|
3548
3553
|
})]
|
|
3549
3554
|
});
|
|
3550
|
-
},
|
|
3555
|
+
}, xn = ({ modalId: e, close: r, title: i = "Ошибка", message: a, closeLabel: o = "Закрыть" }) => /* @__PURE__ */ n(pn, {
|
|
3551
3556
|
modalId: e,
|
|
3552
3557
|
title: i,
|
|
3553
3558
|
role: "alertdialog",
|
|
3554
3559
|
children: [/* @__PURE__ */ t("p", {
|
|
3555
|
-
className:
|
|
3560
|
+
className: _n.message,
|
|
3556
3561
|
children: a
|
|
3557
3562
|
}), /* @__PURE__ */ t("div", {
|
|
3558
|
-
className:
|
|
3563
|
+
className: _n.actions,
|
|
3559
3564
|
children: /* @__PURE__ */ t(j, {
|
|
3560
3565
|
onClick: r,
|
|
3561
3566
|
children: o
|
|
3562
3567
|
})
|
|
3563
3568
|
})]
|
|
3564
|
-
}),
|
|
3565
|
-
ConfirmModal:
|
|
3566
|
-
ErrorModal:
|
|
3567
|
-
}),
|
|
3568
|
-
let e =
|
|
3569
|
+
}), Sn = gn({
|
|
3570
|
+
ConfirmModal: bn,
|
|
3571
|
+
ErrorModal: xn
|
|
3572
|
+
}), Cn = () => {
|
|
3573
|
+
let e = en((e) => e.openModal);
|
|
3569
3574
|
return (t = {}) => new Promise((n) => {
|
|
3570
|
-
|
|
3571
|
-
let r = `confirm-${
|
|
3572
|
-
|
|
3575
|
+
yn += 1;
|
|
3576
|
+
let r = `confirm-${yn}`;
|
|
3577
|
+
vn.set(r, n), e("ConfirmModal", {
|
|
3573
3578
|
...t,
|
|
3574
3579
|
requestId: r
|
|
3575
3580
|
}, {
|
|
3576
3581
|
closeOnEscape: !1,
|
|
3577
3582
|
onClose: () => {
|
|
3578
|
-
|
|
3583
|
+
vn.get(r)?.(!1), vn.delete(r);
|
|
3579
3584
|
}
|
|
3580
3585
|
});
|
|
3581
3586
|
});
|
|
3582
|
-
},
|
|
3583
|
-
let e =
|
|
3587
|
+
}, wn = (e) => e instanceof Error ? e.message : typeof e == "string" ? e : e && typeof e == "object" && "message" in e && typeof e.message == "string" ? e.message : "Произошла неизвестная ошибка", Tn = () => {
|
|
3588
|
+
let e = en((e) => e.openModal);
|
|
3584
3589
|
return { showError: (t, n) => e("ErrorModal", {
|
|
3585
3590
|
title: n,
|
|
3586
|
-
message:
|
|
3591
|
+
message: wn(t)
|
|
3587
3592
|
}) };
|
|
3588
|
-
},
|
|
3589
|
-
let e =
|
|
3593
|
+
}, En = S(() => ({})), Dn = S(() => ({})), On = () => {
|
|
3594
|
+
let e = en((e) => e.modals), t = en((e) => e.openModal), n = en((e) => e.closeModal), r = en((e) => e.closeTopModal), i = en((e) => e.closeAllModals), a = l((e, n = {}, r) => t(e, n, r), [t]), o = l((t) => e.some((e) => e.name === t), [e]);
|
|
3590
3595
|
return m(() => ({
|
|
3591
3596
|
openModal: a,
|
|
3592
3597
|
closeModal: n,
|
|
@@ -3602,7 +3607,7 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3602
3607
|
e.length,
|
|
3603
3608
|
a
|
|
3604
3609
|
]);
|
|
3605
|
-
},
|
|
3610
|
+
}, kn = {
|
|
3606
3611
|
layer: "_layer_ct7yp_1",
|
|
3607
3612
|
backdrop: "_backdrop_ct7yp_13",
|
|
3608
3613
|
panel: "_panel_ct7yp_27",
|
|
@@ -3622,16 +3627,16 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3622
3627
|
"enter-right": "_enter-right_ct7yp_1",
|
|
3623
3628
|
"enter-left": "_enter-left_ct7yp_1",
|
|
3624
3629
|
"enter-bottom": "_enter-bottom_ct7yp_1"
|
|
3625
|
-
},
|
|
3630
|
+
}, An = "button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"])", jn = a(null), Mn = (e) => {
|
|
3626
3631
|
if (e.key !== "Tab") return;
|
|
3627
|
-
let t = Array.from(e.currentTarget.querySelectorAll(
|
|
3632
|
+
let t = Array.from(e.currentTarget.querySelectorAll(An));
|
|
3628
3633
|
if (!t.length) {
|
|
3629
3634
|
e.preventDefault();
|
|
3630
3635
|
return;
|
|
3631
3636
|
}
|
|
3632
3637
|
let n = t[0], r = t.at(-1);
|
|
3633
3638
|
e.shiftKey && document.activeElement === n ? (e.preventDefault(), r?.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus());
|
|
3634
|
-
},
|
|
3639
|
+
}, Nn = () => u(jn), Pn = ({ 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 = "" }) => {
|
|
3635
3640
|
let S = h(null), C = f(), w = f(), T = (e) => {
|
|
3636
3641
|
g || r(e);
|
|
3637
3642
|
};
|
|
@@ -3640,7 +3645,7 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3640
3645
|
let t = document.activeElement, n = b?.current, i = document.body.style.overflow;
|
|
3641
3646
|
document.body.style.overflow = "hidden";
|
|
3642
3647
|
let a = S.current;
|
|
3643
|
-
(y?.current ?? a?.querySelector(
|
|
3648
|
+
(y?.current ?? a?.querySelector(An) ?? a)?.focus();
|
|
3644
3649
|
let o = (e) => {
|
|
3645
3650
|
e.key === "Escape" && p && !g && r("escape");
|
|
3646
3651
|
};
|
|
@@ -3655,29 +3660,29 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3655
3660
|
g,
|
|
3656
3661
|
b
|
|
3657
3662
|
]), !e || typeof document > "u" ? null : _(/* @__PURE__ */ t("div", {
|
|
3658
|
-
className:
|
|
3663
|
+
className: kn.layer,
|
|
3659
3664
|
children: /* @__PURE__ */ t("div", {
|
|
3660
|
-
className:
|
|
3665
|
+
className: kn.backdrop,
|
|
3661
3666
|
onMouseDown: (e) => {
|
|
3662
3667
|
e.target === e.currentTarget && m && T("backdrop");
|
|
3663
3668
|
},
|
|
3664
|
-
children: /* @__PURE__ */ t(
|
|
3669
|
+
children: /* @__PURE__ */ t(jn.Provider, {
|
|
3665
3670
|
value: { requestClose: T },
|
|
3666
3671
|
children: /* @__PURE__ */ n("section", {
|
|
3667
3672
|
ref: S,
|
|
3668
|
-
className: `${
|
|
3673
|
+
className: `${kn.panel} ${kn[l]} ${kn[u]} ${x}`,
|
|
3669
3674
|
role: "dialog",
|
|
3670
3675
|
"aria-modal": "true",
|
|
3671
3676
|
"aria-labelledby": a ? C : void 0,
|
|
3672
3677
|
"aria-describedby": o ? w : void 0,
|
|
3673
3678
|
tabIndex: -1,
|
|
3674
|
-
onKeyDown:
|
|
3679
|
+
onKeyDown: Mn,
|
|
3675
3680
|
children: [
|
|
3676
3681
|
/* @__PURE__ */ n("header", {
|
|
3677
|
-
className:
|
|
3682
|
+
className: kn.header,
|
|
3678
3683
|
children: [
|
|
3679
3684
|
/* @__PURE__ */ n("div", {
|
|
3680
|
-
className:
|
|
3685
|
+
className: kn.heading,
|
|
3681
3686
|
children: [a && /* @__PURE__ */ t("h2", {
|
|
3682
3687
|
id: C,
|
|
3683
3688
|
children: a
|
|
@@ -3687,7 +3692,7 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3687
3692
|
})]
|
|
3688
3693
|
}),
|
|
3689
3694
|
s && /* @__PURE__ */ t("div", {
|
|
3690
|
-
className:
|
|
3695
|
+
className: kn.headerActions,
|
|
3691
3696
|
children: s
|
|
3692
3697
|
}),
|
|
3693
3698
|
/* @__PURE__ */ t(j, {
|
|
@@ -3705,11 +3710,11 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3705
3710
|
]
|
|
3706
3711
|
}),
|
|
3707
3712
|
/* @__PURE__ */ t("div", {
|
|
3708
|
-
className:
|
|
3713
|
+
className: kn.content,
|
|
3709
3714
|
children: i
|
|
3710
3715
|
}),
|
|
3711
3716
|
c && /* @__PURE__ */ t("footer", {
|
|
3712
|
-
className:
|
|
3717
|
+
className: kn.footer,
|
|
3713
3718
|
children: c
|
|
3714
3719
|
})
|
|
3715
3720
|
]
|
|
@@ -3717,17 +3722,17 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3717
3722
|
})
|
|
3718
3723
|
})
|
|
3719
3724
|
}), document.body);
|
|
3720
|
-
},
|
|
3725
|
+
}, Fn = ({ placement: e = "right", ...n }) => /* @__PURE__ */ t(Pn, {
|
|
3721
3726
|
...n,
|
|
3722
3727
|
placement: e
|
|
3723
|
-
}),
|
|
3728
|
+
}), In = (e) => /* @__PURE__ */ t(Pn, {
|
|
3724
3729
|
...e,
|
|
3725
3730
|
placement: "bottom"
|
|
3726
|
-
}),
|
|
3731
|
+
}), Ln = (e) => /* @__PURE__ */ t(Pn, {
|
|
3727
3732
|
...e,
|
|
3728
3733
|
placement: "fullscreen",
|
|
3729
3734
|
size: "xl"
|
|
3730
|
-
}),
|
|
3735
|
+
}), Rn = {
|
|
3731
3736
|
wrapper: "_wrapper_1hyyy_1",
|
|
3732
3737
|
container: "_container_1hyyy_15",
|
|
3733
3738
|
inner: "_inner_1hyyy_35",
|
|
@@ -3742,29 +3747,29 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3742
3747
|
empty: "_empty_1hyyy_153",
|
|
3743
3748
|
destructive: "_destructive_1hyyy_161",
|
|
3744
3749
|
destructiveOutline: "_destructiveOutline_1hyyy_169"
|
|
3745
|
-
},
|
|
3746
|
-
className:
|
|
3750
|
+
}, zn = ({ variant: e = "primary" }) => /* @__PURE__ */ t("div", {
|
|
3751
|
+
className: Rn.wrapper,
|
|
3747
3752
|
children: /* @__PURE__ */ t("div", {
|
|
3748
|
-
className:
|
|
3753
|
+
className: Rn.container,
|
|
3749
3754
|
children: /* @__PURE__ */ n("div", {
|
|
3750
|
-
className:
|
|
3755
|
+
className: Rn.inner,
|
|
3751
3756
|
children: [
|
|
3752
3757
|
/* @__PURE__ */ t("div", {
|
|
3753
|
-
className:
|
|
3754
|
-
children: /* @__PURE__ */ t("div", { className: `${
|
|
3758
|
+
className: Rn.cube,
|
|
3759
|
+
children: /* @__PURE__ */ t("div", { className: `${Rn.cube__inner} ${Rn[e]}` })
|
|
3755
3760
|
}),
|
|
3756
3761
|
/* @__PURE__ */ t("div", {
|
|
3757
|
-
className:
|
|
3758
|
-
children: /* @__PURE__ */ t("div", { className: `${
|
|
3762
|
+
className: Rn.cube,
|
|
3763
|
+
children: /* @__PURE__ */ t("div", { className: `${Rn.cube__inner} ${Rn[e]}` })
|
|
3759
3764
|
}),
|
|
3760
3765
|
/* @__PURE__ */ t("div", {
|
|
3761
|
-
className:
|
|
3762
|
-
children: /* @__PURE__ */ t("div", { className: `${
|
|
3766
|
+
className: Rn.cube,
|
|
3767
|
+
children: /* @__PURE__ */ t("div", { className: `${Rn.cube__inner} ${Rn[e]}` })
|
|
3763
3768
|
})
|
|
3764
3769
|
]
|
|
3765
3770
|
})
|
|
3766
3771
|
})
|
|
3767
|
-
}),
|
|
3772
|
+
}), Bn = {
|
|
3768
3773
|
viewport: "_viewport_bu4eh_1",
|
|
3769
3774
|
"top-right": "_top-right_bu4eh_21",
|
|
3770
3775
|
"top-left": "_top-left_bu4eh_31",
|
|
@@ -3780,12 +3785,12 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3780
3785
|
success: "_success_bu4eh_195",
|
|
3781
3786
|
warning: "_warning_bu4eh_203",
|
|
3782
3787
|
error: "_error_bu4eh_211"
|
|
3783
|
-
},
|
|
3788
|
+
}, Vn = {
|
|
3784
3789
|
info: "IconInfoCircle",
|
|
3785
3790
|
success: "IconSuccessCircle",
|
|
3786
3791
|
warning: "IconWarning",
|
|
3787
3792
|
error: "IconWarning"
|
|
3788
|
-
},
|
|
3793
|
+
}, Hn = ({ toast: e, onClose: r }) => {
|
|
3789
3794
|
let [i, a] = g(!1), [o, s] = g(() => typeof document < "u" && document.hidden), c = h(e.duration), l = h(Date.now());
|
|
3790
3795
|
return d(() => {
|
|
3791
3796
|
if (i || o || e.duration <= 0) return;
|
|
@@ -3805,7 +3810,7 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3805
3810
|
let e = () => s(document.hidden);
|
|
3806
3811
|
return document.addEventListener("visibilitychange", e), () => document.removeEventListener("visibilitychange", e);
|
|
3807
3812
|
}, []), /* @__PURE__ */ n("article", {
|
|
3808
|
-
className: `${
|
|
3813
|
+
className: `${Bn.toast} ${Bn[e.variant]}`,
|
|
3809
3814
|
role: e.variant === "error" ? "alert" : "status",
|
|
3810
3815
|
"aria-live": e.variant === "error" ? "assertive" : "polite",
|
|
3811
3816
|
onMouseEnter: () => a(!0),
|
|
@@ -3814,24 +3819,24 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3814
3819
|
onBlur: () => a(!1),
|
|
3815
3820
|
children: [
|
|
3816
3821
|
/* @__PURE__ */ t("div", {
|
|
3817
|
-
className:
|
|
3822
|
+
className: Bn.icon,
|
|
3818
3823
|
"aria-hidden": "true",
|
|
3819
3824
|
children: /* @__PURE__ */ t(q, {
|
|
3820
|
-
name:
|
|
3825
|
+
name: Vn[e.variant],
|
|
3821
3826
|
color: "var(--ds-toast-accent)",
|
|
3822
3827
|
width: 20,
|
|
3823
3828
|
height: 20
|
|
3824
3829
|
})
|
|
3825
3830
|
}),
|
|
3826
3831
|
/* @__PURE__ */ n("div", {
|
|
3827
|
-
className:
|
|
3832
|
+
className: Bn.body,
|
|
3828
3833
|
children: [
|
|
3829
3834
|
e.title && /* @__PURE__ */ t("strong", {
|
|
3830
|
-
className:
|
|
3835
|
+
className: Bn.title,
|
|
3831
3836
|
children: e.title
|
|
3832
3837
|
}),
|
|
3833
3838
|
/* @__PURE__ */ t("div", {
|
|
3834
|
-
className:
|
|
3839
|
+
className: Bn.message,
|
|
3835
3840
|
children: e.message
|
|
3836
3841
|
}),
|
|
3837
3842
|
e.action && /* @__PURE__ */ t(j, {
|
|
@@ -3857,15 +3862,15 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3857
3862
|
})
|
|
3858
3863
|
]
|
|
3859
3864
|
});
|
|
3860
|
-
},
|
|
3865
|
+
}, Un = 0, Wn = S((e, t) => ({
|
|
3861
3866
|
toasts: [],
|
|
3862
3867
|
showToast: (n) => {
|
|
3863
3868
|
if (n.dedupeKey) {
|
|
3864
3869
|
let e = t().toasts.find((e) => e.dedupeKey === n.dedupeKey);
|
|
3865
3870
|
if (e) return e.id;
|
|
3866
3871
|
}
|
|
3867
|
-
|
|
3868
|
-
let r = `ds-toast-${
|
|
3872
|
+
Un += 1;
|
|
3873
|
+
let r = `ds-toast-${Un}`;
|
|
3869
3874
|
return e((e) => ({ toasts: [...e.toasts, {
|
|
3870
3875
|
variant: "info",
|
|
3871
3876
|
duration: 5e3,
|
|
@@ -3876,18 +3881,18 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3876
3881
|
},
|
|
3877
3882
|
removeToast: (t) => e((e) => ({ toasts: e.toasts.filter((e) => e.id !== t) })),
|
|
3878
3883
|
clearToasts: () => e({ toasts: [] })
|
|
3879
|
-
})),
|
|
3880
|
-
let r =
|
|
3884
|
+
})), Gn = () => Wn.setState({ toasts: [] }), Kn = ({ position: e = "top-right", maxVisible: n }) => {
|
|
3885
|
+
let r = Wn((e) => e.toasts), i = Wn((e) => e.removeToast), a = n === void 0 ? r : r.slice(0, Math.max(0, Math.floor(n)));
|
|
3881
3886
|
return /* @__PURE__ */ t("div", {
|
|
3882
|
-
className: `${
|
|
3887
|
+
className: `${Bn.viewport} ${Bn[e]}`,
|
|
3883
3888
|
"aria-label": "Уведомления",
|
|
3884
|
-
children: a.map((e) => /* @__PURE__ */ t(
|
|
3889
|
+
children: a.map((e) => /* @__PURE__ */ t(Hn, {
|
|
3885
3890
|
toast: e,
|
|
3886
3891
|
onClose: i
|
|
3887
3892
|
}, e.id))
|
|
3888
3893
|
});
|
|
3889
|
-
},
|
|
3890
|
-
let e =
|
|
3894
|
+
}, qn = () => {
|
|
3895
|
+
let e = Wn((e) => e.showToast), t = Wn((e) => e.removeToast), n = Wn((e) => e.clearToasts), r = l((t) => e({
|
|
3891
3896
|
...t,
|
|
3892
3897
|
variant: "info"
|
|
3893
3898
|
}), [e]), i = l((t) => e({
|
|
@@ -3917,7 +3922,7 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3917
3922
|
i,
|
|
3918
3923
|
a
|
|
3919
3924
|
]);
|
|
3920
|
-
},
|
|
3925
|
+
}, Jn = {
|
|
3921
3926
|
root: "_root_8dm5q_1",
|
|
3922
3927
|
tooltip: "_tooltip_8dm5q_11",
|
|
3923
3928
|
"ds-tooltip-in": "_ds-tooltip-in_8dm5q_1",
|
|
@@ -3925,7 +3930,7 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3925
3930
|
bottom: "_bottom_8dm5q_55",
|
|
3926
3931
|
left: "_left_8dm5q_67",
|
|
3927
3932
|
right: "_right_8dm5q_79"
|
|
3928
|
-
},
|
|
3933
|
+
}, Yn = ({ content: e, children: r, placement: a = "top", delay: o = 450, disabled: s = !1, maxWidth: l = 280, className: u = "" }) => {
|
|
3929
3934
|
let p = f(), [m, _] = g(!1), v = h(null), y = () => {
|
|
3930
3935
|
s || !e || (v.current = setTimeout(() => _(!0), o));
|
|
3931
3936
|
}, b = () => {
|
|
@@ -3947,23 +3952,23 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3947
3952
|
onBlur: b
|
|
3948
3953
|
});
|
|
3949
3954
|
return /* @__PURE__ */ n("span", {
|
|
3950
|
-
className: `${
|
|
3955
|
+
className: `${Jn.root} ${u}`,
|
|
3951
3956
|
onPointerDown: m ? b : y,
|
|
3952
3957
|
children: [x, m && /* @__PURE__ */ t("span", {
|
|
3953
3958
|
id: p,
|
|
3954
3959
|
role: "tooltip",
|
|
3955
|
-
className: `${
|
|
3960
|
+
className: `${Jn.tooltip} ${Jn[a]}`,
|
|
3956
3961
|
style: { maxWidth: l },
|
|
3957
3962
|
children: e
|
|
3958
3963
|
})]
|
|
3959
3964
|
});
|
|
3960
|
-
},
|
|
3965
|
+
}, Xn = {
|
|
3961
3966
|
root: "_root_bs28m_1",
|
|
3962
3967
|
tabList: "_tabList_bs28m_11",
|
|
3963
3968
|
tab: "_tab_bs28m_11",
|
|
3964
3969
|
panels: "_panels_bs28m_127",
|
|
3965
3970
|
panel: "_panel_bs28m_127"
|
|
3966
|
-
},
|
|
3971
|
+
}, Zn = ({ items: e, value: r, onChange: i, ariaLabel: a = "Вкладки", disabled: o = !1, loading: s = !1, className: c = "" }) => {
|
|
3967
3972
|
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) => {
|
|
3968
3973
|
let n = e[t];
|
|
3969
3974
|
!n || n.disabled || d || (i(n.id), u.current[t]?.focus(), u.current[t]?.scrollIntoView({
|
|
@@ -3993,10 +3998,10 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
3993
3998
|
t.preventDefault(), _(a);
|
|
3994
3999
|
};
|
|
3995
4000
|
return /* @__PURE__ */ n("div", {
|
|
3996
|
-
className: `${
|
|
4001
|
+
className: `${Xn.root} ${c}`,
|
|
3997
4002
|
"aria-busy": s || void 0,
|
|
3998
4003
|
children: [/* @__PURE__ */ t("div", {
|
|
3999
|
-
className:
|
|
4004
|
+
className: Xn.tabList,
|
|
4000
4005
|
role: "tablist",
|
|
4001
4006
|
"aria-label": a,
|
|
4002
4007
|
"aria-orientation": "horizontal",
|
|
@@ -4008,7 +4013,7 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4008
4013
|
u.current[n] = e;
|
|
4009
4014
|
},
|
|
4010
4015
|
id: a,
|
|
4011
|
-
className:
|
|
4016
|
+
className: Xn.tab,
|
|
4012
4017
|
type: "button",
|
|
4013
4018
|
role: "tab",
|
|
4014
4019
|
"aria-selected": i,
|
|
@@ -4021,12 +4026,12 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4021
4026
|
}, e.id);
|
|
4022
4027
|
})
|
|
4023
4028
|
}), /* @__PURE__ */ t("div", {
|
|
4024
|
-
className:
|
|
4029
|
+
className: Xn.panels,
|
|
4025
4030
|
children: e.map((e, n) => {
|
|
4026
4031
|
let i = e.id === r;
|
|
4027
4032
|
return /* @__PURE__ */ t("div", {
|
|
4028
4033
|
id: `${l}-panel-${n}`,
|
|
4029
|
-
className:
|
|
4034
|
+
className: Xn.panel,
|
|
4030
4035
|
role: "tabpanel",
|
|
4031
4036
|
"aria-labelledby": `${l}-tab-${n}`,
|
|
4032
4037
|
tabIndex: 0,
|
|
@@ -4036,7 +4041,7 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4036
4041
|
})
|
|
4037
4042
|
})]
|
|
4038
4043
|
});
|
|
4039
|
-
},
|
|
4044
|
+
}, Qn = (e) => {
|
|
4040
4045
|
if (!Number.isFinite(e) || e < 0) return "00:00";
|
|
4041
4046
|
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")}`;
|
|
4042
4047
|
return n ? `${n}:${a}` : a;
|
|
@@ -4069,19 +4074,19 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4069
4074
|
settingsActionLabel: "_settingsActionLabel_14cqp_693",
|
|
4070
4075
|
caption: "_caption_14cqp_705",
|
|
4071
4076
|
fullscreen: "_fullscreen_14cqp_719"
|
|
4072
|
-
},
|
|
4077
|
+
}, $n = 2500, er = 5, tr = .05, nr = [
|
|
4073
4078
|
.5,
|
|
4074
4079
|
.75,
|
|
4075
4080
|
1,
|
|
4076
4081
|
1.25,
|
|
4077
4082
|
1.5,
|
|
4078
4083
|
2
|
|
4079
|
-
],
|
|
4084
|
+
], rr = ({ 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 }) => {
|
|
4080
4085
|
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, te] = g(1), [V, H] = g(!!v.muted), [U, ne] = g(1), [re, ie] = g(!!v.loop), [ae, oe] = g(-1), [se, ce] = g(!1), [le, W] = g(!0), [ue, de] = g(!1), [fe, pe] = g(!1), me = r.map(({ src: e, type: t }) => `${e}:${t ?? ""}`).join("|"), G = i.map((e, t) => ({
|
|
4081
4086
|
track: e,
|
|
4082
4087
|
index: t
|
|
4083
4088
|
})).filter(({ track: e }) => e.kind === "captions" || e.kind === "subtitles"), he = u ?? (C ? "Не удалось воспроизвести видео" : void 0), ge = c || T && !he && r.length > 0, _e = !ge && !he && r.length === 0, ve = typeof document < "u" && "pictureInPictureEnabled" in document && document.pictureInPictureEnabled, ye = l(() => {
|
|
4084
|
-
W(!0), window.clearTimeout(S.current), A && !se && (S.current = window.setTimeout(() => W(!1),
|
|
4089
|
+
W(!0), window.clearTimeout(S.current), A && !se && (S.current = window.setTimeout(() => W(!1), $n));
|
|
4085
4090
|
}, [A, se]);
|
|
4086
4091
|
d(() => {
|
|
4087
4092
|
w(!1), E(r.length > 0), O(!1), M(!1), N(!1), F(0), L(0), z(0);
|
|
@@ -4097,7 +4102,7 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4097
4102
|
};
|
|
4098
4103
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
4099
4104
|
}, [se]);
|
|
4100
|
-
let
|
|
4105
|
+
let be = async () => {
|
|
4101
4106
|
let e = x.current;
|
|
4102
4107
|
if (!(!e || he || ge)) {
|
|
4103
4108
|
if (e.paused || e.ended) {
|
|
@@ -4109,38 +4114,38 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4109
4114
|
}
|
|
4110
4115
|
} else e.pause();
|
|
4111
4116
|
}
|
|
4112
|
-
},
|
|
4117
|
+
}, K = () => {
|
|
4113
4118
|
let e = x.current;
|
|
4114
4119
|
e && (e.muted = !e.muted);
|
|
4115
4120
|
}, xe = (e) => {
|
|
4116
4121
|
let t = x.current;
|
|
4117
4122
|
t && (t.volume = Math.min(1, Math.max(0, e)), t.muted = t.volume === 0);
|
|
4118
|
-
},
|
|
4123
|
+
}, J = (e) => {
|
|
4119
4124
|
let t = x.current;
|
|
4120
4125
|
!t || !I || (t.currentTime = Math.min(I, Math.max(0, e)), F(t.currentTime));
|
|
4121
|
-
},
|
|
4126
|
+
}, Se = async () => {
|
|
4122
4127
|
if (b.current) try {
|
|
4123
4128
|
document.fullscreenElement ? await document.exitFullscreen() : await b.current.requestFullscreen();
|
|
4124
4129
|
} catch {
|
|
4125
4130
|
de(!1);
|
|
4126
4131
|
}
|
|
4127
|
-
},
|
|
4132
|
+
}, Y = async () => {
|
|
4128
4133
|
let e = x.current;
|
|
4129
4134
|
if (!(!e || !ve)) try {
|
|
4130
4135
|
document.pictureInPictureElement ? await document.exitPictureInPicture() : await e.requestPictureInPicture();
|
|
4131
4136
|
} catch {
|
|
4132
4137
|
pe(!1);
|
|
4133
4138
|
}
|
|
4134
|
-
},
|
|
4139
|
+
}, Ce = (e) => {
|
|
4135
4140
|
let t = x.current;
|
|
4136
4141
|
t && (Array.from(t.textTracks).forEach((t, n) => {
|
|
4137
4142
|
t.mode = n === e ? "showing" : "disabled";
|
|
4138
4143
|
}), oe(e));
|
|
4139
|
-
},
|
|
4144
|
+
}, we = (e) => {
|
|
4140
4145
|
let t = e.target;
|
|
4141
4146
|
if (/^(INPUT|SELECT|BUTTON)$/.test(t.tagName)) return;
|
|
4142
4147
|
let n = e.key.toLowerCase();
|
|
4143
|
-
n === " " || n === "k" ? (e.preventDefault(),
|
|
4148
|
+
n === " " || n === "k" ? (e.preventDefault(), be()) : n === "m" ? (e.preventDefault(), K()) : n === "f" ? (e.preventDefault(), Se()) : n === "c" && G.length ? (e.preventDefault(), Ce(ae === -1 ? G[0].index : -1)) : e.key === "ArrowLeft" || e.key === "ArrowRight" ? (e.preventDefault(), J(P + (e.key === "ArrowRight" ? er : -5))) : e.key === "ArrowUp" || e.key === "ArrowDown" ? (e.preventDefault(), xe(B + (e.key === "ArrowUp" ? tr : -.05))) : e.key === "Escape" && ce(!1), ye();
|
|
4144
4149
|
}, Te = () => {
|
|
4145
4150
|
let e = x.current;
|
|
4146
4151
|
w(!1), E(!0), e?.load();
|
|
@@ -4151,7 +4156,7 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4151
4156
|
return /* @__PURE__ */ n("figure", {
|
|
4152
4157
|
ref: y,
|
|
4153
4158
|
className: `${$.root} ${p}`,
|
|
4154
|
-
onKeyDown:
|
|
4159
|
+
onKeyDown: we,
|
|
4155
4160
|
children: [/* @__PURE__ */ n("div", {
|
|
4156
4161
|
ref: b,
|
|
4157
4162
|
className: `${$.frame} ${ue ? $.fullscreen : ""}`,
|
|
@@ -4175,10 +4180,10 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4175
4180
|
className: $.video,
|
|
4176
4181
|
style: { objectFit: s },
|
|
4177
4182
|
onClick: (e) => {
|
|
4178
|
-
v.onClick?.(e),
|
|
4183
|
+
v.onClick?.(e), be();
|
|
4179
4184
|
},
|
|
4180
4185
|
onDoubleClick: (e) => {
|
|
4181
|
-
v.onDoubleClick?.(e),
|
|
4186
|
+
v.onDoubleClick?.(e), Se();
|
|
4182
4187
|
},
|
|
4183
4188
|
onLoadStart: (e) => {
|
|
4184
4189
|
E(!0), v.onLoadStart?.(e);
|
|
@@ -4186,7 +4191,7 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4186
4191
|
onLoadedMetadata: (e) => {
|
|
4187
4192
|
L(e.currentTarget.duration || 0);
|
|
4188
4193
|
let t = G.find(({ track: e }) => e.default);
|
|
4189
|
-
|
|
4194
|
+
Ce(t?.index ?? -1), v.onLoadedMetadata?.(e);
|
|
4190
4195
|
},
|
|
4191
4196
|
onDurationChange: (e) => {
|
|
4192
4197
|
L(e.currentTarget.duration || 0), v.onDurationChange?.(e);
|
|
@@ -4239,7 +4244,7 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4239
4244
|
"aria-hidden": "true",
|
|
4240
4245
|
children: /* @__PURE__ */ t("div", {
|
|
4241
4246
|
className: $.loaderScale,
|
|
4242
|
-
children: /* @__PURE__ */ t(
|
|
4247
|
+
children: /* @__PURE__ */ t(zn, {})
|
|
4243
4248
|
})
|
|
4244
4249
|
}), /* @__PURE__ */ t("span", { children: "Загрузка видео" })]
|
|
4245
4250
|
}),
|
|
@@ -4286,7 +4291,7 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4286
4291
|
type: "button",
|
|
4287
4292
|
className: $.replay,
|
|
4288
4293
|
"aria-label": "Воспроизвести заново",
|
|
4289
|
-
onClick: () => void
|
|
4294
|
+
onClick: () => void be(),
|
|
4290
4295
|
children: /* @__PURE__ */ t(q, {
|
|
4291
4296
|
name: "IconReplay",
|
|
4292
4297
|
width: 28,
|
|
@@ -4307,14 +4312,14 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4307
4312
|
let t = Number(e.target.value);
|
|
4308
4313
|
x.current && (x.current.playbackRate = t);
|
|
4309
4314
|
},
|
|
4310
|
-
children:
|
|
4315
|
+
children: nr.map((e) => /* @__PURE__ */ n("option", {
|
|
4311
4316
|
value: e,
|
|
4312
4317
|
children: [e, "×"]
|
|
4313
4318
|
}, e))
|
|
4314
4319
|
})] }),
|
|
4315
4320
|
G.length > 0 && /* @__PURE__ */ n("label", { children: [/* @__PURE__ */ t("span", { children: "Субтитры" }), /* @__PURE__ */ n("select", {
|
|
4316
4321
|
value: ae,
|
|
4317
|
-
onChange: (e) =>
|
|
4322
|
+
onChange: (e) => Ce(Number(e.target.value)),
|
|
4318
4323
|
children: [/* @__PURE__ */ t("option", {
|
|
4319
4324
|
value: -1,
|
|
4320
4325
|
children: "Выключены"
|
|
@@ -4334,7 +4339,7 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4334
4339
|
type: "button",
|
|
4335
4340
|
className: $.settingsAction,
|
|
4336
4341
|
"aria-pressed": fe,
|
|
4337
|
-
onClick: () => void
|
|
4342
|
+
onClick: () => void Y(),
|
|
4338
4343
|
children: /* @__PURE__ */ n("span", {
|
|
4339
4344
|
className: $.settingsActionLabel,
|
|
4340
4345
|
children: [/* @__PURE__ */ t(q, {
|
|
@@ -4355,7 +4360,7 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4355
4360
|
className: `${$.controlButton} ${$.playButton}`,
|
|
4356
4361
|
"aria-label": A ? "Пауза" : "Воспроизвести",
|
|
4357
4362
|
title: A ? "Пауза (K)" : "Воспроизвести (K)",
|
|
4358
|
-
onClick: () => void
|
|
4363
|
+
onClick: () => void be(),
|
|
4359
4364
|
children: /* @__PURE__ */ t(q, {
|
|
4360
4365
|
name: A ? "IconPause" : "IconPlay",
|
|
4361
4366
|
width: 24,
|
|
@@ -4371,7 +4376,7 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4371
4376
|
"aria-label": V ? "Включить звук" : "Выключить звук",
|
|
4372
4377
|
"aria-pressed": V,
|
|
4373
4378
|
title: "Звук (M)",
|
|
4374
|
-
onClick:
|
|
4379
|
+
onClick: K,
|
|
4375
4380
|
children: /* @__PURE__ */ t(q, {
|
|
4376
4381
|
name: V || B === 0 ? "IconVolumeMuted" : "IconVolume",
|
|
4377
4382
|
width: 22,
|
|
@@ -4394,7 +4399,7 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4394
4399
|
children: [
|
|
4395
4400
|
/* @__PURE__ */ t("span", {
|
|
4396
4401
|
className: $.time,
|
|
4397
|
-
children:
|
|
4402
|
+
children: Qn(P)
|
|
4398
4403
|
}),
|
|
4399
4404
|
/* @__PURE__ */ t("input", {
|
|
4400
4405
|
className: $.timeline,
|
|
@@ -4405,12 +4410,12 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4405
4410
|
step: .01,
|
|
4406
4411
|
value: Math.min(P, I || 0),
|
|
4407
4412
|
"aria-label": "Позиция воспроизведения",
|
|
4408
|
-
"aria-valuetext": `${
|
|
4409
|
-
onChange: (e) =>
|
|
4413
|
+
"aria-valuetext": `${Qn(P)} из ${Qn(I)}`,
|
|
4414
|
+
onChange: (e) => J(Number(e.target.value))
|
|
4410
4415
|
}),
|
|
4411
4416
|
/* @__PURE__ */ t("span", {
|
|
4412
4417
|
className: $.time,
|
|
4413
|
-
children:
|
|
4418
|
+
children: Qn(I)
|
|
4414
4419
|
})
|
|
4415
4420
|
]
|
|
4416
4421
|
}),
|
|
@@ -4433,7 +4438,7 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4433
4438
|
className: $.controlButton,
|
|
4434
4439
|
"aria-label": ue ? "Выйти из полноэкранного режима" : "Полноэкранный режим",
|
|
4435
4440
|
title: "Полноэкранный режим (F)",
|
|
4436
|
-
onClick: () => void
|
|
4441
|
+
onClick: () => void Se(),
|
|
4437
4442
|
children: /* @__PURE__ */ t(q, {
|
|
4438
4443
|
name: ue ? "IconFullscreenExit" : "IconFullscreen",
|
|
4439
4444
|
width: 22,
|
|
@@ -4450,7 +4455,7 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4450
4455
|
children: a
|
|
4451
4456
|
})]
|
|
4452
4457
|
});
|
|
4453
|
-
},
|
|
4458
|
+
}, ir = {
|
|
4454
4459
|
root: "_root_ymidq_1",
|
|
4455
4460
|
trigger: "_trigger_ymidq_15",
|
|
4456
4461
|
heading: "_heading_ymidq_41",
|
|
@@ -4460,7 +4465,7 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4460
4465
|
open: "_open_ymidq_91",
|
|
4461
4466
|
content: "_content_ymidq_99",
|
|
4462
4467
|
contentInner: "_contentInner_ymidq_119"
|
|
4463
|
-
},
|
|
4468
|
+
}, ar = (e, t, n, r = 16) => {
|
|
4464
4469
|
if (t > Math.max(0, n - r * 2)) {
|
|
4465
4470
|
let t = e - r;
|
|
4466
4471
|
return Math.abs(t) <= 1 ? {
|
|
@@ -4482,7 +4487,7 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4482
4487
|
alignment: "none",
|
|
4483
4488
|
delta: 0
|
|
4484
4489
|
};
|
|
4485
|
-
},
|
|
4490
|
+
}, or = ({ title: e, subtitle: r, children: i, defaultOpen: a = !1, open: o, onOpenChange: s, autoScrollOnOpen: c = !0, scrollOffset: l = 16, className: u = "" }) => {
|
|
4486
4491
|
let p = f(), [m, _] = g(a), v = o ?? m, y = h(null), b = h(null), x = h(v);
|
|
4487
4492
|
return d(() => {
|
|
4488
4493
|
let e = x.current;
|
|
@@ -4492,7 +4497,7 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4492
4497
|
let r = !1, i = () => {
|
|
4493
4498
|
if (r) return;
|
|
4494
4499
|
r = !0;
|
|
4495
|
-
let e = t.getBoundingClientRect(), n =
|
|
4500
|
+
let e = t.getBoundingClientRect(), n = ar(e.top, e.height, window.innerHeight, l);
|
|
4496
4501
|
if (n.alignment === "none") return;
|
|
4497
4502
|
let i = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
|
4498
4503
|
window.scrollBy({
|
|
@@ -4513,10 +4518,10 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4513
4518
|
l
|
|
4514
4519
|
]), /* @__PURE__ */ n("section", {
|
|
4515
4520
|
ref: y,
|
|
4516
|
-
className: `${
|
|
4521
|
+
className: `${ir.root} ${v ? ir.open : ""} ${u}`,
|
|
4517
4522
|
children: [/* @__PURE__ */ n("button", {
|
|
4518
4523
|
type: "button",
|
|
4519
|
-
className:
|
|
4524
|
+
className: ir.trigger,
|
|
4520
4525
|
"aria-expanded": v,
|
|
4521
4526
|
"aria-controls": p,
|
|
4522
4527
|
onClick: () => {
|
|
@@ -4524,16 +4529,16 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4524
4529
|
o === void 0 && _(e), s?.(e);
|
|
4525
4530
|
},
|
|
4526
4531
|
children: [/* @__PURE__ */ n("span", {
|
|
4527
|
-
className:
|
|
4532
|
+
className: ir.heading,
|
|
4528
4533
|
children: [/* @__PURE__ */ t("span", {
|
|
4529
|
-
className:
|
|
4534
|
+
className: ir.title,
|
|
4530
4535
|
children: e
|
|
4531
4536
|
}), r && /* @__PURE__ */ t("span", {
|
|
4532
|
-
className:
|
|
4537
|
+
className: ir.subtitle,
|
|
4533
4538
|
children: r
|
|
4534
4539
|
})]
|
|
4535
4540
|
}), /* @__PURE__ */ t("span", {
|
|
4536
|
-
className:
|
|
4541
|
+
className: ir.icon,
|
|
4537
4542
|
"aria-hidden": "true",
|
|
4538
4543
|
children: /* @__PURE__ */ t(q, {
|
|
4539
4544
|
name: "IconChevron",
|
|
@@ -4544,15 +4549,15 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4544
4549
|
}), /* @__PURE__ */ t("div", {
|
|
4545
4550
|
ref: b,
|
|
4546
4551
|
id: p,
|
|
4547
|
-
className:
|
|
4552
|
+
className: ir.content,
|
|
4548
4553
|
"aria-hidden": !v,
|
|
4549
4554
|
children: /* @__PURE__ */ t("div", {
|
|
4550
|
-
className:
|
|
4555
|
+
className: ir.contentInner,
|
|
4551
4556
|
children: i
|
|
4552
4557
|
})
|
|
4553
4558
|
})]
|
|
4554
4559
|
});
|
|
4555
|
-
},
|
|
4560
|
+
}, sr = {
|
|
4556
4561
|
root: "_root_14ewt_1",
|
|
4557
4562
|
topSlot: "_topSlot_14ewt_29",
|
|
4558
4563
|
searchSlot: "_searchSlot_14ewt_31",
|
|
@@ -4570,14 +4575,14 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4570
4575
|
description: "_description_14ewt_235",
|
|
4571
4576
|
badge: "_badge_14ewt_269",
|
|
4572
4577
|
empty: "_empty_14ewt_281"
|
|
4573
|
-
},
|
|
4578
|
+
}, cr = (e, t, n) => {
|
|
4574
4579
|
if (e.length === 0) return -1;
|
|
4575
4580
|
for (let r = 1; r <= e.length; r += 1) {
|
|
4576
4581
|
let i = (t + n * r + e.length) % e.length;
|
|
4577
4582
|
if (!e[i]?.disabled) return i;
|
|
4578
4583
|
}
|
|
4579
4584
|
return -1;
|
|
4580
|
-
},
|
|
4585
|
+
}, lr = ({ groups: r, currentItemId: i, ariaLabel: a = "Основная навигация", searchSlot: o, topSlot: s, bottomSlot: c, emptyState: l, renderLink: u, onItemSelect: d, className: p = "" }) => {
|
|
4581
4586
|
let m = f(), g = h(null), _ = h({
|
|
4582
4587
|
value: "",
|
|
4583
4588
|
time: 0
|
|
@@ -4589,7 +4594,7 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4589
4594
|
let n = v.findIndex((e) => e.id === t.id);
|
|
4590
4595
|
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
4591
4596
|
e.preventDefault();
|
|
4592
|
-
let t =
|
|
4597
|
+
let t = cr(v, n, e.key === "ArrowDown" ? 1 : -1);
|
|
4593
4598
|
x(v[t]);
|
|
4594
4599
|
return;
|
|
4595
4600
|
}
|
|
@@ -4609,26 +4614,26 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4609
4614
|
let a = r.id === i, o = {
|
|
4610
4615
|
children: /* @__PURE__ */ n(e, { children: [
|
|
4611
4616
|
r.icon && /* @__PURE__ */ t("span", {
|
|
4612
|
-
className:
|
|
4617
|
+
className: sr.icon,
|
|
4613
4618
|
"aria-hidden": "true",
|
|
4614
4619
|
children: r.icon
|
|
4615
4620
|
}),
|
|
4616
4621
|
/* @__PURE__ */ n("span", {
|
|
4617
|
-
className:
|
|
4622
|
+
className: sr.copy,
|
|
4618
4623
|
children: [/* @__PURE__ */ t("span", {
|
|
4619
|
-
className:
|
|
4624
|
+
className: sr.label,
|
|
4620
4625
|
children: r.label
|
|
4621
4626
|
}), r.description && /* @__PURE__ */ t("span", {
|
|
4622
|
-
className:
|
|
4627
|
+
className: sr.description,
|
|
4623
4628
|
children: r.description
|
|
4624
4629
|
})]
|
|
4625
4630
|
}),
|
|
4626
4631
|
r.badge && /* @__PURE__ */ t("span", {
|
|
4627
|
-
className:
|
|
4632
|
+
className: sr.badge,
|
|
4628
4633
|
children: r.badge
|
|
4629
4634
|
})
|
|
4630
4635
|
] }),
|
|
4631
|
-
className: `${
|
|
4636
|
+
className: `${sr.link} ${a ? sr.current : ""}`,
|
|
4632
4637
|
tabIndex: r.id === b ? 0 : -1,
|
|
4633
4638
|
"aria-current": a ? "page" : void 0,
|
|
4634
4639
|
"aria-disabled": r.disabled ? !0 : void 0,
|
|
@@ -4644,7 +4649,7 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4644
4649
|
onKeyDown: (e) => S(e, r)
|
|
4645
4650
|
};
|
|
4646
4651
|
return /* @__PURE__ */ t("li", {
|
|
4647
|
-
className:
|
|
4652
|
+
className: sr.item,
|
|
4648
4653
|
children: u ? u(r, o) : r.href ? /* @__PURE__ */ t("a", {
|
|
4649
4654
|
href: r.href,
|
|
4650
4655
|
...o,
|
|
@@ -4659,45 +4664,45 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4659
4664
|
};
|
|
4660
4665
|
return /* @__PURE__ */ n("nav", {
|
|
4661
4666
|
ref: g,
|
|
4662
|
-
className: `${
|
|
4667
|
+
className: `${sr.root} ${p}`,
|
|
4663
4668
|
"aria-label": a,
|
|
4664
4669
|
children: [
|
|
4665
4670
|
s && /* @__PURE__ */ t("div", {
|
|
4666
|
-
className:
|
|
4671
|
+
className: sr.topSlot,
|
|
4667
4672
|
children: s
|
|
4668
4673
|
}),
|
|
4669
4674
|
o && /* @__PURE__ */ t("div", {
|
|
4670
|
-
className:
|
|
4675
|
+
className: sr.searchSlot,
|
|
4671
4676
|
children: o
|
|
4672
4677
|
}),
|
|
4673
4678
|
/* @__PURE__ */ n("div", {
|
|
4674
|
-
className:
|
|
4679
|
+
className: sr.groups,
|
|
4675
4680
|
children: [r.map((e) => {
|
|
4676
4681
|
let r = `${m}-${e.id}`;
|
|
4677
4682
|
return /* @__PURE__ */ n("section", {
|
|
4678
|
-
className:
|
|
4683
|
+
className: sr.group,
|
|
4679
4684
|
"aria-labelledby": e.label ? r : void 0,
|
|
4680
4685
|
children: [e.label && /* @__PURE__ */ t("div", {
|
|
4681
4686
|
id: r,
|
|
4682
|
-
className:
|
|
4687
|
+
className: sr.groupLabel,
|
|
4683
4688
|
children: e.label
|
|
4684
4689
|
}), /* @__PURE__ */ t("ul", {
|
|
4685
|
-
className:
|
|
4690
|
+
className: sr.list,
|
|
4686
4691
|
children: e.items.map(C)
|
|
4687
4692
|
})]
|
|
4688
4693
|
}, e.id);
|
|
4689
4694
|
}), v.length === 0 && l && /* @__PURE__ */ t("div", {
|
|
4690
|
-
className:
|
|
4695
|
+
className: sr.empty,
|
|
4691
4696
|
children: l
|
|
4692
4697
|
})]
|
|
4693
4698
|
}),
|
|
4694
4699
|
c && /* @__PURE__ */ t("div", {
|
|
4695
|
-
className:
|
|
4700
|
+
className: sr.bottomSlot,
|
|
4696
4701
|
children: c
|
|
4697
4702
|
})
|
|
4698
4703
|
]
|
|
4699
4704
|
});
|
|
4700
|
-
},
|
|
4705
|
+
}, ur = {
|
|
4701
4706
|
root: "_root_2mdgb_1",
|
|
4702
4707
|
list: "_list_2mdgb_19",
|
|
4703
4708
|
item: "_item_2mdgb_37",
|
|
@@ -4707,7 +4712,7 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4707
4712
|
icon: "_icon_2mdgb_141",
|
|
4708
4713
|
badge: "_badge_2mdgb_149",
|
|
4709
4714
|
label: "_label_2mdgb_163"
|
|
4710
|
-
},
|
|
4715
|
+
}, dr = ({ items: r, currentItemId: i, ariaLabel: a = "Мобильная навигация", renderLink: o, onItemSelect: s, className: c = "" }) => {
|
|
4711
4716
|
let l = h(null), u = r.filter((e) => !e.disabled), d = u.some((e) => e.id === i) ? i : u[0]?.id, f = (e) => {
|
|
4712
4717
|
l.current?.querySelectorAll("[data-ds-navigation-item]")[e]?.focus();
|
|
4713
4718
|
}, p = (e, t) => {
|
|
@@ -4724,27 +4729,27 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4724
4729
|
};
|
|
4725
4730
|
return /* @__PURE__ */ t("nav", {
|
|
4726
4731
|
ref: l,
|
|
4727
|
-
className: `${
|
|
4732
|
+
className: `${ur.root} ${c}`,
|
|
4728
4733
|
"aria-label": a,
|
|
4729
4734
|
children: /* @__PURE__ */ t("ul", {
|
|
4730
|
-
className:
|
|
4735
|
+
className: ur.list,
|
|
4731
4736
|
children: r.map((r) => {
|
|
4732
4737
|
let a = r.id === i, c = {
|
|
4733
4738
|
children: /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ n("span", {
|
|
4734
|
-
className:
|
|
4739
|
+
className: ur.visual,
|
|
4735
4740
|
children: [r.icon && /* @__PURE__ */ t("span", {
|
|
4736
|
-
className:
|
|
4741
|
+
className: ur.icon,
|
|
4737
4742
|
"aria-hidden": "true",
|
|
4738
4743
|
children: r.icon
|
|
4739
4744
|
}), r.badge && /* @__PURE__ */ t("span", {
|
|
4740
|
-
className:
|
|
4745
|
+
className: ur.badge,
|
|
4741
4746
|
children: r.badge
|
|
4742
4747
|
})]
|
|
4743
4748
|
}), /* @__PURE__ */ t("span", {
|
|
4744
|
-
className:
|
|
4749
|
+
className: ur.label,
|
|
4745
4750
|
children: r.label
|
|
4746
4751
|
})] }),
|
|
4747
|
-
className: `${
|
|
4752
|
+
className: `${ur.link} ${a ? ur.current : ""}`,
|
|
4748
4753
|
tabIndex: r.id === d ? 0 : -1,
|
|
4749
4754
|
"aria-current": a ? "page" : void 0,
|
|
4750
4755
|
"aria-disabled": r.disabled ? !0 : void 0,
|
|
@@ -4760,7 +4765,7 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4760
4765
|
onKeyDown: (e) => p(e, r)
|
|
4761
4766
|
};
|
|
4762
4767
|
return /* @__PURE__ */ t("li", {
|
|
4763
|
-
className:
|
|
4768
|
+
className: ur.item,
|
|
4764
4769
|
children: o ? o(r, c) : r.href ? /* @__PURE__ */ t("a", {
|
|
4765
4770
|
href: r.href,
|
|
4766
4771
|
...c,
|
|
@@ -4777,4 +4782,4 @@ var fn = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "
|
|
|
4777
4782
|
});
|
|
4778
4783
|
};
|
|
4779
4784
|
//#endregion
|
|
4780
|
-
export {
|
|
4785
|
+
export { bn as ConfirmModal, or as DSAccordion, w as DSBadge, dr as DSBottomNavigation, In as DSBottomSheet, j as DSButton, Se as DSCheckbox, D as DSCounterBadge, gt as DSDataTable, Ge as DSDateRange, He as DSDateTimePicker, Fn as DSDrawer, $e as DSDropDown, xt as DSDropDownMultiple, ee as DSFieldLabel, N as DSFieldMessage, Kt as DSFileInput, Lt as DSFilters, Jt as DSFloatingMenu, zt as DSFormGrid, Bt as DSFormGridItem, Ln as DSFullscreenDialog, q as DSIcon, Nt as DSInfoBlock, Ct as DSInput, k as DSLoader, mn as DSModal, pn as DSModalFrame, lr as DSNavigationSurface, Pn as DSOverlay, zn as DSPageLoader, qt as DSPortal, Ft as DSRadioButton, jt as DSSearchDropDown, qe as DSSkeleton, tt as DSSort, Zn as DSTabs, Qt as DSTextarea, Hn as DSToast, Kn as DSToastProvider, Yn as DSTooltip, Vt as DSValidationSummary, rr as DSVideoPlayerFrame, xn as ErrorModal, hn as ModalSystemProvider, Sn as builtInModalRegistry, gn as defineModalRegistry, E as formatDSCounterValue, Oe as formatDateInputValue, Pe as formatDateTimeLocalValue, ar as getDSAccordionScrollTarget, it as getDSDataTableColumnStyle, ot as getDSDataTablePaginationItems, at as getDSDataTableStickyColumnStyle, wn as getErrorMessage, rt as getNextDSDataTablePageSelection, Ze as getNextEnabledOptionIndex, je as isValidDateInputPrefix, We as isValidDateRange, ke as maskDateInputValue, Me as parseDateInputValue, Fe as parseDateTimeLocalValue, tn as resetModalStore, Gn as resetToastStore, Cn as useConfirmModal, En as useConfirmModalStore, Nn as useDSOverlay, Tn as useErrorModal, Dn as useErrorModalStore, On as useModals, en as useModalsStore, qn as useToast, Wn as useToastStore, st as validateDSDataTableData };
|