@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,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,50 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { DragOverlay } from "@dnd-kit/core";
|
|
3
|
+
import TabLabel from "../TabLabel";
|
|
4
|
+
import styles from "../../index.module.scss";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
/**
|
|
7
|
+
* Drag overlay component that renders the tab currently being dragged
|
|
8
|
+
*/
|
|
9
|
+
var TabDragOverlay = function TabDragOverlay(_ref) {
|
|
10
|
+
var activeId = _ref.activeId,
|
|
11
|
+
openKeys = _ref.openKeys,
|
|
12
|
+
basePath = _ref.basePath,
|
|
13
|
+
affixRouter = _ref.affixRouter,
|
|
14
|
+
open = _ref.open,
|
|
15
|
+
onReload = _ref.onReload,
|
|
16
|
+
refresh = _ref.refresh,
|
|
17
|
+
drop = _ref.drop,
|
|
18
|
+
setOpenkeys = _ref.setOpenkeys,
|
|
19
|
+
setOpen = _ref.setOpen,
|
|
20
|
+
navigate = _ref.navigate;
|
|
21
|
+
return /*#__PURE__*/_jsx(DragOverlay, {
|
|
22
|
+
adjustScale: false,
|
|
23
|
+
children: activeId ? /*#__PURE__*/_jsx("div", {
|
|
24
|
+
className: styles.dragOverlay,
|
|
25
|
+
children: function () {
|
|
26
|
+
var item = openKeys.find(function (item) {
|
|
27
|
+
return item.key === activeId;
|
|
28
|
+
});
|
|
29
|
+
var idx = openKeys.findIndex(function (item) {
|
|
30
|
+
return item.key === activeId;
|
|
31
|
+
});
|
|
32
|
+
return item ? /*#__PURE__*/_jsx(TabLabel, {
|
|
33
|
+
item: item,
|
|
34
|
+
index: idx,
|
|
35
|
+
openKeys: openKeys,
|
|
36
|
+
basePath: basePath,
|
|
37
|
+
affixRouter: affixRouter,
|
|
38
|
+
open: open,
|
|
39
|
+
onReload: onReload,
|
|
40
|
+
refresh: refresh,
|
|
41
|
+
drop: drop,
|
|
42
|
+
setOpenkeys: setOpenkeys,
|
|
43
|
+
setOpen: setOpen,
|
|
44
|
+
navigate: navigate
|
|
45
|
+
}) : activeId;
|
|
46
|
+
}()
|
|
47
|
+
}) : null
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
export 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,61 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Popover } from "antd";
|
|
3
|
+
import TabContextMenu from "../TabContextMenu";
|
|
4
|
+
import styles from "../../index.module.scss";
|
|
5
|
+
import classNames from "classnames";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
/**
|
|
9
|
+
* Tab label component
|
|
10
|
+
*/
|
|
11
|
+
var TabLabel = function TabLabel(_ref) {
|
|
12
|
+
var item = _ref.item,
|
|
13
|
+
index = _ref.index,
|
|
14
|
+
openKeys = _ref.openKeys,
|
|
15
|
+
basePath = _ref.basePath,
|
|
16
|
+
affixRouter = _ref.affixRouter,
|
|
17
|
+
open = _ref.open,
|
|
18
|
+
onReload = _ref.onReload,
|
|
19
|
+
refresh = _ref.refresh,
|
|
20
|
+
drop = _ref.drop,
|
|
21
|
+
setOpenkeys = _ref.setOpenkeys,
|
|
22
|
+
setOpen = _ref.setOpen,
|
|
23
|
+
navigate = _ref.navigate,
|
|
24
|
+
className = _ref.className;
|
|
25
|
+
return /*#__PURE__*/_jsx(Popover, {
|
|
26
|
+
open: item.key === open,
|
|
27
|
+
placement: "bottomLeft",
|
|
28
|
+
classNames: {
|
|
29
|
+
root: styles.popover
|
|
30
|
+
},
|
|
31
|
+
content: /*#__PURE__*/_jsx(TabContextMenu, {
|
|
32
|
+
item: item,
|
|
33
|
+
index: index,
|
|
34
|
+
openKeys: openKeys,
|
|
35
|
+
basePath: basePath,
|
|
36
|
+
affixRouter: affixRouter,
|
|
37
|
+
onReload: onReload,
|
|
38
|
+
refresh: refresh,
|
|
39
|
+
drop: drop,
|
|
40
|
+
setOpenkeys: setOpenkeys,
|
|
41
|
+
setOpen: setOpen,
|
|
42
|
+
navigate: navigate
|
|
43
|
+
}),
|
|
44
|
+
children: /*#__PURE__*/_jsxs("span", {
|
|
45
|
+
onContextMenu: function onContextMenu(event) {
|
|
46
|
+
event.preventDefault();
|
|
47
|
+
},
|
|
48
|
+
onMouseDown: function onMouseDown(e) {
|
|
49
|
+
if (e.button === 2) {
|
|
50
|
+
setOpen(item.key === open ? "" : item.key);
|
|
51
|
+
} else {
|
|
52
|
+
setOpen("");
|
|
53
|
+
navigate(item.key);
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
className: classNames(styles.tabLabel, className),
|
|
57
|
+
children: [item.icon, item.label]
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
export default TabLabel;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useEffect, useContext } from "react";
|
|
2
|
+
import { useAliveController } from "react-activation";
|
|
3
|
+
import { NavTabBarContent } from "../../_hooks/useDropTab";
|
|
4
|
+
/**
|
|
5
|
+
* Hook that closes a tab via dropKey
|
|
6
|
+
*/
|
|
7
|
+
export var useDropTabKey = function useDropTabKey(setOpenkeys) {
|
|
8
|
+
var _useAliveController = useAliveController(),
|
|
9
|
+
drop = _useAliveController.drop;
|
|
10
|
+
var _useContext = useContext(NavTabBarContent),
|
|
11
|
+
dropKey = _useContext.dropKey;
|
|
12
|
+
useEffect(function () {
|
|
13
|
+
setTimeout(function () {
|
|
14
|
+
if (dropKey) {
|
|
15
|
+
drop(dropKey);
|
|
16
|
+
setOpenkeys(function (prev) {
|
|
17
|
+
var newOpenKeys = prev.filter(function (item) {
|
|
18
|
+
return item.key !== dropKey;
|
|
19
|
+
});
|
|
20
|
+
return newOpenKeys;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}, 0);
|
|
24
|
+
}, [drop, dropKey, setOpenkeys]);
|
|
25
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { useState } from "react";
|
|
8
|
+
import { useDebounceEffect } from "ahooks";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Hook that handles the tab context menu
|
|
12
|
+
*/
|
|
13
|
+
export var useTabContextMenu = function useTabContextMenu() {
|
|
14
|
+
var _useState = useState(""),
|
|
15
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
16
|
+
open = _useState2[0],
|
|
17
|
+
setOpen = _useState2[1];
|
|
18
|
+
useDebounceEffect(function () {
|
|
19
|
+
var close = function close() {
|
|
20
|
+
setOpen("");
|
|
21
|
+
};
|
|
22
|
+
document.removeEventListener("click", close);
|
|
23
|
+
if (open) {
|
|
24
|
+
document.addEventListener("click", close);
|
|
25
|
+
}
|
|
26
|
+
}, [open]);
|
|
27
|
+
return {
|
|
28
|
+
open: open,
|
|
29
|
+
setOpen: setOpen
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -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 {};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
10
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
11
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
13
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
14
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
15
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
16
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
+
import { useCallback, useEffect, useState } from "react";
|
|
18
|
+
import { useLocation } from "react-router";
|
|
19
|
+
import { checkTabPathMatch } from "../_utils/pathMatch";
|
|
20
|
+
import { array_is_includes } from "hsu-utils";
|
|
21
|
+
/**
|
|
22
|
+
* Hook that handles tab path matching and active state
|
|
23
|
+
*/
|
|
24
|
+
export var useTabPath = function useTabPath(_ref) {
|
|
25
|
+
var items = _ref.items,
|
|
26
|
+
affixRouter = _ref.affixRouter;
|
|
27
|
+
var location = useLocation();
|
|
28
|
+
var _useState = useState(""),
|
|
29
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
30
|
+
tabKey = _useState2[0],
|
|
31
|
+
setTabKey = _useState2[1];
|
|
32
|
+
var _useState3 = useState([]),
|
|
33
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
34
|
+
openKeys = _useState4[0],
|
|
35
|
+
setOpenkeys = _useState4[1];
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Check affixed routes (affixRouter and affix) and add them to openKeys
|
|
39
|
+
*/
|
|
40
|
+
var _checkAffix = useCallback(function (items) {
|
|
41
|
+
items === null || items === void 0 || items.forEach(function (item) {
|
|
42
|
+
if (item.children) {
|
|
43
|
+
_checkAffix(item.children);
|
|
44
|
+
} else {
|
|
45
|
+
// Check whether it is an affixed route
|
|
46
|
+
var isAffix = affixRouter.includes(item.key) || item.affix;
|
|
47
|
+
if (isAffix) {
|
|
48
|
+
setOpenkeys(function (prev) {
|
|
49
|
+
var find = prev.find(function (i) {
|
|
50
|
+
return i.key === item.key;
|
|
51
|
+
});
|
|
52
|
+
if (find) {
|
|
53
|
+
return prev;
|
|
54
|
+
}
|
|
55
|
+
return [].concat(_toConsumableArray(prev), [item]);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}, [affixRouter]);
|
|
61
|
+
var _checkPath = useCallback(function (items, parents) {
|
|
62
|
+
var pathname = decodeURI(location.pathname);
|
|
63
|
+
var search = location.search;
|
|
64
|
+
items === null || items === void 0 || items.forEach(function (item) {
|
|
65
|
+
if (item.children) {
|
|
66
|
+
var _parents = parents ? [].concat(_toConsumableArray(parents), [item]) : [item];
|
|
67
|
+
_checkPath(item.children, _parents);
|
|
68
|
+
} else {
|
|
69
|
+
var isMatch = checkTabPathMatch(pathname, item.key);
|
|
70
|
+
if (isMatch) {
|
|
71
|
+
var keyArr = item.key.split("/").filter(Boolean);
|
|
72
|
+
var hasParams = keyArr.filter(function (i) {
|
|
73
|
+
return i.startsWith(":");
|
|
74
|
+
}).length > 0;
|
|
75
|
+
var pathArr = pathname.split("/").filter(Boolean);
|
|
76
|
+
if (hasParams && array_is_includes(keyArr.filter(function (i) {
|
|
77
|
+
return !i.startsWith(":");
|
|
78
|
+
}), pathArr)) {
|
|
79
|
+
// Handle param routes
|
|
80
|
+
setTabKey("".concat(pathname).concat(search));
|
|
81
|
+
setOpenkeys(function (prev) {
|
|
82
|
+
var find = prev.find(function (i) {
|
|
83
|
+
return i.key.split("?")[0] === pathname;
|
|
84
|
+
});
|
|
85
|
+
if (find) {
|
|
86
|
+
return prev.map(function (i) {
|
|
87
|
+
return i.key.split("?")[0] === pathname ? _objectSpread(_objectSpread({}, i), {}, {
|
|
88
|
+
key: "".concat(pathname).concat(search)
|
|
89
|
+
}) : i;
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
return [].concat(_toConsumableArray(prev), [_objectSpread(_objectSpread({}, item), {}, {
|
|
93
|
+
key: "".concat(pathname).concat(search)
|
|
94
|
+
})]);
|
|
95
|
+
});
|
|
96
|
+
} else {
|
|
97
|
+
// Handle plain routes
|
|
98
|
+
setTabKey("".concat(item.key).concat(search));
|
|
99
|
+
setOpenkeys(function (prev) {
|
|
100
|
+
var find = prev.find(function (i) {
|
|
101
|
+
return i.key.split("?")[0] === item.key;
|
|
102
|
+
});
|
|
103
|
+
if (find) {
|
|
104
|
+
return prev.map(function (i) {
|
|
105
|
+
return i.key.split("?")[0] === item.key ? _objectSpread(_objectSpread({}, i), {}, {
|
|
106
|
+
key: "".concat(item.key).concat(search)
|
|
107
|
+
}) : i;
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
return [].concat(_toConsumableArray(prev), [_objectSpread(_objectSpread({}, item), {}, {
|
|
111
|
+
key: "".concat(item.key).concat(search)
|
|
112
|
+
})]);
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
}, [location.pathname, location.search]);
|
|
119
|
+
useEffect(function () {
|
|
120
|
+
// Handle affixed routes first to populate openKeys
|
|
121
|
+
_checkAffix(items);
|
|
122
|
+
// Then run path matching
|
|
123
|
+
_checkPath(items);
|
|
124
|
+
}, [_checkAffix, _checkPath, items]);
|
|
125
|
+
return {
|
|
126
|
+
tabKey: tabKey,
|
|
127
|
+
setTabKey: setTabKey,
|
|
128
|
+
openKeys: openKeys,
|
|
129
|
+
setOpenkeys: setOpenkeys
|
|
130
|
+
};
|
|
131
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import { useEffect, useContext } from "react";
|
|
8
|
+
import { NavTabBarTitleContent } from "../../_hooks/useSetTabTitle";
|
|
9
|
+
/**
|
|
10
|
+
* Hook that updates tab titles via tabTitles
|
|
11
|
+
*/
|
|
12
|
+
export var useTabTitle = function useTabTitle(setOpenkeys) {
|
|
13
|
+
var _useContext = useContext(NavTabBarTitleContent),
|
|
14
|
+
tabTitles = _useContext.tabTitles;
|
|
15
|
+
useEffect(function () {
|
|
16
|
+
if (tabTitles && Object.keys(tabTitles).length > 0) {
|
|
17
|
+
setOpenkeys(function (prev) {
|
|
18
|
+
return prev === null || prev === void 0 ? void 0 : prev.map(function (item) {
|
|
19
|
+
if (tabTitles[item.key] !== undefined) {
|
|
20
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
21
|
+
label: tabTitles[item.key]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return item;
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}, [tabTitles, setOpenkeys]);
|
|
29
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RouteType } from "../../types";
|
|
2
|
+
import { TabType } from "..";
|
|
3
|
+
/**
|
|
4
|
+
* Format routes into tab items
|
|
5
|
+
* @param routes Route configuration
|
|
6
|
+
* @param parent Parent tab item
|
|
7
|
+
* @returns Array of tab items
|
|
8
|
+
*/
|
|
9
|
+
export declare const formatNavTabBar: (routes: RouteType[], parent?: TabType) => TabType[];
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
7
|
+
import { cloneDeep } from "lodash";
|
|
8
|
+
/**
|
|
9
|
+
* Format routes into tab items
|
|
10
|
+
* @param routes Route configuration
|
|
11
|
+
* @param parent Parent tab item
|
|
12
|
+
* @returns Array of tab items
|
|
13
|
+
*/
|
|
14
|
+
export var formatNavTabBar = function formatNavTabBar(routes, parent) {
|
|
15
|
+
var newRoutes = [];
|
|
16
|
+
routes === null || routes === void 0 || routes.forEach(function (route) {
|
|
17
|
+
var children = undefined;
|
|
18
|
+
if (route.children) {
|
|
19
|
+
children = formatNavTabBar(route.children, cloneDeep(route));
|
|
20
|
+
}
|
|
21
|
+
var meta = route.meta;
|
|
22
|
+
if (!(meta !== null && meta !== void 0 && meta.noTabsView) && route.path) {
|
|
23
|
+
var _meta$name, _children;
|
|
24
|
+
newRoutes.push({
|
|
25
|
+
key: decodeURI(route.path),
|
|
26
|
+
label: (_meta$name = meta === null || meta === void 0 ? void 0 : meta.name) !== null && _meta$name !== void 0 ? _meta$name : "",
|
|
27
|
+
children: (((_children = children) === null || _children === void 0 ? void 0 : _children.length) || 0) > 0 ? children : undefined,
|
|
28
|
+
element: route.element,
|
|
29
|
+
affix: meta === null || meta === void 0 ? void 0 : meta.affix,
|
|
30
|
+
icon: meta === null || meta === void 0 ? void 0 : meta.icon
|
|
31
|
+
});
|
|
32
|
+
} else if (!(meta !== null && meta !== void 0 && meta.noTabsView) && route.index && parent !== null && parent !== void 0 && parent.path) {
|
|
33
|
+
var _meta$name2;
|
|
34
|
+
newRoutes.push({
|
|
35
|
+
key: decodeURI(parent.path),
|
|
36
|
+
label: (_meta$name2 = meta === null || meta === void 0 ? void 0 : meta.name) !== null && _meta$name2 !== void 0 ? _meta$name2 : "",
|
|
37
|
+
element: route.element,
|
|
38
|
+
affix: meta === null || meta === void 0 ? void 0 : meta.affix,
|
|
39
|
+
icon: meta === null || meta === void 0 ? void 0 : meta.icon
|
|
40
|
+
});
|
|
41
|
+
} else {
|
|
42
|
+
if (children) {
|
|
43
|
+
newRoutes.push.apply(newRoutes, _toConsumableArray(children));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
return newRoutes;
|
|
48
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check whether a path matches (used by tabs)
|
|
3
|
+
* Note: matching of affixed routes (affixRouter and affix) is handled separately in _checkAffix of useTabPath
|
|
4
|
+
* @param pathname Current path
|
|
5
|
+
* @param key Route key
|
|
6
|
+
* @returns Whether it matches
|
|
7
|
+
*/
|
|
8
|
+
export declare const checkTabPathMatch: (pathname: string, key: string) => boolean;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { array_is_includes } from "hsu-utils";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Check whether a path matches (used by tabs)
|
|
5
|
+
* Note: matching of affixed routes (affixRouter and affix) is handled separately in _checkAffix of useTabPath
|
|
6
|
+
* @param pathname Current path
|
|
7
|
+
* @param key Route key
|
|
8
|
+
* @returns Whether it matches
|
|
9
|
+
*/
|
|
10
|
+
export var checkTabPathMatch = function checkTabPathMatch(pathname, key) {
|
|
11
|
+
// Handle the root path
|
|
12
|
+
if (pathname === "/" && key === "/") {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
var pathArr = pathname.split("/").filter(Boolean);
|
|
16
|
+
var keyArr = key.split("/").filter(Boolean);
|
|
17
|
+
if (keyArr.length === 0) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
if (pathArr.length !== keyArr.length) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Handle routes containing params (e.g. /user/:id)
|
|
25
|
+
if (key.includes(":")) {
|
|
26
|
+
return array_is_includes(keyArr.filter(function (i) {
|
|
27
|
+
return !i.startsWith(":");
|
|
28
|
+
}), pathArr);
|
|
29
|
+
} else {
|
|
30
|
+
// Plain path matching
|
|
31
|
+
return array_is_includes(keyArr, pathArr);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TabType } from "..";
|
|
2
|
+
/**
|
|
3
|
+
* Close the tab at the given index (keeping pinned tabs)
|
|
4
|
+
*/
|
|
5
|
+
export declare const closeTab: (openKeys: TabType[], index: number, drop: (key: string) => void, affixRouter?: string[]) => TabType[];
|
|
6
|
+
/**
|
|
7
|
+
* Close tabs to the left (keeping pinned tabs)
|
|
8
|
+
*/
|
|
9
|
+
export declare const closeLeftTabs: (openKeys: TabType[], index: number, drop: (key: string) => void, affixRouter?: string[]) => TabType[];
|
|
10
|
+
/**
|
|
11
|
+
* Close tabs to the right (keeping pinned tabs)
|
|
12
|
+
*/
|
|
13
|
+
export declare const closeRightTabs: (openKeys: TabType[], index: number, drop: (key: string) => void, affixRouter?: string[]) => TabType[];
|
|
14
|
+
/**
|
|
15
|
+
* Close other tabs (keeping pinned tabs)
|
|
16
|
+
*/
|
|
17
|
+
export declare const closeOtherTabs: (openKeys: TabType[], currentItem: TabType, drop: (key: string) => void, affixRouter?: string[]) => TabType[];
|
|
18
|
+
/**
|
|
19
|
+
* Close all tabs (keeping pinned tabs)
|
|
20
|
+
*/
|
|
21
|
+
export declare const closeAllTabs: (openKeys: TabType[], drop: (key: string) => void, affixRouter?: string[]) => TabType[];
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
7
|
+
/**
|
|
8
|
+
* Close the tab at the given index (keeping pinned tabs)
|
|
9
|
+
*/
|
|
10
|
+
export var closeTab = function closeTab(openKeys, index, drop) {
|
|
11
|
+
var affixRouter = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
12
|
+
var targetItem = openKeys[index];
|
|
13
|
+
// Do not close if it is a pinned tab
|
|
14
|
+
if (affixRouter.includes(targetItem.key) || targetItem.affix) {
|
|
15
|
+
return openKeys;
|
|
16
|
+
}
|
|
17
|
+
var newOpenKeys = _toConsumableArray(openKeys);
|
|
18
|
+
var removed = newOpenKeys.splice(index, 1);
|
|
19
|
+
removed === null || removed === void 0 || removed.forEach(function (item) {
|
|
20
|
+
var _item$key;
|
|
21
|
+
drop(((_item$key = item.key) === null || _item$key === void 0 ? void 0 : _item$key.split("?")[0]) || "");
|
|
22
|
+
});
|
|
23
|
+
return newOpenKeys;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Close tabs to the left (keeping pinned tabs)
|
|
28
|
+
*/
|
|
29
|
+
export var closeLeftTabs = function closeLeftTabs(openKeys, index, drop) {
|
|
30
|
+
var affixRouter = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
31
|
+
// Split off the tabs on the left
|
|
32
|
+
var leftTabs = openKeys.slice(0, index);
|
|
33
|
+
var rightTabs = openKeys.slice(index);
|
|
34
|
+
|
|
35
|
+
// Filter out the non-pinned tabs on the left and close them
|
|
36
|
+
var removedTabs = leftTabs.filter(function (item) {
|
|
37
|
+
return !affixRouter.includes(item.key) && !item.affix;
|
|
38
|
+
});
|
|
39
|
+
removedTabs.forEach(function (item) {
|
|
40
|
+
var _item$key2;
|
|
41
|
+
drop(((_item$key2 = item.key) === null || _item$key2 === void 0 ? void 0 : _item$key2.split("?")[0]) || "");
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// Keep the pinned tabs on the left and all tabs on the right
|
|
45
|
+
var keptLeftTabs = leftTabs.filter(function (item) {
|
|
46
|
+
return affixRouter.includes(item.key) || item.affix;
|
|
47
|
+
});
|
|
48
|
+
return [].concat(_toConsumableArray(keptLeftTabs), _toConsumableArray(rightTabs));
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Close tabs to the right (keeping pinned tabs)
|
|
53
|
+
*/
|
|
54
|
+
export var closeRightTabs = function closeRightTabs(openKeys, index, drop) {
|
|
55
|
+
var affixRouter = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
56
|
+
// Split into left and right tabs
|
|
57
|
+
var leftTabs = openKeys.slice(0, index + 1);
|
|
58
|
+
var rightTabs = openKeys.slice(index + 1);
|
|
59
|
+
|
|
60
|
+
// Filter out the non-pinned tabs on the right and close them
|
|
61
|
+
var removedTabs = rightTabs.filter(function (item) {
|
|
62
|
+
return !affixRouter.includes(item.key) && !item.affix;
|
|
63
|
+
});
|
|
64
|
+
removedTabs.forEach(function (item) {
|
|
65
|
+
var _item$key3;
|
|
66
|
+
drop(((_item$key3 = item.key) === null || _item$key3 === void 0 ? void 0 : _item$key3.split("?")[0]) || "");
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// Keep all tabs on the left and the pinned tabs on the right
|
|
70
|
+
var keptRightTabs = rightTabs.filter(function (item) {
|
|
71
|
+
return affixRouter.includes(item.key) || item.affix;
|
|
72
|
+
});
|
|
73
|
+
return [].concat(_toConsumableArray(leftTabs), _toConsumableArray(keptRightTabs));
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Close other tabs (keeping pinned tabs)
|
|
78
|
+
*/
|
|
79
|
+
export var closeOtherTabs = function closeOtherTabs(openKeys, currentItem, drop) {
|
|
80
|
+
var affixRouter = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
81
|
+
// Filter out the other non-pinned tabs and close them
|
|
82
|
+
var removedTabs = openKeys.filter(function (item) {
|
|
83
|
+
return item.key !== currentItem.key && !affixRouter.includes(item.key) && !item.affix;
|
|
84
|
+
});
|
|
85
|
+
removedTabs.forEach(function (item) {
|
|
86
|
+
var _item$key4;
|
|
87
|
+
drop(((_item$key4 = item.key) === null || _item$key4 === void 0 ? void 0 : _item$key4.split("?")[0]) || "");
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// Keep the current tab and all pinned tabs
|
|
91
|
+
return openKeys.filter(function (item) {
|
|
92
|
+
return item.key === currentItem.key || affixRouter.includes(item.key) || item.affix;
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Close all tabs (keeping pinned tabs)
|
|
98
|
+
*/
|
|
99
|
+
export var closeAllTabs = function closeAllTabs(openKeys, drop) {
|
|
100
|
+
var affixRouter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
101
|
+
// Filter out the non-pinned tabs and close them
|
|
102
|
+
var removedTabs = openKeys.filter(function (item) {
|
|
103
|
+
return !affixRouter.includes(item.key) && !item.affix;
|
|
104
|
+
});
|
|
105
|
+
removedTabs.forEach(function (item) {
|
|
106
|
+
var _item$key5;
|
|
107
|
+
drop(((_item$key5 = item.key) === null || _item$key5 === void 0 ? void 0 : _item$key5.split("?")[0]) || "");
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
// Return the pinned tabs
|
|
111
|
+
return openKeys.filter(function (item) {
|
|
112
|
+
return affixRouter.includes(item.key) || item.affix;
|
|
113
|
+
});
|
|
114
|
+
};
|