@duskmoon-dev/components 0.6.4 → 2.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-rd10x4gc.js → chunk-kpm1rq54.js} +9 -9
- package/dist/{chunk-fwjzvsrx.js → chunk-q5qdwm90.js} +4 -4
- package/dist/{chunk-kg46s2vk.js → chunk-yxp9gq2h.js} +11 -4
- package/dist/classes/alert.d.ts +1 -1
- package/dist/classes/auto-complete.d.ts +1 -1
- package/dist/classes/avatar.d.ts +1 -1
- package/dist/classes/badge.d.ts +1 -1
- package/dist/classes/button.d.ts +1 -1
- package/dist/classes/calendar.d.ts +1 -1
- package/dist/classes/card.d.ts +1 -1
- package/dist/classes/carousel.d.ts +1 -1
- package/dist/classes/cascader.d.ts +1 -1
- package/dist/classes/chat.d.ts +1 -1
- package/dist/classes/checkbox.d.ts +1 -1
- package/dist/classes/collapse.d.ts +1 -1
- package/dist/classes/color-picker.d.ts +1 -1
- package/dist/classes/date-picker.d.ts +1 -1
- package/dist/classes/descriptions.d.ts +1 -1
- package/dist/classes/divider.d.ts +1 -1
- package/dist/classes/dm-query.d.ts +1 -1
- package/dist/classes/dm-splitter.d.ts +1 -1
- package/dist/classes/dm-status.d.ts +1 -1
- package/dist/classes/dm-tabs.d.ts +1 -1
- package/dist/classes/drawer.d.ts +1 -1
- package/dist/classes/dropdown.d.ts +1 -1
- package/dist/classes/float-button.d.ts +1 -1
- package/dist/classes/index.d.ts +99 -99
- package/dist/classes/index.js +182 -182
- package/dist/classes/input-number.d.ts +1 -1
- package/dist/classes/input.d.ts +1 -1
- package/dist/classes/list.d.ts +1 -1
- package/dist/classes/mentions.d.ts +1 -1
- package/dist/classes/menu.d.ts +1 -1
- package/dist/classes/message.d.ts +1 -1
- package/dist/classes/notification.d.ts +1 -1
- package/dist/classes/otp-input.d.ts +1 -1
- package/dist/classes/pagination.d.ts +1 -1
- package/dist/classes/popconfirm.d.ts +1 -1
- package/dist/classes/popover.d.ts +1 -1
- package/dist/classes/progress.d.ts +1 -1
- package/dist/classes/qr-code.d.ts +1 -1
- package/dist/classes/radio.d.ts +1 -1
- package/dist/classes/rate.d.ts +1 -1
- package/dist/classes/result.d.ts +1 -1
- package/dist/classes/row.d.ts +1 -1
- package/dist/classes/segmented.d.ts +1 -1
- package/dist/classes/select.d.ts +1 -1
- package/dist/classes/skeleton.d.ts +1 -1
- package/dist/classes/slider.d.ts +1 -1
- package/dist/classes/space.d.ts +1 -1
- package/dist/classes/spin.d.ts +1 -1
- package/dist/classes/splitter.d.ts +1 -1
- package/dist/classes/steps.d.ts +1 -1
- package/dist/classes/switch.d.ts +1 -1
- package/dist/classes/tabs.d.ts +1 -1
- package/dist/classes/tag.d.ts +1 -1
- package/dist/classes/time-picker.d.ts +1 -1
- package/dist/classes/timeline.d.ts +1 -1
- package/dist/classes/tooltip.d.ts +1 -1
- package/dist/classes/tour.d.ts +1 -1
- package/dist/classes/typography.d.ts +1 -1
- package/dist/classes/upload.d.ts +1 -1
- package/dist/components/affix/Affix.d.ts +1 -1
- package/dist/components/affix/index.d.ts +2 -2
- package/dist/components/affix/index.js +1 -1
- package/dist/components/alert/Alert.d.ts +1 -1
- package/dist/components/alert/index.d.ts +2 -2
- package/dist/components/alert/index.js +1 -1
- package/dist/components/anchor/Anchor.d.ts +1 -1
- package/dist/components/anchor/index.d.ts +2 -2
- package/dist/components/anchor/index.js +1 -1
- package/dist/components/app/App.d.ts +2 -2
- package/dist/components/app/App.types.d.ts +3 -3
- package/dist/components/app/index.d.ts +2 -2
- package/dist/components/app/index.js +82 -82
- package/dist/components/auto-complete/AutoComplete.d.ts +1 -1
- package/dist/components/auto-complete/index.d.ts +2 -2
- package/dist/components/auto-complete/index.js +1 -1
- package/dist/components/avatar/Avatar.d.ts +1 -1
- package/dist/components/avatar/index.d.ts +2 -2
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/back-top/BackTop.d.ts +1 -1
- package/dist/components/back-top/index.d.ts +2 -2
- package/dist/components/back-top/index.js +1 -1
- package/dist/components/badge/Badge.d.ts +1 -1
- package/dist/components/badge/index.d.ts +2 -2
- package/dist/components/badge/index.js +1 -1
- package/dist/components/breadcrumb/Breadcrumb.d.ts +1 -1
- package/dist/components/breadcrumb/index.d.ts +2 -2
- package/dist/components/breadcrumb/index.js +1 -1
- package/dist/components/button/Button.d.ts +1 -1
- package/dist/components/button/index.d.ts +2 -2
- package/dist/components/button/index.js +1 -1
- package/dist/components/calendar/Calendar.d.ts +1 -1
- package/dist/components/calendar/index.d.ts +2 -2
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/card/Card.d.ts +1 -1
- package/dist/components/card/index.d.ts +2 -2
- package/dist/components/card/index.js +1 -1
- package/dist/components/carousel/Carousel.d.ts +1 -1
- package/dist/components/carousel/index.d.ts +2 -2
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/cascader/Cascader.d.ts +1 -1
- package/dist/components/cascader/index.d.ts +2 -2
- package/dist/components/cascader/index.js +3 -3
- package/dist/components/chat/Chat.d.ts +1 -1
- package/dist/components/chat/Chat.types.d.ts +5 -5
- package/dist/components/chat/ChatAuthoritativeQueue.d.ts +1 -1
- package/dist/components/chat/ChatComposer.d.ts +1 -1
- package/dist/components/chat/ChatPrimitives.d.ts +1 -1
- package/dist/components/chat/ChatSessionComposer.d.ts +2 -2
- package/dist/components/chat/ChatSessionComposer.types.d.ts +6 -6
- package/dist/components/chat/ComposerAttachment.types.d.ts +1 -1
- package/dist/components/chat/ComposerDraft.types.d.ts +1 -1
- package/dist/components/chat/ComposerProvider.types.d.ts +1 -1
- package/dist/components/chat/ComposerQueue.types.d.ts +1 -1
- package/dist/components/chat/ComposerSession.types.d.ts +1 -1
- package/dist/components/chat/ComposerSettings.d.ts +1 -1
- package/dist/components/chat/ComposerSettingsMenus.d.ts +1 -1
- package/dist/components/chat/composer/CompletionList.d.ts +1 -1
- package/dist/components/chat/composer/ComposerShell.d.ts +2 -2
- package/dist/components/chat/composer/DraftLifecycle.d.ts +3 -3
- package/dist/components/chat/composer/EditorAdapter.types.d.ts +2 -2
- package/dist/components/chat/composer/PlainEditor.d.ts +1 -1
- package/dist/components/chat/composer/PlainSemanticEditor.d.ts +2 -2
- package/dist/components/chat/composer/SemanticComposer.d.ts +2 -2
- package/dist/components/chat/composer/attachments.d.ts +1 -1
- package/dist/components/chat/composer/compatibility.types.d.ts +2 -2
- package/dist/components/chat/composer/document.d.ts +1 -1
- package/dist/components/chat/composer/drafts.d.ts +1 -1
- package/dist/components/chat/composer/legacy.d.ts +1 -1
- package/dist/components/chat/composer/providers.d.ts +2 -2
- package/dist/components/chat/composer/session.d.ts +2 -2
- package/dist/components/chat/composer/useComposerAttachments.d.ts +1 -1
- package/dist/components/chat/composer/useComposerDraft.d.ts +1 -1
- package/dist/components/chat/composer/useComposerProviders.d.ts +2 -2
- package/dist/components/chat/composer/useComposerSession.d.ts +1 -1
- package/dist/components/chat/index.d.ts +26 -26
- package/dist/components/chat/index.js +246 -248
- package/dist/components/chat/rich/LexicalEditor.d.ts +1 -1
- package/dist/components/chat/rich/RichChatComposer.d.ts +1 -1
- package/dist/components/chat/rich/index.d.ts +2 -2
- package/dist/components/chat/rich/index.js +17 -47
- package/dist/components/chat/rich/nodes.d.ts +2 -2
- package/dist/components/checkbox/Checkbox.d.ts +1 -1
- package/dist/components/checkbox/index.d.ts +2 -2
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/col/Col.d.ts +1 -1
- package/dist/components/col/index.d.ts +2 -2
- package/dist/components/col/index.js +1 -1
- package/dist/components/collapse/Collapse.d.ts +1 -1
- package/dist/components/collapse/index.d.ts +2 -2
- package/dist/components/collapse/index.js +1 -1
- package/dist/components/color-picker/ColorPicker.d.ts +1 -1
- package/dist/components/color-picker/index.d.ts +2 -2
- package/dist/components/color-picker/index.js +9 -9
- package/dist/components/config-provider/ConfigProvider.d.ts +1 -1
- package/dist/components/config-provider/index.d.ts +2 -2
- package/dist/components/config-provider/index.js +1 -1
- package/dist/components/console-page/ConsolePage.d.ts +1 -1
- package/dist/components/console-page/ConsolePage.types.d.ts +1 -1
- package/dist/components/console-page/index.d.ts +2 -2
- package/dist/components/console-page/index.js +1 -1
- package/dist/components/date-picker/DatePicker.d.ts +1 -1
- package/dist/components/date-picker/index.d.ts +2 -2
- package/dist/components/date-picker/index.js +4 -4
- package/dist/components/descriptions/Descriptions.d.ts +1 -1
- package/dist/components/descriptions/index.d.ts +2 -2
- package/dist/components/descriptions/index.js +1 -1
- package/dist/components/divider/Divider.d.ts +1 -1
- package/dist/components/divider/index.d.ts +2 -2
- package/dist/components/divider/index.js +1 -1
- package/dist/components/dm-auxiliary/DmAuxiliary.d.ts +1 -1
- package/dist/components/dm-auxiliary/index.d.ts +2 -2
- package/dist/components/dm-auxiliary/index.js +1 -1
- package/dist/components/dm-breadcrumb/DmBreadcrumb.d.ts +1 -1
- package/dist/components/dm-breadcrumb/DmBreadcrumb.types.d.ts +1 -1
- package/dist/components/dm-breadcrumb/index.d.ts +2 -2
- package/dist/components/dm-breadcrumb/index.js +19 -19
- package/dist/components/dm-date-picker/DmDatePicker.d.ts +2 -2
- package/dist/components/dm-date-picker/DmDatePicker.types.d.ts +1 -1
- package/dist/components/dm-date-picker/index.d.ts +2 -2
- package/dist/components/dm-date-picker/index.js +101 -101
- package/dist/components/dm-drawer/DmDrawer.d.ts +1 -1
- package/dist/components/dm-drawer/DmDrawer.types.d.ts +2 -2
- package/dist/components/dm-drawer/index.d.ts +2 -2
- package/dist/components/dm-drawer/index.js +20 -20
- package/dist/components/dm-infinite-scroll/DmInfiniteScroll.d.ts +1 -1
- package/dist/components/dm-infinite-scroll/index.d.ts +2 -2
- package/dist/components/dm-infinite-scroll/index.js +1 -1
- package/dist/components/dm-layout/DmLayout.d.ts +1 -1
- package/dist/components/dm-layout/DmLayout.types.d.ts +3 -3
- package/dist/components/dm-layout/index.d.ts +2 -2
- package/dist/components/dm-layout/index.js +646 -646
- package/dist/components/dm-menu/DmMenu.d.ts +2 -2
- package/dist/components/dm-menu/DmMenu.types.d.ts +1 -1
- package/dist/components/dm-menu/index.d.ts +2 -2
- package/dist/components/dm-menu/index.js +439 -439
- package/dist/components/dm-message/DmMessage.d.ts +7 -7
- package/dist/components/dm-message/DmMessage.types.d.ts +1 -1
- package/dist/components/dm-message/index.d.ts +2 -2
- package/dist/components/dm-message/index.js +17 -17
- package/dist/components/dm-page-header/DmPageHeader.d.ts +1 -1
- package/dist/components/dm-page-header/DmPageHeader.types.d.ts +2 -2
- package/dist/components/dm-page-header/index.d.ts +2 -2
- package/dist/components/dm-page-header/index.js +482 -482
- package/dist/components/dm-pagination/DmPagination.d.ts +1 -1
- package/dist/components/dm-pagination/DmPagination.types.d.ts +2 -2
- package/dist/components/dm-pagination/index.d.ts +2 -2
- package/dist/components/dm-pagination/index.js +40 -40
- package/dist/components/dm-pro-table/DmProTable.d.ts +2 -2
- package/dist/components/dm-pro-table/DmProTable.types.d.ts +3 -3
- package/dist/components/dm-pro-table/index.d.ts +2 -2
- package/dist/components/dm-pro-table/index.js +3259 -3259
- package/dist/components/dm-provider/DmProvider.d.ts +1 -1
- package/dist/components/dm-provider/DmProvider.types.d.ts +1 -1
- package/dist/components/dm-provider/index.d.ts +2 -2
- package/dist/components/dm-provider/index.js +95 -95
- package/dist/components/dm-query/DmQuery.d.ts +1 -1
- package/dist/components/dm-query/DmQuery.types.d.ts +1 -1
- package/dist/components/dm-query/index.d.ts +2 -2
- package/dist/components/dm-query/index.js +38 -40
- package/dist/components/dm-search/DmSearch.d.ts +1 -1
- package/dist/components/dm-search/DmSearch.types.d.ts +3 -3
- package/dist/components/dm-search/index.d.ts +2 -2
- package/dist/components/dm-search/index.js +32 -32
- package/dist/components/dm-splitter/DmSplitter.d.ts +1 -1
- package/dist/components/dm-splitter/DmSplitter.types.d.ts +1 -1
- package/dist/components/dm-splitter/index.d.ts +2 -2
- package/dist/components/dm-splitter/index.js +33 -33
- package/dist/components/dm-status/DmStatus.d.ts +1 -1
- package/dist/components/dm-status/DmStatus.types.d.ts +1 -1
- package/dist/components/dm-status/index.d.ts +2 -2
- package/dist/components/dm-status/index.js +26 -26
- package/dist/components/dm-table/DmTable.d.ts +2 -2
- package/dist/components/dm-table/DmTable.types.d.ts +3 -3
- package/dist/components/dm-table/index.d.ts +2 -2
- package/dist/components/dm-table/index.js +1196 -1196
- package/dist/components/dm-tabs/DmTabs.d.ts +1 -1
- package/dist/components/dm-tabs/DmTabs.types.d.ts +1 -1
- package/dist/components/dm-tabs/index.d.ts +2 -2
- package/dist/components/dm-tabs/index.js +35 -35
- package/dist/components/dm-toolbar/DmToolbar.d.ts +1 -1
- package/dist/components/dm-toolbar/DmToolbar.types.d.ts +2 -2
- package/dist/components/dm-toolbar/index.d.ts +2 -2
- package/dist/components/dm-toolbar/index.js +36 -36
- package/dist/components/dm-tree/DmTree.d.ts +1 -1
- package/dist/components/dm-tree/DmTree.types.d.ts +2 -2
- package/dist/components/dm-tree/index.d.ts +2 -2
- package/dist/components/dm-tree/index.js +93 -93
- package/dist/components/dm-truncate/DmTruncate.d.ts +1 -1
- package/dist/components/dm-truncate/DmTruncate.types.d.ts +1 -1
- package/dist/components/dm-truncate/index.d.ts +2 -2
- package/dist/components/dm-truncate/index.js +34 -34
- package/dist/components/drawer/Drawer.d.ts +1 -1
- package/dist/components/drawer/index.d.ts +2 -2
- package/dist/components/drawer/index.js +1 -1
- package/dist/components/dropdown/Dropdown.d.ts +1 -1
- package/dist/components/dropdown/Dropdown.types.d.ts +1 -1
- package/dist/components/dropdown/index.d.ts +2 -2
- package/dist/components/dropdown/index.js +94 -94
- package/dist/components/empty/Empty.d.ts +1 -1
- package/dist/components/empty/index.d.ts +2 -2
- package/dist/components/empty/index.js +1 -1
- package/dist/components/fab/Fab.d.ts +1 -1
- package/dist/components/fab/Fab.types.d.ts +1 -1
- package/dist/components/fab/index.d.ts +2 -2
- package/dist/components/fab/index.js +22 -22
- package/dist/components/flex/Flex.d.ts +1 -1
- package/dist/components/flex/index.d.ts +2 -2
- package/dist/components/flex/index.js +1 -1
- package/dist/components/float-button/FloatButton.d.ts +1 -1
- package/dist/components/float-button/index.d.ts +2 -2
- package/dist/components/float-button/index.js +1 -1
- package/dist/components/form/Form.d.ts +1 -1
- package/dist/components/form/index.d.ts +2 -2
- package/dist/components/form/index.js +1 -1
- package/dist/components/grid/Grid.d.ts +1 -1
- package/dist/components/grid/Grid.types.d.ts +1 -1
- package/dist/components/grid/index.d.ts +2 -2
- package/dist/components/image/Image.d.ts +1 -1
- package/dist/components/image/index.d.ts +2 -2
- package/dist/components/image/index.js +1 -1
- package/dist/components/input/Input.d.ts +1 -1
- package/dist/components/input/index.d.ts +2 -2
- package/dist/components/input/index.js +1 -1
- package/dist/components/input-number/InputNumber.d.ts +1 -1
- package/dist/components/input-number/index.d.ts +2 -2
- package/dist/components/input-number/index.js +1 -1
- package/dist/components/json-schema-form/JsonSchemaForm.d.ts +1 -1
- package/dist/components/json-schema-form/JsonSchemaWidget.d.ts +1 -1
- package/dist/components/json-schema-form/index.d.ts +8 -8
- package/dist/components/json-schema-form/index.js +3791 -3791
- package/dist/components/json-schema-form/json-form-widgets.d.ts +1 -1
- package/dist/components/json-schema-form/json-schema-form.d.ts +1 -1
- package/dist/components/layout/Layout.d.ts +1 -1
- package/dist/components/layout/index.d.ts +2 -2
- package/dist/components/layout/index.js +1 -1
- package/dist/components/list/List.d.ts +1 -1
- package/dist/components/list/index.d.ts +2 -2
- package/dist/components/list/index.js +1 -1
- package/dist/components/markdown/Markdown.d.ts +1 -1
- package/dist/components/markdown/index.d.ts +2 -2
- package/dist/components/markdown/index.js +2 -2
- package/dist/components/megamenu/Megamenu.d.ts +1 -1
- package/dist/components/megamenu/index.d.ts +2 -2
- package/dist/components/megamenu/index.js +1 -1
- package/dist/components/mentions/Mentions.d.ts +1 -1
- package/dist/components/mentions/index.d.ts +2 -2
- package/dist/components/mentions/index.js +1 -1
- package/dist/components/menu/Menu.d.ts +1 -1
- package/dist/components/menu/index.d.ts +2 -2
- package/dist/components/menu/index.js +1 -1
- package/dist/components/message/Message.d.ts +1 -1
- package/dist/components/message/index.d.ts +2 -2
- package/dist/components/message/index.js +4 -4
- package/dist/components/modal/Modal.d.ts +1 -1
- package/dist/components/modal/index.d.ts +2 -2
- package/dist/components/modal/index.js +1 -1
- package/dist/components/notification/Notification.d.ts +1 -1
- package/dist/components/notification/index.d.ts +2 -2
- package/dist/components/notification/index.js +1 -1
- package/dist/components/otp-input/OtpInput.d.ts +1 -1
- package/dist/components/otp-input/index.d.ts +2 -2
- package/dist/components/otp-input/index.js +1 -1
- package/dist/components/pagination/Pagination.d.ts +1 -1
- package/dist/components/pagination/index.d.ts +2 -2
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/popconfirm/Popconfirm.d.ts +1 -1
- package/dist/components/popconfirm/Popconfirm.types.d.ts +1 -1
- package/dist/components/popconfirm/index.d.ts +2 -2
- package/dist/components/popconfirm/index.js +48 -48
- package/dist/components/popover/Popover.d.ts +1 -1
- package/dist/components/popover/index.d.ts +2 -2
- package/dist/components/popover/index.js +1 -1
- package/dist/components/progress/Progress.d.ts +1 -1
- package/dist/components/progress/index.d.ts +2 -2
- package/dist/components/progress/index.js +1 -1
- package/dist/components/qr-code/QRCode.d.ts +1 -1
- package/dist/components/qr-code/index.d.ts +2 -2
- package/dist/components/qr-code/index.js +1 -1
- package/dist/components/radio/Radio.d.ts +1 -1
- package/dist/components/radio/index.d.ts +2 -2
- package/dist/components/radio/index.js +1 -1
- package/dist/components/rate/Rate.d.ts +1 -1
- package/dist/components/rate/index.d.ts +2 -2
- package/dist/components/rate/index.js +1 -1
- package/dist/components/result/Result.d.ts +1 -1
- package/dist/components/result/index.d.ts +2 -2
- package/dist/components/result/index.js +1 -1
- package/dist/components/row/Row.d.ts +1 -1
- package/dist/components/row/index.d.ts +2 -2
- package/dist/components/row/index.js +1 -1
- package/dist/components/segmented/Segmented.d.ts +1 -1
- package/dist/components/segmented/index.d.ts +2 -2
- package/dist/components/segmented/index.js +1 -1
- package/dist/components/select/Select.d.ts +1 -1
- package/dist/components/select/index.d.ts +2 -2
- package/dist/components/select/index.js +1 -1
- package/dist/components/skeleton/Skeleton.d.ts +1 -1
- package/dist/components/skeleton/index.d.ts +2 -2
- package/dist/components/skeleton/index.js +1 -1
- package/dist/components/slider/Slider.d.ts +1 -1
- package/dist/components/slider/index.d.ts +2 -2
- package/dist/components/slider/index.js +1 -1
- package/dist/components/space/Space.d.ts +1 -1
- package/dist/components/space/index.d.ts +2 -2
- package/dist/components/space/index.js +1 -1
- package/dist/components/spin/Spin.d.ts +1 -1
- package/dist/components/spin/index.d.ts +2 -2
- package/dist/components/spin/index.js +3 -3
- package/dist/components/splitter/Splitter.d.ts +1 -1
- package/dist/components/splitter/index.d.ts +2 -2
- package/dist/components/splitter/index.js +1 -1
- package/dist/components/statistic/Statistic.d.ts +1 -1
- package/dist/components/statistic/index.d.ts +2 -2
- package/dist/components/statistic/index.js +1 -1
- package/dist/components/steps/Steps.d.ts +1 -1
- package/dist/components/steps/index.d.ts +2 -2
- package/dist/components/steps/index.js +1 -1
- package/dist/components/swap/Swap.d.ts +1 -1
- package/dist/components/swap/index.d.ts +2 -2
- package/dist/components/swap/index.js +1 -1
- package/dist/components/switch/Switch.d.ts +1 -1
- package/dist/components/switch/index.d.ts +2 -2
- package/dist/components/switch/index.js +1 -1
- package/dist/components/table/Table.d.ts +1 -1
- package/dist/components/table/index.d.ts +2 -2
- package/dist/components/table/index.js +3 -3
- package/dist/components/tabs/Tabs.d.ts +1 -1
- package/dist/components/tabs/index.d.ts +2 -2
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tag/Tag.d.ts +1 -1
- package/dist/components/tag/index.d.ts +2 -2
- package/dist/components/tag/index.js +1 -1
- package/dist/components/time-picker/TimePicker.d.ts +1 -1
- package/dist/components/time-picker/index.d.ts +2 -2
- package/dist/components/time-picker/index.js +3 -3
- package/dist/components/timeline/Timeline.d.ts +1 -1
- package/dist/components/timeline/index.d.ts +2 -2
- package/dist/components/timeline/index.js +1 -1
- package/dist/components/tooltip/Tooltip.d.ts +1 -1
- package/dist/components/tooltip/index.d.ts +2 -2
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tour/Tour.d.ts +1 -1
- package/dist/components/tour/Tour.types.d.ts +1 -1
- package/dist/components/tour/index.d.ts +2 -2
- package/dist/components/tour/index.js +66 -66
- package/dist/components/transfer/Transfer.d.ts +1 -1
- package/dist/components/transfer/index.d.ts +2 -2
- package/dist/components/transfer/index.js +1 -1
- package/dist/components/tree/Tree.d.ts +1 -1
- package/dist/components/tree/index.d.ts +2 -2
- package/dist/components/tree/index.js +1 -1
- package/dist/components/tree-select/TreeSelect.d.ts +1 -1
- package/dist/components/tree-select/index.d.ts +2 -2
- package/dist/components/tree-select/index.js +1 -1
- package/dist/components/typography/Typography.d.ts +1 -1
- package/dist/components/typography/index.d.ts +2 -2
- package/dist/components/typography/index.js +1 -1
- package/dist/components/upload/Upload.d.ts +1 -1
- package/dist/components/upload/index.d.ts +2 -2
- package/dist/components/upload/index.js +6 -6
- package/dist/components/watermark/Watermark.d.ts +1 -1
- package/dist/components/watermark/index.d.ts +2 -2
- package/dist/components/watermark/index.js +1 -1
- package/dist/generated/version.d.ts +1 -1
- package/dist/index.d.ts +105 -105
- package/dist/index.js +373 -373
- package/dist/infrastructure.d.ts +1 -1
- package/dist/infrastructure.js +1 -1
- package/dist/styles.css +2 -2
- package/dist/theme/ThemeProvider.d.ts +1 -1
- package/dist/theme/index.d.ts +2 -2
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +5 -5
- package/package.json +218 -218
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
// src/components/
|
|
4
|
-
import
|
|
3
|
+
// src/components/button/Button.tsx
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { createPortal } from "react-dom";
|
|
5
6
|
|
|
6
|
-
//
|
|
7
|
+
// ../../../node_modules/clsx/dist/clsx.mjs
|
|
7
8
|
function r(e) {
|
|
8
9
|
var t, f, n = "";
|
|
9
10
|
if (typeof e == "string" || typeof e == "number")
|
|
@@ -28,25 +29,6 @@ function clsx() {
|
|
|
28
29
|
function cn(...inputs) {
|
|
29
30
|
return clsx(inputs);
|
|
30
31
|
}
|
|
31
|
-
// src/classes/dm-table.ts
|
|
32
|
-
var dmTableBaseClass = "dm-table";
|
|
33
|
-
var dmTableSearchClass = "dm-table-search";
|
|
34
|
-
var dmTableCardClass = "dm-table-card";
|
|
35
|
-
var dmTableHeaderClass = "dm-table-header";
|
|
36
|
-
var dmTableTitleClass = "dm-table-title";
|
|
37
|
-
var dmTableExtraClass = "dm-table-extra";
|
|
38
|
-
var dmTableIndicatorsClass = "dm-table-indicators";
|
|
39
|
-
var dmTableTableExtraClass = "dm-table-table-extra";
|
|
40
|
-
var dmTableColumnSettingClass = "dm-table-column-setting";
|
|
41
|
-
var dmTablePaginationClass = "dm-table-pagination";
|
|
42
|
-
function getDmTableClasses({ className }) {
|
|
43
|
-
return cn(dmTableBaseClass, className);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// src/components/button/Button.tsx
|
|
47
|
-
import React from "react";
|
|
48
|
-
import { createPortal } from "react-dom";
|
|
49
|
-
|
|
50
32
|
// src/classes/button.ts
|
|
51
33
|
var buttonBaseClass = "btn";
|
|
52
34
|
var buttonColorClasses = {
|
|
@@ -370,1303 +352,1278 @@ function Button({
|
|
|
370
352
|
]
|
|
371
353
|
});
|
|
372
354
|
}
|
|
373
|
-
// src/
|
|
374
|
-
|
|
375
|
-
var cardAppearanceClasses = {
|
|
376
|
-
elevated: "card-elevated",
|
|
377
|
-
outline: "card-outline",
|
|
378
|
-
filled: "card-filled"
|
|
379
|
-
};
|
|
380
|
-
var cardPaddingClasses = {
|
|
381
|
-
none: "card-padding-none",
|
|
382
|
-
sm: "card-padding-sm",
|
|
383
|
-
md: "card-padding-md",
|
|
384
|
-
lg: "card-padding-lg"
|
|
385
|
-
};
|
|
386
|
-
function getCardClasses({
|
|
387
|
-
appearance = "elevated",
|
|
388
|
-
padding = "md",
|
|
389
|
-
className
|
|
390
|
-
}) {
|
|
391
|
-
return cn(cardBaseClass, cardAppearanceClasses[appearance], cardPaddingClasses[padding], className);
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
// src/components/card/Card.tsx
|
|
395
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
396
|
-
function Card({
|
|
397
|
-
appearance = "elevated",
|
|
398
|
-
padding = "md",
|
|
399
|
-
className,
|
|
400
|
-
children,
|
|
401
|
-
ref,
|
|
402
|
-
...props
|
|
403
|
-
}) {
|
|
404
|
-
const classes = getCardClasses({
|
|
405
|
-
appearance,
|
|
406
|
-
padding,
|
|
407
|
-
className
|
|
408
|
-
});
|
|
409
|
-
return /* @__PURE__ */ jsx2("div", {
|
|
410
|
-
ref,
|
|
411
|
-
className: classes,
|
|
412
|
-
...props,
|
|
413
|
-
children
|
|
414
|
-
});
|
|
415
|
-
}
|
|
416
|
-
// src/components/dm-pagination/DmPagination.tsx
|
|
417
|
-
import {
|
|
418
|
-
forwardRef as forwardRef2,
|
|
419
|
-
useEffect,
|
|
420
|
-
useMemo as useMemo2,
|
|
421
|
-
useRef,
|
|
422
|
-
useState as useState2
|
|
423
|
-
} from "react";
|
|
355
|
+
// src/components/calendar/Calendar.tsx
|
|
356
|
+
import { forwardRef, useMemo, useState } from "react";
|
|
424
357
|
|
|
425
|
-
// src/classes/
|
|
426
|
-
var
|
|
427
|
-
var
|
|
428
|
-
var
|
|
429
|
-
var
|
|
430
|
-
var
|
|
431
|
-
var
|
|
432
|
-
var
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
358
|
+
// src/classes/calendar.ts
|
|
359
|
+
var calendarBaseClass = "datepicker calendar";
|
|
360
|
+
var calendarHeaderClass = "calendar-header";
|
|
361
|
+
var calendarTitleClass = "calendar-title";
|
|
362
|
+
var calendarControlsClass = "calendar-controls";
|
|
363
|
+
var calendarNavClass = "calendar-nav";
|
|
364
|
+
var calendarModeClass = "calendar-mode";
|
|
365
|
+
var calendarWeekdaysClass = "calendar-weekdays";
|
|
366
|
+
var calendarWeekdayClass = "calendar-weekday";
|
|
367
|
+
var calendarBodyClass = "calendar-body";
|
|
368
|
+
var calendarDateGridClass = "calendar-date-grid";
|
|
369
|
+
var calendarMonthGridClass = "calendar-month-grid";
|
|
370
|
+
var calendarCellContentClass = "calendar-cell-content";
|
|
371
|
+
function getCalendarClasses({
|
|
372
|
+
fullscreen = true,
|
|
373
|
+
mode = "month",
|
|
440
374
|
className
|
|
441
375
|
}) {
|
|
442
|
-
return cn(
|
|
376
|
+
return cn(calendarBaseClass, fullscreen ? "calendar-fullscreen" : "calendar-card", mode === "year" && "calendar-year-mode", className);
|
|
443
377
|
}
|
|
444
|
-
function
|
|
445
|
-
|
|
378
|
+
function getCalendarCellClasses({
|
|
379
|
+
selected,
|
|
380
|
+
today,
|
|
381
|
+
outside,
|
|
382
|
+
disabled,
|
|
446
383
|
className
|
|
447
384
|
}) {
|
|
448
|
-
return cn(
|
|
385
|
+
return cn("calendar-cell", selected && "calendar-cell-selected", today && "calendar-cell-today", outside && "calendar-cell-outside", disabled && "calendar-cell-disabled", className);
|
|
449
386
|
}
|
|
450
387
|
|
|
451
|
-
// src/components/
|
|
452
|
-
import {
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
var paginationResponsiveClass = "pagination-responsive";
|
|
471
|
-
var paginationSizeClasses = {
|
|
472
|
-
sm: "pagination-sm",
|
|
473
|
-
md: "",
|
|
474
|
-
lg: "pagination-lg"
|
|
475
|
-
};
|
|
476
|
-
function getPaginationClasses({
|
|
477
|
-
size = "md",
|
|
478
|
-
compact,
|
|
479
|
-
className
|
|
480
|
-
}) {
|
|
481
|
-
return cn(paginationBaseClass, paginationResponsiveClass, paginationSizeClasses[size], compact && paginationCompactClass, className);
|
|
388
|
+
// src/components/calendar/Calendar.tsx
|
|
389
|
+
import { jsx as jsx2, jsxs as jsxs2, Fragment as Fragment2 } from "react/jsx-runtime";
|
|
390
|
+
var WEEKDAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
391
|
+
var MONTHS = [
|
|
392
|
+
"Jan",
|
|
393
|
+
"Feb",
|
|
394
|
+
"Mar",
|
|
395
|
+
"Apr",
|
|
396
|
+
"May",
|
|
397
|
+
"Jun",
|
|
398
|
+
"Jul",
|
|
399
|
+
"Aug",
|
|
400
|
+
"Sep",
|
|
401
|
+
"Oct",
|
|
402
|
+
"Nov",
|
|
403
|
+
"Dec"
|
|
404
|
+
];
|
|
405
|
+
function pad(value) {
|
|
406
|
+
return String(value).padStart(2, "0");
|
|
482
407
|
}
|
|
483
|
-
function
|
|
484
|
-
|
|
485
|
-
disabled
|
|
486
|
-
}) {
|
|
487
|
-
return cn(paginationItemClass, active && paginationItemActiveClass, disabled && paginationItemDisabledClass);
|
|
408
|
+
function formatDate(date) {
|
|
409
|
+
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
|
|
488
410
|
}
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
return fallback;
|
|
411
|
+
function formatMonth(date) {
|
|
412
|
+
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-01`;
|
|
413
|
+
}
|
|
414
|
+
function parseDate(value) {
|
|
415
|
+
if (value instanceof Date && !Number.isNaN(value.getTime())) {
|
|
416
|
+
return new Date(value.getFullYear(), value.getMonth(), value.getDate());
|
|
496
417
|
}
|
|
497
|
-
|
|
418
|
+
if (typeof value === "string" && value.length > 0) {
|
|
419
|
+
const [year, month = "1", day = "1"] = value.split("-");
|
|
420
|
+
const parsed = new Date(Number(year), Number(month) - 1, Number(day));
|
|
421
|
+
if (!Number.isNaN(parsed.getTime())) {
|
|
422
|
+
return parsed;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
const today = new Date;
|
|
426
|
+
return new Date(today.getFullYear(), today.getMonth(), today.getDate());
|
|
498
427
|
}
|
|
499
|
-
function
|
|
500
|
-
return
|
|
428
|
+
function addMonths(date, amount) {
|
|
429
|
+
return new Date(date.getFullYear(), date.getMonth() + amount, 1);
|
|
501
430
|
}
|
|
502
|
-
function
|
|
503
|
-
return
|
|
431
|
+
function addYears(date, amount) {
|
|
432
|
+
return new Date(date.getFullYear() + amount, date.getMonth(), 1);
|
|
504
433
|
}
|
|
505
|
-
function
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
const end = Math.min(total, current * pageSize);
|
|
511
|
-
return [start, end];
|
|
434
|
+
function startOfCalendarGrid(panelDate) {
|
|
435
|
+
const firstOfMonth = new Date(panelDate.getFullYear(), panelDate.getMonth(), 1);
|
|
436
|
+
const start = new Date(firstOfMonth);
|
|
437
|
+
start.setDate(firstOfMonth.getDate() - firstOfMonth.getDay());
|
|
438
|
+
return start;
|
|
512
439
|
}
|
|
513
|
-
function
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
}
|
|
521
|
-
if (current >= pageCount - 3) {
|
|
522
|
-
[pageCount - 4, pageCount - 3, pageCount - 2, pageCount - 1].forEach((page) => pages.add(page));
|
|
523
|
-
}
|
|
524
|
-
const sortedPages = Array.from(pages).filter((page) => page >= 1 && page <= pageCount).sort((first, second) => first - second);
|
|
525
|
-
return sortedPages.reduce((tokens, page) => {
|
|
526
|
-
const previous = tokens[tokens.length - 1];
|
|
527
|
-
if (typeof previous === "number") {
|
|
528
|
-
const gap = page - previous;
|
|
529
|
-
if (gap === 2) {
|
|
530
|
-
tokens.push(previous + 1);
|
|
531
|
-
} else if (gap > 2) {
|
|
532
|
-
tokens.push("ellipsis");
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
tokens.push(page);
|
|
536
|
-
return tokens;
|
|
537
|
-
}, []);
|
|
440
|
+
function buildDateGrid(panelDate) {
|
|
441
|
+
const start = startOfCalendarGrid(panelDate);
|
|
442
|
+
return Array.from({ length: 42 }, (_, index) => {
|
|
443
|
+
const date = new Date(start);
|
|
444
|
+
date.setDate(start.getDate() + index);
|
|
445
|
+
return date;
|
|
446
|
+
});
|
|
538
447
|
}
|
|
539
|
-
function
|
|
540
|
-
return
|
|
448
|
+
function isSameMonth(left, right) {
|
|
449
|
+
return left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth();
|
|
541
450
|
}
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
pageSize,
|
|
546
|
-
defaultPageSize = 10,
|
|
547
|
-
total = 0,
|
|
548
|
-
onChange,
|
|
549
|
-
disabled,
|
|
550
|
-
simple,
|
|
551
|
-
showSizeChanger,
|
|
552
|
-
showQuickJumper,
|
|
553
|
-
showTotal,
|
|
554
|
-
size = "md",
|
|
555
|
-
className,
|
|
556
|
-
...props
|
|
557
|
-
}, ref) => {
|
|
558
|
-
const isCurrentControlled = current !== undefined;
|
|
559
|
-
const isPageSizeControlled = pageSize !== undefined;
|
|
560
|
-
const [internalCurrent, setInternalCurrent] = useState(defaultCurrent);
|
|
561
|
-
const [internalPageSize, setInternalPageSize] = useState(defaultPageSize);
|
|
562
|
-
const [quickJumpValue, setQuickJumpValue] = useState("");
|
|
563
|
-
const mergedPageSize = toPositiveInteger(pageSize ?? internalPageSize, defaultPageSize);
|
|
564
|
-
const pageCount = getPageCount(total, mergedPageSize);
|
|
565
|
-
const mergedCurrent = clampPage(toPositiveInteger(current ?? internalCurrent, defaultCurrent), pageCount);
|
|
566
|
-
const pageTokens = useMemo(() => getPageTokens(mergedCurrent, pageCount), [mergedCurrent, pageCount]);
|
|
567
|
-
const range = getRange(mergedCurrent, mergedPageSize, total);
|
|
568
|
-
function changePage(nextPage, nextPageSize = mergedPageSize) {
|
|
569
|
-
const nextPageCount = getPageCount(total, nextPageSize);
|
|
570
|
-
const normalizedPage = clampPage(nextPage, nextPageCount);
|
|
571
|
-
if (!isCurrentControlled) {
|
|
572
|
-
setInternalCurrent(normalizedPage);
|
|
573
|
-
}
|
|
574
|
-
if (!isPageSizeControlled) {
|
|
575
|
-
setInternalPageSize(nextPageSize);
|
|
576
|
-
}
|
|
577
|
-
onChange?.(normalizedPage, nextPageSize);
|
|
578
|
-
}
|
|
579
|
-
function handlePageSizeChange(event) {
|
|
580
|
-
const nextPageSize = toPositiveInteger(Number(event.currentTarget.value), mergedPageSize);
|
|
581
|
-
const nextPage = clampPage(mergedCurrent, getPageCount(total, nextPageSize));
|
|
582
|
-
changePage(nextPage, nextPageSize);
|
|
583
|
-
}
|
|
584
|
-
function jumpToInputPage(value) {
|
|
585
|
-
const nextPage = Number(value);
|
|
586
|
-
if (!Number.isFinite(nextPage)) {
|
|
587
|
-
return;
|
|
588
|
-
}
|
|
589
|
-
changePage(nextPage);
|
|
590
|
-
setQuickJumpValue("");
|
|
591
|
-
}
|
|
592
|
-
function handleQuickJumpKeyDown(event) {
|
|
593
|
-
if (event.key !== "Enter") {
|
|
594
|
-
return;
|
|
595
|
-
}
|
|
596
|
-
jumpToInputPage(event.currentTarget.value);
|
|
451
|
+
function isOutsideRange(date, validRange) {
|
|
452
|
+
if (!validRange) {
|
|
453
|
+
return false;
|
|
597
454
|
}
|
|
598
|
-
const
|
|
599
|
-
const
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
455
|
+
const current = formatDate(date);
|
|
456
|
+
const start = formatDate(parseDate(validRange[0]));
|
|
457
|
+
const end = formatDate(parseDate(validRange[1]));
|
|
458
|
+
return current < start || current > end;
|
|
459
|
+
}
|
|
460
|
+
function Header({
|
|
461
|
+
panelDate,
|
|
462
|
+
mode,
|
|
463
|
+
setPanelDate,
|
|
464
|
+
setMode
|
|
465
|
+
}) {
|
|
466
|
+
const title = mode === "year" ? String(panelDate.getFullYear()) : `${MONTHS[panelDate.getMonth()]} ${panelDate.getFullYear()}`;
|
|
467
|
+
return /* @__PURE__ */ jsxs2("div", {
|
|
468
|
+
className: calendarHeaderClass,
|
|
604
469
|
children: [
|
|
605
|
-
|
|
606
|
-
className: paginationInfoClass,
|
|
607
|
-
children: /* @__PURE__ */ jsx3("span", {
|
|
608
|
-
className: paginationInfoTextClass,
|
|
609
|
-
children: showTotal(total, range)
|
|
610
|
-
})
|
|
611
|
-
}) : null,
|
|
612
|
-
/* @__PURE__ */ jsx3("button", {
|
|
470
|
+
/* @__PURE__ */ jsx2("button", {
|
|
613
471
|
type: "button",
|
|
614
|
-
className:
|
|
615
|
-
|
|
616
|
-
"
|
|
617
|
-
|
|
618
|
-
|
|
472
|
+
className: calendarNavClass,
|
|
473
|
+
"aria-label": "Previous panel",
|
|
474
|
+
onClick: () => setPanelDate(mode === "year" ? addYears(panelDate, -1) : addMonths(panelDate, -1), mode),
|
|
475
|
+
children: /* @__PURE__ */ jsx2("svg", {
|
|
476
|
+
"aria-hidden": "true",
|
|
477
|
+
focusable: "false",
|
|
478
|
+
width: "16",
|
|
479
|
+
height: "16",
|
|
480
|
+
viewBox: "0 0 24 24",
|
|
481
|
+
fill: "none",
|
|
482
|
+
stroke: "currentColor",
|
|
483
|
+
strokeWidth: "2",
|
|
484
|
+
strokeLinecap: "round",
|
|
485
|
+
strokeLinejoin: "round",
|
|
486
|
+
children: /* @__PURE__ */ jsx2("path", {
|
|
487
|
+
d: "m15 18-6-6 6-6"
|
|
488
|
+
})
|
|
489
|
+
})
|
|
619
490
|
}),
|
|
620
|
-
|
|
621
|
-
className:
|
|
491
|
+
/* @__PURE__ */ jsxs2("div", {
|
|
492
|
+
className: calendarControlsClass,
|
|
622
493
|
children: [
|
|
623
|
-
/* @__PURE__ */
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
min: 1,
|
|
627
|
-
max: pageCount,
|
|
628
|
-
value: quickJumpValue || String(mergedCurrent),
|
|
629
|
-
disabled,
|
|
630
|
-
onChange: (event) => setQuickJumpValue(event.currentTarget.value),
|
|
631
|
-
onKeyDown: handleQuickJumpKeyDown,
|
|
632
|
-
onBlur: (event) => {
|
|
633
|
-
if (event.currentTarget.value !== String(mergedCurrent)) {
|
|
634
|
-
jumpToInputPage(event.currentTarget.value);
|
|
635
|
-
}
|
|
636
|
-
}
|
|
494
|
+
/* @__PURE__ */ jsx2("div", {
|
|
495
|
+
className: calendarTitleClass,
|
|
496
|
+
children: title
|
|
637
497
|
}),
|
|
638
|
-
/* @__PURE__ */ jsxs2("
|
|
639
|
-
className:
|
|
498
|
+
/* @__PURE__ */ jsxs2("div", {
|
|
499
|
+
className: calendarModeClass,
|
|
640
500
|
children: [
|
|
641
|
-
|
|
642
|
-
|
|
501
|
+
/* @__PURE__ */ jsx2("button", {
|
|
502
|
+
type: "button",
|
|
503
|
+
"aria-pressed": mode === "month",
|
|
504
|
+
onClick: () => setMode("month"),
|
|
505
|
+
children: "Month"
|
|
506
|
+
}),
|
|
507
|
+
/* @__PURE__ */ jsx2("button", {
|
|
508
|
+
type: "button",
|
|
509
|
+
"aria-pressed": mode === "year",
|
|
510
|
+
onClick: () => setMode("year"),
|
|
511
|
+
children: "Year"
|
|
512
|
+
})
|
|
643
513
|
]
|
|
644
514
|
})
|
|
645
515
|
]
|
|
646
|
-
}) : pageTokens.map((pageToken, index) => pageToken === "ellipsis" ? /* @__PURE__ */ jsx3("span", {
|
|
647
|
-
"aria-hidden": "true",
|
|
648
|
-
className: paginationEllipsisClass
|
|
649
|
-
}, `ellipsis-${index}`) : /* @__PURE__ */ jsx3("button", {
|
|
650
|
-
type: "button",
|
|
651
|
-
className: getPaginationItemClasses({
|
|
652
|
-
active: pageToken === mergedCurrent,
|
|
653
|
-
disabled
|
|
654
|
-
}),
|
|
655
|
-
disabled,
|
|
656
|
-
"aria-current": pageToken === mergedCurrent ? "page" : undefined,
|
|
657
|
-
"aria-label": `Page ${pageToken}`,
|
|
658
|
-
onClick: () => changePage(pageToken),
|
|
659
|
-
children: pageToken
|
|
660
|
-
}, pageToken)),
|
|
661
|
-
/* @__PURE__ */ jsx3("button", {
|
|
662
|
-
type: "button",
|
|
663
|
-
className: paginationNextClass,
|
|
664
|
-
disabled: nextDisabled,
|
|
665
|
-
"aria-label": "Next page",
|
|
666
|
-
onClick: () => changePage(mergedCurrent + 1),
|
|
667
|
-
children: "Next"
|
|
668
516
|
}),
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
"aria-label": "Jump to page",
|
|
689
|
-
type: "number",
|
|
690
|
-
min: 1,
|
|
691
|
-
max: pageCount,
|
|
692
|
-
value: quickJumpValue,
|
|
693
|
-
disabled,
|
|
694
|
-
onChange: (event) => setQuickJumpValue(event.currentTarget.value),
|
|
695
|
-
onKeyDown: handleQuickJumpKeyDown
|
|
517
|
+
/* @__PURE__ */ jsx2("button", {
|
|
518
|
+
type: "button",
|
|
519
|
+
className: calendarNavClass,
|
|
520
|
+
"aria-label": "Next panel",
|
|
521
|
+
onClick: () => setPanelDate(mode === "year" ? addYears(panelDate, 1) : addMonths(panelDate, 1), mode),
|
|
522
|
+
children: /* @__PURE__ */ jsx2("svg", {
|
|
523
|
+
"aria-hidden": "true",
|
|
524
|
+
focusable: "false",
|
|
525
|
+
width: "16",
|
|
526
|
+
height: "16",
|
|
527
|
+
viewBox: "0 0 24 24",
|
|
528
|
+
fill: "none",
|
|
529
|
+
stroke: "currentColor",
|
|
530
|
+
strokeWidth: "2",
|
|
531
|
+
strokeLinecap: "round",
|
|
532
|
+
strokeLinejoin: "round",
|
|
533
|
+
children: /* @__PURE__ */ jsx2("path", {
|
|
534
|
+
d: "m9 18 6-6-6-6"
|
|
535
|
+
})
|
|
696
536
|
})
|
|
697
|
-
})
|
|
537
|
+
})
|
|
698
538
|
]
|
|
699
539
|
});
|
|
700
|
-
});
|
|
701
|
-
Pagination.displayName = "Pagination";
|
|
702
|
-
// src/components/dm-pagination/DmPagination.tsx
|
|
703
|
-
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
704
|
-
var defaultLocale = {
|
|
705
|
-
refresh: "Refresh",
|
|
706
|
-
showTotal: (total, range) => `${range[0]}-${range[1]} of ${total}`,
|
|
707
|
-
showTotalSimple: (total, range) => `${range[0]}-${range[1]} / ${total}`,
|
|
708
|
-
selected: (selectedTotal) => `, ${selectedTotal} selected`
|
|
709
|
-
};
|
|
710
|
-
function getResponsiveSimple({
|
|
711
|
-
width,
|
|
712
|
-
total,
|
|
713
|
-
showRefresh,
|
|
714
|
-
showSizeChanger
|
|
715
|
-
}) {
|
|
716
|
-
let reservedWidth = 0;
|
|
717
|
-
if (!showRefresh)
|
|
718
|
-
reservedWidth += 100;
|
|
719
|
-
if (!showSizeChanger)
|
|
720
|
-
reservedWidth += 100;
|
|
721
|
-
if (width < 900 - reservedWidth)
|
|
722
|
-
return total >= 100;
|
|
723
|
-
if (width < 1100 - reservedWidth)
|
|
724
|
-
return total >= 1000;
|
|
725
|
-
if (width < 1220 - reservedWidth)
|
|
726
|
-
return total >= 99999;
|
|
727
|
-
if (width < 1300 - reservedWidth)
|
|
728
|
-
return total >= 999999;
|
|
729
|
-
if (width < 1450 - reservedWidth)
|
|
730
|
-
return total >= 9999999;
|
|
731
|
-
return false;
|
|
732
|
-
}
|
|
733
|
-
function useElementWidth() {
|
|
734
|
-
const ref = useRef(null);
|
|
735
|
-
const [width, setWidth] = useState2(1000);
|
|
736
|
-
useEffect(() => {
|
|
737
|
-
const element = ref.current;
|
|
738
|
-
if (!element || typeof ResizeObserver === "undefined")
|
|
739
|
-
return;
|
|
740
|
-
const observer = new ResizeObserver(([entry]) => {
|
|
741
|
-
setWidth(entry?.contentRect.width || element.getBoundingClientRect().width);
|
|
742
|
-
});
|
|
743
|
-
observer.observe(element);
|
|
744
|
-
return () => observer.disconnect();
|
|
745
|
-
}, []);
|
|
746
|
-
return [ref, width];
|
|
747
|
-
}
|
|
748
|
-
function renderSelected(selectedTotal, locale) {
|
|
749
|
-
if (!selectedTotal)
|
|
750
|
-
return null;
|
|
751
|
-
return /* @__PURE__ */ jsx4("span", {
|
|
752
|
-
className: dmPaginationSelectedClass,
|
|
753
|
-
children: locale.selected(selectedTotal)
|
|
754
|
-
});
|
|
755
540
|
}
|
|
756
|
-
var
|
|
757
|
-
selectedTotal = 0,
|
|
758
|
-
loading = false,
|
|
759
|
-
total = 0,
|
|
760
|
-
showRefresh = true,
|
|
761
|
-
showPagination = true,
|
|
762
|
-
wrapperStyle,
|
|
541
|
+
var Calendar = forwardRef(({
|
|
763
542
|
className,
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
const
|
|
786
|
-
const
|
|
787
|
-
const
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
543
|
+
value,
|
|
544
|
+
defaultValue,
|
|
545
|
+
mode,
|
|
546
|
+
defaultMode = "month",
|
|
547
|
+
fullscreen = true,
|
|
548
|
+
validRange,
|
|
549
|
+
disabledDate,
|
|
550
|
+
dateCellRender,
|
|
551
|
+
dateFullCellRender,
|
|
552
|
+
monthCellRender,
|
|
553
|
+
monthFullCellRender,
|
|
554
|
+
cellRender,
|
|
555
|
+
fullCellRender,
|
|
556
|
+
headerRender,
|
|
557
|
+
onChange,
|
|
558
|
+
onSelect,
|
|
559
|
+
onPanelChange,
|
|
560
|
+
...props
|
|
561
|
+
}, ref) => {
|
|
562
|
+
const selectedDate = parseDate(value ?? defaultValue);
|
|
563
|
+
const [innerValue, setInnerValue] = useState(() => formatDate(selectedDate));
|
|
564
|
+
const [panelDate, setInnerPanelDate] = useState(selectedDate);
|
|
565
|
+
const [innerMode, setInnerMode] = useState(mode ?? defaultMode);
|
|
566
|
+
const currentMode = mode ?? innerMode;
|
|
567
|
+
const currentValue = value === undefined ? innerValue : formatDate(parseDate(value));
|
|
568
|
+
const today = useMemo(() => formatDate(new Date), []);
|
|
569
|
+
const dateGrid = useMemo(() => buildDateGrid(panelDate), [panelDate]);
|
|
570
|
+
function emitPanelChange(nextDate, nextMode = currentMode) {
|
|
571
|
+
setInnerPanelDate(nextDate);
|
|
572
|
+
onPanelChange?.(formatDate(nextDate), nextMode);
|
|
573
|
+
}
|
|
574
|
+
function setCalendarMode(nextMode) {
|
|
575
|
+
if (mode === undefined) {
|
|
576
|
+
setInnerMode(nextMode);
|
|
577
|
+
}
|
|
578
|
+
onPanelChange?.(formatDate(panelDate), nextMode);
|
|
579
|
+
}
|
|
580
|
+
function commitValue(nextDate, source) {
|
|
581
|
+
const nextValue = source === "month" ? formatMonth(nextDate) : formatDate(nextDate);
|
|
582
|
+
if (disabledDate?.(nextValue) || isOutsideRange(nextDate, validRange)) {
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
if (value === undefined) {
|
|
586
|
+
setInnerValue(nextValue);
|
|
587
|
+
}
|
|
588
|
+
setInnerPanelDate(nextDate);
|
|
589
|
+
onSelect?.(nextValue, { source });
|
|
590
|
+
onChange?.(nextValue);
|
|
591
|
+
}
|
|
592
|
+
function renderDateCell(date) {
|
|
593
|
+
const dateValue = formatDate(date);
|
|
594
|
+
const originNode = /* @__PURE__ */ jsxs2("div", {
|
|
595
|
+
className: calendarCellContentClass,
|
|
596
|
+
children: [
|
|
597
|
+
/* @__PURE__ */ jsx2("span", {
|
|
598
|
+
children: date.getDate()
|
|
599
|
+
}),
|
|
600
|
+
dateCellRender?.(dateValue)
|
|
601
|
+
]
|
|
602
|
+
});
|
|
603
|
+
const info = {
|
|
604
|
+
originNode,
|
|
605
|
+
today,
|
|
606
|
+
type: "month"
|
|
802
607
|
};
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
608
|
+
const content = fullCellRender?.(dateValue, info) ?? dateFullCellRender?.(dateValue) ?? cellRender?.(dateValue, info) ?? originNode;
|
|
609
|
+
const disabled = disabledDate?.(dateValue) || isOutsideRange(date, validRange);
|
|
610
|
+
return /* @__PURE__ */ jsx2("button", {
|
|
611
|
+
type: "button",
|
|
612
|
+
"aria-label": dateValue,
|
|
613
|
+
disabled,
|
|
614
|
+
className: getCalendarCellClasses({
|
|
615
|
+
selected: dateValue === currentValue,
|
|
616
|
+
today: dateValue === today,
|
|
617
|
+
outside: !isSameMonth(date, panelDate),
|
|
618
|
+
disabled
|
|
619
|
+
}),
|
|
620
|
+
onClick: () => commitValue(date, "date"),
|
|
621
|
+
children: content
|
|
622
|
+
}, dateValue);
|
|
623
|
+
}
|
|
624
|
+
function renderMonthCell(month) {
|
|
625
|
+
const date = new Date(panelDate.getFullYear(), month, 1);
|
|
626
|
+
const dateValue = formatMonth(date);
|
|
627
|
+
const originNode = /* @__PURE__ */ jsxs2("div", {
|
|
628
|
+
className: calendarCellContentClass,
|
|
629
|
+
children: [
|
|
630
|
+
/* @__PURE__ */ jsx2("span", {
|
|
631
|
+
children: MONTHS[month]
|
|
632
|
+
}),
|
|
633
|
+
monthCellRender?.(dateValue)
|
|
634
|
+
]
|
|
635
|
+
});
|
|
636
|
+
const info = {
|
|
637
|
+
originNode,
|
|
638
|
+
today,
|
|
639
|
+
type: "year"
|
|
640
|
+
};
|
|
641
|
+
const content = fullCellRender?.(dateValue, info) ?? monthFullCellRender?.(dateValue) ?? cellRender?.(dateValue, info) ?? originNode;
|
|
642
|
+
const disabled = disabledDate?.(dateValue) || isOutsideRange(date, validRange);
|
|
643
|
+
return /* @__PURE__ */ jsx2("button", {
|
|
644
|
+
type: "button",
|
|
645
|
+
"aria-label": dateValue,
|
|
646
|
+
disabled,
|
|
647
|
+
className: getCalendarCellClasses({
|
|
648
|
+
selected: dateValue === formatMonth(parseDate(currentValue)),
|
|
649
|
+
today: dateValue === formatMonth(new Date),
|
|
650
|
+
disabled
|
|
651
|
+
}),
|
|
652
|
+
onClick: () => commitValue(date, "month"),
|
|
653
|
+
children: content
|
|
654
|
+
}, dateValue);
|
|
655
|
+
}
|
|
656
|
+
return /* @__PURE__ */ jsxs2("div", {
|
|
657
|
+
...props,
|
|
658
|
+
ref,
|
|
659
|
+
className: getCalendarClasses({
|
|
660
|
+
fullscreen,
|
|
661
|
+
mode: currentMode,
|
|
662
|
+
className
|
|
663
|
+
}),
|
|
823
664
|
children: [
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
665
|
+
headerRender ? headerRender({
|
|
666
|
+
value: formatDate(panelDate),
|
|
667
|
+
type: currentMode,
|
|
668
|
+
onChange: (nextValue) => emitPanelChange(parseDate(nextValue)),
|
|
669
|
+
onTypeChange: setCalendarMode
|
|
670
|
+
}) : /* @__PURE__ */ jsx2(Header, {
|
|
671
|
+
panelDate,
|
|
672
|
+
mode: currentMode,
|
|
673
|
+
setPanelDate: emitPanelChange,
|
|
674
|
+
setMode: setCalendarMode
|
|
675
|
+
}),
|
|
676
|
+
/* @__PURE__ */ jsx2("div", {
|
|
677
|
+
className: calendarBodyClass,
|
|
678
|
+
children: currentMode === "month" ? /* @__PURE__ */ jsxs2(Fragment2, {
|
|
679
|
+
children: [
|
|
680
|
+
/* @__PURE__ */ jsx2("div", {
|
|
681
|
+
className: calendarWeekdaysClass,
|
|
682
|
+
"aria-hidden": "true",
|
|
683
|
+
children: WEEKDAYS.map((weekday) => /* @__PURE__ */ jsx2("span", {
|
|
684
|
+
className: calendarWeekdayClass,
|
|
685
|
+
children: weekday
|
|
686
|
+
}, weekday))
|
|
687
|
+
}),
|
|
688
|
+
/* @__PURE__ */ jsx2("div", {
|
|
689
|
+
className: calendarDateGridClass,
|
|
690
|
+
children: dateGrid.map(renderDateCell)
|
|
691
|
+
})
|
|
692
|
+
]
|
|
693
|
+
}) : /* @__PURE__ */ jsx2("div", {
|
|
694
|
+
className: calendarMonthGridClass,
|
|
695
|
+
children: MONTHS.map((_, month) => renderMonthCell(month))
|
|
833
696
|
})
|
|
834
|
-
})
|
|
835
|
-
isRefreshVisible ? /* @__PURE__ */ jsxs3("button", {
|
|
836
|
-
type: "button",
|
|
837
|
-
className: getDmPaginationRefreshClasses({ loading }),
|
|
838
|
-
disabled: loading || props.disabled,
|
|
839
|
-
"aria-busy": loading || undefined,
|
|
840
|
-
onClick: refresh,
|
|
841
|
-
children: [
|
|
842
|
-
/* @__PURE__ */ jsx4("span", {
|
|
843
|
-
"aria-hidden": "true",
|
|
844
|
-
children: "Reload"
|
|
845
|
-
}),
|
|
846
|
-
/* @__PURE__ */ jsx4("span", {
|
|
847
|
-
children: mergedLocale.refresh
|
|
848
|
-
})
|
|
849
|
-
]
|
|
850
|
-
}) : null
|
|
697
|
+
})
|
|
851
698
|
]
|
|
852
699
|
});
|
|
853
700
|
});
|
|
854
|
-
|
|
855
|
-
// src/
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
var dmSearchFastFilterClass = "dm-search-fast-filter";
|
|
872
|
-
function getDmSearchClasses({
|
|
873
|
-
compact,
|
|
874
|
-
collapsed,
|
|
701
|
+
Calendar.displayName = "Calendar";
|
|
702
|
+
// src/classes/card.ts
|
|
703
|
+
var cardBaseClass = "card";
|
|
704
|
+
var cardAppearanceClasses = {
|
|
705
|
+
elevated: "card-elevated",
|
|
706
|
+
outline: "card-outline",
|
|
707
|
+
filled: "card-filled"
|
|
708
|
+
};
|
|
709
|
+
var cardPaddingClasses = {
|
|
710
|
+
none: "card-padding-none",
|
|
711
|
+
sm: "card-padding-sm",
|
|
712
|
+
md: "card-padding-md",
|
|
713
|
+
lg: "card-padding-lg"
|
|
714
|
+
};
|
|
715
|
+
function getCardClasses({
|
|
716
|
+
appearance = "elevated",
|
|
717
|
+
padding = "md",
|
|
875
718
|
className
|
|
876
719
|
}) {
|
|
877
|
-
return cn(
|
|
720
|
+
return cn(cardBaseClass, cardAppearanceClasses[appearance], cardPaddingClasses[padding], className);
|
|
878
721
|
}
|
|
879
722
|
|
|
880
|
-
// src/components/
|
|
881
|
-
import {
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
var calendarTitleClass = "calendar-title";
|
|
890
|
-
var calendarControlsClass = "calendar-controls";
|
|
891
|
-
var calendarNavClass = "calendar-nav";
|
|
892
|
-
var calendarModeClass = "calendar-mode";
|
|
893
|
-
var calendarWeekdaysClass = "calendar-weekdays";
|
|
894
|
-
var calendarWeekdayClass = "calendar-weekday";
|
|
895
|
-
var calendarBodyClass = "calendar-body";
|
|
896
|
-
var calendarDateGridClass = "calendar-date-grid";
|
|
897
|
-
var calendarMonthGridClass = "calendar-month-grid";
|
|
898
|
-
var calendarCellContentClass = "calendar-cell-content";
|
|
899
|
-
function getCalendarClasses({
|
|
900
|
-
fullscreen = true,
|
|
901
|
-
mode = "month",
|
|
902
|
-
className
|
|
723
|
+
// src/components/card/Card.tsx
|
|
724
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
725
|
+
function Card({
|
|
726
|
+
appearance = "elevated",
|
|
727
|
+
padding = "md",
|
|
728
|
+
className,
|
|
729
|
+
children,
|
|
730
|
+
ref,
|
|
731
|
+
...props
|
|
903
732
|
}) {
|
|
904
|
-
|
|
733
|
+
const classes = getCardClasses({
|
|
734
|
+
appearance,
|
|
735
|
+
padding,
|
|
736
|
+
className
|
|
737
|
+
});
|
|
738
|
+
return /* @__PURE__ */ jsx3("div", {
|
|
739
|
+
ref,
|
|
740
|
+
className: classes,
|
|
741
|
+
...props,
|
|
742
|
+
children
|
|
743
|
+
});
|
|
905
744
|
}
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
745
|
+
// src/components/date-picker/DatePicker.tsx
|
|
746
|
+
import { forwardRef as forwardRef2, useMemo as useMemo2, useState as useState3 } from "react";
|
|
747
|
+
|
|
748
|
+
// src/components/date-picker/usePickerDropdown.ts
|
|
749
|
+
import { useEffect, useId, useImperativeHandle, useRef, useState as useState2 } from "react";
|
|
750
|
+
function usePickerDropdown({
|
|
751
|
+
open,
|
|
752
|
+
defaultOpen,
|
|
910
753
|
disabled,
|
|
911
|
-
|
|
754
|
+
onOpenChange,
|
|
755
|
+
ref
|
|
912
756
|
}) {
|
|
913
|
-
|
|
757
|
+
const rootRef = useRef(null);
|
|
758
|
+
const inputRef = useRef(null);
|
|
759
|
+
const skipFocus = useRef(false);
|
|
760
|
+
const panelId = useId();
|
|
761
|
+
const [innerOpen, setInnerOpen] = useState2(Boolean(defaultOpen));
|
|
762
|
+
const visible = !disabled && (open ?? innerOpen);
|
|
763
|
+
useImperativeHandle(ref, () => rootRef.current, []);
|
|
764
|
+
function setVisible(next) {
|
|
765
|
+
if (disabled || next === visible)
|
|
766
|
+
return;
|
|
767
|
+
if (open === undefined)
|
|
768
|
+
setInnerOpen(next);
|
|
769
|
+
onOpenChange?.(next);
|
|
770
|
+
}
|
|
771
|
+
function closeAndFocus() {
|
|
772
|
+
skipFocus.current = true;
|
|
773
|
+
inputRef.current?.focus();
|
|
774
|
+
skipFocus.current = false;
|
|
775
|
+
setVisible(false);
|
|
776
|
+
}
|
|
777
|
+
useEffect(() => {
|
|
778
|
+
function handleOutside(event) {
|
|
779
|
+
if (visible && !rootRef.current?.contains(event.target))
|
|
780
|
+
setVisible(false);
|
|
781
|
+
}
|
|
782
|
+
function handleKeyDown(event) {
|
|
783
|
+
if (event.defaultPrevented || !rootRef.current?.contains(event.target))
|
|
784
|
+
return;
|
|
785
|
+
if (event.key === "Escape" && visible) {
|
|
786
|
+
event.preventDefault();
|
|
787
|
+
closeAndFocus();
|
|
788
|
+
} else if (event.key === "ArrowDown" && event.target === inputRef.current) {
|
|
789
|
+
event.preventDefault();
|
|
790
|
+
setVisible(true);
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
document.addEventListener("pointerdown", handleOutside);
|
|
794
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
795
|
+
return () => {
|
|
796
|
+
document.removeEventListener("pointerdown", handleOutside);
|
|
797
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
798
|
+
};
|
|
799
|
+
});
|
|
800
|
+
return {
|
|
801
|
+
rootRef,
|
|
802
|
+
inputRef,
|
|
803
|
+
panelId,
|
|
804
|
+
visible,
|
|
805
|
+
setVisible,
|
|
806
|
+
closeAndFocus,
|
|
807
|
+
onInputFocus: () => {
|
|
808
|
+
if (!skipFocus.current)
|
|
809
|
+
setVisible(true);
|
|
810
|
+
},
|
|
811
|
+
onRootBlur: (event) => {
|
|
812
|
+
if (!event.currentTarget.contains(event.relatedTarget))
|
|
813
|
+
setVisible(false);
|
|
814
|
+
}
|
|
815
|
+
};
|
|
914
816
|
}
|
|
915
817
|
|
|
916
|
-
// src/
|
|
917
|
-
|
|
918
|
-
var
|
|
919
|
-
var
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
"
|
|
929
|
-
"
|
|
930
|
-
"
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
}
|
|
936
|
-
|
|
937
|
-
|
|
818
|
+
// src/classes/date-picker.ts
|
|
819
|
+
var datePickerBaseClass = "datepicker";
|
|
820
|
+
var datePickerInputClass = "datepicker-input";
|
|
821
|
+
var datePickerIconClass = "datepicker-icon";
|
|
822
|
+
var datePickerDropdownClass = "datepicker-dropdown";
|
|
823
|
+
var datePickerDropdownOpenClass = "datepicker-dropdown-open";
|
|
824
|
+
var datePickerFooterClass = "datepicker-footer";
|
|
825
|
+
var datePickerPresetClass = "datepicker-preset";
|
|
826
|
+
var datePickerRangeClass = "datepicker-range";
|
|
827
|
+
var datePickerSeparatorClass = "datepicker-range-separator";
|
|
828
|
+
var datePickerClearClass = "datepicker-clear";
|
|
829
|
+
var datePickerSizeClasses = {
|
|
830
|
+
sm: "datepicker-sm",
|
|
831
|
+
md: "",
|
|
832
|
+
lg: "datepicker-lg"
|
|
833
|
+
};
|
|
834
|
+
var datePickerStatusClasses = {
|
|
835
|
+
error: "datepicker-error",
|
|
836
|
+
success: "datepicker-success"
|
|
837
|
+
};
|
|
838
|
+
var datePickerPickerClasses = {
|
|
839
|
+
date: "",
|
|
840
|
+
week: "datepicker-week",
|
|
841
|
+
month: "datepicker-month-picker",
|
|
842
|
+
quarter: "datepicker-quarter-picker",
|
|
843
|
+
year: "datepicker-year-picker",
|
|
844
|
+
time: "datepicker-time-picker"
|
|
845
|
+
};
|
|
846
|
+
function getDatePickerClasses({
|
|
847
|
+
size = "md",
|
|
848
|
+
status,
|
|
849
|
+
picker = "date",
|
|
850
|
+
open,
|
|
851
|
+
disabled,
|
|
852
|
+
range,
|
|
853
|
+
className
|
|
854
|
+
}) {
|
|
855
|
+
return cn(datePickerBaseClass, datePickerSizeClasses[size], status && datePickerStatusClasses[status], datePickerPickerClasses[picker], open && "datepicker-open", disabled && "datepicker-disabled", range && datePickerRangeClass, className);
|
|
938
856
|
}
|
|
939
|
-
function
|
|
940
|
-
|
|
857
|
+
function getDatePickerDropdownClasses({
|
|
858
|
+
open,
|
|
859
|
+
className
|
|
860
|
+
}) {
|
|
861
|
+
return cn(datePickerDropdownClass, open && datePickerDropdownOpenClass, className);
|
|
941
862
|
}
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
if (typeof value === "string" && value.length > 0) {
|
|
947
|
-
const [year, month = "1", day = "1"] = value.split("-");
|
|
948
|
-
const parsed = new Date(Number(year), Number(month) - 1, Number(day));
|
|
949
|
-
if (!Number.isNaN(parsed.getTime())) {
|
|
950
|
-
return parsed;
|
|
951
|
-
}
|
|
952
|
-
}
|
|
863
|
+
|
|
864
|
+
// src/components/date-picker/DatePicker.tsx
|
|
865
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
866
|
+
function todayValue(picker) {
|
|
953
867
|
const today = new Date;
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
}
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
const start = new Date(firstOfMonth);
|
|
965
|
-
start.setDate(firstOfMonth.getDate() - firstOfMonth.getDay());
|
|
966
|
-
return start;
|
|
967
|
-
}
|
|
968
|
-
function buildDateGrid(panelDate) {
|
|
969
|
-
const start = startOfCalendarGrid(panelDate);
|
|
970
|
-
return Array.from({ length: 42 }, (_, index) => {
|
|
971
|
-
const date = new Date(start);
|
|
972
|
-
date.setDate(start.getDate() + index);
|
|
973
|
-
return date;
|
|
974
|
-
});
|
|
868
|
+
const year = today.getFullYear();
|
|
869
|
+
const month = String(today.getMonth() + 1).padStart(2, "0");
|
|
870
|
+
const day = String(today.getDate()).padStart(2, "0");
|
|
871
|
+
if (picker === "month")
|
|
872
|
+
return `${year}-${month}`;
|
|
873
|
+
if (picker === "year")
|
|
874
|
+
return String(year);
|
|
875
|
+
if (picker === "time")
|
|
876
|
+
return "00:00";
|
|
877
|
+
return `${year}-${month}-${day}`;
|
|
975
878
|
}
|
|
976
|
-
function
|
|
977
|
-
|
|
879
|
+
function inputTypeForPicker(picker) {
|
|
880
|
+
if (picker === "month")
|
|
881
|
+
return "month";
|
|
882
|
+
if (picker === "week")
|
|
883
|
+
return "week";
|
|
884
|
+
if (picker === "time")
|
|
885
|
+
return "time";
|
|
886
|
+
return picker === "year" || picker === "quarter" ? "text" : "date";
|
|
978
887
|
}
|
|
979
|
-
function
|
|
980
|
-
if (
|
|
981
|
-
return
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
888
|
+
function placeholderForPicker(picker) {
|
|
889
|
+
if (picker === "month")
|
|
890
|
+
return "Select month";
|
|
891
|
+
if (picker === "week")
|
|
892
|
+
return "Select week";
|
|
893
|
+
if (picker === "quarter")
|
|
894
|
+
return "Select quarter";
|
|
895
|
+
if (picker === "year")
|
|
896
|
+
return "Select year";
|
|
897
|
+
if (picker === "time")
|
|
898
|
+
return "Select time";
|
|
899
|
+
return "Select date";
|
|
987
900
|
}
|
|
988
|
-
function
|
|
989
|
-
|
|
990
|
-
mode,
|
|
991
|
-
setPanelDate,
|
|
992
|
-
setMode
|
|
993
|
-
}) {
|
|
994
|
-
const title = mode === "year" ? String(panelDate.getFullYear()) : `${MONTHS[panelDate.getMonth()]} ${panelDate.getFullYear()}`;
|
|
995
|
-
return /* @__PURE__ */ jsxs4("div", {
|
|
996
|
-
className: calendarHeaderClass,
|
|
997
|
-
children: [
|
|
998
|
-
/* @__PURE__ */ jsx5("button", {
|
|
999
|
-
type: "button",
|
|
1000
|
-
className: calendarNavClass,
|
|
1001
|
-
"aria-label": "Previous panel",
|
|
1002
|
-
onClick: () => setPanelDate(mode === "year" ? addYears(panelDate, -1) : addMonths(panelDate, -1), mode),
|
|
1003
|
-
children: /* @__PURE__ */ jsx5("svg", {
|
|
1004
|
-
"aria-hidden": "true",
|
|
1005
|
-
focusable: "false",
|
|
1006
|
-
width: "16",
|
|
1007
|
-
height: "16",
|
|
1008
|
-
viewBox: "0 0 24 24",
|
|
1009
|
-
fill: "none",
|
|
1010
|
-
stroke: "currentColor",
|
|
1011
|
-
strokeWidth: "2",
|
|
1012
|
-
strokeLinecap: "round",
|
|
1013
|
-
strokeLinejoin: "round",
|
|
1014
|
-
children: /* @__PURE__ */ jsx5("path", {
|
|
1015
|
-
d: "m15 18-6-6 6-6"
|
|
1016
|
-
})
|
|
1017
|
-
})
|
|
1018
|
-
}),
|
|
1019
|
-
/* @__PURE__ */ jsxs4("div", {
|
|
1020
|
-
className: calendarControlsClass,
|
|
1021
|
-
children: [
|
|
1022
|
-
/* @__PURE__ */ jsx5("div", {
|
|
1023
|
-
className: calendarTitleClass,
|
|
1024
|
-
children: title
|
|
1025
|
-
}),
|
|
1026
|
-
/* @__PURE__ */ jsxs4("div", {
|
|
1027
|
-
className: calendarModeClass,
|
|
1028
|
-
children: [
|
|
1029
|
-
/* @__PURE__ */ jsx5("button", {
|
|
1030
|
-
type: "button",
|
|
1031
|
-
"aria-pressed": mode === "month",
|
|
1032
|
-
onClick: () => setMode("month"),
|
|
1033
|
-
children: "Month"
|
|
1034
|
-
}),
|
|
1035
|
-
/* @__PURE__ */ jsx5("button", {
|
|
1036
|
-
type: "button",
|
|
1037
|
-
"aria-pressed": mode === "year",
|
|
1038
|
-
onClick: () => setMode("year"),
|
|
1039
|
-
children: "Year"
|
|
1040
|
-
})
|
|
1041
|
-
]
|
|
1042
|
-
})
|
|
1043
|
-
]
|
|
1044
|
-
}),
|
|
1045
|
-
/* @__PURE__ */ jsx5("button", {
|
|
1046
|
-
type: "button",
|
|
1047
|
-
className: calendarNavClass,
|
|
1048
|
-
"aria-label": "Next panel",
|
|
1049
|
-
onClick: () => setPanelDate(mode === "year" ? addYears(panelDate, 1) : addMonths(panelDate, 1), mode),
|
|
1050
|
-
children: /* @__PURE__ */ jsx5("svg", {
|
|
1051
|
-
"aria-hidden": "true",
|
|
1052
|
-
focusable: "false",
|
|
1053
|
-
width: "16",
|
|
1054
|
-
height: "16",
|
|
1055
|
-
viewBox: "0 0 24 24",
|
|
1056
|
-
fill: "none",
|
|
1057
|
-
stroke: "currentColor",
|
|
1058
|
-
strokeWidth: "2",
|
|
1059
|
-
strokeLinecap: "round",
|
|
1060
|
-
strokeLinejoin: "round",
|
|
1061
|
-
children: /* @__PURE__ */ jsx5("path", {
|
|
1062
|
-
d: "m9 18 6-6-6-6"
|
|
1063
|
-
})
|
|
1064
|
-
})
|
|
1065
|
-
})
|
|
1066
|
-
]
|
|
1067
|
-
});
|
|
901
|
+
function normalizeDateValue(value) {
|
|
902
|
+
return typeof value === "string" && value.length > 0 ? value : undefined;
|
|
1068
903
|
}
|
|
1069
|
-
var
|
|
904
|
+
var DatePickerRoot = forwardRef2(({
|
|
905
|
+
allowClear,
|
|
1070
906
|
className,
|
|
1071
|
-
|
|
907
|
+
inputProps,
|
|
908
|
+
defaultOpen,
|
|
1072
909
|
defaultValue,
|
|
1073
|
-
|
|
1074
|
-
defaultMode = "month",
|
|
1075
|
-
fullscreen = true,
|
|
1076
|
-
validRange,
|
|
910
|
+
disabled,
|
|
1077
911
|
disabledDate,
|
|
1078
|
-
|
|
1079
|
-
dateFullCellRender,
|
|
1080
|
-
monthCellRender,
|
|
1081
|
-
monthFullCellRender,
|
|
1082
|
-
cellRender,
|
|
1083
|
-
fullCellRender,
|
|
1084
|
-
headerRender,
|
|
912
|
+
onBlur,
|
|
1085
913
|
onChange,
|
|
1086
|
-
|
|
1087
|
-
|
|
914
|
+
onFocus,
|
|
915
|
+
onOpenChange,
|
|
916
|
+
open,
|
|
917
|
+
picker = "date",
|
|
918
|
+
placeholder,
|
|
919
|
+
presets,
|
|
920
|
+
showNow,
|
|
921
|
+
size = "md",
|
|
922
|
+
status,
|
|
923
|
+
value,
|
|
1088
924
|
...props
|
|
1089
925
|
}, ref) => {
|
|
1090
|
-
const
|
|
1091
|
-
const
|
|
1092
|
-
const [
|
|
1093
|
-
const
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
}
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
return;
|
|
1112
|
-
}
|
|
1113
|
-
if (value === undefined) {
|
|
1114
|
-
setInnerValue(nextValue);
|
|
1115
|
-
}
|
|
1116
|
-
setInnerPanelDate(nextDate);
|
|
1117
|
-
onSelect?.(nextValue, { source });
|
|
1118
|
-
onChange?.(nextValue);
|
|
1119
|
-
}
|
|
1120
|
-
function renderDateCell(date) {
|
|
1121
|
-
const dateValue = formatDate(date);
|
|
1122
|
-
const originNode = /* @__PURE__ */ jsxs4("div", {
|
|
1123
|
-
className: calendarCellContentClass,
|
|
1124
|
-
children: [
|
|
1125
|
-
/* @__PURE__ */ jsx5("span", {
|
|
1126
|
-
children: date.getDate()
|
|
1127
|
-
}),
|
|
1128
|
-
dateCellRender?.(dateValue)
|
|
1129
|
-
]
|
|
1130
|
-
});
|
|
1131
|
-
const info = {
|
|
1132
|
-
originNode,
|
|
1133
|
-
today,
|
|
1134
|
-
type: "month"
|
|
1135
|
-
};
|
|
1136
|
-
const content = fullCellRender?.(dateValue, info) ?? dateFullCellRender?.(dateValue) ?? cellRender?.(dateValue, info) ?? originNode;
|
|
1137
|
-
const disabled = disabledDate?.(dateValue) || isOutsideRange(date, validRange);
|
|
1138
|
-
return /* @__PURE__ */ jsx5("button", {
|
|
1139
|
-
type: "button",
|
|
1140
|
-
"aria-label": dateValue,
|
|
1141
|
-
disabled,
|
|
1142
|
-
className: getCalendarCellClasses({
|
|
1143
|
-
selected: dateValue === currentValue,
|
|
1144
|
-
today: dateValue === today,
|
|
1145
|
-
outside: !isSameMonth(date, panelDate),
|
|
1146
|
-
disabled
|
|
1147
|
-
}),
|
|
1148
|
-
onClick: () => commitValue(date, "date"),
|
|
1149
|
-
children: content
|
|
1150
|
-
}, dateValue);
|
|
926
|
+
const [calendarMode, setCalendarMode] = useState3("month");
|
|
927
|
+
const isValueControlled = value !== undefined;
|
|
928
|
+
const [innerValue, setInnerValue] = useState3(() => normalizeDateValue(defaultValue));
|
|
929
|
+
const dropdown = usePickerDropdown({
|
|
930
|
+
open,
|
|
931
|
+
defaultOpen,
|
|
932
|
+
disabled,
|
|
933
|
+
onOpenChange,
|
|
934
|
+
ref
|
|
935
|
+
});
|
|
936
|
+
const currentValue = isValueControlled ? normalizeDateValue(value) : innerValue;
|
|
937
|
+
const { visible, setVisible } = dropdown;
|
|
938
|
+
const inputType = inputTypeForPicker(picker);
|
|
939
|
+
function emitChange(nextValue) {
|
|
940
|
+
if (nextValue && disabledDate?.(nextValue)) {
|
|
941
|
+
return;
|
|
942
|
+
}
|
|
943
|
+
if (!isValueControlled) {
|
|
944
|
+
setInnerValue(nextValue);
|
|
945
|
+
}
|
|
946
|
+
onChange?.(nextValue, nextValue ?? "");
|
|
1151
947
|
}
|
|
1152
|
-
function
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
children: [
|
|
1158
|
-
/* @__PURE__ */ jsx5("span", {
|
|
1159
|
-
children: MONTHS[month]
|
|
1160
|
-
}),
|
|
1161
|
-
monthCellRender?.(dateValue)
|
|
1162
|
-
]
|
|
1163
|
-
});
|
|
1164
|
-
const info = {
|
|
1165
|
-
originNode,
|
|
1166
|
-
today,
|
|
1167
|
-
type: "year"
|
|
1168
|
-
};
|
|
1169
|
-
const content = fullCellRender?.(dateValue, info) ?? monthFullCellRender?.(dateValue) ?? cellRender?.(dateValue, info) ?? originNode;
|
|
1170
|
-
const disabled = disabledDate?.(dateValue) || isOutsideRange(date, validRange);
|
|
1171
|
-
return /* @__PURE__ */ jsx5("button", {
|
|
1172
|
-
type: "button",
|
|
1173
|
-
"aria-label": dateValue,
|
|
1174
|
-
disabled,
|
|
1175
|
-
className: getCalendarCellClasses({
|
|
1176
|
-
selected: dateValue === formatMonth(parseDate(currentValue)),
|
|
1177
|
-
today: dateValue === formatMonth(new Date),
|
|
1178
|
-
disabled
|
|
1179
|
-
}),
|
|
1180
|
-
onClick: () => commitValue(date, "month"),
|
|
1181
|
-
children: content
|
|
1182
|
-
}, dateValue);
|
|
948
|
+
function selectValue(nextValue) {
|
|
949
|
+
if (disabledDate?.(nextValue))
|
|
950
|
+
return;
|
|
951
|
+
emitChange(nextValue);
|
|
952
|
+
dropdown.closeAndFocus();
|
|
1183
953
|
}
|
|
1184
|
-
|
|
954
|
+
const presetItems = useMemo2(() => presets ?? [], [presets]);
|
|
955
|
+
return /* @__PURE__ */ jsxs3("div", {
|
|
1185
956
|
...props,
|
|
1186
|
-
ref,
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
957
|
+
ref: dropdown.rootRef,
|
|
958
|
+
onBlur: dropdown.onRootBlur,
|
|
959
|
+
className: getDatePickerClasses({
|
|
960
|
+
size,
|
|
961
|
+
status,
|
|
962
|
+
picker,
|
|
963
|
+
open: visible,
|
|
964
|
+
disabled,
|
|
1190
965
|
className
|
|
1191
966
|
}),
|
|
1192
967
|
children: [
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
968
|
+
/* @__PURE__ */ jsx4("input", {
|
|
969
|
+
...inputProps,
|
|
970
|
+
ref: dropdown.inputRef,
|
|
971
|
+
"aria-haspopup": "dialog",
|
|
972
|
+
"aria-controls": visible ? dropdown.panelId : undefined,
|
|
973
|
+
className: datePickerInputClass,
|
|
974
|
+
disabled,
|
|
975
|
+
type: inputType,
|
|
976
|
+
value: currentValue ?? "",
|
|
977
|
+
placeholder: placeholder ?? placeholderForPicker(picker),
|
|
978
|
+
onFocus: (event) => {
|
|
979
|
+
onFocus?.(event);
|
|
980
|
+
dropdown.onInputFocus();
|
|
981
|
+
},
|
|
982
|
+
onBlur: (event) => {
|
|
983
|
+
onBlur?.(event);
|
|
984
|
+
},
|
|
985
|
+
onClick: () => setVisible(true),
|
|
986
|
+
onChange: (event) => emitChange(event.currentTarget.value || undefined)
|
|
1203
987
|
}),
|
|
1204
|
-
/* @__PURE__ */
|
|
1205
|
-
|
|
1206
|
-
|
|
988
|
+
allowClear && currentValue && !disabled ? /* @__PURE__ */ jsx4("button", {
|
|
989
|
+
type: "button",
|
|
990
|
+
className: datePickerClearClass,
|
|
991
|
+
"aria-label": "Clear date",
|
|
992
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
993
|
+
onClick: () => emitChange(undefined),
|
|
994
|
+
children: "x"
|
|
995
|
+
}) : null,
|
|
996
|
+
/* @__PURE__ */ jsx4("button", {
|
|
997
|
+
type: "button",
|
|
998
|
+
className: datePickerIconClass,
|
|
999
|
+
"aria-label": "Open date picker",
|
|
1000
|
+
"aria-haspopup": "dialog",
|
|
1001
|
+
"aria-expanded": visible,
|
|
1002
|
+
"aria-controls": visible ? dropdown.panelId : undefined,
|
|
1003
|
+
disabled,
|
|
1004
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
1005
|
+
onClick: () => setVisible(!visible),
|
|
1006
|
+
children: /* @__PURE__ */ jsxs3("svg", {
|
|
1007
|
+
"aria-hidden": "true",
|
|
1008
|
+
focusable: "false",
|
|
1009
|
+
width: "18",
|
|
1010
|
+
height: "18",
|
|
1011
|
+
viewBox: "0 0 24 24",
|
|
1012
|
+
fill: "none",
|
|
1013
|
+
stroke: "currentColor",
|
|
1014
|
+
strokeWidth: "1.75",
|
|
1015
|
+
strokeLinecap: "round",
|
|
1016
|
+
strokeLinejoin: "round",
|
|
1207
1017
|
children: [
|
|
1208
|
-
/* @__PURE__ */
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
}, weekday))
|
|
1018
|
+
/* @__PURE__ */ jsx4("rect", {
|
|
1019
|
+
x: "3",
|
|
1020
|
+
y: "5",
|
|
1021
|
+
width: "18",
|
|
1022
|
+
height: "16",
|
|
1023
|
+
rx: "2"
|
|
1215
1024
|
}),
|
|
1216
|
-
/* @__PURE__ */
|
|
1217
|
-
|
|
1218
|
-
children: dateGrid.map(renderDateCell)
|
|
1025
|
+
/* @__PURE__ */ jsx4("path", {
|
|
1026
|
+
d: "M8 3v4M16 3v4M3 10h18"
|
|
1219
1027
|
})
|
|
1220
1028
|
]
|
|
1221
|
-
}) : /* @__PURE__ */ jsx5("div", {
|
|
1222
|
-
className: calendarMonthGridClass,
|
|
1223
|
-
children: MONTHS.map((_, month) => renderMonthCell(month))
|
|
1224
1029
|
})
|
|
1225
|
-
})
|
|
1030
|
+
}),
|
|
1031
|
+
visible ? /* @__PURE__ */ jsxs3("div", {
|
|
1032
|
+
id: dropdown.panelId,
|
|
1033
|
+
role: "dialog",
|
|
1034
|
+
"aria-label": "Choose date",
|
|
1035
|
+
className: getDatePickerDropdownClasses({ open: visible }),
|
|
1036
|
+
children: [
|
|
1037
|
+
picker === "date" || picker === "month" ? /* @__PURE__ */ jsx4(Calendar, {
|
|
1038
|
+
fullscreen: false,
|
|
1039
|
+
value: currentValue,
|
|
1040
|
+
mode: picker === "month" ? "year" : calendarMode,
|
|
1041
|
+
onPanelChange: (_, mode) => {
|
|
1042
|
+
if (picker === "date")
|
|
1043
|
+
setCalendarMode(mode);
|
|
1044
|
+
},
|
|
1045
|
+
disabledDate: (date) => {
|
|
1046
|
+
if (!disabledDate)
|
|
1047
|
+
return false;
|
|
1048
|
+
if (picker === "month")
|
|
1049
|
+
return disabledDate(date.slice(0, 7));
|
|
1050
|
+
if (calendarMode === "year") {
|
|
1051
|
+
const [year, month] = date.split("-").map(Number);
|
|
1052
|
+
const days = new Date(year, month, 0).getDate();
|
|
1053
|
+
return Array.from({ length: days }, (_, index) => `${date.slice(0, 7)}-${String(index + 1).padStart(2, "0")}`).every((day) => disabledDate(day));
|
|
1054
|
+
}
|
|
1055
|
+
return disabledDate(date);
|
|
1056
|
+
},
|
|
1057
|
+
onSelect: (date, info) => {
|
|
1058
|
+
if (picker === "date" && info.source === "month") {
|
|
1059
|
+
setCalendarMode("month");
|
|
1060
|
+
return;
|
|
1061
|
+
}
|
|
1062
|
+
selectValue(picker === "month" ? date.slice(0, 7) : date);
|
|
1063
|
+
}
|
|
1064
|
+
}) : /* @__PURE__ */ jsx4("input", {
|
|
1065
|
+
type: inputType,
|
|
1066
|
+
"aria-label": placeholderForPicker(picker),
|
|
1067
|
+
value: currentValue ?? "",
|
|
1068
|
+
onChange: (event) => selectValue(event.currentTarget.value)
|
|
1069
|
+
}),
|
|
1070
|
+
presetItems.map((preset, index) => /* @__PURE__ */ jsx4("button", {
|
|
1071
|
+
type: "button",
|
|
1072
|
+
className: datePickerPresetClass,
|
|
1073
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
1074
|
+
disabled: Boolean(disabledDate?.(preset.value)),
|
|
1075
|
+
onClick: () => selectValue(preset.value),
|
|
1076
|
+
children: preset.label
|
|
1077
|
+
}, index)),
|
|
1078
|
+
showNow ? /* @__PURE__ */ jsx4("div", {
|
|
1079
|
+
className: datePickerFooterClass,
|
|
1080
|
+
children: /* @__PURE__ */ jsx4("button", {
|
|
1081
|
+
type: "button",
|
|
1082
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
1083
|
+
disabled: Boolean(disabledDate?.(todayValue(picker))),
|
|
1084
|
+
onClick: () => selectValue(todayValue(picker)),
|
|
1085
|
+
children: "Now"
|
|
1086
|
+
})
|
|
1087
|
+
}) : null
|
|
1088
|
+
]
|
|
1089
|
+
}) : null
|
|
1226
1090
|
]
|
|
1227
1091
|
});
|
|
1228
1092
|
});
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1093
|
+
DatePickerRoot.displayName = "DatePicker";
|
|
1094
|
+
var RangePicker = forwardRef2(({
|
|
1095
|
+
allowClear,
|
|
1096
|
+
className,
|
|
1097
|
+
inputProps,
|
|
1098
|
+
defaultValue,
|
|
1235
1099
|
disabled,
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
function closeAndFocus() {
|
|
1254
|
-
skipFocus.current = true;
|
|
1255
|
-
inputRef.current?.focus();
|
|
1256
|
-
skipFocus.current = false;
|
|
1257
|
-
setVisible(false);
|
|
1258
|
-
}
|
|
1259
|
-
useEffect2(() => {
|
|
1260
|
-
function handleOutside(event) {
|
|
1261
|
-
if (visible && !rootRef.current?.contains(event.target))
|
|
1262
|
-
setVisible(false);
|
|
1263
|
-
}
|
|
1264
|
-
function handleKeyDown(event) {
|
|
1265
|
-
if (event.defaultPrevented || !rootRef.current?.contains(event.target))
|
|
1266
|
-
return;
|
|
1267
|
-
if (event.key === "Escape" && visible) {
|
|
1268
|
-
event.preventDefault();
|
|
1269
|
-
closeAndFocus();
|
|
1270
|
-
} else if (event.key === "ArrowDown" && event.target === inputRef.current) {
|
|
1271
|
-
event.preventDefault();
|
|
1272
|
-
setVisible(true);
|
|
1273
|
-
}
|
|
1274
|
-
}
|
|
1275
|
-
document.addEventListener("pointerdown", handleOutside);
|
|
1276
|
-
document.addEventListener("keydown", handleKeyDown);
|
|
1277
|
-
return () => {
|
|
1278
|
-
document.removeEventListener("pointerdown", handleOutside);
|
|
1279
|
-
document.removeEventListener("keydown", handleKeyDown);
|
|
1280
|
-
};
|
|
1281
|
-
});
|
|
1282
|
-
return {
|
|
1283
|
-
rootRef,
|
|
1284
|
-
inputRef,
|
|
1285
|
-
panelId,
|
|
1286
|
-
visible,
|
|
1287
|
-
setVisible,
|
|
1288
|
-
closeAndFocus,
|
|
1289
|
-
onInputFocus: () => {
|
|
1290
|
-
if (!skipFocus.current)
|
|
1291
|
-
setVisible(true);
|
|
1292
|
-
},
|
|
1293
|
-
onRootBlur: (event) => {
|
|
1294
|
-
if (!event.currentTarget.contains(event.relatedTarget))
|
|
1295
|
-
setVisible(false);
|
|
1100
|
+
disabledDate,
|
|
1101
|
+
onChange,
|
|
1102
|
+
picker = "date",
|
|
1103
|
+
placeholder,
|
|
1104
|
+
separator = "-",
|
|
1105
|
+
size = "md",
|
|
1106
|
+
status,
|
|
1107
|
+
value,
|
|
1108
|
+
...props
|
|
1109
|
+
}, ref) => {
|
|
1110
|
+
const isControlled = value !== undefined;
|
|
1111
|
+
const [innerValue, setInnerValue] = useState3(defaultValue ?? [undefined, undefined]);
|
|
1112
|
+
const currentValue = isControlled ? value : innerValue;
|
|
1113
|
+
const inputType = inputTypeForPicker(picker);
|
|
1114
|
+
function emitChange(nextValue) {
|
|
1115
|
+
if (nextValue.some((item) => item !== undefined && Boolean(disabledDate?.(item)))) {
|
|
1116
|
+
return;
|
|
1296
1117
|
}
|
|
1297
|
-
|
|
1118
|
+
if (!isControlled) {
|
|
1119
|
+
setInnerValue(nextValue);
|
|
1120
|
+
}
|
|
1121
|
+
onChange?.(nextValue, [nextValue[0] ?? "", nextValue[1] ?? ""]);
|
|
1122
|
+
}
|
|
1123
|
+
function updateIndex(index, nextItem) {
|
|
1124
|
+
emitChange(index === 0 ? [nextItem, currentValue?.[1]] : [currentValue?.[0], nextItem]);
|
|
1125
|
+
}
|
|
1126
|
+
return /* @__PURE__ */ jsxs3("div", {
|
|
1127
|
+
...props,
|
|
1128
|
+
ref,
|
|
1129
|
+
className: getDatePickerClasses({
|
|
1130
|
+
size,
|
|
1131
|
+
status,
|
|
1132
|
+
picker,
|
|
1133
|
+
disabled,
|
|
1134
|
+
range: true,
|
|
1135
|
+
className
|
|
1136
|
+
}),
|
|
1137
|
+
children: [
|
|
1138
|
+
/* @__PURE__ */ jsx4("input", {
|
|
1139
|
+
...inputProps,
|
|
1140
|
+
className: datePickerInputClass,
|
|
1141
|
+
disabled,
|
|
1142
|
+
type: inputType,
|
|
1143
|
+
value: currentValue?.[0] ?? "",
|
|
1144
|
+
placeholder: Array.isArray(placeholder) ? placeholder[0] : "Start date",
|
|
1145
|
+
onChange: (event) => updateIndex(0, event.currentTarget.value || undefined)
|
|
1146
|
+
}),
|
|
1147
|
+
/* @__PURE__ */ jsx4("span", {
|
|
1148
|
+
className: datePickerSeparatorClass,
|
|
1149
|
+
children: separator
|
|
1150
|
+
}),
|
|
1151
|
+
/* @__PURE__ */ jsx4("input", {
|
|
1152
|
+
...inputProps,
|
|
1153
|
+
id: inputProps?.id ? `${inputProps.id}-end` : undefined,
|
|
1154
|
+
className: datePickerInputClass,
|
|
1155
|
+
disabled,
|
|
1156
|
+
type: inputType,
|
|
1157
|
+
value: currentValue?.[1] ?? "",
|
|
1158
|
+
placeholder: Array.isArray(placeholder) ? placeholder[1] : "End date",
|
|
1159
|
+
onChange: (event) => updateIndex(1, event.currentTarget.value || undefined)
|
|
1160
|
+
}),
|
|
1161
|
+
allowClear && (currentValue?.[0] || currentValue?.[1]) && !disabled ? /* @__PURE__ */ jsx4("button", {
|
|
1162
|
+
type: "button",
|
|
1163
|
+
className: datePickerClearClass,
|
|
1164
|
+
"aria-label": "Clear date range",
|
|
1165
|
+
onClick: () => emitChange([undefined, undefined]),
|
|
1166
|
+
children: "x"
|
|
1167
|
+
}) : null
|
|
1168
|
+
]
|
|
1169
|
+
});
|
|
1170
|
+
});
|
|
1171
|
+
RangePicker.displayName = "DatePicker.RangePicker";
|
|
1172
|
+
function withPicker(picker, displayName) {
|
|
1173
|
+
const Picker = forwardRef2((props, ref) => /* @__PURE__ */ jsx4(DatePickerRoot, {
|
|
1174
|
+
...props,
|
|
1175
|
+
ref,
|
|
1176
|
+
picker
|
|
1177
|
+
}));
|
|
1178
|
+
Picker.displayName = displayName;
|
|
1179
|
+
return Picker;
|
|
1298
1180
|
}
|
|
1181
|
+
var DatePicker = Object.assign(DatePickerRoot, {
|
|
1182
|
+
RangePicker,
|
|
1183
|
+
WeekPicker: withPicker("week", "DatePicker.WeekPicker"),
|
|
1184
|
+
MonthPicker: withPicker("month", "DatePicker.MonthPicker"),
|
|
1185
|
+
QuarterPicker: withPicker("quarter", "DatePicker.QuarterPicker"),
|
|
1186
|
+
YearPicker: withPicker("year", "DatePicker.YearPicker")
|
|
1187
|
+
});
|
|
1188
|
+
// src/components/pagination/Pagination.tsx
|
|
1189
|
+
import {
|
|
1190
|
+
forwardRef as forwardRef3,
|
|
1191
|
+
useMemo as useMemo3,
|
|
1192
|
+
useState as useState4
|
|
1193
|
+
} from "react";
|
|
1299
1194
|
|
|
1300
|
-
// src/classes/
|
|
1301
|
-
var
|
|
1302
|
-
var
|
|
1303
|
-
var
|
|
1304
|
-
var
|
|
1305
|
-
var
|
|
1306
|
-
var
|
|
1307
|
-
var
|
|
1308
|
-
var
|
|
1309
|
-
var
|
|
1310
|
-
var
|
|
1311
|
-
var
|
|
1312
|
-
|
|
1195
|
+
// src/classes/pagination.ts
|
|
1196
|
+
var paginationBaseClass = "pagination";
|
|
1197
|
+
var paginationItemClass = "pagination-item";
|
|
1198
|
+
var paginationItemActiveClass = "pagination-item-active";
|
|
1199
|
+
var paginationItemDisabledClass = "pagination-item-disabled";
|
|
1200
|
+
var paginationPrevClass = "pagination-prev";
|
|
1201
|
+
var paginationNextClass = "pagination-next";
|
|
1202
|
+
var paginationEllipsisClass = "pagination-ellipsis";
|
|
1203
|
+
var paginationCompactClass = "pagination-compact";
|
|
1204
|
+
var paginationInfoClass = "pagination-info";
|
|
1205
|
+
var paginationInfoTextClass = "pagination-info-text";
|
|
1206
|
+
var paginationInputClass = "pagination-input";
|
|
1207
|
+
var paginationResponsiveClass = "pagination-responsive";
|
|
1208
|
+
var paginationSizeClasses = {
|
|
1209
|
+
sm: "pagination-sm",
|
|
1313
1210
|
md: "",
|
|
1314
|
-
lg: "
|
|
1315
|
-
};
|
|
1316
|
-
var datePickerStatusClasses = {
|
|
1317
|
-
error: "datepicker-error",
|
|
1318
|
-
success: "datepicker-success"
|
|
1319
|
-
};
|
|
1320
|
-
var datePickerPickerClasses = {
|
|
1321
|
-
date: "",
|
|
1322
|
-
week: "datepicker-week",
|
|
1323
|
-
month: "datepicker-month-picker",
|
|
1324
|
-
quarter: "datepicker-quarter-picker",
|
|
1325
|
-
year: "datepicker-year-picker",
|
|
1326
|
-
time: "datepicker-time-picker"
|
|
1211
|
+
lg: "pagination-lg"
|
|
1327
1212
|
};
|
|
1328
|
-
function
|
|
1213
|
+
function getPaginationClasses({
|
|
1329
1214
|
size = "md",
|
|
1330
|
-
|
|
1331
|
-
picker = "date",
|
|
1332
|
-
open,
|
|
1333
|
-
disabled,
|
|
1334
|
-
range,
|
|
1215
|
+
compact,
|
|
1335
1216
|
className
|
|
1336
1217
|
}) {
|
|
1337
|
-
return cn(
|
|
1218
|
+
return cn(paginationBaseClass, paginationResponsiveClass, paginationSizeClasses[size], compact && paginationCompactClass, className);
|
|
1338
1219
|
}
|
|
1339
|
-
function
|
|
1340
|
-
|
|
1341
|
-
|
|
1220
|
+
function getPaginationItemClasses({
|
|
1221
|
+
active,
|
|
1222
|
+
disabled
|
|
1342
1223
|
}) {
|
|
1343
|
-
return cn(
|
|
1224
|
+
return cn(paginationItemClass, active && paginationItemActiveClass, disabled && paginationItemDisabledClass);
|
|
1344
1225
|
}
|
|
1345
1226
|
|
|
1346
|
-
// src/components/
|
|
1347
|
-
import { jsx as
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
return `${year}-${month}`;
|
|
1355
|
-
if (picker === "year")
|
|
1356
|
-
return String(year);
|
|
1357
|
-
if (picker === "time")
|
|
1358
|
-
return "00:00";
|
|
1359
|
-
return `${year}-${month}-${day}`;
|
|
1227
|
+
// src/components/pagination/Pagination.tsx
|
|
1228
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1229
|
+
var defaultPageSizeOptions = [10, 20, 50, 100];
|
|
1230
|
+
function toPositiveInteger(value, fallback) {
|
|
1231
|
+
if (!Number.isFinite(value) || value === undefined) {
|
|
1232
|
+
return fallback;
|
|
1233
|
+
}
|
|
1234
|
+
return Math.max(1, Math.floor(value));
|
|
1360
1235
|
}
|
|
1361
|
-
function
|
|
1362
|
-
|
|
1363
|
-
return "month";
|
|
1364
|
-
if (picker === "week")
|
|
1365
|
-
return "week";
|
|
1366
|
-
if (picker === "time")
|
|
1367
|
-
return "time";
|
|
1368
|
-
return picker === "year" || picker === "quarter" ? "text" : "date";
|
|
1236
|
+
function clampPage(page, pageCount) {
|
|
1237
|
+
return Math.min(pageCount, Math.max(1, Math.floor(page)));
|
|
1369
1238
|
}
|
|
1370
|
-
function
|
|
1371
|
-
|
|
1372
|
-
return "Select month";
|
|
1373
|
-
if (picker === "week")
|
|
1374
|
-
return "Select week";
|
|
1375
|
-
if (picker === "quarter")
|
|
1376
|
-
return "Select quarter";
|
|
1377
|
-
if (picker === "year")
|
|
1378
|
-
return "Select year";
|
|
1379
|
-
if (picker === "time")
|
|
1380
|
-
return "Select time";
|
|
1381
|
-
return "Select date";
|
|
1239
|
+
function getPageCount(total, pageSize) {
|
|
1240
|
+
return Math.max(1, Math.ceil(Math.max(0, total) / pageSize));
|
|
1382
1241
|
}
|
|
1383
|
-
function
|
|
1384
|
-
|
|
1242
|
+
function getRange(current, pageSize, total) {
|
|
1243
|
+
if (total <= 0) {
|
|
1244
|
+
return [0, 0];
|
|
1245
|
+
}
|
|
1246
|
+
const start = (current - 1) * pageSize + 1;
|
|
1247
|
+
const end = Math.min(total, current * pageSize);
|
|
1248
|
+
return [start, end];
|
|
1385
1249
|
}
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1250
|
+
function getPageTokens(current, pageCount) {
|
|
1251
|
+
if (pageCount <= 7) {
|
|
1252
|
+
return Array.from({ length: pageCount }, (_, index) => index + 1);
|
|
1253
|
+
}
|
|
1254
|
+
const pages = new Set([1, pageCount, current - 1, current, current + 1]);
|
|
1255
|
+
if (current <= 4) {
|
|
1256
|
+
[2, 3, 4, 5].forEach((page) => pages.add(page));
|
|
1257
|
+
}
|
|
1258
|
+
if (current >= pageCount - 3) {
|
|
1259
|
+
[pageCount - 4, pageCount - 3, pageCount - 2, pageCount - 1].forEach((page) => pages.add(page));
|
|
1260
|
+
}
|
|
1261
|
+
const sortedPages = Array.from(pages).filter((page) => page >= 1 && page <= pageCount).sort((first, second) => first - second);
|
|
1262
|
+
return sortedPages.reduce((tokens, page) => {
|
|
1263
|
+
const previous = tokens[tokens.length - 1];
|
|
1264
|
+
if (typeof previous === "number") {
|
|
1265
|
+
const gap = page - previous;
|
|
1266
|
+
if (gap === 2) {
|
|
1267
|
+
tokens.push(previous + 1);
|
|
1268
|
+
} else if (gap > 2) {
|
|
1269
|
+
tokens.push("ellipsis");
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
tokens.push(page);
|
|
1273
|
+
return tokens;
|
|
1274
|
+
}, []);
|
|
1275
|
+
}
|
|
1276
|
+
function getSizeOptions(pageSize) {
|
|
1277
|
+
return Array.from(new Set([...defaultPageSizeOptions, pageSize])).sort((first, second) => first - second);
|
|
1278
|
+
}
|
|
1279
|
+
var Pagination = forwardRef3(({
|
|
1280
|
+
current,
|
|
1281
|
+
defaultCurrent = 1,
|
|
1282
|
+
pageSize,
|
|
1283
|
+
defaultPageSize = 10,
|
|
1284
|
+
total = 0,
|
|
1395
1285
|
onChange,
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
presets,
|
|
1402
|
-
showNow,
|
|
1286
|
+
disabled,
|
|
1287
|
+
simple,
|
|
1288
|
+
showSizeChanger,
|
|
1289
|
+
showQuickJumper,
|
|
1290
|
+
showTotal,
|
|
1403
1291
|
size = "md",
|
|
1404
|
-
|
|
1405
|
-
value,
|
|
1292
|
+
className,
|
|
1406
1293
|
...props
|
|
1407
|
-
}, ref) => {
|
|
1408
|
-
const
|
|
1409
|
-
const
|
|
1410
|
-
const [
|
|
1411
|
-
const
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
return;
|
|
1294
|
+
}, ref) => {
|
|
1295
|
+
const isCurrentControlled = current !== undefined;
|
|
1296
|
+
const isPageSizeControlled = pageSize !== undefined;
|
|
1297
|
+
const [internalCurrent, setInternalCurrent] = useState4(defaultCurrent);
|
|
1298
|
+
const [internalPageSize, setInternalPageSize] = useState4(defaultPageSize);
|
|
1299
|
+
const [quickJumpValue, setQuickJumpValue] = useState4("");
|
|
1300
|
+
const mergedPageSize = toPositiveInteger(pageSize ?? internalPageSize, defaultPageSize);
|
|
1301
|
+
const pageCount = getPageCount(total, mergedPageSize);
|
|
1302
|
+
const mergedCurrent = clampPage(toPositiveInteger(current ?? internalCurrent, defaultCurrent), pageCount);
|
|
1303
|
+
const pageTokens = useMemo3(() => getPageTokens(mergedCurrent, pageCount), [mergedCurrent, pageCount]);
|
|
1304
|
+
const range = getRange(mergedCurrent, mergedPageSize, total);
|
|
1305
|
+
function changePage(nextPage, nextPageSize = mergedPageSize) {
|
|
1306
|
+
const nextPageCount = getPageCount(total, nextPageSize);
|
|
1307
|
+
const normalizedPage = clampPage(nextPage, nextPageCount);
|
|
1308
|
+
if (!isCurrentControlled) {
|
|
1309
|
+
setInternalCurrent(normalizedPage);
|
|
1424
1310
|
}
|
|
1425
|
-
if (!
|
|
1426
|
-
|
|
1311
|
+
if (!isPageSizeControlled) {
|
|
1312
|
+
setInternalPageSize(nextPageSize);
|
|
1427
1313
|
}
|
|
1428
|
-
onChange?.(
|
|
1314
|
+
onChange?.(normalizedPage, nextPageSize);
|
|
1429
1315
|
}
|
|
1430
|
-
function
|
|
1431
|
-
|
|
1316
|
+
function handlePageSizeChange(event) {
|
|
1317
|
+
const nextPageSize = toPositiveInteger(Number(event.currentTarget.value), mergedPageSize);
|
|
1318
|
+
const nextPage = clampPage(mergedCurrent, getPageCount(total, nextPageSize));
|
|
1319
|
+
changePage(nextPage, nextPageSize);
|
|
1320
|
+
}
|
|
1321
|
+
function jumpToInputPage(value) {
|
|
1322
|
+
const nextPage = Number(value);
|
|
1323
|
+
if (!Number.isFinite(nextPage)) {
|
|
1432
1324
|
return;
|
|
1433
|
-
|
|
1434
|
-
|
|
1325
|
+
}
|
|
1326
|
+
changePage(nextPage);
|
|
1327
|
+
setQuickJumpValue("");
|
|
1435
1328
|
}
|
|
1436
|
-
|
|
1437
|
-
|
|
1329
|
+
function handleQuickJumpKeyDown(event) {
|
|
1330
|
+
if (event.key !== "Enter") {
|
|
1331
|
+
return;
|
|
1332
|
+
}
|
|
1333
|
+
jumpToInputPage(event.currentTarget.value);
|
|
1334
|
+
}
|
|
1335
|
+
const previousDisabled = disabled || mergedCurrent <= 1;
|
|
1336
|
+
const nextDisabled = disabled || mergedCurrent >= pageCount;
|
|
1337
|
+
return /* @__PURE__ */ jsxs4("nav", {
|
|
1438
1338
|
...props,
|
|
1439
|
-
ref
|
|
1440
|
-
|
|
1441
|
-
className: getDatePickerClasses({
|
|
1442
|
-
size,
|
|
1443
|
-
status,
|
|
1444
|
-
picker,
|
|
1445
|
-
open: visible,
|
|
1446
|
-
disabled,
|
|
1447
|
-
className
|
|
1448
|
-
}),
|
|
1339
|
+
ref,
|
|
1340
|
+
className: getPaginationClasses({ size, compact: simple, className }),
|
|
1449
1341
|
children: [
|
|
1450
|
-
/* @__PURE__ */
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
disabled,
|
|
1457
|
-
type: inputType,
|
|
1458
|
-
value: currentValue ?? "",
|
|
1459
|
-
placeholder: placeholder ?? placeholderForPicker(picker),
|
|
1460
|
-
onFocus: (event) => {
|
|
1461
|
-
onFocus?.(event);
|
|
1462
|
-
dropdown.onInputFocus();
|
|
1463
|
-
},
|
|
1464
|
-
onBlur: (event) => {
|
|
1465
|
-
onBlur?.(event);
|
|
1466
|
-
},
|
|
1467
|
-
onClick: () => setVisible(true),
|
|
1468
|
-
onChange: (event) => emitChange(event.currentTarget.value || undefined)
|
|
1469
|
-
}),
|
|
1470
|
-
allowClear && currentValue && !disabled ? /* @__PURE__ */ jsx6("button", {
|
|
1471
|
-
type: "button",
|
|
1472
|
-
className: datePickerClearClass,
|
|
1473
|
-
"aria-label": "Clear date",
|
|
1474
|
-
onMouseDown: (event) => event.preventDefault(),
|
|
1475
|
-
onClick: () => emitChange(undefined),
|
|
1476
|
-
children: "x"
|
|
1342
|
+
showTotal ? /* @__PURE__ */ jsx5("div", {
|
|
1343
|
+
className: paginationInfoClass,
|
|
1344
|
+
children: /* @__PURE__ */ jsx5("span", {
|
|
1345
|
+
className: paginationInfoTextClass,
|
|
1346
|
+
children: showTotal(total, range)
|
|
1347
|
+
})
|
|
1477
1348
|
}) : null,
|
|
1478
|
-
/* @__PURE__ */
|
|
1349
|
+
/* @__PURE__ */ jsx5("button", {
|
|
1479
1350
|
type: "button",
|
|
1480
|
-
className:
|
|
1481
|
-
|
|
1482
|
-
"aria-
|
|
1483
|
-
|
|
1484
|
-
"
|
|
1485
|
-
disabled,
|
|
1486
|
-
onMouseDown: (event) => event.preventDefault(),
|
|
1487
|
-
onClick: () => setVisible(!visible),
|
|
1488
|
-
children: /* @__PURE__ */ jsxs5("svg", {
|
|
1489
|
-
"aria-hidden": "true",
|
|
1490
|
-
focusable: "false",
|
|
1491
|
-
width: "18",
|
|
1492
|
-
height: "18",
|
|
1493
|
-
viewBox: "0 0 24 24",
|
|
1494
|
-
fill: "none",
|
|
1495
|
-
stroke: "currentColor",
|
|
1496
|
-
strokeWidth: "1.75",
|
|
1497
|
-
strokeLinecap: "round",
|
|
1498
|
-
strokeLinejoin: "round",
|
|
1499
|
-
children: [
|
|
1500
|
-
/* @__PURE__ */ jsx6("rect", {
|
|
1501
|
-
x: "3",
|
|
1502
|
-
y: "5",
|
|
1503
|
-
width: "18",
|
|
1504
|
-
height: "16",
|
|
1505
|
-
rx: "2"
|
|
1506
|
-
}),
|
|
1507
|
-
/* @__PURE__ */ jsx6("path", {
|
|
1508
|
-
d: "M8 3v4M16 3v4M3 10h18"
|
|
1509
|
-
})
|
|
1510
|
-
]
|
|
1511
|
-
})
|
|
1351
|
+
className: paginationPrevClass,
|
|
1352
|
+
disabled: previousDisabled,
|
|
1353
|
+
"aria-label": "Previous page",
|
|
1354
|
+
onClick: () => changePage(mergedCurrent - 1),
|
|
1355
|
+
children: "Prev"
|
|
1512
1356
|
}),
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
role: "dialog",
|
|
1516
|
-
"aria-label": "Choose date",
|
|
1517
|
-
className: getDatePickerDropdownClasses({ open: visible }),
|
|
1357
|
+
simple ? /* @__PURE__ */ jsxs4("div", {
|
|
1358
|
+
className: paginationInputClass,
|
|
1518
1359
|
children: [
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
return disabledDate(date.slice(0, 7));
|
|
1532
|
-
if (calendarMode === "year") {
|
|
1533
|
-
const [year, month] = date.split("-").map(Number);
|
|
1534
|
-
const days = new Date(year, month, 0).getDate();
|
|
1535
|
-
return Array.from({ length: days }, (_, index) => `${date.slice(0, 7)}-${String(index + 1).padStart(2, "0")}`).every((day) => disabledDate(day));
|
|
1536
|
-
}
|
|
1537
|
-
return disabledDate(date);
|
|
1538
|
-
},
|
|
1539
|
-
onSelect: (date, info) => {
|
|
1540
|
-
if (picker === "date" && info.source === "month") {
|
|
1541
|
-
setCalendarMode("month");
|
|
1542
|
-
return;
|
|
1360
|
+
/* @__PURE__ */ jsx5("input", {
|
|
1361
|
+
"aria-label": "Current page",
|
|
1362
|
+
type: "number",
|
|
1363
|
+
min: 1,
|
|
1364
|
+
max: pageCount,
|
|
1365
|
+
value: quickJumpValue || String(mergedCurrent),
|
|
1366
|
+
disabled,
|
|
1367
|
+
onChange: (event) => setQuickJumpValue(event.currentTarget.value),
|
|
1368
|
+
onKeyDown: handleQuickJumpKeyDown,
|
|
1369
|
+
onBlur: (event) => {
|
|
1370
|
+
if (event.currentTarget.value !== String(mergedCurrent)) {
|
|
1371
|
+
jumpToInputPage(event.currentTarget.value);
|
|
1543
1372
|
}
|
|
1544
|
-
selectValue(picker === "month" ? date.slice(0, 7) : date);
|
|
1545
1373
|
}
|
|
1546
|
-
}) : /* @__PURE__ */ jsx6("input", {
|
|
1547
|
-
type: inputType,
|
|
1548
|
-
"aria-label": placeholderForPicker(picker),
|
|
1549
|
-
value: currentValue ?? "",
|
|
1550
|
-
onChange: (event) => selectValue(event.currentTarget.value)
|
|
1551
1374
|
}),
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
}, index)),
|
|
1560
|
-
showNow ? /* @__PURE__ */ jsx6("div", {
|
|
1561
|
-
className: datePickerFooterClass,
|
|
1562
|
-
children: /* @__PURE__ */ jsx6("button", {
|
|
1563
|
-
type: "button",
|
|
1564
|
-
onMouseDown: (event) => event.preventDefault(),
|
|
1565
|
-
disabled: Boolean(disabledDate?.(todayValue(picker))),
|
|
1566
|
-
onClick: () => selectValue(todayValue(picker)),
|
|
1567
|
-
children: "Now"
|
|
1568
|
-
})
|
|
1569
|
-
}) : null
|
|
1375
|
+
/* @__PURE__ */ jsxs4("span", {
|
|
1376
|
+
className: paginationInfoTextClass,
|
|
1377
|
+
children: [
|
|
1378
|
+
"/ ",
|
|
1379
|
+
pageCount
|
|
1380
|
+
]
|
|
1381
|
+
})
|
|
1570
1382
|
]
|
|
1383
|
+
}) : pageTokens.map((pageToken, index) => pageToken === "ellipsis" ? /* @__PURE__ */ jsx5("span", {
|
|
1384
|
+
"aria-hidden": "true",
|
|
1385
|
+
className: paginationEllipsisClass
|
|
1386
|
+
}, `ellipsis-${index}`) : /* @__PURE__ */ jsx5("button", {
|
|
1387
|
+
type: "button",
|
|
1388
|
+
className: getPaginationItemClasses({
|
|
1389
|
+
active: pageToken === mergedCurrent,
|
|
1390
|
+
disabled
|
|
1391
|
+
}),
|
|
1392
|
+
disabled,
|
|
1393
|
+
"aria-current": pageToken === mergedCurrent ? "page" : undefined,
|
|
1394
|
+
"aria-label": `Page ${pageToken}`,
|
|
1395
|
+
onClick: () => changePage(pageToken),
|
|
1396
|
+
children: pageToken
|
|
1397
|
+
}, pageToken)),
|
|
1398
|
+
/* @__PURE__ */ jsx5("button", {
|
|
1399
|
+
type: "button",
|
|
1400
|
+
className: paginationNextClass,
|
|
1401
|
+
disabled: nextDisabled,
|
|
1402
|
+
"aria-label": "Next page",
|
|
1403
|
+
onClick: () => changePage(mergedCurrent + 1),
|
|
1404
|
+
children: "Next"
|
|
1405
|
+
}),
|
|
1406
|
+
showSizeChanger ? /* @__PURE__ */ jsx5("div", {
|
|
1407
|
+
className: paginationInputClass,
|
|
1408
|
+
children: /* @__PURE__ */ jsx5("select", {
|
|
1409
|
+
"aria-label": "Page size",
|
|
1410
|
+
value: mergedPageSize,
|
|
1411
|
+
disabled,
|
|
1412
|
+
onChange: handlePageSizeChange,
|
|
1413
|
+
children: getSizeOptions(mergedPageSize).map((option) => /* @__PURE__ */ jsxs4("option", {
|
|
1414
|
+
value: option,
|
|
1415
|
+
children: [
|
|
1416
|
+
option,
|
|
1417
|
+
" / page"
|
|
1418
|
+
]
|
|
1419
|
+
}, option))
|
|
1420
|
+
})
|
|
1421
|
+
}) : null,
|
|
1422
|
+
showQuickJumper && !simple ? /* @__PURE__ */ jsx5("div", {
|
|
1423
|
+
className: paginationInputClass,
|
|
1424
|
+
children: /* @__PURE__ */ jsx5("input", {
|
|
1425
|
+
"aria-label": "Jump to page",
|
|
1426
|
+
type: "number",
|
|
1427
|
+
min: 1,
|
|
1428
|
+
max: pageCount,
|
|
1429
|
+
value: quickJumpValue,
|
|
1430
|
+
disabled,
|
|
1431
|
+
onChange: (event) => setQuickJumpValue(event.currentTarget.value),
|
|
1432
|
+
onKeyDown: handleQuickJumpKeyDown
|
|
1433
|
+
})
|
|
1571
1434
|
}) : null
|
|
1572
1435
|
]
|
|
1573
1436
|
});
|
|
1574
|
-
});
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1437
|
+
});
|
|
1438
|
+
Pagination.displayName = "Pagination";
|
|
1439
|
+
// src/components/dm-pagination/DmPagination.tsx
|
|
1440
|
+
import {
|
|
1441
|
+
forwardRef as forwardRef4,
|
|
1442
|
+
useEffect as useEffect2,
|
|
1443
|
+
useMemo as useMemo4,
|
|
1444
|
+
useRef as useRef2,
|
|
1445
|
+
useState as useState5
|
|
1446
|
+
} from "react";
|
|
1447
|
+
|
|
1448
|
+
// src/classes/dm-pagination.ts
|
|
1449
|
+
var dmPaginationBaseClass = "dm-pagination";
|
|
1450
|
+
var dmPaginationHiddenClass = "dm-pagination-hidden";
|
|
1451
|
+
var dmPaginationPagerClass = "dm-pagination-pager";
|
|
1452
|
+
var dmPaginationRefreshClass = "dm-pagination-refresh";
|
|
1453
|
+
var dmPaginationRefreshLoadingClass = "dm-pagination-refresh-loading";
|
|
1454
|
+
var dmPaginationSelectedClass = "dm-pagination-selected";
|
|
1455
|
+
var dmPaginationAlignClasses = {
|
|
1456
|
+
left: "dm-pagination-left",
|
|
1457
|
+
center: "dm-pagination-center",
|
|
1458
|
+
right: "dm-pagination-right"
|
|
1459
|
+
};
|
|
1460
|
+
function getDmPaginationClasses({
|
|
1461
|
+
align = "right",
|
|
1462
|
+
hidden,
|
|
1463
|
+
className
|
|
1464
|
+
}) {
|
|
1465
|
+
return cn(dmPaginationBaseClass, dmPaginationAlignClasses[align], hidden && dmPaginationHiddenClass, className);
|
|
1466
|
+
}
|
|
1467
|
+
function getDmPaginationRefreshClasses({
|
|
1468
|
+
loading,
|
|
1469
|
+
className
|
|
1470
|
+
}) {
|
|
1471
|
+
return cn(dmPaginationRefreshClass, loading && dmPaginationRefreshLoadingClass, className);
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
// src/components/dm-pagination/DmPagination.tsx
|
|
1475
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1476
|
+
var defaultLocale = {
|
|
1477
|
+
refresh: "Refresh",
|
|
1478
|
+
showTotal: (total, range) => `${range[0]}-${range[1]} of ${total}`,
|
|
1479
|
+
showTotalSimple: (total, range) => `${range[0]}-${range[1]} / ${total}`,
|
|
1480
|
+
selected: (selectedTotal) => `, ${selectedTotal} selected`
|
|
1481
|
+
};
|
|
1482
|
+
function getResponsiveSimple({
|
|
1483
|
+
width,
|
|
1484
|
+
total,
|
|
1485
|
+
showRefresh,
|
|
1486
|
+
showSizeChanger
|
|
1487
|
+
}) {
|
|
1488
|
+
let reservedWidth = 0;
|
|
1489
|
+
if (!showRefresh)
|
|
1490
|
+
reservedWidth += 100;
|
|
1491
|
+
if (!showSizeChanger)
|
|
1492
|
+
reservedWidth += 100;
|
|
1493
|
+
if (width < 900 - reservedWidth)
|
|
1494
|
+
return total >= 100;
|
|
1495
|
+
if (width < 1100 - reservedWidth)
|
|
1496
|
+
return total >= 1000;
|
|
1497
|
+
if (width < 1220 - reservedWidth)
|
|
1498
|
+
return total >= 99999;
|
|
1499
|
+
if (width < 1300 - reservedWidth)
|
|
1500
|
+
return total >= 999999;
|
|
1501
|
+
if (width < 1450 - reservedWidth)
|
|
1502
|
+
return total >= 9999999;
|
|
1503
|
+
return false;
|
|
1504
|
+
}
|
|
1505
|
+
function useElementWidth() {
|
|
1506
|
+
const ref = useRef2(null);
|
|
1507
|
+
const [width, setWidth] = useState5(1000);
|
|
1508
|
+
useEffect2(() => {
|
|
1509
|
+
const element = ref.current;
|
|
1510
|
+
if (!element || typeof ResizeObserver === "undefined")
|
|
1511
|
+
return;
|
|
1512
|
+
const observer = new ResizeObserver(([entry]) => {
|
|
1513
|
+
setWidth(entry?.contentRect.width || element.getBoundingClientRect().width);
|
|
1514
|
+
});
|
|
1515
|
+
observer.observe(element);
|
|
1516
|
+
return () => observer.disconnect();
|
|
1517
|
+
}, []);
|
|
1518
|
+
return [ref, width];
|
|
1519
|
+
}
|
|
1520
|
+
function renderSelected(selectedTotal, locale) {
|
|
1521
|
+
if (!selectedTotal)
|
|
1522
|
+
return null;
|
|
1523
|
+
return /* @__PURE__ */ jsx6("span", {
|
|
1524
|
+
className: dmPaginationSelectedClass,
|
|
1525
|
+
children: locale.selected(selectedTotal)
|
|
1526
|
+
});
|
|
1527
|
+
}
|
|
1528
|
+
var DmPagination = forwardRef4(({
|
|
1529
|
+
selectedTotal = 0,
|
|
1530
|
+
loading = false,
|
|
1531
|
+
total = 0,
|
|
1532
|
+
showRefresh = true,
|
|
1533
|
+
showPagination = true,
|
|
1534
|
+
wrapperStyle,
|
|
1578
1535
|
className,
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
status,
|
|
1589
|
-
value,
|
|
1536
|
+
align = "right",
|
|
1537
|
+
showTotalFullMessage = false,
|
|
1538
|
+
showSizeChanger = true,
|
|
1539
|
+
responsiveSimple = true,
|
|
1540
|
+
refresh,
|
|
1541
|
+
simple,
|
|
1542
|
+
showQuickJumper,
|
|
1543
|
+
showTotal,
|
|
1544
|
+
locale,
|
|
1590
1545
|
...props
|
|
1591
1546
|
}, ref) => {
|
|
1592
|
-
const
|
|
1593
|
-
const
|
|
1594
|
-
const
|
|
1595
|
-
const
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1547
|
+
const [measureRef, width] = useElementWidth();
|
|
1548
|
+
const mergedLocale = useMemo4(() => ({ ...defaultLocale, ...locale }), [locale]);
|
|
1549
|
+
const isRefreshVisible = showRefresh && Boolean(refresh);
|
|
1550
|
+
const shouldRender = showPagination || isRefreshVisible;
|
|
1551
|
+
const responsiveSimpleMode = responsiveSimple ? getResponsiveSimple({
|
|
1552
|
+
width,
|
|
1553
|
+
total,
|
|
1554
|
+
showRefresh,
|
|
1555
|
+
showSizeChanger
|
|
1556
|
+
}) : false;
|
|
1557
|
+
const mergedSimple = simple ?? responsiveSimpleMode;
|
|
1558
|
+
const mergedShowQuickJumper = showQuickJumper ?? !mergedSimple;
|
|
1559
|
+
const totalRenderer = useMemo4(() => {
|
|
1560
|
+
if (showTotal)
|
|
1561
|
+
return showTotal;
|
|
1562
|
+
return (nextTotal, range) => {
|
|
1563
|
+
if (Number(nextTotal) === 0)
|
|
1564
|
+
return "";
|
|
1565
|
+
const selected = renderSelected(selectedTotal, mergedLocale);
|
|
1566
|
+
const message = mergedSimple && !showTotalFullMessage ? mergedLocale.showTotalSimple(nextTotal, range, selectedTotal) : mergedLocale.showTotal(nextTotal, range, selectedTotal);
|
|
1567
|
+
return /* @__PURE__ */ jsxs5("span", {
|
|
1568
|
+
title: `${mergedLocale.showTotal(nextTotal, range, selectedTotal)}${selectedTotal ? mergedLocale.selected(selectedTotal) : ""}`,
|
|
1569
|
+
children: [
|
|
1570
|
+
message,
|
|
1571
|
+
selected
|
|
1572
|
+
]
|
|
1573
|
+
});
|
|
1574
|
+
};
|
|
1575
|
+
}, [
|
|
1576
|
+
mergedLocale,
|
|
1577
|
+
mergedSimple,
|
|
1578
|
+
selectedTotal,
|
|
1579
|
+
showTotal,
|
|
1580
|
+
showTotalFullMessage
|
|
1581
|
+
]);
|
|
1582
|
+
if (!shouldRender)
|
|
1583
|
+
return null;
|
|
1608
1584
|
return /* @__PURE__ */ jsxs5("div", {
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1585
|
+
ref: (element) => {
|
|
1586
|
+
measureRef.current = element;
|
|
1587
|
+
if (typeof ref === "function") {
|
|
1588
|
+
ref(element);
|
|
1589
|
+
} else if (ref) {
|
|
1590
|
+
ref.current = element;
|
|
1591
|
+
}
|
|
1592
|
+
},
|
|
1593
|
+
className: getDmPaginationClasses({ align, className }),
|
|
1594
|
+
style: wrapperStyle,
|
|
1619
1595
|
children: [
|
|
1620
|
-
/* @__PURE__ */ jsx6("
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
}),
|
|
1633
|
-
/* @__PURE__ */ jsx6("input", {
|
|
1634
|
-
...inputProps,
|
|
1635
|
-
id: inputProps?.id ? `${inputProps.id}-end` : undefined,
|
|
1636
|
-
className: datePickerInputClass,
|
|
1637
|
-
disabled,
|
|
1638
|
-
type: inputType,
|
|
1639
|
-
value: currentValue?.[1] ?? "",
|
|
1640
|
-
placeholder: Array.isArray(placeholder) ? placeholder[1] : "End date",
|
|
1641
|
-
onChange: (event) => updateIndex(1, event.currentTarget.value || undefined)
|
|
1642
|
-
}),
|
|
1643
|
-
allowClear && (currentValue?.[0] || currentValue?.[1]) && !disabled ? /* @__PURE__ */ jsx6("button", {
|
|
1596
|
+
showPagination ? /* @__PURE__ */ jsx6("div", {
|
|
1597
|
+
className: dmPaginationPagerClass,
|
|
1598
|
+
children: /* @__PURE__ */ jsx6(Pagination, {
|
|
1599
|
+
...props,
|
|
1600
|
+
total,
|
|
1601
|
+
simple: mergedSimple,
|
|
1602
|
+
showQuickJumper: mergedShowQuickJumper,
|
|
1603
|
+
showSizeChanger,
|
|
1604
|
+
showTotal: totalRenderer
|
|
1605
|
+
})
|
|
1606
|
+
}) : null,
|
|
1607
|
+
isRefreshVisible ? /* @__PURE__ */ jsxs5("button", {
|
|
1644
1608
|
type: "button",
|
|
1645
|
-
className:
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1609
|
+
className: getDmPaginationRefreshClasses({ loading }),
|
|
1610
|
+
disabled: loading || props.disabled,
|
|
1611
|
+
"aria-busy": loading || undefined,
|
|
1612
|
+
onClick: refresh,
|
|
1613
|
+
children: [
|
|
1614
|
+
/* @__PURE__ */ jsx6("span", {
|
|
1615
|
+
"aria-hidden": "true",
|
|
1616
|
+
children: "Reload"
|
|
1617
|
+
}),
|
|
1618
|
+
/* @__PURE__ */ jsx6("span", {
|
|
1619
|
+
children: mergedLocale.refresh
|
|
1620
|
+
})
|
|
1621
|
+
]
|
|
1649
1622
|
}) : null
|
|
1650
1623
|
]
|
|
1651
1624
|
});
|
|
1652
1625
|
});
|
|
1653
|
-
|
|
1654
|
-
function withPicker(picker, displayName) {
|
|
1655
|
-
const Picker = forwardRef4((props, ref) => /* @__PURE__ */ jsx6(DatePickerRoot, {
|
|
1656
|
-
...props,
|
|
1657
|
-
ref,
|
|
1658
|
-
picker
|
|
1659
|
-
}));
|
|
1660
|
-
Picker.displayName = displayName;
|
|
1661
|
-
return Picker;
|
|
1662
|
-
}
|
|
1663
|
-
var DatePicker = Object.assign(DatePickerRoot, {
|
|
1664
|
-
RangePicker,
|
|
1665
|
-
WeekPicker: withPicker("week", "DatePicker.WeekPicker"),
|
|
1666
|
-
MonthPicker: withPicker("month", "DatePicker.MonthPicker"),
|
|
1667
|
-
QuarterPicker: withPicker("quarter", "DatePicker.QuarterPicker"),
|
|
1668
|
-
YearPicker: withPicker("year", "DatePicker.YearPicker")
|
|
1669
|
-
});
|
|
1626
|
+
DmPagination.displayName = "DmPagination";
|
|
1670
1627
|
// src/components/input/Input.tsx
|
|
1671
1628
|
import {
|
|
1672
1629
|
forwardRef as forwardRef5,
|
|
@@ -2443,6 +2400,31 @@ SelectRoot.displayName = "Select";
|
|
|
2443
2400
|
var Select = SelectRoot;
|
|
2444
2401
|
Select.Option = Option;
|
|
2445
2402
|
Select.OptGroup = OptGroup;
|
|
2403
|
+
// src/components/dm-search/DmSearch.tsx
|
|
2404
|
+
import {
|
|
2405
|
+
forwardRef as forwardRef7,
|
|
2406
|
+
useEffect as useEffect4,
|
|
2407
|
+
useImperativeHandle as useImperativeHandle3,
|
|
2408
|
+
useMemo as useMemo6,
|
|
2409
|
+
useState as useState8
|
|
2410
|
+
} from "react";
|
|
2411
|
+
|
|
2412
|
+
// src/classes/dm-search.ts
|
|
2413
|
+
var dmSearchBaseClass = "dm-search";
|
|
2414
|
+
var dmSearchCompactClass = "dm-search-compact";
|
|
2415
|
+
var dmSearchCollapsedClass = "dm-search-collapsed";
|
|
2416
|
+
var dmSearchFieldsClass = "dm-search-fields";
|
|
2417
|
+
var dmSearchFieldClass = "dm-search-field";
|
|
2418
|
+
var dmSearchActionsClass = "dm-search-actions";
|
|
2419
|
+
var dmSearchFastFilterClass = "dm-search-fast-filter";
|
|
2420
|
+
function getDmSearchClasses({
|
|
2421
|
+
compact,
|
|
2422
|
+
collapsed,
|
|
2423
|
+
className
|
|
2424
|
+
}) {
|
|
2425
|
+
return cn(dmSearchBaseClass, compact && dmSearchCompactClass, collapsed && dmSearchCollapsedClass, className);
|
|
2426
|
+
}
|
|
2427
|
+
|
|
2446
2428
|
// src/components/dm-search/DmSearch.tsx
|
|
2447
2429
|
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2448
2430
|
function initialValues(items, searchParams, useSearchParams = true) {
|
|
@@ -2732,8 +2714,8 @@ function getRecordKey(record, index, rowKey) {
|
|
|
2732
2714
|
return rowKey(record, index);
|
|
2733
2715
|
}
|
|
2734
2716
|
if (rowKey) {
|
|
2735
|
-
const
|
|
2736
|
-
return typeof
|
|
2717
|
+
const key2 = record[rowKey];
|
|
2718
|
+
return typeof key2 === "string" || typeof key2 === "number" ? key2 : index;
|
|
2737
2719
|
}
|
|
2738
2720
|
const key = record.key;
|
|
2739
2721
|
return typeof key === "string" || typeof key === "number" ? key : index;
|
|
@@ -3336,6 +3318,24 @@ var Table = Object.assign(TableWithRef, {
|
|
|
3336
3318
|
EXPAND_COLUMN: "EXPAND_COLUMN"
|
|
3337
3319
|
});
|
|
3338
3320
|
Table.displayName = "Table";
|
|
3321
|
+
// src/components/dm-table/DmTable.tsx
|
|
3322
|
+
import { useMemo as useMemo8, useState as useState10 } from "react";
|
|
3323
|
+
|
|
3324
|
+
// src/classes/dm-table.ts
|
|
3325
|
+
var dmTableBaseClass = "dm-table";
|
|
3326
|
+
var dmTableSearchClass = "dm-table-search";
|
|
3327
|
+
var dmTableCardClass = "dm-table-card";
|
|
3328
|
+
var dmTableHeaderClass = "dm-table-header";
|
|
3329
|
+
var dmTableTitleClass = "dm-table-title";
|
|
3330
|
+
var dmTableExtraClass = "dm-table-extra";
|
|
3331
|
+
var dmTableIndicatorsClass = "dm-table-indicators";
|
|
3332
|
+
var dmTableTableExtraClass = "dm-table-table-extra";
|
|
3333
|
+
var dmTableColumnSettingClass = "dm-table-column-setting";
|
|
3334
|
+
var dmTablePaginationClass = "dm-table-pagination";
|
|
3335
|
+
function getDmTableClasses({ className }) {
|
|
3336
|
+
return cn(dmTableBaseClass, className);
|
|
3337
|
+
}
|
|
3338
|
+
|
|
3339
3339
|
// src/components/dm-table/DmTable.tsx
|
|
3340
3340
|
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3341
3341
|
function mapAndFilter(list, mapper) {
|