@mezzanine-ui/react 0.13.10 → 0.13.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion/Accordion.d.ts +24 -24
- package/Accordion/Accordion.js +25 -25
- package/Accordion/AccordionControlContext.d.ts +9 -9
- package/Accordion/AccordionDetails.d.ts +10 -10
- package/Accordion/AccordionDetails.js +16 -16
- package/Accordion/AccordionSummary.d.ts +18 -18
- package/Accordion/AccordionSummary.js +39 -39
- package/Accordion/index.d.ts +3 -3
- package/Alert/Alert.d.ts +20 -20
- package/Alert/Alert.js +9 -9
- package/Alert/index.d.ts +2 -2
- package/AppBar/AppBar.d.ts +14 -14
- package/AppBar/AppBar.js +25 -25
- package/AppBar/AppBarBrand.d.ts +5 -5
- package/AppBar/AppBarBrand.js +4 -4
- package/AppBar/AppBarMain.d.ts +5 -5
- package/AppBar/AppBarMain.js +4 -4
- package/AppBar/AppBarSupport.d.ts +5 -5
- package/AppBar/AppBarSupport.js +4 -4
- package/AppBar/index.d.ts +4 -4
- package/Badge/Badge.d.ts +19 -19
- package/Badge/Badge.js +20 -20
- package/Badge/BadgeContainer.d.ts +8 -8
- package/Badge/BadgeContainer.js +7 -7
- package/Badge/index.d.ts +2 -2
- package/Button/Button.d.ts +11 -11
- package/Button/Button.js +29 -29
- package/Button/ButtonGroup.d.ts +63 -63
- package/Button/ButtonGroup.js +29 -29
- package/Button/IconButton.d.ts +21 -21
- package/Button/IconButton.js +7 -7
- package/Button/index.d.ts +20 -20
- package/Button/index.js +1 -2
- package/Button/typings.d.ts +44 -44
- package/Calendar/Calendar.d.ts +69 -69
- package/Calendar/Calendar.js +38 -38
- package/Calendar/CalendarCell.d.ts +22 -22
- package/Calendar/CalendarCell.js +11 -11
- package/Calendar/CalendarContext.d.ts +22 -22
- package/Calendar/CalendarContext.js +28 -28
- package/Calendar/CalendarControls.d.ts +26 -26
- package/Calendar/CalendarControls.js +11 -11
- package/Calendar/CalendarDayOfWeek.d.ts +15 -15
- package/Calendar/CalendarDayOfWeek.js +9 -9
- package/Calendar/CalendarDays.d.ts +38 -38
- package/Calendar/CalendarDays.js +36 -36
- package/Calendar/CalendarMonths.d.ts +42 -42
- package/Calendar/CalendarMonths.js +22 -22
- package/Calendar/CalendarWeeks.d.ts +41 -41
- package/Calendar/CalendarWeeks.js +42 -42
- package/Calendar/CalendarYears.d.ts +40 -40
- package/Calendar/CalendarYears.js +25 -25
- package/Calendar/index.d.ts +12 -12
- package/Calendar/useCalendarControlModifiers.d.ts +7 -7
- package/Calendar/useCalendarControlModifiers.js +20 -20
- package/Calendar/useCalendarControls.d.ts +12 -12
- package/Calendar/useCalendarControls.js +27 -27
- package/Calendar/useCalendarModeStack.d.ts +6 -6
- package/Calendar/useCalendarModeStack.js +10 -10
- package/Card/Card.d.ts +51 -51
- package/Card/Card.js +12 -12
- package/Card/CardActions.d.ts +34 -34
- package/Card/CardActions.js +7 -7
- package/Card/index.d.ts +2 -2
- package/Checkbox/CheckAll.d.ts +13 -13
- package/Checkbox/CheckAll.js +28 -28
- package/Checkbox/Checkbox.d.ts +46 -46
- package/Checkbox/Checkbox.js +23 -23
- package/Checkbox/CheckboxGroup.d.ts +47 -47
- package/Checkbox/CheckboxGroup.js +27 -27
- package/Checkbox/CheckboxGroupContext.d.ts +9 -9
- package/Checkbox/index.d.ts +4 -4
- package/ConfirmActions/ConfirmActions.d.ts +45 -45
- package/ConfirmActions/ConfirmActions.js +8 -8
- package/ConfirmActions/index.d.ts +1 -1
- package/DatePicker/DatePicker.d.ts +32 -32
- package/DatePicker/DatePicker.js +119 -119
- package/DatePicker/DatePickerCalendar.d.ts +32 -32
- package/DatePicker/DatePickerCalendar.js +52 -52
- package/DatePicker/index.d.ts +2 -2
- package/DateRangePicker/DateRangePicker.d.ts +38 -38
- package/DateRangePicker/DateRangePicker.js +173 -173
- package/DateRangePicker/DateRangePickerCalendar.d.ts +26 -26
- package/DateRangePicker/DateRangePickerCalendar.js +86 -86
- package/DateRangePicker/index.d.ts +4 -4
- package/DateRangePicker/useDateRangeCalendarControls.d.ts +14 -14
- package/DateRangePicker/useDateRangeCalendarControls.js +84 -84
- package/DateRangePicker/useDateRangePickerValue.d.ts +23 -23
- package/DateRangePicker/useDateRangePickerValue.js +81 -81
- package/DateTimePicker/DateTimePicker.d.ts +28 -28
- package/DateTimePicker/DateTimePicker.js +107 -107
- package/DateTimePicker/DateTimePickerPanel.d.ts +29 -29
- package/DateTimePicker/DateTimePickerPanel.js +36 -36
- package/DateTimePicker/index.d.ts +2 -2
- package/Drawer/Drawer.d.ts +13 -13
- package/Drawer/Drawer.js +10 -10
- package/Drawer/index.d.ts +2 -2
- package/Dropdown/Dropdown.d.ts +25 -25
- package/Dropdown/Dropdown.js +52 -52
- package/Dropdown/index.d.ts +1 -1
- package/Empty/Empty.d.ts +18 -18
- package/Empty/Empty.js +6 -6
- package/Empty/index.d.ts +1 -1
- package/Form/FormControlContext.d.ts +9 -9
- package/Form/FormField.d.ts +27 -27
- package/Form/FormField.js +16 -16
- package/Form/FormLabel.d.ts +11 -11
- package/Form/FormLabel.js +8 -8
- package/Form/FormMessage.d.ts +8 -8
- package/Form/FormMessage.js +9 -9
- package/Form/index.d.ts +5 -5
- package/Form/typings.d.ts +4 -4
- package/Form/useAutoCompleteValueControl.d.ts +42 -42
- package/Form/useAutoCompleteValueControl.js +97 -94
- package/Form/useCheckboxControlValue.d.ts +11 -11
- package/Form/useCheckboxControlValue.js +24 -24
- package/Form/useControlValueState.d.ts +7 -7
- package/Form/useControlValueState.js +10 -10
- package/Form/useCustomControlValue.d.ts +5 -5
- package/Form/useCustomControlValue.js +12 -12
- package/Form/useInputControlValue.d.ts +7 -7
- package/Form/useInputControlValue.js +18 -18
- package/Form/useInputWithClearControlValue.d.ts +6 -6
- package/Form/useInputWithClearControlValue.js +28 -28
- package/Form/useInputWithTagsModeValue.d.ts +37 -37
- package/Form/useInputWithTagsModeValue.js +83 -83
- package/Form/useRadioControlValue.d.ts +11 -11
- package/Form/useRadioControlValue.js +19 -19
- package/Form/useSelectValueControl.d.ts +33 -33
- package/Form/useSelectValueControl.js +71 -71
- package/Form/useSwitchControlValue.d.ts +7 -7
- package/Form/useSwitchControlValue.js +18 -18
- package/Icon/Icon.d.ts +32 -32
- package/Icon/Icon.js +18 -18
- package/Icon/index.d.ts +3 -3
- package/Input/Input.d.ts +78 -78
- package/Input/Input.js +34 -34
- package/Input/index.d.ts +2 -2
- package/Loading/Loading.d.ts +34 -34
- package/Loading/Loading.js +19 -19
- package/Loading/index.d.ts +1 -1
- package/Menu/Menu.d.ts +29 -29
- package/Menu/Menu.js +16 -16
- package/Menu/MenuDivider.d.ts +8 -8
- package/Menu/MenuDivider.js +7 -7
- package/Menu/MenuItem.d.ts +24 -24
- package/Menu/MenuItem.js +16 -16
- package/Menu/MenuItemGroup.d.ts +13 -13
- package/Menu/MenuItemGroup.js +7 -7
- package/Menu/index.d.ts +5 -5
- package/Message/Message.d.ts +36 -36
- package/Message/Message.js +63 -63
- package/Message/index.d.ts +2 -2
- package/Modal/Modal.d.ts +37 -37
- package/Modal/Modal.js +15 -15
- package/Modal/ModalActions.d.ts +10 -10
- package/Modal/ModalActions.js +10 -10
- package/Modal/ModalBody.d.ts +8 -8
- package/Modal/ModalBody.js +7 -7
- package/Modal/ModalControl.d.ts +7 -7
- package/Modal/ModalControl.js +3 -3
- package/Modal/ModalFooter.d.ts +8 -8
- package/Modal/ModalFooter.js +7 -7
- package/Modal/ModalHeader.d.ts +20 -20
- package/Modal/ModalHeader.js +10 -10
- package/Modal/index.d.ts +7 -7
- package/Modal/useModalContainer.d.ts +6 -6
- package/Modal/useModalContainer.js +19 -19
- package/Navigation/Navigation.d.ts +29 -29
- package/Navigation/Navigation.js +45 -45
- package/Navigation/NavigationContext.d.ts +6 -6
- package/Navigation/NavigationContext.js +2 -2
- package/Navigation/NavigationItem.d.ts +31 -31
- package/Navigation/NavigationItem.js +13 -13
- package/Navigation/NavigationSubMenu.d.ts +22 -22
- package/Navigation/NavigationSubMenu.js +48 -48
- package/Navigation/index.d.ts +4 -4
- package/Notification/Notification.d.ts +54 -54
- package/Notification/Notification.js +60 -60
- package/Notification/index.d.ts +2 -2
- package/Notifier/NotifierManager.d.ts +17 -17
- package/Notifier/NotifierManager.js +25 -25
- package/Notifier/createNotifier.d.ts +21 -21
- package/Notifier/createNotifier.js +65 -65
- package/Notifier/index.d.ts +2 -2
- package/Notifier/typings.d.ts +28 -28
- package/Overlay/Overlay.d.ts +43 -43
- package/Overlay/Overlay.js +22 -22
- package/Overlay/index.d.ts +1 -1
- package/PageFooter/PageFooter.d.ts +15 -15
- package/PageFooter/PageFooter.js +4 -4
- package/PageFooter/index.d.ts +1 -1
- package/Pagination/Pagination.d.ts +105 -105
- package/Pagination/Pagination.js +18 -18
- package/Pagination/PaginationItem.d.ts +27 -27
- package/Pagination/PaginationItem.js +16 -16
- package/Pagination/PaginationJumper.d.ts +38 -38
- package/Pagination/PaginationJumper.js +40 -40
- package/Pagination/PaginationPageSize.d.ts +38 -38
- package/Pagination/PaginationPageSize.js +8 -8
- package/Pagination/index.d.ts +6 -6
- package/Pagination/usePagination.d.ts +16 -16
- package/Pagination/usePagination.js +73 -73
- package/Picker/PickerTrigger.d.ts +40 -40
- package/Picker/PickerTrigger.js +7 -7
- package/Picker/RangePickerTrigger.d.ts +64 -64
- package/Picker/RangePickerTrigger.js +7 -7
- package/Picker/index.d.ts +7 -7
- package/Picker/usePickerDocumentEventClose.d.ts +10 -10
- package/Picker/usePickerDocumentEventClose.js +20 -20
- package/Picker/usePickerInputValue.d.ts +12 -12
- package/Picker/usePickerInputValue.js +18 -18
- package/Picker/usePickerValue.d.ts +20 -20
- package/Picker/usePickerValue.js +51 -51
- package/Picker/useRangePickerValue.d.ts +20 -20
- package/Picker/useRangePickerValue.js +88 -88
- package/Picker/useTabKeyClose.d.ts +2 -2
- package/Picker/useTabKeyClose.js +7 -7
- package/Popconfirm/Popconfirm.d.ts +16 -16
- package/Popconfirm/Popconfirm.js +4 -4
- package/Popconfirm/index.d.ts +1 -1
- package/Popover/Popover.d.ts +23 -23
- package/Popover/Popover.js +34 -34
- package/Popover/index.d.ts +1 -1
- package/Popper/Popper.d.ts +32 -32
- package/Popper/Popper.js +21 -21
- package/Popper/index.d.ts +1 -1
- package/Portal/Portal.d.ts +20 -20
- package/Portal/Portal.js +15 -15
- package/Portal/index.d.ts +1 -1
- package/Progress/Progress.d.ts +59 -59
- package/Progress/Progress.js +21 -21
- package/Progress/index.d.ts +2 -2
- package/Provider/ConfigProvider.d.ts +8 -8
- package/Provider/ConfigProvider.js +6 -6
- package/Provider/context.d.ts +6 -6
- package/Provider/context.js +2 -2
- package/Provider/index.d.ts +4 -4
- package/Radio/Radio.d.ts +41 -41
- package/Radio/Radio.js +21 -21
- package/Radio/RadioGroup.d.ts +47 -47
- package/Radio/RadioGroup.js +20 -20
- package/Radio/RadioGroupContext.d.ts +9 -9
- package/Radio/index.d.ts +3 -3
- package/Select/AutoComplete.d.ts +101 -101
- package/Select/AutoComplete.js +101 -101
- package/Select/Option.d.ts +19 -19
- package/Select/Option.js +37 -37
- package/Select/Select.d.ts +94 -94
- package/Select/Select.js +111 -111
- package/Select/SelectControlContext.d.ts +3 -3
- package/Select/SelectTrigger.d.ts +89 -89
- package/Select/SelectTrigger.js +44 -44
- package/Select/SelectTriggerTags.d.ts +19 -19
- package/Select/SelectTriggerTags.js +21 -21
- package/Select/TreeSelect.d.ts +68 -68
- package/Select/TreeSelect.js +183 -183
- package/Select/index.d.ts +9 -9
- package/Select/typings.d.ts +12 -12
- package/Select/useSelectTriggerTags.d.ts +19 -19
- package/Select/useSelectTriggerTags.js +53 -53
- package/Skeleton/Skeleton.d.ts +22 -22
- package/Skeleton/Skeleton.js +7 -7
- package/Skeleton/index.d.ts +1 -1
- package/Slider/Slider.d.ts +51 -51
- package/Slider/Slider.js +174 -174
- package/Slider/index.d.ts +3 -3
- package/Slider/useSlider.d.ts +31 -31
- package/Slider/useSlider.js +99 -99
- package/Stepper/Step.d.ts +41 -41
- package/Stepper/Step.js +9 -9
- package/Stepper/Stepper.d.ts +19 -19
- package/Stepper/Stepper.js +26 -26
- package/Stepper/index.d.ts +2 -2
- package/Switch/Switch.d.ts +43 -43
- package/Switch/Switch.js +18 -18
- package/Switch/index.d.ts +2 -2
- package/Table/Table.d.ts +110 -110
- package/Table/Table.js +146 -146
- package/Table/TableBody.d.ts +10 -10
- package/Table/TableBody.js +13 -13
- package/Table/TableBodyRow.d.ts +12 -12
- package/Table/TableBodyRow.js +45 -45
- package/Table/TableCell.d.ts +20 -20
- package/Table/TableCell.js +15 -15
- package/Table/TableContext.d.ts +52 -52
- package/Table/TableContext.js +2 -2
- package/Table/TableExpandedTable.d.ts +12 -12
- package/Table/TableExpandedTable.js +14 -14
- package/Table/TableHeader.d.ts +4 -4
- package/Table/TableHeader.js +20 -20
- package/Table/draggable/useTableDraggable.d.ts +14 -14
- package/Table/draggable/useTableDraggable.js +54 -54
- package/Table/editable/TableEditRenderWrapper.d.ts +8 -8
- package/Table/editable/TableEditRenderWrapper.js +8 -8
- package/Table/expandable/TableExpandable.d.ts +28 -28
- package/Table/expandable/TableExpandable.js +15 -15
- package/Table/index.d.ts +6 -6
- package/Table/pagination/TablePagination.d.ts +10 -10
- package/Table/pagination/TablePagination.js +15 -15
- package/Table/pagination/useTablePagination.d.ts +8 -8
- package/Table/pagination/useTablePagination.js +21 -21
- package/Table/refresh/TableRefresh.d.ts +10 -10
- package/Table/refresh/TableRefresh.js +13 -13
- package/Table/rowSelection/TableRowSelection.d.ts +19 -19
- package/Table/rowSelection/TableRowSelection.js +70 -70
- package/Table/rowSelection/useTableRowSelection.d.ts +6 -6
- package/Table/rowSelection/useTableRowSelection.js +47 -47
- package/Table/sorting/TableSortingIcon.d.ts +11 -11
- package/Table/sorting/TableSortingIcon.js +18 -18
- package/Table/sorting/useTableSorting.d.ts +12 -12
- package/Table/sorting/useTableSorting.js +103 -103
- package/Table/useTableFetchMore.d.ts +10 -10
- package/Table/useTableFetchMore.js +42 -42
- package/Table/useTableLoading.d.ts +5 -5
- package/Table/useTableLoading.js +13 -13
- package/Table/useTableScroll.d.ts +550 -550
- package/Table/useTableScroll.js +275 -275
- package/Tabs/Tab.d.ts +19 -19
- package/Tabs/Tab.js +9 -9
- package/Tabs/TabPane.d.ts +14 -14
- package/Tabs/TabPane.js +11 -11
- package/Tabs/Tabs.d.ts +39 -39
- package/Tabs/Tabs.js +36 -36
- package/Tabs/index.d.ts +3 -3
- package/Tabs/useTabsOverflow.d.ts +8 -8
- package/Tabs/useTabsOverflow.js +56 -56
- package/Tag/Tag.d.ts +29 -29
- package/Tag/Tag.js +14 -14
- package/Tag/index.d.ts +2 -2
- package/TextField/TextField.d.ts +54 -54
- package/TextField/TextField.js +33 -33
- package/TextField/index.d.ts +2 -2
- package/TextField/useTextFieldControl.d.ts +10 -10
- package/TextField/useTextFieldControl.js +12 -12
- package/Textarea/Textarea.d.ts +58 -58
- package/Textarea/Textarea.js +22 -22
- package/Textarea/index.d.ts +2 -2
- package/TimePanel/TimePanel.d.ts +66 -66
- package/TimePanel/TimePanel.js +54 -54
- package/TimePanel/TimePanelAction.d.ts +18 -18
- package/TimePanel/TimePanelAction.js +7 -7
- package/TimePanel/TimePanelColumn.d.ts +37 -37
- package/TimePanel/TimePanelColumn.js +28 -28
- package/TimePanel/index.d.ts +3 -3
- package/TimePicker/TimePicker.d.ts +24 -24
- package/TimePicker/TimePicker.js +99 -99
- package/TimePicker/TimePickerPanel.d.ts +24 -24
- package/TimePicker/TimePickerPanel.js +7 -7
- package/TimePicker/index.d.ts +2 -2
- package/Tooltip/Tooltip.d.ts +25 -25
- package/Tooltip/Tooltip.js +27 -27
- package/Tooltip/index.d.ts +1 -1
- package/Tooltip/useDelayMouseEnterLeave.d.ts +12 -12
- package/Tooltip/useDelayMouseEnterLeave.js +36 -36
- package/Transition/Collapse.d.ts +15 -15
- package/Transition/Collapse.js +96 -96
- package/Transition/Fade.d.ts +8 -8
- package/Transition/Fade.js +74 -74
- package/Transition/Grow.d.ts +13 -13
- package/Transition/Grow.js +101 -101
- package/Transition/SlideFade.d.ts +15 -15
- package/Transition/SlideFade.js +83 -83
- package/Transition/Transition.d.ts +98 -98
- package/Transition/Transition.js +21 -21
- package/Transition/Zoom.d.ts +8 -8
- package/Transition/Zoom.js +74 -74
- package/Transition/getAutoSizeDuration.d.ts +1 -1
- package/Transition/getAutoSizeDuration.js +7 -7
- package/Transition/getTransitionStyleProps.d.ts +16 -16
- package/Transition/getTransitionStyleProps.js +22 -22
- package/Transition/index.d.ts +6 -6
- package/Transition/reflow.d.ts +4 -4
- package/Transition/reflow.js +6 -6
- package/Transition/useAutoTransitionDuration.d.ts +6 -6
- package/Transition/useAutoTransitionDuration.js +10 -10
- package/Transition/useSetNodeTransition.d.ts +7 -7
- package/Transition/useSetNodeTransition.js +30 -30
- package/Tree/Tree.d.ts +70 -70
- package/Tree/Tree.js +116 -116
- package/Tree/TreeNode.d.ts +41 -41
- package/Tree/TreeNode.js +29 -29
- package/Tree/TreeNodeList.d.ts +25 -25
- package/Tree/TreeNodeList.js +22 -22
- package/Tree/getTreeNodeEntities.d.ts +11 -11
- package/Tree/getTreeNodeEntities.js +84 -84
- package/Tree/index.d.ts +8 -8
- package/Tree/toggleValue.d.ts +4 -4
- package/Tree/toggleValue.js +13 -13
- package/Tree/traverseTree.d.ts +2 -2
- package/Tree/traverseTree.js +8 -8
- package/Tree/typings.d.ts +16 -16
- package/Tree/useTreeExpandedValue.d.ts +15 -15
- package/Tree/useTreeExpandedValue.js +26 -26
- package/Typography/Typography.d.ts +43 -43
- package/Typography/Typography.js +31 -31
- package/Typography/index.d.ts +11 -11
- package/Typography/index.js +4 -1
- package/Upload/UploadButton.d.ts +10 -10
- package/Upload/UploadButton.js +14 -14
- package/Upload/UploadInput.d.ts +21 -21
- package/Upload/UploadInput.js +18 -18
- package/Upload/UploadPicture.d.ts +49 -49
- package/Upload/UploadPicture.js +43 -43
- package/Upload/UploadPictureBlock.d.ts +20 -20
- package/Upload/UploadPictureBlock.js +70 -70
- package/Upload/UploadPictureWall.d.ts +81 -81
- package/Upload/UploadPictureWall.js +144 -144
- package/Upload/UploadPictureWallItem.d.ts +15 -15
- package/Upload/UploadPictureWallItem.js +10 -10
- package/Upload/UploadResult.d.ts +35 -35
- package/Upload/UploadResult.js +19 -19
- package/Upload/index.d.ts +6 -6
- package/_internal/InputCheck/InputCheck.d.ts +33 -33
- package/_internal/InputCheck/InputCheck.js +11 -11
- package/_internal/InputCheck/InputCheckGroup.d.ts +18 -18
- package/_internal/InputCheck/InputCheckGroup.js +7 -7
- package/_internal/InputCheck/index.d.ts +3 -3
- package/_internal/InputTriggerPopper/InputTriggerPopper.d.ts +18 -18
- package/_internal/InputTriggerPopper/InputTriggerPopper.js +35 -35
- package/_internal/InputTriggerPopper/index.d.ts +1 -1
- package/_internal/SlideFadeOverlay/SlideFadeOverlay.d.ts +21 -21
- package/_internal/SlideFadeOverlay/SlideFadeOverlay.js +53 -53
- package/_internal/SlideFadeOverlay/index.d.ts +1 -1
- package/_internal/SlideFadeOverlay/useTopStack.d.ts +1 -1
- package/_internal/SlideFadeOverlay/useTopStack.js +17 -17
- package/hooks/useClickAway.d.ts +5 -5
- package/hooks/useClickAway.js +18 -18
- package/hooks/useComposeRefs.d.ts +2 -2
- package/hooks/useComposeRefs.js +2 -2
- package/hooks/useDocumentEscapeKeyDown.d.ts +3 -3
- package/hooks/useDocumentEscapeKeyDown.js +15 -15
- package/hooks/useDocumentEvents.d.ts +5 -5
- package/hooks/useDocumentEvents.js +16 -16
- package/hooks/useDocumentTabKeyDown.d.ts +3 -3
- package/hooks/useDocumentTabKeyDown.js +14 -14
- package/hooks/useIsomorphicLayoutEffect.d.ts +2 -2
- package/hooks/useIsomorphicLayoutEffect.js +2 -2
- package/hooks/useLastCallback.d.ts +1 -1
- package/hooks/useLastCallback.js +5 -5
- package/hooks/useLastValue.d.ts +3 -3
- package/hooks/useLastValue.js +4 -4
- package/hooks/usePreviousValue.d.ts +1 -1
- package/hooks/usePreviousValue.js +6 -6
- package/hooks/useWindowWidth.d.ts +1 -1
- package/hooks/useWindowWidth.js +10 -10
- package/index.d.ts +102 -102
- package/package.json +6 -20
- package/utils/array-move.d.ts +1 -1
- package/utils/array-move.js +10 -10
- package/utils/composeRefs.d.ts +21 -21
- package/utils/composeRefs.js +29 -29
- package/utils/cx.d.ts +1 -1
- package/utils/general.d.ts +8 -8
- package/utils/getElement.d.ts +3 -3
- package/utils/getElement.js +11 -11
- package/utils/jsx-types.d.ts +11 -11
- package/utils/scroll-lock.d.ts +2 -2
- package/utils/scroll-lock.js +17 -17
package/Table/TableBodyRow.js
CHANGED
|
@@ -13,51 +13,51 @@ import AccordionDetails from '../Accordion/AccordionDetails.js';
|
|
|
13
13
|
import { composeRefs } from '../utils/composeRefs.js';
|
|
14
14
|
import cx from 'clsx';
|
|
15
15
|
|
|
16
|
-
const TableBodyRow = forwardRef(function TableBodyRow(props, ref) {
|
|
17
|
-
const { className, rowData, rowIndex, ...rest } = props;
|
|
18
|
-
const { rowSelection, expanding, isHorizontalScrolling, scroll, draggable, } = useContext(TableContext) || {};
|
|
19
|
-
const { columns, } = useContext(TableDataContext) || {};
|
|
20
|
-
/** Feature rowSelection */
|
|
21
|
-
const [selected, setSelected] = useState(false);
|
|
22
|
-
/** Feature expandable */
|
|
23
|
-
const [expanded, setExpanded] = useState(false);
|
|
24
|
-
const isExpandable = useMemo(() => {
|
|
25
|
-
var _a, _b;
|
|
26
|
-
return ((_b = (_a = expanding === null || expanding === void 0 ? void 0 : expanding.rowExpandable) === null || _a === void 0 ? void 0 : _a.call(expanding, rowData)) !== null && _b !== void 0 ? _b : false);
|
|
27
|
-
}, [expanding, rowData]);
|
|
28
|
-
const renderedExpandedContent = useMemo(() => {
|
|
29
|
-
var _a, _b;
|
|
30
|
-
return ((_b = (_a = expanding === null || expanding === void 0 ? void 0 : expanding.expandedRowRender) === null || _a === void 0 ? void 0 : _a.call(expanding, rowData)) !== null && _b !== void 0 ? _b : null);
|
|
31
|
-
}, [expanding, rowData]);
|
|
32
|
-
/** Feature scrolling */
|
|
33
|
-
const isFirstColumnShouldSticky = useMemo(() => {
|
|
34
|
-
var _a;
|
|
35
|
-
/** 前面有 action 時不可 sticky */
|
|
36
|
-
if (rowSelection || expanding)
|
|
37
|
-
return false;
|
|
38
|
-
return ((_a = scroll === null || scroll === void 0 ? void 0 : scroll.fixedFirstColumn) !== null && _a !== void 0 ? _a : false);
|
|
39
|
-
}, [
|
|
40
|
-
rowSelection,
|
|
41
|
-
expanding,
|
|
42
|
-
scroll === null || scroll === void 0 ? void 0 : scroll.fixedFirstColumn,
|
|
43
|
-
]);
|
|
44
|
-
return (jsxs(Fragment, { children: [jsx(Draggable, { index: rowIndex, draggableId: rowData.key || rowData.id, isDragDisabled: !(draggable === null || draggable === void 0 ? void 0 : draggable.enabled), children: (draggableProvided) => (jsxs("tr", { ...rest, ...draggableProvided.draggableProps, ...draggableProvided.dragHandleProps, ref: composeRefs([ref, draggableProvided.innerRef]), className: cx(tableClasses.bodyRow, {
|
|
45
|
-
[tableClasses.bodyRowHighlight]: selected || expanded,
|
|
46
|
-
[tableClasses.bodyRowDragging]: (draggable === null || draggable === void 0 ? void 0 : draggable.draggingId)
|
|
47
|
-
&& draggable.draggingId === (rowData.key || rowData.id),
|
|
48
|
-
}, className), children: [rowSelection ? (jsx("td", { className: tableClasses.bodyRowCellWrapper, style: {
|
|
49
|
-
flex: 'unset',
|
|
50
|
-
minWidth: 'unset',
|
|
51
|
-
}, children: jsx(TableRowSelection, { rowKey: (rowData.key || rowData.id), setChecked: (status) => setSelected(status), showDropdownIcon: false }) })) : null, expanding ? (jsx("td", { className: tableClasses.bodyRowCellWrapper, style: {
|
|
52
|
-
flex: 'unset',
|
|
53
|
-
minWidth: 'unset',
|
|
54
|
-
}, children: jsx(TableExpandable, { expandable: isExpandable, expanded: expanded, setExpanded: setExpanded, onExpand: (status) => { var _a; return (_a = expanding.onExpand) === null || _a === void 0 ? void 0 : _a.call(expanding, rowData, status); } }) })) : null, (columns !== null && columns !== void 0 ? columns : []).map((column, idx) => {
|
|
55
|
-
var _a, _b, _c, _d;
|
|
56
|
-
const ellipsis = !!(get(rowData, column.dataIndex)) && ((_a = column.ellipsis) !== null && _a !== void 0 ? _a : true);
|
|
57
|
-
const tooltipTitle = ((_c = (_b = column.renderTooltipTitle) === null || _b === void 0 ? void 0 : _b.call(column, rowData)) !== null && _c !== void 0 ? _c : get(rowData, column.dataIndex));
|
|
58
|
-
return (jsx("td", { className: cx(tableClasses.bodyRowCellWrapper, isFirstColumnShouldSticky && idx === 0 && tableClasses.bodyRowCellWrapperFixed, isFirstColumnShouldSticky && idx === 0 && isHorizontalScrolling && tableClasses.bodyRowCellWrapperFixedStuck, column.bodyClassName), style: getColumnStyle(column), children: jsx(TableEditRenderWrapper, { ...column, rowData: rowData, children: jsx(TableCell, { ellipsis: ellipsis, forceShownTooltipWhenHovered: column.forceShownTooltipWhenHovered, style: getCellStyle(column), tooltipTitle: tooltipTitle, children: ((_d = column.render) === null || _d === void 0 ? void 0 : _d.call(column, rowData, rowIndex, column)) || get(rowData, column.dataIndex) }) }) }, `${column.dataIndex}-${column.title}`));
|
|
59
|
-
})] })) }, rowData.key || rowData.id), renderedExpandedContent ? (jsx("tr", { children: jsx("td", { style: { padding: 0 }, children: jsx(AccordionDetails, { className: cx(expanding.className, tableClasses.bodyRowExpandedTableWrapper), expanded: expanded, children: (renderedExpandedContent === null || renderedExpandedContent === void 0 ? void 0 : renderedExpandedContent.dataSource) ? (jsx(TableExpandedTable, { renderedExpandedContent: renderedExpandedContent })) : renderedExpandedContent }) }) })) : null] }));
|
|
60
|
-
});
|
|
16
|
+
const TableBodyRow = forwardRef(function TableBodyRow(props, ref) {
|
|
17
|
+
const { className, rowData, rowIndex, ...rest } = props;
|
|
18
|
+
const { rowSelection, expanding, isHorizontalScrolling, scroll, draggable, } = useContext(TableContext) || {};
|
|
19
|
+
const { columns, } = useContext(TableDataContext) || {};
|
|
20
|
+
/** Feature rowSelection */
|
|
21
|
+
const [selected, setSelected] = useState(false);
|
|
22
|
+
/** Feature expandable */
|
|
23
|
+
const [expanded, setExpanded] = useState(false);
|
|
24
|
+
const isExpandable = useMemo(() => {
|
|
25
|
+
var _a, _b;
|
|
26
|
+
return ((_b = (_a = expanding === null || expanding === void 0 ? void 0 : expanding.rowExpandable) === null || _a === void 0 ? void 0 : _a.call(expanding, rowData)) !== null && _b !== void 0 ? _b : false);
|
|
27
|
+
}, [expanding, rowData]);
|
|
28
|
+
const renderedExpandedContent = useMemo(() => {
|
|
29
|
+
var _a, _b;
|
|
30
|
+
return ((_b = (_a = expanding === null || expanding === void 0 ? void 0 : expanding.expandedRowRender) === null || _a === void 0 ? void 0 : _a.call(expanding, rowData)) !== null && _b !== void 0 ? _b : null);
|
|
31
|
+
}, [expanding, rowData]);
|
|
32
|
+
/** Feature scrolling */
|
|
33
|
+
const isFirstColumnShouldSticky = useMemo(() => {
|
|
34
|
+
var _a;
|
|
35
|
+
/** 前面有 action 時不可 sticky */
|
|
36
|
+
if (rowSelection || expanding)
|
|
37
|
+
return false;
|
|
38
|
+
return ((_a = scroll === null || scroll === void 0 ? void 0 : scroll.fixedFirstColumn) !== null && _a !== void 0 ? _a : false);
|
|
39
|
+
}, [
|
|
40
|
+
rowSelection,
|
|
41
|
+
expanding,
|
|
42
|
+
scroll === null || scroll === void 0 ? void 0 : scroll.fixedFirstColumn,
|
|
43
|
+
]);
|
|
44
|
+
return (jsxs(Fragment, { children: [jsx(Draggable, { index: rowIndex, draggableId: rowData.key || rowData.id, isDragDisabled: !(draggable === null || draggable === void 0 ? void 0 : draggable.enabled), children: (draggableProvided) => (jsxs("tr", { ...rest, ...draggableProvided.draggableProps, ...draggableProvided.dragHandleProps, ref: composeRefs([ref, draggableProvided.innerRef]), className: cx(tableClasses.bodyRow, {
|
|
45
|
+
[tableClasses.bodyRowHighlight]: selected || expanded,
|
|
46
|
+
[tableClasses.bodyRowDragging]: (draggable === null || draggable === void 0 ? void 0 : draggable.draggingId)
|
|
47
|
+
&& draggable.draggingId === (rowData.key || rowData.id),
|
|
48
|
+
}, className), children: [rowSelection ? (jsx("td", { "aria-label": "Selection", className: tableClasses.bodyRowCellWrapper, style: {
|
|
49
|
+
flex: 'unset',
|
|
50
|
+
minWidth: 'unset',
|
|
51
|
+
}, children: jsx(TableRowSelection, { rowKey: (rowData.key || rowData.id), setChecked: (status) => setSelected(status), showDropdownIcon: false }) })) : null, expanding ? (jsx("td", { "aria-label": "Expand", className: tableClasses.bodyRowCellWrapper, style: {
|
|
52
|
+
flex: 'unset',
|
|
53
|
+
minWidth: 'unset',
|
|
54
|
+
}, children: jsx(TableExpandable, { expandable: isExpandable, expanded: expanded, setExpanded: setExpanded, onExpand: (status) => { var _a; return (_a = expanding.onExpand) === null || _a === void 0 ? void 0 : _a.call(expanding, rowData, status); } }) })) : null, (columns !== null && columns !== void 0 ? columns : []).map((column, idx) => {
|
|
55
|
+
var _a, _b, _c, _d;
|
|
56
|
+
const ellipsis = !!(get(rowData, column.dataIndex)) && ((_a = column.ellipsis) !== null && _a !== void 0 ? _a : true);
|
|
57
|
+
const tooltipTitle = ((_c = (_b = column.renderTooltipTitle) === null || _b === void 0 ? void 0 : _b.call(column, rowData)) !== null && _c !== void 0 ? _c : get(rowData, column.dataIndex));
|
|
58
|
+
return (jsx("td", { className: cx(tableClasses.bodyRowCellWrapper, isFirstColumnShouldSticky && idx === 0 && tableClasses.bodyRowCellWrapperFixed, isFirstColumnShouldSticky && idx === 0 && isHorizontalScrolling && tableClasses.bodyRowCellWrapperFixedStuck, column.bodyClassName), style: getColumnStyle(column), children: jsx(TableEditRenderWrapper, { ...column, rowData: rowData, children: jsx(TableCell, { ellipsis: ellipsis, forceShownTooltipWhenHovered: column.forceShownTooltipWhenHovered, style: getCellStyle(column), tooltipTitle: tooltipTitle, children: ((_d = column.render) === null || _d === void 0 ? void 0 : _d.call(column, rowData, rowIndex, column)) || get(rowData, column.dataIndex) }) }) }, `${column.dataIndex}-${column.title}-${(rowData.key || rowData.id)}`));
|
|
59
|
+
})] })) }, rowData.key || rowData.id), renderedExpandedContent ? (jsx("tr", { children: jsx("td", { style: { padding: 0 }, children: jsx(AccordionDetails, { className: cx(expanding.className, tableClasses.bodyRowExpandedTableWrapper), expanded: expanded, children: (renderedExpandedContent === null || renderedExpandedContent === void 0 ? void 0 : renderedExpandedContent.dataSource) ? (jsx(TableExpandedTable, { renderedExpandedContent: renderedExpandedContent })) : renderedExpandedContent }) }) })) : null] }));
|
|
60
|
+
});
|
|
61
61
|
var TableBodyRow$1 = TableBodyRow;
|
|
62
62
|
|
|
63
63
|
export { TableBodyRow$1 as default };
|
package/Table/TableCell.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
|
|
3
|
-
export interface TableCellProps extends NativeElementPropsWithoutKeyAndRef<'div'> {
|
|
4
|
-
/**
|
|
5
|
-
* whether cell content should be ellipsis
|
|
6
|
-
* @default true
|
|
7
|
-
*/
|
|
8
|
-
ellipsis?: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* whether tooltip is force to shown when hovered
|
|
11
|
-
* @default false
|
|
12
|
-
*/
|
|
13
|
-
forceShownTooltipWhenHovered?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* tooltip title that you want to display
|
|
16
|
-
*/
|
|
17
|
-
tooltipTitle?: string | number;
|
|
18
|
-
}
|
|
19
|
-
declare const TableCell: import("react").ForwardRefExoticComponent<TableCellProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
20
|
-
export default TableCell;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
|
|
3
|
+
export interface TableCellProps extends NativeElementPropsWithoutKeyAndRef<'div'> {
|
|
4
|
+
/**
|
|
5
|
+
* whether cell content should be ellipsis
|
|
6
|
+
* @default true
|
|
7
|
+
*/
|
|
8
|
+
ellipsis?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* whether tooltip is force to shown when hovered
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
forceShownTooltipWhenHovered?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* tooltip title that you want to display
|
|
16
|
+
*/
|
|
17
|
+
tooltipTitle?: string | number;
|
|
18
|
+
}
|
|
19
|
+
declare const TableCell: import("react").ForwardRefExoticComponent<TableCellProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
20
|
+
export default TableCell;
|
package/Table/TableCell.js
CHANGED
|
@@ -4,21 +4,21 @@ import { tableClasses } from '@mezzanine-ui/core/table';
|
|
|
4
4
|
import Tooltip from '../Tooltip/Tooltip.js';
|
|
5
5
|
import cx from 'clsx';
|
|
6
6
|
|
|
7
|
-
const TableCell = forwardRef(function TableCell(props, ref) {
|
|
8
|
-
const { children, className, ellipsis = true, forceShownTooltipWhenHovered = false, tooltipTitle, ...rest } = props;
|
|
9
|
-
const ellipsisRef = useRef(null);
|
|
10
|
-
return (jsx("div", { ref: ref, ...rest, className: cx(tableClasses.cell, className), children: ellipsis || forceShownTooltipWhenHovered ? (jsx(Tooltip, { title: `${tooltipTitle}`, options: {
|
|
11
|
-
placement: 'top-start',
|
|
12
|
-
}, children: ({ onMouseEnter, onMouseLeave }) => (jsx("div", { ref: ellipsisRef, className: ellipsis ? tableClasses.cellEllipsis : '', onMouseEnter: (e) => {
|
|
13
|
-
if (ellipsisRef.current) {
|
|
14
|
-
const { current: el } = ellipsisRef;
|
|
15
|
-
const isOverflow = forceShownTooltipWhenHovered || (el.scrollWidth > el.offsetWidth);
|
|
16
|
-
/** display tooltip only when content is overflow */
|
|
17
|
-
if (isOverflow)
|
|
18
|
-
onMouseEnter(e);
|
|
19
|
-
}
|
|
20
|
-
}, onMouseLeave: onMouseLeave, children: children })) })) : children }));
|
|
21
|
-
});
|
|
7
|
+
const TableCell = forwardRef(function TableCell(props, ref) {
|
|
8
|
+
const { children, className, ellipsis = true, forceShownTooltipWhenHovered = false, tooltipTitle, ...rest } = props;
|
|
9
|
+
const ellipsisRef = useRef(null);
|
|
10
|
+
return (jsx("div", { ref: ref, ...rest, className: cx(tableClasses.cell, className), children: ellipsis || forceShownTooltipWhenHovered ? (jsx(Tooltip, { title: `${tooltipTitle}`, options: {
|
|
11
|
+
placement: 'top-start',
|
|
12
|
+
}, children: ({ onMouseEnter, onMouseLeave }) => (jsx("div", { ref: ellipsisRef, className: ellipsis ? tableClasses.cellEllipsis : '', onMouseEnter: (e) => {
|
|
13
|
+
if (ellipsisRef.current) {
|
|
14
|
+
const { current: el } = ellipsisRef;
|
|
15
|
+
const isOverflow = forceShownTooltipWhenHovered || (el.scrollWidth > el.offsetWidth);
|
|
16
|
+
/** display tooltip only when content is overflow */
|
|
17
|
+
if (isOverflow)
|
|
18
|
+
onMouseEnter(e);
|
|
19
|
+
}
|
|
20
|
+
}, onMouseLeave: onMouseLeave, children: children })) })) : children }));
|
|
21
|
+
});
|
|
22
22
|
var TableCell$1 = TableCell;
|
|
23
23
|
|
|
24
24
|
export { TableCell$1 as default };
|
package/Table/TableContext.d.ts
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { TableRowSelection, TableColumn, TableExpandable, TablePagination, TableDataSource, TableRecord, ExpandRowBySources, TableScrolling, TableDraggable } from '@mezzanine-ui/core/table';
|
|
3
|
-
import { EmptyProps } from '../Empty';
|
|
4
|
-
/** typeof rowSelection */
|
|
5
|
-
export interface RowSelectionContext extends Pick<TableRowSelection, 'actions'> {
|
|
6
|
-
selectedRowKeys: string[];
|
|
7
|
-
onChange(v: string): void;
|
|
8
|
-
}
|
|
9
|
-
/** typeof sorting */
|
|
10
|
-
export interface SortingContext {
|
|
11
|
-
onSort(v: Pick<TableColumn<TableRecord<unknown>>, 'dataIndex' | 'sorter' | 'onSorted'>): void;
|
|
12
|
-
onResetAll(): void;
|
|
13
|
-
sortedOn: string;
|
|
14
|
-
sortedType: string;
|
|
15
|
-
}
|
|
16
|
-
/** typeof loading */
|
|
17
|
-
export interface LoadingContext {
|
|
18
|
-
setLoading(l: boolean): void;
|
|
19
|
-
}
|
|
20
|
-
/** typeof fetchMore */
|
|
21
|
-
export interface FetchMoreContext {
|
|
22
|
-
onFetchMore(): void;
|
|
23
|
-
isFetching: boolean;
|
|
24
|
-
isReachEnd: boolean;
|
|
25
|
-
}
|
|
26
|
-
export interface TableContextProps {
|
|
27
|
-
isHorizontalScrolling?: boolean;
|
|
28
|
-
emptyProps?: EmptyProps;
|
|
29
|
-
rowSelection?: RowSelectionContext;
|
|
30
|
-
sorting?: SortingContext;
|
|
31
|
-
loading?: boolean;
|
|
32
|
-
setLoading?(l: boolean): void;
|
|
33
|
-
expanding?: Omit<TableExpandable<TableRecord<unknown>>, 'expandedRowRender'> & {
|
|
34
|
-
expandedRowRender(record: TableRecord<unknown>): ReactNode | ExpandRowBySources;
|
|
35
|
-
};
|
|
36
|
-
fetchMore?: FetchMoreContext;
|
|
37
|
-
pagination?: TablePagination;
|
|
38
|
-
scroll?: TableScrolling;
|
|
39
|
-
draggable?: TableDraggable & {
|
|
40
|
-
draggingId: string;
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
export declare const TableContext: import("react").Context<TableContextProps | null>;
|
|
44
|
-
export interface TableDataContextProps {
|
|
45
|
-
columns: TableColumn<TableRecord<unknown>>[];
|
|
46
|
-
dataSource: TableDataSource[];
|
|
47
|
-
}
|
|
48
|
-
export declare const TableDataContext: import("react").Context<TableDataContextProps | null>;
|
|
49
|
-
export interface TableComponentContextProps {
|
|
50
|
-
bodyCell?: any;
|
|
51
|
-
}
|
|
52
|
-
export declare const TableComponentContext: import("react").Context<TableComponentContextProps | null>;
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TableRowSelection, TableColumn, TableExpandable, TablePagination, TableDataSource, TableRecord, ExpandRowBySources, TableScrolling, TableDraggable } from '@mezzanine-ui/core/table';
|
|
3
|
+
import { EmptyProps } from '../Empty';
|
|
4
|
+
/** typeof rowSelection */
|
|
5
|
+
export interface RowSelectionContext extends Pick<TableRowSelection, 'actions'> {
|
|
6
|
+
selectedRowKeys: string[];
|
|
7
|
+
onChange(v: string): void;
|
|
8
|
+
}
|
|
9
|
+
/** typeof sorting */
|
|
10
|
+
export interface SortingContext {
|
|
11
|
+
onSort(v: Pick<TableColumn<TableRecord<unknown>>, 'dataIndex' | 'sorter' | 'onSorted'>): void;
|
|
12
|
+
onResetAll(): void;
|
|
13
|
+
sortedOn: string;
|
|
14
|
+
sortedType: string;
|
|
15
|
+
}
|
|
16
|
+
/** typeof loading */
|
|
17
|
+
export interface LoadingContext {
|
|
18
|
+
setLoading(l: boolean): void;
|
|
19
|
+
}
|
|
20
|
+
/** typeof fetchMore */
|
|
21
|
+
export interface FetchMoreContext {
|
|
22
|
+
onFetchMore(): void;
|
|
23
|
+
isFetching: boolean;
|
|
24
|
+
isReachEnd: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface TableContextProps {
|
|
27
|
+
isHorizontalScrolling?: boolean;
|
|
28
|
+
emptyProps?: EmptyProps;
|
|
29
|
+
rowSelection?: RowSelectionContext;
|
|
30
|
+
sorting?: SortingContext;
|
|
31
|
+
loading?: boolean;
|
|
32
|
+
setLoading?(l: boolean): void;
|
|
33
|
+
expanding?: Omit<TableExpandable<TableRecord<unknown>>, 'expandedRowRender'> & {
|
|
34
|
+
expandedRowRender(record: TableRecord<unknown>): ReactNode | ExpandRowBySources;
|
|
35
|
+
};
|
|
36
|
+
fetchMore?: FetchMoreContext;
|
|
37
|
+
pagination?: TablePagination;
|
|
38
|
+
scroll?: TableScrolling;
|
|
39
|
+
draggable?: TableDraggable & {
|
|
40
|
+
draggingId: string;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export declare const TableContext: import("react").Context<TableContextProps | null>;
|
|
44
|
+
export interface TableDataContextProps {
|
|
45
|
+
columns: TableColumn<TableRecord<unknown>>[];
|
|
46
|
+
dataSource: TableDataSource[];
|
|
47
|
+
}
|
|
48
|
+
export declare const TableDataContext: import("react").Context<TableDataContextProps | null>;
|
|
49
|
+
export interface TableComponentContextProps {
|
|
50
|
+
bodyCell?: any;
|
|
51
|
+
}
|
|
52
|
+
export declare const TableComponentContext: import("react").Context<TableComponentContextProps | null>;
|
package/Table/TableContext.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createContext } from 'react';
|
|
2
2
|
|
|
3
|
-
const TableContext = createContext(null);
|
|
4
|
-
const TableDataContext = createContext(null);
|
|
3
|
+
const TableContext = createContext(null);
|
|
4
|
+
const TableDataContext = createContext(null);
|
|
5
5
|
const TableComponentContext = createContext(null);
|
|
6
6
|
|
|
7
7
|
export { TableComponentContext, TableContext, TableDataContext };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { TableDataSource, ExpandedTableColumn } from '@mezzanine-ui/core/table';
|
|
3
|
-
import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
|
|
4
|
-
export interface TableExpandedTableProps extends NativeElementPropsWithoutKeyAndRef<'div'> {
|
|
5
|
-
renderedExpandedContent: {
|
|
6
|
-
dataSource: TableDataSource[];
|
|
7
|
-
columns?: ExpandedTableColumn[];
|
|
8
|
-
className?: string;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
declare const TableExpandedTable: import("react").ForwardRefExoticComponent<TableExpandedTableProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
|
-
export default TableExpandedTable;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TableDataSource, ExpandedTableColumn } from '@mezzanine-ui/core/table';
|
|
3
|
+
import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
|
|
4
|
+
export interface TableExpandedTableProps extends NativeElementPropsWithoutKeyAndRef<'div'> {
|
|
5
|
+
renderedExpandedContent: {
|
|
6
|
+
dataSource: TableDataSource[];
|
|
7
|
+
columns?: ExpandedTableColumn[];
|
|
8
|
+
className?: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
declare const TableExpandedTable: import("react").ForwardRefExoticComponent<TableExpandedTableProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export default TableExpandedTable;
|
|
@@ -7,20 +7,20 @@ import TableCell from './TableCell.js';
|
|
|
7
7
|
import TableExpandable from './expandable/TableExpandable.js';
|
|
8
8
|
import cx from 'clsx';
|
|
9
9
|
|
|
10
|
-
const TableExpandedTable = forwardRef(function TableExpandedTable(props, ref) {
|
|
11
|
-
const { renderedExpandedContent, } = props;
|
|
12
|
-
const { columns, } = useContext(TableDataContext) || {};
|
|
13
|
-
return (jsx("div", { className: tableClasses.bodyRowExpandedTable, children: renderedExpandedContent.dataSource.map((source, sourceIndex) => {
|
|
14
|
-
var _a;
|
|
15
|
-
return (jsxs("div", { ref: ref, className: cx(tableClasses.bodyRow, tableClasses.bodyRowExpandedTableRow, renderedExpandedContent.className), role: "row", children: [jsx(TableExpandable, { showIcon: false }), ((_a = (renderedExpandedContent.columns || columns)) !== null && _a !== void 0 ? _a : [])
|
|
16
|
-
.map((column, index) => {
|
|
17
|
-
var _a, _b, _c, _d;
|
|
18
|
-
const ellipsis = !!(get(source, column.dataIndex)) && ((_a = column.ellipsis) !== null && _a !== void 0 ? _a : true);
|
|
19
|
-
const tooltipTitle = ((_c = (_b = column.renderTooltipTitle) === null || _b === void 0 ? void 0 : _b.call(column, source)) !== null && _c !== void 0 ? _c : get(source, column.dataIndex));
|
|
20
|
-
return (jsx("div", { className: cx(tableClasses.bodyRowCellWrapper, column.bodyClassName), style: getColumnStyle((columns !== null && columns !== void 0 ? columns : [])[index]), children: jsx(TableCell, { ellipsis: ellipsis, forceShownTooltipWhenHovered: column.forceShownTooltipWhenHovered, style: getCellStyle((columns !== null && columns !== void 0 ? columns : [])[index]), tooltipTitle: tooltipTitle || '', children: ((_d = column.render) === null || _d === void 0 ? void 0 : _d.call(column, source, sourceIndex, column)) || get(source, column.dataIndex) }) }, `${column.dataIndex}-${index}`));
|
|
21
|
-
})] }, (source.key || source.id)));
|
|
22
|
-
}) }));
|
|
23
|
-
});
|
|
10
|
+
const TableExpandedTable = forwardRef(function TableExpandedTable(props, ref) {
|
|
11
|
+
const { renderedExpandedContent, } = props;
|
|
12
|
+
const { columns, } = useContext(TableDataContext) || {};
|
|
13
|
+
return (jsx("div", { className: tableClasses.bodyRowExpandedTable, children: renderedExpandedContent.dataSource.map((source, sourceIndex) => {
|
|
14
|
+
var _a;
|
|
15
|
+
return (jsxs("div", { ref: ref, className: cx(tableClasses.bodyRow, tableClasses.bodyRowExpandedTableRow, renderedExpandedContent.className), role: "row", children: [jsx(TableExpandable, { showIcon: false }), ((_a = (renderedExpandedContent.columns || columns)) !== null && _a !== void 0 ? _a : [])
|
|
16
|
+
.map((column, index) => {
|
|
17
|
+
var _a, _b, _c, _d;
|
|
18
|
+
const ellipsis = !!(get(source, column.dataIndex)) && ((_a = column.ellipsis) !== null && _a !== void 0 ? _a : true);
|
|
19
|
+
const tooltipTitle = ((_c = (_b = column.renderTooltipTitle) === null || _b === void 0 ? void 0 : _b.call(column, source)) !== null && _c !== void 0 ? _c : get(source, column.dataIndex));
|
|
20
|
+
return (jsx("div", { className: cx(tableClasses.bodyRowCellWrapper, column.bodyClassName), style: getColumnStyle((columns !== null && columns !== void 0 ? columns : [])[index]), children: jsx(TableCell, { ellipsis: ellipsis, forceShownTooltipWhenHovered: column.forceShownTooltipWhenHovered, style: getCellStyle((columns !== null && columns !== void 0 ? columns : [])[index]), tooltipTitle: tooltipTitle || '', children: ((_d = column.render) === null || _d === void 0 ? void 0 : _d.call(column, source, sourceIndex, column)) || get(source, column.dataIndex) }) }, `${column.dataIndex}-${index}`));
|
|
21
|
+
})] }, (source.key || source.id)));
|
|
22
|
+
}) }));
|
|
23
|
+
});
|
|
24
24
|
var TableExpandedTable$1 = TableExpandedTable;
|
|
25
25
|
|
|
26
26
|
export { TableExpandedTable$1 as default };
|
package/Table/TableHeader.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
|
|
3
|
-
declare const TableHeader: import("react").ForwardRefExoticComponent<NativeElementPropsWithoutKeyAndRef<"div"> & import("react").RefAttributes<HTMLTableRowElement>>;
|
|
4
|
-
export default TableHeader;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
|
|
3
|
+
declare const TableHeader: import("react").ForwardRefExoticComponent<NativeElementPropsWithoutKeyAndRef<"div"> & import("react").RefAttributes<HTMLTableRowElement>>;
|
|
4
|
+
export default TableHeader;
|
package/Table/TableHeader.js
CHANGED
|
@@ -9,26 +9,26 @@ import TableSortingIcon from './sorting/TableSortingIcon.js';
|
|
|
9
9
|
import TableExpandable from './expandable/TableExpandable.js';
|
|
10
10
|
import cx from 'clsx';
|
|
11
11
|
|
|
12
|
-
const TableHeader = forwardRef(function TableHeader(props, ref) {
|
|
13
|
-
const { className, ...rest } = props;
|
|
14
|
-
const { rowSelection, isHorizontalScrolling, scroll, expanding, } = useContext(TableContext) || {};
|
|
15
|
-
const { columns, } = useContext(TableDataContext) || {};
|
|
16
|
-
const isFirstColumnShouldSticky = useMemo(() => {
|
|
17
|
-
var _a;
|
|
18
|
-
/** 前面有 action 時不可 sticky */
|
|
19
|
-
if (rowSelection || expanding)
|
|
20
|
-
return false;
|
|
21
|
-
return ((_a = scroll === null || scroll === void 0 ? void 0 : scroll.fixedFirstColumn) !== null && _a !== void 0 ? _a : false);
|
|
22
|
-
}, [
|
|
23
|
-
rowSelection,
|
|
24
|
-
expanding,
|
|
25
|
-
scroll === null || scroll === void 0 ? void 0 : scroll.fixedFirstColumn,
|
|
26
|
-
]);
|
|
27
|
-
return (jsx("thead", { className: tableClasses.headerFixed, children: jsxs("tr", { ref: ref, ...rest, className: cx(tableClasses.header, className), children: [rowSelection ? (jsx("th", { style: { display: 'flex' }, children: jsx(TableRowSelection, { rowKey: SELECTED_ALL_KEY, showDropdownIcon: true }) })) : null, expanding && !rowSelection ? (jsx("th", { style: { display: 'flex' }, children: jsx(TableExpandable, { showIcon: false }) })) : null, (columns !== null && columns !== void 0 ? columns : []).map((column, idx) => {
|
|
28
|
-
var _a;
|
|
29
|
-
return (jsx("th", { className: cx(tableClasses.headerCellWrapper, isFirstColumnShouldSticky && idx === 0 && tableClasses.headerCellWrapperFixed, isFirstColumnShouldSticky && idx === 0 && isHorizontalScrolling && tableClasses.headerCellWrapperFixedStuck, column.headerClassName), style: getColumnStyle(column), children: jsxs(TableCell, { ellipsis: false, style: getCellStyle(column), children: [((_a = column.renderTitle) === null || _a === void 0 ? void 0 : _a.call(column, tableClasses)) || column.title, typeof column.sorter === 'function' || typeof column.onSorted === 'function' ? (jsx(TableSortingIcon, { column: column })) : null] }) }, `${column.dataIndex}-${column.title}`));
|
|
30
|
-
})] }) }));
|
|
31
|
-
});
|
|
12
|
+
const TableHeader = forwardRef(function TableHeader(props, ref) {
|
|
13
|
+
const { className, ...rest } = props;
|
|
14
|
+
const { rowSelection, isHorizontalScrolling, scroll, expanding, } = useContext(TableContext) || {};
|
|
15
|
+
const { columns, } = useContext(TableDataContext) || {};
|
|
16
|
+
const isFirstColumnShouldSticky = useMemo(() => {
|
|
17
|
+
var _a;
|
|
18
|
+
/** 前面有 action 時不可 sticky */
|
|
19
|
+
if (rowSelection || expanding)
|
|
20
|
+
return false;
|
|
21
|
+
return ((_a = scroll === null || scroll === void 0 ? void 0 : scroll.fixedFirstColumn) !== null && _a !== void 0 ? _a : false);
|
|
22
|
+
}, [
|
|
23
|
+
rowSelection,
|
|
24
|
+
expanding,
|
|
25
|
+
scroll === null || scroll === void 0 ? void 0 : scroll.fixedFirstColumn,
|
|
26
|
+
]);
|
|
27
|
+
return (jsx("thead", { className: tableClasses.headerFixed, children: jsxs("tr", { ref: ref, ...rest, className: cx(tableClasses.header, className), children: [rowSelection ? (jsx("th", { "aria-label": "Row Selection", style: { display: 'flex' }, children: jsx(TableRowSelection, { rowKey: SELECTED_ALL_KEY, showDropdownIcon: true }) })) : null, expanding && !rowSelection ? (jsx("th", { "aria-label": "Row Expansion", style: { display: 'flex' }, children: jsx(TableExpandable, { showIcon: false }) })) : null, (columns !== null && columns !== void 0 ? columns : []).map((column, idx) => {
|
|
28
|
+
var _a;
|
|
29
|
+
return (jsx("th", { className: cx(tableClasses.headerCellWrapper, isFirstColumnShouldSticky && idx === 0 && tableClasses.headerCellWrapperFixed, isFirstColumnShouldSticky && idx === 0 && isHorizontalScrolling && tableClasses.headerCellWrapperFixedStuck, column.headerClassName), style: getColumnStyle(column), children: jsxs(TableCell, { ellipsis: false, style: getCellStyle(column), children: [((_a = column.renderTitle) === null || _a === void 0 ? void 0 : _a.call(column, tableClasses)) || column.title, typeof column.sorter === 'function' || typeof column.onSorted === 'function' ? (jsx(TableSortingIcon, { column: column })) : null] }) }, `${column.dataIndex}-${column.title}`));
|
|
30
|
+
})] }) }));
|
|
31
|
+
});
|
|
32
32
|
var TableHeader$1 = TableHeader;
|
|
33
33
|
|
|
34
34
|
export { TableHeader$1 as default };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
import { TableDataSource, TableDraggable } from '@mezzanine-ui/core/table';
|
|
3
|
-
export interface UseTableDraggable {
|
|
4
|
-
dataSource: TableDataSource[];
|
|
5
|
-
setDataSource: Dispatch<SetStateAction<TableDataSource[]>>;
|
|
6
|
-
draggable?: TableDraggable;
|
|
7
|
-
}
|
|
8
|
-
export declare function useTableDraggable(props: UseTableDraggable): {
|
|
9
|
-
draggingId: string;
|
|
10
|
-
onBeforeDragStart: (e: {
|
|
11
|
-
draggableId: SetStateAction<string>;
|
|
12
|
-
}) => void;
|
|
13
|
-
onDragEnd: import("react-beautiful-dnd").OnDragEndResponder;
|
|
14
|
-
};
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { TableDataSource, TableDraggable } from '@mezzanine-ui/core/table';
|
|
3
|
+
export interface UseTableDraggable {
|
|
4
|
+
dataSource: TableDataSource[];
|
|
5
|
+
setDataSource: Dispatch<SetStateAction<TableDataSource[]>>;
|
|
6
|
+
draggable?: TableDraggable;
|
|
7
|
+
}
|
|
8
|
+
export declare function useTableDraggable(props: UseTableDraggable): {
|
|
9
|
+
draggingId: string;
|
|
10
|
+
onBeforeDragStart: (e: {
|
|
11
|
+
draggableId: SetStateAction<string>;
|
|
12
|
+
}) => void;
|
|
13
|
+
onDragEnd: import("react-beautiful-dnd").OnDragEndResponder;
|
|
14
|
+
};
|
|
@@ -4,60 +4,60 @@ import debounce from 'lodash/debounce';
|
|
|
4
4
|
import { arrayMove } from '../../utils/array-move.js';
|
|
5
5
|
import { usePreviousValue } from '../../hooks/usePreviousValue.js';
|
|
6
6
|
|
|
7
|
-
function useTableDraggable(props) {
|
|
8
|
-
const { dataSource, setDataSource, draggable } = props;
|
|
9
|
-
const resultSnapshot = useRef(null);
|
|
10
|
-
const dataSnapShot = useRef(dataSource);
|
|
11
|
-
const isDragging = useRef(false);
|
|
12
|
-
const [draggingId, setDraggingId] = useState('');
|
|
13
|
-
const prevDataSource = usePreviousValue(dataSource);
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
if (!isEqual(prevDataSource, dataSource)) {
|
|
16
|
-
dataSnapShot.current = dataSource;
|
|
17
|
-
}
|
|
18
|
-
}, [prevDataSource, dataSource]);
|
|
19
|
-
const onBeforeDragStart = useCallback((e) => {
|
|
20
|
-
isDragging.current = true;
|
|
21
|
-
setDraggingId(e.draggableId);
|
|
22
|
-
}, []);
|
|
23
|
-
const onDragEnd = useCallback(async (result, id) => {
|
|
24
|
-
var _a, _b;
|
|
25
|
-
resultSnapshot.current = [result, id];
|
|
26
|
-
isDragging.current = false;
|
|
27
|
-
setDraggingId('');
|
|
28
|
-
const temp = [...dataSnapShot.current];
|
|
29
|
-
const from = result.source.index;
|
|
30
|
-
const to = (_b = (_a = result.destination) === null || _a === void 0 ? void 0 : _a.index) !== null && _b !== void 0 ? _b : from;
|
|
31
|
-
const newData = arrayMove(temp, from, to);
|
|
32
|
-
dataSnapShot.current = newData;
|
|
33
|
-
setDataSource(newData);
|
|
34
|
-
}, [setDataSource]);
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
if (!(draggable === null || draggable === void 0 ? void 0 : draggable.enabled))
|
|
37
|
-
return () => { };
|
|
38
|
-
async function onMouseUp() {
|
|
39
|
-
var _a, _b, _c;
|
|
40
|
-
if (isDragging.current)
|
|
41
|
-
return;
|
|
42
|
-
const args = resultSnapshot.current;
|
|
43
|
-
resultSnapshot.current = null;
|
|
44
|
-
if (!(args === null || args === void 0 ? void 0 : args[0]) || ((_a = args === null || args === void 0 ? void 0 : args[0]) === null || _a === void 0 ? void 0 : _a.source.index) === ((_c = (_b = args === null || args === void 0 ? void 0 : args[0]) === null || _b === void 0 ? void 0 : _b.destination) === null || _c === void 0 ? void 0 : _c.index))
|
|
45
|
-
return;
|
|
46
|
-
if ((draggable === null || draggable === void 0 ? void 0 : draggable.onDragEnd) && args) {
|
|
47
|
-
draggable.onDragEnd(Array.from(dataSnapShot.current));
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
const debouncedOnMouseUp = debounce(onMouseUp, 500);
|
|
51
|
-
window.addEventListener('mouseup', debouncedOnMouseUp, false);
|
|
52
|
-
return () => {
|
|
53
|
-
window.removeEventListener('mouseup', debouncedOnMouseUp, false);
|
|
54
|
-
};
|
|
55
|
-
}, [draggable]);
|
|
56
|
-
return {
|
|
57
|
-
draggingId,
|
|
58
|
-
onBeforeDragStart,
|
|
59
|
-
onDragEnd,
|
|
60
|
-
};
|
|
7
|
+
function useTableDraggable(props) {
|
|
8
|
+
const { dataSource, setDataSource, draggable } = props;
|
|
9
|
+
const resultSnapshot = useRef(null);
|
|
10
|
+
const dataSnapShot = useRef(dataSource);
|
|
11
|
+
const isDragging = useRef(false);
|
|
12
|
+
const [draggingId, setDraggingId] = useState('');
|
|
13
|
+
const prevDataSource = usePreviousValue(dataSource);
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (!isEqual(prevDataSource, dataSource)) {
|
|
16
|
+
dataSnapShot.current = dataSource;
|
|
17
|
+
}
|
|
18
|
+
}, [prevDataSource, dataSource]);
|
|
19
|
+
const onBeforeDragStart = useCallback((e) => {
|
|
20
|
+
isDragging.current = true;
|
|
21
|
+
setDraggingId(e.draggableId);
|
|
22
|
+
}, []);
|
|
23
|
+
const onDragEnd = useCallback(async (result, id) => {
|
|
24
|
+
var _a, _b;
|
|
25
|
+
resultSnapshot.current = [result, id];
|
|
26
|
+
isDragging.current = false;
|
|
27
|
+
setDraggingId('');
|
|
28
|
+
const temp = [...dataSnapShot.current];
|
|
29
|
+
const from = result.source.index;
|
|
30
|
+
const to = (_b = (_a = result.destination) === null || _a === void 0 ? void 0 : _a.index) !== null && _b !== void 0 ? _b : from;
|
|
31
|
+
const newData = arrayMove(temp, from, to);
|
|
32
|
+
dataSnapShot.current = newData;
|
|
33
|
+
setDataSource(newData);
|
|
34
|
+
}, [setDataSource]);
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (!(draggable === null || draggable === void 0 ? void 0 : draggable.enabled))
|
|
37
|
+
return () => { };
|
|
38
|
+
async function onMouseUp() {
|
|
39
|
+
var _a, _b, _c;
|
|
40
|
+
if (isDragging.current)
|
|
41
|
+
return;
|
|
42
|
+
const args = resultSnapshot.current;
|
|
43
|
+
resultSnapshot.current = null;
|
|
44
|
+
if (!(args === null || args === void 0 ? void 0 : args[0]) || ((_a = args === null || args === void 0 ? void 0 : args[0]) === null || _a === void 0 ? void 0 : _a.source.index) === ((_c = (_b = args === null || args === void 0 ? void 0 : args[0]) === null || _b === void 0 ? void 0 : _b.destination) === null || _c === void 0 ? void 0 : _c.index))
|
|
45
|
+
return;
|
|
46
|
+
if ((draggable === null || draggable === void 0 ? void 0 : draggable.onDragEnd) && args) {
|
|
47
|
+
draggable.onDragEnd(Array.from(dataSnapShot.current));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const debouncedOnMouseUp = debounce(onMouseUp, 500);
|
|
51
|
+
window.addEventListener('mouseup', debouncedOnMouseUp, false);
|
|
52
|
+
return () => {
|
|
53
|
+
window.removeEventListener('mouseup', debouncedOnMouseUp, false);
|
|
54
|
+
};
|
|
55
|
+
}, [draggable]);
|
|
56
|
+
return {
|
|
57
|
+
draggingId,
|
|
58
|
+
onBeforeDragStart,
|
|
59
|
+
onDragEnd,
|
|
60
|
+
};
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
export { useTableDraggable };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { TableColumn, TableDataSource, TableRecord } from '@mezzanine-ui/core/table';
|
|
3
|
-
import { NativeElementPropsWithoutKeyAndRef } from '../../utils/jsx-types';
|
|
4
|
-
export interface EditableBodyCellProps extends NativeElementPropsWithoutKeyAndRef<'div'>, TableColumn<TableRecord<unknown>> {
|
|
5
|
-
rowData: TableDataSource;
|
|
6
|
-
}
|
|
7
|
-
declare function TableEditRenderWrapper({ children, dataIndex, editable, rowData, setCellProps, ...rest }: EditableBodyCellProps): JSX.Element;
|
|
8
|
-
export default TableEditRenderWrapper;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TableColumn, TableDataSource, TableRecord } from '@mezzanine-ui/core/table';
|
|
3
|
+
import { NativeElementPropsWithoutKeyAndRef } from '../../utils/jsx-types';
|
|
4
|
+
export interface EditableBodyCellProps extends NativeElementPropsWithoutKeyAndRef<'div'>, TableColumn<TableRecord<unknown>> {
|
|
5
|
+
rowData: TableDataSource;
|
|
6
|
+
}
|
|
7
|
+
declare function TableEditRenderWrapper({ children, dataIndex, editable, rowData, setCellProps, ...rest }: EditableBodyCellProps): JSX.Element;
|
|
8
|
+
export default TableEditRenderWrapper;
|
|
@@ -2,14 +2,14 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { useContext, Fragment } from 'react';
|
|
3
3
|
import { TableComponentContext } from '../TableContext.js';
|
|
4
4
|
|
|
5
|
-
function TableEditRenderWrapper({ children, dataIndex, editable, rowData, setCellProps, ...rest }) {
|
|
6
|
-
var _a;
|
|
7
|
-
const { bodyCell: BodyCell, } = useContext(TableComponentContext) || {};
|
|
8
|
-
const customProps = (_a = setCellProps === null || setCellProps === void 0 ? void 0 : setCellProps(rowData)) !== null && _a !== void 0 ? _a : {};
|
|
9
|
-
if (typeof BodyCell === 'function') {
|
|
10
|
-
return (jsx(BodyCell, { ...customProps, ...rest, dataIndex: dataIndex, editable: editable, rowData: rowData, children: children }));
|
|
11
|
-
}
|
|
12
|
-
return (jsx(Fragment, { children: children }));
|
|
5
|
+
function TableEditRenderWrapper({ children, dataIndex, editable, rowData, setCellProps, ...rest }) {
|
|
6
|
+
var _a;
|
|
7
|
+
const { bodyCell: BodyCell, } = useContext(TableComponentContext) || {};
|
|
8
|
+
const customProps = (_a = setCellProps === null || setCellProps === void 0 ? void 0 : setCellProps(rowData)) !== null && _a !== void 0 ? _a : {};
|
|
9
|
+
if (typeof BodyCell === 'function') {
|
|
10
|
+
return (jsx(BodyCell, { ...customProps, ...rest, dataIndex: dataIndex, editable: editable, rowData: rowData, children: children }));
|
|
11
|
+
}
|
|
12
|
+
return (jsx(Fragment, { children: children }));
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export { TableEditRenderWrapper as default };
|