@efficiency-point/design-system 0.0.4 → 0.0.6
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/DSDateTimePicker/DSDateTimePicker.d.ts +2 -1
- package/dist/components/DSDateTimePicker/DSDateTimePicker.d.ts.map +1 -1
- package/dist/components/DSFilters/DSFilters.d.ts.map +1 -1
- package/dist/components/DSInput/DSInput.d.ts +21 -7
- package/dist/components/DSInput/DSInput.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.es.js +420 -249
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -45,17 +45,17 @@ var v = {
|
|
|
45
45
|
"aria-label": i ? void 0 : n,
|
|
46
46
|
"aria-hidden": i || void 0
|
|
47
47
|
}), S = {
|
|
48
|
-
button: "
|
|
49
|
-
sm: "
|
|
50
|
-
md: "
|
|
51
|
-
lg: "
|
|
52
|
-
primary: "
|
|
53
|
-
secondary: "
|
|
54
|
-
outline: "
|
|
55
|
-
ghost: "
|
|
56
|
-
empty: "
|
|
57
|
-
destructive: "
|
|
58
|
-
destructiveOutline: "
|
|
48
|
+
button: "_button_higub_1",
|
|
49
|
+
sm: "_sm_higub_16",
|
|
50
|
+
md: "_md_higub_17",
|
|
51
|
+
lg: "_lg_higub_18",
|
|
52
|
+
primary: "_primary_higub_19",
|
|
53
|
+
secondary: "_secondary_higub_20",
|
|
54
|
+
outline: "_outline_higub_21",
|
|
55
|
+
ghost: "_ghost_higub_23",
|
|
56
|
+
empty: "_empty_higub_29",
|
|
57
|
+
destructive: "_destructive_higub_34",
|
|
58
|
+
destructiveOutline: "_destructiveOutline_higub_35"
|
|
59
59
|
}, C = i(({ children: e, variant: n = "primary", size: r = "md", isLoading: i = !1, loadingLabel: a = "Загрузка", disabled: o, type: s = "button", className: c = "", ...l }, u) => /* @__PURE__ */ t("button", {
|
|
60
60
|
ref: u,
|
|
61
61
|
type: s,
|
|
@@ -153,75 +153,227 @@ var w = {
|
|
|
153
153
|
]
|
|
154
154
|
});
|
|
155
155
|
}, k = {
|
|
156
|
-
wrapper: "
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
156
|
+
wrapper: "_wrapper_phf7i_1",
|
|
157
|
+
trigger: "_trigger_phf7i_9",
|
|
158
|
+
nav: "_nav_phf7i_27",
|
|
159
|
+
day: "_day_phf7i_28",
|
|
160
|
+
monthSelect: "_monthSelect_phf7i_29",
|
|
161
|
+
yearInput: "_yearInput_phf7i_30",
|
|
162
|
+
timeInput: "_timeInput_phf7i_31",
|
|
163
|
+
value: "_value_phf7i_43",
|
|
164
|
+
placeholder: "_placeholder_phf7i_47",
|
|
165
|
+
error: "_error_phf7i_51",
|
|
166
|
+
panel: "_panel_phf7i_55",
|
|
167
|
+
calendarHeader: "_calendarHeader_phf7i_68",
|
|
168
|
+
weekdays: "_weekdays_phf7i_113",
|
|
169
|
+
days: "_days_phf7i_114",
|
|
170
|
+
outside: "_outside_phf7i_132",
|
|
171
|
+
selected: "_selected_phf7i_136",
|
|
172
|
+
timeLabel: "_timeLabel_phf7i_146"
|
|
173
|
+
}, A = [
|
|
174
|
+
"Пн",
|
|
175
|
+
"Вт",
|
|
176
|
+
"Ср",
|
|
177
|
+
"Чт",
|
|
178
|
+
"Пт",
|
|
179
|
+
"Сб",
|
|
180
|
+
"Вс"
|
|
181
|
+
], j = [
|
|
182
|
+
"Январь",
|
|
183
|
+
"Февраль",
|
|
184
|
+
"Март",
|
|
185
|
+
"Апрель",
|
|
186
|
+
"Май",
|
|
187
|
+
"Июнь",
|
|
188
|
+
"Июль",
|
|
189
|
+
"Август",
|
|
190
|
+
"Сентябрь",
|
|
191
|
+
"Октябрь",
|
|
192
|
+
"Ноябрь",
|
|
193
|
+
"Декабрь"
|
|
194
|
+
], M = (e) => String(e).padStart(2, "0"), N = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), P = (e, t) => {
|
|
160
195
|
if (!e) return "";
|
|
161
|
-
let n = `${e.getFullYear()}-${
|
|
196
|
+
let n = `${e.getFullYear()}-${M(e.getMonth() + 1)}-${M(e.getDate())}`, r = `${M(e.getHours())}:${M(e.getMinutes())}`;
|
|
162
197
|
return t === "date" ? n : t === "time" ? r : `${n}T${r}`;
|
|
163
|
-
},
|
|
198
|
+
}, ee = (e, t) => {
|
|
164
199
|
if (!e) return null;
|
|
165
200
|
if (t === "time") {
|
|
166
|
-
let
|
|
167
|
-
|
|
201
|
+
let t = /^(\d{2}):(\d{2})$/.exec(e);
|
|
202
|
+
if (!t) return null;
|
|
203
|
+
let n = Number(t[1]), r = Number(t[2]);
|
|
204
|
+
if (n > 23 || r > 59) return null;
|
|
205
|
+
let i = /* @__PURE__ */ new Date();
|
|
206
|
+
return i.setHours(n, r, 0, 0), i;
|
|
168
207
|
}
|
|
169
208
|
let n = new Date(t === "date" ? `${e}T00:00` : e);
|
|
170
209
|
return Number.isNaN(n.getTime()) ? null : n;
|
|
171
|
-
},
|
|
172
|
-
|
|
210
|
+
}, te = (e, t) => {
|
|
211
|
+
if (!e) return "";
|
|
212
|
+
let n = `${M(e.getDate())}.${M(e.getMonth() + 1)}.${e.getFullYear()}`, r = `${M(e.getHours())}:${M(e.getMinutes())}`;
|
|
213
|
+
return t === "date" ? n : t === "time" ? r : `${n} ${r}`;
|
|
214
|
+
}, ne = (e) => {
|
|
215
|
+
let t = new Date(e.getFullYear(), e.getMonth(), 1), n = (t.getDay() + 6) % 7, r = new Date(t);
|
|
216
|
+
return r.setDate(t.getDate() - n), Array.from({ length: 42 }, (e, t) => {
|
|
217
|
+
let n = new Date(r);
|
|
218
|
+
return n.setDate(r.getDate() + t), n;
|
|
219
|
+
});
|
|
220
|
+
}, re = (e, t) => !!(e && e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate()), ie = (e, t, n) => {
|
|
221
|
+
let r = N(e).getTime();
|
|
222
|
+
return !!(t && r < N(t).getTime() || n && r > N(n).getTime());
|
|
223
|
+
}, F = ({ value: r, onChange: i, mode: a = "date", label: d, placeholder: f, hint: p, error: m, disabled: h = !1, readOnly: g = !1, required: _ = !1, min: v, max: y, id: b, name: x, className: S = "" }) => {
|
|
224
|
+
let C = s(), w = b ?? `ds-date-time-${x ?? C}`, D = p ? `${w}-hint` : void 0, O = m ? `${w}-error` : void 0, M = l(null), N = l(null), [F, I] = u(!1), [L, R] = u(r ?? /* @__PURE__ */ new Date()), [z, B] = u(P(r, "time")), V = c(() => ne(L), [L]), H = a !== "time", U = a !== "date";
|
|
225
|
+
o(() => {
|
|
226
|
+
r && R(r), B(P(r, "time"));
|
|
227
|
+
}, [r]), o(() => {
|
|
228
|
+
let e = (e) => {
|
|
229
|
+
M.current?.contains(e.target) || I(!1);
|
|
230
|
+
}, t = (e) => {
|
|
231
|
+
e.key === "Escape" && (I(!1), N.current?.focus());
|
|
232
|
+
};
|
|
233
|
+
return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
|
|
234
|
+
document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
|
|
235
|
+
};
|
|
236
|
+
}, []);
|
|
237
|
+
let ae = (e) => {
|
|
238
|
+
if (ie(e, v, y)) return;
|
|
239
|
+
let t = new Date(e);
|
|
240
|
+
t.setHours(r?.getHours() ?? 0, r?.getMinutes() ?? 0, 0, 0), i?.(t), a === "date" && I(!1);
|
|
241
|
+
}, oe = (e) => {
|
|
242
|
+
if (B(e), !e) {
|
|
243
|
+
i?.(null);
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
let t = ee(e, "time");
|
|
247
|
+
if (!t) return;
|
|
248
|
+
let n = new Date(a === "datetime" ? r ?? L : /* @__PURE__ */ new Date());
|
|
249
|
+
n.setHours(t.getHours(), t.getMinutes(), 0, 0), !(v && n < v || y && n > y) && i?.(n);
|
|
250
|
+
}, W = f ?? (a === "date" ? "Выберите дату" : a === "time" ? "Введите время" : "Выберите дату и время"), se = [D, O].filter(Boolean).join(" ") || void 0;
|
|
173
251
|
return /* @__PURE__ */ n("div", {
|
|
174
|
-
|
|
252
|
+
ref: M,
|
|
253
|
+
className: `${k.wrapper} ${S}`,
|
|
175
254
|
children: [
|
|
176
|
-
|
|
177
|
-
htmlFor:
|
|
178
|
-
required:
|
|
179
|
-
disabled:
|
|
180
|
-
children:
|
|
255
|
+
d && /* @__PURE__ */ t(T, {
|
|
256
|
+
htmlFor: w,
|
|
257
|
+
required: _,
|
|
258
|
+
disabled: h,
|
|
259
|
+
children: d
|
|
181
260
|
}),
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
"aria-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
261
|
+
/* @__PURE__ */ n("button", {
|
|
262
|
+
ref: N,
|
|
263
|
+
id: w,
|
|
264
|
+
name: x,
|
|
265
|
+
type: "button",
|
|
266
|
+
className: `${k.trigger} ${m ? k.error : ""}`,
|
|
267
|
+
disabled: h,
|
|
268
|
+
"aria-readonly": g || void 0,
|
|
269
|
+
"aria-expanded": F,
|
|
270
|
+
"aria-haspopup": "dialog",
|
|
271
|
+
"aria-describedby": se,
|
|
272
|
+
onClick: () => {
|
|
273
|
+
g || I((e) => !e);
|
|
274
|
+
},
|
|
275
|
+
children: [/* @__PURE__ */ t("span", {
|
|
276
|
+
className: r ? k.value : k.placeholder,
|
|
277
|
+
children: te(r, a) || W
|
|
278
|
+
}), /* @__PURE__ */ t("span", {
|
|
279
|
+
"aria-hidden": "true",
|
|
280
|
+
children: "▾"
|
|
281
|
+
})]
|
|
199
282
|
}),
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
283
|
+
F && !g && /* @__PURE__ */ n("div", {
|
|
284
|
+
className: k.panel,
|
|
285
|
+
role: "dialog",
|
|
286
|
+
"aria-label": d ?? W,
|
|
287
|
+
children: [H && /* @__PURE__ */ n(e, { children: [
|
|
288
|
+
/* @__PURE__ */ n("div", {
|
|
289
|
+
className: k.calendarHeader,
|
|
290
|
+
children: [
|
|
291
|
+
/* @__PURE__ */ t("button", {
|
|
292
|
+
type: "button",
|
|
293
|
+
className: k.nav,
|
|
294
|
+
"aria-label": "Предыдущий месяц",
|
|
295
|
+
onClick: () => R(new Date(L.getFullYear(), L.getMonth() - 1, 1)),
|
|
296
|
+
children: "‹"
|
|
297
|
+
}),
|
|
298
|
+
/* @__PURE__ */ t("select", {
|
|
299
|
+
className: k.monthSelect,
|
|
300
|
+
"aria-label": "Месяц",
|
|
301
|
+
value: L.getMonth(),
|
|
302
|
+
onChange: (e) => R(new Date(L.getFullYear(), Number(e.target.value), 1)),
|
|
303
|
+
children: j.map((e, n) => /* @__PURE__ */ t("option", {
|
|
304
|
+
value: n,
|
|
305
|
+
children: e
|
|
306
|
+
}, e))
|
|
307
|
+
}),
|
|
308
|
+
/* @__PURE__ */ t("input", {
|
|
309
|
+
className: k.yearInput,
|
|
310
|
+
type: "number",
|
|
311
|
+
"aria-label": "Год",
|
|
312
|
+
value: L.getFullYear(),
|
|
313
|
+
onChange: (e) => R(new Date(Number(e.target.value), L.getMonth(), 1))
|
|
314
|
+
}),
|
|
315
|
+
/* @__PURE__ */ t("button", {
|
|
316
|
+
type: "button",
|
|
317
|
+
className: k.nav,
|
|
318
|
+
"aria-label": "Следующий месяц",
|
|
319
|
+
onClick: () => R(new Date(L.getFullYear(), L.getMonth() + 1, 1)),
|
|
320
|
+
children: "›"
|
|
321
|
+
})
|
|
322
|
+
]
|
|
323
|
+
}),
|
|
324
|
+
/* @__PURE__ */ t("div", {
|
|
325
|
+
className: k.weekdays,
|
|
326
|
+
children: A.map((e) => /* @__PURE__ */ t("span", { children: e }, e))
|
|
327
|
+
}),
|
|
328
|
+
/* @__PURE__ */ t("div", {
|
|
329
|
+
className: k.days,
|
|
330
|
+
children: V.map((e) => {
|
|
331
|
+
let n = re(r, e);
|
|
332
|
+
return /* @__PURE__ */ t("button", {
|
|
333
|
+
type: "button",
|
|
334
|
+
className: `${k.day} ${e.getMonth() === L.getMonth() ? "" : k.outside} ${n ? k.selected : ""}`,
|
|
335
|
+
disabled: ie(e, v, y),
|
|
336
|
+
"aria-pressed": n,
|
|
337
|
+
onClick: () => ae(e),
|
|
338
|
+
children: e.getDate()
|
|
339
|
+
}, e.toISOString());
|
|
340
|
+
})
|
|
341
|
+
})
|
|
342
|
+
] }), U && /* @__PURE__ */ n("label", {
|
|
343
|
+
className: k.timeLabel,
|
|
344
|
+
children: [/* @__PURE__ */ t("span", { children: "Время" }), /* @__PURE__ */ t("input", {
|
|
345
|
+
className: k.timeInput,
|
|
346
|
+
type: "time",
|
|
347
|
+
value: z,
|
|
348
|
+
onChange: (e) => oe(e.target.value)
|
|
349
|
+
})]
|
|
350
|
+
})]
|
|
203
351
|
}),
|
|
204
|
-
|
|
205
|
-
id:
|
|
352
|
+
p && !m && /* @__PURE__ */ t(E, {
|
|
353
|
+
id: D,
|
|
354
|
+
children: p
|
|
355
|
+
}),
|
|
356
|
+
m && /* @__PURE__ */ t(E, {
|
|
357
|
+
id: O,
|
|
206
358
|
variant: "error",
|
|
207
|
-
children:
|
|
359
|
+
children: m
|
|
208
360
|
})
|
|
209
361
|
]
|
|
210
362
|
});
|
|
211
|
-
},
|
|
363
|
+
}, I = {
|
|
212
364
|
root: "_root_9h2e2_1",
|
|
213
365
|
legend: "_legend_9h2e2_2",
|
|
214
366
|
range: "_range_9h2e2_3"
|
|
215
|
-
},
|
|
367
|
+
}, L = (e) => !!(e.from && e.to && e.from.getTime() <= e.to.getTime()), R = ({ 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 = "" }) => {
|
|
216
368
|
let g = l ?? (e.from && e.to && e.from > e.to ? "Дата «От» не может быть позже даты «До»" : void 0), _ = (e) => {
|
|
217
|
-
i?.(e),
|
|
369
|
+
i?.(e), L(e) && r?.(e);
|
|
218
370
|
};
|
|
219
371
|
return /* @__PURE__ */ n("fieldset", {
|
|
220
|
-
className: `${
|
|
372
|
+
className: `${I.root} ${h}`,
|
|
221
373
|
disabled: f,
|
|
222
374
|
children: [/* @__PURE__ */ n("div", {
|
|
223
|
-
className:
|
|
224
|
-
children: [/* @__PURE__ */ t(
|
|
375
|
+
className: I.range,
|
|
376
|
+
children: [/* @__PURE__ */ t(F, {
|
|
225
377
|
value: e.from,
|
|
226
378
|
mode: a === "datetime" ? "datetime" : a,
|
|
227
379
|
label: o,
|
|
@@ -235,7 +387,7 @@ var w = {
|
|
|
235
387
|
...e,
|
|
236
388
|
from: t
|
|
237
389
|
})
|
|
238
|
-
}), /* @__PURE__ */ t(
|
|
390
|
+
}), /* @__PURE__ */ t(F, {
|
|
239
391
|
value: e.to,
|
|
240
392
|
mode: a === "datetime" ? "datetime" : a,
|
|
241
393
|
label: s,
|
|
@@ -252,7 +404,7 @@ var w = {
|
|
|
252
404
|
})]
|
|
253
405
|
}), c && !g && /* @__PURE__ */ t(E, { children: c })]
|
|
254
406
|
});
|
|
255
|
-
},
|
|
407
|
+
}, z = {
|
|
256
408
|
group: "_group_1st6r_1",
|
|
257
409
|
skeleton: "_skeleton_1st6r_2",
|
|
258
410
|
text: "_text_1st6r_3",
|
|
@@ -260,17 +412,17 @@ var w = {
|
|
|
260
412
|
circular: "_circular_1st6r_5",
|
|
261
413
|
animated: "_animated_1st6r_6",
|
|
262
414
|
"ds-skeleton": "_ds-skeleton_1st6r_1"
|
|
263
|
-
},
|
|
264
|
-
className: `${
|
|
415
|
+
}, B = ({ variant: e = "text", width: n = "100%", height: r, lines: i = 1, animated: a = !0, className: o = "" }) => /* @__PURE__ */ t("span", {
|
|
416
|
+
className: `${z.group} ${o}`,
|
|
265
417
|
"aria-hidden": "true",
|
|
266
418
|
children: Array.from({ length: Math.max(1, i) }, (o, s) => /* @__PURE__ */ t("span", {
|
|
267
|
-
className: `${
|
|
419
|
+
className: `${z.skeleton} ${z[e]} ${a ? z.animated : ""}`,
|
|
268
420
|
style: {
|
|
269
421
|
width: s === i - 1 && i > 1 ? "70%" : n,
|
|
270
422
|
height: r
|
|
271
423
|
}
|
|
272
424
|
}, s))
|
|
273
|
-
}),
|
|
425
|
+
}), V = {
|
|
274
426
|
wrapper: "_wrapper_dkn63_1",
|
|
275
427
|
label: "_label_dkn63_17",
|
|
276
428
|
container: "_container_dkn63_29",
|
|
@@ -286,13 +438,13 @@ var w = {
|
|
|
286
438
|
message: "_message_dkn63_265",
|
|
287
439
|
error: "_error_dkn63_267",
|
|
288
440
|
errorState: "_errorState_dkn63_293"
|
|
289
|
-
},
|
|
441
|
+
}, H = (e, t, n) => {
|
|
290
442
|
for (let r = 0; r < e.length; r += 1) {
|
|
291
443
|
let i = (t + r * n + e.length) % e.length;
|
|
292
444
|
if (!e[i]?.disabled) return i;
|
|
293
445
|
}
|
|
294
446
|
return -1;
|
|
295
|
-
},
|
|
447
|
+
}, U = ({ options: r, value: i, onChange: a, placeholder: d = "Выберите опцию", disabled: f = !1, stringWhileDisabled: p = !1, label: m, error: h, hint: g, className: _ = "", name: v, id: y, needMark: b = !0, maxMenuHeight: x }) => {
|
|
296
448
|
let S = s(), C = y ?? `ds-dropdown-${v ?? S}`, [w, T] = u(!1), E = l(null), D = l(null), O = l([]), k = c(() => r.find((e) => e.value === i), [r, i]), A = g ? `${C}-hint` : void 0, j = h ? `${C}-error` : void 0, M = [A, j].filter(Boolean).join(" ") || void 0, N = f && p;
|
|
297
449
|
o(() => {
|
|
298
450
|
let e = (e) => {
|
|
@@ -305,29 +457,29 @@ var w = {
|
|
|
305
457
|
};
|
|
306
458
|
}, [w]);
|
|
307
459
|
let P = (e, t) => {
|
|
308
|
-
let n =
|
|
460
|
+
let n = H(r, e, t);
|
|
309
461
|
O.current[n]?.focus(), O.current[n]?.scrollIntoView({ block: "nearest" });
|
|
310
|
-
},
|
|
462
|
+
}, ee = (e) => {
|
|
311
463
|
e.disabled || (a?.(e.value, e), T(!1), D.current?.focus());
|
|
312
464
|
};
|
|
313
465
|
return /* @__PURE__ */ n("div", {
|
|
314
466
|
ref: E,
|
|
315
467
|
className: [
|
|
316
|
-
|
|
317
|
-
h ?
|
|
468
|
+
V.wrapper,
|
|
469
|
+
h ? V.errorState : "",
|
|
318
470
|
_
|
|
319
471
|
].filter(Boolean).join(" "),
|
|
320
472
|
children: [
|
|
321
473
|
m && /* @__PURE__ */ t("label", {
|
|
322
474
|
htmlFor: N ? void 0 : C,
|
|
323
|
-
className:
|
|
475
|
+
className: V.label,
|
|
324
476
|
children: m
|
|
325
477
|
}),
|
|
326
478
|
/* @__PURE__ */ t("div", {
|
|
327
|
-
className:
|
|
479
|
+
className: V.container,
|
|
328
480
|
children: N ? /* @__PURE__ */ t("div", {
|
|
329
481
|
id: C,
|
|
330
|
-
className:
|
|
482
|
+
className: V.disabledText,
|
|
331
483
|
"aria-describedby": M,
|
|
332
484
|
children: k?.label ?? d
|
|
333
485
|
}) : /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ n("button", {
|
|
@@ -335,7 +487,7 @@ var w = {
|
|
|
335
487
|
id: C,
|
|
336
488
|
type: "button",
|
|
337
489
|
name: v,
|
|
338
|
-
className:
|
|
490
|
+
className: V.trigger,
|
|
339
491
|
disabled: f,
|
|
340
492
|
"aria-haspopup": "listbox",
|
|
341
493
|
"aria-expanded": w,
|
|
@@ -351,10 +503,10 @@ var w = {
|
|
|
351
503
|
}
|
|
352
504
|
},
|
|
353
505
|
children: [/* @__PURE__ */ t("span", {
|
|
354
|
-
className: k ?
|
|
506
|
+
className: k ? V.value : V.placeholder,
|
|
355
507
|
children: k?.label ?? d
|
|
356
508
|
}), /* @__PURE__ */ t("span", {
|
|
357
|
-
className: `${
|
|
509
|
+
className: `${V.chevron} ${w ? V.chevronOpen : ""}`,
|
|
358
510
|
"aria-hidden": "true",
|
|
359
511
|
children: /* @__PURE__ */ t("svg", {
|
|
360
512
|
viewBox: "0 0 20 20",
|
|
@@ -370,7 +522,7 @@ var w = {
|
|
|
370
522
|
})]
|
|
371
523
|
}), w && /* @__PURE__ */ t("ul", {
|
|
372
524
|
id: `${C}-listbox`,
|
|
373
|
-
className:
|
|
525
|
+
className: V.menu,
|
|
374
526
|
role: "listbox",
|
|
375
527
|
"aria-label": m,
|
|
376
528
|
style: { maxHeight: x },
|
|
@@ -386,8 +538,8 @@ var w = {
|
|
|
386
538
|
role: "option",
|
|
387
539
|
"aria-selected": o,
|
|
388
540
|
disabled: e.disabled,
|
|
389
|
-
className: `${
|
|
390
|
-
onClick: () =>
|
|
541
|
+
className: `${V.option} ${o ? V.selected : ""}`,
|
|
542
|
+
onClick: () => ee(e),
|
|
391
543
|
onKeyDown: (e) => {
|
|
392
544
|
if ((e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), P(a + (e.key === "ArrowDown" ? 1 : -1), e.key === "ArrowDown" ? 1 : -1)), e.key === "Tab" && T(!1), e.key === "Home" || e.key === "End") {
|
|
393
545
|
e.preventDefault();
|
|
@@ -406,35 +558,35 @@ var w = {
|
|
|
406
558
|
}),
|
|
407
559
|
g && !h && /* @__PURE__ */ t("span", {
|
|
408
560
|
id: A,
|
|
409
|
-
className:
|
|
561
|
+
className: V.message,
|
|
410
562
|
children: g
|
|
411
563
|
}),
|
|
412
564
|
h && /* @__PURE__ */ t("span", {
|
|
413
565
|
id: j,
|
|
414
|
-
className:
|
|
566
|
+
className: V.error,
|
|
415
567
|
children: h
|
|
416
568
|
})
|
|
417
569
|
]
|
|
418
570
|
});
|
|
419
|
-
},
|
|
571
|
+
}, ae = (e) => `${e.id}:${e.direction}`, oe = ({ options: e, value: n, onChange: r, label: i = "Сортировка", placeholder: a = "Выберите сортировку", disabled: o = !1, className: s }) => {
|
|
420
572
|
let c = e.flatMap((e) => [{
|
|
421
|
-
value:
|
|
573
|
+
value: ae({
|
|
422
574
|
id: e.id,
|
|
423
575
|
direction: "asc"
|
|
424
576
|
}),
|
|
425
577
|
label: e.ascLabel ?? `${e.label} · по возрастанию`,
|
|
426
578
|
disabled: e.disabled
|
|
427
579
|
}, {
|
|
428
|
-
value:
|
|
580
|
+
value: ae({
|
|
429
581
|
id: e.id,
|
|
430
582
|
direction: "desc"
|
|
431
583
|
}),
|
|
432
584
|
label: e.descLabel ?? `${e.label} · по убыванию`,
|
|
433
585
|
disabled: e.disabled
|
|
434
586
|
}]);
|
|
435
|
-
return /* @__PURE__ */ t(
|
|
587
|
+
return /* @__PURE__ */ t(U, {
|
|
436
588
|
options: c,
|
|
437
|
-
value: n ?
|
|
589
|
+
value: n ? ae(n) : "",
|
|
438
590
|
label: i,
|
|
439
591
|
placeholder: a,
|
|
440
592
|
disabled: o,
|
|
@@ -447,7 +599,7 @@ var w = {
|
|
|
447
599
|
});
|
|
448
600
|
}
|
|
449
601
|
});
|
|
450
|
-
},
|
|
602
|
+
}, W = {
|
|
451
603
|
root: "_root_i4d62_1",
|
|
452
604
|
tableWrap: "_tableWrap_i4d62_2",
|
|
453
605
|
table: "_table_i4d62_2",
|
|
@@ -461,10 +613,10 @@ var w = {
|
|
|
461
613
|
default: "_default_i4d62_21",
|
|
462
614
|
tableOnMobile: "_tableOnMobile_i4d62_21",
|
|
463
615
|
wide: "_wide_i4d62_23"
|
|
464
|
-
},
|
|
616
|
+
}, se = m({
|
|
465
617
|
rowSortingFeature: p,
|
|
466
618
|
sortedRowModel: f()
|
|
467
|
-
}),
|
|
619
|
+
}), ce = (e, t) => {
|
|
468
620
|
let n = /* @__PURE__ */ new Set();
|
|
469
621
|
for (let t of e) {
|
|
470
622
|
if (!t.id.trim()) return "Идентификатор колонки не может быть пустым";
|
|
@@ -473,8 +625,8 @@ var w = {
|
|
|
473
625
|
}
|
|
474
626
|
for (let n = 0; n < t.length; n += 1) for (let r of e) if (typeof r.accessor == "string" && !(r.accessor in t[n])) return `В строке ${n + 1} отсутствует колонка «${r.id}»`;
|
|
475
627
|
return null;
|
|
476
|
-
},
|
|
477
|
-
let [S, C] = u([]), w = o ?? S, T = c(() =>
|
|
628
|
+
}, le = ({ columns: e, data: r, tableOnMobile: i = !1, breakpoint: a = "default", sorting: o, onSortingChange: s, renderMobileCard: l, getRowId: f, caption: p, ariaLabel: m, loading: g = !1, error: _, emptyState: v = "Нет данных", stickyHeader: y = !1, maxHeight: b, className: x = "" }) => {
|
|
629
|
+
let [S, C] = u([]), w = o ?? S, T = c(() => ce(e, r), [e, r]), E = c(() => d(), []), D = c(() => E.columns(e.map((e) => {
|
|
478
630
|
let t = e.accessor;
|
|
479
631
|
return E.accessor(typeof t == "function" ? t : (e) => e[t], {
|
|
480
632
|
id: e.id,
|
|
@@ -484,7 +636,7 @@ var w = {
|
|
|
484
636
|
sortDescFirst: e.sortDescFirst
|
|
485
637
|
});
|
|
486
638
|
})), [e, E]), O = h({
|
|
487
|
-
features:
|
|
639
|
+
features: se,
|
|
488
640
|
columns: D,
|
|
489
641
|
data: r,
|
|
490
642
|
state: { sorting: w },
|
|
@@ -497,17 +649,17 @@ var w = {
|
|
|
497
649
|
id: e.id,
|
|
498
650
|
label: typeof e.header == "string" ? e.header : e.id
|
|
499
651
|
})), j = [
|
|
500
|
-
|
|
501
|
-
a === "wide" ?
|
|
502
|
-
i ?
|
|
652
|
+
W.root,
|
|
653
|
+
a === "wide" ? W.wide : W.default,
|
|
654
|
+
i ? W.tableOnMobile : "",
|
|
503
655
|
x
|
|
504
656
|
].filter(Boolean).join(" "), M = T ?? _;
|
|
505
657
|
return /* @__PURE__ */ n("section", {
|
|
506
658
|
className: j,
|
|
507
659
|
"aria-busy": g,
|
|
508
660
|
children: [
|
|
509
|
-
!i && !g && !M && k.length > 0 && /* @__PURE__ */ t(
|
|
510
|
-
className:
|
|
661
|
+
!i && !g && !M && k.length > 0 && /* @__PURE__ */ t(oe, {
|
|
662
|
+
className: W.mobileSort,
|
|
511
663
|
options: A,
|
|
512
664
|
value: w[0] ? {
|
|
513
665
|
id: w[0].id,
|
|
@@ -519,15 +671,15 @@ var w = {
|
|
|
519
671
|
}])
|
|
520
672
|
}),
|
|
521
673
|
/* @__PURE__ */ t("div", {
|
|
522
|
-
className:
|
|
674
|
+
className: W.tableWrap,
|
|
523
675
|
style: { maxHeight: b },
|
|
524
676
|
children: /* @__PURE__ */ n("table", {
|
|
525
|
-
className:
|
|
677
|
+
className: W.table,
|
|
526
678
|
"aria-label": m,
|
|
527
679
|
children: [
|
|
528
680
|
p && /* @__PURE__ */ t("caption", { children: p }),
|
|
529
681
|
/* @__PURE__ */ t("thead", {
|
|
530
|
-
className: y ?
|
|
682
|
+
className: y ? W.sticky : "",
|
|
531
683
|
children: O.getHeaderGroups().map((e) => /* @__PURE__ */ t("tr", { children: e.headers.map((e) => {
|
|
532
684
|
let r = e.column.getIsSorted();
|
|
533
685
|
return /* @__PURE__ */ t("th", {
|
|
@@ -535,7 +687,7 @@ var w = {
|
|
|
535
687
|
"aria-sort": r === "asc" ? "ascending" : r === "desc" ? "descending" : "none",
|
|
536
688
|
children: /* @__PURE__ */ n("button", {
|
|
537
689
|
type: "button",
|
|
538
|
-
className:
|
|
690
|
+
className: W.sortButton,
|
|
539
691
|
onClick: e.column.getToggleSortingHandler(),
|
|
540
692
|
children: [/* @__PURE__ */ t(O.FlexRender, { header: e }), /* @__PURE__ */ t("span", {
|
|
541
693
|
"aria-hidden": "true",
|
|
@@ -547,13 +699,13 @@ var w = {
|
|
|
547
699
|
}),
|
|
548
700
|
/* @__PURE__ */ t("tbody", { children: g ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
549
701
|
colSpan: e.length,
|
|
550
|
-
children: /* @__PURE__ */ t(
|
|
702
|
+
children: /* @__PURE__ */ t(B, { lines: 3 })
|
|
551
703
|
}) }) : M ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
552
|
-
className:
|
|
704
|
+
className: W.state,
|
|
553
705
|
colSpan: e.length,
|
|
554
706
|
children: M
|
|
555
707
|
}) }) : k.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
556
|
-
className:
|
|
708
|
+
className: W.state,
|
|
557
709
|
colSpan: e.length,
|
|
558
710
|
children: v
|
|
559
711
|
}) }) : k.map((e) => /* @__PURE__ */ t("tr", { children: e.getAllCells().map((e) => /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t(O.FlexRender, { cell: e }) }, e.id)) }, e.id)) })
|
|
@@ -561,14 +713,14 @@ var w = {
|
|
|
561
713
|
})
|
|
562
714
|
}),
|
|
563
715
|
!i && /* @__PURE__ */ t("div", {
|
|
564
|
-
className:
|
|
716
|
+
className: W.cards,
|
|
565
717
|
role: "list",
|
|
566
718
|
"aria-label": m ?? p,
|
|
567
|
-
children: g ? /* @__PURE__ */ t(
|
|
568
|
-
className:
|
|
719
|
+
children: g ? /* @__PURE__ */ t(B, { lines: 4 }) : M ? /* @__PURE__ */ t("div", {
|
|
720
|
+
className: W.state,
|
|
569
721
|
children: M
|
|
570
722
|
}) : k.length === 0 ? /* @__PURE__ */ t("div", {
|
|
571
|
-
className:
|
|
723
|
+
className: W.state,
|
|
572
724
|
children: v
|
|
573
725
|
}) : k.map((r) => {
|
|
574
726
|
if (l) return /* @__PURE__ */ t("div", {
|
|
@@ -581,11 +733,11 @@ var w = {
|
|
|
581
733
|
let i = e.filter((e) => !e.mobile?.hideOnMobile).sort((e, t) => (e.mobile?.mobileOrder ?? 0) - (t.mobile?.mobileOrder ?? 0)), a = i.find((e) => e.mobile?.primary) ?? i.find((e) => e.mobile?.mobileVariant !== "actions"), o = (e) => typeof e.accessor == "function" ? e.accessor(r.original) : r.original[e.accessor], s = (e) => e.mobile?.renderMobile?.(r.original, o(e)) ?? e.cell?.(r.original, o(e)) ?? String(o(e) ?? "");
|
|
582
734
|
return /* @__PURE__ */ n("article", {
|
|
583
735
|
role: "listitem",
|
|
584
|
-
className:
|
|
736
|
+
className: W.card,
|
|
585
737
|
children: [
|
|
586
738
|
/* @__PURE__ */ t("h3", { children: a ? s(a) : `Строка ${r.index + 1}` }),
|
|
587
739
|
/* @__PURE__ */ t("dl", { children: i.filter((e) => e !== a && e.mobile?.mobileVariant !== "actions").map((e) => /* @__PURE__ */ n("div", {
|
|
588
|
-
className: e.mobile?.mobileSpan === 2 ?
|
|
740
|
+
className: e.mobile?.mobileSpan === 2 ? W.spanTwo : "",
|
|
589
741
|
children: [/* @__PURE__ */ t("dt", { children: e.mobile?.mobileLabel ?? e.header }), /* @__PURE__ */ t("dd", { children: s(e) })]
|
|
590
742
|
}, e.id)) }),
|
|
591
743
|
i.filter((e) => e.mobile?.mobileVariant === "actions").map((e) => /* @__PURE__ */ t("footer", { children: s(e) }, e.id))
|
|
@@ -595,7 +747,7 @@ var w = {
|
|
|
595
747
|
})
|
|
596
748
|
]
|
|
597
749
|
});
|
|
598
|
-
},
|
|
750
|
+
}, ue = ({ options: e, value: r, onChange: i, placeholder: a = "Выберите опции", disabled: d = !1, label: f, error: p, hint: m, className: h = "", name: g, id: _, closeOnSelect: v = !1, maxMenuHeight: y }) => {
|
|
599
751
|
let b = s(), x = _ ?? `ds-dropdown-multiple-${g ?? b}`, [S, C] = u(!1), w = l(null), T = l(null), E = l([]), D = c(() => e.filter((e) => r.includes(e.value)), [e, r]), O = D.map((e) => e.label).join(", "), k = m ? `${x}-hint` : void 0, A = p ? `${x}-error` : void 0;
|
|
600
752
|
o(() => {
|
|
601
753
|
let e = (e) => {
|
|
@@ -612,30 +764,30 @@ var w = {
|
|
|
612
764
|
let n = r.includes(t.value) ? r.filter((e) => e !== t.value) : [...r, t.value];
|
|
613
765
|
i?.(n, e.filter((e) => n.includes(e.value))), v && (C(!1), T.current?.focus());
|
|
614
766
|
}, M = (t, n) => {
|
|
615
|
-
let r =
|
|
767
|
+
let r = H(e, t, n);
|
|
616
768
|
E.current[r]?.focus(), E.current[r]?.scrollIntoView({ block: "nearest" });
|
|
617
769
|
};
|
|
618
770
|
return /* @__PURE__ */ n("div", {
|
|
619
771
|
ref: w,
|
|
620
772
|
className: [
|
|
621
|
-
|
|
622
|
-
p ?
|
|
773
|
+
V.wrapper,
|
|
774
|
+
p ? V.errorState : "",
|
|
623
775
|
h
|
|
624
776
|
].filter(Boolean).join(" "),
|
|
625
777
|
children: [
|
|
626
778
|
f && /* @__PURE__ */ t("label", {
|
|
627
779
|
htmlFor: x,
|
|
628
|
-
className:
|
|
780
|
+
className: V.label,
|
|
629
781
|
children: f
|
|
630
782
|
}),
|
|
631
783
|
/* @__PURE__ */ n("div", {
|
|
632
|
-
className:
|
|
784
|
+
className: V.container,
|
|
633
785
|
children: [/* @__PURE__ */ n("button", {
|
|
634
786
|
ref: T,
|
|
635
787
|
id: x,
|
|
636
788
|
type: "button",
|
|
637
789
|
name: g,
|
|
638
|
-
className:
|
|
790
|
+
className: V.trigger,
|
|
639
791
|
disabled: d,
|
|
640
792
|
"aria-haspopup": "listbox",
|
|
641
793
|
"aria-expanded": S,
|
|
@@ -651,16 +803,16 @@ var w = {
|
|
|
651
803
|
}
|
|
652
804
|
},
|
|
653
805
|
children: [/* @__PURE__ */ t("span", {
|
|
654
|
-
className: D.length ?
|
|
806
|
+
className: D.length ? V.value : V.placeholder,
|
|
655
807
|
children: O || a
|
|
656
808
|
}), /* @__PURE__ */ t("span", {
|
|
657
|
-
className: `${
|
|
809
|
+
className: `${V.chevron} ${S ? V.chevronOpen : ""}`,
|
|
658
810
|
"aria-hidden": "true",
|
|
659
811
|
children: "⌄"
|
|
660
812
|
})]
|
|
661
813
|
}), S && /* @__PURE__ */ t("ul", {
|
|
662
814
|
id: `${x}-listbox`,
|
|
663
|
-
className:
|
|
815
|
+
className: V.menu,
|
|
664
816
|
role: "listbox",
|
|
665
817
|
"aria-label": f,
|
|
666
818
|
"aria-multiselectable": "true",
|
|
@@ -677,7 +829,7 @@ var w = {
|
|
|
677
829
|
role: "option",
|
|
678
830
|
"aria-selected": o,
|
|
679
831
|
disabled: i.disabled,
|
|
680
|
-
className: `${
|
|
832
|
+
className: `${V.option} ${o ? V.selected : ""}`,
|
|
681
833
|
onClick: () => j(i),
|
|
682
834
|
onKeyDown: (t) => {
|
|
683
835
|
if (t.key === "ArrowDown" || t.key === "ArrowUp") {
|
|
@@ -703,17 +855,17 @@ var w = {
|
|
|
703
855
|
}),
|
|
704
856
|
m && !p && /* @__PURE__ */ t("span", {
|
|
705
857
|
id: k,
|
|
706
|
-
className:
|
|
858
|
+
className: V.message,
|
|
707
859
|
children: m
|
|
708
860
|
}),
|
|
709
861
|
p && /* @__PURE__ */ t("span", {
|
|
710
862
|
id: A,
|
|
711
|
-
className:
|
|
863
|
+
className: V.error,
|
|
712
864
|
children: p
|
|
713
865
|
})
|
|
714
866
|
]
|
|
715
867
|
});
|
|
716
|
-
},
|
|
868
|
+
}, de = {
|
|
717
869
|
approve: "M4 12l5 5L20 6",
|
|
718
870
|
reject: "M5 5l14 14M19 5L5 19",
|
|
719
871
|
edit: "M4 20h4L19 9l-4-4L4 16v4z",
|
|
@@ -722,7 +874,7 @@ var w = {
|
|
|
722
874
|
basket: "M4 7h16l-1 13H5L4 7zm3 0V4h10v3",
|
|
723
875
|
info: "M12 10v7m0-10v.01",
|
|
724
876
|
warning: "M12 4L3 20h18L12 4zm0 5v5m0 3v.01"
|
|
725
|
-
},
|
|
877
|
+
}, fe = ({ name: e, title: r, width: i = 24, height: a = 24, ...o }) => /* @__PURE__ */ n("svg", {
|
|
726
878
|
viewBox: "0 0 24 24",
|
|
727
879
|
width: i,
|
|
728
880
|
height: a,
|
|
@@ -735,27 +887,27 @@ var w = {
|
|
|
735
887
|
"aria-hidden": !r || void 0,
|
|
736
888
|
focusable: "false",
|
|
737
889
|
...o,
|
|
738
|
-
children: [r && /* @__PURE__ */ t("title", { children: r }), /* @__PURE__ */ t("path", { d:
|
|
739
|
-
}),
|
|
890
|
+
children: [r && /* @__PURE__ */ t("title", { children: r }), /* @__PURE__ */ t("path", { d: de[e] })]
|
|
891
|
+
}), G = {
|
|
740
892
|
root: "_root_1897l_1",
|
|
741
893
|
header: "_header_1897l_11",
|
|
742
894
|
title: "_title_1897l_21",
|
|
743
895
|
dismiss: "_dismiss_1897l_28",
|
|
744
896
|
content: "_content_1897l_57"
|
|
745
|
-
},
|
|
897
|
+
}, pe = ({ title: e, children: r, dismissible: i = !1, onDismiss: a, dismissLabel: o = "Закрыть информационный блок", headingAs: c = "h3", className: l = "" }) => {
|
|
746
898
|
let u = `ds-info-block-${s()}`;
|
|
747
899
|
return /* @__PURE__ */ n("section", {
|
|
748
|
-
className: `${
|
|
900
|
+
className: `${G.root} ${l}`,
|
|
749
901
|
"aria-labelledby": u,
|
|
750
902
|
children: [/* @__PURE__ */ n("header", {
|
|
751
|
-
className:
|
|
903
|
+
className: G.header,
|
|
752
904
|
children: [/* @__PURE__ */ t(c, {
|
|
753
905
|
id: u,
|
|
754
|
-
className:
|
|
906
|
+
className: G.title,
|
|
755
907
|
children: e
|
|
756
908
|
}), i && /* @__PURE__ */ t("button", {
|
|
757
909
|
type: "button",
|
|
758
|
-
className:
|
|
910
|
+
className: G.dismiss,
|
|
759
911
|
onClick: a,
|
|
760
912
|
"aria-label": o,
|
|
761
913
|
children: /* @__PURE__ */ t("svg", {
|
|
@@ -771,90 +923,98 @@ var w = {
|
|
|
771
923
|
})
|
|
772
924
|
})]
|
|
773
925
|
}), /* @__PURE__ */ t("div", {
|
|
774
|
-
className:
|
|
926
|
+
className: G.content,
|
|
775
927
|
children: r
|
|
776
928
|
})]
|
|
777
929
|
});
|
|
778
|
-
},
|
|
930
|
+
}, K = {
|
|
779
931
|
wrapper: "_wrapper_1bpdz_1",
|
|
780
932
|
control: "_control_1bpdz_3",
|
|
781
933
|
input: "_input_1bpdz_5",
|
|
782
934
|
disabledText: "_disabledText_1bpdz_5",
|
|
783
935
|
inputError: "_inputError_1bpdz_11",
|
|
784
936
|
clear: "_clear_1bpdz_13"
|
|
785
|
-
},
|
|
786
|
-
let
|
|
937
|
+
}, me = ({ value: e, onChange: r, type: i = "text", placeholder: a = "", disabled: o = !1, readOnly: c = !1, stringWhileDisabled: u = !1, label: d, error: f, hint: p, className: m = "", name: h, id: g, clearable: _ = !0, required: v = !1, selectTextOnFocus: y = !1, onFocus: b, ...x }) => {
|
|
938
|
+
let S = s(), C = g ?? `ds-input-${h ?? S}`, w = l(null), D = p ? `${C}-hint` : void 0, O = f ? `${C}-error` : void 0, k = String(e ?? ""), A = [D, O].filter(Boolean).join(" ") || void 0;
|
|
787
939
|
return /* @__PURE__ */ n("div", {
|
|
788
|
-
className: `${
|
|
940
|
+
className: `${K.wrapper} ${m}`,
|
|
789
941
|
children: [
|
|
790
942
|
d && /* @__PURE__ */ t(T, {
|
|
791
|
-
htmlFor:
|
|
943
|
+
htmlFor: C,
|
|
792
944
|
required: v,
|
|
793
945
|
disabled: o,
|
|
794
946
|
children: d
|
|
795
947
|
}),
|
|
796
948
|
o && u ? /* @__PURE__ */ t("div", {
|
|
797
|
-
id:
|
|
798
|
-
className:
|
|
799
|
-
"aria-describedby":
|
|
800
|
-
children:
|
|
949
|
+
id: C,
|
|
950
|
+
className: K.disabledText,
|
|
951
|
+
"aria-describedby": A,
|
|
952
|
+
children: k || a
|
|
801
953
|
}) : /* @__PURE__ */ n("div", {
|
|
802
|
-
className:
|
|
954
|
+
className: K.control,
|
|
803
955
|
children: [/* @__PURE__ */ t("input", {
|
|
804
|
-
ref:
|
|
805
|
-
id:
|
|
956
|
+
ref: w,
|
|
957
|
+
id: C,
|
|
806
958
|
name: h,
|
|
807
959
|
type: i,
|
|
808
|
-
value:
|
|
960
|
+
value: k,
|
|
809
961
|
placeholder: a,
|
|
810
962
|
disabled: o,
|
|
811
963
|
readOnly: c,
|
|
812
964
|
required: v,
|
|
813
965
|
"aria-invalid": !!f,
|
|
814
|
-
"aria-describedby":
|
|
815
|
-
className: `${
|
|
966
|
+
"aria-describedby": A,
|
|
967
|
+
className: `${K.input} ${f ? K.inputError : ""}`,
|
|
816
968
|
onChange: (e) => {
|
|
817
|
-
i === "number"
|
|
969
|
+
if (i === "number") {
|
|
970
|
+
let t = e.target.value === "" ? "" : Number(e.target.value);
|
|
971
|
+
r?.(t, e);
|
|
972
|
+
return;
|
|
973
|
+
}
|
|
974
|
+
r?.(e.target.value, e);
|
|
975
|
+
},
|
|
976
|
+
onFocus: (e) => {
|
|
977
|
+
y && e.currentTarget.value && e.currentTarget.select(), b?.(e);
|
|
818
978
|
},
|
|
819
|
-
...
|
|
820
|
-
}), _ &&
|
|
979
|
+
...x
|
|
980
|
+
}), _ && k && !o && !c && /* @__PURE__ */ t("button", {
|
|
821
981
|
type: "button",
|
|
822
|
-
className:
|
|
982
|
+
className: K.clear,
|
|
823
983
|
"aria-label": "Очистить поле",
|
|
824
984
|
onClick: () => {
|
|
825
|
-
let e =
|
|
985
|
+
let e = w.current;
|
|
826
986
|
e && ((Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set)?.call(e, ""), e.dispatchEvent(new Event("input", { bubbles: !0 })), e.focus());
|
|
827
987
|
},
|
|
828
988
|
children: "×"
|
|
829
989
|
})]
|
|
830
990
|
}),
|
|
831
991
|
p && !f && /* @__PURE__ */ t(E, {
|
|
832
|
-
id:
|
|
992
|
+
id: D,
|
|
833
993
|
children: p
|
|
834
994
|
}),
|
|
835
995
|
f && /* @__PURE__ */ t(E, {
|
|
836
|
-
id:
|
|
996
|
+
id: O,
|
|
837
997
|
variant: "error",
|
|
838
998
|
children: f
|
|
839
999
|
})
|
|
840
1000
|
]
|
|
841
1001
|
});
|
|
842
|
-
},
|
|
1002
|
+
}, q = {
|
|
843
1003
|
wrapper: "_wrapper_8srjz_1",
|
|
844
1004
|
input: "_input_8srjz_11",
|
|
845
1005
|
switch: "_switch_8srjz_18",
|
|
846
1006
|
thumb: "_thumb_8srjz_34",
|
|
847
1007
|
label: "_label_8srjz_56",
|
|
848
1008
|
disabled: "_disabled_8srjz_62"
|
|
849
|
-
},
|
|
1009
|
+
}, he = ({ checked: e, onChange: r, label: i, disabled: a = !1, readOnly: o = !1, className: c = "", name: l, id: u, value: d }) => {
|
|
850
1010
|
let f = s(), p = u ?? `ds-radio-button-${l ?? f}`;
|
|
851
1011
|
return /* @__PURE__ */ n("label", {
|
|
852
1012
|
htmlFor: p,
|
|
853
|
-
className: `${
|
|
1013
|
+
className: `${q.wrapper} ${a ? q.disabled : ""} ${c}`,
|
|
854
1014
|
children: [
|
|
855
1015
|
/* @__PURE__ */ t("input", {
|
|
856
1016
|
id: p,
|
|
857
|
-
className:
|
|
1017
|
+
className: q.input,
|
|
858
1018
|
type: "checkbox",
|
|
859
1019
|
role: "switch",
|
|
860
1020
|
name: l,
|
|
@@ -867,21 +1027,21 @@ var w = {
|
|
|
867
1027
|
}
|
|
868
1028
|
}),
|
|
869
1029
|
/* @__PURE__ */ t("span", {
|
|
870
|
-
className:
|
|
1030
|
+
className: q.switch,
|
|
871
1031
|
"aria-hidden": "true",
|
|
872
|
-
children: /* @__PURE__ */ t("span", { className:
|
|
1032
|
+
children: /* @__PURE__ */ t("span", { className: q.thumb })
|
|
873
1033
|
}),
|
|
874
1034
|
i && /* @__PURE__ */ t("span", {
|
|
875
|
-
className:
|
|
1035
|
+
className: q.label,
|
|
876
1036
|
children: i
|
|
877
1037
|
})
|
|
878
1038
|
]
|
|
879
1039
|
});
|
|
880
|
-
},
|
|
1040
|
+
}, ge = {
|
|
881
1041
|
root: "_root_kepgo_1",
|
|
882
1042
|
grid: "_grid_kepgo_3",
|
|
883
1043
|
actions: "_actions_kepgo_5"
|
|
884
|
-
},
|
|
1044
|
+
}, _e = ({ filters: e, values: r, onChange: i, onApply: a, onReset: o, applyMode: s = "instant", loading: c = !1, disabled: l = !1, className: u = "" }) => {
|
|
885
1045
|
let d = (e, t) => {
|
|
886
1046
|
let n = {
|
|
887
1047
|
...r,
|
|
@@ -890,23 +1050,34 @@ var w = {
|
|
|
890
1050
|
i?.(n, e), s === "instant" && a?.(n);
|
|
891
1051
|
};
|
|
892
1052
|
return /* @__PURE__ */ n("section", {
|
|
893
|
-
className: `${
|
|
1053
|
+
className: `${ge.root} ${u}`,
|
|
894
1054
|
"aria-label": "Фильтры",
|
|
895
1055
|
"aria-busy": c,
|
|
896
1056
|
children: [/* @__PURE__ */ t("div", {
|
|
897
|
-
className:
|
|
1057
|
+
className: ge.grid,
|
|
898
1058
|
children: e.filter((e) => !e.hidden).map((e) => {
|
|
899
1059
|
let n = l || c || e.disabled, i = r[e.id];
|
|
900
|
-
if (e.type === "input")
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
1060
|
+
if (e.type === "input") {
|
|
1061
|
+
let r = {
|
|
1062
|
+
key: e.id,
|
|
1063
|
+
label: e.label,
|
|
1064
|
+
hint: e.hint,
|
|
1065
|
+
placeholder: e.placeholder,
|
|
1066
|
+
disabled: n
|
|
1067
|
+
};
|
|
1068
|
+
return e.inputType === "number" ? /* @__PURE__ */ t(me, {
|
|
1069
|
+
...r,
|
|
1070
|
+
type: "number",
|
|
1071
|
+
value: i ?? "",
|
|
1072
|
+
onChange: (t) => d(e.id, t)
|
|
1073
|
+
}) : /* @__PURE__ */ t(me, {
|
|
1074
|
+
...r,
|
|
1075
|
+
type: "text",
|
|
1076
|
+
value: String(i ?? ""),
|
|
1077
|
+
onChange: (t) => d(e.id, t)
|
|
1078
|
+
});
|
|
1079
|
+
}
|
|
1080
|
+
if (e.type === "dropdown") return /* @__PURE__ */ t(U, {
|
|
910
1081
|
label: e.label,
|
|
911
1082
|
hint: e.hint,
|
|
912
1083
|
placeholder: e.placeholder,
|
|
@@ -915,7 +1086,7 @@ var w = {
|
|
|
915
1086
|
disabled: n,
|
|
916
1087
|
onChange: (t) => d(e.id, t)
|
|
917
1088
|
}, e.id);
|
|
918
|
-
if (e.type === "multiple") return /* @__PURE__ */ t(
|
|
1089
|
+
if (e.type === "multiple") return /* @__PURE__ */ t(ue, {
|
|
919
1090
|
label: e.label,
|
|
920
1091
|
hint: e.hint,
|
|
921
1092
|
placeholder: e.placeholder,
|
|
@@ -931,7 +1102,7 @@ var w = {
|
|
|
931
1102
|
disabled: n,
|
|
932
1103
|
onChange: (t) => d(e.id, t)
|
|
933
1104
|
}, e.id);
|
|
934
|
-
if (e.type === "radio") return /* @__PURE__ */ t(
|
|
1105
|
+
if (e.type === "radio") return /* @__PURE__ */ t(he, {
|
|
935
1106
|
label: e.label,
|
|
936
1107
|
checked: !!i,
|
|
937
1108
|
disabled: n,
|
|
@@ -941,7 +1112,7 @@ var w = {
|
|
|
941
1112
|
from: null,
|
|
942
1113
|
to: null
|
|
943
1114
|
};
|
|
944
|
-
return /* @__PURE__ */ t(
|
|
1115
|
+
return /* @__PURE__ */ t(R, {
|
|
945
1116
|
hint: e.hint,
|
|
946
1117
|
mode: e.mode,
|
|
947
1118
|
min: e.min,
|
|
@@ -952,7 +1123,7 @@ var w = {
|
|
|
952
1123
|
}, e.id);
|
|
953
1124
|
})
|
|
954
1125
|
}), (o || s === "manual") && /* @__PURE__ */ n("div", {
|
|
955
|
-
className:
|
|
1126
|
+
className: ge.actions,
|
|
956
1127
|
children: [o && /* @__PURE__ */ t(C, {
|
|
957
1128
|
variant: "destructiveOutline",
|
|
958
1129
|
disabled: l || c,
|
|
@@ -966,11 +1137,11 @@ var w = {
|
|
|
966
1137
|
})]
|
|
967
1138
|
})]
|
|
968
1139
|
});
|
|
969
|
-
},
|
|
1140
|
+
}, ve = 0, J = _((e) => ({
|
|
970
1141
|
modals: [],
|
|
971
1142
|
openModal: (t, n = {}, r = {}) => {
|
|
972
|
-
|
|
973
|
-
let i = `ds-modal-${
|
|
1143
|
+
ve += 1;
|
|
1144
|
+
let i = `ds-modal-${ve}`;
|
|
974
1145
|
return e((e) => ({ modals: [...e.modals, {
|
|
975
1146
|
id: i,
|
|
976
1147
|
name: t,
|
|
@@ -982,7 +1153,7 @@ var w = {
|
|
|
982
1153
|
closeModal: (t) => e((e) => ({ modals: e.modals.filter((e) => e.id !== t) })),
|
|
983
1154
|
closeTopModal: () => e((e) => ({ modals: e.modals.slice(0, -1) })),
|
|
984
1155
|
closeAllModals: () => e({ modals: [] })
|
|
985
|
-
})),
|
|
1156
|
+
})), ye = () => J.setState({ modals: [] }), Y = {
|
|
986
1157
|
layer: "_layer_bl99k_1",
|
|
987
1158
|
backdrop: "_backdrop_bl99k_2",
|
|
988
1159
|
panel: "_panel_bl99k_3",
|
|
@@ -990,14 +1161,14 @@ var w = {
|
|
|
990
1161
|
title: "_title_bl99k_6",
|
|
991
1162
|
description: "_description_bl99k_7",
|
|
992
1163
|
content: "_content_bl99k_8"
|
|
993
|
-
},
|
|
994
|
-
let f = s(), p = s(), m = l(null), h =
|
|
1164
|
+
}, be = "button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"])", xe = ({ children: e, title: r, description: i, modalId: a, closeLabel: c = "Закрыть модальное окно", className: u = "", role: d = "dialog" }) => {
|
|
1165
|
+
let f = s(), p = s(), m = l(null), h = J((e) => e.closeModal);
|
|
995
1166
|
return o(() => {
|
|
996
1167
|
let e = document.activeElement, t = m.current;
|
|
997
|
-
return (t?.querySelector(
|
|
1168
|
+
return (t?.querySelector(be) ?? t)?.focus(), () => e?.focus();
|
|
998
1169
|
}, []), /* @__PURE__ */ n("div", {
|
|
999
1170
|
ref: m,
|
|
1000
|
-
className: `${
|
|
1171
|
+
className: `${Y.panel} ${u}`,
|
|
1001
1172
|
role: d,
|
|
1002
1173
|
"aria-modal": "true",
|
|
1003
1174
|
"aria-labelledby": r ? f : void 0,
|
|
@@ -1005,7 +1176,7 @@ var w = {
|
|
|
1005
1176
|
tabIndex: -1,
|
|
1006
1177
|
onKeyDown: (e) => {
|
|
1007
1178
|
if (e.key !== "Tab") return;
|
|
1008
|
-
let t = Array.from(m.current?.querySelectorAll(
|
|
1179
|
+
let t = Array.from(m.current?.querySelectorAll(be) ?? []);
|
|
1009
1180
|
if (!t.length) {
|
|
1010
1181
|
e.preventDefault();
|
|
1011
1182
|
return;
|
|
@@ -1015,13 +1186,13 @@ var w = {
|
|
|
1015
1186
|
},
|
|
1016
1187
|
children: [
|
|
1017
1188
|
(r || c) && /* @__PURE__ */ n("header", {
|
|
1018
|
-
className:
|
|
1189
|
+
className: Y.header,
|
|
1019
1190
|
children: [r && /* @__PURE__ */ t("h2", {
|
|
1020
1191
|
id: f,
|
|
1021
|
-
className:
|
|
1192
|
+
className: Y.title,
|
|
1022
1193
|
children: r
|
|
1023
1194
|
}), /* @__PURE__ */ t(C, {
|
|
1024
|
-
variant: "
|
|
1195
|
+
variant: "empty",
|
|
1025
1196
|
size: "sm",
|
|
1026
1197
|
"aria-label": c,
|
|
1027
1198
|
onClick: () => h(a),
|
|
@@ -1030,31 +1201,31 @@ var w = {
|
|
|
1030
1201
|
}),
|
|
1031
1202
|
i && /* @__PURE__ */ t("p", {
|
|
1032
1203
|
id: p,
|
|
1033
|
-
className:
|
|
1204
|
+
className: Y.description,
|
|
1034
1205
|
children: i
|
|
1035
1206
|
}),
|
|
1036
1207
|
/* @__PURE__ */ t("div", {
|
|
1037
|
-
className:
|
|
1208
|
+
className: Y.content,
|
|
1038
1209
|
children: e
|
|
1039
1210
|
})
|
|
1040
1211
|
]
|
|
1041
1212
|
});
|
|
1042
|
-
},
|
|
1043
|
-
let n =
|
|
1213
|
+
}, Se = ({ registry: e }) => {
|
|
1214
|
+
let n = J((e) => e.modals), r = J((e) => e.closeModal), i = J((e) => e.closeAllModals);
|
|
1044
1215
|
return o(() => {
|
|
1045
1216
|
let e = (e) => {
|
|
1046
1217
|
if (e.key !== "Escape") return;
|
|
1047
|
-
let t =
|
|
1218
|
+
let t = J.getState().modals.at(-1);
|
|
1048
1219
|
t?.closeOnEscape && r(t.id);
|
|
1049
1220
|
};
|
|
1050
1221
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
1051
1222
|
}, [r]), !n.length || typeof document > "u" ? null : g(/* @__PURE__ */ t("div", {
|
|
1052
|
-
className:
|
|
1223
|
+
className: Y.layer,
|
|
1053
1224
|
"aria-label": "Модальные окна",
|
|
1054
1225
|
children: n.map((a, o) => {
|
|
1055
1226
|
let s = e[a.name];
|
|
1056
1227
|
return s ? /* @__PURE__ */ t("div", {
|
|
1057
|
-
className:
|
|
1228
|
+
className: Y.backdrop,
|
|
1058
1229
|
"aria-hidden": o !== n.length - 1 || void 0,
|
|
1059
1230
|
onMouseDown: (e) => {
|
|
1060
1231
|
e.target === e.currentTarget && a.closeOnBackdrop && r(a.id);
|
|
@@ -1068,23 +1239,23 @@ var w = {
|
|
|
1068
1239
|
}, a.id) : null;
|
|
1069
1240
|
})
|
|
1070
1241
|
}), document.body);
|
|
1071
|
-
},
|
|
1072
|
-
let s =
|
|
1242
|
+
}, Ce = ({ registry: r, children: i, lockBodyScroll: a = !0 }) => {
|
|
1243
|
+
let s = J((e) => e.modals.length);
|
|
1073
1244
|
return o(() => {
|
|
1074
1245
|
if (!a || s === 0) return;
|
|
1075
1246
|
let e = document.body.style.overflow;
|
|
1076
1247
|
return document.body.style.overflow = "hidden", () => {
|
|
1077
1248
|
document.body.style.overflow = e;
|
|
1078
1249
|
};
|
|
1079
|
-
}, [a, s]), /* @__PURE__ */ n(e, { children: [i, /* @__PURE__ */ t(
|
|
1080
|
-
},
|
|
1250
|
+
}, [a, s]), /* @__PURE__ */ n(e, { children: [i, /* @__PURE__ */ t(Se, { registry: r })] });
|
|
1251
|
+
}, we = (e) => e, X = {
|
|
1081
1252
|
message: "_message_187g8_1",
|
|
1082
1253
|
actions: "_actions_187g8_2"
|
|
1083
|
-
},
|
|
1254
|
+
}, Te = /* @__PURE__ */ new Map(), Ee = 0, De = ({ modalId: e, close: r, title: i = "Подтверждение", message: a = "Продолжить действие?", confirmLabel: o = "Подтвердить", cancelLabel: s = "Отмена", tone: c = "default", requestId: l }) => {
|
|
1084
1255
|
let u = (e) => {
|
|
1085
|
-
|
|
1256
|
+
Te.get(l)?.(e), Te.delete(l), r();
|
|
1086
1257
|
};
|
|
1087
|
-
return /* @__PURE__ */ n(
|
|
1258
|
+
return /* @__PURE__ */ n(xe, {
|
|
1088
1259
|
modalId: e,
|
|
1089
1260
|
title: i,
|
|
1090
1261
|
role: "alertdialog",
|
|
@@ -1104,7 +1275,7 @@ var w = {
|
|
|
1104
1275
|
})]
|
|
1105
1276
|
})]
|
|
1106
1277
|
});
|
|
1107
|
-
},
|
|
1278
|
+
}, Oe = ({ modalId: e, close: r, title: i = "Ошибка", message: a, closeLabel: o = "Закрыть" }) => /* @__PURE__ */ n(xe, {
|
|
1108
1279
|
modalId: e,
|
|
1109
1280
|
title: i,
|
|
1110
1281
|
role: "alertdialog",
|
|
@@ -1118,45 +1289,45 @@ var w = {
|
|
|
1118
1289
|
children: o
|
|
1119
1290
|
})
|
|
1120
1291
|
})]
|
|
1121
|
-
}),
|
|
1122
|
-
ConfirmModal:
|
|
1123
|
-
ErrorModal:
|
|
1124
|
-
}),
|
|
1125
|
-
let e =
|
|
1292
|
+
}), ke = we({
|
|
1293
|
+
ConfirmModal: De,
|
|
1294
|
+
ErrorModal: Oe
|
|
1295
|
+
}), Ae = () => {
|
|
1296
|
+
let e = J((e) => e.openModal);
|
|
1126
1297
|
return (t = {}) => new Promise((n) => {
|
|
1127
|
-
|
|
1128
|
-
let r = `confirm-${
|
|
1129
|
-
|
|
1298
|
+
Ee += 1;
|
|
1299
|
+
let r = `confirm-${Ee}`;
|
|
1300
|
+
Te.set(r, n), e("ConfirmModal", {
|
|
1130
1301
|
...t,
|
|
1131
1302
|
requestId: r
|
|
1132
1303
|
}, { closeOnEscape: !1 });
|
|
1133
1304
|
});
|
|
1134
|
-
},
|
|
1135
|
-
let e =
|
|
1305
|
+
}, je = (e) => e instanceof Error ? e.message : typeof e == "string" ? e : e && typeof e == "object" && "message" in e && typeof e.message == "string" ? e.message : "Произошла неизвестная ошибка", Me = () => {
|
|
1306
|
+
let e = J((e) => e.openModal);
|
|
1136
1307
|
return { showError: (t, n) => e("ErrorModal", {
|
|
1137
1308
|
title: n,
|
|
1138
|
-
message:
|
|
1309
|
+
message: je(t)
|
|
1139
1310
|
}) };
|
|
1140
|
-
},
|
|
1141
|
-
let e =
|
|
1311
|
+
}, Ne = _(() => ({})), Pe = _(() => ({})), Fe = () => {
|
|
1312
|
+
let e = J((e) => e.modals), t = J((e) => e.openModal);
|
|
1142
1313
|
return {
|
|
1143
1314
|
openModal: (e, n = {}, r) => t(e, n, r),
|
|
1144
|
-
closeModal:
|
|
1145
|
-
closeTopModal:
|
|
1146
|
-
closeAllModals:
|
|
1315
|
+
closeModal: J((e) => e.closeModal),
|
|
1316
|
+
closeTopModal: J((e) => e.closeTopModal),
|
|
1317
|
+
closeAllModals: J((e) => e.closeAllModals),
|
|
1147
1318
|
isOpen: (t) => e.some((e) => e.name === t),
|
|
1148
1319
|
count: e.length
|
|
1149
1320
|
};
|
|
1150
|
-
},
|
|
1151
|
-
className: `${
|
|
1321
|
+
}, Ie = { root: "_root_1j70j_1" }, Le = ({ label: e = "Загрузка страницы", className: r = "" }) => /* @__PURE__ */ n("div", {
|
|
1322
|
+
className: `${Ie.root} ${r}`,
|
|
1152
1323
|
role: "status",
|
|
1153
1324
|
"aria-label": e,
|
|
1154
1325
|
children: [/* @__PURE__ */ t(x, { decorative: !0 }), /* @__PURE__ */ t("span", { children: e })]
|
|
1155
|
-
}),
|
|
1326
|
+
}), Re = {
|
|
1156
1327
|
root: "_root_ig8lp_1",
|
|
1157
1328
|
legend: "_legend_ig8lp_2",
|
|
1158
1329
|
range: "_range_ig8lp_3"
|
|
1159
|
-
},
|
|
1330
|
+
}, ze = [
|
|
1160
1331
|
{
|
|
1161
1332
|
value: "1",
|
|
1162
1333
|
label: "День"
|
|
@@ -1169,19 +1340,19 @@ var w = {
|
|
|
1169
1340
|
value: "3",
|
|
1170
1341
|
label: "Месяц"
|
|
1171
1342
|
}
|
|
1172
|
-
],
|
|
1343
|
+
], Be = {
|
|
1173
1344
|
day: 1,
|
|
1174
1345
|
week: 2,
|
|
1175
1346
|
month: 3
|
|
1176
|
-
},
|
|
1177
|
-
className: `${
|
|
1347
|
+
}, Ve = ({ value: e, onChange: r, label: i, hint: a, error: o, disabled: s = !1, min: c, max: l, className: u = "", periodTypeOptions: d = ze }) => /* @__PURE__ */ n("fieldset", {
|
|
1348
|
+
className: `${Re.root} ${u}`,
|
|
1178
1349
|
disabled: s,
|
|
1179
1350
|
children: [
|
|
1180
1351
|
i && /* @__PURE__ */ t("legend", {
|
|
1181
|
-
className:
|
|
1352
|
+
className: Re.legend,
|
|
1182
1353
|
children: i
|
|
1183
1354
|
}),
|
|
1184
|
-
/* @__PURE__ */ t(
|
|
1355
|
+
/* @__PURE__ */ t(U, {
|
|
1185
1356
|
options: d,
|
|
1186
1357
|
value: String(e.periodType),
|
|
1187
1358
|
disabled: s,
|
|
@@ -1192,8 +1363,8 @@ var w = {
|
|
|
1192
1363
|
label: "Тип периода"
|
|
1193
1364
|
}),
|
|
1194
1365
|
/* @__PURE__ */ n("div", {
|
|
1195
|
-
className:
|
|
1196
|
-
children: [/* @__PURE__ */ t(
|
|
1366
|
+
className: Re.range,
|
|
1367
|
+
children: [/* @__PURE__ */ t(F, {
|
|
1197
1368
|
value: e.startDate,
|
|
1198
1369
|
onChange: (t) => r?.({
|
|
1199
1370
|
...e,
|
|
@@ -1203,7 +1374,7 @@ var w = {
|
|
|
1203
1374
|
min: c,
|
|
1204
1375
|
max: l,
|
|
1205
1376
|
disabled: s
|
|
1206
|
-
}), /* @__PURE__ */ t(
|
|
1377
|
+
}), /* @__PURE__ */ t(F, {
|
|
1207
1378
|
value: e.endDate,
|
|
1208
1379
|
onChange: (t) => r?.({
|
|
1209
1380
|
...e,
|
|
@@ -1234,7 +1405,7 @@ var w = {
|
|
|
1234
1405
|
success: "_success_v7rog_10",
|
|
1235
1406
|
warning: "_warning_v7rog_11",
|
|
1236
1407
|
error: "_error_v7rog_12"
|
|
1237
|
-
},
|
|
1408
|
+
}, He = ({ toast: e, onClose: r }) => {
|
|
1238
1409
|
let [i, a] = u(!1), s = l(e.duration), c = l(Date.now());
|
|
1239
1410
|
return o(() => {
|
|
1240
1411
|
if (i || e.duration <= 0) return;
|
|
@@ -1257,7 +1428,7 @@ var w = {
|
|
|
1257
1428
|
onFocus: () => a(!0),
|
|
1258
1429
|
onBlur: () => a(!1),
|
|
1259
1430
|
children: [
|
|
1260
|
-
/* @__PURE__ */ t(
|
|
1431
|
+
/* @__PURE__ */ t(fe, {
|
|
1261
1432
|
name: e.variant === "warning" ? "warning" : "info",
|
|
1262
1433
|
className: Z.icon
|
|
1263
1434
|
}),
|
|
@@ -1267,7 +1438,7 @@ var w = {
|
|
|
1267
1438
|
e.title && /* @__PURE__ */ t("strong", { children: e.title }),
|
|
1268
1439
|
/* @__PURE__ */ t("div", { children: e.message }),
|
|
1269
1440
|
e.action && /* @__PURE__ */ t(C, {
|
|
1270
|
-
variant: "
|
|
1441
|
+
variant: "empty",
|
|
1271
1442
|
size: "sm",
|
|
1272
1443
|
onClick: () => {
|
|
1273
1444
|
e.action?.onClick(), (e.action?.dismissOnClick ?? !0) && r(e.id);
|
|
@@ -1277,7 +1448,7 @@ var w = {
|
|
|
1277
1448
|
]
|
|
1278
1449
|
}),
|
|
1279
1450
|
e.closable && /* @__PURE__ */ t(C, {
|
|
1280
|
-
variant: "
|
|
1451
|
+
variant: "empty",
|
|
1281
1452
|
size: "sm",
|
|
1282
1453
|
"aria-label": "Закрыть уведомление",
|
|
1283
1454
|
onClick: () => r(e.id),
|
|
@@ -1285,11 +1456,11 @@ var w = {
|
|
|
1285
1456
|
})
|
|
1286
1457
|
]
|
|
1287
1458
|
});
|
|
1288
|
-
},
|
|
1459
|
+
}, Ue = 0, Q = _((e) => ({
|
|
1289
1460
|
toasts: [],
|
|
1290
1461
|
showToast: (t) => {
|
|
1291
|
-
|
|
1292
|
-
let n = `ds-toast-${
|
|
1462
|
+
Ue += 1;
|
|
1463
|
+
let n = `ds-toast-${Ue}`;
|
|
1293
1464
|
return e((e) => ({ toasts: [...e.toasts, {
|
|
1294
1465
|
variant: "info",
|
|
1295
1466
|
duration: 5e3,
|
|
@@ -1300,17 +1471,17 @@ var w = {
|
|
|
1300
1471
|
},
|
|
1301
1472
|
removeToast: (t) => e((e) => ({ toasts: e.toasts.filter((e) => e.id !== t) })),
|
|
1302
1473
|
clearToasts: () => e({ toasts: [] })
|
|
1303
|
-
})),
|
|
1474
|
+
})), We = () => Q.setState({ toasts: [] }), Ge = ({ position: e = "top-right" }) => {
|
|
1304
1475
|
let n = Q((e) => e.toasts), r = Q((e) => e.removeToast);
|
|
1305
1476
|
return /* @__PURE__ */ t("div", {
|
|
1306
1477
|
className: `${Z.viewport} ${Z[e]}`,
|
|
1307
1478
|
"aria-label": "Уведомления",
|
|
1308
|
-
children: n.map((e) => /* @__PURE__ */ t(
|
|
1479
|
+
children: n.map((e) => /* @__PURE__ */ t(He, {
|
|
1309
1480
|
toast: e,
|
|
1310
1481
|
onClose: r
|
|
1311
1482
|
}, e.id))
|
|
1312
1483
|
});
|
|
1313
|
-
},
|
|
1484
|
+
}, Ke = () => {
|
|
1314
1485
|
let e = Q((e) => e.showToast), t = Q((e) => e.removeToast), n = Q((e) => e.clearToasts), r = (t) => (n) => e({
|
|
1315
1486
|
...n,
|
|
1316
1487
|
variant: t
|
|
@@ -1324,7 +1495,7 @@ var w = {
|
|
|
1324
1495
|
removeToast: t,
|
|
1325
1496
|
clearToasts: n
|
|
1326
1497
|
};
|
|
1327
|
-
},
|
|
1498
|
+
}, qe = {
|
|
1328
1499
|
root: "_root_2bxal_1",
|
|
1329
1500
|
tooltip: "_tooltip_2bxal_2",
|
|
1330
1501
|
"ds-tooltip-in": "_ds-tooltip-in_2bxal_1",
|
|
@@ -1332,7 +1503,7 @@ var w = {
|
|
|
1332
1503
|
bottom: "_bottom_2bxal_4",
|
|
1333
1504
|
left: "_left_2bxal_5",
|
|
1334
1505
|
right: "_right_2bxal_6"
|
|
1335
|
-
},
|
|
1506
|
+
}, Je = ({ content: e, children: i, placement: c = "top", delay: d = 450, disabled: f = !1, maxWidth: p = 280, className: m = "" }) => {
|
|
1336
1507
|
let h = s(), [g, _] = u(!1), v = l(null), y = () => {
|
|
1337
1508
|
f || !e || (v.current = setTimeout(() => _(!0), d));
|
|
1338
1509
|
}, b = () => {
|
|
@@ -1354,12 +1525,12 @@ var w = {
|
|
|
1354
1525
|
onBlur: b
|
|
1355
1526
|
});
|
|
1356
1527
|
return /* @__PURE__ */ n("span", {
|
|
1357
|
-
className: `${
|
|
1528
|
+
className: `${qe.root} ${m}`,
|
|
1358
1529
|
onPointerDown: g ? b : y,
|
|
1359
1530
|
children: [x, g && /* @__PURE__ */ t("span", {
|
|
1360
1531
|
id: h,
|
|
1361
1532
|
role: "tooltip",
|
|
1362
|
-
className: `${
|
|
1533
|
+
className: `${qe.tooltip} ${qe[c]}`,
|
|
1363
1534
|
style: { maxWidth: p },
|
|
1364
1535
|
children: e
|
|
1365
1536
|
})]
|
|
@@ -1371,7 +1542,7 @@ var w = {
|
|
|
1371
1542
|
overlay: "_overlay_tgni1_4",
|
|
1372
1543
|
error: "_error_tgni1_4",
|
|
1373
1544
|
caption: "_caption_tgni1_7"
|
|
1374
|
-
},
|
|
1545
|
+
}, Ye = ({ sources: e, tracks: r = [], title: i, aspectRatio: a = "16 / 9", objectFit: o = "contain", loading: s = !1, error: c, fallback: l, className: d = "", controls: f = !0, playsInline: p = !0, ...m }) => {
|
|
1375
1546
|
let [h, g] = u(!1), _ = c ?? (h ? "Не удалось воспроизвести видео" : void 0);
|
|
1376
1547
|
return /* @__PURE__ */ n("figure", {
|
|
1377
1548
|
className: `${$.root} ${d}`,
|
|
@@ -1408,4 +1579,4 @@ var w = {
|
|
|
1408
1579
|
});
|
|
1409
1580
|
};
|
|
1410
1581
|
//#endregion
|
|
1411
|
-
export {
|
|
1582
|
+
export { De as ConfirmModal, y as DSBadge, C as DSButton, O as DSCheckbox, le as DSDataTable, R as DSDateRange, F as DSDateTimePicker, U as DSDropDown, ue as DSDropDownMultiple, T as DSFieldLabel, E as DSFieldMessage, _e as DSFilters, fe as DSIcon, pe as DSInfoBlock, me as DSInput, x as DSLoader, Se as DSModal, xe as DSModalFrame, Le as DSPageLoader, he as DSRadioButton, B as DSSkeleton, oe as DSSort, Ve as DSTimePeriodPicker, He as DSToast, Ge as DSToastProvider, Je as DSTooltip, Ye as DSVideoPlayerFrame, Be as DS_PERIOD_TYPE_CODES, Oe as ErrorModal, Ce as ModalSystemProvider, ke as builtInModalRegistry, we as defineModalRegistry, P as formatDateTimeLocalValue, je as getErrorMessage, H as getNextEnabledOptionIndex, L as isValidDateRange, ee as parseDateTimeLocalValue, ye as resetModalStore, We as resetToastStore, Ae as useConfirmModal, Ne as useConfirmModalStore, Me as useErrorModal, Pe as useErrorModalStore, Fe as useModals, J as useModalsStore, Ke as useToast, Q as useToastStore, ce as validateDSDataTableData };
|