@povio/ui 3.0.0-rc.1 → 3.0.0-rc.3
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/DatePicker/DatePicker.js +4 -2
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +12 -2
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +12 -5
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +188 -205
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +0 -11
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +3 -2
- package/dist/components/inputs/FormField/FormFieldHeader.js +2 -2
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +0 -9
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +3 -2
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +4 -4
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +0 -4
- package/dist/components/inputs/Input/TextArea/TextArea.cva.js +3 -2
- package/dist/components/inputs/Input/TextArea/TextArea.js +2 -2
- package/dist/components/inputs/Input/shared/InputContent.js +2 -2
- package/dist/components/inputs/Inputs/InputItem.d.ts +1 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.js +6 -6
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +0 -44
- package/dist/components/inputs/RadioGroup/radio.cva.js +3 -3
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +14 -11
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +13 -10
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +1 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.js +50 -45
- package/dist/components/inputs/Selection/Select/Select.js +3 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +5 -5
- package/dist/components/inputs/Selection/shared/SelectInput.js +89 -87
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +2 -2
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +5 -3
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +18 -11
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +0 -4
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +3 -2
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +12 -5
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +6 -3
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +25 -8
- package/dist/components/inputs/Skeleton/InputFrame.js +6 -6
- package/dist/components/inputs/shared/TooltipWrapper.js +2 -2
- package/dist/components/inputs/shared/input.cva.d.ts +0 -54
- package/dist/components/inputs/shared/input.cva.js +3 -5
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +0 -4
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +3 -2
- package/dist/components/text/Typography/typography.cva.d.ts +0 -45
- package/dist/components/text/Typography/typography.cva.js +1 -2
- package/dist/config/uiConfig.context.d.ts +1 -1
- package/dist/config/uiOverrides.context.d.ts +1 -0
- package/dist/hooks/useQueryAutocomplete.d.ts +1 -1
- package/dist/hooks/useQueryAutocomplete.js +17 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +9 -3
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
|
2
2
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
3
3
|
import { Calendar } from "../shared/Calendar.js";
|
|
4
4
|
import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
|
|
5
|
-
import {
|
|
5
|
+
import { datePickerInputContentRowDefinition } from "../shared/datePickerInput.cva.js";
|
|
6
6
|
import { renderDatePickerTodayIcon } from "../shared/datePickerTodayIcon.js";
|
|
7
7
|
import { DatePickerInput } from "../shared/DatePickerInput.js";
|
|
8
8
|
import { DateTimeDialog } from "../shared/DateTimeDialog.js";
|
|
@@ -161,6 +161,8 @@ var DatePickerBase = (props) => {
|
|
|
161
161
|
};
|
|
162
162
|
const onInputClear = () => {
|
|
163
163
|
onChange?.(null);
|
|
164
|
+
dialogState.setValue(null);
|
|
165
|
+
if (fireBlurOnChange) handleBlur(null);
|
|
164
166
|
};
|
|
165
167
|
useEffect(() => {
|
|
166
168
|
if (!state.isOpen) return;
|
|
@@ -262,7 +264,7 @@ var DatePickerInner = (t0) => {
|
|
|
262
264
|
const fullIso = t1 === void 0 ? true : t1;
|
|
263
265
|
const granularity = t2 === void 0 ? "day" : t2;
|
|
264
266
|
const ui = UIConfig.useConfig();
|
|
265
|
-
const datePickerInputContentRowCva = UIOverrides.useCva("datePickerInput.contentRowCva",
|
|
267
|
+
const datePickerInputContentRowCva = UIOverrides.useCva("datePickerInput.contentRowCva", datePickerInputContentRowDefinition);
|
|
266
268
|
const { locale } = useLocale();
|
|
267
269
|
const shouldForceLeadingZeros = props.shouldForceLeadingZeros ?? ui.dateInput.shouldForceLeadingZeros;
|
|
268
270
|
const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
|
|
@@ -3,7 +3,7 @@ import { Typography } from "../../../text/Typography/Typography.js";
|
|
|
3
3
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
4
4
|
import "../../../../config/i18n.js";
|
|
5
5
|
import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
|
|
6
|
-
import {
|
|
6
|
+
import { datePickerInputContentRowDefinition } from "../shared/datePickerInput.cva.js";
|
|
7
7
|
import { renderDatePickerTodayIcon } from "../shared/datePickerTodayIcon.js";
|
|
8
8
|
import { DatePickerInput } from "../shared/DatePickerInput.js";
|
|
9
9
|
import { DateTimeDialog } from "../shared/DateTimeDialog.js";
|
|
@@ -431,6 +431,16 @@ var DateRangePickerBase = (props) => {
|
|
|
431
431
|
};
|
|
432
432
|
const onInputClear = () => {
|
|
433
433
|
onChange?.(null);
|
|
434
|
+
dialogState.setValue(null);
|
|
435
|
+
leftCalendarState.setValue(null);
|
|
436
|
+
rightCalendarState.setValue(null);
|
|
437
|
+
setRangeSelection({
|
|
438
|
+
start: null,
|
|
439
|
+
end: null,
|
|
440
|
+
isSelecting: false
|
|
441
|
+
});
|
|
442
|
+
setHoverDate(null);
|
|
443
|
+
if (fireBlurOnChange) handleBlur(null);
|
|
434
444
|
};
|
|
435
445
|
const onOpenChange = (isOpen) => {
|
|
436
446
|
state.toggle();
|
|
@@ -682,7 +692,7 @@ var DateRangePickerInner = (t0) => {
|
|
|
682
692
|
const { fullIso: t1, minValue, maxValue, renderStaticInput, isFormControlDisabled, ...props } = t0;
|
|
683
693
|
const fullIso = t1 === void 0 ? true : t1;
|
|
684
694
|
const ui = UIConfig.useConfig();
|
|
685
|
-
const datePickerInputContentRowCva = UIOverrides.useCva("datePickerInput.contentRowCva",
|
|
695
|
+
const datePickerInputContentRowCva = UIOverrides.useCva("datePickerInput.contentRowCva", datePickerInputContentRowDefinition);
|
|
686
696
|
const { locale } = useLocale$1();
|
|
687
697
|
const shouldForceLeadingZeros = props.shouldForceLeadingZeros ?? ui.dateInput.shouldForceLeadingZeros;
|
|
688
698
|
const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
|
|
@@ -22,6 +22,7 @@ interface DateTimePickerBaseProps extends FormFieldProps, InputVariantProps, Omi
|
|
|
22
22
|
setDateValueOnDateSelection?: boolean;
|
|
23
23
|
placeholder?: string;
|
|
24
24
|
inputClassName?: string;
|
|
25
|
+
shouldShrinkInput?: boolean;
|
|
25
26
|
shouldUpdateDateOnMonthYearChange?: boolean;
|
|
26
27
|
timeZone?: string;
|
|
27
28
|
format?: string;
|
|
@@ -2,7 +2,7 @@ import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
|
2
2
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
3
3
|
import { Calendar } from "../shared/Calendar.js";
|
|
4
4
|
import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
|
|
5
|
-
import {
|
|
5
|
+
import { datePickerInputContentRowDefinition } from "../shared/datePickerInput.cva.js";
|
|
6
6
|
import { renderDatePickerTodayIcon } from "../shared/datePickerTodayIcon.js";
|
|
7
7
|
import { DatePickerInput } from "../shared/DatePickerInput.js";
|
|
8
8
|
import { DateTimeDialog } from "../shared/DateTimeDialog.js";
|
|
@@ -25,7 +25,7 @@ import { useCalendarState, useDatePickerState } from "react-stately";
|
|
|
25
25
|
//#region src/components/inputs/DateTime/DateTimePicker/DateTimePicker.tsx
|
|
26
26
|
var DateTimePickerBase = (props) => {
|
|
27
27
|
const ui = UIConfig.useConfig();
|
|
28
|
-
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, value, disableDropdown, isTimeOptional, placeholder, inputClassName, hideLabel: hideLabelProp, variant: variantProp, as: asProp, size: sizeProp, isClearable: isClearableProp, todayIcon: todayIconProp, todayIconButtonSize: todayIconButtonSizeProp, todayIconButtonComponent: todayIconButtonComponentProp, todayIconPlacement: todayIconPlacementProp, shouldForceLeadingZeros: shouldForceLeadingZerosProp, disableManualEntry: disableManualEntryProp, shouldUpdateDateOnMonthYearChange: shouldUpdateDateOnMonthYearChangeProp, timeZone: timeZoneProp, autoFixYear: autoFixYearProp, fireBlurOnChange: fireBlurOnChangeProp, format, setDateValueOnDateSelection: setDateValueOnDateSelectionProp, ...rest } = props;
|
|
28
|
+
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, todayIcon: todayIconProp, todayIconButtonSize: todayIconButtonSizeProp, todayIconButtonComponent: todayIconButtonComponentProp, todayIconPlacement: todayIconPlacementProp, shouldForceLeadingZeros: shouldForceLeadingZerosProp, disableManualEntry: disableManualEntryProp, shouldUpdateDateOnMonthYearChange: shouldUpdateDateOnMonthYearChangeProp, timeZone: timeZoneProp, autoFixYear: autoFixYearProp, fireBlurOnChange: fireBlurOnChangeProp, format, setDateValueOnDateSelection: setDateValueOnDateSelectionProp, ...rest } = props;
|
|
29
29
|
const hideLabel = hideLabelProp ?? ui.input.hideLabel;
|
|
30
30
|
const variant = variantProp ?? ui.input.variant;
|
|
31
31
|
const as = asProp ?? ui.input.as;
|
|
@@ -152,6 +152,11 @@ var DateTimePickerBase = (props) => {
|
|
|
152
152
|
dialogState.setValue(currentValue);
|
|
153
153
|
calendarState.setFocusedDate(toCalendarDate(currentValue));
|
|
154
154
|
};
|
|
155
|
+
const onInputClear = () => {
|
|
156
|
+
onChange?.(null);
|
|
157
|
+
dialogState.setValue(null);
|
|
158
|
+
if (fireBlurOnChange) handleBlur(null);
|
|
159
|
+
};
|
|
155
160
|
const onOpenChange = (isOpen) => {
|
|
156
161
|
state.toggle();
|
|
157
162
|
calendarState.setFocusedDate(state.value || today(effectiveTimeZone));
|
|
@@ -204,6 +209,7 @@ var DateTimePickerBase = (props) => {
|
|
|
204
209
|
variant,
|
|
205
210
|
size,
|
|
206
211
|
isDateTime: true,
|
|
212
|
+
shouldShrinkInput,
|
|
207
213
|
isClearable,
|
|
208
214
|
headerProps,
|
|
209
215
|
todayIcon,
|
|
@@ -219,7 +225,8 @@ var DateTimePickerBase = (props) => {
|
|
|
219
225
|
timeZone: effectiveTimeZone,
|
|
220
226
|
isTimeOptional,
|
|
221
227
|
format,
|
|
222
|
-
fireBlurOnChange
|
|
228
|
+
fireBlurOnChange,
|
|
229
|
+
onClear: onInputClear
|
|
223
230
|
}), (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(DateTimeDialog, {
|
|
224
231
|
footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
|
|
225
232
|
isDisabled,
|
|
@@ -250,7 +257,7 @@ var DateTimePickerInner = (t0) => {
|
|
|
250
257
|
const $ = c(9);
|
|
251
258
|
const { fullIso: t1, renderStaticInput, isFormControlDisabled, ...props } = t0;
|
|
252
259
|
const ui = UIConfig.useConfig();
|
|
253
|
-
const datePickerInputContentRowCva = UIOverrides.useCva("datePickerInput.contentRowCva",
|
|
260
|
+
const datePickerInputContentRowCva = UIOverrides.useCva("datePickerInput.contentRowCva", datePickerInputContentRowDefinition);
|
|
254
261
|
const { locale } = useLocale();
|
|
255
262
|
const shouldForceLeadingZeros = props.shouldForceLeadingZeros ?? ui.dateInput.shouldForceLeadingZeros;
|
|
256
263
|
const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
|
|
@@ -303,7 +310,7 @@ var DateTimePickerInner = (t0) => {
|
|
|
303
310
|
...props,
|
|
304
311
|
isDisabled,
|
|
305
312
|
className: clsx("group relative inline-flex w-full flex-col text-left", props.className),
|
|
306
|
-
inputClassName: clsx("min-w-input-width-min-width", props.inputClassName),
|
|
313
|
+
inputClassName: clsx(props.shouldShrinkInput ? "min-w-0" : "min-w-input-width-min-width", props.inputClassName),
|
|
307
314
|
contentClassName: "pr-0!",
|
|
308
315
|
contentWrapperClassName: datePickerInputContentRowCva({ size }),
|
|
309
316
|
contentGroup: "date-picker",
|
|
@@ -21,6 +21,7 @@ interface DatePickerInputProps extends InputVariantProps {
|
|
|
21
21
|
isInvalid?: boolean;
|
|
22
22
|
disableDropdown?: boolean;
|
|
23
23
|
isDateTime?: boolean;
|
|
24
|
+
shouldShrinkInput?: boolean;
|
|
24
25
|
isClearable?: boolean;
|
|
25
26
|
headerProps?: FormFieldHeaderProps;
|
|
26
27
|
todayIcon?: DatePickerTodayIcon;
|
|
@@ -41,5 +42,5 @@ interface DatePickerInputProps extends InputVariantProps {
|
|
|
41
42
|
fireBlurOnChange?: boolean;
|
|
42
43
|
onClear?: () => void;
|
|
43
44
|
}
|
|
44
|
-
export declare const DatePickerInput: ({ ref, as, groupProps, fieldProps, endFieldProps, fieldValue, endFieldValue, isValueControlled, hasValue, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, isClearable, headerProps, todayIcon, todayIconButtonSize, todayIconButtonComponent, todayIconPlacement, isDirty, isRequired, disableManualEntry, autoFixYear, placeholder, className, onOpenDropdown, dateGranularity, timeZone, isTimeOptional, format, fireBlurOnChange, onClear: onClearProp, ...props }: DatePickerInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
export declare const DatePickerInput: ({ ref, as, groupProps, fieldProps, endFieldProps, fieldValue, endFieldValue, isValueControlled, hasValue, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, shouldShrinkInput, isClearable, headerProps, todayIcon, todayIconButtonSize, todayIconButtonComponent, todayIconPlacement, isDirty, isRequired, disableManualEntry, autoFixYear, placeholder, className, onOpenDropdown, dateGranularity, timeZone: timeZoneProp, isTimeOptional, format, fireBlurOnChange, onClear: onClearProp, ...props }: DatePickerInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
45
46
|
export {};
|
|
@@ -4,7 +4,7 @@ import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
|
4
4
|
import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconButton.js";
|
|
5
5
|
import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
|
|
6
6
|
import { DateField } from "./DateField.js";
|
|
7
|
-
import {
|
|
7
|
+
import { datePickerInputContentRowDefinition } from "./datePickerInput.cva.js";
|
|
8
8
|
import { renderDatePickerTodayIcon } from "./datePickerTodayIcon.js";
|
|
9
9
|
import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
|
|
10
10
|
import { InputClear } from "../../shared/InputClear.js";
|
|
@@ -15,21 +15,23 @@ import { clsx } from "clsx";
|
|
|
15
15
|
import { useImperativeHandle, useRef, useState } from "react";
|
|
16
16
|
import { Button } from "react-aria-components";
|
|
17
17
|
import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
|
|
18
|
-
import { today } from "@internationalized/date";
|
|
18
|
+
import { getLocalTimeZone, today } from "@internationalized/date";
|
|
19
19
|
//#region src/components/inputs/DateTime/shared/DatePickerInput.tsx
|
|
20
20
|
var DatePickerInput = (t0) => {
|
|
21
|
-
const $ = c(
|
|
22
|
-
const { ref, as, groupProps, fieldProps, endFieldProps, fieldValue, endFieldValue, isValueControlled, hasValue, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, isClearable, headerProps, todayIcon, todayIconButtonSize: t1, todayIconButtonComponent, todayIconPlacement: t2, isDirty, isRequired, disableManualEntry, autoFixYear: t3, placeholder, className, onOpenDropdown, dateGranularity: t4, timeZone, isTimeOptional: t5, format, fireBlurOnChange, onClear: onClearProp, ...props } = t0;
|
|
21
|
+
const $ = c(96);
|
|
22
|
+
const { ref, as, groupProps, fieldProps, endFieldProps, fieldValue, endFieldValue, isValueControlled, hasValue, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, shouldShrinkInput, isClearable, headerProps, todayIcon, todayIconButtonSize: t1, todayIconButtonComponent, todayIconPlacement: t2, isDirty, isRequired, disableManualEntry, autoFixYear: t3, placeholder, className, onOpenDropdown, dateGranularity: t4, timeZone: timeZoneProp, isTimeOptional: t5, format, fireBlurOnChange, onClear: onClearProp, ...props } = t0;
|
|
23
23
|
const todayIconButtonSize = t1 === void 0 ? "none" : t1;
|
|
24
24
|
const todayIconPlacement = t2 === void 0 ? "content" : t2;
|
|
25
25
|
const autoFixYear = t3 === void 0 ? false : t3;
|
|
26
26
|
const dateGranularity = t4 === void 0 ? "day" : t4;
|
|
27
27
|
const isTimeOptional = t5 === void 0 ? false : t5;
|
|
28
28
|
const uiConfig = UIConfig.useConfig();
|
|
29
|
-
const
|
|
29
|
+
const timeZone = timeZoneProp ?? uiConfig.dateInput.timeZone;
|
|
30
|
+
let effectiveTimeZone = getLocalTimeZone();
|
|
31
|
+
if (timeZone !== "clientLocal") effectiveTimeZone = timeZone;
|
|
30
32
|
const inputBaseCva = UIOverrides.useCva("input.baseCva", inputBaseDefinition);
|
|
31
33
|
const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
|
|
32
|
-
const datePickerInputContentRowCva = UIOverrides.useCva("datePickerInput.contentRowCva",
|
|
34
|
+
const datePickerInputContentRowCva = UIOverrides.useCva("datePickerInput.contentRowCva", datePickerInputContentRowDefinition);
|
|
33
35
|
const [canClear, setCanClear] = useState(false);
|
|
34
36
|
let t6;
|
|
35
37
|
if ($[0] !== isDisabled) {
|
|
@@ -129,112 +131,93 @@ var DatePickerInput = (t0) => {
|
|
|
129
131
|
const onClearChange = t14;
|
|
130
132
|
const showClear = canClear || hasValue || normalizedFieldProps.value != null || normalizedEndFieldProps?.value != null;
|
|
131
133
|
const isTodayIconDisabled = isDisabled || buttonProps.isDisabled;
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
$[20] = effectiveTimeZone;
|
|
150
|
-
$[21] = endFieldProps;
|
|
151
|
-
$[22] = fieldProps;
|
|
152
|
-
$[23] = fireBlurOnChange;
|
|
153
|
-
$[24] = isDateTime;
|
|
154
|
-
$[25] = isTodayIconDisabled;
|
|
155
|
-
$[26] = t15;
|
|
156
|
-
} else t15 = $[26];
|
|
157
|
-
const onToday = t15;
|
|
134
|
+
const onToday = () => {
|
|
135
|
+
if (isTodayIconDisabled) return;
|
|
136
|
+
if (isDateTime) {
|
|
137
|
+
const calendarDateTime = DateTimeUtils.getCurrentWallClockCalendarDateTime();
|
|
138
|
+
fieldProps.onChange?.(calendarDateTime);
|
|
139
|
+
if (endFieldProps) endFieldProps.onChange?.(calendarDateTime);
|
|
140
|
+
} else {
|
|
141
|
+
fieldProps.onChange?.(today(effectiveTimeZone));
|
|
142
|
+
if (endFieldProps) endFieldProps.onChange?.(today(effectiveTimeZone));
|
|
143
|
+
}
|
|
144
|
+
if (fireBlurOnChange) {
|
|
145
|
+
fieldProps.onBlur?.(null);
|
|
146
|
+
endFieldProps?.onBlur?.(null);
|
|
147
|
+
}
|
|
148
|
+
};
|
|
158
149
|
const hidePlaceholder = as === "floating" && !fieldProps.value && !isFocused;
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
todayIconButtonComponent
|
|
166
|
-
});
|
|
167
|
-
$[27] = isTodayIconDisabled;
|
|
168
|
-
$[28] = onToday;
|
|
169
|
-
$[29] = todayIcon;
|
|
170
|
-
$[30] = todayIconButtonComponent;
|
|
171
|
-
$[31] = todayIconButtonSize;
|
|
172
|
-
$[32] = t16;
|
|
173
|
-
} else t16 = $[32];
|
|
174
|
-
const todayIconButton = t16;
|
|
150
|
+
const todayIconButton = renderDatePickerTodayIcon(todayIcon, {
|
|
151
|
+
isDisabled: isTodayIconDisabled,
|
|
152
|
+
onPress: onToday,
|
|
153
|
+
size: todayIconButtonSize,
|
|
154
|
+
todayIconButtonComponent
|
|
155
|
+
});
|
|
175
156
|
const shouldRenderTodayIconWithFieldLabel = todayIconPlacement === "fieldLabel";
|
|
176
157
|
const pickerIcon = isDateTime ? uiConfig.dateInput.dateTimeIcon : uiConfig.dateInput.calendarIcon;
|
|
177
|
-
const
|
|
158
|
+
const t15 = clsx("group group/date-picker-content relative flex items-center justify-between gap-2", shouldShrinkInput ? "min-w-0" : "min-w-input-width-min-width", groupProps.className, inputBaseCva({
|
|
178
159
|
variant,
|
|
179
160
|
as,
|
|
180
161
|
...props
|
|
181
162
|
}), className);
|
|
182
|
-
const
|
|
183
|
-
const
|
|
184
|
-
const
|
|
185
|
-
const
|
|
186
|
-
const
|
|
187
|
-
const
|
|
188
|
-
const
|
|
189
|
-
const
|
|
190
|
-
const
|
|
191
|
-
const
|
|
192
|
-
const
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
163
|
+
const t16 = isHovered || void 0;
|
|
164
|
+
const t17 = isDisabled || void 0;
|
|
165
|
+
const t18 = isDisabled || void 0;
|
|
166
|
+
const t19 = isInvalid || void 0;
|
|
167
|
+
const t20 = normalizedFieldProps.value == null || void 0;
|
|
168
|
+
const t21 = isFocused || void 0;
|
|
169
|
+
const t22 = isFocused && isFocusVisible || void 0;
|
|
170
|
+
const t23 = normalizedFieldProps.value != null || void 0;
|
|
171
|
+
const t24 = isDirty || void 0;
|
|
172
|
+
const t25 = isRequired || void 0;
|
|
173
|
+
const t26 = normalizedFieldProps.value != null || void 0;
|
|
174
|
+
const t27 = shouldShrinkInput ? "min-w-0 flex-1 w-full" : "w-full";
|
|
175
|
+
let t28;
|
|
176
|
+
if ($[20] !== as || $[21] !== inputSizeCva || $[22] !== size || $[23] !== t27) {
|
|
177
|
+
t28 = clsx("flex items-center gap-input-gap-input-text-to-elements pr-0!", t27, inputSizeCva({
|
|
196
178
|
size,
|
|
197
179
|
as
|
|
198
180
|
}));
|
|
199
|
-
$[
|
|
200
|
-
$[
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
181
|
+
$[20] = as;
|
|
182
|
+
$[21] = inputSizeCva;
|
|
183
|
+
$[22] = size;
|
|
184
|
+
$[23] = t27;
|
|
185
|
+
$[24] = t28;
|
|
186
|
+
} else t28 = $[24];
|
|
187
|
+
let t29;
|
|
188
|
+
if ($[25] !== as || $[26] !== headerProps) {
|
|
189
|
+
t29 = as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
|
|
207
190
|
as,
|
|
208
191
|
...headerProps
|
|
209
192
|
});
|
|
210
|
-
$[
|
|
211
|
-
$[
|
|
212
|
-
$[
|
|
213
|
-
} else
|
|
214
|
-
const
|
|
193
|
+
$[25] = as;
|
|
194
|
+
$[26] = headerProps;
|
|
195
|
+
$[27] = t29;
|
|
196
|
+
} else t29 = $[27];
|
|
197
|
+
const t30 = shouldRenderTodayIconWithFieldLabel && todayIconButton;
|
|
198
|
+
let t31;
|
|
199
|
+
if ($[28] !== datePickerInputContentRowCva || $[29] !== size) {
|
|
200
|
+
t31 = datePickerInputContentRowCva({ size });
|
|
201
|
+
$[28] = datePickerInputContentRowCva;
|
|
202
|
+
$[29] = size;
|
|
203
|
+
$[30] = t31;
|
|
204
|
+
} else t31 = $[30];
|
|
215
205
|
let t32;
|
|
216
|
-
if ($[
|
|
217
|
-
t32 =
|
|
218
|
-
$[40] = datePickerInputContentRowCva;
|
|
219
|
-
$[41] = size;
|
|
220
|
-
$[42] = t32;
|
|
221
|
-
} else t32 = $[42];
|
|
222
|
-
let t33;
|
|
223
|
-
if ($[43] !== disableManualEntry || $[44] !== isDisabled || $[45] !== onOpenDropdown) {
|
|
224
|
-
t33 = disableManualEntry && /* @__PURE__ */ jsx(Button, {
|
|
206
|
+
if ($[31] !== disableManualEntry || $[32] !== isDisabled || $[33] !== onOpenDropdown) {
|
|
207
|
+
t32 = disableManualEntry && /* @__PURE__ */ jsx(Button, {
|
|
225
208
|
onPress: onOpenDropdown,
|
|
226
209
|
className: "absolute inset-0 z-0",
|
|
227
210
|
isDisabled
|
|
228
211
|
});
|
|
229
|
-
$[
|
|
230
|
-
$[
|
|
231
|
-
$[
|
|
232
|
-
$[
|
|
233
|
-
} else
|
|
234
|
-
const
|
|
235
|
-
let
|
|
236
|
-
if ($[
|
|
237
|
-
|
|
212
|
+
$[31] = disableManualEntry;
|
|
213
|
+
$[32] = isDisabled;
|
|
214
|
+
$[33] = onOpenDropdown;
|
|
215
|
+
$[34] = t32;
|
|
216
|
+
} else t32 = $[34];
|
|
217
|
+
const t33 = !shouldRenderTodayIconWithFieldLabel && todayIconButton;
|
|
218
|
+
let t34;
|
|
219
|
+
if ($[35] !== as || $[36] !== dateGranularity || $[37] !== disableManualEntry || $[38] !== effectiveTimeZone || $[39] !== fieldProps || $[40] !== format || $[41] !== hidePlaceholder || $[42] !== isDisabled || $[43] !== isInvalid || $[44] !== isTimeOptional || $[45] !== normalizedEndFieldProps || $[46] !== normalizedFieldProps || $[47] !== onClearChange || $[48] !== placeholder) {
|
|
220
|
+
t34 = disableManualEntry && placeholder && !fieldProps.value ? /* @__PURE__ */ jsx(Typography, {
|
|
238
221
|
size: "label-1",
|
|
239
222
|
className: "text-text-default-3",
|
|
240
223
|
children: placeholder
|
|
@@ -265,79 +248,79 @@ var DatePickerInput = (t0) => {
|
|
|
265
248
|
format,
|
|
266
249
|
timeZone: effectiveTimeZone
|
|
267
250
|
})] })] });
|
|
268
|
-
$[
|
|
269
|
-
$[
|
|
270
|
-
$[
|
|
271
|
-
$[
|
|
272
|
-
$[
|
|
273
|
-
$[
|
|
274
|
-
$[
|
|
275
|
-
$[
|
|
276
|
-
$[
|
|
277
|
-
$[
|
|
278
|
-
$[
|
|
279
|
-
$[
|
|
280
|
-
$[
|
|
281
|
-
$[
|
|
282
|
-
$[
|
|
283
|
-
} else
|
|
284
|
-
let
|
|
285
|
-
if ($[
|
|
286
|
-
|
|
287
|
-
className:
|
|
251
|
+
$[35] = as;
|
|
252
|
+
$[36] = dateGranularity;
|
|
253
|
+
$[37] = disableManualEntry;
|
|
254
|
+
$[38] = effectiveTimeZone;
|
|
255
|
+
$[39] = fieldProps;
|
|
256
|
+
$[40] = format;
|
|
257
|
+
$[41] = hidePlaceholder;
|
|
258
|
+
$[42] = isDisabled;
|
|
259
|
+
$[43] = isInvalid;
|
|
260
|
+
$[44] = isTimeOptional;
|
|
261
|
+
$[45] = normalizedEndFieldProps;
|
|
262
|
+
$[46] = normalizedFieldProps;
|
|
263
|
+
$[47] = onClearChange;
|
|
264
|
+
$[48] = placeholder;
|
|
265
|
+
$[49] = t34;
|
|
266
|
+
} else t34 = $[49];
|
|
267
|
+
let t35;
|
|
268
|
+
if ($[50] !== t31 || $[51] !== t32 || $[52] !== t33 || $[53] !== t34) {
|
|
269
|
+
t35 = /* @__PURE__ */ jsxs("div", {
|
|
270
|
+
className: t31,
|
|
288
271
|
children: [
|
|
272
|
+
t32,
|
|
289
273
|
t33,
|
|
290
|
-
t34
|
|
291
|
-
t35
|
|
274
|
+
t34
|
|
292
275
|
]
|
|
293
276
|
});
|
|
294
|
-
$[
|
|
295
|
-
$[
|
|
296
|
-
$[
|
|
297
|
-
$[
|
|
298
|
-
$[
|
|
299
|
-
} else
|
|
300
|
-
let
|
|
301
|
-
if ($[
|
|
302
|
-
|
|
303
|
-
className:
|
|
277
|
+
$[50] = t31;
|
|
278
|
+
$[51] = t32;
|
|
279
|
+
$[52] = t33;
|
|
280
|
+
$[53] = t34;
|
|
281
|
+
$[54] = t35;
|
|
282
|
+
} else t35 = $[54];
|
|
283
|
+
let t36;
|
|
284
|
+
if ($[55] !== t28 || $[56] !== t29 || $[57] !== t30 || $[58] !== t35) {
|
|
285
|
+
t36 = /* @__PURE__ */ jsxs("div", {
|
|
286
|
+
className: t28,
|
|
304
287
|
children: [
|
|
288
|
+
t29,
|
|
305
289
|
t30,
|
|
306
|
-
|
|
307
|
-
t36
|
|
290
|
+
t35
|
|
308
291
|
]
|
|
309
292
|
});
|
|
310
|
-
$[
|
|
311
|
-
$[
|
|
312
|
-
$[
|
|
313
|
-
$[
|
|
314
|
-
$[
|
|
315
|
-
} else
|
|
316
|
-
let
|
|
317
|
-
if ($[
|
|
318
|
-
|
|
293
|
+
$[55] = t28;
|
|
294
|
+
$[56] = t29;
|
|
295
|
+
$[57] = t30;
|
|
296
|
+
$[58] = t35;
|
|
297
|
+
$[59] = t36;
|
|
298
|
+
} else t36 = $[59];
|
|
299
|
+
let t37;
|
|
300
|
+
if ($[60] !== as || $[61] !== inputSizeCva || $[62] !== size) {
|
|
301
|
+
t37 = clsx(inputSizeCva({
|
|
319
302
|
size,
|
|
320
303
|
as
|
|
321
304
|
}), "flex items-center gap-input-gap-trailing-elements py-0! pl-0!");
|
|
322
|
-
$[
|
|
323
|
-
$[
|
|
324
|
-
$[
|
|
325
|
-
$[
|
|
326
|
-
} else
|
|
327
|
-
let
|
|
328
|
-
if ($[
|
|
329
|
-
|
|
305
|
+
$[60] = as;
|
|
306
|
+
$[61] = inputSizeCva;
|
|
307
|
+
$[62] = size;
|
|
308
|
+
$[63] = t37;
|
|
309
|
+
} else t37 = $[63];
|
|
310
|
+
let t38;
|
|
311
|
+
if ($[64] !== clearInput || $[65] !== isClearable || $[66] !== showClear) {
|
|
312
|
+
t38 = isClearable && /* @__PURE__ */ jsx(InputClear, {
|
|
330
313
|
onClear: clearInput,
|
|
331
314
|
show: showClear
|
|
332
315
|
});
|
|
333
|
-
$[
|
|
334
|
-
$[
|
|
335
|
-
$[
|
|
336
|
-
$[
|
|
337
|
-
} else
|
|
338
|
-
let
|
|
339
|
-
if ($[
|
|
340
|
-
|
|
316
|
+
$[64] = clearInput;
|
|
317
|
+
$[65] = isClearable;
|
|
318
|
+
$[66] = showClear;
|
|
319
|
+
$[67] = t38;
|
|
320
|
+
} else t38 = $[67];
|
|
321
|
+
let t39;
|
|
322
|
+
if ($[68] !== buttonProps || $[69] !== disableDropdown || $[70] !== disableManualEntry || $[71] !== isDisabled || $[72] !== pickerIcon) {
|
|
323
|
+
t39 = (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(InlineIconButton, {
|
|
341
324
|
label: "",
|
|
342
325
|
color: "secondary",
|
|
343
326
|
...buttonProps,
|
|
@@ -345,67 +328,67 @@ var DatePickerInput = (t0) => {
|
|
|
345
328
|
isDisabled,
|
|
346
329
|
className: "border-0!"
|
|
347
330
|
});
|
|
348
|
-
$[
|
|
349
|
-
$[
|
|
350
|
-
$[
|
|
351
|
-
$[
|
|
352
|
-
$[
|
|
353
|
-
$[
|
|
354
|
-
} else
|
|
331
|
+
$[68] = buttonProps;
|
|
332
|
+
$[69] = disableDropdown;
|
|
333
|
+
$[70] = disableManualEntry;
|
|
334
|
+
$[71] = isDisabled;
|
|
335
|
+
$[72] = pickerIcon;
|
|
336
|
+
$[73] = t39;
|
|
337
|
+
} else t39 = $[73];
|
|
338
|
+
let t40;
|
|
339
|
+
if ($[74] !== t37 || $[75] !== t38 || $[76] !== t39) {
|
|
340
|
+
t40 = /* @__PURE__ */ jsxs("div", {
|
|
341
|
+
className: t37,
|
|
342
|
+
children: [t38, t39]
|
|
343
|
+
});
|
|
344
|
+
$[74] = t37;
|
|
345
|
+
$[75] = t38;
|
|
346
|
+
$[76] = t39;
|
|
347
|
+
$[77] = t40;
|
|
348
|
+
} else t40 = $[77];
|
|
355
349
|
let t41;
|
|
356
|
-
if ($[86] !==
|
|
350
|
+
if ($[78] !== focusWithinProps || $[79] !== groupProps || $[80] !== hoverProps || $[81] !== t15 || $[82] !== t16 || $[83] !== t17 || $[84] !== t18 || $[85] !== t19 || $[86] !== t20 || $[87] !== t21 || $[88] !== t22 || $[89] !== t23 || $[90] !== t24 || $[91] !== t25 || $[92] !== t26 || $[93] !== t36 || $[94] !== t40) {
|
|
357
351
|
t41 = /* @__PURE__ */ jsxs("div", {
|
|
358
|
-
className: t38,
|
|
359
|
-
children: [t39, t40]
|
|
360
|
-
});
|
|
361
|
-
$[86] = t38;
|
|
362
|
-
$[87] = t39;
|
|
363
|
-
$[88] = t40;
|
|
364
|
-
$[89] = t41;
|
|
365
|
-
} else t41 = $[89];
|
|
366
|
-
let t42;
|
|
367
|
-
if ($[90] !== focusWithinProps || $[91] !== groupProps || $[92] !== hoverProps || $[93] !== t17 || $[94] !== t18 || $[95] !== t19 || $[96] !== t20 || $[97] !== t21 || $[98] !== t22 || $[99] !== t23 || $[100] !== t24 || $[101] !== t25 || $[102] !== t26 || $[103] !== t27 || $[104] !== t28 || $[105] !== t37 || $[106] !== t41) {
|
|
368
|
-
t42 = /* @__PURE__ */ jsxs("div", {
|
|
369
352
|
ref: containerRef,
|
|
370
353
|
...groupProps,
|
|
371
354
|
...focusWithinProps,
|
|
372
355
|
...hoverProps,
|
|
373
|
-
className:
|
|
356
|
+
className: t15,
|
|
374
357
|
"data-rac": "",
|
|
375
358
|
"data-datetime-input": "",
|
|
376
|
-
"data-hovered":
|
|
377
|
-
"data-disabled":
|
|
378
|
-
"data-is-disabled":
|
|
379
|
-
"data-invalid":
|
|
380
|
-
"data-is-empty":
|
|
381
|
-
"data-focus-within":
|
|
382
|
-
"data-focus-visible":
|
|
383
|
-
"data-has-selection":
|
|
384
|
-
"data-is-dirty":
|
|
385
|
-
"data-is-required":
|
|
386
|
-
"data-is-filled":
|
|
387
|
-
children: [
|
|
359
|
+
"data-hovered": t16,
|
|
360
|
+
"data-disabled": t17,
|
|
361
|
+
"data-is-disabled": t18,
|
|
362
|
+
"data-invalid": t19,
|
|
363
|
+
"data-is-empty": t20,
|
|
364
|
+
"data-focus-within": t21,
|
|
365
|
+
"data-focus-visible": t22,
|
|
366
|
+
"data-has-selection": t23,
|
|
367
|
+
"data-is-dirty": t24,
|
|
368
|
+
"data-is-required": t25,
|
|
369
|
+
"data-is-filled": t26,
|
|
370
|
+
children: [t36, t40]
|
|
388
371
|
});
|
|
389
|
-
$[
|
|
390
|
-
$[
|
|
391
|
-
$[
|
|
392
|
-
$[
|
|
393
|
-
$[
|
|
394
|
-
$[
|
|
395
|
-
$[
|
|
396
|
-
$[
|
|
397
|
-
$[
|
|
398
|
-
$[
|
|
399
|
-
$[
|
|
400
|
-
$[
|
|
401
|
-
$[
|
|
402
|
-
$[
|
|
403
|
-
$[
|
|
404
|
-
$[
|
|
405
|
-
$[
|
|
406
|
-
$[
|
|
407
|
-
} else
|
|
408
|
-
return
|
|
372
|
+
$[78] = focusWithinProps;
|
|
373
|
+
$[79] = groupProps;
|
|
374
|
+
$[80] = hoverProps;
|
|
375
|
+
$[81] = t15;
|
|
376
|
+
$[82] = t16;
|
|
377
|
+
$[83] = t17;
|
|
378
|
+
$[84] = t18;
|
|
379
|
+
$[85] = t19;
|
|
380
|
+
$[86] = t20;
|
|
381
|
+
$[87] = t21;
|
|
382
|
+
$[88] = t22;
|
|
383
|
+
$[89] = t23;
|
|
384
|
+
$[90] = t24;
|
|
385
|
+
$[91] = t25;
|
|
386
|
+
$[92] = t26;
|
|
387
|
+
$[93] = t36;
|
|
388
|
+
$[94] = t40;
|
|
389
|
+
$[95] = t41;
|
|
390
|
+
} else t41 = $[95];
|
|
391
|
+
return t41;
|
|
409
392
|
};
|
|
410
393
|
//#endregion
|
|
411
394
|
export { DatePickerInput };
|
|
@@ -11,17 +11,6 @@ export declare const datePickerInputContentRowDefinition: {
|
|
|
11
11
|
};
|
|
12
12
|
}>;
|
|
13
13
|
};
|
|
14
|
-
export declare const datePickerInputContentRow: {
|
|
15
|
-
base: string[];
|
|
16
|
-
config: import("../../../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
17
|
-
readonly size: {
|
|
18
|
-
readonly "extra-small": "";
|
|
19
|
-
readonly small: "";
|
|
20
|
-
readonly default: "";
|
|
21
|
-
readonly large: "";
|
|
22
|
-
};
|
|
23
|
-
}>;
|
|
24
|
-
};
|
|
25
14
|
export type DatePickerInputContentRowConfig = NonNullable<typeof datePickerInputContentRowDefinition.config>;
|
|
26
15
|
export interface DatePickerInputContentRowProps extends UIOverrides.VariantProps<DatePickerInputContentRowConfig>, InputSizeProps {
|
|
27
16
|
}
|