@hsu-react/ui 1.0.0 → 2.0.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/README.md +15 -6
- package/es/components/Button/index.d.ts +49 -8
- package/es/components/Button/index.js +68 -25
- package/es/components/Button/index.module.scss +38 -0
- package/es/components/ChainGraph/_components/ExpandButtons/index.module.scss +5 -3
- package/es/components/ChainGraph/_components/SearchSelect/index.module.scss +3 -2
- package/es/components/ChainGraph/index.js +3 -1
- package/es/components/ChainGraph/index.module.scss +2 -2
- package/es/components/Chart/Group/index.module.scss +1 -1
- package/es/components/Chat/ChatHistory/_components/HistoryGroup/index.module.scss +1 -1
- package/es/components/Chat/ChatHistory/_components/HistoryItem/index.module.scss +13 -13
- package/es/components/Chat/ChatHistory/_components/NewChatButton/index.module.scss +6 -6
- package/es/components/Chat/ChatHistory/index.module.scss +3 -3
- package/es/components/Chat/ChatInput/_components/AgentToggleButton/index.module.scss +9 -9
- package/es/components/Chat/ChatInput/_components/FileList/index.module.scss +3 -3
- package/es/components/Chat/ChatInput/_components/SendButton/index.module.scss +3 -3
- package/es/components/Chat/ChatInput/_components/StopButton/index.module.scss +2 -2
- package/es/components/Chat/ChatInput/_components/UploadButton/index.js +1 -1
- package/es/components/Chat/ChatInput/_components/UploadButton/index.module.scss +3 -3
- package/es/components/Chat/ChatInput/_utils/index.js +1 -1
- package/es/components/Chat/ChatInput/index.module.scss +12 -11
- package/es/components/Chat/ChatList/_components/Assistant/AssistantItem/_components/Copy/index.js +1 -1
- package/es/components/Chat/ChatList/_components/Assistant/AssistantItem/_components/Copy/index.module.scss +6 -6
- package/es/components/Chat/ChatList/_components/Assistant/AssistantItem/_components/LikeDislike/index.js +3 -1
- package/es/components/Chat/ChatList/_components/Assistant/AssistantItem/_components/LikeDislike/index.module.scss +6 -6
- package/es/components/Chat/ChatList/_components/Assistant/AssistantItem/_components/QuoteList/index.module.scss +8 -8
- package/es/components/Chat/ChatList/_components/Assistant/AssistantItem/index.module.scss +7 -7
- package/es/components/Chat/ChatList/_components/Assistant/index.module.scss +3 -3
- package/es/components/Chat/ChatList/_components/User/index.module.scss +21 -10
- package/es/components/Chat/ChatList/index.js +35 -30
- package/es/components/Checkbox/CheckboxGroup/index.module.scss +10 -13
- package/es/components/Checkbox/index.module.scss +23 -28
- package/es/components/CodeMirror/index.module.scss +6 -6
- package/es/components/Copy/index.d.ts +8 -2
- package/es/components/Copy/index.js +45 -22
- package/es/components/Copy/index.module.scss +5 -5
- package/es/components/DatePicker/RangePicker/index.js +5 -1
- package/es/components/DatePicker/RangePicker/index.module.scss +10 -1
- package/es/components/DatePicker/StepPicker/index.module.scss +6 -4
- package/es/components/DatePicker/index.js +14 -3
- package/es/components/DatePicker/index.module.scss +2 -2
- package/es/components/Descriptions/index.d.ts +6 -2
- package/es/components/Descriptions/index.js +15 -8
- package/es/components/Editor/index.module.scss +7 -7
- package/es/components/FileCol/index.js +3 -3
- package/es/components/FilePreview/_components/BasePreview/index.module.scss +3 -3
- package/es/components/FilePreview/_components/PdfPreview/index.js +9 -2
- package/es/components/FilePreview/_components/PdfPreview/index.module.scss +7 -7
- package/es/components/FilePreview/index.module.scss +4 -4
- package/es/components/Form/DrawerForm/index.js +10 -18
- package/es/components/Form/ImportForm/index.js +15 -16
- package/es/components/Form/ModalForm/index.d.ts +1 -1
- package/es/components/Form/ModalForm/index.js +14 -16
- package/es/components/Form/index.d.ts +12 -0
- package/es/components/Form/index.js +7 -1
- package/es/components/FormItem/FormInput/FormPasswordStrength/index.module.scss +3 -3
- package/es/components/FormItem/FormRadio/index.module.scss +11 -13
- package/es/components/FormItem/FormSegmented/index.module.scss +1 -1
- package/es/components/FormItem/FormSlider/index.module.scss +1 -1
- package/es/components/FormItem/FormUpload/FormImage/index.js +1 -1
- package/es/components/FormItem/FormUpload/index.js +2 -1
- package/es/components/FormItem/FormUpload/index.module.scss +17 -17
- package/es/components/FormItem/ItemContainer/index.js +4 -4
- package/es/components/FormItem/ItemContainer/index.module.scss +33 -7
- package/es/components/Input/Number/index.js +41 -55
- package/es/components/Input/Number/index.module.scss +27 -54
- package/es/components/Input/Range/index.module.scss +16 -5
- package/es/components/Input/TextArea/index.module.scss +13 -13
- package/es/components/Input/index.d.ts +3 -1
- package/es/components/Input/index.js +2 -0
- package/es/components/Input/index.module.scss +1 -1
- package/es/components/Markdown/Editor/index.module.scss +4 -4
- package/es/components/Markdown/Views/MermaidBlock.js +15 -1
- package/es/components/Markdown/Views/blocks.module.scss +13 -13
- package/es/components/Markdown/Views/index.module.scss +3 -3
- package/es/components/Modal/index.d.ts +12 -2
- package/es/components/Modal/index.js +31 -11
- package/es/components/Modal/index.module.scss +11 -1
- package/es/components/Operate/index.js +3 -1
- package/es/components/Operate/index.module.scss +1 -1
- package/es/components/Pagination/index.module.scss +19 -18
- package/es/components/Panel/DefaultPanel/index.module.scss +3 -3
- package/es/components/Panel/IframePanel/index.js +3 -1
- package/es/components/Panel/IframePanel/index.module.scss +2 -2
- package/es/components/Panel/ListPanel/ListModalPanel/index.d.ts +2 -2
- package/es/components/Panel/ListPanel/ListModalPanel/index.module.scss +2 -2
- package/es/components/Panel/ListPanel/_components/ColumnMgt/index.js +9 -17
- package/es/components/Panel/ListPanel/_components/ColumnMgt/index.module.scss +3 -3
- package/es/components/Panel/ListPanel/_components/ToolBar/index.js +1 -1
- package/es/components/Panel/ListPanel/_components/ToolBar/index.module.scss +14 -1
- package/es/components/Panel/ListPanel/index.d.ts +2 -2
- package/es/components/Panel/ListPanel/index.module.scss +9 -9
- package/es/components/Search/SearchAdvanced/index.d.ts +3 -3
- package/es/components/Search/SearchCard/index.module.scss +15 -15
- package/es/components/Search/SearchCollapsible/index.d.ts +3 -3
- package/es/components/Search/SearchWithFilter/index.d.ts +3 -3
- package/es/components/Search/SearchWithMore/index.d.ts +3 -3
- package/es/components/Search/_components/ButtonGroup/index.d.ts +4 -4
- package/es/components/Search/_components/ButtonGroup/index.js +2 -2
- package/es/components/Search/_components/FilterDropdown/index.js +3 -1
- package/es/components/Search/_hooks/useSearchCommon.d.ts +3 -3
- package/es/components/Search/_types/index.d.ts +3 -3
- package/es/components/Search/index.d.ts +3 -3
- package/es/components/Search/index.module.scss +33 -5
- package/es/components/SecondConf/index.js +16 -6
- package/es/components/SecondConf/index.module.scss +3 -3
- package/es/components/Select/AutoCompleteSelect/index.js +17 -7
- package/es/components/Select/AutoCompleteSelect/index.module.scss +73 -132
- package/es/components/Select/IconSelect/index.js +67 -60
- package/es/components/Select/IconSelect/index.module.scss +4 -3
- package/es/components/Select/TreeSelect/_utils/getExpandedKeysByLevel.d.ts +1 -1
- package/es/components/Select/TreeSelect/index.js +18 -7
- package/es/components/Select/TreeSelect/index.module.scss +19 -44
- package/es/components/Select/index.d.ts +17 -2
- package/es/components/Select/index.js +22 -4
- package/es/components/Select/index.module.scss +71 -131
- package/es/components/Slider/index.module.scss +1 -1
- package/es/components/Switch/index.module.scss +1 -1
- package/es/components/TabBar/index.module.scss +11 -11
- package/es/components/Table/_components/Drag/index.js +4 -1
- package/es/components/Table/_hooks/useTableColumns.js +1 -1
- package/es/components/Table/_utils/tableUtils.d.ts +1 -1
- package/es/components/Table/_utils/tableUtils.js +4 -3
- package/es/components/Table/index.d.ts +18 -2
- package/es/components/Table/index.js +9 -0
- package/es/components/Table/index.module.scss +14 -14
- package/es/components/Tags/_components/EllipsisTag/index.js +1 -1
- package/es/components/TextEllipsis/index.js +12 -8
- package/es/components/Tree/index.d.ts +8 -2
- package/es/components/Tree/index.js +2 -0
- package/es/components/Tree/index.module.scss +6 -6
- package/es/components/Upload/_components/UploadedItem/index.js +3 -3
- package/es/components/Upload/_components/UploadingItem/index.js +3 -3
- package/es/components/Upload/_utils/normalUpload.d.ts +1 -1
- package/es/components/Upload/_utils/validateFile.js +49 -2
- package/es/components/Upload/index.d.ts +8 -2
- package/es/components/Upload/index.js +11 -4
- package/es/config-provider/index.d.ts +34 -2
- package/es/config-provider/index.js +59 -5
- package/es/feedback/index.d.ts +20 -0
- package/es/feedback/index.js +130 -0
- package/es/hooks/index.d.ts +5 -0
- package/es/hooks/index.js +4 -1
- package/es/hooks/useBreakpoint.d.ts +24 -0
- package/es/hooks/useBreakpoint.js +57 -0
- package/es/hooks/useIsDark.d.ts +9 -0
- package/es/hooks/useIsDark.js +64 -0
- package/es/hooks/usePointerType.d.ts +22 -0
- package/es/hooks/usePointerType.js +62 -0
- package/es/index.d.ts +4 -4
- package/es/index.js +19 -5
- package/es/layout/Breadcrumb/_components/BreadcrumbItemIcon/index.d.ts +10 -0
- package/es/layout/Breadcrumb/_components/BreadcrumbItemIcon/index.js +19 -0
- package/es/layout/Breadcrumb/_components/BreadcrumbMenuItem/index.d.ts +11 -0
- package/es/layout/Breadcrumb/_components/BreadcrumbMenuItem/index.js +26 -0
- package/es/layout/Breadcrumb/_hooks/useBreadcrumbPath.d.ts +5 -0
- package/es/layout/Breadcrumb/_hooks/useBreadcrumbPath.js +104 -0
- package/es/layout/Breadcrumb/_utils/formatMenu.d.ts +9 -0
- package/es/layout/Breadcrumb/_utils/formatMenu.js +28 -0
- package/es/layout/Breadcrumb/_utils/formatRoutes.d.ts +9 -0
- package/es/layout/Breadcrumb/_utils/formatRoutes.js +76 -0
- package/es/layout/Breadcrumb/_utils/pathMatch.d.ts +8 -0
- package/es/layout/Breadcrumb/_utils/pathMatch.js +45 -0
- package/es/layout/Breadcrumb/index.d.ts +19 -0
- package/es/layout/Breadcrumb/index.js +96 -0
- package/es/layout/Breadcrumb/index.module.scss +15 -0
- package/es/layout/Header/index.d.ts +39 -0
- package/es/layout/Header/index.js +166 -0
- package/es/layout/Header/index.module.scss +215 -0
- package/es/layout/I18n/I18nStore.d.ts +29 -0
- package/es/layout/I18n/I18nStore.js +94 -0
- package/es/layout/I18n/index.d.ts +14 -0
- package/es/layout/I18n/index.js +33 -0
- package/es/layout/I18n/locales/en-US.d.ts +2 -0
- package/es/layout/I18n/locales/en-US.js +15 -0
- package/es/layout/I18n/locales/zh-CN.d.ts +2 -0
- package/es/layout/I18n/locales/zh-CN.js +15 -0
- package/es/layout/Menu/_components/SecondaryHeader/index.d.ts +22 -0
- package/es/layout/Menu/_components/SecondaryHeader/index.js +48 -0
- package/es/layout/Menu/_components/SecondaryHeader/index.module.scss +65 -0
- package/es/layout/Menu/_hooks/useMenuPath.d.ts +17 -0
- package/es/layout/Menu/_hooks/useMenuPath.js +91 -0
- package/es/layout/Menu/_hooks/useOnlyLvOneMenu.d.ts +13 -0
- package/es/layout/Menu/_hooks/useOnlyLvOneMenu.js +25 -0
- package/es/layout/Menu/_utils/formatMenu.d.ts +10 -0
- package/es/layout/Menu/_utils/formatMenu.js +55 -0
- package/es/layout/Menu/_utils/pathMatch.d.ts +8 -0
- package/es/layout/Menu/_utils/pathMatch.js +42 -0
- package/es/layout/Menu/_utils/setActiveIcon.d.ts +7 -0
- package/es/layout/Menu/_utils/setActiveIcon.js +20 -0
- package/es/layout/Menu/index.d.ts +34 -0
- package/es/layout/Menu/index.js +195 -0
- package/es/layout/Menu/index.module.scss +50 -0
- package/es/layout/NavTabBar/_components/SortableTab/index.d.ts +9 -0
- package/es/layout/NavTabBar/_components/SortableTab/index.js +34 -0
- package/es/layout/NavTabBar/_components/TabContextMenu/index.d.ts +20 -0
- package/es/layout/NavTabBar/_components/TabContextMenu/index.js +124 -0
- package/es/layout/NavTabBar/_components/TabDragOverlay/index.d.ts +20 -0
- package/es/layout/NavTabBar/_components/TabDragOverlay/index.js +50 -0
- package/es/layout/NavTabBar/_components/TabLabel/index.d.ts +22 -0
- package/es/layout/NavTabBar/_components/TabLabel/index.js +61 -0
- package/es/layout/NavTabBar/_hooks/useDropTabKey.d.ts +5 -0
- package/es/layout/NavTabBar/_hooks/useDropTabKey.js +25 -0
- package/es/layout/NavTabBar/_hooks/useTabContextMenu.d.ts +8 -0
- package/es/layout/NavTabBar/_hooks/useTabContextMenu.js +31 -0
- package/es/layout/NavTabBar/_hooks/useTabPath.d.ts +16 -0
- package/es/layout/NavTabBar/_hooks/useTabPath.js +131 -0
- package/es/layout/NavTabBar/_hooks/useTabTitle.d.ts +5 -0
- package/es/layout/NavTabBar/_hooks/useTabTitle.js +29 -0
- package/es/layout/NavTabBar/_utils/formatNavTabBar.d.ts +9 -0
- package/es/layout/NavTabBar/_utils/formatNavTabBar.js +48 -0
- package/es/layout/NavTabBar/_utils/pathMatch.d.ts +8 -0
- package/es/layout/NavTabBar/_utils/pathMatch.js +33 -0
- package/es/layout/NavTabBar/_utils/tabActions.d.ts +21 -0
- package/es/layout/NavTabBar/_utils/tabActions.js +114 -0
- package/es/layout/NavTabBar/index.d.ts +21 -0
- package/es/layout/NavTabBar/index.js +224 -0
- package/es/layout/NavTabBar/index.module.scss +179 -0
- package/es/layout/Theme/ThemeStore.d.ts +18 -0
- package/es/layout/Theme/ThemeStore.js +80 -0
- package/es/layout/Theme/index.d.ts +30 -0
- package/es/layout/Theme/index.js +89 -0
- package/es/layout/Theme/index.module.scss +6 -0
- package/es/layout/_hooks/useDropTab.d.ts +6 -0
- package/es/layout/_hooks/useDropTab.js +13 -0
- package/es/layout/_hooks/useReload.d.ts +6 -0
- package/es/layout/_hooks/useReload.js +10 -0
- package/es/layout/_hooks/useSetTabTitle.d.ts +6 -0
- package/es/layout/_hooks/useSetTabTitle.js +10 -0
- package/es/layout/_utils/storage.d.ts +6 -0
- package/es/layout/_utils/storage.js +32 -0
- package/es/layout/index.d.ts +54 -0
- package/es/layout/index.js +58 -0
- package/es/layout/types.d.ts +51 -0
- package/es/layout/types.js +1 -0
- package/es/request/index.js +15 -1
- package/es/styles/_responsive.scss +53 -0
- package/es/styles/antd-overload.scss +77 -21
- package/es/styles/tokens.d.ts +113 -13
- package/es/styles/tokens.js +176 -28
- package/es/styles/tokens.json +82 -0
- package/es/styles/tokens.scss +99 -52
- package/es/types/antd.d.ts +35 -0
- package/es/types/antd.js +1 -0
- package/es/utils/semantic.d.ts +31 -0
- package/es/utils/semantic.js +37 -0
- package/lib/components/Button/index.d.ts +49 -8
- package/lib/components/Button/index.js +62 -20
- package/lib/components/Button/index.module.scss +38 -0
- package/lib/components/ChainGraph/_components/ExpandButtons/index.module.scss +5 -3
- package/lib/components/ChainGraph/_components/SearchSelect/index.module.scss +3 -2
- package/lib/components/ChainGraph/index.js +3 -1
- package/lib/components/ChainGraph/index.module.scss +2 -2
- package/lib/components/Chart/Group/index.module.scss +1 -1
- package/lib/components/Chat/ChatHistory/_components/HistoryGroup/index.module.scss +1 -1
- package/lib/components/Chat/ChatHistory/_components/HistoryItem/index.module.scss +13 -13
- package/lib/components/Chat/ChatHistory/_components/NewChatButton/index.module.scss +6 -6
- package/lib/components/Chat/ChatHistory/index.module.scss +3 -3
- package/lib/components/Chat/ChatInput/_components/AgentToggleButton/index.module.scss +9 -9
- package/lib/components/Chat/ChatInput/_components/FileList/index.module.scss +3 -3
- package/lib/components/Chat/ChatInput/_components/SendButton/index.module.scss +3 -3
- package/lib/components/Chat/ChatInput/_components/StopButton/index.module.scss +2 -2
- package/lib/components/Chat/ChatInput/_components/UploadButton/index.js +1 -1
- package/lib/components/Chat/ChatInput/_components/UploadButton/index.module.scss +3 -3
- package/lib/components/Chat/ChatInput/_utils/index.js +6 -6
- package/lib/components/Chat/ChatInput/index.module.scss +12 -11
- package/lib/components/Chat/ChatList/_components/Assistant/AssistantItem/_components/Copy/index.js +2 -2
- package/lib/components/Chat/ChatList/_components/Assistant/AssistantItem/_components/Copy/index.module.scss +6 -6
- package/lib/components/Chat/ChatList/_components/Assistant/AssistantItem/_components/LikeDislike/index.js +3 -1
- package/lib/components/Chat/ChatList/_components/Assistant/AssistantItem/_components/LikeDislike/index.module.scss +6 -6
- package/lib/components/Chat/ChatList/_components/Assistant/AssistantItem/_components/QuoteList/index.module.scss +8 -8
- package/lib/components/Chat/ChatList/_components/Assistant/AssistantItem/index.module.scss +7 -7
- package/lib/components/Chat/ChatList/_components/Assistant/index.module.scss +3 -3
- package/lib/components/Chat/ChatList/_components/User/index.module.scss +21 -10
- package/lib/components/Chat/ChatList/index.js +33 -27
- package/lib/components/Checkbox/CheckboxGroup/index.module.scss +10 -13
- package/lib/components/Checkbox/index.module.scss +23 -28
- package/lib/components/CodeMirror/index.module.scss +6 -6
- package/lib/components/Copy/index.d.ts +8 -2
- package/lib/components/Copy/index.js +38 -23
- package/lib/components/Copy/index.module.scss +5 -5
- package/lib/components/DatePicker/RangePicker/index.js +5 -1
- package/lib/components/DatePicker/RangePicker/index.module.scss +10 -1
- package/lib/components/DatePicker/StepPicker/index.module.scss +6 -4
- package/lib/components/DatePicker/index.js +14 -3
- package/lib/components/DatePicker/index.module.scss +2 -2
- package/lib/components/Descriptions/index.d.ts +6 -2
- package/lib/components/Descriptions/index.js +14 -12
- package/lib/components/Editor/index.module.scss +7 -7
- package/lib/components/FileCol/index.js +3 -3
- package/lib/components/FilePreview/_components/BasePreview/index.module.scss +3 -3
- package/lib/components/FilePreview/_components/PdfPreview/index.js +9 -2
- package/lib/components/FilePreview/_components/PdfPreview/index.module.scss +7 -7
- package/lib/components/FilePreview/index.module.scss +4 -4
- package/lib/components/Form/DrawerForm/index.js +10 -17
- package/lib/components/Form/ImportForm/index.js +13 -18
- package/lib/components/Form/ModalForm/index.d.ts +1 -1
- package/lib/components/Form/ModalForm/index.js +11 -17
- package/lib/components/Form/index.d.ts +12 -0
- package/lib/components/Form/index.js +7 -1
- package/lib/components/FormItem/FormInput/FormPasswordStrength/index.module.scss +3 -3
- package/lib/components/FormItem/FormRadio/index.module.scss +11 -13
- package/lib/components/FormItem/FormSegmented/index.module.scss +1 -1
- package/lib/components/FormItem/FormSlider/index.module.scss +1 -1
- package/lib/components/FormItem/FormUpload/FormImage/index.js +3 -3
- package/lib/components/FormItem/FormUpload/index.js +3 -2
- package/lib/components/FormItem/FormUpload/index.module.scss +17 -17
- package/lib/components/FormItem/ItemContainer/index.js +4 -4
- package/lib/components/FormItem/ItemContainer/index.module.scss +33 -7
- package/lib/components/Input/Number/index.js +38 -54
- package/lib/components/Input/Number/index.module.scss +27 -54
- package/lib/components/Input/Range/index.module.scss +16 -5
- package/lib/components/Input/TextArea/index.module.scss +13 -13
- package/lib/components/Input/index.d.ts +3 -1
- package/lib/components/Input/index.js +2 -0
- package/lib/components/Input/index.module.scss +1 -1
- package/lib/components/Markdown/Editor/index.module.scss +4 -4
- package/lib/components/Markdown/Views/MermaidBlock.js +15 -1
- package/lib/components/Markdown/Views/blocks.module.scss +13 -13
- package/lib/components/Markdown/Views/index.module.scss +3 -3
- package/lib/components/Modal/index.d.ts +12 -2
- package/lib/components/Modal/index.js +30 -10
- package/lib/components/Modal/index.module.scss +11 -1
- package/lib/components/Operate/index.js +3 -1
- package/lib/components/Operate/index.module.scss +1 -1
- package/lib/components/Pagination/index.module.scss +19 -18
- package/lib/components/Panel/DefaultPanel/index.module.scss +3 -3
- package/lib/components/Panel/IframePanel/index.js +3 -1
- package/lib/components/Panel/IframePanel/index.module.scss +2 -2
- package/lib/components/Panel/ListPanel/ListModalPanel/index.d.ts +2 -2
- package/lib/components/Panel/ListPanel/ListModalPanel/index.module.scss +2 -2
- package/lib/components/Panel/ListPanel/_components/ColumnMgt/index.js +9 -20
- package/lib/components/Panel/ListPanel/_components/ColumnMgt/index.module.scss +3 -3
- package/lib/components/Panel/ListPanel/_components/ToolBar/index.js +1 -1
- package/lib/components/Panel/ListPanel/_components/ToolBar/index.module.scss +14 -1
- package/lib/components/Panel/ListPanel/index.d.ts +2 -2
- package/lib/components/Panel/ListPanel/index.module.scss +9 -9
- package/lib/components/Search/SearchAdvanced/index.d.ts +3 -3
- package/lib/components/Search/SearchCard/index.module.scss +15 -15
- package/lib/components/Search/SearchCollapsible/index.d.ts +3 -3
- package/lib/components/Search/SearchWithFilter/index.d.ts +3 -3
- package/lib/components/Search/SearchWithMore/index.d.ts +3 -3
- package/lib/components/Search/_components/ButtonGroup/index.d.ts +4 -4
- package/lib/components/Search/_components/ButtonGroup/index.js +2 -2
- package/lib/components/Search/_components/FilterDropdown/index.js +3 -1
- package/lib/components/Search/_hooks/useSearchCommon.d.ts +3 -3
- package/lib/components/Search/_types/index.d.ts +3 -3
- package/lib/components/Search/index.d.ts +3 -3
- package/lib/components/Search/index.module.scss +33 -5
- package/lib/components/SecondConf/index.js +14 -6
- package/lib/components/SecondConf/index.module.scss +3 -3
- package/lib/components/Select/AutoCompleteSelect/index.js +15 -5
- package/lib/components/Select/AutoCompleteSelect/index.module.scss +73 -132
- package/lib/components/Select/IconSelect/index.js +64 -57
- package/lib/components/Select/IconSelect/index.module.scss +4 -3
- package/lib/components/Select/TreeSelect/_utils/getExpandedKeysByLevel.d.ts +1 -1
- package/lib/components/Select/TreeSelect/index.js +18 -7
- package/lib/components/Select/TreeSelect/index.module.scss +19 -44
- package/lib/components/Select/index.d.ts +17 -2
- package/lib/components/Select/index.js +22 -4
- package/lib/components/Select/index.module.scss +71 -131
- package/lib/components/Slider/index.module.scss +1 -1
- package/lib/components/Switch/index.module.scss +1 -1
- package/lib/components/TabBar/index.module.scss +11 -11
- package/lib/components/Table/_components/Drag/index.js +6 -2
- package/lib/components/Table/_hooks/useTableColumns.js +1 -1
- package/lib/components/Table/_utils/tableUtils.d.ts +1 -1
- package/lib/components/Table/_utils/tableUtils.js +4 -3
- package/lib/components/Table/index.d.ts +18 -2
- package/lib/components/Table/index.js +9 -0
- package/lib/components/Table/index.module.scss +14 -14
- package/lib/components/Tags/_components/EllipsisTag/index.js +1 -1
- package/lib/components/TextEllipsis/index.js +6 -4
- package/lib/components/Tree/index.d.ts +8 -2
- package/lib/components/Tree/index.js +2 -0
- package/lib/components/Tree/index.module.scss +6 -6
- package/lib/components/Upload/_components/UploadedItem/index.js +3 -3
- package/lib/components/Upload/_components/UploadingItem/index.js +3 -3
- package/lib/components/Upload/_utils/normalUpload.d.ts +1 -1
- package/lib/components/Upload/_utils/validateFile.js +47 -2
- package/lib/components/Upload/index.d.ts +8 -2
- package/lib/components/Upload/index.js +11 -4
- package/lib/config-provider/index.d.ts +34 -2
- package/lib/config-provider/index.js +55 -4
- package/lib/feedback/index.d.ts +20 -0
- package/lib/feedback/index.js +115 -0
- package/lib/hooks/index.d.ts +5 -0
- package/lib/hooks/index.js +21 -0
- package/lib/hooks/useBreakpoint.d.ts +24 -0
- package/lib/hooks/useBreakpoint.js +49 -0
- package/lib/hooks/useIsDark.d.ts +9 -0
- package/lib/hooks/useIsDark.js +54 -0
- package/lib/hooks/usePointerType.d.ts +22 -0
- package/lib/hooks/usePointerType.js +55 -0
- package/lib/index.d.ts +4 -4
- package/lib/index.js +78 -19
- package/lib/layout/Breadcrumb/_components/BreadcrumbItemIcon/index.d.ts +10 -0
- package/lib/layout/Breadcrumb/_components/BreadcrumbItemIcon/index.js +26 -0
- package/lib/layout/Breadcrumb/_components/BreadcrumbMenuItem/index.d.ts +11 -0
- package/lib/layout/Breadcrumb/_components/BreadcrumbMenuItem/index.js +32 -0
- package/lib/layout/Breadcrumb/_hooks/useBreadcrumbPath.d.ts +5 -0
- package/lib/layout/Breadcrumb/_hooks/useBreadcrumbPath.js +89 -0
- package/lib/layout/Breadcrumb/_utils/formatMenu.d.ts +9 -0
- package/lib/layout/Breadcrumb/_utils/formatMenu.js +31 -0
- package/lib/layout/Breadcrumb/_utils/formatRoutes.d.ts +9 -0
- package/lib/layout/Breadcrumb/_utils/formatRoutes.js +67 -0
- package/lib/layout/Breadcrumb/_utils/pathMatch.d.ts +8 -0
- package/lib/layout/Breadcrumb/_utils/pathMatch.js +47 -0
- package/lib/layout/Breadcrumb/index.d.ts +19 -0
- package/lib/layout/Breadcrumb/index.js +96 -0
- package/lib/layout/Breadcrumb/index.module.scss +15 -0
- package/lib/layout/Header/index.d.ts +39 -0
- package/lib/layout/Header/index.js +172 -0
- package/lib/layout/Header/index.module.scss +215 -0
- package/lib/layout/I18n/I18nStore.d.ts +29 -0
- package/lib/layout/I18n/I18nStore.js +82 -0
- package/lib/layout/I18n/index.d.ts +14 -0
- package/lib/layout/I18n/index.js +45 -0
- package/lib/layout/I18n/locales/en-US.d.ts +2 -0
- package/lib/layout/I18n/locales/en-US.js +21 -0
- package/lib/layout/I18n/locales/zh-CN.d.ts +2 -0
- package/lib/layout/I18n/locales/zh-CN.js +21 -0
- package/lib/layout/Menu/_components/SecondaryHeader/index.d.ts +22 -0
- package/lib/layout/Menu/_components/SecondaryHeader/index.js +49 -0
- package/lib/layout/Menu/_components/SecondaryHeader/index.module.scss +65 -0
- package/lib/layout/Menu/_hooks/useMenuPath.d.ts +17 -0
- package/lib/layout/Menu/_hooks/useMenuPath.js +75 -0
- package/lib/layout/Menu/_hooks/useOnlyLvOneMenu.d.ts +13 -0
- package/lib/layout/Menu/_hooks/useOnlyLvOneMenu.js +31 -0
- package/lib/layout/Menu/_utils/formatMenu.d.ts +10 -0
- package/lib/layout/Menu/_utils/formatMenu.js +55 -0
- package/lib/layout/Menu/_utils/pathMatch.d.ts +8 -0
- package/lib/layout/Menu/_utils/pathMatch.js +44 -0
- package/lib/layout/Menu/_utils/setActiveIcon.d.ts +7 -0
- package/lib/layout/Menu/_utils/setActiveIcon.js +27 -0
- package/lib/layout/Menu/index.d.ts +34 -0
- package/lib/layout/Menu/index.js +158 -0
- package/lib/layout/Menu/index.module.scss +50 -0
- package/lib/layout/NavTabBar/_components/SortableTab/index.d.ts +9 -0
- package/lib/layout/NavTabBar/_components/SortableTab/index.js +39 -0
- package/lib/layout/NavTabBar/_components/TabContextMenu/index.d.ts +20 -0
- package/lib/layout/NavTabBar/_components/TabContextMenu/index.js +129 -0
- package/lib/layout/NavTabBar/_components/TabDragOverlay/index.d.ts +20 -0
- package/lib/layout/NavTabBar/_components/TabDragOverlay/index.js +54 -0
- package/lib/layout/NavTabBar/_components/TabLabel/index.d.ts +22 -0
- package/lib/layout/NavTabBar/_components/TabLabel/index.js +68 -0
- package/lib/layout/NavTabBar/_hooks/useDropTabKey.d.ts +5 -0
- package/lib/layout/NavTabBar/_hooks/useDropTabKey.js +32 -0
- package/lib/layout/NavTabBar/_hooks/useTabContextMenu.d.ts +8 -0
- package/lib/layout/NavTabBar/_hooks/useTabContextMenu.js +28 -0
- package/lib/layout/NavTabBar/_hooks/useTabPath.d.ts +16 -0
- package/lib/layout/NavTabBar/_hooks/useTabPath.js +107 -0
- package/lib/layout/NavTabBar/_hooks/useTabTitle.d.ts +5 -0
- package/lib/layout/NavTabBar/_hooks/useTabTitle.js +32 -0
- package/lib/layout/NavTabBar/_utils/formatNavTabBar.d.ts +9 -0
- package/lib/layout/NavTabBar/_utils/formatNavTabBar.js +49 -0
- package/lib/layout/NavTabBar/_utils/pathMatch.d.ts +8 -0
- package/lib/layout/NavTabBar/_utils/pathMatch.js +37 -0
- package/lib/layout/NavTabBar/_utils/tabActions.d.ts +21 -0
- package/lib/layout/NavTabBar/_utils/tabActions.js +93 -0
- package/lib/layout/NavTabBar/index.d.ts +21 -0
- package/lib/layout/NavTabBar/index.js +206 -0
- package/lib/layout/NavTabBar/index.module.scss +179 -0
- package/lib/layout/Theme/ThemeStore.d.ts +18 -0
- package/lib/layout/Theme/ThemeStore.js +63 -0
- package/lib/layout/Theme/index.d.ts +30 -0
- package/lib/layout/Theme/index.js +100 -0
- package/lib/layout/Theme/index.module.scss +6 -0
- package/lib/layout/_hooks/useDropTab.d.ts +6 -0
- package/lib/layout/_hooks/useDropTab.js +21 -0
- package/lib/layout/_hooks/useReload.d.ts +6 -0
- package/lib/layout/_hooks/useReload.js +18 -0
- package/lib/layout/_hooks/useSetTabTitle.d.ts +6 -0
- package/lib/layout/_hooks/useSetTabTitle.js +18 -0
- package/lib/layout/_utils/storage.d.ts +6 -0
- package/lib/layout/_utils/storage.js +39 -0
- package/lib/layout/index.d.ts +54 -0
- package/lib/layout/index.js +102 -0
- package/lib/layout/types.d.ts +51 -0
- package/lib/layout/types.js +5 -0
- package/lib/request/index.js +5 -1
- package/lib/styles/_responsive.scss +53 -0
- package/lib/styles/antd-overload.scss +77 -21
- package/lib/styles/tokens.d.ts +113 -13
- package/lib/styles/tokens.js +157 -30
- package/lib/styles/tokens.json +82 -0
- package/lib/styles/tokens.scss +99 -52
- package/lib/types/antd.d.ts +35 -0
- package/lib/types/antd.js +5 -0
- package/lib/utils/semantic.d.ts +31 -0
- package/lib/utils/semantic.js +40 -0
- package/package.json +28 -22
- package/src/components/Button/index.md +54 -10
- package/src/components/Button/index.module.scss +38 -0
- package/src/components/Button/index.tsx +107 -51
- package/src/components/ChainGraph/_components/ExpandButtons/index.module.scss +5 -3
- package/src/components/ChainGraph/_components/SearchSelect/index.module.scss +3 -2
- package/src/components/ChainGraph/index.module.scss +2 -2
- package/src/components/ChainGraph/index.tsx +1 -1
- package/src/components/Chart/Group/index.module.scss +1 -1
- package/src/components/Chat/ChatHistory/_components/HistoryGroup/index.module.scss +1 -1
- package/src/components/Chat/ChatHistory/_components/HistoryItem/index.module.scss +13 -13
- package/src/components/Chat/ChatHistory/_components/NewChatButton/index.module.scss +6 -6
- package/src/components/Chat/ChatHistory/index.module.scss +3 -3
- package/src/components/Chat/ChatInput/_components/AgentToggleButton/index.module.scss +9 -9
- package/src/components/Chat/ChatInput/_components/FileList/index.module.scss +3 -3
- package/src/components/Chat/ChatInput/_components/SendButton/index.module.scss +3 -3
- package/src/components/Chat/ChatInput/_components/StopButton/index.module.scss +2 -2
- package/src/components/Chat/ChatInput/_components/UploadButton/index.module.scss +3 -3
- package/src/components/Chat/ChatInput/_components/UploadButton/index.tsx +1 -1
- package/src/components/Chat/ChatInput/_utils/index.ts +1 -1
- package/src/components/Chat/ChatInput/index.module.scss +12 -11
- package/src/components/Chat/ChatList/_components/Assistant/AssistantItem/_components/Copy/index.module.scss +6 -6
- package/src/components/Chat/ChatList/_components/Assistant/AssistantItem/_components/Copy/index.tsx +1 -1
- package/src/components/Chat/ChatList/_components/Assistant/AssistantItem/_components/LikeDislike/index.module.scss +6 -6
- package/src/components/Chat/ChatList/_components/Assistant/AssistantItem/_components/LikeDislike/index.tsx +1 -1
- package/src/components/Chat/ChatList/_components/Assistant/AssistantItem/_components/QuoteList/index.module.scss +8 -8
- package/src/components/Chat/ChatList/_components/Assistant/AssistantItem/index.module.scss +7 -7
- package/src/components/Chat/ChatList/_components/Assistant/index.module.scss +3 -3
- package/src/components/Chat/ChatList/_components/User/index.module.scss +21 -10
- package/src/components/Chat/ChatList/index.tsx +5 -2
- package/src/components/Checkbox/CheckboxGroup/index.module.scss +10 -13
- package/src/components/Checkbox/index.module.scss +23 -28
- package/src/components/CodeMirror/index.module.scss +6 -6
- package/src/components/Copy/index.module.scss +5 -5
- package/src/components/Copy/index.tsx +41 -25
- package/src/components/DatePicker/RangePicker/index.module.scss +10 -1
- package/src/components/DatePicker/RangePicker/index.tsx +5 -3
- package/src/components/DatePicker/StepPicker/index.module.scss +6 -4
- package/src/components/DatePicker/index.module.scss +2 -2
- package/src/components/DatePicker/index.tsx +11 -3
- package/src/components/Descriptions/index.md +8 -0
- package/src/components/Descriptions/index.tsx +21 -14
- package/src/components/Editor/index.module.scss +7 -7
- package/src/components/FileCol/index.tsx +4 -2
- package/src/components/FilePreview/_components/BasePreview/index.module.scss +3 -3
- package/src/components/FilePreview/_components/PdfPreview/index.module.scss +7 -7
- package/src/components/FilePreview/_components/PdfPreview/index.tsx +8 -2
- package/src/components/FilePreview/index.module.scss +4 -4
- package/src/components/Form/DrawerForm/index.tsx +10 -11
- package/src/components/Form/ImportForm/index.tsx +11 -12
- package/src/components/Form/ModalForm/index.tsx +10 -12
- package/src/components/Form/index.md +18 -0
- package/src/components/Form/index.tsx +18 -0
- package/src/components/FormItem/FormInput/FormPasswordStrength/index.module.scss +3 -3
- package/src/components/FormItem/FormRadio/index.module.scss +11 -13
- package/src/components/FormItem/FormSegmented/index.module.scss +1 -1
- package/src/components/FormItem/FormSlider/index.module.scss +1 -1
- package/src/components/FormItem/FormUpload/FormImage/index.tsx +2 -1
- package/src/components/FormItem/FormUpload/index.module.scss +17 -17
- package/src/components/FormItem/FormUpload/index.tsx +2 -1
- package/src/components/FormItem/ItemContainer/index.module.scss +33 -7
- package/src/components/FormItem/ItemContainer/index.tsx +3 -3
- package/src/components/Input/Number/index.module.scss +27 -54
- package/src/components/Input/Number/index.tsx +49 -65
- package/src/components/Input/Range/index.module.scss +16 -5
- package/src/components/Input/TextArea/index.module.scss +13 -13
- package/src/components/Input/index.md +14 -0
- package/src/components/Input/index.module.scss +1 -1
- package/src/components/Input/index.tsx +4 -0
- package/src/components/Markdown/Editor/index.module.scss +4 -4
- package/src/components/Markdown/Views/MermaidBlock.tsx +15 -1
- package/src/components/Markdown/Views/blocks.module.scss +13 -13
- package/src/components/Markdown/Views/index.module.scss +3 -3
- package/src/components/Markdown/index.md +22 -0
- package/src/components/Modal/index.md +22 -1
- package/src/components/Modal/index.module.scss +11 -1
- package/src/components/Modal/index.tsx +46 -13
- package/src/components/Operate/index.module.scss +1 -1
- package/src/components/Operate/index.tsx +1 -1
- package/src/components/Pagination/index.md +107 -0
- package/src/components/Pagination/index.module.scss +19 -18
- package/src/components/Pagination/index.tsx +2 -2
- package/src/components/Panel/DefaultPanel/index.module.scss +3 -3
- package/src/components/Panel/IframePanel/index.module.scss +2 -2
- package/src/components/Panel/IframePanel/index.tsx +5 -1
- package/src/components/Panel/ListPanel/ListModalPanel/index.module.scss +2 -2
- package/src/components/Panel/ListPanel/ListModalPanel/index.tsx +2 -2
- package/src/components/Panel/ListPanel/_components/ColumnMgt/index.module.scss +3 -3
- package/src/components/Panel/ListPanel/_components/ColumnMgt/index.tsx +7 -11
- package/src/components/Panel/ListPanel/_components/ToolBar/index.module.scss +14 -1
- package/src/components/Panel/ListPanel/_components/ToolBar/index.tsx +2 -2
- package/src/components/Panel/ListPanel/index.module.scss +9 -9
- package/src/components/Panel/ListPanel/index.tsx +2 -2
- package/src/components/Panel/index.md +1 -1
- package/src/components/Search/SearchAdvanced/index.tsx +3 -3
- package/src/components/Search/SearchCard/index.module.scss +15 -15
- package/src/components/Search/SearchCollapsible/index.tsx +3 -3
- package/src/components/Search/SearchWithFilter/index.tsx +3 -3
- package/src/components/Search/SearchWithMore/index.tsx +3 -3
- package/src/components/Search/_components/ButtonGroup/index.tsx +9 -11
- package/src/components/Search/_components/FilterDropdown/index.tsx +1 -1
- package/src/components/Search/_hooks/useSearchCommon.ts +4 -4
- package/src/components/Search/_types/index.ts +3 -3
- package/src/components/Search/index.md +2 -2
- package/src/components/Search/index.module.scss +33 -5
- package/src/components/Search/index.tsx +3 -3
- package/src/components/SecondConf/index.md +1 -1
- package/src/components/SecondConf/index.module.scss +3 -3
- package/src/components/SecondConf/index.tsx +11 -7
- package/src/components/Select/AutoCompleteSelect/index.module.scss +73 -132
- package/src/components/Select/AutoCompleteSelect/index.tsx +13 -7
- package/src/components/Select/IconSelect/index.module.scss +4 -3
- package/src/components/Select/IconSelect/index.tsx +7 -9
- package/src/components/Select/TreeSelect/_utils/getExpandedKeysByLevel.ts +4 -1
- package/src/components/Select/TreeSelect/index.module.scss +19 -44
- package/src/components/Select/TreeSelect/index.tsx +16 -8
- package/src/components/Select/index.md +12 -0
- package/src/components/Select/index.module.scss +71 -131
- package/src/components/Select/index.tsx +38 -10
- package/src/components/Slider/index.module.scss +1 -1
- package/src/components/Switch/index.module.scss +1 -1
- package/src/components/TabBar/index.module.scss +11 -11
- package/src/components/Table/_components/Drag/index.tsx +3 -2
- package/src/components/Table/_hooks/useTableColumns.tsx +1 -1
- package/src/components/Table/_utils/tableUtils.ts +3 -2
- package/src/components/Table/index.md +16 -0
- package/src/components/Table/index.module.scss +14 -14
- package/src/components/Table/index.tsx +27 -1
- package/src/components/Tags/_components/EllipsisTag/index.tsx +1 -1
- package/src/components/TextEllipsis/index.tsx +6 -4
- package/src/components/Tree/index.md +9 -0
- package/src/components/Tree/index.module.scss +6 -6
- package/src/components/Tree/index.tsx +12 -2
- package/src/components/Upload/_components/UploadedItem/index.tsx +2 -2
- package/src/components/Upload/_components/UploadingItem/index.tsx +2 -2
- package/src/components/Upload/_utils/normalUpload.ts +1 -1
- package/src/components/Upload/_utils/validateFile.ts +55 -2
- package/src/components/Upload/index.md +9 -0
- package/src/components/Upload/index.tsx +22 -7
- package/src/config-provider/index.tsx +84 -4
- package/src/feedback/index.tsx +141 -0
- package/src/hooks/index.ts +5 -0
- package/src/hooks/useBreakpoint.ts +62 -0
- package/src/hooks/useIsDark.ts +64 -0
- package/src/hooks/usePointerType.ts +59 -0
- package/src/index.ts +37 -5
- package/src/layout/Breadcrumb/_components/BreadcrumbItemIcon/index.tsx +26 -0
- package/src/layout/Breadcrumb/_components/BreadcrumbMenuItem/index.tsx +32 -0
- package/src/layout/Breadcrumb/_hooks/useBreadcrumbPath.ts +111 -0
- package/src/layout/Breadcrumb/_utils/formatMenu.ts +30 -0
- package/src/layout/Breadcrumb/_utils/formatRoutes.ts +71 -0
- package/src/layout/Breadcrumb/_utils/pathMatch.ts +52 -0
- package/src/layout/Breadcrumb/index.md +37 -0
- package/src/layout/Breadcrumb/index.module.scss +15 -0
- package/src/layout/Breadcrumb/index.tsx +103 -0
- package/src/layout/Header/index.md +120 -0
- package/src/layout/Header/index.module.scss +215 -0
- package/src/layout/Header/index.tsx +198 -0
- package/src/layout/I18n/I18nStore.ts +98 -0
- package/src/layout/I18n/index.md +45 -0
- package/src/layout/I18n/index.tsx +44 -0
- package/src/layout/I18n/locales/en-US.ts +16 -0
- package/src/layout/I18n/locales/zh-CN.ts +16 -0
- package/src/layout/Menu/_components/SecondaryHeader/index.module.scss +65 -0
- package/src/layout/Menu/_components/SecondaryHeader/index.tsx +61 -0
- package/src/layout/Menu/_hooks/useMenuPath.ts +81 -0
- package/src/layout/Menu/_hooks/useOnlyLvOneMenu.ts +44 -0
- package/src/layout/Menu/_utils/formatMenu.ts +57 -0
- package/src/layout/Menu/_utils/pathMatch.ts +48 -0
- package/src/layout/Menu/_utils/setActiveIcon.ts +23 -0
- package/src/layout/Menu/index.md +43 -0
- package/src/layout/Menu/index.module.scss +50 -0
- package/src/layout/Menu/index.tsx +208 -0
- package/src/layout/NavTabBar/_components/SortableTab/index.tsx +40 -0
- package/src/layout/NavTabBar/_components/TabContextMenu/index.tsx +157 -0
- package/src/layout/NavTabBar/_components/TabDragOverlay/index.tsx +69 -0
- package/src/layout/NavTabBar/_components/TabLabel/index.tsx +84 -0
- package/src/layout/NavTabBar/_hooks/useDropTabKey.ts +27 -0
- package/src/layout/NavTabBar/_hooks/useTabContextMenu.ts +23 -0
- package/src/layout/NavTabBar/_hooks/useTabPath.ts +118 -0
- package/src/layout/NavTabBar/_hooks/useTabTitle.ts +28 -0
- package/src/layout/NavTabBar/_utils/formatNavTabBar.ts +50 -0
- package/src/layout/NavTabBar/_utils/pathMatch.ts +37 -0
- package/src/layout/NavTabBar/_utils/tabActions.ts +131 -0
- package/src/layout/NavTabBar/index.md +76 -0
- package/src/layout/NavTabBar/index.module.scss +179 -0
- package/src/layout/NavTabBar/index.tsx +236 -0
- package/src/layout/Theme/ThemeStore.ts +70 -0
- package/src/layout/Theme/index.md +48 -0
- package/src/layout/Theme/index.module.scss +6 -0
- package/src/layout/Theme/index.tsx +105 -0
- package/src/layout/_hooks/useDropTab.ts +23 -0
- package/src/layout/_hooks/useReload.ts +19 -0
- package/src/layout/_hooks/useSetTabTitle.ts +19 -0
- package/src/layout/_utils/storage.ts +34 -0
- package/src/layout/index.ts +78 -0
- package/src/layout/types.ts +58 -0
- package/src/request/index.ts +8 -1
- package/src/styles/_responsive.scss +53 -0
- package/src/styles/antd-overload.scss +77 -21
- package/src/styles/tokens.json +82 -0
- package/src/styles/tokens.scss +99 -52
- package/src/styles/tokens.ts +198 -33
- package/src/types/antd.ts +46 -0
- package/src/utils/semantic.ts +45 -0
- package/es/components/Button/ChakraButton/index.d.ts +0 -11
- package/es/components/Button/ChakraButton/index.js +0 -66
- package/es/components/Button/ChakraButton/index.module.scss +0 -20
- package/es/components/ChakraRoot/index.d.ts +0 -6
- package/es/components/ChakraRoot/index.js +0 -42
- package/lib/components/Button/ChakraButton/index.d.ts +0 -11
- package/lib/components/Button/ChakraButton/index.js +0 -70
- package/lib/components/Button/ChakraButton/index.module.scss +0 -20
- package/lib/components/ChakraRoot/index.d.ts +0 -6
- package/lib/components/ChakraRoot/index.js +0 -46
- package/src/components/Button/ChakraButton/index.module.scss +0 -20
- package/src/components/Button/ChakraButton/index.tsx +0 -83
- package/src/components/ChakraRoot/index.tsx +0 -43
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactRouter = require("react-router");
|
|
9
|
+
var _antd = require("antd");
|
|
10
|
+
var _lodash = require("lodash");
|
|
11
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
|
+
var _semantic = require("../../utils/semantic");
|
|
13
|
+
var _indexModule = _interopRequireDefault(require("./index.module.scss"));
|
|
14
|
+
var _formatMenu = require("./_utils/formatMenu");
|
|
15
|
+
var _setActiveIcon = require("./_utils/setActiveIcon");
|
|
16
|
+
var _useMenuPath = require("./_hooks/useMenuPath");
|
|
17
|
+
var _SecondaryHeader = _interopRequireDefault(require("./_components/SecondaryHeader"));
|
|
18
|
+
var _useOnlyLvOneMenu = require("./_hooks/useOnlyLvOneMenu");
|
|
19
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
22
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
23
|
+
/**
|
|
24
|
+
* 次级菜单根:进入它的子树后,整个侧栏换成那些子页。
|
|
25
|
+
* 由菜单表的 `cat=1` 显式标记,不靠前端推断。
|
|
26
|
+
*/
|
|
27
|
+
const isSecondaryRoot = route => !!route.path && !!route.children?.length && route.meta?.secondary === true;
|
|
28
|
+
|
|
29
|
+
/** 把菜单项 key 里的路由参数按当前地址回填:/order/:id/detail → /order/1024/detail */
|
|
30
|
+
const fillParams = (key, params) => key.replace(/:([^/]+)/g, (seg, name) => params[name] ?? seg);
|
|
31
|
+
const Menu = props => {
|
|
32
|
+
const {
|
|
33
|
+
router,
|
|
34
|
+
collapsed = false,
|
|
35
|
+
className,
|
|
36
|
+
theme = "dark",
|
|
37
|
+
mode = "inline",
|
|
38
|
+
getCurrChildItems,
|
|
39
|
+
menuItems,
|
|
40
|
+
onlyLvOneMenu = false,
|
|
41
|
+
secondaryHeader,
|
|
42
|
+
secondaryItemFilter,
|
|
43
|
+
classNames: semanticClassNames,
|
|
44
|
+
...menuConfig
|
|
45
|
+
} = props;
|
|
46
|
+
const navigate = (0, _reactRouter.useNavigate)();
|
|
47
|
+
const location = (0, _reactRouter.useLocation)();
|
|
48
|
+
|
|
49
|
+
// 当前地址落在某个次级菜单根之下时,侧栏整个换成那棵子树
|
|
50
|
+
const secondary = (0, _react.useMemo)(() => {
|
|
51
|
+
const find = routes => {
|
|
52
|
+
for (const r of routes ?? []) {
|
|
53
|
+
if (isSecondaryRoot(r) && (0, _reactRouter.matchPath)({
|
|
54
|
+
path: r.path,
|
|
55
|
+
end: false
|
|
56
|
+
}, location.pathname)) {
|
|
57
|
+
return r;
|
|
58
|
+
}
|
|
59
|
+
const hit = find(r.children);
|
|
60
|
+
if (hit) return hit;
|
|
61
|
+
}
|
|
62
|
+
return undefined;
|
|
63
|
+
};
|
|
64
|
+
return find(router);
|
|
65
|
+
}, [router, location.pathname]);
|
|
66
|
+
const items = (0, _react.useMemo)(() => {
|
|
67
|
+
if (secondary?.path) {
|
|
68
|
+
const rootLen = secondary.path.length;
|
|
69
|
+
// all=true:这些子页本就都不进主侧栏,按 menu 标记会被全部过滤掉
|
|
70
|
+
return (0, _formatMenu.formatMenu)(secondary.children ?? [], true)
|
|
71
|
+
// 自身那段还带参数的(detail/:id)点不进去,不列
|
|
72
|
+
.filter(i => !i.key.slice(rootLen).includes(":")).filter(i => secondaryItemFilter?.(i.key) ?? true);
|
|
73
|
+
}
|
|
74
|
+
return menuItems ? (0, _lodash.cloneDeep)(menuItems) : (0, _formatMenu.formatMenu)(router);
|
|
75
|
+
}, [router, menuItems, secondary, secondaryItemFilter]);
|
|
76
|
+
const allItems = (0, _react.useMemo)(() => {
|
|
77
|
+
return menuItems ? (0, _lodash.cloneDeep)(menuItems) : (0, _formatMenu.formatMenu)((0, _lodash.cloneDeep)(router), true);
|
|
78
|
+
}, [router, menuItems]);
|
|
79
|
+
const {
|
|
80
|
+
menuKey,
|
|
81
|
+
setMenuKey,
|
|
82
|
+
openKeys,
|
|
83
|
+
setOpenkeys
|
|
84
|
+
} = (0, _useMenuPath.useMenuPath)({
|
|
85
|
+
allItems,
|
|
86
|
+
collapsed,
|
|
87
|
+
mode
|
|
88
|
+
});
|
|
89
|
+
const _items = (0, _react.useMemo)(() => {
|
|
90
|
+
const _items = (0, _lodash.cloneDeep)(items);
|
|
91
|
+
(0, _setActiveIcon.setActiveIcon)(_items, menuKey);
|
|
92
|
+
return _items;
|
|
93
|
+
}, [items, menuKey]);
|
|
94
|
+
(0, _useOnlyLvOneMenu.useOnlyLvOneMenu)({
|
|
95
|
+
items,
|
|
96
|
+
onlyLvOneMenu,
|
|
97
|
+
getCurrChildItems,
|
|
98
|
+
setOpenkeys,
|
|
99
|
+
setMenuKey
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
// Cloudflare style: the sidebar (inline) renders top-level directories as non-collapsible "groups";
|
|
103
|
+
// level 1 = gray section title, level 2 = flat items; collapsible submenus are no longer used in expanded mode.
|
|
104
|
+
const cfGroupItems = (0, _react.useMemo)(() => {
|
|
105
|
+
return _items.map(it => it.children?.length && !collapsed ? {
|
|
106
|
+
type: "group",
|
|
107
|
+
key: it.key,
|
|
108
|
+
label: it.title ?? it.label,
|
|
109
|
+
children: it.children
|
|
110
|
+
} : it);
|
|
111
|
+
}, [_items, collapsed]);
|
|
112
|
+
const menu = /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Menu, {
|
|
113
|
+
...menuConfig,
|
|
114
|
+
mode: mode,
|
|
115
|
+
inlineCollapsed: collapsed,
|
|
116
|
+
items: onlyLvOneMenu ? _items?.map(i => ({
|
|
117
|
+
...i,
|
|
118
|
+
children: undefined
|
|
119
|
+
})) : mode === "inline" ? cfGroupItems : _items,
|
|
120
|
+
onClick: v => {
|
|
121
|
+
if (onlyLvOneMenu) {
|
|
122
|
+
getCurrChildItems?.(items.find(i => i.key === v.key)?.children || []);
|
|
123
|
+
setOpenkeys([v.key]);
|
|
124
|
+
setMenuKey(v.key);
|
|
125
|
+
} else {
|
|
126
|
+
// 次级菜单的 key 是带参模式(/admin/order/:id/detail),按当前地址回填再跳
|
|
127
|
+
const params = secondary?.path ? (0, _reactRouter.matchPath)({
|
|
128
|
+
path: secondary.path,
|
|
129
|
+
end: false
|
|
130
|
+
}, location.pathname)?.params ?? {} : {};
|
|
131
|
+
navigate(fillParams(v.key, params));
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
selectedKeys: [menuKey],
|
|
135
|
+
openKeys: openKeys,
|
|
136
|
+
onOpenChange: keys => {
|
|
137
|
+
setOpenkeys(keys);
|
|
138
|
+
},
|
|
139
|
+
theme: theme,
|
|
140
|
+
className: (0, _classnames.default)(_indexModule.default.menu, className)
|
|
141
|
+
// 弹出的子菜单挂在 body 上,拿不到根节点的类名。给它挂一个自己的类,样式才有地方落
|
|
142
|
+
,
|
|
143
|
+
classNames: (0, _semantic.mergeSemantic)(semanticClassNames, outer => ({
|
|
144
|
+
...outer,
|
|
145
|
+
popup: [_indexModule.default.popup, typeof outer.popup === "string" ? outer.popup : outer.popup?.root].filter(Boolean).join(" ")
|
|
146
|
+
}))
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
// 次级菜单默认带一段头部(至少给出返回入口),调用方可用 secondaryHeader 整块换掉
|
|
150
|
+
return secondary ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
151
|
+
className: _indexModule.default.secondaryWrap,
|
|
152
|
+
children: [secondaryHeader ?? /*#__PURE__*/(0, _jsxRuntime.jsx)(_SecondaryHeader.default, {
|
|
153
|
+
collapsed: collapsed,
|
|
154
|
+
theme: theme
|
|
155
|
+
}), menu]
|
|
156
|
+
}) : menu;
|
|
157
|
+
};
|
|
158
|
+
var _default = exports.default = Menu;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// 注意:CSS Module 里的类名都会被哈希,antd 的类名必须写在 :global() 中,否则
|
|
2
|
+
// `.ant-menu-horizontal` 会变成 `.ant-menu-horizontal___xxxxx`,静悄悄地永不生效。
|
|
3
|
+
.menu {
|
|
4
|
+
&::-webkit-scrollbar {
|
|
5
|
+
width: 0px;
|
|
6
|
+
height: 0px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
scrollbar-width: none;
|
|
10
|
+
|
|
11
|
+
// 顶部横向菜单:占满剩余宽度,背景交给外层的导航渐变
|
|
12
|
+
&:global(.ant-menu-horizontal) {
|
|
13
|
+
flex: 1;
|
|
14
|
+
min-width: 0px;
|
|
15
|
+
|
|
16
|
+
background-color: transparent;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// 弹出的子菜单挂在 body 上,够不到 .menu,所以由组件把这个类挂到 popup 上
|
|
21
|
+
.popup {
|
|
22
|
+
&:global(.ant-menu-submenu-popup.ant-menu.ant-menu-dark) {
|
|
23
|
+
:global(.ant-menu-item),
|
|
24
|
+
:global(.ant-menu-submenu-title) {
|
|
25
|
+
color: var(--vita-foreground);
|
|
26
|
+
|
|
27
|
+
&:hover {
|
|
28
|
+
color: var(--vita-primary) !important;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&:global(.ant-menu-item-selected) {
|
|
32
|
+
background-color: color-mix(in srgb, var(--vita-primary) 8%, transparent);
|
|
33
|
+
|
|
34
|
+
color: var(--vita-primary) !important;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// 次级菜单:头部固定在上,菜单撑满剩余高度
|
|
41
|
+
.secondaryWrap {
|
|
42
|
+
height: 100%;
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
|
|
46
|
+
:global(.ant-menu) {
|
|
47
|
+
flex: 1;
|
|
48
|
+
border-inline-end: none !important;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface DraggableTabPaneProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
"data-node-key": string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Draggable tab node component
|
|
7
|
+
*/
|
|
8
|
+
declare const DraggableTabNode: React.FC<Readonly<DraggableTabPaneProps>>;
|
|
9
|
+
export default DraggableTabNode;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _sortable = require("@dnd-kit/sortable");
|
|
9
|
+
var _utilities = require("@dnd-kit/utilities");
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
/**
|
|
12
|
+
* Draggable tab node component
|
|
13
|
+
*/
|
|
14
|
+
const DraggableTabNode = props => {
|
|
15
|
+
const {
|
|
16
|
+
attributes,
|
|
17
|
+
listeners,
|
|
18
|
+
setNodeRef,
|
|
19
|
+
transform,
|
|
20
|
+
transition,
|
|
21
|
+
isDragging
|
|
22
|
+
} = (0, _sortable.useSortable)({
|
|
23
|
+
id: props["data-node-key"]
|
|
24
|
+
});
|
|
25
|
+
const style = {
|
|
26
|
+
...props.style,
|
|
27
|
+
transform: _utilities.CSS.Transform.toString(transform),
|
|
28
|
+
transition,
|
|
29
|
+
opacity: isDragging ? 0 : 1,
|
|
30
|
+
cursor: "pointer"
|
|
31
|
+
};
|
|
32
|
+
return /*#__PURE__*/_react.default.cloneElement(props.children, {
|
|
33
|
+
ref: setNodeRef,
|
|
34
|
+
style,
|
|
35
|
+
...attributes,
|
|
36
|
+
...listeners
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
var _default = exports.default = DraggableTabNode;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TabType } from "../..";
|
|
3
|
+
interface TabContextMenuProps {
|
|
4
|
+
item: TabType;
|
|
5
|
+
index: number;
|
|
6
|
+
openKeys: TabType[];
|
|
7
|
+
basePath: string;
|
|
8
|
+
affixRouter: string[];
|
|
9
|
+
onReload: (key: string) => void;
|
|
10
|
+
refresh: (key: string) => void;
|
|
11
|
+
drop: (key: string) => void;
|
|
12
|
+
setOpenkeys: React.Dispatch<React.SetStateAction<TabType[]>>;
|
|
13
|
+
setOpen: (key: string) => void;
|
|
14
|
+
navigate: (path: string) => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Tab context menu component
|
|
18
|
+
*/
|
|
19
|
+
declare const TabContextMenu: React.FC<TabContextMenuProps>;
|
|
20
|
+
export default TabContextMenu;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _Button = _interopRequireDefault(require("../../../../components/Button"));
|
|
9
|
+
var _Icon = _interopRequireDefault(require("../../../../components/Icon"));
|
|
10
|
+
var _tabActions = require("../../_utils/tabActions");
|
|
11
|
+
var _indexModule = _interopRequireDefault(require("../../index.module.scss"));
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
/**
|
|
15
|
+
* Tab context menu component
|
|
16
|
+
*/
|
|
17
|
+
const TabContextMenu = ({
|
|
18
|
+
item,
|
|
19
|
+
index,
|
|
20
|
+
openKeys,
|
|
21
|
+
basePath,
|
|
22
|
+
affixRouter,
|
|
23
|
+
onReload,
|
|
24
|
+
refresh,
|
|
25
|
+
drop,
|
|
26
|
+
setOpenkeys,
|
|
27
|
+
setOpen,
|
|
28
|
+
navigate
|
|
29
|
+
}) => {
|
|
30
|
+
// Determine whether the current tab is affixed
|
|
31
|
+
const isAffixed = affixRouter.includes(item.key) || item.affix;
|
|
32
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
33
|
+
className: _indexModule.default.tabContextMenu,
|
|
34
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
35
|
+
className: _indexModule.default.part,
|
|
36
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
37
|
+
type: "text",
|
|
38
|
+
onClick: () => {
|
|
39
|
+
onReload(item.key?.split("?")[0] || "");
|
|
40
|
+
refresh(item.key?.split("?")[0] || "");
|
|
41
|
+
setOpen("");
|
|
42
|
+
},
|
|
43
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
44
|
+
icon: "ep:refresh"
|
|
45
|
+
}),
|
|
46
|
+
children: "\u91CD\u65B0\u52A0\u8F7D"
|
|
47
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
48
|
+
type: "text",
|
|
49
|
+
disabled: isAffixed,
|
|
50
|
+
onClick: () => {
|
|
51
|
+
const newOpenKeys = (0, _tabActions.closeTab)(openKeys, index, drop, affixRouter);
|
|
52
|
+
setOpenkeys(newOpenKeys);
|
|
53
|
+
setOpen("");
|
|
54
|
+
// After closing the tab, select the previous one; fall back to the first one
|
|
55
|
+
const targetIndex = index > 0 ? index - 1 : 0;
|
|
56
|
+
navigate(newOpenKeys[targetIndex]?.key || basePath);
|
|
57
|
+
},
|
|
58
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
59
|
+
icon: "ep:close"
|
|
60
|
+
}),
|
|
61
|
+
children: "\u5173\u95ED\u6807\u7B7E\u9875"
|
|
62
|
+
})]
|
|
63
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
64
|
+
className: _indexModule.default.part,
|
|
65
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
66
|
+
type: "text",
|
|
67
|
+
disabled: index === 0,
|
|
68
|
+
onClick: () => {
|
|
69
|
+
const newOpenKeys = (0, _tabActions.closeLeftTabs)(openKeys, index, drop, affixRouter);
|
|
70
|
+
setOpenkeys(newOpenKeys);
|
|
71
|
+
setOpen("");
|
|
72
|
+
navigate(item.key);
|
|
73
|
+
},
|
|
74
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
75
|
+
icon: "ep:d-arrow-left"
|
|
76
|
+
}),
|
|
77
|
+
children: "\u5173\u95ED\u5DE6\u4FA7\u6807\u7B7E\u9875"
|
|
78
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
79
|
+
type: "text",
|
|
80
|
+
disabled: index === openKeys.length - 1,
|
|
81
|
+
onClick: () => {
|
|
82
|
+
const newOpenKeys = (0, _tabActions.closeRightTabs)(openKeys, index, drop, affixRouter);
|
|
83
|
+
setOpenkeys(newOpenKeys);
|
|
84
|
+
setOpen("");
|
|
85
|
+
navigate(item.key);
|
|
86
|
+
},
|
|
87
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
88
|
+
icon: "ep:d-arrow-right"
|
|
89
|
+
}),
|
|
90
|
+
children: "\u5173\u95ED\u53F3\u4FA7\u6807\u7B7E\u9875"
|
|
91
|
+
})]
|
|
92
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
93
|
+
className: _indexModule.default.part,
|
|
94
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
95
|
+
type: "text",
|
|
96
|
+
disabled: openKeys.length <= 1,
|
|
97
|
+
onClick: () => {
|
|
98
|
+
const newOpenKeys = (0, _tabActions.closeOtherTabs)(openKeys, item, drop, affixRouter);
|
|
99
|
+
setOpenkeys(newOpenKeys);
|
|
100
|
+
setOpen("");
|
|
101
|
+
navigate(item.key);
|
|
102
|
+
},
|
|
103
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
104
|
+
icon: "ep:discount"
|
|
105
|
+
}),
|
|
106
|
+
children: "\u5173\u95ED\u5176\u4ED6\u6807\u7B7E\u9875"
|
|
107
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
108
|
+
type: "text",
|
|
109
|
+
disabled: isAffixed && openKeys.length <= 1,
|
|
110
|
+
onClick: () => {
|
|
111
|
+
const newOpenKeys = (0, _tabActions.closeAllTabs)(openKeys, drop, affixRouter);
|
|
112
|
+
setOpenkeys(newOpenKeys);
|
|
113
|
+
setOpen("");
|
|
114
|
+
// If any affixed tabs remain, navigate to the first one
|
|
115
|
+
if (newOpenKeys.length > 0) {
|
|
116
|
+
navigate(newOpenKeys[0].key);
|
|
117
|
+
} else {
|
|
118
|
+
navigate(basePath);
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
122
|
+
icon: "ep:minus"
|
|
123
|
+
}),
|
|
124
|
+
children: "\u5173\u95ED\u5168\u90E8\u6807\u7B7E\u9875"
|
|
125
|
+
})]
|
|
126
|
+
})]
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
var _default = exports.default = TabContextMenu;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TabType } from "../..";
|
|
3
|
+
interface TabDragOverlayProps {
|
|
4
|
+
activeId: string | null;
|
|
5
|
+
openKeys: TabType[];
|
|
6
|
+
basePath: string;
|
|
7
|
+
affixRouter: string[];
|
|
8
|
+
open: string;
|
|
9
|
+
onReload: (key: string) => void;
|
|
10
|
+
refresh: (key: string) => void;
|
|
11
|
+
drop: (key: string) => void;
|
|
12
|
+
setOpenkeys: React.Dispatch<React.SetStateAction<TabType[]>>;
|
|
13
|
+
setOpen: (key: string) => void;
|
|
14
|
+
navigate: (path: string) => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Drag overlay component that renders the tab currently being dragged
|
|
18
|
+
*/
|
|
19
|
+
declare const TabDragOverlay: React.FC<TabDragOverlayProps>;
|
|
20
|
+
export default TabDragOverlay;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _core = require("@dnd-kit/core");
|
|
9
|
+
var _TabLabel = _interopRequireDefault(require("../TabLabel"));
|
|
10
|
+
var _indexModule = _interopRequireDefault(require("../../index.module.scss"));
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
/**
|
|
14
|
+
* Drag overlay component that renders the tab currently being dragged
|
|
15
|
+
*/
|
|
16
|
+
const TabDragOverlay = ({
|
|
17
|
+
activeId,
|
|
18
|
+
openKeys,
|
|
19
|
+
basePath,
|
|
20
|
+
affixRouter,
|
|
21
|
+
open,
|
|
22
|
+
onReload,
|
|
23
|
+
refresh,
|
|
24
|
+
drop,
|
|
25
|
+
setOpenkeys,
|
|
26
|
+
setOpen,
|
|
27
|
+
navigate
|
|
28
|
+
}) => {
|
|
29
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_core.DragOverlay, {
|
|
30
|
+
adjustScale: false,
|
|
31
|
+
children: activeId ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
32
|
+
className: _indexModule.default.dragOverlay,
|
|
33
|
+
children: (() => {
|
|
34
|
+
const item = openKeys.find(item => item.key === activeId);
|
|
35
|
+
const idx = openKeys.findIndex(item => item.key === activeId);
|
|
36
|
+
return item ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_TabLabel.default, {
|
|
37
|
+
item: item,
|
|
38
|
+
index: idx,
|
|
39
|
+
openKeys: openKeys,
|
|
40
|
+
basePath: basePath,
|
|
41
|
+
affixRouter: affixRouter,
|
|
42
|
+
open: open,
|
|
43
|
+
onReload: onReload,
|
|
44
|
+
refresh: refresh,
|
|
45
|
+
drop: drop,
|
|
46
|
+
setOpenkeys: setOpenkeys,
|
|
47
|
+
setOpen: setOpen,
|
|
48
|
+
navigate: navigate
|
|
49
|
+
}) : activeId;
|
|
50
|
+
})()
|
|
51
|
+
}) : null
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
var _default = exports.default = TabDragOverlay;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TabType } from "../..";
|
|
3
|
+
interface TabLabelProps {
|
|
4
|
+
item: TabType;
|
|
5
|
+
index: number;
|
|
6
|
+
openKeys: TabType[];
|
|
7
|
+
basePath: string;
|
|
8
|
+
affixRouter: string[];
|
|
9
|
+
open: string;
|
|
10
|
+
onReload: (key: string) => void;
|
|
11
|
+
refresh: (key: string) => void;
|
|
12
|
+
drop: (key: string) => void;
|
|
13
|
+
setOpenkeys: React.Dispatch<React.SetStateAction<TabType[]>>;
|
|
14
|
+
setOpen: (key: string) => void;
|
|
15
|
+
navigate: (path: string) => void;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Tab label component
|
|
20
|
+
*/
|
|
21
|
+
declare const TabLabel: React.FC<TabLabelProps>;
|
|
22
|
+
export default TabLabel;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _antd = require("antd");
|
|
9
|
+
var _TabContextMenu = _interopRequireDefault(require("../TabContextMenu"));
|
|
10
|
+
var _indexModule = _interopRequireDefault(require("../../index.module.scss"));
|
|
11
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
/**
|
|
15
|
+
* Tab label component
|
|
16
|
+
*/
|
|
17
|
+
const TabLabel = ({
|
|
18
|
+
item,
|
|
19
|
+
index,
|
|
20
|
+
openKeys,
|
|
21
|
+
basePath,
|
|
22
|
+
affixRouter,
|
|
23
|
+
open,
|
|
24
|
+
onReload,
|
|
25
|
+
refresh,
|
|
26
|
+
drop,
|
|
27
|
+
setOpenkeys,
|
|
28
|
+
setOpen,
|
|
29
|
+
navigate,
|
|
30
|
+
className
|
|
31
|
+
}) => {
|
|
32
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Popover, {
|
|
33
|
+
open: item.key === open,
|
|
34
|
+
placement: "bottomLeft",
|
|
35
|
+
classNames: {
|
|
36
|
+
root: _indexModule.default.popover
|
|
37
|
+
},
|
|
38
|
+
content: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TabContextMenu.default, {
|
|
39
|
+
item: item,
|
|
40
|
+
index: index,
|
|
41
|
+
openKeys: openKeys,
|
|
42
|
+
basePath: basePath,
|
|
43
|
+
affixRouter: affixRouter,
|
|
44
|
+
onReload: onReload,
|
|
45
|
+
refresh: refresh,
|
|
46
|
+
drop: drop,
|
|
47
|
+
setOpenkeys: setOpenkeys,
|
|
48
|
+
setOpen: setOpen,
|
|
49
|
+
navigate: navigate
|
|
50
|
+
}),
|
|
51
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
52
|
+
onContextMenu: event => {
|
|
53
|
+
event.preventDefault();
|
|
54
|
+
},
|
|
55
|
+
onMouseDown: e => {
|
|
56
|
+
if (e.button === 2) {
|
|
57
|
+
setOpen(item.key === open ? "" : item.key);
|
|
58
|
+
} else {
|
|
59
|
+
setOpen("");
|
|
60
|
+
navigate(item.key);
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
className: (0, _classnames.default)(_indexModule.default.tabLabel, className),
|
|
64
|
+
children: [item.icon, item.label]
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
var _default = exports.default = TabLabel;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useDropTabKey = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactActivation = require("react-activation");
|
|
9
|
+
var _useDropTab = require("../../_hooks/useDropTab");
|
|
10
|
+
/**
|
|
11
|
+
* Hook that closes a tab via dropKey
|
|
12
|
+
*/
|
|
13
|
+
const useDropTabKey = setOpenkeys => {
|
|
14
|
+
const {
|
|
15
|
+
drop
|
|
16
|
+
} = (0, _reactActivation.useAliveController)();
|
|
17
|
+
const {
|
|
18
|
+
dropKey
|
|
19
|
+
} = (0, _react.useContext)(_useDropTab.NavTabBarContent);
|
|
20
|
+
(0, _react.useEffect)(() => {
|
|
21
|
+
setTimeout(() => {
|
|
22
|
+
if (dropKey) {
|
|
23
|
+
drop(dropKey);
|
|
24
|
+
setOpenkeys(prev => {
|
|
25
|
+
const newOpenKeys = prev.filter(item => item.key !== dropKey);
|
|
26
|
+
return newOpenKeys;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}, 0);
|
|
30
|
+
}, [drop, dropKey, setOpenkeys]);
|
|
31
|
+
};
|
|
32
|
+
exports.useDropTabKey = useDropTabKey;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useTabContextMenu = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _ahooks = require("ahooks");
|
|
9
|
+
/**
|
|
10
|
+
* Hook that handles the tab context menu
|
|
11
|
+
*/
|
|
12
|
+
const useTabContextMenu = () => {
|
|
13
|
+
const [open, setOpen] = (0, _react.useState)("");
|
|
14
|
+
(0, _ahooks.useDebounceEffect)(() => {
|
|
15
|
+
const close = () => {
|
|
16
|
+
setOpen("");
|
|
17
|
+
};
|
|
18
|
+
document.removeEventListener("click", close);
|
|
19
|
+
if (open) {
|
|
20
|
+
document.addEventListener("click", close);
|
|
21
|
+
}
|
|
22
|
+
}, [open]);
|
|
23
|
+
return {
|
|
24
|
+
open,
|
|
25
|
+
setOpen
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
exports.useTabContextMenu = useTabContextMenu;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TabType } from "..";
|
|
3
|
+
interface UseTabPathOptions {
|
|
4
|
+
items: TabType[];
|
|
5
|
+
affixRouter: string[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Hook that handles tab path matching and active state
|
|
9
|
+
*/
|
|
10
|
+
export declare const useTabPath: ({ items, affixRouter }: UseTabPathOptions) => {
|
|
11
|
+
tabKey: string;
|
|
12
|
+
setTabKey: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
13
|
+
openKeys: TabType[];
|
|
14
|
+
setOpenkeys: import("react").Dispatch<import("react").SetStateAction<TabType[]>>;
|
|
15
|
+
};
|
|
16
|
+
export {};
|