@povio/ui 2.3.0-rc.39 → 2.3.0-rc.40
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.js +50 -45
- package/dist/components/inputs/Checkbox/checkbox.cva.js +2 -0
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +25 -6
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +31 -7
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +18 -5
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +97 -68
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +131 -136
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +1 -1
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +39 -37
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +9 -1
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +43 -7
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +16 -8
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +43 -40
- package/dist/components/inputs/File/InputUpload.js +1 -1
- package/dist/components/inputs/File/shared/InputUploadFilled.js +1 -1
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +103 -97
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +2 -2
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +52 -29
- package/dist/components/inputs/Input/TextArea/TextArea.js +2 -2
- package/dist/components/inputs/Input/TextInput/TextInput.js +2 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.js +29 -43
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +1 -0
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +2 -2
- package/dist/components/inputs/Selection/Select/QuerySelect.js +45 -63
- package/dist/components/inputs/Selection/Select/Select.js +1 -0
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +54 -53
- package/dist/components/inputs/Selection/shared/SelectMobile.js +3 -2
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +1 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +12 -1
- package/dist/components/inputs/Selection/shared/select.context.js +3 -1
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +1 -0
- package/dist/components/inputs/Skeleton/InputFrame.js +100 -92
- package/dist/components/inputs/Slider/Slider.d.ts +2 -1
- package/dist/components/inputs/Slider/Slider.js +170 -156
- package/dist/components/inputs/TextEditor/TextEditor.js +1 -1
- package/dist/components/inputs/Toggle/Toggle.js +70 -64
- package/dist/components/inputs/Toggle/toggle.cva.js +2 -1
- package/dist/components/inputs/shared/InputClear.js +71 -61
- package/dist/components/inputs/shared/input.cva.js +22 -10
- package/dist/components/inputs/shared/label.cva.js +2 -2
- package/dist/components/overlays/BottomSheet/BottomSheet.js +26 -2
- package/dist/config/uiConfig.context.d.ts +3 -1
- package/dist/config/uiConfig.context.js +2 -1
- package/dist/tw-ui-plugin.js +6 -1
- package/dist/utils/date-time.utils.d.ts +5 -0
- package/dist/utils/date-time.utils.js +10 -0
- package/dist/utils/dom.utils.js +1 -1
- package/package.json +1 -1
|
@@ -12,7 +12,7 @@ import { mergeRefs } from "@react-aria/utils";
|
|
|
12
12
|
import { Controller } from "react-hook-form";
|
|
13
13
|
//#region src/components/inputs/Checkbox/Checkbox.tsx
|
|
14
14
|
var CheckboxBase = (props) => {
|
|
15
|
-
const $ = c(
|
|
15
|
+
const $ = c(48);
|
|
16
16
|
const ui = UIConfig.useConfig();
|
|
17
17
|
const checkboxTypographyMap = UIStyle.useMapper("checkbox.typography", checkboxTypography);
|
|
18
18
|
const checkboxContentClassNameMap = UIStyle.useMapper("checkbox.contentClassName", checkboxContentClassName);
|
|
@@ -78,28 +78,29 @@ var CheckboxBase = (props) => {
|
|
|
78
78
|
} else t1 = $[17];
|
|
79
79
|
const handleChange = t1;
|
|
80
80
|
const t2 = !!error;
|
|
81
|
-
const t3 =
|
|
82
|
-
const t4 =
|
|
83
|
-
const t5 = props.
|
|
84
|
-
|
|
81
|
+
const t3 = hideLabel && typeof children === "string" ? children : void 0;
|
|
82
|
+
const t4 = error || void 0;
|
|
83
|
+
const t5 = props.isDirty || void 0;
|
|
84
|
+
const t6 = props.isRequired || void 0;
|
|
85
|
+
let t7;
|
|
85
86
|
if ($[18] !== className) {
|
|
86
|
-
|
|
87
|
+
t7 = clsx("relative", checkboxIndicatorClass, className);
|
|
87
88
|
$[18] = className;
|
|
88
|
-
$[19] =
|
|
89
|
-
} else
|
|
90
|
-
let
|
|
89
|
+
$[19] = t7;
|
|
90
|
+
} else t7 = $[19];
|
|
91
|
+
let t8;
|
|
91
92
|
if ($[20] !== rest || $[21] !== variant) {
|
|
92
|
-
|
|
93
|
+
t8 = /* @__PURE__ */ jsx(CheckboxCheckmark, {
|
|
93
94
|
variant,
|
|
94
95
|
...rest
|
|
95
96
|
});
|
|
96
97
|
$[20] = rest;
|
|
97
98
|
$[21] = variant;
|
|
98
|
-
$[22] =
|
|
99
|
-
} else
|
|
100
|
-
let
|
|
99
|
+
$[22] = t8;
|
|
100
|
+
} else t8 = $[22];
|
|
101
|
+
let t9;
|
|
101
102
|
if ($[23] !== checkboxContentClassNameMap || $[24] !== checkboxTypographyMap || $[25] !== children || $[26] !== hideLabel || $[27] !== rest || $[28] !== variant) {
|
|
102
|
-
|
|
103
|
+
t9 = !hideLabel && /* @__PURE__ */ jsx(CheckContent, {
|
|
103
104
|
typography: checkboxTypographyMap({
|
|
104
105
|
variant,
|
|
105
106
|
...rest
|
|
@@ -116,47 +117,51 @@ var CheckboxBase = (props) => {
|
|
|
116
117
|
$[26] = hideLabel;
|
|
117
118
|
$[27] = rest;
|
|
118
119
|
$[28] = variant;
|
|
119
|
-
$[29] =
|
|
120
|
-
} else
|
|
121
|
-
let
|
|
122
|
-
if ($[30] !== handleChange || $[31] !== isDisabled || $[32] !==
|
|
123
|
-
|
|
120
|
+
$[29] = t9;
|
|
121
|
+
} else t9 = $[29];
|
|
122
|
+
let t10;
|
|
123
|
+
if ($[30] !== handleChange || $[31] !== isDisabled || $[32] !== onBlur || $[33] !== rest || $[34] !== t2 || $[35] !== t3 || $[36] !== t4 || $[37] !== t5 || $[38] !== t6 || $[39] !== t7 || $[40] !== t8 || $[41] !== t9) {
|
|
124
|
+
t10 = /* @__PURE__ */ jsxs(Checkbox, {
|
|
124
125
|
...rest,
|
|
125
126
|
isDisabled,
|
|
126
127
|
isInvalid: t2,
|
|
127
|
-
"aria-
|
|
128
|
-
"
|
|
129
|
-
"data-is-
|
|
128
|
+
"aria-label": t3,
|
|
129
|
+
"aria-errormessage": t4,
|
|
130
|
+
"data-is-dirty": t5,
|
|
131
|
+
"data-is-required": t6,
|
|
130
132
|
onChange: handleChange,
|
|
131
|
-
|
|
132
|
-
|
|
133
|
+
onBlur,
|
|
134
|
+
className: t7,
|
|
135
|
+
children: [t8, t9]
|
|
133
136
|
});
|
|
134
137
|
$[30] = handleChange;
|
|
135
138
|
$[31] = isDisabled;
|
|
136
|
-
$[32] =
|
|
137
|
-
$[33] =
|
|
138
|
-
$[34] =
|
|
139
|
-
$[35] =
|
|
140
|
-
$[36] =
|
|
141
|
-
$[37] =
|
|
142
|
-
$[38] =
|
|
143
|
-
$[39] =
|
|
144
|
-
$[40] =
|
|
145
|
-
|
|
146
|
-
let t10;
|
|
147
|
-
if ($[41] !== formFieldErrorProps) {
|
|
148
|
-
t10 = /* @__PURE__ */ jsx(FormFieldError, { ...formFieldErrorProps });
|
|
149
|
-
$[41] = formFieldErrorProps;
|
|
139
|
+
$[32] = onBlur;
|
|
140
|
+
$[33] = rest;
|
|
141
|
+
$[34] = t2;
|
|
142
|
+
$[35] = t3;
|
|
143
|
+
$[36] = t4;
|
|
144
|
+
$[37] = t5;
|
|
145
|
+
$[38] = t6;
|
|
146
|
+
$[39] = t7;
|
|
147
|
+
$[40] = t8;
|
|
148
|
+
$[41] = t9;
|
|
150
149
|
$[42] = t10;
|
|
151
150
|
} else t10 = $[42];
|
|
152
151
|
let t11;
|
|
153
|
-
if ($[43] !==
|
|
154
|
-
t11 = /* @__PURE__ */
|
|
155
|
-
$[43] =
|
|
156
|
-
$[44] =
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
152
|
+
if ($[43] !== formFieldErrorProps) {
|
|
153
|
+
t11 = /* @__PURE__ */ jsx(FormFieldError, { ...formFieldErrorProps });
|
|
154
|
+
$[43] = formFieldErrorProps;
|
|
155
|
+
$[44] = t11;
|
|
156
|
+
} else t11 = $[44];
|
|
157
|
+
let t12;
|
|
158
|
+
if ($[45] !== t10 || $[46] !== t11) {
|
|
159
|
+
t12 = /* @__PURE__ */ jsxs(Fragment, { children: [t10, t11] });
|
|
160
|
+
$[45] = t10;
|
|
161
|
+
$[46] = t11;
|
|
162
|
+
$[47] = t12;
|
|
163
|
+
} else t12 = $[47];
|
|
164
|
+
return t12;
|
|
160
165
|
};
|
|
161
166
|
var Checkbox$1 = (props) => {
|
|
162
167
|
const $ = c(15);
|
|
@@ -22,6 +22,8 @@ var checkbox = cva([
|
|
|
22
22
|
"group-selected:group-hover:border-interactive-contained-primary-hover",
|
|
23
23
|
"group-selected:group-pressed:bg-interactive-contained-primary-pressed",
|
|
24
24
|
"group-selected:group-pressed:border-interactive-contained-primary-pressed",
|
|
25
|
+
"group-selected:group-disabled:bg-interactive-contained-primary-disabled",
|
|
26
|
+
"group-selected:group-disabled:border-interactive-contained-primary-disabled",
|
|
25
27
|
"group-indeterminate:border-interactive-contained-primary-idle",
|
|
26
28
|
"group-indeterminate:bg-interactive-contained-primary-idle",
|
|
27
29
|
"group-indeterminate:group-hover:bg-interactive-contained-primary-hover",
|
|
@@ -188,13 +188,19 @@ var DatePickerBase = (props) => {
|
|
|
188
188
|
...formFieldProps,
|
|
189
189
|
as,
|
|
190
190
|
labelProps,
|
|
191
|
-
className: clsx("relative inline-flex w-full flex-col text-left", className),
|
|
191
|
+
className: clsx("group relative inline-flex w-full flex-col text-left", className),
|
|
192
192
|
tabIndex: as === "inline" ? -1 : void 0,
|
|
193
193
|
children: [/* @__PURE__ */ jsx(DatePickerInput, {
|
|
194
194
|
ref: mergeRefs(ref, datePickerInputRef),
|
|
195
195
|
as,
|
|
196
196
|
groupProps,
|
|
197
|
-
fieldProps
|
|
197
|
+
fieldProps: {
|
|
198
|
+
...fieldProps,
|
|
199
|
+
onBlur: (event) => {
|
|
200
|
+
fieldProps.onBlur?.(event);
|
|
201
|
+
handleBlur(state.value);
|
|
202
|
+
}
|
|
203
|
+
},
|
|
198
204
|
fieldValue: normalizedValue,
|
|
199
205
|
isValueControlled: true,
|
|
200
206
|
hasValue: normalizedValue != null,
|
|
@@ -337,7 +343,11 @@ var DatePickerInner = (t0) => {
|
|
|
337
343
|
const todayIcon = props.todayIcon ?? ui.dateInput.todayIcon;
|
|
338
344
|
const todayIconButtonSize = props.todayIconButtonSize ?? ui.dateInput.todayIconButtonSize;
|
|
339
345
|
const todayIconPlacement = props.todayIconPlacement ?? ui.dateInput.todayIconPlacement;
|
|
340
|
-
const staticTodayIcon = renderDatePickerTodayIcon(todayIcon,
|
|
346
|
+
const staticTodayIcon = renderDatePickerTodayIcon(todayIcon, {
|
|
347
|
+
isDisabled,
|
|
348
|
+
renderStatic: true,
|
|
349
|
+
size: todayIconButtonSize
|
|
350
|
+
});
|
|
341
351
|
const disableManualEntry = props.disableManualEntry ?? ui.dateInput.disableManualEntry;
|
|
342
352
|
const showDropdown = !props.disableDropdown || disableManualEntry;
|
|
343
353
|
const staticSegments = getStaticCalendarDateSegments({
|
|
@@ -345,12 +355,15 @@ var DatePickerInner = (t0) => {
|
|
|
345
355
|
locale,
|
|
346
356
|
shouldForceLeadingZeros,
|
|
347
357
|
isDisabled,
|
|
348
|
-
hidePlaceholder: as === "floating" && !dateValue
|
|
358
|
+
hidePlaceholder: as === "floating" && !dateValue,
|
|
359
|
+
disableManualEntry,
|
|
360
|
+
placeholder: props.placeholder,
|
|
361
|
+
dateGranularity: granularity
|
|
349
362
|
});
|
|
350
363
|
return /* @__PURE__ */ jsx(InputFrame, {
|
|
351
364
|
...props,
|
|
352
365
|
isDisabled,
|
|
353
|
-
className: clsx("relative inline-flex w-full flex-col text-left", props.className),
|
|
366
|
+
className: clsx("group relative inline-flex w-full flex-col text-left", props.className),
|
|
354
367
|
inputClassName: clsx("min-w-input-width-min-width", props.inputClassName),
|
|
355
368
|
contentClassName: "pr-0!",
|
|
356
369
|
contentWrapperClassName: datePickerInputContentRowCva({ size }),
|
|
@@ -369,10 +382,15 @@ var DatePickerInner = (t0) => {
|
|
|
369
382
|
onStaticInteract: renderRealInput,
|
|
370
383
|
actionContent: staticTodayIcon,
|
|
371
384
|
actionContentPlacement: todayIconPlacement === "fieldLabel" ? "content-row" : "content-wrapper",
|
|
385
|
+
showClear: dateValue != null,
|
|
372
386
|
wrapContentAndTrailing: true,
|
|
373
387
|
contentAndTrailingClassName: "gap-2!",
|
|
374
388
|
trailingClassName: "py-0! pl-0!",
|
|
375
|
-
|
|
389
|
+
action: showDropdown ? {
|
|
390
|
+
icon: ui.dateInput.calendarIcon,
|
|
391
|
+
onClick: _temp2,
|
|
392
|
+
altText: ""
|
|
393
|
+
} : void 0,
|
|
376
394
|
children: staticSegments
|
|
377
395
|
});
|
|
378
396
|
}
|
|
@@ -522,5 +540,6 @@ function _temp(input) {
|
|
|
522
540
|
const container = input.getContainer?.() ?? input;
|
|
523
541
|
return container instanceof HTMLElement ? container.querySelector("input, button, [tabindex]:not([tabindex='-1'])") : null;
|
|
524
542
|
}
|
|
543
|
+
function _temp2() {}
|
|
525
544
|
//#endregion
|
|
526
545
|
export { DatePicker };
|
|
@@ -494,14 +494,26 @@ var DateRangePickerBase = (props) => {
|
|
|
494
494
|
...formFieldProps,
|
|
495
495
|
as,
|
|
496
496
|
labelProps,
|
|
497
|
-
className: clsx("relative inline-flex w-full flex-col text-left", className),
|
|
497
|
+
className: clsx("group relative inline-flex w-full flex-col text-left", className),
|
|
498
498
|
tabIndex: as === "inline" ? -1 : void 0,
|
|
499
499
|
children: [/* @__PURE__ */ jsx(DatePickerInput, {
|
|
500
500
|
ref: mergeRefs(ref, datePickerInputRef),
|
|
501
501
|
as,
|
|
502
502
|
groupProps,
|
|
503
|
-
fieldProps:
|
|
504
|
-
|
|
503
|
+
fieldProps: {
|
|
504
|
+
...startFieldProps,
|
|
505
|
+
onBlur: (event_0) => {
|
|
506
|
+
startFieldProps.onBlur?.(event_0);
|
|
507
|
+
handleBlur(state.value);
|
|
508
|
+
}
|
|
509
|
+
},
|
|
510
|
+
endFieldProps: {
|
|
511
|
+
...endFieldProps,
|
|
512
|
+
onBlur: (event_1) => {
|
|
513
|
+
endFieldProps.onBlur?.(event_1);
|
|
514
|
+
handleBlur(state.value);
|
|
515
|
+
}
|
|
516
|
+
},
|
|
505
517
|
fieldValue: normalizedValue?.start ?? null,
|
|
506
518
|
endFieldValue: normalizedValue?.end ?? null,
|
|
507
519
|
isValueControlled: true,
|
|
@@ -679,7 +691,11 @@ var DateRangePickerInner = (t0) => {
|
|
|
679
691
|
const todayIcon = props.todayIcon ?? ui.dateInput.todayIcon;
|
|
680
692
|
const todayIconButtonSize = props.todayIconButtonSize ?? ui.dateInput.todayIconButtonSize;
|
|
681
693
|
const todayIconPlacement = props.todayIconPlacement ?? ui.dateInput.todayIconPlacement;
|
|
682
|
-
const staticTodayIcon = renderDatePickerTodayIcon(todayIcon,
|
|
694
|
+
const staticTodayIcon = renderDatePickerTodayIcon(todayIcon, {
|
|
695
|
+
isDisabled,
|
|
696
|
+
renderStatic: true,
|
|
697
|
+
size: todayIconButtonSize
|
|
698
|
+
});
|
|
683
699
|
const disableManualEntry = props.disableManualEntry ?? ui.dateInput.disableManualEntry;
|
|
684
700
|
const showDropdown = !props.disableDropdown || disableManualEntry;
|
|
685
701
|
const staticSegments = getStaticDateRangeSegments({
|
|
@@ -688,12 +704,14 @@ var DateRangePickerInner = (t0) => {
|
|
|
688
704
|
locale,
|
|
689
705
|
shouldForceLeadingZeros,
|
|
690
706
|
isDisabled,
|
|
691
|
-
hidePlaceholder: as === "floating" && !hasProvidedRangeValue
|
|
707
|
+
hidePlaceholder: as === "floating" && !hasProvidedRangeValue,
|
|
708
|
+
disableManualEntry,
|
|
709
|
+
placeholder: props.placeholder
|
|
692
710
|
});
|
|
693
711
|
return /* @__PURE__ */ jsx(InputFrame, {
|
|
694
712
|
...props,
|
|
695
713
|
isDisabled,
|
|
696
|
-
className: clsx("relative inline-flex w-full flex-col text-left", props.className),
|
|
714
|
+
className: clsx("group relative inline-flex w-full flex-col text-left", props.className),
|
|
697
715
|
inputClassName: clsx("min-w-input-width-min-width", props.inputClassName),
|
|
698
716
|
contentClassName: "pr-0!",
|
|
699
717
|
contentWrapperClassName: datePickerInputContentRowCva({ size }),
|
|
@@ -712,10 +730,15 @@ var DateRangePickerInner = (t0) => {
|
|
|
712
730
|
onStaticInteract: renderRealInput,
|
|
713
731
|
actionContent: staticTodayIcon,
|
|
714
732
|
actionContentPlacement: todayIconPlacement === "fieldLabel" ? "content-row" : "content-wrapper",
|
|
733
|
+
showClear: hasProvidedRangeValue,
|
|
715
734
|
wrapContentAndTrailing: true,
|
|
716
735
|
contentAndTrailingClassName: "gap-2!",
|
|
717
736
|
trailingClassName: "py-0! pl-0!",
|
|
718
|
-
|
|
737
|
+
action: showDropdown ? {
|
|
738
|
+
icon: ui.dateInput.calendarIcon,
|
|
739
|
+
onClick: _temp2,
|
|
740
|
+
altText: ""
|
|
741
|
+
} : void 0,
|
|
719
742
|
children: staticSegments
|
|
720
743
|
});
|
|
721
744
|
}
|
|
@@ -855,5 +878,6 @@ function _temp(input) {
|
|
|
855
878
|
const container = input.getContainer?.() ?? input;
|
|
856
879
|
return container instanceof HTMLElement ? container.querySelector("input, button, [tabindex]:not([tabindex='-1'])") : null;
|
|
857
880
|
}
|
|
881
|
+
function _temp2() {}
|
|
858
882
|
//#endregion
|
|
859
883
|
export { DateRangePicker };
|
|
@@ -176,7 +176,7 @@ var DateTimePickerBase = (props) => {
|
|
|
176
176
|
...formFieldProps,
|
|
177
177
|
as,
|
|
178
178
|
labelProps,
|
|
179
|
-
className: "relative inline-flex w-full flex-col text-left",
|
|
179
|
+
className: "group relative inline-flex w-full flex-col text-left",
|
|
180
180
|
tabIndex: as === "inline" ? -1 : void 0,
|
|
181
181
|
children: [/* @__PURE__ */ jsx(DatePickerInput, {
|
|
182
182
|
ref: mergeRefs(ref, datePickerInputRef),
|
|
@@ -186,6 +186,7 @@ var DateTimePickerBase = (props) => {
|
|
|
186
186
|
...fieldProps,
|
|
187
187
|
onBlur: (e_0) => {
|
|
188
188
|
fieldProps.onBlur?.(e_0);
|
|
189
|
+
handleBlur(state.value);
|
|
189
190
|
onInputBlur(e_0);
|
|
190
191
|
}
|
|
191
192
|
},
|
|
@@ -267,7 +268,11 @@ var DateTimePickerInner = (t0) => {
|
|
|
267
268
|
const todayIcon = props.todayIcon ?? ui.dateInput.todayIcon;
|
|
268
269
|
const todayIconButtonSize = props.todayIconButtonSize ?? ui.dateInput.todayIconButtonSize;
|
|
269
270
|
const todayIconPlacement = props.todayIconPlacement ?? ui.dateInput.todayIconPlacement;
|
|
270
|
-
const staticTodayIcon = renderDatePickerTodayIcon(todayIcon,
|
|
271
|
+
const staticTodayIcon = renderDatePickerTodayIcon(todayIcon, {
|
|
272
|
+
isDisabled,
|
|
273
|
+
renderStatic: true,
|
|
274
|
+
size: todayIconButtonSize
|
|
275
|
+
});
|
|
271
276
|
const disableManualEntry = props.disableManualEntry ?? ui.dateInput.disableManualEntry;
|
|
272
277
|
const showDropdown = !props.disableDropdown || disableManualEntry;
|
|
273
278
|
const staticSegments = getStaticCalendarDateTimeSegments({
|
|
@@ -275,12 +280,14 @@ var DateTimePickerInner = (t0) => {
|
|
|
275
280
|
locale,
|
|
276
281
|
shouldForceLeadingZeros,
|
|
277
282
|
isDisabled,
|
|
278
|
-
hidePlaceholder: as === "floating" && !dateTimeValue
|
|
283
|
+
hidePlaceholder: as === "floating" && !dateTimeValue,
|
|
284
|
+
disableManualEntry,
|
|
285
|
+
placeholder: props.placeholder
|
|
279
286
|
});
|
|
280
287
|
return /* @__PURE__ */ jsx(InputFrame, {
|
|
281
288
|
...props,
|
|
282
289
|
isDisabled,
|
|
283
|
-
className: clsx("relative inline-flex w-full flex-col text-left", props.className),
|
|
290
|
+
className: clsx("group relative inline-flex w-full flex-col text-left", props.className),
|
|
284
291
|
inputClassName: clsx("min-w-input-width-min-width", props.inputClassName),
|
|
285
292
|
contentClassName: "pr-0!",
|
|
286
293
|
contentWrapperClassName: datePickerInputContentRowCva({ size }),
|
|
@@ -299,10 +306,15 @@ var DateTimePickerInner = (t0) => {
|
|
|
299
306
|
onStaticInteract: renderRealInput,
|
|
300
307
|
actionContent: staticTodayIcon,
|
|
301
308
|
actionContentPlacement: todayIconPlacement === "fieldLabel" ? "content-row" : "content-wrapper",
|
|
309
|
+
showClear: dateTimeValue != null,
|
|
302
310
|
wrapContentAndTrailing: true,
|
|
303
311
|
contentAndTrailingClassName: "gap-2!",
|
|
304
312
|
trailingClassName: "py-0! pl-0!",
|
|
305
|
-
|
|
313
|
+
action: showDropdown ? {
|
|
314
|
+
icon: ui.dateInput.dateTimeIcon,
|
|
315
|
+
onClick: _temp4,
|
|
316
|
+
altText: ""
|
|
317
|
+
} : void 0,
|
|
306
318
|
children: staticSegments
|
|
307
319
|
});
|
|
308
320
|
}
|
|
@@ -434,5 +446,6 @@ function _temp3(isoString) {
|
|
|
434
446
|
if (isoString == null) return null;
|
|
435
447
|
return DateTimeUtils.fromUTCISOToCalendarDateTime(isoString, "UTC");
|
|
436
448
|
}
|
|
449
|
+
function _temp4() {}
|
|
437
450
|
//#endregion
|
|
438
451
|
export { DateTimePicker };
|
|
@@ -22,7 +22,7 @@ import { DateTime } from "luxon";
|
|
|
22
22
|
import { useTimeFieldState } from "react-stately";
|
|
23
23
|
//#region src/components/inputs/DateTime/TimePicker/TimePicker.tsx
|
|
24
24
|
var TimePickerBase = (props) => {
|
|
25
|
-
const $ = c(
|
|
25
|
+
const $ = c(143);
|
|
26
26
|
const ui = UIConfig.useConfig();
|
|
27
27
|
let asProp;
|
|
28
28
|
let className;
|
|
@@ -318,7 +318,7 @@ var TimePickerBase = (props) => {
|
|
|
318
318
|
const t17 = as === "inline" ? -1 : void 0;
|
|
319
319
|
let t18;
|
|
320
320
|
if ($[90] !== className) {
|
|
321
|
-
t18 = clsx("relative inline-flex w-full flex-col text-left", className);
|
|
321
|
+
t18 = clsx("group relative inline-flex w-full flex-col text-left", className);
|
|
322
322
|
$[90] = className;
|
|
323
323
|
$[91] = t18;
|
|
324
324
|
} else t18 = $[91];
|
|
@@ -329,19 +329,40 @@ var TimePickerBase = (props) => {
|
|
|
329
329
|
$[92] = ref;
|
|
330
330
|
$[93] = t20;
|
|
331
331
|
} else t20 = $[93];
|
|
332
|
-
|
|
332
|
+
let t21;
|
|
333
|
+
if ($[94] !== fieldProps || $[95] !== handleBlur || $[96] !== state.value) {
|
|
334
|
+
t21 = (event) => {
|
|
335
|
+
fieldProps.onBlur?.(event);
|
|
336
|
+
handleBlur(state.value);
|
|
337
|
+
};
|
|
338
|
+
$[94] = fieldProps;
|
|
339
|
+
$[95] = handleBlur;
|
|
340
|
+
$[96] = state.value;
|
|
341
|
+
$[97] = t21;
|
|
342
|
+
} else t21 = $[97];
|
|
333
343
|
let t22;
|
|
334
|
-
if ($[
|
|
335
|
-
t22 =
|
|
344
|
+
if ($[98] !== fieldProps || $[99] !== t21) {
|
|
345
|
+
t22 = {
|
|
346
|
+
...fieldProps,
|
|
347
|
+
onBlur: t21
|
|
348
|
+
};
|
|
349
|
+
$[98] = fieldProps;
|
|
350
|
+
$[99] = t21;
|
|
351
|
+
$[100] = t22;
|
|
352
|
+
} else t22 = $[100];
|
|
353
|
+
const t23 = !!error;
|
|
354
|
+
let t24;
|
|
355
|
+
if ($[101] !== as || $[102] !== disableDropdown || $[103] !== disableManualEntry || $[104] !== fireBlurOnChange || $[105] !== headerProps || $[106] !== inputClassName || $[107] !== isClearable || $[108] !== isDirty || $[109] !== isDisabled || $[110] !== isRequired || $[111] !== onInputClear || $[112] !== onOpen || $[113] !== placeholder || $[114] !== size || $[115] !== state || $[116] !== t20 || $[117] !== t22 || $[118] !== t23 || $[119] !== variant) {
|
|
356
|
+
t24 = /* @__PURE__ */ jsx(TimePickerInput, {
|
|
336
357
|
ref: t20,
|
|
337
358
|
as,
|
|
338
|
-
fieldProps,
|
|
359
|
+
fieldProps: t22,
|
|
339
360
|
state,
|
|
340
361
|
onPress: onOpen,
|
|
341
362
|
isDisabled,
|
|
342
363
|
isDirty,
|
|
343
364
|
isRequired,
|
|
344
|
-
isInvalid:
|
|
365
|
+
isInvalid: t23,
|
|
345
366
|
disableDropdown,
|
|
346
367
|
variant,
|
|
347
368
|
size,
|
|
@@ -353,30 +374,30 @@ var TimePickerBase = (props) => {
|
|
|
353
374
|
onClear: onInputClear,
|
|
354
375
|
fireBlurOnChange
|
|
355
376
|
});
|
|
356
|
-
$[
|
|
357
|
-
$[
|
|
358
|
-
$[
|
|
359
|
-
$[
|
|
360
|
-
$[
|
|
361
|
-
$[
|
|
362
|
-
$[
|
|
363
|
-
$[
|
|
364
|
-
$[
|
|
365
|
-
$[
|
|
366
|
-
$[
|
|
367
|
-
$[
|
|
368
|
-
$[
|
|
369
|
-
$[
|
|
370
|
-
$[
|
|
371
|
-
$[
|
|
372
|
-
$[
|
|
373
|
-
$[
|
|
374
|
-
$[
|
|
375
|
-
$[
|
|
376
|
-
} else
|
|
377
|
-
let
|
|
378
|
-
if ($[
|
|
379
|
-
|
|
377
|
+
$[101] = as;
|
|
378
|
+
$[102] = disableDropdown;
|
|
379
|
+
$[103] = disableManualEntry;
|
|
380
|
+
$[104] = fireBlurOnChange;
|
|
381
|
+
$[105] = headerProps;
|
|
382
|
+
$[106] = inputClassName;
|
|
383
|
+
$[107] = isClearable;
|
|
384
|
+
$[108] = isDirty;
|
|
385
|
+
$[109] = isDisabled;
|
|
386
|
+
$[110] = isRequired;
|
|
387
|
+
$[111] = onInputClear;
|
|
388
|
+
$[112] = onOpen;
|
|
389
|
+
$[113] = placeholder;
|
|
390
|
+
$[114] = size;
|
|
391
|
+
$[115] = state;
|
|
392
|
+
$[116] = t20;
|
|
393
|
+
$[117] = t22;
|
|
394
|
+
$[118] = t23;
|
|
395
|
+
$[119] = variant;
|
|
396
|
+
$[120] = t24;
|
|
397
|
+
} else t24 = $[120];
|
|
398
|
+
let t25;
|
|
399
|
+
if ($[121] !== dialogState || $[122] !== disableDropdown || $[123] !== disableManualEntry || $[124] !== isDisabled || $[125] !== isOpen || $[126] !== label || $[127] !== onApply || $[128] !== onOpenChange) {
|
|
400
|
+
t25 = (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(DateTimeDialog, {
|
|
380
401
|
footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
|
|
381
402
|
isDisabled,
|
|
382
403
|
onApply,
|
|
@@ -388,50 +409,50 @@ var TimePickerBase = (props) => {
|
|
|
388
409
|
onOpenChange,
|
|
389
410
|
children: /* @__PURE__ */ jsx(TimePickerForm, { state: dialogState })
|
|
390
411
|
});
|
|
391
|
-
$[
|
|
392
|
-
$[
|
|
393
|
-
$[
|
|
394
|
-
$[
|
|
395
|
-
$[
|
|
396
|
-
$[
|
|
397
|
-
$[
|
|
398
|
-
$[
|
|
399
|
-
$[
|
|
400
|
-
} else
|
|
401
|
-
let
|
|
402
|
-
if ($[
|
|
403
|
-
|
|
412
|
+
$[121] = dialogState;
|
|
413
|
+
$[122] = disableDropdown;
|
|
414
|
+
$[123] = disableManualEntry;
|
|
415
|
+
$[124] = isDisabled;
|
|
416
|
+
$[125] = isOpen;
|
|
417
|
+
$[126] = label;
|
|
418
|
+
$[127] = onApply;
|
|
419
|
+
$[128] = onOpenChange;
|
|
420
|
+
$[129] = t25;
|
|
421
|
+
} else t25 = $[129];
|
|
422
|
+
let t26;
|
|
423
|
+
if ($[130] !== as || $[131] !== formFieldProps || $[132] !== labelProps || $[133] !== t18 || $[134] !== t19 || $[135] !== t24 || $[136] !== t25) {
|
|
424
|
+
t26 = /* @__PURE__ */ jsxs(FormField, {
|
|
404
425
|
...formFieldProps,
|
|
405
426
|
as,
|
|
406
427
|
labelProps,
|
|
407
428
|
className: t18,
|
|
408
429
|
tabIndex: t19,
|
|
409
|
-
children: [
|
|
430
|
+
children: [t24, t25]
|
|
410
431
|
});
|
|
411
|
-
$[
|
|
412
|
-
$[
|
|
413
|
-
$[
|
|
414
|
-
$[
|
|
415
|
-
$[
|
|
416
|
-
$[
|
|
417
|
-
$[
|
|
418
|
-
$[
|
|
419
|
-
} else
|
|
420
|
-
let
|
|
421
|
-
if ($[
|
|
422
|
-
|
|
432
|
+
$[130] = as;
|
|
433
|
+
$[131] = formFieldProps;
|
|
434
|
+
$[132] = labelProps;
|
|
435
|
+
$[133] = t18;
|
|
436
|
+
$[134] = t19;
|
|
437
|
+
$[135] = t24;
|
|
438
|
+
$[136] = t25;
|
|
439
|
+
$[137] = t26;
|
|
440
|
+
} else t26 = $[137];
|
|
441
|
+
let t27;
|
|
442
|
+
if ($[138] !== as || $[139] !== error || $[140] !== t17 || $[141] !== t26) {
|
|
443
|
+
t27 = /* @__PURE__ */ jsx(TooltipWrapper, {
|
|
423
444
|
as,
|
|
424
445
|
error,
|
|
425
446
|
triggerTabIndex: t17,
|
|
426
|
-
children:
|
|
447
|
+
children: t26
|
|
427
448
|
});
|
|
428
|
-
$[
|
|
429
|
-
$[
|
|
430
|
-
$[
|
|
431
|
-
$[
|
|
432
|
-
$[
|
|
433
|
-
} else
|
|
434
|
-
return
|
|
449
|
+
$[138] = as;
|
|
450
|
+
$[139] = error;
|
|
451
|
+
$[140] = t17;
|
|
452
|
+
$[141] = t26;
|
|
453
|
+
$[142] = t27;
|
|
454
|
+
} else t27 = $[142];
|
|
455
|
+
return t27;
|
|
435
456
|
};
|
|
436
457
|
var TimePickerInner = (t0) => {
|
|
437
458
|
const $ = c(9);
|
|
@@ -467,12 +488,14 @@ var TimePickerInner = (t0) => {
|
|
|
467
488
|
value: timeValue_0,
|
|
468
489
|
locale,
|
|
469
490
|
isDisabled,
|
|
470
|
-
hidePlaceholder: as === "floating" && !timeValue_0
|
|
491
|
+
hidePlaceholder: as === "floating" && !timeValue_0,
|
|
492
|
+
disableManualEntry,
|
|
493
|
+
placeholder: props.placeholder
|
|
471
494
|
});
|
|
472
495
|
return /* @__PURE__ */ jsx(InputFrame, {
|
|
473
496
|
...props,
|
|
474
497
|
isDisabled,
|
|
475
|
-
className: clsx("relative inline-flex w-full flex-col text-left", props.className),
|
|
498
|
+
className: clsx("group relative inline-flex w-full flex-col text-left", props.className),
|
|
476
499
|
inputClassName: clsx("min-w-input-width-min-width", props.inputClassName),
|
|
477
500
|
contentClassName: "pr-0!",
|
|
478
501
|
labelPlacement: "content-row",
|
|
@@ -488,9 +511,14 @@ var TimePickerInner = (t0) => {
|
|
|
488
511
|
},
|
|
489
512
|
renderStatic: true,
|
|
490
513
|
onStaticInteract: renderRealInput,
|
|
514
|
+
showClear: timeValue_0 != null,
|
|
491
515
|
wrapContentAndTrailing: true,
|
|
492
516
|
trailingClassName: "py-0! pl-0!",
|
|
493
|
-
|
|
517
|
+
action: showDropdown ? {
|
|
518
|
+
icon: ui.dateInput.timeIcon,
|
|
519
|
+
onClick: _temp3,
|
|
520
|
+
altText: ""
|
|
521
|
+
} : void 0,
|
|
494
522
|
children: staticSegments
|
|
495
523
|
});
|
|
496
524
|
}
|
|
@@ -609,5 +637,6 @@ function _temp2(isoString) {
|
|
|
609
637
|
if (isoString == null) return null;
|
|
610
638
|
return toTime(DateTimeUtils.fromISOtoZonedDateTime(isoString, "UTC"));
|
|
611
639
|
}
|
|
640
|
+
function _temp3() {}
|
|
612
641
|
//#endregion
|
|
613
642
|
export { TimePicker };
|