@mezzanine-ui/react 0.13.10 → 0.13.11
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/Accordion/Accordion.d.ts +24 -24
- package/Accordion/Accordion.js +25 -25
- package/Accordion/AccordionControlContext.d.ts +9 -9
- package/Accordion/AccordionDetails.d.ts +10 -10
- package/Accordion/AccordionDetails.js +16 -16
- package/Accordion/AccordionSummary.d.ts +18 -18
- package/Accordion/AccordionSummary.js +39 -39
- package/Accordion/index.d.ts +3 -3
- package/Alert/Alert.d.ts +20 -20
- package/Alert/Alert.js +9 -9
- package/Alert/index.d.ts +2 -2
- package/AppBar/AppBar.d.ts +14 -14
- package/AppBar/AppBar.js +25 -25
- package/AppBar/AppBarBrand.d.ts +5 -5
- package/AppBar/AppBarBrand.js +4 -4
- package/AppBar/AppBarMain.d.ts +5 -5
- package/AppBar/AppBarMain.js +4 -4
- package/AppBar/AppBarSupport.d.ts +5 -5
- package/AppBar/AppBarSupport.js +4 -4
- package/AppBar/index.d.ts +4 -4
- package/Badge/Badge.d.ts +19 -19
- package/Badge/Badge.js +20 -20
- package/Badge/BadgeContainer.d.ts +8 -8
- package/Badge/BadgeContainer.js +7 -7
- package/Badge/index.d.ts +2 -2
- package/Button/Button.d.ts +11 -11
- package/Button/Button.js +29 -29
- package/Button/ButtonGroup.d.ts +63 -63
- package/Button/ButtonGroup.js +29 -29
- package/Button/IconButton.d.ts +21 -21
- package/Button/IconButton.js +7 -7
- package/Button/index.d.ts +20 -20
- package/Button/index.js +1 -2
- package/Button/typings.d.ts +44 -44
- package/Calendar/Calendar.d.ts +69 -69
- package/Calendar/Calendar.js +38 -38
- package/Calendar/CalendarCell.d.ts +22 -22
- package/Calendar/CalendarCell.js +11 -11
- package/Calendar/CalendarContext.d.ts +22 -22
- package/Calendar/CalendarContext.js +28 -28
- package/Calendar/CalendarControls.d.ts +26 -26
- package/Calendar/CalendarControls.js +11 -11
- package/Calendar/CalendarDayOfWeek.d.ts +15 -15
- package/Calendar/CalendarDayOfWeek.js +9 -9
- package/Calendar/CalendarDays.d.ts +38 -38
- package/Calendar/CalendarDays.js +36 -36
- package/Calendar/CalendarMonths.d.ts +42 -42
- package/Calendar/CalendarMonths.js +22 -22
- package/Calendar/CalendarWeeks.d.ts +41 -41
- package/Calendar/CalendarWeeks.js +42 -42
- package/Calendar/CalendarYears.d.ts +40 -40
- package/Calendar/CalendarYears.js +25 -25
- package/Calendar/index.d.ts +12 -12
- package/Calendar/useCalendarControlModifiers.d.ts +7 -7
- package/Calendar/useCalendarControlModifiers.js +20 -20
- package/Calendar/useCalendarControls.d.ts +12 -12
- package/Calendar/useCalendarControls.js +27 -27
- package/Calendar/useCalendarModeStack.d.ts +6 -6
- package/Calendar/useCalendarModeStack.js +10 -10
- package/Card/Card.d.ts +51 -51
- package/Card/Card.js +12 -12
- package/Card/CardActions.d.ts +34 -34
- package/Card/CardActions.js +7 -7
- package/Card/index.d.ts +2 -2
- package/Checkbox/CheckAll.d.ts +13 -13
- package/Checkbox/CheckAll.js +28 -28
- package/Checkbox/Checkbox.d.ts +46 -46
- package/Checkbox/Checkbox.js +23 -23
- package/Checkbox/CheckboxGroup.d.ts +47 -47
- package/Checkbox/CheckboxGroup.js +27 -27
- package/Checkbox/CheckboxGroupContext.d.ts +9 -9
- package/Checkbox/index.d.ts +4 -4
- package/ConfirmActions/ConfirmActions.d.ts +45 -45
- package/ConfirmActions/ConfirmActions.js +8 -8
- package/ConfirmActions/index.d.ts +1 -1
- package/DatePicker/DatePicker.d.ts +32 -32
- package/DatePicker/DatePicker.js +119 -119
- package/DatePicker/DatePickerCalendar.d.ts +32 -32
- package/DatePicker/DatePickerCalendar.js +52 -52
- package/DatePicker/index.d.ts +2 -2
- package/DateRangePicker/DateRangePicker.d.ts +38 -38
- package/DateRangePicker/DateRangePicker.js +173 -173
- package/DateRangePicker/DateRangePickerCalendar.d.ts +26 -26
- package/DateRangePicker/DateRangePickerCalendar.js +86 -86
- package/DateRangePicker/index.d.ts +4 -4
- package/DateRangePicker/useDateRangeCalendarControls.d.ts +14 -14
- package/DateRangePicker/useDateRangeCalendarControls.js +84 -84
- package/DateRangePicker/useDateRangePickerValue.d.ts +23 -23
- package/DateRangePicker/useDateRangePickerValue.js +81 -81
- package/DateTimePicker/DateTimePicker.d.ts +28 -28
- package/DateTimePicker/DateTimePicker.js +107 -107
- package/DateTimePicker/DateTimePickerPanel.d.ts +29 -29
- package/DateTimePicker/DateTimePickerPanel.js +36 -36
- package/DateTimePicker/index.d.ts +2 -2
- package/Drawer/Drawer.d.ts +13 -13
- package/Drawer/Drawer.js +10 -10
- package/Drawer/index.d.ts +2 -2
- package/Dropdown/Dropdown.d.ts +25 -25
- package/Dropdown/Dropdown.js +52 -52
- package/Dropdown/index.d.ts +1 -1
- package/Empty/Empty.d.ts +18 -18
- package/Empty/Empty.js +6 -6
- package/Empty/index.d.ts +1 -1
- package/Form/FormControlContext.d.ts +9 -9
- package/Form/FormField.d.ts +27 -27
- package/Form/FormField.js +16 -16
- package/Form/FormLabel.d.ts +11 -11
- package/Form/FormLabel.js +8 -8
- package/Form/FormMessage.d.ts +8 -8
- package/Form/FormMessage.js +9 -9
- package/Form/index.d.ts +5 -5
- package/Form/typings.d.ts +4 -4
- package/Form/useAutoCompleteValueControl.d.ts +42 -42
- package/Form/useAutoCompleteValueControl.js +94 -94
- package/Form/useCheckboxControlValue.d.ts +11 -11
- package/Form/useCheckboxControlValue.js +24 -24
- package/Form/useControlValueState.d.ts +7 -7
- package/Form/useControlValueState.js +10 -10
- package/Form/useCustomControlValue.d.ts +5 -5
- package/Form/useCustomControlValue.js +12 -12
- package/Form/useInputControlValue.d.ts +7 -7
- package/Form/useInputControlValue.js +18 -18
- package/Form/useInputWithClearControlValue.d.ts +6 -6
- package/Form/useInputWithClearControlValue.js +28 -28
- package/Form/useInputWithTagsModeValue.d.ts +37 -37
- package/Form/useInputWithTagsModeValue.js +83 -83
- package/Form/useRadioControlValue.d.ts +11 -11
- package/Form/useRadioControlValue.js +19 -19
- package/Form/useSelectValueControl.d.ts +33 -33
- package/Form/useSelectValueControl.js +71 -71
- package/Form/useSwitchControlValue.d.ts +7 -7
- package/Form/useSwitchControlValue.js +18 -18
- package/Icon/Icon.d.ts +32 -32
- package/Icon/Icon.js +18 -18
- package/Icon/index.d.ts +3 -3
- package/Input/Input.d.ts +78 -78
- package/Input/Input.js +34 -34
- package/Input/index.d.ts +2 -2
- package/Loading/Loading.d.ts +34 -34
- package/Loading/Loading.js +19 -19
- package/Loading/index.d.ts +1 -1
- package/Menu/Menu.d.ts +29 -29
- package/Menu/Menu.js +16 -16
- package/Menu/MenuDivider.d.ts +8 -8
- package/Menu/MenuDivider.js +7 -7
- package/Menu/MenuItem.d.ts +24 -24
- package/Menu/MenuItem.js +16 -16
- package/Menu/MenuItemGroup.d.ts +13 -13
- package/Menu/MenuItemGroup.js +7 -7
- package/Menu/index.d.ts +5 -5
- package/Message/Message.d.ts +36 -36
- package/Message/Message.js +63 -63
- package/Message/index.d.ts +2 -2
- package/Modal/Modal.d.ts +37 -37
- package/Modal/Modal.js +15 -15
- package/Modal/ModalActions.d.ts +10 -10
- package/Modal/ModalActions.js +10 -10
- package/Modal/ModalBody.d.ts +8 -8
- package/Modal/ModalBody.js +7 -7
- package/Modal/ModalControl.d.ts +7 -7
- package/Modal/ModalControl.js +3 -3
- package/Modal/ModalFooter.d.ts +8 -8
- package/Modal/ModalFooter.js +7 -7
- package/Modal/ModalHeader.d.ts +20 -20
- package/Modal/ModalHeader.js +10 -10
- package/Modal/index.d.ts +7 -7
- package/Modal/useModalContainer.d.ts +6 -6
- package/Modal/useModalContainer.js +19 -19
- package/Navigation/Navigation.d.ts +29 -29
- package/Navigation/Navigation.js +45 -45
- package/Navigation/NavigationContext.d.ts +6 -6
- package/Navigation/NavigationContext.js +2 -2
- package/Navigation/NavigationItem.d.ts +31 -31
- package/Navigation/NavigationItem.js +13 -13
- package/Navigation/NavigationSubMenu.d.ts +22 -22
- package/Navigation/NavigationSubMenu.js +48 -48
- package/Navigation/index.d.ts +4 -4
- package/Notification/Notification.d.ts +54 -54
- package/Notification/Notification.js +60 -60
- package/Notification/index.d.ts +2 -2
- package/Notifier/NotifierManager.d.ts +17 -17
- package/Notifier/NotifierManager.js +25 -25
- package/Notifier/createNotifier.d.ts +21 -21
- package/Notifier/createNotifier.js +65 -65
- package/Notifier/index.d.ts +2 -2
- package/Notifier/typings.d.ts +28 -28
- package/Overlay/Overlay.d.ts +43 -43
- package/Overlay/Overlay.js +22 -22
- package/Overlay/index.d.ts +1 -1
- package/PageFooter/PageFooter.d.ts +15 -15
- package/PageFooter/PageFooter.js +4 -4
- package/PageFooter/index.d.ts +1 -1
- package/Pagination/Pagination.d.ts +105 -105
- package/Pagination/Pagination.js +18 -18
- package/Pagination/PaginationItem.d.ts +27 -27
- package/Pagination/PaginationItem.js +16 -16
- package/Pagination/PaginationJumper.d.ts +38 -38
- package/Pagination/PaginationJumper.js +40 -40
- package/Pagination/PaginationPageSize.d.ts +38 -38
- package/Pagination/PaginationPageSize.js +8 -8
- package/Pagination/index.d.ts +6 -6
- package/Pagination/usePagination.d.ts +16 -16
- package/Pagination/usePagination.js +73 -73
- package/Picker/PickerTrigger.d.ts +40 -40
- package/Picker/PickerTrigger.js +7 -7
- package/Picker/RangePickerTrigger.d.ts +64 -64
- package/Picker/RangePickerTrigger.js +7 -7
- package/Picker/index.d.ts +7 -7
- package/Picker/usePickerDocumentEventClose.d.ts +10 -10
- package/Picker/usePickerDocumentEventClose.js +20 -20
- package/Picker/usePickerInputValue.d.ts +12 -12
- package/Picker/usePickerInputValue.js +18 -18
- package/Picker/usePickerValue.d.ts +20 -20
- package/Picker/usePickerValue.js +51 -51
- package/Picker/useRangePickerValue.d.ts +20 -20
- package/Picker/useRangePickerValue.js +88 -88
- package/Picker/useTabKeyClose.d.ts +2 -2
- package/Picker/useTabKeyClose.js +7 -7
- package/Popconfirm/Popconfirm.d.ts +16 -16
- package/Popconfirm/Popconfirm.js +4 -4
- package/Popconfirm/index.d.ts +1 -1
- package/Popover/Popover.d.ts +23 -23
- package/Popover/Popover.js +34 -34
- package/Popover/index.d.ts +1 -1
- package/Popper/Popper.d.ts +32 -32
- package/Popper/Popper.js +21 -21
- package/Popper/index.d.ts +1 -1
- package/Portal/Portal.d.ts +20 -20
- package/Portal/Portal.js +15 -15
- package/Portal/index.d.ts +1 -1
- package/Progress/Progress.d.ts +59 -59
- package/Progress/Progress.js +21 -21
- package/Progress/index.d.ts +2 -2
- package/Provider/ConfigProvider.d.ts +8 -8
- package/Provider/ConfigProvider.js +6 -6
- package/Provider/context.d.ts +6 -6
- package/Provider/context.js +2 -2
- package/Provider/index.d.ts +4 -4
- package/Radio/Radio.d.ts +41 -41
- package/Radio/Radio.js +21 -21
- package/Radio/RadioGroup.d.ts +47 -47
- package/Radio/RadioGroup.js +20 -20
- package/Radio/RadioGroupContext.d.ts +9 -9
- package/Radio/index.d.ts +3 -3
- package/Select/AutoComplete.d.ts +101 -101
- package/Select/AutoComplete.js +101 -101
- package/Select/Option.d.ts +19 -19
- package/Select/Option.js +37 -37
- package/Select/Select.d.ts +94 -94
- package/Select/Select.js +111 -111
- package/Select/SelectControlContext.d.ts +3 -3
- package/Select/SelectTrigger.d.ts +89 -89
- package/Select/SelectTrigger.js +44 -44
- package/Select/SelectTriggerTags.d.ts +19 -19
- package/Select/SelectTriggerTags.js +21 -21
- package/Select/TreeSelect.d.ts +68 -68
- package/Select/TreeSelect.js +183 -183
- package/Select/index.d.ts +9 -9
- package/Select/typings.d.ts +12 -12
- package/Select/useSelectTriggerTags.d.ts +19 -19
- package/Select/useSelectTriggerTags.js +53 -53
- package/Skeleton/Skeleton.d.ts +22 -22
- package/Skeleton/Skeleton.js +7 -7
- package/Skeleton/index.d.ts +1 -1
- package/Slider/Slider.d.ts +51 -51
- package/Slider/Slider.js +174 -174
- package/Slider/index.d.ts +3 -3
- package/Slider/useSlider.d.ts +31 -31
- package/Slider/useSlider.js +99 -99
- package/Stepper/Step.d.ts +41 -41
- package/Stepper/Step.js +9 -9
- package/Stepper/Stepper.d.ts +19 -19
- package/Stepper/Stepper.js +26 -26
- package/Stepper/index.d.ts +2 -2
- package/Switch/Switch.d.ts +43 -43
- package/Switch/Switch.js +18 -18
- package/Switch/index.d.ts +2 -2
- package/Table/Table.d.ts +110 -110
- package/Table/Table.js +146 -146
- package/Table/TableBody.d.ts +10 -10
- package/Table/TableBody.js +13 -13
- package/Table/TableBodyRow.d.ts +12 -12
- package/Table/TableBodyRow.js +45 -45
- package/Table/TableCell.d.ts +20 -20
- package/Table/TableCell.js +15 -15
- package/Table/TableContext.d.ts +52 -52
- package/Table/TableContext.js +2 -2
- package/Table/TableExpandedTable.d.ts +12 -12
- package/Table/TableExpandedTable.js +14 -14
- package/Table/TableHeader.d.ts +4 -4
- package/Table/TableHeader.js +20 -20
- package/Table/draggable/useTableDraggable.d.ts +14 -14
- package/Table/draggable/useTableDraggable.js +54 -54
- package/Table/editable/TableEditRenderWrapper.d.ts +8 -8
- package/Table/editable/TableEditRenderWrapper.js +8 -8
- package/Table/expandable/TableExpandable.d.ts +28 -28
- package/Table/expandable/TableExpandable.js +15 -15
- package/Table/index.d.ts +6 -6
- package/Table/pagination/TablePagination.d.ts +10 -10
- package/Table/pagination/TablePagination.js +15 -15
- package/Table/pagination/useTablePagination.d.ts +8 -8
- package/Table/pagination/useTablePagination.js +21 -21
- package/Table/refresh/TableRefresh.d.ts +10 -10
- package/Table/refresh/TableRefresh.js +13 -13
- package/Table/rowSelection/TableRowSelection.d.ts +19 -19
- package/Table/rowSelection/TableRowSelection.js +70 -70
- package/Table/rowSelection/useTableRowSelection.d.ts +6 -6
- package/Table/rowSelection/useTableRowSelection.js +47 -47
- package/Table/sorting/TableSortingIcon.d.ts +11 -11
- package/Table/sorting/TableSortingIcon.js +18 -18
- package/Table/sorting/useTableSorting.d.ts +12 -12
- package/Table/sorting/useTableSorting.js +103 -103
- package/Table/useTableFetchMore.d.ts +10 -10
- package/Table/useTableFetchMore.js +42 -42
- package/Table/useTableLoading.d.ts +5 -5
- package/Table/useTableLoading.js +13 -13
- package/Table/useTableScroll.d.ts +550 -550
- package/Table/useTableScroll.js +275 -275
- package/Tabs/Tab.d.ts +19 -19
- package/Tabs/Tab.js +9 -9
- package/Tabs/TabPane.d.ts +14 -14
- package/Tabs/TabPane.js +11 -11
- package/Tabs/Tabs.d.ts +39 -39
- package/Tabs/Tabs.js +36 -36
- package/Tabs/index.d.ts +3 -3
- package/Tabs/useTabsOverflow.d.ts +8 -8
- package/Tabs/useTabsOverflow.js +56 -56
- package/Tag/Tag.d.ts +29 -29
- package/Tag/Tag.js +14 -14
- package/Tag/index.d.ts +2 -2
- package/TextField/TextField.d.ts +54 -54
- package/TextField/TextField.js +33 -33
- package/TextField/index.d.ts +2 -2
- package/TextField/useTextFieldControl.d.ts +10 -10
- package/TextField/useTextFieldControl.js +12 -12
- package/Textarea/Textarea.d.ts +58 -58
- package/Textarea/Textarea.js +22 -22
- package/Textarea/index.d.ts +2 -2
- package/TimePanel/TimePanel.d.ts +66 -66
- package/TimePanel/TimePanel.js +54 -54
- package/TimePanel/TimePanelAction.d.ts +18 -18
- package/TimePanel/TimePanelAction.js +7 -7
- package/TimePanel/TimePanelColumn.d.ts +37 -37
- package/TimePanel/TimePanelColumn.js +28 -28
- package/TimePanel/index.d.ts +3 -3
- package/TimePicker/TimePicker.d.ts +24 -24
- package/TimePicker/TimePicker.js +99 -99
- package/TimePicker/TimePickerPanel.d.ts +24 -24
- package/TimePicker/TimePickerPanel.js +7 -7
- package/TimePicker/index.d.ts +2 -2
- package/Tooltip/Tooltip.d.ts +25 -25
- package/Tooltip/Tooltip.js +27 -27
- package/Tooltip/index.d.ts +1 -1
- package/Tooltip/useDelayMouseEnterLeave.d.ts +12 -12
- package/Tooltip/useDelayMouseEnterLeave.js +36 -36
- package/Transition/Collapse.d.ts +15 -15
- package/Transition/Collapse.js +96 -96
- package/Transition/Fade.d.ts +8 -8
- package/Transition/Fade.js +74 -74
- package/Transition/Grow.d.ts +13 -13
- package/Transition/Grow.js +101 -101
- package/Transition/SlideFade.d.ts +15 -15
- package/Transition/SlideFade.js +83 -83
- package/Transition/Transition.d.ts +98 -98
- package/Transition/Transition.js +21 -21
- package/Transition/Zoom.d.ts +8 -8
- package/Transition/Zoom.js +74 -74
- package/Transition/getAutoSizeDuration.d.ts +1 -1
- package/Transition/getAutoSizeDuration.js +7 -7
- package/Transition/getTransitionStyleProps.d.ts +16 -16
- package/Transition/getTransitionStyleProps.js +22 -22
- package/Transition/index.d.ts +6 -6
- package/Transition/reflow.d.ts +4 -4
- package/Transition/reflow.js +6 -6
- package/Transition/useAutoTransitionDuration.d.ts +6 -6
- package/Transition/useAutoTransitionDuration.js +10 -10
- package/Transition/useSetNodeTransition.d.ts +7 -7
- package/Transition/useSetNodeTransition.js +30 -30
- package/Tree/Tree.d.ts +70 -70
- package/Tree/Tree.js +116 -116
- package/Tree/TreeNode.d.ts +41 -41
- package/Tree/TreeNode.js +29 -29
- package/Tree/TreeNodeList.d.ts +25 -25
- package/Tree/TreeNodeList.js +22 -22
- package/Tree/getTreeNodeEntities.d.ts +11 -11
- package/Tree/getTreeNodeEntities.js +84 -84
- package/Tree/index.d.ts +8 -8
- package/Tree/toggleValue.d.ts +4 -4
- package/Tree/toggleValue.js +13 -13
- package/Tree/traverseTree.d.ts +2 -2
- package/Tree/traverseTree.js +8 -8
- package/Tree/typings.d.ts +16 -16
- package/Tree/useTreeExpandedValue.d.ts +15 -15
- package/Tree/useTreeExpandedValue.js +26 -26
- package/Typography/Typography.d.ts +43 -43
- package/Typography/Typography.js +31 -31
- package/Typography/index.d.ts +11 -11
- package/Typography/index.js +4 -1
- package/Upload/UploadButton.d.ts +10 -10
- package/Upload/UploadButton.js +14 -14
- package/Upload/UploadInput.d.ts +21 -21
- package/Upload/UploadInput.js +18 -18
- package/Upload/UploadPicture.d.ts +49 -49
- package/Upload/UploadPicture.js +43 -43
- package/Upload/UploadPictureBlock.d.ts +20 -20
- package/Upload/UploadPictureBlock.js +70 -70
- package/Upload/UploadPictureWall.d.ts +81 -81
- package/Upload/UploadPictureWall.js +144 -144
- package/Upload/UploadPictureWallItem.d.ts +15 -15
- package/Upload/UploadPictureWallItem.js +10 -10
- package/Upload/UploadResult.d.ts +35 -35
- package/Upload/UploadResult.js +19 -19
- package/Upload/index.d.ts +6 -6
- package/_internal/InputCheck/InputCheck.d.ts +33 -33
- package/_internal/InputCheck/InputCheck.js +11 -11
- package/_internal/InputCheck/InputCheckGroup.d.ts +18 -18
- package/_internal/InputCheck/InputCheckGroup.js +7 -7
- package/_internal/InputCheck/index.d.ts +3 -3
- package/_internal/InputTriggerPopper/InputTriggerPopper.d.ts +18 -18
- package/_internal/InputTriggerPopper/InputTriggerPopper.js +35 -35
- package/_internal/InputTriggerPopper/index.d.ts +1 -1
- package/_internal/SlideFadeOverlay/SlideFadeOverlay.d.ts +21 -21
- package/_internal/SlideFadeOverlay/SlideFadeOverlay.js +53 -53
- package/_internal/SlideFadeOverlay/index.d.ts +1 -1
- package/_internal/SlideFadeOverlay/useTopStack.d.ts +1 -1
- package/_internal/SlideFadeOverlay/useTopStack.js +17 -17
- package/hooks/useClickAway.d.ts +5 -5
- package/hooks/useClickAway.js +18 -18
- package/hooks/useComposeRefs.d.ts +2 -2
- package/hooks/useComposeRefs.js +2 -2
- package/hooks/useDocumentEscapeKeyDown.d.ts +3 -3
- package/hooks/useDocumentEscapeKeyDown.js +15 -15
- package/hooks/useDocumentEvents.d.ts +5 -5
- package/hooks/useDocumentEvents.js +16 -16
- package/hooks/useDocumentTabKeyDown.d.ts +3 -3
- package/hooks/useDocumentTabKeyDown.js +14 -14
- package/hooks/useIsomorphicLayoutEffect.d.ts +2 -2
- package/hooks/useIsomorphicLayoutEffect.js +2 -2
- package/hooks/useLastCallback.d.ts +1 -1
- package/hooks/useLastCallback.js +5 -5
- package/hooks/useLastValue.d.ts +3 -3
- package/hooks/useLastValue.js +4 -4
- package/hooks/usePreviousValue.d.ts +1 -1
- package/hooks/usePreviousValue.js +6 -6
- package/hooks/useWindowWidth.d.ts +1 -1
- package/hooks/useWindowWidth.js +10 -10
- package/index.d.ts +102 -102
- package/package.json +6 -20
- package/utils/array-move.d.ts +1 -1
- package/utils/array-move.js +10 -10
- package/utils/composeRefs.d.ts +21 -21
- package/utils/composeRefs.js +29 -29
- package/utils/cx.d.ts +1 -1
- package/utils/general.d.ts +8 -8
- package/utils/getElement.d.ts +3 -3
- package/utils/getElement.js +11 -11
- package/utils/jsx-types.d.ts +11 -11
- package/utils/scroll-lock.d.ts +2 -2
- package/utils/scroll-lock.js +17 -17
package/Radio/Radio.js
CHANGED
|
@@ -8,27 +8,27 @@ import InputCheck from '../_internal/InputCheck/InputCheck.js';
|
|
|
8
8
|
import { FormControlContext } from '../Form/FormControlContext.js';
|
|
9
9
|
import cx from 'clsx';
|
|
10
10
|
|
|
11
|
-
/**
|
|
12
|
-
* The react component for `mezzanine` radio.
|
|
13
|
-
*/
|
|
14
|
-
const Radio = forwardRef(function Radio(props, ref) {
|
|
15
|
-
const { size: globalSize, } = useContext(MezzanineConfig);
|
|
16
|
-
const { disabled: disabledFromFormControl, severity, } = useContext(FormControlContext) || {};
|
|
17
|
-
const radioGroup = useContext(RadioGroupContext);
|
|
18
|
-
const { disabled: disabledFromGroup, name: nameFromGroup, size: sizeFromGroup, } = radioGroup || {};
|
|
19
|
-
const { checked: checkedProp, children, defaultChecked, disabled = (disabledFromGroup !== null && disabledFromGroup !== void 0 ? disabledFromGroup : disabledFromFormControl) || false, error = severity === 'error' || false, inputProps, onChange: onChangeProp, size = sizeFromGroup || globalSize, value, ...rest } = props;
|
|
20
|
-
const { id: inputId, name = nameFromGroup, ...restInputProps } = inputProps || {};
|
|
21
|
-
const [checked, onChange] = useRadioControlValue({
|
|
22
|
-
checked: checkedProp,
|
|
23
|
-
defaultChecked,
|
|
24
|
-
onChange: onChangeProp,
|
|
25
|
-
radioGroup,
|
|
26
|
-
value,
|
|
27
|
-
});
|
|
28
|
-
return (jsx(InputCheck, { ...rest, ref: ref, control: (jsx("span", { className: cx(radioClasses.host, {
|
|
29
|
-
[radioClasses.checked]: checked,
|
|
30
|
-
}), children: jsx("input", { ...restInputProps, "aria-checked": checked, "aria-disabled": disabled, checked: checked, disabled: disabled, id: inputId, onChange: onChange, name: name, type: "radio", value: value }) })), disabled: disabled, error: error, htmlFor: inputId, size: size, children: children }));
|
|
31
|
-
});
|
|
11
|
+
/**
|
|
12
|
+
* The react component for `mezzanine` radio.
|
|
13
|
+
*/
|
|
14
|
+
const Radio = forwardRef(function Radio(props, ref) {
|
|
15
|
+
const { size: globalSize, } = useContext(MezzanineConfig);
|
|
16
|
+
const { disabled: disabledFromFormControl, severity, } = useContext(FormControlContext) || {};
|
|
17
|
+
const radioGroup = useContext(RadioGroupContext);
|
|
18
|
+
const { disabled: disabledFromGroup, name: nameFromGroup, size: sizeFromGroup, } = radioGroup || {};
|
|
19
|
+
const { checked: checkedProp, children, defaultChecked, disabled = (disabledFromGroup !== null && disabledFromGroup !== void 0 ? disabledFromGroup : disabledFromFormControl) || false, error = severity === 'error' || false, inputProps, onChange: onChangeProp, size = sizeFromGroup || globalSize, value, ...rest } = props;
|
|
20
|
+
const { id: inputId, name = nameFromGroup, ...restInputProps } = inputProps || {};
|
|
21
|
+
const [checked, onChange] = useRadioControlValue({
|
|
22
|
+
checked: checkedProp,
|
|
23
|
+
defaultChecked,
|
|
24
|
+
onChange: onChangeProp,
|
|
25
|
+
radioGroup,
|
|
26
|
+
value,
|
|
27
|
+
});
|
|
28
|
+
return (jsx(InputCheck, { ...rest, ref: ref, control: (jsx("span", { className: cx(radioClasses.host, {
|
|
29
|
+
[radioClasses.checked]: checked,
|
|
30
|
+
}), children: jsx("input", { ...restInputProps, "aria-checked": checked, "aria-disabled": disabled, checked: checked, disabled: disabled, id: inputId, onChange: onChange, name: name, type: "radio", value: value }) })), disabled: disabled, error: error, htmlFor: inputId, size: size, children: children }));
|
|
31
|
+
});
|
|
32
32
|
var Radio$1 = Radio;
|
|
33
33
|
|
|
34
34
|
export { Radio$1 as default };
|
package/Radio/RadioGroup.d.ts
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { RadioGroupOption, RadioSize } from '@mezzanine-ui/core/radio';
|
|
2
|
-
import { ChangeEventHandler, ReactNode } from 'react';
|
|
3
|
-
import { InputCheckGroupProps } from '../_internal/InputCheck';
|
|
4
|
-
export interface RadioGroupProps extends Omit<InputCheckGroupProps, 'onChange'> {
|
|
5
|
-
/**
|
|
6
|
-
* The radios in radio group.
|
|
7
|
-
*/
|
|
8
|
-
children?: ReactNode;
|
|
9
|
-
/**
|
|
10
|
-
* The default value of radio group.
|
|
11
|
-
*/
|
|
12
|
-
defaultValue?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Whether the radio group is disabled.
|
|
15
|
-
* Control the disabled of radios in group if disabled not passed to radio.
|
|
16
|
-
*/
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* The name of radio group.
|
|
20
|
-
* Control the name of radios in group if name not passed to radio.
|
|
21
|
-
*/
|
|
22
|
-
name?: string;
|
|
23
|
-
/**
|
|
24
|
-
* The onChange of radio group.
|
|
25
|
-
* Will be passed to each radios but composing both instead of overriding.
|
|
26
|
-
*/
|
|
27
|
-
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
28
|
-
/**
|
|
29
|
-
* The options of radio group.
|
|
30
|
-
* Will be ignored if children passed.
|
|
31
|
-
*/
|
|
32
|
-
options?: RadioGroupOption[];
|
|
33
|
-
/**
|
|
34
|
-
* The size of radio group.
|
|
35
|
-
* Control the size of radios in group if size not passed to radio.
|
|
36
|
-
*/
|
|
37
|
-
size?: RadioSize;
|
|
38
|
-
/**
|
|
39
|
-
* The value of radio group.
|
|
40
|
-
*/
|
|
41
|
-
value?: string;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* The react component for `mezzanine` radio group.
|
|
45
|
-
*/
|
|
46
|
-
declare const RadioGroup: import("react").ForwardRefExoticComponent<RadioGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
47
|
-
export default RadioGroup;
|
|
1
|
+
import { RadioGroupOption, RadioSize } from '@mezzanine-ui/core/radio';
|
|
2
|
+
import { ChangeEventHandler, ReactNode } from 'react';
|
|
3
|
+
import { InputCheckGroupProps } from '../_internal/InputCheck';
|
|
4
|
+
export interface RadioGroupProps extends Omit<InputCheckGroupProps, 'onChange'> {
|
|
5
|
+
/**
|
|
6
|
+
* The radios in radio group.
|
|
7
|
+
*/
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* The default value of radio group.
|
|
11
|
+
*/
|
|
12
|
+
defaultValue?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Whether the radio group is disabled.
|
|
15
|
+
* Control the disabled of radios in group if disabled not passed to radio.
|
|
16
|
+
*/
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The name of radio group.
|
|
20
|
+
* Control the name of radios in group if name not passed to radio.
|
|
21
|
+
*/
|
|
22
|
+
name?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The onChange of radio group.
|
|
25
|
+
* Will be passed to each radios but composing both instead of overriding.
|
|
26
|
+
*/
|
|
27
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
28
|
+
/**
|
|
29
|
+
* The options of radio group.
|
|
30
|
+
* Will be ignored if children passed.
|
|
31
|
+
*/
|
|
32
|
+
options?: RadioGroupOption[];
|
|
33
|
+
/**
|
|
34
|
+
* The size of radio group.
|
|
35
|
+
* Control the size of radios in group if size not passed to radio.
|
|
36
|
+
*/
|
|
37
|
+
size?: RadioSize;
|
|
38
|
+
/**
|
|
39
|
+
* The value of radio group.
|
|
40
|
+
*/
|
|
41
|
+
value?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The react component for `mezzanine` radio group.
|
|
45
|
+
*/
|
|
46
|
+
declare const RadioGroup: import("react").ForwardRefExoticComponent<RadioGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
47
|
+
export default RadioGroup;
|
package/Radio/RadioGroup.js
CHANGED
|
@@ -5,26 +5,26 @@ import { RadioGroupContext } from './RadioGroupContext.js';
|
|
|
5
5
|
import Radio from './Radio.js';
|
|
6
6
|
import InputCheckGroup from '../_internal/InputCheck/InputCheckGroup.js';
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
* The react component for `mezzanine` radio group.
|
|
10
|
-
*/
|
|
11
|
-
const RadioGroup = forwardRef(function RadioGroup(props, ref) {
|
|
12
|
-
const { children: childrenProp, defaultValue, disabled, name, options = [], onChange: onChangeProp, size, value: valueProp, ...rest } = props;
|
|
13
|
-
const [value, onChange] = useInputControlValue({
|
|
14
|
-
defaultValue,
|
|
15
|
-
onChange: onChangeProp,
|
|
16
|
-
value: valueProp,
|
|
17
|
-
});
|
|
18
|
-
const context = useMemo(() => ({
|
|
19
|
-
disabled,
|
|
20
|
-
name,
|
|
21
|
-
onChange,
|
|
22
|
-
size,
|
|
23
|
-
value,
|
|
24
|
-
}), [disabled, name, onChange, size, value]);
|
|
25
|
-
const children = childrenProp || options.map((option) => (jsx(Radio, { disabled: option.disabled, value: option.value, children: option.label }, option.value)));
|
|
26
|
-
return (jsx(RadioGroupContext.Provider, { value: context, children: jsx(InputCheckGroup, { ...rest, ref: ref, role: "radiogroup", children: children }) }));
|
|
27
|
-
});
|
|
8
|
+
/**
|
|
9
|
+
* The react component for `mezzanine` radio group.
|
|
10
|
+
*/
|
|
11
|
+
const RadioGroup = forwardRef(function RadioGroup(props, ref) {
|
|
12
|
+
const { children: childrenProp, defaultValue, disabled, name, options = [], onChange: onChangeProp, size, value: valueProp, ...rest } = props;
|
|
13
|
+
const [value, onChange] = useInputControlValue({
|
|
14
|
+
defaultValue,
|
|
15
|
+
onChange: onChangeProp,
|
|
16
|
+
value: valueProp,
|
|
17
|
+
});
|
|
18
|
+
const context = useMemo(() => ({
|
|
19
|
+
disabled,
|
|
20
|
+
name,
|
|
21
|
+
onChange,
|
|
22
|
+
size,
|
|
23
|
+
value,
|
|
24
|
+
}), [disabled, name, onChange, size, value]);
|
|
25
|
+
const children = childrenProp || options.map((option) => (jsx(Radio, { disabled: option.disabled, value: option.value, children: option.label }, option.value)));
|
|
26
|
+
return (jsx(RadioGroupContext.Provider, { value: context, children: jsx(InputCheckGroup, { ...rest, ref: ref, role: "radiogroup", children: children }) }));
|
|
27
|
+
});
|
|
28
28
|
var RadioGroup$1 = RadioGroup;
|
|
29
29
|
|
|
30
30
|
export { RadioGroup$1 as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { RadioSize } from '@mezzanine-ui/core/radio';
|
|
3
|
-
import { RadioGroupControlContextValue } from '../Form/useRadioControlValue';
|
|
4
|
-
export interface RadioGroupContextValue extends RadioGroupControlContextValue {
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
name?: string;
|
|
7
|
-
size?: RadioSize;
|
|
8
|
-
}
|
|
9
|
-
export declare const RadioGroupContext: import("react").Context<RadioGroupContextValue | undefined>;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { RadioSize } from '@mezzanine-ui/core/radio';
|
|
3
|
+
import { RadioGroupControlContextValue } from '../Form/useRadioControlValue';
|
|
4
|
+
export interface RadioGroupContextValue extends RadioGroupControlContextValue {
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
name?: string;
|
|
7
|
+
size?: RadioSize;
|
|
8
|
+
}
|
|
9
|
+
export declare const RadioGroupContext: import("react").Context<RadioGroupContextValue | undefined>;
|
package/Radio/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { RadioSize, RadioGroupOption, RadioGroupOrientation, } from '@mezzanine-ui/core/radio';
|
|
2
|
-
export { RadioProps, default, } from './Radio';
|
|
3
|
-
export { RadioGroupProps, default as RadioGroup, } from './RadioGroup';
|
|
1
|
+
export type { RadioSize, RadioGroupOption, RadioGroupOrientation, } from '@mezzanine-ui/core/radio';
|
|
2
|
+
export { RadioProps, default, } from './Radio';
|
|
3
|
+
export { RadioGroupProps, default as RadioGroup, } from './RadioGroup';
|
package/Select/AutoComplete.d.ts
CHANGED
|
@@ -1,101 +1,101 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { SelectInputSize } from '@mezzanine-ui/core/select';
|
|
3
|
-
import { SelectValue } from './typings';
|
|
4
|
-
import { MenuProps } from '../Menu';
|
|
5
|
-
import { PopperProps } from '../Popper';
|
|
6
|
-
import { PickRenameMulti } from '../utils/general';
|
|
7
|
-
import { SelectTriggerProps, SelectTriggerInputProps } from './SelectTrigger';
|
|
8
|
-
export interface AutoCompleteBaseProps extends Omit<SelectTriggerProps, 'active' | 'clearable' | 'forceHideSuffixActionIcon' | 'mode' | 'onClick' | 'onKeyDown' | 'onChange' | 'renderValue' | 'inputProps' | 'suffixActionIcon' | 'value'>, PickRenameMulti<Pick<MenuProps, 'itemsInView' | 'maxHeight' | 'role' | 'size'>, {
|
|
9
|
-
maxHeight: 'menuMaxHeight';
|
|
10
|
-
role: 'menuRole';
|
|
11
|
-
size: 'menuSize';
|
|
12
|
-
}>, PickRenameMulti<Pick<PopperProps, 'options'>, {
|
|
13
|
-
options: 'popperOptions';
|
|
14
|
-
}> {
|
|
15
|
-
/**
|
|
16
|
-
* Set to true when options can be added dynamically
|
|
17
|
-
* @default false
|
|
18
|
-
*/
|
|
19
|
-
addable?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Should the filter rules be disabled (If you need to control options filter by yourself)
|
|
22
|
-
* @default false
|
|
23
|
-
*/
|
|
24
|
-
disabledOptionsFilter?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* The other native props for input element.
|
|
27
|
-
*/
|
|
28
|
-
inputProps?: Omit<SelectTriggerInputProps, 'onChange' | 'placeholder' | 'role' | 'value' | `aria-${'controls' | 'expanded' | 'owns'}`>;
|
|
29
|
-
/**
|
|
30
|
-
* insert callback whenever insert icon is clicked
|
|
31
|
-
* return `true` when insert is successfully
|
|
32
|
-
*/
|
|
33
|
-
onInsert?(text: string): SelectValue;
|
|
34
|
-
/**
|
|
35
|
-
* The search event handler
|
|
36
|
-
*/
|
|
37
|
-
onSearch?(input: string): any;
|
|
38
|
-
/**
|
|
39
|
-
* The options that mapped autocomplete options
|
|
40
|
-
*/
|
|
41
|
-
options: SelectValue[];
|
|
42
|
-
/**
|
|
43
|
-
* select input placeholder
|
|
44
|
-
*/
|
|
45
|
-
placeholder?: string;
|
|
46
|
-
/**
|
|
47
|
-
* Whether the selection is required.
|
|
48
|
-
* @default false
|
|
49
|
-
*/
|
|
50
|
-
required?: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* The size of input.
|
|
53
|
-
*/
|
|
54
|
-
size?: SelectInputSize;
|
|
55
|
-
}
|
|
56
|
-
export
|
|
57
|
-
/**
|
|
58
|
-
* The default selection
|
|
59
|
-
*/
|
|
60
|
-
defaultValue?: SelectValue[];
|
|
61
|
-
/**
|
|
62
|
-
* Controls the layout of trigger.
|
|
63
|
-
*/
|
|
64
|
-
mode: 'multiple';
|
|
65
|
-
/**
|
|
66
|
-
* The change event handler of input element.
|
|
67
|
-
*/
|
|
68
|
-
onChange?(newOptions: SelectValue[]): any;
|
|
69
|
-
/**
|
|
70
|
-
* The value of selection.
|
|
71
|
-
* @default undefined
|
|
72
|
-
*/
|
|
73
|
-
value?: SelectValue[];
|
|
74
|
-
};
|
|
75
|
-
export
|
|
76
|
-
/**
|
|
77
|
-
* The default selection
|
|
78
|
-
*/
|
|
79
|
-
defaultValue?: SelectValue;
|
|
80
|
-
/**
|
|
81
|
-
* Controls the layout of trigger.
|
|
82
|
-
*/
|
|
83
|
-
mode?: 'single';
|
|
84
|
-
/**
|
|
85
|
-
* The change event handler of input element.
|
|
86
|
-
*/
|
|
87
|
-
onChange?(newOptions: SelectValue): any;
|
|
88
|
-
/**
|
|
89
|
-
* The value of selection.
|
|
90
|
-
* @default undefined
|
|
91
|
-
*/
|
|
92
|
-
value?: SelectValue | null;
|
|
93
|
-
};
|
|
94
|
-
export
|
|
95
|
-
/**
|
|
96
|
-
* The AutoComplete component for react. <br />
|
|
97
|
-
* Note that if you need search for ONLY given options, not included your typings,
|
|
98
|
-
* should considering using the `Select` component with `onSearch` prop.
|
|
99
|
-
*/
|
|
100
|
-
declare const AutoComplete: import("react").ForwardRefExoticComponent<AutoCompleteProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
101
|
-
export default AutoComplete;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SelectInputSize } from '@mezzanine-ui/core/select';
|
|
3
|
+
import { SelectValue } from './typings';
|
|
4
|
+
import { MenuProps } from '../Menu';
|
|
5
|
+
import { PopperProps } from '../Popper';
|
|
6
|
+
import { PickRenameMulti } from '../utils/general';
|
|
7
|
+
import { SelectTriggerProps, SelectTriggerInputProps } from './SelectTrigger';
|
|
8
|
+
export interface AutoCompleteBaseProps extends Omit<SelectTriggerProps, 'active' | 'clearable' | 'forceHideSuffixActionIcon' | 'mode' | 'onClick' | 'onKeyDown' | 'onChange' | 'renderValue' | 'inputProps' | 'suffixActionIcon' | 'value'>, PickRenameMulti<Pick<MenuProps, 'itemsInView' | 'maxHeight' | 'role' | 'size'>, {
|
|
9
|
+
maxHeight: 'menuMaxHeight';
|
|
10
|
+
role: 'menuRole';
|
|
11
|
+
size: 'menuSize';
|
|
12
|
+
}>, PickRenameMulti<Pick<PopperProps, 'options'>, {
|
|
13
|
+
options: 'popperOptions';
|
|
14
|
+
}> {
|
|
15
|
+
/**
|
|
16
|
+
* Set to true when options can be added dynamically
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
addable?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Should the filter rules be disabled (If you need to control options filter by yourself)
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
disabledOptionsFilter?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* The other native props for input element.
|
|
27
|
+
*/
|
|
28
|
+
inputProps?: Omit<SelectTriggerInputProps, 'onChange' | 'placeholder' | 'role' | 'value' | `aria-${'controls' | 'expanded' | 'owns'}`>;
|
|
29
|
+
/**
|
|
30
|
+
* insert callback whenever insert icon is clicked
|
|
31
|
+
* return `true` when insert is successfully
|
|
32
|
+
*/
|
|
33
|
+
onInsert?(text: string): SelectValue;
|
|
34
|
+
/**
|
|
35
|
+
* The search event handler
|
|
36
|
+
*/
|
|
37
|
+
onSearch?(input: string): any;
|
|
38
|
+
/**
|
|
39
|
+
* The options that mapped autocomplete options
|
|
40
|
+
*/
|
|
41
|
+
options: SelectValue[];
|
|
42
|
+
/**
|
|
43
|
+
* select input placeholder
|
|
44
|
+
*/
|
|
45
|
+
placeholder?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Whether the selection is required.
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
50
|
+
required?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* The size of input.
|
|
53
|
+
*/
|
|
54
|
+
size?: SelectInputSize;
|
|
55
|
+
}
|
|
56
|
+
export type AutoCompleteMultipleProps = AutoCompleteBaseProps & {
|
|
57
|
+
/**
|
|
58
|
+
* The default selection
|
|
59
|
+
*/
|
|
60
|
+
defaultValue?: SelectValue[];
|
|
61
|
+
/**
|
|
62
|
+
* Controls the layout of trigger.
|
|
63
|
+
*/
|
|
64
|
+
mode: 'multiple';
|
|
65
|
+
/**
|
|
66
|
+
* The change event handler of input element.
|
|
67
|
+
*/
|
|
68
|
+
onChange?(newOptions: SelectValue[]): any;
|
|
69
|
+
/**
|
|
70
|
+
* The value of selection.
|
|
71
|
+
* @default undefined
|
|
72
|
+
*/
|
|
73
|
+
value?: SelectValue[];
|
|
74
|
+
};
|
|
75
|
+
export type AutoCompleteSingleProps = AutoCompleteBaseProps & {
|
|
76
|
+
/**
|
|
77
|
+
* The default selection
|
|
78
|
+
*/
|
|
79
|
+
defaultValue?: SelectValue;
|
|
80
|
+
/**
|
|
81
|
+
* Controls the layout of trigger.
|
|
82
|
+
*/
|
|
83
|
+
mode?: 'single';
|
|
84
|
+
/**
|
|
85
|
+
* The change event handler of input element.
|
|
86
|
+
*/
|
|
87
|
+
onChange?(newOptions: SelectValue): any;
|
|
88
|
+
/**
|
|
89
|
+
* The value of selection.
|
|
90
|
+
* @default undefined
|
|
91
|
+
*/
|
|
92
|
+
value?: SelectValue | null;
|
|
93
|
+
};
|
|
94
|
+
export type AutoCompleteProps = AutoCompleteMultipleProps | AutoCompleteSingleProps;
|
|
95
|
+
/**
|
|
96
|
+
* The AutoComplete component for react. <br />
|
|
97
|
+
* Note that if you need search for ONLY given options, not included your typings,
|
|
98
|
+
* should considering using the `Select` component with `onSearch` prop.
|
|
99
|
+
*/
|
|
100
|
+
declare const AutoComplete: import("react").ForwardRefExoticComponent<AutoCompleteProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
101
|
+
export default AutoComplete;
|
package/Select/AutoComplete.js
CHANGED
|
@@ -15,107 +15,107 @@ import Icon from '../Icon/Icon.js';
|
|
|
15
15
|
import { FormControlContext } from '../Form/FormControlContext.js';
|
|
16
16
|
import cx from 'clsx';
|
|
17
17
|
|
|
18
|
-
const MENU_ID = 'mzn-select-autocomplete-menu-id';
|
|
19
|
-
/**
|
|
20
|
-
* The AutoComplete component for react. <br />
|
|
21
|
-
* Note that if you need search for ONLY given options, not included your typings,
|
|
22
|
-
* should considering using the `Select` component with `onSearch` prop.
|
|
23
|
-
*/
|
|
24
|
-
const AutoComplete = forwardRef(function Select(props, ref) {
|
|
25
|
-
var _a, _b;
|
|
26
|
-
const { disabled: disabledFromFormControl, fullWidth: fullWidthFromFormControl, required: requiredFromFormControl, severity, } = useContext(FormControlContext) || {};
|
|
27
|
-
const { addable = false, className, disabled = disabledFromFormControl || false, disabledOptionsFilter = false, defaultValue, error = severity === 'error' || false, fullWidth = fullWidthFromFormControl || false, inputRef, inputProps, itemsInView = 4, menuMaxHeight, menuRole = 'listbox', menuSize, mode = 'single', onChange: onChangeProp, onClear: onClearProp, onInsert, onSearch, options: optionsProp, popperOptions = {}, placeholder = '', prefix, required = requiredFromFormControl || false, size, value: valueProp, } = props;
|
|
28
|
-
const [open, toggleOpen] = useState(false);
|
|
29
|
-
const { focused, onFocus, onChange, onClear, options, searchText, selectedOptions, setSearchText, unselectedOptions, value, } = useAutoCompleteValueControl({
|
|
30
|
-
defaultValue,
|
|
31
|
-
disabledOptionsFilter,
|
|
32
|
-
mode,
|
|
33
|
-
onChange: onChangeProp,
|
|
34
|
-
onClear: onClearProp,
|
|
35
|
-
onClose: () => toggleOpen(false),
|
|
36
|
-
onSearch,
|
|
37
|
-
options: optionsProp,
|
|
38
|
-
value: valueProp,
|
|
39
|
-
});
|
|
40
|
-
/** insert feature */
|
|
41
|
-
const [insertText, setInsertText] = useState('');
|
|
42
|
-
const nodeRef = useRef(null);
|
|
43
|
-
const controlRef = useRef(null);
|
|
44
|
-
const popperRef = useRef(null);
|
|
45
|
-
const composedRef = useComposeRefs([ref, controlRef]);
|
|
46
|
-
const renderValue = focused ? () => searchText : undefined;
|
|
47
|
-
useClickAway(() => {
|
|
48
|
-
if (!open || focused)
|
|
49
|
-
return;
|
|
50
|
-
return () => {
|
|
51
|
-
toggleOpen((prev) => !prev);
|
|
52
|
-
};
|
|
53
|
-
}, nodeRef, [
|
|
54
|
-
focused,
|
|
55
|
-
nodeRef,
|
|
56
|
-
open,
|
|
57
|
-
toggleOpen,
|
|
58
|
-
]);
|
|
59
|
-
function getPlaceholder() {
|
|
60
|
-
if (focused && value && !isArray(value)) {
|
|
61
|
-
return value.name;
|
|
62
|
-
}
|
|
63
|
-
return placeholder;
|
|
64
|
-
}
|
|
65
|
-
/** Trigger input props */
|
|
66
|
-
const onSearchInputChange = (e) => {
|
|
67
|
-
/** should sync both search input and value */
|
|
68
|
-
setSearchText(e.target.value);
|
|
69
|
-
setInsertText(e.target.value);
|
|
70
|
-
/** return current value to onSearch */
|
|
71
|
-
onSearch === null || onSearch === void 0 ? void 0 : onSearch(e.target.value);
|
|
72
|
-
};
|
|
73
|
-
const onSearchInputFocus = (e) => {
|
|
74
|
-
var _a;
|
|
75
|
-
e.stopPropagation();
|
|
76
|
-
toggleOpen(true);
|
|
77
|
-
onFocus(true);
|
|
78
|
-
(_a = inputProps === null || inputProps === void 0 ? void 0 : inputProps.onFocus) === null || _a === void 0 ? void 0 : _a.call(inputProps, e);
|
|
79
|
-
};
|
|
80
|
-
const onSearchInputBlur = (e) => {
|
|
81
|
-
var _a;
|
|
82
|
-
onFocus(false);
|
|
83
|
-
(_a = inputProps === null || inputProps === void 0 ? void 0 : inputProps.onBlur) === null || _a === void 0 ? void 0 : _a.call(inputProps, e);
|
|
84
|
-
};
|
|
85
|
-
const onClickSuffixActionIcon = () => {
|
|
86
|
-
toggleOpen((prev) => !prev);
|
|
87
|
-
};
|
|
88
|
-
const resolvedInputProps = {
|
|
89
|
-
...inputProps,
|
|
90
|
-
'aria-controls': MENU_ID,
|
|
91
|
-
'aria-expanded': open,
|
|
92
|
-
'aria-owns': MENU_ID,
|
|
93
|
-
onBlur: onSearchInputBlur,
|
|
94
|
-
onChange: onSearchInputChange,
|
|
95
|
-
onFocus: onSearchInputFocus,
|
|
96
|
-
placeholder: getPlaceholder(),
|
|
97
|
-
role: 'combobox',
|
|
98
|
-
};
|
|
99
|
-
const searchTextExistWithoutOption = !!searchText && options.find((option) => option.name === searchText) === undefined;
|
|
100
|
-
const context = useMemo(() => ({
|
|
101
|
-
onChange,
|
|
102
|
-
value,
|
|
103
|
-
}), [onChange, value]);
|
|
104
|
-
return (jsx(SelectControlContext.Provider, { value: context, children: jsxs("div", { ref: nodeRef, className: cx(selectClasses.host, {
|
|
105
|
-
[selectClasses.hostFullWidth]: fullWidth,
|
|
106
|
-
}), children: [jsx(SelectTrigger, { ref: composedRef, active: open, className: className, clearable: true, disabled: disabled, ellipsis: true, error: error, fullWidth: fullWidth, inputRef: inputRef, mode: mode, onTagClose: onChange, onClear: onClear, prefix: prefix, readOnly: false, required: required, inputProps: resolvedInputProps, searchText: searchText, size: size, showTextInputAfterTags: true, suffixAction: onClickSuffixActionIcon, value: value, renderValue: renderValue }), jsxs(InputTriggerPopper, { ref: popperRef, anchor: controlRef, className: selectClasses.popper, open: open, sameWidth: true, options: popperOptions, children: [options.length ? (jsx(Menu, { id: MENU_ID, "aria-activedescendant": Array.isArray(value) ? (_b = (_a = value === null || value === void 0 ? void 0 : value[0]) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : '' : value === null || value === void 0 ? void 0 : value.id, itemsInView: itemsInView, maxHeight: menuMaxHeight, role: menuRole, size: menuSize, style: { border: 0 }, children: mode === 'single' ? (jsx(Fragment, { children: options.map((option) => (jsx(Option, { value: option.id, children: option.name }, option.id))) })) : (jsxs(Fragment, { children: [selectedOptions.map((option) => (jsx(Option, { value: option.id, children: option.name }, option.id))), unselectedOptions.map((option) => (jsx(Option, { value: option.id, children: option.name }, option.id)))] })) })) : null, searchTextExistWithoutOption && addable ? (jsxs("button", { type: "button", className: selectClasses.autoComplete, onClick: (e) => {
|
|
107
|
-
var _a;
|
|
108
|
-
e.stopPropagation();
|
|
109
|
-
if (insertText) {
|
|
110
|
-
const newOption = (_a = onInsert === null || onInsert === void 0 ? void 0 : onInsert(insertText)) !== null && _a !== void 0 ? _a : null;
|
|
111
|
-
if (newOption) {
|
|
112
|
-
setInsertText('');
|
|
113
|
-
setSearchText('');
|
|
114
|
-
onChange(newOption);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}, children: [jsx("p", { children: insertText }), jsx(Icon, { className: selectClasses.autoCompleteIcon, icon: PlusIcon })] })) : null] })] }) }));
|
|
118
|
-
});
|
|
18
|
+
const MENU_ID = 'mzn-select-autocomplete-menu-id';
|
|
19
|
+
/**
|
|
20
|
+
* The AutoComplete component for react. <br />
|
|
21
|
+
* Note that if you need search for ONLY given options, not included your typings,
|
|
22
|
+
* should considering using the `Select` component with `onSearch` prop.
|
|
23
|
+
*/
|
|
24
|
+
const AutoComplete = forwardRef(function Select(props, ref) {
|
|
25
|
+
var _a, _b;
|
|
26
|
+
const { disabled: disabledFromFormControl, fullWidth: fullWidthFromFormControl, required: requiredFromFormControl, severity, } = useContext(FormControlContext) || {};
|
|
27
|
+
const { addable = false, className, disabled = disabledFromFormControl || false, disabledOptionsFilter = false, defaultValue, error = severity === 'error' || false, fullWidth = fullWidthFromFormControl || false, inputRef, inputProps, itemsInView = 4, menuMaxHeight, menuRole = 'listbox', menuSize, mode = 'single', onChange: onChangeProp, onClear: onClearProp, onInsert, onSearch, options: optionsProp, popperOptions = {}, placeholder = '', prefix, required = requiredFromFormControl || false, size, value: valueProp, } = props;
|
|
28
|
+
const [open, toggleOpen] = useState(false);
|
|
29
|
+
const { focused, onFocus, onChange, onClear, options, searchText, selectedOptions, setSearchText, unselectedOptions, value, } = useAutoCompleteValueControl({
|
|
30
|
+
defaultValue,
|
|
31
|
+
disabledOptionsFilter,
|
|
32
|
+
mode,
|
|
33
|
+
onChange: onChangeProp,
|
|
34
|
+
onClear: onClearProp,
|
|
35
|
+
onClose: () => toggleOpen(false),
|
|
36
|
+
onSearch,
|
|
37
|
+
options: optionsProp,
|
|
38
|
+
value: valueProp,
|
|
39
|
+
});
|
|
40
|
+
/** insert feature */
|
|
41
|
+
const [insertText, setInsertText] = useState('');
|
|
42
|
+
const nodeRef = useRef(null);
|
|
43
|
+
const controlRef = useRef(null);
|
|
44
|
+
const popperRef = useRef(null);
|
|
45
|
+
const composedRef = useComposeRefs([ref, controlRef]);
|
|
46
|
+
const renderValue = focused ? () => searchText : undefined;
|
|
47
|
+
useClickAway(() => {
|
|
48
|
+
if (!open || focused)
|
|
49
|
+
return;
|
|
50
|
+
return () => {
|
|
51
|
+
toggleOpen((prev) => !prev);
|
|
52
|
+
};
|
|
53
|
+
}, nodeRef, [
|
|
54
|
+
focused,
|
|
55
|
+
nodeRef,
|
|
56
|
+
open,
|
|
57
|
+
toggleOpen,
|
|
58
|
+
]);
|
|
59
|
+
function getPlaceholder() {
|
|
60
|
+
if (focused && value && !isArray(value)) {
|
|
61
|
+
return value.name;
|
|
62
|
+
}
|
|
63
|
+
return placeholder;
|
|
64
|
+
}
|
|
65
|
+
/** Trigger input props */
|
|
66
|
+
const onSearchInputChange = (e) => {
|
|
67
|
+
/** should sync both search input and value */
|
|
68
|
+
setSearchText(e.target.value);
|
|
69
|
+
setInsertText(e.target.value);
|
|
70
|
+
/** return current value to onSearch */
|
|
71
|
+
onSearch === null || onSearch === void 0 ? void 0 : onSearch(e.target.value);
|
|
72
|
+
};
|
|
73
|
+
const onSearchInputFocus = (e) => {
|
|
74
|
+
var _a;
|
|
75
|
+
e.stopPropagation();
|
|
76
|
+
toggleOpen(true);
|
|
77
|
+
onFocus(true);
|
|
78
|
+
(_a = inputProps === null || inputProps === void 0 ? void 0 : inputProps.onFocus) === null || _a === void 0 ? void 0 : _a.call(inputProps, e);
|
|
79
|
+
};
|
|
80
|
+
const onSearchInputBlur = (e) => {
|
|
81
|
+
var _a;
|
|
82
|
+
onFocus(false);
|
|
83
|
+
(_a = inputProps === null || inputProps === void 0 ? void 0 : inputProps.onBlur) === null || _a === void 0 ? void 0 : _a.call(inputProps, e);
|
|
84
|
+
};
|
|
85
|
+
const onClickSuffixActionIcon = () => {
|
|
86
|
+
toggleOpen((prev) => !prev);
|
|
87
|
+
};
|
|
88
|
+
const resolvedInputProps = {
|
|
89
|
+
...inputProps,
|
|
90
|
+
'aria-controls': MENU_ID,
|
|
91
|
+
'aria-expanded': open,
|
|
92
|
+
'aria-owns': MENU_ID,
|
|
93
|
+
onBlur: onSearchInputBlur,
|
|
94
|
+
onChange: onSearchInputChange,
|
|
95
|
+
onFocus: onSearchInputFocus,
|
|
96
|
+
placeholder: getPlaceholder(),
|
|
97
|
+
role: 'combobox',
|
|
98
|
+
};
|
|
99
|
+
const searchTextExistWithoutOption = !!searchText && options.find((option) => option.name === searchText) === undefined;
|
|
100
|
+
const context = useMemo(() => ({
|
|
101
|
+
onChange,
|
|
102
|
+
value,
|
|
103
|
+
}), [onChange, value]);
|
|
104
|
+
return (jsx(SelectControlContext.Provider, { value: context, children: jsxs("div", { ref: nodeRef, className: cx(selectClasses.host, {
|
|
105
|
+
[selectClasses.hostFullWidth]: fullWidth,
|
|
106
|
+
}), children: [jsx(SelectTrigger, { ref: composedRef, active: open, className: className, clearable: true, disabled: disabled, ellipsis: true, error: error, fullWidth: fullWidth, inputRef: inputRef, mode: mode, onTagClose: onChange, onClear: onClear, prefix: prefix, readOnly: false, required: required, inputProps: resolvedInputProps, searchText: searchText, size: size, showTextInputAfterTags: true, suffixAction: onClickSuffixActionIcon, value: value, renderValue: renderValue }), jsxs(InputTriggerPopper, { ref: popperRef, anchor: controlRef, className: selectClasses.popper, open: open, sameWidth: true, options: popperOptions, children: [options.length ? (jsx(Menu, { id: MENU_ID, "aria-activedescendant": Array.isArray(value) ? (_b = (_a = value === null || value === void 0 ? void 0 : value[0]) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : '' : value === null || value === void 0 ? void 0 : value.id, itemsInView: itemsInView, maxHeight: menuMaxHeight, role: menuRole, size: menuSize, style: { border: 0 }, children: mode === 'single' ? (jsx(Fragment, { children: options.map((option) => (jsx(Option, { value: option.id, children: option.name }, option.id))) })) : (jsxs(Fragment, { children: [selectedOptions.map((option) => (jsx(Option, { value: option.id, children: option.name }, option.id))), unselectedOptions.map((option) => (jsx(Option, { value: option.id, children: option.name }, option.id)))] })) })) : null, searchTextExistWithoutOption && addable ? (jsxs("button", { type: "button", className: selectClasses.autoComplete, onClick: (e) => {
|
|
107
|
+
var _a;
|
|
108
|
+
e.stopPropagation();
|
|
109
|
+
if (insertText) {
|
|
110
|
+
const newOption = (_a = onInsert === null || onInsert === void 0 ? void 0 : onInsert(insertText)) !== null && _a !== void 0 ? _a : null;
|
|
111
|
+
if (newOption) {
|
|
112
|
+
setInsertText('');
|
|
113
|
+
setSearchText('');
|
|
114
|
+
onChange(newOption);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}, children: [jsx("p", { children: insertText }), jsx(Icon, { className: selectClasses.autoCompleteIcon, icon: PlusIcon })] })) : null] })] }) }));
|
|
118
|
+
});
|
|
119
119
|
var AutoComplete$1 = AutoComplete;
|
|
120
120
|
|
|
121
121
|
export { AutoComplete$1 as default };
|