@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
|
@@ -232,4 +232,13 @@ var Table = function Table(props) {
|
|
|
232
232
|
})
|
|
233
233
|
});
|
|
234
234
|
};
|
|
235
|
+
Table.Summary = AntdTable.Summary;
|
|
236
|
+
Table.Column = AntdTable.Column;
|
|
237
|
+
Table.ColumnGroup = AntdTable.ColumnGroup;
|
|
238
|
+
Table.EXPAND_COLUMN = AntdTable.EXPAND_COLUMN;
|
|
239
|
+
Table.SELECTION_COLUMN = AntdTable.SELECTION_COLUMN;
|
|
240
|
+
Table.SELECTION_ALL = AntdTable.SELECTION_ALL;
|
|
241
|
+
Table.SELECTION_INVERT = AntdTable.SELECTION_INVERT;
|
|
242
|
+
Table.SELECTION_NONE = AntdTable.SELECTION_NONE;
|
|
243
|
+
Table.Drag = Drag;
|
|
235
244
|
export default Table;
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
padding: var(--th-padding);
|
|
26
26
|
|
|
27
27
|
&:global(.ant-table-column-has-sorters) {
|
|
28
|
-
background: var(--
|
|
28
|
+
background: var(--vita-muted);
|
|
29
29
|
|
|
30
30
|
&:hover {
|
|
31
|
-
background: var(--
|
|
31
|
+
background: var(--vita-muted);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -61,11 +61,11 @@
|
|
|
61
61
|
|
|
62
62
|
// 排序列:antd 会用 bodySortBg 单独给该列的单元格上底色,这里抹掉,
|
|
63
63
|
// 让「哪一列在排序」只由表头的高亮与箭头表达。
|
|
64
|
-
// 只抹静止态——从前连悬浮态一起抹掉、再补一支 --
|
|
64
|
+
// 只抹静止态——从前连悬浮态一起抹掉、再补一支 --vita-muted 回来,
|
|
65
65
|
// 而整行其余单元格走的是 antd 的 rowHoverBg,两支值并不相等(库自带调色板下
|
|
66
66
|
// 是 #fafbfc vs #f6f7f9),悬浮一行时排序列会比其余列深一块、整行裂成两截。
|
|
67
67
|
// 排除掉悬浮态后,该单元格自然落回 antd 的行悬浮规则,与整行始终同色,
|
|
68
|
-
// 且不依赖消费方是否同步设置了 --
|
|
68
|
+
// 且不依赖消费方是否同步设置了 --vita-muted / rowHoverBg。
|
|
69
69
|
&:global(.ant-table-column-sort):not(:global(.ant-table-cell-row-hover)) {
|
|
70
70
|
background: transparent;
|
|
71
71
|
}
|
|
@@ -74,10 +74,10 @@
|
|
|
74
74
|
&:global(.ant-table-row-selected) {
|
|
75
75
|
:global(.ant-table-cell) {
|
|
76
76
|
&:global(.ant-table-column-sort) {
|
|
77
|
-
background: color-mix(in srgb, var(--primary
|
|
77
|
+
background: color-mix(in srgb, var(--vita-primary) 12%, transparent);
|
|
78
78
|
|
|
79
79
|
&:global(.ant-table-cell-row-hover) {
|
|
80
|
-
background: color-mix(in srgb, var(--primary
|
|
80
|
+
background: color-mix(in srgb, var(--vita-primary) 22%, transparent);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
}
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
|
|
131
131
|
:global(.ant-checkbox) {
|
|
132
132
|
&:global(.ant-checkbox-checked) {
|
|
133
|
-
|
|
133
|
+
& {
|
|
134
134
|
&::after {
|
|
135
135
|
top: 45%;
|
|
136
136
|
inset-inline-start: 25%;
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
|
|
146
146
|
// Table
|
|
147
147
|
.antdTable {
|
|
148
|
-
border-color: var(--
|
|
148
|
+
border-color: var(--vita-border-weak);
|
|
149
149
|
|
|
150
150
|
*:not(:global(.ant-table-cell) *) {
|
|
151
151
|
border-color: inherit !important;
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
:global(.ant-table-container) {
|
|
175
175
|
:global(.ant-table-content) {
|
|
176
176
|
> table {
|
|
177
|
-
border-left: 1px solid var(--
|
|
177
|
+
border-left: 1px solid var(--vita-border-weak);
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
}
|
|
@@ -239,23 +239,23 @@
|
|
|
239
239
|
:global(.ant-table-container) {
|
|
240
240
|
> :global(.ant-table-header) {
|
|
241
241
|
> table {
|
|
242
|
-
border-radius:
|
|
243
|
-
border-left: 1px solid var(--
|
|
242
|
+
border-radius: var(--vita-radius-sm) var(--vita-radius-sm) 0 0;
|
|
243
|
+
border-left: 1px solid var(--vita-border-weak);
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
|
|
247
247
|
> :global(.ant-table-body) {
|
|
248
248
|
> table {
|
|
249
249
|
border-radius: 0px !important;
|
|
250
|
-
border-left: 1px solid var(--
|
|
250
|
+
border-left: 1px solid var(--vita-border-weak);
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
253
|
|
|
254
254
|
> :global(.ant-table-summary) {
|
|
255
255
|
> table {
|
|
256
256
|
border-radius: 0px !important;
|
|
257
|
-
border-left: 1px solid var(--
|
|
258
|
-
border-top: 1px solid var(--
|
|
257
|
+
border-left: 1px solid var(--vita-border-weak);
|
|
258
|
+
border-top: 1px solid var(--vita-border-weak);
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
261
|
}
|
|
@@ -16,6 +16,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
16
16
|
import { Tooltip } from "antd";
|
|
17
17
|
import { useEffect, useRef, useState } from "react";
|
|
18
18
|
import cssStyles from "./index.module.scss";
|
|
19
|
+
import { mergeSemantic } from "../../utils/semantic";
|
|
19
20
|
|
|
20
21
|
// Default Tooltip width
|
|
21
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -190,14 +191,17 @@ var TextEllipsis = function TextEllipsis(_ref) {
|
|
|
190
191
|
placement: "bottomLeft"
|
|
191
192
|
}, restTooltipConfig), {}, {
|
|
192
193
|
title: isOverflow && !disabled ? tooltipTitle : undefined,
|
|
193
|
-
styles:
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
194
|
+
styles: mergeSemantic(styles, function (outer) {
|
|
195
|
+
return _objectSpread({
|
|
196
|
+
// v5 called this slot `body`; v6 renamed it to `container`
|
|
197
|
+
container: {
|
|
198
|
+
width: tooltipWidth,
|
|
199
|
+
overflow: "auto",
|
|
200
|
+
maxHeight: "300px",
|
|
201
|
+
whiteSpace: "pre-wrap"
|
|
202
|
+
}
|
|
203
|
+
}, outer);
|
|
204
|
+
}),
|
|
201
205
|
children: content
|
|
202
206
|
}));
|
|
203
207
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TreeProps as AntdTreeProps } from "antd";
|
|
1
|
+
import { Tree as AntdTree, TreeProps as AntdTreeProps } from "antd";
|
|
2
2
|
import React, { ReactNode, Key } from "react";
|
|
3
3
|
import { InputProps } from "../Input";
|
|
4
4
|
import { ButtonProps } from "../Button";
|
|
@@ -44,5 +44,11 @@ export interface TreeProps extends Omit<AntdTreeProps, "treeData" | "loadData" |
|
|
|
44
44
|
allowDeselect?: boolean;
|
|
45
45
|
titleSearchBarClassName?: string;
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
interface TreeFC extends React.FC<TreeProps> {
|
|
48
|
+
/** antd 的目录树(带文件夹图标与目录态选中) */
|
|
49
|
+
DirectoryTree: typeof AntdTree.DirectoryTree;
|
|
50
|
+
/** antd 的 `Tree.TreeNode`,供 JSX 写法(本库更推荐用 `treeData`) */
|
|
51
|
+
TreeNode: typeof AntdTree.TreeNode;
|
|
52
|
+
}
|
|
53
|
+
declare const Tree: TreeFC;
|
|
48
54
|
export default Tree;
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
height: 100%;
|
|
12
12
|
min-height: 0px !important;
|
|
13
13
|
|
|
14
|
-
background: var(--
|
|
14
|
+
background: var(--vita-surface);
|
|
15
15
|
|
|
16
|
-
border-radius:
|
|
16
|
+
border-radius: var(--vita-radius);
|
|
17
17
|
|
|
18
18
|
.title_search {
|
|
19
19
|
display: flex;
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
.search {
|
|
38
|
-
height:
|
|
38
|
+
height: var(--vita-control-height);
|
|
39
39
|
|
|
40
40
|
.searchIcon {
|
|
41
41
|
font-size: 16px;
|
|
@@ -58,11 +58,11 @@
|
|
|
58
58
|
|
|
59
59
|
:global(.ant-tree-treenode) {
|
|
60
60
|
&:hover {
|
|
61
|
-
background: var(--
|
|
61
|
+
background: var(--vita-muted);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
&:has(> :global(.ant-tree-node-selected)) {
|
|
65
|
-
background-color: color-mix(in srgb, var(--primary
|
|
65
|
+
background-color: color-mix(in srgb, var(--vita-primary) 12%, transparent);
|
|
66
66
|
|
|
67
67
|
:global(.ant-tree-node-selected) {
|
|
68
68
|
background-color: transparent;
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
&.legacyHasSelectedNodeBackground {
|
|
132
132
|
.treeContainer {
|
|
133
133
|
:global(.ant-tree-treenode):global(.ant-tree-treenode-selected) {
|
|
134
|
-
background-color: color-mix(in srgb, var(--primary
|
|
134
|
+
background-color: color-mix(in srgb, var(--vita-primary) 12%, transparent);
|
|
135
135
|
|
|
136
136
|
:global(.ant-tree-node-selected) {
|
|
137
137
|
background-color: transparent;
|
|
@@ -68,10 +68,10 @@ export var UploadedItem = function UploadedItem(_ref) {
|
|
|
68
68
|
className: classNames(styles.fileItem, listProps === null || listProps === void 0 ? void 0 : listProps.item),
|
|
69
69
|
children: [/*#__PURE__*/_jsx(Tooltip, {
|
|
70
70
|
title: name,
|
|
71
|
-
color: "var(--
|
|
71
|
+
color: "var(--vita-muted)",
|
|
72
72
|
styles: {
|
|
73
|
-
|
|
74
|
-
color: "var(--
|
|
73
|
+
container: {
|
|
74
|
+
color: "var(--vita-foreground)",
|
|
75
75
|
padding: "6px 16px"
|
|
76
76
|
}
|
|
77
77
|
},
|
|
@@ -26,10 +26,10 @@ export var UploadingItem = function UploadingItem(_ref) {
|
|
|
26
26
|
className: styles.uploading,
|
|
27
27
|
children: [/*#__PURE__*/_jsx(Tooltip, {
|
|
28
28
|
title: name,
|
|
29
|
-
color: "var(--
|
|
29
|
+
color: "var(--vita-muted)",
|
|
30
30
|
styles: {
|
|
31
|
-
|
|
32
|
-
color: "var(--
|
|
31
|
+
container: {
|
|
32
|
+
color: "var(--vita-foreground)",
|
|
33
33
|
padding: "6px 16px"
|
|
34
34
|
}
|
|
35
35
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AxiosRequestConfig } from "axios";
|
|
2
2
|
import { RcFile } from "antd/es/upload";
|
|
3
3
|
import { UploadingList } from "..";
|
|
4
|
-
import type { UploadRequestOption } from "
|
|
4
|
+
import type { UploadRequestOption } from "../../../types/antd";
|
|
5
5
|
interface NormalUploadOptions {
|
|
6
6
|
file: RcFile;
|
|
7
7
|
action: string;
|
|
@@ -1,4 +1,52 @@
|
|
|
1
1
|
import { toMB } from "./toMB";
|
|
2
|
+
/**
|
|
3
|
+
* 文件是否命中 accept —— 与 antd 保持一致的语义。
|
|
4
|
+
*
|
|
5
|
+
* 此前是把 accept 拼进正则:`new RegExp(`(${accept.replace(/,/g, "|")})$`)`,有两个问题:
|
|
6
|
+
* 字符没转义(`.png` 里的 `.` 是「任意字符」,实测放行了 `axpng`),且 HTML 允许的 MIME
|
|
7
|
+
* 形式里 `image/*` 的 `*` 会被当成量词(实测把 photo.png 判成了格式错误)。把外部字符串
|
|
8
|
+
* 拼进正则本身也是 ReDoS 入口。
|
|
9
|
+
*
|
|
10
|
+
* 这里照抄 @rc-component/upload 的 attr-accept 语义,而不是另写一套:这个函数是上传前的
|
|
11
|
+
* 预校验,antd 自己的 accept 过滤也在跑,两边规则一旦不一致,就会出现「antd 放行、我们拦下」
|
|
12
|
+
* 或反过来的割裂。逐条 some(),任一命中即通过,全不命中即拒绝 —— 不做额外兜底。
|
|
13
|
+
*/
|
|
14
|
+
var matchesAccept = function matchesAccept(file, accept) {
|
|
15
|
+
var items = accept.split(",");
|
|
16
|
+
var fileName = file.name || "";
|
|
17
|
+
var mimeType = file.type || "";
|
|
18
|
+
var baseMimeType = mimeType.replace(/\/.*$/, "");
|
|
19
|
+
return items.some(function (item) {
|
|
20
|
+
var validType = item.trim();
|
|
21
|
+
if (!validType) return false;
|
|
22
|
+
|
|
23
|
+
// `*` / `*/*`:全部放行
|
|
24
|
+
if (/^\*(\/\*)?$/.test(validType)) return true;
|
|
25
|
+
|
|
26
|
+
// 扩展名。jpg 与 jpeg 互认,与 attr-accept 一致
|
|
27
|
+
if (validType.charAt(0) === ".") {
|
|
28
|
+
var lowerName = fileName.toLowerCase();
|
|
29
|
+
var lowerType = validType.toLowerCase();
|
|
30
|
+
var affixes = lowerType === ".jpg" || lowerType === ".jpeg" ? [".jpg", ".jpeg"] : [lowerType];
|
|
31
|
+
return affixes.some(function (affix) {
|
|
32
|
+
return lowerName.endsWith(affix);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// `image/*` 这类通配
|
|
37
|
+
if (/\/\*$/.test(validType)) {
|
|
38
|
+
return baseMimeType === validType.replace(/\/.*$/, "");
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// MIME 全等
|
|
42
|
+
if (mimeType === validType) return true;
|
|
43
|
+
|
|
44
|
+
// `png` 这种没有点也没有斜杠的写法是无效 accept,attr-accept 选择跳过而不是拦下
|
|
45
|
+
if (/^\w+$/.test(validType)) return true;
|
|
46
|
+
return false;
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
|
|
2
50
|
/**
|
|
3
51
|
* Validate file format and size
|
|
4
52
|
*/
|
|
@@ -8,8 +56,7 @@ export function validateFile(_ref) {
|
|
|
8
56
|
size = _ref.size,
|
|
9
57
|
en = _ref.en;
|
|
10
58
|
if (accept) {
|
|
11
|
-
|
|
12
|
-
if (!fileRegex.test(file.name.toLowerCase())) {
|
|
59
|
+
if (!matchesAccept(file, accept)) {
|
|
13
60
|
return {
|
|
14
61
|
valid: false,
|
|
15
62
|
error: new Error(en ? "File format error, please upload ".concat(accept, " file") : "\u6587\u4EF6\u683C\u5F0F\u9519\u8BEF\uFF0C\u8BF7\u4E0A\u4F20 ".concat(accept, " \u6587\u4EF6"))
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UploadProps as AntdUploadProps, UploadFile } from "antd";
|
|
1
|
+
import { Upload as AntdUpload, UploadProps as AntdUploadProps, UploadFile } from "antd";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Canceler } from "axios";
|
|
4
4
|
import { ButtonProps, ProgressProps } from "antd";
|
|
@@ -38,5 +38,11 @@ export interface UploadProps extends Omit<AntdUploadProps, "action" | "data"> {
|
|
|
38
38
|
};
|
|
39
39
|
en?: boolean;
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
interface UploadFC extends React.FC<UploadProps> {
|
|
42
|
+
/** antd 的拖拽上传区 */
|
|
43
|
+
Dragger: typeof AntdUpload.Dragger;
|
|
44
|
+
/** `beforeUpload` 返回它表示「跳过这个文件且不进 fileList」 */
|
|
45
|
+
LIST_IGNORE: typeof AntdUpload.LIST_IGNORE;
|
|
46
|
+
}
|
|
47
|
+
declare const Upload: UploadFC;
|
|
42
48
|
export default Upload;
|
|
@@ -52,6 +52,11 @@ var Upload = function Upload(props) {
|
|
|
52
52
|
onDownload = props.onDownload,
|
|
53
53
|
onPreview = props.onPreview,
|
|
54
54
|
uploadConfig = _objectWithoutProperties(props, _excluded);
|
|
55
|
+
|
|
56
|
+
// antd v6 widened `accept` to `string | { format: string; filter?: ... }`. This component's own
|
|
57
|
+
// extension check (validateFile) only understands the comma-separated string, so read the format
|
|
58
|
+
// out of the object form; antd still applies the full config to the native file input.
|
|
59
|
+
var acceptFormat = typeof accept === "string" ? accept : accept.format;
|
|
55
60
|
var _useUploadFileList = useUploadFileList({
|
|
56
61
|
fileList: fileList,
|
|
57
62
|
onChange: onChange,
|
|
@@ -98,7 +103,7 @@ var Upload = function Upload(props) {
|
|
|
98
103
|
chunkNum: chunkNum,
|
|
99
104
|
data: data,
|
|
100
105
|
headers: headers,
|
|
101
|
-
accept:
|
|
106
|
+
accept: acceptFormat,
|
|
102
107
|
size: size,
|
|
103
108
|
en: en,
|
|
104
109
|
uploadingList: uploadingList,
|
|
@@ -117,7 +122,7 @@ var Upload = function Upload(props) {
|
|
|
117
122
|
return function (_x) {
|
|
118
123
|
return _ref.apply(this, arguments);
|
|
119
124
|
};
|
|
120
|
-
}(), [chunkAction, mergeChunkAction, chunkNum, data, headers,
|
|
125
|
+
}(), [chunkAction, mergeChunkAction, chunkNum, data, headers, acceptFormat, size, en, uploadingList, setUploadingList, onUploadSuccess]);
|
|
121
126
|
|
|
122
127
|
// Normal upload
|
|
123
128
|
var customRequest = useCallback( /*#__PURE__*/function () {
|
|
@@ -144,7 +149,7 @@ var Upload = function Upload(props) {
|
|
|
144
149
|
action: action,
|
|
145
150
|
data: data,
|
|
146
151
|
headers: headers,
|
|
147
|
-
accept:
|
|
152
|
+
accept: acceptFormat,
|
|
148
153
|
size: size,
|
|
149
154
|
en: en,
|
|
150
155
|
uploadingList: uploadingList,
|
|
@@ -163,7 +168,7 @@ var Upload = function Upload(props) {
|
|
|
163
168
|
return function (_x2) {
|
|
164
169
|
return _ref2.apply(this, arguments);
|
|
165
170
|
};
|
|
166
|
-
}(), [action, data, headers,
|
|
171
|
+
}(), [action, data, headers, acceptFormat, size, en, uploadingList, setUploadingList, onUploadSuccess]);
|
|
167
172
|
var handleChange = function handleChange(_ref3) {
|
|
168
173
|
var file = _ref3.file,
|
|
169
174
|
newFileList = _ref3.fileList;
|
|
@@ -245,4 +250,6 @@ var Upload = function Upload(props) {
|
|
|
245
250
|
}))]
|
|
246
251
|
});
|
|
247
252
|
};
|
|
253
|
+
Upload.Dragger = AntdUpload.Dragger;
|
|
254
|
+
Upload.LIST_IGNORE = AntdUpload.LIST_IGNORE;
|
|
248
255
|
export default Upload;
|
|
@@ -1,17 +1,49 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { type ThemeConfig } from "antd";
|
|
2
3
|
import { RequestImpl } from "../request";
|
|
3
4
|
export interface ConfigProviderProps {
|
|
4
5
|
/** Current user's permission code list; when provided, usePermissions / hasPermi validate against it. If omitted, everything is allowed by default */
|
|
5
6
|
permissions?: string[] | null;
|
|
6
7
|
/** Inject the HTTP request implementation, used by smart components such as ImportForm */
|
|
7
8
|
request?: Partial<RequestImpl>;
|
|
9
|
+
/**
|
|
10
|
+
* Brand colour. Sets both halves of the token layer at once: the `--vita-primary` CSS variable
|
|
11
|
+
* (via `--primary-color`, so pre-2.0 overrides keep working) and antd's `colorPrimary`.
|
|
12
|
+
*
|
|
13
|
+
* Setting the CSS variable by hand only moves this library's own styles — antd derives a
|
|
14
|
+
* 10-step palette from the JS token and cannot read a `var()`. Going through this prop is what
|
|
15
|
+
* keeps the two in step.
|
|
16
|
+
*/
|
|
17
|
+
primaryColor?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Force light/dark instead of following `html[data-theme]` / the OS preference.
|
|
20
|
+
* The CSS variables follow the same signals on their own.
|
|
21
|
+
*/
|
|
22
|
+
dark?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Extra antd theme config, merged on top of the generated one — escape hatch for a consumer
|
|
25
|
+
* that wants a token this library does not map.
|
|
26
|
+
*/
|
|
27
|
+
theme?: ThemeConfig;
|
|
28
|
+
/**
|
|
29
|
+
* Set to `false` to stop managing antd's theme entirely, leaving it to the host app.
|
|
30
|
+
* Components this library wraps still follow the `--vita-*` variables; antd components it does
|
|
31
|
+
* not wrap will fall back to antd's stock look.
|
|
32
|
+
*/
|
|
33
|
+
antdTheme?: boolean;
|
|
8
34
|
children?: React.ReactNode;
|
|
9
35
|
}
|
|
10
36
|
/**
|
|
11
|
-
* Hsu UI global configuration:
|
|
37
|
+
* Hsu UI global configuration: permissions, the request implementation, and the design tokens.
|
|
38
|
+
*
|
|
39
|
+
* On the theme: the `--vita-*` CSS variables cover everything this library styles itself, but not
|
|
40
|
+
* the antd components it merely re-exports or that a page uses directly. Feeding antd's
|
|
41
|
+
* `theme.token` from the very same tokens is what makes an unwrapped `<Steps />` land on the same
|
|
42
|
+
* palette, radii and type scale as a wrapped `<Table />` — without this library having to wrap all
|
|
43
|
+
* 75 antd components to keep the look consistent.
|
|
12
44
|
*
|
|
13
45
|
* @example
|
|
14
|
-
* <ConfigProvider permissions={perms} request={{ get, post, del, put }}>
|
|
46
|
+
* <ConfigProvider permissions={perms} request={{ get, post, del, put }} primaryColor="#7c3aed">
|
|
15
47
|
* <App />
|
|
16
48
|
* </ConfigProvider>
|
|
17
49
|
*/
|
|
@@ -1,12 +1,29 @@
|
|
|
1
|
-
|
|
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 React, { useEffect, useMemo } from "react";
|
|
8
|
+
import { ConfigProvider as AntdConfigProvider, theme as antdTheme } from "antd";
|
|
2
9
|
import { PermissionsContent } from "../hooks/usePermissions";
|
|
10
|
+
import useIsDark from "../hooks/useIsDark";
|
|
3
11
|
import { configureRequest } from "../request";
|
|
12
|
+
import { toAntdComponents, toAntdTheme } from "../styles/tokens";
|
|
13
|
+
import { FeedbackHolder } from "../feedback";
|
|
4
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
16
|
/**
|
|
6
|
-
* Hsu UI global configuration:
|
|
17
|
+
* Hsu UI global configuration: permissions, the request implementation, and the design tokens.
|
|
18
|
+
*
|
|
19
|
+
* On the theme: the `--vita-*` CSS variables cover everything this library styles itself, but not
|
|
20
|
+
* the antd components it merely re-exports or that a page uses directly. Feeding antd's
|
|
21
|
+
* `theme.token` from the very same tokens is what makes an unwrapped `<Steps />` land on the same
|
|
22
|
+
* palette, radii and type scale as a wrapped `<Table />` — without this library having to wrap all
|
|
23
|
+
* 75 antd components to keep the look consistent.
|
|
7
24
|
*
|
|
8
25
|
* @example
|
|
9
|
-
* <ConfigProvider permissions={perms} request={{ get, post, del, put }}>
|
|
26
|
+
* <ConfigProvider permissions={perms} request={{ get, post, del, put }} primaryColor="#7c3aed">
|
|
10
27
|
* <App />
|
|
11
28
|
* </ConfigProvider>
|
|
12
29
|
*/
|
|
@@ -14,6 +31,11 @@ var ConfigProvider = function ConfigProvider(_ref) {
|
|
|
14
31
|
var _ref$permissions = _ref.permissions,
|
|
15
32
|
permissions = _ref$permissions === void 0 ? null : _ref$permissions,
|
|
16
33
|
request = _ref.request,
|
|
34
|
+
primaryColor = _ref.primaryColor,
|
|
35
|
+
dark = _ref.dark,
|
|
36
|
+
theme = _ref.theme,
|
|
37
|
+
_ref$antdTheme = _ref.antdTheme,
|
|
38
|
+
manageAntdTheme = _ref$antdTheme === void 0 ? true : _ref$antdTheme,
|
|
17
39
|
children = _ref.children;
|
|
18
40
|
// Inject synchronously during render so child components get the request implementation on their very first interaction
|
|
19
41
|
useMemo(function () {
|
|
@@ -24,9 +46,41 @@ var ConfigProvider = function ConfigProvider(_ref) {
|
|
|
24
46
|
permissions: permissions
|
|
25
47
|
};
|
|
26
48
|
}, [permissions]);
|
|
27
|
-
|
|
49
|
+
var detectedDark = useIsDark();
|
|
50
|
+
var isDark = dark !== null && dark !== void 0 ? dark : detectedDark;
|
|
51
|
+
var themeConfig = useMemo(function () {
|
|
52
|
+
return _objectSpread(_objectSpread({
|
|
53
|
+
algorithm: isDark ? antdTheme.darkAlgorithm : antdTheme.defaultAlgorithm
|
|
54
|
+
}, theme), {}, {
|
|
55
|
+
token: _objectSpread(_objectSpread({}, toAntdTheme({
|
|
56
|
+
dark: isDark,
|
|
57
|
+
primaryColor: primaryColor
|
|
58
|
+
})), theme === null || theme === void 0 ? void 0 : theme.token),
|
|
59
|
+
components: _objectSpread(_objectSpread({}, toAntdComponents()), theme === null || theme === void 0 ? void 0 : theme.components)
|
|
60
|
+
});
|
|
61
|
+
}, [isDark, primaryColor, theme]);
|
|
62
|
+
|
|
63
|
+
// Written onto <html> rather than a wrapper element: this provider usually sits at the very top
|
|
64
|
+
// of the tree, and slipping an extra div in there would change the layout of whatever it wraps.
|
|
65
|
+
// `--primary-color` rather than `--vita-primary` because the generated tokens make the latter
|
|
66
|
+
// point at the former, so writing the legacy name keeps both spellings working for consumers.
|
|
67
|
+
useEffect(function () {
|
|
68
|
+
if (!primaryColor || typeof document === "undefined") return;
|
|
69
|
+
var root = document.documentElement;
|
|
70
|
+
var previous = root.style.getPropertyValue("--primary-color");
|
|
71
|
+
root.style.setProperty("--primary-color", primaryColor);
|
|
72
|
+
return function () {
|
|
73
|
+
if (previous) root.style.setProperty("--primary-color", previous);else root.style.removeProperty("--primary-color");
|
|
74
|
+
};
|
|
75
|
+
}, [primaryColor]);
|
|
76
|
+
var tree = /*#__PURE__*/_jsxs(PermissionsContent.Provider, {
|
|
28
77
|
value: permissionsValue,
|
|
29
|
-
children: children
|
|
78
|
+
children: [/*#__PURE__*/_jsx(FeedbackHolder, {}), children]
|
|
79
|
+
});
|
|
80
|
+
if (!manageAntdTheme) return tree;
|
|
81
|
+
return /*#__PURE__*/_jsx(AntdConfigProvider, {
|
|
82
|
+
theme: themeConfig,
|
|
83
|
+
children: tree
|
|
30
84
|
});
|
|
31
85
|
};
|
|
32
86
|
export default ConfigProvider;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { HookAPI as ModalHookApi } from "antd/es/modal/useModal";
|
|
3
|
+
import type { MessageInstance } from "antd/es/message/interface";
|
|
4
|
+
import type { NotificationInstance } from "antd/es/notification/interface";
|
|
5
|
+
/**
|
|
6
|
+
* 捕获三个 hook 实例并渲染它们的 contextHolder。由 `ConfigProvider` 内部渲染,
|
|
7
|
+
* 消费方不需要自己挂。
|
|
8
|
+
*/
|
|
9
|
+
export declare const FeedbackHolder: React.FC;
|
|
10
|
+
/** 仅供测试 / 卸载时清理 */
|
|
11
|
+
export declare const resetFeedbackInstances: () => void;
|
|
12
|
+
/**
|
|
13
|
+
* 与 antd 的 `message` 同名同签名,区别是输出在 React 树内,会跟随主题。
|
|
14
|
+
* 直接把 `import { message } from "antd"` 换成从本库引入即可。
|
|
15
|
+
*/
|
|
16
|
+
export declare const message: MessageInstance;
|
|
17
|
+
/** 与 antd 的 `notification` 同名同签名,输出跟随主题 */
|
|
18
|
+
export declare const notification: NotificationInstance;
|
|
19
|
+
/** 与 antd 的 `Modal.confirm` 等同名同签名,输出跟随主题 */
|
|
20
|
+
export declare const modalFuncs: ModalHookApi;
|