@povio/ui 3.4.0-rc.42 → 3.4.0-rc.44
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/{Calendar-BaGjTLHS.js → Calendar-H9E8lACh.js} +1 -1
- package/dist/{Checkbox-BPbSqonT.js → Checkbox-Bg_KpTR1.js} +5 -2
- package/dist/{DatePicker-BJ2wsMwp.js → DatePicker-DyAL-7Ze.js} +13 -6
- package/dist/{DatePicker-aWuhaUgu.d.ts → DatePicker-KFZRDJfS.d.ts} +2 -1
- package/dist/{DatePickerInput-Bo0qxUEY.js → DatePickerInput-DcPW7kKS.js} +2 -1
- package/dist/{DateRangePicker-DQ6OxWBk.js → DateRangePicker-CNkQIrwx.js} +13 -6
- package/dist/{DateRangePicker-DpKWDDlC.d.ts → DateRangePicker-DcZ1l894.d.ts} +2 -1
- package/dist/{DateTimePicker-5u_9ch2c.js → DateTimePicker-C6RmNdPP.js} +13 -6
- package/dist/{DateTimePicker-BoTa_gTC.d.ts → DateTimePicker-DWlstLhf.d.ts} +2 -1
- package/dist/{FileUpload-DJFp2ZI8.js → FileUpload-D_kEAfO0.js} +33 -10
- package/dist/{Form-BjwyXqkN.d.ts → Form-Cnm0yRXZ.d.ts} +1 -1
- package/dist/{InputItem-DxWZR7tz.js → InputItem-BgpoT7wO.js} +11 -11
- package/dist/{InputUpload-DNMrD6CB.js → InputUpload-BJpTDs3D.js} +5 -2
- package/dist/{Inputs-CwkP8B9O.d.ts → Inputs-Cm1abCeb.d.ts} +1 -1
- package/dist/{Inputs-D845qezj.js → Inputs-DtjIuT7_.js} +1 -1
- package/dist/{NumberRangeInput-1vdHmE8h.d.ts → NumberRangeInput-1ic7kLIS.d.ts} +2 -1
- package/dist/{NumberRangeInput-vYLzGc5z.js → NumberRangeInput-CW7X27p1.js} +22 -6
- package/dist/{RadioGroup-SJsugALM.js → RadioGroup-DSsr_W6H.js} +5 -2
- package/dist/{Segment-DJ4LRllP.js → Segment-BnyGK1kI.js} +1 -1
- package/dist/{Select-BLFZVKdH.js → Select-DPG_tS7y.js} +5 -2
- package/dist/{Slider-DHFimpYt.js → Slider-DpjeijYH.js} +5 -1
- package/dist/{TextArea-C1o9LQmC.js → TextArea-Bm3QhIRz.js} +1 -1
- package/dist/{TextEditor-XAMgh14w.js → TextEditor-BlVZ7XEZ.js} +2 -2
- package/dist/{TimePicker-Bdz_yJ0I.d.ts → TimePicker-BcAaXiku.d.ts} +2 -1
- package/dist/{TimePicker-BnBipyWE.js → TimePicker-Bf82rbFG.js} +9 -3
- package/dist/{Toggle-D1M-fop2.js → Toggle-Cf8jQ991.js} +5 -2
- package/dist/components/autocomplete.js +5 -2
- package/dist/components/checkbox-group.js +6 -3
- package/dist/components/checkbox.js +1 -1
- package/dist/components/date-picker.d.ts +1 -1
- package/dist/components/date-picker.js +1 -1
- package/dist/components/date-range-picker.d.ts +1 -1
- package/dist/components/date-range-picker.js +1 -1
- package/dist/components/date-time-picker.d.ts +1 -1
- package/dist/components/date-time-picker.js +1 -1
- package/dist/components/file-upload-container.js +1 -1
- package/dist/components/file-upload.js +1 -1
- package/dist/components/input-upload.js +1 -1
- package/dist/components/number-input.js +1 -1
- package/dist/components/number-range-input.d.ts +1 -1
- package/dist/components/number-range-input.js +1 -1
- package/dist/components/query-autocomplete.js +5 -2
- package/dist/components/query-select.js +6 -3
- package/dist/components/radio-group.js +1 -1
- package/dist/components/segment.js +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/slider.js +1 -1
- package/dist/components/text-area.js +1 -1
- package/dist/components/text-input.js +1 -1
- package/dist/components/time-picker.d.ts +1 -1
- package/dist/components/time-picker.js +1 -1
- package/dist/components/toggle.js +1 -1
- package/dist/config/ui-config.d.ts +1 -1
- package/dist/{date-picker-g50NliUB.d.ts → date-picker-D2W1Bor7.d.ts} +1 -1
- package/dist/{date-range-picker-4EXSwE8B.d.ts → date-range-picker-Cm0OPO-n.d.ts} +1 -1
- package/dist/{date-time-picker-Bjag5nQ1.d.ts → date-time-picker-QcvD8deo.d.ts} +1 -1
- package/dist/{dynamicInputs-p4ATehFR.d.ts → dynamicInputs-DhCSXGpC.d.ts} +10 -10
- package/dist/{form.binding-TF1u0Y89.js → form.binding-DAAmi5nC.js} +6 -2
- package/dist/index.d.ts +11 -11
- package/dist/index.js +9 -9
- package/dist/{number-range-input-43A63EzS.d.ts → number-range-input-BkHzkO1m.d.ts} +1 -1
- package/dist/rhf/checkbox.js +1 -1
- package/dist/rhf/date-picker.d.ts +2 -2
- package/dist/rhf/date-picker.js +1 -1
- package/dist/rhf/date-range-picker.d.ts +2 -2
- package/dist/rhf/date-range-picker.js +1 -1
- package/dist/rhf/date-time-picker.d.ts +2 -2
- package/dist/rhf/date-time-picker.js +1 -1
- package/dist/rhf/file-upload.js +1 -1
- package/dist/rhf/input-upload.js +1 -1
- package/dist/rhf/inputs.d.ts +1 -1
- package/dist/rhf/number-range-input.d.ts +2 -2
- package/dist/rhf/number-range-input.js +1 -1
- package/dist/rhf/radio-group.js +1 -1
- package/dist/rhf/segment.js +1 -1
- package/dist/rhf/select.js +1 -1
- package/dist/rhf/slider.js +1 -1
- package/dist/rhf/text-area.js +1 -1
- package/dist/rhf/text-editor.js +1 -1
- package/dist/rhf/time-picker.d.ts +2 -2
- package/dist/rhf/time-picker.js +1 -1
- package/dist/rhf/toggle.js +1 -1
- package/dist/rhf.d.ts +11 -11
- package/dist/rhf.js +9 -9
- package/dist/tanstack/checkbox.js +1 -1
- package/dist/tanstack/date-picker.d.ts +1 -1
- package/dist/tanstack/date-picker.js +1 -1
- package/dist/tanstack/date-range-picker.d.ts +1 -1
- package/dist/tanstack/date-range-picker.js +1 -1
- package/dist/tanstack/date-time-picker.d.ts +1 -1
- package/dist/tanstack/date-time-picker.js +1 -1
- package/dist/tanstack/file-upload.js +1 -1
- package/dist/tanstack/form.d.ts +1 -1
- package/dist/tanstack/form.js +2 -2
- package/dist/tanstack/input-upload.js +1 -1
- package/dist/tanstack/inputs.d.ts +2 -2
- package/dist/tanstack/inputs.js +1 -1
- package/dist/tanstack/number-range-input.d.ts +1 -1
- package/dist/tanstack/number-range-input.js +1 -1
- package/dist/tanstack/radio-group.js +1 -1
- package/dist/tanstack/segment.js +1 -1
- package/dist/tanstack/select.js +1 -1
- package/dist/tanstack/slider.js +1 -1
- package/dist/tanstack/table.js +1 -1
- package/dist/tanstack/text-area.js +1 -1
- package/dist/tanstack/text-editor.js +1 -1
- package/dist/tanstack/time-picker.d.ts +1 -1
- package/dist/tanstack/time-picker.js +1 -1
- package/dist/tanstack/toggle.js +1 -1
- package/dist/tanstack.d.ts +8 -8
- package/dist/tanstack.js +20 -20
- package/dist/text-editor.js +1 -1
- package/dist/{time-picker-BYfudvVK.d.ts → time-picker-CZLL-OEe.d.ts} +1 -1
- package/dist/{useFormAutosave-C16DFqsF.js → useFormAutosave-CaF9uarl.js} +2 -2
- package/dist/{useTableColumnConfig-5R7xlIMm.js → useTableColumnConfig-D2H_RUmX.js} +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { t as ChevronDown } from "./chevron-down-Ciz9yP9R.js";
|
|
|
2
2
|
import { t as ChevronLeft } from "./chevron-left-VO8YZrXZ.js";
|
|
3
3
|
import { t as ChevronRight } from "./chevron-right-C_M98bh3.js";
|
|
4
4
|
import { t as ChevronUp } from "./chevron-up-CHRnDSA3.js";
|
|
5
|
-
import { i as CalendarGrid } from "./DatePickerInput-
|
|
5
|
+
import { i as CalendarGrid } from "./DatePickerInput-DcPW7kKS.js";
|
|
6
6
|
import { t as clsx } from "./clsx-CnD0nOiA.js";
|
|
7
7
|
import { d as $3ef42575df84b30b$export$9d1611c77c2fe928, h as $bdb11010cef70236$export$f680877a34711e37 } from "./utils-D-KKbY-n.js";
|
|
8
8
|
import { t as $d4ee10de306f2510$export$4282f70798064fe0 } from "./DOMFunctions-BrQjsnDh.js";
|
|
@@ -15,7 +15,7 @@ import { t as $01b77f81d0f07f68$export$75b6ee27786ba447 } from "./Label-BVczUvgv
|
|
|
15
15
|
import { t as $514c0188e459b4c0$export$9afb8bc826b033ea } from "./Text-BTtw_Syz.js";
|
|
16
16
|
import { n as $ee014567cb39d3f0$export$ff05c3ac10437e03, t as $d3e0e05bdfcf66bd$export$c24727297075ec6a } from "./Form-CKUcoaMX.js";
|
|
17
17
|
import { t as UIOverrides } from "./uiOverrides.context-Bfm2n-n8.js";
|
|
18
|
-
import { t as FieldController } from "./form.binding-
|
|
18
|
+
import { t as FieldController } from "./form.binding-DAAmi5nC.js";
|
|
19
19
|
import { t as FormFieldError } from "./FormFieldError-CFg0Wn3i.js";
|
|
20
20
|
import { t as CheckContent } from "./CheckContent-DzWpxKGq.js";
|
|
21
21
|
import $HgANd$react, { createContext, forwardRef, memo, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
@@ -389,7 +389,10 @@ const CheckboxComponent = (props) => {
|
|
|
389
389
|
...innerProps,
|
|
390
390
|
ref: $5dc95899b306f630$export$c9058316764c140e(ref, field.ref),
|
|
391
391
|
isSelected: field.value,
|
|
392
|
-
onChange:
|
|
392
|
+
onChange: (value) => {
|
|
393
|
+
field.onChange(value);
|
|
394
|
+
field.onBlur();
|
|
395
|
+
},
|
|
393
396
|
onBlur: field.onBlur,
|
|
394
397
|
name: field.name,
|
|
395
398
|
isDirty,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as UIConfig } from "./uiConfig.context-BG4jfp9p.js";
|
|
2
|
-
import { n as renderDatePickerTodayIcon, r as datePickerInputContentRowDefinition, t as DatePickerInput } from "./DatePickerInput-
|
|
2
|
+
import { n as renderDatePickerTodayIcon, r as datePickerInputContentRowDefinition, t as DatePickerInput } from "./DatePickerInput-DcPW7kKS.js";
|
|
3
3
|
import { t as clsx } from "./clsx-CnD0nOiA.js";
|
|
4
4
|
import { f as $5dc95899b306f630$export$c9058316764c140e } from "./utils-D-KKbY-n.js";
|
|
5
5
|
import { d as useCalendarState, i as getStaticDateTimeFocusTarget, o as DateTimeDialogFooter, p as useDatePickerState, s as DateTimeDialog, t as getStaticCalendarDateSegments } from "./staticDateTimeSegments-Cefwvojy.js";
|
|
6
6
|
import { t as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-74MZZLC0.js";
|
|
7
|
-
import { r as $6057a3d2a53a12fd$export$42df105a73306d51, t as Calendar } from "./Calendar-
|
|
7
|
+
import { r as $6057a3d2a53a12fd$export$42df105a73306d51, t as Calendar } from "./Calendar-H9E8lACh.js";
|
|
8
8
|
import { t as UIOverrides } from "./uiOverrides.context-Bfm2n-n8.js";
|
|
9
|
-
import { t as FieldController } from "./form.binding-
|
|
9
|
+
import { t as FieldController } from "./form.binding-DAAmi5nC.js";
|
|
10
10
|
import { t as FormField } from "./FormField-Cl-t5Wi1.js";
|
|
11
11
|
import { t as TooltipWrapper } from "./TooltipWrapper-_N-GOMaV.js";
|
|
12
12
|
import { n as InputFrame, t as useStaticInputHandoff } from "./useStaticInputHandoff-F7xAex_x.js";
|
|
@@ -18,7 +18,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
18
18
|
//#region src/components/inputs/DateTime/DatePicker/DatePicker.tsx
|
|
19
19
|
const DatePickerBase = (props) => {
|
|
20
20
|
const ui = UIConfig.useConfig();
|
|
21
|
-
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDirty, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, value, disableDropdown, className, placeholder, inputClassName, as: asProp, hideLabel: hideLabelProp, variant: variantProp, size: sizeProp, isClearable: isClearableProp, isClearableIfDisabled, todayIcon: todayIconProp, todayIconButtonSize: todayIconButtonSizeProp, todayIconButtonComponent: todayIconButtonComponentProp, todayIconPlacement: todayIconPlacementProp, shouldForceLeadingZeros: shouldForceLeadingZerosProp, disableManualEntry: disableManualEntryProp, shouldUpdateDateOnMonthYearChange: shouldUpdateDateOnMonthYearChangeProp, granularity: granularityProp, autoFixYear: autoFixYearProp, format, ...rest } = props;
|
|
21
|
+
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDirty, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, value, disableDropdown, className, placeholder, inputClassName, as: asProp, hideLabel: hideLabelProp, variant: variantProp, size: sizeProp, isClearable: isClearableProp, isClearableIfDisabled, todayIcon: todayIconProp, todayIconButtonSize: todayIconButtonSizeProp, todayIconButtonComponent: todayIconButtonComponentProp, todayIconPlacement: todayIconPlacementProp, shouldForceLeadingZeros: shouldForceLeadingZerosProp, disableManualEntry: disableManualEntryProp, shouldUpdateDateOnMonthYearChange: shouldUpdateDateOnMonthYearChangeProp, granularity: granularityProp, autoFixYear: autoFixYearProp, format, onValueCommit, ...rest } = props;
|
|
22
22
|
const as = asProp ?? ui.input.as;
|
|
23
23
|
const hideLabel = hideLabelProp ?? ui.input.hideLabel;
|
|
24
24
|
const variant = variantProp ?? ui.input.variant;
|
|
@@ -128,6 +128,7 @@ const DatePickerBase = (props) => {
|
|
|
128
128
|
const onApply = () => {
|
|
129
129
|
const newValue = dialogState.value ? normalizeByGranularity(dialogState.value) : dialogState.value;
|
|
130
130
|
state.setValue(newValue);
|
|
131
|
+
onValueCommit?.();
|
|
131
132
|
state.toggle();
|
|
132
133
|
};
|
|
133
134
|
const onMonthYearChange = (selectedDate) => {
|
|
@@ -151,6 +152,7 @@ const DatePickerBase = (props) => {
|
|
|
151
152
|
const onInputClear = () => {
|
|
152
153
|
onChange?.(null);
|
|
153
154
|
dialogState.setValue(null);
|
|
155
|
+
onValueCommit?.();
|
|
154
156
|
};
|
|
155
157
|
const syncDialogFromControlledValue = () => {
|
|
156
158
|
dialogState.setValue(state.value);
|
|
@@ -234,7 +236,8 @@ const DatePickerBase = (props) => {
|
|
|
234
236
|
dateGranularity: granularity,
|
|
235
237
|
format,
|
|
236
238
|
timeZone: effectiveTimeZone,
|
|
237
|
-
onClear: onInputClear
|
|
239
|
+
onClear: onInputClear,
|
|
240
|
+
onValueCommit
|
|
238
241
|
}), (!disableDropdown || disableManualEntry) && state.isOpen && /* @__PURE__ */ jsx(DateTimeDialog, {
|
|
239
242
|
footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
|
|
240
243
|
isDisabled,
|
|
@@ -343,7 +346,10 @@ const DatePickerInner = ({ fullIso = true, granularity = "day", minValue, maxVal
|
|
|
343
346
|
});
|
|
344
347
|
return /* @__PURE__ */ jsx(InputFrame, {
|
|
345
348
|
...props,
|
|
346
|
-
onClear: () =>
|
|
349
|
+
onClear: () => {
|
|
350
|
+
props.onChange?.(null);
|
|
351
|
+
props.onValueCommit?.();
|
|
352
|
+
},
|
|
347
353
|
isDisabled,
|
|
348
354
|
className: clsx("group relative inline-flex w-full flex-col text-left", props.className),
|
|
349
355
|
inputClassName: clsx("min-w-input-width-min-width", props.inputClassName),
|
|
@@ -399,6 +405,7 @@ const DatePickerComponent = ({ fullIso = true, granularity = "day", minValue, ma
|
|
|
399
405
|
ref: $5dc95899b306f630$export$c9058316764c140e(ref, field.ref),
|
|
400
406
|
value: field.value ?? null,
|
|
401
407
|
onChange: (value) => field.onChange(value ?? null),
|
|
408
|
+
onValueCommit: field.onBlur,
|
|
402
409
|
onBlur: field.onBlur,
|
|
403
410
|
isDirty,
|
|
404
411
|
isDisabled: field.disabled || props.isDisabled,
|
|
@@ -24,11 +24,12 @@ interface DatePickerBaseProps extends FormFieldProps, InputVariantProps, Omit<Da
|
|
|
24
24
|
placeholder?: string;
|
|
25
25
|
inputClassName?: string;
|
|
26
26
|
onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
|
|
27
|
+
onValueCommit?: () => void;
|
|
27
28
|
shouldUpdateDateOnMonthYearChange?: boolean;
|
|
28
29
|
granularity?: DatePickerGranularity;
|
|
29
30
|
format?: string;
|
|
30
31
|
}
|
|
31
|
-
interface DatePickerProps extends Omit<DatePickerBaseProps, "value" | "onChange" | "minValue" | "maxValue"> {
|
|
32
|
+
interface DatePickerProps extends Omit<DatePickerBaseProps, "value" | "onChange" | "minValue" | "maxValue" | "onValueCommit"> {
|
|
32
33
|
value?: string | null;
|
|
33
34
|
onChange?: (value: string | null) => void;
|
|
34
35
|
fullIso?: boolean;
|
|
@@ -421,7 +421,7 @@ const renderDatePickerTodayIcon = (todayIcon, options) => {
|
|
|
421
421
|
};
|
|
422
422
|
//#endregion
|
|
423
423
|
//#region src/components/inputs/DateTime/shared/DatePickerInput.tsx
|
|
424
|
-
const DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, fieldValue, endFieldValue, isValueControlled, hasValue, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, shouldShrinkInput, isClearable, isClearableIfDisabled, headerProps, todayIcon, todayIconButtonSize = "none", todayIconButtonComponent, todayIconPlacement = "content", isDirty, isRequired, disableManualEntry, autoFixYear = false, placeholder, displayContent, className, onOpenDropdown, dateGranularity = "day", timeZone: timeZoneProp, isTimeOptional = false, format, onClear: onClearProp, ...props }) => {
|
|
424
|
+
const DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, fieldValue, endFieldValue, isValueControlled, hasValue, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, shouldShrinkInput, isClearable, isClearableIfDisabled, headerProps, todayIcon, todayIconButtonSize = "none", todayIconButtonComponent, todayIconPlacement = "content", isDirty, isRequired, disableManualEntry, autoFixYear = false, placeholder, displayContent, className, onOpenDropdown, dateGranularity = "day", timeZone: timeZoneProp, isTimeOptional = false, format, onClear: onClearProp, onValueCommit, ...props }) => {
|
|
425
425
|
const uiConfig = UIConfig.useConfig();
|
|
426
426
|
const timeZone = timeZoneProp ?? uiConfig.dateInput.timeZone;
|
|
427
427
|
let effectiveTimeZone = getLocalTimeZone();
|
|
@@ -488,6 +488,7 @@ const DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, field
|
|
|
488
488
|
fieldProps.onChange?.(today(effectiveTimeZone));
|
|
489
489
|
if (endFieldProps) endFieldProps.onChange?.(today(effectiveTimeZone));
|
|
490
490
|
}
|
|
491
|
+
onValueCommit?.();
|
|
491
492
|
};
|
|
492
493
|
const hidePlaceholder = as === "floating" && !fieldProps.value && !isFocused;
|
|
493
494
|
const todayIconButton = renderDatePickerTodayIcon(todayIcon, {
|
|
@@ -3,7 +3,7 @@ import { t as ChevronDown } from "./chevron-down-Ciz9yP9R.js";
|
|
|
3
3
|
import { t as ChevronLeft } from "./chevron-left-VO8YZrXZ.js";
|
|
4
4
|
import { t as ChevronRight } from "./chevron-right-C_M98bh3.js";
|
|
5
5
|
import { n as ChevronsLeft, t as ChevronsRight } from "./chevrons-right-BXdmZ2TS.js";
|
|
6
|
-
import { i as CalendarGrid, n as renderDatePickerTodayIcon, r as datePickerInputContentRowDefinition, t as DatePickerInput } from "./DatePickerInput-
|
|
6
|
+
import { i as CalendarGrid, n as renderDatePickerTodayIcon, r as datePickerInputContentRowDefinition, t as DatePickerInput } from "./DatePickerInput-DcPW7kKS.js";
|
|
7
7
|
import { t as clsx } from "./clsx-CnD0nOiA.js";
|
|
8
8
|
import { d as $3ef42575df84b30b$export$9d1611c77c2fe928, f as $5dc95899b306f630$export$c9058316764c140e, h as $bdb11010cef70236$export$f680877a34711e37 } from "./utils-D-KKbY-n.js";
|
|
9
9
|
import { t as $d4ee10de306f2510$export$4282f70798064fe0 } from "./DOMFunctions-BrQjsnDh.js";
|
|
@@ -15,18 +15,18 @@ import { n as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "./Button-D09S1dN
|
|
|
15
15
|
import { t as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-74MZZLC0.js";
|
|
16
16
|
import { n as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "./useLocalizedStringFormatter-tBB7tXBj.js";
|
|
17
17
|
import { n as $e5be200c675c3b3a$export$a763b9476acd3eb, r as $e5be200c675c3b3a$export$dad6ae84456c676a, t as $e5be200c675c3b3a$export$75ee7c75d68f5b0e } from "./useFormValidationState-Bpry7Uk5.js";
|
|
18
|
-
import { t as Toggle } from "./Toggle-
|
|
18
|
+
import { t as Toggle } from "./Toggle-Cf8jQ991.js";
|
|
19
19
|
import { t as UIOverrides } from "./uiOverrides.context-Bfm2n-n8.js";
|
|
20
20
|
import { t as Typography } from "./Typography-AcUd9df8.js";
|
|
21
21
|
import { InlineIconButton } from "./components/inline-icon-button.js";
|
|
22
22
|
import { PillButton } from "./components/pill-button.js";
|
|
23
|
-
import { t as FieldController } from "./form.binding-
|
|
23
|
+
import { t as FieldController } from "./form.binding-DAAmi5nC.js";
|
|
24
24
|
import { t as FormField } from "./FormField-Cl-t5Wi1.js";
|
|
25
25
|
import "./i18n-BDjNuy4Z.js";
|
|
26
26
|
import { t as TooltipWrapper } from "./TooltipWrapper-_N-GOMaV.js";
|
|
27
27
|
import { n as InputFrame, t as useStaticInputHandoff } from "./useStaticInputHandoff-F7xAex_x.js";
|
|
28
28
|
import { t as DateTimeUtils } from "./date-time.utils-0F9qduim.js";
|
|
29
|
-
import { t as Select } from "./Select-
|
|
29
|
+
import { t as Select } from "./Select-DPG_tS7y.js";
|
|
30
30
|
import { memo, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
31
31
|
import { createCalendar, endOfMonth, endOfWeek, endOfYear, getLocalTimeZone, startOfMonth, startOfWeek, startOfYear, toCalendarDate, today } from "@internationalized/date";
|
|
32
32
|
import { useFocusWithin } from "@react-aria/interactions";
|
|
@@ -541,7 +541,7 @@ const hydrateRelativeDateRangeValue = (value, currentDate = today(getLocalTimeZo
|
|
|
541
541
|
const DateRangePickerBase = (props) => {
|
|
542
542
|
const ui = UIConfig.useConfig();
|
|
543
543
|
const { t } = useTranslation();
|
|
544
|
-
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, value, disableDropdown, className, hideSidebar, placeholder, inputClassName, hideLabel: hideLabelProp, variant: variantProp, as: asProp, size: sizeProp, isClearable: isClearableProp, isClearableIfDisabled, todayIcon: todayIconProp, todayIconButtonSize: todayIconButtonSizeProp, todayIconButtonComponent: todayIconButtonComponentProp, todayIconPlacement: todayIconPlacementProp, shouldForceLeadingZeros: shouldForceLeadingZerosProp, disableManualEntry: disableManualEntryProp, autoFixYear: autoFixYearProp, allowPartialRange: allowPartialRangeProp, mode = "absolute", relativeValue, relativeOptions = [], onRelativeChange, enableRelativeMode, onModeChange, minValue, maxValue, ...rest } = props;
|
|
544
|
+
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, onValueCommit, value, disableDropdown, className, hideSidebar, placeholder, inputClassName, hideLabel: hideLabelProp, variant: variantProp, as: asProp, size: sizeProp, isClearable: isClearableProp, isClearableIfDisabled, todayIcon: todayIconProp, todayIconButtonSize: todayIconButtonSizeProp, todayIconButtonComponent: todayIconButtonComponentProp, todayIconPlacement: todayIconPlacementProp, shouldForceLeadingZeros: shouldForceLeadingZerosProp, disableManualEntry: disableManualEntryProp, autoFixYear: autoFixYearProp, allowPartialRange: allowPartialRangeProp, mode = "absolute", relativeValue, relativeOptions = [], onRelativeChange, enableRelativeMode, onModeChange, minValue, maxValue, ...rest } = props;
|
|
545
545
|
const hideLabel = hideLabelProp ?? ui.input.hideLabel;
|
|
546
546
|
const variant = variantProp ?? ui.input.variant;
|
|
547
547
|
const as = asProp ?? ui.input.as;
|
|
@@ -930,6 +930,7 @@ const DateRangePickerBase = (props) => {
|
|
|
930
930
|
const preset = presets.find((option) => option.value === activePreset);
|
|
931
931
|
handledRelativeValueRef.current = activePreset;
|
|
932
932
|
onRelativeChange?.(activePreset, preset?.clampedValue ?? null);
|
|
933
|
+
onValueCommit?.();
|
|
933
934
|
state.toggle();
|
|
934
935
|
return;
|
|
935
936
|
}
|
|
@@ -946,6 +947,7 @@ const DateRangePickerBase = (props) => {
|
|
|
946
947
|
}
|
|
947
948
|
}
|
|
948
949
|
state.toggle();
|
|
950
|
+
onValueCommit?.();
|
|
949
951
|
};
|
|
950
952
|
const onTodayPress = () => {
|
|
951
953
|
const todayDate = today(effectiveTimeZone);
|
|
@@ -966,6 +968,7 @@ const DateRangePickerBase = (props) => {
|
|
|
966
968
|
setActivePreset(null);
|
|
967
969
|
handledRelativeValueRef.current = null;
|
|
968
970
|
onRelativeChange?.(null, null);
|
|
971
|
+
onValueCommit?.();
|
|
969
972
|
return;
|
|
970
973
|
}
|
|
971
974
|
fieldRangeRef.current = null;
|
|
@@ -979,6 +982,7 @@ const DateRangePickerBase = (props) => {
|
|
|
979
982
|
isSelecting: false
|
|
980
983
|
});
|
|
981
984
|
setHoverDate(null);
|
|
985
|
+
onValueCommit?.();
|
|
982
986
|
};
|
|
983
987
|
const syncSelectionFromControlledValue = () => {
|
|
984
988
|
if (mode === "relative") {
|
|
@@ -1193,7 +1197,8 @@ const DateRangePickerBase = (props) => {
|
|
|
1193
1197
|
className: inputClassName,
|
|
1194
1198
|
onOpenDropdown,
|
|
1195
1199
|
timeZone: effectiveTimeZone,
|
|
1196
|
-
onClear: onInputClear
|
|
1200
|
+
onClear: onInputClear,
|
|
1201
|
+
onValueCommit
|
|
1197
1202
|
}), /* @__PURE__ */ jsx(DateTimeDialog, {
|
|
1198
1203
|
hideSidebar,
|
|
1199
1204
|
sidebar: /* @__PURE__ */ jsxs("div", {
|
|
@@ -1398,6 +1403,7 @@ const DateRangePickerInner = ({ fullIso = true, minValue, maxValue, renderStatic
|
|
|
1398
1403
|
onClear: () => {
|
|
1399
1404
|
props.onChange?.(null);
|
|
1400
1405
|
props.onRelativeChange?.(null);
|
|
1406
|
+
props.onValueCommit?.();
|
|
1401
1407
|
},
|
|
1402
1408
|
isDisabled,
|
|
1403
1409
|
className: clsx("group relative inline-flex w-full flex-col text-left", props.className),
|
|
@@ -1479,6 +1485,7 @@ const DateRangePickerComponent = ({ fullIso = true, minValue, maxValue, renderSt
|
|
|
1479
1485
|
value: field.value ?? null,
|
|
1480
1486
|
onChange: (value) => field.onChange(value ?? null),
|
|
1481
1487
|
onBlur: field.onBlur,
|
|
1488
|
+
onValueCommit: field.onBlur,
|
|
1482
1489
|
isDirty,
|
|
1483
1490
|
isDisabled: field.disabled || props.isDisabled,
|
|
1484
1491
|
isFormControlDisabled: !!controlWithOptions._options?.disabled,
|
|
@@ -25,6 +25,7 @@ interface DateRangePickerBaseProps extends FormFieldProps, InputVariantProps, Om
|
|
|
25
25
|
placeholder?: string;
|
|
26
26
|
inputClassName?: string;
|
|
27
27
|
onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
|
|
28
|
+
onValueCommit?: () => void;
|
|
28
29
|
allowPartialRange?: boolean;
|
|
29
30
|
mode?: "absolute" | "relative";
|
|
30
31
|
relativeValue?: string | null;
|
|
@@ -50,7 +51,7 @@ interface DateRangeResolvedValue {
|
|
|
50
51
|
start: string;
|
|
51
52
|
end: string;
|
|
52
53
|
}
|
|
53
|
-
interface DateRangePickerSharedProps extends Omit<DateRangePickerBaseProps, "value" | "onChange" | "minValue" | "maxValue" | "mode" | "relativeValue" | "relativeOptions" | "onRelativeChange" | "onModeChange"> {
|
|
54
|
+
interface DateRangePickerSharedProps extends Omit<DateRangePickerBaseProps, "value" | "onChange" | "minValue" | "maxValue" | "mode" | "relativeValue" | "relativeOptions" | "onRelativeChange" | "onModeChange" | "onValueCommit"> {
|
|
54
55
|
fullIso?: boolean;
|
|
55
56
|
minValue?: DateValue$1 | string;
|
|
56
57
|
maxValue?: DateValue$1 | string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as UIConfig } from "./uiConfig.context-BG4jfp9p.js";
|
|
2
|
-
import { n as renderDatePickerTodayIcon, r as datePickerInputContentRowDefinition, t as DatePickerInput } from "./DatePickerInput-
|
|
2
|
+
import { n as renderDatePickerTodayIcon, r as datePickerInputContentRowDefinition, t as DatePickerInput } from "./DatePickerInput-DcPW7kKS.js";
|
|
3
3
|
import { t as clsx } from "./clsx-CnD0nOiA.js";
|
|
4
4
|
import { f as $5dc95899b306f630$export$c9058316764c140e } from "./utils-D-KKbY-n.js";
|
|
5
5
|
import { d as useCalendarState, i as getStaticDateTimeFocusTarget, n as getStaticCalendarDateTimeSegments, o as DateTimeDialogFooter, p as useDatePickerState, s as DateTimeDialog } from "./staticDateTimeSegments-Cefwvojy.js";
|
|
6
6
|
import { t as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-74MZZLC0.js";
|
|
7
|
-
import { r as $6057a3d2a53a12fd$export$42df105a73306d51, t as Calendar } from "./Calendar-
|
|
7
|
+
import { r as $6057a3d2a53a12fd$export$42df105a73306d51, t as Calendar } from "./Calendar-H9E8lACh.js";
|
|
8
8
|
import { t as UIOverrides } from "./uiOverrides.context-Bfm2n-n8.js";
|
|
9
|
-
import { t as FieldController } from "./form.binding-
|
|
9
|
+
import { t as FieldController } from "./form.binding-DAAmi5nC.js";
|
|
10
10
|
import { t as FormField } from "./FormField-Cl-t5Wi1.js";
|
|
11
11
|
import { t as TooltipWrapper } from "./TooltipWrapper-_N-GOMaV.js";
|
|
12
12
|
import { n as InputFrame, t as useStaticInputHandoff } from "./useStaticInputHandoff-F7xAex_x.js";
|
|
@@ -18,7 +18,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
18
18
|
//#region src/components/inputs/DateTime/DateTimePicker/DateTimePicker.tsx
|
|
19
19
|
const DateTimePickerBase = (props) => {
|
|
20
20
|
const ui = UIConfig.useConfig();
|
|
21
|
-
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, value, disableDropdown, isTimeOptional, placeholder, inputClassName, shouldShrinkInput, hideLabel: hideLabelProp, variant: variantProp, as: asProp, size: sizeProp, isClearable: isClearableProp, isClearableIfDisabled, todayIcon: todayIconProp, todayIconButtonSize: todayIconButtonSizeProp, todayIconButtonComponent: todayIconButtonComponentProp, todayIconPlacement: todayIconPlacementProp, shouldForceLeadingZeros: shouldForceLeadingZerosProp, disableManualEntry: disableManualEntryProp, shouldUpdateDateOnMonthYearChange: shouldUpdateDateOnMonthYearChangeProp, timeZone: timeZoneProp, autoFixYear: autoFixYearProp, format, setDateValueOnDateSelection: setDateValueOnDateSelectionProp, ...rest } = props;
|
|
21
|
+
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, onValueCommit, value, disableDropdown, isTimeOptional, placeholder, inputClassName, shouldShrinkInput, hideLabel: hideLabelProp, variant: variantProp, as: asProp, size: sizeProp, isClearable: isClearableProp, isClearableIfDisabled, todayIcon: todayIconProp, todayIconButtonSize: todayIconButtonSizeProp, todayIconButtonComponent: todayIconButtonComponentProp, todayIconPlacement: todayIconPlacementProp, shouldForceLeadingZeros: shouldForceLeadingZerosProp, disableManualEntry: disableManualEntryProp, shouldUpdateDateOnMonthYearChange: shouldUpdateDateOnMonthYearChangeProp, timeZone: timeZoneProp, autoFixYear: autoFixYearProp, format, setDateValueOnDateSelection: setDateValueOnDateSelectionProp, ...rest } = props;
|
|
22
22
|
const hideLabel = hideLabelProp ?? ui.input.hideLabel;
|
|
23
23
|
const variant = variantProp ?? ui.input.variant;
|
|
24
24
|
const as = asProp ?? ui.input.as;
|
|
@@ -121,6 +121,7 @@ const DateTimePickerBase = (props) => {
|
|
|
121
121
|
const newValue = dialogState.value ?? null;
|
|
122
122
|
onChange?.(newValue);
|
|
123
123
|
dialogState.setValue(newValue);
|
|
124
|
+
onValueCommit?.();
|
|
124
125
|
state.close();
|
|
125
126
|
};
|
|
126
127
|
const onMonthYearChange = (selectedDate) => {
|
|
@@ -146,6 +147,7 @@ const DateTimePickerBase = (props) => {
|
|
|
146
147
|
const onInputClear = () => {
|
|
147
148
|
onChange?.(null);
|
|
148
149
|
dialogState.setValue(null);
|
|
150
|
+
onValueCommit?.();
|
|
149
151
|
};
|
|
150
152
|
const syncDialogFromControlledValue = () => {
|
|
151
153
|
dialogState.setValue(state.value);
|
|
@@ -216,7 +218,8 @@ const DateTimePickerBase = (props) => {
|
|
|
216
218
|
timeZone: effectiveTimeZone,
|
|
217
219
|
isTimeOptional,
|
|
218
220
|
format,
|
|
219
|
-
onClear: onInputClear
|
|
221
|
+
onClear: onInputClear,
|
|
222
|
+
onValueCommit
|
|
220
223
|
}), (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(DateTimeDialog, {
|
|
221
224
|
footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
|
|
222
225
|
isDisabled,
|
|
@@ -305,7 +308,10 @@ const DateTimePickerInner = ({ fullIso: _fullIso = true, renderStaticInput, isFo
|
|
|
305
308
|
});
|
|
306
309
|
return /* @__PURE__ */ jsx(InputFrame, {
|
|
307
310
|
...props,
|
|
308
|
-
onClear: () =>
|
|
311
|
+
onClear: () => {
|
|
312
|
+
props.onChange?.(null);
|
|
313
|
+
props.onValueCommit?.();
|
|
314
|
+
},
|
|
309
315
|
isDisabled,
|
|
310
316
|
className: clsx("group relative inline-flex w-full flex-col text-left", props.className),
|
|
311
317
|
inputClassName: clsx(props.shouldShrinkInput ? "min-w-0" : "min-w-input-width-min-width", props.inputClassName),
|
|
@@ -360,6 +366,7 @@ const DateTimePickerComponent = ({ fullIso = true, renderStaticInput, ...props }
|
|
|
360
366
|
value: field.value ?? null,
|
|
361
367
|
onChange: (value) => field.onChange(value ?? null),
|
|
362
368
|
onBlur: field.onBlur,
|
|
369
|
+
onValueCommit: field.onBlur,
|
|
363
370
|
isDirty,
|
|
364
371
|
isDisabled: field.disabled || props.isDisabled,
|
|
365
372
|
isFormControlDisabled: !!controlWithOptions._options?.disabled,
|
|
@@ -28,8 +28,9 @@ interface DateTimePickerBaseProps extends FormFieldProps, InputVariantProps, Omi
|
|
|
28
28
|
timeZone?: string;
|
|
29
29
|
format?: string;
|
|
30
30
|
onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
|
|
31
|
+
onValueCommit?: () => void;
|
|
31
32
|
}
|
|
32
|
-
interface DateTimePickerProps extends Omit<DateTimePickerBaseProps, "value" | "onChange"> {
|
|
33
|
+
interface DateTimePickerProps extends Omit<DateTimePickerBaseProps, "value" | "onChange" | "onValueCommit"> {
|
|
33
34
|
value?: string | null;
|
|
34
35
|
onChange?: (value: string | null) => void;
|
|
35
36
|
fullIso?: boolean;
|
|
@@ -10,7 +10,7 @@ import { t as Typography } from "./Typography-AcUd9df8.js";
|
|
|
10
10
|
import { t as Button } from "./Button-7HZojyTP.js";
|
|
11
11
|
import { InlineIconButton } from "./components/inline-icon-button.js";
|
|
12
12
|
import { TextButton } from "./components/text-button.js";
|
|
13
|
-
import { t as FieldController } from "./form.binding-
|
|
13
|
+
import { t as FieldController } from "./form.binding-DAAmi5nC.js";
|
|
14
14
|
import { t as FormField } from "./FormField-Cl-t5Wi1.js";
|
|
15
15
|
import "./i18n-BDjNuy4Z.js";
|
|
16
16
|
import { t as FileUtils } from "./file.utils-DqQxnuAm.js";
|
|
@@ -569,7 +569,7 @@ const fileUploadDropZoneDefinition = UIOverrides.defineConfig({
|
|
|
569
569
|
//#region src/components/inputs/File/FileUpload.tsx
|
|
570
570
|
const FileUploadBase = (props) => {
|
|
571
571
|
const { t } = useTranslation("ui");
|
|
572
|
-
const { ref: _ref, label, tooltipText, variant = "vertical", as = "button", helperText, isRequired, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, className, allowsMultiple = false, hideLabel, acceptedFileTypes, clearOnSuccess, emptyText = t(($) => $.ui.fileUpload.emptyText), uploadText = t(($) => $.ui.fileUpload.uploadText), browseText = t(($) => $.ui.fileUpload.browse), fileUpload, fileRemove, children, listRenderer, browseButtonProps, cancelButtonProps, onInvalidFileType, defaultState, ...rest } = props;
|
|
572
|
+
const { ref: _ref, label, tooltipText, variant = "vertical", as = "button", helperText, isRequired, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, className, allowsMultiple = false, hideLabel, acceptedFileTypes, clearOnSuccess, emptyText = t(($) => $.ui.fileUpload.emptyText), uploadText = t(($) => $.ui.fileUpload.uploadText), browseText = t(($) => $.ui.fileUpload.browse), fileUpload, fileRemove, children, listRenderer, browseButtonProps, cancelButtonProps, onInvalidFileType, onChange, defaultState, ...rest } = props;
|
|
573
573
|
const ui = UIConfig.useConfig();
|
|
574
574
|
const fileUploadDropZoneCva = UIOverrides.useCva("fileUpload.dropZoneCva", fileUploadDropZoneDefinition);
|
|
575
575
|
const getInitialState = () => {
|
|
@@ -585,6 +585,10 @@ const FileUploadBase = (props) => {
|
|
|
585
585
|
return allowsMultiple ? items : items.slice(0, 1);
|
|
586
586
|
};
|
|
587
587
|
const [uploadState, setUploadState] = useState(getInitialState);
|
|
588
|
+
const emitFiles = useCallback((files) => {
|
|
589
|
+
if (allowsMultiple) onChange?.(files);
|
|
590
|
+
else onChange?.(files[0] ?? null);
|
|
591
|
+
}, [allowsMultiple, onChange]);
|
|
588
592
|
const formFieldProps = {
|
|
589
593
|
error,
|
|
590
594
|
label,
|
|
@@ -603,7 +607,10 @@ const FileUploadBase = (props) => {
|
|
|
603
607
|
const invalidFiles = inputFiles.filter((file) => !FileUtils.isFileTypeAccepted(file, acceptedFileTypes));
|
|
604
608
|
if (invalidFiles.length > 0) if (allowsMultiple) onInvalidFileType?.(invalidFiles.map((file) => file.name));
|
|
605
609
|
else onInvalidFileType?.(invalidFiles[0].name);
|
|
606
|
-
if (acceptedFiles.length === 0
|
|
610
|
+
if (acceptedFiles.length === 0) return;
|
|
611
|
+
const existingFiles = allowsMultiple ? uploadState.flatMap((state) => state.file ? [state.file] : []) : [];
|
|
612
|
+
emitFiles([...existingFiles, ...acceptedFiles]);
|
|
613
|
+
if (!fileUpload) return;
|
|
607
614
|
if (!allowsMultiple) setUploadState([]);
|
|
608
615
|
const newUploadState = [];
|
|
609
616
|
acceptedFiles.forEach((file) => {
|
|
@@ -643,9 +650,14 @@ const FileUploadBase = (props) => {
|
|
|
643
650
|
id: res.id
|
|
644
651
|
} : state));
|
|
645
652
|
});
|
|
646
|
-
if (clearOnSuccess)
|
|
653
|
+
if (clearOnSuccess) {
|
|
654
|
+
setUploadState([]);
|
|
655
|
+
emitFiles([]);
|
|
656
|
+
}
|
|
647
657
|
} catch (error) {
|
|
648
|
-
|
|
658
|
+
const remainingState = uploadState.slice(0, startIndex);
|
|
659
|
+
setUploadState(remainingState);
|
|
660
|
+
emitFiles(remainingState.flatMap((state) => state.file ? [state.file] : []));
|
|
649
661
|
throw error;
|
|
650
662
|
}
|
|
651
663
|
};
|
|
@@ -665,15 +677,23 @@ const FileUploadBase = (props) => {
|
|
|
665
677
|
};
|
|
666
678
|
const handleRemove = useCallback((id) => {
|
|
667
679
|
fileRemove?.({ id });
|
|
668
|
-
|
|
669
|
-
|
|
680
|
+
const remainingState = uploadState.filter((state) => state.id !== id);
|
|
681
|
+
setUploadState(remainingState);
|
|
682
|
+
emitFiles(remainingState.flatMap((state) => state.file ? [state.file] : []));
|
|
683
|
+
}, [
|
|
684
|
+
emitFiles,
|
|
685
|
+
fileRemove,
|
|
686
|
+
uploadState
|
|
687
|
+
]);
|
|
670
688
|
const handleCancelUpload = useCallback((index) => {
|
|
671
689
|
const findState = uploadState[index];
|
|
672
690
|
if (findState) {
|
|
673
691
|
findState.abortController?.abort("canceled by user");
|
|
674
|
-
|
|
692
|
+
const remainingState = uploadState.filter((_, i) => i !== index);
|
|
693
|
+
setUploadState(remainingState);
|
|
694
|
+
emitFiles(remainingState.flatMap((state) => state.file ? [state.file] : []));
|
|
675
695
|
}
|
|
676
|
-
}, [uploadState]);
|
|
696
|
+
}, [emitFiles, uploadState]);
|
|
677
697
|
return /* @__PURE__ */ jsxs(FormField, {
|
|
678
698
|
...formFieldProps,
|
|
679
699
|
labelProps,
|
|
@@ -753,7 +773,10 @@ const FileUploadComponent = (props) => {
|
|
|
753
773
|
...innerProps,
|
|
754
774
|
ref: $5dc95899b306f630$export$c9058316764c140e(ref, field.ref),
|
|
755
775
|
value: field.value,
|
|
756
|
-
onChange:
|
|
776
|
+
onChange: ((value) => {
|
|
777
|
+
field.onChange(value);
|
|
778
|
+
field.onBlur();
|
|
779
|
+
}),
|
|
757
780
|
isDisabled: field.disabled || props.isDisabled,
|
|
758
781
|
error: props.error ?? error?.message
|
|
759
782
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as UIForm, l as UseFormProps, o as FormSubmitErrorHandler, s as FormSubmitHandler } from "./form.binding-Cu03pQ8Y.js";
|
|
2
|
-
import { c as InputComponentProps, i as DefaultComponentType, r as AllowedComponentType, u as InputDefBaseProps } from "./dynamicInputs-
|
|
2
|
+
import { c as InputComponentProps, i as DefaultComponentType, r as AllowedComponentType, u as InputDefBaseProps } from "./dynamicInputs-DhCSXGpC.js";
|
|
3
3
|
import { DependencyList, ReactNode } from "react";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/hooks/useAutosave.d.ts
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { t as PasswordInput } from "./PasswordInput-CMKZF3YS.js";
|
|
2
|
-
import { t as Checkbox } from "./Checkbox-
|
|
3
|
-
import { t as Slider } from "./Slider-
|
|
4
|
-
import { t as DateRangePicker } from "./DateRangePicker-
|
|
5
|
-
import { t as Toggle } from "./Toggle-
|
|
6
|
-
import { t as TextArea } from "./TextArea-
|
|
2
|
+
import { t as Checkbox } from "./Checkbox-Bg_KpTR1.js";
|
|
3
|
+
import { t as Slider } from "./Slider-DpjeijYH.js";
|
|
4
|
+
import { t as DateRangePicker } from "./DateRangePicker-CNkQIrwx.js";
|
|
5
|
+
import { t as Toggle } from "./Toggle-Cf8jQ991.js";
|
|
6
|
+
import { t as TextArea } from "./TextArea-Bm3QhIRz.js";
|
|
7
7
|
import { TextInput } from "./components/text-input.js";
|
|
8
8
|
import { Autocomplete } from "./components/autocomplete.js";
|
|
9
9
|
import { CheckboxGroup } from "./components/checkbox-group.js";
|
|
10
|
-
import { t as DatePicker } from "./DatePicker-
|
|
11
|
-
import { t as Select } from "./Select-
|
|
12
|
-
import { t as DateTimePicker } from "./DateTimePicker-
|
|
10
|
+
import { t as DatePicker } from "./DatePicker-DyAL-7Ze.js";
|
|
11
|
+
import { t as Select } from "./Select-DPG_tS7y.js";
|
|
12
|
+
import { t as DateTimePicker } from "./DateTimePicker-C6RmNdPP.js";
|
|
13
13
|
import { NumberInput } from "./components/number-input.js";
|
|
14
|
-
import { t as NumberRangeInput } from "./NumberRangeInput-
|
|
14
|
+
import { t as NumberRangeInput } from "./NumberRangeInput-CW7X27p1.js";
|
|
15
15
|
import { QueryAutocomplete } from "./components/query-autocomplete.js";
|
|
16
16
|
import { QuerySelect } from "./components/query-select.js";
|
|
17
|
-
import { t as Segment } from "./Segment-
|
|
18
|
-
import { t as TimePicker } from "./TimePicker-
|
|
17
|
+
import { t as Segment } from "./Segment-BnyGK1kI.js";
|
|
18
|
+
import { t as TimePicker } from "./TimePicker-Bf82rbFG.js";
|
|
19
19
|
import { useMemo } from "react";
|
|
20
20
|
import { jsx } from "react/jsx-runtime";
|
|
21
21
|
//#region src/components/inputs/Inputs/InputItem.tsx
|
|
@@ -9,7 +9,7 @@ import { t as Typography } from "./Typography-AcUd9df8.js";
|
|
|
9
9
|
import { t as Button } from "./Button-7HZojyTP.js";
|
|
10
10
|
import { InlineIconButton } from "./components/inline-icon-button.js";
|
|
11
11
|
import { TextButton } from "./components/text-button.js";
|
|
12
|
-
import { t as FieldController } from "./form.binding-
|
|
12
|
+
import { t as FieldController } from "./form.binding-DAAmi5nC.js";
|
|
13
13
|
import { t as FormField } from "./FormField-Cl-t5Wi1.js";
|
|
14
14
|
import "./i18n-BDjNuy4Z.js";
|
|
15
15
|
import { a as inputSizeDefinition } from "./input.cva-KYGD4Bdz.js";
|
|
@@ -220,7 +220,10 @@ const InputUploadComponent = (props) => {
|
|
|
220
220
|
...innerProps,
|
|
221
221
|
ref: $5dc95899b306f630$export$c9058316764c140e(ref, field.ref),
|
|
222
222
|
value: field.value,
|
|
223
|
-
onChange:
|
|
223
|
+
onChange: ((value) => {
|
|
224
|
+
field.onChange(value);
|
|
225
|
+
field.onBlur();
|
|
226
|
+
}),
|
|
224
227
|
isDisabled: field.disabled || props.isDisabled,
|
|
225
228
|
error: props.error ?? error?.message
|
|
226
229
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as UIForm } from "./form.binding-Cu03pQ8Y.js";
|
|
2
|
-
import { l as InputDef } from "./dynamicInputs-
|
|
2
|
+
import { l as InputDef } from "./dynamicInputs-DhCSXGpC.js";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/components/inputs/Inputs/Inputs.d.ts
|
|
@@ -33,8 +33,9 @@ interface NumberRangeInputBaseProps extends FormFieldProps, InputVariantProps, O
|
|
|
33
33
|
onMinChange?: (value: number | null) => void;
|
|
34
34
|
onMaxChange?: (value: number | null) => void;
|
|
35
35
|
onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
|
|
36
|
+
onValueCommit?: () => void;
|
|
36
37
|
}
|
|
37
|
-
type NumberRangeInputProps = NumberRangeInputBaseProps & {
|
|
38
|
+
type NumberRangeInputProps = Omit<NumberRangeInputBaseProps, "onValueCommit"> & {
|
|
38
39
|
renderStaticInput?: boolean;
|
|
39
40
|
};
|
|
40
41
|
type ControlledNumberRangeInputProps<TFieldValues extends FieldValues> = ControlProps<NumberRangeInputProps, TFieldValues>;
|
|
@@ -5,7 +5,7 @@ import { t as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-74MZZL
|
|
|
5
5
|
import { n as $81397a9303501bda$export$23f548e970bdf099, r as $de67e98908f0c6ee$export$7f629e9dc1ecf37c, t as getStaticNumberDisplayValue } from "./numberStatic.utils-DcnGigJ6.js";
|
|
6
6
|
import { n as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "./Input-BefLtZJe.js";
|
|
7
7
|
import { t as UIOverrides } from "./uiOverrides.context-Bfm2n-n8.js";
|
|
8
|
-
import { t as FieldController } from "./form.binding-
|
|
8
|
+
import { t as FieldController } from "./form.binding-DAAmi5nC.js";
|
|
9
9
|
import { r as FormFieldLabel, t as FormField } from "./FormField-Cl-t5Wi1.js";
|
|
10
10
|
import { a as inputSizeDefinition, t as inputBaseDefinition } from "./input.cva-KYGD4Bdz.js";
|
|
11
11
|
import { n as InputClear, t as TooltipWrapper } from "./TooltipWrapper-_N-GOMaV.js";
|
|
@@ -66,7 +66,7 @@ const NumberRangeValueField = ({ label, value, placeholder, isDisabled, isInvali
|
|
|
66
66
|
})]
|
|
67
67
|
});
|
|
68
68
|
};
|
|
69
|
-
const NumberRangeField = ({ ref, as, className, inputClassName, minInputClassName, maxInputClassName, inputBaseClassName, inputSizeClassName, formFieldProps, headerProps, rangeValue, effectiveError, minPlaceholder, maxPlaceholder, minLabel, maxLabel, hideInnerLabels, isDirty, isClearable, isClearableIfDisabled, autoFocusOnMount, isDisabled, isRequired, isEmpty, isHovered, isFocused, isFocusVisible, focusWithinProps, hoverProps, onRangeSideChange, onRangeSideClear, onBlur, ...numberFieldProps }) => /* @__PURE__ */ jsx(TooltipWrapper, {
|
|
69
|
+
const NumberRangeField = ({ ref, as, className, inputClassName, minInputClassName, maxInputClassName, inputBaseClassName, inputSizeClassName, formFieldProps, headerProps, rangeValue, effectiveError, minPlaceholder, maxPlaceholder, minLabel, maxLabel, hideInnerLabels, isDirty, isClearable, isClearableIfDisabled, autoFocusOnMount, isDisabled, isRequired, isEmpty, isHovered, isFocused, isFocusVisible, focusWithinProps, hoverProps, onRangeSideChange, onRangeSideClear, onBlur, onValueCommit, ...numberFieldProps }) => /* @__PURE__ */ jsx(TooltipWrapper, {
|
|
70
70
|
as,
|
|
71
71
|
error: effectiveError,
|
|
72
72
|
triggerTabIndex: as === "inline" ? -1 : void 0,
|
|
@@ -117,6 +117,7 @@ const NumberRangeField = ({ ref, as, className, inputClassName, minInputClassNam
|
|
|
117
117
|
isClearableIfDisabled,
|
|
118
118
|
onClear: () => {
|
|
119
119
|
onRangeSideClear("min");
|
|
120
|
+
onValueCommit?.();
|
|
120
121
|
},
|
|
121
122
|
className: minInputClassName
|
|
122
123
|
}),
|
|
@@ -141,6 +142,7 @@ const NumberRangeField = ({ ref, as, className, inputClassName, minInputClassNam
|
|
|
141
142
|
isClearableIfDisabled,
|
|
142
143
|
onClear: () => {
|
|
143
144
|
onRangeSideClear("max");
|
|
145
|
+
onValueCommit?.();
|
|
144
146
|
},
|
|
145
147
|
className: maxInputClassName
|
|
146
148
|
})
|
|
@@ -166,7 +168,7 @@ const NumberRangeInputBase = (props) => {
|
|
|
166
168
|
const ui = UIConfig.useConfig();
|
|
167
169
|
const inputBaseCva = UIOverrides.useCva("input.baseCva", inputBaseDefinition);
|
|
168
170
|
const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
|
|
169
|
-
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, isClearableIfDisabled, as: asProp, variant: variantProps, size: sizeProps, hideLabel: hideLabelProps, ...rest } = props;
|
|
171
|
+
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, onValueCommit, isClearable: isClearableProps, isClearableIfDisabled, as: asProp, variant: variantProps, size: sizeProps, hideLabel: hideLabelProps, ...rest } = props;
|
|
170
172
|
const isClearable = isClearableProps ?? ui.input.isClearable;
|
|
171
173
|
const as = asProp ?? ui.input.as;
|
|
172
174
|
const variant = variantProps ?? ui.input.variant;
|
|
@@ -255,7 +257,8 @@ const NumberRangeInputBase = (props) => {
|
|
|
255
257
|
hoverProps,
|
|
256
258
|
onRangeSideChange: updateRange,
|
|
257
259
|
onRangeSideClear: clearRangeSide,
|
|
258
|
-
onBlur
|
|
260
|
+
onBlur,
|
|
261
|
+
onValueCommit
|
|
259
262
|
});
|
|
260
263
|
};
|
|
261
264
|
const NumberRangeInputInner = ({ renderStaticInput, isFormControlDisabled, ...props }) => {
|
|
@@ -330,7 +333,13 @@ const NumberRangeInputInner = ({ renderStaticInput, isFormControlDisabled, ...pr
|
|
|
330
333
|
...dataAttributeProps,
|
|
331
334
|
"data-rac": true
|
|
332
335
|
}), isClearable && (!isDisabled || props.isClearableIfDisabled === true) && /* @__PURE__ */ jsx(InputClear, {
|
|
333
|
-
onClear: () => {
|
|
336
|
+
onClear: () => {
|
|
337
|
+
props.onChange?.({
|
|
338
|
+
...staticValue,
|
|
339
|
+
min: null
|
|
340
|
+
});
|
|
341
|
+
props.onValueCommit?.();
|
|
342
|
+
},
|
|
334
343
|
show: staticValue.min !== null,
|
|
335
344
|
renderStatic: true
|
|
336
345
|
})]
|
|
@@ -360,7 +369,13 @@ const NumberRangeInputInner = ({ renderStaticInput, isFormControlDisabled, ...pr
|
|
|
360
369
|
...dataAttributeProps,
|
|
361
370
|
"data-rac": true
|
|
362
371
|
}), isClearable && (!isDisabled || props.isClearableIfDisabled === true) && /* @__PURE__ */ jsx(InputClear, {
|
|
363
|
-
onClear: () => {
|
|
372
|
+
onClear: () => {
|
|
373
|
+
props.onChange?.({
|
|
374
|
+
...staticValue,
|
|
375
|
+
max: null
|
|
376
|
+
});
|
|
377
|
+
props.onValueCommit?.();
|
|
378
|
+
},
|
|
364
379
|
show: staticValue.max !== null,
|
|
365
380
|
renderStatic: true
|
|
366
381
|
})]
|
|
@@ -386,6 +401,7 @@ const NumberRangeInputComponent = ({ renderStaticInput, ...props }) => {
|
|
|
386
401
|
value: field.value ?? EMPTY_RANGE,
|
|
387
402
|
onChange: field.onChange,
|
|
388
403
|
onBlur: field.onBlur,
|
|
404
|
+
onValueCommit: field.onBlur,
|
|
389
405
|
isDisabled: field.disabled || !!controlWithOptions._options?.disabled || props.isDisabled,
|
|
390
406
|
isFormControlDisabled: !!controlWithOptions._options?.disabled,
|
|
391
407
|
error: props.error ?? error?.message,
|