@para-ui/core 5.0.0-beta.8 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +315 -0
- package/AlignBox/component.json +89 -0
- package/Anchor/component.json +130 -0
- package/Argv/component.json +216 -0
- package/AutoBox/component.json +133 -0
- package/AutoButton/component.json +109 -0
- package/AutoTips/component.json +121 -0
- package/Badge/component.json +92 -0
- package/Breadcrumbs/component.json +142 -0
- package/Button/component.json +168 -0
- package/ButtonGroup/component.json +132 -0
- package/Card/component.json +162 -0
- package/Carousel/component.json +142 -0
- package/Cascader/component.json +196 -0
- package/Checkbox/component.json +138 -0
- package/CheckboxGroup/component.json +152 -0
- package/CodeEditor/component.json +189 -0
- package/Collapse/component.json +166 -0
- package/CollapseBox/component.json +84 -0
- package/CollapseLayout/component.json +155 -0
- package/ColorPicker/component.json +142 -0
- package/ComboSelect/component.json +181 -0
- package/Container/component.json +111 -0
- package/ContentBox/component.json +81 -0
- package/CopyText/component.json +118 -0
- package/CycleSelector/component.json +98 -0
- package/DatePicker/component.json +192 -0
- package/Descriptions/component.json +142 -0
- package/Desktop/component.json +171 -0
- package/DragVerify/component.json +114 -0
- package/Drawer/component.json +200 -0
- package/Dropdown/component.json +147 -0
- package/DynamicMultiBox/component.json +278 -0
- package/Empty/component.json +123 -0
- package/ExpressionInput/component.json +79 -0
- package/FieldForm/component.json +196 -0
- package/Form/component.json +161 -0
- package/FormItem/component.json +171 -0
- package/FunctionModal/component.json +197 -0
- package/Help/component.json +118 -0
- package/HelperText/component.json +126 -0
- package/Image/component.json +165 -0
- package/InputCode/component.json +191 -0
- package/InputLang/component.json +205 -0
- package/InputNumber/component.json +162 -0
- package/Label/component.json +126 -0
- package/Loading/component.json +91 -0
- package/Menu/component.json +180 -0
- package/Message/component.json +246 -0
- package/Modal/component.json +277 -0
- package/MultiBox/component.json +216 -0
- package/Notification/component.json +184 -0
- package/OperateBtn/component.json +134 -0
- package/PageHeader/component.json +112 -0
- package/Pagination/component.json +181 -0
- package/PasswordRules/component.json +105 -0
- package/PopConfirm/component.json +227 -0
- package/PopMenu/component.json +131 -0
- package/Popover/component.json +165 -0
- package/Progress/component.json +161 -0
- package/Prompt/component.json +144 -0
- package/Querying/component.json +96 -0
- package/QuickReply/component.json +129 -0
- package/README.md +0 -5
- package/Radio/component.json +136 -0
- package/RadioGroup/component.json +149 -0
- package/RangeInput/component.json +198 -0
- package/Result/component.json +104 -0
- package/ScrollBar/component.json +115 -0
- package/Search/component.json +177 -0
- package/Select/component.json +244 -0
- package/SelectInput/component.json +184 -0
- package/Selector/component.json +203 -0
- package/SelectorPicker/component.json +179 -0
- package/SingleBox/component.json +151 -0
- package/Slider/component.json +181 -0
- package/SortBox/component.json +108 -0
- package/Status/component.json +104 -0
- package/Stepper/component.json +129 -0
- package/Switch/component.json +207 -0
- package/Table/component.json +547 -0
- package/Tabs/component.json +227 -0
- package/Tag/component.json +221 -0
- package/TextEditor/component.json +186 -0
- package/TextField/component.json +290 -0
- package/TimePicker/component.json +176 -0
- package/Timeline/component.json +110 -0
- package/Title/component.json +156 -0
- package/ToggleButton/component.json +153 -0
- package/Tooltip/component.json +176 -0
- package/Transfer/component.json +157 -0
- package/Tree/component.json +512 -0
- package/Upload/component.json +450 -0
- package/ai-workflows/01-crud-list-multi-drawer.md +278 -0
- package/ai-workflows/02-rbac-operation-buttons.md +290 -0
- package/ai-workflows/03-complex-form-async-cascade.md +350 -0
- package/ai-workflows/04-array-field-form.md +281 -0
- package/ai-workflows/05-popconfirm-async-message-queue.md +333 -0
- package/ai-workflows/06-modal-drawer-form-workflow.md +385 -0
- package/ai-workflows/07-search-filter-table-trio.md +387 -0
- package/ai-workflows/08-table-advanced-features.md +365 -0
- package/ai-workflows/09-batch-operation-export-progress.md +367 -0
- package/ai-workflows/10-cross-component-state-coordination.md +412 -0
- package/es/AlignBox/component.json +89 -0
- package/es/AlignBox/index.css +1 -1
- package/es/AlignBox/index.d.ts +6 -2
- package/es/AlignBox/index.js +1 -1
- package/es/AlignBox/style/index.css +1 -1
- package/es/Anchor/anchorMenu/index.d.ts +2 -1
- package/es/Anchor/anchorMenu/index.js +36 -33
- package/es/Anchor/component.json +130 -0
- package/es/Anchor/index.js +52 -49
- package/es/Anchor/type.d.ts +8 -4
- package/es/Argv/batchEdit/index.js +1 -1
- package/es/Argv/component.json +216 -0
- package/es/Argv/dataGenerator/index.js +1 -1
- package/es/Argv/index.d.ts +5 -6
- package/es/Argv/index.js +1 -1
- package/es/AutoBox/component.json +133 -0
- package/es/AutoBox/index.d.ts +3 -3
- package/es/AutoBox/index.js +1 -1
- package/es/AutoBox/protal.d.ts +2 -2
- package/es/AutoBox/protal.js +33 -30
- package/es/AutoButton/component.json +109 -0
- package/es/AutoButton/index.js +1 -1
- package/es/AutoTips/autoTipsMultiline/index.d.ts +1 -1
- package/es/AutoTips/autoTipsMultiline/index.js +1 -1
- package/es/AutoTips/component.json +121 -0
- package/es/AutoTips/index.js +1 -1
- package/es/Badge/component.json +92 -0
- package/es/Breadcrumbs/component.json +142 -0
- package/es/Breadcrumbs/index.js +1 -1
- package/es/Button/SplitButton.d.ts +2 -2
- package/es/Button/component.json +168 -0
- package/es/Button/index.js +44 -44
- package/es/ButtonGroup/component.json +132 -0
- package/es/ButtonGroup/index.d.ts +1 -1
- package/es/Card/component.json +162 -0
- package/es/Card/index.d.ts +2 -2
- package/es/Card/index.js +2 -2
- package/es/Carousel/component.json +142 -0
- package/es/Carousel/index.d.ts +1 -1
- package/es/Cascader/Cascader.js +1 -1
- package/es/Cascader/OptionList/Column.js +1 -1
- package/es/Cascader/OptionList/index.js +1 -1
- package/es/Cascader/component.json +196 -0
- package/es/Cascader/hooks/useEntities.js +7 -7
- package/es/Cascader/interface.d.ts +1 -0
- package/es/Cascader/utils/commonUtil.d.ts +1 -1
- package/es/Cascader/utils/commonUtil.js +16 -16
- package/es/Cascader/utils/treeUtil.d.ts +14 -5
- package/es/Cascader/utils/treeUtil.js +1 -1
- package/es/Checkbox/component.json +138 -0
- package/es/CheckboxGroup/component.json +152 -0
- package/es/CheckboxGroup/index.js +1 -1
- package/es/CodeEditor/component.json +189 -0
- package/es/CodeEditor/index.d.ts +11 -10
- package/es/CodeEditor/index.js +25 -25
- package/es/Collapse/component.json +166 -0
- package/es/Collapse/index.d.ts +1 -1
- package/es/Collapse/index.js +23 -22
- package/es/CollapseBox/component.json +84 -0
- package/es/CollapseLayout/component.json +155 -0
- package/es/ColorPicker/component.json +142 -0
- package/es/ComboSelect/component.json +181 -0
- package/es/ComboSelect/index.js +115 -109
- package/es/ComboSelect/interface.d.ts +2 -2
- package/es/ComboSelect/utils.d.ts +3 -3
- package/es/ComboSelect/utils.js +1 -1
- package/es/Container/component.json +111 -0
- package/es/ContentBox/component.json +81 -0
- package/es/CopyText/component.json +118 -0
- package/es/CycleSelector/component.json +98 -0
- package/es/CycleSelector/index.js +14 -13
- package/es/DatePicker/component.json +192 -0
- package/es/DatePicker/generatePicker/generateRangePicker.js +11 -11
- package/es/DatePicker/generatePicker/generateSinglePicker.js +2 -2
- package/es/Descriptions/component.json +142 -0
- package/es/Descriptions/index.d.ts +1 -1
- package/es/Desktop/component.json +171 -0
- package/es/Desktop/index.js +1 -1
- package/es/DragVerify/component.json +114 -0
- package/es/DragVerify/index.js +19 -19
- package/es/Drawer/component.json +200 -0
- package/es/Drawer/index.js +86 -86
- package/es/Drawer/interface.d.ts +1 -1
- package/es/Drawer/util.d.ts +1 -6
- package/es/Drawer/util.js +9 -6
- package/es/Dropdown/component.json +147 -0
- package/es/Dropdown/index.js +1 -1
- package/es/DynamicMultiBox/component.json +278 -0
- package/es/DynamicMultiBox/formItem.d.ts +1 -1
- package/es/DynamicMultiBox/index.d.ts +2 -2
- package/es/DynamicMultiBox/index.js +1 -1
- package/es/DynamicMultiBox/interface.d.ts +76 -76
- package/es/DynamicMultiBox/rowForm.d.ts +2 -2
- package/es/Empty/component.json +123 -0
- package/es/Empty/index.css +1 -1
- package/es/Empty/index.d.ts +2 -2
- package/es/Empty/index.js +27 -26
- package/es/Empty/style/index.css +1 -1
- package/es/ExpressionInput/HighlightOverlay.d.ts +8 -0
- package/es/ExpressionInput/HighlightOverlay.js +27 -0
- package/es/ExpressionInput/Popup.d.ts +19 -0
- package/es/ExpressionInput/Popup.js +93 -0
- package/es/ExpressionInput/component.json +79 -0
- package/es/ExpressionInput/detectChainAtCursor.d.ts +17 -0
- package/es/ExpressionInput/detectChainAtCursor.js +31 -0
- package/es/ExpressionInput/filterCandidatesByPartial.d.ts +2 -0
- package/es/ExpressionInput/filterCandidatesByPartial.js +15 -0
- package/es/ExpressionInput/highlightSegments.d.ts +9 -0
- package/es/ExpressionInput/highlightSegments.js +14 -0
- package/es/ExpressionInput/index.css +1 -0
- package/es/ExpressionInput/index.d.ts +5 -0
- package/es/ExpressionInput/index.js +178 -0
- package/es/ExpressionInput/interface.d.ts +52 -0
- package/es/ExpressionInput/isExpressionValue.d.ts +5 -0
- package/es/ExpressionInput/isExpressionValue.js +18 -0
- package/es/ExpressionInput/lang/en_US.d.ts +4 -0
- package/es/ExpressionInput/lang/en_US.js +7 -0
- package/es/ExpressionInput/lang/index.d.ts +9 -0
- package/es/ExpressionInput/lang/index.js +10 -0
- package/es/ExpressionInput/lang/zh_CN.d.ts +4 -0
- package/es/ExpressionInput/lang/zh_CN.js +7 -0
- package/es/ExpressionInput/style/css.js +1 -0
- package/es/ExpressionInput/style/index.css +1 -0
- package/es/ExpressionInput/style/index.js +1 -0
- package/es/ExpressionInput/useExpressionInput.d.ts +26 -0
- package/es/ExpressionInput/useExpressionInput.js +59 -0
- package/es/FieldForm/FieldFormItem/ItemHolder.js +1 -1
- package/es/FieldForm/FieldFormItem/MemoInput.d.ts +2 -2
- package/es/FieldForm/FieldFormItem/StatusProvider.js +1 -1
- package/es/FieldForm/FieldFormItem/index.d.ts +6 -6
- package/es/FieldForm/Form.d.ts +2 -2
- package/es/FieldForm/Form.js +1 -1
- package/es/FieldForm/FormItemInput.js +1 -1
- package/es/FieldForm/FormItemLabel.js +1 -1
- package/es/FieldForm/FormList.d.ts +2 -2
- package/es/FieldForm/component.json +196 -0
- package/es/FieldForm/context.d.ts +5 -1
- package/es/FieldForm/context.js +2 -2
- package/es/FieldForm/hooks/useForm.d.ts +4 -3
- package/es/FieldForm/hooks/useFormInstance.d.ts +1 -1
- package/es/FieldForm/hooks/useFormItemStatus.d.ts +9 -5
- package/es/FieldForm/hooks/useFormItemStatus.js +2 -2
- package/es/FieldForm/hooks/useItemRef.d.ts +1 -1
- package/es/FieldForm/hooks/useItemRef.js +6 -6
- package/es/Form/component.json +161 -0
- package/es/Form/index.d.ts +52 -49
- package/es/Form/index.js +1 -1
- package/es/FormItem/compoments/defaultCompoments/index.d.ts +5 -5
- package/es/FormItem/compoments/defaultCompoments/index.js +12 -11
- package/es/FormItem/compoments/formCheckboxGroup/index.d.ts +2 -2
- package/es/FormItem/compoments/formFile/index.js +8 -8
- package/es/FormItem/compoments/formRadioGroup/index.d.ts +1 -1
- package/es/FormItem/compoments/formSelect/index.d.ts +1 -1
- package/es/FormItem/component.json +171 -0
- package/es/FormItem/index.d.ts +5 -5
- package/es/FormItem/index.js +23 -23
- package/es/FormItem/itemType.js +1 -1
- package/es/FunctionModal/component.json +197 -0
- package/es/FunctionModal/dialog.d.ts +1 -1
- package/es/FunctionModal/modalContext.d.ts +4 -1
- package/es/GlobalContext/confirmLocale.js +1 -1
- package/es/GlobalContext/index.js +1 -1
- package/es/Help/component.json +118 -0
- package/es/HelperText/component.json +126 -0
- package/es/Image/PreviewGroup.js +1 -1
- package/es/Image/component.json +165 -0
- package/es/Image/index.js +1 -1
- package/es/InputCode/component.json +191 -0
- package/es/InputCode/index.d.ts +2 -2
- package/es/InputCode/index.js +1 -1
- package/es/InputLang/component.json +205 -0
- package/es/InputLang/index.js +2 -2
- package/es/InputNumber/component.json +162 -0
- package/es/InputNumber/index.d.ts +13 -7
- package/es/InputNumber/index.js +152 -144
- package/es/Label/component.json +126 -0
- package/es/Label/index.d.ts +2 -2
- package/es/Loading/component.json +91 -0
- package/es/Menu/component.json +180 -0
- package/es/Menu/verticalMenuList.js +1 -1
- package/es/Message/component.json +246 -0
- package/es/Message/index.d.ts +2 -2
- package/es/Message/index.js +19 -19
- package/es/Modal/Confirm/index.d.ts +1 -1
- package/es/Modal/Confirm/index.js +1 -1
- package/es/Modal/component.json +277 -0
- package/es/Modal/index.d.ts +85 -5
- package/es/Modal/index.js +159 -122
- package/es/Modal/interface.d.ts +1 -0
- package/es/MultiBox/component.json +216 -0
- package/es/MultiBox/index.js +19 -14
- package/es/Notification/component.json +184 -0
- package/es/OperateBtn/component.json +134 -0
- package/es/OperateBtn/index.d.ts +3 -3
- package/es/PageHeader/component.json +112 -0
- package/es/PageHeader/horizontalMeun.js +1 -1
- package/es/PageHeader/horizontalMeunRight.js +1 -1
- package/es/Pagination/component.json +181 -0
- package/es/Pagination/index.js +15 -15
- package/es/ParauiProvider/index.js +1 -1
- package/es/PasswordRules/component.json +105 -0
- package/es/PasswordRules/index.d.ts +4 -4
- package/es/PopConfirm/component.json +227 -0
- package/es/PopConfirm/index.d.ts +1 -1
- package/es/PopConfirm/index.js +1 -1
- package/es/PopMenu/component.json +131 -0
- package/es/PopMenu/hooks.d.ts +1 -1
- package/es/PopMenu/index.js +8 -8
- package/es/Popover/component.json +165 -0
- package/es/Popover/index.js +1 -1
- package/es/Progress/component.json +161 -0
- package/es/Prompt/component.json +144 -0
- package/es/Querying/component.json +96 -0
- package/es/Querying/index.css +1 -1
- package/es/Querying/index.d.ts +2 -2
- package/es/Querying/index.js +20 -19
- package/es/Querying/style/index.css +1 -1
- package/es/QuickReply/QuickReplyCode/index.js +1 -1
- package/es/QuickReply/component.json +129 -0
- package/es/QuickReply/index.d.ts +1 -1
- package/es/Radio/component.json +136 -0
- package/es/RadioGroup/component.json +149 -0
- package/es/RangeInput/component.json +198 -0
- package/es/RangeInput/index.d.ts +15 -7
- package/es/RangeInput/index.js +120 -103
- package/es/Result/component.json +104 -0
- package/es/ScrollBar/component.json +115 -0
- package/es/Search/component.json +177 -0
- package/es/Search/index.d.ts +1 -1
- package/es/Select/component.json +244 -0
- package/es/Select/index.d.ts +11 -8
- package/es/Select/index.js +441 -438
- package/es/SelectInput/component.json +184 -0
- package/es/SelectInput/index.d.ts +4 -4
- package/es/SelectInput/index.js +8 -8
- package/es/Selector/component.json +203 -0
- package/es/Selector/index.js +56 -50
- package/es/Selector/interface.d.ts +2 -2
- package/es/Selector/selectorData/index.js +1 -1
- package/es/Selector/selectorMain/index.js +3 -3
- package/es/Selector/selectorNode/index.js +1 -1
- package/es/Selector/util.d.ts +3 -3
- package/es/Selector/util.js +6 -12
- package/es/SelectorPicker/component.json +179 -0
- package/es/SelectorPicker/index.d.ts +5 -5
- package/es/SelectorPicker/index.js +15 -15
- package/es/SingleBox/component.json +151 -0
- package/es/SingleBox/index.d.ts +2 -2
- package/es/Slider/component.json +181 -0
- package/es/SortBox/component.json +108 -0
- package/es/Status/component.json +104 -0
- package/es/Stepper/component.json +129 -0
- package/es/Stepper/index.d.ts +2 -2
- package/es/Switch/component.json +207 -0
- package/es/Switch/index.css +1 -1
- package/es/Switch/index.d.ts +3 -2
- package/es/Switch/index.js +60 -59
- package/es/Switch/style/index.css +1 -1
- package/es/Table/component.json +547 -0
- package/es/Table/index.d.ts +2 -2
- package/es/Table/index.js +385 -382
- package/es/Table/interface.d.ts +30 -0
- package/es/Table/tableHead.js +1 -1
- package/es/Table/util.d.ts +1 -1
- package/es/Table/util.js +3 -12
- package/es/Tabs/component.json +227 -0
- package/es/Tag/component.json +221 -0
- package/es/Tag/index.css +1 -1
- package/es/Tag/index.d.ts +1 -1
- package/es/Tag/index.js +20 -20
- package/es/Tag/style/index.css +1 -1
- package/es/TextEditor/component.json +186 -0
- package/es/TextEditor/index.d.ts +5 -5
- package/es/TextEditor/index.js +1 -1
- package/es/TextField/component.json +290 -0
- package/es/TextField/index.d.ts +2 -2
- package/es/TextField/index.js +1 -1
- package/es/TimePicker/component.json +176 -0
- package/es/Timeline/component.json +110 -0
- package/es/Title/component.json +156 -0
- package/es/ToggleButton/component.json +153 -0
- package/es/ToggleButton/index.js +1 -1
- package/es/Tooltip/component.json +176 -0
- package/es/Tooltip/index.js +58 -53
- package/es/Tooltip/interface.d.ts +14 -1
- package/es/Tooltip/utils.js +6 -6
- package/es/Transfer/component.json +157 -0
- package/es/Tree/OperateBar/index.js +1 -1
- package/es/Tree/Tree.js +3 -3
- package/es/Tree/component.json +512 -0
- package/es/Tree/interface.d.ts +1 -1
- package/es/Upload/component.json +450 -0
- package/es/Upload/util.js +1 -1
- package/es/Utils/snack-kit-shims.d.ts +18 -0
- package/es/Utils/snack-kit-shims.js +19 -0
- package/es/Utils/type.d.ts +0 -6
- package/es/_virtual/index.js +5 -3
- package/es/_virtual/index2.js +2 -5
- package/es/index.d.ts +4 -0
- package/es/index.js +152 -150
- package/es/locale/en-US.d.ts +3 -0
- package/es/locale/en-US.js +3 -0
- package/es/locale/en_US.d.ts +361 -0
- package/es/locale/en_US.js +364 -0
- package/es/locale/index.d.ts +1 -723
- package/es/locale/index2.js +10 -0
- package/es/locale/zh-CN.d.ts +3 -0
- package/es/locale/zh-CN.js +3 -0
- package/es/locale/zh_CN.d.ts +361 -0
- package/es/locale/zh_CN.js +364 -0
- package/es/node_modules/classnames/index.js +1 -1
- package/lib/AlignBox/component.json +89 -0
- package/lib/AlignBox/index.css +1 -1
- package/lib/AlignBox/index.d.ts +6 -2
- package/lib/AlignBox/index.js +1 -1
- package/lib/AlignBox/style/index.css +1 -1
- package/lib/Anchor/anchorMenu/index.d.ts +2 -1
- package/lib/Anchor/anchorMenu/index.js +1 -1
- package/lib/Anchor/component.json +130 -0
- package/lib/Anchor/index.js +1 -1
- package/lib/Anchor/type.d.ts +8 -4
- package/lib/Argv/component.json +216 -0
- package/lib/Argv/dataGenerator/index.js +1 -1
- package/lib/Argv/index.d.ts +5 -6
- package/lib/Argv/index.js +1 -1
- package/lib/AutoBox/component.json +133 -0
- package/lib/AutoBox/index.d.ts +3 -3
- package/lib/AutoBox/index.js +1 -1
- package/lib/AutoBox/protal.d.ts +2 -2
- package/lib/AutoBox/protal.js +1 -1
- package/lib/AutoButton/component.json +109 -0
- package/lib/AutoButton/index.js +1 -1
- package/lib/AutoTips/autoTipsMultiline/index.d.ts +1 -1
- package/lib/AutoTips/autoTipsMultiline/index.js +1 -1
- package/lib/AutoTips/component.json +121 -0
- package/lib/AutoTips/index.js +1 -1
- package/lib/Badge/component.json +92 -0
- package/lib/Breadcrumbs/component.json +142 -0
- package/lib/Breadcrumbs/index.js +1 -1
- package/lib/Button/SplitButton.d.ts +2 -2
- package/lib/Button/component.json +168 -0
- package/lib/Button/index.js +1 -1
- package/lib/ButtonGroup/component.json +132 -0
- package/lib/ButtonGroup/index.d.ts +1 -1
- package/lib/Card/component.json +162 -0
- package/lib/Card/index.d.ts +2 -2
- package/lib/Card/index.js +1 -1
- package/lib/Carousel/component.json +142 -0
- package/lib/Carousel/index.d.ts +1 -1
- package/lib/Cascader/Cascader.js +1 -1
- package/lib/Cascader/OptionList/Column.js +1 -1
- package/lib/Cascader/OptionList/index.js +1 -1
- package/lib/Cascader/component.json +196 -0
- package/lib/Cascader/hooks/useEntities.js +1 -1
- package/lib/Cascader/interface.d.ts +1 -0
- package/lib/Cascader/utils/commonUtil.d.ts +1 -1
- package/lib/Cascader/utils/commonUtil.js +1 -1
- package/lib/Cascader/utils/treeUtil.d.ts +14 -5
- package/lib/Cascader/utils/treeUtil.js +1 -1
- package/lib/Checkbox/component.json +138 -0
- package/lib/CheckboxGroup/component.json +152 -0
- package/lib/CheckboxGroup/index.js +1 -1
- package/lib/CodeEditor/component.json +189 -0
- package/lib/CodeEditor/index.d.ts +11 -10
- package/lib/CodeEditor/index.js +1 -1
- package/lib/Collapse/component.json +166 -0
- package/lib/Collapse/index.d.ts +1 -1
- package/lib/Collapse/index.js +1 -1
- package/lib/CollapseBox/component.json +84 -0
- package/lib/CollapseLayout/component.json +155 -0
- package/lib/ColorPicker/component.json +142 -0
- package/lib/ComboSelect/component.json +181 -0
- package/lib/ComboSelect/index.js +1 -1
- package/lib/ComboSelect/interface.d.ts +2 -2
- package/lib/ComboSelect/utils.d.ts +3 -3
- package/lib/ComboSelect/utils.js +1 -1
- package/lib/Container/component.json +111 -0
- package/lib/ContentBox/component.json +81 -0
- package/lib/CopyText/component.json +118 -0
- package/lib/CycleSelector/component.json +98 -0
- package/lib/CycleSelector/index.js +1 -1
- package/lib/DatePicker/component.json +192 -0
- package/lib/DatePicker/generatePicker/generateRangePicker.js +1 -1
- package/lib/DatePicker/generatePicker/generateSinglePicker.js +1 -1
- package/lib/Descriptions/component.json +142 -0
- package/lib/Descriptions/index.d.ts +1 -1
- package/lib/Desktop/component.json +171 -0
- package/lib/Desktop/index.js +1 -1
- package/lib/DragVerify/component.json +114 -0
- package/lib/DragVerify/index.js +1 -1
- package/lib/Drawer/component.json +200 -0
- package/lib/Drawer/index.js +1 -1
- package/lib/Drawer/interface.d.ts +1 -1
- package/lib/Drawer/util.d.ts +1 -6
- package/lib/Drawer/util.js +1 -1
- package/lib/Dropdown/component.json +147 -0
- package/lib/Dropdown/index.js +1 -1
- package/lib/DynamicMultiBox/component.json +278 -0
- package/lib/DynamicMultiBox/formItem.d.ts +1 -1
- package/lib/DynamicMultiBox/index.d.ts +2 -2
- package/lib/DynamicMultiBox/index.js +1 -1
- package/lib/DynamicMultiBox/interface.d.ts +76 -76
- package/lib/DynamicMultiBox/rowForm.d.ts +2 -2
- package/lib/Empty/component.json +123 -0
- package/lib/Empty/index.css +1 -1
- package/lib/Empty/index.d.ts +2 -2
- package/lib/Empty/index.js +1 -1
- package/lib/Empty/style/index.css +1 -1
- package/lib/ExpressionInput/HighlightOverlay.d.ts +8 -0
- package/lib/ExpressionInput/HighlightOverlay.js +2 -0
- package/lib/ExpressionInput/Popup.d.ts +19 -0
- package/lib/ExpressionInput/Popup.js +2 -0
- package/lib/ExpressionInput/component.json +79 -0
- package/lib/ExpressionInput/detectChainAtCursor.d.ts +17 -0
- package/lib/ExpressionInput/detectChainAtCursor.js +2 -0
- package/lib/ExpressionInput/filterCandidatesByPartial.d.ts +2 -0
- package/lib/ExpressionInput/filterCandidatesByPartial.js +2 -0
- package/lib/ExpressionInput/highlightSegments.d.ts +9 -0
- package/lib/ExpressionInput/highlightSegments.js +2 -0
- package/lib/ExpressionInput/index.css +1 -0
- package/lib/ExpressionInput/index.d.ts +5 -0
- package/lib/ExpressionInput/index.js +2 -0
- package/lib/ExpressionInput/interface.d.ts +52 -0
- package/lib/ExpressionInput/isExpressionValue.d.ts +5 -0
- package/lib/ExpressionInput/isExpressionValue.js +2 -0
- package/lib/ExpressionInput/lang/en_US.d.ts +4 -0
- package/lib/ExpressionInput/lang/en_US.js +2 -0
- package/lib/ExpressionInput/lang/index.d.ts +9 -0
- package/lib/ExpressionInput/lang/index.js +2 -0
- package/lib/ExpressionInput/lang/zh_CN.d.ts +4 -0
- package/lib/ExpressionInput/lang/zh_CN.js +2 -0
- package/lib/ExpressionInput/style/css.js +1 -0
- package/lib/ExpressionInput/style/index.css +1 -0
- package/lib/ExpressionInput/style/index.js +1 -0
- package/lib/ExpressionInput/useExpressionInput.d.ts +26 -0
- package/lib/ExpressionInput/useExpressionInput.js +2 -0
- package/lib/FieldForm/FieldFormItem/ItemHolder.js +1 -1
- package/lib/FieldForm/FieldFormItem/MemoInput.d.ts +2 -2
- package/lib/FieldForm/FieldFormItem/StatusProvider.js +1 -1
- package/lib/FieldForm/FieldFormItem/index.d.ts +6 -6
- package/lib/FieldForm/Form.d.ts +2 -2
- package/lib/FieldForm/Form.js +1 -1
- package/lib/FieldForm/FormItemInput.js +1 -1
- package/lib/FieldForm/FormItemLabel.js +1 -1
- package/lib/FieldForm/FormList.d.ts +2 -2
- package/lib/FieldForm/component.json +196 -0
- package/lib/FieldForm/context.d.ts +5 -1
- package/lib/FieldForm/context.js +1 -1
- package/lib/FieldForm/hooks/useForm.d.ts +4 -3
- package/lib/FieldForm/hooks/useFormInstance.d.ts +1 -1
- package/lib/FieldForm/hooks/useFormItemStatus.d.ts +9 -5
- package/lib/FieldForm/hooks/useFormItemStatus.js +1 -1
- package/lib/FieldForm/hooks/useItemRef.d.ts +1 -1
- package/lib/FieldForm/hooks/useItemRef.js +1 -1
- package/lib/Form/component.json +161 -0
- package/lib/Form/index.d.ts +52 -49
- package/lib/Form/index.js +1 -1
- package/lib/FormItem/compoments/defaultCompoments/index.d.ts +5 -5
- package/lib/FormItem/compoments/defaultCompoments/index.js +1 -1
- package/lib/FormItem/compoments/formCheckboxGroup/index.d.ts +2 -2
- package/lib/FormItem/compoments/formFile/index.js +1 -1
- package/lib/FormItem/compoments/formRadioGroup/index.d.ts +1 -1
- package/lib/FormItem/compoments/formSelect/index.d.ts +1 -1
- package/lib/FormItem/component.json +171 -0
- package/lib/FormItem/index.d.ts +5 -5
- package/lib/FormItem/index.js +1 -1
- package/lib/FormItem/itemType.js +1 -1
- package/lib/FunctionModal/component.json +197 -0
- package/lib/FunctionModal/dialog.d.ts +1 -1
- package/lib/FunctionModal/modalContext.d.ts +4 -1
- package/lib/GlobalContext/confirmLocale.js +1 -1
- package/lib/GlobalContext/index.js +1 -1
- package/lib/Help/component.json +118 -0
- package/lib/HelperText/component.json +126 -0
- package/lib/Image/PreviewGroup.js +1 -1
- package/lib/Image/component.json +165 -0
- package/lib/Image/index.js +1 -1
- package/lib/InputCode/component.json +191 -0
- package/lib/InputCode/index.d.ts +2 -2
- package/lib/InputLang/component.json +205 -0
- package/lib/InputLang/index.js +1 -1
- package/lib/InputNumber/component.json +162 -0
- package/lib/InputNumber/index.d.ts +13 -7
- package/lib/InputNumber/index.js +1 -1
- package/lib/Label/component.json +126 -0
- package/lib/Label/index.d.ts +2 -2
- package/lib/Loading/component.json +91 -0
- package/lib/Menu/component.json +180 -0
- package/lib/Menu/verticalMenuList.js +1 -1
- package/lib/Message/component.json +246 -0
- package/lib/Message/index.d.ts +2 -2
- package/lib/Message/index.js +1 -1
- package/lib/Modal/Confirm/index.d.ts +1 -1
- package/lib/Modal/Confirm/index.js +1 -1
- package/lib/Modal/component.json +277 -0
- package/lib/Modal/index.d.ts +85 -5
- package/lib/Modal/index.js +1 -1
- package/lib/Modal/interface.d.ts +1 -0
- package/lib/MultiBox/component.json +216 -0
- package/lib/MultiBox/index.js +1 -1
- package/lib/Notification/component.json +184 -0
- package/lib/OperateBtn/component.json +134 -0
- package/lib/OperateBtn/index.d.ts +3 -3
- package/lib/PageHeader/component.json +112 -0
- package/lib/PageHeader/horizontalMeun.js +1 -1
- package/lib/PageHeader/horizontalMeunRight.js +1 -1
- package/lib/Pagination/component.json +181 -0
- package/lib/Pagination/index.js +1 -1
- package/lib/ParauiProvider/index.js +1 -1
- package/lib/PasswordRules/component.json +105 -0
- package/lib/PasswordRules/index.d.ts +4 -4
- package/lib/PopConfirm/component.json +227 -0
- package/lib/PopConfirm/index.d.ts +1 -1
- package/lib/PopConfirm/index.js +1 -1
- package/lib/PopMenu/component.json +131 -0
- package/lib/PopMenu/hooks.d.ts +1 -1
- package/lib/PopMenu/index.js +1 -1
- package/lib/Popover/component.json +165 -0
- package/lib/Popover/index.js +1 -1
- package/lib/Progress/component.json +161 -0
- package/lib/Prompt/component.json +144 -0
- package/lib/Querying/component.json +96 -0
- package/lib/Querying/index.css +1 -1
- package/lib/Querying/index.d.ts +2 -2
- package/lib/Querying/index.js +1 -1
- package/lib/Querying/style/index.css +1 -1
- package/lib/QuickReply/QuickReplyCode/index.js +1 -1
- package/lib/QuickReply/component.json +129 -0
- package/lib/QuickReply/index.d.ts +1 -1
- package/lib/Radio/component.json +136 -0
- package/lib/RadioGroup/component.json +149 -0
- package/lib/RangeInput/component.json +198 -0
- package/lib/RangeInput/index.d.ts +15 -7
- package/lib/RangeInput/index.js +1 -1
- package/lib/Result/component.json +104 -0
- package/lib/ScrollBar/component.json +115 -0
- package/lib/Search/component.json +177 -0
- package/lib/Search/index.d.ts +1 -1
- package/lib/Select/component.json +244 -0
- package/lib/Select/index.d.ts +11 -8
- package/lib/Select/index.js +1 -1
- package/lib/SelectInput/component.json +184 -0
- package/lib/SelectInput/index.d.ts +4 -4
- package/lib/SelectInput/index.js +1 -1
- package/lib/Selector/component.json +203 -0
- package/lib/Selector/index.js +1 -1
- package/lib/Selector/interface.d.ts +2 -2
- package/lib/Selector/selectorData/index.js +1 -1
- package/lib/Selector/selectorMain/index.js +1 -1
- package/lib/Selector/selectorNode/index.js +1 -1
- package/lib/Selector/util.d.ts +3 -3
- package/lib/Selector/util.js +1 -1
- package/lib/SelectorPicker/component.json +179 -0
- package/lib/SelectorPicker/index.d.ts +5 -5
- package/lib/SelectorPicker/index.js +1 -1
- package/lib/SingleBox/component.json +151 -0
- package/lib/SingleBox/index.d.ts +2 -2
- package/lib/Slider/component.json +181 -0
- package/lib/SortBox/component.json +108 -0
- package/lib/Status/component.json +104 -0
- package/lib/Stepper/component.json +129 -0
- package/lib/Stepper/index.d.ts +2 -2
- package/lib/Switch/component.json +207 -0
- package/lib/Switch/index.css +1 -1
- package/lib/Switch/index.d.ts +3 -2
- package/lib/Switch/index.js +1 -1
- package/lib/Switch/style/index.css +1 -1
- package/lib/Table/component.json +547 -0
- package/lib/Table/index.d.ts +2 -2
- package/lib/Table/index.js +1 -1
- package/lib/Table/interface.d.ts +30 -0
- package/lib/Table/tableHead.js +1 -1
- package/lib/Table/util.d.ts +1 -1
- package/lib/Table/util.js +1 -1
- package/lib/Tabs/component.json +227 -0
- package/lib/Tag/component.json +221 -0
- package/lib/Tag/index.css +1 -1
- package/lib/Tag/index.d.ts +1 -1
- package/lib/Tag/index.js +1 -1
- package/lib/Tag/style/index.css +1 -1
- package/lib/TextEditor/component.json +186 -0
- package/lib/TextEditor/index.d.ts +5 -5
- package/lib/TextEditor/index.js +1 -1
- package/lib/TextField/component.json +290 -0
- package/lib/TextField/index.d.ts +2 -2
- package/lib/TextField/index.js +1 -1
- package/lib/TimePicker/component.json +176 -0
- package/lib/Timeline/component.json +110 -0
- package/lib/Title/component.json +156 -0
- package/lib/ToggleButton/component.json +153 -0
- package/lib/ToggleButton/index.js +1 -1
- package/lib/Tooltip/component.json +176 -0
- package/lib/Tooltip/index.js +1 -1
- package/lib/Tooltip/interface.d.ts +14 -1
- package/lib/Tooltip/utils.js +1 -1
- package/lib/Transfer/component.json +157 -0
- package/lib/Tree/OperateBar/index.js +2 -2
- package/lib/Tree/Tree.js +1 -1
- package/lib/Tree/component.json +512 -0
- package/lib/Tree/interface.d.ts +1 -1
- package/lib/Upload/component.json +450 -0
- package/lib/Upload/util.js +1 -1
- package/lib/Utils/snack-kit-shims.d.ts +18 -0
- package/lib/Utils/snack-kit-shims.js +2 -0
- package/lib/Utils/type.d.ts +0 -6
- package/lib/_virtual/index.js +1 -1
- package/lib/_virtual/index2.js +1 -1
- package/lib/index.d.ts +4 -0
- package/lib/index.js +1 -1
- package/lib/locale/en-US.d.ts +3 -0
- package/lib/locale/en-US.js +1 -1
- package/lib/locale/en_US.d.ts +361 -0
- package/lib/locale/en_US.js +2 -0
- package/lib/locale/index.d.ts +1 -723
- package/lib/locale/index2.js +2 -0
- package/lib/locale/zh-CN.d.ts +3 -0
- package/lib/locale/zh-CN.js +1 -1
- package/lib/locale/zh_CN.d.ts +361 -0
- package/lib/locale/zh_CN.js +2 -0
- package/lib/node_modules/classnames/index.js +1 -1
- package/package.json +24 -4
- package/es/_virtual/index3.js +0 -5
- package/es/_virtual/index4.js +0 -5
- package/es/node_modules/@para-snack/core/dist/index.js +0 -5231
- package/lib/_virtual/index3.js +0 -2
- package/lib/_virtual/index4.js +0 -2
- package/lib/node_modules/@para-snack/core/dist/index.js +0 -20
- /package/es/{InputCode → CodeEditor}/index.css +0 -0
- /package/es/{Utils/Hooks → Hooks}/useResizeObserver.d.ts +0 -0
- /package/es/{Utils/Hooks → Hooks}/useResizeObserver.js +0 -0
- /package/lib/{Utils/Hooks → Hooks}/useResizeObserver.d.ts +0 -0
- /package/lib/{Utils/Hooks → Hooks}/useResizeObserver.js +0 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Carousel",
|
|
3
|
+
"category": "Data Display",
|
|
4
|
+
"description": "走马灯,用于一组图片或卡片的轮播",
|
|
5
|
+
"semantic": {
|
|
6
|
+
"intent": [
|
|
7
|
+
"轮播展示",
|
|
8
|
+
"吸引注意",
|
|
9
|
+
"节省空间"
|
|
10
|
+
],
|
|
11
|
+
"useCases": [
|
|
12
|
+
"首页 Banner",
|
|
13
|
+
"产品展示",
|
|
14
|
+
"图片画廊"
|
|
15
|
+
],
|
|
16
|
+
"riskLevel": "low"
|
|
17
|
+
},
|
|
18
|
+
"variants": {
|
|
19
|
+
"default": {
|
|
20
|
+
"meaning": "默认轮播"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"states": [
|
|
24
|
+
"active"
|
|
25
|
+
],
|
|
26
|
+
"idealProps": {
|
|
27
|
+
"autoplay": {
|
|
28
|
+
"type": "boolean",
|
|
29
|
+
"default": false,
|
|
30
|
+
"description": "是否自动切换"
|
|
31
|
+
},
|
|
32
|
+
"autoplaySpeed": {
|
|
33
|
+
"type": "number",
|
|
34
|
+
"default": 3000,
|
|
35
|
+
"description": "自动播放间隔(ms),需配合 autoplay=true 使用",
|
|
36
|
+
"required": false
|
|
37
|
+
},
|
|
38
|
+
"infinite": {
|
|
39
|
+
"type": "boolean",
|
|
40
|
+
"default": true,
|
|
41
|
+
"description": "无限循环;设为 false 时到最后一张停止",
|
|
42
|
+
"required": false
|
|
43
|
+
},
|
|
44
|
+
"slidesToShow": {
|
|
45
|
+
"type": "number",
|
|
46
|
+
"default": 1,
|
|
47
|
+
"description": "一帧显示幻灯片数",
|
|
48
|
+
"required": false
|
|
49
|
+
},
|
|
50
|
+
"slidesToScroll": {
|
|
51
|
+
"type": "number",
|
|
52
|
+
"default": 1,
|
|
53
|
+
"description": "一次滚动幻灯片数",
|
|
54
|
+
"required": false
|
|
55
|
+
},
|
|
56
|
+
"arrows": {
|
|
57
|
+
"type": "boolean",
|
|
58
|
+
"default": false,
|
|
59
|
+
"description": "是否显示前后箭头",
|
|
60
|
+
"required": false
|
|
61
|
+
},
|
|
62
|
+
"dotPosition": {
|
|
63
|
+
"type": "enum",
|
|
64
|
+
"values": ["top", "bottom", "left", "right"],
|
|
65
|
+
"default": "bottom",
|
|
66
|
+
"description": "指示点位置",
|
|
67
|
+
"required": false
|
|
68
|
+
},
|
|
69
|
+
"pauseOnHover": {
|
|
70
|
+
"type": "boolean",
|
|
71
|
+
"default": true,
|
|
72
|
+
"description": "悬停时暂停自动播放",
|
|
73
|
+
"required": false
|
|
74
|
+
},
|
|
75
|
+
"dots": {
|
|
76
|
+
"type": "boolean",
|
|
77
|
+
"default": true,
|
|
78
|
+
"description": "是否显示指示点"
|
|
79
|
+
},
|
|
80
|
+
"effect": {
|
|
81
|
+
"type": "enum",
|
|
82
|
+
"values": [
|
|
83
|
+
"scrollx",
|
|
84
|
+
"fade"
|
|
85
|
+
],
|
|
86
|
+
"default": "scrollx",
|
|
87
|
+
"description": "动画效果"
|
|
88
|
+
},
|
|
89
|
+
"afterChange": {
|
|
90
|
+
"type": "function",
|
|
91
|
+
"signature": "(current: number) => void",
|
|
92
|
+
"description": "切换面板的回调"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"do": [
|
|
96
|
+
"使用高质量的图片",
|
|
97
|
+
"限制 Carousel 的数量(<5)以保证性能",
|
|
98
|
+
"需要命令式控制(goTo/next/prev)时通过 forwardRef + useRef<CarouselRef> 获取实例方法"
|
|
99
|
+
],
|
|
100
|
+
"dont": [
|
|
101
|
+
"在移动端使用非触摸友好的 Carousel",
|
|
102
|
+
"自动播放速度过快 (<2s) 导致用户无法看清",
|
|
103
|
+
"不要传 prevArrow / nextArrow prop——这两个 prop 已从 CarouselProps 中移除(TypeScript 会报错);自定义箭头外观请通过 CSS 覆盖 `.slick-prev` / `.slick-next` 样式"
|
|
104
|
+
],
|
|
105
|
+
"events": {
|
|
106
|
+
"afterChange": {
|
|
107
|
+
"signature": "(current: number) => void",
|
|
108
|
+
"asyncSupported": false,
|
|
109
|
+
"examples": [
|
|
110
|
+
"切换后同步外部状态:afterChange={(index) => setActiveIndex(index)}",
|
|
111
|
+
"切换后更新指示器:afterChange={(index) => setTitle(slides[index].title)}",
|
|
112
|
+
"切换后埋点:afterChange={(index) => analytics.track('carousel_change', { slide: index })}"
|
|
113
|
+
],
|
|
114
|
+
"commonMistakes": [
|
|
115
|
+
"期望 beforeChange 回调——CarouselProps 只有 afterChange,beforeChange 来自 react-slick Settings 但未在 CarouselProps 类型覆盖中暴露",
|
|
116
|
+
"期望 afterChange 在自动播放切换时也触发——autoplay 切换同样会触发 afterChange",
|
|
117
|
+
"current 参数是 0-based 索引,从 infinite=true 模式下 current 可能超过 children 数量(react-slick 克隆节点)"
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"typescriptPitfalls": [
|
|
122
|
+
{
|
|
123
|
+
"issue": "prevArrow 和 nextArrow 已从 CarouselProps 中通过 Omit 移除——传入会有 TS 报错",
|
|
124
|
+
"wrong": "<Carousel prevArrow={<MyPrev />} nextArrow={<MyNext />} /> // TS: Omit<Settings, '...prevArrow | nextArrow'>",
|
|
125
|
+
"right": "// 通过 CSS 覆盖箭头样式\n// .paraui-v4-carousel .slick-prev { ... }\n// .paraui-v4-carousel .slick-next { ... }"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"issue": "CarouselRef 的命令式方法(goTo/next/prev/play/pause)需要通过 forwardRef 接收,useRef 泛型必须指定",
|
|
129
|
+
"wrong": "const ref = useRef(null);\n// ref.current.goTo(2); // TS: null 上不存在 goTo",
|
|
130
|
+
"right": "import type { CarouselRef } from '@para-ui/core/Carousel';\nconst ref = useRef<CarouselRef>(null);\n// ref.current?.goTo(2);"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"issue": "effect prop 值只有 'scrollx' | 'fade'——不是 react-slick 原生的 fade boolean,内部做了映射",
|
|
134
|
+
"wrong": "<Carousel fade={true} /> // fade 是 react-slick 原生字段,CarouselProps 用 effect 替代",
|
|
135
|
+
"right": "<Carousel effect='fade' /> // src 内部将 effect='fade' 映射为 newProps.fade=true"
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
"mapping": {
|
|
139
|
+
"realComponent": "Carousel",
|
|
140
|
+
"adapter": null
|
|
141
|
+
}
|
|
142
|
+
}
|
package/lib/Carousel/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { Settings } from 'react-slick';
|
|
3
3
|
export type CarouselEffect = 'scrollx' | 'fade';
|
|
4
4
|
export type DotPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
5
|
-
export interface CarouselProps extends Omit<Settings, 'dots' | 'dotsClass'> {
|
|
5
|
+
export interface CarouselProps extends Omit<Settings, 'dots' | 'dotsClass' | 'prevArrow' | 'nextArrow'> {
|
|
6
6
|
/** 动画效果函数 */
|
|
7
7
|
effect?: CarouselEffect;
|
|
8
8
|
/** style */
|
package/lib/Cascader/Cascader.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("../_virtual/jsx-runtime.js"),He=require("rc-select"),re=require("clsx"),Ke=require("rc-select/lib/hooks/useId"),Le=require("rc-tree/lib/utils/conductUtil"),Fe=require("../node_modules/@para-ui/icons/Right/index.js"),ae=require("rc-util/lib/hooks/useEvent"),Ue=require("rc-util/lib/hooks/useMergedState"),ze=require("../node_modules/@para-ui/icons/Down/index.js"),Be=require("../node_modules/@para-ui/icons/CloseCircleF/index.js"),Je=require("react"),Ge=require("./context.js"),Qe=require("./hooks/useDisplayValues.js"),Xe=require("./hooks/useEntities.js"),Ye=require("./hooks/useMissingValues.js"),Ze=require("./OptionList/index.js"),f=require("./utils/commonUtil.js"),T=require("./utils/treeUtil.js"),et=require("@
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("../_virtual/jsx-runtime.js"),He=require("rc-select"),re=require("clsx"),Ke=require("rc-select/lib/hooks/useId"),Le=require("rc-tree/lib/utils/conductUtil"),Fe=require("../node_modules/@para-ui/icons/Right/index.js"),ae=require("rc-util/lib/hooks/useEvent"),Ue=require("rc-util/lib/hooks/useMergedState"),ze=require("../node_modules/@para-ui/icons/Down/index.js"),Be=require("../node_modules/@para-ui/icons/CloseCircleF/index.js"),Je=require("react"),Ge=require("./context.js"),Qe=require("./hooks/useDisplayValues.js"),Xe=require("./hooks/useEntities.js"),Ye=require("./hooks/useMissingValues.js"),Ze=require("./OptionList/index.js"),f=require("./utils/commonUtil.js"),T=require("./utils/treeUtil.js"),et=require("@snack-kit/lib"),j=require("../GlobalContext/constant.js"),ie=require("../Tooltip/index.js"),tt=require("./lang/index.js"),st=require("../GlobalContext/useFormatMessage.js"),nt=require("../HelperText/index.js");function ot(o){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const p in o)if(p!=="default"){const E=Object.getOwnPropertyDescriptor(o,p);Object.defineProperty(l,p,E.get?E:{enumerable:!0,get:()=>o[p]})}}return l.default=o,Object.freeze(l)}const n=ot(Je);function rt(o){return Array.isArray(o)&&Array.isArray(o[0])}function _(o){return o?rt(o)?o:(o.length===0?[]:[o]).map(l=>Array.isArray(l)?l:[l]):[]}const S=n.forwardRef((o,l)=>{const p=st.default("Cascader",tt.default),{id:E,prefixCls:le=`${j.$prefixCls}-cascader`,fieldNames:I,className:at,defaultValue:ce,value:y,changeOnSelect:W,onChange:R,displayRender:ue,expandTrigger:A,options:g,optionsTitle:H=[],dropdownPrefixCls:K,loadData:L,popupVisible:F,open:N,popupClassName:de,dropdownClassName:pe,dropdownMenuColumnStyle:U,popupPlacement:me,placement:he,onDropdownVisibleChange:xe,onPopupVisibleChange:fe,expandIcon:z=s.jsxRuntimeExports.jsx(Fe.Right,{}),loadingIcon:B,placeholder:q=p({id:"placeholder"}),allClear:ge=!0,menuMaxHight:Ce=158,expandJoin:je="/",disabled:V=!1,loading:w,disabledTooltip:M,error:J=!1,hideErrorDom:Ee,helperText:ye="",children:G,dropdownMatchSelectWidth:Re=!1,showCheckedStrategy:Q=f.SHOW_PARENT,...Ve}=o,we=Ke(E),[v,be]=Ue(ce,{value:y,postState:_}),c=n.useMemo(()=>f.fillFieldNames(I),[JSON.stringify(I)]),u=n.useMemo(()=>g||[],[g]),m=Xe.default(u,c),C=n.useCallback(e=>{const t=m();return e.map(r=>{const{nodes:i}=t[r];return i.map(a=>a[c.value])})},[m,c]),[h,X]=n.useState(),[P,D]=n.useState(!1),[Y,Oe]=n.useState("auto"),x=n.useRef({id:et.UUID(),level:1}),Se=e=>_(e).map(i=>T.toPathOptions(i,u,c).map(a=>a.option));n.useEffect(()=>{if(!y)return;const t=Se(y)[0];t&&X(t.map(r=>r?.label).join(je))},[y]);const Z=Ye.default(u,c),[b,ee,te]=n.useMemo(()=>{const[e,t]=Z(v);if(!v.length)return[e,[],t];const r=f.toPathKeys(e),i=m(),{checkedKeys:a,halfCheckedKeys:d}=Le.conductCheck(r,!0,i);return[C(a),C(d),t]},[v,m,C,Z]),Ne=n.useMemo(()=>{const e=f.toPathKeys(b),t=T.formatStrategyValues(e,m,Q);return[...te,...C(t)]},[b,m,C,te,Q]),qe=Qe.default(Ne,u,c,!1,ue),se=ae(e=>{be(e);const t=_(e),r=t.map(d=>T.toPathOptions(d,u,c).map(O=>O.option)),i=t[0],a=r[0];R&&R(i,a||[])}),k=ae(e=>{se(e)}),Me=(e,t)=>{if(t.type==="clear"){se([]);return}const{valueCells:r}=t.values[0];k(r)},ve=pe||de,Pe=he||me,De=e=>{D(e),xe?.(e),fe?.(e)},ne=n.useMemo(()=>({options:u,optionsTitle:H,fieldNames:c,values:b,menuMaxHight:Ce,halfValues:ee,changeOnSelect:W,onSelect:k,menuWidth:Y,dropdownPrefixCls:K,loadData:L,expandTrigger:A,expandIcon:z,loadingIcon:B,dropdownMenuColumnStyle:U,loading:w}),[Y,u,x,H,c,b,ee,W,k,K,L,A,z,B,U,w]),oe=!u.length,ke=(e,t=1)=>{let r=t;const i=[...e.map(a=>({option:a,depth:1}))];for(;i.length>0&&r<3;){const a=i.pop();if(!a)break;const{option:d,depth:O}=a;r=Math.max(r,O),d.children&&d.children.length>0&&i.push(...d.children.map(Ae=>({option:Ae,depth:O+1})))}return r};n.useEffect(()=>{D(!!(N!==void 0?N:F))},[N,F]),n.useEffect(()=>(window.addEventListener("resize",$),()=>{window.removeEventListener("resize",$)}),[]),n.useEffect(()=>{const t=g?.[0]?.children;x.current.level=!t||t.length<1||w?1:ke(g||[]),$()},[g,w]);const $e=e=>{e.stopPropagation(),X(""),R&&R([],[]),D(!1),ne.values=[]},$=()=>{const e=document.getElementById(`${x.current.id}`);if(!e)return;const{clientWidth:t}=e;Oe((t/x.current.level).toFixed(2))},Te=n.useMemo(()=>s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:h?V&&M?s.jsxRuntimeExports.jsx(ie.Tooltip,{disabled:!0,children:s.jsxRuntimeExports.jsx("span",{className:"select-label-text",children:h})}):s.jsxRuntimeExports.jsx("span",{className:"select-label-text",children:h}):V&&M?s.jsxRuntimeExports.jsx(ie.Tooltip,{disabled:!0,...M,children:s.jsxRuntimeExports.jsx("span",{className:"select-label-placeholder",children:q})}):s.jsxRuntimeExports.jsx("span",{className:"select-label-placeholder",children:q})}),[h,q]),_e=()=>{if(ge)return s.jsxRuntimeExports.jsx("span",{className:"clean-up-icon",onClick:$e,children:s.jsxRuntimeExports.jsx(Be.CloseCircleF,{})})},Ie=n.useMemo(()=>{const e=re(`${j.$prefixCls}-cascader-select-content`,{[`${j.$prefixCls}-cascader-select-value`]:h,[`${j.$prefixCls}-cascader-select-disabled`]:V,[`${j.$prefixCls}-cascader-error`]:J}),t=re("select-svg",{"select-svg-open":P});return G||s.jsxRuntimeExports.jsxs("div",{className:e,id:x.current.id,children:[Te,s.jsxRuntimeExports.jsxs("span",{className:t,children:[s.jsxRuntimeExports.jsx(ze.Down,{}),_e()]})]})},[h,P,x]),We=oe?{}:{minWidth:"auto"};return s.jsxRuntimeExports.jsxs(Ge.default.Provider,{value:ne,children:[s.jsxRuntimeExports.jsx(He.BaseSelect,{...Ve,ref:l,disabled:V,id:we,prefixCls:le,dropdownMatchSelectWidth:Re,dropdownStyle:We,showSearch:!1,searchValue:"",onSearch:()=>{console.log("not search")},displayValues:qe,onDisplayValuesChange:Me,OptionList:Ze.default,emptyOptions:oe,open:P,dropdownClassName:ve,placement:Pe,onDropdownVisibleChange:De,getRawInputElement:()=>Ie}),s.jsxRuntimeExports.jsx(nt.default,{className:"text-field-error-text",error:J,helperText:ye,hideErrorDom:Ee})]})});process.env.NODE_ENV!=="production"&&(S.displayName="Cascader");S.SHOW_PARENT=f.SHOW_PARENT;S.SHOW_CHILD=f.SHOW_CHILD;exports.default=S;
|
|
2
2
|
//# sourceMappingURL=Cascader.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../_virtual/jsx-runtime.js"),Y=require("../../_virtual/
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../_virtual/jsx-runtime.js"),Y=require("../../_virtual/index.js"),Z=require("react"),K=require("../context.js"),O=require("../utils/commonUtil.js"),V=require("../../Tooltip/index.js");require("../../node_modules/@para-ui/icons/SvgIcon/index.js");const ee=require("../../node_modules/@para-ui/icons/Forbid/index.js"),te=require("../../node_modules/@para-ui/icons/LoadingF/index.js"),C=require("../../GlobalContext/constant.js"),ne=require("../lang/index.js"),y=require("../../AutoTips/index.js"),se=require("../../GlobalContext/useFormatMessage.js");function ie(s){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const o in s)if(o!=="default"){const x=Object.getOwnPropertyDescriptor(s,o);Object.defineProperty(r,o,x.get?x:{enumerable:!0,get:()=>s[o]})}}return r.default=s,Object.freeze(r)}const k=ie(Z),F="__cascader_fix_label__";function re({prefixCls:s,options:r,multiple:o,activeValue:x,prevValuePath:E,titleIndex:b,onToggleOpen:L,onSelect:M,onActive:S,checkedSet:$,loadingKeys:_,isSelectable:w,searchValue:D}){const I=`${s}-menu ${C.$prefixCls}-scrollbar-small`,n=`${s}-menu-item`,{fieldNames:m,changeOnSelect:P,expandTrigger:A,expandIcon:q,loadingIcon:v,optionsTitle:j,dropdownMenuColumnStyle:z,menuMaxHight:B,menuWidth:H,loading:X}=k.useContext(K.default),N=A==="hover",U=se.default("OptionList",ne.default),W=k.useMemo(()=>r.map(t=>{const{disabled:p,disableCheckbox:f,disableTitle:h}=t,i=t[F]??t[m.label],l=t[m.value],g=O.isLeaf(t,m),c=[...E,l],u=O.toPathKey(c),d=_.includes(u),R=$.has(u);return{disabled:p,disableTitle:h,label:i,value:l,isLeaf:g,isLoading:d,checked:R,option:t,disableCheckbox:f,fullPath:c,fullPathKey:u}}),[r,$,m,_,E]),G=()=>j.length<1||!j[b]?null:e.jsxRuntimeExports.jsx("span",{className:"menu-title",children:j[b]});return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx("ul",{className:I,role:"menu",style:{width:Number(H),maxHeight:B},children:X?e.jsxRuntimeExports.jsxs("div",{className:`${C.$prefixCls}-cascader-loading`,children:[e.jsxRuntimeExports.jsx("span",{children:"加载中"}),e.jsxRuntimeExports.jsx(te.LoadingF,{className:"loading-icon"})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[G(),W.map(({disabled:t,label:p,value:f,disableTitle:h,isLeaf:i,isLoading:l,checked:g,option:c,fullPath:u,fullPathKey:d,disableCheckbox:R})=>{const T=()=>{if(t||D)return;const a=[...u];N&&i&&a.pop(),S(a)},J=()=>{w(c)&&M(u,i)};typeof c.title=="string"&&c.title;const Q=()=>{const a={marginRight:"4px",fontSize:"11px",color:"inherit"};return e.jsxRuntimeExports.jsxs("span",{children:[e.jsxRuntimeExports.jsx(ee.Forbid,{style:a}),h||U({id:"disableTilte"})]})};return e.jsxRuntimeExports.jsxs("li",{className:Y.default(n,{[`${n}-expand`]:!i,[`${n}-active`]:x===f||x===d,[`${n}-disabled`]:t,[`${n}-loading`]:l}),style:z,role:"menuitemcheckbox","aria-checked":g,"data-path-key":d,onClick:()=>{T(),!R&&(!o||i)&&J()},onDoubleClick:()=>{P&&L(!1)},onMouseEnter:()=>{N&&T()},onMouseDown:a=>{a.preventDefault()},children:[t?e.jsxRuntimeExports.jsx(V.Tooltip,{arrow:!1,placement:"topLeft",title:Q(),children:e.jsxRuntimeExports.jsx("div",{className:`${n}-content`,children:e.jsxRuntimeExports.jsx(y.default,{children:p})})}):e.jsxRuntimeExports.jsx("div",{className:`${n}-content`,children:e.jsxRuntimeExports.jsx(y.default,{children:p})}),!l&&q&&!i&&e.jsxRuntimeExports.jsx("div",{className:`${n}-expand-icon`,children:q}),l&&v&&e.jsxRuntimeExports.jsx("div",{className:`${n}-loading-icon`,children:v})]},d)})]})})})}exports.FIX_LABEL=F;exports.default=re;
|
|
2
2
|
//# sourceMappingURL=Column.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=require("../../_virtual/jsx-runtime.js"),Q=require("../../_virtual/
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=require("../../_virtual/jsx-runtime.js"),Q=require("../../_virtual/index.js"),W=require("rc-select"),Z=require("react"),ee=require("../context.js"),c=require("../utils/commonUtil.js"),E=require("../utils/treeUtil.js"),te=require("./CacheContent.js"),M=require("./Column.js"),oe=require("./useActive.js");function ne(a){const d=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const u in a)if(u!=="default"){const p=Object.getOwnPropertyDescriptor(a,u);Object.defineProperty(d,u,p.get?p:{enumerable:!0,get:()=>a[u]})}}return d.default=a,Object.freeze(d)}const r=ne(Z),se=r.forwardRef((a,d)=>{const{prefixCls:u,multiple:p,searchValue:P,toggleOpen:C,notFoundContent:V,direction:w,open:k}=W.useBaseProps(),L=r.useRef(),T=w==="rtl",{options:f,values:x,halfValues:b,fieldNames:s,changeOnSelect:j,onSelect:A,dropdownPrefixCls:D,loadData:q,expandTrigger:N,loading:ce}=r.useContext(ee.default),h=D||u,[m,K]=r.useState([]),$=e=>{if(!q||P)return;const o=E.toPathOptions(e,f,s).map(({option:l})=>l),n=o[o.length-1];if(n&&!c.isLeaf(n,s)){const l=c.toPathKey(e);K(g=>[...g,l]),q(o)}};r.useEffect(()=>{m.length&&m.forEach(e=>{const t=c.toPathValueStr(e),o=E.toPathOptions(t,f,s,!0).map(({option:l})=>l),n=o[o.length-1];(!n||n[s.children]||c.isLeaf(n,s))&&K(l=>l.filter(g=>g!==e))})},[f,m,s]);const F=r.useMemo(()=>new Set(c.toPathKeys(x)),[x]),I=r.useMemo(()=>new Set(c.toPathKeys(b)),[b]),[i,B]=oe.default(),U=e=>{B(e),$(e)},z=e=>{const{disabled:t}=e,o=c.isLeaf(e,s);return!t&&(o||j||p)},X=(e,t,o=!1)=>{A(e),!p&&(t||j&&(N==="hover"||o))&&C(!1)},O=r.useMemo(()=>f,[P,f]),R=r.useMemo(()=>{const e=[{options:O}];let t=O;const o=c.getFullPathKeys(t,s);for(let n=0;n<i.length;n+=1){const l=i[n],S=t.find((J,_)=>(o[_]?c.toPathKey(o[_]):J[s.value])===l)?.[s.children];if(!S?.length)break;t=S,e.push({options:S})}return e},[O,i,s]);r.useEffect(()=>{for(let e=0;e<i.length;e+=1){const t=i.slice(0,e+1),o=c.toPathKey(t),n=L.current?.querySelector(`li[data-path-key="${o.replace(/\\{0,2}"/g,'\\"')}"]`);n&&c.scrollIntoParentView(n)}},[i]);const y=!R[0]?.options?.length,Y=[{[s.value]:"__EMPTY__",[M.FIX_LABEL]:V,disabled:!0}],G={...a,multiple:!y&&p,onSelect:X,onActive:U,onToggleOpen:C,checkedSet:F,halfCheckedSet:I,loadingKeys:m,isSelectable:z},H=(y?[{options:Y}]:R).map((e,t)=>{const o=i.slice(0,t),n=i[t];return v.jsxRuntimeExports.jsx(M.default,{titleIndex:t,...G,searchValue:P,prefixCls:h,options:e.options,prevValuePath:o,activeValue:n},t)});return v.jsxRuntimeExports.jsx(te.default,{open:k,children:v.jsxRuntimeExports.jsx("div",{className:Q.default(`${h}-menus`,{[`${h}-menu-empty`]:y,[`${h}-rtl`]:T}),ref:L,children:H})})});exports.default=se;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Cascader",
|
|
3
|
+
"category": "Data Entry",
|
|
4
|
+
"description": "级联选择,用于多层级数据的选择",
|
|
5
|
+
"semantic": {
|
|
6
|
+
"intent": [
|
|
7
|
+
"层级选择",
|
|
8
|
+
"地域选择",
|
|
9
|
+
"分类选择"
|
|
10
|
+
],
|
|
11
|
+
"useCases": [
|
|
12
|
+
"省市区选择",
|
|
13
|
+
"商品分类",
|
|
14
|
+
"组织架构"
|
|
15
|
+
],
|
|
16
|
+
"riskLevel": "normal"
|
|
17
|
+
},
|
|
18
|
+
"variants": {
|
|
19
|
+
"default": {
|
|
20
|
+
"meaning": "标准级联"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"states": [
|
|
24
|
+
"default",
|
|
25
|
+
"disabled",
|
|
26
|
+
"error",
|
|
27
|
+
"loading"
|
|
28
|
+
],
|
|
29
|
+
"idealProps": {
|
|
30
|
+
"options": {
|
|
31
|
+
"type": "array",
|
|
32
|
+
"itemSchema": {
|
|
33
|
+
"label": { "type": "ReactNode", "required": true, "description": "选项显示文案" },
|
|
34
|
+
"value": { "type": "string | number | null", "description": "选项值" },
|
|
35
|
+
"children": { "type": "DefaultOptionType[]", "description": "子级选项,形成层级结构" },
|
|
36
|
+
"disabled": { "type": "boolean", "description": "是否禁用该选项" },
|
|
37
|
+
"disableCheckbox": { "type": "boolean", "description": "禁用 checkbox(checkable 模式)" },
|
|
38
|
+
"disableTitle": { "type": "string", "description": "禁用时 tooltip 提示文案" }
|
|
39
|
+
},
|
|
40
|
+
"description": "数据源,元素类型为 `DefaultOptionType`(包含 `label / value / children / disabled / disableTitle`;⚠️ `loading` 和 `isLeaf` **不在 DefaultOptionType 中**,是 loadData 场景扩展字段,需在业务类型中另声明)。业务自有节点类型对接三种推荐写法:(1) 泛型 `<Cascader<RegionNode> options={tree} />`(首选,Cascader 已暴露 `<OptionType extends BaseOptionType = DefaultOptionType>` 泛型);(2) 声明合并 `interface RegionNode extends DefaultOptionType { ... }`;(3) as 强转 `options={tree as DefaultOptionType[]}`(快速逃逸)。详见 docs/view/cascader/codeString.ts customOptionTypeCascader 示例。"
|
|
41
|
+
},
|
|
42
|
+
"value": {
|
|
43
|
+
"type": "(string | number)[]",
|
|
44
|
+
"description": "受控选中值;级联路径数组,每层一个值,如 `['guangdong', 'guangzhou']`。⚠️ 类型是 (string | number)[],不是 string[] 或 any[],传纯 string 路径需在调用侧 as string[]"
|
|
45
|
+
},
|
|
46
|
+
"defaultValue": {
|
|
47
|
+
"type": "(string | number)[]",
|
|
48
|
+
"description": "非受控初始选中值;格式同 value,如 `['guangdong', 'guangzhou']`。不要同时传 value + defaultValue"
|
|
49
|
+
},
|
|
50
|
+
"onChange": {
|
|
51
|
+
"type": "function",
|
|
52
|
+
"signature": "(value: (string | number)[], selectedOptions: DefaultOptionType[]) => void",
|
|
53
|
+
"description": "选中值改变回调。**完整签名**:第一参 value 是选中路径各级节点 value 组成的数组(如 ['guangdong', 'guangzhou']);第二参 selectedOptions 是路径各级节点完整对象数组。⚠️ **TS7006 陷阱(noImplicitAny)**:内联回调参数必须显式标注类型——`onChange={(value: (string | number)[]) => ...}` ✅;`onChange={(value) => ...}` ❌ 报 TS7006。**桥接 string[] 场景推荐写法**:`onChange={(value: (string | number)[]) => onPathChange(value as string[])}`"
|
|
54
|
+
},
|
|
55
|
+
"onDropdownVisibleChange": {
|
|
56
|
+
"type": "function",
|
|
57
|
+
"signature": "(visible: boolean) => void",
|
|
58
|
+
"description": "弹出层显示状态改变时的回调,visible=true 表示打开,false 表示关闭"
|
|
59
|
+
},
|
|
60
|
+
"changeOnSelect": {
|
|
61
|
+
"type": "boolean",
|
|
62
|
+
"default": false,
|
|
63
|
+
"description": "选择任一级即触发 onChange,无需选到末级"
|
|
64
|
+
},
|
|
65
|
+
"expandTrigger": {
|
|
66
|
+
"type": "enum",
|
|
67
|
+
"values": [
|
|
68
|
+
"click",
|
|
69
|
+
"hover"
|
|
70
|
+
],
|
|
71
|
+
"default": "click",
|
|
72
|
+
"description": "展开触发方式"
|
|
73
|
+
},
|
|
74
|
+
"expandIcon": {
|
|
75
|
+
"type": "ReactNode",
|
|
76
|
+
"description": "展开箭头图标"
|
|
77
|
+
},
|
|
78
|
+
"loadingIcon": {
|
|
79
|
+
"type": "ReactNode",
|
|
80
|
+
"description": "异步加载状态图标"
|
|
81
|
+
},
|
|
82
|
+
"expandJoin": {
|
|
83
|
+
"type": "string",
|
|
84
|
+
"default": "/",
|
|
85
|
+
"description": "已选路径文本拼接符"
|
|
86
|
+
},
|
|
87
|
+
"fieldNames": {
|
|
88
|
+
"type": "object",
|
|
89
|
+
"default": "{ label: 'label', value: 'value', children: 'children' }",
|
|
90
|
+
"objectShape": {
|
|
91
|
+
"label": { "type": "string", "description": "数据中作为显示文案的字段名,默认 'label'" },
|
|
92
|
+
"value": { "type": "string", "description": "数据中作为值的字段名,默认 'value'" },
|
|
93
|
+
"children": { "type": "string", "description": "数据中作为子级的字段名,默认 'children'" }
|
|
94
|
+
},
|
|
95
|
+
"description": "自定义节点字段名映射"
|
|
96
|
+
},
|
|
97
|
+
"placeholder": {
|
|
98
|
+
"type": "string",
|
|
99
|
+
"default": "请选择",
|
|
100
|
+
"description": "占位符"
|
|
101
|
+
},
|
|
102
|
+
"disabled": {
|
|
103
|
+
"type": "boolean",
|
|
104
|
+
"default": false,
|
|
105
|
+
"description": "是否整体禁用"
|
|
106
|
+
},
|
|
107
|
+
"disabledTooltip": {
|
|
108
|
+
"type": "TooltipProps",
|
|
109
|
+
"description": "disabled 时悬浮于触发框的 Tooltip 配置"
|
|
110
|
+
},
|
|
111
|
+
"optionsTitle": {
|
|
112
|
+
"type": "Array<string | null>",
|
|
113
|
+
"default": "[]",
|
|
114
|
+
"description": "每级面板顶部标题文案,下标对应级数"
|
|
115
|
+
},
|
|
116
|
+
"checkable": {
|
|
117
|
+
"type": "boolean | ReactNode",
|
|
118
|
+
"default": false,
|
|
119
|
+
"description": "是否多选;true 显示 checkbox,传 ReactNode 自定义勾选图标"
|
|
120
|
+
},
|
|
121
|
+
"displayRender": {
|
|
122
|
+
"type": "function",
|
|
123
|
+
"signature": "(label: string[], selectedOptions?: DefaultOptionType[]) => ReactNode",
|
|
124
|
+
"description": "自定义触发框已选项渲染。label 是路径各级节点 label 的字符串数组(非单一字符串);selectedOptions 是路径各级节点完整对象数组"
|
|
125
|
+
},
|
|
126
|
+
"loadData": {
|
|
127
|
+
"type": "function",
|
|
128
|
+
"signature": "(selectedOptions: DefaultOptionType[]) => void",
|
|
129
|
+
"description": "异步加载下一级数据。触发条件:用户展开 isLeaf=false 且无 children 的节点。selectedOptions 为当前展开路径各级节点数组。在回调内修改数据源并通过外部 setState 更新 options(标准模式:setOptions([...options]))"
|
|
130
|
+
},
|
|
131
|
+
"notFoundContent": {
|
|
132
|
+
"type": "ReactNode",
|
|
133
|
+
"description": "options 为空或搜索无匹配时的空状态"
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"do": [
|
|
137
|
+
"用于有明确层级关系的数据选择",
|
|
138
|
+
"数据量较大会延迟加载(loadData)",
|
|
139
|
+
"onChange 内联回调必须显式标注类型参数,避免 noImplicitAny 报错:onChange={(value: (string|number)[]) => ...}"
|
|
140
|
+
],
|
|
141
|
+
"dont": [
|
|
142
|
+
"层级过深(>5级)导致横向滚动过长",
|
|
143
|
+
"在非层级数据中使用 Cascader(应使用 Select)"
|
|
144
|
+
],
|
|
145
|
+
"events": {
|
|
146
|
+
"onChange": {
|
|
147
|
+
"signature": "(value: (string | number)[], selectedOptions: DefaultOptionType[]) => void",
|
|
148
|
+
"asyncSupported": false,
|
|
149
|
+
"examples": [
|
|
150
|
+
"基础用法:onChange={(value) => setPath(value)} // value 是路径各级 value 数组,如 ['guangdong', 'guangzhou']",
|
|
151
|
+
"获取完整路径对象:onChange={(value, selectedOptions) => setLabel(selectedOptions.map(o => o.label).join(' / '))}",
|
|
152
|
+
"桥接 string[] 类型:onChange={(value: (string|number)[]) => onPathChange(value as string[])}"
|
|
153
|
+
],
|
|
154
|
+
"commonMistakes": [
|
|
155
|
+
"内联回调不标注参数类型导致 TS7006 noImplicitAny 报错——必须显式声明 value: (string|number)[]",
|
|
156
|
+
"期望 onChange 在 changeOnSelect=false 时每级展开都触发——只有选到末级(或 changeOnSelect=true 时任意级)才触发",
|
|
157
|
+
"用 value[value.length-1] 取最终叶节点值——这是最后一级的 value,但当 checkable 多选时 value 结构不同(多维数组)"
|
|
158
|
+
]
|
|
159
|
+
},
|
|
160
|
+
"onDropdownVisibleChange": {
|
|
161
|
+
"signature": "(visible: boolean) => void",
|
|
162
|
+
"asyncSupported": false,
|
|
163
|
+
"examples": [
|
|
164
|
+
"弹出层打开时加载数据:onDropdownVisibleChange={(v) => { if (v && !loaded) fetchOptions(); }}",
|
|
165
|
+
"弹出层关闭时重置搜索:onDropdownVisibleChange={(v) => { if (!v) setSearch(''); }}",
|
|
166
|
+
"受控弹层:onDropdownVisibleChange={(v) => setOpen(v)}"
|
|
167
|
+
],
|
|
168
|
+
"commonMistakes": [
|
|
169
|
+
"期望 onOpen / onClose 独立回调——Cascader 只有 onDropdownVisibleChange,通过 visible 参数区分",
|
|
170
|
+
"在 onDropdownVisibleChange 里直接 loadData——loadData prop 是每级展开时的异步回调,不是全局弹层回调",
|
|
171
|
+
"visible=false 时立即清空 options——关闭动画期间 Cascader 仍需 options 数据,过早清空会闪烁"
|
|
172
|
+
]
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
"typescriptPitfalls": [
|
|
176
|
+
{
|
|
177
|
+
"issue": "onChange 内联回调参数必须显式标注类型,否则 noImplicitAny 报 TS7006",
|
|
178
|
+
"wrong": "<Cascader onChange={(value) => setV(value)} /> // TS7006: 'value' 参数隐式具有 'any' 类型",
|
|
179
|
+
"right": "<Cascader onChange={(value: (string | number)[]) => setV(value)} />"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"issue": "业务自有节点类型必须 extends BaseOptionType(含索引签名),否则泛型约束失败",
|
|
183
|
+
"wrong": "interface Region { label: string; value: string; code: string; } // 无索引签名\n<Cascader<Region> options={regions} /> // TS 报错:Region 不满足 BaseOptionType",
|
|
184
|
+
"right": "interface Region extends DefaultOptionType { code: string; } // 继承 DefaultOptionType 或直接继承 BaseOptionType"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"issue": "DefaultOptionType 的 loading 和 isLeaf 字段不在类型定义中——loadData 场景需扩展类型",
|
|
188
|
+
"wrong": "const node: DefaultOptionType = { label: '北京', value: 'bj', isLeaf: false }; // TS: isLeaf 不在 DefaultOptionType",
|
|
189
|
+
"right": "interface LazyOption extends DefaultOptionType { isLeaf?: boolean; loading?: boolean; }\nconst node: LazyOption = { label: '北京', value: 'bj', isLeaf: false };"
|
|
190
|
+
}
|
|
191
|
+
],
|
|
192
|
+
"mapping": {
|
|
193
|
+
"realComponent": "Cascader",
|
|
194
|
+
"adapter": null
|
|
195
|
+
}
|
|
196
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react"),f=require("../utils/treeUtil.js"),p=require("../utils/commonUtil.js");function b(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const i=b(l),g=(e,n)=>{const t=i.useRef({options:null,info:null});return i.useCallback(()=>(t.current.options!==e&&(t.current.options=e,t.current.info=f.convertDataToEntities(e,{fieldNames:n,initWrapper:r=>({...r,pathKeyEntities:{}}),processEntity:(r,u)=>{const s=u,c=r.nodes.map(a=>a[n.value]).join(p.VALUE_SPLIT);s.pathKeyEntities[c]=r,r.key=c}})),t.current.info.pathKeyEntities),[n,e])};exports.default=g;
|
|
2
2
|
//# sourceMappingURL=useEntities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { DefaultOptionType, BaseOptionType } from './Cascader';
|
|
@@ -15,4 +15,4 @@ export declare function toPathValueStr(pathKey: string): string[];
|
|
|
15
15
|
export declare function fillFieldNames(fieldNames?: FieldNames): InternalFieldNames;
|
|
16
16
|
export declare function isLeaf(option: DefaultOptionType, fieldNames: FieldNames): boolean;
|
|
17
17
|
export declare function scrollIntoParentView(element: HTMLElement): void;
|
|
18
|
-
export declare function getFullPathKeys(options: DefaultOptionType[], fieldNames: FieldNames):
|
|
18
|
+
export declare function getFullPathKeys(options: DefaultOptionType[], fieldNames: FieldNames): (SingleValueType | undefined)[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n="__RC_CASCADER_SPLIT__",c="SHOW_PARENT",i="SHOW_CHILD",a="__rc_cascader_search_mark__";function s(t){return t.join(n)}function f(t){return t.map(s)}function u(t){return t.split(n)}function _(t){const{label:e,value:o,children:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n="__RC_CASCADER_SPLIT__",c="SHOW_PARENT",i="SHOW_CHILD",a="__rc_cascader_search_mark__";function s(t){return t.join(n)}function f(t){return t.map(s)}function u(t){return t.split(n)}function _(t){const{label:e,value:o,children:r}=t||{},l=o||"value";return{label:e||"label",value:l,key:l,children:r||"children"}}function h(t,e){return t.isLeaf??!t[e.children]?.length}function P(t){const e=t.parentElement;if(!e)return;const o=t.offsetTop-e.offsetTop;o-e.scrollTop<0?e.scrollTo({top:o}):o+t.offsetHeight-e.scrollTop>e.offsetHeight&&e.scrollTo({top:o+t.offsetHeight-e.offsetHeight})}function S(t,e){return t.map(o=>o[a]?.map(l=>l[e.value]))}exports.SEARCH_MARK=a;exports.SHOW_CHILD=i;exports.SHOW_PARENT=c;exports.VALUE_SPLIT=n;exports.fillFieldNames=_;exports.getFullPathKeys=S;exports.isLeaf=h;exports.scrollIntoParentView=P;exports.toPathKey=s;exports.toPathKeys=f;exports.toPathValueStr=u;
|
|
2
2
|
//# sourceMappingURL=commonUtil.js.map
|
|
@@ -2,8 +2,17 @@ import { SingleValueType, DefaultOptionType, InternalFieldNames, ShowCheckedStra
|
|
|
2
2
|
import { GetEntities } from '../hooks/useEntities';
|
|
3
3
|
declare type Key = string | number;
|
|
4
4
|
export declare type GetKey<RecordType> = (record: RecordType, index?: number) => Key;
|
|
5
|
-
type
|
|
6
|
-
|
|
5
|
+
type DataNode = DefaultOptionType;
|
|
6
|
+
interface DataEntity {
|
|
7
|
+
node: DataNode;
|
|
8
|
+
nodes: DataNode[];
|
|
9
|
+
index?: number;
|
|
10
|
+
pos: string;
|
|
11
|
+
key: Key;
|
|
12
|
+
level: number;
|
|
13
|
+
parent?: DataEntity;
|
|
14
|
+
children?: DataEntity[];
|
|
15
|
+
}
|
|
7
16
|
interface TraverseDataNodesConfig {
|
|
8
17
|
childrenPropName?: string;
|
|
9
18
|
externalGetKey?: ExternalGetKey;
|
|
@@ -28,7 +37,7 @@ export declare function toPathOptions(valueCells: SingleValueType, options: Defa
|
|
|
28
37
|
option: DefaultOptionType;
|
|
29
38
|
}[];
|
|
30
39
|
export declare function convertDataToEntities(dataNodes: DataNode[], { initWrapper, processEntity, onProcessFinished, externalGetKey, childrenPropName, fieldNames }?: {
|
|
31
|
-
initWrapper?: (wrapper:
|
|
40
|
+
initWrapper?: (wrapper: Wrapper) => Wrapper;
|
|
32
41
|
processEntity?: (entity: DataEntity, wrapper: Wrapper) => void;
|
|
33
42
|
onProcessFinished?: (wrapper: Wrapper) => void;
|
|
34
43
|
externalGetKey?: ExternalGetKey;
|
|
@@ -37,8 +46,8 @@ export declare function convertDataToEntities(dataNodes: DataNode[], { initWrapp
|
|
|
37
46
|
},
|
|
38
47
|
/** @deprecated Use `config.externalGetKey` instead */
|
|
39
48
|
legacyExternalGetKey?: ExternalGetKey): {
|
|
40
|
-
posEntities:
|
|
41
|
-
keyEntities:
|
|
49
|
+
posEntities: Record<string, DataEntity>;
|
|
50
|
+
keyEntities: Record<Key, DataEntity>;
|
|
42
51
|
};
|
|
43
52
|
export declare function traverseDataNodes(dataNodes: DataNode[], callback: (data: {
|
|
44
53
|
node: DataNode;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("rc-tree/lib/utils/treeUtil"),O=require("./commonUtil.js");function b(l,s,o){const t=new Set(l),u=s();return l.filter(n=>{const i=u[n],d=i?i.parent:null,f=i?i.children:null;return i&&i.node.disabled?!0:o===O.SHOW_CHILD?!(f&&f.some(c=>c.key&&t.has(c.key))):!(d&&!d.node.disabled&&t.has(d.key))})}function D(l,s,o,t=!1){let u=s;const n=[];for(let i=0;i<l.length;i+=1){const d=l[i],f=u?.findIndex(y=>{const a=y[o.value];return t?String(a)===String(d):a===d}),c=f!==-1?u?.[f]:null;n.push({value:c?.[o.value]??d,index:f,option:c}),u=c?.[o.children]}return n}function G(l,{initWrapper:s,processEntity:o,onProcessFinished:t,externalGetKey:u,childrenPropName:n,fieldNames:i}={},d){const f=u||d,c={},y={};let a={posEntities:c,keyEntities:y};return s&&(a=s(a)||a),K(l,e=>{const{node:p,index:h,pos:g,key:v,parentPos:m,level:P,nodes:k}=e,r={node:p,nodes:k,index:h,key:v,pos:g,level:P},E=S.getKey(v,g);c[g]=r,y[E]=r,r.parent=c[m],r.parent&&(r.parent.children=r.parent.children||[],r.parent.children.push(r)),o&&o(r,a)},{externalGetKey:f,childrenPropName:n,fieldNames:i}),t&&t(a),a}function K(l,s,o){let t={};typeof o=="object"?t=o:t={externalGetKey:o},t=t||{};const{childrenPropName:u,externalGetKey:n,fieldNames:i}=t,{key:d,children:f}=N(i),c=u||f;let y;n?typeof n=="string"?y=e=>e[n]:typeof n=="function"&&(y=e=>n(e)):y=(e,p)=>S.getKey(e[d],p);function a(e,p,h,g){const v=e?e[c]:l,m=e?x(h.pos,p):"0",P=e?[...g,e]:[];if(e){const k=y(e,m),r={node:e,index:p,pos:m,key:k,parentPos:h?.node?h.pos:null,level:h.level+1,nodes:P};s(r)}v&&v.forEach((k,r)=>{a(k,r,{node:e,pos:m,level:h?h.level+1:-1},P)})}a(null)}function x(l,s){return`${l}-${s}`}function N(l){const{title:s,_title:o,key:t,children:u}=l||{},n=s||"title";return{title:n,_title:o||[n],key:t||"key",children:u||"children"}}exports.convertDataToEntities=G;exports.fillFieldNames=N;exports.formatStrategyValues=b;exports.getPosition=x;exports.toPathOptions=D;exports.traverseDataNodes=K;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("rc-tree/lib/utils/treeUtil"),O=require("./commonUtil.js");function b(l,s,o){const t=new Set(l),u=s();return l.filter(n=>{const i=u[n],d=i?i.parent:null,f=i?i.children:null;return i&&i.node.disabled?!0:o===O.SHOW_CHILD?!(f&&f.some(c=>c.key&&t.has(c.key))):!(d&&!d.node.disabled&&t.has(d.key))})}function D(l,s,o,t=!1){let u=s;const n=[];for(let i=0;i<l.length;i+=1){const d=l[i],f=u?.findIndex(y=>{const a=y[o.value];return t?String(a)===String(d):a===d}),c=f!==-1?u?.[f]:null;n.push({value:c?.[o.value]??d,index:f,option:c}),u=c?.[o.children]}return n}function G(l,{initWrapper:s,processEntity:o,onProcessFinished:t,externalGetKey:u,childrenPropName:n,fieldNames:i}={},d){const f=u||d,c={},y={};let a={posEntities:c,keyEntities:y};return s&&(a=s(a)||a),K(l,e=>{const{node:p,index:h,pos:g,key:v,parentPos:m,level:P,nodes:k}=e,r={node:p,nodes:k,index:h,key:v,pos:g,level:P},E=S.getKey(v,g);c[g]=r,y[E]=r,r.parent=c[m],r.parent&&(r.parent.children=r.parent.children||[],r.parent.children.push(r)),o&&o(r,a)},{externalGetKey:f,childrenPropName:n,fieldNames:i}),t&&t(a),a}function K(l,s,o){let t={};typeof o=="object"?t=o:t={externalGetKey:o},t=t||{};const{childrenPropName:u,externalGetKey:n,fieldNames:i}=t,{key:d,children:f}=N(i),c=u||f;let y;n?typeof n=="string"?y=e=>e[n]:typeof n=="function"&&(y=e=>n(e)):y=(e,p)=>S.getKey(e[d],p);function a(e,p,h,g){const v=e?e[c]:l,m=e?x(h.pos,p):"0",P=e?[...g??[],e]:[];if(e){const k=y(e,m),r={node:e,index:p,pos:m,key:k,parentPos:h?.node?h.pos:null,level:h.level+1,nodes:P};s(r)}v&&v.forEach((k,r)=>{a(k,r,{node:e,pos:m,level:h?h.level+1:-1},P)})}a(null)}function x(l,s){return`${l}-${s}`}function N(l){const{title:s,_title:o,key:t,children:u}=l||{},n=s||"title";return{title:n,_title:o||[n],key:t||"key",children:u||"children"}}exports.convertDataToEntities=G;exports.fillFieldNames=N;exports.formatStrategyValues=b;exports.getPosition=x;exports.toPathOptions=D;exports.traverseDataNodes=K;
|
|
2
2
|
//# sourceMappingURL=treeUtil.js.map
|