@duskmoon-dev/components 0.1.2
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/README.md +38 -0
- package/dist/chunk-r9wkv7xd.js +29 -0
- package/dist/classes/affix.d.ts +6 -0
- package/dist/classes/alert.d.ts +9 -0
- package/dist/classes/anchor.d.ts +19 -0
- package/dist/classes/app.d.ts +9 -0
- package/dist/classes/auto-complete.d.ts +34 -0
- package/dist/classes/avatar.d.ts +9 -0
- package/dist/classes/back-top.d.ts +6 -0
- package/dist/classes/badge.d.ts +11 -0
- package/dist/classes/breadcrumb.d.ts +23 -0
- package/dist/classes/button.d.ts +17 -0
- package/dist/classes/calendar.d.ts +25 -0
- package/dist/classes/card.d.ts +9 -0
- package/dist/classes/carousel.d.ts +25 -0
- package/dist/classes/cascader.d.ts +42 -0
- package/dist/classes/checkbox.d.ts +23 -0
- package/dist/classes/col.d.ts +4 -0
- package/dist/classes/collapse.d.ts +23 -0
- package/dist/classes/color-picker.d.ts +21 -0
- package/dist/classes/config-provider.d.ts +7 -0
- package/dist/classes/date-picker.d.ts +27 -0
- package/dist/classes/descriptions.d.ts +18 -0
- package/dist/classes/divider.d.ts +15 -0
- package/dist/classes/dm-auxiliary.d.ts +11 -0
- package/dist/classes/dm-breadcrumb.d.ts +9 -0
- package/dist/classes/dm-date-picker.d.ts +4 -0
- package/dist/classes/dm-drawer.d.ts +9 -0
- package/dist/classes/dm-infinite-scroll.d.ts +9 -0
- package/dist/classes/dm-layout.d.ts +11 -0
- package/dist/classes/dm-menu.d.ts +13 -0
- package/dist/classes/dm-message.d.ts +6 -0
- package/dist/classes/dm-page-header.d.ts +15 -0
- package/dist/classes/dm-pagination.d.ts +17 -0
- package/dist/classes/dm-pro-table-inner.d.ts +1 -0
- package/dist/classes/dm-pro-table.d.ts +8 -0
- package/dist/classes/dm-provider.d.ts +4 -0
- package/dist/classes/dm-query.d.ts +1 -0
- package/dist/classes/dm-search.d.ts +12 -0
- package/dist/classes/dm-splitter.d.ts +11 -0
- package/dist/classes/dm-status.d.ts +10 -0
- package/dist/classes/dm-table.d.ts +13 -0
- package/dist/classes/dm-tabs.d.ts +17 -0
- package/dist/classes/dm-toolbar.d.ts +12 -0
- package/dist/classes/dm-tree.d.ts +27 -0
- package/dist/classes/dm-truncate.d.ts +14 -0
- package/dist/classes/drawer.d.ts +16 -0
- package/dist/classes/dropdown.d.ts +14 -0
- package/dist/classes/empty.d.ts +7 -0
- package/dist/classes/flex.d.ts +8 -0
- package/dist/classes/float-button.d.ts +27 -0
- package/dist/classes/form.d.ts +20 -0
- package/dist/classes/grid.d.ts +9 -0
- package/dist/classes/image.d.ts +16 -0
- package/dist/classes/index.d.ts +93 -0
- package/dist/classes/index.js +3556 -0
- package/dist/classes/input-number.d.ts +14 -0
- package/dist/classes/input.d.ts +51 -0
- package/dist/classes/layout.d.ts +16 -0
- package/dist/classes/list.d.ts +22 -0
- package/dist/classes/mentions.d.ts +27 -0
- package/dist/classes/menu.d.ts +33 -0
- package/dist/classes/message.d.ts +16 -0
- package/dist/classes/modal.d.ts +17 -0
- package/dist/classes/notification.d.ts +22 -0
- package/dist/classes/pagination.d.ts +23 -0
- package/dist/classes/popconfirm.d.ts +19 -0
- package/dist/classes/popover.d.ts +13 -0
- package/dist/classes/progress.d.ts +11 -0
- package/dist/classes/qr-code.d.ts +19 -0
- package/dist/classes/radio.d.ts +23 -0
- package/dist/classes/rate.d.ts +23 -0
- package/dist/classes/result.d.ts +15 -0
- package/dist/classes/row.d.ts +11 -0
- package/dist/classes/segmented.d.ts +19 -0
- package/dist/classes/select.d.ts +39 -0
- package/dist/classes/skeleton.d.ts +16 -0
- package/dist/classes/slider.d.ts +30 -0
- package/dist/classes/space.d.ts +18 -0
- package/dist/classes/spin.d.ts +16 -0
- package/dist/classes/splitter.d.ts +19 -0
- package/dist/classes/statistic.d.ts +9 -0
- package/dist/classes/steps.d.ts +36 -0
- package/dist/classes/switch.d.ts +16 -0
- package/dist/classes/table.d.ts +36 -0
- package/dist/classes/tabs.d.ts +42 -0
- package/dist/classes/tag.d.ts +20 -0
- package/dist/classes/time-picker.d.ts +24 -0
- package/dist/classes/timeline.d.ts +20 -0
- package/dist/classes/tooltip.d.ts +15 -0
- package/dist/classes/tour.d.ts +34 -0
- package/dist/classes/transfer.d.ts +30 -0
- package/dist/classes/tree-select.d.ts +39 -0
- package/dist/classes/tree.d.ts +34 -0
- package/dist/classes/typography.d.ts +48 -0
- package/dist/classes/upload.d.ts +31 -0
- package/dist/classes/watermark.d.ts +5 -0
- package/dist/components/affix/Affix.d.ts +3 -0
- package/dist/components/affix/Affix.types.d.ts +8 -0
- package/dist/components/affix/index.d.ts +2 -0
- package/dist/components/affix/index.js +103 -0
- package/dist/components/alert/Alert.d.ts +3 -0
- package/dist/components/alert/Alert.types.d.ts +7 -0
- package/dist/components/alert/index.d.ts +2 -0
- package/dist/components/alert/index.js +65 -0
- package/dist/components/anchor/Anchor.d.ts +4 -0
- package/dist/components/anchor/Anchor.types.d.ts +34 -0
- package/dist/components/anchor/index.d.ts +2 -0
- package/dist/components/anchor/index.js +240 -0
- package/dist/components/app/App.d.ts +5 -0
- package/dist/components/app/App.types.d.ts +27 -0
- package/dist/components/app/index.d.ts +2 -0
- package/dist/components/app/index.js +890 -0
- package/dist/components/auto-complete/AutoComplete.d.ts +2 -0
- package/dist/components/auto-complete/AutoComplete.types.d.ts +34 -0
- package/dist/components/auto-complete/index.d.ts +2 -0
- package/dist/components/auto-complete/index.js +339 -0
- package/dist/components/avatar/Avatar.d.ts +3 -0
- package/dist/components/avatar/Avatar.types.d.ts +10 -0
- package/dist/components/avatar/index.d.ts +2 -0
- package/dist/components/avatar/index.js +81 -0
- package/dist/components/back-top/BackTop.d.ts +3 -0
- package/dist/components/back-top/BackTop.types.d.ts +6 -0
- package/dist/components/back-top/index.d.ts +2 -0
- package/dist/components/back-top/index.js +108 -0
- package/dist/components/badge/Badge.d.ts +3 -0
- package/dist/components/badge/Badge.types.d.ts +9 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/badge/index.js +84 -0
- package/dist/components/breadcrumb/Breadcrumb.d.ts +2 -0
- package/dist/components/breadcrumb/Breadcrumb.types.d.ts +53 -0
- package/dist/components/breadcrumb/index.d.ts +2 -0
- package/dist/components/breadcrumb/index.js +313 -0
- package/dist/components/button/Button.d.ts +3 -0
- package/dist/components/button/Button.types.d.ts +15 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/index.js +125 -0
- package/dist/components/calendar/Calendar.d.ts +2 -0
- package/dist/components/calendar/Calendar.types.d.ts +39 -0
- package/dist/components/calendar/index.d.ts +2 -0
- package/dist/components/calendar/index.js +352 -0
- package/dist/components/card/Card.d.ts +3 -0
- package/dist/components/card/Card.types.d.ts +7 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/card/index.js +73 -0
- package/dist/components/carousel/Carousel.d.ts +2 -0
- package/dist/components/carousel/Carousel.types.d.ts +26 -0
- package/dist/components/carousel/index.d.ts +2 -0
- package/dist/components/carousel/index.js +193 -0
- package/dist/components/cascader/Cascader.d.ts +2 -0
- package/dist/components/cascader/Cascader.types.d.ts +63 -0
- package/dist/components/cascader/index.d.ts +2 -0
- package/dist/components/cascader/index.js +509 -0
- package/dist/components/checkbox/Checkbox.d.ts +3 -0
- package/dist/components/checkbox/Checkbox.types.d.ts +15 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/checkbox/index.js +134 -0
- package/dist/components/col/Col.d.ts +3 -0
- package/dist/components/col/Col.types.d.ts +24 -0
- package/dist/components/col/index.d.ts +2 -0
- package/dist/components/col/index.js +100 -0
- package/dist/components/collapse/Collapse.d.ts +3 -0
- package/dist/components/collapse/Collapse.types.d.ts +21 -0
- package/dist/components/collapse/index.d.ts +2 -0
- package/dist/components/collapse/index.js +148 -0
- package/dist/components/color-picker/ColorPicker.d.ts +2 -0
- package/dist/components/color-picker/ColorPicker.types.d.ts +39 -0
- package/dist/components/color-picker/index.d.ts +2 -0
- package/dist/components/color-picker/index.js +282 -0
- package/dist/components/config-provider/ConfigProvider.d.ts +4 -0
- package/dist/components/config-provider/ConfigProvider.types.d.ts +39 -0
- package/dist/components/config-provider/index.d.ts +2 -0
- package/dist/components/config-provider/index.js +127 -0
- package/dist/components/date-picker/DatePicker.d.ts +2 -0
- package/dist/components/date-picker/DatePicker.types.d.ts +46 -0
- package/dist/components/date-picker/index.d.ts +2 -0
- package/dist/components/date-picker/index.js +319 -0
- package/dist/components/descriptions/Descriptions.d.ts +2 -0
- package/dist/components/descriptions/Descriptions.types.d.ts +39 -0
- package/dist/components/descriptions/index.d.ts +2 -0
- package/dist/components/descriptions/index.js +196 -0
- package/dist/components/divider/Divider.d.ts +3 -0
- package/dist/components/divider/Divider.types.d.ts +14 -0
- package/dist/components/divider/index.d.ts +2 -0
- package/dist/components/divider/index.js +108 -0
- package/dist/components/dm-auxiliary/DmAuxiliary.d.ts +4 -0
- package/dist/components/dm-auxiliary/DmAuxiliary.types.d.ts +15 -0
- package/dist/components/dm-auxiliary/index.d.ts +2 -0
- package/dist/components/dm-auxiliary/index.js +127 -0
- package/dist/components/dm-breadcrumb/DmBreadcrumb.d.ts +3 -0
- package/dist/components/dm-breadcrumb/DmBreadcrumb.types.d.ts +25 -0
- package/dist/components/dm-breadcrumb/index.d.ts +2 -0
- package/dist/components/dm-breadcrumb/index.js +460 -0
- package/dist/components/dm-date-picker/DmDatePicker.d.ts +4 -0
- package/dist/components/dm-date-picker/DmDatePicker.types.d.ts +11 -0
- package/dist/components/dm-date-picker/index.d.ts +2 -0
- package/dist/components/dm-date-picker/index.js +460 -0
- package/dist/components/dm-drawer/DmDrawer.d.ts +3 -0
- package/dist/components/dm-drawer/DmDrawer.types.d.ts +16 -0
- package/dist/components/dm-drawer/index.d.ts +2 -0
- package/dist/components/dm-drawer/index.js +309 -0
- package/dist/components/dm-infinite-scroll/DmInfiniteScroll.d.ts +3 -0
- package/dist/components/dm-infinite-scroll/DmInfiniteScroll.types.d.ts +18 -0
- package/dist/components/dm-infinite-scroll/index.d.ts +2 -0
- package/dist/components/dm-infinite-scroll/index.js +153 -0
- package/dist/components/dm-layout/DmLayout.d.ts +4 -0
- package/dist/components/dm-layout/DmLayout.types.d.ts +31 -0
- package/dist/components/dm-layout/index.d.ts +2 -0
- package/dist/components/dm-layout/index.js +1186 -0
- package/dist/components/dm-menu/DmMenu.d.ts +5 -0
- package/dist/components/dm-menu/DmMenu.types.d.ts +44 -0
- package/dist/components/dm-menu/index.d.ts +2 -0
- package/dist/components/dm-menu/index.js +444 -0
- package/dist/components/dm-message/DmMessage.d.ts +16 -0
- package/dist/components/dm-message/DmMessage.types.d.ts +24 -0
- package/dist/components/dm-message/index.d.ts +2 -0
- package/dist/components/dm-message/index.js +280 -0
- package/dist/components/dm-page-header/DmPageHeader.d.ts +6 -0
- package/dist/components/dm-page-header/DmPageHeader.types.d.ts +19 -0
- package/dist/components/dm-page-header/index.d.ts +2 -0
- package/dist/components/dm-page-header/index.js +925 -0
- package/dist/components/dm-pagination/DmPagination.d.ts +3 -0
- package/dist/components/dm-pagination/DmPagination.types.d.ts +22 -0
- package/dist/components/dm-pagination/index.d.ts +2 -0
- package/dist/components/dm-pagination/index.js +469 -0
- package/dist/components/dm-pro-table/DmProTable.d.ts +7 -0
- package/dist/components/dm-pro-table/DmProTable.types.d.ts +15 -0
- package/dist/components/dm-pro-table/index.d.ts +2 -0
- package/dist/components/dm-pro-table/index.js +3076 -0
- package/dist/components/dm-pro-table-inner/DmProTableInner.d.ts +7 -0
- package/dist/components/dm-pro-table-inner/DmProTableInner.types.d.ts +5 -0
- package/dist/components/dm-pro-table-inner/index.d.ts +2 -0
- package/dist/components/dm-pro-table-inner/index.js +2620 -0
- package/dist/components/dm-provider/DmProvider.d.ts +3 -0
- package/dist/components/dm-provider/DmProvider.types.d.ts +11 -0
- package/dist/components/dm-provider/index.d.ts +2 -0
- package/dist/components/dm-provider/index.js +255 -0
- package/dist/components/dm-query/DmQuery.d.ts +3 -0
- package/dist/components/dm-query/DmQuery.types.d.ts +20 -0
- package/dist/components/dm-query/index.d.ts +2 -0
- package/dist/components/dm-query/index.js +1319 -0
- package/dist/components/dm-search/DmSearch.d.ts +3 -0
- package/dist/components/dm-search/DmSearch.types.d.ts +38 -0
- package/dist/components/dm-search/index.d.ts +2 -0
- package/dist/components/dm-search/index.js +1264 -0
- package/dist/components/dm-splitter/DmSplitter.d.ts +3 -0
- package/dist/components/dm-splitter/DmSplitter.types.d.ts +32 -0
- package/dist/components/dm-splitter/index.d.ts +2 -0
- package/dist/components/dm-splitter/index.js +406 -0
- package/dist/components/dm-status/DmStatus.d.ts +4 -0
- package/dist/components/dm-status/DmStatus.types.d.ts +12 -0
- package/dist/components/dm-status/index.d.ts +2 -0
- package/dist/components/dm-status/index.js +369 -0
- package/dist/components/dm-table/DmTable.d.ts +8 -0
- package/dist/components/dm-table/DmTable.types.d.ts +28 -0
- package/dist/components/dm-table/index.d.ts +2 -0
- package/dist/components/dm-table/index.js +2607 -0
- package/dist/components/dm-tabs/DmTabs.d.ts +3 -0
- package/dist/components/dm-tabs/DmTabs.types.d.ts +10 -0
- package/dist/components/dm-tabs/index.d.ts +2 -0
- package/dist/components/dm-tabs/index.js +415 -0
- package/dist/components/dm-toolbar/DmToolbar.d.ts +6 -0
- package/dist/components/dm-toolbar/DmToolbar.types.d.ts +18 -0
- package/dist/components/dm-toolbar/index.d.ts +2 -0
- package/dist/components/dm-toolbar/index.js +520 -0
- package/dist/components/dm-tree/DmTree.d.ts +3 -0
- package/dist/components/dm-tree/DmTree.types.d.ts +70 -0
- package/dist/components/dm-tree/index.d.ts +2 -0
- package/dist/components/dm-tree/index.js +1852 -0
- package/dist/components/dm-truncate/DmTruncate.d.ts +3 -0
- package/dist/components/dm-truncate/DmTruncate.types.d.ts +17 -0
- package/dist/components/dm-truncate/index.d.ts +2 -0
- package/dist/components/dm-truncate/index.js +375 -0
- package/dist/components/drawer/Drawer.d.ts +3 -0
- package/dist/components/drawer/Drawer.types.d.ts +18 -0
- package/dist/components/drawer/index.d.ts +2 -0
- package/dist/components/drawer/index.js +132 -0
- package/dist/components/dropdown/Dropdown.d.ts +2 -0
- package/dist/components/dropdown/Dropdown.types.d.ts +44 -0
- package/dist/components/dropdown/index.d.ts +2 -0
- package/dist/components/dropdown/index.js +411 -0
- package/dist/components/empty/Empty.d.ts +2 -0
- package/dist/components/empty/Empty.types.d.ts +11 -0
- package/dist/components/empty/index.d.ts +2 -0
- package/dist/components/empty/index.js +116 -0
- package/dist/components/flex/Flex.d.ts +3 -0
- package/dist/components/flex/Flex.types.d.ts +13 -0
- package/dist/components/flex/index.d.ts +2 -0
- package/dist/components/flex/index.js +107 -0
- package/dist/components/float-button/FloatButton.d.ts +2 -0
- package/dist/components/float-button/FloatButton.types.d.ts +44 -0
- package/dist/components/float-button/index.d.ts +2 -0
- package/dist/components/float-button/index.js +308 -0
- package/dist/components/form/Form.d.ts +4 -0
- package/dist/components/form/Form.types.d.ts +107 -0
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/form/index.js +449 -0
- package/dist/components/grid/Grid.d.ts +8 -0
- package/dist/components/grid/Grid.types.d.ts +5 -0
- package/dist/components/grid/index.d.ts +2 -0
- package/dist/components/grid/index.js +104 -0
- package/dist/components/image/Image.d.ts +2 -0
- package/dist/components/image/Image.types.d.ts +25 -0
- package/dist/components/image/index.d.ts +2 -0
- package/dist/components/image/index.js +171 -0
- package/dist/components/input/Input.d.ts +8 -0
- package/dist/components/input/Input.types.d.ts +46 -0
- package/dist/components/input/index.d.ts +2 -0
- package/dist/components/input/index.js +352 -0
- package/dist/components/input-number/InputNumber.d.ts +3 -0
- package/dist/components/input-number/InputNumber.types.d.ts +23 -0
- package/dist/components/input-number/index.d.ts +2 -0
- package/dist/components/input-number/index.js +175 -0
- package/dist/components/layout/Layout.d.ts +2 -0
- package/dist/components/layout/Layout.types.d.ts +23 -0
- package/dist/components/layout/index.d.ts +2 -0
- package/dist/components/layout/index.js +142 -0
- package/dist/components/list/List.d.ts +2 -0
- package/dist/components/list/List.types.d.ts +27 -0
- package/dist/components/list/index.d.ts +2 -0
- package/dist/components/list/index.js +175 -0
- package/dist/components/mentions/Mentions.d.ts +2 -0
- package/dist/components/mentions/Mentions.types.d.ts +30 -0
- package/dist/components/mentions/index.d.ts +2 -0
- package/dist/components/mentions/index.js +321 -0
- package/dist/components/menu/Menu.d.ts +2 -0
- package/dist/components/menu/Menu.types.d.ts +58 -0
- package/dist/components/menu/index.d.ts +2 -0
- package/dist/components/menu/index.js +317 -0
- package/dist/components/message/Message.d.ts +6 -0
- package/dist/components/message/Message.types.d.ts +45 -0
- package/dist/components/message/index.d.ts +2 -0
- package/dist/components/message/index.js +205 -0
- package/dist/components/modal/Modal.d.ts +2 -0
- package/dist/components/modal/Modal.types.d.ts +43 -0
- package/dist/components/modal/index.d.ts +2 -0
- package/dist/components/modal/index.js +214 -0
- package/dist/components/notification/Notification.d.ts +4 -0
- package/dist/components/notification/Notification.types.d.ts +43 -0
- package/dist/components/notification/index.d.ts +2 -0
- package/dist/components/notification/index.js +420 -0
- package/dist/components/pagination/Pagination.d.ts +3 -0
- package/dist/components/pagination/Pagination.types.d.ts +17 -0
- package/dist/components/pagination/index.d.ts +2 -0
- package/dist/components/pagination/index.js +281 -0
- package/dist/components/popconfirm/Popconfirm.d.ts +3 -0
- package/dist/components/popconfirm/Popconfirm.types.d.ts +26 -0
- package/dist/components/popconfirm/index.d.ts +2 -0
- package/dist/components/popconfirm/index.js +364 -0
- package/dist/components/popover/Popover.d.ts +3 -0
- package/dist/components/popover/Popover.types.d.ts +15 -0
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/popover/index.js +219 -0
- package/dist/components/progress/Progress.d.ts +3 -0
- package/dist/components/progress/Progress.types.d.ts +11 -0
- package/dist/components/progress/index.d.ts +2 -0
- package/dist/components/progress/index.js +106 -0
- package/dist/components/qr-code/QRCode.d.ts +3 -0
- package/dist/components/qr-code/QRCode.types.d.ts +17 -0
- package/dist/components/qr-code/index.d.ts +2 -0
- package/dist/components/qr-code/index.js +224 -0
- package/dist/components/radio/Radio.d.ts +3 -0
- package/dist/components/radio/Radio.types.d.ts +14 -0
- package/dist/components/radio/index.d.ts +2 -0
- package/dist/components/radio/index.js +118 -0
- package/dist/components/rate/Rate.d.ts +3 -0
- package/dist/components/rate/Rate.types.d.ts +23 -0
- package/dist/components/rate/index.d.ts +2 -0
- package/dist/components/rate/index.js +202 -0
- package/dist/components/result/Result.d.ts +3 -0
- package/dist/components/result/Result.types.d.ts +10 -0
- package/dist/components/result/index.d.ts +2 -0
- package/dist/components/result/index.js +205 -0
- package/dist/components/row/Row.d.ts +3 -0
- package/dist/components/row/Row.types.d.ts +11 -0
- package/dist/components/row/index.d.ts +2 -0
- package/dist/components/row/index.js +109 -0
- package/dist/components/segmented/Segmented.d.ts +3 -0
- package/dist/components/segmented/Segmented.types.d.ts +20 -0
- package/dist/components/segmented/index.d.ts +2 -0
- package/dist/components/segmented/index.js +130 -0
- package/dist/components/select/Select.d.ts +2 -0
- package/dist/components/select/Select.types.d.ts +47 -0
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/index.js +361 -0
- package/dist/components/skeleton/Skeleton.d.ts +15 -0
- package/dist/components/skeleton/Skeleton.types.d.ts +35 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/skeleton/index.js +238 -0
- package/dist/components/slider/Slider.d.ts +3 -0
- package/dist/components/slider/Slider.types.d.ts +38 -0
- package/dist/components/slider/index.d.ts +2 -0
- package/dist/components/slider/index.js +425 -0
- package/dist/components/space/Space.d.ts +2 -0
- package/dist/components/space/Space.types.d.ts +19 -0
- package/dist/components/space/index.d.ts +2 -0
- package/dist/components/space/index.js +144 -0
- package/dist/components/spin/Spin.d.ts +2 -0
- package/dist/components/spin/Spin.types.d.ts +15 -0
- package/dist/components/spin/index.d.ts +2 -0
- package/dist/components/spin/index.js +138 -0
- package/dist/components/splitter/Splitter.d.ts +2 -0
- package/dist/components/splitter/Splitter.types.d.ts +29 -0
- package/dist/components/splitter/index.d.ts +2 -0
- package/dist/components/splitter/index.js +227 -0
- package/dist/components/statistic/Statistic.d.ts +2 -0
- package/dist/components/statistic/Statistic.types.d.ts +22 -0
- package/dist/components/statistic/index.d.ts +2 -0
- package/dist/components/statistic/index.js +150 -0
- package/dist/components/steps/Steps.d.ts +4 -0
- package/dist/components/steps/Steps.types.d.ts +49 -0
- package/dist/components/steps/index.d.ts +2 -0
- package/dist/components/steps/index.js +311 -0
- package/dist/components/switch/Switch.d.ts +2 -0
- package/dist/components/switch/Switch.types.d.ts +16 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/index.js +120 -0
- package/dist/components/table/Table.d.ts +2 -0
- package/dist/components/table/Table.types.d.ts +142 -0
- package/dist/components/table/index.d.ts +2 -0
- package/dist/components/table/index.js +721 -0
- package/dist/components/tabs/Tabs.d.ts +10 -0
- package/dist/components/tabs/Tabs.types.d.ts +48 -0
- package/dist/components/tabs/index.d.ts +2 -0
- package/dist/components/tabs/index.js +359 -0
- package/dist/components/tag/Tag.d.ts +5 -0
- package/dist/components/tag/Tag.types.d.ts +20 -0
- package/dist/components/tag/index.d.ts +2 -0
- package/dist/components/tag/index.js +151 -0
- package/dist/components/time-picker/TimePicker.d.ts +2 -0
- package/dist/components/time-picker/TimePicker.types.d.ts +43 -0
- package/dist/components/time-picker/index.d.ts +2 -0
- package/dist/components/time-picker/index.js +323 -0
- package/dist/components/timeline/Timeline.d.ts +3 -0
- package/dist/components/timeline/Timeline.types.d.ts +20 -0
- package/dist/components/timeline/index.d.ts +2 -0
- package/dist/components/timeline/index.js +130 -0
- package/dist/components/tooltip/Tooltip.d.ts +3 -0
- package/dist/components/tooltip/Tooltip.types.d.ts +12 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/index.js +133 -0
- package/dist/components/tour/Tour.d.ts +3 -0
- package/dist/components/tour/Tour.types.d.ts +50 -0
- package/dist/components/tour/index.d.ts +2 -0
- package/dist/components/tour/index.js +507 -0
- package/dist/components/transfer/Transfer.d.ts +5 -0
- package/dist/components/transfer/Transfer.types.d.ts +88 -0
- package/dist/components/transfer/index.d.ts +2 -0
- package/dist/components/transfer/index.js +456 -0
- package/dist/components/tree/Tree.d.ts +2 -0
- package/dist/components/tree/Tree.types.d.ts +92 -0
- package/dist/components/tree/index.d.ts +2 -0
- package/dist/components/tree/index.js +439 -0
- package/dist/components/tree-select/TreeSelect.d.ts +2 -0
- package/dist/components/tree-select/TreeSelect.types.d.ts +70 -0
- package/dist/components/tree-select/index.d.ts +2 -0
- package/dist/components/tree-select/index.js +488 -0
- package/dist/components/typography/Typography.d.ts +8 -0
- package/dist/components/typography/Typography.types.d.ts +81 -0
- package/dist/components/typography/index.d.ts +2 -0
- package/dist/components/typography/index.js +689 -0
- package/dist/components/upload/Upload.d.ts +2 -0
- package/dist/components/upload/Upload.types.d.ts +55 -0
- package/dist/components/upload/index.d.ts +2 -0
- package/dist/components/upload/index.js +388 -0
- package/dist/components/watermark/Watermark.d.ts +3 -0
- package/dist/components/watermark/Watermark.types.d.ts +20 -0
- package/dist/components/watermark/index.d.ts +2 -0
- package/dist/components/watermark/index.js +109 -0
- package/dist/index.d.ts +100 -0
- package/dist/index.js +18027 -0
- package/dist/infrastructure.d.ts +124 -0
- package/dist/infrastructure.js +141 -0
- package/dist/styles.css +19312 -0
- package/dist/theme/ThemeProvider.d.ts +16 -0
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/index.js +83 -0
- package/dist/theme/theme-script.d.ts +8 -0
- package/dist/utils/cn.d.ts +13 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +8 -0
- package/package.json +444 -0
|
@@ -0,0 +1,721 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/components/table/Table.tsx
|
|
4
|
+
import React, {
|
|
5
|
+
forwardRef,
|
|
6
|
+
useMemo,
|
|
7
|
+
useState
|
|
8
|
+
} from "react";
|
|
9
|
+
|
|
10
|
+
// ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
11
|
+
function r(e) {
|
|
12
|
+
var t, f, n = "";
|
|
13
|
+
if (typeof e == "string" || typeof e == "number")
|
|
14
|
+
n += e;
|
|
15
|
+
else if (typeof e == "object")
|
|
16
|
+
if (Array.isArray(e)) {
|
|
17
|
+
var o = e.length;
|
|
18
|
+
for (t = 0;t < o; t++)
|
|
19
|
+
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
20
|
+
} else
|
|
21
|
+
for (f in e)
|
|
22
|
+
e[f] && (n && (n += " "), n += f);
|
|
23
|
+
return n;
|
|
24
|
+
}
|
|
25
|
+
function clsx() {
|
|
26
|
+
for (var e, t, f = 0, n = "", o = arguments.length;f < o; f++)
|
|
27
|
+
(e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
28
|
+
return n;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// src/utils/cn.ts
|
|
32
|
+
function cn(...inputs) {
|
|
33
|
+
return clsx(inputs);
|
|
34
|
+
}
|
|
35
|
+
// src/classes/table.ts
|
|
36
|
+
var tableWrapperClass = "table-wrapper";
|
|
37
|
+
var tableBaseClass = "table";
|
|
38
|
+
var tableBorderedClass = "table-bordered";
|
|
39
|
+
var tableLoadingClass = "table-loading";
|
|
40
|
+
var tableSmallClass = "table-sm";
|
|
41
|
+
var tableLargeClass = "table-lg";
|
|
42
|
+
var tableHeaderCellClass = "table-header-cell";
|
|
43
|
+
var tableCellClass = "table-cell";
|
|
44
|
+
var tableRowClass = "table-row";
|
|
45
|
+
var tableRowSelectedClass = "table-row-selected";
|
|
46
|
+
var tableRowExpandedClass = "table-row-expanded";
|
|
47
|
+
var tableEmptyClass = "table-empty";
|
|
48
|
+
var tableLoadingIndicatorClass = "table-loading-indicator";
|
|
49
|
+
var tableSorterClass = "table-sorter";
|
|
50
|
+
var tableSorterActiveClass = "table-sorter-active";
|
|
51
|
+
var tableFilterClass = "table-filter";
|
|
52
|
+
var tableSelectionCellClass = "table-selection-cell";
|
|
53
|
+
var tableExpandCellClass = "table-expand-cell";
|
|
54
|
+
var tableExpandButtonClass = "table-expand-button";
|
|
55
|
+
var tablePaginationClass = "table-pagination";
|
|
56
|
+
var tablePaginationButtonClass = "table-pagination-button";
|
|
57
|
+
var tablePaginationInfoClass = "table-pagination-info";
|
|
58
|
+
function getTableWrapperClasses({
|
|
59
|
+
loading,
|
|
60
|
+
className
|
|
61
|
+
}) {
|
|
62
|
+
return cn(tableWrapperClass, loading && tableLoadingClass, className);
|
|
63
|
+
}
|
|
64
|
+
function getTableClasses({
|
|
65
|
+
bordered,
|
|
66
|
+
size
|
|
67
|
+
}) {
|
|
68
|
+
return cn(tableBaseClass, bordered && tableBorderedClass, size === "small" && tableSmallClass, size === "large" && tableLargeClass);
|
|
69
|
+
}
|
|
70
|
+
function getTableRowClasses({
|
|
71
|
+
selected,
|
|
72
|
+
expanded,
|
|
73
|
+
className
|
|
74
|
+
}) {
|
|
75
|
+
return cn(tableRowClass, selected && tableRowSelectedClass, expanded && tableRowExpandedClass, className);
|
|
76
|
+
}
|
|
77
|
+
function getTableSorterClasses(active) {
|
|
78
|
+
return cn(tableSorterClass, active && tableSorterActiveClass);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// src/components/table/Table.tsx
|
|
82
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
83
|
+
import { createElement } from "react";
|
|
84
|
+
var defaultPageSize = 10;
|
|
85
|
+
var defaultSortDirections = ["ascend", "descend", null];
|
|
86
|
+
function hasNode(node) {
|
|
87
|
+
return node !== undefined && node !== null && node !== false;
|
|
88
|
+
}
|
|
89
|
+
function textFromNode(node, fallback) {
|
|
90
|
+
return typeof node === "string" || typeof node === "number" ? String(node) : fallback;
|
|
91
|
+
}
|
|
92
|
+
function dataIndexKey(dataIndex) {
|
|
93
|
+
if (dataIndex === undefined) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
return typeof dataIndex === "string" || typeof dataIndex === "number" ? dataIndex : Array.from(dataIndex).join(".");
|
|
97
|
+
}
|
|
98
|
+
function getValue(record, dataIndex) {
|
|
99
|
+
if (dataIndex === undefined) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const path = Array.isArray(dataIndex) ? dataIndex : [dataIndex];
|
|
103
|
+
return path.reduce((current, key) => {
|
|
104
|
+
if (current === null || current === undefined) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
return current[key];
|
|
108
|
+
}, record);
|
|
109
|
+
}
|
|
110
|
+
function getRecordKey(record, index, rowKey) {
|
|
111
|
+
if (typeof rowKey === "function") {
|
|
112
|
+
return rowKey(record, index);
|
|
113
|
+
}
|
|
114
|
+
if (rowKey) {
|
|
115
|
+
const key2 = record[rowKey];
|
|
116
|
+
return typeof key2 === "string" || typeof key2 === "number" ? key2 : index;
|
|
117
|
+
}
|
|
118
|
+
const key = record.key;
|
|
119
|
+
return typeof key === "string" || typeof key === "number" ? key : index;
|
|
120
|
+
}
|
|
121
|
+
function normalizeKeys(keys) {
|
|
122
|
+
return keys?.map(String) ?? [];
|
|
123
|
+
}
|
|
124
|
+
function normalizeColumns(columns, prefix = "column") {
|
|
125
|
+
return columns.map((column, index) => {
|
|
126
|
+
const rawKey = column.key ?? dataIndexKey(column.dataIndex) ?? `${prefix}-${index}`;
|
|
127
|
+
return {
|
|
128
|
+
...column,
|
|
129
|
+
columnKey: rawKey,
|
|
130
|
+
children: column.children ? normalizeColumns(column.children, String(rawKey)) : undefined
|
|
131
|
+
};
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
function leafColumns(columns) {
|
|
135
|
+
return columns.flatMap((column) => column.children?.length ? leafColumns(column.children) : [column]);
|
|
136
|
+
}
|
|
137
|
+
function getDepth(columns) {
|
|
138
|
+
if (columns.length === 0) {
|
|
139
|
+
return 1;
|
|
140
|
+
}
|
|
141
|
+
return Math.max(...columns.map((column) => column.children?.length ? 1 + getDepth(column.children) : 1));
|
|
142
|
+
}
|
|
143
|
+
function getLeafCount(column) {
|
|
144
|
+
return column.children?.length ? column.children.reduce((count, child) => count + getLeafCount(child), 0) : 1;
|
|
145
|
+
}
|
|
146
|
+
function buildHeaderRows(columns, depth, level = 0, rows = []) {
|
|
147
|
+
rows[level] ??= [];
|
|
148
|
+
columns.forEach((column) => {
|
|
149
|
+
const grouped = Boolean(column.children?.length);
|
|
150
|
+
rows[level].push({
|
|
151
|
+
column,
|
|
152
|
+
colSpan: grouped ? getLeafCount(column) : 1,
|
|
153
|
+
rowSpan: grouped ? 1 : depth - level
|
|
154
|
+
});
|
|
155
|
+
if (column.children?.length) {
|
|
156
|
+
buildHeaderRows(column.children, depth, level + 1, rows);
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
return rows;
|
|
160
|
+
}
|
|
161
|
+
function optionValues(filters) {
|
|
162
|
+
return (filters ?? []).flatMap((filter) => [
|
|
163
|
+
filter,
|
|
164
|
+
...filter.children ?? []
|
|
165
|
+
]);
|
|
166
|
+
}
|
|
167
|
+
function sortCompare(sorter) {
|
|
168
|
+
if (typeof sorter === "function") {
|
|
169
|
+
return sorter;
|
|
170
|
+
}
|
|
171
|
+
if (typeof sorter === "object" && sorter.compare) {
|
|
172
|
+
return sorter.compare;
|
|
173
|
+
}
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
function sortOrderFor(column, sortStates) {
|
|
177
|
+
if (column.sortOrder !== undefined) {
|
|
178
|
+
return column.sortOrder;
|
|
179
|
+
}
|
|
180
|
+
return sortStates[String(column.columnKey)] ?? column.defaultSortOrder;
|
|
181
|
+
}
|
|
182
|
+
function filterValueFor(column, filterStates) {
|
|
183
|
+
if (column.filteredValue !== undefined) {
|
|
184
|
+
return column.filteredValue;
|
|
185
|
+
}
|
|
186
|
+
const state = filterStates[String(column.columnKey)];
|
|
187
|
+
return state !== undefined ? state : column.defaultFilteredValue;
|
|
188
|
+
}
|
|
189
|
+
function nextSortOrder(column, current) {
|
|
190
|
+
const directions = column.sortDirections ?? defaultSortDirections;
|
|
191
|
+
const index = directions.findIndex((order) => order === (current ?? null));
|
|
192
|
+
return directions[(index + 1) % directions.length] ?? null;
|
|
193
|
+
}
|
|
194
|
+
function selectedRowsForKeys(data, keys, rowKey) {
|
|
195
|
+
const keySet = new Set(normalizeKeys(keys));
|
|
196
|
+
return data.filter((record, index) => keySet.has(String(getRecordKey(record, index, rowKey))));
|
|
197
|
+
}
|
|
198
|
+
var Column = forwardRef(() => null);
|
|
199
|
+
Column.displayName = "Table.Column";
|
|
200
|
+
var ColumnGroup = forwardRef(() => null);
|
|
201
|
+
ColumnGroup.displayName = "Table.ColumnGroup";
|
|
202
|
+
var SummaryRow = forwardRef((props, ref) => /* @__PURE__ */ jsx("tr", {
|
|
203
|
+
...props,
|
|
204
|
+
ref
|
|
205
|
+
}));
|
|
206
|
+
SummaryRow.displayName = "Table.Summary.Row";
|
|
207
|
+
var SummaryCell = forwardRef(({ index, ...props }, ref) => {
|
|
208
|
+
return /* @__PURE__ */ jsx("td", {
|
|
209
|
+
...props,
|
|
210
|
+
ref
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
SummaryCell.displayName = "Table.Summary.Cell";
|
|
214
|
+
var Summary = Object.assign(forwardRef(({ fixed, ...props }, ref) => {
|
|
215
|
+
return /* @__PURE__ */ jsx("tfoot", {
|
|
216
|
+
...props,
|
|
217
|
+
ref
|
|
218
|
+
});
|
|
219
|
+
}), {
|
|
220
|
+
Row: SummaryRow,
|
|
221
|
+
Cell: SummaryCell
|
|
222
|
+
});
|
|
223
|
+
Summary.displayName = "Table.Summary";
|
|
224
|
+
function columnsFromChildren(children) {
|
|
225
|
+
return React.Children.toArray(children).flatMap((child) => {
|
|
226
|
+
if (!React.isValidElement(child)) {
|
|
227
|
+
return [];
|
|
228
|
+
}
|
|
229
|
+
if (child.type === Column) {
|
|
230
|
+
const props = child.props;
|
|
231
|
+
const { children: columnChildren, ...column } = props;
|
|
232
|
+
return [column];
|
|
233
|
+
}
|
|
234
|
+
if (child.type === ColumnGroup) {
|
|
235
|
+
const props = child.props;
|
|
236
|
+
const { children: groupChildren, ...column } = props;
|
|
237
|
+
return [
|
|
238
|
+
{
|
|
239
|
+
...column,
|
|
240
|
+
children: columnsFromChildren(groupChildren)
|
|
241
|
+
}
|
|
242
|
+
];
|
|
243
|
+
}
|
|
244
|
+
return [];
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
function renderSummary(summary, pageData, colSpan) {
|
|
248
|
+
if (!summary) {
|
|
249
|
+
return null;
|
|
250
|
+
}
|
|
251
|
+
const node = summary(pageData);
|
|
252
|
+
if (React.isValidElement(node) && node.type === Summary) {
|
|
253
|
+
return node;
|
|
254
|
+
}
|
|
255
|
+
return /* @__PURE__ */ jsx("tfoot", {
|
|
256
|
+
children: /* @__PURE__ */ jsx("tr", {
|
|
257
|
+
children: /* @__PURE__ */ jsx("td", {
|
|
258
|
+
className: tableCellClass,
|
|
259
|
+
colSpan,
|
|
260
|
+
children: node
|
|
261
|
+
})
|
|
262
|
+
})
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
function resolvePagination(pagination, total) {
|
|
266
|
+
if (pagination === false) {
|
|
267
|
+
return null;
|
|
268
|
+
}
|
|
269
|
+
const config = pagination ?? {};
|
|
270
|
+
return {
|
|
271
|
+
current: config.current,
|
|
272
|
+
defaultCurrent: config.defaultCurrent ?? 1,
|
|
273
|
+
pageSize: config.pageSize,
|
|
274
|
+
defaultPageSize: config.defaultPageSize ?? defaultPageSize,
|
|
275
|
+
total: config.total ?? total,
|
|
276
|
+
disabled: config.disabled,
|
|
277
|
+
hideOnSinglePage: config.hideOnSinglePage,
|
|
278
|
+
showTotal: config.showTotal,
|
|
279
|
+
onChange: config.onChange
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
function TableRoot({
|
|
283
|
+
columns,
|
|
284
|
+
dataSource = [],
|
|
285
|
+
rowKey,
|
|
286
|
+
loading,
|
|
287
|
+
bordered,
|
|
288
|
+
size = "middle",
|
|
289
|
+
pagination,
|
|
290
|
+
rowSelection,
|
|
291
|
+
expandable,
|
|
292
|
+
summary,
|
|
293
|
+
locale,
|
|
294
|
+
tableLayout,
|
|
295
|
+
scroll,
|
|
296
|
+
onChange,
|
|
297
|
+
children,
|
|
298
|
+
className,
|
|
299
|
+
...props
|
|
300
|
+
}, ref) {
|
|
301
|
+
const childColumns = useMemo(() => columnsFromChildren(children), [children]);
|
|
302
|
+
const normalizedColumns = useMemo(() => normalizeColumns(columns ?? childColumns), [childColumns, columns]);
|
|
303
|
+
const leaves = useMemo(() => leafColumns(normalizedColumns), [normalizedColumns]);
|
|
304
|
+
const headerRows = useMemo(() => buildHeaderRows(normalizedColumns, getDepth(normalizedColumns)), [normalizedColumns]);
|
|
305
|
+
const [sortStates, setSortStates] = useState({});
|
|
306
|
+
const [filterStates, setFilterStates] = useState({});
|
|
307
|
+
const [internalCurrent, setInternalCurrent] = useState(1);
|
|
308
|
+
const [internalPageSize, setInternalPageSize] = useState(defaultPageSize);
|
|
309
|
+
const [internalSelectedKeys, setInternalSelectedKeys] = useState(rowSelection?.defaultSelectedRowKeys ?? []);
|
|
310
|
+
const [internalExpandedKeys, setInternalExpandedKeys] = useState(expandable?.defaultExpandedRowKeys ?? []);
|
|
311
|
+
const spinning = typeof loading === "object" ? loading.spinning : Boolean(loading);
|
|
312
|
+
const activeFilters = useMemo(() => {
|
|
313
|
+
return leaves.reduce((result, column) => {
|
|
314
|
+
const value = filterValueFor(column, filterStates) ?? null;
|
|
315
|
+
if (value !== null) {
|
|
316
|
+
result[String(column.columnKey)] = value;
|
|
317
|
+
}
|
|
318
|
+
return result;
|
|
319
|
+
}, {});
|
|
320
|
+
}, [filterStates, leaves]);
|
|
321
|
+
const activeSorter = useMemo(() => {
|
|
322
|
+
const column = leaves.find((item) => sortOrderFor(item, sortStates));
|
|
323
|
+
if (!column) {
|
|
324
|
+
return {};
|
|
325
|
+
}
|
|
326
|
+
return {
|
|
327
|
+
column,
|
|
328
|
+
columnKey: column.columnKey,
|
|
329
|
+
field: column.dataIndex,
|
|
330
|
+
order: sortOrderFor(column, sortStates) ?? null
|
|
331
|
+
};
|
|
332
|
+
}, [leaves, sortStates]);
|
|
333
|
+
const filteredData = useMemo(() => {
|
|
334
|
+
return leaves.reduce((records, column) => {
|
|
335
|
+
const values = filterValueFor(column, filterStates);
|
|
336
|
+
if (!values?.length || !column.onFilter) {
|
|
337
|
+
return records;
|
|
338
|
+
}
|
|
339
|
+
return records.filter((record) => values.some((value) => column.onFilter?.(value, record)));
|
|
340
|
+
}, dataSource);
|
|
341
|
+
}, [dataSource, filterStates, leaves]);
|
|
342
|
+
const sortedData = useMemo(() => {
|
|
343
|
+
const sorterColumn = leaves.find((column) => sortOrderFor(column, sortStates));
|
|
344
|
+
const order = sorterColumn ? sortOrderFor(sorterColumn, sortStates) : null;
|
|
345
|
+
const compare = sorterColumn ? sortCompare(sorterColumn.sorter) : undefined;
|
|
346
|
+
if (!sorterColumn || !order || !compare) {
|
|
347
|
+
return filteredData;
|
|
348
|
+
}
|
|
349
|
+
return [...filteredData].sort((first, second) => {
|
|
350
|
+
const result = compare(first, second);
|
|
351
|
+
return order === "descend" ? -result : result;
|
|
352
|
+
});
|
|
353
|
+
}, [filteredData, leaves, sortStates]);
|
|
354
|
+
const paginationConfig = resolvePagination(pagination, sortedData.length);
|
|
355
|
+
const pageSize = Math.max(1, Math.floor(paginationConfig?.pageSize ?? (internalPageSize === defaultPageSize ? paginationConfig?.defaultPageSize : internalPageSize) ?? defaultPageSize));
|
|
356
|
+
const pageCount = paginationConfig ? Math.max(1, Math.ceil(Math.max(0, paginationConfig.total ?? sortedData.length) / pageSize)) : 1;
|
|
357
|
+
const current = paginationConfig ? Math.min(pageCount, Math.max(1, Math.floor(paginationConfig.current ?? internalCurrent ?? paginationConfig.defaultCurrent ?? 1))) : 1;
|
|
358
|
+
const pageData = paginationConfig ? sortedData.slice((current - 1) * pageSize, current * pageSize) : sortedData;
|
|
359
|
+
const selectedKeys = rowSelection?.selectedRowKeys ?? internalSelectedKeys;
|
|
360
|
+
const selectedKeySet = new Set(normalizeKeys(selectedKeys));
|
|
361
|
+
const expandedKeys = expandable?.expandedRowKeys ?? internalExpandedKeys;
|
|
362
|
+
const expandedKeySet = new Set(normalizeKeys(expandedKeys));
|
|
363
|
+
const hasSelection = Boolean(rowSelection);
|
|
364
|
+
const hasExpandable = Boolean(expandable?.expandedRowRender);
|
|
365
|
+
const structuralColumnCount = leaves.length + (hasSelection ? 1 : 0) + (hasExpandable ? 1 : 0);
|
|
366
|
+
const bodyEmpty = pageData.length === 0;
|
|
367
|
+
function emitTableChange(nextPagination, nextFilters, nextSorter, action) {
|
|
368
|
+
onChange?.(nextPagination, nextFilters, nextSorter, {
|
|
369
|
+
currentDataSource: sortedData,
|
|
370
|
+
action
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
function changePage(nextPage, nextPageSize = pageSize) {
|
|
374
|
+
if (!paginationConfig || paginationConfig.disabled) {
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
const nextPageCount = Math.max(1, Math.ceil((paginationConfig.total ?? sortedData.length) / nextPageSize));
|
|
378
|
+
const normalizedPage = Math.min(nextPageCount, Math.max(1, nextPage));
|
|
379
|
+
if (paginationConfig.current === undefined) {
|
|
380
|
+
setInternalCurrent(normalizedPage);
|
|
381
|
+
}
|
|
382
|
+
if (paginationConfig.pageSize === undefined) {
|
|
383
|
+
setInternalPageSize(nextPageSize);
|
|
384
|
+
}
|
|
385
|
+
paginationConfig.onChange?.(normalizedPage, nextPageSize);
|
|
386
|
+
emitTableChange({ ...paginationConfig, current: normalizedPage, pageSize: nextPageSize }, activeFilters, activeSorter, "paginate");
|
|
387
|
+
}
|
|
388
|
+
function changeSorter(column) {
|
|
389
|
+
if (!column.sorter) {
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
const nextOrder = nextSortOrder(column, sortOrderFor(column, sortStates));
|
|
393
|
+
const nextSortStates = { [String(column.columnKey)]: nextOrder };
|
|
394
|
+
const nextSorter = nextOrder ? {
|
|
395
|
+
column,
|
|
396
|
+
columnKey: column.columnKey,
|
|
397
|
+
field: column.dataIndex,
|
|
398
|
+
order: nextOrder
|
|
399
|
+
} : {};
|
|
400
|
+
setSortStates(nextSortStates);
|
|
401
|
+
setInternalCurrent(1);
|
|
402
|
+
emitTableChange({ ...paginationConfig ?? {}, current: 1, pageSize }, activeFilters, nextSorter, "sort");
|
|
403
|
+
}
|
|
404
|
+
function changeFilter(column, event) {
|
|
405
|
+
const selected = Array.from(event.currentTarget.selectedOptions).map((option) => option.value).filter((value) => value !== "");
|
|
406
|
+
const nextValue = selected.length > 0 ? selected : null;
|
|
407
|
+
const nextFilters = {
|
|
408
|
+
...activeFilters,
|
|
409
|
+
[String(column.columnKey)]: nextValue
|
|
410
|
+
};
|
|
411
|
+
if (nextValue === null) {
|
|
412
|
+
delete nextFilters[String(column.columnKey)];
|
|
413
|
+
}
|
|
414
|
+
setFilterStates((currentFilters) => ({
|
|
415
|
+
...currentFilters,
|
|
416
|
+
[String(column.columnKey)]: nextValue
|
|
417
|
+
}));
|
|
418
|
+
setInternalCurrent(1);
|
|
419
|
+
emitTableChange({ ...paginationConfig ?? {}, current: 1, pageSize }, nextFilters, activeSorter, "filter");
|
|
420
|
+
}
|
|
421
|
+
function commitSelection(nextKeys, nativeEvent, changedRecord, selected, changedRows) {
|
|
422
|
+
if (!rowSelection) {
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
const normalizedNextKeys = Array.from(new Set(nextKeys.map(String)));
|
|
426
|
+
const originalKeys = normalizedNextKeys.map((key) => {
|
|
427
|
+
const index = dataSource.findIndex((record, itemIndex) => String(getRecordKey(record, itemIndex, rowKey)) === key);
|
|
428
|
+
return index >= 0 ? getRecordKey(dataSource[index], index, rowKey) : key;
|
|
429
|
+
});
|
|
430
|
+
const selectedRows = selectedRowsForKeys(dataSource, originalKeys, rowKey);
|
|
431
|
+
if (rowSelection.selectedRowKeys === undefined) {
|
|
432
|
+
setInternalSelectedKeys(originalKeys);
|
|
433
|
+
}
|
|
434
|
+
rowSelection.onChange?.(originalKeys, selectedRows);
|
|
435
|
+
if (changedRecord && selected !== undefined) {
|
|
436
|
+
rowSelection.onSelect?.(changedRecord, selected, selectedRows, nativeEvent);
|
|
437
|
+
}
|
|
438
|
+
if (changedRows) {
|
|
439
|
+
rowSelection.onSelectAll?.(Boolean(selected), selectedRows, changedRows);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
function toggleRowSelection(record, index, event) {
|
|
443
|
+
if (!rowSelection) {
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
const key = getRecordKey(record, index, rowKey);
|
|
447
|
+
const keyString = String(key);
|
|
448
|
+
const checked = event.currentTarget.checked;
|
|
449
|
+
const nextKeys = rowSelection.type === "radio" ? checked ? [key] : [] : checked ? [...selectedKeys, key] : selectedKeys.filter((selectedKey) => String(selectedKey) !== keyString);
|
|
450
|
+
commitSelection(nextKeys, event.nativeEvent, record, checked);
|
|
451
|
+
}
|
|
452
|
+
function toggleAllRows(event) {
|
|
453
|
+
if (!rowSelection) {
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
const checked = event.currentTarget.checked;
|
|
457
|
+
const selectableRows = pageData.filter((record, index) => {
|
|
458
|
+
const checkboxProps = rowSelection.getCheckboxProps?.(record);
|
|
459
|
+
return !checkboxProps?.disabled && getRecordKey(record, index, rowKey) !== undefined;
|
|
460
|
+
});
|
|
461
|
+
const pageKeys = selectableRows.map((record, index) => getRecordKey(record, index, rowKey));
|
|
462
|
+
const pageKeySet = new Set(normalizeKeys(pageKeys));
|
|
463
|
+
const nextKeys = checked ? [...selectedKeys, ...pageKeys] : selectedKeys.filter((key) => !pageKeySet.has(String(key)));
|
|
464
|
+
commitSelection(nextKeys, event.nativeEvent, undefined, checked, selectableRows);
|
|
465
|
+
}
|
|
466
|
+
function toggleExpand(record, index) {
|
|
467
|
+
if (!expandable?.expandedRowRender) {
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
const key = getRecordKey(record, index, rowKey);
|
|
471
|
+
const keyString = String(key);
|
|
472
|
+
const expanded = !expandedKeySet.has(keyString);
|
|
473
|
+
const nextKeys = expanded ? [...expandedKeys, key] : expandedKeys.filter((expandedKey) => String(expandedKey) !== keyString);
|
|
474
|
+
if (expandable.expandedRowKeys === undefined) {
|
|
475
|
+
setInternalExpandedKeys(nextKeys);
|
|
476
|
+
}
|
|
477
|
+
expandable.onExpand?.(expanded, record);
|
|
478
|
+
expandable.onExpandedRowsChange?.(nextKeys);
|
|
479
|
+
}
|
|
480
|
+
function renderSelectionHeader() {
|
|
481
|
+
if (!rowSelection) {
|
|
482
|
+
return null;
|
|
483
|
+
}
|
|
484
|
+
if (rowSelection.type === "radio" || rowSelection.hideSelectAll) {
|
|
485
|
+
return /* @__PURE__ */ jsx("th", {
|
|
486
|
+
className: cn(tableHeaderCellClass, tableSelectionCellClass),
|
|
487
|
+
children: rowSelection.columnTitle
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
const pageKeys = pageData.map((record, index) => getRecordKey(record, index, rowKey));
|
|
491
|
+
const allSelected = pageKeys.length > 0 && pageKeys.every((key) => selectedKeySet.has(String(key)));
|
|
492
|
+
return /* @__PURE__ */ jsx("th", {
|
|
493
|
+
className: cn(tableHeaderCellClass, tableSelectionCellClass),
|
|
494
|
+
children: /* @__PURE__ */ jsxs("label", {
|
|
495
|
+
children: [
|
|
496
|
+
/* @__PURE__ */ jsx("input", {
|
|
497
|
+
type: "checkbox",
|
|
498
|
+
"aria-label": "Select all rows",
|
|
499
|
+
checked: allSelected,
|
|
500
|
+
onChange: toggleAllRows
|
|
501
|
+
}),
|
|
502
|
+
hasNode(rowSelection.columnTitle) ? rowSelection.columnTitle : null
|
|
503
|
+
]
|
|
504
|
+
})
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
function renderHeaderCell(cell, index) {
|
|
508
|
+
const { column } = cell;
|
|
509
|
+
const title = column.title ?? dataIndexKey(column.dataIndex) ?? index + 1;
|
|
510
|
+
const sortOrder = sortOrderFor(column, sortStates);
|
|
511
|
+
const headerProps = column.onHeaderCell?.(column) ?? {};
|
|
512
|
+
return /* @__PURE__ */ createElement("th", {
|
|
513
|
+
...headerProps,
|
|
514
|
+
key: String(column.columnKey),
|
|
515
|
+
className: cn(tableHeaderCellClass, column.className, headerProps.className),
|
|
516
|
+
colSpan: cell.colSpan,
|
|
517
|
+
rowSpan: cell.rowSpan,
|
|
518
|
+
style: {
|
|
519
|
+
width: column.width,
|
|
520
|
+
textAlign: column.align,
|
|
521
|
+
...headerProps.style
|
|
522
|
+
}
|
|
523
|
+
}, /* @__PURE__ */ jsx("span", {
|
|
524
|
+
children: title
|
|
525
|
+
}), column.sorter ? /* @__PURE__ */ jsx("button", {
|
|
526
|
+
type: "button",
|
|
527
|
+
className: getTableSorterClasses(Boolean(sortOrder)),
|
|
528
|
+
"aria-label": `Sort ${textFromNode(title, String(column.columnKey))}`,
|
|
529
|
+
onClick: () => changeSorter(column),
|
|
530
|
+
children: sortOrder === "ascend" ? "Asc" : sortOrder === "descend" ? "Desc" : "Sort"
|
|
531
|
+
}) : null, column.filters?.length ? /* @__PURE__ */ jsxs("select", {
|
|
532
|
+
className: tableFilterClass,
|
|
533
|
+
"aria-label": `Filter ${textFromNode(title, String(column.columnKey))}`,
|
|
534
|
+
multiple: column.filterMultiple !== false,
|
|
535
|
+
value: column.filterMultiple === false ? String((filterValueFor(column, filterStates) ?? [])[0] ?? "") : (filterValueFor(column, filterStates) ?? []).map(String),
|
|
536
|
+
onChange: (event) => changeFilter(column, event),
|
|
537
|
+
children: [
|
|
538
|
+
column.filterMultiple === false ? /* @__PURE__ */ jsx("option", {
|
|
539
|
+
value: "",
|
|
540
|
+
children: "All"
|
|
541
|
+
}) : null,
|
|
542
|
+
optionValues(column.filters).map((filter) => /* @__PURE__ */ jsx("option", {
|
|
543
|
+
value: String(filter.value),
|
|
544
|
+
children: filter.text
|
|
545
|
+
}, String(filter.value)))
|
|
546
|
+
]
|
|
547
|
+
}) : null);
|
|
548
|
+
}
|
|
549
|
+
function renderCell(record, recordIndex, column) {
|
|
550
|
+
const value = getValue(record, column.dataIndex);
|
|
551
|
+
const rendered = column.render ? column.render(value, record, recordIndex) : value;
|
|
552
|
+
const cellProps = column.onCell?.(record, recordIndex) ?? {};
|
|
553
|
+
return /* @__PURE__ */ createElement("td", {
|
|
554
|
+
...cellProps,
|
|
555
|
+
key: String(column.columnKey),
|
|
556
|
+
className: cn(tableCellClass, column.className, cellProps.className),
|
|
557
|
+
style: { textAlign: column.align, ...cellProps.style }
|
|
558
|
+
}, hasNode(rendered) ? rendered : null);
|
|
559
|
+
}
|
|
560
|
+
function renderSelectionCell(record, index) {
|
|
561
|
+
if (!rowSelection) {
|
|
562
|
+
return null;
|
|
563
|
+
}
|
|
564
|
+
const key = getRecordKey(record, index, rowKey);
|
|
565
|
+
const checked = selectedKeySet.has(String(key));
|
|
566
|
+
const checkboxProps = rowSelection.getCheckboxProps?.(record) ?? {};
|
|
567
|
+
const originNode = /* @__PURE__ */ jsx("input", {
|
|
568
|
+
...checkboxProps,
|
|
569
|
+
type: rowSelection.type === "radio" ? "radio" : "checkbox",
|
|
570
|
+
"aria-label": `Select row ${index + 1}`,
|
|
571
|
+
checked,
|
|
572
|
+
onChange: (event) => toggleRowSelection(record, index, event)
|
|
573
|
+
});
|
|
574
|
+
return /* @__PURE__ */ jsx("td", {
|
|
575
|
+
className: cn(tableCellClass, tableSelectionCellClass),
|
|
576
|
+
children: rowSelection.renderCell ? rowSelection.renderCell(checked, record, index, originNode) : originNode
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
function renderExpandCell(record, index) {
|
|
580
|
+
if (!expandable?.expandedRowRender) {
|
|
581
|
+
return null;
|
|
582
|
+
}
|
|
583
|
+
const key = getRecordKey(record, index, rowKey);
|
|
584
|
+
const expanded = expandedKeySet.has(String(key));
|
|
585
|
+
const expandableRow = expandable.rowExpandable?.(record) ?? true;
|
|
586
|
+
return /* @__PURE__ */ jsx("td", {
|
|
587
|
+
className: cn(tableCellClass, tableExpandCellClass),
|
|
588
|
+
children: expandableRow ? /* @__PURE__ */ jsx("button", {
|
|
589
|
+
type: "button",
|
|
590
|
+
className: tableExpandButtonClass,
|
|
591
|
+
"aria-label": `${expanded ? "Collapse" : "Expand"} row ${index + 1}`,
|
|
592
|
+
onClick: () => toggleExpand(record, index),
|
|
593
|
+
children: expanded ? "-" : "+"
|
|
594
|
+
}) : null
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
function renderRow(record, index) {
|
|
598
|
+
const key = getRecordKey(record, index, rowKey);
|
|
599
|
+
const expanded = expandedKeySet.has(String(key));
|
|
600
|
+
const selected = selectedKeySet.has(String(key));
|
|
601
|
+
const row = /* @__PURE__ */ jsxs("tr", {
|
|
602
|
+
className: getTableRowClasses({ selected, expanded }),
|
|
603
|
+
onClick: () => {
|
|
604
|
+
if (expandable?.expandRowByClick) {
|
|
605
|
+
toggleExpand(record, index);
|
|
606
|
+
}
|
|
607
|
+
},
|
|
608
|
+
children: [
|
|
609
|
+
renderSelectionCell(record, index),
|
|
610
|
+
renderExpandCell(record, index),
|
|
611
|
+
leaves.map((column) => renderCell(record, index, column))
|
|
612
|
+
]
|
|
613
|
+
}, String(key));
|
|
614
|
+
if (!expanded || !expandable?.expandedRowRender) {
|
|
615
|
+
return row;
|
|
616
|
+
}
|
|
617
|
+
return /* @__PURE__ */ jsxs(React.Fragment, {
|
|
618
|
+
children: [
|
|
619
|
+
row,
|
|
620
|
+
/* @__PURE__ */ jsx("tr", {
|
|
621
|
+
className: "table-expanded-row",
|
|
622
|
+
children: /* @__PURE__ */ jsx("td", {
|
|
623
|
+
className: tableCellClass,
|
|
624
|
+
colSpan: structuralColumnCount,
|
|
625
|
+
children: expandable.expandedRowRender(record, index, 0, expanded)
|
|
626
|
+
})
|
|
627
|
+
})
|
|
628
|
+
]
|
|
629
|
+
}, String(key));
|
|
630
|
+
}
|
|
631
|
+
const tableNode = /* @__PURE__ */ jsxs("table", {
|
|
632
|
+
className: getTableClasses({ bordered, size }),
|
|
633
|
+
style: { tableLayout },
|
|
634
|
+
children: [
|
|
635
|
+
/* @__PURE__ */ jsx("thead", {
|
|
636
|
+
children: headerRows.map((row, rowIndex) => /* @__PURE__ */ jsxs("tr", {
|
|
637
|
+
children: [
|
|
638
|
+
rowIndex === 0 ? renderSelectionHeader() : null,
|
|
639
|
+
rowIndex === 0 && hasExpandable ? /* @__PURE__ */ jsx("th", {
|
|
640
|
+
className: cn(tableHeaderCellClass, tableExpandCellClass),
|
|
641
|
+
children: expandable?.columnTitle
|
|
642
|
+
}) : null,
|
|
643
|
+
row.map(renderHeaderCell)
|
|
644
|
+
]
|
|
645
|
+
}, rowIndex))
|
|
646
|
+
}),
|
|
647
|
+
/* @__PURE__ */ jsx("tbody", {
|
|
648
|
+
children: bodyEmpty ? /* @__PURE__ */ jsx("tr", {
|
|
649
|
+
children: /* @__PURE__ */ jsx("td", {
|
|
650
|
+
className: tableEmptyClass,
|
|
651
|
+
colSpan: structuralColumnCount,
|
|
652
|
+
children: locale?.emptyText ?? "No data"
|
|
653
|
+
})
|
|
654
|
+
}) : pageData.map(renderRow)
|
|
655
|
+
}),
|
|
656
|
+
renderSummary(summary, pageData, structuralColumnCount)
|
|
657
|
+
]
|
|
658
|
+
});
|
|
659
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
660
|
+
...props,
|
|
661
|
+
ref,
|
|
662
|
+
className: getTableWrapperClasses({ loading: spinning, className }),
|
|
663
|
+
children: [
|
|
664
|
+
scroll?.x || scroll?.y ? /* @__PURE__ */ jsx("div", {
|
|
665
|
+
style: {
|
|
666
|
+
overflow: "auto",
|
|
667
|
+
maxHeight: scroll.y,
|
|
668
|
+
width: scroll.x === true ? "100%" : scroll.x
|
|
669
|
+
},
|
|
670
|
+
children: tableNode
|
|
671
|
+
}) : tableNode,
|
|
672
|
+
spinning ? /* @__PURE__ */ jsx("div", {
|
|
673
|
+
className: tableLoadingIndicatorClass,
|
|
674
|
+
role: "status",
|
|
675
|
+
children: typeof loading === "object" && loading.indicator ? loading.indicator : "Loading"
|
|
676
|
+
}) : null,
|
|
677
|
+
paginationConfig && !(paginationConfig.hideOnSinglePage && pageCount <= 1) ? /* @__PURE__ */ jsxs("nav", {
|
|
678
|
+
className: tablePaginationClass,
|
|
679
|
+
"aria-label": "Table pagination",
|
|
680
|
+
children: [
|
|
681
|
+
/* @__PURE__ */ jsx("button", {
|
|
682
|
+
type: "button",
|
|
683
|
+
className: tablePaginationButtonClass,
|
|
684
|
+
disabled: paginationConfig.disabled || current <= 1,
|
|
685
|
+
onClick: () => changePage(current - 1),
|
|
686
|
+
children: "Previous"
|
|
687
|
+
}),
|
|
688
|
+
/* @__PURE__ */ jsx("span", {
|
|
689
|
+
className: tablePaginationInfoClass,
|
|
690
|
+
children: paginationConfig.showTotal ? paginationConfig.showTotal(paginationConfig.total ?? sortedData.length, [
|
|
691
|
+
bodyEmpty ? 0 : (current - 1) * pageSize + 1,
|
|
692
|
+
Math.min(current * pageSize, sortedData.length)
|
|
693
|
+
]) : `${current} / ${pageCount}`
|
|
694
|
+
}),
|
|
695
|
+
/* @__PURE__ */ jsx("button", {
|
|
696
|
+
type: "button",
|
|
697
|
+
className: tablePaginationButtonClass,
|
|
698
|
+
disabled: paginationConfig.disabled || current >= pageCount,
|
|
699
|
+
onClick: () => changePage(current + 1),
|
|
700
|
+
children: "Next"
|
|
701
|
+
})
|
|
702
|
+
]
|
|
703
|
+
}) : null
|
|
704
|
+
]
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
var TableWithRef = forwardRef(TableRoot);
|
|
708
|
+
var Table = Object.assign(TableWithRef, {
|
|
709
|
+
Column,
|
|
710
|
+
ColumnGroup,
|
|
711
|
+
Summary,
|
|
712
|
+
SELECTION_ALL: "SELECT_ALL",
|
|
713
|
+
SELECTION_INVERT: "SELECT_INVERT",
|
|
714
|
+
SELECTION_NONE: "SELECT_NONE",
|
|
715
|
+
SELECTION_COLUMN: "SELECTION_COLUMN",
|
|
716
|
+
EXPAND_COLUMN: "EXPAND_COLUMN"
|
|
717
|
+
});
|
|
718
|
+
Table.displayName = "Table";
|
|
719
|
+
export {
|
|
720
|
+
Table
|
|
721
|
+
};
|