@rescui/switcher 0.13.5-RUI-297-Add-react-compiler-to-the-packages-build-dbbefd7b8.10 → 0.13.5-RUI-297-Add-react-compiler-to-the-packages-build-8aaaed4be.39
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/lib/index.css +87 -77
- package/lib/public-api.p.css +5 -0
- package/lib/public-api.pcss +5 -0
- package/lib/switcher.js +378 -116
- package/lib/switcher.p.module.css.js +19 -19
- package/lib/use-safe-id.d.ts +3 -1
- package/lib/use-safe-id.js +6 -11
- package/lib/vertical-switcher.d.ts +1 -1
- package/lib/vertical-switcher.js +465 -176
- package/lib/vertical-switcher.p.module.css.js +20 -20
- package/package.json +8 -7
package/lib/vertical-switcher.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import _extends from '@babel/runtime-corejs3/helpers/esm/extends';
|
|
3
|
+
import { c } from 'react-compiler-runtime';
|
|
4
|
+
import React, { useRef, useState, useEffect, createContext, useContext, cloneElement } from 'react';
|
|
3
5
|
import PropTypes from 'prop-types';
|
|
4
6
|
import cn from 'classnames';
|
|
5
7
|
import { useThemeWithUndefined } from '@rescui/ui-contexts';
|
|
@@ -13,7 +15,6 @@ const noop = () => {};
|
|
|
13
15
|
const verticalSwitcherContext = /*#__PURE__*/createContext({
|
|
14
16
|
switcherValue: null,
|
|
15
17
|
onChange: noop,
|
|
16
|
-
handleOptionRef: () => noop,
|
|
17
18
|
disabled: null,
|
|
18
19
|
name: null
|
|
19
20
|
});
|
|
@@ -30,212 +31,500 @@ const themeToClass = {
|
|
|
30
31
|
const modeToClass = {
|
|
31
32
|
classic: styles.modeClassic,
|
|
32
33
|
rock: styles.modeRock
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const processOptions = _ref => {
|
|
36
|
-
let {
|
|
37
|
-
rawOptions,
|
|
38
|
-
value,
|
|
39
|
-
iconPosition
|
|
40
|
-
} = _ref;
|
|
41
|
-
const options = [];
|
|
42
|
-
let foundIndexByValue = null;
|
|
43
|
-
let currentIndex = 0;
|
|
44
|
-
let withLeftIcons = false;
|
|
45
|
-
|
|
46
|
-
for (const option of rawOptions) {
|
|
47
|
-
options.push({
|
|
48
|
-
label: option.label,
|
|
49
|
-
value: option.value,
|
|
50
|
-
icon: option.icon,
|
|
51
|
-
'aria-label': option['aria-label']
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
if ( /*#__PURE__*/React.isValidElement(option.icon) && iconPosition === 'left') {
|
|
55
|
-
withLeftIcons = true;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (option.value === value && foundIndexByValue === null) {
|
|
59
|
-
foundIndexByValue = currentIndex;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
currentIndex++;
|
|
63
|
-
} // If some options on the first depth level have icons, we should align all other options accordingly
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
if (withLeftIcons) {
|
|
67
|
-
options.forEach(option => {
|
|
68
|
-
if (! /*#__PURE__*/React.isValidElement(option.icon)) {
|
|
69
|
-
option.icon = /*#__PURE__*/React.createElement("span", {
|
|
70
|
-
className: styles.fakeIcon
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
}
|
|
34
|
+
};
|
|
75
35
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
};
|
|
36
|
+
const findIndexByValue = (options, value) => {
|
|
37
|
+
const index = options.findIndex(option => option.value === value);
|
|
38
|
+
return index === -1 ? 0 : index;
|
|
80
39
|
}; // check for ignored jsx values and empty string, more info https://reactjs.org/docs/jsx-in-depth.html#booleans-null-and-undefined-are-ignored
|
|
81
40
|
|
|
82
41
|
|
|
83
42
|
const isNodeEmpty = node => node === null || typeof node === 'undefined' || node === false || node === true || node === '';
|
|
84
43
|
|
|
85
|
-
function Option(
|
|
86
|
-
|
|
44
|
+
function Option(t0) {
|
|
45
|
+
const $ = c(28);
|
|
46
|
+
const {
|
|
87
47
|
label,
|
|
88
48
|
value,
|
|
89
49
|
icon,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
} = _ref2;
|
|
50
|
+
"aria-label": ariaLabel
|
|
51
|
+
} = t0;
|
|
93
52
|
const {
|
|
94
53
|
switcherValue,
|
|
95
54
|
onChange,
|
|
96
|
-
handleOptionRef,
|
|
97
55
|
disabled,
|
|
98
56
|
name
|
|
99
57
|
} = useContext(verticalSwitcherContext);
|
|
100
58
|
const selected = switcherValue === value;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
}
|
|
59
|
+
let t1;
|
|
60
|
+
|
|
61
|
+
if ($[0] !== label) {
|
|
62
|
+
t1 = isNodeEmpty(label);
|
|
63
|
+
$[0] = label;
|
|
64
|
+
$[1] = t1;
|
|
65
|
+
} else {
|
|
66
|
+
t1 = $[1];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const isWithoutText = t1;
|
|
70
|
+
const t2 = String(value);
|
|
71
|
+
const t3 = selected && styles.selected;
|
|
72
|
+
let t4;
|
|
73
|
+
|
|
74
|
+
if ($[2] !== t3) {
|
|
75
|
+
t4 = cn(styles.option, t3);
|
|
76
|
+
$[2] = t3;
|
|
77
|
+
$[3] = t4;
|
|
78
|
+
} else {
|
|
79
|
+
t4 = $[3];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const t5 = selected && " vertical-switcher-option-selected";
|
|
83
|
+
let t6;
|
|
84
|
+
|
|
85
|
+
if ($[4] !== t5) {
|
|
86
|
+
t6 = cn("vertical-switcher-option", t5);
|
|
87
|
+
$[4] = t5;
|
|
88
|
+
$[5] = t6;
|
|
89
|
+
} else {
|
|
90
|
+
t6 = $[5];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const t7 = String(value);
|
|
94
|
+
let t8;
|
|
95
|
+
|
|
96
|
+
if ($[6] !== onChange || $[7] !== value) {
|
|
97
|
+
t8 = () => onChange(value);
|
|
98
|
+
|
|
99
|
+
$[6] = onChange;
|
|
100
|
+
$[7] = value;
|
|
101
|
+
$[8] = t8;
|
|
102
|
+
} else {
|
|
103
|
+
t8 = $[8];
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
let t9;
|
|
107
|
+
|
|
108
|
+
if ($[9] !== disabled || $[10] !== name || $[11] !== selected || $[12] !== t7 || $[13] !== t8) {
|
|
109
|
+
t9 = /*#__PURE__*/React.createElement("input", {
|
|
110
|
+
type: "radio",
|
|
111
|
+
value: t7,
|
|
112
|
+
onChange: t8,
|
|
113
|
+
className: styles.radio,
|
|
114
|
+
checked: selected,
|
|
115
|
+
disabled: disabled,
|
|
116
|
+
name: name
|
|
117
|
+
});
|
|
118
|
+
$[9] = disabled;
|
|
119
|
+
$[10] = name;
|
|
120
|
+
$[11] = selected;
|
|
121
|
+
$[12] = t7;
|
|
122
|
+
$[13] = t8;
|
|
123
|
+
$[14] = t9;
|
|
124
|
+
} else {
|
|
125
|
+
t9 = $[14];
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
let t10;
|
|
129
|
+
|
|
130
|
+
if ($[15] !== icon) {
|
|
131
|
+
t10 = /*#__PURE__*/ /*#__PURE__*/React.isValidElement(icon) && /*#__PURE__*/cloneElement(icon, {
|
|
132
|
+
className: cn(icon.props.className, styles.icon),
|
|
133
|
+
"data-render-all-sizes": true
|
|
134
|
+
});
|
|
135
|
+
$[15] = icon;
|
|
136
|
+
$[16] = t10;
|
|
137
|
+
} else {
|
|
138
|
+
t10 = $[16];
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
let t11;
|
|
142
|
+
|
|
143
|
+
if ($[17] !== isWithoutText || $[18] !== label) {
|
|
144
|
+
t11 = !isWithoutText && /*#__PURE__*/React.createElement("span", {
|
|
145
|
+
className: styles.optionLabel
|
|
146
|
+
}, label);
|
|
147
|
+
$[17] = isWithoutText;
|
|
148
|
+
$[18] = label;
|
|
149
|
+
$[19] = t11;
|
|
150
|
+
} else {
|
|
151
|
+
t11 = $[19];
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
let t12;
|
|
155
|
+
|
|
156
|
+
if ($[20] !== ariaLabel || $[21] !== t10 || $[22] !== t11 || $[23] !== t2 || $[24] !== t4 || $[25] !== t6 || $[26] !== t9) {
|
|
157
|
+
t12 = /*#__PURE__*/React.createElement("label", {
|
|
158
|
+
key: t2,
|
|
159
|
+
"data-rs-internal": "vertical-switcher__option",
|
|
160
|
+
className: t4,
|
|
161
|
+
"data-test": t6,
|
|
162
|
+
"aria-label": ariaLabel
|
|
163
|
+
}, t9, t10, t11);
|
|
164
|
+
$[20] = ariaLabel;
|
|
165
|
+
$[21] = t10;
|
|
166
|
+
$[22] = t11;
|
|
167
|
+
$[23] = t2;
|
|
168
|
+
$[24] = t4;
|
|
169
|
+
$[25] = t6;
|
|
170
|
+
$[26] = t9;
|
|
171
|
+
$[27] = t12;
|
|
172
|
+
} else {
|
|
173
|
+
t12 = $[27];
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return t12;
|
|
123
177
|
}
|
|
124
178
|
|
|
125
|
-
function VerticalSwitcher(
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
179
|
+
function VerticalSwitcher(t0) {
|
|
180
|
+
const $ = c(65);
|
|
181
|
+
let className;
|
|
182
|
+
let disabled;
|
|
183
|
+
let name;
|
|
184
|
+
let onChange;
|
|
185
|
+
let options;
|
|
186
|
+
let rest;
|
|
187
|
+
let style;
|
|
188
|
+
let switcherValue;
|
|
189
|
+
let t1;
|
|
190
|
+
let t2;
|
|
191
|
+
let t3;
|
|
192
|
+
let themeFromProps;
|
|
193
|
+
|
|
194
|
+
if ($[0] !== t0) {
|
|
195
|
+
({
|
|
196
|
+
className,
|
|
197
|
+
theme: themeFromProps,
|
|
198
|
+
size: t1,
|
|
199
|
+
disabled,
|
|
200
|
+
options,
|
|
201
|
+
value: switcherValue,
|
|
202
|
+
mode: t2,
|
|
203
|
+
iconPosition: t3,
|
|
204
|
+
onChange,
|
|
205
|
+
style,
|
|
206
|
+
name,
|
|
207
|
+
...rest
|
|
208
|
+
} = t0);
|
|
209
|
+
$[0] = t0;
|
|
210
|
+
$[1] = className;
|
|
211
|
+
$[2] = disabled;
|
|
212
|
+
$[3] = name;
|
|
213
|
+
$[4] = onChange;
|
|
214
|
+
$[5] = options;
|
|
215
|
+
$[6] = rest;
|
|
216
|
+
$[7] = style;
|
|
217
|
+
$[8] = switcherValue;
|
|
218
|
+
$[9] = t1;
|
|
219
|
+
$[10] = t2;
|
|
220
|
+
$[11] = t3;
|
|
221
|
+
$[12] = themeFromProps;
|
|
222
|
+
} else {
|
|
223
|
+
className = $[1];
|
|
224
|
+
disabled = $[2];
|
|
225
|
+
name = $[3];
|
|
226
|
+
onChange = $[4];
|
|
227
|
+
options = $[5];
|
|
228
|
+
rest = $[6];
|
|
229
|
+
style = $[7];
|
|
230
|
+
switcherValue = $[8];
|
|
231
|
+
t1 = $[9];
|
|
232
|
+
t2 = $[10];
|
|
233
|
+
t3 = $[11];
|
|
234
|
+
themeFromProps = $[12];
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
const size = t1 === undefined ? "m" : t1;
|
|
238
|
+
const mode = t2 === undefined ? "classic" : t2;
|
|
239
|
+
const iconPosition = t3 === undefined ? "left" : t3;
|
|
141
240
|
const containerRef = useRef(null);
|
|
142
241
|
const theme = useThemeWithUndefined(themeFromProps);
|
|
143
242
|
const uniqueId = useSafeId();
|
|
144
|
-
|
|
145
|
-
options,
|
|
146
|
-
activeIndex
|
|
147
|
-
} = processOptions({
|
|
148
|
-
rawOptions,
|
|
149
|
-
value: switcherValue,
|
|
150
|
-
iconPosition
|
|
151
|
-
});
|
|
152
|
-
const handleOptionRef = useCallback(index => ref => {
|
|
153
|
-
if (!ref) {
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
243
|
+
let t4;
|
|
156
244
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
245
|
+
if ($[13] !== options || $[14] !== switcherValue) {
|
|
246
|
+
t4 = findIndexByValue(options, switcherValue);
|
|
247
|
+
$[13] = options;
|
|
248
|
+
$[14] = switcherValue;
|
|
249
|
+
$[15] = t4;
|
|
250
|
+
} else {
|
|
251
|
+
t4 = $[15];
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
const activeIndex = t4;
|
|
255
|
+
let t5;
|
|
256
|
+
|
|
257
|
+
if ($[16] !== iconPosition || $[17] !== options) {
|
|
258
|
+
t5 = iconPosition === "left" && options.some(_temp);
|
|
259
|
+
$[16] = iconPosition;
|
|
260
|
+
$[17] = options;
|
|
261
|
+
$[18] = t5;
|
|
262
|
+
} else {
|
|
263
|
+
t5 = $[18];
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
const withLeftIcons = t5;
|
|
267
|
+
let t6;
|
|
268
|
+
|
|
269
|
+
if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
|
|
270
|
+
t6 = {
|
|
271
|
+
offset: 0,
|
|
272
|
+
height: 0,
|
|
273
|
+
hidden: true
|
|
274
|
+
};
|
|
275
|
+
$[19] = t6;
|
|
276
|
+
} else {
|
|
277
|
+
t6 = $[19];
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
const [mark, setMark] = useState(t6);
|
|
166
281
|
const [isMarkTransitionEnabled, setIsMarkTransitionEnabled] = useState(false);
|
|
167
282
|
const firstMarkUpdate = useRef(true);
|
|
283
|
+
let t7;
|
|
168
284
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
285
|
+
if ($[20] !== activeIndex) {
|
|
286
|
+
t7 = t8 => {
|
|
287
|
+
const isValueChanged = t8 === undefined ? false : t8;
|
|
288
|
+
const activeEl = containerRef.current?.children.item(activeIndex);
|
|
172
289
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
290
|
+
if (!activeEl) {
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
176
293
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
});
|
|
294
|
+
const parentEl = activeEl.parentElement;
|
|
295
|
+
const activeElBox = activeEl.getBoundingClientRect();
|
|
296
|
+
const parentBox = parentEl.getBoundingClientRect();
|
|
297
|
+
setMark({
|
|
298
|
+
offset: activeElBox.top - parentBox.top + parentEl.scrollTop,
|
|
299
|
+
height: activeElBox.height,
|
|
300
|
+
hidden: false
|
|
301
|
+
});
|
|
186
302
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
303
|
+
if (firstMarkUpdate.current) {
|
|
304
|
+
firstMarkUpdate.current = false;
|
|
305
|
+
setIsMarkTransitionEnabled(false);
|
|
306
|
+
} else {
|
|
307
|
+
setIsMarkTransitionEnabled(isValueChanged);
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
$[20] = activeIndex;
|
|
312
|
+
$[21] = t7;
|
|
313
|
+
} else {
|
|
314
|
+
t7 = $[21];
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
const updateMark = t7;
|
|
318
|
+
let t8;
|
|
319
|
+
let t9;
|
|
320
|
+
|
|
321
|
+
if ($[22] !== updateMark) {
|
|
322
|
+
t8 = () => updateMark(true);
|
|
323
|
+
|
|
324
|
+
t9 = [updateMark];
|
|
325
|
+
$[22] = updateMark;
|
|
326
|
+
$[23] = t8;
|
|
327
|
+
$[24] = t9;
|
|
328
|
+
} else {
|
|
329
|
+
t8 = $[23];
|
|
330
|
+
t9 = $[24];
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
useEffect(t8, t9);
|
|
334
|
+
let t10;
|
|
335
|
+
|
|
336
|
+
if ($[25] !== updateMark) {
|
|
337
|
+
t10 = () => updateMark(false);
|
|
338
|
+
|
|
339
|
+
$[25] = updateMark;
|
|
340
|
+
$[26] = t10;
|
|
341
|
+
} else {
|
|
342
|
+
t10 = $[26];
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
let t11;
|
|
346
|
+
|
|
347
|
+
if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
|
|
348
|
+
t11 = {
|
|
349
|
+
ignoreFirstCall: true
|
|
350
|
+
};
|
|
351
|
+
$[27] = t11;
|
|
352
|
+
} else {
|
|
353
|
+
t11 = $[27];
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
useResizeObserver(containerRef, t10, t11);
|
|
357
|
+
const t12 = sizeToClass[size];
|
|
358
|
+
const t13 = themeToClass[theme];
|
|
359
|
+
const t14 = modeToClass[mode];
|
|
360
|
+
const t15 = disabled && styles.disabled;
|
|
361
|
+
const t16 = mark.hidden && styles.hiddenMark;
|
|
362
|
+
const t17 = iconPosition === "right" ? styles.alignIconRight : styles.alignIconLeft;
|
|
363
|
+
let t18;
|
|
364
|
+
|
|
365
|
+
if ($[28] !== className || $[29] !== t12 || $[30] !== t13 || $[31] !== t14 || $[32] !== t15 || $[33] !== t16 || $[34] !== t17) {
|
|
366
|
+
t18 = cn(className, styles.verticalSwitcher, t12, t13, t14, t15, t16, t17);
|
|
367
|
+
$[28] = className;
|
|
368
|
+
$[29] = t12;
|
|
369
|
+
$[30] = t13;
|
|
370
|
+
$[31] = t14;
|
|
371
|
+
$[32] = t15;
|
|
372
|
+
$[33] = t16;
|
|
373
|
+
$[34] = t17;
|
|
374
|
+
$[35] = t18;
|
|
375
|
+
} else {
|
|
376
|
+
t18 = $[35];
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
const t19 = disabled && "vertical-switcher-disabled";
|
|
380
|
+
let t20;
|
|
381
|
+
|
|
382
|
+
if ($[36] !== t19) {
|
|
383
|
+
t20 = cn("vertical-switcher", t19);
|
|
384
|
+
$[36] = t19;
|
|
385
|
+
$[37] = t20;
|
|
386
|
+
} else {
|
|
387
|
+
t20 = $[37];
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
const t21 = isMarkTransitionEnabled ? MARK_TRANSITION_DURATION : "0s";
|
|
391
|
+
let t22;
|
|
392
|
+
|
|
393
|
+
if ($[38] !== style || $[39] !== t21) {
|
|
394
|
+
t22 = { ...style,
|
|
395
|
+
"--_rs-switcher-vertical-mark-transition-duration": t21
|
|
396
|
+
};
|
|
397
|
+
$[38] = style;
|
|
398
|
+
$[39] = t21;
|
|
399
|
+
$[40] = t22;
|
|
400
|
+
} else {
|
|
401
|
+
t22 = $[40];
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
const t23 = options[activeIndex]?.value;
|
|
405
|
+
const t24 = name ?? `rs-vertical-switcher-${uniqueId}`;
|
|
406
|
+
let t25;
|
|
407
|
+
|
|
408
|
+
if ($[41] !== disabled || $[42] !== onChange || $[43] !== t23 || $[44] !== t24) {
|
|
409
|
+
t25 = {
|
|
410
|
+
switcherValue: t23,
|
|
212
411
|
onChange,
|
|
213
|
-
handleOptionRef,
|
|
214
412
|
disabled,
|
|
215
|
-
name:
|
|
413
|
+
name: t24
|
|
414
|
+
};
|
|
415
|
+
$[41] = disabled;
|
|
416
|
+
$[42] = onChange;
|
|
417
|
+
$[43] = t23;
|
|
418
|
+
$[44] = t24;
|
|
419
|
+
$[45] = t25;
|
|
420
|
+
} else {
|
|
421
|
+
t25 = $[45];
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
let t26;
|
|
425
|
+
|
|
426
|
+
if ($[46] !== options || $[47] !== withLeftIcons) {
|
|
427
|
+
let t27;
|
|
428
|
+
|
|
429
|
+
if ($[49] !== withLeftIcons) {
|
|
430
|
+
t27 = t28 => {
|
|
431
|
+
const {
|
|
432
|
+
value,
|
|
433
|
+
label,
|
|
434
|
+
icon,
|
|
435
|
+
"aria-label": optionAriaLabel
|
|
436
|
+
} = t28;
|
|
437
|
+
return /*#__PURE__*/React.createElement(Option, {
|
|
438
|
+
key: String(value),
|
|
439
|
+
value: value,
|
|
440
|
+
label: label,
|
|
441
|
+
icon: withLeftIcons && ! /*#__PURE__*/React.isValidElement(icon) ? /*#__PURE__*/React.createElement("span", {
|
|
442
|
+
className: styles.fakeIcon
|
|
443
|
+
}) : icon,
|
|
444
|
+
"aria-label": optionAriaLabel
|
|
445
|
+
});
|
|
446
|
+
};
|
|
447
|
+
|
|
448
|
+
$[49] = withLeftIcons;
|
|
449
|
+
$[50] = t27;
|
|
450
|
+
} else {
|
|
451
|
+
t27 = $[50];
|
|
216
452
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
453
|
+
|
|
454
|
+
t26 = options.map(t27);
|
|
455
|
+
$[46] = options;
|
|
456
|
+
$[47] = withLeftIcons;
|
|
457
|
+
$[48] = t26;
|
|
458
|
+
} else {
|
|
459
|
+
t26 = $[48];
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
let t27;
|
|
463
|
+
|
|
464
|
+
if ($[51] === Symbol.for("react.memo_cache_sentinel")) {
|
|
465
|
+
t27 = cn(styles.mark);
|
|
466
|
+
$[51] = t27;
|
|
467
|
+
} else {
|
|
468
|
+
t27 = $[51];
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
let t28;
|
|
472
|
+
|
|
473
|
+
if ($[52] !== mark.height || $[53] !== mark.offset) {
|
|
474
|
+
t28 = /*#__PURE__*/React.createElement("span", {
|
|
475
|
+
className: t27,
|
|
476
|
+
style: {
|
|
477
|
+
top: mark.offset,
|
|
478
|
+
height: mark.height
|
|
479
|
+
}
|
|
231
480
|
});
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
481
|
+
$[52] = mark.height;
|
|
482
|
+
$[53] = mark.offset;
|
|
483
|
+
$[54] = t28;
|
|
484
|
+
} else {
|
|
485
|
+
t28 = $[54];
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
let t29;
|
|
489
|
+
|
|
490
|
+
if ($[55] !== t25 || $[56] !== t26 || $[57] !== t28) {
|
|
491
|
+
t29 = /*#__PURE__*/React.createElement(verticalSwitcherContext.Provider, {
|
|
492
|
+
value: t25
|
|
493
|
+
}, t26, t28);
|
|
494
|
+
$[55] = t25;
|
|
495
|
+
$[56] = t26;
|
|
496
|
+
$[57] = t28;
|
|
497
|
+
$[58] = t29;
|
|
498
|
+
} else {
|
|
499
|
+
t29 = $[58];
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
let t30;
|
|
503
|
+
|
|
504
|
+
if ($[59] !== rest || $[60] !== t18 || $[61] !== t20 || $[62] !== t22 || $[63] !== t29) {
|
|
505
|
+
t30 = /*#__PURE__*/React.createElement("span", _extends({}, rest, {
|
|
506
|
+
className: t18,
|
|
507
|
+
ref: containerRef,
|
|
508
|
+
"data-rs-internal": "vertical-switcher",
|
|
509
|
+
"data-test": t20,
|
|
510
|
+
style: t22,
|
|
511
|
+
role: "radiogroup"
|
|
512
|
+
}), t29);
|
|
513
|
+
$[59] = rest;
|
|
514
|
+
$[60] = t18;
|
|
515
|
+
$[61] = t20;
|
|
516
|
+
$[62] = t22;
|
|
517
|
+
$[63] = t29;
|
|
518
|
+
$[64] = t30;
|
|
519
|
+
} else {
|
|
520
|
+
t30 = $[64];
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
return t30;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
function _temp(option) {
|
|
527
|
+
return /*#__PURE__*/React.isValidElement(option.icon);
|
|
239
528
|
}
|
|
240
529
|
|
|
241
530
|
const optionPropType = PropTypes.shape({
|