@povio/ui 3.3.0-rc.3 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js +55 -206
- package/dist/components/buttons/Button/button.cva.d.ts +1 -1
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
- package/dist/components/buttons/shared/ButtonContent.js +22 -80
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
- package/dist/components/inputs/Checkbox/CheckboxGroup.d.ts +5 -1
- package/dist/components/inputs/Checkbox/CheckboxGroup.js +234 -201
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +93 -227
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +170 -273
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +60 -147
- package/dist/components/inputs/DateTime/shared/Calendar.js +139 -339
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +114 -308
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +35 -150
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +95 -229
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +115 -296
- package/dist/components/inputs/DateTime/shared/DateField.js +135 -301
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +142 -338
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +144 -134
- package/dist/components/inputs/DateTime/shared/useFirefoxDateSegmentSelectionGuard.d.ts +2 -0
- package/dist/components/inputs/DateTime/shared/useFirefoxDateSegmentSelectionGuard.js +33 -0
- package/dist/components/inputs/File/FileUpload.js +1 -1
- package/dist/components/inputs/File/InputUpload.js +65 -261
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +48 -180
- package/dist/components/inputs/File/shared/FileUploadContentError.js +95 -265
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +99 -261
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +56 -234
- package/dist/components/inputs/File/shared/ProgressBar.js +15 -102
- package/dist/components/inputs/FormField/FormField.js +34 -47
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +2 -1
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +77 -314
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +23 -83
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +56 -2
- package/dist/components/inputs/Selection/Select/QuerySelect.js +82 -94
- package/dist/components/inputs/Selection/Select/Select.js +3 -3
- package/dist/components/inputs/Selection/shared/SelectInput.js +1 -0
- package/dist/components/inputs/Selection/shared/SelectListBox.js +51 -163
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +1 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +1 -0
- package/dist/components/inputs/Selection/shared/select.context.js +19 -9
- package/dist/components/inputs/Selection/shared/useSelectItems.js +48 -108
- package/dist/components/inputs/Skeleton/InputFrame.js +177 -552
- package/dist/components/inputs/TextEditor/TextEditor.js +87 -389
- package/dist/components/inputs/shared/InputClear.js +24 -40
- package/dist/components/inputs/shared/input.cva.js +1 -1
- package/dist/components/navigation/Accordion/Accordion.js +22 -69
- package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
- package/dist/components/navigation/Stepper/Stepper.js +22 -67
- package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +29 -110
- package/dist/components/shared/pagination/Pagination.js +22 -108
- package/dist/components/shared/pagination/minWidth.cva.d.ts +1 -1
- package/dist/components/status/Alert/Alert.js +30 -97
- package/dist/components/table/InfiniteTable.js +16 -67
- package/dist/components/table/Table.d.ts +2 -8
- package/dist/components/table/Table.js +33 -55
- package/dist/components/text/Typography/Typography.js +8 -23
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/theme.context.js +45 -98
- package/dist/config/uiConfig.context.d.ts +1 -0
- package/dist/config/uiConfig.context.js +10 -40
- package/dist/config/uiOverrides.context.d.ts +0 -1
- package/dist/helpers/dynamicColumns.js +2 -1
- package/dist/hooks/useDebounceCallback.js +17 -51
- package/dist/hooks/useFormAutosave.js +33 -120
- package/dist/hooks/useLongPressRepeat.js +20 -55
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/utils/date-time.utils.d.ts +0 -1
- package/dist/utils/date-time.utils.js +21 -45
- package/dist/utils/intl.utils.d.ts +7 -0
- package/dist/utils/intl.utils.js +38 -0
- package/dist/utils/intl.utils.spec.d.ts +1 -0
- package/package.json +2 -2
- package/dist/components/inputs/FormField/formField.cva.d.ts +0 -11
- package/dist/components/inputs/FormField/formField.cva.js +0 -16
- package/dist/components/table/TableColumnFilterInput.d.ts +0 -9
- package/dist/components/table/TableColumnFilterInput.js +0 -108
- package/dist/components/table/TableColumnFilterPlaceholder.d.ts +0 -5
- package/dist/components/table/TableColumnFilterPlaceholder.js +0 -41
- package/dist/components/table/TableColumnFilterRow.d.ts +0 -16
- package/dist/components/table/TableColumnFilterRow.js +0 -68
|
@@ -2,6 +2,7 @@ import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
|
2
2
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
3
3
|
import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
|
|
4
4
|
import { inputBaseDefinition, inputSizeDefinition } from "../../shared/input.cva.js";
|
|
5
|
+
import { IntlUtils } from "../../../../utils/intl.utils.js";
|
|
5
6
|
import { InputClear } from "../../shared/InputClear.js";
|
|
6
7
|
import { InputFrame } from "../../Skeleton/InputFrame.js";
|
|
7
8
|
import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
|
|
@@ -27,337 +28,99 @@ var normalizeRangeValue = (value, minValue, maxValue) => {
|
|
|
27
28
|
};
|
|
28
29
|
};
|
|
29
30
|
var NumberRangeInputBase = (props) => {
|
|
30
|
-
const $ = c(114);
|
|
31
31
|
const ui = UIConfig.useConfig();
|
|
32
32
|
const inputBaseCva = UIOverrides.useCva("input.baseCva", inputBaseDefinition);
|
|
33
33
|
const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
|
|
34
|
-
|
|
35
|
-
let autoFocusOnMount;
|
|
36
|
-
let className;
|
|
37
|
-
let error;
|
|
38
|
-
let errorClassName;
|
|
39
|
-
let headerClassName;
|
|
40
|
-
let helperText;
|
|
41
|
-
let hideLabelProps;
|
|
42
|
-
let inputClassName;
|
|
43
|
-
let isClearableProps;
|
|
44
|
-
let isDirty;
|
|
45
|
-
let isDisabled;
|
|
46
|
-
let isHeaderHidden;
|
|
47
|
-
let isRequired;
|
|
48
|
-
let label;
|
|
49
|
-
let maxInputClassName;
|
|
50
|
-
let maxValue;
|
|
51
|
-
let minInputClassName;
|
|
52
|
-
let minValue;
|
|
53
|
-
let onBlur;
|
|
54
|
-
let onChange;
|
|
55
|
-
let onMaxChange;
|
|
56
|
-
let onMinChange;
|
|
57
|
-
let ref;
|
|
58
|
-
let rest;
|
|
59
|
-
let rightContent;
|
|
60
|
-
let sizeProps;
|
|
61
|
-
let t0;
|
|
62
|
-
let t1;
|
|
63
|
-
let t2;
|
|
64
|
-
let t3;
|
|
65
|
-
let t4;
|
|
66
|
-
let t5;
|
|
67
|
-
let tooltipText;
|
|
68
|
-
let value;
|
|
69
|
-
let variantProps;
|
|
70
|
-
if ($[0] !== props) {
|
|
71
|
-
({ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, className, inputClassName, minInputClassName, maxInputClassName, value, minValue, maxValue, minPlaceholder: t0, maxPlaceholder: t1, minLabel: t2, maxLabel: t3, invalidRangeError: t4, hideInnerLabels: t5, isDirty, autoFocusOnMount, onChange, onMinChange, onMaxChange, onBlur, isClearable: isClearableProps, as: asProp, variant: variantProps, size: sizeProps, hideLabel: hideLabelProps, ...rest} = props);
|
|
72
|
-
$[0] = props;
|
|
73
|
-
$[1] = asProp;
|
|
74
|
-
$[2] = autoFocusOnMount;
|
|
75
|
-
$[3] = className;
|
|
76
|
-
$[4] = error;
|
|
77
|
-
$[5] = errorClassName;
|
|
78
|
-
$[6] = headerClassName;
|
|
79
|
-
$[7] = helperText;
|
|
80
|
-
$[8] = hideLabelProps;
|
|
81
|
-
$[9] = inputClassName;
|
|
82
|
-
$[10] = isClearableProps;
|
|
83
|
-
$[11] = isDirty;
|
|
84
|
-
$[12] = isDisabled;
|
|
85
|
-
$[13] = isHeaderHidden;
|
|
86
|
-
$[14] = isRequired;
|
|
87
|
-
$[15] = label;
|
|
88
|
-
$[16] = maxInputClassName;
|
|
89
|
-
$[17] = maxValue;
|
|
90
|
-
$[18] = minInputClassName;
|
|
91
|
-
$[19] = minValue;
|
|
92
|
-
$[20] = onBlur;
|
|
93
|
-
$[21] = onChange;
|
|
94
|
-
$[22] = onMaxChange;
|
|
95
|
-
$[23] = onMinChange;
|
|
96
|
-
$[24] = ref;
|
|
97
|
-
$[25] = rest;
|
|
98
|
-
$[26] = rightContent;
|
|
99
|
-
$[27] = sizeProps;
|
|
100
|
-
$[28] = t0;
|
|
101
|
-
$[29] = t1;
|
|
102
|
-
$[30] = t2;
|
|
103
|
-
$[31] = t3;
|
|
104
|
-
$[32] = t4;
|
|
105
|
-
$[33] = t5;
|
|
106
|
-
$[34] = tooltipText;
|
|
107
|
-
$[35] = value;
|
|
108
|
-
$[36] = variantProps;
|
|
109
|
-
} else {
|
|
110
|
-
asProp = $[1];
|
|
111
|
-
autoFocusOnMount = $[2];
|
|
112
|
-
className = $[3];
|
|
113
|
-
error = $[4];
|
|
114
|
-
errorClassName = $[5];
|
|
115
|
-
headerClassName = $[6];
|
|
116
|
-
helperText = $[7];
|
|
117
|
-
hideLabelProps = $[8];
|
|
118
|
-
inputClassName = $[9];
|
|
119
|
-
isClearableProps = $[10];
|
|
120
|
-
isDirty = $[11];
|
|
121
|
-
isDisabled = $[12];
|
|
122
|
-
isHeaderHidden = $[13];
|
|
123
|
-
isRequired = $[14];
|
|
124
|
-
label = $[15];
|
|
125
|
-
maxInputClassName = $[16];
|
|
126
|
-
maxValue = $[17];
|
|
127
|
-
minInputClassName = $[18];
|
|
128
|
-
minValue = $[19];
|
|
129
|
-
onBlur = $[20];
|
|
130
|
-
onChange = $[21];
|
|
131
|
-
onMaxChange = $[22];
|
|
132
|
-
onMinChange = $[23];
|
|
133
|
-
ref = $[24];
|
|
134
|
-
rest = $[25];
|
|
135
|
-
rightContent = $[26];
|
|
136
|
-
sizeProps = $[27];
|
|
137
|
-
t0 = $[28];
|
|
138
|
-
t1 = $[29];
|
|
139
|
-
t2 = $[30];
|
|
140
|
-
t3 = $[31];
|
|
141
|
-
t4 = $[32];
|
|
142
|
-
t5 = $[33];
|
|
143
|
-
tooltipText = $[34];
|
|
144
|
-
value = $[35];
|
|
145
|
-
variantProps = $[36];
|
|
146
|
-
}
|
|
147
|
-
const minPlaceholder = t0 === void 0 ? "Min" : t0;
|
|
148
|
-
const maxPlaceholder = t1 === void 0 ? "Max" : t1;
|
|
149
|
-
const minLabel = t2 === void 0 ? "Minimum" : t2;
|
|
150
|
-
const maxLabel = t3 === void 0 ? "Maximum" : t3;
|
|
151
|
-
const invalidRangeError = t4 === void 0 ? "Minimum cannot be greater than maximum" : t4;
|
|
152
|
-
const hideInnerLabels = t5 === void 0 ? true : t5;
|
|
34
|
+
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, className, inputClassName, minInputClassName, maxInputClassName, value, minValue, maxValue, minPlaceholder = "Min", maxPlaceholder = "Max", minLabel = "Minimum", maxLabel = "Maximum", invalidRangeError = "Minimum cannot be greater than maximum", hideInnerLabels = true, isDirty, autoFocusOnMount, onChange, onMinChange, onMaxChange, onBlur, isClearable: isClearableProps, as: asProp, variant: variantProps, size: sizeProps, hideLabel: hideLabelProps, ...rest } = props;
|
|
153
35
|
const isClearable = isClearableProps ?? ui.input.isClearable;
|
|
154
36
|
const as = asProp ?? ui.input.as;
|
|
155
37
|
const variant = variantProps ?? ui.input.variant;
|
|
156
38
|
const size = sizeProps ?? ui.input.size;
|
|
157
39
|
const hideLabel = hideLabelProps ?? ui.input.hideLabel;
|
|
158
|
-
|
|
159
|
-
if ($[37] !== maxValue || $[38] !== minValue || $[39] !== value) {
|
|
160
|
-
t6 = normalizeRangeValue(value, minValue, maxValue);
|
|
161
|
-
$[37] = maxValue;
|
|
162
|
-
$[38] = minValue;
|
|
163
|
-
$[39] = value;
|
|
164
|
-
$[40] = t6;
|
|
165
|
-
} else t6 = $[40];
|
|
166
|
-
const rangeValue = t6;
|
|
40
|
+
const rangeValue = normalizeRangeValue(value, minValue, maxValue);
|
|
167
41
|
const isEmpty = rangeValue.min === null && rangeValue.max === null;
|
|
168
42
|
const rangeError = rangeValue.min !== null && rangeValue.max !== null && rangeValue.min > rangeValue.max ? invalidRangeError : void 0;
|
|
169
43
|
const effectiveError = error || rangeError;
|
|
170
|
-
|
|
171
|
-
if ($[41] !== isDisabled) {
|
|
172
|
-
t7 = { isDisabled };
|
|
173
|
-
$[41] = isDisabled;
|
|
174
|
-
$[42] = t7;
|
|
175
|
-
} else t7 = $[42];
|
|
176
|
-
const { hoverProps, isHovered } = useHover(t7);
|
|
44
|
+
const { hoverProps, isHovered } = useHover({ isDisabled });
|
|
177
45
|
const { isFocusVisible } = useFocusVisible();
|
|
178
46
|
const [isFocused, setIsFocused] = useState(false);
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
$[50] = isRequired;
|
|
208
|
-
$[51] = label;
|
|
209
|
-
$[52] = rightContent;
|
|
210
|
-
$[53] = t9;
|
|
211
|
-
$[54] = tooltipText;
|
|
212
|
-
$[55] = t10;
|
|
213
|
-
} else t10 = $[55];
|
|
214
|
-
const formFieldProps = t10;
|
|
215
|
-
const t11 = hideLabel || isHeaderHidden;
|
|
216
|
-
let t12;
|
|
217
|
-
if ($[56] !== headerClassName || $[57] !== helperText || $[58] !== isDisabled || $[59] !== isRequired || $[60] !== label || $[61] !== rightContent || $[62] !== t11 || $[63] !== tooltipText) {
|
|
218
|
-
t12 = {
|
|
219
|
-
label,
|
|
220
|
-
tooltipText,
|
|
221
|
-
helperText,
|
|
222
|
-
isRequired,
|
|
223
|
-
rightContent,
|
|
224
|
-
isHeaderHidden: t11,
|
|
225
|
-
isDisabled,
|
|
226
|
-
className: headerClassName
|
|
227
|
-
};
|
|
228
|
-
$[56] = headerClassName;
|
|
229
|
-
$[57] = helperText;
|
|
230
|
-
$[58] = isDisabled;
|
|
231
|
-
$[59] = isRequired;
|
|
232
|
-
$[60] = label;
|
|
233
|
-
$[61] = rightContent;
|
|
234
|
-
$[62] = t11;
|
|
235
|
-
$[63] = tooltipText;
|
|
236
|
-
$[64] = t12;
|
|
237
|
-
} else t12 = $[64];
|
|
238
|
-
const headerProps = t12;
|
|
239
|
-
let t13;
|
|
240
|
-
if ($[65] !== onChange || $[66] !== onMaxChange || $[67] !== onMinChange || $[68] !== rangeValue) {
|
|
241
|
-
t13 = (side, nextValue) => {
|
|
242
|
-
const nextRange = {
|
|
243
|
-
...rangeValue,
|
|
244
|
-
[side]: nextValue
|
|
245
|
-
};
|
|
246
|
-
onChange?.(nextRange);
|
|
247
|
-
if (side === "min") onMinChange?.(nextValue);
|
|
248
|
-
else onMaxChange?.(nextValue);
|
|
249
|
-
};
|
|
250
|
-
$[65] = onChange;
|
|
251
|
-
$[66] = onMaxChange;
|
|
252
|
-
$[67] = onMinChange;
|
|
253
|
-
$[68] = rangeValue;
|
|
254
|
-
$[69] = t13;
|
|
255
|
-
} else t13 = $[69];
|
|
256
|
-
const updateRange = t13;
|
|
257
|
-
let t14;
|
|
258
|
-
if ($[70] !== onBlur || $[71] !== updateRange) {
|
|
259
|
-
t14 = (side_0) => {
|
|
260
|
-
updateRange(side_0, null);
|
|
261
|
-
onBlur?.({ target: { value: "" } });
|
|
47
|
+
const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: setIsFocused });
|
|
48
|
+
const formFieldProps = {
|
|
49
|
+
error: effectiveError,
|
|
50
|
+
label,
|
|
51
|
+
tooltipText,
|
|
52
|
+
helperText,
|
|
53
|
+
isRequired,
|
|
54
|
+
rightContent,
|
|
55
|
+
isHeaderHidden: isHeaderHidden || as === "inline" || as === "filter" || as === "floating",
|
|
56
|
+
hideLabel,
|
|
57
|
+
isDisabled,
|
|
58
|
+
headerClassName,
|
|
59
|
+
errorClassName
|
|
60
|
+
};
|
|
61
|
+
const headerProps = {
|
|
62
|
+
label,
|
|
63
|
+
tooltipText,
|
|
64
|
+
helperText,
|
|
65
|
+
isRequired,
|
|
66
|
+
rightContent,
|
|
67
|
+
isHeaderHidden: hideLabel || isHeaderHidden,
|
|
68
|
+
isDisabled,
|
|
69
|
+
className: headerClassName
|
|
70
|
+
};
|
|
71
|
+
const updateRange = (side, nextValue) => {
|
|
72
|
+
const nextRange = {
|
|
73
|
+
...rangeValue,
|
|
74
|
+
[side]: nextValue
|
|
262
75
|
};
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
}
|
|
267
|
-
const clearRangeSide =
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
76
|
+
onChange?.(nextRange);
|
|
77
|
+
if (side === "min") onMinChange?.(nextValue);
|
|
78
|
+
else onMaxChange?.(nextValue);
|
|
79
|
+
};
|
|
80
|
+
const clearRangeSide = (side_0) => {
|
|
81
|
+
updateRange(side_0, null);
|
|
82
|
+
onBlur?.({ target: { value: "" } });
|
|
83
|
+
};
|
|
84
|
+
return /* @__PURE__ */ jsx(NumberRangeField, {
|
|
85
|
+
...rest,
|
|
86
|
+
ref,
|
|
87
|
+
as,
|
|
88
|
+
className,
|
|
89
|
+
inputClassName,
|
|
90
|
+
minInputClassName,
|
|
91
|
+
maxInputClassName,
|
|
92
|
+
inputBaseClassName: inputBaseCva({
|
|
271
93
|
variant,
|
|
272
94
|
as
|
|
273
|
-
})
|
|
274
|
-
|
|
275
|
-
$[74] = inputBaseCva;
|
|
276
|
-
$[75] = variant;
|
|
277
|
-
$[76] = t15;
|
|
278
|
-
} else t15 = $[76];
|
|
279
|
-
let t16;
|
|
280
|
-
if ($[77] !== as || $[78] !== inputSizeCva || $[79] !== size) {
|
|
281
|
-
t16 = inputSizeCva({
|
|
95
|
+
}),
|
|
96
|
+
inputSizeClassName: inputSizeCva({
|
|
282
97
|
size,
|
|
283
98
|
as
|
|
284
|
-
})
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
maxLabel,
|
|
310
|
-
hideInnerLabels,
|
|
311
|
-
isDirty,
|
|
312
|
-
isClearable,
|
|
313
|
-
autoFocusOnMount,
|
|
314
|
-
isDisabled,
|
|
315
|
-
isRequired,
|
|
316
|
-
isEmpty,
|
|
317
|
-
isHovered,
|
|
318
|
-
isFocused,
|
|
319
|
-
isFocusVisible,
|
|
320
|
-
focusWithinProps,
|
|
321
|
-
hoverProps,
|
|
322
|
-
onRangeSideChange: updateRange,
|
|
323
|
-
onRangeSideClear: clearRangeSide,
|
|
324
|
-
onBlur
|
|
325
|
-
});
|
|
326
|
-
$[81] = as;
|
|
327
|
-
$[82] = autoFocusOnMount;
|
|
328
|
-
$[83] = className;
|
|
329
|
-
$[84] = clearRangeSide;
|
|
330
|
-
$[85] = effectiveError;
|
|
331
|
-
$[86] = focusWithinProps;
|
|
332
|
-
$[87] = formFieldProps;
|
|
333
|
-
$[88] = headerProps;
|
|
334
|
-
$[89] = hideInnerLabels;
|
|
335
|
-
$[90] = hoverProps;
|
|
336
|
-
$[91] = inputClassName;
|
|
337
|
-
$[92] = isClearable;
|
|
338
|
-
$[93] = isDirty;
|
|
339
|
-
$[94] = isDisabled;
|
|
340
|
-
$[95] = isEmpty;
|
|
341
|
-
$[96] = isFocusVisible;
|
|
342
|
-
$[97] = isFocused;
|
|
343
|
-
$[98] = isHovered;
|
|
344
|
-
$[99] = isRequired;
|
|
345
|
-
$[100] = maxInputClassName;
|
|
346
|
-
$[101] = maxLabel;
|
|
347
|
-
$[102] = maxPlaceholder;
|
|
348
|
-
$[103] = minInputClassName;
|
|
349
|
-
$[104] = minLabel;
|
|
350
|
-
$[105] = minPlaceholder;
|
|
351
|
-
$[106] = onBlur;
|
|
352
|
-
$[107] = rangeValue;
|
|
353
|
-
$[108] = ref;
|
|
354
|
-
$[109] = rest;
|
|
355
|
-
$[110] = t15;
|
|
356
|
-
$[111] = t16;
|
|
357
|
-
$[112] = updateRange;
|
|
358
|
-
$[113] = t17;
|
|
359
|
-
} else t17 = $[113];
|
|
360
|
-
return t17;
|
|
99
|
+
}),
|
|
100
|
+
formFieldProps,
|
|
101
|
+
headerProps,
|
|
102
|
+
rangeValue,
|
|
103
|
+
effectiveError,
|
|
104
|
+
minPlaceholder,
|
|
105
|
+
maxPlaceholder,
|
|
106
|
+
minLabel,
|
|
107
|
+
maxLabel,
|
|
108
|
+
hideInnerLabels,
|
|
109
|
+
isDirty,
|
|
110
|
+
isClearable,
|
|
111
|
+
autoFocusOnMount,
|
|
112
|
+
isDisabled,
|
|
113
|
+
isRequired,
|
|
114
|
+
isEmpty,
|
|
115
|
+
isHovered,
|
|
116
|
+
isFocused,
|
|
117
|
+
isFocusVisible,
|
|
118
|
+
focusWithinProps,
|
|
119
|
+
hoverProps,
|
|
120
|
+
onRangeSideChange: updateRange,
|
|
121
|
+
onRangeSideClear: clearRangeSide,
|
|
122
|
+
onBlur
|
|
123
|
+
});
|
|
361
124
|
};
|
|
362
125
|
var NumberRangeInputInner = (t0) => {
|
|
363
126
|
const $ = c(5);
|
|
@@ -381,7 +144,7 @@ var NumberRangeInputInner = (t0) => {
|
|
|
381
144
|
if (!renderInput) {
|
|
382
145
|
const staticValue = normalizeRangeValue(props.value, props.minValue, props.maxValue);
|
|
383
146
|
const formatOptions = props.formatOptions ?? ui.numberInput.formatOptions;
|
|
384
|
-
const formatter =
|
|
147
|
+
const formatter = IntlUtils.getNumberFormatter(locale, formatOptions);
|
|
385
148
|
const minDisplay = getStaticNumberDisplayValue(staticValue.min, formatter);
|
|
386
149
|
const maxDisplay = getStaticNumberDisplayValue(staticValue.max, formatter);
|
|
387
150
|
const hasValue = minDisplay !== null || maxDisplay !== null;
|
|
@@ -134,92 +134,32 @@ function AutocompleteInner(t0) {
|
|
|
134
134
|
function _temp(root) {
|
|
135
135
|
return root.querySelector("input, [data-type='select-trigger'], button, [tabindex]");
|
|
136
136
|
}
|
|
137
|
-
function Autocomplete(
|
|
138
|
-
const $ = c(23);
|
|
139
|
-
let props;
|
|
140
|
-
let renderStaticInput;
|
|
141
|
-
if ($[0] !== t0) {
|
|
142
|
-
({renderStaticInput, ...props} = t0);
|
|
143
|
-
$[0] = t0;
|
|
144
|
-
$[1] = props;
|
|
145
|
-
$[2] = renderStaticInput;
|
|
146
|
-
} else {
|
|
147
|
-
props = $[1];
|
|
148
|
-
renderStaticInput = $[2];
|
|
149
|
-
}
|
|
137
|
+
function Autocomplete({ renderStaticInput, ...props }) {
|
|
150
138
|
if ("formControl" in props && props.formControl) {
|
|
151
|
-
|
|
152
|
-
let innerProps;
|
|
153
|
-
let ref;
|
|
154
|
-
let t1;
|
|
155
|
-
if ($[3] !== props) {
|
|
156
|
-
({ignoreInputValueFiltering: t1, formControl, ref, ...innerProps} = props);
|
|
157
|
-
$[3] = props;
|
|
158
|
-
$[4] = formControl;
|
|
159
|
-
$[5] = innerProps;
|
|
160
|
-
$[6] = ref;
|
|
161
|
-
$[7] = t1;
|
|
162
|
-
} else {
|
|
163
|
-
formControl = $[4];
|
|
164
|
-
innerProps = $[5];
|
|
165
|
-
ref = $[6];
|
|
166
|
-
t1 = $[7];
|
|
167
|
-
}
|
|
168
|
-
const ignoreInputValueFiltering = t1 === void 0 ? true : t1;
|
|
139
|
+
const { ignoreInputValueFiltering = true, formControl, ref, ...innerProps } = props;
|
|
169
140
|
const controlWithOptions = formControl.control;
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
renderStaticInput
|
|
187
|
-
});
|
|
188
|
-
};
|
|
189
|
-
$[8] = controlWithOptions._options?.disabled;
|
|
190
|
-
$[9] = ignoreInputValueFiltering;
|
|
191
|
-
$[10] = innerProps;
|
|
192
|
-
$[11] = props.error;
|
|
193
|
-
$[12] = props.isDisabled;
|
|
194
|
-
$[13] = ref;
|
|
195
|
-
$[14] = renderStaticInput;
|
|
196
|
-
$[15] = t2;
|
|
197
|
-
} else t2 = $[15];
|
|
198
|
-
let t3;
|
|
199
|
-
if ($[16] !== formControl.control || $[17] !== formControl.name || $[18] !== t2) {
|
|
200
|
-
t3 = /* @__PURE__ */ jsx(Controller, {
|
|
201
|
-
control: formControl.control,
|
|
202
|
-
name: formControl.name,
|
|
203
|
-
render: t2
|
|
204
|
-
});
|
|
205
|
-
$[16] = formControl.control;
|
|
206
|
-
$[17] = formControl.name;
|
|
207
|
-
$[18] = t2;
|
|
208
|
-
$[19] = t3;
|
|
209
|
-
} else t3 = $[19];
|
|
210
|
-
return t3;
|
|
211
|
-
}
|
|
212
|
-
let t1;
|
|
213
|
-
if ($[20] !== props || $[21] !== renderStaticInput) {
|
|
214
|
-
t1 = /* @__PURE__ */ jsx(AutocompleteInner, {
|
|
215
|
-
...props,
|
|
216
|
-
renderStaticInput
|
|
141
|
+
return /* @__PURE__ */ jsx(Controller, {
|
|
142
|
+
control: formControl.control,
|
|
143
|
+
name: formControl.name,
|
|
144
|
+
render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(AutocompleteInner, {
|
|
145
|
+
...innerProps,
|
|
146
|
+
ref: mergeRefs(ref, field.ref),
|
|
147
|
+
value: field.value,
|
|
148
|
+
onChange: field.onChange,
|
|
149
|
+
onBlur: field.onBlur,
|
|
150
|
+
isDirty,
|
|
151
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
152
|
+
isFormControlDisabled: !!controlWithOptions._options?.disabled,
|
|
153
|
+
error: props.error ?? error?.message,
|
|
154
|
+
ignoreInputValueFiltering,
|
|
155
|
+
renderStaticInput
|
|
156
|
+
})
|
|
217
157
|
});
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
158
|
+
}
|
|
159
|
+
return /* @__PURE__ */ jsx(AutocompleteInner, {
|
|
160
|
+
...props,
|
|
161
|
+
renderStaticInput
|
|
162
|
+
});
|
|
223
163
|
}
|
|
224
164
|
//#endregion
|
|
225
165
|
export { Autocomplete };
|
|
@@ -8,7 +8,7 @@ import { useState } from "react";
|
|
|
8
8
|
import { mergeRefs } from "@react-aria/utils";
|
|
9
9
|
import { Controller } from "react-hook-form";
|
|
10
10
|
//#region src/components/inputs/Selection/Autocomplete/QueryAutocomplete.tsx
|
|
11
|
-
var
|
|
11
|
+
var LoadedQueryAutocompleteContent = ({ query, queryParams, queryOptions, queryMap, resolveSelectedItemsWithIds, isQueryEnabledInitially = false, leadingContent, ...props }) => {
|
|
12
12
|
"use no memo";
|
|
13
13
|
const ui = UIConfig.useConfig();
|
|
14
14
|
const [search, setSearch] = useState("");
|
|
@@ -20,6 +20,8 @@ var QueryAutocompleteContent = ({ query, queryParams, queryOptions, queryMap, re
|
|
|
20
20
|
mapInitialToSelectItem: props.mapInitialToSelectItem
|
|
21
21
|
});
|
|
22
22
|
const shouldEnableInitialQuery = selectedIdsToResolve.count > 0;
|
|
23
|
+
const isInitialQueryDisabled = props.isInitialQueryDisabled ?? ui.queryAutocomplete?.isInitialQueryDisabled;
|
|
24
|
+
const shouldDisableInitialQuery = !isQueryEnabledInitially && !shouldEnableInitialQuery && (selectedIdsToResolve.isResolvedByInitialSelection || isInitialQueryDisabled);
|
|
23
25
|
const { items, totalItems, isLoading, handleEnableQuery, hasNextPage, fetchNextPage } = useQueryAutocomplete({
|
|
24
26
|
query,
|
|
25
27
|
queryParams,
|
|
@@ -27,7 +29,7 @@ var QueryAutocompleteContent = ({ query, queryParams, queryOptions, queryMap, re
|
|
|
27
29
|
mapItems: (data) => getQueryItems(data, queryMap),
|
|
28
30
|
resolveSelectedItemsWithIds: resolveSelectedItemsWithIds ?? ui.queryAutocomplete?.resolveSelectedItemsWithIds,
|
|
29
31
|
search,
|
|
30
|
-
initialQueryState:
|
|
32
|
+
initialQueryState: shouldDisableInitialQuery,
|
|
31
33
|
selectedIdsToResolve: selectedIdsToResolve.items
|
|
32
34
|
});
|
|
33
35
|
const handleChange = (value_0) => {
|
|
@@ -55,6 +57,58 @@ var QueryAutocompleteContent = ({ query, queryParams, queryOptions, queryMap, re
|
|
|
55
57
|
onLoadMore: fetchNextPage
|
|
56
58
|
});
|
|
57
59
|
};
|
|
60
|
+
var QueryAutocompleteContent = (props) => {
|
|
61
|
+
const $ = c(9);
|
|
62
|
+
const [isQueryMounted, setIsQueryMounted] = useState(false);
|
|
63
|
+
const value = "value" in props ? props.value : void 0;
|
|
64
|
+
if (!getSelectionIdsToResolve({
|
|
65
|
+
initialSelection: props.initialSelection,
|
|
66
|
+
value,
|
|
67
|
+
mapInitialToSelectItem: props.mapInitialToSelectItem
|
|
68
|
+
}).isResolvedByInitialSelection || isQueryMounted) {
|
|
69
|
+
let t0;
|
|
70
|
+
if ($[0] !== isQueryMounted || $[1] !== props) {
|
|
71
|
+
t0 = /* @__PURE__ */ jsx(LoadedQueryAutocompleteContent, {
|
|
72
|
+
...props,
|
|
73
|
+
isQueryEnabledInitially: isQueryMounted
|
|
74
|
+
});
|
|
75
|
+
$[0] = isQueryMounted;
|
|
76
|
+
$[1] = props;
|
|
77
|
+
$[2] = t0;
|
|
78
|
+
} else t0 = $[2];
|
|
79
|
+
return t0;
|
|
80
|
+
}
|
|
81
|
+
let autocompleteProps;
|
|
82
|
+
if ($[3] !== props) {
|
|
83
|
+
const { query: _, queryParams: _queryParams, queryOptions: _queryOptions, queryMap: _queryMap, resolveSelectedItemsWithIds: _resolveSelectedItemsWithIds, isInitialQueryDisabled: _isInitialQueryDisabled, ...t0 } = props;
|
|
84
|
+
autocompleteProps = t0;
|
|
85
|
+
$[3] = props;
|
|
86
|
+
$[4] = autocompleteProps;
|
|
87
|
+
} else autocompleteProps = $[4];
|
|
88
|
+
let t0;
|
|
89
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
90
|
+
t0 = () => setIsQueryMounted(true);
|
|
91
|
+
$[5] = t0;
|
|
92
|
+
} else t0 = $[5];
|
|
93
|
+
const mountQuery = t0;
|
|
94
|
+
let t1;
|
|
95
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
96
|
+
t1 = [];
|
|
97
|
+
$[6] = t1;
|
|
98
|
+
} else t1 = $[6];
|
|
99
|
+
let t2;
|
|
100
|
+
if ($[7] !== autocompleteProps) {
|
|
101
|
+
t2 = /* @__PURE__ */ jsx(Autocomplete, {
|
|
102
|
+
...autocompleteProps,
|
|
103
|
+
items: t1,
|
|
104
|
+
onMouseEnter: mountQuery,
|
|
105
|
+
onFocusCapture: mountQuery
|
|
106
|
+
});
|
|
107
|
+
$[7] = autocompleteProps;
|
|
108
|
+
$[8] = t2;
|
|
109
|
+
} else t2 = $[8];
|
|
110
|
+
return t2;
|
|
111
|
+
};
|
|
58
112
|
var QueryAutocomplete = (props) => {
|
|
59
113
|
const $ = c(16);
|
|
60
114
|
if ("formControl" in props && props.formControl) {
|