@mezzanine-ui/react 0.15.3 → 1.0.0-alpha.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/Accordion/Accordion.js +1 -2
- package/Accordion/AccordionControlContext.js +1 -0
- package/Accordion/AccordionDetails.js +2 -2
- package/Accordion/AccordionSummary.d.ts +1 -1
- package/Accordion/AccordionSummary.js +11 -12
- package/Accordion/index.d.ts +6 -3
- package/Alert/Alert.js +1 -2
- package/Alert/index.d.ts +3 -2
- package/AlertBanner/AlertBanner.d.ts +93 -0
- package/AlertBanner/AlertBanner.js +154 -0
- package/AlertBanner/index.d.ts +2 -0
- package/AlertBanner/index.js +1 -0
- package/Anchor/Anchor.js +2 -3
- package/Anchor/index.d.ts +2 -1
- package/AppBar/AppBar.js +1 -2
- package/AppBar/AppBarBrand.js +1 -2
- package/AppBar/AppBarMain.js +1 -2
- package/AppBar/AppBarSupport.js +1 -2
- package/AppBar/index.d.ts +8 -4
- package/{Overlay/Overlay.d.ts → Backdrop/Backdrop.d.ts} +12 -16
- package/Backdrop/Backdrop.js +40 -0
- package/Backdrop/index.d.ts +2 -0
- package/Backdrop/index.js +1 -0
- package/Badge/Badge.d.ts +20 -14
- package/Badge/Badge.js +15 -18
- package/Badge/BadgeContainer.d.ts +1 -1
- package/Badge/BadgeContainer.js +2 -3
- package/Badge/index.d.ts +3 -2
- package/Badge/typings.d.ts +48 -0
- package/Breadcrumb/Breadcrumb.d.ts +6 -0
- package/Breadcrumb/Breadcrumb.js +25 -0
- package/Breadcrumb/BreadcrumbItem.d.ts +4 -0
- package/Breadcrumb/BreadcrumbItem.js +45 -0
- package/Breadcrumb/index.d.ts +2 -0
- package/Breadcrumb/index.js +1 -0
- package/Breadcrumb/typings.d.ts +70 -0
- package/Button/Button.js +24 -19
- package/Button/ButtonGroup.d.ts +6 -28
- package/Button/ButtonGroup.js +8 -18
- package/Button/index.d.ts +6 -12
- package/Button/index.js +2 -3
- package/Button/typings.d.ts +11 -26
- package/Calendar/Calendar.d.ts +31 -2
- package/Calendar/Calendar.js +75 -21
- package/Calendar/CalendarCell.d.ts +4 -0
- package/Calendar/CalendarCell.js +3 -3
- package/Calendar/CalendarConfigProviderDayjs.d.ts +21 -0
- package/Calendar/CalendarConfigProviderDayjs.js +15 -0
- package/Calendar/CalendarConfigProviderLuxon.d.ts +21 -0
- package/Calendar/CalendarConfigProviderLuxon.js +15 -0
- package/Calendar/CalendarConfigProviderMoment.d.ts +21 -0
- package/Calendar/CalendarConfigProviderMoment.js +15 -0
- package/Calendar/CalendarContext.d.ts +14 -7
- package/Calendar/CalendarContext.js +8 -13
- package/Calendar/CalendarControls.d.ts +16 -0
- package/Calendar/CalendarControls.js +3 -7
- package/Calendar/CalendarDayOfWeek.js +4 -3
- package/Calendar/CalendarDays.d.ts +9 -1
- package/Calendar/CalendarDays.js +63 -38
- package/Calendar/CalendarFooterActions.d.ts +13 -0
- package/Calendar/CalendarFooterActions.js +14 -0
- package/Calendar/CalendarFooterControl.d.ts +16 -0
- package/Calendar/CalendarFooterControl.js +14 -0
- package/Calendar/CalendarHalfYears.d.ts +39 -0
- package/Calendar/CalendarHalfYears.js +62 -0
- package/Calendar/CalendarMonths.js +17 -5
- package/Calendar/CalendarQuarters.d.ts +37 -0
- package/Calendar/CalendarQuarters.js +64 -0
- package/Calendar/CalendarQuickSelect.d.ts +21 -0
- package/Calendar/CalendarQuickSelect.js +15 -0
- package/Calendar/CalendarWeeks.d.ts +1 -1
- package/Calendar/CalendarWeeks.js +89 -44
- package/Calendar/CalendarYears.js +14 -4
- package/Calendar/RangeCalendar.d.ts +59 -0
- package/Calendar/RangeCalendar.js +232 -0
- package/Calendar/index.d.ts +33 -10
- package/Calendar/index.js +7 -0
- package/Calendar/useCalendarControlModifiers.d.ts +4 -4
- package/Calendar/useCalendarControlModifiers.js +40 -8
- package/Calendar/useCalendarControls.d.ts +2 -0
- package/Calendar/useCalendarControls.js +19 -2
- package/Calendar/useCalendarModeStack.js +1 -0
- package/Calendar/useRangeCalendarControls.d.ts +18 -0
- package/Calendar/useRangeCalendarControls.js +115 -0
- package/Card/Card.js +1 -2
- package/Card/CardActions.js +2 -3
- package/Card/index.d.ts +4 -2
- package/Checkbox/CheckAll.d.ts +16 -6
- package/Checkbox/CheckAll.js +41 -28
- package/Checkbox/Checkbox.d.ts +100 -22
- package/Checkbox/Checkbox.js +74 -18
- package/Checkbox/CheckboxGroup.d.ts +100 -18
- package/Checkbox/CheckboxGroup.js +169 -25
- package/Checkbox/CheckboxGroupContext.d.ts +0 -2
- package/Checkbox/CheckboxGroupContext.js +1 -0
- package/Checkbox/index.d.ts +16 -4
- package/Checkbox/index.js +6 -2
- package/Checkbox/typings.d.ts +37 -0
- package/ClearActions/ClearActions.d.ts +41 -0
- package/ClearActions/ClearActions.js +23 -0
- package/ClearActions/index.d.ts +3 -0
- package/ClearActions/index.js +5 -0
- package/ConfirmActions/ConfirmActions.d.ts +2 -1
- package/ConfirmActions/ConfirmActions.js +1 -2
- package/ConfirmActions/index.d.ts +2 -1
- package/DatePicker/DatePicker.d.ts +12 -1
- package/DatePicker/DatePicker.js +42 -11
- package/DatePicker/DatePickerCalendar.d.ts +3 -6
- package/DatePicker/DatePickerCalendar.js +38 -39
- package/DatePicker/index.d.ts +4 -2
- package/DateRangePicker/DateRangePicker.d.ts +18 -2
- package/DateRangePicker/DateRangePicker.js +144 -102
- package/DateRangePicker/DateRangePickerCalendar.d.ts +13 -9
- package/DateRangePicker/DateRangePickerCalendar.js +8 -96
- package/DateRangePicker/index.d.ts +6 -3
- package/DateRangePicker/useDateRangeCalendarControls.js +11 -6
- package/DateRangePicker/useDateRangePickerValue.d.ts +38 -15
- package/DateRangePicker/useDateRangePickerValue.js +142 -63
- package/DateTimePicker/DateTimePicker.d.ts +31 -10
- package/DateTimePicker/DateTimePicker.js +180 -96
- package/DateTimePicker/index.d.ts +2 -2
- package/DateTimePicker/index.js +0 -1
- package/Drawer/Drawer.js +3 -4
- package/Drawer/index.d.ts +2 -1
- package/Dropdown/Dropdown.js +13 -24
- package/Dropdown/index.d.ts +2 -1
- package/Empty/Empty.d.ts +1 -16
- package/Empty/Empty.js +37 -9
- package/Empty/icons/EmptyMainInitialDataIcon.d.ts +4 -0
- package/Empty/icons/EmptyMainInitialDataIcon.js +9 -0
- package/Empty/icons/EmptyMainResultIcon.d.ts +4 -0
- package/Empty/icons/EmptyMainResultIcon.js +9 -0
- package/Empty/icons/EmptyMainSystemIcon.d.ts +4 -0
- package/Empty/icons/EmptyMainSystemIcon.js +9 -0
- package/Empty/index.d.ts +2 -1
- package/Empty/typings.d.ts +52 -0
- package/Form/FormControlContext.js +1 -0
- package/Form/FormField.js +1 -2
- package/Form/FormHintText.d.ts +18 -0
- package/Form/FormHintText.js +17 -0
- package/Form/FormLabel.js +2 -2
- package/Form/index.d.ts +9 -5
- package/Form/index.js +1 -1
- package/Form/useAutoCompleteValueControl.js +2 -0
- package/Form/useCheckboxControlValue.js +0 -1
- package/Form/useInputWithClearControlValue.d.ts +1 -1
- package/Form/useInputWithTagsModeValue.d.ts +1 -1
- package/Form/useSelectValueControl.js +2 -0
- package/Icon/Icon.js +1 -2
- package/InlineMessage/InlineMessage.d.ts +33 -0
- package/InlineMessage/InlineMessage.js +42 -0
- package/InlineMessage/InlineMessageGroup.d.ts +24 -0
- package/InlineMessage/InlineMessageGroup.js +21 -0
- package/InlineMessage/index.d.ts +4 -0
- package/InlineMessage/index.js +2 -0
- package/Input/ActionButton/ActionButton.d.ts +26 -0
- package/Input/ActionButton/ActionButton.js +14 -0
- package/Input/ActionButton/index.d.ts +2 -0
- package/Input/ActionButton/index.js +1 -0
- package/Input/Input.d.ts +147 -42
- package/Input/Input.js +196 -31
- package/Input/PasswordStrengthIndicator/PasswordStrengthIndicator.d.ts +31 -0
- package/Input/PasswordStrengthIndicator/PasswordStrengthIndicator.js +18 -0
- package/Input/PasswordStrengthIndicator/index.d.ts +2 -0
- package/Input/PasswordStrengthIndicator/index.js +1 -0
- package/Input/SelectButton/SelectButton.d.ts +20 -0
- package/Input/SelectButton/SelectButton.js +21 -0
- package/Input/SelectButton/index.d.ts +2 -0
- package/Input/SelectButton/index.js +1 -0
- package/Input/SpinnerButton/SpinnerButton.d.ts +19 -0
- package/Input/SpinnerButton/SpinnerButton.js +14 -0
- package/Input/SpinnerButton/index.d.ts +2 -0
- package/Input/SpinnerButton/index.js +1 -0
- package/Input/index.d.ts +3 -2
- package/Menu/Menu.js +2 -2
- package/Menu/MenuDivider.js +1 -2
- package/Menu/MenuItem.js +1 -2
- package/Menu/MenuItemGroup.js +1 -2
- package/Menu/index.d.ts +8 -4
- package/Message/Message.d.ts +6 -4
- package/Message/Message.js +87 -11
- package/Message/MessageTimerController.d.ts +14 -0
- package/Message/MessageTimerController.js +27 -0
- package/Message/index.d.ts +3 -2
- package/Modal/Modal.js +3 -4
- package/Modal/ModalActions.js +2 -2
- package/Modal/ModalBody.js +1 -2
- package/Modal/ModalControl.js +1 -0
- package/Modal/ModalFooter.js +1 -2
- package/Modal/ModalHeader.js +3 -3
- package/Modal/index.d.ts +10 -5
- package/Modal/useModalContainer.d.ts +1 -1
- package/Modal/useModalContainer.js +2 -4
- package/Navigation/Navigation.js +38 -36
- package/Navigation/NavigationContext.js +1 -0
- package/Navigation/NavigationItem.js +2 -2
- package/Navigation/NavigationSubMenu.js +17 -28
- package/Navigation/index.d.ts +8 -4
- package/Notification/Notification.js +1 -3
- package/Notification/index.d.ts +3 -2
- package/Notifier/NotifierManager.d.ts +16 -3
- package/Notifier/NotifierManager.js +60 -18
- package/Notifier/createNotifier.d.ts +9 -0
- package/Notifier/createNotifier.js +3 -2
- package/Notifier/typings.d.ts +3 -1
- package/OverflowTooltip/OverflowCounterTag.d.ts +12 -0
- package/OverflowTooltip/OverflowCounterTag.js +48 -0
- package/OverflowTooltip/OverflowTooltip.d.ts +34 -0
- package/OverflowTooltip/OverflowTooltip.js +53 -0
- package/OverflowTooltip/index.d.ts +2 -0
- package/OverflowTooltip/index.js +2 -0
- package/PageFooter/PageFooter.d.ts +73 -8
- package/PageFooter/PageFooter.js +35 -5
- package/PageFooter/index.d.ts +2 -1
- package/PageHeader/PageHeader.d.ts +36 -0
- package/PageHeader/PageHeader.js +65 -0
- package/PageHeader/index.d.ts +2 -0
- package/PageHeader/index.js +1 -0
- package/PageToolbar/PageToolbar.d.ts +67 -0
- package/PageToolbar/PageToolbar.js +114 -0
- package/PageToolbar/index.d.ts +2 -0
- package/PageToolbar/index.js +1 -0
- package/Pagination/Pagination.d.ts +23 -29
- package/Pagination/Pagination.js +4 -6
- package/Pagination/PaginationItem.d.ts +1 -1
- package/Pagination/PaginationItem.js +7 -5
- package/Pagination/PaginationJumper.d.ts +7 -9
- package/Pagination/PaginationJumper.js +4 -7
- package/Pagination/PaginationPageSize.d.ts +8 -11
- package/Pagination/PaginationPageSize.js +6 -6
- package/Pagination/index.d.ts +8 -4
- package/Pagination/usePagination.d.ts +3 -1
- package/Pagination/usePagination.js +30 -21
- package/Picker/FormattedInput.d.ts +17 -0
- package/Picker/FormattedInput.js +74 -0
- package/Picker/MaskFormat.d.ts +39 -0
- package/Picker/MaskFormat.js +94 -0
- package/Picker/PickerTrigger.d.ts +14 -4
- package/Picker/PickerTrigger.js +18 -4
- package/Picker/PickerTriggerWithSeparator.d.ts +124 -0
- package/Picker/PickerTriggerWithSeparator.js +80 -0
- package/Picker/RangePickerTrigger.d.ts +57 -6
- package/Picker/RangePickerTrigger.js +66 -9
- package/Picker/formatUtils.d.ts +34 -0
- package/Picker/formatUtils.js +124 -0
- package/Picker/index.d.ts +17 -6
- package/Picker/index.js +4 -1
- package/Picker/useDateInputFormatter.d.ts +52 -0
- package/Picker/useDateInputFormatter.js +382 -0
- package/Picker/usePickerDocumentEventClose.d.ts +3 -3
- package/Picker/usePickerValue.d.ts +2 -3
- package/Picker/usePickerValue.js +8 -13
- package/Picker/useTabKeyClose.d.ts +1 -1
- package/Popconfirm/Popconfirm.js +3 -4
- package/Popconfirm/index.d.ts +2 -1
- package/Popover/Popover.js +5 -10
- package/Popover/index.d.ts +2 -1
- package/Popper/Popper.d.ts +15 -10
- package/Popper/Popper.js +89 -19
- package/Popper/index.d.ts +2 -1
- package/Portal/Portal.d.ts +13 -5
- package/Portal/Portal.js +26 -12
- package/Portal/index.d.ts +4 -1
- package/Portal/index.js +1 -0
- package/Portal/portalRegistry.d.ts +17 -0
- package/Portal/portalRegistry.js +92 -0
- package/Progress/Progress.d.ts +23 -30
- package/Progress/Progress.js +72 -23
- package/Progress/index.d.ts +3 -2
- package/Provider/ConfigProvider.d.ts +2 -1
- package/Provider/ConfigProvider.js +1 -0
- package/Provider/context.js +1 -0
- package/Radio/Radio.d.ts +1 -1
- package/Radio/Radio.js +3 -3
- package/Radio/RadioGroup.d.ts +1 -1
- package/Radio/RadioGroup.js +2 -3
- package/Radio/RadioGroupContext.js +1 -0
- package/Radio/index.d.ts +4 -2
- package/ResultState/ResultState.d.ts +52 -0
- package/ResultState/ResultState.js +24 -0
- package/ResultState/index.d.ts +2 -0
- package/ResultState/index.js +1 -0
- package/Select/AutoComplete.d.ts +3 -3
- package/Select/AutoComplete.js +6 -13
- package/Select/Option.js +2 -2
- package/Select/Select.d.ts +1 -1
- package/Select/Select.js +3 -3
- package/Select/SelectControlContext.js +1 -0
- package/Select/SelectTrigger.d.ts +1 -87
- package/Select/SelectTrigger.js +27 -23
- package/Select/SelectTriggerTags.d.ts +1 -1
- package/Select/SelectTriggerTags.js +48 -20
- package/Select/TreeSelect.d.ts +1 -1
- package/Select/TreeSelect.js +3 -3
- package/Select/index.d.ts +14 -7
- package/Select/typings.d.ts +99 -0
- package/Select/useSelectTriggerTags.d.ts +15 -8
- package/Select/useSelectTriggerTags.js +79 -43
- package/Selection/Selection.d.ts +98 -0
- package/Selection/Selection.js +46 -0
- package/Selection/index.d.ts +12 -0
- package/Selection/index.js +5 -0
- package/Skeleton/Skeleton.d.ts +10 -3
- package/Skeleton/Skeleton.js +13 -6
- package/Skeleton/index.d.ts +2 -1
- package/Slider/Slider.d.ts +44 -7
- package/Slider/Slider.js +18 -15
- package/Slider/index.d.ts +5 -3
- package/Slider/useSlider.d.ts +1 -1
- package/Slider/useSlider.js +1 -1
- package/Spin/Spin.d.ts +39 -0
- package/{Loading/Loading.js → Spin/Spin.js} +9 -10
- package/Spin/index.d.ts +2 -0
- package/Spin/index.js +1 -0
- package/Stepper/Step.d.ts +1 -35
- package/Stepper/Step.js +44 -10
- package/Stepper/Stepper.d.ts +1 -14
- package/Stepper/Stepper.js +50 -17
- package/Stepper/index.d.ts +5 -2
- package/Stepper/index.js +1 -0
- package/Stepper/typings.d.ts +77 -0
- package/Stepper/useStepDistance.d.ts +10 -0
- package/Stepper/useStepDistance.js +81 -0
- package/Stepper/useStepper.d.ts +21 -0
- package/Stepper/useStepper.js +26 -0
- package/Table/Table.d.ts +1 -1
- package/Table/Table.js +3 -4
- package/Table/TableBody.js +3 -2
- package/Table/TableBodyRow.js +1 -0
- package/Table/TableCell.js +1 -2
- package/Table/TableContext.js +1 -0
- package/Table/TableExpandedTable.js +1 -0
- package/Table/TableHeader.js +1 -0
- package/Table/draggable/useTableDraggable.d.ts +1 -1
- package/Table/editable/TableEditRenderWrapper.js +1 -0
- package/Table/expandable/TableExpandable.js +1 -1
- package/Table/index.d.ts +7 -4
- package/Table/pagination/TablePagination.d.ts +1 -1
- package/Table/pagination/TablePagination.js +1 -0
- package/Table/pagination/useTablePagination.d.ts +1 -1
- package/Table/pagination/useTablePagination.js +1 -0
- package/Table/refresh/TableRefresh.js +4 -3
- package/Table/rowSelection/TableRowSelection.js +3 -2
- package/Table/sorting/TableSortingIcon.js +2 -1
- package/Table/sorting/useTableSorting.js +1 -0
- package/Table/useTableFetchMore.js +1 -1
- package/Table/useTableScroll.d.ts +44 -14
- package/Table/useTableScroll.js +10 -8
- package/Tabs/Tab.js +1 -2
- package/Tabs/TabPane.js +2 -2
- package/Tabs/Tabs.js +10 -6
- package/Tabs/index.d.ts +6 -3
- package/Tabs/useTabsOverflow.d.ts +1 -1
- package/Tabs/useTabsOverflow.js +4 -3
- package/Tag/Tag.d.ts +2 -25
- package/Tag/Tag.js +24 -15
- package/Tag/TagGroup.d.ts +12 -0
- package/Tag/TagGroup.js +41 -0
- package/Tag/index.d.ts +2 -1
- package/Tag/typings.d.ts +78 -0
- package/TextField/TextField.d.ts +78 -20
- package/TextField/TextField.js +59 -24
- package/TextField/index.d.ts +2 -1
- package/Textarea/Textarea.d.ts +19 -51
- package/Textarea/Textarea.js +14 -21
- package/Textarea/index.d.ts +2 -2
- package/TimePanel/TimePanel.d.ts +1 -22
- package/TimePanel/TimePanel.js +32 -28
- package/TimePanel/TimePanelAction.d.ts +2 -8
- package/TimePanel/TimePanelAction.js +3 -4
- package/TimePanel/TimePanelColumn.d.ts +0 -13
- package/TimePanel/TimePanelColumn.js +10 -13
- package/TimePanel/index.d.ts +6 -3
- package/TimePicker/TimePicker.d.ts +10 -1
- package/TimePicker/TimePicker.js +87 -37
- package/TimePicker/TimePickerPanel.d.ts +1 -2
- package/TimePicker/TimePickerPanel.js +3 -4
- package/TimePicker/index.d.ts +4 -2
- package/Toggle/Toggle.d.ts +46 -0
- package/Toggle/Toggle.js +29 -0
- package/Toggle/index.d.ts +3 -0
- package/Toggle/index.js +1 -0
- package/Tooltip/Tooltip.d.ts +14 -3
- package/Tooltip/Tooltip.js +53 -18
- package/Tooltip/index.d.ts +2 -1
- package/Tooltip/useDelayMouseEnterLeave.d.ts +1 -2
- package/Tooltip/useDelayMouseEnterLeave.js +10 -13
- package/Transition/Collapse.d.ts +2 -0
- package/Transition/Collapse.js +7 -12
- package/Transition/Fade.js +5 -6
- package/Transition/Rotate.d.ts +42 -0
- package/Transition/Rotate.js +30 -0
- package/Transition/Scale.d.ts +13 -0
- package/Transition/{Grow.js → Scale.js} +19 -17
- package/Transition/Slide.d.ts +7 -0
- package/Transition/{Zoom.js → Slide.js} +14 -13
- package/Transition/SlideFade.d.ts +3 -0
- package/Transition/SlideFade.js +6 -6
- package/Transition/Transition.d.ts +3 -3
- package/Transition/Translate.d.ts +14 -0
- package/Transition/Translate.js +94 -0
- package/Transition/index.d.ts +16 -6
- package/Transition/index.js +4 -2
- package/Transition/useAutoTransitionDuration.d.ts +1 -1
- package/Transition/useAutoTransitionDuration.js +3 -3
- package/Transition/useSetNodeTransition.js +0 -2
- package/Tree/Tree.js +1 -2
- package/Tree/TreeNode.js +8 -8
- package/Tree/TreeNodeList.js +1 -2
- package/Tree/index.d.ts +10 -5
- package/Tree/typings.d.ts +2 -2
- package/Typography/Typography.d.ts +6 -9
- package/Typography/Typography.js +7 -9
- package/Typography/index.d.ts +4 -7
- package/Upload/Upload.d.ts +175 -0
- package/Upload/Upload.js +279 -0
- package/Upload/UploadItem.d.ts +82 -0
- package/Upload/UploadItem.js +118 -0
- package/Upload/UploadPictureCard.d.ts +110 -0
- package/Upload/UploadPictureCard.js +101 -0
- package/Upload/Uploader.d.ts +161 -0
- package/Upload/Uploader.js +120 -0
- package/Upload/index.d.ts +8 -6
- package/Upload/index.js +4 -5
- package/Upload/upload-utils.d.ts +41 -0
- package/Upload/upload-utils.js +65 -0
- package/_internal/InputCheck/InputCheck.js +1 -2
- package/_internal/InputCheck/InputCheckGroup.js +1 -2
- package/_internal/InputCheck/index.d.ts +4 -2
- package/_internal/InputTriggerPopper/InputTriggerPopper.js +16 -27
- package/_internal/InputTriggerPopper/index.d.ts +2 -1
- package/_internal/SlideFadeOverlay/SlideFadeOverlay.d.ts +2 -2
- package/_internal/SlideFadeOverlay/SlideFadeOverlay.js +5 -29
- package/_internal/SlideFadeOverlay/index.d.ts +2 -1
- package/_internal/SlideFadeOverlay/useTopStack.js +1 -0
- package/dayjs.d.ts +21 -0
- package/dayjs.js +2 -0
- package/hooks/useClickAway.d.ts +1 -1
- package/hooks/useComposeRefs.js +1 -1
- package/hooks/useLastCallback.js +3 -1
- package/hooks/useScrollLock.d.ts +28 -0
- package/hooks/useScrollLock.js +134 -0
- package/index.d.ts +126 -58
- package/index.js +103 -90
- package/luxon.d.ts +21 -0
- package/luxon.js +2 -0
- package/moment.d.ts +21 -0
- package/moment.js +2 -0
- package/package.json +16 -20
- package/utils/composeRefs.js +0 -1
- package/utils/get-css-variable-value.d.ts +1 -0
- package/utils/get-css-variable-value.js +9 -0
- package/utils/jsx-types.d.ts +1 -1
- package/Button/IconButton.d.ts +0 -21
- package/Button/IconButton.js +0 -13
- package/DateTimePicker/DateTimePickerPanel.d.ts +0 -28
- package/DateTimePicker/DateTimePickerPanel.js +0 -50
- package/Form/FormMessage.d.ts +0 -7
- package/Form/FormMessage.js +0 -19
- package/Form/useInputWithTagsModeValue.js +0 -86
- package/Loading/Loading.d.ts +0 -33
- package/Loading/index.d.ts +0 -1
- package/Loading/index.js +0 -1
- package/Overlay/Overlay.js +0 -32
- package/Overlay/index.d.ts +0 -1
- package/Overlay/index.js +0 -1
- package/Picker/useRangePickerValue.d.ts +0 -23
- package/Picker/useRangePickerValue.js +0 -99
- package/Switch/Switch.d.ts +0 -43
- package/Switch/Switch.js +0 -29
- package/Switch/index.d.ts +0 -2
- package/Switch/index.js +0 -1
- package/Transition/Grow.d.ts +0 -12
- package/Transition/Zoom.d.ts +0 -7
- package/Upload/UploadButton.d.ts +0 -9
- package/Upload/UploadButton.js +0 -24
- package/Upload/UploadInput.d.ts +0 -20
- package/Upload/UploadInput.js +0 -24
- package/Upload/UploadPicture.d.ts +0 -49
- package/Upload/UploadPicture.js +0 -52
- package/Upload/UploadPictureBlock.d.ts +0 -20
- package/Upload/UploadPictureBlock.js +0 -82
- package/Upload/UploadPictureWall.d.ts +0 -81
- package/Upload/UploadPictureWall.js +0 -169
- package/Upload/UploadPictureWallItem.d.ts +0 -15
- package/Upload/UploadPictureWallItem.js +0 -18
- package/Upload/UploadResult.d.ts +0 -35
- package/Upload/UploadResult.js +0 -30
- package/utils/scroll-lock.d.ts +0 -2
- package/utils/scroll-lock.js +0 -24
package/Table/Table.d.ts
CHANGED
|
@@ -99,7 +99,7 @@ export interface TableWithPagination<T> extends TableBaseProps<T> {
|
|
|
99
99
|
* `pagination.onChange` is the callback when page number changed. (required) <br />
|
|
100
100
|
* `pagination.disableAutoSlicing` set this to true if you don't want auto data slicing. <br />
|
|
101
101
|
* `pagination.total` is the total amount of your data. (default will be dataSource length) <br />
|
|
102
|
-
* `pagination.options` is the
|
|
102
|
+
* `pagination.options` is the 'Pagination' component props. <br />
|
|
103
103
|
* Notice that if `pagination` object is given, table will disable fetchMore and use pagination instead.
|
|
104
104
|
*/
|
|
105
105
|
pagination?: TablePaginationType;
|
package/Table/Table.js
CHANGED
|
@@ -15,7 +15,7 @@ import { useTableDraggable } from './draggable/useTableDraggable.js';
|
|
|
15
15
|
import useTableScroll from './useTableScroll.js';
|
|
16
16
|
import { useComposeRefs } from '../hooks/useComposeRefs.js';
|
|
17
17
|
import { composeRefs } from '../utils/composeRefs.js';
|
|
18
|
-
import
|
|
18
|
+
import Spin from '../Spin/Spin.js';
|
|
19
19
|
import cx from 'clsx';
|
|
20
20
|
|
|
21
21
|
const Table = forwardRef(function Table(props, ref) {
|
|
@@ -155,7 +155,7 @@ const Table = forwardRef(function Table(props, ref) {
|
|
|
155
155
|
}
|
|
156
156
|
return undefined;
|
|
157
157
|
}, [bodyRowClassName]);
|
|
158
|
-
return (jsx(TableContext.Provider, { value: tableContextValue, children: jsx(TableDataContext.Provider, { value: tableDataContextValue, children: jsx(TableComponentContext.Provider, { value: tableComponentContextValue, children: jsx(DragDropContext, { onBeforeDragStart: onBeforeDragStart, onDragEnd: onDragEnd, children: jsx(
|
|
158
|
+
return (jsx(TableContext.Provider, { value: tableContextValue, children: jsx(TableDataContext.Provider, { value: tableDataContextValue, children: jsx(TableComponentContext.Provider, { value: tableComponentContextValue, children: jsx(DragDropContext, { onBeforeDragStart: onBeforeDragStart, onDragEnd: onDragEnd, children: jsx(Spin, { loading: loading, stretch: true, description: loadingTip, backdropProps: {
|
|
159
159
|
className: tableClasses.loading,
|
|
160
160
|
}, children: jsx(Droppable, { droppableId: "mzn-table-dnd", isDropDisabled: !(draggableProp === null || draggableProp === void 0 ? void 0 : draggableProp.enabled), children: (provided) => (jsxs(Fragment, { children: [jsx("div", { ...provided.droppableProps, ref: composeRefs([scrollBody.ref, provided.innerRef]), className: cx(tableClasses.scrollContainer, scrollContainerClassName), onScroll: scrollBody.onScroll, style: tableContextValue.scroll
|
|
161
161
|
? {
|
|
@@ -178,6 +178,5 @@ const Table = forwardRef(function Table(props, ref) {
|
|
|
178
178
|
transition: '0.1s',
|
|
179
179
|
} }) }) }) })] })) }) }) }) }) }) }));
|
|
180
180
|
});
|
|
181
|
-
var Table$1 = Table;
|
|
182
181
|
|
|
183
|
-
export { Table
|
|
182
|
+
export { Table as default };
|
package/Table/TableBody.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { forwardRef, useContext } from 'react';
|
|
3
4
|
import { tableClasses } from '@mezzanine-ui/core/table';
|
|
4
5
|
import { TableDataContext, TableContext } from './TableContext.js';
|
|
5
6
|
import TableBodyRow from './TableBodyRow.js';
|
|
6
|
-
import
|
|
7
|
+
import Spin from '../Spin/Spin.js';
|
|
7
8
|
import Empty from '../Empty/Empty.js';
|
|
8
9
|
import cx from 'clsx';
|
|
9
10
|
|
|
@@ -24,7 +25,7 @@ const TableBody = forwardRef(function TableBody(props, ref) {
|
|
|
24
25
|
const currentDataSource = pagination && !disableAutoSlicing
|
|
25
26
|
? dataSource.slice(currentStartCount, currentEndCount)
|
|
26
27
|
: dataSource;
|
|
27
|
-
return (jsxs("tbody", { ...rest, ref: ref, className: cx(tableClasses.body, className), children: [currentDataSource.length ? (currentDataSource.map((rowData, index) => (jsx(TableBodyRow, { className: rowClassName === null || rowClassName === void 0 ? void 0 : rowClassName(rowData), rowData: rowData, rowIndex: index }, (rowData.key || rowData.id))))) : (jsx("tr", { children: jsx("td", { children: jsx(Empty, { ...restEmptyProps, className: cx(tableClasses.bodyEmpty, emptyComponentClassName), fullHeight: emptyComponentFullHeight, children: emptyComponentChildren }) }) })), (fetchMore === null || fetchMore === void 0 ? void 0 : fetchMore.isFetching) ? (jsx("tr", { className: tableClasses.bodyFetchMore, children: jsx("td", { "aria-label": "Loading", children: jsx(
|
|
28
|
+
return (jsxs("tbody", { ...rest, ref: ref, className: cx(tableClasses.body, className), children: [currentDataSource.length ? (currentDataSource.map((rowData, index) => (jsx(TableBodyRow, { className: rowClassName === null || rowClassName === void 0 ? void 0 : rowClassName(rowData), rowData: rowData, rowIndex: index }, (rowData.key || rowData.id))))) : (jsx("tr", { children: jsx("td", { children: jsx(Empty, { ...restEmptyProps, className: cx(tableClasses.bodyEmpty, emptyComponentClassName), fullHeight: emptyComponentFullHeight, children: emptyComponentChildren }) }) })), (fetchMore === null || fetchMore === void 0 ? void 0 : fetchMore.isFetching) ? (jsx("tr", { className: tableClasses.bodyFetchMore, children: jsx("td", { "aria-label": "Loading", children: jsx(Spin, { loading: true }) }) })) : null] }));
|
|
28
29
|
});
|
|
29
30
|
|
|
30
31
|
export { TableBody as default };
|
package/Table/TableBodyRow.js
CHANGED
package/Table/TableCell.js
CHANGED
package/Table/TableContext.js
CHANGED
package/Table/TableHeader.js
CHANGED
|
@@ -10,5 +10,5 @@ export declare function useTableDraggable(props: UseTableDraggable): {
|
|
|
10
10
|
onBeforeDragStart: (e: {
|
|
11
11
|
draggableId: SetStateAction<string>;
|
|
12
12
|
}) => void;
|
|
13
|
-
onDragEnd: import("@hello-pangea/dnd").OnDragEndResponder
|
|
13
|
+
onDragEnd: import("@hello-pangea/dnd").OnDragEndResponder<string>;
|
|
14
14
|
};
|
|
@@ -18,7 +18,7 @@ const TableExpandable = forwardRef(function TableExpandable(props, ref) {
|
|
|
18
18
|
};
|
|
19
19
|
return (jsx("div", { ...rest, ref: ref, className: cx(tableClasses.collapseAction, className), children: jsx("div", { className: tableClasses.icon, children: showIcon ? (jsx(Icon, { className: cx(tableClasses.icon, {
|
|
20
20
|
[tableClasses.iconClickable]: expandable,
|
|
21
|
-
}), color: expandable ? '
|
|
21
|
+
}), color: expandable ? 'brand' : 'neutral-faint', icon: ChevronDownIcon, onClick: onClick, style: { transform: `rotate(${expanded ? '180deg' : '0'})` } })) : null }) }));
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
export { TableExpandable as default };
|
package/Table/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
export { TableProps
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
1
|
+
export type { TableProps } from './Table';
|
|
2
|
+
export { default } from './Table';
|
|
3
|
+
export { default as TableRefresh } from './refresh/TableRefresh';
|
|
4
|
+
export type { TableRefreshProps } from './refresh/TableRefresh';
|
|
5
|
+
export type { TableCellProps } from './TableCell';
|
|
6
|
+
export { default as TableCell } from './TableCell';
|
|
7
|
+
export type { EditableBodyCellProps } from './editable/TableEditRenderWrapper';
|
|
5
8
|
export { useTableDraggable } from './draggable/useTableDraggable';
|
|
6
9
|
export { useTableRowSelection, SELECTED_ALL_KEY, } from './rowSelection/useTableRowSelection';
|
|
7
10
|
export { default as useTableScroll } from './useTableScroll';
|
|
@@ -4,7 +4,7 @@ export interface TablePaginationProps extends NativeElementPropsWithoutKeyAndRef
|
|
|
4
4
|
/**
|
|
5
5
|
* body scroll ref
|
|
6
6
|
*/
|
|
7
|
-
bodyRef: RefObject<HTMLDivElement>;
|
|
7
|
+
bodyRef: RefObject<HTMLDivElement | null>;
|
|
8
8
|
}
|
|
9
9
|
declare const TablePagination: import("react").ForwardRefExoticComponent<TablePaginationProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
10
10
|
export default TablePagination;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
2
|
import { TablePagination } from '@mezzanine-ui/core/table';
|
|
3
3
|
export interface UseTablePagination {
|
|
4
|
-
bodyRef: RefObject<HTMLDivElement>;
|
|
4
|
+
bodyRef: RefObject<HTMLDivElement | null>;
|
|
5
5
|
current?: TablePagination['current'];
|
|
6
6
|
onChange?: TablePagination['onChange'];
|
|
7
7
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { forwardRef, useContext, useCallback } from 'react';
|
|
4
|
+
import cx from 'clsx';
|
|
3
5
|
import { tableClasses } from '@mezzanine-ui/core/table';
|
|
4
6
|
import { ResetIcon } from '@mezzanine-ui/icons';
|
|
5
7
|
import { TableContext } from '../TableContext.js';
|
|
@@ -14,8 +16,7 @@ const TableRefresh = forwardRef(function TableRefresh(props, ref) {
|
|
|
14
16
|
setLoading === null || setLoading === void 0 ? void 0 : setLoading(true);
|
|
15
17
|
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
16
18
|
}, [onClick, setLoading]);
|
|
17
|
-
return (jsx("div", { ref: ref, className: tableClasses.refresh, ...rest, children: jsx(Button, { onClick: onRefreshClicked, prefix: jsx(Icon, { icon: ResetIcon }), children: children || '重新整理' }) }));
|
|
19
|
+
return (jsx("div", { ref: ref, className: cx(tableClasses.refresh, className), ...rest, children: jsx(Button, { onClick: onRefreshClicked, prefix: jsx(Icon, { icon: ResetIcon }), children: children || '重新整理' }) }));
|
|
18
20
|
});
|
|
19
|
-
var TableRefresh$1 = TableRefresh;
|
|
20
21
|
|
|
21
|
-
export { TableRefresh
|
|
22
|
+
export { TableRefresh as default };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
3
|
import { forwardRef, useContext, useCallback, useMemo, useEffect, useState } from 'react';
|
|
3
4
|
import { tableClasses } from '@mezzanine-ui/core/table';
|
|
@@ -5,9 +6,9 @@ import xor from 'lodash/xor';
|
|
|
5
6
|
import { MoreVerticalIcon } from '@mezzanine-ui/icons';
|
|
6
7
|
import { TableContext, TableDataContext } from '../TableContext.js';
|
|
7
8
|
import { SELECTED_ALL_KEY } from './useTableRowSelection.js';
|
|
9
|
+
import Checkbox from '../../Checkbox/Checkbox.js';
|
|
8
10
|
import Menu from '../../Menu/Menu.js';
|
|
9
11
|
import MenuItem from '../../Menu/MenuItem.js';
|
|
10
|
-
import Checkbox from '../../Checkbox/Checkbox.js';
|
|
11
12
|
import Dropdown from '../../Dropdown/Dropdown.js';
|
|
12
13
|
import Icon from '../../Icon/Icon.js';
|
|
13
14
|
import cx from 'clsx';
|
|
@@ -86,7 +87,7 @@ const TableRowSelection = forwardRef(function TableRowSelection(props, ref) {
|
|
|
86
87
|
},
|
|
87
88
|
}, children: (dropdownRef) => (jsx(Icon, { ref: dropdownRef, className: cx(tableClasses.icon, {
|
|
88
89
|
[tableClasses.iconClickable]: isMenuAllowOpen,
|
|
89
|
-
}), color: isMenuAllowOpen ? '
|
|
90
|
+
}), color: isMenuAllowOpen ? 'brand' : 'neutral-faint', icon: MoreVerticalIcon, onClick: onIconClicked })) })) : null })) : null] }));
|
|
90
91
|
});
|
|
91
92
|
|
|
92
93
|
export { TableRowSelection as default };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { forwardRef, useMemo, useContext } from 'react';
|
|
3
4
|
import { tableClasses } from '@mezzanine-ui/core/table';
|
|
@@ -14,7 +15,7 @@ const TableSortingIcon = forwardRef(function TableSortingIcon(props, ref) {
|
|
|
14
15
|
/** styling */
|
|
15
16
|
const currentType = (key === (sorting === null || sorting === void 0 ? void 0 : sorting.sortedOn) ? sorting.sortedType : 'none');
|
|
16
17
|
const currentIconStyle = useMemo(() => ({
|
|
17
|
-
color: currentType === 'none' ? '
|
|
18
|
+
color: currentType === 'none' ? 'neutral' : 'neutral-strong',
|
|
18
19
|
style: {
|
|
19
20
|
transform: `rotate(${90 * (currentType === 'asc' ? -1 : 1)}deg)`,
|
|
20
21
|
},
|
|
@@ -56,6 +56,7 @@ function useTableSorting(props) {
|
|
|
56
56
|
!equalityFn(prevDataSourceProps, dataSourceProp, true)) {
|
|
57
57
|
setDataSource(dataSourceProp);
|
|
58
58
|
}
|
|
59
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
59
60
|
}, [prevDataSourceProps, dataSourceProp]);
|
|
60
61
|
const getNextSortedType = useCallback((currentType) => {
|
|
61
62
|
// none -> desc -> asc -> none
|
|
@@ -39,7 +39,7 @@ function useTableFetchMore(props) {
|
|
|
39
39
|
if (prevSourceLength !== currentSourceLength) {
|
|
40
40
|
onFetching(false);
|
|
41
41
|
}
|
|
42
|
-
}, [prevSourceLength, currentSourceLength]);
|
|
42
|
+
}, [prevSourceLength, currentSourceLength, onFetching]);
|
|
43
43
|
return {
|
|
44
44
|
fetchMore,
|
|
45
45
|
isFetching,
|
|
@@ -5,12 +5,12 @@ interface TableScrollProps {
|
|
|
5
5
|
scrollBarSize?: number;
|
|
6
6
|
}
|
|
7
7
|
export default function useTableScroll(props: TableScrollProps): readonly [{
|
|
8
|
-
ref: import("react").RefObject<HTMLDivElement>;
|
|
9
|
-
target: import("react").RefObject<HTMLTableElement>;
|
|
8
|
+
ref: import("react").RefObject<HTMLDivElement | null>;
|
|
9
|
+
target: import("react").RefObject<HTMLTableElement | null>;
|
|
10
10
|
onScroll: UIEventHandler<HTMLDivElement>;
|
|
11
11
|
}, {
|
|
12
|
-
ref: import("react").RefObject<HTMLDivElement>;
|
|
13
|
-
trackRef: import("react").RefObject<HTMLDivElement>;
|
|
12
|
+
ref: import("react").RefObject<HTMLDivElement | null>;
|
|
13
|
+
trackRef: import("react").RefObject<HTMLDivElement | null>;
|
|
14
14
|
scrollBarSize: number;
|
|
15
15
|
onMouseDown: ({ clientY }: {
|
|
16
16
|
clientY: number;
|
|
@@ -20,19 +20,21 @@ export default function useTableScroll(props: TableScrollProps): readonly [{
|
|
|
20
20
|
onMouseLeave: () => void;
|
|
21
21
|
style: {
|
|
22
22
|
height: string;
|
|
23
|
-
ref?: import("react").
|
|
23
|
+
ref?: import("react").Ref<HTMLDivElement> | undefined;
|
|
24
24
|
key?: import("react").Key | null | undefined;
|
|
25
25
|
defaultChecked?: boolean | undefined;
|
|
26
26
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
27
27
|
suppressContentEditableWarning?: boolean | undefined;
|
|
28
28
|
suppressHydrationWarning?: boolean | undefined;
|
|
29
29
|
accessKey?: string | undefined;
|
|
30
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {});
|
|
30
31
|
autoFocus?: boolean | undefined;
|
|
31
32
|
className?: string | undefined;
|
|
32
33
|
contentEditable?: (boolean | "false" | "true") | "inherit" | "plaintext-only" | undefined;
|
|
33
34
|
contextMenu?: string | undefined;
|
|
34
35
|
dir?: string | undefined;
|
|
35
36
|
draggable?: (boolean | "false" | "true") | undefined;
|
|
37
|
+
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
|
|
36
38
|
hidden?: boolean | undefined;
|
|
37
39
|
id?: string | undefined;
|
|
38
40
|
lang?: string | undefined;
|
|
@@ -56,7 +58,6 @@ export default function useTableScroll(props: TableScrollProps): readonly [{
|
|
|
56
58
|
rev?: string | undefined;
|
|
57
59
|
typeof?: string | undefined;
|
|
58
60
|
vocab?: string | undefined;
|
|
59
|
-
autoCapitalize?: string | undefined;
|
|
60
61
|
autoCorrect?: string | undefined;
|
|
61
62
|
autoSave?: string | undefined;
|
|
62
63
|
color?: string | undefined;
|
|
@@ -68,8 +69,14 @@ export default function useTableScroll(props: TableScrollProps): readonly [{
|
|
|
68
69
|
results?: number | undefined;
|
|
69
70
|
security?: string | undefined;
|
|
70
71
|
unselectable?: "on" | "off" | undefined;
|
|
72
|
+
popover?: "" | "auto" | "manual" | "hint" | undefined;
|
|
73
|
+
popoverTargetAction?: "toggle" | "show" | "hide" | undefined;
|
|
74
|
+
popoverTarget?: string | undefined;
|
|
75
|
+
inert?: boolean | undefined;
|
|
71
76
|
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
|
|
72
77
|
is?: string | undefined;
|
|
78
|
+
exportparts?: string | undefined;
|
|
79
|
+
part?: string | undefined;
|
|
73
80
|
"aria-activedescendant"?: string | undefined;
|
|
74
81
|
"aria-atomic"?: (boolean | "false" | "true") | undefined;
|
|
75
82
|
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
|
|
@@ -145,7 +152,7 @@ export default function useTableScroll(props: TableScrollProps): readonly [{
|
|
|
145
152
|
onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
146
153
|
onChange?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
147
154
|
onChangeCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
148
|
-
onBeforeInput?: import("react").
|
|
155
|
+
onBeforeInput?: import("react").InputEventHandler<HTMLDivElement> | undefined;
|
|
149
156
|
onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
150
157
|
onInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
151
158
|
onInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
@@ -195,8 +202,6 @@ export default function useTableScroll(props: TableScrollProps): readonly [{
|
|
|
195
202
|
onProgressCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
196
203
|
onRateChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
197
204
|
onRateChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
198
|
-
onResize?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
199
|
-
onResizeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
200
205
|
onSeeked?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
201
206
|
onSeekedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
202
207
|
onSeeking?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
@@ -277,6 +282,8 @@ export default function useTableScroll(props: TableScrollProps): readonly [{
|
|
|
277
282
|
onLostPointerCaptureCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
278
283
|
onScroll?: UIEventHandler<HTMLDivElement> | undefined;
|
|
279
284
|
onScrollCapture?: UIEventHandler<HTMLDivElement> | undefined;
|
|
285
|
+
onScrollEnd?: UIEventHandler<HTMLDivElement> | undefined;
|
|
286
|
+
onScrollEndCapture?: UIEventHandler<HTMLDivElement> | undefined;
|
|
280
287
|
onWheel?: import("react").WheelEventHandler<HTMLDivElement> | undefined;
|
|
281
288
|
onWheelCapture?: import("react").WheelEventHandler<HTMLDivElement> | undefined;
|
|
282
289
|
onAnimationStart?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
@@ -285,24 +292,34 @@ export default function useTableScroll(props: TableScrollProps): readonly [{
|
|
|
285
292
|
onAnimationEndCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
286
293
|
onAnimationIteration?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
287
294
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
295
|
+
onToggle?: import("react").ToggleEventHandler<HTMLDivElement> | undefined;
|
|
296
|
+
onBeforeToggle?: import("react").ToggleEventHandler<HTMLDivElement> | undefined;
|
|
297
|
+
onTransitionCancel?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
298
|
+
onTransitionCancelCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
288
299
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
289
300
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
301
|
+
onTransitionRun?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
302
|
+
onTransitionRunCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
303
|
+
onTransitionStart?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
304
|
+
onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
290
305
|
};
|
|
291
306
|
trackStyle: {
|
|
292
307
|
height: string;
|
|
293
|
-
ref?: import("react").
|
|
308
|
+
ref?: import("react").Ref<HTMLDivElement> | undefined;
|
|
294
309
|
key?: import("react").Key | null | undefined;
|
|
295
310
|
defaultChecked?: boolean | undefined;
|
|
296
311
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
297
312
|
suppressContentEditableWarning?: boolean | undefined;
|
|
298
313
|
suppressHydrationWarning?: boolean | undefined;
|
|
299
314
|
accessKey?: string | undefined;
|
|
315
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {});
|
|
300
316
|
autoFocus?: boolean | undefined;
|
|
301
317
|
className?: string | undefined;
|
|
302
318
|
contentEditable?: (boolean | "false" | "true") | "inherit" | "plaintext-only" | undefined;
|
|
303
319
|
contextMenu?: string | undefined;
|
|
304
320
|
dir?: string | undefined;
|
|
305
321
|
draggable?: (boolean | "false" | "true") | undefined;
|
|
322
|
+
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
|
|
306
323
|
hidden?: boolean | undefined;
|
|
307
324
|
id?: string | undefined;
|
|
308
325
|
lang?: string | undefined;
|
|
@@ -326,7 +343,6 @@ export default function useTableScroll(props: TableScrollProps): readonly [{
|
|
|
326
343
|
rev?: string | undefined;
|
|
327
344
|
typeof?: string | undefined;
|
|
328
345
|
vocab?: string | undefined;
|
|
329
|
-
autoCapitalize?: string | undefined;
|
|
330
346
|
autoCorrect?: string | undefined;
|
|
331
347
|
autoSave?: string | undefined;
|
|
332
348
|
color?: string | undefined;
|
|
@@ -338,8 +354,14 @@ export default function useTableScroll(props: TableScrollProps): readonly [{
|
|
|
338
354
|
results?: number | undefined;
|
|
339
355
|
security?: string | undefined;
|
|
340
356
|
unselectable?: "on" | "off" | undefined;
|
|
357
|
+
popover?: "" | "auto" | "manual" | "hint" | undefined;
|
|
358
|
+
popoverTargetAction?: "toggle" | "show" | "hide" | undefined;
|
|
359
|
+
popoverTarget?: string | undefined;
|
|
360
|
+
inert?: boolean | undefined;
|
|
341
361
|
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
|
|
342
362
|
is?: string | undefined;
|
|
363
|
+
exportparts?: string | undefined;
|
|
364
|
+
part?: string | undefined;
|
|
343
365
|
"aria-activedescendant"?: string | undefined;
|
|
344
366
|
"aria-atomic"?: (boolean | "false" | "true") | undefined;
|
|
345
367
|
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
|
|
@@ -415,7 +437,7 @@ export default function useTableScroll(props: TableScrollProps): readonly [{
|
|
|
415
437
|
onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
416
438
|
onChange?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
417
439
|
onChangeCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
418
|
-
onBeforeInput?: import("react").
|
|
440
|
+
onBeforeInput?: import("react").InputEventHandler<HTMLDivElement> | undefined;
|
|
419
441
|
onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
420
442
|
onInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
421
443
|
onInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
@@ -465,8 +487,6 @@ export default function useTableScroll(props: TableScrollProps): readonly [{
|
|
|
465
487
|
onProgressCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
466
488
|
onRateChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
467
489
|
onRateChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
468
|
-
onResize?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
469
|
-
onResizeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
470
490
|
onSeeked?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
471
491
|
onSeekedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
472
492
|
onSeeking?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
@@ -547,6 +567,8 @@ export default function useTableScroll(props: TableScrollProps): readonly [{
|
|
|
547
567
|
onLostPointerCaptureCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
548
568
|
onScroll?: UIEventHandler<HTMLDivElement> | undefined;
|
|
549
569
|
onScrollCapture?: UIEventHandler<HTMLDivElement> | undefined;
|
|
570
|
+
onScrollEnd?: UIEventHandler<HTMLDivElement> | undefined;
|
|
571
|
+
onScrollEndCapture?: UIEventHandler<HTMLDivElement> | undefined;
|
|
550
572
|
onWheel?: import("react").WheelEventHandler<HTMLDivElement> | undefined;
|
|
551
573
|
onWheelCapture?: import("react").WheelEventHandler<HTMLDivElement> | undefined;
|
|
552
574
|
onAnimationStart?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
@@ -555,8 +577,16 @@ export default function useTableScroll(props: TableScrollProps): readonly [{
|
|
|
555
577
|
onAnimationEndCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
556
578
|
onAnimationIteration?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
557
579
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
580
|
+
onToggle?: import("react").ToggleEventHandler<HTMLDivElement> | undefined;
|
|
581
|
+
onBeforeToggle?: import("react").ToggleEventHandler<HTMLDivElement> | undefined;
|
|
582
|
+
onTransitionCancel?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
583
|
+
onTransitionCancelCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
558
584
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
559
585
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
586
|
+
onTransitionRun?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
587
|
+
onTransitionRunCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
588
|
+
onTransitionStart?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
589
|
+
onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
560
590
|
};
|
|
561
591
|
}, boolean];
|
|
562
592
|
export {};
|
package/Table/useTableScroll.js
CHANGED
|
@@ -37,7 +37,7 @@ function useTableScroll(props) {
|
|
|
37
37
|
const tableRef = useRef(null);
|
|
38
38
|
const scrollBarTrackRef = useRef(null);
|
|
39
39
|
const scrollBarRef = useRef(null);
|
|
40
|
-
const scrollBarDisplayTimer = useRef();
|
|
40
|
+
const scrollBarDisplayTimer = useRef(undefined);
|
|
41
41
|
const [scrollBarHeight, setScrollBarHeight] = useState(0);
|
|
42
42
|
const [pointerOffset, setPointerOffset] = useState(0);
|
|
43
43
|
const [isHorizontalScrolling, toggleIsHorizontalScrolling] = useState(false);
|
|
@@ -77,7 +77,7 @@ function useTableScroll(props) {
|
|
|
77
77
|
!scrollBarTrackRef.current)
|
|
78
78
|
return;
|
|
79
79
|
/** 觸控螢幕不需要 scroll bar */
|
|
80
|
-
const isTouchEnabled =
|
|
80
|
+
const isTouchEnabled = navigator.maxTouchPoints > 0;
|
|
81
81
|
/** firefox 的滾軸只能同時顯示 or 取消,所以乾脆就用原生的(除非能單獨關掉直向的滾軸,只顯示橫向的才行) */
|
|
82
82
|
const isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
|
83
83
|
if (isTouchEnabled || isFirefox)
|
|
@@ -98,7 +98,7 @@ function useTableScroll(props) {
|
|
|
98
98
|
`${scrollBarSize}px`;
|
|
99
99
|
}
|
|
100
100
|
resetPointerOffset();
|
|
101
|
-
}, []);
|
|
101
|
+
}, [resetPointerOffset, scrollBarSize]);
|
|
102
102
|
/** when use mouse to drag scroll bar, get cursor position */
|
|
103
103
|
const onScrollBarMouseDown = useCallback(({ clientY }) => {
|
|
104
104
|
const { current: scrollBar } = scrollBarRef;
|
|
@@ -107,7 +107,7 @@ function useTableScroll(props) {
|
|
|
107
107
|
const { top: initScrollBarTop } = scrollBar.getBoundingClientRect();
|
|
108
108
|
setPointerOffset(clientY - initScrollBarTop);
|
|
109
109
|
}, []);
|
|
110
|
-
const onScrollBarMouseUp = useCallback(() => resetPointerOffset(), []);
|
|
110
|
+
const onScrollBarMouseUp = useCallback(() => resetPointerOffset(), [resetPointerOffset]);
|
|
111
111
|
/** 偵測 table 高度是否發生變化,有的話就要重新計算 scroll bar 長度 */
|
|
112
112
|
useEffect(() => {
|
|
113
113
|
const { current: table } = tableRef;
|
|
@@ -122,7 +122,7 @@ function useTableScroll(props) {
|
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
124
|
return () => { };
|
|
125
|
-
}, []);
|
|
125
|
+
}, [onSetScrollBarHeight]);
|
|
126
126
|
useEffect(() => {
|
|
127
127
|
const { current: body } = scrollRef;
|
|
128
128
|
const { current: scrollBar } = scrollBarRef;
|
|
@@ -208,7 +208,7 @@ function useTableScroll(props) {
|
|
|
208
208
|
scrollBarRef.current.childNodes[0].style.width =
|
|
209
209
|
`${scrollBarSize + 6}px`;
|
|
210
210
|
}
|
|
211
|
-
}, []);
|
|
211
|
+
}, [scrollBarSize]);
|
|
212
212
|
/** scroll table directly */
|
|
213
213
|
const setScrollBarTop = useCallback(() => {
|
|
214
214
|
if (scrollRef.current) {
|
|
@@ -224,7 +224,7 @@ function useTableScroll(props) {
|
|
|
224
224
|
scrollBarTrackRef.current.style.height = `${tableHeight - HEADER_DEFAULT_HEIGHT}px`;
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
|
-
}, [
|
|
227
|
+
}, [pointerOffset]);
|
|
228
228
|
const onScroll = useCallback((scrollTarget) => {
|
|
229
229
|
/** 使用者開始橫向滾動 */
|
|
230
230
|
if (scrollTarget.target.scrollLeft) {
|
|
@@ -270,7 +270,9 @@ function useTableScroll(props) {
|
|
|
270
270
|
...defaultScrollBarTrackStyle,
|
|
271
271
|
height: `${(_b = (_a = scrollRef.current) === null || _a === void 0 ? void 0 : _a.scrollHeight) !== null && _b !== void 0 ? _b : 0}px`,
|
|
272
272
|
});
|
|
273
|
-
},
|
|
273
|
+
},
|
|
274
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
275
|
+
[scrollBarHeight]);
|
|
274
276
|
/** composing result */
|
|
275
277
|
const tableScrollContainer = {
|
|
276
278
|
ref: scrollRef,
|
package/Tabs/Tab.js
CHANGED
package/Tabs/TabPane.js
CHANGED
|
@@ -11,9 +11,9 @@ const TabPane = forwardRef(function TabPane(props, ref) {
|
|
|
11
11
|
/**
|
|
12
12
|
* Ignore it
|
|
13
13
|
*/
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
14
15
|
tab, ...rest } = props;
|
|
15
16
|
return (jsx("div", { ...rest, ref: ref, className: cx(tabsClasses.pane, className), children: children }));
|
|
16
17
|
});
|
|
17
|
-
var TabPane$1 = TabPane;
|
|
18
18
|
|
|
19
|
-
export { TabPane
|
|
19
|
+
export { TabPane as default };
|
package/Tabs/Tabs.js
CHANGED
|
@@ -18,15 +18,11 @@ const Tabs = forwardRef(function Tabs(props, ref) {
|
|
|
18
18
|
onChange,
|
|
19
19
|
value: activeKeyProp,
|
|
20
20
|
});
|
|
21
|
-
let pane;
|
|
22
21
|
const tabs = Children.map(children, (tabPane, index) => {
|
|
23
22
|
var _a;
|
|
24
23
|
const key = (_a = tabPane.key) !== null && _a !== void 0 ? _a : index;
|
|
25
24
|
const { tab } = tabPane.props;
|
|
26
25
|
const active = activeKey.toString() === key.toString();
|
|
27
|
-
if (active) {
|
|
28
|
-
pane = tabPane;
|
|
29
|
-
}
|
|
30
26
|
return cloneElement(tab, {
|
|
31
27
|
key,
|
|
32
28
|
active,
|
|
@@ -40,9 +36,17 @@ const Tabs = forwardRef(function Tabs(props, ref) {
|
|
|
40
36
|
},
|
|
41
37
|
});
|
|
42
38
|
});
|
|
39
|
+
let pane;
|
|
40
|
+
Children.forEach(children, (tabPane, index) => {
|
|
41
|
+
var _a;
|
|
42
|
+
const child = tabPane;
|
|
43
|
+
const key = (_a = child.key) !== null && _a !== void 0 ? _a : index;
|
|
44
|
+
if (activeKey.toString() === key.toString()) {
|
|
45
|
+
pane = child;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
43
48
|
const { isOverflowing, isScrollToBegin, isScrollToEnd, scrollToLeft, scrollToRight, } = useTabsOverflow(tabsRef);
|
|
44
49
|
return (jsxs("div", { ...rest, ref: ref, className: cx(tabsClasses.host, className), children: [jsxs("div", { className: cx(tabsClasses.tabBar, tabBarClassName), children: [jsxs("div", { className: tabsClasses.overflow, children: [isOverflowing && !isScrollToBegin && (jsx("button", { "aria-label": "scrollToLeft", className: tabsClasses.scrollBtn, onClick: () => scrollToLeft(), type: "button", children: jsx(Icon, { icon: ChevronLeftIcon }) })), jsx("div", { ref: tabsRef, className: tabsClasses.tabs, children: tabs }), isOverflowing && !isScrollToEnd && (jsx("button", { "aria-label": "scrollToRight", className: tabsClasses.scrollBtn, onClick: () => scrollToRight(), type: "button", children: jsx(Icon, { icon: ChevronRightIcon }) }))] }), actions] }), pane] }));
|
|
45
50
|
});
|
|
46
|
-
var Tabs$1 = Tabs;
|
|
47
51
|
|
|
48
|
-
export { Tabs
|
|
52
|
+
export { Tabs as default };
|
package/Tabs/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
export { TabProps
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
1
|
+
export type { TabProps } from './Tab';
|
|
2
|
+
export { default as Tab } from './Tab';
|
|
3
|
+
export type { TabPaneProps } from './TabPane';
|
|
4
|
+
export { default as TabPane } from './TabPane';
|
|
5
|
+
export type { TabsChild, TabsProps } from './Tabs';
|
|
6
|
+
export { default } from './Tabs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
|
-
export default function useTabsOverflow(tabsRef: RefObject<HTMLElement>): {
|
|
2
|
+
export default function useTabsOverflow(tabsRef: RefObject<HTMLElement | null>): {
|
|
3
3
|
isOverflowing: boolean;
|
|
4
4
|
isScrollToBegin: boolean;
|
|
5
5
|
isScrollToEnd: boolean;
|
package/Tabs/useTabsOverflow.js
CHANGED
|
@@ -42,13 +42,14 @@ function useTabsOverflow(tabsRef) {
|
|
|
42
42
|
window.addEventListener('resize', handleOverflowingState);
|
|
43
43
|
tabsRef.current.addEventListener('scroll', handleScrollState);
|
|
44
44
|
return () => {
|
|
45
|
-
|
|
45
|
+
const { current: tabsEl } = tabsRef;
|
|
46
|
+
if (tabsEl) {
|
|
46
47
|
window.removeEventListener('resize', handleOverflowingState);
|
|
47
|
-
|
|
48
|
+
tabsEl.removeEventListener('scroll', handleScrollState);
|
|
48
49
|
}
|
|
49
50
|
};
|
|
50
51
|
}
|
|
51
|
-
}, [tabsRef
|
|
52
|
+
}, [tabsRef]);
|
|
52
53
|
return {
|
|
53
54
|
isOverflowing,
|
|
54
55
|
isScrollToBegin,
|