@povio/ui 3.4.0-rc.13 → 3.4.0-rc.15
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/buttons/Button/Button.js +1 -1
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +2 -1
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +4 -2
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +2 -1
- package/dist/components/inputs/DateTime/shared/datePickerValue.utils.d.ts +1 -0
- package/dist/components/inputs/DateTime/shared/datePickerValue.utils.js +4 -0
- package/dist/components/inputs/DateTime/shared/datePickerValue.utils.spec.d.ts +1 -0
- package/dist/components/inputs/shared/InputClear.js +1 -0
- package/package.json +1 -1
|
@@ -25,7 +25,7 @@ var Button$1 = ({ icon: Icon, iconPosition, children, isLoading, className, link
|
|
|
25
25
|
return /* @__PURE__ */ jsx(Component, {
|
|
26
26
|
...props,
|
|
27
27
|
...link,
|
|
28
|
-
isDisabled:
|
|
28
|
+
isDisabled: isLoading && !noDisableWhenLoading ? true : props.isDisabled,
|
|
29
29
|
className: clsx(buttonCva({
|
|
30
30
|
...props,
|
|
31
31
|
variant,
|
|
@@ -7,6 +7,7 @@ import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
|
|
|
7
7
|
import { datePickerInputContentRowDefinition } from "../shared/datePickerInput.cva.js";
|
|
8
8
|
import { renderDatePickerTodayIcon } from "../shared/datePickerTodayIcon.js";
|
|
9
9
|
import { DatePickerInput } from "../shared/DatePickerInput.js";
|
|
10
|
+
import { normalizeDatePickerValue } from "../shared/datePickerValue.utils.js";
|
|
10
11
|
import { DateTimeDialog } from "../shared/DateTimeDialog.js";
|
|
11
12
|
import { DateTimeDialogFooter } from "../shared/DateTimeDialogFooter.js";
|
|
12
13
|
import { getStaticCalendarDateSegments, getStaticDateTimeFocusTarget } from "../shared/staticDateTimeSegments.js";
|
|
@@ -88,7 +89,7 @@ var DatePickerBase = (props) => {
|
|
|
88
89
|
shouldForceLeadingZeros,
|
|
89
90
|
value: normalizedValue,
|
|
90
91
|
onChange: (val_0) => {
|
|
91
|
-
let normalizedValue_0 = val_0;
|
|
92
|
+
let normalizedValue_0 = normalizeDatePickerValue(val_0);
|
|
92
93
|
if (val_0) normalizedValue_0 = normalizeByGranularity(val_0);
|
|
93
94
|
if (normalizedValue_0 && (rest.minValue && normalizedValue_0 < rest?.minValue || rest?.maxValue && normalizedValue_0 > rest?.maxValue)) {
|
|
94
95
|
state.setValue(state.value);
|
|
@@ -7,6 +7,7 @@ import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
|
|
|
7
7
|
import { datePickerInputContentRowDefinition } from "../shared/datePickerInput.cva.js";
|
|
8
8
|
import { renderDatePickerTodayIcon } from "../shared/datePickerTodayIcon.js";
|
|
9
9
|
import { DatePickerInput } from "../shared/DatePickerInput.js";
|
|
10
|
+
import { normalizeDatePickerValue } from "../shared/datePickerValue.utils.js";
|
|
10
11
|
import { DateTimeDialog } from "../shared/DateTimeDialog.js";
|
|
11
12
|
import { DateTimeDialogFooter } from "../shared/DateTimeDialogFooter.js";
|
|
12
13
|
import { getStaticCalendarDateTimeSegments, getStaticDateTimeFocusTarget } from "../shared/staticDateTimeSegments.js";
|
|
@@ -84,8 +85,9 @@ var DateTimePickerBase = (props) => {
|
|
|
84
85
|
shouldForceLeadingZeros,
|
|
85
86
|
value: normalizedValue,
|
|
86
87
|
onChange: (val_0) => {
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
const normalizedValue_0 = normalizeDatePickerValue(val_0);
|
|
89
|
+
onChange?.(normalizedValue_0);
|
|
90
|
+
dialogState.setValue(normalizedValue_0);
|
|
89
91
|
calendarState.setFocusedDate(val_0 || today(effectiveTimeZone));
|
|
90
92
|
},
|
|
91
93
|
shouldCloseOnSelect: false,
|
|
@@ -3,6 +3,7 @@ import { FieldController } from "../../shared/form.binding.js";
|
|
|
3
3
|
import { FormField } from "../../FormField/FormField.js";
|
|
4
4
|
import { TimePickerForm } from "../shared/TimePickerForm.js";
|
|
5
5
|
import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
|
|
6
|
+
import { normalizeDatePickerValue } from "../shared/datePickerValue.utils.js";
|
|
6
7
|
import { DateTimeDialog } from "../shared/DateTimeDialog.js";
|
|
7
8
|
import { DateTimeDialogFooter } from "../shared/DateTimeDialogFooter.js";
|
|
8
9
|
import { getStaticDateTimeFocusTarget, getStaticTimeSegments } from "../shared/staticDateTimeSegments.js";
|
|
@@ -181,7 +182,7 @@ var TimePickerBase = (props) => {
|
|
|
181
182
|
let t5;
|
|
182
183
|
if ($[48] !== onChange) {
|
|
183
184
|
t5 = (val_0) => {
|
|
184
|
-
onChange?.(val_0);
|
|
185
|
+
onChange?.(normalizeDatePickerValue(val_0));
|
|
185
186
|
};
|
|
186
187
|
$[48] = onChange;
|
|
187
188
|
$[49] = t5;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const normalizeDatePickerValue: <T>(value: T | null | undefined) => T | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|