@hsu-react/ui 0.0.13 → 0.0.15
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/LICENSE +21 -0
- package/README.md +11 -0
- package/es/components/Button/index.js +2 -2
- package/es/components/ChainGraph/ChainGraphServices/Edges/ArrowEdge.js +4 -4
- package/es/components/ChainGraph/ChainGraphServices/NodeEvents.js +3 -3
- package/es/components/ChainGraph/ChainGraphServices/RootNode.js +27 -27
- package/es/components/ChainGraph/ChainGraphServices/TreeNode.js +32 -32
- package/es/components/ChainGraph/ChainGraphServices/index.js +11 -11
- package/es/components/ChainGraph/_components/SearchSelect/index.module.scss +2 -2
- package/es/components/ChainGraph/_utils/findAncestorsOfNode.d.ts +5 -5
- package/es/components/ChainGraph/_utils/findAncestorsOfNode.js +12 -12
- package/es/components/ChainGraph/_utils/getTextSize.d.ts +4 -4
- package/es/components/ChainGraph/_utils/getTextSize.js +4 -4
- package/es/components/ChainGraph/_utils/styles.d.ts +3 -3
- package/es/components/ChainGraph/_utils/styles.js +3 -3
- package/es/components/ChainGraph/index.js +7 -7
- package/es/components/ChainGraph/index.module.scss +2 -2
- package/es/components/Chart/Bar/Bar3DOpt.d.ts +9 -9
- package/es/components/Chart/Bar/Bar3DOpt.js +29 -29
- package/es/components/Chart/Bar/index.d.ts +5 -5
- package/es/components/Chart/Bar/index.js +23 -23
- package/es/components/Chart/Bubble/index.d.ts +6 -6
- package/es/components/Chart/Bubble/index.js +41 -41
- package/es/components/Chart/Common/index.js +12 -12
- package/es/components/Chart/Gauge/index.js +11 -11
- package/es/components/Chart/Group/index.js +1 -1
- package/es/components/Chart/Heatmap/index.d.ts +12 -12
- package/es/components/Chart/Heatmap/index.js +24 -24
- package/es/components/Chart/Line/index.d.ts +5 -5
- package/es/components/Chart/Line/index.js +23 -23
- package/es/components/Chart/Pie/Pie3D/_hooks/index.js +14 -14
- package/es/components/Chart/Pie/Pie3D/_utils/label.js +30 -30
- package/es/components/Chart/Pie/index.d.ts +8 -8
- package/es/components/Chart/Pie/index.js +34 -34
- package/es/components/Chart/Polar/index.js +11 -11
- package/es/components/Chart/Radar/index.d.ts +8 -8
- package/es/components/Chart/Radar/index.js +7 -7
- package/es/components/Chart/Sankey/index.js +12 -12
- package/es/components/Chart/Tree/index.js +12 -12
- package/es/components/Chart/_utils/autoSmooth.d.ts +1 -1
- package/es/components/Chart/_utils/autoSmooth.js +2 -2
- package/es/components/Chart/_utils/bubble.js +8 -8
- package/es/components/Chart/_utils/cartesian.d.ts +4 -4
- package/es/components/Chart/_utils/cartesian.js +4 -4
- package/es/components/Chart/chartUtils/calculateAxisConfig.d.ts +4 -4
- package/es/components/Chart/chartUtils/calculateAxisConfig.js +16 -16
- package/es/components/Chart/chartUtils/chartTooltipFormatter.d.ts +1 -1
- package/es/components/Chart/chartUtils/chartTooltipFormatter.js +1 -1
- package/es/components/Chart/chartUtils/useDataZoomWindow.d.ts +7 -7
- package/es/components/Chart/chartUtils/useDataZoomWindow.js +4 -4
- package/es/components/Chart/chartUtils/useLegendSelection.d.ts +6 -6
- package/es/components/Chart/chartUtils/useLegendSelection.js +3 -3
- package/es/components/Chart/chartUtils/yAxisDisplayUnit.d.ts +4 -4
- package/es/components/Chart/chartUtils/yAxisDisplayUnit.js +4 -4
- package/es/components/Chart/index.d.ts +2 -2
- package/es/components/Chart/index.js +1 -1
- package/es/components/Chat/ChatHistory/_components/HistoryGroup/index.module.scss +1 -1
- package/es/components/Chat/ChatHistory/_components/HistoryItem/index.js +8 -8
- package/es/components/Chat/ChatHistory/_components/HistoryItem/index.module.scss +6 -6
- package/es/components/Chat/ChatHistory/_components/NewChatButton/index.module.scss +4 -4
- package/es/components/Chat/ChatHistory/_utils/index.d.ts +1 -1
- package/es/components/Chat/ChatHistory/_utils/index.js +1 -1
- package/es/components/Chat/ChatHistory/index.js +2 -2
- package/es/components/Chat/ChatHistory/index.module.scss +3 -3
- package/es/components/Chat/ChatInput/_components/AgentToggleButton/index.module.scss +8 -8
- package/es/components/Chat/ChatInput/_components/FileList/index.module.scss +3 -3
- package/es/components/Chat/ChatInput/_components/UploadButton/index.js +1 -1
- package/es/components/Chat/ChatInput/_utils/index.d.ts +3 -3
- package/es/components/Chat/ChatInput/_utils/index.js +3 -3
- package/es/components/Chat/ChatInput/index.d.ts +5 -5
- package/es/components/Chat/ChatInput/index.js +28 -23
- package/es/components/Chat/ChatInput/index.module.scss +4 -4
- package/es/components/Chat/ChatList/_components/Assistant/AssistantItem/_components/Copy/index.js +0 -1
- package/es/components/Chat/ChatList/_components/Assistant/AssistantItem/_components/Copy/index.module.scss +5 -5
- package/es/components/Chat/ChatList/_components/Assistant/AssistantItem/_components/LikeDislike/index.module.scss +5 -5
- package/es/components/Chat/ChatList/_components/Assistant/AssistantItem/_components/QuoteList/index.module.scss +7 -7
- package/es/components/Chat/ChatList/_components/Assistant/AssistantItem/index.js +5 -5
- package/es/components/Chat/ChatList/_components/Assistant/AssistantItem/index.module.scss +5 -5
- package/es/components/Chat/ChatList/_components/Assistant/index.module.scss +3 -3
- package/es/components/Chat/ChatList/_components/User/index.module.scss +6 -6
- package/es/components/Chat/ChatList/_hooks/useAssistantNavigation.d.ts +1 -1
- package/es/components/Chat/ChatList/_hooks/useAssistantNavigation.js +1 -1
- package/es/components/Chat/ChatList/_hooks/useCalculateRowIndex.js +1 -1
- package/es/components/Chat/ChatList/_utils/cleanRedactedReasoning.d.ts +3 -3
- package/es/components/Chat/ChatList/_utils/cleanRedactedReasoning.js +3 -3
- package/es/components/Checkbox/CheckboxGroup/index.js +6 -6
- package/es/components/Checkbox/CheckboxGroup/index.module.scss +3 -3
- package/es/components/Checkbox/index.module.scss +2 -2
- package/es/components/CodeMirror/index.d.ts +6 -6
- package/es/components/CodeMirror/index.js +7 -7
- package/es/components/CodeMirror/index.module.scss +4 -4
- package/es/components/CodeMirror/linters/errorTranslator.d.ts +1 -1
- package/es/components/CodeMirror/linters/errorTranslator.js +19 -19
- package/es/components/CodeMirror/linters/jsonLinter.d.ts +2 -2
- package/es/components/CodeMirror/linters/jsonLinter.js +9 -9
- package/es/components/CodeMirror/linters/sqlLinter.js +29 -29
- package/es/components/Copy/index.module.scss +3 -3
- package/es/components/DatePicker/defaultModalPickerGetPopupContainer.d.ts +2 -2
- package/es/components/DatePicker/defaultModalPickerGetPopupContainer.js +2 -2
- package/es/components/DatePicker/index.js +9 -9
- package/es/components/Editor/index.js +3 -3
- package/es/components/Editor/index.module.scss +2 -2
- package/es/components/FileCol/index.js +2 -2
- package/es/components/FilePreview/_components/BasePreview/index.module.scss +2 -2
- package/es/components/FilePreview/_components/PdfPreview/index.module.scss +3 -3
- package/es/components/FilePreview/_hooks/useXlsxData.d.ts +1 -1
- package/es/components/FilePreview/_hooks/useXlsxData.js +1 -1
- package/es/components/FilePreview/index.module.scss +2 -2
- package/es/components/Form/ModalForm/_hooks/useAdaptiveColumnNum.d.ts +7 -7
- package/es/components/Form/ModalForm/_hooks/useAdaptiveColumnNum.js +8 -8
- package/es/components/Form/ModalForm/_hooks/useColumnFormItems.d.ts +3 -3
- package/es/components/Form/ModalForm/_hooks/useColumnFormItems.js +18 -18
- package/es/components/Form/ModalForm/_hooks/useFormItems.d.ts +5 -5
- package/es/components/Form/ModalForm/_hooks/useFormItems.js +5 -5
- package/es/components/FormItem/FormCodeMirror/index.js +6 -6
- package/es/components/FormItem/FormInput/FormPasswordStrength/index.module.scss +5 -5
- package/es/components/FormItem/FormRadio/index.module.scss +2 -2
- package/es/components/FormItem/FormUpload/index.module.scss +13 -13
- package/es/components/FormItem/ItemContainer/index.d.ts +1 -1
- package/es/components/FormItem/ItemContainer/index.js +3 -3
- package/es/components/FormItem/ItemContainer/index.module.scss +4 -4
- package/es/components/FormItem/databaseTypeMapping.d.ts +23 -23
- package/es/components/FormItem/databaseTypeMapping.js +36 -36
- package/es/components/FormItem/index.js +12 -12
- package/es/components/Icon/index.js +4 -4
- package/es/components/Input/Number/index.js +6 -6
- package/es/components/Input/Number/index.module.scss +5 -5
- package/es/components/Input/Password/index.js +3 -3
- package/es/components/Input/Range/index.js +3 -3
- package/es/components/Input/Range/index.module.scss +2 -2
- package/es/components/Input/Search/index.js +3 -3
- package/es/components/Input/TextArea/index.js +6 -6
- package/es/components/Input/TextArea/index.module.scss +5 -5
- package/es/components/Input/index.js +14 -14
- package/es/components/Input/index.module.scss +2 -2
- package/es/components/Markdown/Editor/index.module.scss +3 -3
- package/es/components/Markdown/Views/ArtifactBlock.d.ts +5 -5
- package/es/components/Markdown/Views/ArtifactBlock.js +2 -2
- package/es/components/Markdown/Views/MermaidBlock.d.ts +2 -2
- package/es/components/Markdown/Views/MermaidBlock.js +5 -5
- package/es/components/Markdown/Views/blocks.module.scss +11 -11
- package/es/components/Markdown/Views/index.js +5 -5
- package/es/components/Markdown/Views/index.module.scss +1 -1
- package/es/components/Modal/_hooks/useModalDrag.d.ts +1 -1
- package/es/components/Modal/_hooks/useModalDrag.js +1 -1
- package/es/components/Modal/_hooks/useModalElements.d.ts +1 -1
- package/es/components/Modal/_hooks/useModalElements.js +1 -1
- package/es/components/Modal/_utils/calculatePosition.d.ts +7 -7
- package/es/components/Modal/_utils/calculatePosition.js +7 -7
- package/es/components/Modal/index.module.scss +1 -1
- package/es/components/Operate/_hooks/useOperateEllipsis.d.ts +5 -5
- package/es/components/Operate/_hooks/useOperateEllipsis.js +5 -5
- package/es/components/Operate/index.js +16 -16
- package/es/components/Panel/DefaultPanel/index.module.scss +1 -1
- package/es/components/Panel/IframePanel/index.module.scss +1 -1
- package/es/components/Panel/ListPanel/ListModalPanel/index.d.ts +2 -2
- package/es/components/Panel/ListPanel/ListModalPanel/index.js +3 -3
- package/es/components/Panel/ListPanel/ListModalPanel/index.module.scss +1 -1
- package/es/components/Panel/ListPanel/_components/ColumnMgt/index.js +1 -1
- package/es/components/Panel/ListPanel/index.d.ts +2 -2
- package/es/components/Panel/ListPanel/index.js +1 -1
- package/es/components/Panel/ListPanel/index.module.scss +5 -5
- package/es/components/Search/SearchAdvanced/index.d.ts +4 -4
- package/es/components/Search/SearchAdvanced/index.js +4 -4
- package/es/components/Search/SearchAdvanced/index.module.scss +2 -2
- package/es/components/Search/SearchCard/_components/OptionRow/ChildrenItems/index.js +8 -8
- package/es/components/Search/SearchCard/_components/OptionRow/Item/index.js +13 -13
- package/es/components/Search/SearchCard/_components/OptionRow/index.js +8 -8
- package/es/components/Search/SearchCard/_hooks/useSearchCardCollapse.d.ts +1 -1
- package/es/components/Search/SearchCard/_hooks/useSearchCardCollapse.js +1 -1
- package/es/components/Search/SearchCard/_hooks/useSearchCardMoreOptions.d.ts +1 -1
- package/es/components/Search/SearchCard/_hooks/useSearchCardMoreOptions.js +14 -14
- package/es/components/Search/SearchCard/_hooks/useSearchCardValue.d.ts +1 -1
- package/es/components/Search/SearchCard/_hooks/useSearchCardValue.js +5 -5
- package/es/components/Search/SearchCard/_utils/getRealValues.d.ts +1 -1
- package/es/components/Search/SearchCard/_utils/getRealValues.js +5 -5
- package/es/components/Search/SearchCard/_utils/hasSelectedChildren.d.ts +1 -1
- package/es/components/Search/SearchCard/_utils/hasSelectedChildren.js +3 -3
- package/es/components/Search/SearchCard/_utils/typeGuards.d.ts +1 -1
- package/es/components/Search/SearchCard/_utils/typeGuards.js +1 -1
- package/es/components/Search/SearchCard/_utils/updateRealValue.d.ts +1 -1
- package/es/components/Search/SearchCard/_utils/updateRealValue.js +11 -11
- package/es/components/Search/SearchCard/index.js +1 -1
- package/es/components/Search/SearchCard/index.module.scss +8 -8
- package/es/components/Search/SearchCollapsible/index.d.ts +4 -4
- package/es/components/Search/SearchCollapsible/index.js +6 -6
- package/es/components/Search/SearchCollapsible/index.module.scss +2 -2
- package/es/components/Search/SearchWithFilter/index.d.ts +4 -4
- package/es/components/Search/SearchWithFilter/index.js +4 -4
- package/es/components/Search/SearchWithFilter/index.module.scss +2 -2
- package/es/components/Search/SearchWithMore/index.d.ts +4 -4
- package/es/components/Search/SearchWithMore/index.js +5 -5
- package/es/components/Search/SearchWithMore/index.module.scss +2 -2
- package/es/components/Search/_components/ButtonGroup/index.js +1 -1
- package/es/components/Search/_components/SearchBase/index.d.ts +8 -8
- package/es/components/Search/_components/SearchBase/index.js +5 -5
- package/es/components/Search/_components/SearchButtons/index.d.ts +2 -2
- package/es/components/Search/_hooks/useAdaptiveColumnNum.d.ts +9 -9
- package/es/components/Search/_hooks/useAdaptiveColumnNum.js +19 -19
- package/es/components/Search/_hooks/useSearchCommon.d.ts +1 -1
- package/es/components/Search/_hooks/useSearchCommon.js +21 -21
- package/es/components/Search/_hooks/useSearchExpand.d.ts +12 -12
- package/es/components/Search/_hooks/useSearchExpand.js +32 -32
- package/es/components/Search/_hooks/useSearchForm.d.ts +1 -1
- package/es/components/Search/_hooks/useSearchForm.js +1 -1
- package/es/components/Search/_hooks/useSearchItems.d.ts +5 -4
- package/es/components/Search/_hooks/useSearchItems.js +5 -4
- package/es/components/Search/_types/index.d.ts +12 -12
- package/es/components/Search/_utils/calculateButtonGroupAndColumnWidth.d.ts +6 -6
- package/es/components/Search/_utils/calculateButtonGroupAndColumnWidth.js +10 -10
- package/es/components/Search/_utils/calculateVisibleItems.d.ts +9 -9
- package/es/components/Search/_utils/calculateVisibleItems.js +12 -12
- package/es/components/Search/_utils/cleanSearchData.d.ts +3 -3
- package/es/components/Search/_utils/cleanSearchData.js +3 -3
- package/es/components/Search/_utils/measureButtonGroupWidth.d.ts +3 -3
- package/es/components/Search/_utils/measureButtonGroupWidth.js +4 -4
- package/es/components/Search/_utils/shouldDisplayExtraItem.d.ts +7 -7
- package/es/components/Search/_utils/shouldDisplayExtraItem.js +7 -7
- package/es/components/Search/index.d.ts +2 -2
- package/es/components/Search/index.js +4 -4
- package/es/components/Search/index.module.scss +1 -1
- package/es/components/SecondConf/index.module.scss +1 -1
- package/es/components/Select/AutoCompleteSelect/index.js +71 -32
- package/es/components/Select/AutoCompleteSelect/index.module.scss +6 -6
- package/es/components/Select/IconSelect/index.module.scss +2 -2
- package/es/components/Select/TreeSelect/_utils/getExpandedKeysByLevel.d.ts +4 -4
- package/es/components/Select/TreeSelect/_utils/getExpandedKeysByLevel.js +5 -5
- package/es/components/Select/TreeSelect/index.module.scss +1 -1
- package/es/components/Select/_hooks/useSelectComposition.d.ts +1 -1
- package/es/components/Select/_hooks/useSelectComposition.js +1 -1
- package/es/components/Select/_hooks/useSelectInputOptions.d.ts +1 -1
- package/es/components/Select/_hooks/useSelectInputOptions.js +1 -1
- package/es/components/Select/_utils/calculatePopupWidth.d.ts +1 -1
- package/es/components/Select/_utils/calculatePopupWidth.js +1 -1
- package/es/components/Select/_utils/filterOption.d.ts +1 -1
- package/es/components/Select/_utils/filterOption.js +1 -1
- package/es/components/Select/_utils/getElementPosition.d.ts +7 -6
- package/es/components/Select/_utils/getElementPosition.js +7 -6
- package/es/components/Select/index.module.scss +8 -8
- package/es/components/Spreadsheet/xlsxspread.js +2 -2
- package/es/components/Switch/index.module.scss +2 -2
- package/es/components/TabBar/index.module.scss +8 -8
- package/es/components/Table/_components/Pagination/index.js +3 -3
- package/es/components/Table/_hooks/useAutoScrolling.d.ts +1 -1
- package/es/components/Table/_hooks/useAutoScrolling.js +8 -7
- package/es/components/Table/_hooks/useEllipsisTooltip.d.ts +1 -1
- package/es/components/Table/_hooks/useEllipsisTooltip.js +6 -6
- package/es/components/Table/_hooks/usePaginationSync.d.ts +3 -3
- package/es/components/Table/_hooks/usePaginationSync.js +5 -5
- package/es/components/Table/_hooks/useScrollEnd.js +7 -7
- package/es/components/Table/_hooks/useTableColumns.js +30 -28
- package/es/components/Table/_hooks/useTablePagination.js +7 -7
- package/es/components/Table/_utils/tableUtils.d.ts +7 -7
- package/es/components/Table/_utils/tableUtils.js +11 -11
- package/es/components/Table/index.d.ts +11 -8
- package/es/components/Table/index.module.scss +3 -3
- package/es/components/Tags/_components/EllipsisTag/index.d.ts +1 -1
- package/es/components/Tags/_components/EllipsisTag/index.js +1 -1
- package/es/components/Tags/_components/MeasureContainer/index.d.ts +1 -1
- package/es/components/Tags/_components/MeasureContainer/index.js +1 -1
- package/es/components/Tags/_hooks/useVisibleTags.d.ts +5 -5
- package/es/components/Tags/_hooks/useVisibleTags.js +13 -13
- package/es/components/Tags/_utils/calculateVisibleCount.d.ts +6 -6
- package/es/components/Tags/_utils/calculateVisibleCount.js +12 -12
- package/es/components/Tags/_utils/getTagColor.d.ts +4 -4
- package/es/components/Tags/_utils/getTagColor.js +4 -4
- package/es/components/Tags/index.js +2 -2
- package/es/components/TextEllipsis/index.d.ts +11 -11
- package/es/components/TextEllipsis/index.js +18 -18
- package/es/components/Tree/_components/TitleSearchBar/index.js +2 -2
- package/es/components/Tree/_hooks/useClearNodeTitle.d.ts +4 -4
- package/es/components/Tree/_hooks/useClearNodeTitle.js +8 -8
- package/es/components/Tree/_hooks/useTreeCheck.d.ts +2 -2
- package/es/components/Tree/_hooks/useTreeCheck.js +4 -4
- package/es/components/Tree/_hooks/useTreeSearch.d.ts +1 -1
- package/es/components/Tree/_hooks/useTreeSearch.js +7 -7
- package/es/components/Tree/_hooks/useTreeState.d.ts +3 -3
- package/es/components/Tree/_hooks/useTreeState.js +10 -10
- package/es/components/Tree/_utils/index.d.ts +24 -24
- package/es/components/Tree/_utils/index.js +28 -28
- package/es/components/Tree/_utils/normalizeCheckedKeys.d.ts +4 -4
- package/es/components/Tree/_utils/normalizeCheckedKeys.js +16 -16
- package/es/components/Tree/index.d.ts +3 -3
- package/es/components/Tree/index.js +22 -21
- package/es/components/Tree/index.module.scss +2 -2
- package/es/components/Upload/_components/UploadedItem/index.js +2 -2
- package/es/components/Upload/_components/UploadingItem/index.js +2 -2
- package/es/components/Upload/_hooks/useUploadFileList.d.ts +1 -1
- package/es/components/Upload/_hooks/useUploadFileList.js +1 -1
- package/es/components/Upload/_hooks/useUploadOperations.d.ts +1 -1
- package/es/components/Upload/_hooks/useUploadOperations.js +3 -3
- package/es/components/Upload/_hooks/useUploadPreview.d.ts +1 -1
- package/es/components/Upload/_hooks/useUploadPreview.js +1 -1
- package/es/components/Upload/_utils/chunkUpload.d.ts +1 -1
- package/es/components/Upload/_utils/chunkUpload.js +4 -4
- package/es/components/Upload/_utils/createFormData.d.ts +1 -1
- package/es/components/Upload/_utils/createFormData.js +1 -1
- package/es/components/Upload/_utils/extractFileUrl.d.ts +1 -1
- package/es/components/Upload/_utils/extractFileUrl.js +1 -1
- package/es/components/Upload/_utils/isSuccessResponse.d.ts +1 -1
- package/es/components/Upload/_utils/isSuccessResponse.js +1 -1
- package/es/components/Upload/_utils/normalUpload.d.ts +1 -1
- package/es/components/Upload/_utils/normalUpload.js +2 -2
- package/es/components/Upload/_utils/toMB.d.ts +1 -1
- package/es/components/Upload/_utils/toMB.js +1 -1
- package/es/components/Upload/_utils/validateFile.d.ts +1 -1
- package/es/components/Upload/_utils/validateFile.js +1 -1
- package/es/components/Upload/index.js +2 -2
- package/es/config-provider/index.d.ts +3 -3
- package/es/config-provider/index.js +2 -2
- package/es/hooks/usePermissions.js +3 -3
- package/es/index.d.ts +2 -0
- package/es/index.js +6 -4
- package/es/request/ResType.d.ts +3 -3
- package/es/request/index.d.ts +6 -6
- package/es/request/index.js +6 -6
- package/es/styles/antd-overload.scss +12 -9
- package/es/styles/tokens.d.ts +26 -0
- package/es/styles/tokens.js +32 -0
- package/es/styles/tokens.scss +62 -0
- package/es/typings.d.ts +3 -3
- package/es/utils/getUUID.d.ts +1 -1
- package/es/utils/getUUID.js +1 -1
- package/lib/components/Button/index.js +2 -2
- package/lib/components/ChainGraph/ChainGraphServices/Edges/ArrowEdge.js +4 -4
- package/lib/components/ChainGraph/ChainGraphServices/NodeEvents.js +3 -3
- package/lib/components/ChainGraph/ChainGraphServices/RootNode.js +27 -27
- package/lib/components/ChainGraph/ChainGraphServices/TreeNode.js +32 -32
- package/lib/components/ChainGraph/ChainGraphServices/index.js +11 -11
- package/lib/components/ChainGraph/_components/SearchSelect/index.module.scss +2 -2
- package/lib/components/ChainGraph/_utils/findAncestorsOfNode.d.ts +5 -5
- package/lib/components/ChainGraph/_utils/findAncestorsOfNode.js +12 -12
- package/lib/components/ChainGraph/_utils/getTextSize.d.ts +4 -4
- package/lib/components/ChainGraph/_utils/getTextSize.js +4 -4
- package/lib/components/ChainGraph/_utils/styles.d.ts +3 -3
- package/lib/components/ChainGraph/_utils/styles.js +3 -3
- package/lib/components/ChainGraph/index.js +7 -7
- package/lib/components/ChainGraph/index.module.scss +2 -2
- package/lib/components/Chart/Bar/Bar3DOpt.d.ts +9 -9
- package/lib/components/Chart/Bar/Bar3DOpt.js +29 -29
- package/lib/components/Chart/Bar/index.d.ts +5 -5
- package/lib/components/Chart/Bar/index.js +23 -23
- package/lib/components/Chart/Bubble/index.d.ts +6 -6
- package/lib/components/Chart/Bubble/index.js +41 -41
- package/lib/components/Chart/Common/index.js +12 -12
- package/lib/components/Chart/Gauge/index.js +11 -11
- package/lib/components/Chart/Group/index.js +1 -1
- package/lib/components/Chart/Heatmap/index.d.ts +12 -12
- package/lib/components/Chart/Heatmap/index.js +24 -24
- package/lib/components/Chart/Line/index.d.ts +5 -5
- package/lib/components/Chart/Line/index.js +23 -23
- package/lib/components/Chart/Pie/Pie3D/_hooks/index.js +14 -14
- package/lib/components/Chart/Pie/Pie3D/_utils/label.js +30 -30
- package/lib/components/Chart/Pie/index.d.ts +8 -8
- package/lib/components/Chart/Pie/index.js +34 -34
- package/lib/components/Chart/Polar/index.js +11 -11
- package/lib/components/Chart/Radar/index.d.ts +8 -8
- package/lib/components/Chart/Radar/index.js +7 -7
- package/lib/components/Chart/Sankey/index.js +12 -12
- package/lib/components/Chart/Tree/index.js +12 -12
- package/lib/components/Chart/_utils/autoSmooth.d.ts +1 -1
- package/lib/components/Chart/_utils/autoSmooth.js +2 -2
- package/lib/components/Chart/_utils/bubble.js +8 -8
- package/lib/components/Chart/_utils/cartesian.d.ts +4 -4
- package/lib/components/Chart/_utils/cartesian.js +4 -4
- package/lib/components/Chart/chartUtils/calculateAxisConfig.d.ts +4 -4
- package/lib/components/Chart/chartUtils/calculateAxisConfig.js +16 -16
- package/lib/components/Chart/chartUtils/chartTooltipFormatter.d.ts +1 -1
- package/lib/components/Chart/chartUtils/chartTooltipFormatter.js +1 -1
- package/lib/components/Chart/chartUtils/useDataZoomWindow.d.ts +7 -7
- package/lib/components/Chart/chartUtils/useDataZoomWindow.js +4 -4
- package/lib/components/Chart/chartUtils/useLegendSelection.d.ts +6 -6
- package/lib/components/Chart/chartUtils/useLegendSelection.js +3 -3
- package/lib/components/Chart/chartUtils/yAxisDisplayUnit.d.ts +4 -4
- package/lib/components/Chart/chartUtils/yAxisDisplayUnit.js +4 -4
- package/lib/components/Chart/index.d.ts +2 -2
- package/lib/components/Chart/index.js +1 -1
- package/lib/components/Chat/ChatHistory/_components/HistoryGroup/index.module.scss +1 -1
- package/lib/components/Chat/ChatHistory/_components/HistoryItem/index.js +8 -8
- package/lib/components/Chat/ChatHistory/_components/HistoryItem/index.module.scss +6 -6
- package/lib/components/Chat/ChatHistory/_components/NewChatButton/index.module.scss +4 -4
- package/lib/components/Chat/ChatHistory/_utils/index.d.ts +1 -1
- package/lib/components/Chat/ChatHistory/_utils/index.js +1 -1
- package/lib/components/Chat/ChatHistory/index.js +2 -2
- package/lib/components/Chat/ChatHistory/index.module.scss +3 -3
- package/lib/components/Chat/ChatInput/_components/AgentToggleButton/index.module.scss +8 -8
- package/lib/components/Chat/ChatInput/_components/FileList/index.module.scss +3 -3
- package/lib/components/Chat/ChatInput/_components/UploadButton/index.js +1 -1
- package/lib/components/Chat/ChatInput/_utils/index.d.ts +3 -3
- package/lib/components/Chat/ChatInput/_utils/index.js +3 -3
- package/lib/components/Chat/ChatInput/index.d.ts +5 -5
- package/lib/components/Chat/ChatInput/index.js +23 -19
- package/lib/components/Chat/ChatInput/index.module.scss +4 -4
- package/lib/components/Chat/ChatList/_components/Assistant/AssistantItem/_components/Copy/index.js +0 -1
- package/lib/components/Chat/ChatList/_components/Assistant/AssistantItem/_components/Copy/index.module.scss +5 -5
- package/lib/components/Chat/ChatList/_components/Assistant/AssistantItem/_components/LikeDislike/index.module.scss +5 -5
- package/lib/components/Chat/ChatList/_components/Assistant/AssistantItem/_components/QuoteList/index.module.scss +7 -7
- package/lib/components/Chat/ChatList/_components/Assistant/AssistantItem/index.js +5 -5
- package/lib/components/Chat/ChatList/_components/Assistant/AssistantItem/index.module.scss +5 -5
- package/lib/components/Chat/ChatList/_components/Assistant/index.module.scss +3 -3
- package/lib/components/Chat/ChatList/_components/User/index.module.scss +6 -6
- package/lib/components/Chat/ChatList/_hooks/useAssistantNavigation.d.ts +1 -1
- package/lib/components/Chat/ChatList/_hooks/useAssistantNavigation.js +1 -1
- package/lib/components/Chat/ChatList/_hooks/useCalculateRowIndex.js +1 -1
- package/lib/components/Chat/ChatList/_utils/cleanRedactedReasoning.d.ts +3 -3
- package/lib/components/Chat/ChatList/_utils/cleanRedactedReasoning.js +3 -3
- package/lib/components/Checkbox/CheckboxGroup/index.js +6 -6
- package/lib/components/Checkbox/CheckboxGroup/index.module.scss +3 -3
- package/lib/components/Checkbox/index.module.scss +2 -2
- package/lib/components/CodeMirror/index.d.ts +6 -6
- package/lib/components/CodeMirror/index.js +9 -9
- package/lib/components/CodeMirror/index.module.scss +4 -4
- package/lib/components/CodeMirror/linters/errorTranslator.d.ts +1 -1
- package/lib/components/CodeMirror/linters/errorTranslator.js +19 -19
- package/lib/components/CodeMirror/linters/jsonLinter.d.ts +2 -2
- package/lib/components/CodeMirror/linters/jsonLinter.js +9 -9
- package/lib/components/CodeMirror/linters/sqlLinter.js +29 -29
- package/lib/components/Copy/index.module.scss +3 -3
- package/lib/components/DatePicker/defaultModalPickerGetPopupContainer.d.ts +2 -2
- package/lib/components/DatePicker/defaultModalPickerGetPopupContainer.js +2 -2
- package/lib/components/DatePicker/index.js +9 -9
- package/lib/components/Editor/index.js +3 -3
- package/lib/components/Editor/index.module.scss +2 -2
- package/lib/components/FileCol/index.js +2 -2
- package/lib/components/FilePreview/_components/BasePreview/index.module.scss +2 -2
- package/lib/components/FilePreview/_components/PdfPreview/index.module.scss +3 -3
- package/lib/components/FilePreview/_hooks/useXlsxData.d.ts +1 -1
- package/lib/components/FilePreview/_hooks/useXlsxData.js +1 -1
- package/lib/components/FilePreview/index.module.scss +2 -2
- package/lib/components/Form/ModalForm/_hooks/useAdaptiveColumnNum.d.ts +7 -7
- package/lib/components/Form/ModalForm/_hooks/useAdaptiveColumnNum.js +8 -8
- package/lib/components/Form/ModalForm/_hooks/useColumnFormItems.d.ts +3 -3
- package/lib/components/Form/ModalForm/_hooks/useColumnFormItems.js +18 -18
- package/lib/components/Form/ModalForm/_hooks/useFormItems.d.ts +5 -5
- package/lib/components/Form/ModalForm/_hooks/useFormItems.js +5 -5
- package/lib/components/FormItem/FormCodeMirror/index.js +6 -6
- package/lib/components/FormItem/FormInput/FormPasswordStrength/index.module.scss +5 -5
- package/lib/components/FormItem/FormRadio/index.module.scss +2 -2
- package/lib/components/FormItem/FormUpload/index.module.scss +13 -13
- package/lib/components/FormItem/ItemContainer/index.d.ts +1 -1
- package/lib/components/FormItem/ItemContainer/index.js +3 -3
- package/lib/components/FormItem/ItemContainer/index.module.scss +4 -4
- package/lib/components/FormItem/databaseTypeMapping.d.ts +23 -23
- package/lib/components/FormItem/databaseTypeMapping.js +36 -36
- package/lib/components/FormItem/index.js +12 -12
- package/lib/components/Icon/index.js +4 -4
- package/lib/components/Input/Number/index.js +6 -6
- package/lib/components/Input/Number/index.module.scss +5 -5
- package/lib/components/Input/Password/index.js +3 -3
- package/lib/components/Input/Range/index.js +3 -3
- package/lib/components/Input/Range/index.module.scss +2 -2
- package/lib/components/Input/Search/index.js +3 -3
- package/lib/components/Input/TextArea/index.js +6 -6
- package/lib/components/Input/TextArea/index.module.scss +5 -5
- package/lib/components/Input/index.js +14 -14
- package/lib/components/Input/index.module.scss +2 -2
- package/lib/components/Markdown/Editor/index.module.scss +3 -3
- package/lib/components/Markdown/Views/ArtifactBlock.d.ts +5 -5
- package/lib/components/Markdown/Views/ArtifactBlock.js +2 -2
- package/lib/components/Markdown/Views/MermaidBlock.d.ts +2 -2
- package/lib/components/Markdown/Views/MermaidBlock.js +5 -5
- package/lib/components/Markdown/Views/blocks.module.scss +11 -11
- package/lib/components/Markdown/Views/index.js +5 -5
- package/lib/components/Markdown/Views/index.module.scss +1 -1
- package/lib/components/Modal/_hooks/useModalDrag.d.ts +1 -1
- package/lib/components/Modal/_hooks/useModalDrag.js +1 -1
- package/lib/components/Modal/_hooks/useModalElements.d.ts +1 -1
- package/lib/components/Modal/_hooks/useModalElements.js +1 -1
- package/lib/components/Modal/_utils/calculatePosition.d.ts +7 -7
- package/lib/components/Modal/_utils/calculatePosition.js +7 -7
- package/lib/components/Modal/index.module.scss +1 -1
- package/lib/components/Operate/_hooks/useOperateEllipsis.d.ts +5 -5
- package/lib/components/Operate/_hooks/useOperateEllipsis.js +5 -5
- package/lib/components/Operate/index.js +16 -16
- package/lib/components/Panel/DefaultPanel/index.module.scss +1 -1
- package/lib/components/Panel/IframePanel/index.module.scss +1 -1
- package/lib/components/Panel/ListPanel/ListModalPanel/index.d.ts +2 -2
- package/lib/components/Panel/ListPanel/ListModalPanel/index.js +5 -5
- package/lib/components/Panel/ListPanel/ListModalPanel/index.module.scss +1 -1
- package/lib/components/Panel/ListPanel/_components/ColumnMgt/index.js +1 -1
- package/lib/components/Panel/ListPanel/index.d.ts +2 -2
- package/lib/components/Panel/ListPanel/index.js +3 -3
- package/lib/components/Panel/ListPanel/index.module.scss +5 -5
- package/lib/components/Search/SearchAdvanced/index.d.ts +4 -4
- package/lib/components/Search/SearchAdvanced/index.js +4 -4
- package/lib/components/Search/SearchAdvanced/index.module.scss +2 -2
- package/lib/components/Search/SearchCard/_components/OptionRow/ChildrenItems/index.js +8 -8
- package/lib/components/Search/SearchCard/_components/OptionRow/Item/index.js +13 -13
- package/lib/components/Search/SearchCard/_components/OptionRow/index.js +8 -8
- package/lib/components/Search/SearchCard/_hooks/useSearchCardCollapse.d.ts +1 -1
- package/lib/components/Search/SearchCard/_hooks/useSearchCardCollapse.js +1 -1
- package/lib/components/Search/SearchCard/_hooks/useSearchCardMoreOptions.d.ts +1 -1
- package/lib/components/Search/SearchCard/_hooks/useSearchCardMoreOptions.js +14 -14
- package/lib/components/Search/SearchCard/_hooks/useSearchCardValue.d.ts +1 -1
- package/lib/components/Search/SearchCard/_hooks/useSearchCardValue.js +5 -5
- package/lib/components/Search/SearchCard/_utils/getRealValues.d.ts +1 -1
- package/lib/components/Search/SearchCard/_utils/getRealValues.js +5 -5
- package/lib/components/Search/SearchCard/_utils/hasSelectedChildren.d.ts +1 -1
- package/lib/components/Search/SearchCard/_utils/hasSelectedChildren.js +3 -3
- package/lib/components/Search/SearchCard/_utils/typeGuards.d.ts +1 -1
- package/lib/components/Search/SearchCard/_utils/typeGuards.js +1 -1
- package/lib/components/Search/SearchCard/_utils/updateRealValue.d.ts +1 -1
- package/lib/components/Search/SearchCard/_utils/updateRealValue.js +11 -11
- package/lib/components/Search/SearchCard/index.js +1 -1
- package/lib/components/Search/SearchCard/index.module.scss +8 -8
- package/lib/components/Search/SearchCollapsible/index.d.ts +4 -4
- package/lib/components/Search/SearchCollapsible/index.js +6 -6
- package/lib/components/Search/SearchCollapsible/index.module.scss +2 -2
- package/lib/components/Search/SearchWithFilter/index.d.ts +4 -4
- package/lib/components/Search/SearchWithFilter/index.js +4 -4
- package/lib/components/Search/SearchWithFilter/index.module.scss +2 -2
- package/lib/components/Search/SearchWithMore/index.d.ts +4 -4
- package/lib/components/Search/SearchWithMore/index.js +5 -5
- package/lib/components/Search/SearchWithMore/index.module.scss +2 -2
- package/lib/components/Search/_components/ButtonGroup/index.js +1 -1
- package/lib/components/Search/_components/SearchBase/index.d.ts +8 -8
- package/lib/components/Search/_components/SearchBase/index.js +5 -5
- package/lib/components/Search/_components/SearchButtons/index.d.ts +2 -2
- package/lib/components/Search/_hooks/useAdaptiveColumnNum.d.ts +9 -9
- package/lib/components/Search/_hooks/useAdaptiveColumnNum.js +19 -19
- package/lib/components/Search/_hooks/useSearchCommon.d.ts +1 -1
- package/lib/components/Search/_hooks/useSearchCommon.js +21 -21
- package/lib/components/Search/_hooks/useSearchExpand.d.ts +12 -12
- package/lib/components/Search/_hooks/useSearchExpand.js +32 -32
- package/lib/components/Search/_hooks/useSearchForm.d.ts +1 -1
- package/lib/components/Search/_hooks/useSearchForm.js +1 -1
- package/lib/components/Search/_hooks/useSearchItems.d.ts +5 -4
- package/lib/components/Search/_hooks/useSearchItems.js +5 -4
- package/lib/components/Search/_types/index.d.ts +12 -12
- package/lib/components/Search/_utils/calculateButtonGroupAndColumnWidth.d.ts +6 -6
- package/lib/components/Search/_utils/calculateButtonGroupAndColumnWidth.js +10 -10
- package/lib/components/Search/_utils/calculateVisibleItems.d.ts +9 -9
- package/lib/components/Search/_utils/calculateVisibleItems.js +12 -12
- package/lib/components/Search/_utils/cleanSearchData.d.ts +3 -3
- package/lib/components/Search/_utils/cleanSearchData.js +3 -3
- package/lib/components/Search/_utils/measureButtonGroupWidth.d.ts +3 -3
- package/lib/components/Search/_utils/measureButtonGroupWidth.js +4 -4
- package/lib/components/Search/_utils/shouldDisplayExtraItem.d.ts +7 -7
- package/lib/components/Search/_utils/shouldDisplayExtraItem.js +7 -7
- package/lib/components/Search/index.d.ts +2 -2
- package/lib/components/Search/index.js +4 -4
- package/lib/components/Search/index.module.scss +1 -1
- package/lib/components/SecondConf/index.module.scss +1 -1
- package/lib/components/Select/AutoCompleteSelect/index.js +57 -23
- package/lib/components/Select/AutoCompleteSelect/index.module.scss +6 -6
- package/lib/components/Select/IconSelect/index.module.scss +2 -2
- package/lib/components/Select/TreeSelect/_utils/getExpandedKeysByLevel.d.ts +4 -4
- package/lib/components/Select/TreeSelect/_utils/getExpandedKeysByLevel.js +5 -5
- package/lib/components/Select/TreeSelect/index.module.scss +1 -1
- package/lib/components/Select/_hooks/useSelectComposition.d.ts +1 -1
- package/lib/components/Select/_hooks/useSelectComposition.js +1 -1
- package/lib/components/Select/_hooks/useSelectInputOptions.d.ts +1 -1
- package/lib/components/Select/_hooks/useSelectInputOptions.js +1 -1
- package/lib/components/Select/_utils/calculatePopupWidth.d.ts +1 -1
- package/lib/components/Select/_utils/calculatePopupWidth.js +1 -1
- package/lib/components/Select/_utils/filterOption.d.ts +1 -1
- package/lib/components/Select/_utils/filterOption.js +1 -1
- package/lib/components/Select/_utils/getElementPosition.d.ts +7 -6
- package/lib/components/Select/_utils/getElementPosition.js +7 -6
- package/lib/components/Select/index.module.scss +8 -8
- package/lib/components/Spreadsheet/xlsxspread.js +2 -2
- package/lib/components/Switch/index.module.scss +2 -2
- package/lib/components/TabBar/index.module.scss +8 -8
- package/lib/components/Table/_components/Pagination/index.js +3 -3
- package/lib/components/Table/_hooks/useAutoScrolling.d.ts +1 -1
- package/lib/components/Table/_hooks/useAutoScrolling.js +8 -7
- package/lib/components/Table/_hooks/useEllipsisTooltip.d.ts +1 -1
- package/lib/components/Table/_hooks/useEllipsisTooltip.js +6 -6
- package/lib/components/Table/_hooks/usePaginationSync.d.ts +3 -3
- package/lib/components/Table/_hooks/usePaginationSync.js +5 -5
- package/lib/components/Table/_hooks/useScrollEnd.js +7 -7
- package/lib/components/Table/_hooks/useTableColumns.js +30 -28
- package/lib/components/Table/_hooks/useTablePagination.js +7 -7
- package/lib/components/Table/_utils/tableUtils.d.ts +7 -7
- package/lib/components/Table/_utils/tableUtils.js +11 -11
- package/lib/components/Table/index.d.ts +11 -8
- package/lib/components/Table/index.module.scss +3 -3
- package/lib/components/Tags/_components/EllipsisTag/index.d.ts +1 -1
- package/lib/components/Tags/_components/EllipsisTag/index.js +1 -1
- package/lib/components/Tags/_components/MeasureContainer/index.d.ts +1 -1
- package/lib/components/Tags/_components/MeasureContainer/index.js +1 -1
- package/lib/components/Tags/_hooks/useVisibleTags.d.ts +5 -5
- package/lib/components/Tags/_hooks/useVisibleTags.js +13 -13
- package/lib/components/Tags/_utils/calculateVisibleCount.d.ts +6 -6
- package/lib/components/Tags/_utils/calculateVisibleCount.js +12 -12
- package/lib/components/Tags/_utils/getTagColor.d.ts +4 -4
- package/lib/components/Tags/_utils/getTagColor.js +4 -4
- package/lib/components/Tags/index.js +2 -2
- package/lib/components/TextEllipsis/index.d.ts +11 -11
- package/lib/components/TextEllipsis/index.js +18 -18
- package/lib/components/Tree/_components/TitleSearchBar/index.js +2 -2
- package/lib/components/Tree/_hooks/useClearNodeTitle.d.ts +4 -4
- package/lib/components/Tree/_hooks/useClearNodeTitle.js +8 -8
- package/lib/components/Tree/_hooks/useTreeCheck.d.ts +2 -2
- package/lib/components/Tree/_hooks/useTreeCheck.js +4 -4
- package/lib/components/Tree/_hooks/useTreeSearch.d.ts +1 -1
- package/lib/components/Tree/_hooks/useTreeSearch.js +7 -7
- package/lib/components/Tree/_hooks/useTreeState.d.ts +3 -3
- package/lib/components/Tree/_hooks/useTreeState.js +10 -10
- package/lib/components/Tree/_utils/index.d.ts +24 -24
- package/lib/components/Tree/_utils/index.js +28 -28
- package/lib/components/Tree/_utils/normalizeCheckedKeys.d.ts +4 -4
- package/lib/components/Tree/_utils/normalizeCheckedKeys.js +16 -16
- package/lib/components/Tree/index.d.ts +3 -3
- package/lib/components/Tree/index.js +22 -21
- package/lib/components/Tree/index.module.scss +2 -2
- package/lib/components/Upload/_components/UploadedItem/index.js +2 -2
- package/lib/components/Upload/_components/UploadingItem/index.js +2 -2
- package/lib/components/Upload/_hooks/useUploadFileList.d.ts +1 -1
- package/lib/components/Upload/_hooks/useUploadFileList.js +1 -1
- package/lib/components/Upload/_hooks/useUploadOperations.d.ts +1 -1
- package/lib/components/Upload/_hooks/useUploadOperations.js +3 -3
- package/lib/components/Upload/_hooks/useUploadPreview.d.ts +1 -1
- package/lib/components/Upload/_hooks/useUploadPreview.js +1 -1
- package/lib/components/Upload/_utils/chunkUpload.d.ts +1 -1
- package/lib/components/Upload/_utils/chunkUpload.js +4 -4
- package/lib/components/Upload/_utils/createFormData.d.ts +1 -1
- package/lib/components/Upload/_utils/createFormData.js +1 -1
- package/lib/components/Upload/_utils/extractFileUrl.d.ts +1 -1
- package/lib/components/Upload/_utils/extractFileUrl.js +1 -1
- package/lib/components/Upload/_utils/isSuccessResponse.d.ts +1 -1
- package/lib/components/Upload/_utils/isSuccessResponse.js +1 -1
- package/lib/components/Upload/_utils/normalUpload.d.ts +1 -1
- package/lib/components/Upload/_utils/normalUpload.js +2 -2
- package/lib/components/Upload/_utils/toMB.d.ts +1 -1
- package/lib/components/Upload/_utils/toMB.js +1 -1
- package/lib/components/Upload/_utils/validateFile.d.ts +1 -1
- package/lib/components/Upload/_utils/validateFile.js +1 -1
- package/lib/components/Upload/index.js +2 -2
- package/lib/config-provider/index.d.ts +3 -3
- package/lib/config-provider/index.js +2 -2
- package/lib/hooks/usePermissions.js +3 -3
- package/lib/index.d.ts +2 -0
- package/lib/index.js +22 -0
- package/lib/request/ResType.d.ts +3 -3
- package/lib/request/index.d.ts +6 -6
- package/lib/request/index.js +6 -6
- package/lib/styles/antd-overload.scss +12 -9
- package/lib/styles/tokens.d.ts +26 -0
- package/lib/styles/tokens.js +38 -0
- package/lib/styles/tokens.scss +62 -0
- package/lib/typings.d.ts +3 -3
- package/lib/utils/getUUID.d.ts +1 -1
- package/lib/utils/getUUID.js +1 -1
- package/package.json +3 -3
- package/src/components/Button/index.tsx +2 -2
- package/src/components/ChainGraph/ChainGraphServices/Edges/ArrowEdge.ts +4 -4
- package/src/components/ChainGraph/ChainGraphServices/NodeEvents.ts +3 -3
- package/src/components/ChainGraph/ChainGraphServices/RootNode.ts +27 -27
- package/src/components/ChainGraph/ChainGraphServices/TreeNode.ts +32 -32
- package/src/components/ChainGraph/ChainGraphServices/index.ts +11 -11
- package/src/components/ChainGraph/_components/SearchSelect/index.module.scss +2 -2
- package/src/components/ChainGraph/_utils/findAncestorsOfNode.ts +12 -12
- package/src/components/ChainGraph/_utils/getTextSize.ts +4 -4
- package/src/components/ChainGraph/_utils/styles.ts +3 -3
- package/src/components/ChainGraph/index.module.scss +2 -2
- package/src/components/ChainGraph/index.tsx +8 -8
- package/src/components/Chart/Bar/Bar3DOpt.tsx +33 -33
- package/src/components/Chart/Bar/index.tsx +28 -28
- package/src/components/Chart/Bubble/index.tsx +47 -47
- package/src/components/Chart/Common/index.tsx +12 -12
- package/src/components/Chart/Gauge/index.tsx +11 -11
- package/src/components/Chart/Group/index.tsx +1 -1
- package/src/components/Chart/Heatmap/index.tsx +36 -36
- package/src/components/Chart/Line/index.tsx +28 -28
- package/src/components/Chart/Pie/Pie3D/_hooks/index.ts +14 -14
- package/src/components/Chart/Pie/Pie3D/_utils/label.ts +31 -31
- package/src/components/Chart/Pie/index.tsx +42 -42
- package/src/components/Chart/Polar/index.tsx +11 -11
- package/src/components/Chart/Radar/index.tsx +12 -12
- package/src/components/Chart/Sankey/index.tsx +12 -12
- package/src/components/Chart/Tree/index.tsx +12 -12
- package/src/components/Chart/_utils/autoSmooth.ts +3 -3
- package/src/components/Chart/_utils/bubble.ts +8 -8
- package/src/components/Chart/_utils/cartesian.ts +4 -4
- package/src/components/Chart/chartUtils/calculateAxisConfig.ts +16 -16
- package/src/components/Chart/chartUtils/chartTooltipFormatter.ts +2 -2
- package/src/components/Chart/chartUtils/useDataZoomWindow.ts +8 -8
- package/src/components/Chart/chartUtils/useLegendSelection.ts +6 -6
- package/src/components/Chart/chartUtils/yAxisDisplayUnit.ts +4 -4
- package/src/components/Chart/index.tsx +2 -2
- package/src/components/Chat/ChatHistory/_components/HistoryGroup/index.module.scss +1 -1
- package/src/components/Chat/ChatHistory/_components/HistoryItem/index.module.scss +6 -6
- package/src/components/Chat/ChatHistory/_components/HistoryItem/index.tsx +8 -8
- package/src/components/Chat/ChatHistory/_components/NewChatButton/index.module.scss +4 -4
- package/src/components/Chat/ChatHistory/_utils/index.ts +1 -1
- package/src/components/Chat/ChatHistory/index.module.scss +3 -3
- package/src/components/Chat/ChatHistory/index.tsx +2 -2
- package/src/components/Chat/ChatInput/_components/AgentToggleButton/index.module.scss +8 -8
- package/src/components/Chat/ChatInput/_components/FileList/index.module.scss +3 -3
- package/src/components/Chat/ChatInput/_components/UploadButton/index.tsx +2 -2
- package/src/components/Chat/ChatInput/_utils/index.ts +3 -3
- package/src/components/Chat/ChatInput/index.module.scss +4 -4
- package/src/components/Chat/ChatInput/index.tsx +24 -23
- package/src/components/Chat/ChatList/_components/Assistant/AssistantItem/_components/Copy/index.module.scss +5 -5
- package/src/components/Chat/ChatList/_components/Assistant/AssistantItem/_components/Copy/index.tsx +0 -2
- package/src/components/Chat/ChatList/_components/Assistant/AssistantItem/_components/LikeDislike/index.module.scss +5 -5
- package/src/components/Chat/ChatList/_components/Assistant/AssistantItem/_components/QuoteList/index.module.scss +7 -7
- package/src/components/Chat/ChatList/_components/Assistant/AssistantItem/index.module.scss +5 -5
- package/src/components/Chat/ChatList/_components/Assistant/AssistantItem/index.tsx +6 -6
- package/src/components/Chat/ChatList/_components/Assistant/index.module.scss +3 -3
- package/src/components/Chat/ChatList/_components/User/index.module.scss +6 -6
- package/src/components/Chat/ChatList/_hooks/useAssistantNavigation.ts +1 -1
- package/src/components/Chat/ChatList/_hooks/useCalculateRowIndex.ts +1 -1
- package/src/components/Chat/ChatList/_utils/cleanRedactedReasoning.ts +3 -3
- package/src/components/Checkbox/CheckboxGroup/index.module.scss +3 -3
- package/src/components/Checkbox/CheckboxGroup/index.tsx +6 -6
- package/src/components/Checkbox/index.module.scss +2 -2
- package/src/components/CodeMirror/index.module.scss +4 -4
- package/src/components/CodeMirror/index.tsx +15 -15
- package/src/components/CodeMirror/linters/errorTranslator.ts +19 -19
- package/src/components/CodeMirror/linters/jsonLinter.ts +11 -11
- package/src/components/CodeMirror/linters/sqlLinter.ts +29 -29
- package/src/components/Copy/index.module.scss +3 -3
- package/src/components/DatePicker/defaultModalPickerGetPopupContainer.ts +2 -2
- package/src/components/DatePicker/index.tsx +9 -9
- package/src/components/Editor/index.module.scss +2 -2
- package/src/components/Editor/index.tsx +3 -3
- package/src/components/FileCol/index.tsx +2 -2
- package/src/components/FilePreview/_components/BasePreview/index.module.scss +2 -2
- package/src/components/FilePreview/_components/PdfPreview/index.module.scss +3 -3
- package/src/components/FilePreview/_hooks/useXlsxData.ts +1 -1
- package/src/components/FilePreview/index.module.scss +2 -2
- package/src/components/Form/ModalForm/_hooks/useAdaptiveColumnNum.ts +8 -8
- package/src/components/Form/ModalForm/_hooks/useColumnFormItems.ts +18 -18
- package/src/components/Form/ModalForm/_hooks/useFormItems.ts +5 -5
- package/src/components/FormItem/FormCodeMirror/index.tsx +6 -6
- package/src/components/FormItem/FormInput/FormPasswordStrength/index.module.scss +5 -5
- package/src/components/FormItem/FormRadio/index.module.scss +2 -2
- package/src/components/FormItem/FormUpload/index.module.scss +13 -13
- package/src/components/FormItem/ItemContainer/index.module.scss +4 -4
- package/src/components/FormItem/ItemContainer/index.tsx +4 -4
- package/src/components/FormItem/databaseTypeMapping.ts +43 -43
- package/src/components/FormItem/index.tsx +15 -15
- package/src/components/Icon/index.tsx +4 -4
- package/src/components/Input/Number/index.module.scss +5 -5
- package/src/components/Input/Number/index.tsx +6 -6
- package/src/components/Input/Password/index.tsx +3 -3
- package/src/components/Input/Range/index.module.scss +2 -2
- package/src/components/Input/Range/index.tsx +3 -3
- package/src/components/Input/Search/index.tsx +3 -3
- package/src/components/Input/TextArea/index.module.scss +5 -5
- package/src/components/Input/TextArea/index.tsx +6 -6
- package/src/components/Input/index.module.scss +2 -2
- package/src/components/Input/index.tsx +14 -14
- package/src/components/Markdown/Editor/index.module.scss +3 -3
- package/src/components/Markdown/Views/ArtifactBlock.tsx +5 -5
- package/src/components/Markdown/Views/MermaidBlock.tsx +5 -5
- package/src/components/Markdown/Views/blocks.module.scss +11 -11
- package/src/components/Markdown/Views/index.module.scss +1 -1
- package/src/components/Markdown/Views/index.tsx +5 -5
- package/src/components/Modal/_hooks/useModalDrag.ts +1 -1
- package/src/components/Modal/_hooks/useModalElements.ts +1 -1
- package/src/components/Modal/_utils/calculatePosition.ts +7 -7
- package/src/components/Modal/index.module.scss +1 -1
- package/src/components/Operate/_hooks/useOperateEllipsis.ts +5 -5
- package/src/components/Operate/index.tsx +16 -16
- package/src/components/Panel/DefaultPanel/index.module.scss +1 -1
- package/src/components/Panel/IframePanel/index.module.scss +1 -1
- package/src/components/Panel/ListPanel/ListModalPanel/index.module.scss +1 -1
- package/src/components/Panel/ListPanel/ListModalPanel/index.tsx +8 -8
- package/src/components/Panel/ListPanel/_components/ColumnMgt/index.tsx +1 -1
- package/src/components/Panel/ListPanel/index.module.scss +5 -5
- package/src/components/Panel/ListPanel/index.tsx +5 -5
- package/src/components/Search/SearchAdvanced/index.module.scss +2 -2
- package/src/components/Search/SearchAdvanced/index.tsx +4 -4
- package/src/components/Search/SearchCard/_components/OptionRow/ChildrenItems/index.tsx +8 -8
- package/src/components/Search/SearchCard/_components/OptionRow/Item/index.tsx +13 -13
- package/src/components/Search/SearchCard/_components/OptionRow/index.tsx +9 -9
- package/src/components/Search/SearchCard/_hooks/useSearchCardCollapse.ts +1 -1
- package/src/components/Search/SearchCard/_hooks/useSearchCardMoreOptions.ts +14 -14
- package/src/components/Search/SearchCard/_hooks/useSearchCardValue.ts +5 -5
- package/src/components/Search/SearchCard/_utils/getRealValues.ts +5 -5
- package/src/components/Search/SearchCard/_utils/hasSelectedChildren.ts +3 -3
- package/src/components/Search/SearchCard/_utils/typeGuards.ts +1 -1
- package/src/components/Search/SearchCard/_utils/updateRealValue.ts +11 -11
- package/src/components/Search/SearchCard/index.module.scss +8 -8
- package/src/components/Search/SearchCard/index.tsx +1 -1
- package/src/components/Search/SearchCollapsible/index.module.scss +2 -2
- package/src/components/Search/SearchCollapsible/index.tsx +6 -6
- package/src/components/Search/SearchWithFilter/index.module.scss +2 -2
- package/src/components/Search/SearchWithFilter/index.tsx +4 -4
- package/src/components/Search/SearchWithMore/index.module.scss +2 -2
- package/src/components/Search/SearchWithMore/index.tsx +5 -5
- package/src/components/Search/_components/ButtonGroup/index.tsx +1 -1
- package/src/components/Search/_components/SearchBase/index.tsx +9 -9
- package/src/components/Search/_components/SearchButtons/index.tsx +2 -2
- package/src/components/Search/_hooks/useAdaptiveColumnNum.ts +19 -19
- package/src/components/Search/_hooks/useSearchCommon.ts +21 -21
- package/src/components/Search/_hooks/useSearchExpand.ts +32 -32
- package/src/components/Search/_hooks/useSearchForm.ts +1 -1
- package/src/components/Search/_hooks/useSearchItems.ts +5 -4
- package/src/components/Search/_types/index.ts +12 -12
- package/src/components/Search/_utils/calculateButtonGroupAndColumnWidth.ts +10 -10
- package/src/components/Search/_utils/calculateVisibleItems.ts +12 -12
- package/src/components/Search/_utils/cleanSearchData.ts +3 -3
- package/src/components/Search/_utils/measureButtonGroupWidth.ts +4 -4
- package/src/components/Search/_utils/shouldDisplayExtraItem.ts +7 -7
- package/src/components/Search/index.module.scss +1 -1
- package/src/components/Search/index.tsx +4 -4
- package/src/components/SecondConf/index.module.scss +1 -1
- package/src/components/Select/AutoCompleteSelect/index.module.scss +6 -6
- package/src/components/Select/AutoCompleteSelect/index.tsx +72 -27
- package/src/components/Select/IconSelect/index.module.scss +2 -2
- package/src/components/Select/TreeSelect/_utils/getExpandedKeysByLevel.ts +5 -5
- package/src/components/Select/TreeSelect/index.module.scss +1 -1
- package/src/components/Select/_hooks/useSelectComposition.ts +1 -1
- package/src/components/Select/_hooks/useSelectInputOptions.ts +1 -1
- package/src/components/Select/_utils/calculatePopupWidth.ts +1 -1
- package/src/components/Select/_utils/filterOption.ts +1 -1
- package/src/components/Select/_utils/getElementPosition.ts +7 -6
- package/src/components/Select/index.module.scss +8 -8
- package/src/components/Spreadsheet/xlsxspread.ts +2 -2
- package/src/components/Switch/index.module.scss +2 -2
- package/src/components/TabBar/index.module.scss +8 -8
- package/src/components/Table/_components/Pagination/index.tsx +3 -3
- package/src/components/Table/_hooks/useAutoScrolling.ts +9 -8
- package/src/components/Table/_hooks/useEllipsisTooltip.ts +6 -6
- package/src/components/Table/_hooks/usePaginationSync.ts +5 -5
- package/src/components/Table/_hooks/useScrollEnd.ts +9 -9
- package/src/components/Table/_hooks/useTableColumns.tsx +30 -28
- package/src/components/Table/_hooks/useTablePagination.ts +7 -7
- package/src/components/Table/_utils/tableUtils.ts +11 -11
- package/src/components/Table/index.module.scss +3 -3
- package/src/components/Table/index.tsx +12 -9
- package/src/components/Tags/_components/EllipsisTag/index.tsx +1 -1
- package/src/components/Tags/_components/MeasureContainer/index.tsx +1 -1
- package/src/components/Tags/_hooks/useVisibleTags.ts +13 -13
- package/src/components/Tags/_utils/calculateVisibleCount.ts +12 -12
- package/src/components/Tags/_utils/getTagColor.ts +4 -4
- package/src/components/Tags/index.tsx +4 -4
- package/src/components/TextEllipsis/index.tsx +28 -28
- package/src/components/Tree/_components/TitleSearchBar/index.tsx +2 -2
- package/src/components/Tree/_hooks/useClearNodeTitle.ts +8 -8
- package/src/components/Tree/_hooks/useTreeCheck.ts +4 -4
- package/src/components/Tree/_hooks/useTreeSearch.ts +7 -7
- package/src/components/Tree/_hooks/useTreeState.ts +10 -10
- package/src/components/Tree/_utils/index.ts +28 -28
- package/src/components/Tree/_utils/normalizeCheckedKeys.ts +16 -16
- package/src/components/Tree/index.module.scss +2 -2
- package/src/components/Tree/index.tsx +25 -24
- package/src/components/Upload/_components/UploadedItem/index.tsx +2 -2
- package/src/components/Upload/_components/UploadingItem/index.tsx +2 -2
- package/src/components/Upload/_hooks/useUploadFileList.ts +1 -1
- package/src/components/Upload/_hooks/useUploadOperations.ts +3 -3
- package/src/components/Upload/_hooks/useUploadPreview.ts +1 -1
- package/src/components/Upload/_utils/chunkUpload.ts +4 -4
- package/src/components/Upload/_utils/createFormData.ts +1 -1
- package/src/components/Upload/_utils/extractFileUrl.ts +1 -1
- package/src/components/Upload/_utils/isSuccessResponse.ts +1 -1
- package/src/components/Upload/_utils/normalUpload.ts +2 -2
- package/src/components/Upload/_utils/toMB.ts +1 -1
- package/src/components/Upload/_utils/validateFile.ts +1 -1
- package/src/components/Upload/index.tsx +2 -2
- package/src/config-provider/index.tsx +4 -4
- package/src/hooks/usePermissions.ts +3 -3
- package/src/index.ts +8 -4
- package/src/request/ResType.ts +3 -3
- package/src/request/index.ts +7 -7
- package/src/styles/antd-overload.scss +12 -9
- package/src/styles/tokens.scss +62 -0
- package/src/styles/tokens.ts +52 -0
- package/src/typings.d.ts +3 -3
- package/src/utils/getUUID.ts +1 -1
|
@@ -5,21 +5,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.translateError = translateError;
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Translate English error messages into Chinese
|
|
9
9
|
*/
|
|
10
10
|
function translateError(message) {
|
|
11
11
|
if (!message) return message;
|
|
12
12
|
let translated = message;
|
|
13
13
|
|
|
14
|
-
//
|
|
14
|
+
// Handle complete JSON error patterns first (highest priority)
|
|
15
15
|
const jsonPatterns = [[/Unexpected token (.+) in JSON at position (\d+)/gi, "JSON 中位置 $2 处意外的标记: $1"], [/Unexpected end of JSON input/gi, "JSON 输入意外结束"], [/Expected property name or '}' in JSON at position (\d+)/gi, "JSON 中位置 $1 处期望属性名或 '}'"], [/Expected double-quoted property name in JSON at position (\d+)/gi, "JSON 中位置 $1 处期望双引号属性名"], [/Expected ':' after property name in JSON at position (\d+)/gi, "JSON 中位置 $1 处属性名后期望 ':'"], [/Expected ',' or '}' after property value in JSON at position (\d+)/gi, "JSON 中位置 $1 处属性值后期望 ',' 或 '}'"], [/Expected ',' or ']' after array element in JSON at position (\d+)/gi, "JSON 中位置 $1 处数组元素后期望 ',' 或 ']'"], [/Unexpected non-whitespace character after JSON at position (\d+)/gi, "JSON 中位置 $1 处意外的非空白字符"], [/Unexpected end of JSON input/gi, "JSON 输入意外结束"]];
|
|
16
16
|
|
|
17
|
-
//
|
|
17
|
+
// Apply the complete JSON patterns
|
|
18
18
|
jsonPatterns?.forEach(([pattern, replacement]) => {
|
|
19
19
|
translated = translated.replace(pattern, replacement);
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
-
//
|
|
22
|
+
// Handle position info (if not already handled by the patterns above)
|
|
23
23
|
if (translated.includes("at position")) {
|
|
24
24
|
const positionMatch = translated.match(/at position (\d+)/);
|
|
25
25
|
if (positionMatch) {
|
|
@@ -27,47 +27,47 @@ function translateError(message) {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
//
|
|
30
|
+
// Handle common word translations (sorted by length from long to short, matching longer phrases first)
|
|
31
31
|
const wordTranslations = [["but found", "但找到"], ["in JSON", "在 JSON 中"], ["at position", "位置"], ["after property", "属性后"], ["after array", "数组后"], ["property name", "属性名"], ["property value", "属性值"], ["array element", "数组元素"], ["non-whitespace character", "非空白字符"], ["double-quoted", "双引号"], ["Unexpected", "意外的"], ["Expected", "期望"], ["Invalid", "无效的"], ["Missing", "缺少"], ["Unknown", "未知的"], ["SyntaxError", "语法错误"], ["token", "标记"], ["column", "列"], ["table", "表"], ["keyword", "关键字"], ["operator", "操作符"], ["function", "函数"], ["syntax", "语法"], ["parse", "解析"], ["error", "错误"], ["end", "结束"], ["input", "输入"], ["character", "字符"], ["found", "找到"], ["but", "但是"]];
|
|
32
32
|
|
|
33
|
-
//
|
|
33
|
+
// Apply word translations (in order, longer phrases first)
|
|
34
34
|
wordTranslations?.forEach(([en, zh]) => {
|
|
35
|
-
//
|
|
35
|
+
// For phrases, replace directly
|
|
36
36
|
if (en.includes(" ")) {
|
|
37
37
|
const regex = new RegExp(en.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "gi");
|
|
38
38
|
translated = translated.replace(regex, zh);
|
|
39
39
|
} else {
|
|
40
|
-
//
|
|
40
|
+
// For single words, use word boundaries
|
|
41
41
|
const regex = new RegExp(`\\b${en.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\b`, "gi");
|
|
42
42
|
translated = translated.replace(regex, zh);
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
//
|
|
46
|
+
// Handle common SQL error patterns
|
|
47
47
|
const sqlPatterns = [[/SyntaxError: (.+)/gi, "语法错误: $1"], [/Expected (.+) but found (.+)/gi, "期望 $1 但找到 $2"], [/Invalid (.+)/gi, "无效的 $1"], [/Missing (.+)/gi, "缺少 $1"], [/Unknown (.+)/gi, "未知的 $1"]];
|
|
48
48
|
sqlPatterns?.forEach(([pattern, replacement]) => {
|
|
49
49
|
translated = translated.replace(pattern, replacement);
|
|
50
50
|
});
|
|
51
51
|
|
|
52
|
-
//
|
|
53
|
-
translated = translated.replace(/\s+/g, " ") //
|
|
54
|
-
.replace(/\s*,\s*/g, ",") //
|
|
55
|
-
.replace(/\s*:\s*/g, ":") //
|
|
56
|
-
.replace(/\s*\.\s*/g, "。") //
|
|
52
|
+
// Clean up extra whitespace and punctuation
|
|
53
|
+
translated = translated.replace(/\s+/g, " ") // Merge multiple spaces into one
|
|
54
|
+
.replace(/\s*,\s*/g, ",") // Replace English commas with Chinese commas
|
|
55
|
+
.replace(/\s*:\s*/g, ":") // Replace English colons with Chinese colons
|
|
56
|
+
.replace(/\s*\.\s*/g, "。") // Replace English periods with Chinese periods
|
|
57
57
|
.trim();
|
|
58
58
|
|
|
59
|
-
//
|
|
60
|
-
//
|
|
59
|
+
// Final check: if obvious English words remain, try translating common words
|
|
60
|
+
// Note: these words may already have been handled by earlier translations; this is a fallback
|
|
61
61
|
const commonEnglishWords = [["or", "或"], ["and", "和"], ["of", "的"], ["with", "使用"], ["without", "没有"], ["for", "为"], ["from", "从"], ["by", "通过"], ["the", "该"], ["a", "一个"], ["an", "一个"], ["is", "是"], ["are", "是"], ["was", "是"], ["were", "是"], ["has", "有"], ["have", "有"], ["in", "在"], ["at", "在"], ["to", "到"]];
|
|
62
62
|
|
|
63
|
-
//
|
|
63
|
+
// Replace directly without checking first (avoids regex state issues)
|
|
64
64
|
commonEnglishWords?.forEach(([en, zh]) => {
|
|
65
|
-
//
|
|
65
|
+
// Use word boundaries to ensure only complete words are replaced
|
|
66
66
|
const regex = new RegExp(`\\b${en}\\b`, "gi");
|
|
67
67
|
translated = translated.replace(regex, zh);
|
|
68
68
|
});
|
|
69
69
|
|
|
70
|
-
//
|
|
70
|
+
// Final cleanup: remove extra spaces
|
|
71
71
|
translated = translated.replace(/\s+/g, " ").trim();
|
|
72
72
|
return translated;
|
|
73
73
|
}
|
|
@@ -4,10 +4,10 @@ declare const loadJsonParser: () => Promise<{
|
|
|
4
4
|
parse: (text: string) => unknown;
|
|
5
5
|
} | null>;
|
|
6
6
|
export interface JsonLinterOptions {
|
|
7
|
-
/**
|
|
7
|
+
/** Whether to translate error messages into Chinese */
|
|
8
8
|
translate?: boolean;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Whether to allow the root node to be a JSON array `[...]` (only affects top-level character validation; default false, only `{...}` is allowed)
|
|
11
11
|
*/
|
|
12
12
|
allowArrayRoot?: boolean;
|
|
13
13
|
}
|
|
@@ -8,10 +8,10 @@ exports.loadJsonParser = void 0;
|
|
|
8
8
|
var _errorTranslator = require("./errorTranslator");
|
|
9
9
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
10
10
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
|
-
//
|
|
11
|
+
// Global JSON parser instance
|
|
12
12
|
let jsonParser = null;
|
|
13
13
|
|
|
14
|
-
//
|
|
14
|
+
// Preload the JSON parser
|
|
15
15
|
const loadJsonParser = async () => {
|
|
16
16
|
if (!jsonParser) {
|
|
17
17
|
try {
|
|
@@ -41,7 +41,7 @@ function resolveJsonLinterOptions(options = false) {
|
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
// JSON
|
|
44
|
+
// JSON syntax linter (a `boolean` can be passed to only enable translate, for backward compatibility)
|
|
45
45
|
function jsonLinter(options = false) {
|
|
46
46
|
const {
|
|
47
47
|
translate,
|
|
@@ -54,7 +54,7 @@ function jsonLinter(options = false) {
|
|
|
54
54
|
return diagnostics;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
//
|
|
57
|
+
// By default the text must start with `{`; when allowArrayRoot is enabled, `[` is also allowed
|
|
58
58
|
const trimmedStart = text.trimStart();
|
|
59
59
|
const rootOk = trimmedStart.startsWith("{") || allowArrayRoot && trimmedStart.startsWith("[");
|
|
60
60
|
if (!rootOk) {
|
|
@@ -76,11 +76,11 @@ function jsonLinter(options = false) {
|
|
|
76
76
|
const error = e;
|
|
77
77
|
const message = error.message;
|
|
78
78
|
|
|
79
|
-
//
|
|
79
|
+
// Try to extract position info from the error message
|
|
80
80
|
let from = 0;
|
|
81
81
|
let to = text.length;
|
|
82
82
|
|
|
83
|
-
//
|
|
83
|
+
// Parse position info, e.g. "Unexpected token } in JSON at position 10"
|
|
84
84
|
const positionMatch = message.match(/at position (\d+)/);
|
|
85
85
|
if (positionMatch) {
|
|
86
86
|
const position = parseInt(positionMatch[1], 10);
|
|
@@ -88,7 +88,7 @@ function jsonLinter(options = false) {
|
|
|
88
88
|
to = Math.min(text.length, position + 1);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
//
|
|
91
|
+
// Decide whether to translate the error message based on the translate parameter
|
|
92
92
|
const finalMessage = translate ? (0, _errorTranslator.translateError)(message) : message;
|
|
93
93
|
diagnostics.push({
|
|
94
94
|
from,
|
|
@@ -98,7 +98,7 @@ function jsonLinter(options = false) {
|
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
100
|
} else {
|
|
101
|
-
//
|
|
101
|
+
// If the parser is not loaded yet, try to load it
|
|
102
102
|
loadJsonParser().then(parser => {
|
|
103
103
|
if (parser) {
|
|
104
104
|
try {
|
|
@@ -113,4 +113,4 @@ function jsonLinter(options = false) {
|
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
//
|
|
116
|
+
// Export the preload function for external use
|
|
@@ -8,14 +8,14 @@ exports.sqlLinter = sqlLinter;
|
|
|
8
8
|
var _errorTranslator = require("./errorTranslator");
|
|
9
9
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
10
10
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
|
-
//
|
|
11
|
+
// Global SQL parser instance
|
|
12
12
|
let sqlParser = null;
|
|
13
13
|
|
|
14
|
-
// MongoDB
|
|
14
|
+
// MongoDB parser function type
|
|
15
15
|
|
|
16
16
|
let mongoParser = null;
|
|
17
17
|
|
|
18
|
-
//
|
|
18
|
+
// Preload the SQL parser
|
|
19
19
|
const loadSqlParser = async () => {
|
|
20
20
|
if (!sqlParser) {
|
|
21
21
|
try {
|
|
@@ -30,7 +30,7 @@ const loadSqlParser = async () => {
|
|
|
30
30
|
return sqlParser;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
//
|
|
33
|
+
// Preload the MongoDB parser
|
|
34
34
|
exports.loadSqlParser = loadSqlParser;
|
|
35
35
|
const loadMongoParser = async () => {
|
|
36
36
|
if (!mongoParser) {
|
|
@@ -44,17 +44,17 @@ const loadMongoParser = async () => {
|
|
|
44
44
|
return mongoParser;
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
//
|
|
47
|
+
// Detect whether the text is a MongoDB use statement
|
|
48
48
|
exports.loadMongoParser = loadMongoParser;
|
|
49
49
|
function isMongoUseStatement(text) {
|
|
50
50
|
const trimmed = text.trim();
|
|
51
|
-
// MongoDB use
|
|
52
|
-
//
|
|
51
|
+
// MongoDB use statement format: use database_name
|
|
52
|
+
// The database name may contain letters, digits, underscores, hyphens, etc.
|
|
53
53
|
const usePattern = /^use\s+[a-zA-Z0-9_-]+(\s*;?\s*)$/i;
|
|
54
54
|
return usePattern.test(trimmed);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
//
|
|
57
|
+
// Validate a MongoDB use statement
|
|
58
58
|
function validateMongoUseStatement(text) {
|
|
59
59
|
const trimmed = text.trim();
|
|
60
60
|
if (!trimmed) {
|
|
@@ -64,7 +64,7 @@ function validateMongoUseStatement(text) {
|
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
//
|
|
67
|
+
// Check the format: use database_name
|
|
68
68
|
const usePattern = /^use\s+([a-zA-Z0-9_-]+)(\s*;?\s*)$/i;
|
|
69
69
|
const match = trimmed.match(usePattern);
|
|
70
70
|
if (!match) {
|
|
@@ -81,7 +81,7 @@ function validateMongoUseStatement(text) {
|
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
//
|
|
84
|
+
// The database name cannot start with a digit
|
|
85
85
|
if (/^\d/.test(dbName)) {
|
|
86
86
|
return {
|
|
87
87
|
valid: false,
|
|
@@ -93,21 +93,21 @@ function validateMongoUseStatement(text) {
|
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
//
|
|
96
|
+
// Detect the query type: SQL or MongoDB
|
|
97
97
|
function detectQueryType(text) {
|
|
98
98
|
const trimmed = text.trim();
|
|
99
99
|
|
|
100
|
-
//
|
|
100
|
+
// First check whether it might be a MongoDB query (MongoDB shell command format)
|
|
101
101
|
const isMongo = trimmed.startsWith("db.") || trimmed.includes(".find(") || trimmed.includes(".aggregate(") || trimmed.includes(".insert(") || trimmed.includes(".update(") || trimmed.includes(".delete(") || trimmed.includes(".remove(") || trimmed.startsWith("use ");
|
|
102
102
|
if (isMongo) {
|
|
103
103
|
return "mongodb";
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
//
|
|
106
|
+
// Fall back to SQL by default
|
|
107
107
|
return "sql";
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
// SQL
|
|
110
|
+
// SQL and MongoDB syntax linter (auto-detected)
|
|
111
111
|
function sqlLinter(translate = false) {
|
|
112
112
|
return view => {
|
|
113
113
|
const diagnostics = [];
|
|
@@ -116,25 +116,25 @@ function sqlLinter(translate = false) {
|
|
|
116
116
|
return diagnostics;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
//
|
|
119
|
+
// Split the text by lines
|
|
120
120
|
const lines = text.split("\n");
|
|
121
121
|
let currentOffset = 0;
|
|
122
122
|
const nonUseLines = [];
|
|
123
123
|
|
|
124
|
-
//
|
|
124
|
+
// First pass: check use lines individually, collect non-use lines
|
|
125
125
|
for (let i = 0; i < lines.length; i++) {
|
|
126
126
|
const line = lines[i];
|
|
127
127
|
const lineStart = currentOffset;
|
|
128
128
|
const lineEnd = currentOffset + line.length;
|
|
129
129
|
const trimmedLine = line.trim();
|
|
130
130
|
|
|
131
|
-
//
|
|
131
|
+
// Skip empty lines
|
|
132
132
|
if (!trimmedLine) {
|
|
133
|
-
currentOffset = lineEnd + 1; // +1
|
|
133
|
+
currentOffset = lineEnd + 1; // +1 for the newline character
|
|
134
134
|
continue;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
//
|
|
137
|
+
// Check use lines individually
|
|
138
138
|
if (isMongoUseStatement(trimmedLine)) {
|
|
139
139
|
const validation = validateMongoUseStatement(trimmedLine);
|
|
140
140
|
if (!validation.valid) {
|
|
@@ -146,27 +146,27 @@ function sqlLinter(translate = false) {
|
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
148
|
} else {
|
|
149
|
-
//
|
|
149
|
+
// Collect non-use lines
|
|
150
150
|
nonUseLines.push({
|
|
151
151
|
line: line,
|
|
152
152
|
start: lineStart,
|
|
153
153
|
end: lineEnd
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
|
-
currentOffset = lineEnd + 1; // +1
|
|
156
|
+
currentOffset = lineEnd + 1; // +1 for the newline character
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
//
|
|
159
|
+
// Second pass: validate all non-use lines together
|
|
160
160
|
if (nonUseLines.length > 0) {
|
|
161
|
-
//
|
|
161
|
+
// Merge all non-use lines
|
|
162
162
|
const nonUseText = nonUseLines?.map(item => item.line).join("\n");
|
|
163
163
|
const nonUseStart = nonUseLines[0].start;
|
|
164
164
|
const nonUseEnd = nonUseLines[nonUseLines.length - 1].end;
|
|
165
165
|
|
|
166
|
-
//
|
|
166
|
+
// Determine the query type
|
|
167
167
|
const queryType = detectQueryType(nonUseText);
|
|
168
168
|
if (queryType === "mongodb") {
|
|
169
|
-
// MongoDB
|
|
169
|
+
// Validate MongoDB statements with mongoParser
|
|
170
170
|
if (mongoParser) {
|
|
171
171
|
try {
|
|
172
172
|
mongoParser(nonUseText);
|
|
@@ -180,7 +180,7 @@ function sqlLinter(translate = false) {
|
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
182
|
} else {
|
|
183
|
-
//
|
|
183
|
+
// If the parser is not loaded yet, try to load it
|
|
184
184
|
loadMongoParser().then(parser => {
|
|
185
185
|
if (parser) {
|
|
186
186
|
try {
|
|
@@ -192,7 +192,7 @@ function sqlLinter(translate = false) {
|
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
194
|
} else {
|
|
195
|
-
// SQL
|
|
195
|
+
// Validate SQL statements with the SQL parser
|
|
196
196
|
if (sqlParser) {
|
|
197
197
|
try {
|
|
198
198
|
sqlParser.astify(nonUseText);
|
|
@@ -206,7 +206,7 @@ function sqlLinter(translate = false) {
|
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
208
|
} else {
|
|
209
|
-
//
|
|
209
|
+
// If the parser is not loaded yet, try to load it
|
|
210
210
|
loadSqlParser().then(parser => {
|
|
211
211
|
if (parser) {
|
|
212
212
|
try {
|
|
@@ -223,4 +223,4 @@ function sqlLinter(translate = false) {
|
|
|
223
223
|
};
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
-
//
|
|
226
|
+
// Export the preload functions for external use
|
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
|
|
9
9
|
font-size: 14px;
|
|
10
10
|
line-height: 18px;
|
|
11
|
-
color:
|
|
11
|
+
color: var(--cf-text-2);
|
|
12
12
|
|
|
13
13
|
cursor: pointer;
|
|
14
14
|
|
|
15
15
|
transition: color 0.3s, background-color 0.3s;
|
|
16
16
|
|
|
17
17
|
&:hover {
|
|
18
|
-
color:
|
|
18
|
+
color: var(--cf-text);
|
|
19
19
|
|
|
20
|
-
background-color:
|
|
20
|
+
background-color: var(--cf-row-hover);
|
|
21
21
|
|
|
22
22
|
border-radius: 4px;
|
|
23
23
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Mount the date popup on the current antd Modal's wrap to avoid clipping by a parent's overflow:hidden (e.g. when embedded in a modal);
|
|
3
|
+
* consistent with the usual behavior of formerly standalone popups inside large-screen BaseModals such as data resources. Falls back to document.body in non-modal scenarios.
|
|
4
4
|
*/
|
|
5
5
|
export declare function defaultModalPickerGetPopupContainer(node: HTMLElement): HTMLElement;
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.defaultModalPickerGetPopupContainer = defaultModalPickerGetPopupContainer;
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* Mount the date popup on the current antd Modal's wrap to avoid clipping by a parent's overflow:hidden (e.g. when embedded in a modal);
|
|
9
|
+
* consistent with the usual behavior of formerly standalone popups inside large-screen BaseModals such as data resources. Falls back to document.body in non-modal scenarios.
|
|
10
10
|
*/
|
|
11
11
|
function defaultModalPickerGetPopupContainer(node) {
|
|
12
12
|
return node.closest(".ant-modal-wrap") ?? document.body;
|
|
@@ -60,7 +60,7 @@ const DatePicker = props => {
|
|
|
60
60
|
const defaultValueRef = (0, _react.useRef)(defaultValue);
|
|
61
61
|
const showTimeRef = (0, _react.useRef)(showTime);
|
|
62
62
|
|
|
63
|
-
//
|
|
63
|
+
// Keep refs up to date
|
|
64
64
|
(0, _react.useEffect)(() => {
|
|
65
65
|
onChangeRef.current = onChange;
|
|
66
66
|
valueRef.current = value;
|
|
@@ -68,7 +68,7 @@ const DatePicker = props => {
|
|
|
68
68
|
showTimeRef.current = showTime;
|
|
69
69
|
}, [onChange, value, defaultValue, showTime]);
|
|
70
70
|
|
|
71
|
-
//
|
|
71
|
+
// Helper function for formatting date values
|
|
72
72
|
const formatDateByPicker = (0, _react.useCallback)((dateValue, pickerType) => {
|
|
73
73
|
if (pickerType === "date") {
|
|
74
74
|
if (showTimeRef.current) {
|
|
@@ -89,19 +89,19 @@ const DatePicker = props => {
|
|
|
89
89
|
return "";
|
|
90
90
|
}, []);
|
|
91
91
|
|
|
92
|
-
//
|
|
92
|
+
// Handle onChange when the picker changes
|
|
93
93
|
const handlePickerChange = (0, _react.useCallback)(newPicker => {
|
|
94
|
-
//
|
|
94
|
+
// When the picker changes, trigger onChange once
|
|
95
95
|
if (onChangeRef.current) {
|
|
96
|
-
//
|
|
96
|
+
// Prefer value; fall back to defaultValue if absent
|
|
97
97
|
const currentValue = valueRef.current ?? defaultValueRef.current;
|
|
98
98
|
if (currentValue) {
|
|
99
|
-
//
|
|
99
|
+
// If there is a current or default value, reformat it with the new picker format
|
|
100
100
|
const dateValue = (0, _dayjs.default)(currentValue.toString());
|
|
101
101
|
const formattedDate = formatDateByPicker(dateValue, newPicker);
|
|
102
102
|
onChangeRef.current(formattedDate, newPicker);
|
|
103
103
|
} else {
|
|
104
|
-
//
|
|
104
|
+
// If there is neither a value nor a default value, trigger onChange with an empty string
|
|
105
105
|
onChangeRef.current("", newPicker);
|
|
106
106
|
}
|
|
107
107
|
}
|
|
@@ -110,11 +110,11 @@ const DatePicker = props => {
|
|
|
110
110
|
if (pickerProps !== undefined) {
|
|
111
111
|
const prevPicker = prevPickerRef.current;
|
|
112
112
|
|
|
113
|
-
//
|
|
113
|
+
// Mark as initialized
|
|
114
114
|
if (!isInitializedRef.current) {
|
|
115
115
|
isInitializedRef.current = true;
|
|
116
116
|
} else {
|
|
117
|
-
//
|
|
117
|
+
// When the picker changes, trigger onChange once (excluding initialization)
|
|
118
118
|
if (prevPicker !== undefined && prevPicker !== pickerProps) {
|
|
119
119
|
handlePickerChange(pickerProps);
|
|
120
120
|
}
|
|
@@ -17,7 +17,7 @@ const EditorContent = props => {
|
|
|
17
17
|
value = ""
|
|
18
18
|
} = props;
|
|
19
19
|
|
|
20
|
-
//
|
|
20
|
+
// Editor configuration
|
|
21
21
|
const editorConfig = {
|
|
22
22
|
readOnly: true,
|
|
23
23
|
autoFocus: false
|
|
@@ -45,10 +45,10 @@ const Editor = props => {
|
|
|
45
45
|
setHtml(value || "");
|
|
46
46
|
}, [value]);
|
|
47
47
|
|
|
48
|
-
//
|
|
48
|
+
// Toolbar configuration
|
|
49
49
|
const toolbarConfig = {};
|
|
50
50
|
|
|
51
|
-
//
|
|
51
|
+
// Editor configuration
|
|
52
52
|
const editorConfig = {
|
|
53
53
|
placeholder,
|
|
54
54
|
autoFocus: false,
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
border-radius: 6px;
|
|
12
12
|
|
|
13
13
|
.toolbar {
|
|
14
|
-
border-bottom: 1px solid
|
|
14
|
+
border-bottom: 1px solid var(--cf-border);
|
|
15
15
|
|
|
16
16
|
.w-e-bar-item {
|
|
17
17
|
color: var(--cf-text-3);
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
cursor: not-allowed;
|
|
34
34
|
|
|
35
35
|
.w-e-text-container {
|
|
36
|
-
background-color:
|
|
36
|
+
background-color: var(--cf-subtle);
|
|
37
37
|
|
|
38
38
|
color: var(--cf-text-3);
|
|
39
39
|
}
|
|
@@ -27,10 +27,10 @@ const FileCol = props => {
|
|
|
27
27
|
className: _indexModule.default.fileItem,
|
|
28
28
|
children: [!hideNm && /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
29
29
|
title: file.name,
|
|
30
|
-
color: "
|
|
30
|
+
color: "var(--cf-subtle)",
|
|
31
31
|
styles: {
|
|
32
32
|
body: {
|
|
33
|
-
color: "
|
|
33
|
+
color: "var(--cf-text)",
|
|
34
34
|
padding: "6px 16px"
|
|
35
35
|
}
|
|
36
36
|
},
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
|
|
64
64
|
border-radius: 4px;
|
|
65
65
|
|
|
66
|
-
background-color:
|
|
66
|
+
background-color: var(--cf-surface);
|
|
67
67
|
|
|
68
68
|
overflow: auto;
|
|
69
69
|
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
&::-webkit-scrollbar-track {
|
|
76
|
-
background-color:
|
|
76
|
+
background-color: var(--cf-surface);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
}
|
|
@@ -133,11 +133,11 @@
|
|
|
133
133
|
|
|
134
134
|
padding: 5px 10px;
|
|
135
135
|
|
|
136
|
-
background-color:
|
|
136
|
+
background-color: var(--cf-surface);
|
|
137
137
|
|
|
138
138
|
border-radius: 4px;
|
|
139
139
|
|
|
140
|
-
box-shadow:
|
|
140
|
+
box-shadow: var(--cf-shadow-3);
|
|
141
141
|
|
|
142
142
|
.toolItem {
|
|
143
143
|
display: flex;
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
cursor: pointer;
|
|
162
162
|
|
|
163
163
|
&:hover {
|
|
164
|
-
background-color:
|
|
164
|
+
background-color: var(--cf-row-hover);
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
&.disabled {
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
|
|
74
74
|
border-radius: 4px;
|
|
75
75
|
|
|
76
|
-
background-color:
|
|
76
|
+
background-color: var(--cf-surface);
|
|
77
77
|
|
|
78
78
|
overflow: auto;
|
|
79
79
|
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
&::-webkit-scrollbar-track {
|
|
86
|
-
background-color:
|
|
86
|
+
background-color: var(--cf-surface);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { RefObject } from "react";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* @param containerRef
|
|
5
|
-
* @param columnNum
|
|
6
|
-
* @param enabled
|
|
7
|
-
* @param minColumnNum
|
|
8
|
-
* @param maxColumnNum
|
|
9
|
-
* @param baseWidth
|
|
3
|
+
* Dynamically adjust the column count based on container width
|
|
4
|
+
* @param containerRef Container whose width should be observed
|
|
5
|
+
* @param columnNum Base column count
|
|
6
|
+
* @param enabled Whether adaptive mode is enabled
|
|
7
|
+
* @param minColumnNum Minimum column count
|
|
8
|
+
* @param maxColumnNum Maximum column count
|
|
9
|
+
* @param baseWidth Reference width (adjustable per design spec)
|
|
10
10
|
*/
|
|
11
11
|
export declare const useAdaptiveColumnNum: (containerRef: RefObject<HTMLElement> | HTMLElement | null, columnNum: number, enabled?: boolean, minColumnNum?: number, maxColumnNum?: number, baseWidth?: number, active?: boolean) => number;
|
|
@@ -6,13 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.useAdaptiveColumnNum = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
* @param containerRef
|
|
11
|
-
* @param columnNum
|
|
12
|
-
* @param enabled
|
|
13
|
-
* @param minColumnNum
|
|
14
|
-
* @param maxColumnNum
|
|
15
|
-
* @param baseWidth
|
|
9
|
+
* Dynamically adjust the column count based on container width
|
|
10
|
+
* @param containerRef Container whose width should be observed
|
|
11
|
+
* @param columnNum Base column count
|
|
12
|
+
* @param enabled Whether adaptive mode is enabled
|
|
13
|
+
* @param minColumnNum Minimum column count
|
|
14
|
+
* @param maxColumnNum Maximum column count
|
|
15
|
+
* @param baseWidth Reference width (adjustable per design spec)
|
|
16
16
|
*/
|
|
17
17
|
const useAdaptiveColumnNum = (containerRef, columnNum, enabled = true, minColumnNum = 1, maxColumnNum, baseWidth = 1200, active = true) => {
|
|
18
18
|
const [adaptiveColumnNum, setAdaptiveColumnNum] = (0, _react.useState)(columnNum);
|
|
@@ -29,7 +29,7 @@ const useAdaptiveColumnNum = (containerRef, columnNum, enabled = true, minColumn
|
|
|
29
29
|
if (!container) return;
|
|
30
30
|
const containerWidth = container.parentElement.offsetWidth;
|
|
31
31
|
|
|
32
|
-
//
|
|
32
|
+
// Scale proportionally to the current container width, using baseWidth as the baseline
|
|
33
33
|
let next = Math.round(columnNum * containerWidth / baseWidth);
|
|
34
34
|
if (next < minColumnNum) next = minColumnNum;
|
|
35
35
|
if (maxColumnNum !== undefined && next > maxColumnNum) {
|