@povio/ui 2.3.0-rc.38 → 2.3.0-rc.39
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/DateTime/DateTimePicker/DateTimePicker.js +1 -5
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +40 -37
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +4 -2
- package/package.json +1 -1
|
@@ -149,9 +149,6 @@ var DateTimePickerBase = (props) => {
|
|
|
149
149
|
dialogState.setValue(currentValue);
|
|
150
150
|
calendarState.setFocusedDate(toCalendarDate(currentValue));
|
|
151
151
|
};
|
|
152
|
-
const onInputClear = () => {
|
|
153
|
-
onChange?.(null);
|
|
154
|
-
};
|
|
155
152
|
const onOpenChange = (isOpen) => {
|
|
156
153
|
state.toggle();
|
|
157
154
|
calendarState.setFocusedDate(state.value || today(effectiveTimeZone));
|
|
@@ -217,8 +214,7 @@ var DateTimePickerBase = (props) => {
|
|
|
217
214
|
timeZone: effectiveTimeZone,
|
|
218
215
|
isTimeOptional,
|
|
219
216
|
format,
|
|
220
|
-
fireBlurOnChange
|
|
221
|
-
onClear: onInputClear
|
|
217
|
+
fireBlurOnChange
|
|
222
218
|
}), (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(DateTimeDialog, {
|
|
223
219
|
footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
|
|
224
220
|
isDisabled,
|
|
@@ -12,6 +12,7 @@ export declare const DateSegmentItem: ({ segment, state, isDisabled, timePickerO
|
|
|
12
12
|
interface DateSegmentItemViewProps {
|
|
13
13
|
ref?: Ref<HTMLDivElement>;
|
|
14
14
|
segmentProps?: HTMLAttributes<HTMLDivElement>;
|
|
15
|
+
role?: HTMLAttributes<HTMLDivElement>["role"];
|
|
15
16
|
type?: DateSegment["type"];
|
|
16
17
|
text: ReactNode;
|
|
17
18
|
placeholder?: ReactNode;
|
|
@@ -21,5 +22,5 @@ interface DateSegmentItemViewProps {
|
|
|
21
22
|
timePickerOnly?: boolean;
|
|
22
23
|
hidePlaceholder?: boolean;
|
|
23
24
|
}
|
|
24
|
-
export declare const DateSegmentItemView: ({ ref, segmentProps, type, text, placeholder, isPlaceholder, isInputEmpty, isDisabled, timePickerOnly, hidePlaceholder, }: DateSegmentItemViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare const DateSegmentItemView: ({ ref, segmentProps, role, type, text, placeholder, isPlaceholder, isInputEmpty, isDisabled, timePickerOnly, hidePlaceholder, }: DateSegmentItemViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
26
|
export {};
|
|
@@ -55,57 +55,60 @@ var DateSegmentItem = (t0) => {
|
|
|
55
55
|
return t5;
|
|
56
56
|
};
|
|
57
57
|
var DateSegmentItemView = (t0) => {
|
|
58
|
-
const $ = c(
|
|
59
|
-
const { ref, segmentProps, type, text, placeholder, isPlaceholder, isInputEmpty, isDisabled, timePickerOnly, hidePlaceholder } = t0;
|
|
60
|
-
const t1 =
|
|
61
|
-
const t2 =
|
|
62
|
-
const t3 = !isDisabled &&
|
|
63
|
-
const t4 =
|
|
64
|
-
const t5 =
|
|
65
|
-
|
|
66
|
-
if ($[0] !== t1 || $[1] !== t2 || $[2] !== t3 || $[3] !== t4 || $[4] !== t5) {
|
|
67
|
-
t6 = clsx("box-content rounded-input-rounding-default", t1, t2, t3, "focus-within:outline-1 focus-within:outline-interactive-contained-primary-idle focus-within:outline-offset-1", t4, t5);
|
|
68
|
-
$[0] = t1;
|
|
69
|
-
$[1] = t2;
|
|
70
|
-
$[2] = t3;
|
|
71
|
-
$[3] = t4;
|
|
72
|
-
$[4] = t5;
|
|
73
|
-
$[5] = t6;
|
|
74
|
-
} else t6 = $[5];
|
|
58
|
+
const $ = c(18);
|
|
59
|
+
const { ref, segmentProps, role, type, text, placeholder, isPlaceholder, isInputEmpty, isDisabled, timePickerOnly, hidePlaceholder } = t0;
|
|
60
|
+
const t1 = role ?? segmentProps?.role;
|
|
61
|
+
const t2 = isDisabled && "text-interactive-text-secondary-disabled";
|
|
62
|
+
const t3 = !isDisabled && isInputEmpty && "text-text-default-3 group-focus-within:text-text-default-1";
|
|
63
|
+
const t4 = !isDisabled && !isInputEmpty && "text-text-default-1";
|
|
64
|
+
const t5 = type && (type === "hour" && !timePickerOnly || type === "dayPeriod") && "ml-1";
|
|
65
|
+
const t6 = hidePlaceholder && "opacity-0";
|
|
75
66
|
let t7;
|
|
67
|
+
if ($[0] !== t2 || $[1] !== t3 || $[2] !== t4 || $[3] !== t5 || $[4] !== t6) {
|
|
68
|
+
t7 = clsx("box-content rounded-input-rounding-default", t2, t3, t4, "focus-within:outline-1 focus-within:outline-interactive-contained-primary-idle focus-within:outline-offset-1", t5, t6);
|
|
69
|
+
$[0] = t2;
|
|
70
|
+
$[1] = t3;
|
|
71
|
+
$[2] = t4;
|
|
72
|
+
$[3] = t5;
|
|
73
|
+
$[4] = t6;
|
|
74
|
+
$[5] = t7;
|
|
75
|
+
} else t7 = $[5];
|
|
76
|
+
let t8;
|
|
76
77
|
if ($[6] !== isPlaceholder || $[7] !== placeholder) {
|
|
77
|
-
|
|
78
|
+
t8 = isPlaceholder && /* @__PURE__ */ jsx("span", {
|
|
78
79
|
"aria-hidden": "true",
|
|
79
80
|
className: "pointer-events-none",
|
|
80
81
|
children: placeholder
|
|
81
82
|
});
|
|
82
83
|
$[6] = isPlaceholder;
|
|
83
84
|
$[7] = placeholder;
|
|
84
|
-
$[8] =
|
|
85
|
-
} else
|
|
86
|
-
const
|
|
87
|
-
let t9;
|
|
88
|
-
if ($[9] !== t7 || $[10] !== t8) {
|
|
89
|
-
t9 = /* @__PURE__ */ jsxs(Fragment, { children: [t7, t8] });
|
|
90
|
-
$[9] = t7;
|
|
91
|
-
$[10] = t8;
|
|
92
|
-
$[11] = t9;
|
|
93
|
-
} else t9 = $[11];
|
|
85
|
+
$[8] = t8;
|
|
86
|
+
} else t8 = $[8];
|
|
87
|
+
const t9 = isPlaceholder ? "" : text;
|
|
94
88
|
let t10;
|
|
95
|
-
if ($[
|
|
96
|
-
t10 = /* @__PURE__ */
|
|
89
|
+
if ($[9] !== t8 || $[10] !== t9) {
|
|
90
|
+
t10 = /* @__PURE__ */ jsxs(Fragment, { children: [t8, t9] });
|
|
91
|
+
$[9] = t8;
|
|
92
|
+
$[10] = t9;
|
|
93
|
+
$[11] = t10;
|
|
94
|
+
} else t10 = $[11];
|
|
95
|
+
let t11;
|
|
96
|
+
if ($[12] !== ref || $[13] !== segmentProps || $[14] !== t1 || $[15] !== t10 || $[16] !== t7) {
|
|
97
|
+
t11 = /* @__PURE__ */ jsx("div", {
|
|
97
98
|
...segmentProps,
|
|
99
|
+
role: t1,
|
|
98
100
|
ref,
|
|
99
|
-
className:
|
|
100
|
-
children:
|
|
101
|
+
className: t7,
|
|
102
|
+
children: t10
|
|
101
103
|
});
|
|
102
104
|
$[12] = ref;
|
|
103
105
|
$[13] = segmentProps;
|
|
104
|
-
$[14] =
|
|
105
|
-
$[15] =
|
|
106
|
-
$[16] =
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
$[14] = t1;
|
|
107
|
+
$[15] = t10;
|
|
108
|
+
$[16] = t7;
|
|
109
|
+
$[17] = t11;
|
|
110
|
+
} else t11 = $[17];
|
|
111
|
+
return t11;
|
|
109
112
|
};
|
|
110
113
|
//#endregion
|
|
111
114
|
export { DateSegmentItem, DateSegmentItemView, getPlaceholder };
|
|
@@ -17,7 +17,8 @@ var getStaticCalendarDateTimeSegments = ({ value, locale, shouldForceLeadingZero
|
|
|
17
17
|
isPlaceholder: !hasValue,
|
|
18
18
|
isInputEmpty: !hasValue,
|
|
19
19
|
isDisabled,
|
|
20
|
-
hidePlaceholder
|
|
20
|
+
hidePlaceholder,
|
|
21
|
+
segmentRole: "spinbutton"
|
|
21
22
|
});
|
|
22
23
|
};
|
|
23
24
|
var getStaticDateRangeSegments = ({ start, end, locale, shouldForceLeadingZeros, isDisabled, hidePlaceholder }) => {
|
|
@@ -62,7 +63,8 @@ var renderStaticSegments = (value, options) => {
|
|
|
62
63
|
isInputEmpty: options.isInputEmpty,
|
|
63
64
|
isDisabled: options.isDisabled,
|
|
64
65
|
timePickerOnly: options.timePickerOnly,
|
|
65
|
-
hidePlaceholder: options.hidePlaceholder
|
|
66
|
+
hidePlaceholder: options.hidePlaceholder,
|
|
67
|
+
role: token.type === "literal" ? void 0 : options.segmentRole
|
|
66
68
|
}, index))
|
|
67
69
|
});
|
|
68
70
|
};
|