@duskmoon-dev/components 0.6.4 → 2.0.0-rc.1
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,444 +29,136 @@ function clsx() {
|
|
|
28
29
|
function cn(...inputs) {
|
|
29
30
|
return clsx(inputs);
|
|
30
31
|
}
|
|
31
|
-
// src/classes/
|
|
32
|
-
var
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}) {
|
|
45
|
-
return cn(dmMenuClass, hideProductHeader && dmMenuNoHeaderClass, inlineCollapsed && dmMenuCollapsedClass, className);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// src/components/menu/Menu.tsx
|
|
49
|
-
import { forwardRef, useState } from "react";
|
|
50
|
-
|
|
51
|
-
// src/classes/menu.ts
|
|
52
|
-
var menuBaseClass = "menu";
|
|
53
|
-
var menuShowClass = "menu-show";
|
|
54
|
-
var menuItemClass = "menu-item";
|
|
55
|
-
var menuItemActiveClass = "menu-item-active";
|
|
56
|
-
var menuItemDisabledClass = "menu-item-disabled";
|
|
57
|
-
var menuItemIconClass = "menu-item-icon";
|
|
58
|
-
var menuItemTrailingClass = "menu-item-trailing";
|
|
59
|
-
var menuItemSubmenuClass = "menu-item-submenu";
|
|
60
|
-
var menuDividerClass = "menu-divider";
|
|
61
|
-
var menuLabelClass = "menu-label";
|
|
62
|
-
var menuSubmenuClass = "menu-submenu";
|
|
63
|
-
var menuCompactClass = "menu-compact";
|
|
64
|
-
var menuWideClass = "menu-wide";
|
|
65
|
-
var menuModeClasses = {
|
|
66
|
-
vertical: "menu-vertical",
|
|
67
|
-
horizontal: "menu-horizontal",
|
|
68
|
-
inline: "menu-inline"
|
|
32
|
+
// src/classes/button.ts
|
|
33
|
+
var buttonBaseClass = "btn";
|
|
34
|
+
var buttonColorClasses = {
|
|
35
|
+
primary: "btn-primary",
|
|
36
|
+
secondary: "btn-secondary",
|
|
37
|
+
tertiary: "btn-tertiary",
|
|
38
|
+
accent: "btn-accent",
|
|
39
|
+
neutral: "btn-neutral",
|
|
40
|
+
base: "btn-base",
|
|
41
|
+
info: "btn-info",
|
|
42
|
+
success: "btn-success",
|
|
43
|
+
warning: "btn-warning",
|
|
44
|
+
error: "btn-error"
|
|
69
45
|
};
|
|
70
|
-
var
|
|
71
|
-
|
|
72
|
-
|
|
46
|
+
var buttonAppearanceClasses = {
|
|
47
|
+
filled: "",
|
|
48
|
+
outline: "btn-outline",
|
|
49
|
+
tonal: "btn-tonal",
|
|
50
|
+
ghost: "btn-ghost",
|
|
51
|
+
text: "btn-text"
|
|
73
52
|
};
|
|
74
|
-
var
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
53
|
+
var buttonShapeClasses = {
|
|
54
|
+
rect: "",
|
|
55
|
+
circle: "btn-circle btn-icon",
|
|
56
|
+
square: "btn-square"
|
|
78
57
|
};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
58
|
+
var buttonSizeClasses = {
|
|
59
|
+
xs: "btn-xs",
|
|
60
|
+
sm: "btn-sm",
|
|
61
|
+
md: "btn-md",
|
|
62
|
+
lg: "btn-lg"
|
|
63
|
+
};
|
|
64
|
+
var buttonBlockClass = "btn-block";
|
|
65
|
+
var buttonIsLoadingClass = "btn-loading";
|
|
66
|
+
function getButtonClasses({
|
|
67
|
+
color = "primary",
|
|
68
|
+
appearance = "filled",
|
|
69
|
+
shape = "rect",
|
|
82
70
|
size = "md",
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
className
|
|
86
|
-
}) {
|
|
87
|
-
return cn(menuBaseClass, menuShowClass, menuModeClasses[mode], menuThemeClasses[theme], menuSizeClasses[size], inlineCollapsed && "menu-inline-collapsed", disabled && menuItemDisabledClass, className);
|
|
88
|
-
}
|
|
89
|
-
function getMenuItemClasses({
|
|
90
|
-
active,
|
|
91
|
-
disabled,
|
|
92
|
-
danger,
|
|
93
|
-
submenu,
|
|
71
|
+
block,
|
|
72
|
+
isLoading,
|
|
94
73
|
className
|
|
95
74
|
}) {
|
|
96
|
-
return cn(
|
|
75
|
+
return cn(buttonBaseClass, buttonColorClasses[color], buttonAppearanceClasses[appearance], buttonShapeClasses[shape], buttonSizeClasses[size], shape === "circle" && size === "xs" && "btn-icon-sm", shape === "circle" && size === "sm" && "btn-icon-sm", shape === "circle" && size === "lg" && "btn-icon-lg", block && buttonBlockClass, isLoading && buttonIsLoadingClass, className);
|
|
97
76
|
}
|
|
98
77
|
|
|
99
|
-
// src/components/
|
|
100
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
101
|
-
function
|
|
102
|
-
return
|
|
103
|
-
}
|
|
104
|
-
function hasNode(node) {
|
|
105
|
-
return node !== undefined && node !== null && node !== false;
|
|
106
|
-
}
|
|
107
|
-
function keyForItem(item, indexPath) {
|
|
108
|
-
return String(item.key ?? indexPath.join("-"));
|
|
109
|
-
}
|
|
110
|
-
function isActivationKey(key) {
|
|
111
|
-
return key === "Enter" || key === " ";
|
|
78
|
+
// src/components/button/Button.tsx
|
|
79
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
80
|
+
function isPromiseLike(value) {
|
|
81
|
+
return value !== null && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
|
|
112
82
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
83
|
+
function Button({
|
|
84
|
+
color = "primary",
|
|
85
|
+
appearance = "filled",
|
|
86
|
+
shape = "rect",
|
|
87
|
+
size = "md",
|
|
88
|
+
block,
|
|
89
|
+
isLoading,
|
|
90
|
+
leftIcon,
|
|
91
|
+
rightIcon,
|
|
120
92
|
className,
|
|
121
|
-
role,
|
|
122
|
-
...props
|
|
123
|
-
}, ref) => /* @__PURE__ */ jsxs("li", {
|
|
124
|
-
...props,
|
|
125
|
-
ref,
|
|
126
|
-
role: role ?? "menuitem",
|
|
127
|
-
"aria-disabled": disabled || undefined,
|
|
128
|
-
className: getMenuItemClasses({
|
|
129
|
-
active,
|
|
130
|
-
disabled,
|
|
131
|
-
danger,
|
|
132
|
-
className
|
|
133
|
-
}),
|
|
134
|
-
children: [
|
|
135
|
-
icon ? /* @__PURE__ */ jsx("span", {
|
|
136
|
-
className: menuItemIconClass,
|
|
137
|
-
children: icon
|
|
138
|
-
}) : null,
|
|
139
|
-
/* @__PURE__ */ jsx("span", {
|
|
140
|
-
children
|
|
141
|
-
}),
|
|
142
|
-
extra ? /* @__PURE__ */ jsx("span", {
|
|
143
|
-
className: menuItemTrailingClass,
|
|
144
|
-
children: extra
|
|
145
|
-
}) : null
|
|
146
|
-
]
|
|
147
|
-
}));
|
|
148
|
-
MenuItem.displayName = "Menu.Item";
|
|
149
|
-
var MenuDivider = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("li", {
|
|
150
|
-
...props,
|
|
151
|
-
ref,
|
|
152
|
-
role: "separator",
|
|
153
|
-
className: cn(menuDividerClass, className)
|
|
154
|
-
}));
|
|
155
|
-
MenuDivider.displayName = "Menu.Divider";
|
|
156
|
-
var MenuItemGroup = forwardRef(({ title, children, className, ...props }, ref) => /* @__PURE__ */ jsxs("li", {
|
|
157
|
-
...props,
|
|
158
|
-
ref,
|
|
159
|
-
className: cn("menu-group", className),
|
|
160
|
-
children: [
|
|
161
|
-
hasNode(title) ? /* @__PURE__ */ jsx("div", {
|
|
162
|
-
className: menuLabelClass,
|
|
163
|
-
children: title
|
|
164
|
-
}) : null,
|
|
165
|
-
/* @__PURE__ */ jsx("ul", {
|
|
166
|
-
className: cn(menuSubmenuClass, "menu-show"),
|
|
167
|
-
children
|
|
168
|
-
})
|
|
169
|
-
]
|
|
170
|
-
}));
|
|
171
|
-
MenuItemGroup.displayName = "Menu.ItemGroup";
|
|
172
|
-
var MenuRoot = forwardRef(({
|
|
173
|
-
items,
|
|
174
93
|
children,
|
|
175
|
-
selectedKeys,
|
|
176
|
-
defaultSelectedKeys,
|
|
177
|
-
openKeys,
|
|
178
|
-
defaultOpenKeys,
|
|
179
|
-
mode = "vertical",
|
|
180
|
-
theme = "light",
|
|
181
|
-
size = "md",
|
|
182
|
-
selectable = true,
|
|
183
|
-
multiple,
|
|
184
|
-
inlineCollapsed,
|
|
185
94
|
disabled,
|
|
95
|
+
ref,
|
|
96
|
+
confirm,
|
|
186
97
|
onClick,
|
|
187
|
-
onSelect,
|
|
188
|
-
onDeselect,
|
|
189
|
-
onOpenChange,
|
|
190
|
-
className,
|
|
191
98
|
...props
|
|
192
|
-
}
|
|
193
|
-
const
|
|
194
|
-
const
|
|
195
|
-
const
|
|
196
|
-
const
|
|
197
|
-
const
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
99
|
+
}) {
|
|
100
|
+
const buttonRef = React.useRef(null);
|
|
101
|
+
const popoverRef = React.useRef(null);
|
|
102
|
+
const cancelRef = React.useRef(null);
|
|
103
|
+
const approvalRef = React.useRef("idle");
|
|
104
|
+
const pendingRef = React.useRef(false);
|
|
105
|
+
const actionRef = React.useRef(0);
|
|
106
|
+
const operationRef = React.useRef(0);
|
|
107
|
+
const mountedRef = React.useRef(false);
|
|
108
|
+
const [portalTarget, setPortalTarget] = React.useState(null);
|
|
109
|
+
const [confirmLoading, setConfirmLoading] = React.useState(false);
|
|
110
|
+
const [confirmError, setConfirmError] = React.useState(false);
|
|
111
|
+
const generatedId = React.useId().replace(/:/g, "");
|
|
112
|
+
const popoverId = `button-confirm-${generatedId}`;
|
|
113
|
+
const titleId = `${popoverId}-title`;
|
|
114
|
+
const descriptionId = `${popoverId}-description`;
|
|
115
|
+
const anchor = `--${popoverId}-anchor`;
|
|
116
|
+
const hasConfirm = Boolean(confirm);
|
|
117
|
+
const confirmation = confirm && typeof confirm === "object" ? confirm : undefined;
|
|
118
|
+
const title = confirmation ? confirmation.title : "Confirm action";
|
|
119
|
+
const hasTitle = title !== undefined && title !== null && title !== false && title !== "";
|
|
120
|
+
const content = confirmation?.component ?? confirmation?.message ?? confirmation?.description;
|
|
121
|
+
const hasContent = content !== undefined && content !== null && content !== false && content !== "";
|
|
122
|
+
const mergedRef = React.useCallback((node) => {
|
|
123
|
+
buttonRef.current = node;
|
|
124
|
+
if (!node) {
|
|
125
|
+
if (typeof ref === "function")
|
|
126
|
+
ref(null);
|
|
127
|
+
else if (ref)
|
|
128
|
+
ref.current = null;
|
|
129
|
+
return;
|
|
202
130
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
131
|
+
const cleanup = typeof ref === "function" ? ref(node) : undefined;
|
|
132
|
+
if (ref && typeof ref !== "function")
|
|
133
|
+
ref.current = node;
|
|
134
|
+
return () => {
|
|
135
|
+
buttonRef.current = null;
|
|
136
|
+
if (typeof cleanup === "function")
|
|
137
|
+
cleanup();
|
|
138
|
+
else if (typeof ref === "function")
|
|
139
|
+
ref(null);
|
|
140
|
+
else if (ref)
|
|
141
|
+
ref.current = null;
|
|
142
|
+
};
|
|
143
|
+
}, [ref]);
|
|
144
|
+
React.useEffect(() => {
|
|
145
|
+
mountedRef.current = true;
|
|
146
|
+
return () => {
|
|
147
|
+
mountedRef.current = false;
|
|
148
|
+
operationRef.current += 1;
|
|
149
|
+
};
|
|
150
|
+
}, []);
|
|
151
|
+
React.useEffect(() => {
|
|
152
|
+
operationRef.current += 1;
|
|
153
|
+
approvalRef.current = "idle";
|
|
154
|
+
setConfirmError(false);
|
|
155
|
+
setPortalTarget(hasConfirm ? document.body : null);
|
|
156
|
+
}, [hasConfirm]);
|
|
157
|
+
function closePopover() {
|
|
158
|
+
if (popoverRef.current?.matches(":popover-open")) {
|
|
159
|
+
popoverRef.current.hidePopover();
|
|
207
160
|
}
|
|
208
|
-
|
|
209
|
-
}
|
|
210
|
-
function buildInfo(item, key, keyPath, domEvent, nextSelectedKeys = currentSelectedKeys) {
|
|
211
|
-
return {
|
|
212
|
-
key,
|
|
213
|
-
keyPath,
|
|
214
|
-
item,
|
|
215
|
-
selectedKeys: nextSelectedKeys,
|
|
216
|
-
domEvent
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
function activateItem(item, key, keyPath, event) {
|
|
220
|
-
if (disabled || item.disabled) {
|
|
221
|
-
event.preventDefault();
|
|
222
|
-
return;
|
|
223
|
-
}
|
|
224
|
-
let nextSelectedKeys = currentSelectedKeys;
|
|
225
|
-
const selected = currentSelectedKeys.includes(key);
|
|
226
|
-
if (selectable) {
|
|
227
|
-
if (selected && multiple) {
|
|
228
|
-
nextSelectedKeys = currentSelectedKeys.filter((selectedKey) => selectedKey !== key);
|
|
229
|
-
setNextSelectedKeys(nextSelectedKeys);
|
|
230
|
-
onDeselect?.(buildInfo(item, key, keyPath, event, nextSelectedKeys));
|
|
231
|
-
} else if (!selected) {
|
|
232
|
-
nextSelectedKeys = multiple ? [...currentSelectedKeys, key] : [key];
|
|
233
|
-
setNextSelectedKeys(nextSelectedKeys);
|
|
234
|
-
onSelect?.(buildInfo(item, key, keyPath, event, nextSelectedKeys));
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
onClick?.(buildInfo(item, key, keyPath, event, nextSelectedKeys));
|
|
238
|
-
}
|
|
239
|
-
function toggleSubmenu(key) {
|
|
240
|
-
const open = currentOpenKeys.includes(key);
|
|
241
|
-
setNextOpenKeys(open ? currentOpenKeys.filter((openKey) => openKey !== key) : [...currentOpenKeys, key]);
|
|
242
|
-
}
|
|
243
|
-
function renderItem(item, indexPath, parentKeyPath = []) {
|
|
244
|
-
if (item.type === "divider") {
|
|
245
|
-
return /* @__PURE__ */ jsx(MenuDivider, {}, `divider-${indexPath.join("-")}`);
|
|
246
|
-
}
|
|
247
|
-
const key = keyForItem(item, indexPath);
|
|
248
|
-
const keyPath = [key, ...parentKeyPath];
|
|
249
|
-
if (item.type === "group") {
|
|
250
|
-
return /* @__PURE__ */ jsx(MenuItemGroup, {
|
|
251
|
-
title: item.label ?? item.title,
|
|
252
|
-
children: item.children?.map((child, childIndex) => renderItem(child, [...indexPath, childIndex], keyPath))
|
|
253
|
-
}, key);
|
|
254
|
-
}
|
|
255
|
-
const hasChildren = Boolean(item.children?.length);
|
|
256
|
-
const selected = currentSelectedKeys.includes(key);
|
|
257
|
-
const open = currentOpenKeys.includes(key);
|
|
258
|
-
const itemDisabled = disabled || item.disabled;
|
|
259
|
-
if (hasChildren) {
|
|
260
|
-
return /* @__PURE__ */ jsxs("li", {
|
|
261
|
-
className: cn("menu-submenu-wrapper", item.className),
|
|
262
|
-
children: [
|
|
263
|
-
/* @__PURE__ */ jsxs("button", {
|
|
264
|
-
type: "button",
|
|
265
|
-
className: getMenuItemClasses({
|
|
266
|
-
active: selected,
|
|
267
|
-
disabled: itemDisabled,
|
|
268
|
-
danger: item.danger,
|
|
269
|
-
submenu: true
|
|
270
|
-
}),
|
|
271
|
-
disabled: itemDisabled,
|
|
272
|
-
"aria-expanded": open,
|
|
273
|
-
onClick: () => toggleSubmenu(key),
|
|
274
|
-
children: [
|
|
275
|
-
item.icon ? /* @__PURE__ */ jsx("span", {
|
|
276
|
-
className: menuItemIconClass,
|
|
277
|
-
children: item.icon
|
|
278
|
-
}) : null,
|
|
279
|
-
/* @__PURE__ */ jsx("span", {
|
|
280
|
-
children: item.label ?? item.title
|
|
281
|
-
}),
|
|
282
|
-
item.extra ? /* @__PURE__ */ jsx("span", {
|
|
283
|
-
className: menuItemTrailingClass,
|
|
284
|
-
children: item.extra
|
|
285
|
-
}) : null
|
|
286
|
-
]
|
|
287
|
-
}),
|
|
288
|
-
open ? /* @__PURE__ */ jsx("ul", {
|
|
289
|
-
className: cn(menuSubmenuClass, "menu-show"),
|
|
290
|
-
children: item.children?.map((child, childIndex) => renderItem(child, [...indexPath, childIndex], keyPath))
|
|
291
|
-
}) : null
|
|
292
|
-
]
|
|
293
|
-
}, key);
|
|
294
|
-
}
|
|
295
|
-
return /* @__PURE__ */ jsx(MenuItem, {
|
|
296
|
-
role: "menuitem",
|
|
297
|
-
tabIndex: itemDisabled ? undefined : 0,
|
|
298
|
-
active: selected,
|
|
299
|
-
disabled: itemDisabled,
|
|
300
|
-
danger: item.danger,
|
|
301
|
-
icon: item.icon,
|
|
302
|
-
extra: item.extra,
|
|
303
|
-
className: item.className,
|
|
304
|
-
onClick: (event) => activateItem(item, key, keyPath, event),
|
|
305
|
-
onKeyDown: (event) => {
|
|
306
|
-
if (!isActivationKey(event.key)) {
|
|
307
|
-
return;
|
|
308
|
-
}
|
|
309
|
-
event.preventDefault();
|
|
310
|
-
activateItem(item, key, keyPath, event);
|
|
311
|
-
},
|
|
312
|
-
children: item.label
|
|
313
|
-
}, key);
|
|
314
|
-
}
|
|
315
|
-
return /* @__PURE__ */ jsx("ul", {
|
|
316
|
-
...props,
|
|
317
|
-
ref,
|
|
318
|
-
role: props.role ?? "menu",
|
|
319
|
-
className: getMenuClasses({
|
|
320
|
-
mode,
|
|
321
|
-
theme,
|
|
322
|
-
size,
|
|
323
|
-
inlineCollapsed,
|
|
324
|
-
disabled,
|
|
325
|
-
className
|
|
326
|
-
}),
|
|
327
|
-
children: items ? items.map((item, index) => renderItem(item, [index])) : children
|
|
328
|
-
});
|
|
329
|
-
});
|
|
330
|
-
MenuRoot.displayName = "Menu";
|
|
331
|
-
MenuRoot.Item = MenuItem;
|
|
332
|
-
MenuRoot.Divider = MenuDivider;
|
|
333
|
-
MenuRoot.ItemGroup = MenuItemGroup;
|
|
334
|
-
var Menu = MenuRoot;
|
|
335
|
-
// src/components/button/Button.tsx
|
|
336
|
-
import React2 from "react";
|
|
337
|
-
import { createPortal } from "react-dom";
|
|
338
|
-
|
|
339
|
-
// src/classes/button.ts
|
|
340
|
-
var buttonBaseClass = "btn";
|
|
341
|
-
var buttonColorClasses = {
|
|
342
|
-
primary: "btn-primary",
|
|
343
|
-
secondary: "btn-secondary",
|
|
344
|
-
tertiary: "btn-tertiary",
|
|
345
|
-
accent: "btn-accent",
|
|
346
|
-
neutral: "btn-neutral",
|
|
347
|
-
base: "btn-base",
|
|
348
|
-
info: "btn-info",
|
|
349
|
-
success: "btn-success",
|
|
350
|
-
warning: "btn-warning",
|
|
351
|
-
error: "btn-error"
|
|
352
|
-
};
|
|
353
|
-
var buttonAppearanceClasses = {
|
|
354
|
-
filled: "",
|
|
355
|
-
outline: "btn-outline",
|
|
356
|
-
tonal: "btn-tonal",
|
|
357
|
-
ghost: "btn-ghost",
|
|
358
|
-
text: "btn-text"
|
|
359
|
-
};
|
|
360
|
-
var buttonShapeClasses = {
|
|
361
|
-
rect: "",
|
|
362
|
-
circle: "btn-circle btn-icon",
|
|
363
|
-
square: "btn-square"
|
|
364
|
-
};
|
|
365
|
-
var buttonSizeClasses = {
|
|
366
|
-
xs: "btn-xs",
|
|
367
|
-
sm: "btn-sm",
|
|
368
|
-
md: "btn-md",
|
|
369
|
-
lg: "btn-lg"
|
|
370
|
-
};
|
|
371
|
-
var buttonBlockClass = "btn-block";
|
|
372
|
-
var buttonIsLoadingClass = "btn-loading";
|
|
373
|
-
function getButtonClasses({
|
|
374
|
-
color = "primary",
|
|
375
|
-
appearance = "filled",
|
|
376
|
-
shape = "rect",
|
|
377
|
-
size = "md",
|
|
378
|
-
block,
|
|
379
|
-
isLoading,
|
|
380
|
-
className
|
|
381
|
-
}) {
|
|
382
|
-
return cn(buttonBaseClass, buttonColorClasses[color], buttonAppearanceClasses[appearance], buttonShapeClasses[shape], buttonSizeClasses[size], shape === "circle" && size === "xs" && "btn-icon-sm", shape === "circle" && size === "sm" && "btn-icon-sm", shape === "circle" && size === "lg" && "btn-icon-lg", block && buttonBlockClass, isLoading && buttonIsLoadingClass, className);
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
// src/components/button/Button.tsx
|
|
386
|
-
import { jsx as jsx2, jsxs as jsxs2, Fragment } from "react/jsx-runtime";
|
|
387
|
-
function isPromiseLike(value) {
|
|
388
|
-
return value !== null && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
|
|
389
|
-
}
|
|
390
|
-
function Button({
|
|
391
|
-
color = "primary",
|
|
392
|
-
appearance = "filled",
|
|
393
|
-
shape = "rect",
|
|
394
|
-
size = "md",
|
|
395
|
-
block,
|
|
396
|
-
isLoading,
|
|
397
|
-
leftIcon,
|
|
398
|
-
rightIcon,
|
|
399
|
-
className,
|
|
400
|
-
children,
|
|
401
|
-
disabled,
|
|
402
|
-
ref,
|
|
403
|
-
confirm,
|
|
404
|
-
onClick,
|
|
405
|
-
...props
|
|
406
|
-
}) {
|
|
407
|
-
const buttonRef = React2.useRef(null);
|
|
408
|
-
const popoverRef = React2.useRef(null);
|
|
409
|
-
const cancelRef = React2.useRef(null);
|
|
410
|
-
const approvalRef = React2.useRef("idle");
|
|
411
|
-
const pendingRef = React2.useRef(false);
|
|
412
|
-
const actionRef = React2.useRef(0);
|
|
413
|
-
const operationRef = React2.useRef(0);
|
|
414
|
-
const mountedRef = React2.useRef(false);
|
|
415
|
-
const [portalTarget, setPortalTarget] = React2.useState(null);
|
|
416
|
-
const [confirmLoading, setConfirmLoading] = React2.useState(false);
|
|
417
|
-
const [confirmError, setConfirmError] = React2.useState(false);
|
|
418
|
-
const generatedId = React2.useId().replace(/:/g, "");
|
|
419
|
-
const popoverId = `button-confirm-${generatedId}`;
|
|
420
|
-
const titleId = `${popoverId}-title`;
|
|
421
|
-
const descriptionId = `${popoverId}-description`;
|
|
422
|
-
const anchor = `--${popoverId}-anchor`;
|
|
423
|
-
const hasConfirm = Boolean(confirm);
|
|
424
|
-
const confirmation = confirm && typeof confirm === "object" ? confirm : undefined;
|
|
425
|
-
const title = confirmation ? confirmation.title : "Confirm action";
|
|
426
|
-
const hasTitle = title !== undefined && title !== null && title !== false && title !== "";
|
|
427
|
-
const content = confirmation?.component ?? confirmation?.message ?? confirmation?.description;
|
|
428
|
-
const hasContent = content !== undefined && content !== null && content !== false && content !== "";
|
|
429
|
-
const mergedRef = React2.useCallback((node) => {
|
|
430
|
-
buttonRef.current = node;
|
|
431
|
-
if (!node) {
|
|
432
|
-
if (typeof ref === "function")
|
|
433
|
-
ref(null);
|
|
434
|
-
else if (ref)
|
|
435
|
-
ref.current = null;
|
|
436
|
-
return;
|
|
437
|
-
}
|
|
438
|
-
const cleanup = typeof ref === "function" ? ref(node) : undefined;
|
|
439
|
-
if (ref && typeof ref !== "function")
|
|
440
|
-
ref.current = node;
|
|
441
|
-
return () => {
|
|
442
|
-
buttonRef.current = null;
|
|
443
|
-
if (typeof cleanup === "function")
|
|
444
|
-
cleanup();
|
|
445
|
-
else if (typeof ref === "function")
|
|
446
|
-
ref(null);
|
|
447
|
-
else if (ref)
|
|
448
|
-
ref.current = null;
|
|
449
|
-
};
|
|
450
|
-
}, [ref]);
|
|
451
|
-
React2.useEffect(() => {
|
|
452
|
-
mountedRef.current = true;
|
|
453
|
-
return () => {
|
|
454
|
-
mountedRef.current = false;
|
|
455
|
-
operationRef.current += 1;
|
|
456
|
-
};
|
|
457
|
-
}, []);
|
|
458
|
-
React2.useEffect(() => {
|
|
459
|
-
operationRef.current += 1;
|
|
460
|
-
approvalRef.current = "idle";
|
|
461
|
-
setConfirmError(false);
|
|
462
|
-
setPortalTarget(hasConfirm ? document.body : null);
|
|
463
|
-
}, [hasConfirm]);
|
|
464
|
-
function closePopover() {
|
|
465
|
-
if (popoverRef.current?.matches(":popover-open")) {
|
|
466
|
-
popoverRef.current.hidePopover();
|
|
467
|
-
}
|
|
468
|
-
buttonRef.current?.focus();
|
|
161
|
+
buttonRef.current?.focus();
|
|
469
162
|
}
|
|
470
163
|
function handleClick(event) {
|
|
471
164
|
if (!confirm) {
|
|
@@ -563,9 +256,9 @@ function Button({
|
|
|
563
256
|
size: "sm",
|
|
564
257
|
isLoading: confirmLoading
|
|
565
258
|
});
|
|
566
|
-
return /* @__PURE__ */
|
|
259
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
567
260
|
children: [
|
|
568
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ jsxs("button", {
|
|
569
262
|
ref: confirm ? mergedRef : ref,
|
|
570
263
|
className: classes,
|
|
571
264
|
disabled: disabled || isLoading,
|
|
@@ -577,24 +270,24 @@ function Button({
|
|
|
577
270
|
"aria-controls": confirm ? popoverId : props["aria-controls"],
|
|
578
271
|
onClick: confirm ? handleClick : onClick,
|
|
579
272
|
children: [
|
|
580
|
-
isLoading && /* @__PURE__ */
|
|
273
|
+
isLoading && /* @__PURE__ */ jsx("span", {
|
|
581
274
|
className: "btn-spinner"
|
|
582
275
|
}),
|
|
583
|
-
!isLoading && leftIcon && /* @__PURE__ */
|
|
276
|
+
!isLoading && leftIcon && /* @__PURE__ */ jsx("span", {
|
|
584
277
|
className: "btn-icon-left",
|
|
585
278
|
children: leftIcon
|
|
586
279
|
}),
|
|
587
|
-
/* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ jsx("span", {
|
|
588
281
|
className: "btn-content",
|
|
589
282
|
children
|
|
590
283
|
}),
|
|
591
|
-
!isLoading && rightIcon && /* @__PURE__ */
|
|
284
|
+
!isLoading && rightIcon && /* @__PURE__ */ jsx("span", {
|
|
592
285
|
className: "btn-icon-right",
|
|
593
286
|
children: rightIcon
|
|
594
287
|
})
|
|
595
288
|
]
|
|
596
289
|
}),
|
|
597
|
-
confirm && portalTarget && createPortal(/* @__PURE__ */
|
|
290
|
+
confirm && portalTarget && createPortal(/* @__PURE__ */ jsxs("form", {
|
|
598
291
|
id: popoverId,
|
|
599
292
|
ref: popoverRef,
|
|
600
293
|
popover: "auto",
|
|
@@ -615,28 +308,28 @@ function Button({
|
|
|
615
308
|
}
|
|
616
309
|
},
|
|
617
310
|
children: [
|
|
618
|
-
hasTitle && /* @__PURE__ */
|
|
311
|
+
hasTitle && /* @__PURE__ */ jsx("div", {
|
|
619
312
|
className: "popover-header",
|
|
620
|
-
children: /* @__PURE__ */
|
|
313
|
+
children: /* @__PURE__ */ jsx("h3", {
|
|
621
314
|
id: titleId,
|
|
622
315
|
className: "popover-title",
|
|
623
316
|
children: title
|
|
624
317
|
})
|
|
625
318
|
}),
|
|
626
|
-
hasContent && /* @__PURE__ */
|
|
319
|
+
hasContent && /* @__PURE__ */ jsx("div", {
|
|
627
320
|
id: descriptionId,
|
|
628
321
|
className: "popover-body",
|
|
629
322
|
children: content
|
|
630
323
|
}),
|
|
631
|
-
confirmError && /* @__PURE__ */
|
|
324
|
+
confirmError && /* @__PURE__ */ jsx("div", {
|
|
632
325
|
role: "alert",
|
|
633
326
|
className: "popover-body",
|
|
634
327
|
children: "The action failed. Please try again."
|
|
635
328
|
}),
|
|
636
|
-
/* @__PURE__ */
|
|
329
|
+
/* @__PURE__ */ jsxs("div", {
|
|
637
330
|
className: "popover-footer",
|
|
638
331
|
children: [
|
|
639
|
-
/* @__PURE__ */
|
|
332
|
+
/* @__PURE__ */ jsx("button", {
|
|
640
333
|
ref: cancelRef,
|
|
641
334
|
type: "button",
|
|
642
335
|
className: "btn btn-text btn-sm",
|
|
@@ -645,7 +338,7 @@ function Button({
|
|
|
645
338
|
disabled: confirmLoading,
|
|
646
339
|
children: confirmation?.cancelText ?? "Cancel"
|
|
647
340
|
}),
|
|
648
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ jsx("button", {
|
|
649
342
|
type: "submit",
|
|
650
343
|
className: confirmClasses,
|
|
651
344
|
disabled: disabled || isLoading || confirmLoading,
|
|
@@ -659,6 +352,313 @@ function Button({
|
|
|
659
352
|
]
|
|
660
353
|
});
|
|
661
354
|
}
|
|
355
|
+
// src/components/menu/Menu.tsx
|
|
356
|
+
import { forwardRef, useState } from "react";
|
|
357
|
+
|
|
358
|
+
// src/classes/menu.ts
|
|
359
|
+
var menuBaseClass = "menu";
|
|
360
|
+
var menuShowClass = "menu-show";
|
|
361
|
+
var menuItemClass = "menu-item";
|
|
362
|
+
var menuItemActiveClass = "menu-item-active";
|
|
363
|
+
var menuItemDisabledClass = "menu-item-disabled";
|
|
364
|
+
var menuItemIconClass = "menu-item-icon";
|
|
365
|
+
var menuItemTrailingClass = "menu-item-trailing";
|
|
366
|
+
var menuItemSubmenuClass = "menu-item-submenu";
|
|
367
|
+
var menuDividerClass = "menu-divider";
|
|
368
|
+
var menuLabelClass = "menu-label";
|
|
369
|
+
var menuSubmenuClass = "menu-submenu";
|
|
370
|
+
var menuCompactClass = "menu-compact";
|
|
371
|
+
var menuWideClass = "menu-wide";
|
|
372
|
+
var menuModeClasses = {
|
|
373
|
+
vertical: "menu-vertical",
|
|
374
|
+
horizontal: "menu-horizontal",
|
|
375
|
+
inline: "menu-inline"
|
|
376
|
+
};
|
|
377
|
+
var menuThemeClasses = {
|
|
378
|
+
light: "",
|
|
379
|
+
dark: "menu-dark menu-surface-container-highest"
|
|
380
|
+
};
|
|
381
|
+
var menuSizeClasses = {
|
|
382
|
+
sm: menuCompactClass,
|
|
383
|
+
md: "",
|
|
384
|
+
lg: menuWideClass
|
|
385
|
+
};
|
|
386
|
+
function getMenuClasses({
|
|
387
|
+
mode = "vertical",
|
|
388
|
+
theme = "light",
|
|
389
|
+
size = "md",
|
|
390
|
+
inlineCollapsed,
|
|
391
|
+
disabled,
|
|
392
|
+
className
|
|
393
|
+
}) {
|
|
394
|
+
return cn(menuBaseClass, menuShowClass, menuModeClasses[mode], menuThemeClasses[theme], menuSizeClasses[size], inlineCollapsed && "menu-inline-collapsed", disabled && menuItemDisabledClass, className);
|
|
395
|
+
}
|
|
396
|
+
function getMenuItemClasses({
|
|
397
|
+
active,
|
|
398
|
+
disabled,
|
|
399
|
+
danger,
|
|
400
|
+
submenu,
|
|
401
|
+
className
|
|
402
|
+
}) {
|
|
403
|
+
return cn(menuItemClass, active && menuItemActiveClass, disabled && menuItemDisabledClass, danger && "menu-item-danger", submenu && menuItemSubmenuClass, className);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
// src/components/menu/Menu.tsx
|
|
407
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
408
|
+
function normalizeKeys(keys) {
|
|
409
|
+
return keys?.map(String) ?? [];
|
|
410
|
+
}
|
|
411
|
+
function hasNode(node) {
|
|
412
|
+
return node !== undefined && node !== null && node !== false;
|
|
413
|
+
}
|
|
414
|
+
function keyForItem(item, indexPath) {
|
|
415
|
+
return String(item.key ?? indexPath.join("-"));
|
|
416
|
+
}
|
|
417
|
+
function isActivationKey(key) {
|
|
418
|
+
return key === "Enter" || key === " ";
|
|
419
|
+
}
|
|
420
|
+
var MenuItem = forwardRef(({
|
|
421
|
+
children,
|
|
422
|
+
icon,
|
|
423
|
+
extra,
|
|
424
|
+
active,
|
|
425
|
+
disabled,
|
|
426
|
+
danger,
|
|
427
|
+
className,
|
|
428
|
+
role,
|
|
429
|
+
...props
|
|
430
|
+
}, ref) => /* @__PURE__ */ jsxs2("li", {
|
|
431
|
+
...props,
|
|
432
|
+
ref,
|
|
433
|
+
role: role ?? "menuitem",
|
|
434
|
+
"aria-disabled": disabled || undefined,
|
|
435
|
+
className: getMenuItemClasses({
|
|
436
|
+
active,
|
|
437
|
+
disabled,
|
|
438
|
+
danger,
|
|
439
|
+
className
|
|
440
|
+
}),
|
|
441
|
+
children: [
|
|
442
|
+
icon ? /* @__PURE__ */ jsx2("span", {
|
|
443
|
+
className: menuItemIconClass,
|
|
444
|
+
children: icon
|
|
445
|
+
}) : null,
|
|
446
|
+
/* @__PURE__ */ jsx2("span", {
|
|
447
|
+
children
|
|
448
|
+
}),
|
|
449
|
+
extra ? /* @__PURE__ */ jsx2("span", {
|
|
450
|
+
className: menuItemTrailingClass,
|
|
451
|
+
children: extra
|
|
452
|
+
}) : null
|
|
453
|
+
]
|
|
454
|
+
}));
|
|
455
|
+
MenuItem.displayName = "Menu.Item";
|
|
456
|
+
var MenuDivider = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2("li", {
|
|
457
|
+
...props,
|
|
458
|
+
ref,
|
|
459
|
+
role: "separator",
|
|
460
|
+
className: cn(menuDividerClass, className)
|
|
461
|
+
}));
|
|
462
|
+
MenuDivider.displayName = "Menu.Divider";
|
|
463
|
+
var MenuItemGroup = forwardRef(({ title, children, className, ...props }, ref) => /* @__PURE__ */ jsxs2("li", {
|
|
464
|
+
...props,
|
|
465
|
+
ref,
|
|
466
|
+
className: cn("menu-group", className),
|
|
467
|
+
children: [
|
|
468
|
+
hasNode(title) ? /* @__PURE__ */ jsx2("div", {
|
|
469
|
+
className: menuLabelClass,
|
|
470
|
+
children: title
|
|
471
|
+
}) : null,
|
|
472
|
+
/* @__PURE__ */ jsx2("ul", {
|
|
473
|
+
className: cn(menuSubmenuClass, "menu-show"),
|
|
474
|
+
children
|
|
475
|
+
})
|
|
476
|
+
]
|
|
477
|
+
}));
|
|
478
|
+
MenuItemGroup.displayName = "Menu.ItemGroup";
|
|
479
|
+
var MenuRoot = forwardRef(({
|
|
480
|
+
items,
|
|
481
|
+
children,
|
|
482
|
+
selectedKeys,
|
|
483
|
+
defaultSelectedKeys,
|
|
484
|
+
openKeys,
|
|
485
|
+
defaultOpenKeys,
|
|
486
|
+
mode = "vertical",
|
|
487
|
+
theme = "light",
|
|
488
|
+
size = "md",
|
|
489
|
+
selectable = true,
|
|
490
|
+
multiple,
|
|
491
|
+
inlineCollapsed,
|
|
492
|
+
disabled,
|
|
493
|
+
onClick,
|
|
494
|
+
onSelect,
|
|
495
|
+
onDeselect,
|
|
496
|
+
onOpenChange,
|
|
497
|
+
className,
|
|
498
|
+
...props
|
|
499
|
+
}, ref) => {
|
|
500
|
+
const selectedControlled = selectedKeys !== undefined;
|
|
501
|
+
const openControlled = openKeys !== undefined;
|
|
502
|
+
const [internalSelectedKeys, setInternalSelectedKeys] = useState(() => normalizeKeys(defaultSelectedKeys));
|
|
503
|
+
const [internalOpenKeys, setInternalOpenKeys] = useState(() => normalizeKeys(defaultOpenKeys));
|
|
504
|
+
const currentSelectedKeys = selectedControlled ? normalizeKeys(selectedKeys) : internalSelectedKeys;
|
|
505
|
+
const currentOpenKeys = openControlled ? normalizeKeys(openKeys) : internalOpenKeys;
|
|
506
|
+
function setNextSelectedKeys(nextSelectedKeys) {
|
|
507
|
+
if (!selectedControlled) {
|
|
508
|
+
setInternalSelectedKeys(nextSelectedKeys);
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
function setNextOpenKeys(nextOpenKeys) {
|
|
512
|
+
if (!openControlled) {
|
|
513
|
+
setInternalOpenKeys(nextOpenKeys);
|
|
514
|
+
}
|
|
515
|
+
onOpenChange?.(nextOpenKeys);
|
|
516
|
+
}
|
|
517
|
+
function buildInfo(item, key, keyPath, domEvent, nextSelectedKeys = currentSelectedKeys) {
|
|
518
|
+
return {
|
|
519
|
+
key,
|
|
520
|
+
keyPath,
|
|
521
|
+
item,
|
|
522
|
+
selectedKeys: nextSelectedKeys,
|
|
523
|
+
domEvent
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
function activateItem(item, key, keyPath, event) {
|
|
527
|
+
if (disabled || item.disabled) {
|
|
528
|
+
event.preventDefault();
|
|
529
|
+
return;
|
|
530
|
+
}
|
|
531
|
+
let nextSelectedKeys = currentSelectedKeys;
|
|
532
|
+
const selected = currentSelectedKeys.includes(key);
|
|
533
|
+
if (selectable) {
|
|
534
|
+
if (selected && multiple) {
|
|
535
|
+
nextSelectedKeys = currentSelectedKeys.filter((selectedKey) => selectedKey !== key);
|
|
536
|
+
setNextSelectedKeys(nextSelectedKeys);
|
|
537
|
+
onDeselect?.(buildInfo(item, key, keyPath, event, nextSelectedKeys));
|
|
538
|
+
} else if (!selected) {
|
|
539
|
+
nextSelectedKeys = multiple ? [...currentSelectedKeys, key] : [key];
|
|
540
|
+
setNextSelectedKeys(nextSelectedKeys);
|
|
541
|
+
onSelect?.(buildInfo(item, key, keyPath, event, nextSelectedKeys));
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
onClick?.(buildInfo(item, key, keyPath, event, nextSelectedKeys));
|
|
545
|
+
}
|
|
546
|
+
function toggleSubmenu(key) {
|
|
547
|
+
const open = currentOpenKeys.includes(key);
|
|
548
|
+
setNextOpenKeys(open ? currentOpenKeys.filter((openKey) => openKey !== key) : [...currentOpenKeys, key]);
|
|
549
|
+
}
|
|
550
|
+
function renderItem(item, indexPath, parentKeyPath = []) {
|
|
551
|
+
if (item.type === "divider") {
|
|
552
|
+
return /* @__PURE__ */ jsx2(MenuDivider, {}, `divider-${indexPath.join("-")}`);
|
|
553
|
+
}
|
|
554
|
+
const key = keyForItem(item, indexPath);
|
|
555
|
+
const keyPath = [key, ...parentKeyPath];
|
|
556
|
+
if (item.type === "group") {
|
|
557
|
+
return /* @__PURE__ */ jsx2(MenuItemGroup, {
|
|
558
|
+
title: item.label ?? item.title,
|
|
559
|
+
children: item.children?.map((child, childIndex) => renderItem(child, [...indexPath, childIndex], keyPath))
|
|
560
|
+
}, key);
|
|
561
|
+
}
|
|
562
|
+
const hasChildren = Boolean(item.children?.length);
|
|
563
|
+
const selected = currentSelectedKeys.includes(key);
|
|
564
|
+
const open = currentOpenKeys.includes(key);
|
|
565
|
+
const itemDisabled = disabled || item.disabled;
|
|
566
|
+
if (hasChildren) {
|
|
567
|
+
return /* @__PURE__ */ jsxs2("li", {
|
|
568
|
+
className: cn("menu-submenu-wrapper", item.className),
|
|
569
|
+
children: [
|
|
570
|
+
/* @__PURE__ */ jsxs2("button", {
|
|
571
|
+
type: "button",
|
|
572
|
+
className: getMenuItemClasses({
|
|
573
|
+
active: selected,
|
|
574
|
+
disabled: itemDisabled,
|
|
575
|
+
danger: item.danger,
|
|
576
|
+
submenu: true
|
|
577
|
+
}),
|
|
578
|
+
disabled: itemDisabled,
|
|
579
|
+
"aria-expanded": open,
|
|
580
|
+
onClick: () => toggleSubmenu(key),
|
|
581
|
+
children: [
|
|
582
|
+
item.icon ? /* @__PURE__ */ jsx2("span", {
|
|
583
|
+
className: menuItemIconClass,
|
|
584
|
+
children: item.icon
|
|
585
|
+
}) : null,
|
|
586
|
+
/* @__PURE__ */ jsx2("span", {
|
|
587
|
+
children: item.label ?? item.title
|
|
588
|
+
}),
|
|
589
|
+
item.extra ? /* @__PURE__ */ jsx2("span", {
|
|
590
|
+
className: menuItemTrailingClass,
|
|
591
|
+
children: item.extra
|
|
592
|
+
}) : null
|
|
593
|
+
]
|
|
594
|
+
}),
|
|
595
|
+
open ? /* @__PURE__ */ jsx2("ul", {
|
|
596
|
+
className: cn(menuSubmenuClass, "menu-show"),
|
|
597
|
+
children: item.children?.map((child, childIndex) => renderItem(child, [...indexPath, childIndex], keyPath))
|
|
598
|
+
}) : null
|
|
599
|
+
]
|
|
600
|
+
}, key);
|
|
601
|
+
}
|
|
602
|
+
return /* @__PURE__ */ jsx2(MenuItem, {
|
|
603
|
+
role: "menuitem",
|
|
604
|
+
tabIndex: itemDisabled ? undefined : 0,
|
|
605
|
+
active: selected,
|
|
606
|
+
disabled: itemDisabled,
|
|
607
|
+
danger: item.danger,
|
|
608
|
+
icon: item.icon,
|
|
609
|
+
extra: item.extra,
|
|
610
|
+
className: item.className,
|
|
611
|
+
onClick: (event) => activateItem(item, key, keyPath, event),
|
|
612
|
+
onKeyDown: (event) => {
|
|
613
|
+
if (!isActivationKey(event.key)) {
|
|
614
|
+
return;
|
|
615
|
+
}
|
|
616
|
+
event.preventDefault();
|
|
617
|
+
activateItem(item, key, keyPath, event);
|
|
618
|
+
},
|
|
619
|
+
children: item.label
|
|
620
|
+
}, key);
|
|
621
|
+
}
|
|
622
|
+
return /* @__PURE__ */ jsx2("ul", {
|
|
623
|
+
...props,
|
|
624
|
+
ref,
|
|
625
|
+
role: props.role ?? "menu",
|
|
626
|
+
className: getMenuClasses({
|
|
627
|
+
mode,
|
|
628
|
+
theme,
|
|
629
|
+
size,
|
|
630
|
+
inlineCollapsed,
|
|
631
|
+
disabled,
|
|
632
|
+
className
|
|
633
|
+
}),
|
|
634
|
+
children: items ? items.map((item, index) => renderItem(item, [index])) : children
|
|
635
|
+
});
|
|
636
|
+
});
|
|
637
|
+
MenuRoot.displayName = "Menu";
|
|
638
|
+
MenuRoot.Item = MenuItem;
|
|
639
|
+
MenuRoot.Divider = MenuDivider;
|
|
640
|
+
MenuRoot.ItemGroup = MenuItemGroup;
|
|
641
|
+
var Menu = MenuRoot;
|
|
642
|
+
// src/components/dm-menu/DmMenu.tsx
|
|
643
|
+
import { forwardRef as forwardRef2, useMemo } from "react";
|
|
644
|
+
|
|
645
|
+
// src/classes/dm-menu.ts
|
|
646
|
+
var dmMenuClass = "dm-menu";
|
|
647
|
+
var dmMenuNoHeaderClass = "dm-menu-no-header";
|
|
648
|
+
var dmMenuCollapsedClass = "dm-menu-collapsed";
|
|
649
|
+
var dmMenuHeaderClass = "dm-menu-header";
|
|
650
|
+
var dmMenuProductIconClass = "dm-menu-product-icon";
|
|
651
|
+
var dmMenuContentClass = "dm-menu-content";
|
|
652
|
+
var dmMenuFooterClass = "dm-menu-footer";
|
|
653
|
+
var dmMenuCollapseButtonClass = "dm-menu-collapse-button";
|
|
654
|
+
function getDmMenuClasses({
|
|
655
|
+
hideProductHeader,
|
|
656
|
+
inlineCollapsed,
|
|
657
|
+
className
|
|
658
|
+
}) {
|
|
659
|
+
return cn(dmMenuClass, hideProductHeader && dmMenuNoHeaderClass, inlineCollapsed && dmMenuCollapsedClass, className);
|
|
660
|
+
}
|
|
661
|
+
|
|
662
662
|
// src/components/dm-menu/DmMenu.tsx
|
|
663
663
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
664
664
|
function getMenuLabel(menu, locale) {
|