@mezzanine-ui/react 0.16.0 → 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/AccordionControlContext.js +1 -0
- package/Accordion/AccordionDetails.js +1 -0
- package/Accordion/AccordionSummary.js +10 -10
- package/Accordion/index.d.ts +6 -3
- 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 +1 -1
- package/Anchor/index.d.ts +2 -1
- 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 +14 -16
- package/Badge/BadgeContainer.d.ts +1 -1
- package/Badge/BadgeContainer.js +1 -1
- 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 +7 -16
- package/Button/index.d.ts +4 -10
- package/Button/index.js +2 -3
- package/Button/typings.d.ts +11 -26
- package/Calendar/Calendar.d.ts +31 -2
- package/Calendar/Calendar.js +74 -19
- 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 +16 -4
- 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 +13 -3
- 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/CardActions.js +1 -1
- package/Card/index.d.ts +4 -2
- package/Checkbox/CheckAll.d.ts +16 -6
- package/Checkbox/CheckAll.js +40 -26
- package/Checkbox/Checkbox.d.ts +100 -22
- package/Checkbox/Checkbox.js +73 -16
- package/Checkbox/CheckboxGroup.d.ts +100 -18
- package/Checkbox/CheckboxGroup.js +169 -24
- 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/index.d.ts +2 -1
- package/DatePicker/DatePicker.d.ts +12 -1
- package/DatePicker/DatePicker.js +41 -9
- package/DatePicker/DatePickerCalendar.d.ts +2 -5
- package/DatePicker/DatePickerCalendar.js +37 -37
- package/DatePicker/index.d.ts +4 -2
- package/DateRangePicker/DateRangePicker.d.ts +18 -2
- package/DateRangePicker/DateRangePicker.js +143 -100
- package/DateRangePicker/DateRangePickerCalendar.d.ts +13 -9
- package/DateRangePicker/DateRangePickerCalendar.js +7 -94
- 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 +179 -94
- package/DateTimePicker/index.d.ts +2 -2
- package/DateTimePicker/index.js +0 -1
- package/Drawer/Drawer.js +2 -2
- package/Drawer/index.d.ts +2 -1
- package/Dropdown/Dropdown.js +12 -22
- package/Dropdown/index.d.ts +2 -1
- package/Empty/Empty.d.ts +1 -16
- package/Empty/Empty.js +36 -7
- 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/FormHintText.d.ts +18 -0
- package/Form/FormHintText.js +17 -0
- package/Form/FormLabel.js +1 -0
- 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/useSelectValueControl.js +2 -0
- 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 +195 -27
- 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 +1 -0
- package/Menu/index.d.ts +8 -4
- package/Message/Message.d.ts +6 -4
- package/Message/Message.js +86 -9
- package/Message/MessageTimerController.d.ts +14 -0
- package/Message/MessageTimerController.js +27 -0
- package/Message/index.d.ts +3 -2
- package/Modal/Modal.js +2 -2
- package/Modal/ModalActions.js +1 -0
- package/Modal/ModalControl.js +1 -0
- package/Modal/ModalHeader.js +1 -0
- package/Modal/index.d.ts +10 -5
- package/Modal/useModalContainer.d.ts +1 -1
- package/Modal/useModalContainer.js +2 -4
- package/Navigation/Navigation.js +37 -34
- package/Navigation/NavigationContext.js +1 -0
- package/Navigation/NavigationItem.js +1 -0
- package/Navigation/NavigationSubMenu.js +16 -26
- package/Navigation/index.d.ts +8 -4
- package/Notification/Notification.js +0 -1
- package/Notification/index.d.ts +3 -2
- package/Notifier/NotifierManager.d.ts +15 -2
- 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 +34 -3
- 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 +3 -4
- package/Pagination/PaginationItem.d.ts +1 -1
- package/Pagination/PaginationItem.js +6 -3
- package/Pagination/PaginationJumper.d.ts +7 -9
- package/Pagination/PaginationJumper.js +3 -5
- package/Pagination/PaginationPageSize.d.ts +8 -11
- package/Pagination/PaginationPageSize.js +5 -4
- 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 +13 -3
- package/Picker/PickerTrigger.js +17 -2
- package/Picker/PickerTriggerWithSeparator.d.ts +124 -0
- package/Picker/PickerTriggerWithSeparator.js +80 -0
- package/Picker/RangePickerTrigger.d.ts +55 -4
- package/Picker/RangePickerTrigger.js +65 -7
- 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/usePickerValue.d.ts +1 -2
- package/Picker/usePickerValue.js +8 -13
- package/Popconfirm/Popconfirm.js +1 -1
- package/Popconfirm/index.d.ts +2 -1
- package/Popover/Popover.js +4 -8
- package/Popover/index.d.ts +2 -1
- package/Popper/Popper.d.ts +15 -10
- package/Popper/Popper.js +88 -17
- package/Popper/index.d.ts +2 -1
- package/Portal/Portal.d.ts +13 -5
- package/Portal/Portal.js +25 -10
- 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 +71 -21
- package/Progress/index.d.ts +3 -2
- package/Provider/ConfigProvider.d.ts +1 -0
- package/Provider/ConfigProvider.js +1 -0
- package/Provider/context.js +1 -0
- package/Radio/Radio.d.ts +1 -1
- package/Radio/Radio.js +2 -1
- package/Radio/RadioGroup.d.ts +1 -1
- package/Radio/RadioGroup.js +1 -1
- 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 +1 -1
- package/Select/AutoComplete.js +2 -1
- package/Select/Option.js +1 -0
- package/Select/Select.d.ts +1 -1
- package/Select/Select.js +2 -1
- package/Select/SelectControlContext.js +1 -0
- package/Select/SelectTrigger.d.ts +1 -87
- package/Select/SelectTrigger.js +26 -21
- package/Select/SelectTriggerTags.d.ts +1 -1
- package/Select/SelectTriggerTags.js +47 -18
- package/Select/TreeSelect.d.ts +1 -1
- package/Select/TreeSelect.js +2 -1
- 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 +83 -44
- 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 +12 -4
- package/Skeleton/index.d.ts +2 -1
- package/Slider/Slider.d.ts +44 -7
- package/Slider/Slider.js +17 -13
- package/Slider/index.d.ts +5 -3
- package/Spin/Spin.d.ts +39 -0
- package/{Loading/Loading.js → Spin/Spin.js} +9 -9
- package/Spin/index.d.ts +2 -0
- package/Spin/index.js +1 -0
- package/Stepper/Step.d.ts +1 -35
- package/Stepper/Step.js +43 -8
- package/Stepper/Stepper.d.ts +1 -14
- package/Stepper/Stepper.js +49 -15
- 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.js +2 -2
- package/Table/TableBody.js +3 -2
- package/Table/TableBodyRow.js +1 -0
- package/Table/TableContext.js +1 -0
- package/Table/TableExpandedTable.js +1 -0
- package/Table/TableHeader.js +1 -0
- 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.js +1 -0
- package/Table/pagination/useTablePagination.js +1 -0
- package/Table/refresh/TableRefresh.js +3 -1
- 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 +4 -8
- package/Table/useTableScroll.js +9 -7
- package/Tabs/TabPane.js +1 -0
- package/Tabs/Tabs.js +9 -4
- package/Tabs/index.d.ts +6 -3
- package/Tabs/useTabsOverflow.js +4 -3
- package/Tag/Tag.d.ts +2 -25
- package/Tag/Tag.js +23 -13
- 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 -19
- package/TextField/TextField.js +58 -22
- package/TextField/index.d.ts +2 -1
- package/Textarea/Textarea.d.ts +19 -51
- package/Textarea/Textarea.js +13 -19
- package/Textarea/index.d.ts +2 -2
- package/TimePanel/TimePanel.d.ts +1 -22
- package/TimePanel/TimePanel.js +31 -26
- package/TimePanel/TimePanelAction.d.ts +2 -8
- package/TimePanel/TimePanelAction.js +2 -2
- package/TimePanel/TimePanelColumn.d.ts +0 -13
- package/TimePanel/TimePanelColumn.js +9 -11
- package/TimePanel/index.d.ts +6 -3
- package/TimePicker/TimePicker.d.ts +10 -1
- package/TimePicker/TimePicker.js +86 -35
- package/TimePicker/TimePickerPanel.d.ts +1 -2
- package/TimePicker/TimePickerPanel.js +2 -2
- 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 +13 -2
- package/Tooltip/Tooltip.js +56 -10
- 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 +5 -6
- package/Transition/Fade.js +4 -4
- 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 -16
- package/Transition/Slide.d.ts +7 -0
- package/Transition/{Zoom.js → Slide.js} +14 -12
- package/Transition/SlideFade.d.ts +3 -0
- package/Transition/SlideFade.js +5 -4
- package/Transition/Transition.d.ts +2 -2
- 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/TreeNode.js +7 -6
- package/Tree/index.d.ts +10 -5
- package/Typography/Typography.d.ts +6 -9
- package/Typography/Typography.js +7 -9
- package/Typography/index.d.ts +2 -5
- 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/index.d.ts +4 -2
- package/_internal/InputTriggerPopper/InputTriggerPopper.js +15 -25
- package/_internal/InputTriggerPopper/index.d.ts +2 -1
- package/_internal/SlideFadeOverlay/SlideFadeOverlay.d.ts +2 -2
- package/_internal/SlideFadeOverlay/SlideFadeOverlay.js +4 -27
- 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/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 +93 -80
- 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 +13 -17
- 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/Button/IconButton.d.ts +0 -21
- package/Button/IconButton.js +0 -13
- package/DateTimePicker/DateTimePickerPanel.d.ts +0 -28
- package/DateTimePicker/DateTimePickerPanel.js +0 -49
- package/Form/FormMessage.d.ts +0 -7
- package/Form/FormMessage.js +0 -18
- 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 -31
- 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 -28
- 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 -23
- 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 -51
- package/Upload/UploadPictureBlock.d.ts +0 -20
- package/Upload/UploadPictureBlock.js +0 -81
- package/Upload/UploadPictureWall.d.ts +0 -81
- package/Upload/UploadPictureWall.js +0 -168
- 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 -29
- package/utils/scroll-lock.d.ts +0 -2
- package/utils/scroll-lock.js +0 -24
package/Stepper/Stepper.js
CHANGED
|
@@ -1,33 +1,67 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { forwardRef, Children, cloneElement } from 'react';
|
|
2
|
+
import { forwardRef, Children, useRef, useCallback, cloneElement, useEffect } from 'react';
|
|
3
3
|
import { stepperClasses } from '@mezzanine-ui/core/stepper';
|
|
4
|
+
import { useStepDistance } from './useStepDistance.js';
|
|
4
5
|
import cx from 'clsx';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* The react component for `mezzanine` stepper.
|
|
8
9
|
*/
|
|
9
10
|
const Stepper = forwardRef(function Stepper(props, ref) {
|
|
10
|
-
const {
|
|
11
|
+
const { children, className, currentStep = 0, onStepChange, orientation = 'horizontal', type = 'number', ...rest } = props;
|
|
11
12
|
const childrenArray = Children.toArray(children);
|
|
13
|
+
const stepperRef = useRef(null);
|
|
14
|
+
const stepRefs = useRef([]);
|
|
15
|
+
const mergedRef = useCallback((element) => {
|
|
16
|
+
stepperRef.current = element;
|
|
17
|
+
if (ref) {
|
|
18
|
+
if (typeof ref === 'function') {
|
|
19
|
+
ref(element);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
ref.current = element;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}, [ref]);
|
|
26
|
+
const stepPositions = useStepDistance(orientation, stepperRef, stepRefs, type, childrenArray);
|
|
27
|
+
const getStepStatus = (index, processingIndex) => {
|
|
28
|
+
if (index === processingIndex)
|
|
29
|
+
return 'processing';
|
|
30
|
+
if (index < processingIndex)
|
|
31
|
+
return 'succeeded';
|
|
32
|
+
return 'pending';
|
|
33
|
+
};
|
|
12
34
|
const stepsWithState = childrenArray.map((element, index) => {
|
|
35
|
+
var _a;
|
|
13
36
|
const step = element;
|
|
14
|
-
const state = {
|
|
15
|
-
index,
|
|
16
|
-
active: activeStep === index,
|
|
17
|
-
completed: activeStep > index,
|
|
18
|
-
disabled: activeStep < index,
|
|
19
|
-
};
|
|
20
|
-
if (step.props.active || step.props.disabled || step.props.completed) {
|
|
21
|
-
state.active = false;
|
|
22
|
-
state.completed = false;
|
|
23
|
-
state.disabled = false;
|
|
24
|
-
}
|
|
25
37
|
return cloneElement(step, {
|
|
26
|
-
|
|
38
|
+
index,
|
|
39
|
+
orientation,
|
|
40
|
+
ref: (el) => {
|
|
41
|
+
stepRefs.current[index] = el;
|
|
42
|
+
},
|
|
43
|
+
status: getStepStatus(index, currentStep),
|
|
44
|
+
style: {
|
|
45
|
+
'--connect-line-distance': ((_a = stepPositions === null || stepPositions === void 0 ? void 0 : stepPositions.distances) === null || _a === void 0 ? void 0 : _a[index])
|
|
46
|
+
? `${stepPositions.distances[index]}px`
|
|
47
|
+
: undefined,
|
|
48
|
+
...step.props.style,
|
|
49
|
+
},
|
|
50
|
+
type,
|
|
27
51
|
...step.props,
|
|
28
52
|
});
|
|
29
53
|
});
|
|
30
|
-
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
if (typeof onStepChange === 'function') {
|
|
56
|
+
onStepChange(currentStep);
|
|
57
|
+
}
|
|
58
|
+
}, [currentStep, onStepChange]);
|
|
59
|
+
return (jsx("div", { ...rest, className: cx(stepperClasses.host, {
|
|
60
|
+
[stepperClasses.horizontal]: orientation === 'horizontal',
|
|
61
|
+
[stepperClasses.vertical]: orientation === 'vertical',
|
|
62
|
+
[stepperClasses.dot]: type === 'dot',
|
|
63
|
+
[stepperClasses.number]: type === 'number',
|
|
64
|
+
}, className), ref: mergedRef, children: stepsWithState }));
|
|
31
65
|
});
|
|
32
66
|
|
|
33
67
|
export { Stepper as default };
|
package/Stepper/index.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
export { StepProps
|
|
2
|
-
export {
|
|
1
|
+
export type { StepProps } from './typings';
|
|
2
|
+
export { default as Step } from './Step';
|
|
3
|
+
export type { StepperProps } from './typings';
|
|
4
|
+
export { default } from './Stepper';
|
|
5
|
+
export { useStepper } from './useStepper';
|
package/Stepper/index.js
CHANGED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
|
|
3
|
+
export interface StepperProps extends NativeElementPropsWithoutKeyAndRef<'div'> {
|
|
4
|
+
/**
|
|
5
|
+
* Three or more `<Step />` components.
|
|
6
|
+
*/
|
|
7
|
+
children: ReactElement<StepProps> | ReactElement<StepProps>[];
|
|
8
|
+
/**
|
|
9
|
+
* Set the processing step index to replace step status.
|
|
10
|
+
* Index is zero-based (0 = first step, 1 = second step, etc.).
|
|
11
|
+
* @default 0
|
|
12
|
+
*/
|
|
13
|
+
currentStep?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Callback fired when the step changes.
|
|
16
|
+
* @param stepIndex The current step index after change.
|
|
17
|
+
*/
|
|
18
|
+
onStepChange?: (stepIndex: number) => void;
|
|
19
|
+
/**
|
|
20
|
+
* The orientation of the stepper.
|
|
21
|
+
* - 'horizontal': Steps arranged horizontally
|
|
22
|
+
* - 'vertical': Steps arranged vertically
|
|
23
|
+
* @default 'horizontal'
|
|
24
|
+
*/
|
|
25
|
+
orientation?: 'horizontal' | 'vertical';
|
|
26
|
+
/**
|
|
27
|
+
* The type of step indicator.
|
|
28
|
+
* - 'dot': Display as dots
|
|
29
|
+
* - 'number': Display as numbers
|
|
30
|
+
* @default 'number'
|
|
31
|
+
*/
|
|
32
|
+
type?: 'dot' | 'number';
|
|
33
|
+
}
|
|
34
|
+
export interface StepProps extends Omit<NativeElementPropsWithoutKeyAndRef<'div'>, 'title' | 'children'> {
|
|
35
|
+
/**
|
|
36
|
+
* The step description, visible if value is not empty.
|
|
37
|
+
*/
|
|
38
|
+
description?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Whether the step is disabled.
|
|
41
|
+
* Only applies when status is not 'processing'.
|
|
42
|
+
*/
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Whether the step is in error state.
|
|
46
|
+
* Only applies when status is not 'processing'.
|
|
47
|
+
*/
|
|
48
|
+
error?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Step index, automatically set by the parent <Stepper />.
|
|
51
|
+
* Zero-based index (0 = first step, 1 = second step, etc.).
|
|
52
|
+
*/
|
|
53
|
+
index?: number;
|
|
54
|
+
/**
|
|
55
|
+
* The orientation of the step, inherited from parent Stepper.
|
|
56
|
+
* - 'horizontal': Step arranged horizontally
|
|
57
|
+
* - 'vertical': Step arranged vertically
|
|
58
|
+
*/
|
|
59
|
+
orientation?: 'horizontal' | 'vertical';
|
|
60
|
+
/**
|
|
61
|
+
* The current status of the step, automatically set by the parent <Stepper />.
|
|
62
|
+
* - 'processing': Currently active/in progress
|
|
63
|
+
* - 'pending': Waiting to be processed (default for future steps)
|
|
64
|
+
* - 'succeeded': Successfully completed
|
|
65
|
+
*/
|
|
66
|
+
status?: 'processing' | 'pending' | 'succeeded';
|
|
67
|
+
/**
|
|
68
|
+
* The step title.
|
|
69
|
+
*/
|
|
70
|
+
title?: string;
|
|
71
|
+
/**
|
|
72
|
+
* The type of step indicator, inherited from parent Stepper.
|
|
73
|
+
* - 'dot': Display as dot
|
|
74
|
+
* - 'number': Display as number
|
|
75
|
+
*/
|
|
76
|
+
type?: 'dot' | 'number';
|
|
77
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode, RefObject } from 'react';
|
|
2
|
+
export declare const useStepDistance: (orientation: "horizontal" | "vertical", stepperRef: RefObject<HTMLDivElement | null>, stepRefs: RefObject<(HTMLDivElement | null)[]>, type: "dot" | "number", childrenArray: Array<Exclude<ReactNode, boolean | null | undefined>>) => {
|
|
3
|
+
distances: number[];
|
|
4
|
+
positions: Array<{
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
}>;
|
|
10
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { stepClasses } from '@mezzanine-ui/core/stepper';
|
|
2
|
+
import { useState, useLayoutEffect } from 'react';
|
|
3
|
+
|
|
4
|
+
const useStepDistance = (orientation, stepperRef, stepRefs, type, childrenArray) => {
|
|
5
|
+
const [stepPositions, setStepPositions] = useState({ distances: [], positions: [] });
|
|
6
|
+
// Calculate position and distance between each step
|
|
7
|
+
useLayoutEffect(() => {
|
|
8
|
+
const calculatePositions = () => {
|
|
9
|
+
if (!stepperRef.current || stepRefs.current.length === 0)
|
|
10
|
+
return;
|
|
11
|
+
const stepperRect = stepperRef.current.getBoundingClientRect();
|
|
12
|
+
const positions = [];
|
|
13
|
+
const distances = [];
|
|
14
|
+
stepRefs.current.forEach((stepElement) => {
|
|
15
|
+
if (stepElement) {
|
|
16
|
+
const stepRect = stepElement.getBoundingClientRect();
|
|
17
|
+
positions.push({
|
|
18
|
+
x: stepRect.left - stepperRect.left,
|
|
19
|
+
y: stepRect.top - stepperRect.top,
|
|
20
|
+
width: stepRect.width,
|
|
21
|
+
height: stepRect.height,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
// Calculate distance between each pair of adjacent steps
|
|
26
|
+
for (let i = 0; i < positions.length - 1; i += 1) {
|
|
27
|
+
const next = positions[i + 1];
|
|
28
|
+
const currentStepElement = stepRefs.current[i];
|
|
29
|
+
if (orientation === 'horizontal' && type === 'number') {
|
|
30
|
+
// Horizontal number version: from current step title to next step start
|
|
31
|
+
const titleElement = currentStepElement === null || currentStepElement === void 0 ? void 0 : currentStepElement.querySelector(`.${stepClasses.titleConnectLine}`);
|
|
32
|
+
if (titleElement) {
|
|
33
|
+
const titleRect = titleElement.getBoundingClientRect();
|
|
34
|
+
const titleEnd = titleRect.right - stepperRect.left;
|
|
35
|
+
distances.push(next.x - titleEnd);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
distances.push(0);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
else if (orientation === 'horizontal' && type === 'dot') {
|
|
42
|
+
// Horizontal dot version: calculate x-axis distance from status-indicator
|
|
43
|
+
const statusIndicatorElement = currentStepElement === null || currentStepElement === void 0 ? void 0 : currentStepElement.querySelector(`.${stepClasses.statusIndicator}`);
|
|
44
|
+
if (statusIndicatorElement) {
|
|
45
|
+
const statusIndicatorRect = statusIndicatorElement.getBoundingClientRect();
|
|
46
|
+
const statusIndicatorEnd = statusIndicatorRect.right - stepperRect.left;
|
|
47
|
+
distances.push(next.x +
|
|
48
|
+
next.width / 2 -
|
|
49
|
+
statusIndicatorEnd -
|
|
50
|
+
statusIndicatorElement.clientWidth / 2);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
distances.push(0);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
// Vertical orientation: calculate y-axis distance
|
|
58
|
+
const statusIndicatorElement = currentStepElement === null || currentStepElement === void 0 ? void 0 : currentStepElement.querySelector(`.${stepClasses.statusIndicator}`);
|
|
59
|
+
if (statusIndicatorElement) {
|
|
60
|
+
const statusIndicatorRect = statusIndicatorElement.getBoundingClientRect();
|
|
61
|
+
const statusIndicatorEnd = statusIndicatorRect.bottom - stepperRect.top;
|
|
62
|
+
distances.push(next.y - statusIndicatorEnd);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
distances.push(0);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
setStepPositions({ distances, positions });
|
|
70
|
+
};
|
|
71
|
+
calculatePositions();
|
|
72
|
+
// Add resize listener to recalculate positions on window resize
|
|
73
|
+
window.addEventListener('resize', calculatePositions);
|
|
74
|
+
return () => {
|
|
75
|
+
window.removeEventListener('resize', calculatePositions);
|
|
76
|
+
};
|
|
77
|
+
}, [orientation, type, childrenArray.length, stepperRef, stepRefs]);
|
|
78
|
+
return stepPositions;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export { useStepDistance };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface UseStepperOptions {
|
|
2
|
+
/**
|
|
3
|
+
* The default step index to start from.
|
|
4
|
+
* Index is zero-based (0 = first step, 1 = second step, etc.).
|
|
5
|
+
* @default 0
|
|
6
|
+
*/
|
|
7
|
+
defaultStep?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Total number of steps in the stepper.
|
|
10
|
+
* @default Number.MAX_VALUE
|
|
11
|
+
*/
|
|
12
|
+
totalSteps?: number;
|
|
13
|
+
}
|
|
14
|
+
export declare const useStepper: ({ defaultStep, totalSteps, }: UseStepperOptions) => {
|
|
15
|
+
currentStep: number;
|
|
16
|
+
goToStep: (step: number) => void;
|
|
17
|
+
isFirstStep: boolean;
|
|
18
|
+
isLastStep: boolean;
|
|
19
|
+
nextStep: () => void;
|
|
20
|
+
prevStep: () => void;
|
|
21
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
|
|
3
|
+
const useStepper = ({ defaultStep = 0, totalSteps = Number.MAX_VALUE, }) => {
|
|
4
|
+
const [currentStep, setCurrentStep] = useState(defaultStep);
|
|
5
|
+
const goToStep = (step) => {
|
|
6
|
+
setCurrentStep(Math.max(0, Math.min(step, totalSteps - 1)));
|
|
7
|
+
};
|
|
8
|
+
const isFirstStep = currentStep === 0;
|
|
9
|
+
const isLastStep = currentStep === totalSteps - 1;
|
|
10
|
+
const nextStep = () => {
|
|
11
|
+
setCurrentStep((prev) => Math.min(prev + 1, totalSteps - 1));
|
|
12
|
+
};
|
|
13
|
+
const prevStep = () => {
|
|
14
|
+
setCurrentStep((prev) => Math.max(prev - 1, 0));
|
|
15
|
+
};
|
|
16
|
+
return {
|
|
17
|
+
currentStep,
|
|
18
|
+
goToStep,
|
|
19
|
+
isFirstStep,
|
|
20
|
+
isLastStep,
|
|
21
|
+
nextStep,
|
|
22
|
+
prevStep,
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export { useStepper };
|
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
|
? {
|
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/TableContext.js
CHANGED
package/Table/TableHeader.js
CHANGED
|
@@ -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';
|
|
@@ -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,7 +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
21
|
|
|
20
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,
|
|
@@ -69,7 +69,7 @@ export default function useTableScroll(props: TableScrollProps): readonly [{
|
|
|
69
69
|
results?: number | undefined;
|
|
70
70
|
security?: string | undefined;
|
|
71
71
|
unselectable?: "on" | "off" | undefined;
|
|
72
|
-
popover?: "" | "auto" | "manual" | undefined;
|
|
72
|
+
popover?: "" | "auto" | "manual" | "hint" | undefined;
|
|
73
73
|
popoverTargetAction?: "toggle" | "show" | "hide" | undefined;
|
|
74
74
|
popoverTarget?: string | undefined;
|
|
75
75
|
inert?: boolean | undefined;
|
|
@@ -152,7 +152,7 @@ export default function useTableScroll(props: TableScrollProps): readonly [{
|
|
|
152
152
|
onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
153
153
|
onChange?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
154
154
|
onChangeCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
155
|
-
onBeforeInput?: import("react").
|
|
155
|
+
onBeforeInput?: import("react").InputEventHandler<HTMLDivElement> | undefined;
|
|
156
156
|
onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
157
157
|
onInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
158
158
|
onInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
@@ -202,8 +202,6 @@ export default function useTableScroll(props: TableScrollProps): readonly [{
|
|
|
202
202
|
onProgressCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
203
203
|
onRateChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
204
204
|
onRateChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
205
|
-
onResize?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
206
|
-
onResizeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
207
205
|
onSeeked?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
208
206
|
onSeekedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
209
207
|
onSeeking?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
@@ -356,7 +354,7 @@ export default function useTableScroll(props: TableScrollProps): readonly [{
|
|
|
356
354
|
results?: number | undefined;
|
|
357
355
|
security?: string | undefined;
|
|
358
356
|
unselectable?: "on" | "off" | undefined;
|
|
359
|
-
popover?: "" | "auto" | "manual" | undefined;
|
|
357
|
+
popover?: "" | "auto" | "manual" | "hint" | undefined;
|
|
360
358
|
popoverTargetAction?: "toggle" | "show" | "hide" | undefined;
|
|
361
359
|
popoverTarget?: string | undefined;
|
|
362
360
|
inert?: boolean | undefined;
|
|
@@ -439,7 +437,7 @@ export default function useTableScroll(props: TableScrollProps): readonly [{
|
|
|
439
437
|
onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
440
438
|
onChange?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
441
439
|
onChangeCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
442
|
-
onBeforeInput?: import("react").
|
|
440
|
+
onBeforeInput?: import("react").InputEventHandler<HTMLDivElement> | undefined;
|
|
443
441
|
onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
444
442
|
onInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
445
443
|
onInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
@@ -489,8 +487,6 @@ export default function useTableScroll(props: TableScrollProps): readonly [{
|
|
|
489
487
|
onProgressCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
490
488
|
onRateChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
491
489
|
onRateChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
492
|
-
onResize?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
493
|
-
onResizeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
494
490
|
onSeeked?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
495
491
|
onSeekedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
496
492
|
onSeeking?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
package/Table/useTableScroll.js
CHANGED
|
@@ -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/TabPane.js
CHANGED
|
@@ -11,6 +11,7 @@ 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
|
});
|