@povio/ui 3.0.0-rc.3 → 3.1.0
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/README.md +39 -0
- 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.d.ts +4 -0
- 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.d.ts +1 -1
- package/dist/components/Menu/MenuMobile.js +39 -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.d.ts +0 -1
- package/dist/components/inputs/Checkbox/Checkbox.js +35 -201
- 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 -12
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +75 -373
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +5 -12
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +186 -492
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +5 -14
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +47 -273
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +3 -7
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +121 -611
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +3 -5
- package/dist/components/inputs/DateTime/shared/Calendar.js +120 -338
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +2 -4
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +103 -310
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +2 -4
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +33 -150
- package/dist/components/inputs/DateTime/shared/CalendarHeader.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +98 -249
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +137 -318
- package/dist/components/inputs/DateTime/shared/DateField.js +112 -286
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +3 -14
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +129 -356
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +0 -15
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +11 -96
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.d.ts +4 -1
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +28 -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 -4
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +65 -210
- package/dist/components/inputs/DateTime/shared/YearPicker.js +68 -119
- package/dist/components/inputs/File/FileUpload.js +45 -88
- 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.d.ts +2 -2
- package/dist/components/inputs/File/shared/ProgressBar.js +20 -53
- package/dist/components/inputs/File/shared/fileUpload.cva.d.ts +1 -1
- package/dist/components/inputs/File/shared/fileUpload.cva.js +1 -1
- package/dist/components/inputs/File/shared/progressBar.cva.d.ts +38 -0
- package/dist/components/inputs/File/shared/progressBar.cva.js +28 -0
- 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 +97 -447
- 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 +90 -419
- 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 -15
- package/dist/components/inputs/Inputs/InputItem.js +14 -69
- package/dist/components/inputs/Inputs/Inputs.js +11 -37
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -3
- package/dist/components/inputs/RadioGroup/RadioGroup.js +61 -353
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +0 -45
- package/dist/components/inputs/RadioGroup/radio.cva.js +1 -48
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +2 -6
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +22 -217
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +18 -3
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +8 -107
- package/dist/components/inputs/Selection/Select/Select.d.ts +3 -7
- package/dist/components/inputs/Selection/Select/Select.js +18 -227
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +3 -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 -397
- 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 +6 -11
- package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -3
- package/dist/components/inputs/Selection/shared/select.context.js +36 -67
- 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.d.ts +1 -2
- package/dist/components/inputs/Slider/Slider.js +76 -265
- 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.d.ts +0 -1
- package/dist/components/inputs/Toggle/Toggle.js +37 -214
- 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 +12 -88
- package/dist/components/inputs/shared/TooltipWrapper.js +11 -50
- package/dist/components/inputs/shared/input.cva.d.ts +0 -28
- package/dist/components/inputs/shared/input.cva.js +4 -38
- 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 +25 -98
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +8 -48
- package/dist/components/overlays/Drawer/Drawer.js +22 -64
- package/dist/components/overlays/Modal/modal.cva.js +1 -1
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.d.ts +5 -1
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +28 -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 +17 -22
- package/dist/components/status/Toast/toast.cva.d.ts +14 -3
- package/dist/components/status/Toast/toast.cva.js +12 -10
- 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 +30 -30
- package/dist/components/table/table.cva.d.ts +7 -0
- package/dist/components/table/table.cva.js +2 -1
- package/dist/components/text/Link/Link.js +7 -19
- package/dist/components/text/Pill/Pill.d.ts +15 -0
- package/dist/components/text/Pill/Pill.js +44 -0
- 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 +10 -21
- package/dist/config/uiConfig.context.js +18 -69
- package/dist/config/uiOverrides.context.d.ts +10 -20
- package/dist/config/uiOverrides.context.js +14 -54
- package/dist/helpers/dynamicInputs.d.ts +5 -5
- package/dist/helpers/dynamicInputs.js +0 -3
- package/dist/hooks/useAutosave.d.ts +1 -2
- package/dist/hooks/useAutosave.js +4 -12
- 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.d.ts +1 -3
- package/dist/hooks/useFormAutosave.js +30 -122
- 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 +7 -16
- package/dist/index.js +6 -13
- package/dist/tw-ui-plugin.js +0 -6
- package/dist/utils/date-time.utils.d.ts +10 -38
- package/dist/utils/date-time.utils.js +22 -136
- package/package.json +1 -1
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +0 -5
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +0 -16
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +0 -16
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +0 -15
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +0 -32
- 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 -40
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +0 -85
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +0 -1
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +0 -13
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +0 -14
- 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 -575
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +0 -8
- 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 -37
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +0 -14
- package/dist/components/inputs/Selection/Select/QuerySelect.js +0 -178
- 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 -14
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +0 -43
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +0 -6
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +0 -5
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +0 -12
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +0 -8
- package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +0 -23
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +0 -54
- package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +0 -1
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +0 -82
- package/dist/components/inputs/Skeleton/InputFrame.js +0 -548
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +0 -8
- 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/useAutosave.spec.d.ts +0 -1
- package/dist/hooks/useFormAutosave.spec.d.ts +0 -1
- package/dist/hooks/useKeyInteractions.d.ts +0 -20
- package/dist/hooks/useKeyInteractions.js +0 -54
- package/dist/hooks/useKeyInteractions.spec.d.ts +0 -1
- package/dist/hooks/useQueryAutocomplete.d.ts +0 -14
- package/dist/hooks/useQueryAutocomplete.js +0 -72
- package/dist/utils/query.utils.d.ts +0 -4
- package/dist/utils/query.utils.js +0 -8
|
@@ -1,575 +0,0 @@
|
|
|
1
|
-
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
2
|
-
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
3
|
-
import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
|
|
4
|
-
import { InputClear } from "../../shared/InputClear.js";
|
|
5
|
-
import { inputBaseDefinition, inputSizeDefinition } from "../../shared/input.cva.js";
|
|
6
|
-
import { InputFrame } from "../../Skeleton/InputFrame.js";
|
|
7
|
-
import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
|
|
8
|
-
import { getStaticNumberDisplayValue } from "../shared/numberStatic.utils.js";
|
|
9
|
-
import { NumberRangeField } from "./NumberRangeField.js";
|
|
10
|
-
import { c } from "react/compiler-runtime";
|
|
11
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
-
import { clsx } from "clsx";
|
|
13
|
-
import { useRef, useState } from "react";
|
|
14
|
-
import { useLocale } from "react-aria-components";
|
|
15
|
-
import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
|
|
16
|
-
import { Controller } from "react-hook-form";
|
|
17
|
-
//#region src/components/inputs/Input/NumberRangeInput/NumberRangeInput.tsx
|
|
18
|
-
var EMPTY_RANGE = {
|
|
19
|
-
min: null,
|
|
20
|
-
max: null
|
|
21
|
-
};
|
|
22
|
-
var normalizeRangeValue = (value, minValue, maxValue) => {
|
|
23
|
-
if (value) return value;
|
|
24
|
-
return {
|
|
25
|
-
min: minValue ?? null,
|
|
26
|
-
max: maxValue ?? null
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
var NumberRangeInputBase = (props) => {
|
|
30
|
-
const $ = c(114);
|
|
31
|
-
const ui = UIConfig.useConfig();
|
|
32
|
-
const inputBaseCva = UIOverrides.useCva("input.baseCva", inputBaseDefinition);
|
|
33
|
-
const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
|
|
34
|
-
let asProp;
|
|
35
|
-
let autoFocusOnMount;
|
|
36
|
-
let className;
|
|
37
|
-
let error;
|
|
38
|
-
let errorClassName;
|
|
39
|
-
let headerClassName;
|
|
40
|
-
let helperText;
|
|
41
|
-
let hideLabelProps;
|
|
42
|
-
let inputClassName;
|
|
43
|
-
let isClearableProps;
|
|
44
|
-
let isDirty;
|
|
45
|
-
let isDisabled;
|
|
46
|
-
let isHeaderHidden;
|
|
47
|
-
let isRequired;
|
|
48
|
-
let label;
|
|
49
|
-
let maxInputClassName;
|
|
50
|
-
let maxValue;
|
|
51
|
-
let minInputClassName;
|
|
52
|
-
let minValue;
|
|
53
|
-
let onBlur;
|
|
54
|
-
let onChange;
|
|
55
|
-
let onMaxChange;
|
|
56
|
-
let onMinChange;
|
|
57
|
-
let ref;
|
|
58
|
-
let rest;
|
|
59
|
-
let rightContent;
|
|
60
|
-
let sizeProps;
|
|
61
|
-
let t0;
|
|
62
|
-
let t1;
|
|
63
|
-
let t2;
|
|
64
|
-
let t3;
|
|
65
|
-
let t4;
|
|
66
|
-
let t5;
|
|
67
|
-
let tooltipText;
|
|
68
|
-
let value;
|
|
69
|
-
let variantProps;
|
|
70
|
-
if ($[0] !== props) {
|
|
71
|
-
({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);
|
|
72
|
-
$[0] = props;
|
|
73
|
-
$[1] = asProp;
|
|
74
|
-
$[2] = autoFocusOnMount;
|
|
75
|
-
$[3] = className;
|
|
76
|
-
$[4] = error;
|
|
77
|
-
$[5] = errorClassName;
|
|
78
|
-
$[6] = headerClassName;
|
|
79
|
-
$[7] = helperText;
|
|
80
|
-
$[8] = hideLabelProps;
|
|
81
|
-
$[9] = inputClassName;
|
|
82
|
-
$[10] = isClearableProps;
|
|
83
|
-
$[11] = isDirty;
|
|
84
|
-
$[12] = isDisabled;
|
|
85
|
-
$[13] = isHeaderHidden;
|
|
86
|
-
$[14] = isRequired;
|
|
87
|
-
$[15] = label;
|
|
88
|
-
$[16] = maxInputClassName;
|
|
89
|
-
$[17] = maxValue;
|
|
90
|
-
$[18] = minInputClassName;
|
|
91
|
-
$[19] = minValue;
|
|
92
|
-
$[20] = onBlur;
|
|
93
|
-
$[21] = onChange;
|
|
94
|
-
$[22] = onMaxChange;
|
|
95
|
-
$[23] = onMinChange;
|
|
96
|
-
$[24] = ref;
|
|
97
|
-
$[25] = rest;
|
|
98
|
-
$[26] = rightContent;
|
|
99
|
-
$[27] = sizeProps;
|
|
100
|
-
$[28] = t0;
|
|
101
|
-
$[29] = t1;
|
|
102
|
-
$[30] = t2;
|
|
103
|
-
$[31] = t3;
|
|
104
|
-
$[32] = t4;
|
|
105
|
-
$[33] = t5;
|
|
106
|
-
$[34] = tooltipText;
|
|
107
|
-
$[35] = value;
|
|
108
|
-
$[36] = variantProps;
|
|
109
|
-
} else {
|
|
110
|
-
asProp = $[1];
|
|
111
|
-
autoFocusOnMount = $[2];
|
|
112
|
-
className = $[3];
|
|
113
|
-
error = $[4];
|
|
114
|
-
errorClassName = $[5];
|
|
115
|
-
headerClassName = $[6];
|
|
116
|
-
helperText = $[7];
|
|
117
|
-
hideLabelProps = $[8];
|
|
118
|
-
inputClassName = $[9];
|
|
119
|
-
isClearableProps = $[10];
|
|
120
|
-
isDirty = $[11];
|
|
121
|
-
isDisabled = $[12];
|
|
122
|
-
isHeaderHidden = $[13];
|
|
123
|
-
isRequired = $[14];
|
|
124
|
-
label = $[15];
|
|
125
|
-
maxInputClassName = $[16];
|
|
126
|
-
maxValue = $[17];
|
|
127
|
-
minInputClassName = $[18];
|
|
128
|
-
minValue = $[19];
|
|
129
|
-
onBlur = $[20];
|
|
130
|
-
onChange = $[21];
|
|
131
|
-
onMaxChange = $[22];
|
|
132
|
-
onMinChange = $[23];
|
|
133
|
-
ref = $[24];
|
|
134
|
-
rest = $[25];
|
|
135
|
-
rightContent = $[26];
|
|
136
|
-
sizeProps = $[27];
|
|
137
|
-
t0 = $[28];
|
|
138
|
-
t1 = $[29];
|
|
139
|
-
t2 = $[30];
|
|
140
|
-
t3 = $[31];
|
|
141
|
-
t4 = $[32];
|
|
142
|
-
t5 = $[33];
|
|
143
|
-
tooltipText = $[34];
|
|
144
|
-
value = $[35];
|
|
145
|
-
variantProps = $[36];
|
|
146
|
-
}
|
|
147
|
-
const minPlaceholder = t0 === void 0 ? "Min" : t0;
|
|
148
|
-
const maxPlaceholder = t1 === void 0 ? "Max" : t1;
|
|
149
|
-
const minLabel = t2 === void 0 ? "Minimum" : t2;
|
|
150
|
-
const maxLabel = t3 === void 0 ? "Maximum" : t3;
|
|
151
|
-
const invalidRangeError = t4 === void 0 ? "Minimum cannot be greater than maximum" : t4;
|
|
152
|
-
const hideInnerLabels = t5 === void 0 ? true : t5;
|
|
153
|
-
const isClearable = isClearableProps ?? ui.input.isClearable;
|
|
154
|
-
const as = asProp ?? ui.input.as;
|
|
155
|
-
const variant = variantProps ?? ui.input.variant;
|
|
156
|
-
const size = sizeProps ?? ui.input.size;
|
|
157
|
-
const hideLabel = hideLabelProps ?? ui.input.hideLabel;
|
|
158
|
-
let t6;
|
|
159
|
-
if ($[37] !== maxValue || $[38] !== minValue || $[39] !== value) {
|
|
160
|
-
t6 = normalizeRangeValue(value, minValue, maxValue);
|
|
161
|
-
$[37] = maxValue;
|
|
162
|
-
$[38] = minValue;
|
|
163
|
-
$[39] = value;
|
|
164
|
-
$[40] = t6;
|
|
165
|
-
} else t6 = $[40];
|
|
166
|
-
const rangeValue = t6;
|
|
167
|
-
const isEmpty = rangeValue.min === null && rangeValue.max === null;
|
|
168
|
-
const rangeError = rangeValue.min !== null && rangeValue.max !== null && rangeValue.min > rangeValue.max ? invalidRangeError : void 0;
|
|
169
|
-
const effectiveError = error || rangeError;
|
|
170
|
-
let t7;
|
|
171
|
-
if ($[41] !== isDisabled) {
|
|
172
|
-
t7 = { isDisabled };
|
|
173
|
-
$[41] = isDisabled;
|
|
174
|
-
$[42] = t7;
|
|
175
|
-
} else t7 = $[42];
|
|
176
|
-
const { hoverProps, isHovered } = useHover(t7);
|
|
177
|
-
const { isFocusVisible } = useFocusVisible();
|
|
178
|
-
const [isFocused, setIsFocused] = useState(false);
|
|
179
|
-
let t8;
|
|
180
|
-
if ($[43] === Symbol.for("react.memo_cache_sentinel")) {
|
|
181
|
-
t8 = { onFocusWithinChange: setIsFocused };
|
|
182
|
-
$[43] = t8;
|
|
183
|
-
} else t8 = $[43];
|
|
184
|
-
const { focusWithinProps } = useFocusWithin(t8);
|
|
185
|
-
const t9 = isHeaderHidden || as === "inline" || as === "filter" || as === "floating";
|
|
186
|
-
let t10;
|
|
187
|
-
if ($[44] !== effectiveError || $[45] !== errorClassName || $[46] !== headerClassName || $[47] !== helperText || $[48] !== hideLabel || $[49] !== isDisabled || $[50] !== isRequired || $[51] !== label || $[52] !== rightContent || $[53] !== t9 || $[54] !== tooltipText) {
|
|
188
|
-
t10 = {
|
|
189
|
-
error: effectiveError,
|
|
190
|
-
label,
|
|
191
|
-
tooltipText,
|
|
192
|
-
helperText,
|
|
193
|
-
isRequired,
|
|
194
|
-
rightContent,
|
|
195
|
-
isHeaderHidden: t9,
|
|
196
|
-
hideLabel,
|
|
197
|
-
isDisabled,
|
|
198
|
-
headerClassName,
|
|
199
|
-
errorClassName
|
|
200
|
-
};
|
|
201
|
-
$[44] = effectiveError;
|
|
202
|
-
$[45] = errorClassName;
|
|
203
|
-
$[46] = headerClassName;
|
|
204
|
-
$[47] = helperText;
|
|
205
|
-
$[48] = hideLabel;
|
|
206
|
-
$[49] = isDisabled;
|
|
207
|
-
$[50] = isRequired;
|
|
208
|
-
$[51] = label;
|
|
209
|
-
$[52] = rightContent;
|
|
210
|
-
$[53] = t9;
|
|
211
|
-
$[54] = tooltipText;
|
|
212
|
-
$[55] = t10;
|
|
213
|
-
} else t10 = $[55];
|
|
214
|
-
const formFieldProps = t10;
|
|
215
|
-
const t11 = hideLabel || isHeaderHidden;
|
|
216
|
-
let t12;
|
|
217
|
-
if ($[56] !== headerClassName || $[57] !== helperText || $[58] !== isDisabled || $[59] !== isRequired || $[60] !== label || $[61] !== rightContent || $[62] !== t11 || $[63] !== tooltipText) {
|
|
218
|
-
t12 = {
|
|
219
|
-
label,
|
|
220
|
-
tooltipText,
|
|
221
|
-
helperText,
|
|
222
|
-
isRequired,
|
|
223
|
-
rightContent,
|
|
224
|
-
isHeaderHidden: t11,
|
|
225
|
-
isDisabled,
|
|
226
|
-
className: headerClassName
|
|
227
|
-
};
|
|
228
|
-
$[56] = headerClassName;
|
|
229
|
-
$[57] = helperText;
|
|
230
|
-
$[58] = isDisabled;
|
|
231
|
-
$[59] = isRequired;
|
|
232
|
-
$[60] = label;
|
|
233
|
-
$[61] = rightContent;
|
|
234
|
-
$[62] = t11;
|
|
235
|
-
$[63] = tooltipText;
|
|
236
|
-
$[64] = t12;
|
|
237
|
-
} else t12 = $[64];
|
|
238
|
-
const headerProps = t12;
|
|
239
|
-
let t13;
|
|
240
|
-
if ($[65] !== onChange || $[66] !== onMaxChange || $[67] !== onMinChange || $[68] !== rangeValue) {
|
|
241
|
-
t13 = (side, nextValue) => {
|
|
242
|
-
const nextRange = {
|
|
243
|
-
...rangeValue,
|
|
244
|
-
[side]: nextValue
|
|
245
|
-
};
|
|
246
|
-
onChange?.(nextRange);
|
|
247
|
-
if (side === "min") onMinChange?.(nextValue);
|
|
248
|
-
else onMaxChange?.(nextValue);
|
|
249
|
-
};
|
|
250
|
-
$[65] = onChange;
|
|
251
|
-
$[66] = onMaxChange;
|
|
252
|
-
$[67] = onMinChange;
|
|
253
|
-
$[68] = rangeValue;
|
|
254
|
-
$[69] = t13;
|
|
255
|
-
} else t13 = $[69];
|
|
256
|
-
const updateRange = t13;
|
|
257
|
-
let t14;
|
|
258
|
-
if ($[70] !== onBlur || $[71] !== updateRange) {
|
|
259
|
-
t14 = (side_0) => {
|
|
260
|
-
updateRange(side_0, null);
|
|
261
|
-
onBlur?.({ target: { value: "" } });
|
|
262
|
-
};
|
|
263
|
-
$[70] = onBlur;
|
|
264
|
-
$[71] = updateRange;
|
|
265
|
-
$[72] = t14;
|
|
266
|
-
} else t14 = $[72];
|
|
267
|
-
const clearRangeSide = t14;
|
|
268
|
-
let t15;
|
|
269
|
-
if ($[73] !== as || $[74] !== inputBaseCva || $[75] !== variant) {
|
|
270
|
-
t15 = inputBaseCva({
|
|
271
|
-
variant,
|
|
272
|
-
as
|
|
273
|
-
});
|
|
274
|
-
$[73] = as;
|
|
275
|
-
$[74] = inputBaseCva;
|
|
276
|
-
$[75] = variant;
|
|
277
|
-
$[76] = t15;
|
|
278
|
-
} else t15 = $[76];
|
|
279
|
-
let t16;
|
|
280
|
-
if ($[77] !== as || $[78] !== inputSizeCva || $[79] !== size) {
|
|
281
|
-
t16 = inputSizeCva({
|
|
282
|
-
size,
|
|
283
|
-
as
|
|
284
|
-
});
|
|
285
|
-
$[77] = as;
|
|
286
|
-
$[78] = inputSizeCva;
|
|
287
|
-
$[79] = size;
|
|
288
|
-
$[80] = t16;
|
|
289
|
-
} else t16 = $[80];
|
|
290
|
-
let t17;
|
|
291
|
-
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) {
|
|
292
|
-
t17 = /* @__PURE__ */ jsx(NumberRangeField, {
|
|
293
|
-
...rest,
|
|
294
|
-
ref,
|
|
295
|
-
as,
|
|
296
|
-
className,
|
|
297
|
-
inputClassName,
|
|
298
|
-
minInputClassName,
|
|
299
|
-
maxInputClassName,
|
|
300
|
-
inputBaseClassName: t15,
|
|
301
|
-
inputSizeClassName: t16,
|
|
302
|
-
formFieldProps,
|
|
303
|
-
headerProps,
|
|
304
|
-
rangeValue,
|
|
305
|
-
effectiveError,
|
|
306
|
-
minPlaceholder,
|
|
307
|
-
maxPlaceholder,
|
|
308
|
-
minLabel,
|
|
309
|
-
maxLabel,
|
|
310
|
-
hideInnerLabels,
|
|
311
|
-
isDirty,
|
|
312
|
-
isClearable,
|
|
313
|
-
autoFocusOnMount,
|
|
314
|
-
isDisabled,
|
|
315
|
-
isRequired,
|
|
316
|
-
isEmpty,
|
|
317
|
-
isHovered,
|
|
318
|
-
isFocused,
|
|
319
|
-
isFocusVisible,
|
|
320
|
-
focusWithinProps,
|
|
321
|
-
hoverProps,
|
|
322
|
-
onRangeSideChange: updateRange,
|
|
323
|
-
onRangeSideClear: clearRangeSide,
|
|
324
|
-
onBlur
|
|
325
|
-
});
|
|
326
|
-
$[81] = as;
|
|
327
|
-
$[82] = autoFocusOnMount;
|
|
328
|
-
$[83] = className;
|
|
329
|
-
$[84] = clearRangeSide;
|
|
330
|
-
$[85] = effectiveError;
|
|
331
|
-
$[86] = focusWithinProps;
|
|
332
|
-
$[87] = formFieldProps;
|
|
333
|
-
$[88] = headerProps;
|
|
334
|
-
$[89] = hideInnerLabels;
|
|
335
|
-
$[90] = hoverProps;
|
|
336
|
-
$[91] = inputClassName;
|
|
337
|
-
$[92] = isClearable;
|
|
338
|
-
$[93] = isDirty;
|
|
339
|
-
$[94] = isDisabled;
|
|
340
|
-
$[95] = isEmpty;
|
|
341
|
-
$[96] = isFocusVisible;
|
|
342
|
-
$[97] = isFocused;
|
|
343
|
-
$[98] = isHovered;
|
|
344
|
-
$[99] = isRequired;
|
|
345
|
-
$[100] = maxInputClassName;
|
|
346
|
-
$[101] = maxLabel;
|
|
347
|
-
$[102] = maxPlaceholder;
|
|
348
|
-
$[103] = minInputClassName;
|
|
349
|
-
$[104] = minLabel;
|
|
350
|
-
$[105] = minPlaceholder;
|
|
351
|
-
$[106] = onBlur;
|
|
352
|
-
$[107] = rangeValue;
|
|
353
|
-
$[108] = ref;
|
|
354
|
-
$[109] = rest;
|
|
355
|
-
$[110] = t15;
|
|
356
|
-
$[111] = t16;
|
|
357
|
-
$[112] = updateRange;
|
|
358
|
-
$[113] = t17;
|
|
359
|
-
} else t17 = $[113];
|
|
360
|
-
return t17;
|
|
361
|
-
};
|
|
362
|
-
var NumberRangeInputInner = (t0) => {
|
|
363
|
-
const $ = c(5);
|
|
364
|
-
const { renderStaticInput, isFormControlDisabled, ...props } = t0;
|
|
365
|
-
const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
|
|
366
|
-
const ui = UIConfig.useConfig();
|
|
367
|
-
const { locale } = useLocale();
|
|
368
|
-
const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
|
|
369
|
-
const inputRef = useRef(null);
|
|
370
|
-
let t1;
|
|
371
|
-
if ($[0] !== renderInput) {
|
|
372
|
-
t1 = {
|
|
373
|
-
inputRef,
|
|
374
|
-
renderInput,
|
|
375
|
-
setRenderInput
|
|
376
|
-
};
|
|
377
|
-
$[0] = renderInput;
|
|
378
|
-
$[1] = t1;
|
|
379
|
-
} else t1 = $[1];
|
|
380
|
-
const { shouldFocus, renderRealInput } = useStaticInputHandoff(t1);
|
|
381
|
-
if (!renderInput) {
|
|
382
|
-
const staticValue = normalizeRangeValue(props.value, props.minValue, props.maxValue);
|
|
383
|
-
const formatOptions = props.formatOptions ?? ui.numberInput.formatOptions;
|
|
384
|
-
const formatter = new Intl.NumberFormat(locale, formatOptions);
|
|
385
|
-
const minDisplay = getStaticNumberDisplayValue(staticValue.min, formatter);
|
|
386
|
-
const maxDisplay = getStaticNumberDisplayValue(staticValue.max, formatter);
|
|
387
|
-
const hasValue = minDisplay !== null || maxDisplay !== null;
|
|
388
|
-
const rangeError = staticValue.min !== null && staticValue.max !== null && staticValue.min > staticValue.max ? props.invalidRangeError ?? "Minimum cannot be greater than maximum" : void 0;
|
|
389
|
-
const effectiveError = props.error || rangeError;
|
|
390
|
-
const as = props.as ?? ui.input.as;
|
|
391
|
-
const size = props.size ?? ui.input.size;
|
|
392
|
-
let isDisabled = !!props.isDisabled;
|
|
393
|
-
if (isFormControlDisabled) isDisabled = true;
|
|
394
|
-
const isClearable = props.isClearable ?? ui.input.isClearable;
|
|
395
|
-
const dataAttributes = {
|
|
396
|
-
dataIsEmpty: !hasValue,
|
|
397
|
-
dataIsFilled: hasValue,
|
|
398
|
-
dataIsDirty: props.isDirty,
|
|
399
|
-
dataIsRequired: props.isRequired,
|
|
400
|
-
dataIsDisabled: isDisabled,
|
|
401
|
-
dataDisabled: isDisabled,
|
|
402
|
-
dataInvalid: !!effectiveError,
|
|
403
|
-
dataHasSelection: hasValue
|
|
404
|
-
};
|
|
405
|
-
return /* @__PURE__ */ jsx(InputFrame, {
|
|
406
|
-
...props,
|
|
407
|
-
error: effectiveError,
|
|
408
|
-
isDisabled,
|
|
409
|
-
className: clsx("group w-full", as === "inline" && "h-full", props.className),
|
|
410
|
-
inputClassName: props.inputClassName,
|
|
411
|
-
contentClassName: "pr-0!",
|
|
412
|
-
trailingClassName: "py-0! pl-0!",
|
|
413
|
-
contentWrapperClassName: clsx("flex w-full items-center gap-input-gap-input-text-to-elements pr-0! py-0! px-0!", inputSizeCva({
|
|
414
|
-
size,
|
|
415
|
-
as
|
|
416
|
-
})),
|
|
417
|
-
dataAttributes,
|
|
418
|
-
renderStatic: true,
|
|
419
|
-
onStaticInteract: renderRealInput,
|
|
420
|
-
isClearable: false,
|
|
421
|
-
labelPlacement: "content-wrapper",
|
|
422
|
-
children: (t2) => {
|
|
423
|
-
const { id, ...dataAttributeProps } = t2;
|
|
424
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
425
|
-
/* @__PURE__ */ jsxs("div", {
|
|
426
|
-
className: "min-w-0 flex-1",
|
|
427
|
-
children: [/* @__PURE__ */ jsx(FormFieldLabel, {
|
|
428
|
-
label: props.minLabel ?? "Minimum",
|
|
429
|
-
isRequired: props.isRequired,
|
|
430
|
-
isDisabled,
|
|
431
|
-
className: clsx((props.hideInnerLabels ?? true) && "sr-only")
|
|
432
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
433
|
-
className: "flex items-center gap-input-gap-trailing-elements",
|
|
434
|
-
children: [/* @__PURE__ */ jsx("input", {
|
|
435
|
-
id,
|
|
436
|
-
readOnly: true,
|
|
437
|
-
disabled: isDisabled,
|
|
438
|
-
tabIndex: -1,
|
|
439
|
-
value: minDisplay ?? "",
|
|
440
|
-
placeholder: props.minPlaceholder ?? "Min",
|
|
441
|
-
className: clsx("w-full min-w-0 bg-transparent outline-none", props.minInputClassName),
|
|
442
|
-
...dataAttributeProps,
|
|
443
|
-
"data-rac": true
|
|
444
|
-
}), isClearable && /* @__PURE__ */ jsx(InputClear, {
|
|
445
|
-
onClear: _temp,
|
|
446
|
-
show: staticValue.min !== null,
|
|
447
|
-
renderStatic: true
|
|
448
|
-
})]
|
|
449
|
-
})]
|
|
450
|
-
}),
|
|
451
|
-
/* @__PURE__ */ jsx("span", {
|
|
452
|
-
className: "pointer-events-none shrink-0 select-none text-label-2 text-text-default-3",
|
|
453
|
-
children: "-"
|
|
454
|
-
}),
|
|
455
|
-
/* @__PURE__ */ jsxs("div", {
|
|
456
|
-
className: "min-w-0 flex-1",
|
|
457
|
-
children: [/* @__PURE__ */ jsx(FormFieldLabel, {
|
|
458
|
-
label: props.maxLabel ?? "Maximum",
|
|
459
|
-
isRequired: props.isRequired,
|
|
460
|
-
isDisabled,
|
|
461
|
-
className: clsx((props.hideInnerLabels ?? true) && "sr-only")
|
|
462
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
463
|
-
className: "flex items-center gap-input-gap-trailing-elements",
|
|
464
|
-
children: [/* @__PURE__ */ jsx("input", {
|
|
465
|
-
id: `${id}-max`,
|
|
466
|
-
readOnly: true,
|
|
467
|
-
disabled: isDisabled,
|
|
468
|
-
tabIndex: -1,
|
|
469
|
-
value: maxDisplay ?? "",
|
|
470
|
-
placeholder: props.maxPlaceholder ?? "Max",
|
|
471
|
-
className: clsx("w-full min-w-0 bg-transparent outline-none", props.maxInputClassName),
|
|
472
|
-
...dataAttributeProps,
|
|
473
|
-
"data-rac": true
|
|
474
|
-
}), isClearable && /* @__PURE__ */ jsx(InputClear, {
|
|
475
|
-
onClear: _temp2,
|
|
476
|
-
show: staticValue.max !== null,
|
|
477
|
-
renderStatic: true
|
|
478
|
-
})]
|
|
479
|
-
})]
|
|
480
|
-
})
|
|
481
|
-
] });
|
|
482
|
-
}
|
|
483
|
-
});
|
|
484
|
-
}
|
|
485
|
-
let t2;
|
|
486
|
-
if ($[2] !== props || $[3] !== shouldFocus) {
|
|
487
|
-
t2 = /* @__PURE__ */ jsx(NumberRangeInputBase, {
|
|
488
|
-
...props,
|
|
489
|
-
autoFocusOnMount: shouldFocus
|
|
490
|
-
});
|
|
491
|
-
$[2] = props;
|
|
492
|
-
$[3] = shouldFocus;
|
|
493
|
-
$[4] = t2;
|
|
494
|
-
} else t2 = $[4];
|
|
495
|
-
return t2;
|
|
496
|
-
};
|
|
497
|
-
var NumberRangeInput = (t0) => {
|
|
498
|
-
const $ = c(19);
|
|
499
|
-
let props;
|
|
500
|
-
let renderStaticInput;
|
|
501
|
-
if ($[0] !== t0) {
|
|
502
|
-
({renderStaticInput, ...props} = t0);
|
|
503
|
-
$[0] = t0;
|
|
504
|
-
$[1] = props;
|
|
505
|
-
$[2] = renderStaticInput;
|
|
506
|
-
} else {
|
|
507
|
-
props = $[1];
|
|
508
|
-
renderStaticInput = $[2];
|
|
509
|
-
}
|
|
510
|
-
if ("formControl" in props && props.formControl) {
|
|
511
|
-
let formControl;
|
|
512
|
-
let innerProps;
|
|
513
|
-
if ($[3] !== props) {
|
|
514
|
-
({formControl, ...innerProps} = props);
|
|
515
|
-
$[3] = props;
|
|
516
|
-
$[4] = formControl;
|
|
517
|
-
$[5] = innerProps;
|
|
518
|
-
} else {
|
|
519
|
-
formControl = $[4];
|
|
520
|
-
innerProps = $[5];
|
|
521
|
-
}
|
|
522
|
-
const controlWithOptions = formControl.control;
|
|
523
|
-
let t1;
|
|
524
|
-
if ($[6] !== controlWithOptions._options?.disabled || $[7] !== innerProps || $[8] !== props.error || $[9] !== props.isDisabled || $[10] !== renderStaticInput) {
|
|
525
|
-
t1 = (t2) => {
|
|
526
|
-
const { field, fieldState: t3 } = t2;
|
|
527
|
-
const { error } = t3;
|
|
528
|
-
return /* @__PURE__ */ jsx(NumberRangeInputInner, {
|
|
529
|
-
...innerProps,
|
|
530
|
-
value: field.value ?? EMPTY_RANGE,
|
|
531
|
-
onChange: field.onChange,
|
|
532
|
-
onBlur: field.onBlur,
|
|
533
|
-
isDisabled: field.disabled || !!controlWithOptions._options?.disabled || props.isDisabled,
|
|
534
|
-
isFormControlDisabled: !!controlWithOptions._options?.disabled,
|
|
535
|
-
error: props.error ?? error?.message,
|
|
536
|
-
renderStaticInput
|
|
537
|
-
});
|
|
538
|
-
};
|
|
539
|
-
$[6] = controlWithOptions._options?.disabled;
|
|
540
|
-
$[7] = innerProps;
|
|
541
|
-
$[8] = props.error;
|
|
542
|
-
$[9] = props.isDisabled;
|
|
543
|
-
$[10] = renderStaticInput;
|
|
544
|
-
$[11] = t1;
|
|
545
|
-
} else t1 = $[11];
|
|
546
|
-
let t2;
|
|
547
|
-
if ($[12] !== formControl.control || $[13] !== formControl.name || $[14] !== t1) {
|
|
548
|
-
t2 = /* @__PURE__ */ jsx(Controller, {
|
|
549
|
-
control: formControl.control,
|
|
550
|
-
name: formControl.name,
|
|
551
|
-
render: t1
|
|
552
|
-
});
|
|
553
|
-
$[12] = formControl.control;
|
|
554
|
-
$[13] = formControl.name;
|
|
555
|
-
$[14] = t1;
|
|
556
|
-
$[15] = t2;
|
|
557
|
-
} else t2 = $[15];
|
|
558
|
-
return t2;
|
|
559
|
-
}
|
|
560
|
-
let t1;
|
|
561
|
-
if ($[16] !== props || $[17] !== renderStaticInput) {
|
|
562
|
-
t1 = /* @__PURE__ */ jsx(NumberRangeInputInner, {
|
|
563
|
-
...props,
|
|
564
|
-
renderStaticInput
|
|
565
|
-
});
|
|
566
|
-
$[16] = props;
|
|
567
|
-
$[17] = renderStaticInput;
|
|
568
|
-
$[18] = t1;
|
|
569
|
-
} else t1 = $[18];
|
|
570
|
-
return t1;
|
|
571
|
-
};
|
|
572
|
-
function _temp() {}
|
|
573
|
-
function _temp2() {}
|
|
574
|
-
//#endregion
|
|
575
|
-
export { NumberRangeInput };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { UIOverrides } from '../../../../config/uiOverrides.context';
|
|
2
|
-
export declare const textAreaWrapperDefinition: {
|
|
3
|
-
base: string[];
|
|
4
|
-
config?: import("../../../../utils/style-merge.util").StyleMergeUtils.Config<Record<never, never>>;
|
|
5
|
-
};
|
|
6
|
-
export type TextAreaWrapperConfig = NonNullable<typeof textAreaWrapperDefinition.config>;
|
|
7
|
-
export interface TextAreaWrapperVariantProps extends UIOverrides.VariantProps<TextAreaWrapperConfig> {
|
|
8
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
2
|
-
//#region src/components/inputs/Input/TextArea/TextArea.cva.ts
|
|
3
|
-
var textAreaWrapperDefinition = UIOverrides.defineConfig({ base: ["group/text-area relative h-full"] });
|
|
4
|
-
//#endregion
|
|
5
|
-
export { textAreaWrapperDefinition };
|
|
@@ -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,37 +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
|
-
selectedIdsToResolve?: TKey[];
|
|
37
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Key } from 'react-aria-components';
|
|
2
|
-
import { FieldValues } from 'react-hook-form';
|
|
3
|
-
import { DefaultInitialSelectItem, GroupedSelectControlProps, GroupedSelectProps, SelectItem } from '../shared/select.types';
|
|
4
|
-
import { SelectProps } from './Select';
|
|
5
|
-
import { QueryDataType, QueryFn } from '../shared/querySelect.utils';
|
|
6
|
-
import { OmitDiscriminatedUnion } from '../../../../types/common';
|
|
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, TInitialSelectItem = DefaultInitialSelectItem<TKey>>(props: QuerySelectProps<TFieldValues, TQueryFn, TKey, TInitialSelectItem>) => import("react/jsx-runtime").JSX.Element;
|