@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.
@@ -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: props.isDisabled || isLoading && !noDisableWhenLoading,
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
- onChange?.(val_0);
88
- dialogState.setValue(val_0);
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,4 @@
1
+ //#region src/components/inputs/DateTime/shared/datePickerValue.utils.ts
2
+ var normalizeDatePickerValue = (value) => value ?? null;
3
+ //#endregion
4
+ export { normalizeDatePickerValue };
@@ -92,6 +92,7 @@ var InputClearButton = (t0) => {
92
92
  label: t1,
93
93
  icon: X,
94
94
  onPress: onClear,
95
+ isDisabled: false,
95
96
  onMouseDown: _temp3,
96
97
  excludeFromTabOrder: true,
97
98
  style
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@povio/ui",
3
- "version": "3.4.0-rc.13",
3
+ "version": "3.4.0-rc.15",
4
4
  "type": "module",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",