@povio/ui 2.3.0-rc.16 → 2.3.0-rc.18
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/inputs/Input/NumberInput/NumberInput.js +50 -45
- package/dist/components/inputs/Input/TextInput/TextInput.js +70 -68
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +120 -129
- package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/select.context.js +10 -4
- package/package.json +1 -1
|
@@ -18,7 +18,7 @@ import { Controller, useWatch } 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(87);
|
|
22
22
|
const ui = UIConfig.useConfig();
|
|
23
23
|
const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
|
|
24
24
|
const inputRef = useRef(null);
|
|
@@ -167,6 +167,7 @@ var NumberInputBase = (props) => {
|
|
|
167
167
|
$[42] = t9;
|
|
168
168
|
} else t9 = $[42];
|
|
169
169
|
const headerProps = t9;
|
|
170
|
+
const dataIsDisabled = isDisabled || void 0;
|
|
170
171
|
const T0 = TooltipWrapper;
|
|
171
172
|
const t10 = as === "inline" ? -1 : void 0;
|
|
172
173
|
const T1 = FormField;
|
|
@@ -211,7 +212,7 @@ var NumberInputBase = (props) => {
|
|
|
211
212
|
$[50] = t23;
|
|
212
213
|
} else t23 = $[50];
|
|
213
214
|
let t24;
|
|
214
|
-
if ($[51] !==
|
|
215
|
+
if ($[51] !== dataIsDisabled || $[52] !== inputProps || $[53] !== t17 || $[54] !== t18 || $[55] !== t19 || $[56] !== t20 || $[57] !== t21 || $[58] !== t22 || $[59] !== t23) {
|
|
215
216
|
t24 = /* @__PURE__ */ jsx(Input, {
|
|
216
217
|
...inputProps,
|
|
217
218
|
ref: t17,
|
|
@@ -219,22 +220,24 @@ var NumberInputBase = (props) => {
|
|
|
219
220
|
"data-is-required": t19,
|
|
220
221
|
"data-is-empty": t20,
|
|
221
222
|
"data-is-filled": t21,
|
|
223
|
+
"data-is-disabled": dataIsDisabled,
|
|
222
224
|
placeholder: t22,
|
|
223
225
|
className: "w-full bg-transparent outline-none",
|
|
224
226
|
onFocus: t23
|
|
225
227
|
});
|
|
226
|
-
$[51] =
|
|
227
|
-
$[52] =
|
|
228
|
-
$[53] =
|
|
229
|
-
$[54] =
|
|
230
|
-
$[55] =
|
|
231
|
-
$[56] =
|
|
232
|
-
$[57] =
|
|
233
|
-
$[58] =
|
|
234
|
-
$[59] =
|
|
235
|
-
|
|
228
|
+
$[51] = dataIsDisabled;
|
|
229
|
+
$[52] = inputProps;
|
|
230
|
+
$[53] = t17;
|
|
231
|
+
$[54] = t18;
|
|
232
|
+
$[55] = t19;
|
|
233
|
+
$[56] = t20;
|
|
234
|
+
$[57] = t21;
|
|
235
|
+
$[58] = t22;
|
|
236
|
+
$[59] = t23;
|
|
237
|
+
$[60] = t24;
|
|
238
|
+
} else t24 = $[60];
|
|
236
239
|
let t25;
|
|
237
|
-
if ($[
|
|
240
|
+
if ($[61] !== as || $[62] !== headerProps || $[63] !== inputContentProps || $[64] !== size || $[65] !== t24) {
|
|
238
241
|
t25 = /* @__PURE__ */ jsx(InputContent, {
|
|
239
242
|
...inputContentProps,
|
|
240
243
|
headerProps,
|
|
@@ -242,30 +245,32 @@ var NumberInputBase = (props) => {
|
|
|
242
245
|
size,
|
|
243
246
|
children: t24
|
|
244
247
|
});
|
|
245
|
-
$[
|
|
246
|
-
$[
|
|
247
|
-
$[
|
|
248
|
-
$[
|
|
249
|
-
$[
|
|
250
|
-
$[
|
|
251
|
-
} else t25 = $[
|
|
248
|
+
$[61] = as;
|
|
249
|
+
$[62] = headerProps;
|
|
250
|
+
$[63] = inputContentProps;
|
|
251
|
+
$[64] = size;
|
|
252
|
+
$[65] = t24;
|
|
253
|
+
$[66] = t25;
|
|
254
|
+
} else t25 = $[66];
|
|
252
255
|
let t26;
|
|
253
|
-
if ($[
|
|
256
|
+
if ($[67] !== dataIsDisabled || $[68] !== t13 || $[69] !== t15 || $[70] !== t16 || $[71] !== t25) {
|
|
254
257
|
t26 = /* @__PURE__ */ jsx("div", {
|
|
255
258
|
className: t13,
|
|
256
259
|
onClick: t14,
|
|
257
260
|
"data-is-empty": t15,
|
|
258
261
|
"data-is-required": t16,
|
|
262
|
+
"data-is-disabled": dataIsDisabled,
|
|
259
263
|
children: t25
|
|
260
264
|
});
|
|
261
|
-
$[
|
|
262
|
-
$[
|
|
263
|
-
$[
|
|
264
|
-
$[
|
|
265
|
-
$[
|
|
266
|
-
|
|
265
|
+
$[67] = dataIsDisabled;
|
|
266
|
+
$[68] = t13;
|
|
267
|
+
$[69] = t15;
|
|
268
|
+
$[70] = t16;
|
|
269
|
+
$[71] = t25;
|
|
270
|
+
$[72] = t26;
|
|
271
|
+
} else t26 = $[72];
|
|
267
272
|
let t27;
|
|
268
|
-
if ($[
|
|
273
|
+
if ($[73] !== T1 || $[74] !== as || $[75] !== formFieldProps || $[76] !== labelProps || $[77] !== t11 || $[78] !== t12 || $[79] !== t26) {
|
|
269
274
|
t27 = /* @__PURE__ */ jsx(T1, {
|
|
270
275
|
...formFieldProps,
|
|
271
276
|
as,
|
|
@@ -274,30 +279,30 @@ var NumberInputBase = (props) => {
|
|
|
274
279
|
tabIndex: t12,
|
|
275
280
|
children: t26
|
|
276
281
|
});
|
|
277
|
-
$[
|
|
278
|
-
$[
|
|
279
|
-
$[
|
|
280
|
-
$[
|
|
281
|
-
$[
|
|
282
|
-
$[
|
|
283
|
-
$[
|
|
284
|
-
$[
|
|
285
|
-
} else t27 = $[
|
|
282
|
+
$[73] = T1;
|
|
283
|
+
$[74] = as;
|
|
284
|
+
$[75] = formFieldProps;
|
|
285
|
+
$[76] = labelProps;
|
|
286
|
+
$[77] = t11;
|
|
287
|
+
$[78] = t12;
|
|
288
|
+
$[79] = t26;
|
|
289
|
+
$[80] = t27;
|
|
290
|
+
} else t27 = $[80];
|
|
286
291
|
let t28;
|
|
287
|
-
if ($[
|
|
292
|
+
if ($[81] !== T0 || $[82] !== as || $[83] !== error || $[84] !== t10 || $[85] !== t27) {
|
|
288
293
|
t28 = /* @__PURE__ */ jsx(T0, {
|
|
289
294
|
as,
|
|
290
295
|
error,
|
|
291
296
|
triggerTabIndex: t10,
|
|
292
297
|
children: t27
|
|
293
298
|
});
|
|
294
|
-
$[
|
|
295
|
-
$[
|
|
296
|
-
$[
|
|
297
|
-
$[
|
|
298
|
-
$[
|
|
299
|
-
$[
|
|
300
|
-
} else t28 = $[
|
|
299
|
+
$[81] = T0;
|
|
300
|
+
$[82] = as;
|
|
301
|
+
$[83] = error;
|
|
302
|
+
$[84] = t10;
|
|
303
|
+
$[85] = t27;
|
|
304
|
+
$[86] = t28;
|
|
305
|
+
} else t28 = $[86];
|
|
301
306
|
return t28;
|
|
302
307
|
};
|
|
303
308
|
var NumberInput = ({ renderStaticInput, ...props }) => {
|
|
@@ -16,7 +16,7 @@ import { mergeRefs } from "@react-aria/utils";
|
|
|
16
16
|
import { Controller, useWatch } from "react-hook-form";
|
|
17
17
|
//#region src/components/inputs/Input/TextInput/TextInput.tsx
|
|
18
18
|
var TextInputBase = (props) => {
|
|
19
|
-
const $ = c(
|
|
19
|
+
const $ = c(84);
|
|
20
20
|
const ui = UIConfig.useConfig();
|
|
21
21
|
const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
|
|
22
22
|
const inputRef = useRef(null);
|
|
@@ -139,6 +139,7 @@ var TextInputBase = (props) => {
|
|
|
139
139
|
$[36] = t6;
|
|
140
140
|
} else t6 = $[36];
|
|
141
141
|
const headerProps = t6;
|
|
142
|
+
const dataIsDisabled = isDisabled || void 0;
|
|
142
143
|
const T0 = TooltipWrapper;
|
|
143
144
|
const t7 = as === "inline" ? -1 : void 0;
|
|
144
145
|
const T1 = FormField;
|
|
@@ -175,77 +176,78 @@ var TextInputBase = (props) => {
|
|
|
175
176
|
const t19 = !(value === "" || value === null || value === void 0) || void 0;
|
|
176
177
|
const t20 = isDirty || void 0;
|
|
177
178
|
const t21 = isRequired || void 0;
|
|
178
|
-
const t22 =
|
|
179
|
-
|
|
180
|
-
let t24;
|
|
179
|
+
const t22 = as === "floating" ? "\xA0" : inputProps.placeholder;
|
|
180
|
+
let t23;
|
|
181
181
|
if ($[43] !== inputProps || $[44] !== isFocusVisible) {
|
|
182
|
-
|
|
182
|
+
t23 = (e) => {
|
|
183
183
|
inputProps.onFocus?.(e);
|
|
184
184
|
if (isFocusVisible) e.target.select();
|
|
185
185
|
};
|
|
186
186
|
$[43] = inputProps;
|
|
187
187
|
$[44] = isFocusVisible;
|
|
188
|
-
$[45] =
|
|
189
|
-
} else
|
|
190
|
-
let
|
|
191
|
-
if ($[46] !==
|
|
192
|
-
|
|
188
|
+
$[45] = t23;
|
|
189
|
+
} else t23 = $[45];
|
|
190
|
+
let t24;
|
|
191
|
+
if ($[46] !== dataIsDisabled || $[47] !== inputProps || $[48] !== t17 || $[49] !== t18 || $[50] !== t19 || $[51] !== t20 || $[52] !== t21 || $[53] !== t22 || $[54] !== t23) {
|
|
192
|
+
t24 = /* @__PURE__ */ jsx(Input, {
|
|
193
193
|
...inputProps,
|
|
194
194
|
ref: t17,
|
|
195
195
|
"data-is-empty": t18,
|
|
196
196
|
"data-is-filled": t19,
|
|
197
197
|
"data-is-dirty": t20,
|
|
198
198
|
"data-is-required": t21,
|
|
199
|
-
"data-is-disabled":
|
|
200
|
-
placeholder:
|
|
199
|
+
"data-is-disabled": dataIsDisabled,
|
|
200
|
+
placeholder: t22,
|
|
201
201
|
className: "w-full bg-transparent outline-none",
|
|
202
|
-
onFocus:
|
|
202
|
+
onFocus: t23
|
|
203
203
|
});
|
|
204
|
-
$[46] =
|
|
205
|
-
$[47] =
|
|
206
|
-
$[48] =
|
|
207
|
-
$[49] =
|
|
208
|
-
$[50] =
|
|
209
|
-
$[51] =
|
|
210
|
-
$[52] =
|
|
211
|
-
$[53] =
|
|
212
|
-
$[54] =
|
|
213
|
-
$[55] =
|
|
214
|
-
} else
|
|
215
|
-
let
|
|
216
|
-
if ($[56] !== as || $[57] !== headerProps || $[58] !== inputContentProps || $[59] !== size || $[60] !==
|
|
217
|
-
|
|
204
|
+
$[46] = dataIsDisabled;
|
|
205
|
+
$[47] = inputProps;
|
|
206
|
+
$[48] = t17;
|
|
207
|
+
$[49] = t18;
|
|
208
|
+
$[50] = t19;
|
|
209
|
+
$[51] = t20;
|
|
210
|
+
$[52] = t21;
|
|
211
|
+
$[53] = t22;
|
|
212
|
+
$[54] = t23;
|
|
213
|
+
$[55] = t24;
|
|
214
|
+
} else t24 = $[55];
|
|
215
|
+
let t25;
|
|
216
|
+
if ($[56] !== as || $[57] !== headerProps || $[58] !== inputContentProps || $[59] !== size || $[60] !== t24) {
|
|
217
|
+
t25 = /* @__PURE__ */ jsx(InputContent, {
|
|
218
218
|
...inputContentProps,
|
|
219
219
|
headerProps,
|
|
220
220
|
as,
|
|
221
221
|
size,
|
|
222
|
-
children:
|
|
222
|
+
children: t24
|
|
223
223
|
});
|
|
224
224
|
$[56] = as;
|
|
225
225
|
$[57] = headerProps;
|
|
226
226
|
$[58] = inputContentProps;
|
|
227
227
|
$[59] = size;
|
|
228
|
-
$[60] =
|
|
229
|
-
$[61] =
|
|
230
|
-
} else
|
|
231
|
-
let
|
|
232
|
-
if ($[62] !==
|
|
233
|
-
|
|
228
|
+
$[60] = t24;
|
|
229
|
+
$[61] = t25;
|
|
230
|
+
} else t25 = $[61];
|
|
231
|
+
let t26;
|
|
232
|
+
if ($[62] !== dataIsDisabled || $[63] !== t13 || $[64] !== t15 || $[65] !== t16 || $[66] !== t25) {
|
|
233
|
+
t26 = /* @__PURE__ */ jsx("div", {
|
|
234
234
|
className: t13,
|
|
235
235
|
onClick: t14,
|
|
236
236
|
"data-is-empty": t15,
|
|
237
237
|
"data-is-required": t16,
|
|
238
|
-
|
|
238
|
+
"data-is-disabled": dataIsDisabled,
|
|
239
|
+
children: t25
|
|
239
240
|
});
|
|
240
|
-
$[62] =
|
|
241
|
-
$[63] =
|
|
242
|
-
$[64] =
|
|
243
|
-
$[65] =
|
|
244
|
-
$[66] =
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
241
|
+
$[62] = dataIsDisabled;
|
|
242
|
+
$[63] = t13;
|
|
243
|
+
$[64] = t15;
|
|
244
|
+
$[65] = t16;
|
|
245
|
+
$[66] = t25;
|
|
246
|
+
$[67] = t26;
|
|
247
|
+
} else t26 = $[67];
|
|
248
|
+
let t27;
|
|
249
|
+
if ($[68] !== T1 || $[69] !== as || $[70] !== formFieldProps || $[71] !== labelProps || $[72] !== t10 || $[73] !== t11 || $[74] !== t12 || $[75] !== t26 || $[76] !== t9) {
|
|
250
|
+
t27 = /* @__PURE__ */ jsx(T1, {
|
|
249
251
|
...formFieldProps,
|
|
250
252
|
as,
|
|
251
253
|
labelProps,
|
|
@@ -253,35 +255,35 @@ var TextInputBase = (props) => {
|
|
|
253
255
|
tabIndex: t10,
|
|
254
256
|
"data-is-empty": t11,
|
|
255
257
|
"data-is-required": t12,
|
|
256
|
-
children:
|
|
258
|
+
children: t26
|
|
257
259
|
});
|
|
258
|
-
$[
|
|
259
|
-
$[
|
|
260
|
-
$[
|
|
261
|
-
$[
|
|
262
|
-
$[
|
|
263
|
-
$[
|
|
264
|
-
$[
|
|
265
|
-
$[
|
|
266
|
-
$[
|
|
267
|
-
$[
|
|
268
|
-
} else
|
|
269
|
-
let
|
|
270
|
-
if ($[
|
|
271
|
-
|
|
260
|
+
$[68] = T1;
|
|
261
|
+
$[69] = as;
|
|
262
|
+
$[70] = formFieldProps;
|
|
263
|
+
$[71] = labelProps;
|
|
264
|
+
$[72] = t10;
|
|
265
|
+
$[73] = t11;
|
|
266
|
+
$[74] = t12;
|
|
267
|
+
$[75] = t26;
|
|
268
|
+
$[76] = t9;
|
|
269
|
+
$[77] = t27;
|
|
270
|
+
} else t27 = $[77];
|
|
271
|
+
let t28;
|
|
272
|
+
if ($[78] !== T0 || $[79] !== as || $[80] !== error || $[81] !== t27 || $[82] !== t7) {
|
|
273
|
+
t28 = /* @__PURE__ */ jsx(T0, {
|
|
272
274
|
as,
|
|
273
275
|
error,
|
|
274
276
|
triggerTabIndex: t7,
|
|
275
|
-
children:
|
|
277
|
+
children: t27
|
|
276
278
|
});
|
|
277
|
-
$[
|
|
278
|
-
$[
|
|
279
|
-
$[
|
|
280
|
-
$[
|
|
281
|
-
$[
|
|
282
|
-
$[
|
|
283
|
-
} else
|
|
284
|
-
return
|
|
279
|
+
$[78] = T0;
|
|
280
|
+
$[79] = as;
|
|
281
|
+
$[80] = error;
|
|
282
|
+
$[81] = t27;
|
|
283
|
+
$[82] = t7;
|
|
284
|
+
$[83] = t28;
|
|
285
|
+
} else t28 = $[83];
|
|
286
|
+
return t28;
|
|
285
287
|
};
|
|
286
288
|
var TextInput = ({ renderStaticInput, ...props }) => {
|
|
287
289
|
const ui = UIConfig.useConfig();
|
|
@@ -4,12 +4,12 @@ import { FormFieldHeaderProps } from '../../FormField/FormFieldHeader';
|
|
|
4
4
|
import { SelectBaseProps } from './SelectBase';
|
|
5
5
|
import { SelectItem } from './select.types';
|
|
6
6
|
import { InputVariantProps } from '../../shared/input.cva';
|
|
7
|
-
interface SelectInputProps extends InputVariantProps, Pick<SelectBaseProps, "ref" | "placeholder" | "isDisabled" | "hideDropdownIcon" | "isSearchable" | "isClearable" | "onBlur" | "showSelectionContent" | "inputClassName" | "selectedTagsType" | "collapseAfter" | "isRequired" | "isDirty" | "
|
|
7
|
+
interface SelectInputProps extends InputVariantProps, Pick<SelectBaseProps, "ref" | "placeholder" | "isDisabled" | "hideDropdownIcon" | "isSearchable" | "isClearable" | "onBlur" | "showSelectionContent" | "inputClassName" | "selectedTagsType" | "collapseAfter" | "isRequired" | "isDirty" | "leadingContent" | "trailingContent" | "onMouseEnter" | "onFocusCapture"> {
|
|
8
8
|
isInvalid?: boolean;
|
|
9
9
|
className?: string;
|
|
10
10
|
fieldProps?: AriaFieldProps;
|
|
11
11
|
headerProps?: FormFieldHeaderProps;
|
|
12
12
|
onCloseComboBox?: (state: ComboBoxState<SelectItem> | null) => void;
|
|
13
13
|
}
|
|
14
|
-
export declare const SelectInput: ({ ref, placeholder, variant, as, size, isDisabled, isInvalid, className, hideDropdownIcon, isSearchable, isClearable, showSelectionContent, inputClassName, fieldProps, headerProps, selectedTagsType, collapseAfter, isRequired, isDirty, onCloseComboBox, onBlur,
|
|
14
|
+
export declare const SelectInput: ({ ref, placeholder, variant, as, size, isDisabled, isInvalid, className, hideDropdownIcon, isSearchable, isClearable, showSelectionContent, inputClassName, fieldProps, headerProps, selectedTagsType, collapseAfter, isRequired, isDirty, onCloseComboBox, onBlur, leadingContent, trailingContent, onMouseEnter, onFocusCapture, ...props }: SelectInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
export {};
|
|
@@ -17,8 +17,8 @@ import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
|
|
|
17
17
|
import { useTranslation } from "react-i18next";
|
|
18
18
|
//#region src/components/inputs/Selection/shared/SelectInput.tsx
|
|
19
19
|
var SelectInput = (t0) => {
|
|
20
|
-
const $0 = c(
|
|
21
|
-
const { ref, placeholder, variant, as, size, isDisabled, isInvalid, className, hideDropdownIcon, isSearchable, isClearable, showSelectionContent, inputClassName, fieldProps, headerProps, selectedTagsType, collapseAfter, isRequired, isDirty, onCloseComboBox, onBlur,
|
|
20
|
+
const $0 = c(107);
|
|
21
|
+
const { ref, placeholder, variant, as, size, isDisabled, isInvalid, className, hideDropdownIcon, isSearchable, isClearable, showSelectionContent, inputClassName, fieldProps, headerProps, selectedTagsType, collapseAfter, isRequired, isDirty, onCloseComboBox, onBlur, leadingContent, trailingContent, onMouseEnter, onFocusCapture, ...props } = t0;
|
|
22
22
|
const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
|
|
23
23
|
const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
|
|
24
24
|
const inputClearClassCva = UIStyle.useCva("input.clearClassCva", inputClearClass);
|
|
@@ -78,34 +78,28 @@ var SelectInput = (t0) => {
|
|
|
78
78
|
}
|
|
79
79
|
const labelProps = t3;
|
|
80
80
|
let t4;
|
|
81
|
-
if ($0[10] !== fieldState.inputValue || $0[11] !== fieldState.value || $0[12] !==
|
|
81
|
+
if ($0[10] !== fieldState.inputValue || $0[11] !== fieldState.value || $0[12] !== isLoading || $0[13] !== isMultiple || $0[14] !== listItems || $0[15] !== onChange || $0[16] !== onCloseComboBox || $0[17] !== state) {
|
|
82
82
|
t4 = (e) => {
|
|
83
83
|
if (e.key === "Enter" && !isMultiple && !isLoading && listItems.length === 1 && !listItems[0].isDisabled) {
|
|
84
84
|
e.preventDefault();
|
|
85
85
|
onChange(listItems[0].id);
|
|
86
|
-
if (fireBlurOnChange) onBlur?.({});
|
|
87
86
|
onCloseComboBox?.(state);
|
|
88
87
|
}
|
|
89
|
-
if (e.key === "Backspace" && isMultiple && fieldState.inputValue === "" && Array.isArray(fieldState.value) && fieldState.value.length > 0)
|
|
90
|
-
onChange(fieldState.value.slice(0, -1));
|
|
91
|
-
if (fireBlurOnChange) onBlur?.({});
|
|
92
|
-
}
|
|
88
|
+
if (e.key === "Backspace" && isMultiple && fieldState.inputValue === "" && Array.isArray(fieldState.value) && fieldState.value.length > 0) onChange(fieldState.value.slice(0, -1));
|
|
93
89
|
};
|
|
94
90
|
$0[10] = fieldState.inputValue;
|
|
95
91
|
$0[11] = fieldState.value;
|
|
96
|
-
$0[12] =
|
|
97
|
-
$0[13] =
|
|
98
|
-
$0[14] =
|
|
99
|
-
$0[15] =
|
|
100
|
-
$0[16] =
|
|
101
|
-
$0[17] =
|
|
102
|
-
$0[18] =
|
|
103
|
-
|
|
104
|
-
$0[20] = t4;
|
|
105
|
-
} else t4 = $0[20];
|
|
92
|
+
$0[12] = isLoading;
|
|
93
|
+
$0[13] = isMultiple;
|
|
94
|
+
$0[14] = listItems;
|
|
95
|
+
$0[15] = onChange;
|
|
96
|
+
$0[16] = onCloseComboBox;
|
|
97
|
+
$0[17] = state;
|
|
98
|
+
$0[18] = t4;
|
|
99
|
+
} else t4 = $0[18];
|
|
106
100
|
const onKeyDown = t4;
|
|
107
101
|
let t5;
|
|
108
|
-
if ($0[
|
|
102
|
+
if ($0[19] !== isDisabled || $0[20] !== isOpen || $0[21] !== isSearchable || $0[22] !== setIsOpen) {
|
|
109
103
|
t5 = () => {
|
|
110
104
|
if (isDisabled) return;
|
|
111
105
|
if (!isSearchable) {
|
|
@@ -114,12 +108,12 @@ var SelectInput = (t0) => {
|
|
|
114
108
|
}
|
|
115
109
|
inputRef.current?.focus();
|
|
116
110
|
};
|
|
117
|
-
$0[
|
|
118
|
-
$0[
|
|
119
|
-
$0[
|
|
120
|
-
$0[
|
|
121
|
-
$0[
|
|
122
|
-
} else t5 = $0[
|
|
111
|
+
$0[19] = isDisabled;
|
|
112
|
+
$0[20] = isOpen;
|
|
113
|
+
$0[21] = isSearchable;
|
|
114
|
+
$0[22] = setIsOpen;
|
|
115
|
+
$0[23] = t5;
|
|
116
|
+
} else t5 = $0[23];
|
|
123
117
|
const onClick = t5;
|
|
124
118
|
const t6 = inputBaseCva({
|
|
125
119
|
variant,
|
|
@@ -149,28 +143,28 @@ var SelectInput = (t0) => {
|
|
|
149
143
|
...props
|
|
150
144
|
}));
|
|
151
145
|
let t24;
|
|
152
|
-
if ($0[
|
|
146
|
+
if ($0[24] !== as || $0[25] !== headerProps || $0[26] !== labelProps) {
|
|
153
147
|
t24 = as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
|
|
154
148
|
as,
|
|
155
149
|
...headerProps,
|
|
156
150
|
labelProps
|
|
157
151
|
});
|
|
158
|
-
$0[
|
|
159
|
-
$0[
|
|
160
|
-
$0[
|
|
161
|
-
$0[
|
|
162
|
-
} else t24 = $0[
|
|
152
|
+
$0[24] = as;
|
|
153
|
+
$0[25] = headerProps;
|
|
154
|
+
$0[26] = labelProps;
|
|
155
|
+
$0[27] = t24;
|
|
156
|
+
} else t24 = $0[27];
|
|
163
157
|
let t25;
|
|
164
|
-
if ($0[
|
|
158
|
+
if ($0[28] !== leadingContent) {
|
|
165
159
|
t25 = leadingContent && /* @__PURE__ */ jsx("div", {
|
|
166
160
|
className: "ml-input-side-default flex shrink-0 items-center",
|
|
167
161
|
children: leadingContent
|
|
168
162
|
});
|
|
169
|
-
$0[
|
|
170
|
-
$0[
|
|
171
|
-
} else t25 = $0[
|
|
163
|
+
$0[28] = leadingContent;
|
|
164
|
+
$0[29] = t25;
|
|
165
|
+
} else t25 = $0[29];
|
|
172
166
|
let t26;
|
|
173
|
-
if ($0[
|
|
167
|
+
if ($0[30] !== as || $0[31] !== collapseAfter || $0[32] !== fieldProps || $0[33] !== inputClassName || $0[34] !== isDisabled || $0[35] !== isSearchable || $0[36] !== onBlur || $0[37] !== onKeyDown || $0[38] !== onRemove || $0[39] !== placeholder || $0[40] !== selectedItems || $0[41] !== selectedTagsType || $0[42] !== showTags) {
|
|
174
168
|
t26 = (showTags || isSearchable) && /* @__PURE__ */ jsxs("div", {
|
|
175
169
|
className: selectInputTagsContentWrapperCva({ isSearchable }),
|
|
176
170
|
children: [showTags && /* @__PURE__ */ jsx(SelectInputTags, {
|
|
@@ -188,23 +182,23 @@ var SelectInput = (t0) => {
|
|
|
188
182
|
...fieldProps
|
|
189
183
|
})]
|
|
190
184
|
});
|
|
191
|
-
$0[
|
|
192
|
-
$0[
|
|
193
|
-
$0[
|
|
194
|
-
$0[
|
|
195
|
-
$0[
|
|
196
|
-
$0[
|
|
197
|
-
$0[
|
|
198
|
-
$0[
|
|
199
|
-
$0[
|
|
200
|
-
$0[
|
|
201
|
-
$0[
|
|
202
|
-
$0[
|
|
203
|
-
$0[
|
|
204
|
-
$0[
|
|
205
|
-
} else t26 = $0[
|
|
185
|
+
$0[30] = as;
|
|
186
|
+
$0[31] = collapseAfter;
|
|
187
|
+
$0[32] = fieldProps;
|
|
188
|
+
$0[33] = inputClassName;
|
|
189
|
+
$0[34] = isDisabled;
|
|
190
|
+
$0[35] = isSearchable;
|
|
191
|
+
$0[36] = onBlur;
|
|
192
|
+
$0[37] = onKeyDown;
|
|
193
|
+
$0[38] = onRemove;
|
|
194
|
+
$0[39] = placeholder;
|
|
195
|
+
$0[40] = selectedItems;
|
|
196
|
+
$0[41] = selectedTagsType;
|
|
197
|
+
$0[42] = showTags;
|
|
198
|
+
$0[43] = t26;
|
|
199
|
+
} else t26 = $0[43];
|
|
206
200
|
let t27;
|
|
207
|
-
if ($0[
|
|
201
|
+
if ($0[44] !== as || $0[45] !== fieldProps || $0[46] !== isDisabled || $0[47] !== isEmpty || $0[48] !== isMultiple || $0[49] !== isOpen || $0[50] !== isSearchable || $0[51] !== onBlur || $0[52] !== placeholder || $0[53] !== selectedItems[0] || $0[54] !== setIsOpen || $0[55] !== showSelectionContent || $0[56] !== showTags) {
|
|
208
202
|
t27 = !isSearchable && /* @__PURE__ */ jsxs(Button, {
|
|
209
203
|
isDisabled,
|
|
210
204
|
onPress: () => setIsOpen(!isOpen),
|
|
@@ -218,23 +212,23 @@ var SelectInput = (t0) => {
|
|
|
218
212
|
children: [isEmpty && placeholder, !isEmpty && (showSelectionContent ? selectedItems[0].content : selectedItems[0].label)]
|
|
219
213
|
})]
|
|
220
214
|
});
|
|
221
|
-
$0[
|
|
222
|
-
$0[
|
|
223
|
-
$0[
|
|
224
|
-
$0[
|
|
225
|
-
$0[
|
|
226
|
-
$0[
|
|
227
|
-
$0[
|
|
228
|
-
$0[
|
|
229
|
-
$0[
|
|
230
|
-
$0[
|
|
231
|
-
$0[
|
|
232
|
-
$0[
|
|
233
|
-
$0[
|
|
234
|
-
$0[
|
|
235
|
-
} else t27 = $0[
|
|
215
|
+
$0[44] = as;
|
|
216
|
+
$0[45] = fieldProps;
|
|
217
|
+
$0[46] = isDisabled;
|
|
218
|
+
$0[47] = isEmpty;
|
|
219
|
+
$0[48] = isMultiple;
|
|
220
|
+
$0[49] = isOpen;
|
|
221
|
+
$0[50] = isSearchable;
|
|
222
|
+
$0[51] = onBlur;
|
|
223
|
+
$0[52] = placeholder;
|
|
224
|
+
$0[53] = selectedItems[0];
|
|
225
|
+
$0[54] = setIsOpen;
|
|
226
|
+
$0[55] = showSelectionContent;
|
|
227
|
+
$0[56] = showTags;
|
|
228
|
+
$0[57] = t27;
|
|
229
|
+
} else t27 = $0[57];
|
|
236
230
|
let t28;
|
|
237
|
-
if ($0[
|
|
231
|
+
if ($0[58] !== onClick || $0[59] !== t23 || $0[60] !== t24 || $0[61] !== t25 || $0[62] !== t26 || $0[63] !== t27) {
|
|
238
232
|
t28 = /* @__PURE__ */ jsxs("div", {
|
|
239
233
|
className: t23,
|
|
240
234
|
onClick,
|
|
@@ -245,44 +239,41 @@ var SelectInput = (t0) => {
|
|
|
245
239
|
t27
|
|
246
240
|
]
|
|
247
241
|
});
|
|
248
|
-
$0[
|
|
249
|
-
$0[
|
|
250
|
-
$0[
|
|
251
|
-
$0[
|
|
252
|
-
$0[
|
|
253
|
-
$0[
|
|
254
|
-
$0[
|
|
255
|
-
} else t28 = $0[
|
|
242
|
+
$0[58] = onClick;
|
|
243
|
+
$0[59] = t23;
|
|
244
|
+
$0[60] = t24;
|
|
245
|
+
$0[61] = t25;
|
|
246
|
+
$0[62] = t26;
|
|
247
|
+
$0[63] = t27;
|
|
248
|
+
$0[64] = t28;
|
|
249
|
+
} else t28 = $0[64];
|
|
256
250
|
let t29;
|
|
257
|
-
if ($0[
|
|
251
|
+
if ($0[65] !== as || $0[66] !== inputClearClassCva || $0[67] !== isClearable || $0[68] !== onClear || $0[69] !== showClearButton) {
|
|
258
252
|
t29 = isClearable && /* @__PURE__ */ jsx(InputClear, {
|
|
259
253
|
onClear: () => {
|
|
260
254
|
onClear();
|
|
261
|
-
if (fireBlurOnChange) onBlur?.({});
|
|
262
255
|
},
|
|
263
256
|
className: inputClearClassCva({ as }),
|
|
264
257
|
show: showClearButton
|
|
265
258
|
});
|
|
266
|
-
$0[
|
|
267
|
-
$0[
|
|
268
|
-
$0[
|
|
269
|
-
$0[
|
|
270
|
-
$0[
|
|
271
|
-
$0[
|
|
272
|
-
|
|
273
|
-
$0[74] = t29;
|
|
274
|
-
} else t29 = $0[74];
|
|
259
|
+
$0[65] = as;
|
|
260
|
+
$0[66] = inputClearClassCva;
|
|
261
|
+
$0[67] = isClearable;
|
|
262
|
+
$0[68] = onClear;
|
|
263
|
+
$0[69] = showClearButton;
|
|
264
|
+
$0[70] = t29;
|
|
265
|
+
} else t29 = $0[70];
|
|
275
266
|
let t30;
|
|
276
|
-
if ($0[
|
|
267
|
+
if ($0[71] !== trailingContent) {
|
|
277
268
|
t30 = trailingContent && /* @__PURE__ */ jsx("div", {
|
|
278
269
|
className: "flex shrink-0 items-center",
|
|
279
270
|
children: trailingContent
|
|
280
271
|
});
|
|
281
|
-
$0[
|
|
282
|
-
$0[
|
|
283
|
-
} else t30 = $0[
|
|
272
|
+
$0[71] = trailingContent;
|
|
273
|
+
$0[72] = t30;
|
|
274
|
+
} else t30 = $0[72];
|
|
284
275
|
let t31;
|
|
285
|
-
if ($0[
|
|
276
|
+
if ($0[73] !== hideDropdownIcon || $0[74] !== inputSizeCva || $0[75] !== isDisabled || $0[76] !== isOpen || $0[77] !== isSearchable || $0[78] !== setIsOpen || $0[79] !== size || $0[80] !== t) {
|
|
286
277
|
t31 = !hideDropdownIcon && /* @__PURE__ */ jsx(Button, {
|
|
287
278
|
excludeFromTabOrder: true,
|
|
288
279
|
"aria-label": t(($) => isOpen ? $.ui.closeAlt : $.ui.openAlt),
|
|
@@ -296,18 +287,18 @@ var SelectInput = (t0) => {
|
|
|
296
287
|
"aria-hidden": "true"
|
|
297
288
|
})
|
|
298
289
|
});
|
|
299
|
-
$0[
|
|
300
|
-
$0[
|
|
301
|
-
$0[
|
|
302
|
-
$0[
|
|
303
|
-
$0[
|
|
304
|
-
$0[
|
|
305
|
-
$0[
|
|
306
|
-
$0[
|
|
307
|
-
$0[
|
|
308
|
-
} else t31 = $0[
|
|
290
|
+
$0[73] = hideDropdownIcon;
|
|
291
|
+
$0[74] = inputSizeCva;
|
|
292
|
+
$0[75] = isDisabled;
|
|
293
|
+
$0[76] = isOpen;
|
|
294
|
+
$0[77] = isSearchable;
|
|
295
|
+
$0[78] = setIsOpen;
|
|
296
|
+
$0[79] = size;
|
|
297
|
+
$0[80] = t;
|
|
298
|
+
$0[81] = t31;
|
|
299
|
+
} else t31 = $0[81];
|
|
309
300
|
let t32;
|
|
310
|
-
if ($0[
|
|
301
|
+
if ($0[82] !== focusWithinProps || $0[83] !== hoverProps || $0[84] !== onFocusCapture || $0[85] !== onMouseEnter || $0[86] !== ref || $0[87] !== t10 || $0[88] !== t11 || $0[89] !== t12 || $0[90] !== t13 || $0[91] !== t14 || $0[92] !== t15 || $0[93] !== t16 || $0[94] !== t17 || $0[95] !== t18 || $0[96] !== t19 || $0[97] !== t20 || $0[98] !== t21 || $0[99] !== t28 || $0[100] !== t29 || $0[101] !== t30 || $0[102] !== t31 || $0[103] !== t6 || $0[104] !== t8 || $0[105] !== t9) {
|
|
311
302
|
t32 = /* @__PURE__ */ jsxs("div", {
|
|
312
303
|
ref,
|
|
313
304
|
className: t6,
|
|
@@ -338,32 +329,32 @@ var SelectInput = (t0) => {
|
|
|
338
329
|
t31
|
|
339
330
|
]
|
|
340
331
|
});
|
|
341
|
-
$0[
|
|
342
|
-
$0[
|
|
343
|
-
$0[
|
|
344
|
-
$0[
|
|
345
|
-
$0[
|
|
346
|
-
$0[
|
|
347
|
-
$0[
|
|
348
|
-
$0[
|
|
349
|
-
$0[
|
|
350
|
-
$0[
|
|
351
|
-
$0[
|
|
352
|
-
$0[
|
|
353
|
-
$0[
|
|
354
|
-
$0[
|
|
355
|
-
$0[
|
|
356
|
-
$0[
|
|
357
|
-
$0[
|
|
358
|
-
$0[
|
|
359
|
-
$0[
|
|
360
|
-
$0[
|
|
361
|
-
$0[
|
|
362
|
-
$0[
|
|
363
|
-
$0[
|
|
364
|
-
$0[
|
|
365
|
-
$0[
|
|
366
|
-
} else t32 = $0[
|
|
332
|
+
$0[82] = focusWithinProps;
|
|
333
|
+
$0[83] = hoverProps;
|
|
334
|
+
$0[84] = onFocusCapture;
|
|
335
|
+
$0[85] = onMouseEnter;
|
|
336
|
+
$0[86] = ref;
|
|
337
|
+
$0[87] = t10;
|
|
338
|
+
$0[88] = t11;
|
|
339
|
+
$0[89] = t12;
|
|
340
|
+
$0[90] = t13;
|
|
341
|
+
$0[91] = t14;
|
|
342
|
+
$0[92] = t15;
|
|
343
|
+
$0[93] = t16;
|
|
344
|
+
$0[94] = t17;
|
|
345
|
+
$0[95] = t18;
|
|
346
|
+
$0[96] = t19;
|
|
347
|
+
$0[97] = t20;
|
|
348
|
+
$0[98] = t21;
|
|
349
|
+
$0[99] = t28;
|
|
350
|
+
$0[100] = t29;
|
|
351
|
+
$0[101] = t30;
|
|
352
|
+
$0[102] = t31;
|
|
353
|
+
$0[103] = t6;
|
|
354
|
+
$0[104] = t8;
|
|
355
|
+
$0[105] = t9;
|
|
356
|
+
$0[106] = t32;
|
|
357
|
+
} else t32 = $0[106];
|
|
367
358
|
return t32;
|
|
368
359
|
};
|
|
369
360
|
//#endregion
|
|
@@ -24,8 +24,8 @@ export declare namespace SelectContext {
|
|
|
24
24
|
selectedIds: Key[];
|
|
25
25
|
isMultiple: boolean;
|
|
26
26
|
} & Pick<SelectBaseProps, "onInputChange" | "isLoading" | "hasLoadMore">;
|
|
27
|
-
export type ProviderProps = GroupedSelectProps & Pick<SelectBaseProps, "items" | "onInputChange" | "onSearchChange" | "showSelectAllOption" | "showNewItemOption" | "newItemMinLength" | "onNewItemOption" | "isLoading" | "hasLoadMore" | "mapInitialToSelectItem" | "isSearchable" | "isClientSearchDisabled" | "ignoreInputValueFiltering">;
|
|
28
|
-
export const Provider: ({ items, onInputChange, onSearchChange, showSelectAllOption, showNewItemOption, newItemMinLength, onNewItemOption, isLoading, hasLoadMore, isClientSearchDisabled, ignoreInputValueFiltering, children, mapInitialToSelectItem, ...props }: PropsWithChildren<ProviderProps>) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export type ProviderProps = GroupedSelectProps & Pick<SelectBaseProps, "items" | "onInputChange" | "onSearchChange" | "showSelectAllOption" | "showNewItemOption" | "newItemMinLength" | "onNewItemOption" | "isLoading" | "hasLoadMore" | "mapInitialToSelectItem" | "isSearchable" | "isClientSearchDisabled" | "ignoreInputValueFiltering" | "fireBlurOnChange" | "onBlur">;
|
|
28
|
+
export const Provider: ({ items, onInputChange, onSearchChange, showSelectAllOption, showNewItemOption, newItemMinLength, onNewItemOption, isLoading, hasLoadMore, isClientSearchDisabled, ignoreInputValueFiltering, fireBlurOnChange, onBlur: fieldOnBlur, children, mapInitialToSelectItem, ...props }: PropsWithChildren<ProviderProps>) => import("react/jsx-runtime").JSX.Element;
|
|
29
29
|
export const useSelect: () => Type;
|
|
30
30
|
export {};
|
|
31
31
|
}
|
|
@@ -10,7 +10,7 @@ var SelectContext;
|
|
|
10
10
|
id: item.id,
|
|
11
11
|
label: item.label ?? item.name ?? ""
|
|
12
12
|
});
|
|
13
|
-
_SelectContext.Provider = ({ items, onInputChange, onSearchChange, showSelectAllOption, showNewItemOption, newItemMinLength, onNewItemOption, isLoading, hasLoadMore, isClientSearchDisabled, ignoreInputValueFiltering, children, mapInitialToSelectItem = defaultMapInitialToSelectItem, ...props }) => {
|
|
13
|
+
_SelectContext.Provider = ({ items, onInputChange, onSearchChange, showSelectAllOption, showNewItemOption, newItemMinLength, onNewItemOption, isLoading, hasLoadMore, isClientSearchDisabled, ignoreInputValueFiltering, fireBlurOnChange, onBlur: fieldOnBlur, children, mapInitialToSelectItem = defaultMapInitialToSelectItem, ...props }) => {
|
|
14
14
|
const isMultiple = props.selectionMode === "multiple";
|
|
15
15
|
const initialSelectedItems = useMemo(() => {
|
|
16
16
|
if (!props.initialSelection) return null;
|
|
@@ -58,13 +58,15 @@ var SelectContext;
|
|
|
58
58
|
}, [getItem_0]);
|
|
59
59
|
const getValueIds = () => Array.isArray(valueRef.current) ? valueRef.current.map(({ id: id_3 }) => id_3) : valueRef.current?.id ?? null;
|
|
60
60
|
const emitStateChanges = useCallback((changes, skipSelectionChange) => {
|
|
61
|
-
|
|
61
|
+
const valueChanged = JSON.stringify(changes.value) !== JSON.stringify(getValueIds());
|
|
62
|
+
if (valueChanged) {
|
|
62
63
|
updateValue(changes.value);
|
|
63
64
|
if (!skipSelectionChange) if (isMultiple) props.onChange?.(changes.value);
|
|
64
65
|
else props.onChange?.(changes.value);
|
|
65
66
|
}
|
|
66
67
|
if (changes.inputValue !== fieldState.inputValue) onInputChange?.(changes.inputValue);
|
|
67
68
|
if (changes.searchValue !== fieldState.searchValue) onSearchChangeDebounced?.(changes.searchValue);
|
|
69
|
+
return valueChanged;
|
|
68
70
|
}, [
|
|
69
71
|
fieldState,
|
|
70
72
|
isMultiple,
|
|
@@ -73,6 +75,9 @@ var SelectContext;
|
|
|
73
75
|
onSearchChangeDebounced,
|
|
74
76
|
updateValue
|
|
75
77
|
]);
|
|
78
|
+
const triggerBlurOnChange = useCallback(() => {
|
|
79
|
+
if (fireBlurOnChange) fieldOnBlur?.({});
|
|
80
|
+
}, [fireBlurOnChange, fieldOnBlur]);
|
|
76
81
|
const syncFieldState = (value_1) => {
|
|
77
82
|
const newFieldState = {
|
|
78
83
|
value: value_1,
|
|
@@ -115,7 +120,7 @@ var SelectContext;
|
|
|
115
120
|
searchValue: ""
|
|
116
121
|
};
|
|
117
122
|
setFieldState(newFieldState_1);
|
|
118
|
-
emitStateChanges(newFieldState_1);
|
|
123
|
+
if (emitStateChanges(newFieldState_1)) triggerBlurOnChange();
|
|
119
124
|
}
|
|
120
125
|
if (!isMultiple) {
|
|
121
126
|
setIsOpen(false);
|
|
@@ -126,7 +131,8 @@ var SelectContext;
|
|
|
126
131
|
onNewItemOption,
|
|
127
132
|
fieldState.inputValue,
|
|
128
133
|
getItem_0,
|
|
129
|
-
isMultiple
|
|
134
|
+
isMultiple,
|
|
135
|
+
triggerBlurOnChange
|
|
130
136
|
]);
|
|
131
137
|
const onClear = useCallback(() => {
|
|
132
138
|
if (!valueRef.current || Array.isArray(valueRef.current) && valueRef.current.length === 0) {
|