@povio/ui 3.1.0 → 3.2.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/dist/assets/icons/AlignCenter.js +26 -11
- package/dist/assets/icons/AlignLeft.js +26 -11
- package/dist/assets/icons/AlignLeftRight.js +26 -11
- package/dist/assets/icons/AlignRight.js +26 -11
- package/dist/assets/icons/ArrowDropDown.js +26 -11
- package/dist/assets/icons/ArrowDropUp.js +26 -11
- package/dist/assets/icons/ArrowLeft.js +26 -11
- package/dist/assets/icons/ArrowRight.js +26 -11
- package/dist/assets/icons/Bold.js +26 -11
- package/dist/assets/icons/BulletedList.js +26 -11
- package/dist/assets/icons/Calendar.js +28 -13
- package/dist/assets/icons/Check.js +28 -13
- package/dist/assets/icons/CheckCircle.js +26 -11
- package/dist/assets/icons/CheckboxCheckmark.js +29 -14
- package/dist/assets/icons/CheckboxIndeterminate.js +29 -14
- package/dist/assets/icons/ChevronDown.js +28 -13
- package/dist/assets/icons/ChevronLeft.js +28 -13
- package/dist/assets/icons/ChevronRight.js +28 -13
- package/dist/assets/icons/ChevronUp.js +28 -13
- package/dist/assets/icons/ChevronsLeft.js +28 -13
- package/dist/assets/icons/ChevronsRight.js +28 -13
- package/dist/assets/icons/Clock.js +26 -11
- package/dist/assets/icons/Close.js +26 -11
- package/dist/assets/icons/DateTime.js +35 -14
- package/dist/assets/icons/DragIndicator.js +26 -11
- package/dist/assets/icons/File.js +28 -13
- package/dist/assets/icons/Highlight.js +26 -11
- package/dist/assets/icons/HighlightOn.js +49 -15
- package/dist/assets/icons/Home.js +26 -11
- package/dist/assets/icons/Info.js +37 -16
- package/dist/assets/icons/Italic.js +26 -11
- package/dist/assets/icons/Link.js +26 -11
- package/dist/assets/icons/Menu.js +26 -11
- package/dist/assets/icons/NumberedList.js +26 -11
- package/dist/assets/icons/PointerHorizontal.js +26 -11
- package/dist/assets/icons/PointerVertical.js +26 -11
- package/dist/assets/icons/Search.js +26 -11
- package/dist/assets/icons/Send.js +28 -13
- package/dist/assets/icons/Strikethrough.js +26 -11
- package/dist/assets/icons/TextColor.js +48 -14
- package/dist/assets/icons/Today.js +26 -11
- package/dist/assets/icons/Underlined.js +28 -13
- package/dist/assets/icons/Upload.js +35 -14
- package/dist/assets/icons/Visibility.js +26 -11
- package/dist/assets/icons/VisibilityOff.js +26 -11
- package/dist/assets/icons/WarningFilled.js +28 -13
- package/dist/components/Breadcrumbs/Breadcrumbs.js +207 -56
- package/dist/components/Menu/Menu.js +18 -2
- package/dist/components/Menu/MenuDesktop.js +41 -7
- package/dist/components/Menu/MenuItem.js +32 -9
- package/dist/components/Menu/MenuMobile.js +102 -39
- package/dist/components/Menu/MenuPopover.js +105 -29
- package/dist/components/buttons/Button/button.cva.d.ts +3 -3
- package/dist/components/buttons/IconButton/IconButton.js +40 -8
- package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +2 -1
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
- package/dist/components/buttons/PillButton/PillButton.js +55 -17
- package/dist/components/buttons/PillButton/pillButton.cva.d.ts +1 -1
- package/dist/components/buttons/SplitButton/SplitButton.js +103 -18
- package/dist/components/buttons/TextButton/TextButton.js +30 -8
- package/dist/components/buttons/ToggleButton/ToggleButton.js +28 -8
- package/dist/components/buttons/shared/ButtonContent.js +80 -22
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/inputs/Checkbox/Checkbox.js +201 -35
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +3 -0
- package/dist/components/inputs/Checkbox/checkbox.cva.js +2 -1
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +12 -5
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +380 -75
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +12 -5
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +499 -186
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +14 -5
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +280 -46
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +7 -3
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +616 -121
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +5 -2
- package/dist/components/inputs/DateTime/shared/Calendar.js +342 -119
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +4 -2
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +310 -103
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +4 -2
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +150 -33
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +233 -98
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
- package/dist/components/inputs/DateTime/shared/DateField.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/DateField.js +288 -112
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +14 -3
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +359 -129
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +18 -1
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +104 -11
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +83 -28
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +103 -58
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +193 -82
- package/dist/components/inputs/DateTime/shared/TimeField.js +27 -8
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +279 -110
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +4 -1
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +211 -65
- package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +5 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +16 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +16 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +15 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +32 -0
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +2 -0
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +1 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +41 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +99 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +1 -0
- package/dist/components/inputs/File/FileUpload.js +91 -46
- package/dist/components/inputs/File/FileUploadContainer.js +15 -7
- package/dist/components/inputs/File/InputUpload.js +317 -79
- package/dist/components/inputs/File/index.d.ts +1 -1
- package/dist/components/inputs/File/shared/FileCard.js +104 -41
- package/dist/components/inputs/File/shared/FileCardList.js +47 -12
- package/dist/components/inputs/File/shared/FileUploadContent.js +175 -44
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +149 -46
- package/dist/components/inputs/File/shared/FileUploadContentError.js +234 -93
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +230 -97
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +199 -55
- package/dist/components/inputs/File/shared/InputUploadContent.js +148 -34
- package/dist/components/inputs/File/shared/InputUploadFilled.js +49 -8
- package/dist/components/inputs/File/shared/ProgressBar.js +102 -15
- package/dist/components/inputs/File/shared/fileUpload.cva.d.ts +0 -11
- package/dist/components/inputs/File/shared/fileUpload.cva.js +1 -18
- package/dist/components/inputs/FormField/FormField.d.ts +3 -3
- package/dist/components/inputs/FormField/FormField.js +119 -37
- package/dist/components/inputs/FormField/FormFieldError.js +25 -5
- package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldHeader.js +81 -22
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +31 -7
- package/dist/components/inputs/FormField/FormFieldHelper.js +26 -6
- package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldLabel.js +40 -9
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +13 -0
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +14 -0
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +5 -2
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +446 -97
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +45 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +571 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +35 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +574 -0
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +8 -0
- package/dist/components/inputs/Input/TextArea/TextArea.cva.js +5 -0
- package/dist/components/inputs/Input/TextArea/TextArea.js +305 -90
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +3 -1
- package/dist/components/inputs/Input/TextInput/TextInput.js +429 -90
- package/dist/components/inputs/Input/shared/InputContent.js +193 -59
- package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +1 -0
- package/dist/components/inputs/Input/shared/numberStatic.utils.js +7 -0
- package/dist/components/inputs/Inputs/Form.js +40 -11
- package/dist/components/inputs/Inputs/InputItem.d.ts +15 -21
- package/dist/components/inputs/Inputs/InputItem.js +69 -14
- package/dist/components/inputs/Inputs/Inputs.js +37 -11
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +3 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.js +353 -61
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +45 -0
- package/dist/components/inputs/RadioGroup/radio.cva.js +48 -1
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +6 -2
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +217 -22
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +3 -18
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +107 -8
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +37 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +14 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.js +178 -0
- package/dist/components/inputs/Selection/Select/Select.d.ts +7 -3
- package/dist/components/inputs/Selection/Select/Select.js +227 -18
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +8 -1
- package/dist/components/inputs/Selection/shared/SelectBase.js +69 -18
- package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +393 -138
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +397 -116
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
- package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBox.js +164 -52
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +85 -35
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +69 -16
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +70 -21
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
- package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectMobile.js +9 -3
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +9 -0
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +47 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +14 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +43 -0
- package/dist/components/inputs/Selection/shared/select.context.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/select.context.js +67 -36
- package/dist/components/inputs/Selection/shared/select.types.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +6 -0
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +5 -0
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +12 -0
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +8 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +23 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +54 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +1 -0
- package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +83 -0
- package/dist/components/inputs/Skeleton/InputFrame.js +612 -0
- package/dist/components/inputs/Slider/Slider.d.ts +2 -1
- package/dist/components/inputs/Slider/Slider.js +265 -76
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -0
- package/dist/components/inputs/TextEditor/TextEditor.js +447 -98
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +102 -30
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
- package/dist/components/inputs/Toggle/Toggle.d.ts +1 -0
- package/dist/components/inputs/Toggle/Toggle.js +214 -37
- package/dist/components/inputs/Toggle/toggle.cva.d.ts +3 -0
- package/dist/components/inputs/Toggle/toggle.cva.js +2 -1
- package/dist/components/inputs/shared/CheckContent.d.ts +2 -1
- package/dist/components/inputs/shared/CheckContent.js +21 -11
- package/dist/components/inputs/shared/InputClear.d.ts +2 -1
- package/dist/components/inputs/shared/InputClear.js +88 -12
- package/dist/components/inputs/shared/TooltipWrapper.js +50 -11
- package/dist/components/inputs/shared/input.cva.d.ts +28 -0
- package/dist/components/inputs/shared/input.cva.js +38 -4
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +8 -0
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +5 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +15 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.js +112 -0
- package/dist/components/navigation/Accordion/Accordion.js +69 -22
- package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
- package/dist/components/navigation/Stepper/Stepper.js +67 -22
- package/dist/components/navigation/Stepper/StepperItem.js +104 -31
- package/dist/components/navigation/Stepper/StepperSeparator.js +23 -5
- package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
- package/dist/components/overlays/BottomSheet/BottomSheet.js +96 -23
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
- package/dist/components/overlays/Drawer/Drawer.js +62 -20
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +85 -28
- package/dist/components/overlays/Tooltip/Tooltip.js +137 -28
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
- package/dist/components/segment/Segment.js +218 -57
- package/dist/components/segment/SegmentItem.js +67 -10
- package/dist/components/shared/pagination/Pagination.js +108 -22
- package/dist/components/shared/pagination/PaginationList.js +167 -64
- package/dist/components/shared/pagination/minWidth.cva.d.ts +1 -1
- package/dist/components/status/Alert/Alert.js +97 -30
- package/dist/components/status/Loader/Loader.js +77 -22
- package/dist/components/status/Toast/Toast.js +28 -14
- package/dist/components/status/Toast/toast.cva.d.ts +1 -1
- package/dist/components/status/Toast/useToast.js +62 -57
- package/dist/components/table/ColumnConfig.js +158 -54
- package/dist/components/table/InfiniteTable.js +67 -16
- package/dist/components/table/PaginatedTable.js +84 -18
- package/dist/components/table/Table.js +28 -27
- package/dist/components/text/Link/Link.js +19 -7
- package/dist/components/text/Typography/Typography.js +23 -8
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/link.context.js +23 -9
- package/dist/config/router.context.js +42 -16
- package/dist/config/theme.context.js +98 -45
- package/dist/config/uiConfig.context.d.ts +20 -6
- package/dist/config/uiConfig.context.js +68 -14
- package/dist/config/uiOverrides.context.d.ts +30 -11
- package/dist/config/uiOverrides.context.js +54 -14
- package/dist/helpers/dynamicInputs.d.ts +12 -9
- package/dist/helpers/dynamicInputs.js +13 -8
- package/dist/hooks/useAutosave.d.ts +2 -1
- package/dist/hooks/useAutosave.js +12 -4
- package/dist/hooks/useAutosave.spec.d.ts +1 -0
- package/dist/hooks/useBreakpoint.js +16 -3
- package/dist/hooks/useDebounceCallback.js +51 -17
- package/dist/hooks/useFilters.js +125 -64
- package/dist/hooks/useForm.js +42 -8
- package/dist/hooks/useFormAutosave.d.ts +3 -1
- package/dist/hooks/useFormAutosave.js +122 -30
- package/dist/hooks/useFormAutosave.spec.d.ts +1 -0
- package/dist/hooks/useIntersectionObserver.d.ts +1 -1
- package/dist/hooks/useIntersectionObserver.js +91 -24
- package/dist/hooks/useKeyInteractions.d.ts +20 -0
- package/dist/hooks/useKeyInteractions.js +54 -0
- package/dist/hooks/useKeyInteractions.spec.d.ts +1 -0
- package/dist/hooks/useLocalStorage.js +43 -10
- package/dist/hooks/useLongPressRepeat.js +55 -20
- package/dist/hooks/usePagination.js +49 -19
- package/dist/hooks/useQueryAutocomplete.d.ts +14 -0
- package/dist/hooks/useQueryAutocomplete.js +72 -0
- package/dist/hooks/useScrollableListBox.js +37 -16
- package/dist/hooks/useSorting.js +69 -28
- package/dist/hooks/useStateAndRef.js +21 -7
- package/dist/hooks/useTableColumnConfig.js +124 -31
- package/dist/hooks/useTranslationMemo.js +25 -5
- package/dist/index.d.ts +18 -3
- package/dist/index.js +15 -5
- package/dist/tw-ui-plugin.js +6 -0
- package/dist/utils/date-time.utils.d.ts +38 -10
- package/dist/utils/date-time.utils.js +136 -22
- package/dist/utils/query.utils.d.ts +4 -0
- package/dist/utils/query.utils.js +8 -0
- package/dist/utils/zod.utils.d.ts +2 -0
- package/dist/utils/zod.utils.js +5 -0
- package/package.json +2 -2
|
@@ -4,74 +4,208 @@ import { Loader } from "../../../status/Loader/Loader.js";
|
|
|
4
4
|
import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconButton.js";
|
|
5
5
|
import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
|
|
6
6
|
import { InputClear } from "../../shared/InputClear.js";
|
|
7
|
-
import { inputSizeDefinition } from "../../shared/input.cva.js";
|
|
7
|
+
import { inputContentWrapperDefinition, inputSizeDefinition } from "../../shared/input.cva.js";
|
|
8
|
+
import { c } from "react/compiler-runtime";
|
|
8
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
10
|
import { clsx } from "clsx";
|
|
10
11
|
import { isValidElement } from "react";
|
|
11
12
|
//#region src/components/inputs/Input/shared/InputContent.tsx
|
|
12
|
-
var InputContent = (
|
|
13
|
+
var InputContent = (t0) => {
|
|
14
|
+
const $ = c(64);
|
|
15
|
+
const { leadingIcon: LeadingIcon, trailingIcon: TrailingIcon, unit, isLoading, isDisabled, action, isClearable, value, onChange, onBlur, children, headerProps, as, size } = t0;
|
|
13
16
|
const typographyCva = UIOverrides.useCva("typography.cva", typographyDefinition);
|
|
14
17
|
const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
|
|
15
|
-
const
|
|
16
|
-
|
|
18
|
+
const inputContentWrapperCva = UIOverrides.useCva("input.contentWrapperCva", inputContentWrapperDefinition);
|
|
19
|
+
let t1;
|
|
20
|
+
if ($[0] !== LeadingIcon) {
|
|
21
|
+
t1 = LeadingIcon && isValidElement(LeadingIcon);
|
|
22
|
+
$[0] = LeadingIcon;
|
|
23
|
+
$[1] = t1;
|
|
24
|
+
} else t1 = $[1];
|
|
25
|
+
const isLeadingIconElement = t1;
|
|
26
|
+
let t2;
|
|
27
|
+
if ($[2] !== TrailingIcon) {
|
|
28
|
+
t2 = TrailingIcon && isValidElement(TrailingIcon);
|
|
29
|
+
$[2] = TrailingIcon;
|
|
30
|
+
$[3] = t2;
|
|
31
|
+
} else t2 = $[3];
|
|
32
|
+
const isTrailingIconElement = t2;
|
|
17
33
|
const showClear = value != null && value !== "" && !isDisabled;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
})
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
const t3 = as === "inline" && "h-full";
|
|
35
|
+
let t4;
|
|
36
|
+
if ($[4] !== as || $[5] !== inputSizeCva || $[6] !== size || $[7] !== t3) {
|
|
37
|
+
t4 = clsx("group/input-content flex w-full items-center gap-input-gap-input-text-to-elements pr-0!", t3, inputSizeCva({
|
|
38
|
+
size,
|
|
39
|
+
as
|
|
40
|
+
}));
|
|
41
|
+
$[4] = as;
|
|
42
|
+
$[5] = inputSizeCva;
|
|
43
|
+
$[6] = size;
|
|
44
|
+
$[7] = t3;
|
|
45
|
+
$[8] = t4;
|
|
46
|
+
} else t4 = $[8];
|
|
47
|
+
let t5;
|
|
48
|
+
if ($[9] !== LeadingIcon || $[10] !== isLeadingIconElement) {
|
|
49
|
+
t5 = LeadingIcon && /* @__PURE__ */ jsx("div", {
|
|
50
|
+
className: clsx(!isLeadingIconElement && "pointer-events-none"),
|
|
51
|
+
children: isLeadingIconElement ? LeadingIcon : /* @__PURE__ */ jsx(LeadingIcon, { className: "size-6 text-interactive-text-secondary-idle" })
|
|
52
|
+
});
|
|
53
|
+
$[9] = LeadingIcon;
|
|
54
|
+
$[10] = isLeadingIconElement;
|
|
55
|
+
$[11] = t5;
|
|
56
|
+
} else t5 = $[11];
|
|
57
|
+
let t6;
|
|
58
|
+
if ($[12] !== as || $[13] !== inputContentWrapperCva) {
|
|
59
|
+
t6 = inputContentWrapperCva({ as });
|
|
60
|
+
$[12] = as;
|
|
61
|
+
$[13] = inputContentWrapperCva;
|
|
62
|
+
$[14] = t6;
|
|
63
|
+
} else t6 = $[14];
|
|
64
|
+
let t7;
|
|
65
|
+
if ($[15] !== as || $[16] !== headerProps || $[17] !== size) {
|
|
66
|
+
t7 = as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
|
|
67
|
+
as,
|
|
68
|
+
size,
|
|
69
|
+
...headerProps
|
|
70
|
+
});
|
|
71
|
+
$[15] = as;
|
|
72
|
+
$[16] = headerProps;
|
|
73
|
+
$[17] = size;
|
|
74
|
+
$[18] = t7;
|
|
75
|
+
} else t7 = $[18];
|
|
76
|
+
let t8;
|
|
77
|
+
if ($[19] !== children || $[20] !== t6 || $[21] !== t7) {
|
|
78
|
+
t8 = /* @__PURE__ */ jsxs("div", {
|
|
79
|
+
className: t6,
|
|
80
|
+
children: [t7, children]
|
|
81
|
+
});
|
|
82
|
+
$[19] = children;
|
|
83
|
+
$[20] = t6;
|
|
84
|
+
$[21] = t7;
|
|
85
|
+
$[22] = t8;
|
|
86
|
+
} else t8 = $[22];
|
|
87
|
+
let t9;
|
|
88
|
+
if ($[23] !== t4 || $[24] !== t5 || $[25] !== t8) {
|
|
89
|
+
t9 = /* @__PURE__ */ jsxs("div", {
|
|
90
|
+
className: t4,
|
|
91
|
+
children: [t5, t8]
|
|
92
|
+
});
|
|
93
|
+
$[23] = t4;
|
|
94
|
+
$[24] = t5;
|
|
95
|
+
$[25] = t8;
|
|
96
|
+
$[26] = t9;
|
|
97
|
+
} else t9 = $[26];
|
|
98
|
+
let t10;
|
|
99
|
+
if ($[27] !== action || $[28] !== as || $[29] !== inputSizeCva || $[30] !== isClearable || $[31] !== isTrailingIconElement || $[32] !== showClear || $[33] !== size) {
|
|
100
|
+
t10 = clsx("flex items-center gap-input-gap-trailing-elements py-0! pl-0!", inputSizeCva({
|
|
101
|
+
size,
|
|
102
|
+
as
|
|
103
|
+
}), !isTrailingIconElement && !action && !(isClearable && showClear) && "pointer-events-none");
|
|
104
|
+
$[27] = action;
|
|
105
|
+
$[28] = as;
|
|
106
|
+
$[29] = inputSizeCva;
|
|
107
|
+
$[30] = isClearable;
|
|
108
|
+
$[31] = isTrailingIconElement;
|
|
109
|
+
$[32] = showClear;
|
|
110
|
+
$[33] = size;
|
|
111
|
+
$[34] = t10;
|
|
112
|
+
} else t10 = $[34];
|
|
113
|
+
let t11;
|
|
114
|
+
if ($[35] !== isClearable || $[36] !== onBlur || $[37] !== onChange || $[38] !== showClear) {
|
|
115
|
+
t11 = isClearable && /* @__PURE__ */ jsx(InputClear, {
|
|
116
|
+
onClear: () => {
|
|
117
|
+
onChange?.("");
|
|
118
|
+
onBlur?.({ target: { value: "" } });
|
|
119
|
+
},
|
|
120
|
+
show: showClear
|
|
121
|
+
});
|
|
122
|
+
$[35] = isClearable;
|
|
123
|
+
$[36] = onBlur;
|
|
124
|
+
$[37] = onChange;
|
|
125
|
+
$[38] = showClear;
|
|
126
|
+
$[39] = t11;
|
|
127
|
+
} else t11 = $[39];
|
|
128
|
+
let t12;
|
|
129
|
+
if ($[40] !== typographyCva || $[41] !== unit) {
|
|
130
|
+
t12 = unit && /* @__PURE__ */ jsx("span", {
|
|
131
|
+
className: typographyCva({
|
|
132
|
+
size: "label-2",
|
|
133
|
+
sizeMobile: "label-2",
|
|
134
|
+
variant: "prominent-1",
|
|
135
|
+
className: "text-text-default-3"
|
|
136
|
+
}),
|
|
137
|
+
children: unit
|
|
138
|
+
});
|
|
139
|
+
$[40] = typographyCva;
|
|
140
|
+
$[41] = unit;
|
|
141
|
+
$[42] = t12;
|
|
142
|
+
} else t12 = $[42];
|
|
143
|
+
let t13;
|
|
144
|
+
if ($[43] !== isLoading) {
|
|
145
|
+
t13 = isLoading && /* @__PURE__ */ jsx("div", {
|
|
146
|
+
className: "inline-flex",
|
|
147
|
+
children: /* @__PURE__ */ jsx(Loader, {})
|
|
148
|
+
});
|
|
149
|
+
$[43] = isLoading;
|
|
150
|
+
$[44] = t13;
|
|
151
|
+
} else t13 = $[44];
|
|
152
|
+
let t14;
|
|
153
|
+
if ($[45] !== action || $[46] !== isDisabled || $[47] !== isLoading) {
|
|
154
|
+
t14 = !isLoading && action && /* @__PURE__ */ jsx(InlineIconButton, {
|
|
155
|
+
color: "secondary",
|
|
156
|
+
icon: action.icon,
|
|
157
|
+
isDisabled,
|
|
158
|
+
onPress: action.onClick,
|
|
159
|
+
excludeFromTabOrder: true,
|
|
160
|
+
label: action.altText,
|
|
161
|
+
className: clsx("border-0!", action.className),
|
|
162
|
+
"data-static-press-action": ""
|
|
163
|
+
});
|
|
164
|
+
$[45] = action;
|
|
165
|
+
$[46] = isDisabled;
|
|
166
|
+
$[47] = isLoading;
|
|
167
|
+
$[48] = t14;
|
|
168
|
+
} else t14 = $[48];
|
|
169
|
+
let t15;
|
|
170
|
+
if ($[49] !== TrailingIcon || $[50] !== action || $[51] !== isLoading || $[52] !== isTrailingIconElement) {
|
|
171
|
+
t15 = !isLoading && !action && TrailingIcon && (isTrailingIconElement ? TrailingIcon : /* @__PURE__ */ jsx(TrailingIcon, { className: "size-6 text-interactive-text-secondary-idle" }));
|
|
172
|
+
$[49] = TrailingIcon;
|
|
173
|
+
$[50] = action;
|
|
174
|
+
$[51] = isLoading;
|
|
175
|
+
$[52] = isTrailingIconElement;
|
|
176
|
+
$[53] = t15;
|
|
177
|
+
} else t15 = $[53];
|
|
178
|
+
let t16;
|
|
179
|
+
if ($[54] !== t10 || $[55] !== t11 || $[56] !== t12 || $[57] !== t13 || $[58] !== t14 || $[59] !== t15) {
|
|
180
|
+
t16 = /* @__PURE__ */ jsxs("div", {
|
|
181
|
+
className: t10,
|
|
41
182
|
children: [
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
show: showClear
|
|
48
|
-
}),
|
|
49
|
-
unit && /* @__PURE__ */ jsx("span", {
|
|
50
|
-
className: typographyCva({
|
|
51
|
-
size: "label-2",
|
|
52
|
-
sizeMobile: "label-2",
|
|
53
|
-
variant: "prominent-1",
|
|
54
|
-
className: "text-text-default-3"
|
|
55
|
-
}),
|
|
56
|
-
children: unit
|
|
57
|
-
}),
|
|
58
|
-
isLoading && /* @__PURE__ */ jsx("div", {
|
|
59
|
-
className: "inline-flex",
|
|
60
|
-
children: /* @__PURE__ */ jsx(Loader, {})
|
|
61
|
-
}),
|
|
62
|
-
!isLoading && action && /* @__PURE__ */ jsx(InlineIconButton, {
|
|
63
|
-
color: "secondary",
|
|
64
|
-
icon: action.icon,
|
|
65
|
-
isDisabled,
|
|
66
|
-
onPress: action.onClick,
|
|
67
|
-
excludeFromTabOrder: true,
|
|
68
|
-
label: action.altText,
|
|
69
|
-
className: clsx("border-0!", action.className)
|
|
70
|
-
}),
|
|
71
|
-
!isLoading && !action && TrailingIcon && (isTrailingIconElement ? TrailingIcon : /* @__PURE__ */ jsx(TrailingIcon, { className: "size-6 text-interactive-text-secondary-idle" }))
|
|
183
|
+
t11,
|
|
184
|
+
t12,
|
|
185
|
+
t13,
|
|
186
|
+
t14,
|
|
187
|
+
t15
|
|
72
188
|
]
|
|
73
|
-
})
|
|
74
|
-
|
|
189
|
+
});
|
|
190
|
+
$[54] = t10;
|
|
191
|
+
$[55] = t11;
|
|
192
|
+
$[56] = t12;
|
|
193
|
+
$[57] = t13;
|
|
194
|
+
$[58] = t14;
|
|
195
|
+
$[59] = t15;
|
|
196
|
+
$[60] = t16;
|
|
197
|
+
} else t16 = $[60];
|
|
198
|
+
let t17;
|
|
199
|
+
if ($[61] !== t16 || $[62] !== t9) {
|
|
200
|
+
t17 = /* @__PURE__ */ jsxs("div", {
|
|
201
|
+
className: "flex w-full items-center gap-input-gap-input-text-to-elements",
|
|
202
|
+
children: [t9, t16]
|
|
203
|
+
});
|
|
204
|
+
$[61] = t16;
|
|
205
|
+
$[62] = t9;
|
|
206
|
+
$[63] = t17;
|
|
207
|
+
} else t17 = $[63];
|
|
208
|
+
return t17;
|
|
75
209
|
};
|
|
76
210
|
//#endregion
|
|
77
211
|
export { InputContent };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getStaticNumberDisplayValue: (value: unknown, formatter: Intl.NumberFormat) => string | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
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 };
|
|
@@ -2,8 +2,8 @@ import { InputItem } from "./InputItem.js";
|
|
|
2
2
|
import { StringUtils } from "../../../utils/string.utils.js";
|
|
3
3
|
import { ZodUtils } from "../../../utils/zod.utils.js";
|
|
4
4
|
import { getDefaultInputComponentType } from "../../../helpers/dynamicInputs.js";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
5
6
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import { useMemo } from "react";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
//#region src/components/inputs/Inputs/Form.tsx
|
|
9
9
|
var createFieldComponent = (field, schemaKeyType, form) => {
|
|
@@ -23,22 +23,51 @@ var createFieldComponent = (field, schemaKeyType, form) => {
|
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
|
-
function Form(
|
|
27
|
-
const
|
|
28
|
-
|
|
26
|
+
function Form(t0) {
|
|
27
|
+
const $ = c(14);
|
|
28
|
+
const { form, schema, onSubmit, onError, className, children } = t0;
|
|
29
|
+
let fieldComponents;
|
|
30
|
+
if ($[0] !== form || $[1] !== schema.shape) {
|
|
31
|
+
fieldComponents = {};
|
|
29
32
|
const fields = Object.keys(schema.shape);
|
|
30
33
|
for (const field of fields) {
|
|
31
34
|
const componentName = StringUtils.capitalize(String(field));
|
|
32
35
|
const schemaKeyType = schema.shape[field];
|
|
33
36
|
fieldComponents[componentName] = createFieldComponent(field, schemaKeyType, form);
|
|
34
37
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
$[0] = form;
|
|
39
|
+
$[1] = schema.shape;
|
|
40
|
+
$[2] = fieldComponents;
|
|
41
|
+
} else fieldComponents = $[2];
|
|
42
|
+
const components = fieldComponents;
|
|
43
|
+
let t1;
|
|
44
|
+
if ($[3] !== form || $[4] !== onError || $[5] !== onSubmit) {
|
|
45
|
+
t1 = form.handleSubmit(onSubmit, onError);
|
|
46
|
+
$[3] = form;
|
|
47
|
+
$[4] = onError;
|
|
48
|
+
$[5] = onSubmit;
|
|
49
|
+
$[6] = t1;
|
|
50
|
+
} else t1 = $[6];
|
|
51
|
+
let t2;
|
|
52
|
+
if ($[7] !== children || $[8] !== components) {
|
|
53
|
+
t2 = children(components);
|
|
54
|
+
$[7] = children;
|
|
55
|
+
$[8] = components;
|
|
56
|
+
$[9] = t2;
|
|
57
|
+
} else t2 = $[9];
|
|
58
|
+
let t3;
|
|
59
|
+
if ($[10] !== className || $[11] !== t1 || $[12] !== t2) {
|
|
60
|
+
t3 = /* @__PURE__ */ jsx("form", {
|
|
61
|
+
onSubmit: t1,
|
|
62
|
+
className,
|
|
63
|
+
children: t2
|
|
64
|
+
});
|
|
65
|
+
$[10] = className;
|
|
66
|
+
$[11] = t1;
|
|
67
|
+
$[12] = t2;
|
|
68
|
+
$[13] = t3;
|
|
69
|
+
} else t3 = $[13];
|
|
70
|
+
return t3;
|
|
42
71
|
}
|
|
43
72
|
//#endregion
|
|
44
73
|
export { Form };
|
|
@@ -1,33 +1,27 @@
|
|
|
1
1
|
import { ComponentProps, JSXElementConstructor, ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { Control, UseFormReturn } from 'react-hook-form';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
+
import { Autocomplete } from '../Selection/Autocomplete/Autocomplete';
|
|
5
|
+
import { Select } from '../Selection/Select/Select';
|
|
4
6
|
import { HasRequiredProperty } from '../../../types/common';
|
|
5
7
|
declare const componentRegistry: {
|
|
6
8
|
readonly toggle: <TFieldValues extends import('react-hook-form').FieldValues>(props: import('../Toggle/Toggle').ControlledToggleProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
7
9
|
readonly checkbox: <TFieldValues extends import('react-hook-form').FieldValues>(props: import('../Checkbox/Checkbox').ControlledCheckboxProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
readonly numberInput: <TFieldValues extends import('react-hook-form').FieldValues>(props: import('../Input/NumberInput/NumberInput').ControlledNumberInputProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
readonly numberInput: <TFieldValues extends import('react-hook-form').FieldValues>({ renderStaticInput, ...props }: import('../Input/NumberInput/NumberInput').ControlledNumberInputProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
readonly numberRangeInput: <TFieldValues extends import('react-hook-form').FieldValues>({ renderStaticInput, ...props }: import('../Input/NumberRangeInput/NumberRangeInput').ControlledNumberRangeInputProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
9
12
|
readonly slider: <TFieldValues extends import('react-hook-form').FieldValues, IsRange extends boolean = false>(props: import('../Slider/Slider').ControlledSliderProps<TFieldValues, IsRange>) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
readonly textInput: <TFieldValues extends import('react-hook-form').FieldValues>(props: import('../Input/TextInput/TextInput').ControlledTextInputProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
readonly textInput: <TFieldValues extends import('react-hook-form').FieldValues>({ renderStaticInput, ...props }: import('../Input/TextInput/TextInput').ControlledTextInputProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
11
14
|
readonly passwordInput: <TFieldValues extends import('react-hook-form').FieldValues>(props: import('../Input/PasswordInput/PasswordInput').ControlledPasswordInputProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
12
15
|
readonly textArea: <TFieldValues extends import('react-hook-form').FieldValues>(props: import('../Input/TextArea/TextArea').ControlledTextAreaProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
readonly select:
|
|
14
|
-
readonly
|
|
15
|
-
readonly
|
|
16
|
-
|
|
17
|
-
} ? InferredKey : never>, "onChange" | "value" | "items" | "selectionMode" | "isLoading" | "showSelectionBar" | "showSelectAllOption" | "initialSelection" | "showSelectionContent" | "onSearchChange"> & (import('../Selection/shared/select.types').GroupedSelectControlProps<TFieldValues, Exclude<ReturnType<TQueryFn>["data"], undefined>[0] extends {
|
|
18
|
-
id: infer InferredKey extends import('react-aria').Key;
|
|
19
|
-
} ? InferredKey : never> & {
|
|
20
|
-
query: Parameters<TQueryFn>[0] extends {
|
|
21
|
-
search?: string;
|
|
22
|
-
} ? TQueryFn : never;
|
|
23
|
-
queryParams?: Omit<Parameters<TQueryFn>[0], "search"> | undefined;
|
|
24
|
-
queryOptions?: Parameters<TQueryFn>[1] | undefined;
|
|
25
|
-
})) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
readonly select: typeof Select;
|
|
17
|
+
readonly querySelect: <TFieldValues extends import('react-hook-form').FieldValues, TQueryFn extends import('../Selection/shared/querySelect.utils').QueryFn, TKey extends import('react-aria').Key = import('react-aria').Key, TInitialSelectItem = import('../../..').DefaultInitialSelectItem<TKey>>(props: import('../Selection/Select/QuerySelect').QuerySelectProps<TFieldValues, TQueryFn, TKey, TInitialSelectItem>) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
readonly autocomplete: typeof Autocomplete;
|
|
19
|
+
readonly queryAutocomplete: <TFieldValues extends import('react-hook-form').FieldValues, TSelectItem extends import('../../..').SelectItem<any>, TQueryFn extends import('../Selection/Autocomplete/queryAutocomplete.types').QueryFn>(props: import('../Selection/Autocomplete/queryAutocomplete.types').QueryAutocompleteProps<TFieldValues, TSelectItem, TQueryFn>) => import("react/jsx-runtime").JSX.Element;
|
|
26
20
|
readonly segment: <TFieldValues extends import('react-hook-form').FieldValues, TKey extends import('react-aria').Key = import('react-aria').Key>(props: import('../../..').ControlledSegmentProps<TFieldValues, TKey>) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
-
readonly datePicker: <TFieldValues extends import('react-hook-form').FieldValues>({ fullIso, granularity, minValue, maxValue, ...props }: import('../DateTime/DatePicker/DatePicker').ControlledDatePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
readonly dateTimePicker: <TFieldValues extends import('react-hook-form').FieldValues>({ fullIso, ...props }: import('../DateTime/DateTimePicker/DateTimePicker').ControlledDateTimePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
-
readonly timePicker: <TFieldValues extends import('react-hook-form').FieldValues>(props: import('../DateTime/TimePicker/TimePicker').ControlledTimePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
-
readonly dateRangePicker: <TFieldValues extends import('react-hook-form').FieldValues>({ fullIso, minValue, maxValue, ...props }: import('../DateTime/DateRangePicker/DateRangePicker').ControlledDateRangePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
readonly datePicker: <TFieldValues extends import('react-hook-form').FieldValues>({ fullIso, granularity, minValue, maxValue, renderStaticInput, ...props }: import('../DateTime/DatePicker/DatePicker').ControlledDatePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
readonly dateTimePicker: <TFieldValues extends import('react-hook-form').FieldValues>({ fullIso, renderStaticInput, ...props }: import('../DateTime/DateTimePicker/DateTimePicker').ControlledDateTimePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
readonly timePicker: <TFieldValues extends import('react-hook-form').FieldValues>({ renderStaticInput, ...props }: import('../DateTime/TimePicker/TimePicker').ControlledTimePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
readonly dateRangePicker: <TFieldValues extends import('react-hook-form').FieldValues>({ fullIso, minValue, maxValue, renderStaticInput, ...props }: import('../DateTime/DateRangePicker/DateRangePicker').ControlledDateRangePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
31
25
|
readonly unknown: null;
|
|
32
26
|
};
|
|
33
27
|
export type InputComponentRegistry = typeof componentRegistry;
|
|
@@ -56,8 +50,8 @@ type TypeBasedInputDef<TSchemaType extends Record<string, any>, T extends InputC
|
|
|
56
50
|
interface RenderBasedInputDef<TSchemaType extends Record<string, any>, K extends keyof TSchemaType> {
|
|
57
51
|
type?: never;
|
|
58
52
|
name: K;
|
|
59
|
-
label?:
|
|
60
|
-
placeholder?:
|
|
53
|
+
label?: string;
|
|
54
|
+
placeholder?: string;
|
|
61
55
|
props?: never;
|
|
62
56
|
inputWrapper?: never;
|
|
63
57
|
render: (formControl: {
|
|
@@ -6,6 +6,7 @@ import { DateRangePicker } from "../DateTime/DateRangePicker/DateRangePicker.js"
|
|
|
6
6
|
import { DateTimePicker } from "../DateTime/DateTimePicker/DateTimePicker.js";
|
|
7
7
|
import { TimePicker } from "../DateTime/TimePicker/TimePicker.js";
|
|
8
8
|
import { NumberInput } from "../Input/NumberInput/NumberInput.js";
|
|
9
|
+
import { NumberRangeInput } from "../Input/NumberRangeInput/NumberRangeInput.js";
|
|
9
10
|
import { PasswordInput } from "../Input/PasswordInput/PasswordInput.js";
|
|
10
11
|
import { TextArea } from "../Input/TextArea/TextArea.js";
|
|
11
12
|
import { Autocomplete } from "../Selection/Autocomplete/Autocomplete.js";
|
|
@@ -13,17 +14,21 @@ import { QueryAutocomplete } from "../Selection/Autocomplete/QueryAutocomplete.j
|
|
|
13
14
|
import { Slider } from "../Slider/Slider.js";
|
|
14
15
|
import { Toggle } from "../Toggle/Toggle.js";
|
|
15
16
|
import { Segment } from "../../segment/Segment.js";
|
|
17
|
+
import { QuerySelect } from "../Selection/Select/QuerySelect.js";
|
|
18
|
+
import { c } from "react/compiler-runtime";
|
|
16
19
|
import { jsx } from "react/jsx-runtime";
|
|
17
20
|
//#region src/components/inputs/Inputs/InputItem.tsx
|
|
18
21
|
var componentRegistry = {
|
|
19
22
|
toggle: Toggle,
|
|
20
23
|
checkbox: Checkbox,
|
|
21
24
|
numberInput: NumberInput,
|
|
25
|
+
numberRangeInput: NumberRangeInput,
|
|
22
26
|
slider: Slider,
|
|
23
27
|
textInput: TextInput,
|
|
24
28
|
passwordInput: PasswordInput,
|
|
25
29
|
textArea: TextArea,
|
|
26
30
|
select: Select,
|
|
31
|
+
querySelect: QuerySelect,
|
|
27
32
|
autocomplete: Autocomplete,
|
|
28
33
|
queryAutocomplete: QueryAutocomplete,
|
|
29
34
|
segment: Segment,
|
|
@@ -33,24 +38,74 @@ var componentRegistry = {
|
|
|
33
38
|
dateRangePicker: DateRangePicker,
|
|
34
39
|
unknown: null
|
|
35
40
|
};
|
|
36
|
-
function InputItem(
|
|
41
|
+
function InputItem(t0) {
|
|
42
|
+
const $ = c(18);
|
|
43
|
+
const { form, inputDef } = t0;
|
|
37
44
|
const { name, label, placeholder, props, inputWrapper, render, type } = inputDef;
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
const t1 = form.control;
|
|
46
|
+
let formControl;
|
|
47
|
+
let t2;
|
|
48
|
+
if ($[0] !== form || $[1] !== name || $[2] !== render) {
|
|
49
|
+
t2 = Symbol.for("react.early_return_sentinel");
|
|
50
|
+
bb0: {
|
|
51
|
+
formControl = {
|
|
52
|
+
control: t1,
|
|
53
|
+
name
|
|
54
|
+
};
|
|
55
|
+
if (render) {
|
|
56
|
+
t2 = render(formControl, form);
|
|
57
|
+
break bb0;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
$[0] = form;
|
|
61
|
+
$[1] = name;
|
|
62
|
+
$[2] = render;
|
|
63
|
+
$[3] = formControl;
|
|
64
|
+
$[4] = t2;
|
|
65
|
+
} else {
|
|
66
|
+
formControl = $[3];
|
|
67
|
+
t2 = $[4];
|
|
68
|
+
}
|
|
69
|
+
if (t2 !== Symbol.for("react.early_return_sentinel")) return t2;
|
|
43
70
|
if (!type) return null;
|
|
44
71
|
const Component = componentRegistry[type];
|
|
45
72
|
const usesChildrenAsLabel = ["toggle", "checkbox"].includes(type);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
73
|
+
let t3;
|
|
74
|
+
if ($[5] !== props) {
|
|
75
|
+
t3 = props ?? {};
|
|
76
|
+
$[5] = props;
|
|
77
|
+
$[6] = t3;
|
|
78
|
+
} else t3 = $[6];
|
|
79
|
+
const inputProps = t3;
|
|
80
|
+
const t4 = usesChildrenAsLabel ? void 0 : label;
|
|
81
|
+
const t5 = usesChildrenAsLabel ? label : void 0;
|
|
82
|
+
let t6;
|
|
83
|
+
if ($[7] !== Component || $[8] !== formControl || $[9] !== inputProps || $[10] !== placeholder || $[11] !== t4 || $[12] !== t5) {
|
|
84
|
+
t6 = /* @__PURE__ */ jsx(Component, {
|
|
85
|
+
...inputProps,
|
|
86
|
+
label: t4,
|
|
87
|
+
placeholder,
|
|
88
|
+
formControl,
|
|
89
|
+
children: t5
|
|
90
|
+
});
|
|
91
|
+
$[7] = Component;
|
|
92
|
+
$[8] = formControl;
|
|
93
|
+
$[9] = inputProps;
|
|
94
|
+
$[10] = placeholder;
|
|
95
|
+
$[11] = t4;
|
|
96
|
+
$[12] = t5;
|
|
97
|
+
$[13] = t6;
|
|
98
|
+
} else t6 = $[13];
|
|
99
|
+
const inputComponent = t6;
|
|
100
|
+
let t7;
|
|
101
|
+
if ($[14] !== inputComponent || $[15] !== inputWrapper || $[16] !== label) {
|
|
102
|
+
t7 = inputWrapper ? inputWrapper(inputComponent, label) : inputComponent;
|
|
103
|
+
$[14] = inputComponent;
|
|
104
|
+
$[15] = inputWrapper;
|
|
105
|
+
$[16] = label;
|
|
106
|
+
$[17] = t7;
|
|
107
|
+
} else t7 = $[17];
|
|
108
|
+
return t7;
|
|
54
109
|
}
|
|
55
110
|
//#endregion
|
|
56
111
|
export { InputItem };
|
|
@@ -1,17 +1,43 @@
|
|
|
1
1
|
import { InputItem } from "./InputItem.js";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
//#region src/components/inputs/Inputs/Inputs.tsx
|
|
4
|
-
function Inputs(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
function Inputs(t0) {
|
|
6
|
+
const $ = c(9);
|
|
7
|
+
const { form, inputDefs, children } = t0;
|
|
8
|
+
if (!children) {
|
|
9
|
+
let t1;
|
|
10
|
+
if ($[0] !== form || $[1] !== inputDefs) {
|
|
11
|
+
let t2;
|
|
12
|
+
if ($[3] !== form) {
|
|
13
|
+
t2 = (inputDef) => /* @__PURE__ */ jsx(InputItem, {
|
|
14
|
+
form,
|
|
15
|
+
inputDef
|
|
16
|
+
}, String(inputDef.name));
|
|
17
|
+
$[3] = form;
|
|
18
|
+
$[4] = t2;
|
|
19
|
+
} else t2 = $[4];
|
|
20
|
+
t1 = inputDefs.map(t2);
|
|
21
|
+
$[0] = form;
|
|
22
|
+
$[1] = inputDefs;
|
|
23
|
+
$[2] = t1;
|
|
24
|
+
} else t1 = $[2];
|
|
25
|
+
return t1;
|
|
26
|
+
}
|
|
27
|
+
let t1;
|
|
28
|
+
if ($[5] !== children || $[6] !== form || $[7] !== inputDefs) {
|
|
29
|
+
const childrenParams = {};
|
|
30
|
+
for (const inputDef_0 of inputDefs) childrenParams[inputDef_0.name] = /* @__PURE__ */ jsx(InputItem, {
|
|
31
|
+
form,
|
|
32
|
+
inputDef: inputDef_0
|
|
33
|
+
});
|
|
34
|
+
t1 = children(childrenParams);
|
|
35
|
+
$[5] = children;
|
|
36
|
+
$[6] = form;
|
|
37
|
+
$[7] = inputDefs;
|
|
38
|
+
$[8] = t1;
|
|
39
|
+
} else t1 = $[8];
|
|
40
|
+
return t1;
|
|
15
41
|
}
|
|
16
42
|
//#endregion
|
|
17
43
|
export { Inputs };
|
|
@@ -4,7 +4,8 @@ import { FieldValues } from 'react-hook-form';
|
|
|
4
4
|
import { FormFieldProps } from '../FormField/FormField';
|
|
5
5
|
import { RadioVariantProps } from './radio.cva';
|
|
6
6
|
import { ControlProps } from '../shared/form.types';
|
|
7
|
-
|
|
7
|
+
import { InputVariantProps } from '../shared/input.cva';
|
|
8
|
+
interface RadioGroupBaseProps extends Omit<FormFieldProps, "variant">, RadioVariantProps, Omit<InputVariantProps, "variant">, Omit<AriaRadioGroupProps, "className"> {
|
|
8
9
|
ref?: Ref<HTMLDivElement>;
|
|
9
10
|
options: {
|
|
10
11
|
label: string | ReactElement;
|
|
@@ -13,6 +14,7 @@ interface RadioGroupBaseProps extends Omit<FormFieldProps, "variant">, RadioVari
|
|
|
13
14
|
isDirty?: boolean;
|
|
14
15
|
inputClassName?: string;
|
|
15
16
|
labelClassName?: string;
|
|
17
|
+
fireBlurOnChange?: boolean;
|
|
16
18
|
}
|
|
17
19
|
export interface RadioGroupProps extends RadioGroupBaseProps {
|
|
18
20
|
}
|