@efficiency-point/design-system 0.1.7 → 0.1.9
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 +19 -0
- package/dist/components/DSTextarea/DSTextarea.d.ts +30 -0
- package/dist/components/DSTextarea/DSTextarea.d.ts.map +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +241 -109
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -657,24 +657,24 @@ var T = {
|
|
|
657
657
|
}
|
|
658
658
|
}, s))
|
|
659
659
|
}), Y = {
|
|
660
|
-
wrapper: "
|
|
661
|
-
label: "
|
|
662
|
-
container: "
|
|
663
|
-
trigger: "
|
|
664
|
-
disabledText: "
|
|
665
|
-
sm: "
|
|
666
|
-
md: "
|
|
667
|
-
lg: "
|
|
668
|
-
value: "
|
|
669
|
-
placeholder: "
|
|
670
|
-
chevron: "
|
|
671
|
-
chevronOpen: "
|
|
672
|
-
menu: "
|
|
673
|
-
option: "
|
|
674
|
-
selected: "
|
|
675
|
-
message: "
|
|
676
|
-
error: "
|
|
677
|
-
errorState: "
|
|
660
|
+
wrapper: "_wrapper_1gp7o_1",
|
|
661
|
+
label: "_label_1gp7o_17",
|
|
662
|
+
container: "_container_1gp7o_29",
|
|
663
|
+
trigger: "_trigger_1gp7o_37",
|
|
664
|
+
disabledText: "_disabledText_1gp7o_39",
|
|
665
|
+
sm: "_sm_1gp7o_61",
|
|
666
|
+
md: "_md_1gp7o_71",
|
|
667
|
+
lg: "_lg_1gp7o_83",
|
|
668
|
+
value: "_value_1gp7o_143",
|
|
669
|
+
placeholder: "_placeholder_1gp7o_145",
|
|
670
|
+
chevron: "_chevron_1gp7o_201",
|
|
671
|
+
chevronOpen: "_chevronOpen_1gp7o_227",
|
|
672
|
+
menu: "_menu_1gp7o_235",
|
|
673
|
+
option: "_option_1gp7o_265",
|
|
674
|
+
selected: "_selected_1gp7o_335",
|
|
675
|
+
message: "_message_1gp7o_355",
|
|
676
|
+
error: "_error_1gp7o_357",
|
|
677
|
+
errorState: "_errorState_1gp7o_383"
|
|
678
678
|
}, re = 8, ie = 6, ae = 120, oe = (e, t, n) => {
|
|
679
679
|
if (!e.length) return -1;
|
|
680
680
|
for (let r = 0; r < e.length; r += 1) {
|
|
@@ -2013,11 +2013,143 @@ var T = {
|
|
|
2013
2013
|
})
|
|
2014
2014
|
]
|
|
2015
2015
|
});
|
|
2016
|
-
}, Je =
|
|
2016
|
+
}, Je = {
|
|
2017
|
+
wrapper: "_wrapper_1bwdq_1",
|
|
2018
|
+
control: "_control_1bwdq_15",
|
|
2019
|
+
textarea: "_textarea_1bwdq_25",
|
|
2020
|
+
disabledText: "_disabledText_1bwdq_27",
|
|
2021
|
+
sm: "_sm_1bwdq_103",
|
|
2022
|
+
md: "_md_1bwdq_117",
|
|
2023
|
+
lg: "_lg_1bwdq_131",
|
|
2024
|
+
autoResize: "_autoResize_1bwdq_145",
|
|
2025
|
+
manualResize: "_manualResize_1bwdq_155",
|
|
2026
|
+
textareaError: "_textareaError_1bwdq_163",
|
|
2027
|
+
clearAction: "_clearAction_1bwdq_171",
|
|
2028
|
+
messages: "_messages_1bwdq_251",
|
|
2029
|
+
counter: "_counter_1bwdq_265"
|
|
2030
|
+
}, Ye = 2;
|
|
2031
|
+
function Xe(e) {
|
|
2032
|
+
let t = window.getComputedStyle(e), n = Number.parseFloat(t.lineHeight);
|
|
2033
|
+
return Number.isFinite(n) ? n : Number.parseFloat(t.fontSize) * 1.4;
|
|
2034
|
+
}
|
|
2035
|
+
function Ze({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, readOnly: l = !1, stringWhileDisabled: u = !1, label: f, error: p, hint: m, className: h = "", name: g, id: _, size: v = "md", clearable: y = !1, required: b = !1, maxLength: x, showCount: S = !1, minRows: C = Ye, maxRows: w, autoResize: T = !0, ...O }) {
|
|
2036
|
+
let k = c(), j = _ ?? `ds-textarea-${g ?? k}`, M = d(null), N = m ? `${j}-hint` : void 0, P = p ? `${j}-error` : void 0, F = S && x ? `${j}-count` : void 0, I = [
|
|
2037
|
+
N,
|
|
2038
|
+
P,
|
|
2039
|
+
F
|
|
2040
|
+
].filter(Boolean).join(" ") || void 0, L = Math.max(1, C), R = w === void 0 ? void 0 : Math.max(L, w), z = o(() => {
|
|
2041
|
+
let e = M.current;
|
|
2042
|
+
if (!e || !T) return;
|
|
2043
|
+
let t = window.getComputedStyle(e), n = Xe(e), r = Number.parseFloat(t.paddingTop) + Number.parseFloat(t.paddingBottom) + Number.parseFloat(t.borderTopWidth) + Number.parseFloat(t.borderBottomWidth), i = n * L + r, a = R === void 0 ? Infinity : n * R + r;
|
|
2044
|
+
e.style.height = "auto";
|
|
2045
|
+
let o = Math.min(Math.max(e.scrollHeight, i), a);
|
|
2046
|
+
e.style.height = `${o}px`, e.style.overflowY = e.scrollHeight > a ? "auto" : "hidden";
|
|
2047
|
+
}, [
|
|
2048
|
+
T,
|
|
2049
|
+
R,
|
|
2050
|
+
L
|
|
2051
|
+
]);
|
|
2052
|
+
s(() => {
|
|
2053
|
+
z();
|
|
2054
|
+
}, [z, e]), s(() => {
|
|
2055
|
+
if (!T) return;
|
|
2056
|
+
window.addEventListener("resize", z);
|
|
2057
|
+
let e = M.current?.parentElement, t;
|
|
2058
|
+
if (e && typeof ResizeObserver < "u") {
|
|
2059
|
+
let n = e.getBoundingClientRect().width;
|
|
2060
|
+
t = new ResizeObserver(([e]) => {
|
|
2061
|
+
!e || e.contentRect.width === n || (n = e.contentRect.width, z());
|
|
2062
|
+
}), t.observe(e);
|
|
2063
|
+
}
|
|
2064
|
+
return () => {
|
|
2065
|
+
window.removeEventListener("resize", z), t?.disconnect();
|
|
2066
|
+
};
|
|
2067
|
+
}, [T, z]);
|
|
2068
|
+
let B = (e) => {
|
|
2069
|
+
r?.(e.target.value, e), z();
|
|
2070
|
+
}, V = () => {
|
|
2071
|
+
let e = M.current;
|
|
2072
|
+
e && ((Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set)?.call(e, ""), e.dispatchEvent(new Event("input", { bubbles: !0 })), e.focus(), z());
|
|
2073
|
+
}, H = { "--ds-textarea-min-rows": L };
|
|
2074
|
+
return /* @__PURE__ */ n("div", {
|
|
2075
|
+
className: `${Je.wrapper} ${h}`,
|
|
2076
|
+
children: [
|
|
2077
|
+
f && /* @__PURE__ */ t(E, {
|
|
2078
|
+
htmlFor: j,
|
|
2079
|
+
required: b,
|
|
2080
|
+
disabled: a,
|
|
2081
|
+
children: f
|
|
2082
|
+
}),
|
|
2083
|
+
a && u ? /* @__PURE__ */ t("div", {
|
|
2084
|
+
id: j,
|
|
2085
|
+
className: `${Je.disabledText} ${Je[v]}`,
|
|
2086
|
+
style: H,
|
|
2087
|
+
"aria-describedby": I,
|
|
2088
|
+
children: e || i
|
|
2089
|
+
}) : /* @__PURE__ */ n("div", {
|
|
2090
|
+
className: Je.control,
|
|
2091
|
+
children: [/* @__PURE__ */ t("textarea", {
|
|
2092
|
+
ref: M,
|
|
2093
|
+
id: j,
|
|
2094
|
+
name: g,
|
|
2095
|
+
value: e,
|
|
2096
|
+
placeholder: i,
|
|
2097
|
+
disabled: a,
|
|
2098
|
+
readOnly: l,
|
|
2099
|
+
required: b,
|
|
2100
|
+
maxLength: x,
|
|
2101
|
+
rows: L,
|
|
2102
|
+
style: H,
|
|
2103
|
+
"aria-invalid": !!p,
|
|
2104
|
+
"aria-describedby": I,
|
|
2105
|
+
className: `${Je.textarea} ${Je[v]} ${T ? Je.autoResize : Je.manualResize} ${p ? Je.textareaError : ""}`,
|
|
2106
|
+
onChange: B,
|
|
2107
|
+
...O
|
|
2108
|
+
}), y && e && !a && !l && /* @__PURE__ */ t("button", {
|
|
2109
|
+
type: "button",
|
|
2110
|
+
className: Je.clearAction,
|
|
2111
|
+
"aria-label": "Очистить поле",
|
|
2112
|
+
onClick: V,
|
|
2113
|
+
children: /* @__PURE__ */ t(A, {
|
|
2114
|
+
name: "IconCross",
|
|
2115
|
+
width: 20,
|
|
2116
|
+
height: 20
|
|
2117
|
+
})
|
|
2118
|
+
})]
|
|
2119
|
+
}),
|
|
2120
|
+
(m || p || F) && /* @__PURE__ */ n("div", {
|
|
2121
|
+
className: Je.messages,
|
|
2122
|
+
children: [
|
|
2123
|
+
m && !p && /* @__PURE__ */ t(D, {
|
|
2124
|
+
id: N,
|
|
2125
|
+
children: m
|
|
2126
|
+
}),
|
|
2127
|
+
p && /* @__PURE__ */ t(D, {
|
|
2128
|
+
id: P,
|
|
2129
|
+
variant: "error",
|
|
2130
|
+
children: p
|
|
2131
|
+
}),
|
|
2132
|
+
F && /* @__PURE__ */ n("span", {
|
|
2133
|
+
id: F,
|
|
2134
|
+
className: Je.counter,
|
|
2135
|
+
children: [
|
|
2136
|
+
e.length,
|
|
2137
|
+
" / ",
|
|
2138
|
+
x
|
|
2139
|
+
]
|
|
2140
|
+
})
|
|
2141
|
+
]
|
|
2142
|
+
})
|
|
2143
|
+
]
|
|
2144
|
+
});
|
|
2145
|
+
}
|
|
2146
|
+
//#endregion
|
|
2147
|
+
//#region src/components/DSModal/modal.store.ts
|
|
2148
|
+
var Qe = 0, Q = v((e) => ({
|
|
2017
2149
|
modals: [],
|
|
2018
2150
|
openModal: (t, n = {}, r = {}) => {
|
|
2019
|
-
|
|
2020
|
-
let i = `ds-modal-${
|
|
2151
|
+
Qe += 1;
|
|
2152
|
+
let i = `ds-modal-${Qe}`;
|
|
2021
2153
|
return e((e) => ({ modals: [...e.modals, {
|
|
2022
2154
|
id: i,
|
|
2023
2155
|
name: t,
|
|
@@ -2029,7 +2161,7 @@ var T = {
|
|
|
2029
2161
|
closeModal: (t) => e((e) => ({ modals: e.modals.filter((e) => e.id !== t) })),
|
|
2030
2162
|
closeTopModal: () => e((e) => ({ modals: e.modals.slice(0, -1) })),
|
|
2031
2163
|
closeAllModals: () => e({ modals: [] })
|
|
2032
|
-
})),
|
|
2164
|
+
})), $e = () => Q.setState({ modals: [] }), et = {
|
|
2033
2165
|
layer: "_layer_1opno_1",
|
|
2034
2166
|
backdrop: "_backdrop_1opno_3",
|
|
2035
2167
|
panel: "_panel_1opno_5",
|
|
@@ -2038,14 +2170,14 @@ var T = {
|
|
|
2038
2170
|
description: "_description_1opno_13",
|
|
2039
2171
|
content: "_content_1opno_15",
|
|
2040
2172
|
close: "_close_1opno_17"
|
|
2041
|
-
},
|
|
2173
|
+
}, tt = "button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"])", nt = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "Закрыть модальное окно", className: l = "", role: u = "dialog" }) => {
|
|
2042
2174
|
let f = c(), p = c(), m = d(null), h = Q((e) => e.closeModal);
|
|
2043
2175
|
return s(() => {
|
|
2044
2176
|
let e = document.activeElement, t = m.current;
|
|
2045
|
-
return (t?.querySelector(
|
|
2177
|
+
return (t?.querySelector(tt) ?? t)?.focus(), () => e?.focus();
|
|
2046
2178
|
}, []), /* @__PURE__ */ n("div", {
|
|
2047
2179
|
ref: m,
|
|
2048
|
-
className: `${
|
|
2180
|
+
className: `${et.panel} ${l}`,
|
|
2049
2181
|
role: u,
|
|
2050
2182
|
"aria-modal": "true",
|
|
2051
2183
|
"aria-labelledby": r ? f : void 0,
|
|
@@ -2053,7 +2185,7 @@ var T = {
|
|
|
2053
2185
|
tabIndex: -1,
|
|
2054
2186
|
onKeyDown: (e) => {
|
|
2055
2187
|
if (e.key !== "Tab") return;
|
|
2056
|
-
let t = Array.from(m.current?.querySelectorAll(
|
|
2188
|
+
let t = Array.from(m.current?.querySelectorAll(tt) ?? []);
|
|
2057
2189
|
if (!t.length) {
|
|
2058
2190
|
e.preventDefault();
|
|
2059
2191
|
return;
|
|
@@ -2063,13 +2195,13 @@ var T = {
|
|
|
2063
2195
|
},
|
|
2064
2196
|
children: [
|
|
2065
2197
|
(r || o) && /* @__PURE__ */ n("header", {
|
|
2066
|
-
className:
|
|
2198
|
+
className: et.header,
|
|
2067
2199
|
children: [r && /* @__PURE__ */ t("h2", {
|
|
2068
2200
|
id: f,
|
|
2069
|
-
className:
|
|
2201
|
+
className: et.title,
|
|
2070
2202
|
children: r
|
|
2071
2203
|
}), /* @__PURE__ */ t(w, {
|
|
2072
|
-
className:
|
|
2204
|
+
className: et.close,
|
|
2073
2205
|
variant: "empty",
|
|
2074
2206
|
size: "sm",
|
|
2075
2207
|
"aria-label": o,
|
|
@@ -2083,16 +2215,16 @@ var T = {
|
|
|
2083
2215
|
}),
|
|
2084
2216
|
i && /* @__PURE__ */ t("p", {
|
|
2085
2217
|
id: p,
|
|
2086
|
-
className:
|
|
2218
|
+
className: et.description,
|
|
2087
2219
|
children: i
|
|
2088
2220
|
}),
|
|
2089
2221
|
/* @__PURE__ */ t("div", {
|
|
2090
|
-
className:
|
|
2222
|
+
className: et.content,
|
|
2091
2223
|
children: e
|
|
2092
2224
|
})
|
|
2093
2225
|
]
|
|
2094
2226
|
});
|
|
2095
|
-
},
|
|
2227
|
+
}, rt = ({ registry: e }) => {
|
|
2096
2228
|
let n = Q((e) => e.modals), r = Q((e) => e.closeModal), i = Q((e) => e.closeAllModals);
|
|
2097
2229
|
return s(() => {
|
|
2098
2230
|
let e = (e) => {
|
|
@@ -2102,12 +2234,12 @@ var T = {
|
|
|
2102
2234
|
};
|
|
2103
2235
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
2104
2236
|
}, [r]), !n.length || typeof document > "u" ? null : p(/* @__PURE__ */ t("div", {
|
|
2105
|
-
className:
|
|
2237
|
+
className: et.layer,
|
|
2106
2238
|
"aria-label": "Модальные окна",
|
|
2107
2239
|
children: n.map((a, o) => {
|
|
2108
2240
|
let s = e[a.name];
|
|
2109
2241
|
return s ? /* @__PURE__ */ t("div", {
|
|
2110
|
-
className:
|
|
2242
|
+
className: et.backdrop,
|
|
2111
2243
|
"aria-hidden": o !== n.length - 1 || void 0,
|
|
2112
2244
|
onMouseDown: (e) => {
|
|
2113
2245
|
e.target === e.currentTarget && a.closeOnBackdrop && r(a.id);
|
|
@@ -2121,7 +2253,7 @@ var T = {
|
|
|
2121
2253
|
}, a.id) : null;
|
|
2122
2254
|
})
|
|
2123
2255
|
}), document.body);
|
|
2124
|
-
},
|
|
2256
|
+
}, it = ({ registry: r, children: i, lockBodyScroll: a = !0 }) => {
|
|
2125
2257
|
let o = Q((e) => e.modals.length);
|
|
2126
2258
|
return s(() => {
|
|
2127
2259
|
if (!a || o === 0) return;
|
|
@@ -2129,23 +2261,23 @@ var T = {
|
|
|
2129
2261
|
return document.body.style.overflow = "hidden", () => {
|
|
2130
2262
|
document.body.style.overflow = e;
|
|
2131
2263
|
};
|
|
2132
|
-
}, [a, o]), /* @__PURE__ */ n(e, { children: [i, /* @__PURE__ */ t(
|
|
2133
|
-
},
|
|
2264
|
+
}, [a, o]), /* @__PURE__ */ n(e, { children: [i, /* @__PURE__ */ t(rt, { registry: r })] });
|
|
2265
|
+
}, at = (e) => e, ot = {
|
|
2134
2266
|
message: "_message_1vtru_1",
|
|
2135
2267
|
actions: "_actions_1vtru_3"
|
|
2136
|
-
},
|
|
2268
|
+
}, st = /* @__PURE__ */ new Map(), ct = 0, lt = ({ modalId: e, close: r, title: i = "Подтверждение", message: a = "Продолжить действие?", confirmLabel: o = "Подтвердить", cancelLabel: s = "Отмена", tone: c = "default", requestId: l }) => {
|
|
2137
2269
|
let u = (e) => {
|
|
2138
|
-
|
|
2270
|
+
st.get(l)?.(e), st.delete(l), r();
|
|
2139
2271
|
};
|
|
2140
|
-
return /* @__PURE__ */ n(
|
|
2272
|
+
return /* @__PURE__ */ n(nt, {
|
|
2141
2273
|
modalId: e,
|
|
2142
2274
|
title: i,
|
|
2143
2275
|
role: "alertdialog",
|
|
2144
2276
|
children: [/* @__PURE__ */ t("p", {
|
|
2145
|
-
className:
|
|
2277
|
+
className: ot.message,
|
|
2146
2278
|
children: a
|
|
2147
2279
|
}), /* @__PURE__ */ n("div", {
|
|
2148
|
-
className:
|
|
2280
|
+
className: ot.actions,
|
|
2149
2281
|
children: [/* @__PURE__ */ t(w, {
|
|
2150
2282
|
variant: "outline",
|
|
2151
2283
|
onClick: () => u(!1),
|
|
@@ -2157,40 +2289,40 @@ var T = {
|
|
|
2157
2289
|
})]
|
|
2158
2290
|
})]
|
|
2159
2291
|
});
|
|
2160
|
-
},
|
|
2292
|
+
}, ut = ({ modalId: e, close: r, title: i = "Ошибка", message: a, closeLabel: o = "Закрыть" }) => /* @__PURE__ */ n(nt, {
|
|
2161
2293
|
modalId: e,
|
|
2162
2294
|
title: i,
|
|
2163
2295
|
role: "alertdialog",
|
|
2164
2296
|
children: [/* @__PURE__ */ t("p", {
|
|
2165
|
-
className:
|
|
2297
|
+
className: ot.message,
|
|
2166
2298
|
children: a
|
|
2167
2299
|
}), /* @__PURE__ */ t("div", {
|
|
2168
|
-
className:
|
|
2300
|
+
className: ot.actions,
|
|
2169
2301
|
children: /* @__PURE__ */ t(w, {
|
|
2170
2302
|
onClick: r,
|
|
2171
2303
|
children: o
|
|
2172
2304
|
})
|
|
2173
2305
|
})]
|
|
2174
|
-
}),
|
|
2175
|
-
ConfirmModal:
|
|
2176
|
-
ErrorModal:
|
|
2177
|
-
}),
|
|
2306
|
+
}), dt = at({
|
|
2307
|
+
ConfirmModal: lt,
|
|
2308
|
+
ErrorModal: ut
|
|
2309
|
+
}), ft = () => {
|
|
2178
2310
|
let e = Q((e) => e.openModal);
|
|
2179
2311
|
return (t = {}) => new Promise((n) => {
|
|
2180
|
-
|
|
2181
|
-
let r = `confirm-${
|
|
2182
|
-
|
|
2312
|
+
ct += 1;
|
|
2313
|
+
let r = `confirm-${ct}`;
|
|
2314
|
+
st.set(r, n), e("ConfirmModal", {
|
|
2183
2315
|
...t,
|
|
2184
2316
|
requestId: r
|
|
2185
2317
|
}, { closeOnEscape: !1 });
|
|
2186
2318
|
});
|
|
2187
|
-
},
|
|
2319
|
+
}, pt = (e) => e instanceof Error ? e.message : typeof e == "string" ? e : e && typeof e == "object" && "message" in e && typeof e.message == "string" ? e.message : "Произошла неизвестная ошибка", mt = () => {
|
|
2188
2320
|
let e = Q((e) => e.openModal);
|
|
2189
2321
|
return { showError: (t, n) => e("ErrorModal", {
|
|
2190
2322
|
title: n,
|
|
2191
|
-
message:
|
|
2323
|
+
message: pt(t)
|
|
2192
2324
|
}) };
|
|
2193
|
-
},
|
|
2325
|
+
}, ht = v(() => ({})), gt = v(() => ({})), _t = () => {
|
|
2194
2326
|
let e = Q((e) => e.modals), t = Q((e) => e.openModal);
|
|
2195
2327
|
return {
|
|
2196
2328
|
openModal: (e, n = {}, r) => t(e, n, r),
|
|
@@ -2200,7 +2332,7 @@ var T = {
|
|
|
2200
2332
|
isOpen: (t) => e.some((e) => e.name === t),
|
|
2201
2333
|
count: e.length
|
|
2202
2334
|
};
|
|
2203
|
-
},
|
|
2335
|
+
}, vt = {
|
|
2204
2336
|
wrapper: "_wrapper_1qbyz_1",
|
|
2205
2337
|
container: "_container_1qbyz_15",
|
|
2206
2338
|
inner: "_inner_1qbyz_35",
|
|
@@ -2208,29 +2340,29 @@ var T = {
|
|
|
2208
2340
|
jump: "_jump_1qbyz_1",
|
|
2209
2341
|
cube__inner: "_cube__inner_1qbyz_67",
|
|
2210
2342
|
morph: "_morph_1qbyz_1"
|
|
2211
|
-
},
|
|
2212
|
-
className:
|
|
2343
|
+
}, yt = () => /* @__PURE__ */ t("div", {
|
|
2344
|
+
className: vt.wrapper,
|
|
2213
2345
|
children: /* @__PURE__ */ t("div", {
|
|
2214
|
-
className:
|
|
2346
|
+
className: vt.container,
|
|
2215
2347
|
children: /* @__PURE__ */ n("div", {
|
|
2216
|
-
className:
|
|
2348
|
+
className: vt.inner,
|
|
2217
2349
|
children: [
|
|
2218
2350
|
/* @__PURE__ */ t("div", {
|
|
2219
|
-
className:
|
|
2220
|
-
children: /* @__PURE__ */ t("div", { className:
|
|
2351
|
+
className: vt.cube,
|
|
2352
|
+
children: /* @__PURE__ */ t("div", { className: vt.cube__inner })
|
|
2221
2353
|
}),
|
|
2222
2354
|
/* @__PURE__ */ t("div", {
|
|
2223
|
-
className:
|
|
2224
|
-
children: /* @__PURE__ */ t("div", { className:
|
|
2355
|
+
className: vt.cube,
|
|
2356
|
+
children: /* @__PURE__ */ t("div", { className: vt.cube__inner })
|
|
2225
2357
|
}),
|
|
2226
2358
|
/* @__PURE__ */ t("div", {
|
|
2227
|
-
className:
|
|
2228
|
-
children: /* @__PURE__ */ t("div", { className:
|
|
2359
|
+
className: vt.cube,
|
|
2360
|
+
children: /* @__PURE__ */ t("div", { className: vt.cube__inner })
|
|
2229
2361
|
})
|
|
2230
2362
|
]
|
|
2231
2363
|
})
|
|
2232
2364
|
})
|
|
2233
|
-
}),
|
|
2365
|
+
}), bt = {
|
|
2234
2366
|
viewport: "_viewport_15mi5_1",
|
|
2235
2367
|
"top-right": "_top-right_15mi5_3",
|
|
2236
2368
|
"top-left": "_top-left_15mi5_5",
|
|
@@ -2243,7 +2375,7 @@ var T = {
|
|
|
2243
2375
|
success: "_success_15mi5_19",
|
|
2244
2376
|
warning: "_warning_15mi5_21",
|
|
2245
2377
|
error: "_error_15mi5_23"
|
|
2246
|
-
},
|
|
2378
|
+
}, xt = {
|
|
2247
2379
|
info: {
|
|
2248
2380
|
name: "IconInfoCircle",
|
|
2249
2381
|
color: "var(--color-primary)"
|
|
@@ -2260,7 +2392,7 @@ var T = {
|
|
|
2260
2392
|
name: "IconWarning",
|
|
2261
2393
|
color: "var(--color-error)"
|
|
2262
2394
|
}
|
|
2263
|
-
},
|
|
2395
|
+
}, St = ({ toast: e, onClose: r }) => {
|
|
2264
2396
|
let [i, a] = f(!1), o = d(e.duration), c = d(Date.now());
|
|
2265
2397
|
return s(() => {
|
|
2266
2398
|
if (i || e.duration <= 0) return;
|
|
@@ -2275,7 +2407,7 @@ var T = {
|
|
|
2275
2407
|
e.duration,
|
|
2276
2408
|
e.id
|
|
2277
2409
|
]), /* @__PURE__ */ n("article", {
|
|
2278
|
-
className: `${
|
|
2410
|
+
className: `${bt.toast} ${bt[e.variant]}`,
|
|
2279
2411
|
role: e.variant === "error" ? "alert" : "status",
|
|
2280
2412
|
"aria-live": e.variant === "error" ? "assertive" : "polite",
|
|
2281
2413
|
onMouseEnter: () => a(!0),
|
|
@@ -2284,12 +2416,12 @@ var T = {
|
|
|
2284
2416
|
onBlur: () => a(!1),
|
|
2285
2417
|
children: [
|
|
2286
2418
|
/* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(A, {
|
|
2287
|
-
...
|
|
2419
|
+
...xt[e.variant],
|
|
2288
2420
|
width: 24,
|
|
2289
2421
|
height: 24
|
|
2290
2422
|
}) }),
|
|
2291
2423
|
/* @__PURE__ */ n("div", {
|
|
2292
|
-
className:
|
|
2424
|
+
className: bt.body,
|
|
2293
2425
|
children: [
|
|
2294
2426
|
e.title && /* @__PURE__ */ t("strong", { children: e.title }),
|
|
2295
2427
|
/* @__PURE__ */ t("div", { children: e.message }),
|
|
@@ -2316,11 +2448,11 @@ var T = {
|
|
|
2316
2448
|
})
|
|
2317
2449
|
]
|
|
2318
2450
|
});
|
|
2319
|
-
},
|
|
2451
|
+
}, Ct = 0, wt = v((e) => ({
|
|
2320
2452
|
toasts: [],
|
|
2321
2453
|
showToast: (t) => {
|
|
2322
|
-
|
|
2323
|
-
let n = `ds-toast-${
|
|
2454
|
+
Ct += 1;
|
|
2455
|
+
let n = `ds-toast-${Ct}`;
|
|
2324
2456
|
return e((e) => ({ toasts: [...e.toasts, {
|
|
2325
2457
|
variant: "info",
|
|
2326
2458
|
duration: 5e3,
|
|
@@ -2331,18 +2463,18 @@ var T = {
|
|
|
2331
2463
|
},
|
|
2332
2464
|
removeToast: (t) => e((e) => ({ toasts: e.toasts.filter((e) => e.id !== t) })),
|
|
2333
2465
|
clearToasts: () => e({ toasts: [] })
|
|
2334
|
-
})),
|
|
2335
|
-
let n =
|
|
2466
|
+
})), Tt = () => wt.setState({ toasts: [] }), Et = ({ position: e = "top-right" }) => {
|
|
2467
|
+
let n = wt((e) => e.toasts), r = wt((e) => e.removeToast);
|
|
2336
2468
|
return /* @__PURE__ */ t("div", {
|
|
2337
|
-
className: `${
|
|
2469
|
+
className: `${bt.viewport} ${bt[e]}`,
|
|
2338
2470
|
"aria-label": "Уведомления",
|
|
2339
|
-
children: n.map((e) => /* @__PURE__ */ t(
|
|
2471
|
+
children: n.map((e) => /* @__PURE__ */ t(St, {
|
|
2340
2472
|
toast: e,
|
|
2341
2473
|
onClose: r
|
|
2342
2474
|
}, e.id))
|
|
2343
2475
|
});
|
|
2344
|
-
},
|
|
2345
|
-
let e =
|
|
2476
|
+
}, Dt = () => {
|
|
2477
|
+
let e = wt((e) => e.showToast), t = wt((e) => e.removeToast), n = wt((e) => e.clearToasts), r = o((t) => e({
|
|
2346
2478
|
...t,
|
|
2347
2479
|
variant: "info"
|
|
2348
2480
|
}), [e]), i = o((t) => e({
|
|
@@ -2372,7 +2504,7 @@ var T = {
|
|
|
2372
2504
|
i,
|
|
2373
2505
|
a
|
|
2374
2506
|
]);
|
|
2375
|
-
},
|
|
2507
|
+
}, Ot = {
|
|
2376
2508
|
root: "_root_s9o0g_1",
|
|
2377
2509
|
tooltip: "_tooltip_s9o0g_3",
|
|
2378
2510
|
"ds-tooltip-in": "_ds-tooltip-in_s9o0g_1",
|
|
@@ -2380,7 +2512,7 @@ var T = {
|
|
|
2380
2512
|
bottom: "_bottom_s9o0g_7",
|
|
2381
2513
|
left: "_left_s9o0g_9",
|
|
2382
2514
|
right: "_right_s9o0g_11"
|
|
2383
|
-
},
|
|
2515
|
+
}, kt = ({ content: e, children: i, placement: o = "top", delay: l = 450, disabled: u = !1, maxWidth: p = 280, className: m = "" }) => {
|
|
2384
2516
|
let h = c(), [g, _] = f(!1), v = d(null), y = () => {
|
|
2385
2517
|
u || !e || (v.current = setTimeout(() => _(!0), l));
|
|
2386
2518
|
}, b = () => {
|
|
@@ -2402,17 +2534,17 @@ var T = {
|
|
|
2402
2534
|
onBlur: b
|
|
2403
2535
|
});
|
|
2404
2536
|
return /* @__PURE__ */ n("span", {
|
|
2405
|
-
className: `${
|
|
2537
|
+
className: `${Ot.root} ${m}`,
|
|
2406
2538
|
onPointerDown: g ? b : y,
|
|
2407
2539
|
children: [x, g && /* @__PURE__ */ t("span", {
|
|
2408
2540
|
id: h,
|
|
2409
2541
|
role: "tooltip",
|
|
2410
|
-
className: `${
|
|
2542
|
+
className: `${Ot.tooltip} ${Ot[o]}`,
|
|
2411
2543
|
style: { maxWidth: p },
|
|
2412
2544
|
children: e
|
|
2413
2545
|
})]
|
|
2414
2546
|
});
|
|
2415
|
-
},
|
|
2547
|
+
}, At = (e) => {
|
|
2416
2548
|
if (!Number.isFinite(e) || e < 0) return "00:00";
|
|
2417
2549
|
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
2550
|
return n ? `${n}:${a}` : a;
|
|
@@ -2445,19 +2577,19 @@ var T = {
|
|
|
2445
2577
|
settingsActionLabel: "_settingsActionLabel_1oxvl_677",
|
|
2446
2578
|
caption: "_caption_1oxvl_689",
|
|
2447
2579
|
fullscreen: "_fullscreen_1oxvl_703"
|
|
2448
|
-
},
|
|
2580
|
+
}, jt = 2500, Mt = 5, Nt = .05, Pt = [
|
|
2449
2581
|
.5,
|
|
2450
2582
|
.75,
|
|
2451
2583
|
1,
|
|
2452
2584
|
1.25,
|
|
2453
2585
|
1.5,
|
|
2454
2586
|
2
|
|
2455
|
-
],
|
|
2587
|
+
], Ft = ({ 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
2588
|
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
2589
|
track: e,
|
|
2458
2590
|
index: t
|
|
2459
2591
|
})).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),
|
|
2592
|
+
ae(!0), window.clearTimeout(C.current), M && !Y && (C.current = window.setTimeout(() => ae(!1), jt));
|
|
2461
2593
|
}, [M, Y]);
|
|
2462
2594
|
s(() => {
|
|
2463
2595
|
E(!1), O(r.length > 0), j(!1), N(!1), F(!1), L(0), z(0), V(0);
|
|
@@ -2516,7 +2648,7 @@ var T = {
|
|
|
2516
2648
|
let t = e.target;
|
|
2517
2649
|
if (/^(INPUT|SELECT|BUTTON)$/.test(t.tagName)) return;
|
|
2518
2650
|
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" ?
|
|
2651
|
+
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" ? Mt : -5))) : e.key === "ArrowUp" || e.key === "ArrowDown" ? (e.preventDefault(), ve(H + (e.key === "ArrowUp" ? Nt : -.05))) : e.key === "Escape" && re(!1), he();
|
|
2520
2652
|
}, we = () => {
|
|
2521
2653
|
let e = x.current;
|
|
2522
2654
|
E(!1), O(!0), e?.load();
|
|
@@ -2615,7 +2747,7 @@ var T = {
|
|
|
2615
2747
|
"aria-hidden": "true",
|
|
2616
2748
|
children: /* @__PURE__ */ t("div", {
|
|
2617
2749
|
className: $.loaderScale,
|
|
2618
|
-
children: /* @__PURE__ */ t(
|
|
2750
|
+
children: /* @__PURE__ */ t(yt, {})
|
|
2619
2751
|
})
|
|
2620
2752
|
}), /* @__PURE__ */ t("span", { children: "Загрузка видео" })]
|
|
2621
2753
|
}),
|
|
@@ -2683,7 +2815,7 @@ var T = {
|
|
|
2683
2815
|
let t = Number(e.target.value);
|
|
2684
2816
|
x.current && (x.current.playbackRate = t);
|
|
2685
2817
|
},
|
|
2686
|
-
children:
|
|
2818
|
+
children: Pt.map((e) => /* @__PURE__ */ n("option", {
|
|
2687
2819
|
value: e,
|
|
2688
2820
|
children: [e, "×"]
|
|
2689
2821
|
}, e))
|
|
@@ -2770,7 +2902,7 @@ var T = {
|
|
|
2770
2902
|
children: [
|
|
2771
2903
|
/* @__PURE__ */ t("span", {
|
|
2772
2904
|
className: $.time,
|
|
2773
|
-
children:
|
|
2905
|
+
children: At(I)
|
|
2774
2906
|
}),
|
|
2775
2907
|
/* @__PURE__ */ t("input", {
|
|
2776
2908
|
className: $.timeline,
|
|
@@ -2781,12 +2913,12 @@ var T = {
|
|
|
2781
2913
|
step: .01,
|
|
2782
2914
|
value: Math.min(I, R || 0),
|
|
2783
2915
|
"aria-label": "Позиция воспроизведения",
|
|
2784
|
-
"aria-valuetext": `${
|
|
2916
|
+
"aria-valuetext": `${At(I)} из ${At(R)}`,
|
|
2785
2917
|
onChange: (e) => ye(Number(e.target.value))
|
|
2786
2918
|
}),
|
|
2787
2919
|
/* @__PURE__ */ t("span", {
|
|
2788
2920
|
className: $.time,
|
|
2789
|
-
children:
|
|
2921
|
+
children: At(R)
|
|
2790
2922
|
})
|
|
2791
2923
|
]
|
|
2792
2924
|
}),
|
|
@@ -2826,7 +2958,7 @@ var T = {
|
|
|
2826
2958
|
children: a
|
|
2827
2959
|
})]
|
|
2828
2960
|
});
|
|
2829
|
-
},
|
|
2961
|
+
}, It = {
|
|
2830
2962
|
root: "_root_1tdda_1",
|
|
2831
2963
|
trigger: "_trigger_1tdda_15",
|
|
2832
2964
|
heading: "_heading_1tdda_41",
|
|
@@ -2836,7 +2968,7 @@ var T = {
|
|
|
2836
2968
|
open: "_open_1tdda_91",
|
|
2837
2969
|
content: "_content_1tdda_99",
|
|
2838
2970
|
contentInner: "_contentInner_1tdda_119"
|
|
2839
|
-
},
|
|
2971
|
+
}, Lt = (e, t, n, r = 16) => {
|
|
2840
2972
|
if (t > Math.max(0, n - r * 2)) {
|
|
2841
2973
|
let t = e - r;
|
|
2842
2974
|
return Math.abs(t) <= 1 ? {
|
|
@@ -2858,7 +2990,7 @@ var T = {
|
|
|
2858
2990
|
alignment: "none",
|
|
2859
2991
|
delta: 0
|
|
2860
2992
|
};
|
|
2861
|
-
},
|
|
2993
|
+
}, Rt = ({ title: e, subtitle: r, children: i, defaultOpen: a = !1, open: o, onOpenChange: l, autoScrollOnOpen: u = !0, scrollOffset: p = 16, className: m = "" }) => {
|
|
2862
2994
|
let h = c(), [g, _] = f(a), v = o ?? g, y = d(null), b = d(null), x = d(v);
|
|
2863
2995
|
return s(() => {
|
|
2864
2996
|
let e = x.current;
|
|
@@ -2868,7 +3000,7 @@ var T = {
|
|
|
2868
3000
|
let r = !1, i = () => {
|
|
2869
3001
|
if (r) return;
|
|
2870
3002
|
r = !0;
|
|
2871
|
-
let e = t.getBoundingClientRect(), n =
|
|
3003
|
+
let e = t.getBoundingClientRect(), n = Lt(e.top, e.height, window.innerHeight, p);
|
|
2872
3004
|
if (n.alignment === "none") return;
|
|
2873
3005
|
let i = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
|
2874
3006
|
window.scrollBy({
|
|
@@ -2889,10 +3021,10 @@ var T = {
|
|
|
2889
3021
|
p
|
|
2890
3022
|
]), /* @__PURE__ */ n("section", {
|
|
2891
3023
|
ref: y,
|
|
2892
|
-
className: `${
|
|
3024
|
+
className: `${It.root} ${v ? It.open : ""} ${m}`,
|
|
2893
3025
|
children: [/* @__PURE__ */ n("button", {
|
|
2894
3026
|
type: "button",
|
|
2895
|
-
className:
|
|
3027
|
+
className: It.trigger,
|
|
2896
3028
|
"aria-expanded": v,
|
|
2897
3029
|
"aria-controls": h,
|
|
2898
3030
|
onClick: () => {
|
|
@@ -2900,16 +3032,16 @@ var T = {
|
|
|
2900
3032
|
o === void 0 && _(e), l?.(e);
|
|
2901
3033
|
},
|
|
2902
3034
|
children: [/* @__PURE__ */ n("span", {
|
|
2903
|
-
className:
|
|
3035
|
+
className: It.heading,
|
|
2904
3036
|
children: [/* @__PURE__ */ t("span", {
|
|
2905
|
-
className:
|
|
3037
|
+
className: It.title,
|
|
2906
3038
|
children: e
|
|
2907
3039
|
}), r && /* @__PURE__ */ t("span", {
|
|
2908
|
-
className:
|
|
3040
|
+
className: It.subtitle,
|
|
2909
3041
|
children: r
|
|
2910
3042
|
})]
|
|
2911
3043
|
}), /* @__PURE__ */ t("span", {
|
|
2912
|
-
className:
|
|
3044
|
+
className: It.icon,
|
|
2913
3045
|
"aria-hidden": "true",
|
|
2914
3046
|
children: /* @__PURE__ */ t(A, {
|
|
2915
3047
|
name: "IconChevron",
|
|
@@ -2920,15 +3052,15 @@ var T = {
|
|
|
2920
3052
|
}), /* @__PURE__ */ t("div", {
|
|
2921
3053
|
ref: b,
|
|
2922
3054
|
id: h,
|
|
2923
|
-
className:
|
|
3055
|
+
className: It.content,
|
|
2924
3056
|
"aria-hidden": !v,
|
|
2925
3057
|
children: /* @__PURE__ */ t("div", {
|
|
2926
|
-
className:
|
|
3058
|
+
className: It.contentInner,
|
|
2927
3059
|
children: i
|
|
2928
3060
|
})
|
|
2929
3061
|
})]
|
|
2930
3062
|
});
|
|
2931
|
-
},
|
|
3063
|
+
}, zt = ({ children: e, containerId: t = "overlay-root" }) => {
|
|
2932
3064
|
let [n, r] = f(null);
|
|
2933
3065
|
return s(() => {
|
|
2934
3066
|
let e = document.getElementById(t);
|
|
@@ -2943,4 +3075,4 @@ var T = {
|
|
|
2943
3075
|
}, [t]), n ? p(e, n) : null;
|
|
2944
3076
|
};
|
|
2945
3077
|
//#endregion
|
|
2946
|
-
export {
|
|
3078
|
+
export { lt as ConfirmModal, Rt 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, rt as DSModal, nt as DSModalFrame, yt as DSPageLoader, zt as DSPortal, Be as DSRadioButton, Ie as DSSearchDropDown, ne as DSSkeleton, ue as DSSort, Ze as DSTextarea, St as DSToast, Et as DSToastProvider, kt as DSTooltip, Ft as DSVideoPlayerFrame, ut as ErrorModal, it as ModalSystemProvider, dt as builtInModalRegistry, at as defineModalRegistry, R as formatDateTimeLocalValue, Lt as getDSAccordionScrollTarget, fe as getDSDataTablePaginationItems, pt as getErrorMessage, oe as getNextEnabledOptionIndex, K as isValidDateRange, z as parseDateTimeLocalValue, $e as resetModalStore, Tt as resetToastStore, ft as useConfirmModal, ht as useConfirmModalStore, mt as useErrorModal, gt as useErrorModalStore, _t as useModals, Q as useModalsStore, Dt as useToast, wt as useToastStore, pe as validateDSDataTableData };
|