@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,890 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/components/message/Message.tsx
|
|
4
|
+
import React, { useSyncExternalStore } from "react";
|
|
5
|
+
|
|
6
|
+
// ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
7
|
+
function r(e) {
|
|
8
|
+
var t, f, n = "";
|
|
9
|
+
if (typeof e == "string" || typeof e == "number")
|
|
10
|
+
n += e;
|
|
11
|
+
else if (typeof e == "object")
|
|
12
|
+
if (Array.isArray(e)) {
|
|
13
|
+
var o = e.length;
|
|
14
|
+
for (t = 0;t < o; t++)
|
|
15
|
+
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
16
|
+
} else
|
|
17
|
+
for (f in e)
|
|
18
|
+
e[f] && (n && (n += " "), n += f);
|
|
19
|
+
return n;
|
|
20
|
+
}
|
|
21
|
+
function clsx() {
|
|
22
|
+
for (var e, t, f = 0, n = "", o = arguments.length;f < o; f++)
|
|
23
|
+
(e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
24
|
+
return n;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// src/utils/cn.ts
|
|
28
|
+
function cn(...inputs) {
|
|
29
|
+
return clsx(inputs);
|
|
30
|
+
}
|
|
31
|
+
// src/classes/message.ts
|
|
32
|
+
var messageHolderClass = "message-holder";
|
|
33
|
+
var messageBaseClass = "message";
|
|
34
|
+
var messageContentClass = "message-content";
|
|
35
|
+
var messageIconClass = "message-icon";
|
|
36
|
+
var messageCloseClass = "message-close";
|
|
37
|
+
var messageTypeClasses = {
|
|
38
|
+
info: "message-info alert alert-info",
|
|
39
|
+
success: "message-success alert alert-success",
|
|
40
|
+
error: "message-error alert alert-error",
|
|
41
|
+
warning: "message-warning alert alert-warning",
|
|
42
|
+
loading: "message-loading alert"
|
|
43
|
+
};
|
|
44
|
+
var messagePlacementClasses = {
|
|
45
|
+
top: "message-top",
|
|
46
|
+
bottom: "message-bottom"
|
|
47
|
+
};
|
|
48
|
+
function getMessageHolderClasses({
|
|
49
|
+
placement = "top",
|
|
50
|
+
className
|
|
51
|
+
}) {
|
|
52
|
+
return cn(messageHolderClass, messagePlacementClasses[placement], className);
|
|
53
|
+
}
|
|
54
|
+
function getMessageClasses({
|
|
55
|
+
type = "info",
|
|
56
|
+
className
|
|
57
|
+
}) {
|
|
58
|
+
return cn(messageBaseClass, messageTypeClasses[type], className);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// src/components/message/Message.tsx
|
|
62
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
63
|
+
var seed = 0;
|
|
64
|
+
var globalConfig = {
|
|
65
|
+
duration: 3,
|
|
66
|
+
placement: "top"
|
|
67
|
+
};
|
|
68
|
+
var messages = [];
|
|
69
|
+
var listeners = new Set;
|
|
70
|
+
var timers = new Map;
|
|
71
|
+
var snapshot = { messages, config: globalConfig };
|
|
72
|
+
function emit() {
|
|
73
|
+
snapshot = { messages, config: globalConfig };
|
|
74
|
+
for (const listener of listeners) {
|
|
75
|
+
listener();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function subscribe(listener) {
|
|
79
|
+
listeners.add(listener);
|
|
80
|
+
return () => listeners.delete(listener);
|
|
81
|
+
}
|
|
82
|
+
function getSnapshot() {
|
|
83
|
+
return snapshot;
|
|
84
|
+
}
|
|
85
|
+
function normalizeContent(type, content, duration, onClose) {
|
|
86
|
+
if (typeof content === "object" && content !== null && !React.isValidElement(content) && (("content" in content) || ("type" in content) || ("key" in content))) {
|
|
87
|
+
return { type, ...content };
|
|
88
|
+
}
|
|
89
|
+
return { type, content, duration, onClose };
|
|
90
|
+
}
|
|
91
|
+
function makeHandle(key) {
|
|
92
|
+
const promise = Promise.resolve();
|
|
93
|
+
promise.key = key;
|
|
94
|
+
promise.close = () => destroy(key);
|
|
95
|
+
return promise;
|
|
96
|
+
}
|
|
97
|
+
function clearTimer(key) {
|
|
98
|
+
const timer = timers.get(key);
|
|
99
|
+
if (timer) {
|
|
100
|
+
clearTimeout(timer);
|
|
101
|
+
timers.delete(key);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function destroy(key) {
|
|
105
|
+
if (key === undefined) {
|
|
106
|
+
for (const item of messages) {
|
|
107
|
+
clearTimer(item.key);
|
|
108
|
+
item.onClose?.();
|
|
109
|
+
}
|
|
110
|
+
messages = [];
|
|
111
|
+
emit();
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
const targetKey = String(key);
|
|
115
|
+
const target = messages.find((item) => item.key === targetKey);
|
|
116
|
+
clearTimer(targetKey);
|
|
117
|
+
messages = messages.filter((item) => item.key !== targetKey);
|
|
118
|
+
target?.onClose?.();
|
|
119
|
+
emit();
|
|
120
|
+
}
|
|
121
|
+
function open(config) {
|
|
122
|
+
const key = String(config.key ?? `message-${seed += 1}`);
|
|
123
|
+
const duration = config.duration ?? globalConfig.duration;
|
|
124
|
+
const next = {
|
|
125
|
+
key,
|
|
126
|
+
type: config.type ?? "info",
|
|
127
|
+
content: config.content,
|
|
128
|
+
duration,
|
|
129
|
+
className: config.className,
|
|
130
|
+
icon: config.icon,
|
|
131
|
+
onClose: config.onClose
|
|
132
|
+
};
|
|
133
|
+
clearTimer(key);
|
|
134
|
+
messages = messages.filter((item) => item.key !== key).concat(next);
|
|
135
|
+
if (globalConfig.maxCount && messages.length > globalConfig.maxCount) {
|
|
136
|
+
const overflow = messages.slice(0, messages.length - globalConfig.maxCount);
|
|
137
|
+
for (const item of overflow) {
|
|
138
|
+
clearTimer(item.key);
|
|
139
|
+
item.onClose?.();
|
|
140
|
+
}
|
|
141
|
+
messages = messages.slice(-globalConfig.maxCount);
|
|
142
|
+
}
|
|
143
|
+
if (duration > 0) {
|
|
144
|
+
timers.set(key, setTimeout(() => destroy(key), duration * 1000));
|
|
145
|
+
}
|
|
146
|
+
emit();
|
|
147
|
+
return makeHandle(key);
|
|
148
|
+
}
|
|
149
|
+
function typedOpen(type) {
|
|
150
|
+
return (content, duration, onClose) => open(normalizeContent(type, content, duration, onClose));
|
|
151
|
+
}
|
|
152
|
+
function config(nextConfig) {
|
|
153
|
+
globalConfig = { ...globalConfig, ...nextConfig };
|
|
154
|
+
emit();
|
|
155
|
+
}
|
|
156
|
+
function MessageHolder({ className }) {
|
|
157
|
+
const snapshot2 = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
158
|
+
return /* @__PURE__ */ jsx("div", {
|
|
159
|
+
className: getMessageHolderClasses({
|
|
160
|
+
placement: snapshot2.config.placement,
|
|
161
|
+
className
|
|
162
|
+
}),
|
|
163
|
+
children: snapshot2.messages.map((item) => /* @__PURE__ */ jsxs("div", {
|
|
164
|
+
className: getMessageClasses({
|
|
165
|
+
type: item.type,
|
|
166
|
+
className: item.className
|
|
167
|
+
}),
|
|
168
|
+
children: [
|
|
169
|
+
item.icon ? /* @__PURE__ */ jsx("span", {
|
|
170
|
+
className: messageIconClass,
|
|
171
|
+
children: item.icon
|
|
172
|
+
}) : null,
|
|
173
|
+
/* @__PURE__ */ jsx("span", {
|
|
174
|
+
className: messageContentClass,
|
|
175
|
+
children: item.content
|
|
176
|
+
}),
|
|
177
|
+
/* @__PURE__ */ jsx("button", {
|
|
178
|
+
type: "button",
|
|
179
|
+
className: messageCloseClass,
|
|
180
|
+
"aria-label": "Close message",
|
|
181
|
+
onClick: () => destroy(item.key),
|
|
182
|
+
children: "x"
|
|
183
|
+
})
|
|
184
|
+
]
|
|
185
|
+
}, item.key))
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
var apiBase = {
|
|
189
|
+
open,
|
|
190
|
+
success: typedOpen("success"),
|
|
191
|
+
error: typedOpen("error"),
|
|
192
|
+
info: typedOpen("info"),
|
|
193
|
+
warning: typedOpen("warning"),
|
|
194
|
+
loading: typedOpen("loading"),
|
|
195
|
+
destroy,
|
|
196
|
+
config
|
|
197
|
+
};
|
|
198
|
+
var message = {
|
|
199
|
+
...apiBase,
|
|
200
|
+
useMessage: () => [message, /* @__PURE__ */ jsx(MessageHolder, {}, "message-holder")]
|
|
201
|
+
};
|
|
202
|
+
// src/components/modal/Modal.tsx
|
|
203
|
+
import {
|
|
204
|
+
forwardRef,
|
|
205
|
+
useCallback,
|
|
206
|
+
useEffect,
|
|
207
|
+
useRef,
|
|
208
|
+
useState
|
|
209
|
+
} from "react";
|
|
210
|
+
|
|
211
|
+
// src/classes/modal.ts
|
|
212
|
+
var modalBackdropClass = "modal-backdrop";
|
|
213
|
+
var modalOpenClass = "modal-open";
|
|
214
|
+
var modalBackdropCenterClass = "modal-backdrop-center";
|
|
215
|
+
var modalClass = "modal";
|
|
216
|
+
var modalHeaderClass = "modal-header";
|
|
217
|
+
var modalTitleClass = "modal-title";
|
|
218
|
+
var modalCloseClass = "modal-close";
|
|
219
|
+
var modalBodyClass = "modal-body";
|
|
220
|
+
var modalFooterClass = "modal-footer";
|
|
221
|
+
function getModalBackdropClasses({
|
|
222
|
+
open: open2,
|
|
223
|
+
centered,
|
|
224
|
+
className
|
|
225
|
+
}) {
|
|
226
|
+
return cn(modalBackdropClass, open2 && modalOpenClass, centered && modalBackdropCenterClass, className);
|
|
227
|
+
}
|
|
228
|
+
function getModalClasses({ className }) {
|
|
229
|
+
return cn(modalClass, className);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// src/components/modal/Modal.tsx
|
|
233
|
+
import { jsx as jsx2, jsxs as jsxs2, Fragment } from "react/jsx-runtime";
|
|
234
|
+
var defaultCloseIcon = "x";
|
|
235
|
+
var serviceHandles = new Set;
|
|
236
|
+
function createServiceHandle(config2) {
|
|
237
|
+
let currentConfig = config2;
|
|
238
|
+
const handle = {
|
|
239
|
+
destroy: () => {
|
|
240
|
+
serviceHandles.delete(handle);
|
|
241
|
+
},
|
|
242
|
+
update: (nextConfig) => {
|
|
243
|
+
currentConfig = { ...currentConfig, ...nextConfig };
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
serviceHandles.add(handle);
|
|
247
|
+
return handle;
|
|
248
|
+
}
|
|
249
|
+
function getModalStyle({
|
|
250
|
+
width,
|
|
251
|
+
style
|
|
252
|
+
}) {
|
|
253
|
+
return {
|
|
254
|
+
...style,
|
|
255
|
+
...width !== undefined ? { width } : undefined
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
var ModalBase = forwardRef(({
|
|
259
|
+
open: open2,
|
|
260
|
+
defaultOpen = false,
|
|
261
|
+
title,
|
|
262
|
+
children,
|
|
263
|
+
content,
|
|
264
|
+
footer,
|
|
265
|
+
onOk,
|
|
266
|
+
onCancel,
|
|
267
|
+
okText = "OK",
|
|
268
|
+
cancelText = "Cancel",
|
|
269
|
+
confirmLoading,
|
|
270
|
+
closable = true,
|
|
271
|
+
maskClosable = true,
|
|
272
|
+
width,
|
|
273
|
+
centered,
|
|
274
|
+
destroyOnClose,
|
|
275
|
+
afterOpenChange,
|
|
276
|
+
className,
|
|
277
|
+
maskClassName,
|
|
278
|
+
closeIcon = defaultCloseIcon,
|
|
279
|
+
style,
|
|
280
|
+
role = "dialog",
|
|
281
|
+
...props
|
|
282
|
+
}, ref) => {
|
|
283
|
+
const controlled = open2 !== undefined;
|
|
284
|
+
const [innerOpen, setInnerOpen] = useState(defaultOpen);
|
|
285
|
+
const mergedOpen = controlled ? Boolean(open2) : innerOpen;
|
|
286
|
+
const previousOpen = useRef(mergedOpen);
|
|
287
|
+
const showClose = closable && closeIcon !== null && closeIcon !== false;
|
|
288
|
+
const body = children ?? content;
|
|
289
|
+
useEffect(() => {
|
|
290
|
+
if (previousOpen.current === mergedOpen) {
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
previousOpen.current = mergedOpen;
|
|
294
|
+
afterOpenChange?.(mergedOpen);
|
|
295
|
+
}, [afterOpenChange, mergedOpen]);
|
|
296
|
+
const close = useCallback((event) => {
|
|
297
|
+
if (!controlled) {
|
|
298
|
+
setInnerOpen(false);
|
|
299
|
+
}
|
|
300
|
+
onCancel?.(event);
|
|
301
|
+
}, [controlled, onCancel]);
|
|
302
|
+
const handleOk = useCallback((event) => {
|
|
303
|
+
onOk?.(event);
|
|
304
|
+
}, [onOk]);
|
|
305
|
+
const handleMaskClick = useCallback((event) => {
|
|
306
|
+
if (event.target !== event.currentTarget || !maskClosable) {
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
close(event);
|
|
310
|
+
}, [close, maskClosable]);
|
|
311
|
+
if (!mergedOpen && destroyOnClose) {
|
|
312
|
+
return null;
|
|
313
|
+
}
|
|
314
|
+
return /* @__PURE__ */ jsx2("div", {
|
|
315
|
+
"aria-hidden": mergedOpen ? undefined : true,
|
|
316
|
+
role: "presentation",
|
|
317
|
+
className: getModalBackdropClasses({
|
|
318
|
+
open: mergedOpen,
|
|
319
|
+
centered,
|
|
320
|
+
className: maskClassName
|
|
321
|
+
}),
|
|
322
|
+
onMouseDown: handleMaskClick,
|
|
323
|
+
children: /* @__PURE__ */ jsxs2("div", {
|
|
324
|
+
...props,
|
|
325
|
+
ref,
|
|
326
|
+
role,
|
|
327
|
+
"aria-modal": mergedOpen ? true : undefined,
|
|
328
|
+
className: getModalClasses({ className }),
|
|
329
|
+
style: getModalStyle({ width, style }),
|
|
330
|
+
children: [
|
|
331
|
+
title !== undefined || showClose ? /* @__PURE__ */ jsxs2("div", {
|
|
332
|
+
className: modalHeaderClass,
|
|
333
|
+
children: [
|
|
334
|
+
title !== undefined ? /* @__PURE__ */ jsx2("h2", {
|
|
335
|
+
className: modalTitleClass,
|
|
336
|
+
children: title
|
|
337
|
+
}) : null,
|
|
338
|
+
showClose ? /* @__PURE__ */ jsx2("button", {
|
|
339
|
+
type: "button",
|
|
340
|
+
className: modalCloseClass,
|
|
341
|
+
"aria-label": "Close",
|
|
342
|
+
onClick: close,
|
|
343
|
+
children: closeIcon
|
|
344
|
+
}) : null
|
|
345
|
+
]
|
|
346
|
+
}) : null,
|
|
347
|
+
/* @__PURE__ */ jsx2("div", {
|
|
348
|
+
className: modalBodyClass,
|
|
349
|
+
children: body
|
|
350
|
+
}),
|
|
351
|
+
footer === null ? null : /* @__PURE__ */ jsx2("div", {
|
|
352
|
+
className: modalFooterClass,
|
|
353
|
+
children: footer !== undefined ? footer : /* @__PURE__ */ jsxs2(Fragment, {
|
|
354
|
+
children: [
|
|
355
|
+
/* @__PURE__ */ jsx2("button", {
|
|
356
|
+
type: "button",
|
|
357
|
+
onClick: close,
|
|
358
|
+
children: cancelText
|
|
359
|
+
}),
|
|
360
|
+
/* @__PURE__ */ jsx2("button", {
|
|
361
|
+
type: "button",
|
|
362
|
+
"aria-busy": confirmLoading,
|
|
363
|
+
disabled: confirmLoading,
|
|
364
|
+
onClick: handleOk,
|
|
365
|
+
children: okText
|
|
366
|
+
})
|
|
367
|
+
]
|
|
368
|
+
})
|
|
369
|
+
})
|
|
370
|
+
]
|
|
371
|
+
})
|
|
372
|
+
});
|
|
373
|
+
});
|
|
374
|
+
ModalBase.displayName = "Modal";
|
|
375
|
+
var Modal = ModalBase;
|
|
376
|
+
Modal.confirm = createServiceHandle;
|
|
377
|
+
Modal.info = createServiceHandle;
|
|
378
|
+
Modal.success = createServiceHandle;
|
|
379
|
+
Modal.error = createServiceHandle;
|
|
380
|
+
Modal.warning = createServiceHandle;
|
|
381
|
+
Modal.destroyAll = () => {
|
|
382
|
+
for (const handle of Array.from(serviceHandles)) {
|
|
383
|
+
handle.destroy();
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
// src/components/notification/Notification.tsx
|
|
387
|
+
import {
|
|
388
|
+
useCallback as useCallback2,
|
|
389
|
+
useEffect as useEffect2,
|
|
390
|
+
useMemo,
|
|
391
|
+
useState as useState2
|
|
392
|
+
} from "react";
|
|
393
|
+
import { createRoot } from "react-dom/client";
|
|
394
|
+
|
|
395
|
+
// src/classes/notification.ts
|
|
396
|
+
var notificationRootClass = "notification-root";
|
|
397
|
+
var notificationHolderClass = "notification-holder";
|
|
398
|
+
var notificationNoticeClass = "notification-notice";
|
|
399
|
+
var notificationNoticeOpenClass = "notification-notice-open";
|
|
400
|
+
var notificationIconClass = "notification-icon";
|
|
401
|
+
var notificationContentClass = "notification-content";
|
|
402
|
+
var notificationMessageClass = "notification-message";
|
|
403
|
+
var notificationDescriptionClass = "notification-description";
|
|
404
|
+
var notificationActionsClass = "notification-actions";
|
|
405
|
+
var notificationCloseClass = "notification-close";
|
|
406
|
+
var notificationPlacementClasses = {
|
|
407
|
+
top: "notification-top",
|
|
408
|
+
topLeft: "notification-top-left",
|
|
409
|
+
topRight: "notification-top-right",
|
|
410
|
+
bottom: "notification-bottom",
|
|
411
|
+
bottomLeft: "notification-bottom-left",
|
|
412
|
+
bottomRight: "notification-bottom-right"
|
|
413
|
+
};
|
|
414
|
+
var notificationTypeClasses = {
|
|
415
|
+
info: "toast-info alert-info",
|
|
416
|
+
success: "toast-success alert-success",
|
|
417
|
+
error: "toast-error alert-error",
|
|
418
|
+
warning: "toast-warning alert-warning"
|
|
419
|
+
};
|
|
420
|
+
function getNotificationHolderClasses({
|
|
421
|
+
placement,
|
|
422
|
+
className
|
|
423
|
+
}) {
|
|
424
|
+
return cn(notificationHolderClass, notificationPlacementClasses[placement], className);
|
|
425
|
+
}
|
|
426
|
+
function getNotificationNoticeClasses({
|
|
427
|
+
type = "info",
|
|
428
|
+
open: open2 = true,
|
|
429
|
+
className
|
|
430
|
+
}) {
|
|
431
|
+
return cn("toast", "alert", notificationNoticeClass, notificationTypeClasses[type], open2 && "toast-show", open2 && notificationNoticeOpenClass, className);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
// src/components/notification/Notification.tsx
|
|
435
|
+
import { jsx as jsx3, jsxs as jsxs3, Fragment as Fragment2 } from "react/jsx-runtime";
|
|
436
|
+
var defaultConfig = {
|
|
437
|
+
placement: "topRight",
|
|
438
|
+
duration: 4.5
|
|
439
|
+
};
|
|
440
|
+
var defaultIcons = {
|
|
441
|
+
info: "i",
|
|
442
|
+
success: "✓",
|
|
443
|
+
warning: "!",
|
|
444
|
+
error: "!"
|
|
445
|
+
};
|
|
446
|
+
var globalConfig2 = { ...defaultConfig };
|
|
447
|
+
var globalNotices = [];
|
|
448
|
+
var globalCounter = 0;
|
|
449
|
+
var globalContainer = null;
|
|
450
|
+
var globalRoot = null;
|
|
451
|
+
var globalTimers = new Map;
|
|
452
|
+
var listeners2 = new Set;
|
|
453
|
+
function getKey(key) {
|
|
454
|
+
if (key !== undefined) {
|
|
455
|
+
return key;
|
|
456
|
+
}
|
|
457
|
+
globalCounter += 1;
|
|
458
|
+
return `notification-${globalCounter}`;
|
|
459
|
+
}
|
|
460
|
+
function getDuration(config2, holderConfig) {
|
|
461
|
+
return config2.duration ?? holderConfig.duration ?? defaultConfig.duration;
|
|
462
|
+
}
|
|
463
|
+
function getPlacement(config2, holderConfig) {
|
|
464
|
+
return config2.placement ?? holderConfig.placement ?? defaultConfig.placement;
|
|
465
|
+
}
|
|
466
|
+
function applyMaxCount(notices, maxCount) {
|
|
467
|
+
if (!maxCount || notices.length <= maxCount) {
|
|
468
|
+
return notices;
|
|
469
|
+
}
|
|
470
|
+
return notices.slice(notices.length - maxCount);
|
|
471
|
+
}
|
|
472
|
+
function groupByPlacement(notices) {
|
|
473
|
+
return notices.reduce((groups, notice) => {
|
|
474
|
+
groups[notice.placement].push(notice);
|
|
475
|
+
return groups;
|
|
476
|
+
}, {
|
|
477
|
+
top: [],
|
|
478
|
+
topLeft: [],
|
|
479
|
+
topRight: [],
|
|
480
|
+
bottom: [],
|
|
481
|
+
bottomLeft: [],
|
|
482
|
+
bottomRight: []
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
function clearTimer2(key) {
|
|
486
|
+
const timer = globalTimers.get(key);
|
|
487
|
+
if (timer) {
|
|
488
|
+
clearTimeout(timer);
|
|
489
|
+
globalTimers.delete(key);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
function emitGlobal() {
|
|
493
|
+
for (const listener of listeners2) {
|
|
494
|
+
listener(globalNotices, globalConfig2);
|
|
495
|
+
}
|
|
496
|
+
renderGlobalHolder();
|
|
497
|
+
}
|
|
498
|
+
function ensureGlobalRoot() {
|
|
499
|
+
if (typeof document === "undefined") {
|
|
500
|
+
return;
|
|
501
|
+
}
|
|
502
|
+
if (globalRoot && globalContainer?.isConnected) {
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
const container = globalConfig2.getContainer?.() ?? document.body;
|
|
506
|
+
globalContainer = document.createElement("div");
|
|
507
|
+
globalContainer.className = notificationRootClass;
|
|
508
|
+
container.appendChild(globalContainer);
|
|
509
|
+
globalRoot = createRoot(globalContainer);
|
|
510
|
+
}
|
|
511
|
+
function renderGlobalHolder() {
|
|
512
|
+
if (globalNotices.length === 0 && globalRoot && globalContainer) {
|
|
513
|
+
globalRoot.render(null);
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
ensureGlobalRoot();
|
|
517
|
+
globalRoot?.render(/* @__PURE__ */ jsx3(NotificationHolder, {
|
|
518
|
+
notices: globalNotices,
|
|
519
|
+
config: globalConfig2,
|
|
520
|
+
onClose: (key) => globalApi.close(key)
|
|
521
|
+
}));
|
|
522
|
+
}
|
|
523
|
+
function closeGlobal(key) {
|
|
524
|
+
const notice = globalNotices.find((item) => item.key === key);
|
|
525
|
+
clearTimer2(key);
|
|
526
|
+
globalNotices = globalNotices.filter((item) => item.key !== key);
|
|
527
|
+
notice?.onClose?.();
|
|
528
|
+
emitGlobal();
|
|
529
|
+
}
|
|
530
|
+
function destroyGlobal(key) {
|
|
531
|
+
if (key !== undefined) {
|
|
532
|
+
closeGlobal(key);
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
535
|
+
for (const notice of globalNotices) {
|
|
536
|
+
clearTimer2(notice.key);
|
|
537
|
+
notice.onClose?.();
|
|
538
|
+
}
|
|
539
|
+
globalNotices = [];
|
|
540
|
+
emitGlobal();
|
|
541
|
+
}
|
|
542
|
+
function openGlobal(config2) {
|
|
543
|
+
const key = getKey(config2.key);
|
|
544
|
+
const notice = {
|
|
545
|
+
...config2,
|
|
546
|
+
key,
|
|
547
|
+
placement: getPlacement(config2, globalConfig2),
|
|
548
|
+
type: config2.type ?? "info"
|
|
549
|
+
};
|
|
550
|
+
clearTimer2(key);
|
|
551
|
+
globalNotices = applyMaxCount([...globalNotices.filter((item) => item.key !== key), notice], globalConfig2.maxCount);
|
|
552
|
+
const duration = getDuration(config2, globalConfig2);
|
|
553
|
+
if (duration && duration > 0) {
|
|
554
|
+
globalTimers.set(key, setTimeout(() => closeGlobal(key), duration * 1000));
|
|
555
|
+
}
|
|
556
|
+
emitGlobal();
|
|
557
|
+
}
|
|
558
|
+
function withType(type, config2) {
|
|
559
|
+
openGlobal({ ...config2, type });
|
|
560
|
+
}
|
|
561
|
+
var globalApi = {
|
|
562
|
+
open: openGlobal,
|
|
563
|
+
success: (config2) => withType("success", config2),
|
|
564
|
+
info: (config2) => withType("info", config2),
|
|
565
|
+
warning: (config2) => withType("warning", config2),
|
|
566
|
+
error: (config2) => withType("error", config2),
|
|
567
|
+
close: closeGlobal,
|
|
568
|
+
destroy: destroyGlobal,
|
|
569
|
+
config: (config2) => {
|
|
570
|
+
globalConfig2 = { ...globalConfig2, ...config2 };
|
|
571
|
+
emitGlobal();
|
|
572
|
+
},
|
|
573
|
+
useNotification
|
|
574
|
+
};
|
|
575
|
+
function NotificationHolder({
|
|
576
|
+
notices,
|
|
577
|
+
config: config2,
|
|
578
|
+
onClose
|
|
579
|
+
}) {
|
|
580
|
+
const groups = groupByPlacement(notices);
|
|
581
|
+
return /* @__PURE__ */ jsx3(Fragment2, {
|
|
582
|
+
children: Object.entries(groups).map(([placement, group]) => {
|
|
583
|
+
if (group.length === 0) {
|
|
584
|
+
return null;
|
|
585
|
+
}
|
|
586
|
+
const offsetStyle = placement.startsWith("bottom") && config2.bottom !== undefined ? { bottom: config2.bottom } : config2.top !== undefined ? { top: config2.top } : undefined;
|
|
587
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
588
|
+
className: getNotificationHolderClasses({
|
|
589
|
+
placement
|
|
590
|
+
}),
|
|
591
|
+
style: offsetStyle,
|
|
592
|
+
children: group.map((notice) => /* @__PURE__ */ jsx3(NotificationNotice, {
|
|
593
|
+
notice,
|
|
594
|
+
fallbackCloseIcon: config2.closeIcon,
|
|
595
|
+
onClose
|
|
596
|
+
}, notice.key))
|
|
597
|
+
}, placement);
|
|
598
|
+
})
|
|
599
|
+
});
|
|
600
|
+
}
|
|
601
|
+
function NotificationNotice({
|
|
602
|
+
notice,
|
|
603
|
+
fallbackCloseIcon,
|
|
604
|
+
onClose
|
|
605
|
+
}) {
|
|
606
|
+
const closeIcon = notice.closeIcon ?? fallbackCloseIcon ?? "x";
|
|
607
|
+
const icon = notice.icon ?? defaultIcons[notice.type];
|
|
608
|
+
const clickableProps = notice.onClick ? {
|
|
609
|
+
tabIndex: 0,
|
|
610
|
+
onClick: notice.onClick,
|
|
611
|
+
onKeyDown: (event) => {
|
|
612
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
613
|
+
event.preventDefault();
|
|
614
|
+
notice.onClick?.();
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
} : undefined;
|
|
618
|
+
return /* @__PURE__ */ jsxs3("div", {
|
|
619
|
+
role: notice.role ?? "alert",
|
|
620
|
+
className: getNotificationNoticeClasses({
|
|
621
|
+
type: notice.type,
|
|
622
|
+
className: notice.className
|
|
623
|
+
}),
|
|
624
|
+
style: notice.style,
|
|
625
|
+
...clickableProps,
|
|
626
|
+
children: [
|
|
627
|
+
icon ? /* @__PURE__ */ jsx3("span", {
|
|
628
|
+
className: notificationIconClass,
|
|
629
|
+
children: icon
|
|
630
|
+
}) : null,
|
|
631
|
+
/* @__PURE__ */ jsxs3("span", {
|
|
632
|
+
className: notificationContentClass,
|
|
633
|
+
children: [
|
|
634
|
+
/* @__PURE__ */ jsx3("span", {
|
|
635
|
+
className: notificationMessageClass,
|
|
636
|
+
children: notice.message
|
|
637
|
+
}),
|
|
638
|
+
notice.description ? /* @__PURE__ */ jsx3("span", {
|
|
639
|
+
className: notificationDescriptionClass,
|
|
640
|
+
children: notice.description
|
|
641
|
+
}) : null,
|
|
642
|
+
notice.btn ? /* @__PURE__ */ jsx3("span", {
|
|
643
|
+
className: notificationActionsClass,
|
|
644
|
+
children: notice.btn
|
|
645
|
+
}) : null
|
|
646
|
+
]
|
|
647
|
+
}),
|
|
648
|
+
closeIcon === null ? null : /* @__PURE__ */ jsx3("button", {
|
|
649
|
+
type: "button",
|
|
650
|
+
className: notificationCloseClass,
|
|
651
|
+
"aria-label": "Close notification",
|
|
652
|
+
onClick: (event) => {
|
|
653
|
+
event.stopPropagation();
|
|
654
|
+
onClose(notice.key);
|
|
655
|
+
},
|
|
656
|
+
children: closeIcon
|
|
657
|
+
})
|
|
658
|
+
]
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
function createScopedApi({
|
|
662
|
+
holderConfig,
|
|
663
|
+
setNotices,
|
|
664
|
+
timerMap
|
|
665
|
+
}) {
|
|
666
|
+
function clearScopedTimer(key) {
|
|
667
|
+
const timer = timerMap.get(key);
|
|
668
|
+
if (timer) {
|
|
669
|
+
clearTimeout(timer);
|
|
670
|
+
timerMap.delete(key);
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
function close(key) {
|
|
674
|
+
clearScopedTimer(key);
|
|
675
|
+
setNotices((current) => {
|
|
676
|
+
const notice = current.find((item) => item.key === key);
|
|
677
|
+
notice?.onClose?.();
|
|
678
|
+
return current.filter((item) => item.key !== key);
|
|
679
|
+
});
|
|
680
|
+
}
|
|
681
|
+
function open2(config2) {
|
|
682
|
+
const key = getKey(config2.key);
|
|
683
|
+
const notice = {
|
|
684
|
+
...config2,
|
|
685
|
+
key,
|
|
686
|
+
placement: getPlacement(config2, holderConfig),
|
|
687
|
+
type: config2.type ?? "info"
|
|
688
|
+
};
|
|
689
|
+
clearScopedTimer(key);
|
|
690
|
+
setNotices((current) => applyMaxCount([...current.filter((item) => item.key !== key), notice], holderConfig.maxCount));
|
|
691
|
+
const duration = getDuration(config2, holderConfig);
|
|
692
|
+
if (duration && duration > 0) {
|
|
693
|
+
timerMap.set(key, setTimeout(() => close(key), duration * 1000));
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
function typed(type, config2) {
|
|
697
|
+
open2({ ...config2, type });
|
|
698
|
+
}
|
|
699
|
+
return {
|
|
700
|
+
open: open2,
|
|
701
|
+
success: (config2) => typed("success", config2),
|
|
702
|
+
info: (config2) => typed("info", config2),
|
|
703
|
+
warning: (config2) => typed("warning", config2),
|
|
704
|
+
error: (config2) => typed("error", config2),
|
|
705
|
+
close,
|
|
706
|
+
destroy: (key) => {
|
|
707
|
+
if (key !== undefined) {
|
|
708
|
+
close(key);
|
|
709
|
+
return;
|
|
710
|
+
}
|
|
711
|
+
for (const timerKey of timerMap.keys()) {
|
|
712
|
+
clearScopedTimer(timerKey);
|
|
713
|
+
}
|
|
714
|
+
setNotices((current) => {
|
|
715
|
+
for (const notice of current) {
|
|
716
|
+
notice.onClose?.();
|
|
717
|
+
}
|
|
718
|
+
return [];
|
|
719
|
+
});
|
|
720
|
+
}
|
|
721
|
+
};
|
|
722
|
+
}
|
|
723
|
+
function useNotification(config2 = {}) {
|
|
724
|
+
const holderConfig = useMemo(() => ({
|
|
725
|
+
...defaultConfig,
|
|
726
|
+
bottom: config2.bottom,
|
|
727
|
+
closeIcon: config2.closeIcon,
|
|
728
|
+
duration: config2.duration ?? defaultConfig.duration,
|
|
729
|
+
getContainer: config2.getContainer,
|
|
730
|
+
maxCount: config2.maxCount,
|
|
731
|
+
placement: config2.placement ?? defaultConfig.placement,
|
|
732
|
+
top: config2.top
|
|
733
|
+
}), [
|
|
734
|
+
config2.bottom,
|
|
735
|
+
config2.closeIcon,
|
|
736
|
+
config2.duration,
|
|
737
|
+
config2.getContainer,
|
|
738
|
+
config2.maxCount,
|
|
739
|
+
config2.placement,
|
|
740
|
+
config2.top
|
|
741
|
+
]);
|
|
742
|
+
const [notices, setNotices] = useState2([]);
|
|
743
|
+
const [timerMap] = useState2(() => new Map);
|
|
744
|
+
const close = useCallback2((key) => {
|
|
745
|
+
const timer = timerMap.get(key);
|
|
746
|
+
if (timer) {
|
|
747
|
+
clearTimeout(timer);
|
|
748
|
+
timerMap.delete(key);
|
|
749
|
+
}
|
|
750
|
+
setNotices((current) => {
|
|
751
|
+
const notice = current.find((item) => item.key === key);
|
|
752
|
+
notice?.onClose?.();
|
|
753
|
+
return current.filter((item) => item.key !== key);
|
|
754
|
+
});
|
|
755
|
+
}, [timerMap]);
|
|
756
|
+
const api = useMemo(() => createScopedApi({ holderConfig, setNotices, timerMap }), [holderConfig, timerMap]);
|
|
757
|
+
useEffect2(() => {
|
|
758
|
+
return () => {
|
|
759
|
+
for (const timer of timerMap.values()) {
|
|
760
|
+
clearTimeout(timer);
|
|
761
|
+
}
|
|
762
|
+
timerMap.clear();
|
|
763
|
+
};
|
|
764
|
+
}, [timerMap]);
|
|
765
|
+
return [
|
|
766
|
+
api,
|
|
767
|
+
/* @__PURE__ */ jsx3(NotificationHolder, {
|
|
768
|
+
notices,
|
|
769
|
+
config: holderConfig,
|
|
770
|
+
onClose: close
|
|
771
|
+
}, "notification-holder")
|
|
772
|
+
];
|
|
773
|
+
}
|
|
774
|
+
var notification = globalApi;
|
|
775
|
+
// src/components/app/App.tsx
|
|
776
|
+
import {
|
|
777
|
+
createContext,
|
|
778
|
+
forwardRef as forwardRef2,
|
|
779
|
+
useContext,
|
|
780
|
+
useEffect as useEffect3,
|
|
781
|
+
useMemo as useMemo2
|
|
782
|
+
} from "react";
|
|
783
|
+
|
|
784
|
+
// src/classes/app.ts
|
|
785
|
+
var appClass = "app";
|
|
786
|
+
var appRootClass = "app-root";
|
|
787
|
+
var appHolderClass = "app-holder";
|
|
788
|
+
function getAppClasses({
|
|
789
|
+
className
|
|
790
|
+
}) {
|
|
791
|
+
return cn(appClass, className);
|
|
792
|
+
}
|
|
793
|
+
function getAppRootClasses({
|
|
794
|
+
className
|
|
795
|
+
}) {
|
|
796
|
+
return cn(appRootClass, className);
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
// src/components/app/App.tsx
|
|
800
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
801
|
+
var fallbackContext = {
|
|
802
|
+
message,
|
|
803
|
+
notification: {
|
|
804
|
+
open: () => {
|
|
805
|
+
return;
|
|
806
|
+
},
|
|
807
|
+
success: () => {
|
|
808
|
+
return;
|
|
809
|
+
},
|
|
810
|
+
info: () => {
|
|
811
|
+
return;
|
|
812
|
+
},
|
|
813
|
+
warning: () => {
|
|
814
|
+
return;
|
|
815
|
+
},
|
|
816
|
+
error: () => {
|
|
817
|
+
return;
|
|
818
|
+
},
|
|
819
|
+
close: () => {
|
|
820
|
+
return;
|
|
821
|
+
},
|
|
822
|
+
destroy: () => {
|
|
823
|
+
return;
|
|
824
|
+
}
|
|
825
|
+
},
|
|
826
|
+
modal: Modal
|
|
827
|
+
};
|
|
828
|
+
var AppContext = createContext(fallbackContext);
|
|
829
|
+
var AppBase = forwardRef2(({
|
|
830
|
+
children,
|
|
831
|
+
className,
|
|
832
|
+
component: Component = "div",
|
|
833
|
+
message: messageConfig,
|
|
834
|
+
notification: notificationConfig,
|
|
835
|
+
...props
|
|
836
|
+
}, ref) => {
|
|
837
|
+
const [messageApi, messageHolder] = message.useMessage();
|
|
838
|
+
const [notificationApi, notificationHolder] = useNotification(notificationConfig);
|
|
839
|
+
const contextValue = useMemo2(() => ({
|
|
840
|
+
message: messageApi,
|
|
841
|
+
notification: notificationApi,
|
|
842
|
+
modal: Modal
|
|
843
|
+
}), [messageApi, notificationApi]);
|
|
844
|
+
useEffect3(() => {
|
|
845
|
+
if (messageConfig) {
|
|
846
|
+
messageApi.config(messageConfig);
|
|
847
|
+
}
|
|
848
|
+
}, [messageApi, messageConfig]);
|
|
849
|
+
const content = /* @__PURE__ */ jsxs4(AppContext.Provider, {
|
|
850
|
+
value: contextValue,
|
|
851
|
+
children: [
|
|
852
|
+
children,
|
|
853
|
+
/* @__PURE__ */ jsxs4("div", {
|
|
854
|
+
className: appHolderClass,
|
|
855
|
+
children: [
|
|
856
|
+
messageHolder,
|
|
857
|
+
notificationHolder
|
|
858
|
+
]
|
|
859
|
+
})
|
|
860
|
+
]
|
|
861
|
+
});
|
|
862
|
+
if (Component === false) {
|
|
863
|
+
return content;
|
|
864
|
+
}
|
|
865
|
+
const Root = Component;
|
|
866
|
+
return /* @__PURE__ */ jsx4(Root, {
|
|
867
|
+
...props,
|
|
868
|
+
ref,
|
|
869
|
+
className: getAppClasses({ className }),
|
|
870
|
+
children: content
|
|
871
|
+
});
|
|
872
|
+
});
|
|
873
|
+
AppBase.displayName = "App";
|
|
874
|
+
var App = AppBase;
|
|
875
|
+
App.Context = AppContext;
|
|
876
|
+
App.useApp = () => useContext(AppContext);
|
|
877
|
+
function AppRoot({
|
|
878
|
+
className,
|
|
879
|
+
...props
|
|
880
|
+
}) {
|
|
881
|
+
return /* @__PURE__ */ jsx4("div", {
|
|
882
|
+
...props,
|
|
883
|
+
className: getAppRootClasses({ className })
|
|
884
|
+
});
|
|
885
|
+
}
|
|
886
|
+
export {
|
|
887
|
+
AppRoot,
|
|
888
|
+
AppContext,
|
|
889
|
+
App
|
|
890
|
+
};
|