mimir-ui-kit 1.43.8 → 1.43.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/SelectSearch/SelectSearch.d.ts +2 -0
- package/dist/components/SelectSearch/SelectSearch.js +283 -246
- package/dist/components/SelectSearch/types.d.ts +9 -1
- package/dist/components/Slider/Slider.d.ts +5 -1
- package/dist/components/Slider/Slider.js +36 -34
- package/package.json +1 -1
@@ -13,6 +13,7 @@ export declare const SelectSearch: import('react').ForwardRefExoticComponent<Pic
|
|
13
13
|
filterOnSearch?: boolean;
|
14
14
|
items: TSelectOption[];
|
15
15
|
classNameOption?: string;
|
16
|
+
classNameOptionInner?: string;
|
16
17
|
menuPlacement?: import('./types').TMenuPlacement;
|
17
18
|
disabled?: boolean;
|
18
19
|
searchProps?: Pick<import('../Input').TInputProps, "numbersOnly" | "maxLength" | "required">;
|
@@ -26,4 +27,5 @@ export declare const SelectSearch: import('react').ForwardRefExoticComponent<Pic
|
|
26
27
|
loadingIndicatorPlacement?: ELoadingIndicatorPlacement | `${ELoadingIndicatorPlacement}`;
|
27
28
|
groupBy?: string;
|
28
29
|
getGroupTitle?: (groupValue: string) => string;
|
30
|
+
optionLayout?: import('./types').TOptionLayout;
|
29
31
|
} & import('react').RefAttributes<HTMLElement>>;
|
@@ -1,159 +1,175 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { u as
|
3
|
-
import { c as
|
4
|
-
import { forwardRef as
|
5
|
-
import { ESelectSearchSize as
|
6
|
-
import { prepareGroupedItems as
|
7
|
-
import { Icon as
|
8
|
-
import { Button as
|
9
|
-
import { I as
|
10
|
-
import { EInputVariant as
|
11
|
-
import { Loader as
|
12
|
-
import { H as
|
13
|
-
import '../../assets/SelectSearch.css';const
|
1
|
+
import { jsx as r, jsxs as c, Fragment as V } from "react/jsx-runtime";
|
2
|
+
import { u as zt } from "../../index-D5H8gPPn.js";
|
3
|
+
import { c as i } from "../../index-DIxK0V-G.js";
|
4
|
+
import { forwardRef as Lt, useRef as Dt, useState as E, useMemo as q, useEffect as st, useCallback as Vt } from "react";
|
5
|
+
import { ESelectSearchSize as l, ELoadingIndicatorPlacement as x } from "./constants.js";
|
6
|
+
import { prepareGroupedItems as Et, mapSizeToInputSize as it, getDropdownArrowIcon as Tt } from "./utils.js";
|
7
|
+
import { Icon as P } from "../../icons/Icon.js";
|
8
|
+
import { Button as Bt } from "../Button/Button.js";
|
9
|
+
import { I as at } from "../../Input-BU_6U1CW.js";
|
10
|
+
import { EInputVariant as At } from "../Input/constants.js";
|
11
|
+
import { Loader as ct } from "../Loader/Loader.js";
|
12
|
+
import { H as Gt, U as lt, G as dt, W as ut, K as Mt } from "../../combobox-fIVOzEhl.js";
|
13
|
+
import '../../assets/SelectSearch.css';const qt = "_disabled_1rthm_6", Pt = "_container_1rthm_13", jt = "_full_1rthm_26", Ft = "_button_1rthm_38", Ht = "_options_1rthm_52", $t = "_top_1rthm_63", Kt = "_bottom_1rthm_69", Ut = "_s_1rthm_2", Wt = "_m_1rthm_110", Qt = "_l_1rthm_123", Yt = "_loader_1rthm_161", Jt = "_option_1rthm_52", Rt = "_clear_1rthm_200", t = {
|
14
14
|
"select-search": "_select-search_1rthm_2",
|
15
|
-
disabled:
|
16
|
-
container:
|
15
|
+
disabled: qt,
|
16
|
+
container: Pt,
|
17
17
|
"container-open": "_container-open_1rthm_22",
|
18
|
-
full:
|
18
|
+
full: jt,
|
19
19
|
"selected-icon": "_selected-icon_1rthm_30",
|
20
20
|
"selector-icon-open": "_selector-icon-open_1rthm_34",
|
21
|
-
button:
|
21
|
+
button: Ft,
|
22
22
|
"selector-icon": "_selector-icon_1rthm_34",
|
23
|
-
options:
|
24
|
-
top:
|
25
|
-
bottom:
|
23
|
+
options: Ht,
|
24
|
+
top: $t,
|
25
|
+
bottom: Kt,
|
26
26
|
"no-options": "_no-options_1rthm_75",
|
27
|
-
s:
|
28
|
-
m:
|
29
|
-
l:
|
27
|
+
s: Ut,
|
28
|
+
m: Wt,
|
29
|
+
l: Qt,
|
30
30
|
"select-search-input": "_select-search-input_1rthm_136",
|
31
31
|
"select-search-input-disabled": "_select-search-input-disabled_1rthm_139",
|
32
32
|
"group-header": "_group-header_1rthm_146",
|
33
33
|
"sticky-active": "_sticky-active_1rthm_157",
|
34
|
-
loader:
|
34
|
+
loader: Yt,
|
35
35
|
"input-container": "_input-container_1rthm_166",
|
36
|
-
option:
|
36
|
+
option: Jt,
|
37
37
|
"option-active": "_option-active_1rthm_180",
|
38
38
|
"option-inner": "_option-inner_1rthm_183",
|
39
39
|
"right-slot": "_right-slot_1rthm_190",
|
40
40
|
"required-mark": "_required-mark_1rthm_195",
|
41
|
-
clear:
|
41
|
+
clear: Rt,
|
42
42
|
"icon-button": "_icon-button_1rthm_209"
|
43
|
-
},
|
44
|
-
(
|
43
|
+
}, Xt = Lt(
|
44
|
+
(mt, pt) => {
|
45
45
|
const {
|
46
|
-
placeholder:
|
47
|
-
size: o =
|
48
|
-
value:
|
49
|
-
onChange:
|
50
|
-
full:
|
51
|
-
showArrow:
|
46
|
+
placeholder: j,
|
47
|
+
size: o = l.L,
|
48
|
+
value: d,
|
49
|
+
onChange: a,
|
50
|
+
full: ht,
|
51
|
+
showArrow: _t = !0,
|
52
52
|
items: g = [],
|
53
|
-
classNameOption:
|
54
|
-
|
55
|
-
|
53
|
+
classNameOption: F,
|
54
|
+
classNameOptionInner: H,
|
55
|
+
displayValue: S = "name",
|
56
|
+
filterOnSearch: $ = !0,
|
56
57
|
onSearch: I,
|
57
|
-
variant:
|
58
|
-
menuPlacement:
|
59
|
-
disabled:
|
60
|
-
searchProps:
|
61
|
-
withClearButton:
|
62
|
-
disableInput:
|
63
|
-
autocomplete:
|
64
|
-
immediate:
|
65
|
-
noOptionsText:
|
66
|
-
noMatchText:
|
67
|
-
loadOnOpen:
|
68
|
-
loading:
|
69
|
-
loadingIndicatorPlacement:
|
58
|
+
variant: K = At.DefaultGray,
|
59
|
+
menuPlacement: k = "bottom",
|
60
|
+
disabled: u = !1,
|
61
|
+
searchProps: U,
|
62
|
+
withClearButton: T = !1,
|
63
|
+
disableInput: h = !1,
|
64
|
+
autocomplete: W = "on",
|
65
|
+
immediate: ft = !1,
|
66
|
+
noOptionsText: gt = "Нет данных",
|
67
|
+
noMatchText: vt = "Ничего не найдено",
|
68
|
+
loadOnOpen: B,
|
69
|
+
loading: Q,
|
70
|
+
loadingIndicatorPlacement: w = x.Dropdown,
|
70
71
|
groupBy: p,
|
71
|
-
getGroupTitle:
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
72
|
+
getGroupTitle: Y = (e) => e,
|
73
|
+
optionLayout: bt = "name-bottom"
|
74
|
+
} = mt, A = (e) => {
|
75
|
+
if (!e) return "";
|
76
|
+
const n = e[S];
|
77
|
+
return typeof n == "string" ? n : String(n || "");
|
78
|
+
}, yt = (e) => {
|
79
|
+
const n = e[S];
|
80
|
+
return typeof n == "string" ? n : String(n || "");
|
81
|
+
}, G = A(d), C = Dt(null), [_, v] = E(G), [m, b] = E(d), [Nt, J] = E(!1), [M, xt] = E(null), R = Q !== void 0 ? Q : Nt, y = q(() => {
|
82
|
+
if (!$)
|
83
|
+
return g;
|
84
|
+
const e = String(_ || "").trim().toLowerCase();
|
85
|
+
return e ? g.filter((n) => yt(n).toLowerCase().includes(e)) : g;
|
86
|
+
}, [_, g, $, S]), N = q(() => p ? Et(
|
87
|
+
y,
|
76
88
|
p,
|
77
|
-
|
78
|
-
) :
|
79
|
-
const
|
80
|
-
return
|
81
|
-
n.isGroupHeader &&
|
82
|
-
}),
|
83
|
-
}, [
|
84
|
-
count:
|
85
|
-
getScrollElement: () =>
|
86
|
-
estimateSize: () => o ===
|
89
|
+
Y || ((e) => e)
|
90
|
+
) : y, [y, p, Y]), O = q(() => {
|
91
|
+
const e = [];
|
92
|
+
return N.forEach((n, s) => {
|
93
|
+
n.isGroupHeader && e.push(s);
|
94
|
+
}), e;
|
95
|
+
}, [N]), f = zt({
|
96
|
+
count: N.length,
|
97
|
+
getScrollElement: () => C.current,
|
98
|
+
estimateSize: () => o === l.L ? 65 : 49,
|
87
99
|
overscan: 10
|
88
100
|
});
|
89
|
-
|
90
|
-
const
|
91
|
-
if (!
|
101
|
+
st(() => {
|
102
|
+
const e = C.current;
|
103
|
+
if (!e || !p) return;
|
92
104
|
const n = () => {
|
93
|
-
var
|
94
|
-
const
|
95
|
-
let
|
96
|
-
for (let L = 0; L <
|
97
|
-
const
|
98
|
-
if ((((
|
99
|
-
|
100
|
-
const
|
101
|
-
if (
|
105
|
+
var nt, ot;
|
106
|
+
const s = e.scrollTop;
|
107
|
+
let z = null;
|
108
|
+
for (let L = 0; L < O.length; L++) {
|
109
|
+
const rt = O[L];
|
110
|
+
if ((((nt = f.getVirtualItems().find((D) => D.index === rt)) == null ? void 0 : nt.start) || 0) <= s) {
|
111
|
+
z = rt;
|
112
|
+
const D = O[L + 1];
|
113
|
+
if (D !== void 0 && (((ot = f.getVirtualItems().find((Ot) => Ot.index === D)) == null ? void 0 : ot.start) || 0) <= s)
|
102
114
|
continue;
|
103
115
|
} else
|
104
116
|
break;
|
105
117
|
}
|
106
|
-
|
118
|
+
xt(z);
|
107
119
|
};
|
108
|
-
return
|
109
|
-
}, [f,
|
110
|
-
const
|
111
|
-
if (
|
120
|
+
return e.addEventListener("scroll", n), () => e.removeEventListener("scroll", n);
|
121
|
+
}, [f, O, p, C.current]);
|
122
|
+
const X = async () => {
|
123
|
+
if (B)
|
112
124
|
try {
|
113
|
-
|
125
|
+
J(!0), await B();
|
114
126
|
} finally {
|
115
|
-
|
127
|
+
J(!1);
|
116
128
|
}
|
117
|
-
},
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
129
|
+
}, St = (e) => {
|
130
|
+
if (e) {
|
131
|
+
const n = A(e);
|
132
|
+
v(n), b(e), a == null || a(e);
|
133
|
+
} else
|
134
|
+
v(""), b(null), a == null || a({ id: "", name: "" });
|
135
|
+
}, Z = Vt(
|
136
|
+
(e) => {
|
137
|
+
if (h) return;
|
138
|
+
const n = e.target.value;
|
139
|
+
v(n), I == null || I(n), m && n !== A(m) && b(null), !n && d && (a == null || a({ id: "", name: "" }));
|
124
140
|
},
|
125
|
-
[
|
126
|
-
),
|
127
|
-
v(""), b(null),
|
128
|
-
},
|
129
|
-
|
141
|
+
[h, a, I, d, m, S]
|
142
|
+
), It = () => {
|
143
|
+
v(""), b(null), a == null || a({ id: "", name: "" });
|
144
|
+
}, tt = async (e) => {
|
145
|
+
h && e.target.blur(), B && await X();
|
130
146
|
};
|
131
|
-
|
132
|
-
const
|
133
|
-
v(
|
134
|
-
}, [
|
135
|
-
const
|
136
|
-
/* @__PURE__ */
|
147
|
+
st(() => {
|
148
|
+
const e = !d || typeof d == "object" && !Object.keys(d).length;
|
149
|
+
v(e ? "" : G), b(e ? null : d);
|
150
|
+
}, [d, G]);
|
151
|
+
const kt = () => R && (w === x.Dropdown || w === x.Both) ? /* @__PURE__ */ c("div", { className: t.loader, children: [
|
152
|
+
/* @__PURE__ */ r(ct, { size: "s" }),
|
137
153
|
"Загрузка..."
|
138
|
-
] }) :
|
139
|
-
if (
|
154
|
+
] }) : gt, wt = (e) => {
|
155
|
+
if (_t)
|
140
156
|
return {
|
141
157
|
addonType: "react-node",
|
142
|
-
addonContent: /* @__PURE__ */
|
143
|
-
|
144
|
-
/* @__PURE__ */
|
145
|
-
|
158
|
+
addonContent: /* @__PURE__ */ c(V, { children: [
|
159
|
+
R && (w === x.Input || w === x.Both) && /* @__PURE__ */ r(ct, { size: "s" }),
|
160
|
+
/* @__PURE__ */ r(
|
161
|
+
lt,
|
146
162
|
{
|
147
|
-
className:
|
148
|
-
[
|
163
|
+
className: i(t.button, {
|
164
|
+
[t.disabled]: u
|
149
165
|
}),
|
150
|
-
disabled:
|
151
|
-
children: /* @__PURE__ */
|
152
|
-
|
166
|
+
disabled: u,
|
167
|
+
children: /* @__PURE__ */ r(
|
168
|
+
P,
|
153
169
|
{
|
154
|
-
iconName: o ==
|
155
|
-
className:
|
156
|
-
[
|
170
|
+
iconName: o == l.M || o == l.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
|
171
|
+
className: i(t["selector-icon"], {
|
172
|
+
[t["selector-icon-open"]]: e
|
157
173
|
})
|
158
174
|
}
|
159
175
|
)
|
@@ -161,30 +177,39 @@ import '../../assets/SelectSearch.css';const Be = "_disabled_1rthm_6", Ve = "_co
|
|
161
177
|
)
|
162
178
|
] })
|
163
179
|
};
|
164
|
-
},
|
180
|
+
}, et = (e) => {
|
181
|
+
const n = e.name, s = e.bottom && /* @__PURE__ */ r("div", { children: e.bottom });
|
182
|
+
return bt === "bottom-name" ? /* @__PURE__ */ c(V, { children: [
|
183
|
+
s,
|
184
|
+
n
|
185
|
+
] }) : /* @__PURE__ */ c(V, { children: [
|
186
|
+
n,
|
187
|
+
s
|
188
|
+
] });
|
189
|
+
}, Ct = (e) => g.length ? y.length ? p ? /* @__PURE__ */ c(
|
165
190
|
"div",
|
166
191
|
{
|
167
|
-
ref:
|
192
|
+
ref: C,
|
168
193
|
"data-testid": "select-search-options",
|
169
|
-
className:
|
194
|
+
className: i(t.options, t[o], t[k]),
|
170
195
|
style: {
|
171
|
-
height: o ===
|
196
|
+
height: o === l.M || o === l.S ? "240px" : "320px",
|
172
197
|
overflow: "auto"
|
173
198
|
},
|
174
199
|
children: [
|
175
|
-
|
200
|
+
M !== null && /* @__PURE__ */ r(
|
176
201
|
"div",
|
177
202
|
{
|
178
|
-
className:
|
203
|
+
className: t["group-header"],
|
179
204
|
style: {
|
180
205
|
position: "sticky",
|
181
206
|
top: 0,
|
182
207
|
zIndex: 3
|
183
208
|
},
|
184
|
-
children:
|
209
|
+
children: N[M].name
|
185
210
|
}
|
186
211
|
),
|
187
|
-
/* @__PURE__ */
|
212
|
+
/* @__PURE__ */ r(
|
188
213
|
"div",
|
189
214
|
{
|
190
215
|
style: {
|
@@ -192,8 +217,8 @@ import '../../assets/SelectSearch.css';const Be = "_disabled_1rthm_6", Ve = "_co
|
|
192
217
|
width: "100%"
|
193
218
|
},
|
194
219
|
children: f.getVirtualItems().map((n) => {
|
195
|
-
const
|
196
|
-
return /* @__PURE__ */
|
220
|
+
const s = N[n.index];
|
221
|
+
return /* @__PURE__ */ r(
|
197
222
|
"div",
|
198
223
|
{
|
199
224
|
"data-index": n.index,
|
@@ -205,43 +230,49 @@ import '../../assets/SelectSearch.css';const Be = "_disabled_1rthm_6", Ve = "_co
|
|
205
230
|
width: "100%",
|
206
231
|
transform: `translateY(${n.start}px)`
|
207
232
|
},
|
208
|
-
children:
|
233
|
+
children: s.isGroupHeader ? /* @__PURE__ */ r(
|
209
234
|
"div",
|
210
235
|
{
|
211
|
-
className:
|
236
|
+
className: t["group-header"],
|
212
237
|
style: {
|
213
|
-
visibility:
|
238
|
+
visibility: M === n.index ? "hidden" : "visible"
|
214
239
|
},
|
215
|
-
children:
|
240
|
+
children: s.name
|
216
241
|
}
|
217
|
-
) : /* @__PURE__ */
|
218
|
-
|
242
|
+
) : /* @__PURE__ */ c(
|
243
|
+
ut,
|
219
244
|
{
|
220
|
-
value:
|
221
|
-
className: ({ focus:
|
222
|
-
|
223
|
-
|
224
|
-
o &&
|
245
|
+
value: s,
|
246
|
+
className: ({ focus: z }) => i(
|
247
|
+
t.option,
|
248
|
+
F,
|
249
|
+
o && t[o],
|
225
250
|
{
|
226
|
-
[
|
251
|
+
[t["option-active"]]: z
|
227
252
|
}
|
228
253
|
),
|
229
|
-
"data-testid": `select-search-option-${
|
254
|
+
"data-testid": `select-search-option-${s.id}`,
|
230
255
|
children: [
|
231
|
-
/* @__PURE__ */
|
232
|
-
|
233
|
-
i.bottom && /* @__PURE__ */ s("div", { children: i.bottom })
|
234
|
-
] }),
|
235
|
-
u && u.id === i.id && /* @__PURE__ */ s(
|
236
|
-
G,
|
256
|
+
/* @__PURE__ */ r(
|
257
|
+
"div",
|
237
258
|
{
|
238
|
-
|
239
|
-
|
259
|
+
className: i(
|
260
|
+
t["option-inner"],
|
261
|
+
H
|
262
|
+
),
|
263
|
+
children: et(s)
|
264
|
+
}
|
265
|
+
),
|
266
|
+
m && m.id === s.id && /* @__PURE__ */ r(
|
267
|
+
P,
|
268
|
+
{
|
269
|
+
iconName: o === l.M || o === l.S ? "Done16px" : "Done24px",
|
270
|
+
className: t["selected-icon"]
|
240
271
|
}
|
241
272
|
)
|
242
273
|
]
|
243
274
|
},
|
244
|
-
|
275
|
+
s.id
|
245
276
|
)
|
246
277
|
},
|
247
278
|
n.key
|
@@ -251,35 +282,41 @@ import '../../assets/SelectSearch.css';const Be = "_disabled_1rthm_6", Ve = "_co
|
|
251
282
|
)
|
252
283
|
]
|
253
284
|
}
|
254
|
-
) : /* @__PURE__ */
|
255
|
-
|
285
|
+
) : /* @__PURE__ */ r(
|
286
|
+
Mt,
|
256
287
|
{
|
257
|
-
className:
|
288
|
+
className: i(t.options, t[o], t[k]),
|
258
289
|
"data-testid": "select-search-options",
|
259
290
|
style: { width: "100%" },
|
260
291
|
static: !0,
|
261
|
-
children: ({ option: n }) => /* @__PURE__ */
|
262
|
-
|
292
|
+
children: ({ option: n }) => /* @__PURE__ */ c(
|
293
|
+
ut,
|
263
294
|
{
|
264
295
|
value: n,
|
265
|
-
className: ({ focus:
|
266
|
-
|
267
|
-
|
296
|
+
className: ({ focus: s }) => i(
|
297
|
+
t.option,
|
298
|
+
F,
|
268
299
|
{
|
269
|
-
[
|
300
|
+
[t["option-active"]]: s
|
270
301
|
},
|
271
|
-
o &&
|
302
|
+
o && t[o]
|
272
303
|
),
|
273
304
|
children: [
|
274
|
-
/* @__PURE__ */
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
305
|
+
/* @__PURE__ */ r(
|
306
|
+
"div",
|
307
|
+
{
|
308
|
+
className: i(
|
309
|
+
t["option-inner"],
|
310
|
+
H
|
311
|
+
),
|
312
|
+
children: et(n)
|
313
|
+
}
|
314
|
+
),
|
315
|
+
m && m.id === n.id && /* @__PURE__ */ r(
|
316
|
+
P,
|
280
317
|
{
|
281
|
-
iconName: o ===
|
282
|
-
className:
|
318
|
+
iconName: o === l.M || o === l.S ? "Done16px" : "Done24px",
|
319
|
+
className: t["selected-icon"]
|
283
320
|
}
|
284
321
|
)
|
285
322
|
]
|
@@ -287,139 +324,139 @@ import '../../assets/SelectSearch.css';const Be = "_disabled_1rthm_6", Ve = "_co
|
|
287
324
|
n.id
|
288
325
|
)
|
289
326
|
}
|
290
|
-
) : /* @__PURE__ */
|
327
|
+
) : /* @__PURE__ */ r(
|
291
328
|
"div",
|
292
329
|
{
|
293
|
-
className:
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
330
|
+
className: i(
|
331
|
+
t.options,
|
332
|
+
t[o],
|
333
|
+
t["no-options"],
|
334
|
+
t[k]
|
298
335
|
),
|
299
|
-
"data-headlessui-state":
|
300
|
-
children:
|
336
|
+
"data-headlessui-state": e ? "open" : "closed",
|
337
|
+
children: vt
|
301
338
|
}
|
302
|
-
) : /* @__PURE__ */
|
339
|
+
) : /* @__PURE__ */ r(
|
303
340
|
"div",
|
304
341
|
{
|
305
|
-
className:
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
342
|
+
className: i(
|
343
|
+
t.options,
|
344
|
+
t[o],
|
345
|
+
t["no-options"],
|
346
|
+
t[k]
|
310
347
|
),
|
311
|
-
"data-headlessui-state":
|
312
|
-
children:
|
348
|
+
"data-headlessui-state": e ? "open" : "closed",
|
349
|
+
children: kt()
|
313
350
|
}
|
314
351
|
);
|
315
|
-
return /* @__PURE__ */
|
316
|
-
|
352
|
+
return /* @__PURE__ */ r(
|
353
|
+
Gt,
|
317
354
|
{
|
318
355
|
as: "div",
|
319
|
-
value:
|
320
|
-
className:
|
321
|
-
[
|
322
|
-
[
|
356
|
+
value: m,
|
357
|
+
className: i(t["select-search"], {
|
358
|
+
[t.full]: ht,
|
359
|
+
[t.disabled]: u
|
323
360
|
}),
|
324
|
-
onChange:
|
325
|
-
ref:
|
326
|
-
disabled:
|
327
|
-
virtual: p ? void 0 : { options:
|
328
|
-
immediate:
|
329
|
-
children: ({ open:
|
330
|
-
/* @__PURE__ */
|
361
|
+
onChange: St,
|
362
|
+
ref: pt,
|
363
|
+
disabled: u,
|
364
|
+
virtual: p ? void 0 : { options: y },
|
365
|
+
immediate: ft,
|
366
|
+
children: ({ open: e }) => /* @__PURE__ */ c(V, { children: [
|
367
|
+
/* @__PURE__ */ c(
|
331
368
|
"div",
|
332
369
|
{
|
333
|
-
className:
|
334
|
-
[
|
370
|
+
className: i(t.container, t[o], {
|
371
|
+
[t["container-open"]]: e
|
335
372
|
}),
|
336
373
|
children: [
|
337
|
-
|
338
|
-
/* @__PURE__ */
|
339
|
-
|
374
|
+
h && /* @__PURE__ */ c("div", { className: t["input-container"], children: [
|
375
|
+
/* @__PURE__ */ r(
|
376
|
+
lt,
|
340
377
|
{
|
341
|
-
disabled:
|
378
|
+
disabled: u,
|
342
379
|
style: { width: "100%" },
|
343
|
-
onClick:
|
344
|
-
children: /* @__PURE__ */
|
345
|
-
|
380
|
+
onClick: X,
|
381
|
+
children: /* @__PURE__ */ r(
|
382
|
+
dt,
|
346
383
|
{
|
347
|
-
as:
|
348
|
-
label:
|
349
|
-
size:
|
350
|
-
className:
|
351
|
-
[
|
384
|
+
as: at,
|
385
|
+
label: j,
|
386
|
+
size: it(o),
|
387
|
+
className: i(t["select-search-input"], {
|
388
|
+
[t["select-search-input-disabled"]]: h && T
|
352
389
|
}),
|
353
|
-
onChange:
|
354
|
-
value:
|
355
|
-
disabled:
|
356
|
-
variant:
|
357
|
-
rightSlotClassName:
|
358
|
-
requiredMarkClassName:
|
390
|
+
onChange: Z,
|
391
|
+
value: _,
|
392
|
+
disabled: u,
|
393
|
+
variant: K,
|
394
|
+
rightSlotClassName: t["right-slot"],
|
395
|
+
requiredMarkClassName: t["required-mark"],
|
359
396
|
"data-testid": "select-search-input",
|
360
|
-
onFocus:
|
397
|
+
onFocus: tt,
|
361
398
|
rightAddon: {
|
362
399
|
addonType: "icon",
|
363
|
-
addonContent:
|
400
|
+
addonContent: Tt(e, o)
|
364
401
|
},
|
365
|
-
autocomplete:
|
366
|
-
...
|
402
|
+
autocomplete: W,
|
403
|
+
...U
|
367
404
|
}
|
368
405
|
)
|
369
406
|
}
|
370
407
|
),
|
371
|
-
|
372
|
-
|
408
|
+
T && _ && /* @__PURE__ */ r(
|
409
|
+
Bt,
|
373
410
|
{
|
374
411
|
tabIndex: -1,
|
375
|
-
className:
|
376
|
-
[
|
412
|
+
className: i(t.clear, {
|
413
|
+
[t.disabled]: u
|
377
414
|
}),
|
378
|
-
iconButtonClassName:
|
415
|
+
iconButtonClassName: t["icon-button"],
|
379
416
|
isIconButton: !0,
|
380
417
|
iconName: "Close16px",
|
381
418
|
size: "m-s",
|
382
419
|
clear: !0,
|
383
|
-
disabled:
|
420
|
+
disabled: u,
|
384
421
|
variant: "secondary-gray",
|
385
422
|
onClick: (n) => {
|
386
|
-
n.stopPropagation(),
|
423
|
+
n.stopPropagation(), It();
|
387
424
|
},
|
388
425
|
"data-testid": "clear-button"
|
389
426
|
}
|
390
427
|
)
|
391
428
|
] }),
|
392
|
-
!
|
393
|
-
|
429
|
+
!h && /* @__PURE__ */ r(
|
430
|
+
dt,
|
394
431
|
{
|
395
|
-
as:
|
396
|
-
label:
|
397
|
-
size:
|
398
|
-
className:
|
399
|
-
rightSlotClassName:
|
400
|
-
requiredMarkClassName:
|
401
|
-
value:
|
402
|
-
disabled:
|
403
|
-
variant:
|
404
|
-
withClearButton:
|
405
|
-
onChange:
|
406
|
-
rightAddon:
|
432
|
+
as: at,
|
433
|
+
label: j,
|
434
|
+
size: it(o),
|
435
|
+
className: t["select-search-input"],
|
436
|
+
rightSlotClassName: t["right-slot"],
|
437
|
+
requiredMarkClassName: t["required-mark"],
|
438
|
+
value: _,
|
439
|
+
disabled: u,
|
440
|
+
variant: K,
|
441
|
+
withClearButton: T && !!_,
|
442
|
+
onChange: Z,
|
443
|
+
rightAddon: wt(e),
|
407
444
|
"data-testid": "select-search-input",
|
408
|
-
onFocus:
|
409
|
-
autocomplete:
|
410
|
-
...
|
445
|
+
onFocus: tt,
|
446
|
+
autocomplete: W,
|
447
|
+
...U
|
411
448
|
}
|
412
449
|
)
|
413
450
|
]
|
414
451
|
}
|
415
452
|
),
|
416
|
-
|
453
|
+
e && Ct(e)
|
417
454
|
] })
|
418
455
|
}
|
419
456
|
);
|
420
457
|
}
|
421
458
|
);
|
422
|
-
|
459
|
+
Xt.displayName = "SelectSearch";
|
423
460
|
export {
|
424
|
-
|
461
|
+
Xt as SelectSearch
|
425
462
|
};
|
@@ -3,12 +3,13 @@ import { ELoadingIndicatorPlacement, ESelectSearchSize } from './constants';
|
|
3
3
|
import { TInputProps } from '../Input';
|
4
4
|
|
5
5
|
export type TSelectOption = {
|
6
|
-
name: string;
|
6
|
+
name: string | ReactNode;
|
7
7
|
id: number | string;
|
8
8
|
bottom?: ReactNode;
|
9
9
|
[index: string]: unknown;
|
10
10
|
};
|
11
11
|
export type TMenuPlacement = 'top' | 'bottom';
|
12
|
+
export type TOptionLayout = 'name-bottom' | 'bottom-name';
|
12
13
|
export type TSelectSearchProps = Pick<TInputProps, 'withClearButton' | 'variant'> & {
|
13
14
|
/**
|
14
15
|
* Текущее выбранное значение.
|
@@ -44,6 +45,8 @@ export type TSelectSearchProps = Pick<TInputProps, 'withClearButton' | 'variant'
|
|
44
45
|
items: TSelectOption[];
|
45
46
|
/** Класснейм для значения */
|
46
47
|
classNameOption?: string;
|
48
|
+
/** Класснейм для внутреннего контейнера опции */
|
49
|
+
classNameOptionInner?: string;
|
47
50
|
/** Варианты отображения выпадающего меню */
|
48
51
|
menuPlacement?: TMenuPlacement;
|
49
52
|
/** Отключает компонент SelectSearch */
|
@@ -87,4 +90,9 @@ export type TSelectSearchProps = Pick<TInputProps, 'withClearButton' | 'variant'
|
|
87
90
|
* @returns Строка для отображения в заголовке группы
|
88
91
|
*/
|
89
92
|
getGroupTitle?: (groupValue: string) => string;
|
93
|
+
/**
|
94
|
+
* Порядок отображения элементов в опции
|
95
|
+
* @default 'name-bottom'
|
96
|
+
*/
|
97
|
+
optionLayout?: TOptionLayout;
|
90
98
|
};
|
@@ -27,6 +27,10 @@ type TProps = SwiperProps & {
|
|
27
27
|
* Показывать стрелки навигации и количество слайдов.
|
28
28
|
*/
|
29
29
|
needNavigation?: boolean;
|
30
|
+
/**
|
31
|
+
* Приостанавливать автопрокрутку при наведении на слайдер.
|
32
|
+
*/
|
33
|
+
pauseOnMouseEnter?: boolean;
|
30
34
|
/**
|
31
35
|
* Функция, которая будет вызвана при клике на слайд.
|
32
36
|
*/
|
@@ -88,5 +92,5 @@ type TProps = SwiperProps & {
|
|
88
92
|
*/
|
89
93
|
images?: TSlideImage[];
|
90
94
|
};
|
91
|
-
export default function Slider({ images, children, gap, onSlideClick, swiperClassName, slideClassName, imageClassName, navigationClassName, navigationContent, sliderBottomPanelClassName, descriptionsClassName, navigationContentClassName, buttonsVariant, progressBarPosition, isFullPaginationWidth, needNavigation, leftDescription, rightDescription, delay, ...props }: TProps): import("react/jsx-runtime").JSX.Element;
|
95
|
+
export default function Slider({ images, children, gap, onSlideClick, swiperClassName, slideClassName, imageClassName, navigationClassName, navigationContent, sliderBottomPanelClassName, descriptionsClassName, navigationContentClassName, buttonsVariant, progressBarPosition, isFullPaginationWidth, needNavigation, leftDescription, rightDescription, delay, pauseOnMouseEnter, ...props }: TProps): import("react/jsx-runtime").JSX.Element;
|
92
96
|
export {};
|
@@ -1,35 +1,35 @@
|
|
1
1
|
import { jsx as s, jsxs as o, Fragment as N } from "react/jsx-runtime";
|
2
2
|
import { c as a } from "../../index-DIxK0V-G.js";
|
3
|
-
import { memo as F, useCallback as u, useMemo as
|
4
|
-
import { u as
|
3
|
+
import { memo as F, useCallback as u, useMemo as Z, forwardRef as V, useRef as B, useState as W, Children as I } from "react";
|
4
|
+
import { u as ee, S as se, A as re, a as T } from "../../swiper-react-BvAw14a4.js";
|
5
5
|
import { EProgressBarPosition as S } from "./constants.js";
|
6
6
|
import { formatSlideNumber as O } from "./utils.js";
|
7
7
|
import { AppImage as P } from "../Image/Image.js";
|
8
|
-
import { MergedButton as
|
9
|
-
import '../../assets/Slider.css';const
|
10
|
-
swiper:
|
11
|
-
slide:
|
12
|
-
link:
|
13
|
-
image:
|
14
|
-
navigation:
|
8
|
+
import { MergedButton as te } from "../MergedButton/MergedButton.js";
|
9
|
+
import '../../assets/Slider.css';const ne = "_swiper_zqjj3_2", ae = "_slide_zqjj3_8", oe = "_link_zqjj3_15", ie = "_image_zqjj3_21", le = "_navigation_zqjj3_28", ce = "_pagination_zqjj3_46", de = "_slides_zqjj3_65", pe = "_separator_zqjj3_71", ue = "_progress_zqjj3_78", me = "_descriptions_zqjj3_95", e = {
|
10
|
+
swiper: ne,
|
11
|
+
slide: ae,
|
12
|
+
link: oe,
|
13
|
+
image: ie,
|
14
|
+
navigation: le,
|
15
15
|
"navigation-content": "_navigation-content_zqjj3_37",
|
16
|
-
pagination:
|
16
|
+
pagination: ce,
|
17
17
|
"is-full": "_is-full_zqjj3_60",
|
18
|
-
slides:
|
19
|
-
separator:
|
20
|
-
progress:
|
18
|
+
slides: de,
|
19
|
+
separator: pe,
|
20
|
+
progress: ue,
|
21
21
|
"progress-bar-bottom": "_progress-bar-bottom_zqjj3_85",
|
22
22
|
"progress-bar": "_progress-bar_zqjj3_85",
|
23
|
-
descriptions:
|
24
|
-
},
|
23
|
+
descriptions: me
|
24
|
+
}, _e = 15e3, E = F(
|
25
25
|
({
|
26
26
|
variant: t = "white"
|
27
27
|
}) => {
|
28
|
-
const n =
|
28
|
+
const n = ee(), p = u(() => {
|
29
29
|
n.slideNext();
|
30
30
|
}, [n]), c = u(() => {
|
31
31
|
n.slidePrev();
|
32
|
-
}, [n]), m =
|
32
|
+
}, [n]), m = Z(
|
33
33
|
() => [
|
34
34
|
{
|
35
35
|
isIconButton: !0,
|
@@ -46,10 +46,10 @@ import '../../assets/Slider.css';const te = "_swiper_zqjj3_2", ne = "_slide_zqjj
|
|
46
46
|
],
|
47
47
|
[c, t, p]
|
48
48
|
);
|
49
|
-
return /* @__PURE__ */ s(
|
49
|
+
return /* @__PURE__ */ s(te, { buttons: m });
|
50
50
|
}
|
51
51
|
), b = F(
|
52
|
-
|
52
|
+
V((t, n) => /* @__PURE__ */ s(
|
53
53
|
"div",
|
54
54
|
{
|
55
55
|
"data-testid": "progress-bar-wrapper",
|
@@ -65,7 +65,7 @@ import '../../assets/Slider.css';const te = "_swiper_zqjj3_2", ne = "_slide_zqjj
|
|
65
65
|
}
|
66
66
|
))
|
67
67
|
);
|
68
|
-
function
|
68
|
+
function ze({
|
69
69
|
images: t,
|
70
70
|
children: n,
|
71
71
|
gap: p,
|
@@ -84,17 +84,18 @@ function qe({
|
|
84
84
|
needNavigation: i = !0,
|
85
85
|
leftDescription: C,
|
86
86
|
rightDescription: y,
|
87
|
-
delay: D =
|
88
|
-
|
87
|
+
delay: D = _e,
|
88
|
+
pauseOnMouseEnter: U = !1,
|
89
|
+
...Y
|
89
90
|
}) {
|
90
|
-
const d = B(null), h = B(null), [
|
91
|
-
j ?
|
92
|
-
),
|
91
|
+
const d = B(null), h = B(null), [G, H] = W(1), j = !(typeof n == "function") && !!n, J = j ? I.count(n) : 0, K = (t == null ? void 0 : t.length) ?? 0, A = O(G), x = O(
|
92
|
+
j ? J : K
|
93
|
+
), Q = u(() => {
|
93
94
|
if (h.current && i) {
|
94
95
|
const r = h.current.swiper;
|
95
|
-
|
96
|
+
H(r.realIndex + 1);
|
96
97
|
}
|
97
|
-
}, [i]),
|
98
|
+
}, [i]), X = u(
|
98
99
|
(r, l) => {
|
99
100
|
if (d.current && i) {
|
100
101
|
const g = r.params.autoplay.delay, w = l / g * 100;
|
@@ -104,23 +105,24 @@ function qe({
|
|
104
105
|
[i]
|
105
106
|
);
|
106
107
|
return /* @__PURE__ */ o(
|
107
|
-
|
108
|
+
se,
|
108
109
|
{
|
109
|
-
...
|
110
|
+
...Y,
|
110
111
|
ref: h,
|
111
112
|
className: a(e.swiper, m),
|
112
113
|
loop: !0,
|
113
114
|
spaceBetween: p,
|
114
115
|
autoplay: {
|
115
116
|
delay: D,
|
116
|
-
disableOnInteraction: !1
|
117
|
+
disableOnInteraction: !1,
|
118
|
+
pauseOnMouseEnter: U
|
117
119
|
},
|
118
120
|
fadeEffect: {
|
119
121
|
crossFade: !0
|
120
122
|
},
|
121
|
-
modules: [
|
122
|
-
onAutoplayTimeLeft:
|
123
|
-
onSlideChange:
|
123
|
+
modules: [re],
|
124
|
+
onAutoplayTimeLeft: X,
|
125
|
+
onSlideChange: Q,
|
124
126
|
children: [
|
125
127
|
/* @__PURE__ */ s(
|
126
128
|
"div",
|
@@ -246,5 +248,5 @@ function qe({
|
|
246
248
|
);
|
247
249
|
}
|
248
250
|
export {
|
249
|
-
|
251
|
+
ze as default
|
250
252
|
};
|