@povio/ui 2.3.0-rc.9 → 2.3.1
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/assets/icons/AlignCenter.js +11 -26
- package/dist/assets/icons/AlignLeft.js +11 -26
- package/dist/assets/icons/AlignLeftRight.js +11 -26
- package/dist/assets/icons/AlignRight.js +11 -26
- package/dist/assets/icons/ArrowDropDown.js +11 -26
- package/dist/assets/icons/ArrowDropUp.js +11 -26
- package/dist/assets/icons/ArrowLeft.js +11 -26
- package/dist/assets/icons/ArrowRight.js +11 -26
- package/dist/assets/icons/Bold.js +11 -26
- package/dist/assets/icons/BulletedList.js +11 -26
- package/dist/assets/icons/Calendar.js +13 -28
- package/dist/assets/icons/Check.js +13 -28
- package/dist/assets/icons/CheckCircle.js +11 -26
- package/dist/assets/icons/CheckboxCheckmark.js +14 -29
- package/dist/assets/icons/CheckboxIndeterminate.js +14 -29
- package/dist/assets/icons/ChevronDown.js +13 -28
- package/dist/assets/icons/ChevronLeft.js +13 -28
- package/dist/assets/icons/ChevronRight.js +13 -28
- package/dist/assets/icons/ChevronUp.js +13 -28
- package/dist/assets/icons/ChevronsLeft.js +13 -28
- package/dist/assets/icons/ChevronsRight.js +13 -28
- package/dist/assets/icons/Clock.js +11 -26
- package/dist/assets/icons/Close.js +11 -26
- package/dist/assets/icons/DateTime.js +14 -35
- package/dist/assets/icons/DragIndicator.js +11 -26
- package/dist/assets/icons/File.js +13 -28
- package/dist/assets/icons/Highlight.js +11 -26
- package/dist/assets/icons/HighlightOn.js +15 -49
- package/dist/assets/icons/Home.js +11 -26
- package/dist/assets/icons/Info.js +16 -37
- package/dist/assets/icons/Italic.js +11 -26
- package/dist/assets/icons/Link.js +11 -26
- package/dist/assets/icons/Menu.js +11 -26
- package/dist/assets/icons/NumberedList.js +11 -26
- package/dist/assets/icons/PointerHorizontal.js +11 -26
- package/dist/assets/icons/PointerVertical.js +11 -26
- package/dist/assets/icons/Search.js +11 -26
- package/dist/assets/icons/Send.js +13 -28
- package/dist/assets/icons/Strikethrough.js +11 -26
- package/dist/assets/icons/TextColor.js +14 -48
- package/dist/assets/icons/Today.js +11 -26
- package/dist/assets/icons/Underlined.js +13 -28
- package/dist/assets/icons/Upload.js +14 -35
- package/dist/assets/icons/Visibility.js +11 -26
- package/dist/assets/icons/VisibilityOff.js +11 -26
- package/dist/assets/icons/WarningFilled.js +13 -28
- package/dist/components/Breadcrumbs/Breadcrumbs.js +56 -207
- package/dist/components/Menu/Menu.js +2 -18
- package/dist/components/Menu/MenuDesktop.js +7 -41
- package/dist/components/Menu/MenuItem.js +9 -32
- package/dist/components/Menu/MenuMobile.js +38 -97
- package/dist/components/Menu/MenuPopover.js +29 -105
- package/dist/components/buttons/IconButton/IconButton.js +8 -40
- package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +1 -2
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
- package/dist/components/buttons/PillButton/PillButton.js +17 -55
- package/dist/components/buttons/SplitButton/SplitButton.js +18 -103
- package/dist/components/buttons/TextButton/TextButton.js +8 -30
- package/dist/components/buttons/ToggleButton/ToggleButton.js +8 -28
- package/dist/components/buttons/shared/ButtonContent.js +22 -80
- package/dist/components/inputs/Checkbox/Checkbox.js +35 -172
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +0 -3
- package/dist/components/inputs/Checkbox/checkbox.cva.js +1 -2
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +5 -10
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +20 -121
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +5 -10
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +111 -215
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +5 -11
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +19 -123
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +3 -5
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +104 -448
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +2 -5
- package/dist/components/inputs/DateTime/shared/Calendar.js +119 -330
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +1 -1
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +102 -283
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +1 -1
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +33 -142
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +93 -249
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +137 -318
- package/dist/components/inputs/DateTime/shared/DateField.js +112 -296
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +3 -6
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +136 -355
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +0 -14
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +11 -97
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +27 -81
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +58 -103
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +82 -193
- package/dist/components/inputs/DateTime/shared/TimeField.js +8 -27
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +110 -279
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +1 -2
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +65 -207
- package/dist/components/inputs/DateTime/shared/YearPicker.js +68 -119
- package/dist/components/inputs/File/FileUpload.js +44 -87
- package/dist/components/inputs/File/FileUploadContainer.js +7 -15
- package/dist/components/inputs/File/InputUpload.js +79 -317
- package/dist/components/inputs/File/shared/FileCard.js +41 -104
- package/dist/components/inputs/File/shared/FileCardList.js +12 -47
- package/dist/components/inputs/File/shared/FileUploadContent.js +44 -175
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +46 -149
- package/dist/components/inputs/File/shared/FileUploadContentError.js +93 -234
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +97 -230
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +55 -199
- package/dist/components/inputs/File/shared/InputUploadContent.js +34 -148
- package/dist/components/inputs/File/shared/InputUploadFilled.js +8 -49
- package/dist/components/inputs/File/shared/ProgressBar.js +9 -48
- package/dist/components/inputs/FormField/FormField.d.ts +3 -3
- package/dist/components/inputs/FormField/FormField.js +37 -119
- package/dist/components/inputs/FormField/FormFieldError.js +5 -25
- package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldHeader.js +22 -81
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +7 -31
- package/dist/components/inputs/FormField/FormFieldHelper.js +6 -26
- package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldLabel.js +9 -40
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +2 -5
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +88 -334
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +9 -48
- package/dist/components/inputs/Input/TextArea/TextArea.js +90 -305
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +1 -3
- package/dist/components/inputs/Input/TextInput/TextInput.js +79 -319
- package/dist/components/inputs/Input/shared/InputContent.js +59 -192
- package/dist/components/inputs/Inputs/Form.js +11 -40
- package/dist/components/inputs/Inputs/InputItem.d.ts +21 -16
- package/dist/components/inputs/Inputs/InputItem.js +14 -71
- package/dist/components/inputs/Inputs/Inputs.js +11 -37
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -2
- package/dist/components/inputs/RadioGroup/RadioGroup.js +60 -352
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +0 -17
- package/dist/components/inputs/RadioGroup/radio.cva.js +1 -42
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +2 -6
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +7 -109
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +18 -3
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +8 -34
- package/dist/components/inputs/Selection/Select/Select.d.ts +3 -7
- package/dist/components/inputs/Selection/Select/Select.js +5 -132
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +1 -8
- package/dist/components/inputs/Selection/shared/SelectBase.js +18 -69
- package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +138 -393
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +116 -338
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +25 -99
- package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBox.js +52 -164
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +35 -85
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +16 -69
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +21 -70
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +9 -58
- package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectMobile.js +3 -9
- package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -3
- package/dist/components/inputs/Selection/shared/select.context.js +34 -57
- package/dist/components/inputs/Selection/shared/select.types.d.ts +2 -3
- package/dist/components/inputs/Selection/shared/useSelectItems.js +49 -109
- package/dist/components/inputs/Slider/Slider.js +74 -250
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +0 -1
- package/dist/components/inputs/TextEditor/TextEditor.js +98 -447
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +11 -37
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +30 -102
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +45 -194
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +28 -88
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +14 -48
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +19 -66
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +15 -49
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +32 -92
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +54 -126
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +38 -141
- package/dist/components/inputs/Toggle/Toggle.js +37 -189
- package/dist/components/inputs/Toggle/toggle.cva.d.ts +0 -3
- package/dist/components/inputs/Toggle/toggle.cva.js +1 -2
- package/dist/components/inputs/shared/CheckContent.d.ts +1 -2
- package/dist/components/inputs/shared/CheckContent.js +11 -21
- package/dist/components/inputs/shared/InputClear.d.ts +1 -2
- package/dist/components/inputs/shared/InputClear.js +13 -79
- package/dist/components/inputs/shared/TooltipWrapper.js +11 -50
- package/dist/components/inputs/shared/input.cva.d.ts +0 -10
- package/dist/components/inputs/shared/input.cva.js +4 -32
- package/dist/components/navigation/Accordion/Accordion.js +22 -69
- package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
- package/dist/components/navigation/Stepper/Stepper.js +22 -67
- package/dist/components/navigation/Stepper/StepperItem.js +31 -104
- package/dist/components/navigation/Stepper/StepperSeparator.js +5 -23
- package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
- package/dist/components/overlays/BottomSheet/BottomSheet.js +49 -98
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +8 -48
- package/dist/components/overlays/Drawer/Drawer.js +20 -62
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +27 -83
- package/dist/components/overlays/Tooltip/Tooltip.js +28 -137
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +12 -37
- package/dist/components/segment/Segment.js +57 -218
- package/dist/components/segment/SegmentItem.js +10 -67
- package/dist/components/shared/pagination/Pagination.js +22 -108
- package/dist/components/shared/pagination/PaginationList.js +64 -167
- package/dist/components/status/Alert/Alert.js +30 -97
- package/dist/components/status/Loader/Loader.js +22 -77
- package/dist/components/status/Toast/Toast.js +13 -21
- package/dist/components/status/Toast/useToast.js +57 -62
- package/dist/components/table/ColumnConfig.js +54 -158
- package/dist/components/table/InfiniteTable.js +16 -67
- package/dist/components/table/PaginatedTable.js +18 -84
- package/dist/components/table/Table.js +27 -28
- package/dist/components/text/Link/Link.js +7 -19
- package/dist/components/text/Typography/Typography.js +8 -23
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/link.context.js +9 -23
- package/dist/config/router.context.js +16 -42
- package/dist/config/theme.context.js +45 -98
- package/dist/config/uiConfig.context.d.ts +6 -16
- package/dist/config/uiConfig.context.js +13 -56
- package/dist/config/uiStyle.context.d.ts +4 -27
- package/dist/config/uiStyle.context.js +5 -15
- package/dist/helpers/dynamicInputs.d.ts +5 -5
- package/dist/helpers/dynamicInputs.js +0 -3
- package/dist/hooks/useBreakpoint.js +3 -16
- package/dist/hooks/useDebounceCallback.js +17 -51
- package/dist/hooks/useFilters.js +64 -125
- package/dist/hooks/useForm.js +8 -42
- package/dist/hooks/useFormAutosave.js +30 -101
- package/dist/hooks/useIntersectionObserver.d.ts +1 -1
- package/dist/hooks/useIntersectionObserver.js +24 -91
- package/dist/hooks/useLocalStorage.js +10 -43
- package/dist/hooks/useLongPressRepeat.js +20 -55
- package/dist/hooks/usePagination.js +19 -49
- package/dist/hooks/useScrollableListBox.js +16 -37
- package/dist/hooks/useSorting.js +28 -69
- package/dist/hooks/useStateAndRef.js +7 -21
- package/dist/hooks/useTableColumnConfig.js +31 -124
- package/dist/hooks/useTranslationMemo.js +5 -25
- package/dist/index.d.ts +0 -7
- package/dist/index.js +3 -5
- package/dist/tw-ui-plugin.js +0 -2
- package/dist/utils/date-time.utils.d.ts +10 -31
- package/dist/utils/date-time.utils.js +22 -123
- package/dist/utils/dom.utils.js +1 -1
- package/package.json +1 -1
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +0 -4
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +0 -7
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +0 -13
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +0 -6
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +0 -21
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +0 -2
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +0 -1
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +0 -31
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +0 -80
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +0 -1
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +0 -6
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +0 -11
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +0 -45
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +0 -571
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +0 -35
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +0 -479
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +0 -4
- package/dist/components/inputs/Input/TextArea/TextArea.cva.js +0 -5
- package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +0 -1
- package/dist/components/inputs/Input/shared/numberStatic.utils.js +0 -7
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +0 -36
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +0 -14
- package/dist/components/inputs/Selection/Select/QuerySelect.js +0 -122
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +0 -9
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +0 -47
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +0 -6
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +0 -13
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +0 -3
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +0 -5
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +0 -5
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +0 -5
- package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +0 -23
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +0 -37
- package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +0 -1
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +0 -79
- package/dist/components/inputs/Skeleton/InputFrame.js +0 -526
- package/dist/components/inputs/shared/StaticInput.d.ts +0 -38
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +0 -4
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +0 -5
- package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +0 -14
- package/dist/components/inputs/shared/useStaticInputHandoff.js +0 -100
- package/dist/hooks/useQueryAutocomplete.d.ts +0 -14
- package/dist/hooks/useQueryAutocomplete.js +0 -57
- package/dist/utils/query.utils.d.ts +0 -4
- package/dist/utils/query.utils.js +0 -8
|
@@ -1,479 +0,0 @@
|
|
|
1
|
-
import { UIStyle } from "../../../../config/uiStyle.context.js";
|
|
2
|
-
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
3
|
-
import { InputClear } from "../../shared/InputClear.js";
|
|
4
|
-
import { inputBase, inputSize } from "../../shared/input.cva.js";
|
|
5
|
-
import { InputFrame } from "../../Skeleton/InputFrame.js";
|
|
6
|
-
import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
|
|
7
|
-
import { getStaticNumberDisplayValue } from "../shared/numberStatic.utils.js";
|
|
8
|
-
import { NumberRangeField } from "./NumberRangeField.js";
|
|
9
|
-
import { c } from "react/compiler-runtime";
|
|
10
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
-
import { clsx } from "clsx";
|
|
12
|
-
import { useRef, useState } from "react";
|
|
13
|
-
import { useLocale } from "react-aria-components";
|
|
14
|
-
import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
|
|
15
|
-
import { Controller, useWatch } from "react-hook-form";
|
|
16
|
-
//#region src/components/inputs/Input/NumberRangeInput/NumberRangeInput.tsx
|
|
17
|
-
var EMPTY_RANGE = {
|
|
18
|
-
min: null,
|
|
19
|
-
max: null
|
|
20
|
-
};
|
|
21
|
-
var normalizeRangeValue = (value, minValue, maxValue) => {
|
|
22
|
-
if (value) return value;
|
|
23
|
-
return {
|
|
24
|
-
min: minValue ?? null,
|
|
25
|
-
max: maxValue ?? null
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
var NumberRangeInputBase = (props) => {
|
|
29
|
-
const $ = c(114);
|
|
30
|
-
const ui = UIConfig.useConfig();
|
|
31
|
-
const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
|
|
32
|
-
const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
|
|
33
|
-
let asProp;
|
|
34
|
-
let autoFocusOnMount;
|
|
35
|
-
let className;
|
|
36
|
-
let error;
|
|
37
|
-
let errorClassName;
|
|
38
|
-
let headerClassName;
|
|
39
|
-
let helperText;
|
|
40
|
-
let hideLabelProps;
|
|
41
|
-
let inputClassName;
|
|
42
|
-
let isClearableProps;
|
|
43
|
-
let isDirty;
|
|
44
|
-
let isDisabled;
|
|
45
|
-
let isHeaderHidden;
|
|
46
|
-
let isRequired;
|
|
47
|
-
let label;
|
|
48
|
-
let maxInputClassName;
|
|
49
|
-
let maxValue;
|
|
50
|
-
let minInputClassName;
|
|
51
|
-
let minValue;
|
|
52
|
-
let onBlur;
|
|
53
|
-
let onChange;
|
|
54
|
-
let onMaxChange;
|
|
55
|
-
let onMinChange;
|
|
56
|
-
let ref;
|
|
57
|
-
let rest;
|
|
58
|
-
let rightContent;
|
|
59
|
-
let sizeProps;
|
|
60
|
-
let t0;
|
|
61
|
-
let t1;
|
|
62
|
-
let t2;
|
|
63
|
-
let t3;
|
|
64
|
-
let t4;
|
|
65
|
-
let t5;
|
|
66
|
-
let tooltipText;
|
|
67
|
-
let value;
|
|
68
|
-
let variantProps;
|
|
69
|
-
if ($[0] !== props) {
|
|
70
|
-
({ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, className, inputClassName, minInputClassName, maxInputClassName, value, minValue, maxValue, minPlaceholder: t0, maxPlaceholder: t1, minLabel: t2, maxLabel: t3, invalidRangeError: t4, hideInnerLabels: t5, isDirty, autoFocusOnMount, onChange, onMinChange, onMaxChange, onBlur, isClearable: isClearableProps, as: asProp, variant: variantProps, size: sizeProps, hideLabel: hideLabelProps, ...rest} = props);
|
|
71
|
-
$[0] = props;
|
|
72
|
-
$[1] = asProp;
|
|
73
|
-
$[2] = autoFocusOnMount;
|
|
74
|
-
$[3] = className;
|
|
75
|
-
$[4] = error;
|
|
76
|
-
$[5] = errorClassName;
|
|
77
|
-
$[6] = headerClassName;
|
|
78
|
-
$[7] = helperText;
|
|
79
|
-
$[8] = hideLabelProps;
|
|
80
|
-
$[9] = inputClassName;
|
|
81
|
-
$[10] = isClearableProps;
|
|
82
|
-
$[11] = isDirty;
|
|
83
|
-
$[12] = isDisabled;
|
|
84
|
-
$[13] = isHeaderHidden;
|
|
85
|
-
$[14] = isRequired;
|
|
86
|
-
$[15] = label;
|
|
87
|
-
$[16] = maxInputClassName;
|
|
88
|
-
$[17] = maxValue;
|
|
89
|
-
$[18] = minInputClassName;
|
|
90
|
-
$[19] = minValue;
|
|
91
|
-
$[20] = onBlur;
|
|
92
|
-
$[21] = onChange;
|
|
93
|
-
$[22] = onMaxChange;
|
|
94
|
-
$[23] = onMinChange;
|
|
95
|
-
$[24] = ref;
|
|
96
|
-
$[25] = rest;
|
|
97
|
-
$[26] = rightContent;
|
|
98
|
-
$[27] = sizeProps;
|
|
99
|
-
$[28] = t0;
|
|
100
|
-
$[29] = t1;
|
|
101
|
-
$[30] = t2;
|
|
102
|
-
$[31] = t3;
|
|
103
|
-
$[32] = t4;
|
|
104
|
-
$[33] = t5;
|
|
105
|
-
$[34] = tooltipText;
|
|
106
|
-
$[35] = value;
|
|
107
|
-
$[36] = variantProps;
|
|
108
|
-
} else {
|
|
109
|
-
asProp = $[1];
|
|
110
|
-
autoFocusOnMount = $[2];
|
|
111
|
-
className = $[3];
|
|
112
|
-
error = $[4];
|
|
113
|
-
errorClassName = $[5];
|
|
114
|
-
headerClassName = $[6];
|
|
115
|
-
helperText = $[7];
|
|
116
|
-
hideLabelProps = $[8];
|
|
117
|
-
inputClassName = $[9];
|
|
118
|
-
isClearableProps = $[10];
|
|
119
|
-
isDirty = $[11];
|
|
120
|
-
isDisabled = $[12];
|
|
121
|
-
isHeaderHidden = $[13];
|
|
122
|
-
isRequired = $[14];
|
|
123
|
-
label = $[15];
|
|
124
|
-
maxInputClassName = $[16];
|
|
125
|
-
maxValue = $[17];
|
|
126
|
-
minInputClassName = $[18];
|
|
127
|
-
minValue = $[19];
|
|
128
|
-
onBlur = $[20];
|
|
129
|
-
onChange = $[21];
|
|
130
|
-
onMaxChange = $[22];
|
|
131
|
-
onMinChange = $[23];
|
|
132
|
-
ref = $[24];
|
|
133
|
-
rest = $[25];
|
|
134
|
-
rightContent = $[26];
|
|
135
|
-
sizeProps = $[27];
|
|
136
|
-
t0 = $[28];
|
|
137
|
-
t1 = $[29];
|
|
138
|
-
t2 = $[30];
|
|
139
|
-
t3 = $[31];
|
|
140
|
-
t4 = $[32];
|
|
141
|
-
t5 = $[33];
|
|
142
|
-
tooltipText = $[34];
|
|
143
|
-
value = $[35];
|
|
144
|
-
variantProps = $[36];
|
|
145
|
-
}
|
|
146
|
-
const minPlaceholder = t0 === void 0 ? "Min" : t0;
|
|
147
|
-
const maxPlaceholder = t1 === void 0 ? "Max" : t1;
|
|
148
|
-
const minLabel = t2 === void 0 ? "Minimum" : t2;
|
|
149
|
-
const maxLabel = t3 === void 0 ? "Maximum" : t3;
|
|
150
|
-
const invalidRangeError = t4 === void 0 ? "Minimum cannot be greater than maximum" : t4;
|
|
151
|
-
const hideInnerLabels = t5 === void 0 ? true : t5;
|
|
152
|
-
const isClearable = isClearableProps ?? ui.input.isClearable;
|
|
153
|
-
const as = asProp ?? ui.input.as;
|
|
154
|
-
const variant = variantProps ?? ui.input.variant;
|
|
155
|
-
const size = sizeProps ?? ui.input.size;
|
|
156
|
-
const hideLabel = hideLabelProps ?? ui.input.hideLabel;
|
|
157
|
-
let t6;
|
|
158
|
-
if ($[37] !== maxValue || $[38] !== minValue || $[39] !== value) {
|
|
159
|
-
t6 = normalizeRangeValue(value, minValue, maxValue);
|
|
160
|
-
$[37] = maxValue;
|
|
161
|
-
$[38] = minValue;
|
|
162
|
-
$[39] = value;
|
|
163
|
-
$[40] = t6;
|
|
164
|
-
} else t6 = $[40];
|
|
165
|
-
const rangeValue = t6;
|
|
166
|
-
const isEmpty = rangeValue.min === null && rangeValue.max === null;
|
|
167
|
-
const rangeError = rangeValue.min !== null && rangeValue.max !== null && rangeValue.min > rangeValue.max ? invalidRangeError : void 0;
|
|
168
|
-
const effectiveError = error || rangeError;
|
|
169
|
-
let t7;
|
|
170
|
-
if ($[41] !== isDisabled) {
|
|
171
|
-
t7 = { isDisabled };
|
|
172
|
-
$[41] = isDisabled;
|
|
173
|
-
$[42] = t7;
|
|
174
|
-
} else t7 = $[42];
|
|
175
|
-
const { hoverProps, isHovered } = useHover(t7);
|
|
176
|
-
const { isFocusVisible } = useFocusVisible();
|
|
177
|
-
const [isFocused, setIsFocused] = useState(false);
|
|
178
|
-
let t8;
|
|
179
|
-
if ($[43] === Symbol.for("react.memo_cache_sentinel")) {
|
|
180
|
-
t8 = { onFocusWithinChange: setIsFocused };
|
|
181
|
-
$[43] = t8;
|
|
182
|
-
} else t8 = $[43];
|
|
183
|
-
const { focusWithinProps } = useFocusWithin(t8);
|
|
184
|
-
const t9 = isHeaderHidden || as === "inline" || as === "filter" || as === "floating";
|
|
185
|
-
let t10;
|
|
186
|
-
if ($[44] !== effectiveError || $[45] !== errorClassName || $[46] !== headerClassName || $[47] !== helperText || $[48] !== hideLabel || $[49] !== isDisabled || $[50] !== isRequired || $[51] !== label || $[52] !== rightContent || $[53] !== t9 || $[54] !== tooltipText) {
|
|
187
|
-
t10 = {
|
|
188
|
-
error: effectiveError,
|
|
189
|
-
label,
|
|
190
|
-
tooltipText,
|
|
191
|
-
helperText,
|
|
192
|
-
isRequired,
|
|
193
|
-
rightContent,
|
|
194
|
-
isHeaderHidden: t9,
|
|
195
|
-
hideLabel,
|
|
196
|
-
isDisabled,
|
|
197
|
-
headerClassName,
|
|
198
|
-
errorClassName
|
|
199
|
-
};
|
|
200
|
-
$[44] = effectiveError;
|
|
201
|
-
$[45] = errorClassName;
|
|
202
|
-
$[46] = headerClassName;
|
|
203
|
-
$[47] = helperText;
|
|
204
|
-
$[48] = hideLabel;
|
|
205
|
-
$[49] = isDisabled;
|
|
206
|
-
$[50] = isRequired;
|
|
207
|
-
$[51] = label;
|
|
208
|
-
$[52] = rightContent;
|
|
209
|
-
$[53] = t9;
|
|
210
|
-
$[54] = tooltipText;
|
|
211
|
-
$[55] = t10;
|
|
212
|
-
} else t10 = $[55];
|
|
213
|
-
const formFieldProps = t10;
|
|
214
|
-
const t11 = hideLabel || isHeaderHidden;
|
|
215
|
-
let t12;
|
|
216
|
-
if ($[56] !== headerClassName || $[57] !== helperText || $[58] !== isDisabled || $[59] !== isRequired || $[60] !== label || $[61] !== rightContent || $[62] !== t11 || $[63] !== tooltipText) {
|
|
217
|
-
t12 = {
|
|
218
|
-
label,
|
|
219
|
-
tooltipText,
|
|
220
|
-
helperText,
|
|
221
|
-
isRequired,
|
|
222
|
-
rightContent,
|
|
223
|
-
isHeaderHidden: t11,
|
|
224
|
-
isDisabled,
|
|
225
|
-
className: headerClassName
|
|
226
|
-
};
|
|
227
|
-
$[56] = headerClassName;
|
|
228
|
-
$[57] = helperText;
|
|
229
|
-
$[58] = isDisabled;
|
|
230
|
-
$[59] = isRequired;
|
|
231
|
-
$[60] = label;
|
|
232
|
-
$[61] = rightContent;
|
|
233
|
-
$[62] = t11;
|
|
234
|
-
$[63] = tooltipText;
|
|
235
|
-
$[64] = t12;
|
|
236
|
-
} else t12 = $[64];
|
|
237
|
-
const headerProps = t12;
|
|
238
|
-
let t13;
|
|
239
|
-
if ($[65] !== onChange || $[66] !== onMaxChange || $[67] !== onMinChange || $[68] !== rangeValue) {
|
|
240
|
-
t13 = (side, nextValue) => {
|
|
241
|
-
const nextRange = {
|
|
242
|
-
...rangeValue,
|
|
243
|
-
[side]: nextValue
|
|
244
|
-
};
|
|
245
|
-
onChange?.(nextRange);
|
|
246
|
-
if (side === "min") onMinChange?.(nextValue);
|
|
247
|
-
else onMaxChange?.(nextValue);
|
|
248
|
-
};
|
|
249
|
-
$[65] = onChange;
|
|
250
|
-
$[66] = onMaxChange;
|
|
251
|
-
$[67] = onMinChange;
|
|
252
|
-
$[68] = rangeValue;
|
|
253
|
-
$[69] = t13;
|
|
254
|
-
} else t13 = $[69];
|
|
255
|
-
const updateRange = t13;
|
|
256
|
-
let t14;
|
|
257
|
-
if ($[70] !== onBlur || $[71] !== updateRange) {
|
|
258
|
-
t14 = (side_0) => {
|
|
259
|
-
updateRange(side_0, null);
|
|
260
|
-
onBlur?.({ target: { value: "" } });
|
|
261
|
-
};
|
|
262
|
-
$[70] = onBlur;
|
|
263
|
-
$[71] = updateRange;
|
|
264
|
-
$[72] = t14;
|
|
265
|
-
} else t14 = $[72];
|
|
266
|
-
const clearRangeSide = t14;
|
|
267
|
-
let t15;
|
|
268
|
-
if ($[73] !== as || $[74] !== inputBaseCva || $[75] !== variant) {
|
|
269
|
-
t15 = inputBaseCva({
|
|
270
|
-
variant,
|
|
271
|
-
as
|
|
272
|
-
});
|
|
273
|
-
$[73] = as;
|
|
274
|
-
$[74] = inputBaseCva;
|
|
275
|
-
$[75] = variant;
|
|
276
|
-
$[76] = t15;
|
|
277
|
-
} else t15 = $[76];
|
|
278
|
-
let t16;
|
|
279
|
-
if ($[77] !== as || $[78] !== inputSizeCva || $[79] !== size) {
|
|
280
|
-
t16 = inputSizeCva({
|
|
281
|
-
size,
|
|
282
|
-
as
|
|
283
|
-
});
|
|
284
|
-
$[77] = as;
|
|
285
|
-
$[78] = inputSizeCva;
|
|
286
|
-
$[79] = size;
|
|
287
|
-
$[80] = t16;
|
|
288
|
-
} else t16 = $[80];
|
|
289
|
-
let t17;
|
|
290
|
-
if ($[81] !== as || $[82] !== autoFocusOnMount || $[83] !== className || $[84] !== clearRangeSide || $[85] !== effectiveError || $[86] !== focusWithinProps || $[87] !== formFieldProps || $[88] !== headerProps || $[89] !== hideInnerLabels || $[90] !== hoverProps || $[91] !== inputClassName || $[92] !== isClearable || $[93] !== isDirty || $[94] !== isDisabled || $[95] !== isEmpty || $[96] !== isFocusVisible || $[97] !== isFocused || $[98] !== isHovered || $[99] !== isRequired || $[100] !== maxInputClassName || $[101] !== maxLabel || $[102] !== maxPlaceholder || $[103] !== minInputClassName || $[104] !== minLabel || $[105] !== minPlaceholder || $[106] !== onBlur || $[107] !== rangeValue || $[108] !== ref || $[109] !== rest || $[110] !== t15 || $[111] !== t16 || $[112] !== updateRange) {
|
|
291
|
-
t17 = /* @__PURE__ */ jsx(NumberRangeField, {
|
|
292
|
-
...rest,
|
|
293
|
-
ref,
|
|
294
|
-
as,
|
|
295
|
-
className,
|
|
296
|
-
inputClassName,
|
|
297
|
-
minInputClassName,
|
|
298
|
-
maxInputClassName,
|
|
299
|
-
inputBaseClassName: t15,
|
|
300
|
-
inputSizeClassName: t16,
|
|
301
|
-
formFieldProps,
|
|
302
|
-
headerProps,
|
|
303
|
-
rangeValue,
|
|
304
|
-
effectiveError,
|
|
305
|
-
minPlaceholder,
|
|
306
|
-
maxPlaceholder,
|
|
307
|
-
minLabel,
|
|
308
|
-
maxLabel,
|
|
309
|
-
hideInnerLabels,
|
|
310
|
-
isDirty,
|
|
311
|
-
isClearable,
|
|
312
|
-
autoFocusOnMount,
|
|
313
|
-
isDisabled,
|
|
314
|
-
isRequired,
|
|
315
|
-
isEmpty,
|
|
316
|
-
isHovered,
|
|
317
|
-
isFocused,
|
|
318
|
-
isFocusVisible,
|
|
319
|
-
focusWithinProps,
|
|
320
|
-
hoverProps,
|
|
321
|
-
onRangeSideChange: updateRange,
|
|
322
|
-
onRangeSideClear: clearRangeSide,
|
|
323
|
-
onBlur
|
|
324
|
-
});
|
|
325
|
-
$[81] = as;
|
|
326
|
-
$[82] = autoFocusOnMount;
|
|
327
|
-
$[83] = className;
|
|
328
|
-
$[84] = clearRangeSide;
|
|
329
|
-
$[85] = effectiveError;
|
|
330
|
-
$[86] = focusWithinProps;
|
|
331
|
-
$[87] = formFieldProps;
|
|
332
|
-
$[88] = headerProps;
|
|
333
|
-
$[89] = hideInnerLabels;
|
|
334
|
-
$[90] = hoverProps;
|
|
335
|
-
$[91] = inputClassName;
|
|
336
|
-
$[92] = isClearable;
|
|
337
|
-
$[93] = isDirty;
|
|
338
|
-
$[94] = isDisabled;
|
|
339
|
-
$[95] = isEmpty;
|
|
340
|
-
$[96] = isFocusVisible;
|
|
341
|
-
$[97] = isFocused;
|
|
342
|
-
$[98] = isHovered;
|
|
343
|
-
$[99] = isRequired;
|
|
344
|
-
$[100] = maxInputClassName;
|
|
345
|
-
$[101] = maxLabel;
|
|
346
|
-
$[102] = maxPlaceholder;
|
|
347
|
-
$[103] = minInputClassName;
|
|
348
|
-
$[104] = minLabel;
|
|
349
|
-
$[105] = minPlaceholder;
|
|
350
|
-
$[106] = onBlur;
|
|
351
|
-
$[107] = rangeValue;
|
|
352
|
-
$[108] = ref;
|
|
353
|
-
$[109] = rest;
|
|
354
|
-
$[110] = t15;
|
|
355
|
-
$[111] = t16;
|
|
356
|
-
$[112] = updateRange;
|
|
357
|
-
$[113] = t17;
|
|
358
|
-
} else t17 = $[113];
|
|
359
|
-
return t17;
|
|
360
|
-
};
|
|
361
|
-
var NumberRangeInput = ({ renderStaticInput, ...props }) => {
|
|
362
|
-
const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
|
|
363
|
-
const ui = UIConfig.useConfig();
|
|
364
|
-
const { locale } = useLocale();
|
|
365
|
-
const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
|
|
366
|
-
const { shouldFocus, renderRealInput } = useStaticInputHandoff({
|
|
367
|
-
inputRef: useRef(null),
|
|
368
|
-
renderInput,
|
|
369
|
-
setRenderInput
|
|
370
|
-
});
|
|
371
|
-
const watchedValue = "formControl" in props && props.formControl ? useWatch({
|
|
372
|
-
control: props.formControl.control,
|
|
373
|
-
name: props.formControl.name
|
|
374
|
-
}) : props.value;
|
|
375
|
-
let isFormControlDisabled = false;
|
|
376
|
-
if ("formControl" in props && props.formControl) isFormControlDisabled = !!props.formControl.control._options?.disabled;
|
|
377
|
-
if (!renderInput) {
|
|
378
|
-
const staticValue = normalizeRangeValue(watchedValue, props.minValue, props.maxValue);
|
|
379
|
-
const formatOptions = props.formatOptions ?? ui.numberInput.formatOptions;
|
|
380
|
-
const formatter = new Intl.NumberFormat(locale, formatOptions);
|
|
381
|
-
const minDisplay = getStaticNumberDisplayValue(staticValue.min, formatter);
|
|
382
|
-
const maxDisplay = getStaticNumberDisplayValue(staticValue.max, formatter);
|
|
383
|
-
const hasValue = minDisplay !== null || maxDisplay !== null;
|
|
384
|
-
const rangeError = staticValue.min !== null && staticValue.max !== null && staticValue.min > staticValue.max ? props.invalidRangeError ?? "Minimum cannot be greater than maximum" : void 0;
|
|
385
|
-
const effectiveError = props.error || rangeError;
|
|
386
|
-
const as = props.as ?? ui.input.as;
|
|
387
|
-
const size = props.size ?? ui.input.size;
|
|
388
|
-
let isDisabled = !!props.isDisabled;
|
|
389
|
-
if (isFormControlDisabled) isDisabled = true;
|
|
390
|
-
const isClearable = props.isClearable ?? ui.input.isClearable;
|
|
391
|
-
const dataAttributes = {
|
|
392
|
-
dataIsEmpty: !hasValue,
|
|
393
|
-
dataIsFilled: hasValue,
|
|
394
|
-
dataIsDirty: props.isDirty,
|
|
395
|
-
dataIsRequired: props.isRequired,
|
|
396
|
-
dataIsDisabled: isDisabled,
|
|
397
|
-
dataDisabled: isDisabled,
|
|
398
|
-
dataInvalid: !!effectiveError,
|
|
399
|
-
dataHasSelection: hasValue
|
|
400
|
-
};
|
|
401
|
-
return /* @__PURE__ */ jsx(InputFrame, {
|
|
402
|
-
...props,
|
|
403
|
-
error: effectiveError,
|
|
404
|
-
isDisabled,
|
|
405
|
-
className: clsx("group w-full", as === "inline" && "h-full", props.className),
|
|
406
|
-
inputClassName: props.inputClassName,
|
|
407
|
-
contentClassName: "pr-0!",
|
|
408
|
-
trailingClassName: "py-0! pl-0!",
|
|
409
|
-
contentWrapperClassName: clsx("flex w-full items-center gap-input-gap-input-text-to-elements pr-0! py-0! px-0!", inputSizeCva({
|
|
410
|
-
size,
|
|
411
|
-
as
|
|
412
|
-
})),
|
|
413
|
-
dataAttributes,
|
|
414
|
-
renderStatic: true,
|
|
415
|
-
onStaticInteract: renderRealInput,
|
|
416
|
-
isClearable: false,
|
|
417
|
-
labelPlacement: "content-wrapper",
|
|
418
|
-
children: ({ id, ...dataAttributeProps }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
419
|
-
/* @__PURE__ */ jsx("input", {
|
|
420
|
-
id,
|
|
421
|
-
readOnly: true,
|
|
422
|
-
disabled: isDisabled,
|
|
423
|
-
tabIndex: -1,
|
|
424
|
-
value: minDisplay ?? "",
|
|
425
|
-
placeholder: props.minPlaceholder ?? "Min",
|
|
426
|
-
className: clsx("w-full bg-transparent outline-none placeholder:text-text-default-3 disabled:text-interactive-text-secondary-disabled", props.minInputClassName),
|
|
427
|
-
...dataAttributeProps,
|
|
428
|
-
"data-rac": true
|
|
429
|
-
}),
|
|
430
|
-
isClearable && /* @__PURE__ */ jsx(InputClear, {
|
|
431
|
-
onClear: () => {},
|
|
432
|
-
renderStatic: true
|
|
433
|
-
}),
|
|
434
|
-
/* @__PURE__ */ jsx("span", {
|
|
435
|
-
className: "pointer-events-none shrink-0 select-none text-label-2 text-text-default-3",
|
|
436
|
-
children: "-"
|
|
437
|
-
}),
|
|
438
|
-
/* @__PURE__ */ jsx("input", {
|
|
439
|
-
id: `${id}-max`,
|
|
440
|
-
readOnly: true,
|
|
441
|
-
disabled: isDisabled,
|
|
442
|
-
tabIndex: -1,
|
|
443
|
-
value: maxDisplay ?? "",
|
|
444
|
-
placeholder: props.maxPlaceholder ?? "Max",
|
|
445
|
-
className: clsx("w-full bg-transparent outline-none placeholder:text-text-default-3 disabled:text-interactive-text-secondary-disabled", props.maxInputClassName),
|
|
446
|
-
...dataAttributeProps,
|
|
447
|
-
"data-rac": true
|
|
448
|
-
}),
|
|
449
|
-
isClearable && /* @__PURE__ */ jsx(InputClear, {
|
|
450
|
-
onClear: () => {},
|
|
451
|
-
renderStatic: true
|
|
452
|
-
})
|
|
453
|
-
] })
|
|
454
|
-
});
|
|
455
|
-
}
|
|
456
|
-
if ("formControl" in props && props.formControl) {
|
|
457
|
-
const { formControl, ref, ...innerProps } = props;
|
|
458
|
-
return /* @__PURE__ */ jsx(Controller, {
|
|
459
|
-
control: formControl.control,
|
|
460
|
-
name: formControl.name,
|
|
461
|
-
render: ({ field, fieldState: { error } }) => /* @__PURE__ */ jsx(NumberRangeInputBase, {
|
|
462
|
-
...innerProps,
|
|
463
|
-
ref,
|
|
464
|
-
value: field.value ?? EMPTY_RANGE,
|
|
465
|
-
onChange: field.onChange,
|
|
466
|
-
onBlur: field.onBlur,
|
|
467
|
-
isDisabled: field.disabled || props.isDisabled,
|
|
468
|
-
error: props.error ?? error?.message,
|
|
469
|
-
autoFocusOnMount: shouldFocus
|
|
470
|
-
})
|
|
471
|
-
});
|
|
472
|
-
}
|
|
473
|
-
return /* @__PURE__ */ jsx(NumberRangeInputBase, {
|
|
474
|
-
...props,
|
|
475
|
-
autoFocusOnMount: shouldFocus
|
|
476
|
-
});
|
|
477
|
-
};
|
|
478
|
-
//#endregion
|
|
479
|
-
export { NumberRangeInput };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { VariantProps } from 'class-variance-authority';
|
|
2
|
-
export declare const textAreaWrapper: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
3
|
-
export interface TextAreaWrapperVariantProps extends VariantProps<typeof textAreaWrapper> {
|
|
4
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getStaticNumberDisplayValue: (value: unknown, formatter: Intl.NumberFormat) => string | null;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
//#region src/components/inputs/Input/shared/numberStatic.utils.ts
|
|
2
|
-
var getStaticNumberDisplayValue = (value, formatter) => {
|
|
3
|
-
if (typeof value !== "number" || !Number.isFinite(value)) return null;
|
|
4
|
-
return formatter.format(value);
|
|
5
|
-
};
|
|
6
|
-
//#endregion
|
|
7
|
-
export { getStaticNumberDisplayValue };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { InfiniteData, UseInfiniteQueryResult, UseQueryResult } from '@tanstack/react-query';
|
|
2
|
-
import { Key } from 'react-aria-components';
|
|
3
|
-
import { FieldValues } from 'react-hook-form';
|
|
4
|
-
import { AutocompleteProps } from './Autocomplete';
|
|
5
|
-
import { GroupedSelectControlProps, GroupedSelectProps, SelectItem } from '../shared/select.types';
|
|
6
|
-
import { OmitDiscriminatedUnion } from '../../../../types/common';
|
|
7
|
-
export type InfiniteQueryPage<TKey extends Key> = {
|
|
8
|
-
items?: SelectItem<TKey>[];
|
|
9
|
-
totalItems?: number;
|
|
10
|
-
};
|
|
11
|
-
export type QueryResult<TData> = UseQueryResult<TData> | UseInfiniteQueryResult<TData>;
|
|
12
|
-
export type QueryFn = (params: any, options?: any) => QueryResult<any>;
|
|
13
|
-
export type ExtractQueryParams<TQueryFn> = TQueryFn extends (params: infer TParams, ...args: any[]) => any ? TParams : never;
|
|
14
|
-
export type ExtractQueryOptions<TQueryFn> = TQueryFn extends (params: any, options?: infer TOptions) => any ? TOptions : never;
|
|
15
|
-
export type QueryDataType<TQueryFn extends QueryFn> = Exclude<ReturnType<TQueryFn>["data"], undefined>;
|
|
16
|
-
export type ExtractPageType<T> = T extends InfiniteData<infer TPage> ? TPage : T;
|
|
17
|
-
export type ExtractedDataType<TQueryFn extends QueryFn> = ExtractPageType<QueryDataType<TQueryFn>> | ExtractPageType<QueryDataType<TQueryFn>>[];
|
|
18
|
-
export type QueryAutocompleteProps<TFieldValues extends FieldValues, TSelectItem extends SelectItem<any>, TQueryFn extends QueryFn> = OmitDiscriminatedUnion<AutocompleteProps<TSelectItem["id"]>, "items" | "onSearchChange" | "isLoading" | keyof GroupedSelectProps> & GroupedSelectControlProps<TFieldValues, TSelectItem["id"]> & {
|
|
19
|
-
query: TQueryFn;
|
|
20
|
-
queryParams?: Omit<ExtractQueryParams<TQueryFn>, "search" | "limit"> & {
|
|
21
|
-
limit?: number;
|
|
22
|
-
};
|
|
23
|
-
queryOptions?: ExtractQueryOptions<TQueryFn>;
|
|
24
|
-
queryMap?: (data: ExtractedDataType<TQueryFn>) => SelectItem<TSelectItem["id"]>[];
|
|
25
|
-
isInitialQueryDisabled?: boolean;
|
|
26
|
-
};
|
|
27
|
-
export interface UseQueryAutocompleteOptions<TQueryFn extends QueryFn, TKey extends Key = Key> {
|
|
28
|
-
query: TQueryFn;
|
|
29
|
-
queryParams?: Omit<ExtractQueryParams<TQueryFn>, "search" | "limit"> & {
|
|
30
|
-
limit?: number;
|
|
31
|
-
};
|
|
32
|
-
queryOptions?: ExtractQueryOptions<TQueryFn>;
|
|
33
|
-
mapItems: (data: QueryDataType<TQueryFn>) => SelectItem<TKey>[];
|
|
34
|
-
initialQueryState?: boolean;
|
|
35
|
-
search?: string;
|
|
36
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { DefaultInitialSelectItem, GroupedSelectControlProps, GroupedSelectProps, SelectItem } from '../shared/select.types';
|
|
2
|
-
import { SelectProps } from './Select';
|
|
3
|
-
import { QueryDataType, QueryFn } from '../shared/querySelect.utils';
|
|
4
|
-
import { OmitDiscriminatedUnion } from '../../../../types/common';
|
|
5
|
-
import { Key } from 'react-aria-components';
|
|
6
|
-
import { FieldValues } from 'react-hook-form';
|
|
7
|
-
export type QuerySelectProps<TFieldValues extends FieldValues, TQueryFn extends QueryFn, TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>> = OmitDiscriminatedUnion<SelectProps<TKey, TInitialSelectItem>, "items" | "totalItems" | keyof GroupedSelectProps> & GroupedSelectControlProps<TFieldValues, TKey, TInitialSelectItem> & {
|
|
8
|
-
query: TQueryFn;
|
|
9
|
-
queryParams?: Parameters<TQueryFn>[0];
|
|
10
|
-
queryOptions?: Parameters<TQueryFn>[1];
|
|
11
|
-
queryMap?: (data: QueryDataType<TQueryFn>) => SelectItem<TKey>[];
|
|
12
|
-
isInitialQueryDisabled?: boolean;
|
|
13
|
-
};
|
|
14
|
-
export declare const QuerySelect: <TFieldValues extends FieldValues, TQueryFn extends QueryFn, TKey extends Key = Key>({ query, queryParams, queryOptions, queryMap, ...props }: QuerySelectProps<TFieldValues, TQueryFn, TKey>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
2
|
-
import { Select } from "./Select.js";
|
|
3
|
-
import { getQueryItems } from "../shared/querySelect.utils.js";
|
|
4
|
-
import { useQueryAutocomplete } from "../../../../hooks/useQueryAutocomplete.js";
|
|
5
|
-
import { c } from "react/compiler-runtime";
|
|
6
|
-
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
import { useState } from "react";
|
|
8
|
-
//#region src/components/inputs/Selection/Select/QuerySelect.tsx
|
|
9
|
-
var QuerySelect = (t0) => {
|
|
10
|
-
const $ = c(33);
|
|
11
|
-
let props;
|
|
12
|
-
let query;
|
|
13
|
-
let queryMap;
|
|
14
|
-
let queryOptions;
|
|
15
|
-
let queryParams;
|
|
16
|
-
if ($[0] !== t0) {
|
|
17
|
-
({query, queryParams, queryOptions, queryMap, ...props} = t0);
|
|
18
|
-
$[0] = t0;
|
|
19
|
-
$[1] = props;
|
|
20
|
-
$[2] = query;
|
|
21
|
-
$[3] = queryMap;
|
|
22
|
-
$[4] = queryOptions;
|
|
23
|
-
$[5] = queryParams;
|
|
24
|
-
} else {
|
|
25
|
-
props = $[1];
|
|
26
|
-
query = $[2];
|
|
27
|
-
queryMap = $[3];
|
|
28
|
-
queryOptions = $[4];
|
|
29
|
-
queryParams = $[5];
|
|
30
|
-
}
|
|
31
|
-
const ui = UIConfig.useConfig();
|
|
32
|
-
const [search, setSearch] = useState("");
|
|
33
|
-
const isSearchable = props.isSearchable ?? ui.select.isSearchable;
|
|
34
|
-
let t1;
|
|
35
|
-
if ($[6] !== queryMap) {
|
|
36
|
-
t1 = (data) => getQueryItems(data, queryMap);
|
|
37
|
-
$[6] = queryMap;
|
|
38
|
-
$[7] = t1;
|
|
39
|
-
} else t1 = $[7];
|
|
40
|
-
const t2 = isSearchable ? search : void 0;
|
|
41
|
-
const t3 = props.isInitialQueryDisabled ?? ui.querySelect?.isInitialQueryDisabled;
|
|
42
|
-
let t4;
|
|
43
|
-
if ($[8] !== query || $[9] !== queryOptions || $[10] !== queryParams || $[11] !== t1 || $[12] !== t2 || $[13] !== t3) {
|
|
44
|
-
t4 = {
|
|
45
|
-
query,
|
|
46
|
-
queryParams,
|
|
47
|
-
queryOptions,
|
|
48
|
-
mapItems: t1,
|
|
49
|
-
search: t2,
|
|
50
|
-
initialQueryState: t3
|
|
51
|
-
};
|
|
52
|
-
$[8] = query;
|
|
53
|
-
$[9] = queryOptions;
|
|
54
|
-
$[10] = queryParams;
|
|
55
|
-
$[11] = t1;
|
|
56
|
-
$[12] = t2;
|
|
57
|
-
$[13] = t3;
|
|
58
|
-
$[14] = t4;
|
|
59
|
-
} else t4 = $[14];
|
|
60
|
-
const { items, totalItems, isLoading, handleEnableQuery, hasNextPage, fetchNextPage } = useQueryAutocomplete(t4);
|
|
61
|
-
let onSearchChange;
|
|
62
|
-
let selectProps;
|
|
63
|
-
if ($[15] !== props) {
|
|
64
|
-
const { isInitialQueryDisabled: _, onSearchChange: t5, ...t6 } = props;
|
|
65
|
-
onSearchChange = t5;
|
|
66
|
-
selectProps = t6;
|
|
67
|
-
$[15] = props;
|
|
68
|
-
$[16] = onSearchChange;
|
|
69
|
-
$[17] = selectProps;
|
|
70
|
-
} else {
|
|
71
|
-
onSearchChange = $[16];
|
|
72
|
-
selectProps = $[17];
|
|
73
|
-
}
|
|
74
|
-
let t5;
|
|
75
|
-
if ($[18] !== handleEnableQuery || $[19] !== onSearchChange) {
|
|
76
|
-
t5 = (value) => {
|
|
77
|
-
setSearch(value);
|
|
78
|
-
handleEnableQuery();
|
|
79
|
-
onSearchChange?.(value);
|
|
80
|
-
};
|
|
81
|
-
$[18] = handleEnableQuery;
|
|
82
|
-
$[19] = onSearchChange;
|
|
83
|
-
$[20] = t5;
|
|
84
|
-
} else t5 = $[20];
|
|
85
|
-
const handleSearchChange = t5;
|
|
86
|
-
let t6;
|
|
87
|
-
if ($[21] !== handleSearchChange || $[22] !== isSearchable) {
|
|
88
|
-
t6 = isSearchable && {
|
|
89
|
-
isClientSearchDisabled: true,
|
|
90
|
-
onSearchChange: handleSearchChange
|
|
91
|
-
};
|
|
92
|
-
$[21] = handleSearchChange;
|
|
93
|
-
$[22] = isSearchable;
|
|
94
|
-
$[23] = t6;
|
|
95
|
-
} else t6 = $[23];
|
|
96
|
-
let t7;
|
|
97
|
-
if ($[24] !== fetchNextPage || $[25] !== handleEnableQuery || $[26] !== hasNextPage || $[27] !== isLoading || $[28] !== items || $[29] !== selectProps || $[30] !== t6 || $[31] !== totalItems) {
|
|
98
|
-
t7 = /* @__PURE__ */ jsx(Select, {
|
|
99
|
-
...selectProps,
|
|
100
|
-
items,
|
|
101
|
-
isLoading,
|
|
102
|
-
totalItems,
|
|
103
|
-
hasLoadMore: hasNextPage,
|
|
104
|
-
onLoadMore: fetchNextPage,
|
|
105
|
-
onMouseEnter: handleEnableQuery,
|
|
106
|
-
onFocusCapture: handleEnableQuery,
|
|
107
|
-
...t6
|
|
108
|
-
});
|
|
109
|
-
$[24] = fetchNextPage;
|
|
110
|
-
$[25] = handleEnableQuery;
|
|
111
|
-
$[26] = hasNextPage;
|
|
112
|
-
$[27] = isLoading;
|
|
113
|
-
$[28] = items;
|
|
114
|
-
$[29] = selectProps;
|
|
115
|
-
$[30] = t6;
|
|
116
|
-
$[31] = totalItems;
|
|
117
|
-
$[32] = t7;
|
|
118
|
-
} else t7 = $[32];
|
|
119
|
-
return t7;
|
|
120
|
-
};
|
|
121
|
-
//#endregion
|
|
122
|
-
export { QuerySelect };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { InputVariantProps } from '../../shared/input.cva';
|
|
3
|
-
interface StaticSelectTrailingContentProps extends Pick<InputVariantProps, "size"> {
|
|
4
|
-
trailingContent?: ReactNode;
|
|
5
|
-
hideDropdownIcon?: boolean;
|
|
6
|
-
isDisabled?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare const StaticSelectTrailingContent: ({ trailingContent, hideDropdownIcon, isDisabled, size, }: StaticSelectTrailingContentProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
-
export {};
|