@povio/ui 3.3.0 → 3.4.0-rc.2
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/Checkbox/Checkbox.d.ts +1 -2
- package/dist/components/inputs/Checkbox/Checkbox.js +93 -100
- package/dist/components/inputs/Checkbox/CheckboxGroup.d.ts +1 -2
- package/dist/components/inputs/Checkbox/CheckboxGroup.js +109 -113
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +1 -2
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +15 -21
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +1 -2
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +15 -22
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +1 -2
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +19 -24
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +1 -2
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +276 -294
- package/dist/components/inputs/DateTime/shared/DateField.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/DateField.js +2 -2
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +1 -2
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +4 -12
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +1 -2
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +45 -48
- package/dist/components/inputs/File/FileUpload.d.ts +1 -1
- package/dist/components/inputs/File/FileUpload.js +17 -17
- package/dist/components/inputs/File/InputUpload.d.ts +1 -1
- package/dist/components/inputs/File/InputUpload.js +17 -17
- package/dist/components/inputs/File/fileUpload.types.d.ts +1 -1
- package/dist/components/inputs/File/inputUpload.types.d.ts +1 -1
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +1 -1
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +19 -19
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +1 -1
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +18 -18
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.d.ts +1 -1
- package/dist/components/inputs/Input/TextArea/TextArea.d.ts +1 -1
- package/dist/components/inputs/Input/TextArea/TextArea.js +18 -18
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +2 -2
- package/dist/components/inputs/Input/TextInput/TextInput.js +36 -38
- package/dist/components/inputs/Inputs/Form.d.ts +4 -4
- package/dist/components/inputs/Inputs/InputItem.d.ts +22 -22
- package/dist/components/inputs/Inputs/InputItem.js +35 -36
- package/dist/components/inputs/Inputs/Inputs.d.ts +2 -2
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -2
- package/dist/components/inputs/RadioGroup/RadioGroup.js +107 -111
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +1 -1
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +13 -13
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +1 -1
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +19 -19
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +1 -1
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +1 -1
- package/dist/components/inputs/Selection/Select/QuerySelect.js +19 -19
- package/dist/components/inputs/Selection/Select/Select.d.ts +1 -1
- package/dist/components/inputs/Selection/Select/Select.js +19 -19
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +0 -1
- package/dist/components/inputs/Selection/shared/SelectBase.js +34 -37
- package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/select.context.js +4 -8
- package/dist/components/inputs/Selection/shared/select.types.d.ts +1 -1
- package/dist/components/inputs/Skeleton/InputFrame.js +5 -2
- package/dist/components/inputs/Slider/Slider.d.ts +1 -1
- package/dist/components/inputs/Slider/Slider.js +18 -18
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -1
- package/dist/components/inputs/TextEditor/TextEditor.js +18 -18
- package/dist/components/inputs/Toggle/Toggle.d.ts +1 -2
- package/dist/components/inputs/Toggle/Toggle.js +59 -63
- package/dist/components/inputs/shared/InputClear.js +40 -25
- package/dist/components/inputs/shared/form.binding.d.ts +27 -0
- package/dist/components/inputs/shared/form.binding.js +57 -0
- package/dist/components/inputs/shared/form.types.d.ts +9 -8
- package/dist/components/inputs/shared/form.types.js +8 -0
- package/dist/components/segment/Segment.d.ts +1 -1
- package/dist/components/segment/Segment.js +17 -17
- package/dist/components/segment/segment.types.d.ts +1 -1
- package/dist/config/uiConfig.context.d.ts +5 -5
- package/dist/config/uiConfig.context.js +3 -12
- package/dist/helpers/dynamicColumns.d.ts +1 -1
- package/dist/helpers/dynamicInputs.d.ts +7 -7
- package/dist/hooks/useAutosave.d.ts +4 -4
- package/dist/hooks/useAutosave.js +64 -49
- package/dist/hooks/useForm.d.ts +39 -15
- package/dist/hooks/useForm.js +96 -43
- package/dist/hooks/useFormAutosave.d.ts +8 -9
- package/dist/hooks/useFormAutosave.js +23 -9
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/package.json +2 -3
- package/dist/hooks/useAutosave.spec.d.ts +0 -1
|
@@ -15,6 +15,7 @@ interface DateFieldProps extends Omit<DateFieldStateOptions, "locale" | "createC
|
|
|
15
15
|
timeZone?: string;
|
|
16
16
|
segmentGroup?: string;
|
|
17
17
|
shouldAutoFixYear?: boolean;
|
|
18
|
+
preserveNullValue?: boolean;
|
|
18
19
|
}
|
|
19
|
-
export declare const DateField: ({ ref, onClearChange, hidePlaceholder, isDisabled, disableManualEntry, dateGranularity, isTimeOptional, format, timeZone, segmentGroup, shouldAutoFixYear, ...props }: DateFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare const DateField: ({ ref, onClearChange, hidePlaceholder, isDisabled, disableManualEntry, dateGranularity, isTimeOptional, format, timeZone, segmentGroup, shouldAutoFixYear, preserveNullValue, ...props }: DateFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
21
|
export {};
|
|
@@ -9,10 +9,10 @@ import { DateTime } from "luxon";
|
|
|
9
9
|
import { useDateFieldState } from "react-stately";
|
|
10
10
|
//#region src/components/inputs/DateTime/shared/DateField.tsx
|
|
11
11
|
var omitNullValue = ({ value: _value, ...props }) => props;
|
|
12
|
-
var DateField = ({ ref, onClearChange, hidePlaceholder, isDisabled, disableManualEntry, dateGranularity = "day", isTimeOptional = false, format, timeZone, segmentGroup, shouldAutoFixYear = false, ...props }) => {
|
|
12
|
+
var DateField = ({ ref, onClearChange, hidePlaceholder, isDisabled, disableManualEntry, dateGranularity = "day", isTimeOptional = false, format, timeZone, segmentGroup, shouldAutoFixYear = false, preserveNullValue = false, ...props }) => {
|
|
13
13
|
const { locale } = useLocale();
|
|
14
14
|
const previousValueRef = useRef(props.value);
|
|
15
|
-
const dateFieldProps = props.value == null ? omitNullValue(props) : props;
|
|
15
|
+
const dateFieldProps = props.value == null && !preserveNullValue ? omitNullValue(props) : props;
|
|
16
16
|
const state = useDateFieldState({
|
|
17
17
|
...dateFieldProps,
|
|
18
18
|
isDisabled,
|
|
@@ -39,8 +39,7 @@ interface DatePickerInputProps extends InputVariantProps {
|
|
|
39
39
|
timeZone?: string;
|
|
40
40
|
isTimeOptional?: boolean;
|
|
41
41
|
format?: string;
|
|
42
|
-
fireBlurOnChange?: boolean;
|
|
43
42
|
onClear?: () => void;
|
|
44
43
|
}
|
|
45
|
-
export declare const DatePickerInput: ({ ref, as, groupProps, fieldProps, endFieldProps, fieldValue, endFieldValue, isValueControlled, hasValue, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, shouldShrinkInput, isClearable, headerProps, todayIcon, todayIconButtonSize, todayIconButtonComponent, todayIconPlacement, isDirty, isRequired, disableManualEntry, autoFixYear, placeholder, className, onOpenDropdown, dateGranularity, timeZone: timeZoneProp, isTimeOptional, format,
|
|
44
|
+
export declare const DatePickerInput: ({ ref, as, groupProps, fieldProps, endFieldProps, fieldValue, endFieldValue, isValueControlled, hasValue, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, shouldShrinkInput, isClearable, headerProps, todayIcon, todayIconButtonSize, todayIconButtonComponent, todayIconPlacement, isDirty, isRequired, disableManualEntry, autoFixYear, placeholder, className, onOpenDropdown, dateGranularity, timeZone: timeZoneProp, isTimeOptional, format, onClear: onClearProp, ...props }: DatePickerInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
46
45
|
export {};
|
|
@@ -17,7 +17,7 @@ import { Button } from "react-aria-components";
|
|
|
17
17
|
import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
|
|
18
18
|
import { getLocalTimeZone, today } from "@internationalized/date";
|
|
19
19
|
//#region src/components/inputs/DateTime/shared/DatePickerInput.tsx
|
|
20
|
-
var DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, fieldValue, endFieldValue, isValueControlled, hasValue, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, shouldShrinkInput, isClearable, headerProps, todayIcon, todayIconButtonSize = "none", todayIconButtonComponent, todayIconPlacement = "content", isDirty, isRequired, disableManualEntry, autoFixYear = false, placeholder, className, onOpenDropdown, dateGranularity = "day", timeZone: timeZoneProp, isTimeOptional = false, format,
|
|
20
|
+
var DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, fieldValue, endFieldValue, isValueControlled, hasValue, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, shouldShrinkInput, isClearable, headerProps, todayIcon, todayIconButtonSize = "none", todayIconButtonComponent, todayIconPlacement = "content", isDirty, isRequired, disableManualEntry, autoFixYear = false, placeholder, className, onOpenDropdown, dateGranularity = "day", timeZone: timeZoneProp, isTimeOptional = false, format, onClear: onClearProp, ...props }) => {
|
|
21
21
|
const uiConfig = UIConfig.useConfig();
|
|
22
22
|
const timeZone = timeZoneProp ?? uiConfig.dateInput.timeZone;
|
|
23
23
|
let effectiveTimeZone = getLocalTimeZone();
|
|
@@ -51,22 +51,17 @@ var DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, fieldVa
|
|
|
51
51
|
shouldAutoFixYear: autoFixYear
|
|
52
52
|
} : void 0;
|
|
53
53
|
const clearInput = useCallback(() => {
|
|
54
|
-
dateFieldRef.current?.clearField();
|
|
55
|
-
endDateFieldRef.current?.clearField();
|
|
56
54
|
if (onClearProp) onClearProp();
|
|
57
55
|
else {
|
|
56
|
+
dateFieldRef.current?.clearField();
|
|
57
|
+
endDateFieldRef.current?.clearField();
|
|
58
58
|
fieldProps.onChange?.(null);
|
|
59
59
|
endFieldProps?.onChange?.(null);
|
|
60
|
-
if (fireBlurOnChange) {
|
|
61
|
-
fieldProps.onBlur?.(null);
|
|
62
|
-
endFieldProps?.onBlur?.(null);
|
|
63
|
-
}
|
|
64
60
|
}
|
|
65
61
|
setCanClear(false);
|
|
66
62
|
}, [
|
|
67
63
|
endFieldProps,
|
|
68
64
|
fieldProps,
|
|
69
|
-
fireBlurOnChange,
|
|
70
65
|
onClearProp
|
|
71
66
|
]);
|
|
72
67
|
useImperativeHandle(ref, () => ({
|
|
@@ -88,10 +83,6 @@ var DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, fieldVa
|
|
|
88
83
|
fieldProps.onChange?.(today(effectiveTimeZone));
|
|
89
84
|
if (endFieldProps) endFieldProps.onChange?.(today(effectiveTimeZone));
|
|
90
85
|
}
|
|
91
|
-
if (fireBlurOnChange) {
|
|
92
|
-
fieldProps.onBlur?.(null);
|
|
93
|
-
endFieldProps?.onBlur?.(null);
|
|
94
|
-
}
|
|
95
86
|
};
|
|
96
87
|
const hidePlaceholder = as === "floating" && !fieldProps.value && !isFocused;
|
|
97
88
|
const todayIconButton = renderDatePickerTodayIcon(todayIcon, {
|
|
@@ -159,6 +150,7 @@ var DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, fieldVa
|
|
|
159
150
|
disableManualEntry,
|
|
160
151
|
dateGranularity,
|
|
161
152
|
isTimeOptional,
|
|
153
|
+
preserveNullValue: isValueControlled && !endFieldProps,
|
|
162
154
|
format,
|
|
163
155
|
timeZone: effectiveTimeZone,
|
|
164
156
|
segmentGroup: normalizedEndFieldProps ? "start" : void 0
|
|
@@ -19,7 +19,6 @@ interface DatePickerInputProps extends InputVariantProps {
|
|
|
19
19
|
className?: string;
|
|
20
20
|
onPress: () => void;
|
|
21
21
|
onClear?: () => void;
|
|
22
|
-
fireBlurOnChange?: boolean;
|
|
23
22
|
}
|
|
24
|
-
export declare const TimePickerInput: ({ ref, as, fieldProps, state, isDisabled, isDirty, isRequired, isInvalid, disableDropdown, variant, size, isClearable, headerProps, disableManualEntry, placeholder, className, onPress, onClear,
|
|
23
|
+
export declare const TimePickerInput: ({ ref, as, fieldProps, state, isDisabled, isDirty, isRequired, isInvalid, disableDropdown, variant, size, isClearable, headerProps, disableManualEntry, placeholder, className, onPress, onClear, ...props }: DatePickerInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
24
|
export {};
|
|
@@ -16,8 +16,8 @@ import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
|
|
|
16
16
|
import { mergeRefs } from "@react-aria/utils";
|
|
17
17
|
//#region src/components/inputs/DateTime/shared/TimePickerInput.tsx
|
|
18
18
|
var TimePickerInput = (t0) => {
|
|
19
|
-
const $ = c(
|
|
20
|
-
const { ref, as, fieldProps, state, isDisabled, isDirty, isRequired, isInvalid, disableDropdown, variant, size, isClearable, headerProps, disableManualEntry, placeholder, className, onPress, onClear,
|
|
19
|
+
const $ = c(67);
|
|
20
|
+
const { ref, as, fieldProps, state, isDisabled, isDirty, isRequired, isInvalid, disableDropdown, variant, size, isClearable, headerProps, disableManualEntry, placeholder, className, onPress, onClear, ...props } = t0;
|
|
21
21
|
const uiConfig = UIConfig.useConfig();
|
|
22
22
|
const inputBaseCva = UIOverrides.useCva("input.baseCva", inputBaseDefinition);
|
|
23
23
|
const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
|
|
@@ -147,25 +147,22 @@ var TimePickerInput = (t0) => {
|
|
|
147
147
|
$[32] = t22;
|
|
148
148
|
} else t22 = $[32];
|
|
149
149
|
let t23;
|
|
150
|
-
if ($[33] !== canClear || $[34] !==
|
|
150
|
+
if ($[33] !== canClear || $[34] !== isClearable || $[35] !== onClear || $[36] !== state) {
|
|
151
151
|
t23 = isClearable && /* @__PURE__ */ jsx(InputClear, {
|
|
152
152
|
onClear: () => {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
if (fireBlurOnChange) fieldProps.onBlur?.(null);
|
|
153
|
+
if (onClear) onClear();
|
|
154
|
+
else state.setValue(null);
|
|
156
155
|
},
|
|
157
156
|
show: canClear
|
|
158
157
|
});
|
|
159
158
|
$[33] = canClear;
|
|
160
|
-
$[34] =
|
|
161
|
-
$[35] =
|
|
162
|
-
$[36] =
|
|
163
|
-
$[37] =
|
|
164
|
-
|
|
165
|
-
$[39] = t23;
|
|
166
|
-
} else t23 = $[39];
|
|
159
|
+
$[34] = isClearable;
|
|
160
|
+
$[35] = onClear;
|
|
161
|
+
$[36] = state;
|
|
162
|
+
$[37] = t23;
|
|
163
|
+
} else t23 = $[37];
|
|
167
164
|
let t24;
|
|
168
|
-
if ($[
|
|
165
|
+
if ($[38] !== disableDropdown || $[39] !== disableManualEntry || $[40] !== isDisabled || $[41] !== onPress || $[42] !== uiConfig) {
|
|
169
166
|
t24 = (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(InlineIconButton, {
|
|
170
167
|
label: "",
|
|
171
168
|
color: "secondary",
|
|
@@ -175,26 +172,26 @@ var TimePickerInput = (t0) => {
|
|
|
175
172
|
className: "border-0!",
|
|
176
173
|
"data-static-press-action": ""
|
|
177
174
|
});
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
180
|
-
$[
|
|
181
|
-
$[
|
|
182
|
-
$[
|
|
183
|
-
$[
|
|
184
|
-
} else t24 = $[
|
|
175
|
+
$[38] = disableDropdown;
|
|
176
|
+
$[39] = disableManualEntry;
|
|
177
|
+
$[40] = isDisabled;
|
|
178
|
+
$[41] = onPress;
|
|
179
|
+
$[42] = uiConfig;
|
|
180
|
+
$[43] = t24;
|
|
181
|
+
} else t24 = $[43];
|
|
185
182
|
let t25;
|
|
186
|
-
if ($[
|
|
183
|
+
if ($[44] !== t22 || $[45] !== t23 || $[46] !== t24) {
|
|
187
184
|
t25 = /* @__PURE__ */ jsxs("div", {
|
|
188
185
|
className: t22,
|
|
189
186
|
children: [t23, t24]
|
|
190
187
|
});
|
|
191
|
-
$[
|
|
192
|
-
$[
|
|
193
|
-
$[
|
|
194
|
-
$[
|
|
195
|
-
} else t25 = $[
|
|
188
|
+
$[44] = t22;
|
|
189
|
+
$[45] = t23;
|
|
190
|
+
$[46] = t24;
|
|
191
|
+
$[47] = t25;
|
|
192
|
+
} else t25 = $[47];
|
|
196
193
|
let t26;
|
|
197
|
-
if ($[
|
|
194
|
+
if ($[48] !== fieldProps || $[49] !== focusWithinProps || $[50] !== hoverProps || $[51] !== t10 || $[52] !== t11 || $[53] !== t12 || $[54] !== t13 || $[55] !== t14 || $[56] !== t15 || $[57] !== t16 || $[58] !== t21 || $[59] !== t25 || $[60] !== t4 || $[61] !== t5 || $[62] !== t6 || $[63] !== t7 || $[64] !== t8 || $[65] !== t9) {
|
|
198
195
|
t26 = /* @__PURE__ */ jsxs("div", {
|
|
199
196
|
ref: t4,
|
|
200
197
|
className: t5,
|
|
@@ -216,26 +213,26 @@ var TimePickerInput = (t0) => {
|
|
|
216
213
|
...hoverProps,
|
|
217
214
|
children: [t21, t25]
|
|
218
215
|
});
|
|
219
|
-
$[
|
|
220
|
-
$[
|
|
221
|
-
$[
|
|
222
|
-
$[
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
225
|
-
$[
|
|
226
|
-
$[
|
|
227
|
-
$[
|
|
228
|
-
$[
|
|
229
|
-
$[
|
|
230
|
-
$[
|
|
231
|
-
$[
|
|
232
|
-
$[
|
|
233
|
-
$[
|
|
234
|
-
$[
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
237
|
-
$[
|
|
238
|
-
} else t26 = $[
|
|
216
|
+
$[48] = fieldProps;
|
|
217
|
+
$[49] = focusWithinProps;
|
|
218
|
+
$[50] = hoverProps;
|
|
219
|
+
$[51] = t10;
|
|
220
|
+
$[52] = t11;
|
|
221
|
+
$[53] = t12;
|
|
222
|
+
$[54] = t13;
|
|
223
|
+
$[55] = t14;
|
|
224
|
+
$[56] = t15;
|
|
225
|
+
$[57] = t16;
|
|
226
|
+
$[58] = t21;
|
|
227
|
+
$[59] = t25;
|
|
228
|
+
$[60] = t4;
|
|
229
|
+
$[61] = t5;
|
|
230
|
+
$[62] = t6;
|
|
231
|
+
$[63] = t7;
|
|
232
|
+
$[64] = t8;
|
|
233
|
+
$[65] = t9;
|
|
234
|
+
$[66] = t26;
|
|
235
|
+
} else t26 = $[66];
|
|
239
236
|
return t26;
|
|
240
237
|
};
|
|
241
238
|
function _temp(segment) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FieldValues } from '
|
|
1
|
+
import { FieldValues } from '../shared/form.binding';
|
|
2
2
|
import { FileUploadProps } from './fileUpload.types';
|
|
3
3
|
export type { DefaultFile, FileUploadBaseProps, FileUploadButtonProps, FileUploadError, FileUploadProps, FileUploadRequest, FileUploadResponse, FileUploadState, } from './fileUpload.types';
|
|
4
4
|
export declare const FileUpload: <TFieldValues extends FieldValues = FieldValues>(props: FileUploadProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
2
2
|
import { UIConfig } from "../../../config/uiConfig.context.js";
|
|
3
3
|
import "../../../config/i18n.js";
|
|
4
|
+
import { FieldController } from "../shared/form.binding.js";
|
|
4
5
|
import { FormField } from "../FormField/FormField.js";
|
|
5
6
|
import { FileUtils } from "../../../utils/file.utils.js";
|
|
6
7
|
import { FileCardList } from "./shared/FileCardList.js";
|
|
@@ -14,7 +15,6 @@ import { useCallback, useState } from "react";
|
|
|
14
15
|
import { DropZone } from "react-aria-components";
|
|
15
16
|
import { mergeRefs, useLabels } from "@react-aria/utils";
|
|
16
17
|
import { useTranslation } from "react-i18next";
|
|
17
|
-
import { Controller } from "react-hook-form";
|
|
18
18
|
//#region src/components/inputs/File/FileUpload.tsx
|
|
19
19
|
var FileUploadBase = (props) => {
|
|
20
20
|
const { t } = useTranslation("ui");
|
|
@@ -192,32 +192,32 @@ var FileUploadBase = (props) => {
|
|
|
192
192
|
};
|
|
193
193
|
var FileUpload = (props) => {
|
|
194
194
|
const $ = c(15);
|
|
195
|
-
if ("
|
|
196
|
-
let
|
|
195
|
+
if ("field" in props && props.field) {
|
|
196
|
+
let field;
|
|
197
197
|
let innerProps;
|
|
198
198
|
let ref;
|
|
199
199
|
if ($[0] !== props) {
|
|
200
|
-
({
|
|
200
|
+
({field, ref, ...innerProps} = props);
|
|
201
201
|
$[0] = props;
|
|
202
|
-
$[1] =
|
|
202
|
+
$[1] = field;
|
|
203
203
|
$[2] = innerProps;
|
|
204
204
|
$[3] = ref;
|
|
205
205
|
} else {
|
|
206
|
-
|
|
206
|
+
field = $[1];
|
|
207
207
|
innerProps = $[2];
|
|
208
208
|
ref = $[3];
|
|
209
209
|
}
|
|
210
210
|
let t0;
|
|
211
211
|
if ($[4] !== innerProps || $[5] !== props.error || $[6] !== props.isDisabled || $[7] !== ref) {
|
|
212
212
|
t0 = (t1) => {
|
|
213
|
-
const { field, fieldState: t2 } = t1;
|
|
213
|
+
const { field: field_0, fieldState: t2 } = t1;
|
|
214
214
|
const { error } = t2;
|
|
215
215
|
return /* @__PURE__ */ jsx(FileUploadBase, {
|
|
216
216
|
...innerProps,
|
|
217
|
-
ref: mergeRefs(ref,
|
|
218
|
-
value:
|
|
219
|
-
onChange:
|
|
220
|
-
isDisabled:
|
|
217
|
+
ref: mergeRefs(ref, field_0.ref),
|
|
218
|
+
value: field_0.value,
|
|
219
|
+
onChange: field_0.onChange,
|
|
220
|
+
isDisabled: field_0.disabled || props.isDisabled,
|
|
221
221
|
error: props.error ?? error?.message
|
|
222
222
|
});
|
|
223
223
|
};
|
|
@@ -228,14 +228,14 @@ var FileUpload = (props) => {
|
|
|
228
228
|
$[8] = t0;
|
|
229
229
|
} else t0 = $[8];
|
|
230
230
|
let t1;
|
|
231
|
-
if ($[9] !==
|
|
232
|
-
t1 = /* @__PURE__ */ jsx(
|
|
233
|
-
control:
|
|
234
|
-
name:
|
|
231
|
+
if ($[9] !== field.form || $[10] !== field.name || $[11] !== t0) {
|
|
232
|
+
t1 = /* @__PURE__ */ jsx(FieldController, {
|
|
233
|
+
control: field.form,
|
|
234
|
+
name: field.name,
|
|
235
235
|
render: t0
|
|
236
236
|
});
|
|
237
|
-
$[9] =
|
|
238
|
-
$[10] =
|
|
237
|
+
$[9] = field.form;
|
|
238
|
+
$[10] = field.name;
|
|
239
239
|
$[11] = t0;
|
|
240
240
|
$[12] = t1;
|
|
241
241
|
} else t1 = $[12];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FieldValues } from '
|
|
1
|
+
import { FieldValues } from '../shared/form.binding';
|
|
2
2
|
import { InputUploadProps } from './inputUpload.types';
|
|
3
3
|
export type { InputUploadBaseProps, InputUploadProps } from './inputUpload.types';
|
|
4
4
|
export declare const InputUpload: <TFieldValues extends FieldValues = FieldValues>(props: InputUploadProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { UIConfig } from "../../../config/uiConfig.context.js";
|
|
2
|
+
import { FieldController } from "../shared/form.binding.js";
|
|
2
3
|
import { FormField } from "../FormField/FormField.js";
|
|
3
4
|
import { FileUtils } from "../../../utils/file.utils.js";
|
|
4
5
|
import { InputUploadContent } from "./shared/InputUploadContent.js";
|
|
@@ -8,7 +9,6 @@ import { jsx } from "react/jsx-runtime";
|
|
|
8
9
|
import { clsx } from "clsx";
|
|
9
10
|
import { useState } from "react";
|
|
10
11
|
import { mergeRefs, useLabels } from "@react-aria/utils";
|
|
11
|
-
import { Controller } from "react-hook-form";
|
|
12
12
|
//#region src/components/inputs/File/InputUpload.tsx
|
|
13
13
|
var InputUploadBase = ({ ref: _ref, label, tooltipText, variant, helperText, isRequired, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, className, onChange, onInvalidFileType, value, defaultValue, allowsMultiple = false, hideLabel, acceptedFileTypes, size, ...rest }) => {
|
|
14
14
|
const ui = UIConfig.useConfig();
|
|
@@ -96,32 +96,32 @@ var InputUploadBase = ({ ref: _ref, label, tooltipText, variant, helperText, isR
|
|
|
96
96
|
};
|
|
97
97
|
var InputUpload = (props) => {
|
|
98
98
|
const $ = c(15);
|
|
99
|
-
if ("
|
|
100
|
-
let
|
|
99
|
+
if ("field" in props && props.field) {
|
|
100
|
+
let field;
|
|
101
101
|
let innerProps;
|
|
102
102
|
let ref;
|
|
103
103
|
if ($[0] !== props) {
|
|
104
|
-
({
|
|
104
|
+
({field, ref, ...innerProps} = props);
|
|
105
105
|
$[0] = props;
|
|
106
|
-
$[1] =
|
|
106
|
+
$[1] = field;
|
|
107
107
|
$[2] = innerProps;
|
|
108
108
|
$[3] = ref;
|
|
109
109
|
} else {
|
|
110
|
-
|
|
110
|
+
field = $[1];
|
|
111
111
|
innerProps = $[2];
|
|
112
112
|
ref = $[3];
|
|
113
113
|
}
|
|
114
114
|
let t0;
|
|
115
115
|
if ($[4] !== innerProps || $[5] !== props.error || $[6] !== props.isDisabled || $[7] !== ref) {
|
|
116
116
|
t0 = (t1) => {
|
|
117
|
-
const { field, fieldState: t2 } = t1;
|
|
117
|
+
const { field: field_0, fieldState: t2 } = t1;
|
|
118
118
|
const { error } = t2;
|
|
119
119
|
return /* @__PURE__ */ jsx(InputUploadBase, {
|
|
120
120
|
...innerProps,
|
|
121
|
-
ref: mergeRefs(ref,
|
|
122
|
-
value:
|
|
123
|
-
onChange:
|
|
124
|
-
isDisabled:
|
|
121
|
+
ref: mergeRefs(ref, field_0.ref),
|
|
122
|
+
value: field_0.value,
|
|
123
|
+
onChange: field_0.onChange,
|
|
124
|
+
isDisabled: field_0.disabled || props.isDisabled,
|
|
125
125
|
error: props.error ?? error?.message
|
|
126
126
|
});
|
|
127
127
|
};
|
|
@@ -132,14 +132,14 @@ var InputUpload = (props) => {
|
|
|
132
132
|
$[8] = t0;
|
|
133
133
|
} else t0 = $[8];
|
|
134
134
|
let t1;
|
|
135
|
-
if ($[9] !==
|
|
136
|
-
t1 = /* @__PURE__ */ jsx(
|
|
137
|
-
control:
|
|
138
|
-
name:
|
|
135
|
+
if ($[9] !== field.form || $[10] !== field.name || $[11] !== t0) {
|
|
136
|
+
t1 = /* @__PURE__ */ jsx(FieldController, {
|
|
137
|
+
control: field.form,
|
|
138
|
+
name: field.name,
|
|
139
139
|
render: t0
|
|
140
140
|
});
|
|
141
|
-
$[9] =
|
|
142
|
-
$[10] =
|
|
141
|
+
$[9] = field.form;
|
|
142
|
+
$[10] = field.name;
|
|
143
143
|
$[11] = t0;
|
|
144
144
|
$[12] = t1;
|
|
145
145
|
} else t1 = $[12];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode, Ref } from 'react';
|
|
2
2
|
import { DropZoneProps, FileTriggerProps } from 'react-aria-components';
|
|
3
|
-
import { FieldValues } from '
|
|
3
|
+
import { FieldValues } from '../shared/form.binding';
|
|
4
4
|
import { ButtonProps } from '../../buttons/Button/Button';
|
|
5
5
|
import { FormFieldProps } from '../FormField/FormField';
|
|
6
6
|
import { ControlProps } from '../shared/form.types';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'react';
|
|
2
2
|
import { DropZoneProps, FileTriggerProps } from 'react-aria-components';
|
|
3
|
-
import { FieldValues } from '
|
|
3
|
+
import { FieldValues } from '../shared/form.binding';
|
|
4
4
|
import { FormFieldProps } from '../FormField/FormField';
|
|
5
5
|
import { ControlProps } from '../shared/form.types';
|
|
6
6
|
import { InputUploadButtonProps } from './shared/inputUploadButton.cva';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FocusEvent, Ref } from 'react';
|
|
2
2
|
import { NumberFieldProps as AriaNumberFieldProps } from 'react-aria-components';
|
|
3
|
-
import { FieldValues } from '
|
|
3
|
+
import { FieldValues } from '../../shared/form.binding';
|
|
4
4
|
import { FormFieldProps } from '../../FormField/FormField';
|
|
5
5
|
import { InputContentProps } from '../shared/InputContent';
|
|
6
6
|
import { ControlProps } from '../../shared/form.types';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
2
2
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
3
|
+
import { FieldController } from "../../shared/form.binding.js";
|
|
3
4
|
import { FormField } from "../../FormField/FormField.js";
|
|
4
5
|
import { inputBaseDefinition } from "../../shared/input.cva.js";
|
|
5
6
|
import { IntlUtils } from "../../../../utils/intl.utils.js";
|
|
@@ -15,7 +16,6 @@ import { useEffect, useRef, useState } from "react";
|
|
|
15
16
|
import { Input, useLocale } from "react-aria-components";
|
|
16
17
|
import { useFocusVisible, useNumberField } from "react-aria";
|
|
17
18
|
import { mergeRefs } from "@react-aria/utils";
|
|
18
|
-
import { Controller } from "react-hook-form";
|
|
19
19
|
import { useNumberFieldState } from "react-stately";
|
|
20
20
|
//#region src/components/inputs/Input/NumberInput/NumberInput.tsx
|
|
21
21
|
var NumberInputBase = (props) => {
|
|
@@ -420,35 +420,35 @@ var NumberInput = (t0) => {
|
|
|
420
420
|
props = $[1];
|
|
421
421
|
renderStaticInput = $[2];
|
|
422
422
|
}
|
|
423
|
-
if ("
|
|
424
|
-
let
|
|
423
|
+
if ("field" in props && props.field) {
|
|
424
|
+
let field;
|
|
425
425
|
let innerProps;
|
|
426
426
|
let ref;
|
|
427
427
|
if ($[3] !== props) {
|
|
428
|
-
({
|
|
428
|
+
({field, ref, ...innerProps} = props);
|
|
429
429
|
$[3] = props;
|
|
430
|
-
$[4] =
|
|
430
|
+
$[4] = field;
|
|
431
431
|
$[5] = innerProps;
|
|
432
432
|
$[6] = ref;
|
|
433
433
|
} else {
|
|
434
|
-
|
|
434
|
+
field = $[4];
|
|
435
435
|
innerProps = $[5];
|
|
436
436
|
ref = $[6];
|
|
437
437
|
}
|
|
438
|
-
const controlWithOptions =
|
|
438
|
+
const controlWithOptions = field.form;
|
|
439
439
|
let t1;
|
|
440
440
|
if ($[7] !== controlWithOptions._options?.disabled || $[8] !== innerProps || $[9] !== props.error || $[10] !== props.isDisabled || $[11] !== ref || $[12] !== renderStaticInput) {
|
|
441
441
|
t1 = (t2) => {
|
|
442
|
-
const { field, fieldState: t3 } = t2;
|
|
442
|
+
const { field: field_0, fieldState: t3 } = t2;
|
|
443
443
|
const { error, isDirty } = t3;
|
|
444
444
|
return /* @__PURE__ */ jsx(NumberInputInner, {
|
|
445
445
|
...innerProps,
|
|
446
|
-
ref: mergeRefs(ref,
|
|
447
|
-
value:
|
|
448
|
-
onChange:
|
|
449
|
-
onBlur:
|
|
446
|
+
ref: mergeRefs(ref, field_0.ref),
|
|
447
|
+
value: field_0.value,
|
|
448
|
+
onChange: field_0.onChange,
|
|
449
|
+
onBlur: field_0.onBlur,
|
|
450
450
|
isDirty,
|
|
451
|
-
isDisabled:
|
|
451
|
+
isDisabled: field_0.disabled || props.isDisabled,
|
|
452
452
|
isFormControlDisabled: !!controlWithOptions._options?.disabled,
|
|
453
453
|
error: props.error ?? error?.message,
|
|
454
454
|
renderStaticInput
|
|
@@ -463,14 +463,14 @@ var NumberInput = (t0) => {
|
|
|
463
463
|
$[13] = t1;
|
|
464
464
|
} else t1 = $[13];
|
|
465
465
|
let t2;
|
|
466
|
-
if ($[14] !==
|
|
467
|
-
t2 = /* @__PURE__ */ jsx(
|
|
468
|
-
control:
|
|
469
|
-
name:
|
|
466
|
+
if ($[14] !== field.form || $[15] !== field.name || $[16] !== t1) {
|
|
467
|
+
t2 = /* @__PURE__ */ jsx(FieldController, {
|
|
468
|
+
control: field.form,
|
|
469
|
+
name: field.name,
|
|
470
470
|
render: t1
|
|
471
471
|
});
|
|
472
|
-
$[14] =
|
|
473
|
-
$[15] =
|
|
472
|
+
$[14] = field.form;
|
|
473
|
+
$[15] = field.name;
|
|
474
474
|
$[16] = t1;
|
|
475
475
|
$[17] = t2;
|
|
476
476
|
} else t2 = $[17];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FocusEvent, Ref } from 'react';
|
|
2
2
|
import { NumberFieldProps as AriaNumberFieldProps } from 'react-aria-components';
|
|
3
|
-
import { FieldValues } from '
|
|
3
|
+
import { FieldValues } from '../../shared/form.binding';
|
|
4
4
|
import { FormFieldProps } from '../../FormField/FormField';
|
|
5
5
|
import { NumberRangeValue } from './NumberRangeField';
|
|
6
6
|
import { ControlProps } from '../../shared/form.types';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
2
2
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
3
|
+
import { FieldController } from "../../shared/form.binding.js";
|
|
3
4
|
import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
|
|
4
5
|
import { inputBaseDefinition, inputSizeDefinition } from "../../shared/input.cva.js";
|
|
5
6
|
import { IntlUtils } from "../../../../utils/intl.utils.js";
|
|
@@ -14,7 +15,6 @@ import { clsx } from "clsx";
|
|
|
14
15
|
import { useRef, useState } from "react";
|
|
15
16
|
import { useLocale } from "react-aria-components";
|
|
16
17
|
import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
|
|
17
|
-
import { Controller } from "react-hook-form";
|
|
18
18
|
//#region src/components/inputs/Input/NumberRangeInput/NumberRangeInput.tsx
|
|
19
19
|
var EMPTY_RANGE = {
|
|
20
20
|
min: null,
|
|
@@ -269,30 +269,30 @@ var NumberRangeInput = (t0) => {
|
|
|
269
269
|
props = $[1];
|
|
270
270
|
renderStaticInput = $[2];
|
|
271
271
|
}
|
|
272
|
-
if ("
|
|
273
|
-
let
|
|
272
|
+
if ("field" in props && props.field) {
|
|
273
|
+
let field;
|
|
274
274
|
let innerProps;
|
|
275
275
|
if ($[3] !== props) {
|
|
276
|
-
({
|
|
276
|
+
({field, ...innerProps} = props);
|
|
277
277
|
$[3] = props;
|
|
278
|
-
$[4] =
|
|
278
|
+
$[4] = field;
|
|
279
279
|
$[5] = innerProps;
|
|
280
280
|
} else {
|
|
281
|
-
|
|
281
|
+
field = $[4];
|
|
282
282
|
innerProps = $[5];
|
|
283
283
|
}
|
|
284
|
-
const controlWithOptions =
|
|
284
|
+
const controlWithOptions = field.form;
|
|
285
285
|
let t1;
|
|
286
286
|
if ($[6] !== controlWithOptions._options?.disabled || $[7] !== innerProps || $[8] !== props.error || $[9] !== props.isDisabled || $[10] !== renderStaticInput) {
|
|
287
287
|
t1 = (t2) => {
|
|
288
|
-
const { field, fieldState: t3 } = t2;
|
|
288
|
+
const { field: field_0, fieldState: t3 } = t2;
|
|
289
289
|
const { error } = t3;
|
|
290
290
|
return /* @__PURE__ */ jsx(NumberRangeInputInner, {
|
|
291
291
|
...innerProps,
|
|
292
|
-
value:
|
|
293
|
-
onChange:
|
|
294
|
-
onBlur:
|
|
295
|
-
isDisabled:
|
|
292
|
+
value: field_0.value ?? EMPTY_RANGE,
|
|
293
|
+
onChange: field_0.onChange,
|
|
294
|
+
onBlur: field_0.onBlur,
|
|
295
|
+
isDisabled: field_0.disabled || !!controlWithOptions._options?.disabled || props.isDisabled,
|
|
296
296
|
isFormControlDisabled: !!controlWithOptions._options?.disabled,
|
|
297
297
|
error: props.error ?? error?.message,
|
|
298
298
|
renderStaticInput
|
|
@@ -306,14 +306,14 @@ var NumberRangeInput = (t0) => {
|
|
|
306
306
|
$[11] = t1;
|
|
307
307
|
} else t1 = $[11];
|
|
308
308
|
let t2;
|
|
309
|
-
if ($[12] !==
|
|
310
|
-
t2 = /* @__PURE__ */ jsx(
|
|
311
|
-
control:
|
|
312
|
-
name:
|
|
309
|
+
if ($[12] !== field.form || $[13] !== field.name || $[14] !== t1) {
|
|
310
|
+
t2 = /* @__PURE__ */ jsx(FieldController, {
|
|
311
|
+
control: field.form,
|
|
312
|
+
name: field.name,
|
|
313
313
|
render: t1
|
|
314
314
|
});
|
|
315
|
-
$[12] =
|
|
316
|
-
$[13] =
|
|
315
|
+
$[12] = field.form;
|
|
316
|
+
$[13] = field.name;
|
|
317
317
|
$[14] = t1;
|
|
318
318
|
$[15] = t2;
|
|
319
319
|
} else t2 = $[15];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FieldValues } from '
|
|
1
|
+
import { FieldValues } from '../../shared/form.binding';
|
|
2
2
|
import { TextInputProps } from '../TextInput/TextInput';
|
|
3
3
|
import { ControlProps } from '../../shared/form.types';
|
|
4
4
|
export interface PasswordInputProps extends Omit<TextInputProps, "type" | "action" | "trailingIcon" | "unit"> {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Ref } from 'react';
|
|
2
2
|
import { AriaTextFieldProps } from 'react-aria';
|
|
3
3
|
import { TextAreaProps as AriaTextAreaProps } from 'react-aria-components';
|
|
4
|
-
import { FieldValues } from '
|
|
4
|
+
import { FieldValues } from '../../shared/form.binding';
|
|
5
5
|
import { FormFieldProps } from '../../FormField/FormField';
|
|
6
6
|
import { ControlProps } from '../../shared/form.types';
|
|
7
7
|
import { InputVariantProps } from '../../shared/input.cva';
|