@povio/ui 2.3.0-rc.22 → 2.3.0-rc.24
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.
|
@@ -18,9 +18,10 @@ import { Controller } from "react-hook-form";
|
|
|
18
18
|
import { useNumberFieldState } from "react-stately";
|
|
19
19
|
//#region src/components/inputs/Input/NumberInput/NumberInput.tsx
|
|
20
20
|
var NumberInputBase = (props) => {
|
|
21
|
-
const $ = c(
|
|
21
|
+
const $ = c(89);
|
|
22
22
|
const ui = UIConfig.useConfig();
|
|
23
23
|
const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
|
|
24
|
+
const hasControlledValue = "value" in props;
|
|
24
25
|
const inputRef = useRef(null);
|
|
25
26
|
const { ref, inputClassName, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, className, unit, isLoading, action, leadingIcon, trailingIcon, value, onChange, onBlur, formatOptions: formatOptionsProp, variant: variantProp, as: asProp, size: sizeProp, hideLabel: hideLabelProp, isClearable: isClearableProp, autoFocusOnMount, ...rest } = props;
|
|
26
27
|
const formatOptions = formatOptionsProp ?? ui.numberInput.formatOptions;
|
|
@@ -33,90 +34,96 @@ var NumberInputBase = (props) => {
|
|
|
33
34
|
const { isFocusVisible } = useFocusVisible();
|
|
34
35
|
const { locale } = useLocale();
|
|
35
36
|
let t0;
|
|
36
|
-
if ($[0] !==
|
|
37
|
-
t0 = (
|
|
38
|
-
$[0] =
|
|
37
|
+
if ($[0] !== onChange) {
|
|
38
|
+
t0 = (nextValue) => onChange?.(Number.isNaN(nextValue) ? null : nextValue);
|
|
39
|
+
$[0] = onChange;
|
|
39
40
|
$[1] = t0;
|
|
40
41
|
} else t0 = $[1];
|
|
42
|
+
let t1;
|
|
43
|
+
if ($[2] !== onBlur) {
|
|
44
|
+
t1 = (e) => onBlur?.({ target: e.target });
|
|
45
|
+
$[2] = onBlur;
|
|
46
|
+
$[3] = t1;
|
|
47
|
+
} else t1 = $[3];
|
|
41
48
|
const numberProps = {
|
|
42
49
|
...rest,
|
|
43
|
-
value: value ?? void 0,
|
|
50
|
+
value: hasControlledValue ? value ?? NaN : void 0,
|
|
44
51
|
label,
|
|
45
52
|
isDisabled,
|
|
46
53
|
isInvalid: !!error,
|
|
47
54
|
isRequired,
|
|
48
|
-
onChange,
|
|
49
|
-
onBlur:
|
|
55
|
+
onChange: t0,
|
|
56
|
+
onBlur: t1,
|
|
50
57
|
locale,
|
|
51
58
|
formatOptions
|
|
52
59
|
};
|
|
53
60
|
const { labelProps, inputProps } = useNumberField(numberProps, useNumberFieldState(numberProps), numberFieldRef);
|
|
54
|
-
let t1;
|
|
55
61
|
let t2;
|
|
56
|
-
|
|
57
|
-
|
|
62
|
+
let t3;
|
|
63
|
+
if ($[4] !== autoFocusOnMount || $[5] !== isDisabled) {
|
|
64
|
+
t2 = () => {
|
|
58
65
|
if (!autoFocusOnMount || isDisabled) return;
|
|
59
66
|
requestAnimationFrame(() => inputRef.current?.focus());
|
|
60
67
|
};
|
|
61
|
-
|
|
62
|
-
$[
|
|
63
|
-
$[
|
|
64
|
-
$[
|
|
65
|
-
$[
|
|
68
|
+
t3 = [autoFocusOnMount, isDisabled];
|
|
69
|
+
$[4] = autoFocusOnMount;
|
|
70
|
+
$[5] = isDisabled;
|
|
71
|
+
$[6] = t2;
|
|
72
|
+
$[7] = t3;
|
|
66
73
|
} else {
|
|
67
|
-
|
|
68
|
-
|
|
74
|
+
t2 = $[6];
|
|
75
|
+
t3 = $[7];
|
|
69
76
|
}
|
|
70
|
-
useEffect(
|
|
71
|
-
const
|
|
72
|
-
let
|
|
73
|
-
if ($[
|
|
74
|
-
|
|
77
|
+
useEffect(t2, t3);
|
|
78
|
+
const t4 = isHeaderHidden || as === "inline" || as === "filter" || as === "floating";
|
|
79
|
+
let t5;
|
|
80
|
+
if ($[8] !== error || $[9] !== errorClassName || $[10] !== headerClassName || $[11] !== helperText || $[12] !== hideLabel || $[13] !== isDisabled || $[14] !== isRequired || $[15] !== label || $[16] !== rightContent || $[17] !== t4 || $[18] !== tooltipText) {
|
|
81
|
+
t5 = {
|
|
75
82
|
error,
|
|
76
83
|
label,
|
|
77
84
|
tooltipText,
|
|
78
85
|
helperText,
|
|
79
86
|
isRequired,
|
|
80
87
|
rightContent,
|
|
81
|
-
isHeaderHidden:
|
|
88
|
+
isHeaderHidden: t4,
|
|
82
89
|
hideLabel,
|
|
83
90
|
isDisabled,
|
|
84
91
|
headerClassName,
|
|
85
92
|
errorClassName
|
|
86
93
|
};
|
|
87
|
-
$[
|
|
88
|
-
$[
|
|
89
|
-
$[
|
|
90
|
-
$[
|
|
91
|
-
$[
|
|
92
|
-
$[
|
|
93
|
-
$[
|
|
94
|
-
$[
|
|
95
|
-
$[
|
|
96
|
-
$[15] = t3;
|
|
97
|
-
$[16] = tooltipText;
|
|
94
|
+
$[8] = error;
|
|
95
|
+
$[9] = errorClassName;
|
|
96
|
+
$[10] = headerClassName;
|
|
97
|
+
$[11] = helperText;
|
|
98
|
+
$[12] = hideLabel;
|
|
99
|
+
$[13] = isDisabled;
|
|
100
|
+
$[14] = isRequired;
|
|
101
|
+
$[15] = label;
|
|
102
|
+
$[16] = rightContent;
|
|
98
103
|
$[17] = t4;
|
|
99
|
-
|
|
100
|
-
const formFieldProps = t4;
|
|
101
|
-
let t5;
|
|
102
|
-
if ($[18] !== onBlur) {
|
|
103
|
-
t5 = (e_0) => {
|
|
104
|
-
const target = numberFieldRef.current ?? e_0?.target;
|
|
105
|
-
onBlur?.({ target });
|
|
106
|
-
};
|
|
107
|
-
$[18] = onBlur;
|
|
104
|
+
$[18] = tooltipText;
|
|
108
105
|
$[19] = t5;
|
|
109
106
|
} else t5 = $[19];
|
|
110
|
-
const
|
|
107
|
+
const formFieldProps = t5;
|
|
111
108
|
let t6;
|
|
112
|
-
if ($[20] !==
|
|
113
|
-
t6 = (
|
|
114
|
-
|
|
109
|
+
if ($[20] !== onBlur) {
|
|
110
|
+
t6 = (e_0) => {
|
|
111
|
+
const target = numberFieldRef.current ?? e_0?.target;
|
|
112
|
+
onBlur?.({ target });
|
|
113
|
+
};
|
|
114
|
+
$[20] = onBlur;
|
|
115
115
|
$[21] = t6;
|
|
116
116
|
} else t6 = $[21];
|
|
117
|
+
const handleInputBlur = t6;
|
|
117
118
|
let t7;
|
|
118
|
-
if ($[22] !==
|
|
119
|
-
t7 =
|
|
119
|
+
if ($[22] !== onChange) {
|
|
120
|
+
t7 = (val) => onChange?.(val === "" ? null : Number(val));
|
|
121
|
+
$[22] = onChange;
|
|
122
|
+
$[23] = t7;
|
|
123
|
+
} else t7 = $[23];
|
|
124
|
+
let t8;
|
|
125
|
+
if ($[24] !== action || $[25] !== handleInputBlur || $[26] !== isClearable || $[27] !== isDisabled || $[28] !== isLoading || $[29] !== leadingIcon || $[30] !== t7 || $[31] !== trailingIcon || $[32] !== unit || $[33] !== value) {
|
|
126
|
+
t8 = {
|
|
120
127
|
unit,
|
|
121
128
|
isLoading,
|
|
122
129
|
isDisabled,
|
|
@@ -125,185 +132,185 @@ var NumberInputBase = (props) => {
|
|
|
125
132
|
trailingIcon,
|
|
126
133
|
isClearable,
|
|
127
134
|
value,
|
|
128
|
-
onChange:
|
|
135
|
+
onChange: t7,
|
|
129
136
|
onBlur: handleInputBlur
|
|
130
137
|
};
|
|
131
|
-
$[
|
|
132
|
-
$[
|
|
133
|
-
$[
|
|
134
|
-
$[
|
|
135
|
-
$[
|
|
136
|
-
$[
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
140
|
-
$[
|
|
141
|
-
$[
|
|
142
|
-
} else
|
|
143
|
-
const inputContentProps =
|
|
144
|
-
const
|
|
145
|
-
let
|
|
146
|
-
if ($[
|
|
147
|
-
|
|
138
|
+
$[24] = action;
|
|
139
|
+
$[25] = handleInputBlur;
|
|
140
|
+
$[26] = isClearable;
|
|
141
|
+
$[27] = isDisabled;
|
|
142
|
+
$[28] = isLoading;
|
|
143
|
+
$[29] = leadingIcon;
|
|
144
|
+
$[30] = t7;
|
|
145
|
+
$[31] = trailingIcon;
|
|
146
|
+
$[32] = unit;
|
|
147
|
+
$[33] = value;
|
|
148
|
+
$[34] = t8;
|
|
149
|
+
} else t8 = $[34];
|
|
150
|
+
const inputContentProps = t8;
|
|
151
|
+
const t9 = hideLabel || isHeaderHidden;
|
|
152
|
+
let t10;
|
|
153
|
+
if ($[35] !== headerClassName || $[36] !== helperText || $[37] !== isDisabled || $[38] !== isRequired || $[39] !== label || $[40] !== labelProps || $[41] !== rightContent || $[42] !== t9 || $[43] !== tooltipText) {
|
|
154
|
+
t10 = {
|
|
148
155
|
label,
|
|
149
156
|
tooltipText,
|
|
150
157
|
helperText,
|
|
151
158
|
isRequired,
|
|
152
159
|
rightContent,
|
|
153
|
-
isHeaderHidden:
|
|
160
|
+
isHeaderHidden: t9,
|
|
154
161
|
isDisabled,
|
|
155
162
|
className: headerClassName,
|
|
156
163
|
labelProps
|
|
157
164
|
};
|
|
158
|
-
$[
|
|
159
|
-
$[
|
|
160
|
-
$[
|
|
161
|
-
$[
|
|
162
|
-
$[
|
|
163
|
-
$[
|
|
164
|
-
$[
|
|
165
|
-
$[40] = t8;
|
|
166
|
-
$[41] = tooltipText;
|
|
165
|
+
$[35] = headerClassName;
|
|
166
|
+
$[36] = helperText;
|
|
167
|
+
$[37] = isDisabled;
|
|
168
|
+
$[38] = isRequired;
|
|
169
|
+
$[39] = label;
|
|
170
|
+
$[40] = labelProps;
|
|
171
|
+
$[41] = rightContent;
|
|
167
172
|
$[42] = t9;
|
|
168
|
-
|
|
169
|
-
|
|
173
|
+
$[43] = tooltipText;
|
|
174
|
+
$[44] = t10;
|
|
175
|
+
} else t10 = $[44];
|
|
176
|
+
const headerProps = t10;
|
|
170
177
|
const dataIsDisabled = isDisabled || void 0;
|
|
171
178
|
const T0 = TooltipWrapper;
|
|
172
|
-
const
|
|
179
|
+
const t11 = as === "inline" ? -1 : void 0;
|
|
173
180
|
const T1 = FormField;
|
|
174
|
-
let
|
|
175
|
-
if ($[
|
|
176
|
-
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
179
|
-
} else
|
|
180
|
-
const
|
|
181
|
-
const
|
|
181
|
+
let t12;
|
|
182
|
+
if ($[45] !== className) {
|
|
183
|
+
t12 = clsx("group w-full", className);
|
|
184
|
+
$[45] = className;
|
|
185
|
+
$[46] = t12;
|
|
186
|
+
} else t12 = $[46];
|
|
187
|
+
const t13 = as === "inline" ? -1 : void 0;
|
|
188
|
+
const t14 = clsx("relative flex cursor-text has-disabled:cursor-default", inputBaseCva({
|
|
182
189
|
variant,
|
|
183
190
|
as,
|
|
184
191
|
...rest
|
|
185
192
|
}), inputClassName);
|
|
186
|
-
let
|
|
187
|
-
if ($[
|
|
188
|
-
|
|
189
|
-
$[
|
|
190
|
-
} else
|
|
191
|
-
const
|
|
192
|
-
const
|
|
193
|
-
let
|
|
194
|
-
if ($[
|
|
195
|
-
|
|
196
|
-
$[
|
|
197
|
-
$[
|
|
198
|
-
} else
|
|
199
|
-
const
|
|
200
|
-
const
|
|
201
|
-
const
|
|
202
|
-
const
|
|
203
|
-
const
|
|
204
|
-
let
|
|
205
|
-
if ($[
|
|
206
|
-
|
|
193
|
+
let t15;
|
|
194
|
+
if ($[47] === Symbol.for("react.memo_cache_sentinel")) {
|
|
195
|
+
t15 = () => inputRef.current?.focus();
|
|
196
|
+
$[47] = t15;
|
|
197
|
+
} else t15 = $[47];
|
|
198
|
+
const t16 = value === null || value === void 0 || void 0;
|
|
199
|
+
const t17 = isRequired || void 0;
|
|
200
|
+
let t18;
|
|
201
|
+
if ($[48] !== ref) {
|
|
202
|
+
t18 = mergeRefs(ref, inputRef);
|
|
203
|
+
$[48] = ref;
|
|
204
|
+
$[49] = t18;
|
|
205
|
+
} else t18 = $[49];
|
|
206
|
+
const t19 = isDirty || void 0;
|
|
207
|
+
const t20 = isRequired || void 0;
|
|
208
|
+
const t21 = value === null || value === void 0 || void 0;
|
|
209
|
+
const t22 = !("" + value === "" || value === null || value === void 0) || void 0;
|
|
210
|
+
const t23 = as === "floating" ? "\xA0" : inputProps.placeholder;
|
|
211
|
+
let t24;
|
|
212
|
+
if ($[50] !== inputProps || $[51] !== isFocusVisible) {
|
|
213
|
+
t24 = (e_1) => {
|
|
207
214
|
inputProps.onFocus?.(e_1);
|
|
208
215
|
if (isFocusVisible) e_1.target.select();
|
|
209
216
|
};
|
|
210
|
-
$[
|
|
211
|
-
$[
|
|
212
|
-
$[
|
|
213
|
-
} else
|
|
214
|
-
let
|
|
215
|
-
if ($[
|
|
216
|
-
|
|
217
|
+
$[50] = inputProps;
|
|
218
|
+
$[51] = isFocusVisible;
|
|
219
|
+
$[52] = t24;
|
|
220
|
+
} else t24 = $[52];
|
|
221
|
+
let t25;
|
|
222
|
+
if ($[53] !== dataIsDisabled || $[54] !== inputProps || $[55] !== t18 || $[56] !== t19 || $[57] !== t20 || $[58] !== t21 || $[59] !== t22 || $[60] !== t23 || $[61] !== t24) {
|
|
223
|
+
t25 = /* @__PURE__ */ jsx(Input, {
|
|
217
224
|
...inputProps,
|
|
218
|
-
ref:
|
|
219
|
-
"data-is-dirty":
|
|
220
|
-
"data-is-required":
|
|
221
|
-
"data-is-empty":
|
|
222
|
-
"data-is-filled":
|
|
225
|
+
ref: t18,
|
|
226
|
+
"data-is-dirty": t19,
|
|
227
|
+
"data-is-required": t20,
|
|
228
|
+
"data-is-empty": t21,
|
|
229
|
+
"data-is-filled": t22,
|
|
223
230
|
"data-is-disabled": dataIsDisabled,
|
|
224
|
-
placeholder:
|
|
231
|
+
placeholder: t23,
|
|
225
232
|
className: "w-full bg-transparent outline-none",
|
|
226
|
-
onFocus:
|
|
233
|
+
onFocus: t24
|
|
227
234
|
});
|
|
228
|
-
$[
|
|
229
|
-
$[
|
|
230
|
-
$[
|
|
231
|
-
$[
|
|
232
|
-
$[
|
|
233
|
-
$[
|
|
234
|
-
$[
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
237
|
-
$[
|
|
238
|
-
} else
|
|
239
|
-
let
|
|
240
|
-
if ($[
|
|
241
|
-
|
|
235
|
+
$[53] = dataIsDisabled;
|
|
236
|
+
$[54] = inputProps;
|
|
237
|
+
$[55] = t18;
|
|
238
|
+
$[56] = t19;
|
|
239
|
+
$[57] = t20;
|
|
240
|
+
$[58] = t21;
|
|
241
|
+
$[59] = t22;
|
|
242
|
+
$[60] = t23;
|
|
243
|
+
$[61] = t24;
|
|
244
|
+
$[62] = t25;
|
|
245
|
+
} else t25 = $[62];
|
|
246
|
+
let t26;
|
|
247
|
+
if ($[63] !== as || $[64] !== headerProps || $[65] !== inputContentProps || $[66] !== size || $[67] !== t25) {
|
|
248
|
+
t26 = /* @__PURE__ */ jsx(InputContent, {
|
|
242
249
|
...inputContentProps,
|
|
243
250
|
headerProps,
|
|
244
251
|
as,
|
|
245
252
|
size,
|
|
246
|
-
children: t24
|
|
247
|
-
});
|
|
248
|
-
$[61] = as;
|
|
249
|
-
$[62] = headerProps;
|
|
250
|
-
$[63] = inputContentProps;
|
|
251
|
-
$[64] = size;
|
|
252
|
-
$[65] = t24;
|
|
253
|
-
$[66] = t25;
|
|
254
|
-
} else t25 = $[66];
|
|
255
|
-
let t26;
|
|
256
|
-
if ($[67] !== dataIsDisabled || $[68] !== t13 || $[69] !== t15 || $[70] !== t16 || $[71] !== t25) {
|
|
257
|
-
t26 = /* @__PURE__ */ jsx("div", {
|
|
258
|
-
className: t13,
|
|
259
|
-
onClick: t14,
|
|
260
|
-
"data-is-empty": t15,
|
|
261
|
-
"data-is-required": t16,
|
|
262
|
-
"data-is-disabled": dataIsDisabled,
|
|
263
253
|
children: t25
|
|
264
254
|
});
|
|
265
|
-
$[
|
|
266
|
-
$[
|
|
267
|
-
$[
|
|
268
|
-
$[
|
|
269
|
-
$[
|
|
270
|
-
$[
|
|
271
|
-
} else t26 = $[
|
|
255
|
+
$[63] = as;
|
|
256
|
+
$[64] = headerProps;
|
|
257
|
+
$[65] = inputContentProps;
|
|
258
|
+
$[66] = size;
|
|
259
|
+
$[67] = t25;
|
|
260
|
+
$[68] = t26;
|
|
261
|
+
} else t26 = $[68];
|
|
272
262
|
let t27;
|
|
273
|
-
if ($[
|
|
274
|
-
t27 = /* @__PURE__ */ jsx(
|
|
263
|
+
if ($[69] !== dataIsDisabled || $[70] !== t14 || $[71] !== t16 || $[72] !== t17 || $[73] !== t26) {
|
|
264
|
+
t27 = /* @__PURE__ */ jsx("div", {
|
|
265
|
+
className: t14,
|
|
266
|
+
onClick: t15,
|
|
267
|
+
"data-is-empty": t16,
|
|
268
|
+
"data-is-required": t17,
|
|
269
|
+
"data-is-disabled": dataIsDisabled,
|
|
270
|
+
children: t26
|
|
271
|
+
});
|
|
272
|
+
$[69] = dataIsDisabled;
|
|
273
|
+
$[70] = t14;
|
|
274
|
+
$[71] = t16;
|
|
275
|
+
$[72] = t17;
|
|
276
|
+
$[73] = t26;
|
|
277
|
+
$[74] = t27;
|
|
278
|
+
} else t27 = $[74];
|
|
279
|
+
let t28;
|
|
280
|
+
if ($[75] !== T1 || $[76] !== as || $[77] !== formFieldProps || $[78] !== labelProps || $[79] !== t12 || $[80] !== t13 || $[81] !== t27) {
|
|
281
|
+
t28 = /* @__PURE__ */ jsx(T1, {
|
|
275
282
|
...formFieldProps,
|
|
276
283
|
as,
|
|
277
284
|
labelProps,
|
|
278
|
-
className:
|
|
279
|
-
tabIndex:
|
|
280
|
-
children:
|
|
285
|
+
className: t12,
|
|
286
|
+
tabIndex: t13,
|
|
287
|
+
children: t27
|
|
281
288
|
});
|
|
282
|
-
$[
|
|
283
|
-
$[
|
|
284
|
-
$[
|
|
285
|
-
$[
|
|
286
|
-
$[
|
|
287
|
-
$[
|
|
288
|
-
$[
|
|
289
|
-
$[
|
|
290
|
-
} else
|
|
291
|
-
let
|
|
292
|
-
if ($[
|
|
293
|
-
|
|
289
|
+
$[75] = T1;
|
|
290
|
+
$[76] = as;
|
|
291
|
+
$[77] = formFieldProps;
|
|
292
|
+
$[78] = labelProps;
|
|
293
|
+
$[79] = t12;
|
|
294
|
+
$[80] = t13;
|
|
295
|
+
$[81] = t27;
|
|
296
|
+
$[82] = t28;
|
|
297
|
+
} else t28 = $[82];
|
|
298
|
+
let t29;
|
|
299
|
+
if ($[83] !== T0 || $[84] !== as || $[85] !== error || $[86] !== t11 || $[87] !== t28) {
|
|
300
|
+
t29 = /* @__PURE__ */ jsx(T0, {
|
|
294
301
|
as,
|
|
295
302
|
error,
|
|
296
|
-
triggerTabIndex:
|
|
297
|
-
children:
|
|
303
|
+
triggerTabIndex: t11,
|
|
304
|
+
children: t28
|
|
298
305
|
});
|
|
299
|
-
$[
|
|
300
|
-
$[
|
|
301
|
-
$[
|
|
302
|
-
$[
|
|
303
|
-
$[
|
|
304
|
-
$[
|
|
305
|
-
} else
|
|
306
|
-
return
|
|
306
|
+
$[83] = T0;
|
|
307
|
+
$[84] = as;
|
|
308
|
+
$[85] = error;
|
|
309
|
+
$[86] = t11;
|
|
310
|
+
$[87] = t28;
|
|
311
|
+
$[88] = t29;
|
|
312
|
+
} else t29 = $[88];
|
|
313
|
+
return t29;
|
|
307
314
|
};
|
|
308
315
|
var NumberInputInner = (t0) => {
|
|
309
316
|
const $ = c(9);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { UIStyle } from "../../../config/uiStyle.context.js";
|
|
2
2
|
import { typography } from "../../text/Typography/typography.cva.js";
|
|
3
|
-
import { Loader } from "../../status/Loader/Loader.js";
|
|
4
3
|
import { UIConfig } from "../../../config/uiConfig.context.js";
|
|
5
4
|
import { InlineIconButton } from "../../buttons/InlineIconButton/InlineIconButton.js";
|
|
6
5
|
import { FormFieldLabel } from "../FormField/FormFieldLabel.js";
|
|
@@ -14,14 +13,14 @@ import { clsx } from "clsx";
|
|
|
14
13
|
import { isValidElement, useId } from "react";
|
|
15
14
|
//#region src/components/inputs/Skeleton/InputFrame.tsx
|
|
16
15
|
var InputFrame = (props) => {
|
|
17
|
-
const $ = c(
|
|
16
|
+
const $ = c(181);
|
|
18
17
|
const ui = UIConfig.useConfig();
|
|
19
18
|
const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
|
|
20
19
|
const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
|
|
21
20
|
const inputContentWrapperCva = UIStyle.useCva("input.contentWrapperCva", inputContentWrapper);
|
|
22
21
|
const typographyCva = UIStyle.useCva("typography.cva", typography);
|
|
23
22
|
const generatedInputId = useId();
|
|
24
|
-
const { ref, children, formFieldRef, labelProps: labelPropsProp, headerProps, error, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isHeaderHidden, hideLabel: hideLabelProp, headerClassName, errorClassName, className, leadingContent, leadingIcon, actionContent, actionContentPlacement: t0, trailingContent, trailingIcon, trailingAction, unit,
|
|
23
|
+
const { ref, children, formFieldRef, labelProps: labelPropsProp, headerProps, error, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isHeaderHidden, hideLabel: hideLabelProp, headerClassName, errorClassName, className, leadingContent, leadingIcon, actionContent, actionContentPlacement: t0, trailingContent, trailingIcon, trailingAction, unit, action, isClearable: isClearableProp, showClear, renderStatic, onStaticInteract, clearClassName, onClear, dataAttributes, typographySize, id: idProp, inputClassName, contentClassName, contentWrapperClassName, contentAndTrailingClassName, wrapContentAndTrailing, wrapTrailingContent: t1, labelPlacement: t2, trailingClassName, onMouseEnter, onFocusCapture, variant: variantProp, as: asProp, size: sizeProp } = props;
|
|
25
24
|
const actionContentPlacement = t0 === void 0 ? "content-wrapper" : t0;
|
|
26
25
|
const wrapTrailingContent = t1 === void 0 ? true : t1;
|
|
27
26
|
const labelPlacement = t2 === void 0 ? "content-wrapper" : t2;
|
|
@@ -44,7 +43,7 @@ var InputFrame = (props) => {
|
|
|
44
43
|
$[3] = t4;
|
|
45
44
|
} else t4 = $[3];
|
|
46
45
|
const isTrailingIconElement = t4;
|
|
47
|
-
const hasTrailingContent = hasClear || !!trailingContent || !!unit || !!
|
|
46
|
+
const hasTrailingContent = hasClear || !!trailingContent || !!unit || !!action || !!trailingIcon || !!trailingAction;
|
|
48
47
|
const isTrailingInteractive = !!action || !!trailingAction || !!isTrailingIconElement || hasClear && !!showClear || !!trailingContent;
|
|
49
48
|
let dataAttributeProps;
|
|
50
49
|
let formFieldProps;
|
|
@@ -301,7 +300,7 @@ var InputFrame = (props) => {
|
|
|
301
300
|
} else t15 = $[111];
|
|
302
301
|
const contentRow = t15;
|
|
303
302
|
let t16;
|
|
304
|
-
if ($[112] !== action || $[113] !== clearClassName || $[114] !== hasClear || $[115] !== hasTrailingContent || $[116] !== isDisabled || $[117] !==
|
|
303
|
+
if ($[112] !== action || $[113] !== clearClassName || $[114] !== hasClear || $[115] !== hasTrailingContent || $[116] !== isDisabled || $[117] !== onClear || $[118] !== renderStatic || $[119] !== showClear || $[120] !== trailingAction || $[121] !== trailingContent || $[122] !== trailingIcon || $[123] !== typographyCva || $[124] !== unit) {
|
|
305
304
|
t16 = hasTrailingContent ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
306
305
|
hasClear && /* @__PURE__ */ jsx(InputClear, {
|
|
307
306
|
onClear: () => onClear?.(),
|
|
@@ -319,11 +318,7 @@ var InputFrame = (props) => {
|
|
|
319
318
|
}),
|
|
320
319
|
children: unit
|
|
321
320
|
}),
|
|
322
|
-
|
|
323
|
-
className: "inline-flex",
|
|
324
|
-
children: /* @__PURE__ */ jsx(Loader, {})
|
|
325
|
-
}),
|
|
326
|
-
!isLoading && action && /* @__PURE__ */ jsx(InlineIconButton, {
|
|
321
|
+
action && /* @__PURE__ */ jsx(InlineIconButton, {
|
|
327
322
|
color: "secondary",
|
|
328
323
|
icon: action.icon,
|
|
329
324
|
isDisabled,
|
|
@@ -332,7 +327,7 @@ var InputFrame = (props) => {
|
|
|
332
327
|
label: action.altText,
|
|
333
328
|
className: clsx("border-0!", action.className)
|
|
334
329
|
}),
|
|
335
|
-
!
|
|
330
|
+
!action && trailingIcon && renderIconVisual(trailingIcon),
|
|
336
331
|
trailingAction
|
|
337
332
|
] }) : null;
|
|
338
333
|
$[112] = action;
|
|
@@ -340,20 +335,19 @@ var InputFrame = (props) => {
|
|
|
340
335
|
$[114] = hasClear;
|
|
341
336
|
$[115] = hasTrailingContent;
|
|
342
337
|
$[116] = isDisabled;
|
|
343
|
-
$[117] =
|
|
344
|
-
$[118] =
|
|
345
|
-
$[119] =
|
|
346
|
-
$[120] =
|
|
347
|
-
$[121] =
|
|
348
|
-
$[122] =
|
|
349
|
-
$[123] =
|
|
350
|
-
$[124] =
|
|
351
|
-
$[125] =
|
|
352
|
-
|
|
353
|
-
} else t16 = $[126];
|
|
338
|
+
$[117] = onClear;
|
|
339
|
+
$[118] = renderStatic;
|
|
340
|
+
$[119] = showClear;
|
|
341
|
+
$[120] = trailingAction;
|
|
342
|
+
$[121] = trailingContent;
|
|
343
|
+
$[122] = trailingIcon;
|
|
344
|
+
$[123] = typographyCva;
|
|
345
|
+
$[124] = unit;
|
|
346
|
+
$[125] = t16;
|
|
347
|
+
} else t16 = $[125];
|
|
354
348
|
const trailingContentNodes = t16;
|
|
355
349
|
let t17;
|
|
356
|
-
if ($[
|
|
350
|
+
if ($[126] !== as || $[127] !== inputSizeCva || $[128] !== isTrailingInteractive || $[129] !== size || $[130] !== trailingClassName || $[131] !== trailingContentNodes || $[132] !== wrapTrailingContent) {
|
|
357
351
|
t17 = wrapTrailingContent && trailingContentNodes ? /* @__PURE__ */ jsx("div", {
|
|
358
352
|
className: clsx("flex items-center gap-input-gap-trailing-elements", inputSizeCva({
|
|
359
353
|
size,
|
|
@@ -361,70 +355,70 @@ var InputFrame = (props) => {
|
|
|
361
355
|
}), !isTrailingInteractive && "pointer-events-none", trailingClassName),
|
|
362
356
|
children: trailingContentNodes
|
|
363
357
|
}) : trailingContentNodes;
|
|
364
|
-
$[
|
|
365
|
-
$[
|
|
366
|
-
$[
|
|
367
|
-
$[
|
|
368
|
-
$[
|
|
369
|
-
$[
|
|
370
|
-
$[
|
|
371
|
-
$[
|
|
372
|
-
} else t17 = $[
|
|
358
|
+
$[126] = as;
|
|
359
|
+
$[127] = inputSizeCva;
|
|
360
|
+
$[128] = isTrailingInteractive;
|
|
361
|
+
$[129] = size;
|
|
362
|
+
$[130] = trailingClassName;
|
|
363
|
+
$[131] = trailingContentNodes;
|
|
364
|
+
$[132] = wrapTrailingContent;
|
|
365
|
+
$[133] = t17;
|
|
366
|
+
} else t17 = $[133];
|
|
373
367
|
const trailingRow = t17;
|
|
374
368
|
let t18;
|
|
375
|
-
if ($[
|
|
369
|
+
if ($[134] !== contentAndTrailingClassName || $[135] !== contentRow || $[136] !== trailingRow || $[137] !== wrapContentAndTrailing) {
|
|
376
370
|
t18 = wrapContentAndTrailing ? /* @__PURE__ */ jsxs("div", {
|
|
377
371
|
className: clsx("flex w-full items-center gap-input-gap-input-text-to-elements", contentAndTrailingClassName),
|
|
378
372
|
children: [contentRow, trailingRow]
|
|
379
373
|
}) : /* @__PURE__ */ jsxs(Fragment, { children: [contentRow, trailingRow] });
|
|
380
|
-
$[
|
|
381
|
-
$[
|
|
382
|
-
$[
|
|
383
|
-
$[
|
|
384
|
-
$[
|
|
385
|
-
} else t18 = $[
|
|
374
|
+
$[134] = contentAndTrailingClassName;
|
|
375
|
+
$[135] = contentRow;
|
|
376
|
+
$[136] = trailingRow;
|
|
377
|
+
$[137] = wrapContentAndTrailing;
|
|
378
|
+
$[138] = t18;
|
|
379
|
+
} else t18 = $[138];
|
|
386
380
|
const inputFrameContent = t18;
|
|
387
381
|
const t19 = as === "inline" ? -1 : void 0;
|
|
388
382
|
const t20 = as === "inline" ? -1 : void 0;
|
|
389
383
|
let t21;
|
|
390
|
-
if ($[
|
|
384
|
+
if ($[139] !== onMouseEnter || $[140] !== onStaticInteract || $[141] !== renderStatic) {
|
|
391
385
|
t21 = (event) => {
|
|
392
386
|
onMouseEnter?.(event);
|
|
393
387
|
if (renderStatic) onStaticInteract?.(false);
|
|
394
388
|
};
|
|
395
|
-
$[
|
|
396
|
-
$[
|
|
397
|
-
$[
|
|
398
|
-
$[
|
|
399
|
-
} else t21 = $[
|
|
389
|
+
$[139] = onMouseEnter;
|
|
390
|
+
$[140] = onStaticInteract;
|
|
391
|
+
$[141] = renderStatic;
|
|
392
|
+
$[142] = t21;
|
|
393
|
+
} else t21 = $[142];
|
|
400
394
|
let t22;
|
|
401
|
-
if ($[
|
|
395
|
+
if ($[143] !== onFocusCapture || $[144] !== onStaticInteract || $[145] !== renderStatic) {
|
|
402
396
|
t22 = (event_0) => {
|
|
403
397
|
onFocusCapture?.(event_0);
|
|
404
398
|
if (renderStatic) onStaticInteract?.(true);
|
|
405
399
|
};
|
|
406
|
-
$[
|
|
407
|
-
$[
|
|
408
|
-
$[
|
|
409
|
-
$[
|
|
410
|
-
} else t22 = $[
|
|
400
|
+
$[143] = onFocusCapture;
|
|
401
|
+
$[144] = onStaticInteract;
|
|
402
|
+
$[145] = renderStatic;
|
|
403
|
+
$[146] = t22;
|
|
404
|
+
} else t22 = $[146];
|
|
411
405
|
let t23;
|
|
412
|
-
if ($[
|
|
406
|
+
if ($[147] !== as || $[148] !== inputBaseCva || $[149] !== inputClassName || $[150] !== variant) {
|
|
413
407
|
t23 = clsx("relative flex cursor-text has-disabled:cursor-default", inputBaseCva({
|
|
414
408
|
variant,
|
|
415
409
|
as
|
|
416
410
|
}), inputClassName);
|
|
417
|
-
$[
|
|
418
|
-
$[
|
|
419
|
-
$[
|
|
420
|
-
$[
|
|
421
|
-
$[
|
|
422
|
-
} else t23 = $[
|
|
411
|
+
$[147] = as;
|
|
412
|
+
$[148] = inputBaseCva;
|
|
413
|
+
$[149] = inputClassName;
|
|
414
|
+
$[150] = variant;
|
|
415
|
+
$[151] = t23;
|
|
416
|
+
} else t23 = $[151];
|
|
423
417
|
const t24 = renderStatic ? isDisabled ? -1 : 0 : void 0;
|
|
424
418
|
let t25;
|
|
425
419
|
let t26;
|
|
426
420
|
let t27;
|
|
427
|
-
if ($[
|
|
421
|
+
if ($[152] !== onStaticInteract || $[153] !== renderStatic) {
|
|
428
422
|
t25 = () => {
|
|
429
423
|
if (renderStatic) onStaticInteract?.(true);
|
|
430
424
|
};
|
|
@@ -434,18 +428,18 @@ var InputFrame = (props) => {
|
|
|
434
428
|
t27 = () => {
|
|
435
429
|
if (renderStatic) onStaticInteract?.(true);
|
|
436
430
|
};
|
|
437
|
-
$[
|
|
438
|
-
$[
|
|
439
|
-
$[
|
|
440
|
-
$[
|
|
441
|
-
$[
|
|
431
|
+
$[152] = onStaticInteract;
|
|
432
|
+
$[153] = renderStatic;
|
|
433
|
+
$[154] = t25;
|
|
434
|
+
$[155] = t26;
|
|
435
|
+
$[156] = t27;
|
|
442
436
|
} else {
|
|
443
|
-
t25 = $[
|
|
444
|
-
t26 = $[
|
|
445
|
-
t27 = $[
|
|
437
|
+
t25 = $[154];
|
|
438
|
+
t26 = $[155];
|
|
439
|
+
t27 = $[156];
|
|
446
440
|
}
|
|
447
441
|
let t28;
|
|
448
|
-
if ($[
|
|
442
|
+
if ($[157] !== dataAttributeProps || $[158] !== inputFrameContent || $[159] !== ref || $[160] !== t23 || $[161] !== t24 || $[162] !== t25 || $[163] !== t26 || $[164] !== t27) {
|
|
449
443
|
t28 = /* @__PURE__ */ jsx("div", {
|
|
450
444
|
ref,
|
|
451
445
|
...dataAttributeProps,
|
|
@@ -457,18 +451,18 @@ var InputFrame = (props) => {
|
|
|
457
451
|
"data-rac": "",
|
|
458
452
|
children: inputFrameContent
|
|
459
453
|
});
|
|
460
|
-
$[
|
|
461
|
-
$[
|
|
462
|
-
$[
|
|
463
|
-
$[
|
|
464
|
-
$[
|
|
465
|
-
$[
|
|
466
|
-
$[
|
|
467
|
-
$[
|
|
468
|
-
$[
|
|
469
|
-
} else t28 = $[
|
|
454
|
+
$[157] = dataAttributeProps;
|
|
455
|
+
$[158] = inputFrameContent;
|
|
456
|
+
$[159] = ref;
|
|
457
|
+
$[160] = t23;
|
|
458
|
+
$[161] = t24;
|
|
459
|
+
$[162] = t25;
|
|
460
|
+
$[163] = t26;
|
|
461
|
+
$[164] = t27;
|
|
462
|
+
$[165] = t28;
|
|
463
|
+
} else t28 = $[165];
|
|
470
464
|
let t29;
|
|
471
|
-
if ($[
|
|
465
|
+
if ($[166] !== as || $[167] !== dataAttributeProps || $[168] !== formFieldProps || $[169] !== formFieldRef || $[170] !== labelProps || $[171] !== t20 || $[172] !== t21 || $[173] !== t22 || $[174] !== t28) {
|
|
472
466
|
t29 = /* @__PURE__ */ jsx(FormField, {
|
|
473
467
|
...formFieldProps,
|
|
474
468
|
...dataAttributeProps,
|
|
@@ -480,31 +474,31 @@ var InputFrame = (props) => {
|
|
|
480
474
|
onFocusCapture: t22,
|
|
481
475
|
children: t28
|
|
482
476
|
});
|
|
483
|
-
$[
|
|
484
|
-
$[
|
|
485
|
-
$[
|
|
486
|
-
$[
|
|
487
|
-
$[
|
|
488
|
-
$[
|
|
489
|
-
$[
|
|
490
|
-
$[
|
|
491
|
-
$[
|
|
492
|
-
$[
|
|
493
|
-
} else t29 = $[
|
|
477
|
+
$[166] = as;
|
|
478
|
+
$[167] = dataAttributeProps;
|
|
479
|
+
$[168] = formFieldProps;
|
|
480
|
+
$[169] = formFieldRef;
|
|
481
|
+
$[170] = labelProps;
|
|
482
|
+
$[171] = t20;
|
|
483
|
+
$[172] = t21;
|
|
484
|
+
$[173] = t22;
|
|
485
|
+
$[174] = t28;
|
|
486
|
+
$[175] = t29;
|
|
487
|
+
} else t29 = $[175];
|
|
494
488
|
let t30;
|
|
495
|
-
if ($[
|
|
489
|
+
if ($[176] !== as || $[177] !== error || $[178] !== t19 || $[179] !== t29) {
|
|
496
490
|
t30 = /* @__PURE__ */ jsx(TooltipWrapper, {
|
|
497
491
|
as,
|
|
498
492
|
error,
|
|
499
493
|
triggerTabIndex: t19,
|
|
500
494
|
children: t29
|
|
501
495
|
});
|
|
502
|
-
$[
|
|
503
|
-
$[
|
|
504
|
-
$[
|
|
505
|
-
$[
|
|
506
|
-
$[
|
|
507
|
-
} else t30 = $[
|
|
496
|
+
$[176] = as;
|
|
497
|
+
$[177] = error;
|
|
498
|
+
$[178] = t19;
|
|
499
|
+
$[179] = t29;
|
|
500
|
+
$[180] = t30;
|
|
501
|
+
} else t30 = $[180];
|
|
508
502
|
return t30;
|
|
509
503
|
};
|
|
510
504
|
var renderIconVisual = (icon) => {
|