@hsu-react/ui 0.0.25 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -3
- 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 +43 -0
- package/es/layout/index.js +50 -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 +43 -0
- package/lib/layout/index.js +95 -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 +105 -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 +66 -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,9 @@
|
|
|
1
|
+
import { BreadcrumbType } from "..";
|
|
2
|
+
import { ItemType as MenuItemType } from "antd/es/menu/interface";
|
|
3
|
+
/**
|
|
4
|
+
* Format the breadcrumb submenu
|
|
5
|
+
* @param children Child breadcrumb items
|
|
6
|
+
* @param navigate Navigation function
|
|
7
|
+
* @returns Array of menu items
|
|
8
|
+
*/
|
|
9
|
+
export declare const formatBreadcrumbMenu: (children: BreadcrumbType[], navigate: (path: string) => void) => Omit<MenuItemType, "null">[];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import BreadcrumbMenuItem from "../_components/BreadcrumbMenuItem";
|
|
3
|
+
import { cloneDeep } from "lodash";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Format the breadcrumb submenu
|
|
7
|
+
* @param children Child breadcrumb items
|
|
8
|
+
* @param navigate Navigation function
|
|
9
|
+
* @returns Array of menu items
|
|
10
|
+
*/
|
|
11
|
+
export var formatBreadcrumbMenu = function formatBreadcrumbMenu(children, navigate) {
|
|
12
|
+
return children === null || children === void 0 ? void 0 : children.map(function (item) {
|
|
13
|
+
var _item$children, _item$path;
|
|
14
|
+
var children = (_item$children = item.children) === null || _item$children === void 0 ? void 0 : _item$children.filter(function (i) {
|
|
15
|
+
var _i$path;
|
|
16
|
+
return !((_i$path = i.path) !== null && _i$path !== void 0 && _i$path.includes(":"));
|
|
17
|
+
});
|
|
18
|
+
var childrenBreadcrumb = formatBreadcrumbMenu(cloneDeep(children || []), navigate);
|
|
19
|
+
return {
|
|
20
|
+
key: decodeURI((_item$path = item.path) !== null && _item$path !== void 0 ? _item$path : ""),
|
|
21
|
+
label: /*#__PURE__*/React.createElement(BreadcrumbMenuItem, {
|
|
22
|
+
item: item,
|
|
23
|
+
navigate: navigate
|
|
24
|
+
}),
|
|
25
|
+
children: childrenBreadcrumb.length > 0 ? childrenBreadcrumb : undefined
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RouteType } from "../../types";
|
|
2
|
+
import { BreadcrumbType } from "..";
|
|
3
|
+
/**
|
|
4
|
+
* Format routes into breadcrumb items
|
|
5
|
+
* @param router Route configuration
|
|
6
|
+
* @param parent Parent route
|
|
7
|
+
* @returns Array of breadcrumb items
|
|
8
|
+
*/
|
|
9
|
+
export declare const formatRoutes: (router: RouteType[], parent?: RouteType) => BreadcrumbType[];
|
|
@@ -0,0 +1,76 @@
|
|
|
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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
|
+
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."); }
|
|
4
|
+
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); }
|
|
5
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
+
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; }
|
|
8
|
+
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; }
|
|
9
|
+
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; }
|
|
10
|
+
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; }
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
12
|
+
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); }
|
|
13
|
+
import { cloneDeep } from "lodash";
|
|
14
|
+
/**
|
|
15
|
+
* Format routes into breadcrumb items
|
|
16
|
+
* @param router Route configuration
|
|
17
|
+
* @param parent Parent route
|
|
18
|
+
* @returns Array of breadcrumb items
|
|
19
|
+
*/
|
|
20
|
+
export var formatRoutes = function formatRoutes(router, parent) {
|
|
21
|
+
var newRoutes = [];
|
|
22
|
+
router === null || router === void 0 || router.forEach(function (route) {
|
|
23
|
+
var children = undefined;
|
|
24
|
+
if (route.children) {
|
|
25
|
+
children = formatRoutes(route.children, cloneDeep(route));
|
|
26
|
+
}
|
|
27
|
+
var meta = route.meta;
|
|
28
|
+
if (meta !== null && meta !== void 0 && meta.menu || !(meta !== null && meta !== void 0 && meta.noTabsView)) {
|
|
29
|
+
var path = "";
|
|
30
|
+
if (route.path) {
|
|
31
|
+
path = decodeURI(route.path);
|
|
32
|
+
}
|
|
33
|
+
if (route.index) {
|
|
34
|
+
var _children;
|
|
35
|
+
newRoutes.push({
|
|
36
|
+
path: parent === null || parent === void 0 ? void 0 : parent.path,
|
|
37
|
+
title: meta === null || meta === void 0 ? void 0 : meta.name,
|
|
38
|
+
children: (((_children = children) === null || _children === void 0 ? void 0 : _children.length) || 0) > 0 ? children : undefined,
|
|
39
|
+
icon: meta === null || meta === void 0 ? void 0 : meta.icon,
|
|
40
|
+
parent: parent,
|
|
41
|
+
route: route,
|
|
42
|
+
index: true
|
|
43
|
+
});
|
|
44
|
+
} else {
|
|
45
|
+
var _children2, _children3;
|
|
46
|
+
var indexChild = (_children2 = children) === null || _children2 === void 0 ? void 0 : _children2.find(function (child) {
|
|
47
|
+
return child === null || child === void 0 ? void 0 : child.index;
|
|
48
|
+
});
|
|
49
|
+
var newChildren = (_children3 = children) === null || _children3 === void 0 ? void 0 : _children3.filter(function (child) {
|
|
50
|
+
return !(child !== null && child !== void 0 && child.index);
|
|
51
|
+
});
|
|
52
|
+
if (indexChild) {
|
|
53
|
+
newRoutes.push(_objectSpread(_objectSpread({}, indexChild), {}, {
|
|
54
|
+
index: false,
|
|
55
|
+
parent: parent,
|
|
56
|
+
children: ((newChildren === null || newChildren === void 0 ? void 0 : newChildren.length) || 0) > 0 ? newChildren : undefined
|
|
57
|
+
}));
|
|
58
|
+
} else {
|
|
59
|
+
var _children4;
|
|
60
|
+
newRoutes.push({
|
|
61
|
+
path: path,
|
|
62
|
+
title: meta === null || meta === void 0 ? void 0 : meta.name,
|
|
63
|
+
children: (((_children4 = children) === null || _children4 === void 0 ? void 0 : _children4.length) || 0) > 0 ? children : undefined,
|
|
64
|
+
icon: meta === null || meta === void 0 ? void 0 : meta.icon,
|
|
65
|
+
parent: parent
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
} else {
|
|
70
|
+
if (children) {
|
|
71
|
+
newRoutes.push.apply(newRoutes, _toConsumableArray(children));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
return newRoutes;
|
|
76
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check whether a path matches (used by the breadcrumb)
|
|
3
|
+
* @param pathname Current path
|
|
4
|
+
* @param itemPath Route path
|
|
5
|
+
* @param parentPath Parent path
|
|
6
|
+
* @returns Whether it matches
|
|
7
|
+
*/
|
|
8
|
+
export declare const checkBreadcrumbPathMatch: (pathname: string, itemPath: string, parentPath?: string) => boolean;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { array_is_includes } from "hsu-utils";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Check whether a path matches (used by the breadcrumb)
|
|
5
|
+
* @param pathname Current path
|
|
6
|
+
* @param itemPath Route path
|
|
7
|
+
* @param parentPath Parent path
|
|
8
|
+
* @returns Whether it matches
|
|
9
|
+
*/
|
|
10
|
+
export var checkBreadcrumbPathMatch = function checkBreadcrumbPathMatch(pathname, itemPath, parentPath) {
|
|
11
|
+
if (!itemPath) {
|
|
12
|
+
return pathname === "/" && itemPath === "/";
|
|
13
|
+
}
|
|
14
|
+
var pathArr = pathname.split("/").filter(Boolean);
|
|
15
|
+
var keyArr = itemPath.split("/").filter(Boolean);
|
|
16
|
+
if (keyArr.length === 0) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
if (pathArr.length !== keyArr.length) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Handle the root path
|
|
24
|
+
if (pathname === "/" && itemPath === "/") {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Handle routes containing params (e.g. /user/:id)
|
|
29
|
+
if (itemPath.includes(":")) {
|
|
30
|
+
if (parentPath === "/") {
|
|
31
|
+
// If the parent path is the root path, check that there are no non-param segments
|
|
32
|
+
return !keyArr.filter(function (i) {
|
|
33
|
+
return !i.startsWith(":");
|
|
34
|
+
}).length;
|
|
35
|
+
} else {
|
|
36
|
+
// Filter out param segments and compare only the non-param parts
|
|
37
|
+
return array_is_includes(keyArr.filter(function (i) {
|
|
38
|
+
return !i.startsWith(":");
|
|
39
|
+
}), pathArr);
|
|
40
|
+
}
|
|
41
|
+
} else {
|
|
42
|
+
// Plain path matching
|
|
43
|
+
return array_is_includes(keyArr, pathArr);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import { ItemType } from "antd/es/breadcrumb/Breadcrumb";
|
|
3
|
+
import { RouteType } from "../types";
|
|
4
|
+
export interface BreadcrumbType extends Omit<ItemType, "children"> {
|
|
5
|
+
children?: BreadcrumbType[];
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
parent?: RouteType;
|
|
8
|
+
route?: RouteType;
|
|
9
|
+
index?: boolean;
|
|
10
|
+
}
|
|
11
|
+
interface BreadcrumbProps {
|
|
12
|
+
router: RouteType[];
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Breadcrumb component
|
|
17
|
+
*/
|
|
18
|
+
declare const Breadcrumb: React.FC<BreadcrumbProps>;
|
|
19
|
+
export default Breadcrumb;
|
|
@@ -0,0 +1,96 @@
|
|
|
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 { Breadcrumb as AntBreadcrumb } from "antd";
|
|
8
|
+
import React, { useMemo, useCallback } from "react";
|
|
9
|
+
import { useNavigate } from "react-router";
|
|
10
|
+
import styles from "./index.module.scss";
|
|
11
|
+
import { cloneDeep } from "lodash";
|
|
12
|
+
import classNames from "classnames";
|
|
13
|
+
import { formatRoutes } from "./_utils/formatRoutes";
|
|
14
|
+
import { formatBreadcrumbMenu } from "./_utils/formatMenu";
|
|
15
|
+
import { useBreadcrumbPath } from "./_hooks/useBreadcrumbPath";
|
|
16
|
+
import BreadcrumbItemIcon from "./_components/BreadcrumbItemIcon";
|
|
17
|
+
|
|
18
|
+
// Omit 掉 children:antd v6 把 BreadcrumbItemType.children 收窄成了
|
|
19
|
+
// `Omit<BreadcrumbItemType, "children">[]`,而这里的 children 要能递归携带 parent / route
|
|
20
|
+
// 这些自有字段,直接 extends 会判为不兼容。渲染时再转回 antd 认识的形状。
|
|
21
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
+
/**
|
|
23
|
+
* Breadcrumb component
|
|
24
|
+
*/
|
|
25
|
+
var Breadcrumb = function Breadcrumb(props) {
|
|
26
|
+
var router = props.router,
|
|
27
|
+
className = props.className;
|
|
28
|
+
var navigate = useNavigate();
|
|
29
|
+
var _routes = useMemo(function () {
|
|
30
|
+
return formatRoutes(router);
|
|
31
|
+
}, [router]);
|
|
32
|
+
var breadcrumb = useBreadcrumbPath(_routes);
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Handle the breadcrumb item click event
|
|
36
|
+
*/
|
|
37
|
+
var handleItemClick = useCallback(function (path) {
|
|
38
|
+
navigate(path);
|
|
39
|
+
}, [navigate]);
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Format breadcrumb items
|
|
43
|
+
*/
|
|
44
|
+
var formattedItems = useMemo(function () {
|
|
45
|
+
var _cloneDeep;
|
|
46
|
+
return (_cloneDeep = cloneDeep(breadcrumb)) === null || _cloneDeep === void 0 ? void 0 : _cloneDeep.map(function (item, index) {
|
|
47
|
+
var _item$children;
|
|
48
|
+
var isLastItem = index === breadcrumb.length - 1;
|
|
49
|
+
var children = (_item$children = item.children) === null || _item$children === void 0 ? void 0 : _item$children.filter(function (i) {
|
|
50
|
+
var _i$path;
|
|
51
|
+
return !((_i$path = i.path) !== null && _i$path !== void 0 && _i$path.includes(":"));
|
|
52
|
+
});
|
|
53
|
+
var hasChildren = children && children.length > 0;
|
|
54
|
+
|
|
55
|
+
// If there are child menus, set the menu items
|
|
56
|
+
if (hasChildren) {
|
|
57
|
+
item.onClick = function (e) {
|
|
58
|
+
return e.preventDefault();
|
|
59
|
+
};
|
|
60
|
+
item.menu = {
|
|
61
|
+
items: formatBreadcrumbMenu(cloneDeep(children), navigate)
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// The last item does not show a path
|
|
66
|
+
if (isLastItem) {
|
|
67
|
+
item.path = undefined;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// If there is an icon, wrap the title
|
|
71
|
+
if (item.icon) {
|
|
72
|
+
item.title = /*#__PURE__*/_jsx(BreadcrumbItemIcon, {
|
|
73
|
+
icon: item.icon,
|
|
74
|
+
title: item.title
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// If there is a path and no child menu, set the click handler
|
|
79
|
+
if (item.path && !hasChildren) {
|
|
80
|
+
item.onClick = function (e) {
|
|
81
|
+
e.preventDefault();
|
|
82
|
+
handleItemClick(item.path);
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
return _objectSpread({}, item);
|
|
86
|
+
});
|
|
87
|
+
}, [breadcrumb, navigate, handleItemClick]);
|
|
88
|
+
return /*#__PURE__*/_jsx(AntBreadcrumb, {
|
|
89
|
+
className: classNames(styles.Breadcrumb, className)
|
|
90
|
+
// BreadcrumbType 比 antd 的 ItemType 多带了 parent / route / children 这些自有字段,
|
|
91
|
+
// 供上面的格式化与点击逻辑使用;渲染时 antd 只读它认识的那几个,多出来的会被忽略。
|
|
92
|
+
,
|
|
93
|
+
items: formattedItems
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
export default Breadcrumb;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.Breadcrumb {
|
|
2
|
+
cursor: default;
|
|
3
|
+
|
|
4
|
+
// On narrow screens, keep long paths on one line so they do not squeeze the top bar; hide the overflow
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
|
|
7
|
+
:global(ol) {
|
|
8
|
+
flex-wrap: nowrap;
|
|
9
|
+
white-space: nowrap;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
* {
|
|
13
|
+
color: inherit !important;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Breadcrumb from "../Breadcrumb";
|
|
3
|
+
import { MenuType } from "../Menu";
|
|
4
|
+
/**
|
|
5
|
+
* 账号动作(改密 / 退出)由 App 传进来,本组件只认这个形状、不认来源。
|
|
6
|
+
*
|
|
7
|
+
* 别把 `PwdChange` 或 `LoginStore` 搬进来——看着它们该跟用户菜单待在一起,
|
|
8
|
+
* 但会同时踩两条:
|
|
9
|
+
* 1. `layout/` 反向 import `@/pages/…`(共享层依赖页面私有目录);
|
|
10
|
+
* 2. `PwdChange` 用 `FormItem`,而 `FormItem` 静态引入全部字段渲染器
|
|
11
|
+
* (wangeditor / codemirror / pdfjs / xlsx)。它现在由 App 以 `lazy()`
|
|
12
|
+
* +「打开才挂载」持有,搬进来很容易顺手写成静态 import,那些库就又钉回首屏了。
|
|
13
|
+
*/
|
|
14
|
+
export interface AccountAction {
|
|
15
|
+
title: string;
|
|
16
|
+
icon: string;
|
|
17
|
+
onclick: () => void;
|
|
18
|
+
/** 危险动作(退出登录之类),悬浮态用红色区分 */
|
|
19
|
+
danger?: boolean;
|
|
20
|
+
}
|
|
21
|
+
interface HeaderProps {
|
|
22
|
+
router: Parameters<typeof Breadcrumb>[0]["router"];
|
|
23
|
+
collapsed: boolean;
|
|
24
|
+
onToggleCollapsed: () => void;
|
|
25
|
+
/** mixed 布局下把顶部菜单的子项回传给左侧栏 */
|
|
26
|
+
onChildItems: (items: MenuType[]) => void;
|
|
27
|
+
menu: AccountAction[];
|
|
28
|
+
/** 当前用户,用于右上角展示。不传则不显示用户名 */
|
|
29
|
+
user?: {
|
|
30
|
+
nickname?: string;
|
|
31
|
+
avatar?: string;
|
|
32
|
+
};
|
|
33
|
+
/** 站点标题。原本读的是应用的全局 Config,组件不该认识那个 */
|
|
34
|
+
title?: React.ReactNode;
|
|
35
|
+
/** 侧栏收起时用的短标题;不传则回落到 title */
|
|
36
|
+
smallTitle?: React.ReactNode;
|
|
37
|
+
}
|
|
38
|
+
declare const Header: React.FC<HeaderProps>;
|
|
39
|
+
export default Header;
|
|
@@ -0,0 +1,166 @@
|
|
|
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 _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; }
|
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
4
|
+
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); }
|
|
5
|
+
import React from "react";
|
|
6
|
+
|
|
7
|
+
// Only components hsu-ui does not provide fall back to antd; Button comes from hsu-ui
|
|
8
|
+
import { Avatar, Layout, Popover, Segmented, Space } from "antd";
|
|
9
|
+
import { MenuFoldOutlined, MenuUnfoldOutlined, UserOutlined } from "@ant-design/icons";
|
|
10
|
+
import Button from "../../components/Button";
|
|
11
|
+
import Icon from "../../components/Icon";
|
|
12
|
+
import classNames from "classnames";
|
|
13
|
+
import styles from "./index.module.scss";
|
|
14
|
+
import { observer } from "mobx-react-lite";
|
|
15
|
+
import Breadcrumb from "../Breadcrumb";
|
|
16
|
+
import Menu from "../Menu";
|
|
17
|
+
import ThemeStore from "../Theme/ThemeStore";
|
|
18
|
+
import I18nStore from "../I18n/I18nStore";
|
|
19
|
+
// 用户信息由 App 传进来。这里原本是 `import { getUserInfo } from "@/utils/auth"` ——
|
|
20
|
+
// 那是消费方自己的鉴权模块,组件不该认识它。改成 props 之后本组件只关心「显示什么名字」。
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 账号动作(改密 / 退出)由 App 传进来,本组件只认这个形状、不认来源。
|
|
24
|
+
*
|
|
25
|
+
* 别把 `PwdChange` 或 `LoginStore` 搬进来——看着它们该跟用户菜单待在一起,
|
|
26
|
+
* 但会同时踩两条:
|
|
27
|
+
* 1. `layout/` 反向 import `@/pages/…`(共享层依赖页面私有目录);
|
|
28
|
+
* 2. `PwdChange` 用 `FormItem`,而 `FormItem` 静态引入全部字段渲染器
|
|
29
|
+
* (wangeditor / codemirror / pdfjs / xlsx)。它现在由 App 以 `lazy()`
|
|
30
|
+
* +「打开才挂载」持有,搬进来很容易顺手写成静态 import,那些库就又钉回首屏了。
|
|
31
|
+
*/
|
|
32
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
33
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
34
|
+
var Header = observer(function (props) {
|
|
35
|
+
var _nickname$;
|
|
36
|
+
var router = props.router,
|
|
37
|
+
collapsed = props.collapsed,
|
|
38
|
+
onToggleCollapsed = props.onToggleCollapsed,
|
|
39
|
+
onChildItems = props.onChildItems,
|
|
40
|
+
menu = props.menu,
|
|
41
|
+
user = props.user,
|
|
42
|
+
title = props.title,
|
|
43
|
+
smallTitle = props.smallTitle;
|
|
44
|
+
var layout = ThemeStore.layout,
|
|
45
|
+
headerTheme = ThemeStore.headerTheme,
|
|
46
|
+
appearance = ThemeStore.appearance,
|
|
47
|
+
setAppearance = ThemeStore.setAppearance;
|
|
48
|
+
var locale = I18nStore.locale,
|
|
49
|
+
setLocale = I18nStore.setLocale;
|
|
50
|
+
|
|
51
|
+
// Appearance + language are grouped into the user dropdown; bilingual labels follow the current language
|
|
52
|
+
var isEn = locale === "en-US";
|
|
53
|
+
var appearanceOptions = [{
|
|
54
|
+
label: isEn ? "Light" : "浅色",
|
|
55
|
+
value: "light"
|
|
56
|
+
}, {
|
|
57
|
+
label: isEn ? "Dark" : "深色",
|
|
58
|
+
value: "dark"
|
|
59
|
+
}, {
|
|
60
|
+
label: isEn ? "System" : "跟随",
|
|
61
|
+
value: "system"
|
|
62
|
+
}];
|
|
63
|
+
var languageOptions = [{
|
|
64
|
+
label: "中文",
|
|
65
|
+
value: "zh-CN"
|
|
66
|
+
}, {
|
|
67
|
+
label: "English",
|
|
68
|
+
value: "en-US"
|
|
69
|
+
}];
|
|
70
|
+
|
|
71
|
+
// Nav (header/sidebar) light/dark: light -> light, dark/theme-colored -> dark
|
|
72
|
+
var navTheme = headerTheme === "light" ? "light" : "dark";
|
|
73
|
+
var nickname = user === null || user === void 0 ? void 0 : user.nickname;
|
|
74
|
+
return /*#__PURE__*/_jsxs(Layout.Header, {
|
|
75
|
+
className: classNames(styles.header, styles[headerTheme]),
|
|
76
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
77
|
+
className: styles.headerLeft,
|
|
78
|
+
children: [["left", "mixed"].includes(layout) ? /*#__PURE__*/_jsx("div", {
|
|
79
|
+
className: classNames(styles.title, _defineProperty({}, styles.titleCollapsed, collapsed)),
|
|
80
|
+
children: collapsed ? smallTitle !== null && smallTitle !== void 0 ? smallTitle : title : title
|
|
81
|
+
}) : /*#__PURE__*/_jsx("div", {
|
|
82
|
+
className: classNames(styles.title, styles.titleTop),
|
|
83
|
+
children: title
|
|
84
|
+
}), ["left", "mixed"].includes(layout) && /*#__PURE__*/_jsx(Button, {
|
|
85
|
+
className: styles.collapsed,
|
|
86
|
+
type: "text",
|
|
87
|
+
icon: collapsed ? /*#__PURE__*/_jsx(MenuUnfoldOutlined, {}) : /*#__PURE__*/_jsx(MenuFoldOutlined, {}),
|
|
88
|
+
onClick: onToggleCollapsed
|
|
89
|
+
}), ["left"].includes(layout) && /*#__PURE__*/_jsx(Breadcrumb, {
|
|
90
|
+
router: router,
|
|
91
|
+
className: styles.breadcrumb
|
|
92
|
+
}), ["top", "mixed"].includes(layout) && /*#__PURE__*/_jsx(Menu, {
|
|
93
|
+
router: router,
|
|
94
|
+
mode: "horizontal",
|
|
95
|
+
theme: navTheme,
|
|
96
|
+
onlyLvOneMenu: layout === "mixed",
|
|
97
|
+
getCurrChildItems: onChildItems
|
|
98
|
+
})]
|
|
99
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
100
|
+
className: styles.headerRight,
|
|
101
|
+
children: /*#__PURE__*/_jsx(Popover, {
|
|
102
|
+
classNames: {
|
|
103
|
+
root: styles.userPopover
|
|
104
|
+
},
|
|
105
|
+
placement: "bottomRight",
|
|
106
|
+
content: /*#__PURE__*/_jsxs("div", {
|
|
107
|
+
className: styles.userMenuPanel,
|
|
108
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
109
|
+
className: styles.settingRow,
|
|
110
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
111
|
+
className: styles.settingLabel,
|
|
112
|
+
children: isEn ? "Appearance" : "外观"
|
|
113
|
+
}), /*#__PURE__*/_jsx(Segmented, {
|
|
114
|
+
size: "small",
|
|
115
|
+
value: appearance,
|
|
116
|
+
options: appearanceOptions,
|
|
117
|
+
onChange: function onChange(v) {
|
|
118
|
+
return setAppearance(v);
|
|
119
|
+
}
|
|
120
|
+
})]
|
|
121
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
122
|
+
className: styles.settingRow,
|
|
123
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
124
|
+
className: styles.settingLabel,
|
|
125
|
+
children: isEn ? "Language" : "语言"
|
|
126
|
+
}), /*#__PURE__*/_jsx(Segmented, {
|
|
127
|
+
size: "small",
|
|
128
|
+
value: locale,
|
|
129
|
+
options: languageOptions,
|
|
130
|
+
onChange: function onChange(v) {
|
|
131
|
+
return setLocale(v);
|
|
132
|
+
}
|
|
133
|
+
})]
|
|
134
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
135
|
+
className: styles.settingDivider
|
|
136
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
137
|
+
className: styles.menu,
|
|
138
|
+
children: menu === null || menu === void 0 ? void 0 : menu.map(function (item, index) {
|
|
139
|
+
return /*#__PURE__*/_jsx(Button, {
|
|
140
|
+
className: classNames(_defineProperty({}, styles.menuBtnDanger, item.danger)),
|
|
141
|
+
icon: /*#__PURE__*/_jsx(Icon, {
|
|
142
|
+
icon: item.icon
|
|
143
|
+
}),
|
|
144
|
+
onClick: item.onclick,
|
|
145
|
+
type: "text",
|
|
146
|
+
children: item.title
|
|
147
|
+
}, index);
|
|
148
|
+
})
|
|
149
|
+
})]
|
|
150
|
+
}),
|
|
151
|
+
children: /*#__PURE__*/_jsxs(Space, {
|
|
152
|
+
className: styles.user,
|
|
153
|
+
children: [/*#__PURE__*/_jsx(Avatar, {
|
|
154
|
+
style: {
|
|
155
|
+
backgroundColor: "#1677ff",
|
|
156
|
+
verticalAlign: "middle"
|
|
157
|
+
},
|
|
158
|
+
icon: nickname ? undefined : /*#__PURE__*/_jsx(UserOutlined, {}),
|
|
159
|
+
children: nickname === null || nickname === void 0 || (_nickname$ = nickname[0]) === null || _nickname$ === void 0 ? void 0 : _nickname$.toUpperCase()
|
|
160
|
+
}), nickname]
|
|
161
|
+
})
|
|
162
|
+
})
|
|
163
|
+
})]
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
export default Header;
|