@efficiency-point/design-system 0.1.5 → 0.1.7
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/README.md +3 -3
- package/dist/components/DSAccordion/DSAccordion.d.ts.map +1 -1
- package/dist/components/DSCheckbox/DSCheckbox.d.ts.map +1 -1
- package/dist/components/DSDataTable/DSDataTable.d.ts.map +1 -1
- package/dist/components/DSDateTimePicker/DSDateTimePicker.d.ts.map +1 -1
- package/dist/components/DSDropDown/DSDropDown.d.ts.map +1 -1
- package/dist/components/DSDropDownMultiple/DSDropDownMultiple.d.ts.map +1 -1
- package/dist/components/DSFileInput/DSFileInput.d.ts.map +1 -1
- package/dist/components/DSIcon/DSIcon.d.ts +4 -7
- package/dist/components/DSIcon/DSIcon.d.ts.map +1 -1
- package/dist/components/DSIcon/IconSvg.d.ts +4 -0
- package/dist/components/DSIcon/IconSvg.d.ts.map +1 -0
- package/dist/components/DSIcon/source/IconBasket.d.ts +4 -0
- package/dist/components/DSIcon/source/IconBasket.d.ts.map +1 -0
- package/dist/components/DSIcon/source/IconCaptions.d.ts +4 -0
- package/dist/components/DSIcon/source/IconCaptions.d.ts.map +1 -0
- package/dist/components/DSIcon/source/IconCheck.d.ts +4 -0
- package/dist/components/DSIcon/source/IconCheck.d.ts.map +1 -0
- package/dist/components/DSIcon/source/IconChevron.d.ts +4 -0
- package/dist/components/DSIcon/source/IconChevron.d.ts.map +1 -0
- package/dist/components/DSIcon/source/IconCross.d.ts +4 -0
- package/dist/components/DSIcon/source/IconCross.d.ts.map +1 -0
- package/dist/components/DSIcon/source/IconEdit.d.ts +4 -0
- package/dist/components/DSIcon/source/IconEdit.d.ts.map +1 -0
- package/dist/components/DSIcon/source/IconErrorCircle.d.ts +4 -0
- package/dist/components/DSIcon/source/IconErrorCircle.d.ts.map +1 -0
- package/dist/components/DSIcon/source/IconEye.d.ts +4 -0
- package/dist/components/DSIcon/source/IconEye.d.ts.map +1 -0
- package/dist/components/DSIcon/source/IconEyeOff.d.ts +4 -0
- package/dist/components/DSIcon/source/IconEyeOff.d.ts.map +1 -0
- package/dist/components/DSIcon/source/IconFullscreen.d.ts +4 -0
- package/dist/components/DSIcon/source/IconFullscreen.d.ts.map +1 -0
- package/dist/components/DSIcon/source/IconFullscreenExit.d.ts +4 -0
- package/dist/components/DSIcon/source/IconFullscreenExit.d.ts.map +1 -0
- package/dist/components/DSIcon/source/IconInfo.d.ts +4 -0
- package/dist/components/DSIcon/source/IconInfo.d.ts.map +1 -0
- package/dist/components/DSIcon/source/IconInfoCircle.d.ts +4 -0
- package/dist/components/DSIcon/source/IconInfoCircle.d.ts.map +1 -0
- package/dist/components/DSIcon/source/IconMinus.d.ts +4 -0
- package/dist/components/DSIcon/source/IconMinus.d.ts.map +1 -0
- package/dist/components/DSIcon/source/IconPause.d.ts +4 -0
- package/dist/components/DSIcon/source/IconPause.d.ts.map +1 -0
- package/dist/components/DSIcon/source/IconPictureInPicture.d.ts +4 -0
- package/dist/components/DSIcon/source/IconPictureInPicture.d.ts.map +1 -0
- package/dist/components/DSIcon/source/IconPlay.d.ts +4 -0
- package/dist/components/DSIcon/source/IconPlay.d.ts.map +1 -0
- package/dist/components/DSIcon/source/IconReplay.d.ts +4 -0
- package/dist/components/DSIcon/source/IconReplay.d.ts.map +1 -0
- package/dist/components/DSIcon/source/IconSettings.d.ts +4 -0
- package/dist/components/DSIcon/source/IconSettings.d.ts.map +1 -0
- package/dist/components/DSIcon/source/IconSort.d.ts +4 -0
- package/dist/components/DSIcon/source/IconSort.d.ts.map +1 -0
- package/dist/components/DSIcon/source/IconSortAscending.d.ts +4 -0
- package/dist/components/DSIcon/source/IconSortAscending.d.ts.map +1 -0
- package/dist/components/DSIcon/source/IconSortDescending.d.ts +4 -0
- package/dist/components/DSIcon/source/IconSortDescending.d.ts.map +1 -0
- package/dist/components/DSIcon/source/IconSuccessCircle.d.ts +4 -0
- package/dist/components/DSIcon/source/IconSuccessCircle.d.ts.map +1 -0
- package/dist/components/DSIcon/source/IconUpload.d.ts +4 -0
- package/dist/components/DSIcon/source/IconUpload.d.ts.map +1 -0
- package/dist/components/DSIcon/source/IconVolume.d.ts +4 -0
- package/dist/components/DSIcon/source/IconVolume.d.ts.map +1 -0
- package/dist/components/DSIcon/source/IconVolumeMuted.d.ts +4 -0
- package/dist/components/DSIcon/source/IconVolumeMuted.d.ts.map +1 -0
- package/dist/components/DSIcon/source/IconWarning.d.ts +4 -0
- package/dist/components/DSIcon/source/IconWarning.d.ts.map +1 -0
- package/dist/components/DSIcon/source/index.d.ts +31 -0
- package/dist/components/DSIcon/source/index.d.ts.map +1 -0
- package/dist/components/DSIcon/types.d.ts +13 -0
- package/dist/components/DSIcon/types.d.ts.map +1 -0
- package/dist/components/DSInfoBlock/DSInfoBlock.d.ts.map +1 -1
- package/dist/components/DSInput/DSInput.d.ts.map +1 -1
- package/dist/components/DSModal/DSModal.d.ts.map +1 -1
- package/dist/components/DSSearchDropDown/DSSearchDropDown.d.ts.map +1 -1
- package/dist/components/DSToast/DSToast.d.ts.map +1 -1
- package/dist/components/DSVideoPlayerFrame/DSVideoPlayerFrame.d.ts.map +1 -1
- package/dist/components/DSVideoPlayerFrame/DSVideoPlayerFrame.utils.d.ts +2 -0
- package/dist/components/DSVideoPlayerFrame/DSVideoPlayerFrame.utils.d.ts.map +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.es.js +1255 -927
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -33,17 +33,17 @@ var y = {
|
|
|
33
33
|
})
|
|
34
34
|
]
|
|
35
35
|
}), x = {
|
|
36
|
-
container: "
|
|
37
|
-
inner: "
|
|
38
|
-
line: "
|
|
39
|
-
primary: "
|
|
40
|
-
secondary: "
|
|
41
|
-
outline: "
|
|
42
|
-
ghost: "
|
|
43
|
-
empty: "
|
|
44
|
-
destructive: "
|
|
45
|
-
destructiveOutline: "
|
|
46
|
-
grow: "
|
|
36
|
+
container: "_container_1h2c4_1",
|
|
37
|
+
inner: "_inner_1h2c4_21",
|
|
38
|
+
line: "_line_1h2c4_39",
|
|
39
|
+
primary: "_primary_1h2c4_57",
|
|
40
|
+
secondary: "_secondary_1h2c4_65",
|
|
41
|
+
outline: "_outline_1h2c4_73",
|
|
42
|
+
ghost: "_ghost_1h2c4_81",
|
|
43
|
+
empty: "_empty_1h2c4_89",
|
|
44
|
+
destructive: "_destructive_1h2c4_97",
|
|
45
|
+
destructiveOutline: "_destructiveOutline_1h2c4_105",
|
|
46
|
+
grow: "_grow_1h2c4_1"
|
|
47
47
|
}, S = ({ variant: e = "primary" }) => /* @__PURE__ */ t("div", {
|
|
48
48
|
className: `${x.container} ${x[e]}`,
|
|
49
49
|
children: /* @__PURE__ */ n("div", {
|
|
@@ -86,7 +86,7 @@ var T = {
|
|
|
86
86
|
disabled: "_disabled_fa00b_47",
|
|
87
87
|
message: "_message_fa00b_55",
|
|
88
88
|
success: "_success_fa00b_71"
|
|
89
|
-
},
|
|
89
|
+
}, E = ({ children: e, required: r = !1, optionalText: i, disabled: a = !1, className: o = "", ...s }) => /* @__PURE__ */ n("label", {
|
|
90
90
|
className: `${T.label} ${a ? T.disabled : ""} ${o}`,
|
|
91
91
|
...s,
|
|
92
92
|
children: [
|
|
@@ -101,28 +101,184 @@ var T = {
|
|
|
101
101
|
children: i
|
|
102
102
|
})
|
|
103
103
|
]
|
|
104
|
-
}),
|
|
104
|
+
}), D = ({ children: e, variant: n = "hint", id: r, live: i = !1, className: a = "" }) => /* @__PURE__ */ t("span", {
|
|
105
105
|
id: r,
|
|
106
106
|
className: `${T.message} ${T[n]} ${a}`,
|
|
107
107
|
role: i && n === "error" ? "alert" : void 0,
|
|
108
108
|
"aria-live": i && n !== "error" ? "polite" : void 0,
|
|
109
109
|
children: e
|
|
110
|
-
}),
|
|
110
|
+
}), O = ({ width: e = 24, height: r = 24, color: i, title: a, style: o, children: s, ...c }) => /* @__PURE__ */ n("svg", {
|
|
111
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
112
|
+
viewBox: "0 0 24 24",
|
|
113
|
+
width: e,
|
|
114
|
+
height: r,
|
|
115
|
+
fill: "none",
|
|
116
|
+
stroke: "currentColor",
|
|
117
|
+
strokeWidth: "1.8",
|
|
118
|
+
strokeLinecap: "round",
|
|
119
|
+
strokeLinejoin: "round",
|
|
120
|
+
role: a ? "img" : void 0,
|
|
121
|
+
"aria-hidden": !a || void 0,
|
|
122
|
+
focusable: "false",
|
|
123
|
+
style: i ? {
|
|
124
|
+
...o,
|
|
125
|
+
color: i
|
|
126
|
+
} : o,
|
|
127
|
+
...c,
|
|
128
|
+
children: [a && /* @__PURE__ */ t("title", { children: a }), s]
|
|
129
|
+
}), k = {
|
|
130
|
+
IconBasket: (e) => /* @__PURE__ */ t(O, {
|
|
131
|
+
...e,
|
|
132
|
+
children: /* @__PURE__ */ t("path", { d: "M4 7h16l-1 13H5L4 7zm3 0V4h10v3" })
|
|
133
|
+
}),
|
|
134
|
+
IconCheck: (e) => /* @__PURE__ */ t(O, {
|
|
135
|
+
...e,
|
|
136
|
+
children: /* @__PURE__ */ t("path", { d: "m5 12 4 4L19 6" })
|
|
137
|
+
}),
|
|
138
|
+
IconChevron: (e) => /* @__PURE__ */ t(O, {
|
|
139
|
+
viewBox: "0 0 20 20",
|
|
140
|
+
...e,
|
|
141
|
+
children: /* @__PURE__ */ t("path", { d: "M5 7.5L10 12.5L15 7.5" })
|
|
142
|
+
}),
|
|
143
|
+
IconCross: ({ strokeWidth: e = 2, ...n }) => /* @__PURE__ */ t(O, {
|
|
144
|
+
strokeWidth: e,
|
|
145
|
+
...n,
|
|
146
|
+
children: /* @__PURE__ */ t("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
147
|
+
}),
|
|
148
|
+
IconEdit: (e) => /* @__PURE__ */ t(O, {
|
|
149
|
+
...e,
|
|
150
|
+
children: /* @__PURE__ */ t("path", { d: "M4 20h4L19 9l-4-4L4 16v4z" })
|
|
151
|
+
}),
|
|
152
|
+
IconErrorCircle: (e) => /* @__PURE__ */ n(O, {
|
|
153
|
+
...e,
|
|
154
|
+
children: [/* @__PURE__ */ t("circle", {
|
|
155
|
+
cx: "12",
|
|
156
|
+
cy: "12",
|
|
157
|
+
r: "10"
|
|
158
|
+
}), /* @__PURE__ */ t("path", { d: "m15 9-6 6M9 9l6 6" })]
|
|
159
|
+
}),
|
|
160
|
+
IconEye: (e) => /* @__PURE__ */ n(O, {
|
|
161
|
+
...e,
|
|
162
|
+
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", {
|
|
163
|
+
cx: "12",
|
|
164
|
+
cy: "12",
|
|
165
|
+
r: "2.5"
|
|
166
|
+
})]
|
|
167
|
+
}),
|
|
168
|
+
IconEyeOff: (e) => /* @__PURE__ */ t(O, {
|
|
169
|
+
...e,
|
|
170
|
+
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" })
|
|
171
|
+
}),
|
|
172
|
+
IconInfo: (e) => /* @__PURE__ */ t(O, {
|
|
173
|
+
...e,
|
|
174
|
+
children: /* @__PURE__ */ t("path", { d: "M12 10v7m0-10v.01" })
|
|
175
|
+
}),
|
|
176
|
+
IconInfoCircle: (e) => /* @__PURE__ */ n(O, {
|
|
177
|
+
...e,
|
|
178
|
+
children: [/* @__PURE__ */ t("circle", {
|
|
179
|
+
cx: "12",
|
|
180
|
+
cy: "12",
|
|
181
|
+
r: "10"
|
|
182
|
+
}), /* @__PURE__ */ t("path", { d: "M12 16v-4M12 8v.01" })]
|
|
183
|
+
}),
|
|
184
|
+
IconMinus: (e) => /* @__PURE__ */ t(O, {
|
|
185
|
+
...e,
|
|
186
|
+
children: /* @__PURE__ */ t("path", { d: "M5 12h14" })
|
|
187
|
+
}),
|
|
188
|
+
IconPause: (e) => /* @__PURE__ */ t(O, {
|
|
189
|
+
...e,
|
|
190
|
+
children: /* @__PURE__ */ t("path", {
|
|
191
|
+
d: "M8 5v14M16 5v14",
|
|
192
|
+
strokeWidth: "3"
|
|
193
|
+
})
|
|
194
|
+
}),
|
|
195
|
+
IconPictureInPicture: (e) => /* @__PURE__ */ t(O, {
|
|
196
|
+
...e,
|
|
197
|
+
children: /* @__PURE__ */ t("path", { d: "M3 5h18v14H3V5Zm10 7h6v5h-6v-5Z" })
|
|
198
|
+
}),
|
|
199
|
+
IconPlay: (e) => /* @__PURE__ */ t(O, {
|
|
200
|
+
...e,
|
|
201
|
+
children: /* @__PURE__ */ t("path", {
|
|
202
|
+
d: "m8 5 11 7-11 7V5Z",
|
|
203
|
+
fill: "currentColor",
|
|
204
|
+
stroke: "none"
|
|
205
|
+
})
|
|
206
|
+
}),
|
|
207
|
+
IconReplay: (e) => /* @__PURE__ */ t(O, {
|
|
208
|
+
...e,
|
|
209
|
+
children: /* @__PURE__ */ t("path", { d: "M4 7v5h5M5.5 11a7 7 0 1 1 1.3 6.3" })
|
|
210
|
+
}),
|
|
211
|
+
IconSettings: (e) => /* @__PURE__ */ t(O, {
|
|
212
|
+
...e,
|
|
213
|
+
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" })
|
|
214
|
+
}),
|
|
215
|
+
IconFullscreen: (e) => /* @__PURE__ */ t(O, {
|
|
216
|
+
...e,
|
|
217
|
+
children: /* @__PURE__ */ t("path", { d: "M9 4H4v5m11-5h5v5M9 20H4v-5m11 5h5v-5" })
|
|
218
|
+
}),
|
|
219
|
+
IconFullscreenExit: (e) => /* @__PURE__ */ t(O, {
|
|
220
|
+
...e,
|
|
221
|
+
children: /* @__PURE__ */ t("path", { d: "M4 9h5V4m6 5h5V4M4 15h5v5m6-5h5v5" })
|
|
222
|
+
}),
|
|
223
|
+
IconCaptions: (e) => /* @__PURE__ */ t(O, {
|
|
224
|
+
...e,
|
|
225
|
+
children: /* @__PURE__ */ t("path", { d: "M4 6h16v12H4V6Zm7 4a2 2 0 1 0 0 4m7-4a2 2 0 1 0 0 4" })
|
|
226
|
+
}),
|
|
227
|
+
IconVolume: (e) => /* @__PURE__ */ t(O, {
|
|
228
|
+
...e,
|
|
229
|
+
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" })
|
|
230
|
+
}),
|
|
231
|
+
IconVolumeMuted: (e) => /* @__PURE__ */ t(O, {
|
|
232
|
+
...e,
|
|
233
|
+
children: /* @__PURE__ */ t("path", { d: "M5 10v4h4l5 4V6l-5 4H5Zm12 0 4 4m0-4-4 4" })
|
|
234
|
+
}),
|
|
235
|
+
IconSort: (e) => /* @__PURE__ */ t(O, {
|
|
236
|
+
...e,
|
|
237
|
+
children: /* @__PURE__ */ t("path", { d: "M8 17V5m-3 3 3-3 3 3M16 7v12m-3-3 3 3 3-3" })
|
|
238
|
+
}),
|
|
239
|
+
IconSortAscending: (e) => /* @__PURE__ */ t(O, {
|
|
240
|
+
...e,
|
|
241
|
+
children: /* @__PURE__ */ t("path", { d: "M12 19V5m-5 5 5-5 5 5" })
|
|
242
|
+
}),
|
|
243
|
+
IconSortDescending: (e) => /* @__PURE__ */ t(O, {
|
|
244
|
+
...e,
|
|
245
|
+
children: /* @__PURE__ */ t("path", { d: "M12 5v14m-5-5 5 5 5-5" })
|
|
246
|
+
}),
|
|
247
|
+
IconSuccessCircle: (e) => /* @__PURE__ */ n(O, {
|
|
248
|
+
...e,
|
|
249
|
+
children: [/* @__PURE__ */ t("circle", {
|
|
250
|
+
cx: "12",
|
|
251
|
+
cy: "12",
|
|
252
|
+
r: "10"
|
|
253
|
+
}), /* @__PURE__ */ t("path", { d: "m9 12 2 2 4-4" })]
|
|
254
|
+
}),
|
|
255
|
+
IconUpload: (e) => /* @__PURE__ */ t(O, {
|
|
256
|
+
...e,
|
|
257
|
+
children: /* @__PURE__ */ t("path", { d: "M12 19V5m-5 5 5-5 5 5" })
|
|
258
|
+
}),
|
|
259
|
+
IconWarning: (e) => /* @__PURE__ */ n(O, {
|
|
260
|
+
...e,
|
|
261
|
+
children: [/* @__PURE__ */ t("path", { d: "M12 3.5L21 19H3L12 3.5Z" }), /* @__PURE__ */ t("path", { d: "M12 9v4.5M12 16.5v.01" })]
|
|
262
|
+
})
|
|
263
|
+
}, A = ({ name: e, ...n }) => {
|
|
264
|
+
let r = k[e];
|
|
265
|
+
return /* @__PURE__ */ t(r, { ...n });
|
|
266
|
+
}, j = {
|
|
111
267
|
wrapper: "_wrapper_1gq36_1",
|
|
112
268
|
label: "_label_1gq36_3",
|
|
113
269
|
input: "_input_1gq36_5",
|
|
114
270
|
control: "_control_1gq36_7",
|
|
115
271
|
disabled: "_disabled_1gq36_13",
|
|
116
272
|
controlError: "_controlError_1gq36_17"
|
|
117
|
-
},
|
|
273
|
+
}, M = ({ checked: e, onChange: r, label: i, hint: a, error: o, disabled: l = !1, readOnly: u = !1, className: f = "", name: p, id: m, indeterminate: h = !1, ...g }) => {
|
|
118
274
|
let _ = c(), v = m ?? `ds-checkbox-${p ?? _}`, y = d(null), b = a ? `${v}-hint` : void 0, x = o ? `${v}-error` : void 0;
|
|
119
275
|
return s(() => {
|
|
120
276
|
y.current && (y.current.indeterminate = h && !e);
|
|
121
277
|
}, [e, h]), /* @__PURE__ */ n("div", {
|
|
122
|
-
className: `${
|
|
278
|
+
className: `${j.wrapper} ${f}`,
|
|
123
279
|
children: [
|
|
124
280
|
/* @__PURE__ */ n("label", {
|
|
125
|
-
className: `${
|
|
281
|
+
className: `${j.label} ${l ? j.disabled : ""}`,
|
|
126
282
|
htmlFor: v,
|
|
127
283
|
children: [
|
|
128
284
|
/* @__PURE__ */ t("input", {
|
|
@@ -135,53 +291,63 @@ var T = {
|
|
|
135
291
|
"aria-readonly": u || void 0,
|
|
136
292
|
"aria-invalid": !!o,
|
|
137
293
|
"aria-describedby": [b, x].filter(Boolean).join(" ") || void 0,
|
|
138
|
-
className:
|
|
294
|
+
className: j.input,
|
|
139
295
|
onChange: (e) => {
|
|
140
296
|
u || r?.(e.target.checked, e);
|
|
141
297
|
},
|
|
142
298
|
...g
|
|
143
299
|
}),
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
-
className: `${
|
|
300
|
+
/* @__PURE__ */ n("span", {
|
|
301
|
+
className: `${j.control} ${o ? j.controlError : ""}`,
|
|
146
302
|
"aria-hidden": "true",
|
|
147
|
-
children: h && !e
|
|
303
|
+
children: [h && !e && /* @__PURE__ */ t(A, {
|
|
304
|
+
name: "IconMinus",
|
|
305
|
+
width: 16,
|
|
306
|
+
height: 16
|
|
307
|
+
}), e && /* @__PURE__ */ t(A, {
|
|
308
|
+
name: "IconCheck",
|
|
309
|
+
width: 16,
|
|
310
|
+
height: 16
|
|
311
|
+
})]
|
|
148
312
|
}),
|
|
149
313
|
i && /* @__PURE__ */ t("span", { children: i })
|
|
150
314
|
]
|
|
151
315
|
}),
|
|
152
|
-
a && !o && /* @__PURE__ */ t(
|
|
316
|
+
a && !o && /* @__PURE__ */ t(D, {
|
|
153
317
|
id: b,
|
|
154
318
|
children: a
|
|
155
319
|
}),
|
|
156
|
-
o && /* @__PURE__ */ t(
|
|
320
|
+
o && /* @__PURE__ */ t(D, {
|
|
157
321
|
id: x,
|
|
158
322
|
variant: "error",
|
|
159
323
|
children: o
|
|
160
324
|
})
|
|
161
325
|
]
|
|
162
326
|
});
|
|
163
|
-
},
|
|
164
|
-
wrapper: "
|
|
165
|
-
trigger: "
|
|
166
|
-
lg: "
|
|
167
|
-
chevron: "
|
|
168
|
-
chevronOpen: "
|
|
169
|
-
nav: "
|
|
170
|
-
day: "
|
|
171
|
-
monthSelect: "
|
|
172
|
-
yearInput: "
|
|
173
|
-
timeInput: "
|
|
174
|
-
value: "
|
|
175
|
-
placeholder: "
|
|
176
|
-
error: "
|
|
177
|
-
panel: "
|
|
178
|
-
calendarHeader: "
|
|
179
|
-
weekdays: "
|
|
180
|
-
days: "
|
|
181
|
-
outside: "
|
|
182
|
-
selected: "
|
|
183
|
-
timeLabel: "
|
|
184
|
-
|
|
327
|
+
}, N = {
|
|
328
|
+
wrapper: "_wrapper_1kcfm_1",
|
|
329
|
+
trigger: "_trigger_1kcfm_17",
|
|
330
|
+
lg: "_lg_1kcfm_51",
|
|
331
|
+
chevron: "_chevron_1kcfm_63",
|
|
332
|
+
chevronOpen: "_chevronOpen_1kcfm_89",
|
|
333
|
+
nav: "_nav_1kcfm_99",
|
|
334
|
+
day: "_day_1kcfm_101",
|
|
335
|
+
monthSelect: "_monthSelect_1kcfm_103",
|
|
336
|
+
yearInput: "_yearInput_1kcfm_105",
|
|
337
|
+
timeInput: "_timeInput_1kcfm_107",
|
|
338
|
+
value: "_value_1kcfm_131",
|
|
339
|
+
placeholder: "_placeholder_1kcfm_139",
|
|
340
|
+
error: "_error_1kcfm_147",
|
|
341
|
+
panel: "_panel_1kcfm_155",
|
|
342
|
+
calendarHeader: "_calendarHeader_1kcfm_181",
|
|
343
|
+
weekdays: "_weekdays_1kcfm_271",
|
|
344
|
+
days: "_days_1kcfm_273",
|
|
345
|
+
outside: "_outside_1kcfm_309",
|
|
346
|
+
selected: "_selected_1kcfm_317",
|
|
347
|
+
timeLabel: "_timeLabel_1kcfm_337",
|
|
348
|
+
previousMonth: "_previousMonth_1kcfm_385",
|
|
349
|
+
nextMonth: "_nextMonth_1kcfm_393"
|
|
350
|
+
}, P = [
|
|
185
351
|
"Пн",
|
|
186
352
|
"Вт",
|
|
187
353
|
"Ср",
|
|
@@ -189,7 +355,7 @@ var T = {
|
|
|
189
355
|
"Пт",
|
|
190
356
|
"Сб",
|
|
191
357
|
"Вс"
|
|
192
|
-
],
|
|
358
|
+
], F = [
|
|
193
359
|
"Январь",
|
|
194
360
|
"Февраль",
|
|
195
361
|
"Март",
|
|
@@ -202,11 +368,11 @@ var T = {
|
|
|
202
368
|
"Октябрь",
|
|
203
369
|
"Ноябрь",
|
|
204
370
|
"Декабрь"
|
|
205
|
-
],
|
|
371
|
+
], I = (e) => String(e).padStart(2, "0"), L = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), R = (e, t) => {
|
|
206
372
|
if (!e) return "";
|
|
207
|
-
let n = `${e.getFullYear()}-${
|
|
373
|
+
let n = `${e.getFullYear()}-${I(e.getMonth() + 1)}-${I(e.getDate())}`, r = `${I(e.getHours())}:${I(e.getMinutes())}`;
|
|
208
374
|
return t === "date" ? n : t === "time" ? r : `${n}T${r}`;
|
|
209
|
-
},
|
|
375
|
+
}, z = (e, t) => {
|
|
210
376
|
if (!e) return null;
|
|
211
377
|
if (t === "time") {
|
|
212
378
|
let t = /^(\d{2}):(\d{2})$/.exec(e);
|
|
@@ -224,36 +390,36 @@ var T = {
|
|
|
224
390
|
}
|
|
225
391
|
let n = new Date(e);
|
|
226
392
|
return Number.isNaN(n.getTime()) ? null : n;
|
|
227
|
-
},
|
|
393
|
+
}, B = (e, t) => {
|
|
228
394
|
if (!e) return "";
|
|
229
|
-
let n = `${
|
|
395
|
+
let n = `${I(e.getDate())}.${I(e.getMonth() + 1)}.${e.getFullYear()}`, r = `${I(e.getHours())}:${I(e.getMinutes())}`;
|
|
230
396
|
return t === "date" ? n : t === "time" ? r : `${n} ${r}`;
|
|
231
|
-
},
|
|
397
|
+
}, V = (e) => {
|
|
232
398
|
let t = new Date(e.getFullYear(), e.getMonth(), 1), n = (t.getDay() + 6) % 7, r = new Date(t);
|
|
233
399
|
return r.setDate(t.getDate() - n), Array.from({ length: 42 }, (e, t) => {
|
|
234
400
|
let n = new Date(r);
|
|
235
401
|
return n.setDate(r.getDate() + t), n;
|
|
236
402
|
});
|
|
237
|
-
},
|
|
238
|
-
let r =
|
|
239
|
-
return !!(t && r <
|
|
240
|
-
},
|
|
241
|
-
let
|
|
403
|
+
}, H = (e, t) => !!(e && e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate()), ee = (e, t, n) => {
|
|
404
|
+
let r = L(e).getTime();
|
|
405
|
+
return !!(t && r < L(t).getTime() || n && r > L(n).getTime());
|
|
406
|
+
}, U = 8, W = 6, G = ({ value: r, onChange: i, mode: a = "date", label: m, placeholder: h, hint: g, error: _, disabled: v = !1, readOnly: y = !1, required: b = !1, min: x, max: S, size: C = "md", id: w, name: T, className: O = "" }) => {
|
|
407
|
+
let k = c(), j = w ?? `ds-date-time-${T ?? k}`, M = g ? `${j}-hint` : void 0, I = _ ? `${j}-error` : void 0, L = d(null), G = d(null), te = d(null), [K, q] = f(!1), [J, ne] = f(r ?? /* @__PURE__ */ new Date()), [Y, re] = f(R(r, "time")), [ie, ae] = f(null), oe = u(() => V(J), [J]), se = a !== "time", ce = a !== "date";
|
|
242
408
|
s(() => {
|
|
243
|
-
r &&
|
|
409
|
+
r && ne(r), re(R(r, "time"));
|
|
244
410
|
}, [r]);
|
|
245
411
|
let le = o(() => {
|
|
246
|
-
let e =
|
|
412
|
+
let e = G.current, t = te.current;
|
|
247
413
|
if (!e || !t) return;
|
|
248
|
-
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight - n.bottom -
|
|
414
|
+
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight - n.bottom - U, o = n.top - U, s = a < r.height && o > a, c = Math.max(120, s ? o : a), l = s ? Math.max(U, n.top - r.height - W) : n.bottom + W, u = n.left, d = i - r.width - U;
|
|
249
415
|
ae({
|
|
250
416
|
top: l,
|
|
251
|
-
left: Math.max(
|
|
417
|
+
left: Math.max(U, Math.min(u, d)),
|
|
252
418
|
maxHeight: c
|
|
253
419
|
});
|
|
254
420
|
}, []);
|
|
255
421
|
l(() => {
|
|
256
|
-
if (!
|
|
422
|
+
if (!K) {
|
|
257
423
|
ae(null);
|
|
258
424
|
return;
|
|
259
425
|
}
|
|
@@ -261,38 +427,38 @@ var T = {
|
|
|
261
427
|
window.removeEventListener("resize", le), window.removeEventListener("scroll", le, !0);
|
|
262
428
|
};
|
|
263
429
|
}, [
|
|
264
|
-
|
|
430
|
+
K,
|
|
265
431
|
le,
|
|
266
|
-
|
|
267
|
-
|
|
432
|
+
J,
|
|
433
|
+
Y
|
|
268
434
|
]), s(() => {
|
|
269
|
-
if (!
|
|
435
|
+
if (!K) return;
|
|
270
436
|
let e = (e) => {
|
|
271
|
-
let t = e.target, n =
|
|
272
|
-
!n && !r &&
|
|
437
|
+
let t = e.target, n = L.current?.contains(t), r = te.current?.contains(t);
|
|
438
|
+
!n && !r && q(!1);
|
|
273
439
|
}, t = (e) => {
|
|
274
|
-
e.key === "Escape" && (
|
|
440
|
+
e.key === "Escape" && (q(!1), G.current?.focus());
|
|
275
441
|
};
|
|
276
442
|
return document.addEventListener("pointerdown", e), document.addEventListener("keydown", t), () => {
|
|
277
443
|
document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
|
|
278
444
|
};
|
|
279
|
-
}, [
|
|
445
|
+
}, [K]);
|
|
280
446
|
let ue = (e) => {
|
|
281
|
-
if (
|
|
282
|
-
let t = a === "date" ?
|
|
283
|
-
t && (a !== "date" && t.setHours(r?.getHours() ?? 0, r?.getMinutes() ?? 0, 0, 0), i?.(t), a === "date" &&
|
|
284
|
-
},
|
|
447
|
+
if (ee(e, x, S)) return;
|
|
448
|
+
let t = a === "date" ? z(R(e, "date"), "date") : new Date(e);
|
|
449
|
+
t && (a !== "date" && t.setHours(r?.getHours() ?? 0, r?.getMinutes() ?? 0, 0, 0), i?.(t), a === "date" && q(!1));
|
|
450
|
+
}, X = (e) => {
|
|
285
451
|
if (re(e), !e) {
|
|
286
452
|
i?.(null);
|
|
287
453
|
return;
|
|
288
454
|
}
|
|
289
|
-
let t =
|
|
455
|
+
let t = z(e, "time");
|
|
290
456
|
if (!t) return;
|
|
291
|
-
let n = new Date(a === "datetime" ? r ??
|
|
457
|
+
let n = new Date(a === "datetime" ? r ?? J : /* @__PURE__ */ new Date());
|
|
292
458
|
n.setHours(t.getHours(), t.getMinutes(), 0, 0), !(x && n < x || S && n > S) && i?.(n);
|
|
293
|
-
}, de = h ?? (a === "date" ? "
|
|
459
|
+
}, de = h ?? (a === "date" ? "--.--.----" : a === "time" ? "--:--" : "--.--.---- --:--"), fe = [M, I].filter(Boolean).join(" ") || void 0, pe = K && !y ? /* @__PURE__ */ n("div", {
|
|
294
460
|
ref: te,
|
|
295
|
-
className:
|
|
461
|
+
className: N.panel,
|
|
296
462
|
role: "dialog",
|
|
297
463
|
"aria-label": m ?? de,
|
|
298
464
|
style: ie ? {
|
|
@@ -306,53 +472,63 @@ var T = {
|
|
|
306
472
|
},
|
|
307
473
|
children: [se && /* @__PURE__ */ n(e, { children: [
|
|
308
474
|
/* @__PURE__ */ n("div", {
|
|
309
|
-
className:
|
|
475
|
+
className: N.calendarHeader,
|
|
310
476
|
children: [
|
|
311
477
|
/* @__PURE__ */ t("button", {
|
|
312
478
|
type: "button",
|
|
313
|
-
className:
|
|
479
|
+
className: N.nav,
|
|
314
480
|
"aria-label": "Предыдущий месяц",
|
|
315
|
-
onClick: () =>
|
|
316
|
-
children:
|
|
481
|
+
onClick: () => ne(new Date(J.getFullYear(), J.getMonth() - 1, 1)),
|
|
482
|
+
children: /* @__PURE__ */ t(A, {
|
|
483
|
+
name: "IconChevron",
|
|
484
|
+
width: 20,
|
|
485
|
+
height: 20,
|
|
486
|
+
className: N.previousMonth
|
|
487
|
+
})
|
|
317
488
|
}),
|
|
318
489
|
/* @__PURE__ */ t("select", {
|
|
319
|
-
className:
|
|
490
|
+
className: N.monthSelect,
|
|
320
491
|
"aria-label": "Месяц",
|
|
321
|
-
value:
|
|
322
|
-
onChange: (e) =>
|
|
323
|
-
children:
|
|
492
|
+
value: J.getMonth(),
|
|
493
|
+
onChange: (e) => ne(new Date(J.getFullYear(), Number(e.target.value), 1)),
|
|
494
|
+
children: F.map((e, n) => /* @__PURE__ */ t("option", {
|
|
324
495
|
value: n,
|
|
325
496
|
children: e
|
|
326
497
|
}, e))
|
|
327
498
|
}),
|
|
328
499
|
/* @__PURE__ */ t("input", {
|
|
329
|
-
className:
|
|
500
|
+
className: N.yearInput,
|
|
330
501
|
type: "number",
|
|
331
502
|
"aria-label": "Год",
|
|
332
|
-
value:
|
|
333
|
-
onChange: (e) =>
|
|
503
|
+
value: J.getFullYear(),
|
|
504
|
+
onChange: (e) => ne(new Date(Number(e.target.value), J.getMonth(), 1))
|
|
334
505
|
}),
|
|
335
506
|
/* @__PURE__ */ t("button", {
|
|
336
507
|
type: "button",
|
|
337
|
-
className:
|
|
508
|
+
className: N.nav,
|
|
338
509
|
"aria-label": "Следующий месяц",
|
|
339
|
-
onClick: () =>
|
|
340
|
-
children:
|
|
510
|
+
onClick: () => ne(new Date(J.getFullYear(), J.getMonth() + 1, 1)),
|
|
511
|
+
children: /* @__PURE__ */ t(A, {
|
|
512
|
+
name: "IconChevron",
|
|
513
|
+
width: 20,
|
|
514
|
+
height: 20,
|
|
515
|
+
className: N.nextMonth
|
|
516
|
+
})
|
|
341
517
|
})
|
|
342
518
|
]
|
|
343
519
|
}),
|
|
344
520
|
/* @__PURE__ */ t("div", {
|
|
345
|
-
className:
|
|
346
|
-
children:
|
|
521
|
+
className: N.weekdays,
|
|
522
|
+
children: P.map((e) => /* @__PURE__ */ t("span", { children: e }, e))
|
|
347
523
|
}),
|
|
348
524
|
/* @__PURE__ */ t("div", {
|
|
349
|
-
className:
|
|
525
|
+
className: N.days,
|
|
350
526
|
children: oe.map((e) => {
|
|
351
|
-
let n =
|
|
527
|
+
let n = H(r, e);
|
|
352
528
|
return /* @__PURE__ */ t("button", {
|
|
353
529
|
type: "button",
|
|
354
|
-
className: `${
|
|
355
|
-
disabled:
|
|
530
|
+
className: `${N.day} ${e.getMonth() === J.getMonth() ? "" : N.outside} ${n ? N.selected : ""}`,
|
|
531
|
+
disabled: ee(e, x, S),
|
|
356
532
|
"aria-pressed": n,
|
|
357
533
|
onClick: () => ue(e),
|
|
358
534
|
children: e.getDate()
|
|
@@ -360,84 +536,78 @@ var T = {
|
|
|
360
536
|
})
|
|
361
537
|
})
|
|
362
538
|
] }), ce && /* @__PURE__ */ n("label", {
|
|
363
|
-
className:
|
|
539
|
+
className: N.timeLabel,
|
|
364
540
|
children: [/* @__PURE__ */ t("span", { children: "Время" }), /* @__PURE__ */ t("input", {
|
|
365
|
-
className:
|
|
541
|
+
className: N.timeInput,
|
|
366
542
|
type: "time",
|
|
367
|
-
value:
|
|
368
|
-
onChange: (e) =>
|
|
543
|
+
value: Y,
|
|
544
|
+
onChange: (e) => X(e.target.value)
|
|
369
545
|
})]
|
|
370
546
|
})]
|
|
371
547
|
}) : null;
|
|
372
548
|
return /* @__PURE__ */ n("div", {
|
|
373
|
-
ref:
|
|
374
|
-
className: `${
|
|
549
|
+
ref: L,
|
|
550
|
+
className: `${N.wrapper} ${O}`,
|
|
375
551
|
children: [
|
|
376
|
-
m && /* @__PURE__ */ t(
|
|
377
|
-
htmlFor:
|
|
552
|
+
m && /* @__PURE__ */ t(E, {
|
|
553
|
+
htmlFor: j,
|
|
378
554
|
required: b,
|
|
379
555
|
disabled: v,
|
|
380
556
|
children: m
|
|
381
557
|
}),
|
|
382
558
|
/* @__PURE__ */ n("button", {
|
|
383
|
-
ref:
|
|
384
|
-
id:
|
|
559
|
+
ref: G,
|
|
560
|
+
id: j,
|
|
385
561
|
name: T,
|
|
386
562
|
type: "button",
|
|
387
|
-
className: `${
|
|
563
|
+
className: `${N.trigger} ${N[C]} ${_ ? N.error : ""}`,
|
|
388
564
|
disabled: v,
|
|
389
565
|
"aria-readonly": y || void 0,
|
|
390
|
-
"aria-expanded":
|
|
566
|
+
"aria-expanded": K,
|
|
391
567
|
"aria-haspopup": "dialog",
|
|
392
568
|
"aria-describedby": fe,
|
|
393
569
|
onClick: () => {
|
|
394
|
-
y ||
|
|
570
|
+
y || q((e) => !e);
|
|
395
571
|
},
|
|
396
572
|
children: [/* @__PURE__ */ t("span", {
|
|
397
|
-
className: r ?
|
|
398
|
-
children:
|
|
573
|
+
className: r ? N.value : N.placeholder,
|
|
574
|
+
children: B(r, a) || de
|
|
399
575
|
}), /* @__PURE__ */ t("span", {
|
|
400
|
-
className: [
|
|
576
|
+
className: [N.chevron, pe ? N.chevronOpen : ""].filter(Boolean).join(" "),
|
|
401
577
|
"aria-hidden": "true",
|
|
402
|
-
children: /* @__PURE__ */ t(
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
d: "M5 7.5L10 12.5L15 7.5",
|
|
407
|
-
stroke: "currentColor",
|
|
408
|
-
strokeWidth: "1.8",
|
|
409
|
-
strokeLinecap: "round",
|
|
410
|
-
strokeLinejoin: "round"
|
|
411
|
-
})
|
|
578
|
+
children: /* @__PURE__ */ t(A, {
|
|
579
|
+
name: "IconChevron",
|
|
580
|
+
width: 20,
|
|
581
|
+
height: 20
|
|
412
582
|
})
|
|
413
583
|
})]
|
|
414
584
|
}),
|
|
415
585
|
pe && p(pe, document.body),
|
|
416
|
-
g && !_ && /* @__PURE__ */ t(
|
|
417
|
-
id:
|
|
586
|
+
g && !_ && /* @__PURE__ */ t(D, {
|
|
587
|
+
id: M,
|
|
418
588
|
children: g
|
|
419
589
|
}),
|
|
420
|
-
_ && /* @__PURE__ */ t(
|
|
421
|
-
id:
|
|
590
|
+
_ && /* @__PURE__ */ t(D, {
|
|
591
|
+
id: I,
|
|
422
592
|
variant: "error",
|
|
423
593
|
children: _
|
|
424
594
|
})
|
|
425
595
|
]
|
|
426
596
|
});
|
|
427
|
-
},
|
|
597
|
+
}, te = {
|
|
428
598
|
root: "_root_1q42e_1",
|
|
429
599
|
legend: "_legend_1q42e_3",
|
|
430
600
|
range: "_range_1q42e_5"
|
|
431
|
-
},
|
|
601
|
+
}, K = (e) => !!(e.from && e.to && e.from.getTime() <= e.to.getTime()), q = ({ 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 = "" }) => {
|
|
432
602
|
let g = l ?? (e.from && e.to && e.from > e.to ? "Дата «От» не может быть позже даты «До»" : void 0), _ = (e) => {
|
|
433
|
-
i?.(e),
|
|
603
|
+
i?.(e), K(e) && r?.(e);
|
|
434
604
|
};
|
|
435
605
|
return /* @__PURE__ */ n("fieldset", {
|
|
436
|
-
className: `${
|
|
606
|
+
className: `${te.root} ${h}`,
|
|
437
607
|
disabled: f,
|
|
438
608
|
children: [/* @__PURE__ */ n("div", {
|
|
439
|
-
className:
|
|
440
|
-
children: [/* @__PURE__ */ t(
|
|
609
|
+
className: te.range,
|
|
610
|
+
children: [/* @__PURE__ */ t(G, {
|
|
441
611
|
value: e.from,
|
|
442
612
|
mode: a === "datetime" ? "datetime" : a,
|
|
443
613
|
label: o,
|
|
@@ -451,7 +621,7 @@ var T = {
|
|
|
451
621
|
...e,
|
|
452
622
|
from: t
|
|
453
623
|
})
|
|
454
|
-
}), /* @__PURE__ */ t(
|
|
624
|
+
}), /* @__PURE__ */ t(G, {
|
|
455
625
|
value: e.to,
|
|
456
626
|
mode: a === "datetime" ? "datetime" : a,
|
|
457
627
|
label: s,
|
|
@@ -466,9 +636,9 @@ var T = {
|
|
|
466
636
|
to: t
|
|
467
637
|
})
|
|
468
638
|
})]
|
|
469
|
-
}), c && !g && /* @__PURE__ */ t(
|
|
639
|
+
}), c && !g && /* @__PURE__ */ t(D, { children: c })]
|
|
470
640
|
});
|
|
471
|
-
},
|
|
641
|
+
}, J = {
|
|
472
642
|
group: "_group_1fs9e_1",
|
|
473
643
|
skeleton: "_skeleton_1fs9e_3",
|
|
474
644
|
text: "_text_1fs9e_5",
|
|
@@ -476,55 +646,55 @@ var T = {
|
|
|
476
646
|
circular: "_circular_1fs9e_9",
|
|
477
647
|
animated: "_animated_1fs9e_11",
|
|
478
648
|
"ds-skeleton": "_ds-skeleton_1fs9e_1"
|
|
479
|
-
},
|
|
480
|
-
className: `${
|
|
649
|
+
}, ne = ({ variant: e = "text", width: n = "100%", height: r, lines: i = 1, animated: a = !0, className: o = "" }) => /* @__PURE__ */ t("span", {
|
|
650
|
+
className: `${J.group} ${o}`,
|
|
481
651
|
"aria-hidden": "true",
|
|
482
652
|
children: Array.from({ length: Math.max(1, i) }, (o, s) => /* @__PURE__ */ t("span", {
|
|
483
|
-
className: `${
|
|
653
|
+
className: `${J.skeleton} ${J[e]} ${a ? J.animated : ""}`,
|
|
484
654
|
style: {
|
|
485
655
|
width: s === i - 1 && i > 1 ? "70%" : n,
|
|
486
656
|
height: r
|
|
487
657
|
}
|
|
488
658
|
}, s))
|
|
489
|
-
}),
|
|
490
|
-
wrapper: "
|
|
491
|
-
label: "
|
|
492
|
-
container: "
|
|
493
|
-
trigger: "
|
|
494
|
-
disabledText: "
|
|
495
|
-
sm: "
|
|
496
|
-
md: "
|
|
497
|
-
lg: "
|
|
498
|
-
value: "
|
|
499
|
-
placeholder: "
|
|
500
|
-
chevron: "
|
|
501
|
-
chevronOpen: "
|
|
502
|
-
menu: "
|
|
503
|
-
option: "
|
|
504
|
-
selected: "
|
|
505
|
-
message: "
|
|
506
|
-
error: "
|
|
507
|
-
errorState: "
|
|
508
|
-
},
|
|
659
|
+
}), Y = {
|
|
660
|
+
wrapper: "_wrapper_jmtfp_1",
|
|
661
|
+
label: "_label_jmtfp_17",
|
|
662
|
+
container: "_container_jmtfp_29",
|
|
663
|
+
trigger: "_trigger_jmtfp_37",
|
|
664
|
+
disabledText: "_disabledText_jmtfp_39",
|
|
665
|
+
sm: "_sm_jmtfp_61",
|
|
666
|
+
md: "_md_jmtfp_71",
|
|
667
|
+
lg: "_lg_jmtfp_81",
|
|
668
|
+
value: "_value_jmtfp_141",
|
|
669
|
+
placeholder: "_placeholder_jmtfp_143",
|
|
670
|
+
chevron: "_chevron_jmtfp_199",
|
|
671
|
+
chevronOpen: "_chevronOpen_jmtfp_225",
|
|
672
|
+
menu: "_menu_jmtfp_233",
|
|
673
|
+
option: "_option_jmtfp_263",
|
|
674
|
+
selected: "_selected_jmtfp_333",
|
|
675
|
+
message: "_message_jmtfp_353",
|
|
676
|
+
error: "_error_jmtfp_355",
|
|
677
|
+
errorState: "_errorState_jmtfp_381"
|
|
678
|
+
}, re = 8, ie = 6, ae = 120, oe = (e, t, n) => {
|
|
509
679
|
if (!e.length) return -1;
|
|
510
680
|
for (let r = 0; r < e.length; r += 1) {
|
|
511
681
|
let i = (t + r * n + e.length) % e.length;
|
|
512
682
|
if (!e[i]?.disabled) return i;
|
|
513
683
|
}
|
|
514
684
|
return -1;
|
|
515
|
-
},
|
|
685
|
+
}, se = (e) => {
|
|
516
686
|
if (typeof e == "number") return e;
|
|
517
687
|
if (typeof e == "string") {
|
|
518
688
|
let t = Number.parseFloat(e);
|
|
519
689
|
if (Number.isFinite(t)) return t;
|
|
520
690
|
}
|
|
521
691
|
return Infinity;
|
|
522
|
-
},
|
|
523
|
-
let
|
|
524
|
-
let e =
|
|
692
|
+
}, ce = ({ options: e, value: r, onChange: i, placeholder: a = "Выберите опцию", disabled: m = !1, stringWhileDisabled: h = !1, label: g, error: _, size: v = "md", hint: y, className: b = "", required: x = !1, name: S, id: C, needMark: w = !0, maxMenuHeight: T }) => {
|
|
693
|
+
let D = c(), O = C ?? `ds-dropdown-${S ?? D}`, k = `${O}-listbox`, [j, M] = f(!1), [N, P] = f(null), F = d(null), I = d(null), L = d(null), R = d([]), z = u(() => e.find((e) => e.value === r), [e, r]), B = y ? `${O}-hint` : void 0, V = _ ? `${O}-error` : void 0, H = [B, V].filter(Boolean).join(" ") || void 0, ee = m && h, U = o(() => {
|
|
694
|
+
let e = I.current, t = L.current;
|
|
525
695
|
if (!e || !t) return;
|
|
526
|
-
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight - n.bottom -
|
|
527
|
-
|
|
696
|
+
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight - n.bottom - re, o = n.top - re, s = a < r.height && o > a, c = Math.max(ae, s ? o : a), l = se(T), u = Math.min(c, l), d = n.left, f = i - n.width - re, p = Math.max(re, Math.min(d, f)), m = s ? Math.max(re, n.top - r.height - ie) : n.bottom + ie;
|
|
697
|
+
P({
|
|
528
698
|
top: m,
|
|
529
699
|
left: p,
|
|
530
700
|
width: n.width,
|
|
@@ -532,48 +702,48 @@ var T = {
|
|
|
532
702
|
});
|
|
533
703
|
}, [T]);
|
|
534
704
|
l(() => {
|
|
535
|
-
if (!
|
|
536
|
-
|
|
705
|
+
if (!j) {
|
|
706
|
+
P(null);
|
|
537
707
|
return;
|
|
538
708
|
}
|
|
539
|
-
return
|
|
540
|
-
window.removeEventListener("resize",
|
|
709
|
+
return U(), window.addEventListener("resize", U), window.addEventListener("scroll", U, !0), () => {
|
|
710
|
+
window.removeEventListener("resize", U), window.removeEventListener("scroll", U, !0);
|
|
541
711
|
};
|
|
542
712
|
}, [
|
|
543
|
-
|
|
544
|
-
|
|
713
|
+
j,
|
|
714
|
+
U,
|
|
545
715
|
e.length
|
|
546
716
|
]), s(() => {
|
|
547
|
-
if (!
|
|
717
|
+
if (!j) return;
|
|
548
718
|
let e = (e) => {
|
|
549
|
-
let t = e.target, n =
|
|
550
|
-
!n && !r &&
|
|
719
|
+
let t = e.target, n = F.current?.contains(t), r = L.current?.contains(t);
|
|
720
|
+
!n && !r && M(!1);
|
|
551
721
|
}, t = (e) => {
|
|
552
|
-
e.key === "Escape" && (
|
|
722
|
+
e.key === "Escape" && (M(!1), I.current?.focus());
|
|
553
723
|
};
|
|
554
724
|
return document.addEventListener("pointerdown", e), document.addEventListener("keydown", t), () => {
|
|
555
725
|
document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
|
|
556
726
|
};
|
|
557
|
-
}, [
|
|
558
|
-
let
|
|
559
|
-
let r =
|
|
727
|
+
}, [j]);
|
|
728
|
+
let W = (t, n) => {
|
|
729
|
+
let r = oe(e, t, n);
|
|
560
730
|
if (r === -1) return;
|
|
561
|
-
let i =
|
|
731
|
+
let i = R.current[r];
|
|
562
732
|
i?.focus(), i?.scrollIntoView({ block: "nearest" });
|
|
563
|
-
},
|
|
564
|
-
e.disabled || (i?.(e.value, e),
|
|
565
|
-
}, te =
|
|
566
|
-
ref:
|
|
567
|
-
id:
|
|
568
|
-
className:
|
|
733
|
+
}, G = (e) => {
|
|
734
|
+
e.disabled || (i?.(e.value, e), M(!1), I.current?.focus());
|
|
735
|
+
}, te = j ? /* @__PURE__ */ t("ul", {
|
|
736
|
+
ref: L,
|
|
737
|
+
id: k,
|
|
738
|
+
className: Y.menu,
|
|
569
739
|
role: "listbox",
|
|
570
740
|
"aria-label": g,
|
|
571
|
-
style:
|
|
741
|
+
style: N ? {
|
|
572
742
|
position: "fixed",
|
|
573
|
-
top:
|
|
574
|
-
left:
|
|
575
|
-
width:
|
|
576
|
-
maxHeight:
|
|
743
|
+
top: N.top,
|
|
744
|
+
left: N.left,
|
|
745
|
+
width: N.width,
|
|
746
|
+
maxHeight: N.maxHeight
|
|
577
747
|
} : {
|
|
578
748
|
position: "fixed",
|
|
579
749
|
top: 0,
|
|
@@ -587,140 +757,135 @@ var T = {
|
|
|
587
757
|
role: "presentation",
|
|
588
758
|
children: /* @__PURE__ */ n("button", {
|
|
589
759
|
ref: (e) => {
|
|
590
|
-
|
|
760
|
+
R.current[a] = e;
|
|
591
761
|
},
|
|
592
762
|
type: "button",
|
|
593
763
|
role: "option",
|
|
594
764
|
"aria-selected": o,
|
|
595
765
|
disabled: i.disabled,
|
|
596
766
|
className: [
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
o ?
|
|
767
|
+
Y[v],
|
|
768
|
+
Y.option,
|
|
769
|
+
o ? Y.selected : ""
|
|
600
770
|
].filter(Boolean).join(" "),
|
|
601
|
-
onClick: () =>
|
|
771
|
+
onClick: () => G(i),
|
|
602
772
|
onKeyDown: (t) => {
|
|
603
773
|
if (t.key === "ArrowDown" || t.key === "ArrowUp") {
|
|
604
774
|
t.preventDefault();
|
|
605
775
|
let e = t.key === "ArrowDown" ? 1 : -1;
|
|
606
|
-
|
|
776
|
+
W(a + e, e);
|
|
607
777
|
}
|
|
608
|
-
if (t.key === "Tab" &&
|
|
778
|
+
if (t.key === "Tab" && M(!1), t.key === "Home" || t.key === "End") {
|
|
609
779
|
t.preventDefault();
|
|
610
780
|
let n = t.key === "Home" ? 1 : -1;
|
|
611
|
-
|
|
781
|
+
W(t.key === "Home" ? 0 : e.length - 1, n);
|
|
612
782
|
}
|
|
613
|
-
(t.key === "Enter" || t.key === " ") && (t.preventDefault(),
|
|
783
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), G(i));
|
|
614
784
|
},
|
|
615
|
-
children: [/* @__PURE__ */ t("span", { children: i.label }), o && w && /* @__PURE__ */ t(
|
|
616
|
-
|
|
617
|
-
|
|
785
|
+
children: [/* @__PURE__ */ t("span", { children: i.label }), o && w && /* @__PURE__ */ t(A, {
|
|
786
|
+
name: "IconCheck",
|
|
787
|
+
width: 16,
|
|
788
|
+
height: 16
|
|
618
789
|
})]
|
|
619
790
|
})
|
|
620
791
|
}, i.value);
|
|
621
792
|
})
|
|
622
793
|
}) : null;
|
|
623
794
|
return /* @__PURE__ */ n("div", {
|
|
624
|
-
ref:
|
|
795
|
+
ref: F,
|
|
625
796
|
className: [
|
|
626
|
-
|
|
627
|
-
_ ?
|
|
797
|
+
Y.wrapper,
|
|
798
|
+
_ ? Y.errorState : "",
|
|
628
799
|
b
|
|
629
800
|
].filter(Boolean).join(" "),
|
|
630
801
|
children: [
|
|
631
|
-
g && /* @__PURE__ */ t(
|
|
802
|
+
g && /* @__PURE__ */ t(E, {
|
|
632
803
|
required: x,
|
|
633
804
|
disabled: m,
|
|
634
|
-
htmlFor:
|
|
805
|
+
htmlFor: ee ? void 0 : O,
|
|
635
806
|
children: g
|
|
636
807
|
}),
|
|
637
808
|
/* @__PURE__ */ t("div", {
|
|
638
|
-
className:
|
|
639
|
-
children:
|
|
640
|
-
id:
|
|
641
|
-
className:
|
|
642
|
-
"aria-describedby":
|
|
643
|
-
children:
|
|
809
|
+
className: Y.container,
|
|
810
|
+
children: ee ? /* @__PURE__ */ t("div", {
|
|
811
|
+
id: O,
|
|
812
|
+
className: Y.disabledText,
|
|
813
|
+
"aria-describedby": H,
|
|
814
|
+
children: z?.label ?? a
|
|
644
815
|
}) : /* @__PURE__ */ n("button", {
|
|
645
|
-
ref:
|
|
646
|
-
id:
|
|
816
|
+
ref: I,
|
|
817
|
+
id: O,
|
|
647
818
|
type: "button",
|
|
648
819
|
name: S,
|
|
649
|
-
className: `${
|
|
820
|
+
className: `${Y.trigger} ${Y[v]}`,
|
|
650
821
|
disabled: m,
|
|
651
822
|
"aria-haspopup": "listbox",
|
|
652
|
-
"aria-expanded":
|
|
653
|
-
"aria-controls":
|
|
654
|
-
"aria-describedby":
|
|
823
|
+
"aria-expanded": j,
|
|
824
|
+
"aria-controls": k,
|
|
825
|
+
"aria-describedby": H,
|
|
655
826
|
"aria-invalid": !!_,
|
|
656
|
-
onClick: () =>
|
|
827
|
+
onClick: () => M((e) => !e),
|
|
657
828
|
onKeyDown: (t) => {
|
|
658
829
|
if (t.key === "ArrowDown" || t.key === "ArrowUp") {
|
|
659
|
-
t.preventDefault(),
|
|
830
|
+
t.preventDefault(), M(!0);
|
|
660
831
|
let n = t.key === "ArrowDown" ? 1 : -1;
|
|
661
832
|
requestAnimationFrame(() => {
|
|
662
|
-
|
|
833
|
+
W(t.key === "ArrowDown" ? 0 : e.length - 1, n);
|
|
663
834
|
});
|
|
664
835
|
}
|
|
665
|
-
if (t.key === "Enter" &&
|
|
836
|
+
if (t.key === "Enter" && j) {
|
|
666
837
|
t.preventDefault();
|
|
667
838
|
let n = e.findIndex((e) => e.value === r);
|
|
668
|
-
|
|
839
|
+
W(n >= 0 ? n : 0, 1);
|
|
669
840
|
}
|
|
670
841
|
},
|
|
671
842
|
children: [/* @__PURE__ */ t("span", {
|
|
672
|
-
className: `${
|
|
673
|
-
${
|
|
674
|
-
children:
|
|
843
|
+
className: `${z ? Y.value : Y.placeholder}
|
|
844
|
+
${Y[v]}`,
|
|
845
|
+
children: z?.label ?? a
|
|
675
846
|
}), /* @__PURE__ */ t("span", {
|
|
676
|
-
className: [
|
|
847
|
+
className: [Y.chevron, j ? Y.chevronOpen : ""].filter(Boolean).join(" "),
|
|
677
848
|
"aria-hidden": "true",
|
|
678
|
-
children: /* @__PURE__ */ t(
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
d: "M5 7.5L10 12.5L15 7.5",
|
|
683
|
-
stroke: "currentColor",
|
|
684
|
-
strokeWidth: "1.8",
|
|
685
|
-
strokeLinecap: "round",
|
|
686
|
-
strokeLinejoin: "round"
|
|
687
|
-
})
|
|
849
|
+
children: /* @__PURE__ */ t(A, {
|
|
850
|
+
name: "IconChevron",
|
|
851
|
+
width: 20,
|
|
852
|
+
height: 20
|
|
688
853
|
})
|
|
689
854
|
})]
|
|
690
855
|
})
|
|
691
856
|
}),
|
|
692
|
-
|
|
857
|
+
j && p(te, document.body),
|
|
693
858
|
y && !_ && /* @__PURE__ */ t("span", {
|
|
694
|
-
id:
|
|
695
|
-
className:
|
|
859
|
+
id: B,
|
|
860
|
+
className: Y.message,
|
|
696
861
|
children: y
|
|
697
862
|
}),
|
|
698
863
|
_ && /* @__PURE__ */ t("span", {
|
|
699
|
-
id:
|
|
700
|
-
className:
|
|
864
|
+
id: V,
|
|
865
|
+
className: Y.error,
|
|
701
866
|
children: _
|
|
702
867
|
})
|
|
703
868
|
]
|
|
704
869
|
});
|
|
705
|
-
},
|
|
870
|
+
}, le = (e) => `${e.id}:${e.direction}`, ue = ({ options: e, value: n, onChange: r, label: i = "Сортировка", placeholder: a = "Выберите сортировку", disabled: o = !1, className: s }) => {
|
|
706
871
|
let c = e.flatMap((e) => [{
|
|
707
|
-
value:
|
|
872
|
+
value: le({
|
|
708
873
|
id: e.id,
|
|
709
874
|
direction: "asc"
|
|
710
875
|
}),
|
|
711
876
|
label: e.ascLabel ?? `${e.label} · по возрастанию`,
|
|
712
877
|
disabled: e.disabled
|
|
713
878
|
}, {
|
|
714
|
-
value:
|
|
879
|
+
value: le({
|
|
715
880
|
id: e.id,
|
|
716
881
|
direction: "desc"
|
|
717
882
|
}),
|
|
718
883
|
label: e.descLabel ?? `${e.label} · по убыванию`,
|
|
719
884
|
disabled: e.disabled
|
|
720
885
|
}]);
|
|
721
|
-
return /* @__PURE__ */ t(
|
|
886
|
+
return /* @__PURE__ */ t(ce, {
|
|
722
887
|
options: c,
|
|
723
|
-
value: n ?
|
|
888
|
+
value: n ? le(n) : "",
|
|
724
889
|
label: i,
|
|
725
890
|
placeholder: a,
|
|
726
891
|
disabled: o,
|
|
@@ -733,30 +898,7 @@ var T = {
|
|
|
733
898
|
});
|
|
734
899
|
}
|
|
735
900
|
});
|
|
736
|
-
},
|
|
737
|
-
approve: "M4 12l5 5L20 6",
|
|
738
|
-
reject: "M5 5l14 14M19 5L5 19",
|
|
739
|
-
edit: "M4 20h4L19 9l-4-4L4 16v4z",
|
|
740
|
-
cross: "M5 5l14 14M19 5L5 19",
|
|
741
|
-
chevron: "M6 9l6 6 6-6",
|
|
742
|
-
basket: "M4 7h16l-1 13H5L4 7zm3 0V4h10v3",
|
|
743
|
-
info: "M12 10v7m0-10v.01",
|
|
744
|
-
warning: "M12 4L3 20h18L12 4zm0 5v5m0 3v.01"
|
|
745
|
-
}, ue = ({ name: e, title: r, width: i = 24, height: a = 24, ...o }) => /* @__PURE__ */ n("svg", {
|
|
746
|
-
viewBox: "0 0 24 24",
|
|
747
|
-
width: i,
|
|
748
|
-
height: a,
|
|
749
|
-
fill: "none",
|
|
750
|
-
stroke: "currentColor",
|
|
751
|
-
strokeWidth: "1.8",
|
|
752
|
-
strokeLinecap: "round",
|
|
753
|
-
strokeLinejoin: "round",
|
|
754
|
-
role: r ? "img" : void 0,
|
|
755
|
-
"aria-hidden": !r || void 0,
|
|
756
|
-
focusable: "false",
|
|
757
|
-
...o,
|
|
758
|
-
children: [r && /* @__PURE__ */ t("title", { children: r }), /* @__PURE__ */ t("path", { d: le[e] })]
|
|
759
|
-
}), Y = {
|
|
901
|
+
}, X = {
|
|
760
902
|
root: "_root_l2civ_1",
|
|
761
903
|
tableWrap: "_tableWrap_l2civ_3",
|
|
762
904
|
table: "_table_l2civ_3",
|
|
@@ -859,138 +1001,139 @@ var T = {
|
|
|
859
1001
|
sortDescFirst: e.sortDescFirst
|
|
860
1002
|
};
|
|
861
1003
|
return n !== void 0 && (i.sortFn = n), i;
|
|
862
|
-
}, Se = ({ columns: e, data: r, tableOnMobile: i = !1, breakpoint: a = "default", sorting: o, onSortingChange: c, renderMobileCard: l, getRowId: d, caption: p, ariaLabel: m, loading: h = !1, error: g, emptyState: v = "Нет данных", stickyHeader: y = !1, maxHeight: b, className: x = "", onRowClick: S, pagination: C = !1, pageSize: T = 30, visibleColumnIds:
|
|
863
|
-
let [
|
|
864
|
-
if (
|
|
865
|
-
let t = new Set(
|
|
1004
|
+
}, Se = ({ columns: e, data: r, tableOnMobile: i = !1, breakpoint: a = "default", sorting: o, onSortingChange: c, renderMobileCard: l, getRowId: d, caption: p, ariaLabel: m, loading: h = !1, error: g, emptyState: v = "Нет данных", stickyHeader: y = !1, maxHeight: b, className: x = "", onRowClick: S, pagination: C = !1, pageSize: T = 30, visibleColumnIds: E }) => {
|
|
1005
|
+
let [D, O] = f([]), [k, j] = f(0), M = o ?? D, N = M.map((e) => `${e.id}:${e.desc ? "desc" : "asc"}`).join("|"), P = Number.isFinite(T) && T > 0 ? Math.floor(T) : 30, F = u(() => {
|
|
1006
|
+
if (E === void 0) return e;
|
|
1007
|
+
let t = new Set(E);
|
|
866
1008
|
return e.filter((e) => t.has(e.id));
|
|
867
|
-
}, [e,
|
|
1009
|
+
}, [e, E]), I = u(() => F.length === 0 ? "Должна быть видима хотя бы одна колонка" : pe(F, r), [r, F]), L = u(() => F.map(xe), [F]), R = _({
|
|
868
1010
|
features: de,
|
|
869
|
-
columns:
|
|
1011
|
+
columns: L,
|
|
870
1012
|
data: r,
|
|
871
|
-
state: { sorting:
|
|
1013
|
+
state: { sorting: M },
|
|
872
1014
|
onSortingChange: (e) => {
|
|
873
|
-
let t = typeof e == "function" ? e(
|
|
874
|
-
o === void 0 &&
|
|
1015
|
+
let t = typeof e == "function" ? e(M) : e;
|
|
1016
|
+
o === void 0 && O(t), j(0), c?.(t);
|
|
875
1017
|
},
|
|
876
1018
|
getRowId: d
|
|
877
|
-
}),
|
|
878
|
-
|
|
1019
|
+
}), z = R.getRowModel().rows, B = C ? Math.max(1, Math.ceil(z.length / P)) : 1, V = Math.min(k, B - 1), H = u(() => C ? z.slice(V * P, (V + 1) * P) : z, [
|
|
1020
|
+
P,
|
|
879
1021
|
C,
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
]),
|
|
1022
|
+
V,
|
|
1023
|
+
z
|
|
1024
|
+
]), ee = u(() => F.filter((e) => e.enableSorting ?? e.dataType !== "custom").map((e) => ({
|
|
883
1025
|
id: e.id,
|
|
884
1026
|
label: typeof e.header == "string" ? e.header : e.id
|
|
885
|
-
})), [
|
|
886
|
-
|
|
887
|
-
a === "wide" ?
|
|
888
|
-
i ?
|
|
1027
|
+
})), [F]), U = u(() => fe(V, B), [B, V]), W = [
|
|
1028
|
+
X.root,
|
|
1029
|
+
a === "wide" ? X.wide : X.default,
|
|
1030
|
+
i ? X.tableOnMobile : "",
|
|
889
1031
|
x
|
|
890
|
-
].filter(Boolean).join(" "),
|
|
1032
|
+
].filter(Boolean).join(" "), G = I ?? g, te = C && !h && !G && z.length > P, K = V * P + 1, q = Math.min((V + 1) * P, z.length);
|
|
891
1033
|
return s(() => {
|
|
892
|
-
|
|
1034
|
+
j(0);
|
|
893
1035
|
}, [
|
|
894
1036
|
r,
|
|
895
|
-
|
|
1037
|
+
P,
|
|
896
1038
|
C,
|
|
897
|
-
|
|
1039
|
+
N
|
|
898
1040
|
]), s(() => {
|
|
899
|
-
|
|
900
|
-
}, [
|
|
901
|
-
className:
|
|
1041
|
+
k >= B && j(B - 1);
|
|
1042
|
+
}, [B, k]), /* @__PURE__ */ n("section", {
|
|
1043
|
+
className: W,
|
|
902
1044
|
"aria-busy": h,
|
|
903
1045
|
children: [
|
|
904
|
-
!i && !h && !
|
|
905
|
-
className:
|
|
906
|
-
options:
|
|
907
|
-
value:
|
|
908
|
-
id:
|
|
909
|
-
direction:
|
|
1046
|
+
!i && !h && !G && H.length > 0 && ee.length > 0 && /* @__PURE__ */ t(ue, {
|
|
1047
|
+
className: X.mobileSort,
|
|
1048
|
+
options: ee,
|
|
1049
|
+
value: M[0] ? {
|
|
1050
|
+
id: M[0].id,
|
|
1051
|
+
direction: M[0].desc ? "desc" : "asc"
|
|
910
1052
|
} : null,
|
|
911
|
-
onChange: (e) =>
|
|
1053
|
+
onChange: (e) => R.setSorting([{
|
|
912
1054
|
id: e.id,
|
|
913
1055
|
desc: e.direction === "desc"
|
|
914
1056
|
}])
|
|
915
1057
|
}),
|
|
916
1058
|
/* @__PURE__ */ t("div", {
|
|
917
|
-
className:
|
|
1059
|
+
className: X.tableWrap,
|
|
918
1060
|
style: { maxHeight: b },
|
|
919
1061
|
children: /* @__PURE__ */ n("table", {
|
|
920
|
-
className:
|
|
1062
|
+
className: X.table,
|
|
921
1063
|
"aria-label": m,
|
|
922
1064
|
children: [
|
|
923
1065
|
p && /* @__PURE__ */ t("caption", { children: p }),
|
|
924
1066
|
/* @__PURE__ */ t("thead", {
|
|
925
|
-
className: y ?
|
|
926
|
-
children:
|
|
1067
|
+
className: y ? X.sticky : "",
|
|
1068
|
+
children: R.getHeaderGroups().map((e) => /* @__PURE__ */ t("tr", { children: e.headers.map((e) => {
|
|
927
1069
|
let r = e.column.getIsSorted(), i = e.column.getCanSort(), a = e.column.getToggleSortingHandler();
|
|
928
1070
|
return /* @__PURE__ */ t("th", {
|
|
929
1071
|
scope: "col",
|
|
930
1072
|
"aria-sort": r === "asc" ? "ascending" : r === "desc" ? "descending" : "none",
|
|
931
1073
|
children: /* @__PURE__ */ n("button", {
|
|
932
1074
|
type: "button",
|
|
933
|
-
className:
|
|
1075
|
+
className: X.sortButton,
|
|
934
1076
|
disabled: !i,
|
|
935
1077
|
onClick: a,
|
|
936
|
-
children: [/* @__PURE__ */ t(
|
|
937
|
-
"
|
|
938
|
-
|
|
1078
|
+
children: [/* @__PURE__ */ t(R.FlexRender, { header: e }), /* @__PURE__ */ t(A, {
|
|
1079
|
+
name: r === "asc" ? "IconSortAscending" : r === "desc" ? "IconSortDescending" : "IconSort",
|
|
1080
|
+
width: 16,
|
|
1081
|
+
height: 16
|
|
939
1082
|
})]
|
|
940
1083
|
})
|
|
941
1084
|
}, e.id);
|
|
942
1085
|
}) }, e.id))
|
|
943
1086
|
}),
|
|
944
1087
|
/* @__PURE__ */ t("tbody", { children: h ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
945
|
-
colSpan:
|
|
946
|
-
children: /* @__PURE__ */ t(
|
|
947
|
-
}) }) :
|
|
948
|
-
className:
|
|
949
|
-
colSpan:
|
|
950
|
-
children:
|
|
951
|
-
}) }) :
|
|
952
|
-
className:
|
|
953
|
-
colSpan:
|
|
1088
|
+
colSpan: F.length,
|
|
1089
|
+
children: /* @__PURE__ */ t(ne, { lines: 3 })
|
|
1090
|
+
}) }) : G ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
1091
|
+
className: X.state,
|
|
1092
|
+
colSpan: F.length,
|
|
1093
|
+
children: G
|
|
1094
|
+
}) }) : H.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
|
|
1095
|
+
className: X.state,
|
|
1096
|
+
colSpan: F.length,
|
|
954
1097
|
children: v
|
|
955
|
-
}) }) :
|
|
956
|
-
className: S ?
|
|
1098
|
+
}) }) : H.map((e) => /* @__PURE__ */ t("tr", {
|
|
1099
|
+
className: S ? X.clickableRow : void 0,
|
|
957
1100
|
onClick: () => S?.(e.original),
|
|
958
1101
|
onKeyDown: (t) => {
|
|
959
1102
|
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), S?.(e.original));
|
|
960
1103
|
},
|
|
961
1104
|
tabIndex: S ? 0 : void 0,
|
|
962
1105
|
role: S ? "button" : void 0,
|
|
963
|
-
children: e.getAllCells().map((e) => /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t(
|
|
1106
|
+
children: e.getAllCells().map((e) => /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t(R.FlexRender, { cell: e }) }, e.id))
|
|
964
1107
|
}, e.id)) })
|
|
965
1108
|
]
|
|
966
1109
|
})
|
|
967
1110
|
}),
|
|
968
1111
|
!i && /* @__PURE__ */ t("div", {
|
|
969
|
-
className:
|
|
1112
|
+
className: X.cards,
|
|
970
1113
|
role: "list",
|
|
971
1114
|
"aria-label": m ?? p,
|
|
972
|
-
children: h ? /* @__PURE__ */ t(
|
|
973
|
-
className:
|
|
974
|
-
children:
|
|
975
|
-
}) :
|
|
976
|
-
className:
|
|
1115
|
+
children: h ? /* @__PURE__ */ t(ne, { lines: 4 }) : G ? /* @__PURE__ */ t("div", {
|
|
1116
|
+
className: X.state,
|
|
1117
|
+
children: G
|
|
1118
|
+
}) : H.length === 0 ? /* @__PURE__ */ t("div", {
|
|
1119
|
+
className: X.state,
|
|
977
1120
|
children: v
|
|
978
|
-
}) :
|
|
1121
|
+
}) : H.map((e) => {
|
|
979
1122
|
if (l) return /* @__PURE__ */ t("div", {
|
|
980
1123
|
role: "listitem",
|
|
981
1124
|
children: l({
|
|
982
1125
|
row: e.original,
|
|
983
|
-
columns:
|
|
1126
|
+
columns: F
|
|
984
1127
|
})
|
|
985
1128
|
}, e.id);
|
|
986
|
-
let r =
|
|
1129
|
+
let r = F.filter((e) => !e.mobile?.hideOnMobile).sort((e, t) => (e.mobile?.mobileOrder ?? 0) - (t.mobile?.mobileOrder ?? 0)), i = r.find((e) => e.mobile?.primary) ?? r.find((e) => e.mobile?.mobileVariant !== "actions"), a = (t) => me(t.accessor, e.original), o = (t) => t.mobile?.renderMobile?.(e.original, a(t)) ?? t.cell?.(e.original, a(t)) ?? String(a(t) ?? "");
|
|
987
1130
|
return /* @__PURE__ */ n("article", {
|
|
988
1131
|
role: "listitem",
|
|
989
|
-
className:
|
|
1132
|
+
className: X.card,
|
|
990
1133
|
children: [
|
|
991
1134
|
/* @__PURE__ */ t("h3", { children: i ? o(i) : `Строка ${e.index + 1}` }),
|
|
992
1135
|
/* @__PURE__ */ t("dl", { children: r.filter((e) => e !== i && e.mobile?.mobileVariant !== "actions").map((e) => /* @__PURE__ */ n("div", {
|
|
993
|
-
className: e.mobile?.mobileSpan === 2 ?
|
|
1136
|
+
className: e.mobile?.mobileSpan === 2 ? X.spanTwo : "",
|
|
994
1137
|
children: [/* @__PURE__ */ t("dt", { children: e.mobile?.mobileLabel ?? e.header }), /* @__PURE__ */ t("dd", { children: o(e) })]
|
|
995
1138
|
}, e.id)) }),
|
|
996
1139
|
r.filter((e) => e.mobile?.mobileVariant === "actions").map((e) => /* @__PURE__ */ t("footer", { children: o(e) }, e.id))
|
|
@@ -999,53 +1142,53 @@ var T = {
|
|
|
999
1142
|
})
|
|
1000
1143
|
}),
|
|
1001
1144
|
te && /* @__PURE__ */ n("nav", {
|
|
1002
|
-
className:
|
|
1145
|
+
className: X.pagination,
|
|
1003
1146
|
"aria-label": "Пагинация таблицы",
|
|
1004
1147
|
children: [/* @__PURE__ */ n("span", {
|
|
1005
|
-
className:
|
|
1148
|
+
className: X.paginationRange,
|
|
1006
1149
|
"aria-live": "polite",
|
|
1007
1150
|
children: [
|
|
1008
|
-
|
|
1151
|
+
K,
|
|
1009
1152
|
"–",
|
|
1010
1153
|
q,
|
|
1011
1154
|
" из ",
|
|
1012
|
-
|
|
1155
|
+
z.length
|
|
1013
1156
|
]
|
|
1014
1157
|
}), /* @__PURE__ */ n("div", {
|
|
1015
|
-
className:
|
|
1158
|
+
className: X.paginationControls,
|
|
1016
1159
|
children: [
|
|
1017
1160
|
/* @__PURE__ */ n(w, {
|
|
1018
1161
|
variant: "empty",
|
|
1019
1162
|
size: "md",
|
|
1020
|
-
disabled:
|
|
1163
|
+
disabled: V === 0,
|
|
1021
1164
|
"aria-label": "Предыдущая страница",
|
|
1022
1165
|
onClick: () => {
|
|
1023
|
-
|
|
1166
|
+
j((e) => Math.max(0, e - 1));
|
|
1024
1167
|
},
|
|
1025
|
-
children: [/* @__PURE__ */ t(
|
|
1026
|
-
name: "
|
|
1168
|
+
children: [/* @__PURE__ */ t(A, {
|
|
1169
|
+
name: "IconChevron",
|
|
1027
1170
|
width: 18,
|
|
1028
1171
|
height: 18,
|
|
1029
|
-
className:
|
|
1172
|
+
className: X.previousIcon
|
|
1030
1173
|
}), /* @__PURE__ */ t("span", {
|
|
1031
|
-
className:
|
|
1174
|
+
className: X.paginationButtonLabel,
|
|
1032
1175
|
children: "Назад"
|
|
1033
1176
|
})]
|
|
1034
1177
|
}),
|
|
1035
1178
|
/* @__PURE__ */ t("div", {
|
|
1036
|
-
className:
|
|
1037
|
-
children:
|
|
1038
|
-
variant: e ===
|
|
1179
|
+
className: X.pageNumbers,
|
|
1180
|
+
children: U.map((e) => typeof e == "number" ? /* @__PURE__ */ t(w, {
|
|
1181
|
+
variant: e === V ? "secondary" : "empty",
|
|
1039
1182
|
size: "md",
|
|
1040
|
-
className:
|
|
1183
|
+
className: X.pageButton,
|
|
1041
1184
|
"aria-label": `Перейти на страницу ${e + 1}`,
|
|
1042
|
-
"aria-current": e ===
|
|
1185
|
+
"aria-current": e === V ? "page" : void 0,
|
|
1043
1186
|
onClick: () => {
|
|
1044
|
-
|
|
1187
|
+
j(e);
|
|
1045
1188
|
},
|
|
1046
1189
|
children: e + 1
|
|
1047
1190
|
}, e) : /* @__PURE__ */ t("span", {
|
|
1048
|
-
className:
|
|
1191
|
+
className: X.ellipsis,
|
|
1049
1192
|
"aria-hidden": "true",
|
|
1050
1193
|
children: "…"
|
|
1051
1194
|
}, e))
|
|
@@ -1053,19 +1196,19 @@ var T = {
|
|
|
1053
1196
|
/* @__PURE__ */ n(w, {
|
|
1054
1197
|
variant: "empty",
|
|
1055
1198
|
size: "md",
|
|
1056
|
-
disabled:
|
|
1199
|
+
disabled: V === B - 1,
|
|
1057
1200
|
"aria-label": "Следующая страница",
|
|
1058
1201
|
onClick: () => {
|
|
1059
|
-
|
|
1202
|
+
j((e) => Math.min(B - 1, e + 1));
|
|
1060
1203
|
},
|
|
1061
1204
|
children: [/* @__PURE__ */ t("span", {
|
|
1062
|
-
className:
|
|
1205
|
+
className: X.paginationButtonLabel,
|
|
1063
1206
|
children: "Вперёд"
|
|
1064
|
-
}), /* @__PURE__ */ t(
|
|
1065
|
-
name: "
|
|
1207
|
+
}), /* @__PURE__ */ t(A, {
|
|
1208
|
+
name: "IconChevron",
|
|
1066
1209
|
width: 18,
|
|
1067
1210
|
height: 18,
|
|
1068
|
-
className:
|
|
1211
|
+
className: X.nextIcon
|
|
1069
1212
|
})]
|
|
1070
1213
|
})
|
|
1071
1214
|
]
|
|
@@ -1080,62 +1223,62 @@ var T = {
|
|
|
1080
1223
|
if (Number.isFinite(t)) return t;
|
|
1081
1224
|
}
|
|
1082
1225
|
return Infinity;
|
|
1083
|
-
}, De = ({ options: e, value: r, onChange: i, placeholder: a = "Выберите опции", disabled: m = !1, stringWhileDisabled: h = !1, label: g, error: _, size: v = "md", required: y = !1, hint: b, className: x = "", name: S, id: C, closeOnSelect: w = !1, needMark: T = !0, maxMenuHeight:
|
|
1084
|
-
let
|
|
1085
|
-
let e =
|
|
1226
|
+
}, De = ({ options: e, value: r, onChange: i, placeholder: a = "Выберите опции", disabled: m = !1, stringWhileDisabled: h = !1, label: g, error: _, size: v = "md", required: y = !1, hint: b, className: x = "", name: S, id: C, closeOnSelect: w = !1, needMark: T = !0, maxMenuHeight: D }) => {
|
|
1227
|
+
let O = c(), k = C ?? `ds-dropdown-multiple-${S ?? O}`, j = `${k}-listbox`, [M, N] = f(!1), [P, F] = f(null), I = d(null), L = d(null), R = d(null), z = d([]), B = u(() => e.filter((e) => r.includes(e.value)), [e, r]).map((e) => e.label).join(", "), V = b ? `${k}-hint` : void 0, H = _ ? `${k}-error` : void 0, ee = [V, H].filter(Boolean).join(" ") || void 0, U = m && h, W = o(() => {
|
|
1228
|
+
let e = L.current, t = R.current;
|
|
1086
1229
|
if (!e || !t) return;
|
|
1087
1230
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerHeight - n.bottom - Ce, a = n.top - Ce, o = i < r.height && a > i, s = Math.max(Te, o ? a : i), c = window.innerWidth - n.width - Ce;
|
|
1088
|
-
|
|
1231
|
+
F({
|
|
1089
1232
|
top: o ? Math.max(Ce, n.top - r.height - we) : n.bottom + we,
|
|
1090
1233
|
left: Math.max(Ce, Math.min(n.left, c)),
|
|
1091
1234
|
width: n.width,
|
|
1092
|
-
maxHeight: Math.min(s, Ee(
|
|
1235
|
+
maxHeight: Math.min(s, Ee(D))
|
|
1093
1236
|
});
|
|
1094
|
-
}, [
|
|
1237
|
+
}, [D]);
|
|
1095
1238
|
l(() => {
|
|
1096
|
-
if (!
|
|
1097
|
-
|
|
1239
|
+
if (!M) {
|
|
1240
|
+
F(null);
|
|
1098
1241
|
return;
|
|
1099
1242
|
}
|
|
1100
|
-
return
|
|
1101
|
-
window.removeEventListener("resize",
|
|
1243
|
+
return W(), window.addEventListener("resize", W), window.addEventListener("scroll", W, !0), () => {
|
|
1244
|
+
window.removeEventListener("resize", W), window.removeEventListener("scroll", W, !0);
|
|
1102
1245
|
};
|
|
1103
1246
|
}, [
|
|
1104
|
-
|
|
1247
|
+
M,
|
|
1105
1248
|
e.length,
|
|
1106
|
-
|
|
1249
|
+
W
|
|
1107
1250
|
]), s(() => {
|
|
1108
|
-
if (!
|
|
1251
|
+
if (!M) return;
|
|
1109
1252
|
let e = (e) => {
|
|
1110
1253
|
let t = e.target;
|
|
1111
|
-
!
|
|
1254
|
+
!I.current?.contains(t) && !R.current?.contains(t) && N(!1);
|
|
1112
1255
|
}, t = (e) => {
|
|
1113
|
-
e.key === "Escape" && (
|
|
1256
|
+
e.key === "Escape" && (N(!1), L.current?.focus());
|
|
1114
1257
|
};
|
|
1115
1258
|
return document.addEventListener("pointerdown", e), document.addEventListener("keydown", t), () => {
|
|
1116
1259
|
document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
|
|
1117
1260
|
};
|
|
1118
|
-
}, [
|
|
1119
|
-
let
|
|
1120
|
-
let r =
|
|
1121
|
-
r !== -1 && (
|
|
1261
|
+
}, [M]);
|
|
1262
|
+
let G = (t, n) => {
|
|
1263
|
+
let r = oe(e, t, n);
|
|
1264
|
+
r !== -1 && (z.current[r]?.focus(), z.current[r]?.scrollIntoView({ block: "nearest" }));
|
|
1122
1265
|
}, te = (t) => {
|
|
1123
1266
|
if (t.disabled) return;
|
|
1124
1267
|
let n = r.includes(t.value) ? r.filter((e) => e !== t.value) : [...r, t.value];
|
|
1125
|
-
i?.(n, e.filter((e) => n.includes(e.value))), w && (
|
|
1126
|
-
},
|
|
1127
|
-
ref:
|
|
1128
|
-
id:
|
|
1129
|
-
className:
|
|
1268
|
+
i?.(n, e.filter((e) => n.includes(e.value))), w && (N(!1), L.current?.focus());
|
|
1269
|
+
}, K = M ? /* @__PURE__ */ t("ul", {
|
|
1270
|
+
ref: R,
|
|
1271
|
+
id: j,
|
|
1272
|
+
className: Y.menu,
|
|
1130
1273
|
role: "listbox",
|
|
1131
1274
|
"aria-label": g,
|
|
1132
1275
|
"aria-multiselectable": "true",
|
|
1133
|
-
style:
|
|
1276
|
+
style: P ? {
|
|
1134
1277
|
position: "fixed",
|
|
1135
|
-
top:
|
|
1136
|
-
left:
|
|
1137
|
-
width:
|
|
1138
|
-
maxHeight:
|
|
1278
|
+
top: P.top,
|
|
1279
|
+
left: P.left,
|
|
1280
|
+
width: P.width,
|
|
1281
|
+
maxHeight: P.maxHeight
|
|
1139
1282
|
} : {
|
|
1140
1283
|
position: "fixed",
|
|
1141
1284
|
top: 0,
|
|
@@ -1149,156 +1292,151 @@ var T = {
|
|
|
1149
1292
|
role: "presentation",
|
|
1150
1293
|
children: /* @__PURE__ */ n("button", {
|
|
1151
1294
|
ref: (e) => {
|
|
1152
|
-
|
|
1295
|
+
z.current[a] = e;
|
|
1153
1296
|
},
|
|
1154
1297
|
type: "button",
|
|
1155
1298
|
role: "option",
|
|
1156
1299
|
"aria-selected": o,
|
|
1157
1300
|
disabled: i.disabled,
|
|
1158
1301
|
className: [
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
o ?
|
|
1302
|
+
Y[v],
|
|
1303
|
+
Y.option,
|
|
1304
|
+
o ? Y.selected : ""
|
|
1162
1305
|
].filter(Boolean).join(" "),
|
|
1163
1306
|
onClick: () => te(i),
|
|
1164
1307
|
onKeyDown: (t) => {
|
|
1165
1308
|
if (t.key === "ArrowDown" || t.key === "ArrowUp") {
|
|
1166
1309
|
t.preventDefault();
|
|
1167
1310
|
let e = t.key === "ArrowDown" ? 1 : -1;
|
|
1168
|
-
|
|
1311
|
+
G(a + e, e);
|
|
1169
1312
|
}
|
|
1170
1313
|
if (t.key === "Home" || t.key === "End") {
|
|
1171
1314
|
t.preventDefault();
|
|
1172
1315
|
let n = t.key === "Home" ? 1 : -1;
|
|
1173
|
-
|
|
1316
|
+
G(t.key === "Home" ? 0 : e.length - 1, n);
|
|
1174
1317
|
}
|
|
1175
|
-
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), te(i)), t.key === "Tab" &&
|
|
1318
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), te(i)), t.key === "Tab" && N(!1);
|
|
1176
1319
|
},
|
|
1177
|
-
children: [/* @__PURE__ */ t("span", { children: i.label }), o && T && /* @__PURE__ */ t(
|
|
1178
|
-
|
|
1179
|
-
|
|
1320
|
+
children: [/* @__PURE__ */ t("span", { children: i.label }), o && T && /* @__PURE__ */ t(A, {
|
|
1321
|
+
name: "IconCheck",
|
|
1322
|
+
width: 16,
|
|
1323
|
+
height: 16
|
|
1180
1324
|
})]
|
|
1181
1325
|
})
|
|
1182
1326
|
}, i.value);
|
|
1183
1327
|
})
|
|
1184
1328
|
}) : null;
|
|
1185
1329
|
return /* @__PURE__ */ n("div", {
|
|
1186
|
-
ref:
|
|
1330
|
+
ref: I,
|
|
1187
1331
|
className: [
|
|
1188
|
-
|
|
1189
|
-
_ ?
|
|
1332
|
+
Y.wrapper,
|
|
1333
|
+
_ ? Y.errorState : "",
|
|
1190
1334
|
x
|
|
1191
1335
|
].filter(Boolean).join(" "),
|
|
1192
1336
|
children: [
|
|
1193
|
-
g && /* @__PURE__ */ t(
|
|
1194
|
-
htmlFor:
|
|
1337
|
+
g && /* @__PURE__ */ t(E, {
|
|
1338
|
+
htmlFor: U ? void 0 : k,
|
|
1195
1339
|
required: y,
|
|
1196
1340
|
disabled: m,
|
|
1197
1341
|
children: g
|
|
1198
1342
|
}),
|
|
1199
1343
|
/* @__PURE__ */ t("div", {
|
|
1200
|
-
className:
|
|
1201
|
-
children:
|
|
1202
|
-
id:
|
|
1203
|
-
className: `${
|
|
1204
|
-
"aria-describedby":
|
|
1205
|
-
children:
|
|
1344
|
+
className: Y.container,
|
|
1345
|
+
children: U ? /* @__PURE__ */ t("div", {
|
|
1346
|
+
id: k,
|
|
1347
|
+
className: `${Y.disabledText} ${Y[v]}`,
|
|
1348
|
+
"aria-describedby": ee,
|
|
1349
|
+
children: B || a
|
|
1206
1350
|
}) : /* @__PURE__ */ n("button", {
|
|
1207
|
-
ref:
|
|
1208
|
-
id:
|
|
1351
|
+
ref: L,
|
|
1352
|
+
id: k,
|
|
1209
1353
|
type: "button",
|
|
1210
1354
|
name: S,
|
|
1211
|
-
className: `${
|
|
1355
|
+
className: `${Y.trigger} ${Y[v]}`,
|
|
1212
1356
|
disabled: m,
|
|
1213
1357
|
"aria-haspopup": "listbox",
|
|
1214
|
-
"aria-expanded":
|
|
1215
|
-
"aria-controls":
|
|
1216
|
-
"aria-describedby":
|
|
1358
|
+
"aria-expanded": M,
|
|
1359
|
+
"aria-controls": j,
|
|
1360
|
+
"aria-describedby": ee,
|
|
1217
1361
|
"aria-invalid": !!_,
|
|
1218
|
-
onClick: () =>
|
|
1362
|
+
onClick: () => N((e) => !e),
|
|
1219
1363
|
onKeyDown: (t) => {
|
|
1220
1364
|
if (t.key === "ArrowDown" || t.key === "ArrowUp") {
|
|
1221
|
-
t.preventDefault(),
|
|
1365
|
+
t.preventDefault(), N(!0);
|
|
1222
1366
|
let n = t.key === "ArrowDown" ? 1 : -1;
|
|
1223
|
-
requestAnimationFrame(() =>
|
|
1367
|
+
requestAnimationFrame(() => G(t.key === "ArrowDown" ? 0 : e.length - 1, n));
|
|
1224
1368
|
}
|
|
1225
1369
|
},
|
|
1226
1370
|
children: [/* @__PURE__ */ t("span", {
|
|
1227
|
-
className: `${
|
|
1228
|
-
children:
|
|
1371
|
+
className: `${B ? Y.value : Y.placeholder} ${Y[v]}`,
|
|
1372
|
+
children: B || a
|
|
1229
1373
|
}), /* @__PURE__ */ t("span", {
|
|
1230
|
-
className: [
|
|
1374
|
+
className: [Y.chevron, M ? Y.chevronOpen : ""].filter(Boolean).join(" "),
|
|
1231
1375
|
"aria-hidden": "true",
|
|
1232
|
-
children: /* @__PURE__ */ t(
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
d: "M5 7.5L10 12.5L15 7.5",
|
|
1237
|
-
stroke: "currentColor",
|
|
1238
|
-
strokeWidth: "1.8",
|
|
1239
|
-
strokeLinecap: "round",
|
|
1240
|
-
strokeLinejoin: "round"
|
|
1241
|
-
})
|
|
1376
|
+
children: /* @__PURE__ */ t(A, {
|
|
1377
|
+
name: "IconChevron",
|
|
1378
|
+
width: 20,
|
|
1379
|
+
height: 20
|
|
1242
1380
|
})
|
|
1243
1381
|
})]
|
|
1244
1382
|
})
|
|
1245
1383
|
}),
|
|
1246
|
-
|
|
1384
|
+
M && p(K, document.body),
|
|
1247
1385
|
b && !_ && /* @__PURE__ */ t("span", {
|
|
1248
|
-
id:
|
|
1249
|
-
className:
|
|
1386
|
+
id: V,
|
|
1387
|
+
className: Y.message,
|
|
1250
1388
|
children: b
|
|
1251
1389
|
}),
|
|
1252
1390
|
_ && /* @__PURE__ */ t("span", {
|
|
1253
|
-
id:
|
|
1254
|
-
className:
|
|
1391
|
+
id: H,
|
|
1392
|
+
className: Y.error,
|
|
1255
1393
|
children: _
|
|
1256
1394
|
})
|
|
1257
1395
|
]
|
|
1258
1396
|
});
|
|
1259
1397
|
}, Oe = {
|
|
1260
|
-
wrapper: "
|
|
1261
|
-
control: "
|
|
1262
|
-
input: "
|
|
1263
|
-
disabledText: "
|
|
1264
|
-
sm: "
|
|
1265
|
-
md: "
|
|
1266
|
-
lg: "
|
|
1267
|
-
inputError: "
|
|
1268
|
-
trailingAction: "
|
|
1269
|
-
}, ke = ({ value: e, onChange: r, type: i = "text", placeholder: a = "", disabled: o = !1, readOnly: l = !1, stringWhileDisabled: u = !1, label: p, error: m, hint: h, className: g = "", name: _, id: v, size: y = "md", clearable: b = !0, required: x = !1, selectTextOnFocus: S = !1, isPassword: C = !1, passwordVisibleLabel: w = "Скрыть пароль", passwordHiddenLabel: T = "Показать пароль", onFocus:
|
|
1270
|
-
let
|
|
1398
|
+
wrapper: "_wrapper_yuep3_1",
|
|
1399
|
+
control: "_control_yuep3_3",
|
|
1400
|
+
input: "_input_yuep3_7",
|
|
1401
|
+
disabledText: "_disabledText_yuep3_7",
|
|
1402
|
+
sm: "_sm_yuep3_45",
|
|
1403
|
+
md: "_md_yuep3_57",
|
|
1404
|
+
lg: "_lg_yuep3_69",
|
|
1405
|
+
inputError: "_inputError_yuep3_81",
|
|
1406
|
+
trailingAction: "_trailingAction_yuep3_83"
|
|
1407
|
+
}, ke = ({ value: e, onChange: r, type: i = "text", placeholder: a = "", disabled: o = !1, readOnly: l = !1, stringWhileDisabled: u = !1, label: p, error: m, hint: h, className: g = "", name: _, id: v, size: y = "md", clearable: b = !0, required: x = !1, selectTextOnFocus: S = !1, isPassword: C = !1, passwordVisibleLabel: w = "Скрыть пароль", passwordHiddenLabel: T = "Показать пароль", onFocus: O, ...k }) => {
|
|
1408
|
+
let j = c(), M = v ?? `ds-input-${_ ?? j}`, N = d(null), [P, F] = f(!1), I = h ? `${M}-hint` : void 0, L = m ? `${M}-error` : void 0, R = String(e ?? ""), z = [I, L].filter(Boolean).join(" ") || void 0, B = C ? P ? "text" : "password" : i;
|
|
1271
1409
|
return s(() => {
|
|
1272
|
-
C ||
|
|
1410
|
+
C || F(!1);
|
|
1273
1411
|
}, [C]), /* @__PURE__ */ n("div", {
|
|
1274
1412
|
className: `${Oe.wrapper} ${g}`,
|
|
1275
1413
|
children: [
|
|
1276
|
-
p && /* @__PURE__ */ t(
|
|
1277
|
-
htmlFor:
|
|
1414
|
+
p && /* @__PURE__ */ t(E, {
|
|
1415
|
+
htmlFor: M,
|
|
1278
1416
|
required: x,
|
|
1279
1417
|
disabled: o,
|
|
1280
1418
|
children: p
|
|
1281
1419
|
}),
|
|
1282
1420
|
o && u ? /* @__PURE__ */ t("div", {
|
|
1283
|
-
id:
|
|
1421
|
+
id: M,
|
|
1284
1422
|
className: Oe.disabledText,
|
|
1285
|
-
"aria-describedby":
|
|
1286
|
-
children:
|
|
1423
|
+
"aria-describedby": z,
|
|
1424
|
+
children: R || a
|
|
1287
1425
|
}) : /* @__PURE__ */ n("div", {
|
|
1288
1426
|
className: Oe.control,
|
|
1289
1427
|
children: [
|
|
1290
1428
|
/* @__PURE__ */ t("input", {
|
|
1291
|
-
ref:
|
|
1292
|
-
id:
|
|
1429
|
+
ref: N,
|
|
1430
|
+
id: M,
|
|
1293
1431
|
name: _,
|
|
1294
|
-
type:
|
|
1295
|
-
value:
|
|
1432
|
+
type: B,
|
|
1433
|
+
value: R,
|
|
1296
1434
|
placeholder: a,
|
|
1297
1435
|
disabled: o,
|
|
1298
1436
|
readOnly: l,
|
|
1299
1437
|
required: x,
|
|
1300
1438
|
"aria-invalid": !!m,
|
|
1301
|
-
"aria-describedby":
|
|
1439
|
+
"aria-describedby": z,
|
|
1302
1440
|
className: `${Oe.input} ${Oe[y]} ${m ? Oe.inputError : ""}`,
|
|
1303
1441
|
onChange: (e) => {
|
|
1304
1442
|
if (i === "number" && !C) {
|
|
@@ -1309,49 +1447,45 @@ var T = {
|
|
|
1309
1447
|
r?.(e.target.value, e);
|
|
1310
1448
|
},
|
|
1311
1449
|
onFocus: (e) => {
|
|
1312
|
-
S && e.currentTarget.value && e.currentTarget.select(),
|
|
1450
|
+
S && e.currentTarget.value && e.currentTarget.select(), O?.(e);
|
|
1313
1451
|
},
|
|
1314
|
-
...
|
|
1452
|
+
...k
|
|
1315
1453
|
}),
|
|
1316
1454
|
C && /* @__PURE__ */ t("button", {
|
|
1317
1455
|
type: "button",
|
|
1318
1456
|
className: Oe.trailingAction,
|
|
1319
1457
|
disabled: o,
|
|
1320
|
-
"aria-label":
|
|
1321
|
-
"aria-pressed":
|
|
1322
|
-
onClick: () =>
|
|
1323
|
-
children:
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
}) : /* @__PURE__ */ n("svg", {
|
|
1328
|
-
viewBox: "0 0 24 24",
|
|
1329
|
-
"aria-hidden": "true",
|
|
1330
|
-
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", {
|
|
1331
|
-
cx: "12",
|
|
1332
|
-
cy: "12",
|
|
1333
|
-
r: "2.5"
|
|
1334
|
-
})]
|
|
1458
|
+
"aria-label": P ? w : T,
|
|
1459
|
+
"aria-pressed": P,
|
|
1460
|
+
onClick: () => F((e) => !e),
|
|
1461
|
+
children: /* @__PURE__ */ t(A, {
|
|
1462
|
+
name: P ? "IconEyeOff" : "IconEye",
|
|
1463
|
+
width: 20,
|
|
1464
|
+
height: 20
|
|
1335
1465
|
})
|
|
1336
1466
|
}),
|
|
1337
|
-
!C && b &&
|
|
1467
|
+
!C && b && R && !o && !l && /* @__PURE__ */ t("button", {
|
|
1338
1468
|
type: "button",
|
|
1339
1469
|
className: Oe.trailingAction,
|
|
1340
1470
|
"aria-label": "Очистить поле",
|
|
1341
1471
|
onClick: () => {
|
|
1342
|
-
let e =
|
|
1472
|
+
let e = N.current;
|
|
1343
1473
|
e && ((Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set)?.call(e, ""), e.dispatchEvent(new Event("input", { bubbles: !0 })), e.focus());
|
|
1344
1474
|
},
|
|
1345
|
-
children:
|
|
1475
|
+
children: /* @__PURE__ */ t(A, {
|
|
1476
|
+
name: "IconCross",
|
|
1477
|
+
width: 20,
|
|
1478
|
+
height: 20
|
|
1479
|
+
})
|
|
1346
1480
|
})
|
|
1347
1481
|
]
|
|
1348
1482
|
}),
|
|
1349
|
-
h && !m && /* @__PURE__ */ t(
|
|
1350
|
-
id:
|
|
1483
|
+
h && !m && /* @__PURE__ */ t(D, {
|
|
1484
|
+
id: I,
|
|
1351
1485
|
children: h
|
|
1352
1486
|
}),
|
|
1353
|
-
m && /* @__PURE__ */ t(
|
|
1354
|
-
id:
|
|
1487
|
+
m && /* @__PURE__ */ t(D, {
|
|
1488
|
+
id: L,
|
|
1355
1489
|
variant: "error",
|
|
1356
1490
|
children: m
|
|
1357
1491
|
})
|
|
@@ -1367,7 +1501,7 @@ var T = {
|
|
|
1367
1501
|
if (!e[i]?.disabled) return i;
|
|
1368
1502
|
}
|
|
1369
1503
|
return -1;
|
|
1370
|
-
},
|
|
1504
|
+
}, Z = {
|
|
1371
1505
|
wrapper: "_wrapper_1uxs8_1",
|
|
1372
1506
|
control: "_control_1uxs8_5",
|
|
1373
1507
|
inputHost: "_inputHost_1uxs8_9",
|
|
@@ -1388,19 +1522,19 @@ var T = {
|
|
|
1388
1522
|
sm: 20,
|
|
1389
1523
|
md: 30,
|
|
1390
1524
|
lg: 40
|
|
1391
|
-
}, Ie = ({ options: e, value: r, onChange: i, placeholder: a = "Начните вводить", noResultsText: m = "Ничего не найдено", disabled: h = !1, readOnly: g = !1, stringWhileDisabled: _ = !1, label: v, error: y, hint: b, size: x = "md", required: S = !1, className: C = "", name: w, id: T, needMark:
|
|
1392
|
-
let
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
].filter(Boolean).join(" "),
|
|
1397
|
-
s(() =>
|
|
1398
|
-
let
|
|
1399
|
-
|
|
1525
|
+
}, Ie = ({ options: e, value: r, onChange: i, placeholder: a = "Начните вводить", noResultsText: m = "Ничего не найдено", disabled: h = !1, readOnly: g = !1, stringWhileDisabled: _ = !1, label: v, error: y, hint: b, size: x = "md", required: S = !1, className: C = "", name: w, id: T, needMark: O = !0 }) => {
|
|
1526
|
+
let k = c(), j = T ?? `ds-search-dropdown-${w ?? k}`, M = `${j}-listbox`, N = `${j}-status`, P = b ? `${j}-hint` : void 0, F = y ? `${j}-error` : void 0, I = [
|
|
1527
|
+
N,
|
|
1528
|
+
P,
|
|
1529
|
+
F
|
|
1530
|
+
].filter(Boolean).join(" "), L = d(null), R = d(null), z = d([]), [B, V] = f(!1), [H, ee] = f(""), [U, W] = f(-1), [G, te] = f(null), K = u(() => e.find((e) => e.value === r), [e, r]), q = u(() => Ae(e, H), [e, H]), J = h && _, ne = U >= 0 ? q[U] : void 0;
|
|
1531
|
+
s(() => ee(K?.label ?? ""), [K?.label, r]);
|
|
1532
|
+
let Y = o(() => L.current?.querySelector("input") ?? null, []), re = o((e, t) => je(q, e, t), [q]), ie = o((e) => {
|
|
1533
|
+
W(e), !(e < 0) && requestAnimationFrame(() => z.current[e]?.scrollIntoView({ block: "nearest" }));
|
|
1400
1534
|
}, []), ae = o(() => {
|
|
1401
|
-
let e =
|
|
1535
|
+
let e = Y();
|
|
1402
1536
|
if (!e) return;
|
|
1403
|
-
let t = e.getBoundingClientRect(), n = Math.max(1, Math.min(
|
|
1537
|
+
let t = e.getBoundingClientRect(), n = Math.max(1, Math.min(q.length, Pe)) * Fe[x] + 2, r = window.innerHeight - t.bottom - Me, i = t.top - Me, a = r < n && i > r, o = a ? i : r, s = Math.max(Fe[x] + 2, Math.min(n, o)), c = window.innerWidth - t.width - Me, l = Math.max(Me, Math.min(t.left, c)), u = a ? Math.max(Me, t.top - s - Ne) : t.bottom + Ne;
|
|
1404
1538
|
te({
|
|
1405
1539
|
top: u,
|
|
1406
1540
|
left: l,
|
|
@@ -1408,59 +1542,59 @@ var T = {
|
|
|
1408
1542
|
maxHeight: s
|
|
1409
1543
|
});
|
|
1410
1544
|
}, [
|
|
1411
|
-
|
|
1412
|
-
|
|
1545
|
+
q.length,
|
|
1546
|
+
Y,
|
|
1413
1547
|
x
|
|
1414
1548
|
]);
|
|
1415
1549
|
l(() => {
|
|
1416
|
-
if (!
|
|
1550
|
+
if (!B) {
|
|
1417
1551
|
te(null);
|
|
1418
1552
|
return;
|
|
1419
1553
|
}
|
|
1420
1554
|
return ae(), window.addEventListener("resize", ae), window.addEventListener("scroll", ae, !0), () => {
|
|
1421
1555
|
window.removeEventListener("resize", ae), window.removeEventListener("scroll", ae, !0);
|
|
1422
1556
|
};
|
|
1423
|
-
}, [
|
|
1424
|
-
if (!
|
|
1557
|
+
}, [B, ae]), s(() => {
|
|
1558
|
+
if (!B) return;
|
|
1425
1559
|
let e = (e) => {
|
|
1426
1560
|
let t = e.target;
|
|
1427
|
-
!
|
|
1561
|
+
!L.current?.contains(t) && !R.current?.contains(t) && (V(!1), W(-1));
|
|
1428
1562
|
};
|
|
1429
1563
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
1430
|
-
}, [
|
|
1564
|
+
}, [B]);
|
|
1431
1565
|
let oe = () => {
|
|
1432
|
-
h || g || (
|
|
1566
|
+
h || g || (V(!0), W(re(0, 1)));
|
|
1433
1567
|
}, se = (e) => {
|
|
1434
|
-
e.disabled || (
|
|
1435
|
-
}, ce =
|
|
1436
|
-
ref:
|
|
1437
|
-
id:
|
|
1438
|
-
className:
|
|
1568
|
+
e.disabled || (ee(e.label), V(!1), W(-1), i?.(e.value, e), Y()?.focus());
|
|
1569
|
+
}, ce = B ? /* @__PURE__ */ t("ul", {
|
|
1570
|
+
ref: R,
|
|
1571
|
+
id: M,
|
|
1572
|
+
className: Z.menu,
|
|
1439
1573
|
role: "listbox",
|
|
1440
1574
|
"aria-label": v,
|
|
1441
|
-
style:
|
|
1442
|
-
top:
|
|
1443
|
-
left:
|
|
1444
|
-
width:
|
|
1445
|
-
maxHeight:
|
|
1575
|
+
style: G ? {
|
|
1576
|
+
top: G.top,
|
|
1577
|
+
left: G.left,
|
|
1578
|
+
width: G.width,
|
|
1579
|
+
maxHeight: G.maxHeight
|
|
1446
1580
|
} : {
|
|
1447
1581
|
top: 0,
|
|
1448
1582
|
left: 0,
|
|
1449
1583
|
visibility: "hidden",
|
|
1450
1584
|
maxHeight: 0
|
|
1451
1585
|
},
|
|
1452
|
-
children:
|
|
1453
|
-
className: `${
|
|
1586
|
+
children: q.length === 0 ? /* @__PURE__ */ t("li", {
|
|
1587
|
+
className: `${Z.empty} ${Z[x]}`,
|
|
1454
1588
|
children: m
|
|
1455
|
-
}) :
|
|
1456
|
-
let a = e.value === r, o = i ===
|
|
1589
|
+
}) : q.map((e, i) => {
|
|
1590
|
+
let a = e.value === r, o = i === U;
|
|
1457
1591
|
return /* @__PURE__ */ t("li", {
|
|
1458
1592
|
role: "presentation",
|
|
1459
1593
|
children: /* @__PURE__ */ n("button", {
|
|
1460
1594
|
ref: (e) => {
|
|
1461
|
-
|
|
1595
|
+
z.current[i] = e;
|
|
1462
1596
|
},
|
|
1463
|
-
id: `${
|
|
1597
|
+
id: `${j}-option-${i}`,
|
|
1464
1598
|
type: "button",
|
|
1465
1599
|
role: "option",
|
|
1466
1600
|
tabIndex: -1,
|
|
@@ -1468,46 +1602,47 @@ var T = {
|
|
|
1468
1602
|
"aria-disabled": e.disabled,
|
|
1469
1603
|
"aria-selected": a,
|
|
1470
1604
|
className: [
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
a ?
|
|
1474
|
-
o ?
|
|
1605
|
+
Z.option,
|
|
1606
|
+
Z[x],
|
|
1607
|
+
a ? Z.selected : "",
|
|
1608
|
+
o ? Z.active : ""
|
|
1475
1609
|
].filter(Boolean).join(" "),
|
|
1476
1610
|
onPointerMove: () => {
|
|
1477
|
-
e.disabled ||
|
|
1611
|
+
e.disabled || W(i);
|
|
1478
1612
|
},
|
|
1479
1613
|
onClick: () => se(e),
|
|
1480
|
-
children: [/* @__PURE__ */ t("span", { children: e.label }), a &&
|
|
1481
|
-
|
|
1482
|
-
|
|
1614
|
+
children: [/* @__PURE__ */ t("span", { children: e.label }), a && O && /* @__PURE__ */ t(A, {
|
|
1615
|
+
name: "IconCheck",
|
|
1616
|
+
width: 16,
|
|
1617
|
+
height: 16
|
|
1483
1618
|
})]
|
|
1484
1619
|
})
|
|
1485
1620
|
}, e.value);
|
|
1486
1621
|
})
|
|
1487
1622
|
}) : null;
|
|
1488
1623
|
return /* @__PURE__ */ n("div", {
|
|
1489
|
-
ref:
|
|
1624
|
+
ref: L,
|
|
1490
1625
|
className: [
|
|
1491
|
-
|
|
1492
|
-
y ?
|
|
1626
|
+
Z.wrapper,
|
|
1627
|
+
y ? Z.errorState : "",
|
|
1493
1628
|
C
|
|
1494
1629
|
].filter(Boolean).join(" "),
|
|
1495
1630
|
children: [
|
|
1496
|
-
v && /* @__PURE__ */ t(
|
|
1497
|
-
htmlFor:
|
|
1631
|
+
v && /* @__PURE__ */ t(E, {
|
|
1632
|
+
htmlFor: J ? void 0 : j,
|
|
1498
1633
|
required: S,
|
|
1499
1634
|
disabled: h,
|
|
1500
1635
|
children: v
|
|
1501
1636
|
}),
|
|
1502
|
-
|
|
1503
|
-
className: `${
|
|
1504
|
-
children:
|
|
1637
|
+
J ? /* @__PURE__ */ t("div", {
|
|
1638
|
+
className: `${Z.disabledText} ${Z[x]}`,
|
|
1639
|
+
children: K?.label ?? a
|
|
1505
1640
|
}) : /* @__PURE__ */ n("div", {
|
|
1506
|
-
className:
|
|
1641
|
+
className: Z.control,
|
|
1507
1642
|
children: [/* @__PURE__ */ t(ke, {
|
|
1508
|
-
id:
|
|
1643
|
+
id: j,
|
|
1509
1644
|
name: w,
|
|
1510
|
-
value:
|
|
1645
|
+
value: H,
|
|
1511
1646
|
placeholder: a,
|
|
1512
1647
|
disabled: h,
|
|
1513
1648
|
readOnly: g,
|
|
@@ -1515,74 +1650,68 @@ var T = {
|
|
|
1515
1650
|
size: x,
|
|
1516
1651
|
clearable: !1,
|
|
1517
1652
|
autoComplete: "off",
|
|
1518
|
-
className: `${
|
|
1653
|
+
className: `${Z.inputHost} ${Z[x]}`,
|
|
1519
1654
|
onFocus: oe,
|
|
1520
1655
|
onChange: (t) => {
|
|
1521
1656
|
let n = String(t), r = Ae(e, n);
|
|
1522
|
-
|
|
1657
|
+
ee(n), V(!0), W(je(r, 0, 1));
|
|
1523
1658
|
},
|
|
1524
1659
|
role: "combobox",
|
|
1525
1660
|
"aria-autocomplete": "list",
|
|
1526
|
-
"aria-expanded":
|
|
1527
|
-
"aria-controls":
|
|
1528
|
-
"aria-activedescendant":
|
|
1661
|
+
"aria-expanded": B,
|
|
1662
|
+
"aria-controls": M,
|
|
1663
|
+
"aria-activedescendant": ne ? `${j}-option-${U}` : void 0,
|
|
1529
1664
|
"aria-invalid": !!y,
|
|
1530
|
-
"aria-describedby":
|
|
1665
|
+
"aria-describedby": I,
|
|
1531
1666
|
onClick: oe,
|
|
1532
1667
|
onKeyDown: (e) => {
|
|
1533
1668
|
if (!(h || g)) {
|
|
1534
1669
|
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
1535
1670
|
e.preventDefault();
|
|
1536
|
-
let t = e.key === "ArrowDown" ? 1 : -1, n =
|
|
1537
|
-
|
|
1671
|
+
let t = e.key === "ArrowDown" ? 1 : -1, n = U >= 0 ? U + t : t === 1 ? 0 : q.length - 1;
|
|
1672
|
+
V(!0), ie(re(n, t));
|
|
1538
1673
|
} else if (e.key === "Home" || e.key === "End") {
|
|
1539
|
-
if (!
|
|
1674
|
+
if (!B) return;
|
|
1540
1675
|
e.preventDefault();
|
|
1541
1676
|
let t = e.key === "Home" ? 1 : -1;
|
|
1542
|
-
ie(re(e.key === "Home" ? 0 :
|
|
1543
|
-
} else e.key === "Enter" &&
|
|
1677
|
+
ie(re(e.key === "Home" ? 0 : q.length - 1, t));
|
|
1678
|
+
} else e.key === "Enter" && B && ne ? (e.preventDefault(), se(ne)) : e.key === "Escape" && B ? (e.preventDefault(), V(!1), W(-1)) : e.key === "Tab" && (V(!1), W(-1));
|
|
1544
1679
|
}
|
|
1545
1680
|
}
|
|
1546
1681
|
}), /* @__PURE__ */ t("span", {
|
|
1547
|
-
className: `${
|
|
1682
|
+
className: `${Z.chevron} ${B ? Z.chevronOpen : ""}`,
|
|
1548
1683
|
"aria-hidden": "true",
|
|
1549
|
-
children: /* @__PURE__ */ t(
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
d: "M5 7.5L10 12.5L15 7.5",
|
|
1554
|
-
stroke: "currentColor",
|
|
1555
|
-
strokeWidth: "1.8",
|
|
1556
|
-
strokeLinecap: "round",
|
|
1557
|
-
strokeLinejoin: "round"
|
|
1558
|
-
})
|
|
1684
|
+
children: /* @__PURE__ */ t(A, {
|
|
1685
|
+
name: "IconChevron",
|
|
1686
|
+
width: 20,
|
|
1687
|
+
height: 20
|
|
1559
1688
|
})
|
|
1560
1689
|
})]
|
|
1561
1690
|
}),
|
|
1562
|
-
|
|
1691
|
+
B && typeof document < "u" && p(ce, document.body),
|
|
1563
1692
|
/* @__PURE__ */ n("span", {
|
|
1564
|
-
id:
|
|
1565
|
-
className:
|
|
1693
|
+
id: N,
|
|
1694
|
+
className: Z.visuallyHidden,
|
|
1566
1695
|
"aria-live": "polite",
|
|
1567
|
-
children: ["Найдено вариантов: ",
|
|
1696
|
+
children: ["Найдено вариантов: ", q.length]
|
|
1568
1697
|
}),
|
|
1569
|
-
b && !y && /* @__PURE__ */ t(
|
|
1570
|
-
id:
|
|
1698
|
+
b && !y && /* @__PURE__ */ t(D, {
|
|
1699
|
+
id: P,
|
|
1571
1700
|
children: b
|
|
1572
1701
|
}),
|
|
1573
|
-
y && /* @__PURE__ */ t(
|
|
1574
|
-
id:
|
|
1702
|
+
y && /* @__PURE__ */ t(D, {
|
|
1703
|
+
id: F,
|
|
1575
1704
|
variant: "error",
|
|
1576
1705
|
children: y
|
|
1577
1706
|
})
|
|
1578
1707
|
]
|
|
1579
1708
|
});
|
|
1580
1709
|
}, Le = {
|
|
1581
|
-
root: "
|
|
1582
|
-
header: "
|
|
1583
|
-
title: "
|
|
1584
|
-
dismiss: "
|
|
1585
|
-
content: "
|
|
1710
|
+
root: "_root_1gjqg_1",
|
|
1711
|
+
header: "_header_1gjqg_21",
|
|
1712
|
+
title: "_title_1gjqg_41",
|
|
1713
|
+
dismiss: "_dismiss_1gjqg_55",
|
|
1714
|
+
content: "_content_1gjqg_65"
|
|
1586
1715
|
}, Re = ({ title: e, children: r, dismissible: i = !1, onDismiss: a, dismissLabel: o = "Закрыть информационный блок", headingAs: s = "h3", className: l = "" }) => {
|
|
1587
1716
|
let u = `ds-info-block-${c()}`;
|
|
1588
1717
|
return /* @__PURE__ */ n("section", {
|
|
@@ -1594,21 +1723,15 @@ var T = {
|
|
|
1594
1723
|
id: u,
|
|
1595
1724
|
className: Le.title,
|
|
1596
1725
|
children: e
|
|
1597
|
-
}), i && /* @__PURE__ */ t(
|
|
1598
|
-
type: "button",
|
|
1726
|
+
}), i && /* @__PURE__ */ t(w, {
|
|
1599
1727
|
className: Le.dismiss,
|
|
1728
|
+
variant: "empty",
|
|
1600
1729
|
onClick: a,
|
|
1601
1730
|
"aria-label": o,
|
|
1602
|
-
children: /* @__PURE__ */ t(
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
d: "M5 5L15 15M15 5L5 15",
|
|
1607
|
-
fill: "none",
|
|
1608
|
-
stroke: "currentColor",
|
|
1609
|
-
strokeWidth: "1.8",
|
|
1610
|
-
strokeLinecap: "round"
|
|
1611
|
-
})
|
|
1731
|
+
children: /* @__PURE__ */ t(A, {
|
|
1732
|
+
name: "IconCross",
|
|
1733
|
+
width: 20,
|
|
1734
|
+
height: 20
|
|
1612
1735
|
})
|
|
1613
1736
|
})]
|
|
1614
1737
|
}), /* @__PURE__ */ t("div", {
|
|
@@ -1655,9 +1778,9 @@ var T = {
|
|
|
1655
1778
|
]
|
|
1656
1779
|
});
|
|
1657
1780
|
}, Ve = {
|
|
1658
|
-
root: "
|
|
1659
|
-
grid: "
|
|
1660
|
-
actions: "
|
|
1781
|
+
root: "_root_13nj5_1",
|
|
1782
|
+
grid: "_grid_13nj5_3",
|
|
1783
|
+
actions: "_actions_13nj5_5"
|
|
1661
1784
|
}, He = ({ filters: e, values: r, onChange: i, onApply: a, onReset: o, applyMode: s = "instant", loading: c = !1, disabled: l = !1, className: u = "" }) => {
|
|
1662
1785
|
let d = (e, t) => {
|
|
1663
1786
|
let n = {
|
|
@@ -1693,7 +1816,8 @@ var T = {
|
|
|
1693
1816
|
onChange: (t) => d(e.id, t)
|
|
1694
1817
|
}, e.id);
|
|
1695
1818
|
}
|
|
1696
|
-
if (e.type === "dropdown") return /* @__PURE__ */ t(
|
|
1819
|
+
if (e.type === "dropdown") return /* @__PURE__ */ t(ce, {
|
|
1820
|
+
size: "lg",
|
|
1697
1821
|
label: e.label,
|
|
1698
1822
|
hint: e.hint,
|
|
1699
1823
|
placeholder: e.placeholder,
|
|
@@ -1703,6 +1827,7 @@ var T = {
|
|
|
1703
1827
|
onChange: (t) => d(e.id, t)
|
|
1704
1828
|
}, e.id);
|
|
1705
1829
|
if (e.type === "multiple") return /* @__PURE__ */ t(De, {
|
|
1830
|
+
size: "lg",
|
|
1706
1831
|
label: e.label,
|
|
1707
1832
|
hint: e.hint,
|
|
1708
1833
|
placeholder: e.placeholder,
|
|
@@ -1711,7 +1836,7 @@ var T = {
|
|
|
1711
1836
|
disabled: n,
|
|
1712
1837
|
onChange: (t) => d(e.id, t)
|
|
1713
1838
|
}, e.id);
|
|
1714
|
-
if (e.type === "checkbox") return /* @__PURE__ */ t(
|
|
1839
|
+
if (e.type === "checkbox") return /* @__PURE__ */ t(M, {
|
|
1715
1840
|
label: e.label,
|
|
1716
1841
|
hint: e.hint,
|
|
1717
1842
|
checked: !!i,
|
|
@@ -1728,7 +1853,7 @@ var T = {
|
|
|
1728
1853
|
from: null,
|
|
1729
1854
|
to: null
|
|
1730
1855
|
};
|
|
1731
|
-
return /* @__PURE__ */ t(
|
|
1856
|
+
return /* @__PURE__ */ t(q, {
|
|
1732
1857
|
hint: e.hint,
|
|
1733
1858
|
mode: e.mode,
|
|
1734
1859
|
min: e.min,
|
|
@@ -1753,7 +1878,7 @@ var T = {
|
|
|
1753
1878
|
})]
|
|
1754
1879
|
})]
|
|
1755
1880
|
});
|
|
1756
|
-
},
|
|
1881
|
+
}, Ue = {
|
|
1757
1882
|
wrapper: "_wrapper_8w6xl_1",
|
|
1758
1883
|
dropzone: "_dropzone_8w6xl_3",
|
|
1759
1884
|
dragActive: "_dragActive_8w6xl_5",
|
|
@@ -1766,125 +1891,133 @@ var T = {
|
|
|
1766
1891
|
file: "_file_8w6xl_17",
|
|
1767
1892
|
fileName: "_fileName_8w6xl_21",
|
|
1768
1893
|
fileSize: "_fileSize_8w6xl_23"
|
|
1769
|
-
},
|
|
1770
|
-
let
|
|
1771
|
-
let t = [], n = new Set(r.map(
|
|
1894
|
+
}, We = (e) => `${e.name}:${e.size}:${e.lastModified}`, Ge = (e) => e < 1024 ? `${e} Б` : e < 1048576 ? `${(e / 1024).toFixed(1)} КБ` : `${(e / 1024 / 1024).toFixed(1)} МБ`, Ke = (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), qe = ({ value: r, onChange: i, multiple: a = !1, accept: o, maxSize: s, maxFiles: l, label: u, hint: p, error: m, required: h = !1, disabled: g = !1, readOnly: _ = !1, name: v, id: y, className: b = "", dropLabel: x = "Перетащите файлы в эту область", browseLabel: S = "Выбрать файлы", addMoreLabel: C = "Добавить ещё", onReject: T }) => {
|
|
1895
|
+
let O = c(), k = y ?? `ds-file-input-${v ?? O}`, j = d(null), M = d(0), [N, P] = f(!1), F = p ? `${k}-hint` : void 0, I = m ? `${k}-error` : void 0, L = [F, I].filter(Boolean).join(" ") || void 0, R = !g && !_, z = (e) => {
|
|
1896
|
+
let t = [], n = new Set(r.map(We)), c = e.filter((e) => Ke(e, o) ? s !== void 0 && e.size > s ? (t.push({
|
|
1772
1897
|
file: e,
|
|
1773
1898
|
reason: "maxSize"
|
|
1774
|
-
}), !1) : !n.has(
|
|
1899
|
+
}), !1) : !n.has(We(e)) && (n.add(We(e)), !0) : (t.push({
|
|
1775
1900
|
file: e,
|
|
1776
1901
|
reason: "accept"
|
|
1777
1902
|
}), !1)), u = a ? l : 1, d = a ? [...r, ...c] : c.slice(-1);
|
|
1778
1903
|
u !== void 0 && d.length > u && (d.slice(u).forEach((e) => t.push({
|
|
1779
1904
|
file: e,
|
|
1780
1905
|
reason: "maxFiles"
|
|
1781
|
-
})), d = d.slice(0, u)), t.length && T?.(t), c.length && i?.(d),
|
|
1906
|
+
})), d = d.slice(0, u)), t.length && T?.(t), c.length && i?.(d), j.current && (j.current.value = "");
|
|
1782
1907
|
};
|
|
1783
1908
|
return /* @__PURE__ */ n("div", {
|
|
1784
|
-
className: `${
|
|
1909
|
+
className: `${Ue.wrapper} ${b}`,
|
|
1785
1910
|
children: [
|
|
1786
|
-
u && /* @__PURE__ */ t(
|
|
1787
|
-
htmlFor:
|
|
1911
|
+
u && /* @__PURE__ */ t(E, {
|
|
1912
|
+
htmlFor: k,
|
|
1788
1913
|
required: h,
|
|
1789
1914
|
disabled: g,
|
|
1790
1915
|
children: u
|
|
1791
1916
|
}),
|
|
1792
1917
|
/* @__PURE__ */ n("div", {
|
|
1793
|
-
className: `${
|
|
1918
|
+
className: `${Ue.dropzone} ${N ? Ue.dragActive : ""} ${g ? Ue.disabled : ""} ${m ? Ue.error : ""}`,
|
|
1794
1919
|
onDragEnter: (e) => {
|
|
1795
|
-
e.preventDefault(),
|
|
1920
|
+
e.preventDefault(), R && ++M.current === 1 && P(!0);
|
|
1796
1921
|
},
|
|
1797
1922
|
onDragOver: (e) => e.preventDefault(),
|
|
1798
1923
|
onDragLeave: (e) => {
|
|
1799
|
-
e.preventDefault(), --
|
|
1924
|
+
e.preventDefault(), --M.current <= 0 && (M.current = 0, P(!1));
|
|
1800
1925
|
},
|
|
1801
1926
|
onDrop: (e) => {
|
|
1802
|
-
e.preventDefault(),
|
|
1927
|
+
e.preventDefault(), M.current = 0, P(!1), R && z(Array.from(e.dataTransfer.files));
|
|
1803
1928
|
},
|
|
1804
1929
|
children: [/* @__PURE__ */ t("input", {
|
|
1805
|
-
ref:
|
|
1806
|
-
id:
|
|
1930
|
+
ref: j,
|
|
1931
|
+
id: k,
|
|
1807
1932
|
name: v,
|
|
1808
|
-
className:
|
|
1933
|
+
className: Ue.nativeInput,
|
|
1809
1934
|
type: "file",
|
|
1810
1935
|
multiple: a,
|
|
1811
1936
|
accept: o,
|
|
1812
1937
|
required: h && r.length === 0,
|
|
1813
|
-
disabled: !
|
|
1814
|
-
"aria-describedby":
|
|
1938
|
+
disabled: !R,
|
|
1939
|
+
"aria-describedby": L,
|
|
1815
1940
|
"aria-invalid": !!m,
|
|
1816
|
-
onChange: (e) =>
|
|
1941
|
+
onChange: (e) => z(Array.from(e.target.files ?? []))
|
|
1817
1942
|
}), r.length ? /* @__PURE__ */ n(e, { children: [
|
|
1818
1943
|
/* @__PURE__ */ t("ul", {
|
|
1819
|
-
className:
|
|
1944
|
+
className: Ue.files,
|
|
1820
1945
|
"aria-live": "polite",
|
|
1821
1946
|
children: r.map((e, a) => /* @__PURE__ */ n("li", {
|
|
1822
|
-
className:
|
|
1947
|
+
className: Ue.file,
|
|
1823
1948
|
children: [
|
|
1824
1949
|
/* @__PURE__ */ t("span", {
|
|
1825
|
-
className:
|
|
1950
|
+
className: Ue.fileName,
|
|
1826
1951
|
title: e.name,
|
|
1827
1952
|
children: e.name
|
|
1828
1953
|
}),
|
|
1829
1954
|
/* @__PURE__ */ t("span", {
|
|
1830
|
-
className:
|
|
1831
|
-
children:
|
|
1955
|
+
className: Ue.fileSize,
|
|
1956
|
+
children: Ge(e.size)
|
|
1832
1957
|
}),
|
|
1833
|
-
|
|
1958
|
+
R && /* @__PURE__ */ t(w, {
|
|
1834
1959
|
variant: "empty",
|
|
1835
1960
|
size: "sm",
|
|
1836
1961
|
"aria-label": `Удалить файл ${e.name}`,
|
|
1837
1962
|
onClick: () => i?.(r.filter((e, t) => t !== a)),
|
|
1838
|
-
children:
|
|
1963
|
+
children: /* @__PURE__ */ t(A, {
|
|
1964
|
+
name: "IconCross",
|
|
1965
|
+
width: 16,
|
|
1966
|
+
height: 16
|
|
1967
|
+
})
|
|
1839
1968
|
})
|
|
1840
1969
|
]
|
|
1841
|
-
},
|
|
1970
|
+
}, We(e)))
|
|
1842
1971
|
}),
|
|
1843
|
-
|
|
1844
|
-
className:
|
|
1972
|
+
R && (a || r.length === 0) && /* @__PURE__ */ t(w, {
|
|
1973
|
+
className: Ue.browseButton,
|
|
1845
1974
|
size: "sm",
|
|
1846
|
-
onClick: () =>
|
|
1975
|
+
onClick: () => j.current?.click(),
|
|
1847
1976
|
children: C
|
|
1848
1977
|
}),
|
|
1849
|
-
|
|
1850
|
-
className:
|
|
1978
|
+
R && !a && /* @__PURE__ */ t(w, {
|
|
1979
|
+
className: Ue.browseButton,
|
|
1851
1980
|
size: "sm",
|
|
1852
|
-
onClick: () =>
|
|
1981
|
+
onClick: () => j.current?.click(),
|
|
1853
1982
|
children: S
|
|
1854
1983
|
})
|
|
1855
1984
|
] }) : /* @__PURE__ */ n("div", {
|
|
1856
|
-
className:
|
|
1985
|
+
className: Ue.empty,
|
|
1857
1986
|
children: [
|
|
1858
1987
|
/* @__PURE__ */ t("span", {
|
|
1859
|
-
className:
|
|
1988
|
+
className: Ue.uploadIcon,
|
|
1860
1989
|
"aria-hidden": "true",
|
|
1861
|
-
children:
|
|
1990
|
+
children: /* @__PURE__ */ t(A, {
|
|
1991
|
+
name: "IconUpload",
|
|
1992
|
+
width: 24,
|
|
1993
|
+
height: 24
|
|
1994
|
+
})
|
|
1862
1995
|
}),
|
|
1863
|
-
/* @__PURE__ */ t("strong", { children:
|
|
1864
|
-
!
|
|
1865
|
-
onClick: () =>
|
|
1996
|
+
/* @__PURE__ */ t("strong", { children: N ? "Отпустите файлы здесь" : x }),
|
|
1997
|
+
!N && R && /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", { children: "или" }), /* @__PURE__ */ t(w, {
|
|
1998
|
+
onClick: () => j.current?.click(),
|
|
1866
1999
|
children: S
|
|
1867
2000
|
})] })
|
|
1868
2001
|
]
|
|
1869
2002
|
})]
|
|
1870
2003
|
}),
|
|
1871
|
-
p && !m && /* @__PURE__ */ t(
|
|
1872
|
-
id:
|
|
2004
|
+
p && !m && /* @__PURE__ */ t(D, {
|
|
2005
|
+
id: F,
|
|
1873
2006
|
children: p
|
|
1874
2007
|
}),
|
|
1875
|
-
m && /* @__PURE__ */ t(
|
|
1876
|
-
id:
|
|
2008
|
+
m && /* @__PURE__ */ t(D, {
|
|
2009
|
+
id: I,
|
|
1877
2010
|
variant: "error",
|
|
1878
2011
|
live: !0,
|
|
1879
2012
|
children: m
|
|
1880
2013
|
})
|
|
1881
2014
|
]
|
|
1882
2015
|
});
|
|
1883
|
-
},
|
|
2016
|
+
}, Je = 0, Q = v((e) => ({
|
|
1884
2017
|
modals: [],
|
|
1885
2018
|
openModal: (t, n = {}, r = {}) => {
|
|
1886
|
-
|
|
1887
|
-
let i = `ds-modal-${
|
|
2019
|
+
Je += 1;
|
|
2020
|
+
let i = `ds-modal-${Je}`;
|
|
1888
2021
|
return e((e) => ({ modals: [...e.modals, {
|
|
1889
2022
|
id: i,
|
|
1890
2023
|
name: t,
|
|
@@ -1896,22 +2029,23 @@ var T = {
|
|
|
1896
2029
|
closeModal: (t) => e((e) => ({ modals: e.modals.filter((e) => e.id !== t) })),
|
|
1897
2030
|
closeTopModal: () => e((e) => ({ modals: e.modals.slice(0, -1) })),
|
|
1898
2031
|
closeAllModals: () => e({ modals: [] })
|
|
1899
|
-
})),
|
|
1900
|
-
layer: "
|
|
1901
|
-
backdrop: "
|
|
1902
|
-
panel: "
|
|
1903
|
-
header: "
|
|
1904
|
-
title: "
|
|
1905
|
-
description: "
|
|
1906
|
-
content: "
|
|
1907
|
-
|
|
2032
|
+
})), Ye = () => Q.setState({ modals: [] }), Xe = {
|
|
2033
|
+
layer: "_layer_1opno_1",
|
|
2034
|
+
backdrop: "_backdrop_1opno_3",
|
|
2035
|
+
panel: "_panel_1opno_5",
|
|
2036
|
+
header: "_header_1opno_9",
|
|
2037
|
+
title: "_title_1opno_11",
|
|
2038
|
+
description: "_description_1opno_13",
|
|
2039
|
+
content: "_content_1opno_15",
|
|
2040
|
+
close: "_close_1opno_17"
|
|
2041
|
+
}, Ze = "button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"])", Qe = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "Закрыть модальное окно", className: l = "", role: u = "dialog" }) => {
|
|
1908
2042
|
let f = c(), p = c(), m = d(null), h = Q((e) => e.closeModal);
|
|
1909
2043
|
return s(() => {
|
|
1910
2044
|
let e = document.activeElement, t = m.current;
|
|
1911
|
-
return (t?.querySelector(
|
|
2045
|
+
return (t?.querySelector(Ze) ?? t)?.focus(), () => e?.focus();
|
|
1912
2046
|
}, []), /* @__PURE__ */ n("div", {
|
|
1913
2047
|
ref: m,
|
|
1914
|
-
className: `${
|
|
2048
|
+
className: `${Xe.panel} ${l}`,
|
|
1915
2049
|
role: u,
|
|
1916
2050
|
"aria-modal": "true",
|
|
1917
2051
|
"aria-labelledby": r ? f : void 0,
|
|
@@ -1919,7 +2053,7 @@ var T = {
|
|
|
1919
2053
|
tabIndex: -1,
|
|
1920
2054
|
onKeyDown: (e) => {
|
|
1921
2055
|
if (e.key !== "Tab") return;
|
|
1922
|
-
let t = Array.from(m.current?.querySelectorAll(
|
|
2056
|
+
let t = Array.from(m.current?.querySelectorAll(Ze) ?? []);
|
|
1923
2057
|
if (!t.length) {
|
|
1924
2058
|
e.preventDefault();
|
|
1925
2059
|
return;
|
|
@@ -1929,42 +2063,36 @@ var T = {
|
|
|
1929
2063
|
},
|
|
1930
2064
|
children: [
|
|
1931
2065
|
(r || o) && /* @__PURE__ */ n("header", {
|
|
1932
|
-
className:
|
|
2066
|
+
className: Xe.header,
|
|
1933
2067
|
children: [r && /* @__PURE__ */ t("h2", {
|
|
1934
2068
|
id: f,
|
|
1935
|
-
className:
|
|
2069
|
+
className: Xe.title,
|
|
1936
2070
|
children: r
|
|
1937
2071
|
}), /* @__PURE__ */ t(w, {
|
|
2072
|
+
className: Xe.close,
|
|
1938
2073
|
variant: "empty",
|
|
1939
2074
|
size: "sm",
|
|
1940
2075
|
"aria-label": o,
|
|
1941
2076
|
onClick: () => h(a),
|
|
1942
|
-
children: /* @__PURE__ */
|
|
1943
|
-
|
|
1944
|
-
width:
|
|
1945
|
-
height:
|
|
1946
|
-
viewBox: "0 0 24 24",
|
|
1947
|
-
fill: "none",
|
|
1948
|
-
stroke: "currentColor",
|
|
1949
|
-
strokeWidth: "2",
|
|
1950
|
-
strokeLinecap: "round",
|
|
1951
|
-
strokeLinejoin: "round",
|
|
1952
|
-
children: [/* @__PURE__ */ t("path", { d: "M18 6 6 18" }), /* @__PURE__ */ t("path", { d: "m6 6 12 12" })]
|
|
2077
|
+
children: /* @__PURE__ */ t(A, {
|
|
2078
|
+
name: "IconCross",
|
|
2079
|
+
width: 24,
|
|
2080
|
+
height: 24
|
|
1953
2081
|
})
|
|
1954
2082
|
})]
|
|
1955
2083
|
}),
|
|
1956
2084
|
i && /* @__PURE__ */ t("p", {
|
|
1957
2085
|
id: p,
|
|
1958
|
-
className:
|
|
2086
|
+
className: Xe.description,
|
|
1959
2087
|
children: i
|
|
1960
2088
|
}),
|
|
1961
2089
|
/* @__PURE__ */ t("div", {
|
|
1962
|
-
className:
|
|
2090
|
+
className: Xe.content,
|
|
1963
2091
|
children: e
|
|
1964
2092
|
})
|
|
1965
2093
|
]
|
|
1966
2094
|
});
|
|
1967
|
-
},
|
|
2095
|
+
}, $e = ({ registry: e }) => {
|
|
1968
2096
|
let n = Q((e) => e.modals), r = Q((e) => e.closeModal), i = Q((e) => e.closeAllModals);
|
|
1969
2097
|
return s(() => {
|
|
1970
2098
|
let e = (e) => {
|
|
@@ -1974,12 +2102,12 @@ var T = {
|
|
|
1974
2102
|
};
|
|
1975
2103
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
1976
2104
|
}, [r]), !n.length || typeof document > "u" ? null : p(/* @__PURE__ */ t("div", {
|
|
1977
|
-
className:
|
|
2105
|
+
className: Xe.layer,
|
|
1978
2106
|
"aria-label": "Модальные окна",
|
|
1979
2107
|
children: n.map((a, o) => {
|
|
1980
2108
|
let s = e[a.name];
|
|
1981
2109
|
return s ? /* @__PURE__ */ t("div", {
|
|
1982
|
-
className:
|
|
2110
|
+
className: Xe.backdrop,
|
|
1983
2111
|
"aria-hidden": o !== n.length - 1 || void 0,
|
|
1984
2112
|
onMouseDown: (e) => {
|
|
1985
2113
|
e.target === e.currentTarget && a.closeOnBackdrop && r(a.id);
|
|
@@ -1993,7 +2121,7 @@ var T = {
|
|
|
1993
2121
|
}, a.id) : null;
|
|
1994
2122
|
})
|
|
1995
2123
|
}), document.body);
|
|
1996
|
-
},
|
|
2124
|
+
}, et = ({ registry: r, children: i, lockBodyScroll: a = !0 }) => {
|
|
1997
2125
|
let o = Q((e) => e.modals.length);
|
|
1998
2126
|
return s(() => {
|
|
1999
2127
|
if (!a || o === 0) return;
|
|
@@ -2001,23 +2129,23 @@ var T = {
|
|
|
2001
2129
|
return document.body.style.overflow = "hidden", () => {
|
|
2002
2130
|
document.body.style.overflow = e;
|
|
2003
2131
|
};
|
|
2004
|
-
}, [a, o]), /* @__PURE__ */ n(e, { children: [i, /* @__PURE__ */ t(
|
|
2005
|
-
},
|
|
2132
|
+
}, [a, o]), /* @__PURE__ */ n(e, { children: [i, /* @__PURE__ */ t($e, { registry: r })] });
|
|
2133
|
+
}, tt = (e) => e, nt = {
|
|
2006
2134
|
message: "_message_1vtru_1",
|
|
2007
2135
|
actions: "_actions_1vtru_3"
|
|
2008
|
-
},
|
|
2136
|
+
}, rt = /* @__PURE__ */ new Map(), it = 0, at = ({ modalId: e, close: r, title: i = "Подтверждение", message: a = "Продолжить действие?", confirmLabel: o = "Подтвердить", cancelLabel: s = "Отмена", tone: c = "default", requestId: l }) => {
|
|
2009
2137
|
let u = (e) => {
|
|
2010
|
-
|
|
2138
|
+
rt.get(l)?.(e), rt.delete(l), r();
|
|
2011
2139
|
};
|
|
2012
|
-
return /* @__PURE__ */ n(
|
|
2140
|
+
return /* @__PURE__ */ n(Qe, {
|
|
2013
2141
|
modalId: e,
|
|
2014
2142
|
title: i,
|
|
2015
2143
|
role: "alertdialog",
|
|
2016
2144
|
children: [/* @__PURE__ */ t("p", {
|
|
2017
|
-
className:
|
|
2145
|
+
className: nt.message,
|
|
2018
2146
|
children: a
|
|
2019
2147
|
}), /* @__PURE__ */ n("div", {
|
|
2020
|
-
className:
|
|
2148
|
+
className: nt.actions,
|
|
2021
2149
|
children: [/* @__PURE__ */ t(w, {
|
|
2022
2150
|
variant: "outline",
|
|
2023
2151
|
onClick: () => u(!1),
|
|
@@ -2029,40 +2157,40 @@ var T = {
|
|
|
2029
2157
|
})]
|
|
2030
2158
|
})]
|
|
2031
2159
|
});
|
|
2032
|
-
},
|
|
2160
|
+
}, ot = ({ modalId: e, close: r, title: i = "Ошибка", message: a, closeLabel: o = "Закрыть" }) => /* @__PURE__ */ n(Qe, {
|
|
2033
2161
|
modalId: e,
|
|
2034
2162
|
title: i,
|
|
2035
2163
|
role: "alertdialog",
|
|
2036
2164
|
children: [/* @__PURE__ */ t("p", {
|
|
2037
|
-
className:
|
|
2165
|
+
className: nt.message,
|
|
2038
2166
|
children: a
|
|
2039
2167
|
}), /* @__PURE__ */ t("div", {
|
|
2040
|
-
className:
|
|
2168
|
+
className: nt.actions,
|
|
2041
2169
|
children: /* @__PURE__ */ t(w, {
|
|
2042
2170
|
onClick: r,
|
|
2043
2171
|
children: o
|
|
2044
2172
|
})
|
|
2045
2173
|
})]
|
|
2046
|
-
}),
|
|
2047
|
-
ConfirmModal:
|
|
2048
|
-
ErrorModal:
|
|
2049
|
-
}),
|
|
2174
|
+
}), st = tt({
|
|
2175
|
+
ConfirmModal: at,
|
|
2176
|
+
ErrorModal: ot
|
|
2177
|
+
}), ct = () => {
|
|
2050
2178
|
let e = Q((e) => e.openModal);
|
|
2051
2179
|
return (t = {}) => new Promise((n) => {
|
|
2052
|
-
|
|
2053
|
-
let r = `confirm-${
|
|
2054
|
-
|
|
2180
|
+
it += 1;
|
|
2181
|
+
let r = `confirm-${it}`;
|
|
2182
|
+
rt.set(r, n), e("ConfirmModal", {
|
|
2055
2183
|
...t,
|
|
2056
2184
|
requestId: r
|
|
2057
2185
|
}, { closeOnEscape: !1 });
|
|
2058
2186
|
});
|
|
2059
|
-
},
|
|
2187
|
+
}, lt = (e) => e instanceof Error ? e.message : typeof e == "string" ? e : e && typeof e == "object" && "message" in e && typeof e.message == "string" ? e.message : "Произошла неизвестная ошибка", ut = () => {
|
|
2060
2188
|
let e = Q((e) => e.openModal);
|
|
2061
2189
|
return { showError: (t, n) => e("ErrorModal", {
|
|
2062
2190
|
title: n,
|
|
2063
|
-
message:
|
|
2191
|
+
message: lt(t)
|
|
2064
2192
|
}) };
|
|
2065
|
-
},
|
|
2193
|
+
}, dt = v(() => ({})), ft = v(() => ({})), pt = () => {
|
|
2066
2194
|
let e = Q((e) => e.modals), t = Q((e) => e.openModal);
|
|
2067
2195
|
return {
|
|
2068
2196
|
openModal: (e, n = {}, r) => t(e, n, r),
|
|
@@ -2072,7 +2200,7 @@ var T = {
|
|
|
2072
2200
|
isOpen: (t) => e.some((e) => e.name === t),
|
|
2073
2201
|
count: e.length
|
|
2074
2202
|
};
|
|
2075
|
-
},
|
|
2203
|
+
}, mt = {
|
|
2076
2204
|
wrapper: "_wrapper_1qbyz_1",
|
|
2077
2205
|
container: "_container_1qbyz_15",
|
|
2078
2206
|
inner: "_inner_1qbyz_35",
|
|
@@ -2080,29 +2208,29 @@ var T = {
|
|
|
2080
2208
|
jump: "_jump_1qbyz_1",
|
|
2081
2209
|
cube__inner: "_cube__inner_1qbyz_67",
|
|
2082
2210
|
morph: "_morph_1qbyz_1"
|
|
2083
|
-
},
|
|
2084
|
-
className:
|
|
2211
|
+
}, ht = () => /* @__PURE__ */ t("div", {
|
|
2212
|
+
className: mt.wrapper,
|
|
2085
2213
|
children: /* @__PURE__ */ t("div", {
|
|
2086
|
-
className:
|
|
2214
|
+
className: mt.container,
|
|
2087
2215
|
children: /* @__PURE__ */ n("div", {
|
|
2088
|
-
className:
|
|
2216
|
+
className: mt.inner,
|
|
2089
2217
|
children: [
|
|
2090
2218
|
/* @__PURE__ */ t("div", {
|
|
2091
|
-
className:
|
|
2092
|
-
children: /* @__PURE__ */ t("div", { className:
|
|
2219
|
+
className: mt.cube,
|
|
2220
|
+
children: /* @__PURE__ */ t("div", { className: mt.cube__inner })
|
|
2093
2221
|
}),
|
|
2094
2222
|
/* @__PURE__ */ t("div", {
|
|
2095
|
-
className:
|
|
2096
|
-
children: /* @__PURE__ */ t("div", { className:
|
|
2223
|
+
className: mt.cube,
|
|
2224
|
+
children: /* @__PURE__ */ t("div", { className: mt.cube__inner })
|
|
2097
2225
|
}),
|
|
2098
2226
|
/* @__PURE__ */ t("div", {
|
|
2099
|
-
className:
|
|
2100
|
-
children: /* @__PURE__ */ t("div", { className:
|
|
2227
|
+
className: mt.cube,
|
|
2228
|
+
children: /* @__PURE__ */ t("div", { className: mt.cube__inner })
|
|
2101
2229
|
})
|
|
2102
2230
|
]
|
|
2103
2231
|
})
|
|
2104
2232
|
})
|
|
2105
|
-
}),
|
|
2233
|
+
}), gt = {
|
|
2106
2234
|
viewport: "_viewport_15mi5_1",
|
|
2107
2235
|
"top-right": "_top-right_15mi5_3",
|
|
2108
2236
|
"top-left": "_top-left_15mi5_5",
|
|
@@ -2115,93 +2243,24 @@ var T = {
|
|
|
2115
2243
|
success: "_success_15mi5_19",
|
|
2116
2244
|
warning: "_warning_15mi5_21",
|
|
2117
2245
|
error: "_error_15mi5_23"
|
|
2118
|
-
},
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
/* @__PURE__ */ t("path", { d: "M12 16v-4" }),
|
|
2137
|
-
/* @__PURE__ */ t("path", { d: "M12 8h.01" })
|
|
2138
|
-
]
|
|
2139
|
-
}) : e === "success" ? /* @__PURE__ */ n("svg", {
|
|
2140
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2141
|
-
width: "24",
|
|
2142
|
-
height: "24",
|
|
2143
|
-
viewBox: "0 0 24 24",
|
|
2144
|
-
fill: "none",
|
|
2145
|
-
stroke: "#179c66",
|
|
2146
|
-
strokeWidth: "2",
|
|
2147
|
-
strokeLinecap: "round",
|
|
2148
|
-
strokeLinejoin: "round",
|
|
2149
|
-
children: [/* @__PURE__ */ t("circle", {
|
|
2150
|
-
cx: "12",
|
|
2151
|
-
cy: "12",
|
|
2152
|
-
r: "10"
|
|
2153
|
-
}), /* @__PURE__ */ t("path", { d: "m9 12 2 2 4-4" })]
|
|
2154
|
-
}) : e === "warning" ? /* @__PURE__ */ n("svg", {
|
|
2155
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2156
|
-
width: "24",
|
|
2157
|
-
height: "24",
|
|
2158
|
-
viewBox: "0 0 24 24",
|
|
2159
|
-
fill: "none",
|
|
2160
|
-
stroke: "#f59e0b",
|
|
2161
|
-
strokeWidth: "2",
|
|
2162
|
-
strokeLinecap: "round",
|
|
2163
|
-
strokeLinejoin: "round",
|
|
2164
|
-
children: [
|
|
2165
|
-
/* @__PURE__ */ t("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }),
|
|
2166
|
-
/* @__PURE__ */ t("path", { d: "M12 9v4" }),
|
|
2167
|
-
/* @__PURE__ */ t("path", { d: "M12 17h.01" })
|
|
2168
|
-
]
|
|
2169
|
-
}) : e === "error" ? /* @__PURE__ */ n("svg", {
|
|
2170
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2171
|
-
width: "24",
|
|
2172
|
-
height: "24",
|
|
2173
|
-
viewBox: "0 0 24 24",
|
|
2174
|
-
fill: "none",
|
|
2175
|
-
stroke: "#dc2626",
|
|
2176
|
-
strokeWidth: "2",
|
|
2177
|
-
strokeLinecap: "round",
|
|
2178
|
-
strokeLinejoin: "round",
|
|
2179
|
-
children: [
|
|
2180
|
-
/* @__PURE__ */ t("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }),
|
|
2181
|
-
/* @__PURE__ */ t("path", { d: "M12 9v4" }),
|
|
2182
|
-
/* @__PURE__ */ t("path", { d: "M12 17h.01" })
|
|
2183
|
-
]
|
|
2184
|
-
}) : /* @__PURE__ */ n("svg", {
|
|
2185
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2186
|
-
width: "24",
|
|
2187
|
-
height: "24",
|
|
2188
|
-
viewBox: "0 0 24 24",
|
|
2189
|
-
fill: "none",
|
|
2190
|
-
stroke: "currentColor",
|
|
2191
|
-
strokeWidth: "2",
|
|
2192
|
-
strokeLinecap: "round",
|
|
2193
|
-
strokeLinejoin: "round",
|
|
2194
|
-
children: [
|
|
2195
|
-
/* @__PURE__ */ t("circle", {
|
|
2196
|
-
cx: "12",
|
|
2197
|
-
cy: "12",
|
|
2198
|
-
r: "10"
|
|
2199
|
-
}),
|
|
2200
|
-
/* @__PURE__ */ t("path", { d: "m15 9-6 6" }),
|
|
2201
|
-
/* @__PURE__ */ t("path", { d: "m9 9 6 6" })
|
|
2202
|
-
]
|
|
2203
|
-
}), r;
|
|
2204
|
-
}, _t = ({ toast: e, onClose: r }) => {
|
|
2246
|
+
}, _t = {
|
|
2247
|
+
info: {
|
|
2248
|
+
name: "IconInfoCircle",
|
|
2249
|
+
color: "var(--color-primary)"
|
|
2250
|
+
},
|
|
2251
|
+
success: {
|
|
2252
|
+
name: "IconSuccessCircle",
|
|
2253
|
+
color: "var(--color-success)"
|
|
2254
|
+
},
|
|
2255
|
+
warning: {
|
|
2256
|
+
name: "IconWarning",
|
|
2257
|
+
color: "var(--color-warning)"
|
|
2258
|
+
},
|
|
2259
|
+
error: {
|
|
2260
|
+
name: "IconWarning",
|
|
2261
|
+
color: "var(--color-error)"
|
|
2262
|
+
}
|
|
2263
|
+
}, vt = ({ toast: e, onClose: r }) => {
|
|
2205
2264
|
let [i, a] = f(!1), o = d(e.duration), c = d(Date.now());
|
|
2206
2265
|
return s(() => {
|
|
2207
2266
|
if (i || e.duration <= 0) return;
|
|
@@ -2216,7 +2275,7 @@ var T = {
|
|
|
2216
2275
|
e.duration,
|
|
2217
2276
|
e.id
|
|
2218
2277
|
]), /* @__PURE__ */ n("article", {
|
|
2219
|
-
className: `${
|
|
2278
|
+
className: `${gt.toast} ${gt[e.variant]}`,
|
|
2220
2279
|
role: e.variant === "error" ? "alert" : "status",
|
|
2221
2280
|
"aria-live": e.variant === "error" ? "assertive" : "polite",
|
|
2222
2281
|
onMouseEnter: () => a(!0),
|
|
@@ -2224,9 +2283,13 @@ var T = {
|
|
|
2224
2283
|
onFocus: () => a(!0),
|
|
2225
2284
|
onBlur: () => a(!1),
|
|
2226
2285
|
children: [
|
|
2227
|
-
/* @__PURE__ */ t("div", { children:
|
|
2286
|
+
/* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(A, {
|
|
2287
|
+
..._t[e.variant],
|
|
2288
|
+
width: 24,
|
|
2289
|
+
height: 24
|
|
2290
|
+
}) }),
|
|
2228
2291
|
/* @__PURE__ */ n("div", {
|
|
2229
|
-
className:
|
|
2292
|
+
className: gt.body,
|
|
2230
2293
|
children: [
|
|
2231
2294
|
e.title && /* @__PURE__ */ t("strong", { children: e.title }),
|
|
2232
2295
|
/* @__PURE__ */ t("div", { children: e.message }),
|
|
@@ -2245,26 +2308,19 @@ var T = {
|
|
|
2245
2308
|
size: "sm",
|
|
2246
2309
|
"aria-label": "Закрыть уведомление",
|
|
2247
2310
|
onClick: () => r(e.id),
|
|
2248
|
-
children: /* @__PURE__ */
|
|
2249
|
-
|
|
2250
|
-
width:
|
|
2251
|
-
height:
|
|
2252
|
-
viewBox: "0 0 24 24",
|
|
2253
|
-
fill: "none",
|
|
2254
|
-
stroke: "currentColor",
|
|
2255
|
-
strokeWidth: "2",
|
|
2256
|
-
strokeLinecap: "round",
|
|
2257
|
-
strokeLinejoin: "round",
|
|
2258
|
-
children: [/* @__PURE__ */ t("path", { d: "M18 6 6 18" }), /* @__PURE__ */ t("path", { d: "m6 6 12 12" })]
|
|
2311
|
+
children: /* @__PURE__ */ t(A, {
|
|
2312
|
+
name: "IconCross",
|
|
2313
|
+
width: 24,
|
|
2314
|
+
height: 24
|
|
2259
2315
|
})
|
|
2260
2316
|
})
|
|
2261
2317
|
]
|
|
2262
2318
|
});
|
|
2263
|
-
},
|
|
2319
|
+
}, yt = 0, bt = v((e) => ({
|
|
2264
2320
|
toasts: [],
|
|
2265
2321
|
showToast: (t) => {
|
|
2266
|
-
|
|
2267
|
-
let n = `ds-toast-${
|
|
2322
|
+
yt += 1;
|
|
2323
|
+
let n = `ds-toast-${yt}`;
|
|
2268
2324
|
return e((e) => ({ toasts: [...e.toasts, {
|
|
2269
2325
|
variant: "info",
|
|
2270
2326
|
duration: 5e3,
|
|
@@ -2275,18 +2331,18 @@ var T = {
|
|
|
2275
2331
|
},
|
|
2276
2332
|
removeToast: (t) => e((e) => ({ toasts: e.toasts.filter((e) => e.id !== t) })),
|
|
2277
2333
|
clearToasts: () => e({ toasts: [] })
|
|
2278
|
-
})),
|
|
2279
|
-
let n =
|
|
2334
|
+
})), xt = () => bt.setState({ toasts: [] }), St = ({ position: e = "top-right" }) => {
|
|
2335
|
+
let n = bt((e) => e.toasts), r = bt((e) => e.removeToast);
|
|
2280
2336
|
return /* @__PURE__ */ t("div", {
|
|
2281
|
-
className: `${
|
|
2337
|
+
className: `${gt.viewport} ${gt[e]}`,
|
|
2282
2338
|
"aria-label": "Уведомления",
|
|
2283
|
-
children: n.map((e) => /* @__PURE__ */ t(
|
|
2339
|
+
children: n.map((e) => /* @__PURE__ */ t(vt, {
|
|
2284
2340
|
toast: e,
|
|
2285
2341
|
onClose: r
|
|
2286
2342
|
}, e.id))
|
|
2287
2343
|
});
|
|
2288
|
-
},
|
|
2289
|
-
let e =
|
|
2344
|
+
}, Ct = () => {
|
|
2345
|
+
let e = bt((e) => e.showToast), t = bt((e) => e.removeToast), n = bt((e) => e.clearToasts), r = o((t) => e({
|
|
2290
2346
|
...t,
|
|
2291
2347
|
variant: "info"
|
|
2292
2348
|
}), [e]), i = o((t) => e({
|
|
@@ -2316,7 +2372,7 @@ var T = {
|
|
|
2316
2372
|
i,
|
|
2317
2373
|
a
|
|
2318
2374
|
]);
|
|
2319
|
-
},
|
|
2375
|
+
}, wt = {
|
|
2320
2376
|
root: "_root_s9o0g_1",
|
|
2321
2377
|
tooltip: "_tooltip_s9o0g_3",
|
|
2322
2378
|
"ds-tooltip-in": "_ds-tooltip-in_s9o0g_1",
|
|
@@ -2324,7 +2380,7 @@ var T = {
|
|
|
2324
2380
|
bottom: "_bottom_s9o0g_7",
|
|
2325
2381
|
left: "_left_s9o0g_9",
|
|
2326
2382
|
right: "_right_s9o0g_11"
|
|
2327
|
-
},
|
|
2383
|
+
}, Tt = ({ content: e, children: i, placement: o = "top", delay: l = 450, disabled: u = !1, maxWidth: p = 280, className: m = "" }) => {
|
|
2328
2384
|
let h = c(), [g, _] = f(!1), v = d(null), y = () => {
|
|
2329
2385
|
u || !e || (v.current = setTimeout(() => _(!0), l));
|
|
2330
2386
|
}, b = () => {
|
|
@@ -2346,120 +2402,211 @@ var T = {
|
|
|
2346
2402
|
onBlur: b
|
|
2347
2403
|
});
|
|
2348
2404
|
return /* @__PURE__ */ n("span", {
|
|
2349
|
-
className: `${
|
|
2405
|
+
className: `${wt.root} ${m}`,
|
|
2350
2406
|
onPointerDown: g ? b : y,
|
|
2351
2407
|
children: [x, g && /* @__PURE__ */ t("span", {
|
|
2352
2408
|
id: h,
|
|
2353
2409
|
role: "tooltip",
|
|
2354
|
-
className: `${
|
|
2410
|
+
className: `${wt.tooltip} ${wt[o]}`,
|
|
2355
2411
|
style: { maxWidth: p },
|
|
2356
2412
|
children: e
|
|
2357
2413
|
})]
|
|
2358
2414
|
});
|
|
2415
|
+
}, Et = (e) => {
|
|
2416
|
+
if (!Number.isFinite(e) || e < 0) return "00:00";
|
|
2417
|
+
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")}`;
|
|
2418
|
+
return n ? `${n}:${a}` : a;
|
|
2359
2419
|
}, $ = {
|
|
2360
|
-
root: "
|
|
2361
|
-
frame: "
|
|
2362
|
-
video: "
|
|
2363
|
-
overlay: "
|
|
2364
|
-
state: "
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
]
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
children: [
|
|
2403
|
-
/* @__PURE__ */ t("path", {
|
|
2404
|
-
d: "M12 3.5L21 19H3L12 3.5Z",
|
|
2405
|
-
stroke: "currentColor",
|
|
2406
|
-
strokeWidth: "1.7",
|
|
2407
|
-
strokeLinejoin: "round"
|
|
2408
|
-
}),
|
|
2409
|
-
/* @__PURE__ */ t("path", {
|
|
2410
|
-
d: "M12 9V13.5",
|
|
2411
|
-
stroke: "currentColor",
|
|
2412
|
-
strokeWidth: "1.7",
|
|
2413
|
-
strokeLinecap: "round"
|
|
2414
|
-
}),
|
|
2415
|
-
/* @__PURE__ */ t("circle", {
|
|
2416
|
-
cx: "12",
|
|
2417
|
-
cy: "16.5",
|
|
2418
|
-
r: "1",
|
|
2419
|
-
fill: "currentColor"
|
|
2420
|
-
})
|
|
2421
|
-
]
|
|
2422
|
-
}), Dt = ({ sources: r, tracks: i = [], title: a, aspectRatio: o = "16 / 9", objectFit: c = "contain", loading: l = !1, error: u, fallback: d, className: p = "", controls: m = !0, playsInline: h = !0, ...g }) => {
|
|
2423
|
-
let [_, v] = f(!1), [y, b] = f(r.length > 0), x = r.map(({ src: e, type: t }) => `${e}:${t ?? ""}`).join("|");
|
|
2420
|
+
root: "_root_1oxvl_1",
|
|
2421
|
+
frame: "_frame_1oxvl_35",
|
|
2422
|
+
video: "_video_1oxvl_65",
|
|
2423
|
+
overlay: "_overlay_1oxvl_79",
|
|
2424
|
+
state: "_state_1oxvl_81",
|
|
2425
|
+
buffering: "_buffering_1oxvl_83",
|
|
2426
|
+
loaderViewport: "_loaderViewport_1oxvl_143",
|
|
2427
|
+
loaderScale: "_loaderScale_1oxvl_155",
|
|
2428
|
+
stateIcon: "_stateIcon_1oxvl_169",
|
|
2429
|
+
empty: "_empty_1oxvl_201",
|
|
2430
|
+
error: "_error_1oxvl_211",
|
|
2431
|
+
replay: "_replay_1oxvl_223",
|
|
2432
|
+
controlsLayer: "_controlsLayer_1oxvl_259",
|
|
2433
|
+
controlsVisible: "_controlsVisible_1oxvl_285",
|
|
2434
|
+
controls: "_controls_1oxvl_259",
|
|
2435
|
+
controlGroup: "_controlGroup_1oxvl_309",
|
|
2436
|
+
controlButton: "_controlButton_1oxvl_335",
|
|
2437
|
+
settingsAction: "_settingsAction_1oxvl_367",
|
|
2438
|
+
timeline: "_timeline_1oxvl_385",
|
|
2439
|
+
volume: "_volume_1oxvl_387",
|
|
2440
|
+
settings: "_settings_1oxvl_367",
|
|
2441
|
+
playButton: "_playButton_1oxvl_401",
|
|
2442
|
+
volumeGroup: "_volumeGroup_1oxvl_415",
|
|
2443
|
+
timelineGroup: "_timelineGroup_1oxvl_439",
|
|
2444
|
+
time: "_time_1oxvl_385",
|
|
2445
|
+
settingsActionLabel: "_settingsActionLabel_1oxvl_677",
|
|
2446
|
+
caption: "_caption_1oxvl_689",
|
|
2447
|
+
fullscreen: "_fullscreen_1oxvl_703"
|
|
2448
|
+
}, Dt = 2500, Ot = 5, kt = .05, At = [
|
|
2449
|
+
.5,
|
|
2450
|
+
.75,
|
|
2451
|
+
1,
|
|
2452
|
+
1.25,
|
|
2453
|
+
1.5,
|
|
2454
|
+
2
|
|
2455
|
+
], jt = ({ sources: r, tracks: i = [], title: a, aspectRatio: c = "16 / 9", objectFit: l = "contain", loading: u = !1, error: p, fallback: m, className: h = "", controls: g = !0, playsInline: _ = !0, ...v }) => {
|
|
2456
|
+
let y = d(null), b = d(null), x = d(null), C = d(void 0), [T, E] = f(!1), [D, O] = f(r.length > 0), [k, j] = f(!1), [M, N] = f(!1), [P, F] = f(!1), [I, L] = f(0), [R, z] = f(0), [B, V] = f(0), [H, ee] = f(1), [U, W] = f(!!v.muted), [G, te] = f(1), [K, q] = f(!!v.loop), [J, ne] = f(-1), [Y, re] = f(!1), [ie, ae] = f(!0), [oe, se] = f(!1), [ce, le] = f(!1), ue = r.map(({ src: e, type: t }) => `${e}:${t ?? ""}`).join("|"), X = i.map((e, t) => ({
|
|
2457
|
+
track: e,
|
|
2458
|
+
index: t
|
|
2459
|
+
})).filter(({ track: e }) => e.kind === "captions" || e.kind === "subtitles"), de = p ?? (T ? "Не удалось воспроизвести видео" : void 0), fe = u || D && !de && r.length > 0, pe = !fe && !de && r.length === 0, me = typeof document < "u" && "pictureInPictureEnabled" in document && document.pictureInPictureEnabled, he = o(() => {
|
|
2460
|
+
ae(!0), window.clearTimeout(C.current), M && !Y && (C.current = window.setTimeout(() => ae(!1), Dt));
|
|
2461
|
+
}, [M, Y]);
|
|
2424
2462
|
s(() => {
|
|
2425
|
-
|
|
2426
|
-
}, [
|
|
2427
|
-
|
|
2463
|
+
E(!1), O(r.length > 0), j(!1), N(!1), F(!1), L(0), z(0), V(0);
|
|
2464
|
+
}, [ue, r.length]), s(() => (he(), () => window.clearTimeout(C.current)), [he]), s(() => {
|
|
2465
|
+
let e = () => se(document.fullscreenElement === b.current), t = () => le(document.pictureInPictureElement === x.current);
|
|
2466
|
+
return document.addEventListener("fullscreenchange", e), document.addEventListener("enterpictureinpicture", t), document.addEventListener("leavepictureinpicture", t), () => {
|
|
2467
|
+
document.removeEventListener("fullscreenchange", e), document.removeEventListener("enterpictureinpicture", t), document.removeEventListener("leavepictureinpicture", t);
|
|
2468
|
+
};
|
|
2469
|
+
}, []), s(() => {
|
|
2470
|
+
if (!Y) return;
|
|
2471
|
+
let e = (e) => {
|
|
2472
|
+
y.current?.contains(e.target) || re(!1);
|
|
2473
|
+
};
|
|
2474
|
+
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
2475
|
+
}, [Y]);
|
|
2476
|
+
let ge = async () => {
|
|
2477
|
+
let e = x.current;
|
|
2478
|
+
if (!(!e || de || fe)) {
|
|
2479
|
+
if (e.paused || e.ended) {
|
|
2480
|
+
e.ended && (e.currentTime = 0);
|
|
2481
|
+
try {
|
|
2482
|
+
await e.play();
|
|
2483
|
+
} catch {
|
|
2484
|
+
E(!0);
|
|
2485
|
+
}
|
|
2486
|
+
} else e.pause();
|
|
2487
|
+
}
|
|
2488
|
+
}, _e = () => {
|
|
2489
|
+
let e = x.current;
|
|
2490
|
+
e && (e.muted = !e.muted);
|
|
2491
|
+
}, ve = (e) => {
|
|
2492
|
+
let t = x.current;
|
|
2493
|
+
t && (t.volume = Math.min(1, Math.max(0, e)), t.muted = t.volume === 0);
|
|
2494
|
+
}, ye = (e) => {
|
|
2495
|
+
let t = x.current;
|
|
2496
|
+
!t || !R || (t.currentTime = Math.min(R, Math.max(0, e)), L(t.currentTime));
|
|
2497
|
+
}, be = async () => {
|
|
2498
|
+
if (b.current) try {
|
|
2499
|
+
document.fullscreenElement ? await document.exitFullscreen() : await b.current.requestFullscreen();
|
|
2500
|
+
} catch {
|
|
2501
|
+
se(!1);
|
|
2502
|
+
}
|
|
2503
|
+
}, xe = async () => {
|
|
2504
|
+
let e = x.current;
|
|
2505
|
+
if (!(!e || !me)) try {
|
|
2506
|
+
document.pictureInPictureElement ? await document.exitPictureInPicture() : await e.requestPictureInPicture();
|
|
2507
|
+
} catch {
|
|
2508
|
+
le(!1);
|
|
2509
|
+
}
|
|
2510
|
+
}, Se = (e) => {
|
|
2511
|
+
let t = x.current;
|
|
2512
|
+
t && (Array.from(t.textTracks).forEach((t, n) => {
|
|
2513
|
+
t.mode = n === e ? "showing" : "disabled";
|
|
2514
|
+
}), ne(e));
|
|
2515
|
+
}, Ce = (e) => {
|
|
2516
|
+
let t = e.target;
|
|
2517
|
+
if (/^(INPUT|SELECT|BUTTON)$/.test(t.tagName)) return;
|
|
2518
|
+
let n = e.key.toLowerCase();
|
|
2519
|
+
n === " " || n === "k" ? (e.preventDefault(), ge()) : n === "m" ? (e.preventDefault(), _e()) : n === "f" ? (e.preventDefault(), be()) : n === "c" && X.length ? (e.preventDefault(), Se(J === -1 ? X[0].index : -1)) : e.key === "ArrowLeft" || e.key === "ArrowRight" ? (e.preventDefault(), ye(I + (e.key === "ArrowRight" ? Ot : -5))) : e.key === "ArrowUp" || e.key === "ArrowDown" ? (e.preventDefault(), ve(H + (e.key === "ArrowUp" ? kt : -.05))) : e.key === "Escape" && re(!1), he();
|
|
2520
|
+
}, we = () => {
|
|
2521
|
+
let e = x.current;
|
|
2522
|
+
E(!1), O(!0), e?.load();
|
|
2523
|
+
}, Te = {
|
|
2524
|
+
"--video-progress": `${R ? I / R * 100 : 0}%`,
|
|
2525
|
+
"--video-buffered": `${B * 100}%`
|
|
2526
|
+
};
|
|
2428
2527
|
return /* @__PURE__ */ n("figure", {
|
|
2429
|
-
|
|
2528
|
+
ref: y,
|
|
2529
|
+
className: `${$.root} ${h}`,
|
|
2530
|
+
onKeyDown: Ce,
|
|
2430
2531
|
children: [/* @__PURE__ */ n("div", {
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2532
|
+
ref: b,
|
|
2533
|
+
className: `${$.frame} ${oe ? $.fullscreen : ""}`,
|
|
2534
|
+
style: { aspectRatio: c },
|
|
2535
|
+
"aria-busy": fe || void 0,
|
|
2536
|
+
tabIndex: g && r.length ? 0 : void 0,
|
|
2537
|
+
onPointerMove: he,
|
|
2538
|
+
onPointerDown: he,
|
|
2539
|
+
onFocusCapture: he,
|
|
2540
|
+
onMouseLeave: () => {
|
|
2541
|
+
M && !Y && ae(!1);
|
|
2542
|
+
},
|
|
2434
2543
|
children: [
|
|
2435
|
-
|
|
2436
|
-
...
|
|
2544
|
+
r.length > 0 && /* @__PURE__ */ n("video", {
|
|
2545
|
+
...v,
|
|
2546
|
+
ref: x,
|
|
2437
2547
|
"aria-label": a,
|
|
2438
|
-
controls:
|
|
2439
|
-
playsInline:
|
|
2548
|
+
controls: !1,
|
|
2549
|
+
playsInline: _,
|
|
2550
|
+
loop: K,
|
|
2440
2551
|
className: $.video,
|
|
2441
|
-
style: { objectFit:
|
|
2552
|
+
style: { objectFit: l },
|
|
2553
|
+
onClick: (e) => {
|
|
2554
|
+
v.onClick?.(e), ge();
|
|
2555
|
+
},
|
|
2556
|
+
onDoubleClick: (e) => {
|
|
2557
|
+
v.onDoubleClick?.(e), be();
|
|
2558
|
+
},
|
|
2442
2559
|
onLoadStart: (e) => {
|
|
2443
|
-
|
|
2560
|
+
O(!0), v.onLoadStart?.(e);
|
|
2561
|
+
},
|
|
2562
|
+
onLoadedMetadata: (e) => {
|
|
2563
|
+
z(e.currentTarget.duration || 0);
|
|
2564
|
+
let t = X.find(({ track: e }) => e.default);
|
|
2565
|
+
Se(t?.index ?? -1), v.onLoadedMetadata?.(e);
|
|
2566
|
+
},
|
|
2567
|
+
onDurationChange: (e) => {
|
|
2568
|
+
z(e.currentTarget.duration || 0), v.onDurationChange?.(e);
|
|
2569
|
+
},
|
|
2570
|
+
onTimeUpdate: (e) => {
|
|
2571
|
+
L(e.currentTarget.currentTime), v.onTimeUpdate?.(e);
|
|
2572
|
+
},
|
|
2573
|
+
onProgress: (e) => {
|
|
2574
|
+
let t = e.currentTarget;
|
|
2575
|
+
t.duration && t.buffered.length && V(t.buffered.end(t.buffered.length - 1) / t.duration), v.onProgress?.(e);
|
|
2444
2576
|
},
|
|
2445
2577
|
onLoadedData: (e) => {
|
|
2446
|
-
|
|
2578
|
+
O(!1), j(!1), v.onLoadedData?.(e);
|
|
2447
2579
|
},
|
|
2448
2580
|
onCanPlay: (e) => {
|
|
2449
|
-
|
|
2581
|
+
O(!1), j(!1), v.onCanPlay?.(e);
|
|
2450
2582
|
},
|
|
2451
2583
|
onWaiting: (e) => {
|
|
2452
|
-
|
|
2584
|
+
j(!0), v.onWaiting?.(e);
|
|
2453
2585
|
},
|
|
2454
2586
|
onPlaying: (e) => {
|
|
2455
|
-
|
|
2587
|
+
N(!0), F(!1), j(!1), v.onPlaying?.(e);
|
|
2588
|
+
},
|
|
2589
|
+
onPlay: (e) => {
|
|
2590
|
+
N(!0), v.onPlay?.(e);
|
|
2591
|
+
},
|
|
2592
|
+
onPause: (e) => {
|
|
2593
|
+
N(!1), v.onPause?.(e);
|
|
2594
|
+
},
|
|
2595
|
+
onEnded: (e) => {
|
|
2596
|
+
N(!1), F(!0), ae(!0), v.onEnded?.(e);
|
|
2597
|
+
},
|
|
2598
|
+
onVolumeChange: (e) => {
|
|
2599
|
+
ee(e.currentTarget.volume), W(e.currentTarget.muted), v.onVolumeChange?.(e);
|
|
2600
|
+
},
|
|
2601
|
+
onRateChange: (e) => {
|
|
2602
|
+
te(e.currentTarget.playbackRate), v.onRateChange?.(e);
|
|
2456
2603
|
},
|
|
2457
2604
|
onError: (e) => {
|
|
2458
|
-
|
|
2605
|
+
O(!1), j(!1), E(!0), v.onError?.(e);
|
|
2459
2606
|
},
|
|
2460
2607
|
children: [r.map((e) => /* @__PURE__ */ t("source", { ...e }, `${e.src}-${e.type}`)), i.map((e) => /* @__PURE__ */ t("track", { ...e }, `${e.src}-${e.srcLang}`))]
|
|
2461
2608
|
}),
|
|
2462
|
-
|
|
2609
|
+
fe && /* @__PURE__ */ n("div", {
|
|
2463
2610
|
className: $.overlay,
|
|
2464
2611
|
role: "status",
|
|
2465
2612
|
"aria-live": "polite",
|
|
@@ -2468,23 +2615,210 @@ var T = {
|
|
|
2468
2615
|
"aria-hidden": "true",
|
|
2469
2616
|
children: /* @__PURE__ */ t("div", {
|
|
2470
2617
|
className: $.loaderScale,
|
|
2471
|
-
children: /* @__PURE__ */ t(
|
|
2618
|
+
children: /* @__PURE__ */ t(ht, {})
|
|
2472
2619
|
})
|
|
2473
2620
|
}), /* @__PURE__ */ t("span", { children: "Загрузка видео" })]
|
|
2474
2621
|
}),
|
|
2475
|
-
|
|
2622
|
+
!fe && k && !de && /* @__PURE__ */ t("div", {
|
|
2623
|
+
className: $.buffering,
|
|
2624
|
+
role: "status",
|
|
2625
|
+
"aria-label": "Буферизация видео",
|
|
2626
|
+
children: /* @__PURE__ */ t(S, { variant: "empty" })
|
|
2627
|
+
}),
|
|
2628
|
+
pe && /* @__PURE__ */ n("div", {
|
|
2476
2629
|
className: `${$.state} ${$.empty}`,
|
|
2477
2630
|
role: "status",
|
|
2478
2631
|
children: [
|
|
2479
|
-
/* @__PURE__ */ t(
|
|
2632
|
+
/* @__PURE__ */ t(A, {
|
|
2633
|
+
name: "IconInfoCircle",
|
|
2634
|
+
className: $.stateIcon,
|
|
2635
|
+
width: 40,
|
|
2636
|
+
height: 40
|
|
2637
|
+
}),
|
|
2480
2638
|
/* @__PURE__ */ t("strong", { children: "Видео отсутствует" }),
|
|
2481
|
-
|
|
2639
|
+
m ?? /* @__PURE__ */ t("span", { children: "Источник видео не указан" })
|
|
2482
2640
|
]
|
|
2483
2641
|
}),
|
|
2484
|
-
!
|
|
2642
|
+
!fe && de && /* @__PURE__ */ n("div", {
|
|
2485
2643
|
className: `${$.state} ${$.error}`,
|
|
2486
2644
|
role: "alert",
|
|
2487
|
-
children: [
|
|
2645
|
+
children: [
|
|
2646
|
+
/* @__PURE__ */ t(A, {
|
|
2647
|
+
name: "IconWarning",
|
|
2648
|
+
className: $.stateIcon,
|
|
2649
|
+
width: 40,
|
|
2650
|
+
height: 40
|
|
2651
|
+
}),
|
|
2652
|
+
m ?? /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("strong", { children: "Видео недоступно" }), /* @__PURE__ */ t("span", { children: de })] }),
|
|
2653
|
+
r.length > 0 && /* @__PURE__ */ t(w, {
|
|
2654
|
+
size: "sm",
|
|
2655
|
+
variant: "secondary",
|
|
2656
|
+
onClick: we,
|
|
2657
|
+
children: "Повторить"
|
|
2658
|
+
})
|
|
2659
|
+
]
|
|
2660
|
+
}),
|
|
2661
|
+
!fe && !de && P && /* @__PURE__ */ t("button", {
|
|
2662
|
+
type: "button",
|
|
2663
|
+
className: $.replay,
|
|
2664
|
+
"aria-label": "Воспроизвести заново",
|
|
2665
|
+
onClick: () => void ge(),
|
|
2666
|
+
children: /* @__PURE__ */ t(A, {
|
|
2667
|
+
name: "IconReplay",
|
|
2668
|
+
width: 28,
|
|
2669
|
+
height: 28
|
|
2670
|
+
})
|
|
2671
|
+
}),
|
|
2672
|
+
g && r.length > 0 && !fe && !de && /* @__PURE__ */ n("div", {
|
|
2673
|
+
className: `${$.controlsLayer} ${ie || !M ? $.controlsVisible : ""}`,
|
|
2674
|
+
onClick: (e) => e.stopPropagation(),
|
|
2675
|
+
children: [Y && /* @__PURE__ */ n("div", {
|
|
2676
|
+
className: $.settings,
|
|
2677
|
+
role: "dialog",
|
|
2678
|
+
"aria-label": "Настройки видео",
|
|
2679
|
+
children: [
|
|
2680
|
+
/* @__PURE__ */ n("label", { children: [/* @__PURE__ */ t("span", { children: "Скорость" }), /* @__PURE__ */ t("select", {
|
|
2681
|
+
value: G,
|
|
2682
|
+
onChange: (e) => {
|
|
2683
|
+
let t = Number(e.target.value);
|
|
2684
|
+
x.current && (x.current.playbackRate = t);
|
|
2685
|
+
},
|
|
2686
|
+
children: At.map((e) => /* @__PURE__ */ n("option", {
|
|
2687
|
+
value: e,
|
|
2688
|
+
children: [e, "×"]
|
|
2689
|
+
}, e))
|
|
2690
|
+
})] }),
|
|
2691
|
+
X.length > 0 && /* @__PURE__ */ n("label", { children: [/* @__PURE__ */ t("span", { children: "Субтитры" }), /* @__PURE__ */ n("select", {
|
|
2692
|
+
value: J,
|
|
2693
|
+
onChange: (e) => Se(Number(e.target.value)),
|
|
2694
|
+
children: [/* @__PURE__ */ t("option", {
|
|
2695
|
+
value: -1,
|
|
2696
|
+
children: "Выключены"
|
|
2697
|
+
}), X.map(({ track: e, index: n }) => /* @__PURE__ */ t("option", {
|
|
2698
|
+
value: n,
|
|
2699
|
+
children: e.label
|
|
2700
|
+
}, `${e.srcLang}-${e.label}`))]
|
|
2701
|
+
})] }),
|
|
2702
|
+
/* @__PURE__ */ n("button", {
|
|
2703
|
+
type: "button",
|
|
2704
|
+
className: $.settingsAction,
|
|
2705
|
+
"aria-pressed": K,
|
|
2706
|
+
onClick: () => q((e) => !e),
|
|
2707
|
+
children: [/* @__PURE__ */ t("span", { children: "Повтор" }), /* @__PURE__ */ t("span", { children: K ? "Вкл." : "Выкл." })]
|
|
2708
|
+
}),
|
|
2709
|
+
me && /* @__PURE__ */ t("button", {
|
|
2710
|
+
type: "button",
|
|
2711
|
+
className: $.settingsAction,
|
|
2712
|
+
"aria-pressed": ce,
|
|
2713
|
+
onClick: () => void xe(),
|
|
2714
|
+
children: /* @__PURE__ */ n("span", {
|
|
2715
|
+
className: $.settingsActionLabel,
|
|
2716
|
+
children: [/* @__PURE__ */ t(A, {
|
|
2717
|
+
name: "IconPictureInPicture",
|
|
2718
|
+
width: 18,
|
|
2719
|
+
height: 18
|
|
2720
|
+
}), "Картинка в картинке"]
|
|
2721
|
+
})
|
|
2722
|
+
})
|
|
2723
|
+
]
|
|
2724
|
+
}), /* @__PURE__ */ n("div", {
|
|
2725
|
+
className: $.controls,
|
|
2726
|
+
children: [
|
|
2727
|
+
/* @__PURE__ */ t("div", {
|
|
2728
|
+
className: $.controlGroup,
|
|
2729
|
+
children: /* @__PURE__ */ t("button", {
|
|
2730
|
+
type: "button",
|
|
2731
|
+
className: `${$.controlButton} ${$.playButton}`,
|
|
2732
|
+
"aria-label": M ? "Пауза" : "Воспроизвести",
|
|
2733
|
+
title: M ? "Пауза (K)" : "Воспроизвести (K)",
|
|
2734
|
+
onClick: () => void ge(),
|
|
2735
|
+
children: /* @__PURE__ */ t(A, {
|
|
2736
|
+
name: M ? "IconPause" : "IconPlay",
|
|
2737
|
+
width: 24,
|
|
2738
|
+
height: 24
|
|
2739
|
+
})
|
|
2740
|
+
})
|
|
2741
|
+
}),
|
|
2742
|
+
/* @__PURE__ */ n("div", {
|
|
2743
|
+
className: `${$.controlGroup} ${$.volumeGroup}`,
|
|
2744
|
+
children: [/* @__PURE__ */ t("button", {
|
|
2745
|
+
type: "button",
|
|
2746
|
+
className: $.controlButton,
|
|
2747
|
+
"aria-label": U ? "Включить звук" : "Выключить звук",
|
|
2748
|
+
"aria-pressed": U,
|
|
2749
|
+
title: "Звук (M)",
|
|
2750
|
+
onClick: _e,
|
|
2751
|
+
children: /* @__PURE__ */ t(A, {
|
|
2752
|
+
name: U || H === 0 ? "IconVolumeMuted" : "IconVolume",
|
|
2753
|
+
width: 22,
|
|
2754
|
+
height: 22
|
|
2755
|
+
})
|
|
2756
|
+
}), /* @__PURE__ */ t("input", {
|
|
2757
|
+
className: $.volume,
|
|
2758
|
+
type: "range",
|
|
2759
|
+
min: 0,
|
|
2760
|
+
max: 1,
|
|
2761
|
+
step: .05,
|
|
2762
|
+
value: U ? 0 : H,
|
|
2763
|
+
"aria-label": "Громкость",
|
|
2764
|
+
"aria-valuetext": `${Math.round((U ? 0 : H) * 100)}%`,
|
|
2765
|
+
onChange: (e) => ve(Number(e.target.value))
|
|
2766
|
+
})]
|
|
2767
|
+
}),
|
|
2768
|
+
/* @__PURE__ */ n("div", {
|
|
2769
|
+
className: `${$.controlGroup} ${$.timelineGroup}`,
|
|
2770
|
+
children: [
|
|
2771
|
+
/* @__PURE__ */ t("span", {
|
|
2772
|
+
className: $.time,
|
|
2773
|
+
children: Et(I)
|
|
2774
|
+
}),
|
|
2775
|
+
/* @__PURE__ */ t("input", {
|
|
2776
|
+
className: $.timeline,
|
|
2777
|
+
style: Te,
|
|
2778
|
+
type: "range",
|
|
2779
|
+
min: 0,
|
|
2780
|
+
max: R || 0,
|
|
2781
|
+
step: .01,
|
|
2782
|
+
value: Math.min(I, R || 0),
|
|
2783
|
+
"aria-label": "Позиция воспроизведения",
|
|
2784
|
+
"aria-valuetext": `${Et(I)} из ${Et(R)}`,
|
|
2785
|
+
onChange: (e) => ye(Number(e.target.value))
|
|
2786
|
+
}),
|
|
2787
|
+
/* @__PURE__ */ t("span", {
|
|
2788
|
+
className: $.time,
|
|
2789
|
+
children: Et(R)
|
|
2790
|
+
})
|
|
2791
|
+
]
|
|
2792
|
+
}),
|
|
2793
|
+
/* @__PURE__ */ n("div", {
|
|
2794
|
+
className: $.controlGroup,
|
|
2795
|
+
children: [/* @__PURE__ */ t("button", {
|
|
2796
|
+
type: "button",
|
|
2797
|
+
className: $.controlButton,
|
|
2798
|
+
"aria-label": "Настройки",
|
|
2799
|
+
"aria-expanded": Y,
|
|
2800
|
+
title: "Настройки",
|
|
2801
|
+
onClick: () => re((e) => !e),
|
|
2802
|
+
children: /* @__PURE__ */ t(A, {
|
|
2803
|
+
name: "IconSettings",
|
|
2804
|
+
width: 22,
|
|
2805
|
+
height: 22
|
|
2806
|
+
})
|
|
2807
|
+
}), /* @__PURE__ */ t("button", {
|
|
2808
|
+
type: "button",
|
|
2809
|
+
className: $.controlButton,
|
|
2810
|
+
"aria-label": oe ? "Выйти из полноэкранного режима" : "Полноэкранный режим",
|
|
2811
|
+
title: "Полноэкранный режим (F)",
|
|
2812
|
+
onClick: () => void be(),
|
|
2813
|
+
children: /* @__PURE__ */ t(A, {
|
|
2814
|
+
name: oe ? "IconFullscreenExit" : "IconFullscreen",
|
|
2815
|
+
width: 22,
|
|
2816
|
+
height: 22
|
|
2817
|
+
})
|
|
2818
|
+
})]
|
|
2819
|
+
})
|
|
2820
|
+
]
|
|
2821
|
+
})]
|
|
2488
2822
|
})
|
|
2489
2823
|
]
|
|
2490
2824
|
}), /* @__PURE__ */ t("figcaption", {
|
|
@@ -2492,7 +2826,7 @@ var T = {
|
|
|
2492
2826
|
children: a
|
|
2493
2827
|
})]
|
|
2494
2828
|
});
|
|
2495
|
-
},
|
|
2829
|
+
}, Mt = {
|
|
2496
2830
|
root: "_root_1tdda_1",
|
|
2497
2831
|
trigger: "_trigger_1tdda_15",
|
|
2498
2832
|
heading: "_heading_1tdda_41",
|
|
@@ -2502,7 +2836,7 @@ var T = {
|
|
|
2502
2836
|
open: "_open_1tdda_91",
|
|
2503
2837
|
content: "_content_1tdda_99",
|
|
2504
2838
|
contentInner: "_contentInner_1tdda_119"
|
|
2505
|
-
},
|
|
2839
|
+
}, Nt = (e, t, n, r = 16) => {
|
|
2506
2840
|
if (t > Math.max(0, n - r * 2)) {
|
|
2507
2841
|
let t = e - r;
|
|
2508
2842
|
return Math.abs(t) <= 1 ? {
|
|
@@ -2524,7 +2858,7 @@ var T = {
|
|
|
2524
2858
|
alignment: "none",
|
|
2525
2859
|
delta: 0
|
|
2526
2860
|
};
|
|
2527
|
-
},
|
|
2861
|
+
}, Pt = ({ title: e, subtitle: r, children: i, defaultOpen: a = !1, open: o, onOpenChange: l, autoScrollOnOpen: u = !0, scrollOffset: p = 16, className: m = "" }) => {
|
|
2528
2862
|
let h = c(), [g, _] = f(a), v = o ?? g, y = d(null), b = d(null), x = d(v);
|
|
2529
2863
|
return s(() => {
|
|
2530
2864
|
let e = x.current;
|
|
@@ -2534,7 +2868,7 @@ var T = {
|
|
|
2534
2868
|
let r = !1, i = () => {
|
|
2535
2869
|
if (r) return;
|
|
2536
2870
|
r = !0;
|
|
2537
|
-
let e = t.getBoundingClientRect(), n =
|
|
2871
|
+
let e = t.getBoundingClientRect(), n = Nt(e.top, e.height, window.innerHeight, p);
|
|
2538
2872
|
if (n.alignment === "none") return;
|
|
2539
2873
|
let i = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
|
2540
2874
|
window.scrollBy({
|
|
@@ -2555,10 +2889,10 @@ var T = {
|
|
|
2555
2889
|
p
|
|
2556
2890
|
]), /* @__PURE__ */ n("section", {
|
|
2557
2891
|
ref: y,
|
|
2558
|
-
className: `${
|
|
2892
|
+
className: `${Mt.root} ${v ? Mt.open : ""} ${m}`,
|
|
2559
2893
|
children: [/* @__PURE__ */ n("button", {
|
|
2560
2894
|
type: "button",
|
|
2561
|
-
className:
|
|
2895
|
+
className: Mt.trigger,
|
|
2562
2896
|
"aria-expanded": v,
|
|
2563
2897
|
"aria-controls": h,
|
|
2564
2898
|
onClick: () => {
|
|
@@ -2566,41 +2900,35 @@ var T = {
|
|
|
2566
2900
|
o === void 0 && _(e), l?.(e);
|
|
2567
2901
|
},
|
|
2568
2902
|
children: [/* @__PURE__ */ n("span", {
|
|
2569
|
-
className:
|
|
2903
|
+
className: Mt.heading,
|
|
2570
2904
|
children: [/* @__PURE__ */ t("span", {
|
|
2571
|
-
className:
|
|
2905
|
+
className: Mt.title,
|
|
2572
2906
|
children: e
|
|
2573
2907
|
}), r && /* @__PURE__ */ t("span", {
|
|
2574
|
-
className:
|
|
2908
|
+
className: Mt.subtitle,
|
|
2575
2909
|
children: r
|
|
2576
2910
|
})]
|
|
2577
2911
|
}), /* @__PURE__ */ t("span", {
|
|
2578
|
-
className:
|
|
2912
|
+
className: Mt.icon,
|
|
2579
2913
|
"aria-hidden": "true",
|
|
2580
|
-
children: /* @__PURE__ */ t(
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
d: "M5 7.5L10 12.5L15 7.5",
|
|
2585
|
-
stroke: "currentColor",
|
|
2586
|
-
strokeWidth: "1.8",
|
|
2587
|
-
strokeLinecap: "round",
|
|
2588
|
-
strokeLinejoin: "round"
|
|
2589
|
-
})
|
|
2914
|
+
children: /* @__PURE__ */ t(A, {
|
|
2915
|
+
name: "IconChevron",
|
|
2916
|
+
width: 20,
|
|
2917
|
+
height: 20
|
|
2590
2918
|
})
|
|
2591
2919
|
})]
|
|
2592
2920
|
}), /* @__PURE__ */ t("div", {
|
|
2593
2921
|
ref: b,
|
|
2594
2922
|
id: h,
|
|
2595
|
-
className:
|
|
2923
|
+
className: Mt.content,
|
|
2596
2924
|
"aria-hidden": !v,
|
|
2597
2925
|
children: /* @__PURE__ */ t("div", {
|
|
2598
|
-
className:
|
|
2926
|
+
className: Mt.contentInner,
|
|
2599
2927
|
children: i
|
|
2600
2928
|
})
|
|
2601
2929
|
})]
|
|
2602
2930
|
});
|
|
2603
|
-
},
|
|
2931
|
+
}, Ft = ({ children: e, containerId: t = "overlay-root" }) => {
|
|
2604
2932
|
let [n, r] = f(null);
|
|
2605
2933
|
return s(() => {
|
|
2606
2934
|
let e = document.getElementById(t);
|
|
@@ -2615,4 +2943,4 @@ var T = {
|
|
|
2615
2943
|
}, [t]), n ? p(e, n) : null;
|
|
2616
2944
|
};
|
|
2617
2945
|
//#endregion
|
|
2618
|
-
export {
|
|
2946
|
+
export { at as ConfirmModal, Pt as DSAccordion, b as DSBadge, w as DSButton, M as DSCheckbox, Se as DSDataTable, q as DSDateRange, G as DSDateTimePicker, ce as DSDropDown, De as DSDropDownMultiple, E as DSFieldLabel, D as DSFieldMessage, qe as DSFileInput, He as DSFilters, A as DSIcon, Re as DSInfoBlock, ke as DSInput, S as DSLoader, $e as DSModal, Qe as DSModalFrame, ht as DSPageLoader, Ft as DSPortal, Be as DSRadioButton, Ie as DSSearchDropDown, ne as DSSkeleton, ue as DSSort, vt as DSToast, St as DSToastProvider, Tt as DSTooltip, jt as DSVideoPlayerFrame, ot as ErrorModal, et as ModalSystemProvider, st as builtInModalRegistry, tt as defineModalRegistry, R as formatDateTimeLocalValue, Nt as getDSAccordionScrollTarget, fe as getDSDataTablePaginationItems, lt as getErrorMessage, oe as getNextEnabledOptionIndex, K as isValidDateRange, z as parseDateTimeLocalValue, Ye as resetModalStore, xt as resetToastStore, ct as useConfirmModal, dt as useConfirmModalStore, ut as useErrorModal, ft as useErrorModalStore, pt as useModals, Q as useModalsStore, Ct as useToast, bt as useToastStore, pe as validateDSDataTableData };
|