@para-ui/core 5.0.0-beta.12 → 5.0.0-beta.13
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/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/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 +50 -47
- package/es/Anchor/type.d.ts +8 -4
- package/es/Argv/component.json +216 -0
- package/es/Argv/index.d.ts +5 -6
- 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 +32 -29
- 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/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/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/CodeEditor/component.json +189 -0
- package/es/CodeEditor/index.d.ts +10 -9
- 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 +73 -68
- 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 +10 -10
- package/es/DatePicker/generatePicker/generateSinglePicker.js +1 -1
- package/es/Descriptions/component.json +142 -0
- package/es/Descriptions/index.d.ts +1 -1
- package/es/Desktop/component.json +171 -0
- 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/DynamicMultiBox/component.json +278 -0
- package/es/DynamicMultiBox/formItem.d.ts +1 -1
- 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/FieldForm/FieldFormItem/MemoInput.d.ts +2 -2
- package/es/FieldForm/FieldFormItem/index.d.ts +6 -6
- package/es/FieldForm/Form.d.ts +2 -2
- 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/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/Help/component.json +118 -0
- package/es/HelperText/component.json +126 -0
- package/es/Image/component.json +165 -0
- package/es/InputCode/component.json +191 -0
- package/es/InputCode/index.d.ts +2 -2
- package/es/InputLang/component.json +205 -0
- package/es/InputLang/index.js +1 -1
- package/es/InputNumber/component.json +162 -0
- 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/Message/component.json +246 -0
- package/es/Message/index.d.ts +2 -2
- package/es/Message/index.js +2 -2
- package/es/Modal/Confirm/index.d.ts +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/Pagination/component.json +181 -0
- package/es/Pagination/index.js +15 -15
- 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/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.js +1 -1
- 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.js +113 -113
- package/es/SelectInput/component.json +184 -0
- package/es/Selector/component.json +203 -0
- package/es/Selector/index.js +28 -27
- package/es/Selector/interface.d.ts +1 -1
- package/es/Selector/selectorMain/index.js +2 -2
- package/es/Selector/selectorNode/index.js +1 -1
- package/es/Selector/util.d.ts +2 -2
- 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 +414 -414
- package/es/Table/interface.d.ts +6 -0
- 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/TextField/component.json +290 -0
- package/es/TextField/index.d.ts +2 -2
- 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/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/component.json +512 -0
- package/es/Upload/component.json +450 -0
- package/es/Utils/type.d.ts +0 -2
- package/es/index.d.ts +2 -0
- package/es/index.js +1 -1
- 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 +361 -0
- package/es/locale/zh_CN.js +364 -0
- 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/index.d.ts +5 -6
- 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/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/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/CodeEditor/component.json +189 -0
- package/lib/CodeEditor/index.d.ts +10 -9
- 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/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/DynamicMultiBox/component.json +278 -0
- package/lib/DynamicMultiBox/formItem.d.ts +1 -1
- 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/FieldForm/FieldFormItem/MemoInput.d.ts +2 -2
- package/lib/FieldForm/FieldFormItem/index.d.ts +6 -6
- package/lib/FieldForm/Form.d.ts +2 -2
- 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/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/Help/component.json +118 -0
- package/lib/HelperText/component.json +126 -0
- package/lib/Image/component.json +165 -0
- 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/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/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/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/Pagination/component.json +181 -0
- package/lib/Pagination/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/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.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.js +1 -1
- package/lib/SelectInput/component.json +184 -0
- package/lib/Selector/component.json +203 -0
- package/lib/Selector/index.js +1 -1
- package/lib/Selector/interface.d.ts +1 -1
- package/lib/Selector/selectorMain/index.js +1 -1
- package/lib/Selector/selectorNode/index.js +1 -1
- package/lib/Selector/util.d.ts +2 -2
- 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 +6 -0
- 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/TextField/component.json +290 -0
- package/lib/TextField/index.d.ts +2 -2
- 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/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/component.json +512 -0
- package/lib/Upload/component.json +450 -0
- package/lib/Utils/type.d.ts +0 -2
- package/lib/index.d.ts +2 -0
- package/lib/index.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 +361 -0
- package/lib/locale/zh_CN.js +2 -0
- package/package.json +9 -3
- /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
package/es/AutoButton/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { Tooltip as J } from "../Tooltip/index.js";
|
|
|
10
10
|
import v from "clsx";
|
|
11
11
|
import L from "../GlobalContext/useFormatMessage.js";
|
|
12
12
|
import V from "./lang/index.js";
|
|
13
|
-
import q from "../
|
|
13
|
+
import q from "../Hooks/useResizeObserver.js";
|
|
14
14
|
import './index.css';/* empty css */
|
|
15
15
|
const lt = (P) => {
|
|
16
16
|
const {
|
|
@@ -6,7 +6,7 @@ export interface AutoTipsMultilineProps extends Omit<AutoTipsProps, 'children'>
|
|
|
6
6
|
/** 行数 */
|
|
7
7
|
line?: number;
|
|
8
8
|
/** 刷新 */
|
|
9
|
-
refresh?:
|
|
9
|
+
refresh?: () => void;
|
|
10
10
|
}
|
|
11
11
|
declare const AutoTipsMultiline: FunctionComponent<AutoTipsMultilineProps>;
|
|
12
12
|
export default AutoTipsMultiline;
|
|
@@ -2,7 +2,7 @@ import { j as n } from "../../_virtual/jsx-runtime.js";
|
|
|
2
2
|
import { useRef as p, useState as b, useEffect as y, useMemo as L } from "react";
|
|
3
3
|
import { $prefixCls as f } from "../../GlobalContext/constant.js";
|
|
4
4
|
import { Tooltip as O } from "../../Tooltip/index.js";
|
|
5
|
-
import k from "../../
|
|
5
|
+
import k from "../../Hooks/useResizeObserver.js";
|
|
6
6
|
import './index.css';/* empty css */
|
|
7
7
|
const J = (A) => {
|
|
8
8
|
const {
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "AutoTips",
|
|
3
|
+
"category": "Data Display",
|
|
4
|
+
"description": "文本溢出自动提示——内容超出容器宽度时自动弹出 Tooltip,不超出时不显示;beyondText 控制 Tooltip 显示文本还是原始 children 节点",
|
|
5
|
+
"semantic": {
|
|
6
|
+
"intent": [
|
|
7
|
+
"溢出提示",
|
|
8
|
+
"文本截断"
|
|
9
|
+
],
|
|
10
|
+
"useCases": [
|
|
11
|
+
"表格单元格",
|
|
12
|
+
"列表项",
|
|
13
|
+
"标签"
|
|
14
|
+
],
|
|
15
|
+
"riskLevel": "low"
|
|
16
|
+
},
|
|
17
|
+
"variants": {
|
|
18
|
+
"default": {
|
|
19
|
+
"meaning": "默认样式"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"states": [
|
|
23
|
+
"default",
|
|
24
|
+
"overflow"
|
|
25
|
+
],
|
|
26
|
+
"idealProps": {
|
|
27
|
+
"children": {
|
|
28
|
+
"type": "ReactNode",
|
|
29
|
+
"description": "被截断的内容;单行模式不限制类型,多行模式(AutoTipsMultiline)限制为 string"
|
|
30
|
+
},
|
|
31
|
+
"tips": {
|
|
32
|
+
"type": "ReactNode",
|
|
33
|
+
"description": "超出时 Tooltip 显示的内容。**不传时**:beyondText=true(默认)显示 tipsElm.innerText;beyondText=false 显示原始 children。**传了 tips**:超出时直接显示 tips,忽略 beyondText"
|
|
34
|
+
},
|
|
35
|
+
"beyondText": {
|
|
36
|
+
"type": "boolean",
|
|
37
|
+
"default": true,
|
|
38
|
+
"description": "未传 tips 时的 Tooltip 内容:true=显示文本(innerText);false=显示原始 children 节点"
|
|
39
|
+
},
|
|
40
|
+
"placement": {
|
|
41
|
+
"type": "enum",
|
|
42
|
+
"values": [
|
|
43
|
+
"top",
|
|
44
|
+
"top-start",
|
|
45
|
+
"top-end",
|
|
46
|
+
"bottom",
|
|
47
|
+
"bottom-start",
|
|
48
|
+
"bottom-end",
|
|
49
|
+
"left",
|
|
50
|
+
"left-start",
|
|
51
|
+
"left-end",
|
|
52
|
+
"right",
|
|
53
|
+
"right-start",
|
|
54
|
+
"right-end"
|
|
55
|
+
],
|
|
56
|
+
"default": "bottom-start",
|
|
57
|
+
"description": "Tooltip 弹出方向(默认 bottom-start)"
|
|
58
|
+
},
|
|
59
|
+
"tipMaxWidth": {
|
|
60
|
+
"type": "number | string",
|
|
61
|
+
"description": "Tooltip 最大宽度"
|
|
62
|
+
},
|
|
63
|
+
"arrow": {
|
|
64
|
+
"type": "boolean",
|
|
65
|
+
"default": false,
|
|
66
|
+
"description": "Tooltip 是否显示箭头"
|
|
67
|
+
},
|
|
68
|
+
"interactive": {
|
|
69
|
+
"type": "boolean",
|
|
70
|
+
"default": true,
|
|
71
|
+
"description": "Tooltip 是否可交互(鼠标移入 Tooltip 不消失)"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"do": [
|
|
75
|
+
"在表格单元格中自动处理长文本截断+提示",
|
|
76
|
+
"设置合理的 tipMaxWidth 避免 Tooltip 过宽",
|
|
77
|
+
"多行截断场景使用导出的 AutoTipsMultiline 子组件(children 需为 string)"
|
|
78
|
+
],
|
|
79
|
+
"dont": [
|
|
80
|
+
"在短文本场景中滥用(AutoTips 每次 hover 都做宽度比较,短文本无截断时 Tooltip 不会弹,但有轻微性能开销)",
|
|
81
|
+
"tip 内容过于复杂(Tooltip 本身宽度有限,复杂节点用 Popover)",
|
|
82
|
+
"在多行模式(AutoTipsMultiline)下传 ReactNode 类型 children——多行限制为 string"
|
|
83
|
+
],
|
|
84
|
+
"events": {
|
|
85
|
+
"onMouseOver (内部)": {
|
|
86
|
+
"signature": "内部 onMouseOver 事件,无对外暴露",
|
|
87
|
+
"asyncSupported": false,
|
|
88
|
+
"examples": [
|
|
89
|
+
"鼠标悬停时 AutoTips 内部调用 mouseHover() 比较 tipsElm 与 textElm 宽度决定是否展示 Tooltip",
|
|
90
|
+
"超出宽度时自动设置 tTips state,Tooltip title 随之更新",
|
|
91
|
+
"不超出时 tTips 为空字符串,Tooltip 不渲染弹层"
|
|
92
|
+
],
|
|
93
|
+
"commonMistakes": [
|
|
94
|
+
"期望传 onOverflow 回调在超出时得到通知——AutoTips 不暴露此事件,如需监听请用 ResizeObserver 自行比较",
|
|
95
|
+
"期望 tips prop 变化时立即更新 Tooltip 内容——tips 变化会通过 useEffect 更新 tTips state,下次 hover 才生效",
|
|
96
|
+
"在 SSR 场景中使用 AutoTips——依赖 getBoundingClientRect(),SSR 下无 DOM 会报错"
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"typescriptPitfalls": [
|
|
101
|
+
{
|
|
102
|
+
"issue": "placement 的完整枚举是带方向后缀的 MUI Popper 风格(如 'top-start'),不是简单的 'top'/'bottom'",
|
|
103
|
+
"wrong": "<AutoTips placement='topLeft'>...</AutoTips> // 'topLeft' 不在联合类型,TS 报错",
|
|
104
|
+
"right": "<AutoTips placement='top-start'>...</AutoTips> // 使用连字符形式"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"issue": "AutoTips 导出了 AutoTipsMultiline 子组件,但二者 props 不同——多行模式 children 必须为 string",
|
|
108
|
+
"wrong": "import AutoTips from '@para-ui/core/AutoTips';\n// 误用 AutoTips(单行)做多行截断\n<AutoTips style={{ WebkitLineClamp: 2 }}><ReactNode/></AutoTips> // 多行截断行为不可靠",
|
|
109
|
+
"right": "import { AutoTipsMultiline } from '@para-ui/core/AutoTips';\n<AutoTipsMultiline line={2}>{'长文本字符串'}</AutoTipsMultiline>"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"issue": "tips 不传时 tTips 由 mouseHover 计算,初始为空字符串——不要用 tips='' 期望清空提示",
|
|
113
|
+
"wrong": "<AutoTips tips=''>文本内容</AutoTips> // tips='' 等价于 tips=undefined,超出时仍显示 innerText",
|
|
114
|
+
"right": "// 不传 tips 让 AutoTips 自动提取文本\n<AutoTips>文本内容</AutoTips>"
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"mapping": {
|
|
118
|
+
"realComponent": "AutoTips",
|
|
119
|
+
"adapter": null
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Badge",
|
|
3
|
+
"category": "Data Display",
|
|
4
|
+
"description": "出现在子元素角部的标记节点。**注意:不接受 antd 风格的 count / dot / maxCount / overflowCount 这些 prop**——本组件用 sign 作为核心标记内容(ReactNode),不传 sign 时退化为小圆点;传 null 时不显示",
|
|
5
|
+
"semantic": {
|
|
6
|
+
"intent": [
|
|
7
|
+
"展示数量",
|
|
8
|
+
"展示状态",
|
|
9
|
+
"吸引注意"
|
|
10
|
+
],
|
|
11
|
+
"useCases": [
|
|
12
|
+
"消息计数",
|
|
13
|
+
"在线状态",
|
|
14
|
+
"新功能标记"
|
|
15
|
+
],
|
|
16
|
+
"riskLevel": "low"
|
|
17
|
+
},
|
|
18
|
+
"variants": {
|
|
19
|
+
"default": {
|
|
20
|
+
"meaning": "默认(带 sign 内容时按 sign 渲染;不传 sign 退化为小圆点)"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"states": [
|
|
24
|
+
"visible",
|
|
25
|
+
"hidden"
|
|
26
|
+
],
|
|
27
|
+
"idealProps": {
|
|
28
|
+
"children": {
|
|
29
|
+
"type": "ReactNode",
|
|
30
|
+
"description": "被徽标包裹的目标元素,Badge 会在其右上角(或 placement 指定位置)叠加徽标显示",
|
|
31
|
+
"required": false
|
|
32
|
+
},
|
|
33
|
+
"sign": {
|
|
34
|
+
"type": "ReactNode",
|
|
35
|
+
"description": "标记内容。**核心 prop**:传数字 / 字符串显示文本徽标;不传退化为小圆点;传 null 时整个徽标不显示(用于条件展示)"
|
|
36
|
+
},
|
|
37
|
+
"backgroundColor": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"description": "徽标背景色(CSS 颜色字符串)"
|
|
40
|
+
},
|
|
41
|
+
"color": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"description": "徽标文字色(CSS 颜色字符串)"
|
|
44
|
+
},
|
|
45
|
+
"offset": {
|
|
46
|
+
"type": "[number, number]",
|
|
47
|
+
"description": "徽标相对默认位置的像素偏移 [x, y]"
|
|
48
|
+
},
|
|
49
|
+
"placement": {
|
|
50
|
+
"type": "enum",
|
|
51
|
+
"values": [
|
|
52
|
+
"top-left",
|
|
53
|
+
"top-right",
|
|
54
|
+
"bottom-left",
|
|
55
|
+
"bottom-right"
|
|
56
|
+
],
|
|
57
|
+
"default": "top-right",
|
|
58
|
+
"description": "徽标在子元素四角的位置"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"do": [
|
|
62
|
+
"用 sign 传 ReactNode 作为标记(数字 / 短字符串 / 状态点)",
|
|
63
|
+
"条件展示:传 sign={null} 隐藏徽标但保留 children 占位",
|
|
64
|
+
"超过 999 的数字自动显示 '999+',无需业务方手动判断"
|
|
65
|
+
],
|
|
66
|
+
"dont": [
|
|
67
|
+
"传 count / dot / maxCount / overflowCount / status——这些 antd 风格 prop 不存在",
|
|
68
|
+
"把核心内容放到 children——children 是被标记的目标元素,不是徽标本身"
|
|
69
|
+
],
|
|
70
|
+
"events": {},
|
|
71
|
+
"typescriptPitfalls": [
|
|
72
|
+
{
|
|
73
|
+
"issue": "sign 是 ReactNode 而非数字,传 null 和不传 sign 含义不同",
|
|
74
|
+
"wrong": "// 期望隐藏徽标,传 sign={0} 却仍然显示数字 0\n<Badge sign={0}>图标</Badge> // 0 是数字,显示'0'文本徽标",
|
|
75
|
+
"right": "// 传 null 才能隐藏徽标\n<Badge sign={null}>图标</Badge> // handleType 返回 'null',handleSign 返回 null 不渲染"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"issue": "offset 是 [number, number] 元组,不是对象 { x, y }",
|
|
79
|
+
"wrong": "<Badge offset={{ x: 4, y: -4 }}>图标</Badge> // TS 类型报错:期望 [number, number]",
|
|
80
|
+
"right": "<Badge offset={[4, -4]}>图标</Badge> // [offsetX, offsetY],正数向右/向下"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"issue": "不要传 antd 风格的 count / dot / maxCount / overflowCount prop——它们不存在于 BadgeProps",
|
|
84
|
+
"wrong": "<Badge count={5} dot={false}>图标</Badge> // count/dot 不在 BadgeProps,静默失效",
|
|
85
|
+
"right": "<Badge sign={5}>图标</Badge> // para-ui 用 sign 作为核心标记内容"
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
"mapping": {
|
|
89
|
+
"realComponent": "Badge",
|
|
90
|
+
"adapter": null
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Breadcrumbs",
|
|
3
|
+
"category": "Navigation",
|
|
4
|
+
"description": "面包屑导航,显示当前页面在系统层级结构中的位置;内置自适应收缩:容器宽度不足时自动折叠中间项到'更多'弹层",
|
|
5
|
+
"semantic": {
|
|
6
|
+
"intent": [
|
|
7
|
+
"展示路径",
|
|
8
|
+
"向上导航",
|
|
9
|
+
"定位上下文"
|
|
10
|
+
],
|
|
11
|
+
"useCases": [
|
|
12
|
+
"多级菜单",
|
|
13
|
+
"详情页",
|
|
14
|
+
"层级浏览"
|
|
15
|
+
],
|
|
16
|
+
"riskLevel": "low"
|
|
17
|
+
},
|
|
18
|
+
"variants": {
|
|
19
|
+
"default": {
|
|
20
|
+
"meaning": "标准面包屑"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"states": [
|
|
24
|
+
"default"
|
|
25
|
+
],
|
|
26
|
+
"idealProps": {
|
|
27
|
+
"list": {
|
|
28
|
+
"type": "listOptions[]",
|
|
29
|
+
"typeDefinition": "interface listOptions { label: ReactNode; maxWidth?: string; disabled?: boolean; [name: string]: any }",
|
|
30
|
+
"description": "路由数据列表。**每项必填 label**(显示文案,ReactNode);disabled=true 时该项不可点击;maxWidth 覆盖单项最大宽度(默认用顶层 maxWidth)。**末尾项(最后一项)自动不可点击**(src:154 实证)"
|
|
31
|
+
},
|
|
32
|
+
"separator": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"default": "/",
|
|
35
|
+
"description": "分隔符(src:38 interface 实证:类型为 string,不是 ReactNode)"
|
|
36
|
+
},
|
|
37
|
+
"maxWidth": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"default": "160px",
|
|
40
|
+
"description": "每项最大宽度(px),超出则内部 AutoTips 自动截断显示省略号"
|
|
41
|
+
},
|
|
42
|
+
"isShrink": {
|
|
43
|
+
"type": "boolean",
|
|
44
|
+
"default": true,
|
|
45
|
+
"description": "是否启用自适应收缩(容器宽度不足时折叠中间项到'更多'弹层)"
|
|
46
|
+
},
|
|
47
|
+
"minNum": {
|
|
48
|
+
"type": "number",
|
|
49
|
+
"default": 2,
|
|
50
|
+
"description": "收缩时最少保留显示的项数(末尾 N 项始终显示)"
|
|
51
|
+
},
|
|
52
|
+
"isBack": {
|
|
53
|
+
"type": "boolean",
|
|
54
|
+
"default": false,
|
|
55
|
+
"description": "是否显示返回按钮(在面包屑右侧)"
|
|
56
|
+
},
|
|
57
|
+
"backRender": {
|
|
58
|
+
"type": "ReactNode",
|
|
59
|
+
"description": "自定义返回按钮内容(不传时显示默认返回图标 + 文字)"
|
|
60
|
+
},
|
|
61
|
+
"onClickItem": {
|
|
62
|
+
"type": "(ops: listOptions) => void",
|
|
63
|
+
"description": "点击非末尾且非 disabled 项时的回调(末尾项和 disabled 项不触发)"
|
|
64
|
+
},
|
|
65
|
+
"onBack": {
|
|
66
|
+
"type": "() => void",
|
|
67
|
+
"description": "点击返回按钮的回调;不传时默认点击 list 倒数第二项"
|
|
68
|
+
},
|
|
69
|
+
"trigger": {
|
|
70
|
+
"type": "'hover' | 'click'",
|
|
71
|
+
"default": "hover",
|
|
72
|
+
"description": "收缩弹层的触发方式"
|
|
73
|
+
},
|
|
74
|
+
"placement": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"default": "bottomLeft",
|
|
77
|
+
"description": "收缩弹层的弹出位置"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"do": [
|
|
81
|
+
"在层级较深的系统中提供 Breadcrumbs",
|
|
82
|
+
"保持层级路径清晰,避免过深 (>5级)",
|
|
83
|
+
"list 末尾项自动不可点击,无需手动设 disabled",
|
|
84
|
+
"需要返回上级功能用 isBack=true,需要自定义返回行为用 onBack 回调"
|
|
85
|
+
],
|
|
86
|
+
"dont": [
|
|
87
|
+
"在扁平化结构的站点强行使用 Breadcrumbs",
|
|
88
|
+
"Breadcrumbs 替代主导航",
|
|
89
|
+
"传 separator={<Icon />} ReactNode 类型——src interface 类型为 string,传 ReactNode 会有 TS 警告"
|
|
90
|
+
],
|
|
91
|
+
"events": {
|
|
92
|
+
"onClickItem": {
|
|
93
|
+
"signature": "(ops: listOptions) => void",
|
|
94
|
+
"asyncSupported": false,
|
|
95
|
+
"examples": [
|
|
96
|
+
"点击面包屑项导航:onClickItem={(item) => router.push(item.path)}",
|
|
97
|
+
"传入回调时只有非末尾、非 disabled 的项才触发(src:154 实证)",
|
|
98
|
+
"结合 list 的扩展字段:onClickItem={(item) => { if (item.href) window.location.href = item.href; }}"
|
|
99
|
+
],
|
|
100
|
+
"commonMistakes": [
|
|
101
|
+
"期望末尾项也能 onClickItem——末尾项(list.length-1 === index)在 src:154 被拦截,永远不触发",
|
|
102
|
+
"把路由信息放到 onClickItem 回调参数之外——item 是 listOptions 对象,可通过索引签名携带任意业务字段",
|
|
103
|
+
"期望 onClickItem 携带 index 参数——签名只有 (ops: listOptions),无 index;需要 index 请在 list 中嵌入业务 id"
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
"onBack": {
|
|
107
|
+
"signature": "() => void",
|
|
108
|
+
"asyncSupported": false,
|
|
109
|
+
"examples": [
|
|
110
|
+
"自定义返回行为:onBack={() => navigate(-1)}",
|
|
111
|
+
"不传时默认点击 list 倒数第二项(触发 onClickItem)",
|
|
112
|
+
"配合 isBack=true 使用:<Breadcrumbs isBack onBack={handleBack} />"
|
|
113
|
+
],
|
|
114
|
+
"commonMistakes": [
|
|
115
|
+
"传了 onBack 但忘传 isBack=true——onBack 存在但不显示返回按钮,回调永远不触发",
|
|
116
|
+
"期望 onBack 携带当前最后一项——回调无参数,最后一项可从 list[list.length-1] 直接取",
|
|
117
|
+
"同时期望 onBack 和返回按钮的默认行为(点 list[-2])——传了 onBack 就完全覆盖默认行为"
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"typescriptPitfalls": [
|
|
122
|
+
{
|
|
123
|
+
"issue": "separator 类型为 string,不支持 ReactNode,传 ReactNode 会有 TS 报错",
|
|
124
|
+
"wrong": "<Breadcrumbs separator={<ChevronRight />} list={list} /> // TS: ReactNode 不可分配给 string",
|
|
125
|
+
"right": "<Breadcrumbs separator='>' list={list} /> // 只接受字符串"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"issue": "listOptions 有索引签名 [name: string]: any,但 label 是必填字段,不传会导致运行时显示空白",
|
|
129
|
+
"wrong": "const list = [{ path: '/home' }, { path: '/detail' }]; // 缺少 label,显示空白",
|
|
130
|
+
"right": "const list: listOptions[] = [{ label: '首页', path: '/home' }, { label: '详情', path: '/detail' }];"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"issue": "disabled 字段是 listOptions 可选属性(boolean),但 TypeScript 在索引签名下不强制检查类型",
|
|
134
|
+
"wrong": "const list = [{ label: '返回', disabled: 'true' }]; // 字符串 'true' 在 runtime 按 truthy 处理,但语义错",
|
|
135
|
+
"right": "const list: listOptions[] = [{ label: '返回', disabled: true }]; // 显式声明 listOptions[] 让 TS 检查"
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
"mapping": {
|
|
139
|
+
"realComponent": "Breadcrumbs",
|
|
140
|
+
"adapter": null
|
|
141
|
+
}
|
|
142
|
+
}
|
package/es/Breadcrumbs/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { Return as J } from "../node_modules/@para-ui/icons/Return/index.js";
|
|
|
7
7
|
import { $prefixCls as l } from "../GlobalContext/constant.js";
|
|
8
8
|
import G from "../GlobalContext/useFormatMessage.js";
|
|
9
9
|
import K from "./lang/index.js";
|
|
10
|
-
import Q from "../
|
|
10
|
+
import Q from "../Hooks/useResizeObserver.js";
|
|
11
11
|
import './index.css';/* empty css */
|
|
12
12
|
const nr = (S) => {
|
|
13
13
|
const {
|
|
@@ -12,7 +12,7 @@ interface Option {
|
|
|
12
12
|
/**
|
|
13
13
|
* 按钮value
|
|
14
14
|
*/
|
|
15
|
-
value?:
|
|
15
|
+
value?: unknown;
|
|
16
16
|
/**
|
|
17
17
|
* 禁用按钮
|
|
18
18
|
*/
|
|
@@ -23,7 +23,7 @@ interface Option {
|
|
|
23
23
|
disabledTooltip?: TooltipProps;
|
|
24
24
|
/** 气泡确认框参数 */
|
|
25
25
|
popConfirmProps?: PopConfirmProps;
|
|
26
|
-
[name: string]:
|
|
26
|
+
[name: string]: unknown;
|
|
27
27
|
}
|
|
28
28
|
type GroupOption = Array<Option>;
|
|
29
29
|
export interface SplitButtonProps {
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Button",
|
|
3
|
+
"category": "Basic",
|
|
4
|
+
"description": "用于触发用户操作的按钮组件",
|
|
5
|
+
"semantic": {
|
|
6
|
+
"intent": [
|
|
7
|
+
"提交",
|
|
8
|
+
"确认",
|
|
9
|
+
"触发操作",
|
|
10
|
+
"导航"
|
|
11
|
+
],
|
|
12
|
+
"useCases": [
|
|
13
|
+
"表单提交",
|
|
14
|
+
"弹窗确认",
|
|
15
|
+
"页面主操作",
|
|
16
|
+
"表格操作栏"
|
|
17
|
+
],
|
|
18
|
+
"riskLevel": "normal"
|
|
19
|
+
},
|
|
20
|
+
"variants": {
|
|
21
|
+
"contained": {
|
|
22
|
+
"meaning": "主要操作,强调引导用户点击",
|
|
23
|
+
"constraints": [
|
|
24
|
+
"一个操作区域通常只放置一个 contained 按钮"
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"outlined": {
|
|
28
|
+
"meaning": "次要操作,作为一个替代选择"
|
|
29
|
+
},
|
|
30
|
+
"text": {
|
|
31
|
+
"meaning": "最轻量级的操作,通常用于表格行内或辅助位置"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"modifiers": {
|
|
35
|
+
"danger": {
|
|
36
|
+
"meaning": "高风险操作标识(如删除、重置),与 variant 正交——可与 contained/outlined/text 任一组合",
|
|
37
|
+
"constraints": [
|
|
38
|
+
"建议配合二次确认(如 PopConfirm)使用,但非强制"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"states": [
|
|
43
|
+
"default",
|
|
44
|
+
"disabled",
|
|
45
|
+
"loading"
|
|
46
|
+
],
|
|
47
|
+
"idealProps": {
|
|
48
|
+
"variant": {
|
|
49
|
+
"type": "enum",
|
|
50
|
+
"values": [
|
|
51
|
+
"contained",
|
|
52
|
+
"outlined",
|
|
53
|
+
"text"
|
|
54
|
+
],
|
|
55
|
+
"default": "contained"
|
|
56
|
+
},
|
|
57
|
+
"size": {
|
|
58
|
+
"type": "enum",
|
|
59
|
+
"values": [
|
|
60
|
+
"small",
|
|
61
|
+
"medium",
|
|
62
|
+
"large"
|
|
63
|
+
],
|
|
64
|
+
"default": "large",
|
|
65
|
+
"description": "按钮尺寸。**注意:默认 large**(与 antd/MUI 业界惯例 medium 不同——这是 para-ui 的设计选择,DEFECT-003 wont-fix 留设计评审)。如需业界默认尺寸请显式传 size='medium'"
|
|
66
|
+
},
|
|
67
|
+
"loading": {
|
|
68
|
+
"type": "boolean | { delay: number }",
|
|
69
|
+
"default": false,
|
|
70
|
+
"description": "载入状态。loading=true 时按钮显示 loading 图标 + 自动加 disabled 属性(**隐含 disabled,onClick 不触发**)——与 antd/MUI 惯例一致。`loading={delay: ms}`:loading spinner 最短可见时长(delay 毫秒),防止快速请求场景闪烁",
|
|
71
|
+
"behaviorNote": "v5.x DEFECT-001 修复:之前需要 `disabled={loading}` 双写防御,**现在 loading=true 已自动隐含 disabled(onClick 不触发),无需再写 disabled={loading}**——双写不造成 bug 但属于冗余代码。零破坏:src 业务 0 引用此 prop;docs 仅 1 处示例不受影响"
|
|
72
|
+
},
|
|
73
|
+
"disabled": {
|
|
74
|
+
"type": "boolean",
|
|
75
|
+
"default": false
|
|
76
|
+
},
|
|
77
|
+
"danger": {
|
|
78
|
+
"type": "boolean",
|
|
79
|
+
"default": false,
|
|
80
|
+
"description": "危险操作修饰符;与 variant 正交(可与 contained/outlined/text 任一组合)。详见顶层 modifiers.danger"
|
|
81
|
+
},
|
|
82
|
+
"startIcon": {
|
|
83
|
+
"type": "ReactNode",
|
|
84
|
+
"description": "前置图标"
|
|
85
|
+
},
|
|
86
|
+
"endIcon": {
|
|
87
|
+
"type": "ReactNode",
|
|
88
|
+
"description": "后置图标"
|
|
89
|
+
},
|
|
90
|
+
"href": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"description": "跳转链接,传入此属性时行为类似 a 标签"
|
|
93
|
+
},
|
|
94
|
+
"target": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"description": "链接打开方式"
|
|
97
|
+
},
|
|
98
|
+
"toolTipTitle": {
|
|
99
|
+
"type": "ReactNode",
|
|
100
|
+
"description": "**hover 悬停提示(最简快捷写法)——仅 disabled=false 时生效**。src 内 toolTipTitle 路径把 Tooltip `disabled={disabled}` 透传,因此按钮禁用时 Tooltip 同时被禁用(tooltip 不显示)。⚠️ Tooltip 相关共有 3 个 prop(toolTipTitle / TooltipProps / disabledTooltip),命名风格不一致 + 职责重叠是已知问题(DEFECT-002,独立 epic 评审中——src 内 134+ 处使用)。**优先级(src 实证)**:① disabled=true + disabledTooltip 有值 → 走 disabledTooltip 路径;② toolTipTitle 非空 → 显示 Tooltip(disabled=false 时);③ TooltipProps 覆盖 toolTipTitle 的 arrow/placement 等样式参数。**结论:disabled 状态的悬停提示必须用 disabledTooltip,toolTipTitle 在 disabled=true 时不显示**。**传 undefined / null / false 时等价于不传,不渲染 Tooltip wrapper,不影响点击区域**"
|
|
101
|
+
},
|
|
102
|
+
"disabledTooltip": {
|
|
103
|
+
"type": "{ title: ReactNode; placement?: string; arrow?: boolean; [key: string]: any }",
|
|
104
|
+
"description": "**disabled=true 时的悬停提示**(toolTipTitle 在 disabled=true 时不生效,需用此 prop)。TooltipProps 核心字段:`title: ReactNode`(必填)/ `placement?`(弹出方向,默认 'top')/ `arrow?: boolean`(箭头)。**最简写法**:`disabledTooltip={{ title: '不可操作原因' }}`"
|
|
105
|
+
},
|
|
106
|
+
"children": {
|
|
107
|
+
"type": "ReactNode",
|
|
108
|
+
"description": "**按钮文案或内容(正式 prop)**。通过 React 标准 children 传入;可传字符串或 ReactNode,与 startIcon/endIcon 可同时使用。ButtonProps extends ButtonOrAnchorAttributes(继承自 React.ButtonHTMLAttributes),children 是标准 React prop——不单独在此处列出不代表不支持"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"do": [
|
|
112
|
+
"主要操作使用 contained",
|
|
113
|
+
"重要但非主要操作使用 outlined",
|
|
114
|
+
"危险操作必须明确标识(danger 属性)",
|
|
115
|
+
"表单提交场景传 `type='submit'`(默认 `type='button'` 防意外表单提交;Button 通过 restProps 透传 HTML 原生 button 属性,`type='submit'` 会覆盖默认值生效)。⚠️ **type 是 HTML native attribute · 只接受 'button' / 'submit' / 'reset'。若你想用 antd 风格 `type='primary'` · paraui 对应是 `variant='contained'`;若你想 antd `type='default'` · paraui 用 `variant='outlined'`;若 antd `type='danger'` · paraui 用 `danger={true}`(modifier · 与 variant 正交)**",
|
|
116
|
+
"disabled 状态需要悬停提示时用 disabledTooltip(toolTipTitle 在 disabled=true 时不显示)",
|
|
117
|
+
"loading 状态无需额外写 disabled={loading}——loading=true 已自动隐含 disabled(DEFECT-001 修复)",
|
|
118
|
+
"**ButtonProps extends ButtonOrAnchorAttributes**(src/Button/index.tsx:21):所有原生 button/a 属性均可安全透传,TypeScript 严格模式下不会类型报错——`type='submit'` / `name` / `form`(关联 form id)/ `disabled` / `aria-*` 等均可用"
|
|
119
|
+
],
|
|
120
|
+
"dont": [
|
|
121
|
+
"在同一区域放置过多 contained 按钮",
|
|
122
|
+
"使用 disabled 按钮作为唯一的禁用反馈(应配合 Tooltip 解释原因)",
|
|
123
|
+
"❌ 不要用 `type='primary'` / `type='default'` / `type='danger'`(antd 风格)· paraui 用 `variant='contained'` / `variant='outlined'` / `danger={true}`(modifier 与 variant 正交)",
|
|
124
|
+
"❌ 不要用 `color='primary'`(MUI 风格)· paraui 用 variant + danger 拆分语义"
|
|
125
|
+
],
|
|
126
|
+
"events": {
|
|
127
|
+
"onClick": {
|
|
128
|
+
"signature": "(event: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void",
|
|
129
|
+
"asyncSupported": false,
|
|
130
|
+
"examples": [
|
|
131
|
+
"基本点击处理:onClick={() => handleSubmit()}",
|
|
132
|
+
"需要阻止冒泡:onClick={(e) => { e.stopPropagation(); doAction(); }}",
|
|
133
|
+
"loading 状态下 onClick 不触发(已自动隐含 disabled):无需 onClick 里手动判断 isLoading"
|
|
134
|
+
],
|
|
135
|
+
"commonMistakes": [
|
|
136
|
+
"loading=true 时期望 onClick 还触发——loading 自动隐含 disabled,onClick 被屏蔽;无需再写 disabled={loading}",
|
|
137
|
+
"disabled=true 时用 toolTipTitle 做禁用提示——disabled 状态下 toolTipTitle 不显示;需改用 disabledTooltip prop",
|
|
138
|
+
"在 href 模式(传了 href)下期望 onClick 阻止跳转——渲染为 <a>,onClick 里需 e.preventDefault() 才能阻止"
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"typescriptPitfalls": [
|
|
143
|
+
{
|
|
144
|
+
"issue": "variant 不是 antd 的 type,不接受 'primary'/'default'/'danger',只接受 'contained'/'outlined'/'text'",
|
|
145
|
+
"wrong": "// antd 风格:\n<Button type='primary'>提交</Button> // 这里 type 是 HTML button type,不是样式!",
|
|
146
|
+
"right": "// para-ui 风格:\n<Button variant='contained'>提交</Button> // 主要操作用 contained\n<Button variant='outlined'>取消</Button> // 次要操作用 outlined\n<Button danger>删除</Button> // 危险操作加 danger modifier"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"issue": "type prop 是 HTML 原生 button type('button'|'submit'|'reset'),不是样式 variant",
|
|
150
|
+
"wrong": "<Button type='primary'>提交</Button> // TypeScript 报错:'primary' 不在 'button'|'submit'|'reset' 联合类型",
|
|
151
|
+
"right": "<Button variant='contained' type='submit'>提交</Button> // type 只管 form 提交行为,默认 'button'"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"issue": "loading 的对象形式需要传 { delay: number },不能传其他结构",
|
|
155
|
+
"wrong": "loading={{ duration: 300 }} // TS 类型报错:对象形式只接受 { delay: number }",
|
|
156
|
+
"right": "loading={{ delay: 300 }} // delay 是 loading spinner 最短可见毫秒数"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"issue": "disabledTooltip 的 title 字段必填,TooltipProps 的 disabled 字段含义是'禁用 tooltip 本身'——不要传 disabled",
|
|
160
|
+
"wrong": "disabledTooltip={{ disabled: true, title: '...' }} // disabled 是 Tooltip 的开关,传 true 反而不显示",
|
|
161
|
+
"right": "disabledTooltip={{ title: '不可操作原因' }} // 只需 title,Button disabled=true 时自动触发"
|
|
162
|
+
}
|
|
163
|
+
],
|
|
164
|
+
"mapping": {
|
|
165
|
+
"realComponent": "Button",
|
|
166
|
+
"adapter": null
|
|
167
|
+
}
|
|
168
|
+
}
|