@para-ui/core 5.0.0-beta.12 → 5.0.0-beta.14
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/codemods/modal-onCancel-to-onDismiss.js +69 -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/Cascader.js +188 -180
- 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 +41 -33
- 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 +299 -287
- package/es/ComboSelect/interface.d.ts +6 -3
- 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.d.ts +0 -8
- package/es/DatePicker/generatePicker/generateRangePicker.js +73 -65
- package/es/DatePicker/generatePicker/generateSinglePicker.js +1 -1
- package/es/DatePicker/generatePicker/index.d.ts +11 -4
- 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/Confirm/index.js +81 -75
- package/es/Modal/component.json +277 -0
- package/es/Modal/index.d.ts +97 -6
- package/es/Modal/index.js +174 -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 +74 -63
- 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/Cascader.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/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 +6 -3
- 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.d.ts +0 -8
- package/lib/DatePicker/generatePicker/generateRangePicker.js +1 -1
- package/lib/DatePicker/generatePicker/generateSinglePicker.js +1 -1
- package/lib/DatePicker/generatePicker/index.d.ts +11 -4
- 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/Confirm/index.js +1 -1
- package/lib/Modal/component.json +277 -0
- package/lib/Modal/index.d.ts +97 -6
- 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 +10 -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/Button/index.js
CHANGED
|
@@ -11,32 +11,32 @@ const z = (b) => {
|
|
|
11
11
|
variant: N = "contained",
|
|
12
12
|
size: T = "large",
|
|
13
13
|
className: p,
|
|
14
|
-
disabled:
|
|
15
|
-
children:
|
|
14
|
+
disabled: s = !1,
|
|
15
|
+
children: l,
|
|
16
16
|
startIcon: e,
|
|
17
|
-
endIcon:
|
|
18
|
-
loading:
|
|
17
|
+
endIcon: o,
|
|
18
|
+
loading: c = !1,
|
|
19
19
|
toolTipTitle: x = "",
|
|
20
20
|
TooltipProps: B,
|
|
21
21
|
danger: L = !1,
|
|
22
22
|
href: h,
|
|
23
23
|
target: j,
|
|
24
|
-
disabledTooltip:
|
|
24
|
+
disabledTooltip: a,
|
|
25
25
|
...f
|
|
26
|
-
} = b, [
|
|
26
|
+
} = b, [r, m] = y(!1), d = "href" in b, i = () => P(
|
|
27
27
|
`${n}-button`,
|
|
28
28
|
p,
|
|
29
29
|
`${n}-button-${N}`,
|
|
30
30
|
`${n}-button-${T}`,
|
|
31
|
-
|
|
32
|
-
L && !
|
|
31
|
+
r && `${n}-button-loading`,
|
|
32
|
+
L && !s && `${n}-button-dangerous`,
|
|
33
33
|
d && `${n}-button-link`,
|
|
34
|
-
d &&
|
|
34
|
+
d && s && `${n}-button-link-disabled`
|
|
35
35
|
), u = (k) => {
|
|
36
|
-
if (!
|
|
37
|
-
return k === "start" && e ? /* @__PURE__ */ t.jsx("span", { className: "button-icon", children: e }) : k === "end" &&
|
|
38
|
-
if (typeof
|
|
39
|
-
const v =
|
|
36
|
+
if (!r)
|
|
37
|
+
return k === "start" && e ? /* @__PURE__ */ t.jsx("span", { className: "button-icon", children: e }) : k === "end" && o ? /* @__PURE__ */ t.jsx("span", { className: "button-icon button-icon-end", children: o }) : null;
|
|
38
|
+
if (typeof c == "object") {
|
|
39
|
+
const v = c.delay || 0;
|
|
40
40
|
setTimeout(() => m(!1), v);
|
|
41
41
|
}
|
|
42
42
|
return k === "start" ? /* @__PURE__ */ t.jsx("span", { className: "button-icon button-icon-loading", children: /* @__PURE__ */ t.jsx(C, {}) }) : null;
|
|
@@ -46,34 +46,34 @@ const z = (b) => {
|
|
|
46
46
|
...f,
|
|
47
47
|
href: h,
|
|
48
48
|
target: j,
|
|
49
|
-
className:
|
|
49
|
+
className: i(),
|
|
50
50
|
children: [
|
|
51
51
|
u("start"),
|
|
52
|
-
|
|
52
|
+
l && /* @__PURE__ */ t.jsx("span", { className: "button-label", children: l }),
|
|
53
53
|
u("end")
|
|
54
54
|
]
|
|
55
55
|
}
|
|
56
56
|
) : /* @__PURE__ */ t.jsxs(
|
|
57
57
|
"button",
|
|
58
58
|
{
|
|
59
|
-
disabled:
|
|
59
|
+
disabled: s || r,
|
|
60
60
|
type: "button",
|
|
61
|
-
className:
|
|
61
|
+
className: i(),
|
|
62
62
|
...f,
|
|
63
63
|
children: [
|
|
64
64
|
u("start"),
|
|
65
|
-
|
|
65
|
+
l && /* @__PURE__ */ t.jsx("span", { className: "button-label", children: l }),
|
|
66
66
|
u("end")
|
|
67
67
|
]
|
|
68
68
|
}
|
|
69
69
|
);
|
|
70
70
|
return I(() => {
|
|
71
|
-
m(!!
|
|
72
|
-
}, [
|
|
71
|
+
m(!!c);
|
|
72
|
+
}, [c]), s && a ? /* @__PURE__ */ t.jsx(
|
|
73
73
|
g,
|
|
74
74
|
{
|
|
75
75
|
disabled: !0,
|
|
76
|
-
...
|
|
76
|
+
...a,
|
|
77
77
|
children: /* @__PURE__ */ t.jsx("span", { className: `${n}-button--disabled`, children: $() })
|
|
78
78
|
}
|
|
79
79
|
) : x ? /* @__PURE__ */ t.jsx(
|
|
@@ -82,9 +82,9 @@ const z = (b) => {
|
|
|
82
82
|
arrow: !1,
|
|
83
83
|
placement: "bottomLeft",
|
|
84
84
|
...B,
|
|
85
|
-
disabled:
|
|
85
|
+
disabled: s,
|
|
86
86
|
title: x,
|
|
87
|
-
children:
|
|
87
|
+
children: s ? /* @__PURE__ */ t.jsx("span", { className: `${n}-button--disabled`, children: $() }) : $()
|
|
88
88
|
}
|
|
89
89
|
) : $();
|
|
90
90
|
}, E = (b) => {
|
|
@@ -92,33 +92,33 @@ const z = (b) => {
|
|
|
92
92
|
variant: N = "contained",
|
|
93
93
|
size: T = "large",
|
|
94
94
|
toolTipTitle: p = "",
|
|
95
|
-
children:
|
|
96
|
-
className:
|
|
95
|
+
children: s,
|
|
96
|
+
className: l,
|
|
97
97
|
disabled: e = !1,
|
|
98
|
-
loading:
|
|
99
|
-
TooltipProps:
|
|
98
|
+
loading: o = !1,
|
|
99
|
+
TooltipProps: c,
|
|
100
100
|
danger: x = !1,
|
|
101
101
|
href: B,
|
|
102
102
|
target: L,
|
|
103
103
|
disabledTooltip: h,
|
|
104
104
|
...j
|
|
105
|
-
} = b, [
|
|
105
|
+
} = b, [a, f] = y(!1), r = "href" in b, m = () => P(
|
|
106
106
|
`${n}-button ${n}-icon-button`,
|
|
107
|
-
|
|
107
|
+
l,
|
|
108
108
|
`${n}-icon-button-${N}`,
|
|
109
109
|
`${n}-icon-button-${T}`,
|
|
110
|
-
|
|
110
|
+
a && `${n}-icon-button-loading`,
|
|
111
111
|
x && !e && `${n}-icon-button-dangerous`,
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
r && `${n}-button-link`,
|
|
113
|
+
r && e && `${n}-button-link-disabled`
|
|
114
114
|
), d = () => {
|
|
115
|
-
if (!
|
|
116
|
-
if (typeof
|
|
117
|
-
const u =
|
|
115
|
+
if (!a) return s;
|
|
116
|
+
if (typeof o == "object") {
|
|
117
|
+
const u = o.delay || 0;
|
|
118
118
|
setTimeout(() => f(!1), u);
|
|
119
119
|
}
|
|
120
120
|
return /* @__PURE__ */ t.jsx("span", { className: "button-loading-icon", children: /* @__PURE__ */ t.jsx(C, {}) });
|
|
121
|
-
},
|
|
121
|
+
}, i = () => r ? /* @__PURE__ */ t.jsx(
|
|
122
122
|
"a",
|
|
123
123
|
{
|
|
124
124
|
...j,
|
|
@@ -131,33 +131,33 @@ const z = (b) => {
|
|
|
131
131
|
"button",
|
|
132
132
|
{
|
|
133
133
|
...j,
|
|
134
|
-
disabled: e,
|
|
134
|
+
disabled: e || a,
|
|
135
135
|
type: "button",
|
|
136
136
|
className: m(),
|
|
137
137
|
children: d()
|
|
138
138
|
}
|
|
139
139
|
);
|
|
140
140
|
return I(() => {
|
|
141
|
-
f(!!
|
|
142
|
-
}, [
|
|
141
|
+
f(!!o);
|
|
142
|
+
}, [o]), e && h ? /* @__PURE__ */ t.jsx(
|
|
143
143
|
g,
|
|
144
144
|
{
|
|
145
145
|
disabled: !0,
|
|
146
146
|
...h,
|
|
147
|
-
children: /* @__PURE__ */ t.jsx("span", { className: `${n}-button--disabled`, children:
|
|
147
|
+
children: /* @__PURE__ */ t.jsx("span", { className: `${n}-button--disabled`, children: i() })
|
|
148
148
|
}
|
|
149
149
|
) : p ? /* @__PURE__ */ t.jsx(
|
|
150
150
|
g,
|
|
151
151
|
{
|
|
152
152
|
arrow: !1,
|
|
153
153
|
placement: "bottomLeft",
|
|
154
|
-
...
|
|
154
|
+
...c,
|
|
155
155
|
disabled: e,
|
|
156
156
|
title: p,
|
|
157
|
-
children: e ? /* @__PURE__ */ t.jsx("span", { className: `${n}-button--disabled`, children:
|
|
157
|
+
children: e ? /* @__PURE__ */ t.jsx("span", { className: `${n}-button--disabled`, children: i() }) : i()
|
|
158
158
|
},
|
|
159
|
-
+
|
|
160
|
-
) :
|
|
159
|
+
+a
|
|
160
|
+
) : i();
|
|
161
161
|
}, S = z;
|
|
162
162
|
S.IconButton = E;
|
|
163
163
|
S.SplitButton = w;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ButtonGroup",
|
|
3
|
+
"category": "General",
|
|
4
|
+
"description": "按钮组,将多个按钮组合在一起",
|
|
5
|
+
"semantic": {
|
|
6
|
+
"intent": [
|
|
7
|
+
"操作分组",
|
|
8
|
+
"互斥选择"
|
|
9
|
+
],
|
|
10
|
+
"useCases": [
|
|
11
|
+
"视图切换",
|
|
12
|
+
"格式化工具栏",
|
|
13
|
+
"分段控制"
|
|
14
|
+
],
|
|
15
|
+
"riskLevel": "low"
|
|
16
|
+
},
|
|
17
|
+
"variants": {
|
|
18
|
+
"icon": {
|
|
19
|
+
"meaning": "图标模式"
|
|
20
|
+
},
|
|
21
|
+
"iconSplit": {
|
|
22
|
+
"meaning": "图标分割模式"
|
|
23
|
+
},
|
|
24
|
+
"text": {
|
|
25
|
+
"meaning": "文本模式"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"states": [
|
|
29
|
+
"default",
|
|
30
|
+
"disabled"
|
|
31
|
+
],
|
|
32
|
+
"idealProps": {
|
|
33
|
+
"data": {
|
|
34
|
+
"type": "ButtonItem[]",
|
|
35
|
+
"itemSchema": {
|
|
36
|
+
"icon": { "type": "ReactNode", "description": "按钮图标" },
|
|
37
|
+
"text": { "type": "ReactNode", "description": "按钮文本(icon/iconSplit 模式下仅作 tooltip 默认值;text 模式下为显示文字)" },
|
|
38
|
+
"disabled": { "type": "boolean", "description": "单项禁用(覆盖组件级 disabled)" },
|
|
39
|
+
"toolTipTitle": { "type": "ReactNode", "description": "该项 tooltip 文案(优先级高于 text)" },
|
|
40
|
+
"variant": { "type": "'contained' | 'outlined' | 'text'", "description": "继承自 ButtonProps,text 模式下用于标识激活态" }
|
|
41
|
+
},
|
|
42
|
+
"description": "按钮组数据数组,每项 ButtonItem extends ButtonProps(来自 src/Button — 可用 variant / size / loading / type 等全部 Button 字段),额外含 ButtonGroup 专用字段 icon? / text? / toolTipTitle? + 索引签名透传业务字段;src/ButtonGroup/index.tsx:15。**text 字段双语义**:icon/iconSplit 模式下 text 仅作 tooltip 默认值(不显示为按钮文字),text 模式下 text 才是按钮显示文字。**ButtonItem.value 字段冲突**:继承自 Button 类型为 `string | number | readonly string[] | undefined`,**不是单纯 string** — 业务标识请用 viewId / actionKey / menuKey 等独有名避免 tsc 报错(R22 ButtonGroup-004 实证)。**data[].disabled** 是单项独立覆盖字段(boolean,非字符串)"
|
|
43
|
+
},
|
|
44
|
+
"mode": {
|
|
45
|
+
"type": "enum",
|
|
46
|
+
"values": [
|
|
47
|
+
"icon",
|
|
48
|
+
"iconSplit",
|
|
49
|
+
"text"
|
|
50
|
+
],
|
|
51
|
+
"default": "icon",
|
|
52
|
+
"description": "按钮组模式(icon=纯图标 / iconSplit=分割可见 / text=纯文字)。**text 模式下 variant 切换有效**:variant='contained' 实心高亮 / variant='outlined' 描边弱化 — 配合外部 activeKey state 实现 tabs 视觉切换(组件无内置 active 状态)"
|
|
53
|
+
},
|
|
54
|
+
"layout": {
|
|
55
|
+
"type": "enum",
|
|
56
|
+
"values": [
|
|
57
|
+
"horizontal",
|
|
58
|
+
"vertical"
|
|
59
|
+
],
|
|
60
|
+
"default": "horizontal",
|
|
61
|
+
"description": "布局方向"
|
|
62
|
+
},
|
|
63
|
+
"showToolTip": {
|
|
64
|
+
"type": "boolean",
|
|
65
|
+
"default": "false",
|
|
66
|
+
"description": "对每按钮显示 tooltip,未设 toolTipTitle 时自动用 text 作为提示;单项 toolTipTitle 优先级高于此自动逻辑"
|
|
67
|
+
},
|
|
68
|
+
"showIcon": {
|
|
69
|
+
"type": "boolean",
|
|
70
|
+
"default": "false",
|
|
71
|
+
"description": "text 模式下文字前显示 icon(icon/iconSplit 模式无效)"
|
|
72
|
+
},
|
|
73
|
+
"disabled": {
|
|
74
|
+
"type": "boolean",
|
|
75
|
+
"default": "false",
|
|
76
|
+
"description": "整组禁用;单项可通过 data[].disabled(**boolean,不是字符串 'true'**)单独覆盖;src/ButtonGroup/index.tsx:88 单项若未设则继承顶层"
|
|
77
|
+
},
|
|
78
|
+
"onClick": {
|
|
79
|
+
"type": "(item: ButtonItem, event?: React.MouseEvent) => void",
|
|
80
|
+
"description": "点击回调;**item 是被点击的整个 ButtonItem 对象**(含 data 项里的所有自定义字段,如业务 id / viewId 等)— 推荐做法:在 data 每项上挂 value / viewId 等业务字段,onClick 内 item.viewId 直取(不必维护 index → 业务 id 的映射)"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"do": [
|
|
84
|
+
"用于互斥或相关操作的分组",
|
|
85
|
+
"保持按钮数量适中(2-5)",
|
|
86
|
+
"在 data 每项透传业务字段(如 value / viewId / actionKey),onClick 内 item.业务字段 取值"
|
|
87
|
+
],
|
|
88
|
+
"dont": [
|
|
89
|
+
"ButtonGroup 内放置不相关的操作",
|
|
90
|
+
"按钮过多导致布局拥挤",
|
|
91
|
+
"把 data[].disabled 传字符串 'true'(必须 boolean — runtime 行为不可信)",
|
|
92
|
+
"假设 ButtonGroup 有内置 active/selected 状态(无此 prop — tabs 切换需外部 state 维护 activeKey,根据 activeKey 在 data 项里切 variant: 'contained' | 'outlined')",
|
|
93
|
+
"把业务标识透传到 ButtonItem.value 字段(value 继承自 Button 是宽类型 `string | number | readonly string[] | undefined` — tsc 会报错;业务标识用 viewId / actionKey / menuKey 等独有名)"
|
|
94
|
+
],
|
|
95
|
+
"events": {
|
|
96
|
+
"onClick": {
|
|
97
|
+
"signature": "(item: ButtonItem, event?: React.MouseEvent) => void",
|
|
98
|
+
"asyncSupported": false,
|
|
99
|
+
"examples": [
|
|
100
|
+
"通用点击入口:onClick={(item) => dispatch({ type: item.actionKey })}",
|
|
101
|
+
"获取被点击项的业务标识:onClick={(item) => navigate(item.viewId)}",
|
|
102
|
+
"需要事件对象:onClick={(item, event) => { event?.stopPropagation(); handleItem(item); }}"
|
|
103
|
+
],
|
|
104
|
+
"commonMistakes": [
|
|
105
|
+
"期望 item 只是 index 或 key——item 是被点击的完整 ButtonItem 对象,含 data[] 中该项的所有字段",
|
|
106
|
+
"在 data 里用 ButtonItem.value 存业务 id——value 继承自 Button 是宽类型 string|number|readonly string[]|undefined,建议用 viewId/actionKey 等独有字段名",
|
|
107
|
+
"event 参数是可选的(签名 event?),回调内直接访问 event.target 前需检查 event 非 undefined"
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"typescriptPitfalls": [
|
|
112
|
+
{
|
|
113
|
+
"issue": "ButtonItem 继承自 ButtonProps,value 字段类型是 string|number|readonly string[]|undefined,不是单纯 string",
|
|
114
|
+
"wrong": "const items: ButtonItem[] = [{ icon: <Icon/>, text: '编辑', value: 'edit' }];\n// onClick 中:const id: string = item.value; // TS 报错:不可分配给 string",
|
|
115
|
+
"right": "// 使用自定义字段名避免冲突\nconst items: ButtonItem[] = [{ icon: <Icon/>, text: '编辑', actionKey: 'edit' }];\n// onClick 中:const key = (item as any).actionKey;"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"issue": "ButtonGroup 没有内置 active/selected 状态,需要外部 state 维护并通过 variant 切换视觉",
|
|
119
|
+
"wrong": "// 期望有 activeKey prop 自动高亮\n<ButtonGroup data={tabs} activeKey='tab1' /> // activeKey 不在 ButtonGroupProps,静默失效",
|
|
120
|
+
"right": "// 外部维护 activeKey,按需设置 variant\nconst [active, setActive] = useState('tab1');\n<ButtonGroup\n mode='text'\n data={tabs.map(t => ({ ...t, variant: t.id === active ? 'contained' : 'outlined' }))}\n onClick={(item) => setActive((item as any).id)}\n/>"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"issue": "data[].disabled 必须是 boolean,不能是字符串 'true',因为 ButtonGroup src 用 typeof _disabled === 'undefined' 做判断",
|
|
124
|
+
"wrong": "const items: ButtonItem[] = [{ text: '删除', disabled: 'true' as any }]; // 字符串 'true' 是 truthy,不是 boolean true",
|
|
125
|
+
"right": "const items: ButtonItem[] = [{ text: '删除', disabled: true }]; // 明确传 boolean"
|
|
126
|
+
}
|
|
127
|
+
],
|
|
128
|
+
"mapping": {
|
|
129
|
+
"realComponent": "ButtonGroup",
|
|
130
|
+
"adapter": null
|
|
131
|
+
}
|
|
132
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Card",
|
|
3
|
+
"category": "Data Display",
|
|
4
|
+
"description": "list-driven 卡片容器——按 list 数据源渲染多张卡片,支持每行个数 / 加载更多 / 投影边框配置。**注意:不是 antd 风格的单卡片容器**(没有 title / extra / hoverable / actions 这些 prop)",
|
|
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
|
+
"loadingMore"
|
|
26
|
+
],
|
|
27
|
+
"idealProps": {
|
|
28
|
+
"list": {
|
|
29
|
+
"type": "CardItemProps[]",
|
|
30
|
+
"itemSchema": {
|
|
31
|
+
"render": { "type": "ReactNode", "description": "卡片内容,静态 ReactNode(不是函数),闭包引用循环变量:data.map(d => ({ render: <div>{d.title}</div> }))" },
|
|
32
|
+
"style": { "type": "React.CSSProperties", "description": "透传到该卡片外层 div 的样式(可覆盖 boxShadow / border 等组件级配置)" }
|
|
33
|
+
},
|
|
34
|
+
"description": "卡片数据源数组。**`CardItemProps = { render?: ReactNode; style?: CSSProperties; [key]: any }`**——核心字段:①`render` 是**静态 ReactNode**(不是 `(item) => ReactNode` 函数!直接写 JSX 即可,需引用循环变量时用闭包:`docs.map(d => ({ render: <div>{d.title}</div> }))`,不要写 `render: () => <div>{d.title}</div>`);②`style` 透传到该卡片外层 div;③允许任意业务字段平铺存放(`id` / `title` 等仅供业务方在 render 中闭包引用,不被 Card 内部使用)。**list 项**不需要传 React `key`——src 内部用数组 index 做 key。"
|
|
35
|
+
},
|
|
36
|
+
"lineNum": {
|
|
37
|
+
"type": "number | CardLineNumProps[]",
|
|
38
|
+
"itemSchema": {
|
|
39
|
+
"width": { "type": "number", "required": true, "description": "容器宽度阈值(px),当容器宽度超过此值时使用此断点配置" },
|
|
40
|
+
"size": { "type": "number", "required": true, "description": "该断点下每行展示的卡片数" }
|
|
41
|
+
},
|
|
42
|
+
"description": "**每行展示的卡片数**(不是总行数!)。与 `width` 互斥:仅当未传 `width` 时 `lineNum` 才生效,每张卡片宽度按容器宽度均分。传数组可做响应式:`[{width: 容器宽阈值, size: 该断点每行个数}]`,src 按 width 升序匹配第一个 `item.width > 容器宽` 的 size;都不命中时取最大档 size。**src 行为细节**(DEFECT-006):src 内部按 width 升序自动 sort,Infinity 作 width 合法且与 `>` 比较恒真;\"最大档\" = 排序后最后一项(width 最大),与 size 数值无关。"
|
|
43
|
+
},
|
|
44
|
+
"width": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"default": "300px",
|
|
47
|
+
"description": "每张卡片固定宽度(与 `lineNum` 互斥,**`width` 优先级高于 `lineNum`**——src 在 `props.width === undefined` 时才进入 `lineNum` 分支)。仅接受 px 等具体单位字符串;不支持 `'auto'` / 百分比(src 直接 inline style 透传,但宽度模式下 Card 不会重新计算 marginRight 收尾对齐)。"
|
|
48
|
+
},
|
|
49
|
+
"height": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"default": "140px",
|
|
52
|
+
"description": "每张卡片高度。仅接受 px 等具体单位字符串;**不支持 `'auto'`**——src 把 height 直接写到外层 div inline style,'auto' 会让卡片高度按 render 内容撑开但失去等高网格视觉。如需自适应内容高度,需在 render 内部用 `display: flex; flex-direction: column` 自管理。**height 不支持 'auto' / 百分比**(DEFECT-008):如需高度跟随内容,父组件需先测量后传 px 字符串(可用 ResizeObserver),Card 不感知父容器高度变化。"
|
|
53
|
+
},
|
|
54
|
+
"boxShadow": {
|
|
55
|
+
"type": "boolean | string",
|
|
56
|
+
"default": false,
|
|
57
|
+
"description": "是否带投影。`true` 默认值 `'1px 1px 10px 2px rgba(212,218,227,0.40)'`(src/Card/index.tsx:203);传字符串则直接作为 CSS box-shadow 值透传。**作用于所有卡片**(组件级);单卡覆盖在 list[].style.boxShadow 中传值,后者优先(Card-DEFECT-003(详见 docs/superpowers/ai-test/defects.md))。"
|
|
58
|
+
},
|
|
59
|
+
"border": {
|
|
60
|
+
"type": "boolean | string",
|
|
61
|
+
"default": false,
|
|
62
|
+
"description": "是否带边框。`true` 默认值 `'1px solid rgba(212, 218, 227, 0.4)'`(src/Card/index.tsx:210);传字符串则直接作为 CSS border 简写值(如 `'2px dashed #1677ff'`)透传。**作用于所有卡片**(组件级);单卡覆盖在 list[].style.border 中传值,后者优先(Card-DEFECT-003(详见 docs/superpowers/ai-test/defects.md))。"
|
|
63
|
+
},
|
|
64
|
+
"marginRight": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"default": "20px",
|
|
67
|
+
"description": "**卡片之间的右间距**(不是 Card 容器外边距)。每张卡片 inline `style.marginRight`;每行最后一张卡片自动重置为 0。"
|
|
68
|
+
},
|
|
69
|
+
"marginBottom": {
|
|
70
|
+
"type": "string",
|
|
71
|
+
"default": "20px",
|
|
72
|
+
"description": "**卡片之间的下间距**(不是 Card 容器外边距)。每张卡片 inline `style.marginBottom`。"
|
|
73
|
+
},
|
|
74
|
+
"showMore": {
|
|
75
|
+
"type": "boolean",
|
|
76
|
+
"default": false,
|
|
77
|
+
"description": "是否启用『加载更多』机制(与 `onMore` 配合:showMore=true 时滚动到底部触发 onMore;底部展示 moreRender / loadingMoreRender 文案)。**注意**:5.x 没有独立 `hasMore` prop——『已加载完所有数据』需在业务方 `onMore` 内自行判断后 return 短路(参见 do 段)。议题见 discussions/Card-hasMore-prop.md。"
|
|
78
|
+
},
|
|
79
|
+
"moreRender": {
|
|
80
|
+
"type": "ReactNode",
|
|
81
|
+
"default": "intl('more')",
|
|
82
|
+
"description": "底部『可加载』状态展示节点(非 loading 时)。点击后触发 onMore。与 loadingMoreRender 互斥:loadingMore 状态展示 loadingMoreRender,否则展示 moreRender。"
|
|
83
|
+
},
|
|
84
|
+
"loadingMoreRender": {
|
|
85
|
+
"type": "ReactNode",
|
|
86
|
+
"default": "intl('loadingMore')",
|
|
87
|
+
"description": "底部『加载中』状态展示节点(onMore 执行期间)。与 moreRender 互斥(见 moreRender 描述)。"
|
|
88
|
+
},
|
|
89
|
+
"onMore": {
|
|
90
|
+
"type": "function",
|
|
91
|
+
"signature": "() => Promise<void> | void",
|
|
92
|
+
"description": "加载更多回调(showMore=true 时滚动到底部触发)。返回 Promise 时 Card 自动管理 loadingMore 状态——业务方应在 onMore 内 await 数据请求后 setState 追加 list;同步返回时立即结束 loading。**业务方需自行维护 hasMore 标记**:到达末页时在 onMore 入口 `if (!hasMore) return` 短路。"
|
|
93
|
+
},
|
|
94
|
+
"backgroundImage": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"description": "**作用于所有卡片的统一背景图**(组件级,Card-DEFECT-002(详见 docs/superpowers/ai-test/defects.md):所有卡片共享同一张背景图,不是按 list[].cover 渲染单卡封面)。url 设置后 Card 自动追加 `backgroundSize: 100% 100%; backgroundRepeat: no-repeat`。如需每张卡封面不同,请在 list[].render 内自管理图片渲染。"
|
|
97
|
+
},
|
|
98
|
+
"className": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"description": "卡片容器自定义类名(src/Card/index.tsx:33 interface 实证,透传到根容器 div)"
|
|
101
|
+
},
|
|
102
|
+
"style": {
|
|
103
|
+
"type": "React.CSSProperties",
|
|
104
|
+
"description": "卡片容器自定义样式(src/Card/index.tsx:35 interface 实证,透传到根容器 div)"
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"do": [
|
|
108
|
+
"用 list 一次传入数据源,让 Card 自动按 lineNum / width 排版",
|
|
109
|
+
"**业务数据派生 list 时**:用 `data.map(d => ({ render: <CardContent {...d} /> }))` 或 `data.map(d => ({ render: <div>{d.title}</div> }))` —— render 直接写 JSX 节点(闭包引用循环变量 d),**不要写 `render: () => <div>...</div>` 函数形式**",
|
|
110
|
+
"**自定义渲染撑满整张卡片**:render 节点内部用 `<div style={{ height: '100%', display: 'flex', flexDirection: 'column' }}>...</div>`,因为 Card 已经把外层 div 高度固定为 props.height",
|
|
111
|
+
"在 render 根 div 加 `boxSizing: border-box`(DEFECT-007):因 Card 外层 height 固定时,padding 默认会撑超溢出",
|
|
112
|
+
"需要响应式列数时给 lineNum 传数组(按容器宽断点;按 width 升序匹配第一个超过容器宽的档位)",
|
|
113
|
+
"数据较多时启用 showMore + onMore 实现分页加载;**业务方在 onMore 入口判断业务侧 hasMore 标记,到达末页 `if (!hasMore) return`** 短路(src 无 hasMore prop)",
|
|
114
|
+
"lineNum / width 二选一即可——传 width 时 lineNum 不生效(src 在 props.width === undefined 时才进入 lineNum 分支)",
|
|
115
|
+
"list 项不需要传 React `key`——src 内部用数组 index 做 key(业务字段 `id` 仅供业务方 render 内闭包引用)"
|
|
116
|
+
],
|
|
117
|
+
"dont": [
|
|
118
|
+
"**不要把 render 写成 `() => ReactNode` 函数形式**——CardItemProps.render 是静态 `ReactNode`,传函数会被 React 当作 child 直接渲染,触发 `Warning: Functions are not valid as a React child` 警告(runtime 层验证失败)",
|
|
119
|
+
"lineNum 与 width 同时传(互斥;src 在 width 已定义时直接走 width 分支,lineNum 被忽略)",
|
|
120
|
+
"在 list 中传入超大 ReactNode 致渲染卡顿(应只放轻量数据,render 用 memo)",
|
|
121
|
+
"**试图传 antd 风格 prop**:`title` / `extra` / `hoverable` / `actions` / `cover` / `renderItem` / `dataSource` —— 这些 prop 不存在;自定义渲染只能通过 `list[].render` 节点",
|
|
122
|
+
"传 `height='auto'` 或百分比——src 直接 inline 透传,'auto' 会让卡片高度按内容撑开但失去等高视觉",
|
|
123
|
+
"依赖 `showMore=false` 切换来停止 onMore 触发——切换 false 会让底部按钮消失但已触发的 onMore 不会撤销;正确做法是 `onMore` 内 `if (!业务侧 hasMore) return`"
|
|
124
|
+
],
|
|
125
|
+
"events": {
|
|
126
|
+
"onMore": {
|
|
127
|
+
"signature": "() => Promise<void> | void",
|
|
128
|
+
"asyncSupported": true,
|
|
129
|
+
"examples": [
|
|
130
|
+
"基础分页加载:onMore={async () => { const data = await api.getPage(page++); setList(prev => [...prev, ...data]); }}",
|
|
131
|
+
"Card 自动管理 loadingMore 状态——onMore 执行期间显示 loadingMoreRender,执行完毕自动恢复",
|
|
132
|
+
"业务侧维护 hasMore 标记:onMore={async () => { if (!hasMore) return; const res = await load(); if (!res.hasNext) setHasMore(false); }}"
|
|
133
|
+
],
|
|
134
|
+
"commonMistakes": [
|
|
135
|
+
"期望 src 自动检测是否到达末页——src 无 hasMore prop,到达末页需在 onMore 内 return 短路",
|
|
136
|
+
"依赖 showMore=false 停止触发——切换 false 只隐藏底部按钮,已触发的 onMore Promise 不会撤销",
|
|
137
|
+
"onMore 里直接 setState 覆盖整个 list 而非追加——滚动加载应追加新数据:setList(prev => [...prev, ...newItems])"
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"typescriptPitfalls": [
|
|
142
|
+
{
|
|
143
|
+
"issue": "list[].render 是静态 ReactNode,不是 (item) => ReactNode 函数——传函数导致 React child 警告",
|
|
144
|
+
"wrong": "const list = data.map(d => ({ render: () => <CardContent data={d} /> })); // 函数被当作 child 渲染,报 Warning",
|
|
145
|
+
"right": "const list = data.map(d => ({ render: <CardContent data={d} /> })); // 闭包引用 d,直接写 JSX"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"issue": "lineNum 与 width 互斥——同时传时 width 优先(src 在 props.width === undefined 时才进 lineNum 分支)",
|
|
149
|
+
"wrong": "// 期望 lineNum 和 width 都生效\n<Card list={list} width='300px' lineNum={4} /> // lineNum 被忽略",
|
|
150
|
+
"right": "// 二选一:固定宽度用 width;响应式列数用 lineNum(不传 width)\n<Card list={list} lineNum={4} />"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"issue": "height 不支持 'auto'——src 直接 inline 透传,'auto' 会破坏等高网格视觉",
|
|
154
|
+
"wrong": "<Card list={list} height='auto' /> // 卡片高度按内容撑开,等高网格失效",
|
|
155
|
+
"right": "// 如需自适应内容高度,先测量再传 px 字符串,或在 render 内部自管理\n<Card list={list} height='200px' />"
|
|
156
|
+
}
|
|
157
|
+
],
|
|
158
|
+
"mapping": {
|
|
159
|
+
"realComponent": "Card",
|
|
160
|
+
"adapter": null
|
|
161
|
+
}
|
|
162
|
+
}
|
package/es/Card/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { default as React, FunctionComponent, ReactNode } from 'react';
|
|
|
2
2
|
export interface CardItemProps {
|
|
3
3
|
render?: ReactNode;
|
|
4
4
|
style?: React.CSSProperties;
|
|
5
|
-
[name: string]:
|
|
5
|
+
[name: string]: unknown;
|
|
6
6
|
}
|
|
7
7
|
export interface CardLineNumProps {
|
|
8
8
|
/** 容器宽度 */
|
|
@@ -41,7 +41,7 @@ export interface CardProps {
|
|
|
41
41
|
loadingMoreRender?: ReactNode;
|
|
42
42
|
/** 加载更多事件 */
|
|
43
43
|
onMore?: () => Promise<void> | void;
|
|
44
|
-
[name: string]:
|
|
44
|
+
[name: string]: unknown;
|
|
45
45
|
}
|
|
46
46
|
export declare const Card: FunctionComponent<CardProps>;
|
|
47
47
|
export default Card;
|
package/es/Card/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { $prefixCls as z } from "../GlobalContext/constant.js";
|
|
|
4
4
|
import K from "clsx";
|
|
5
5
|
import P from "../GlobalContext/useFormatMessage.js";
|
|
6
6
|
import Q from "./lang/index.js";
|
|
7
|
-
import U from "../
|
|
7
|
+
import U from "../Hooks/useResizeObserver.js";
|
|
8
8
|
import './index.css';/* empty css */
|
|
9
9
|
const cr = (c) => {
|
|
10
10
|
const {
|
|
@@ -57,7 +57,7 @@ const cr = (c) => {
|
|
|
57
57
|
h && (a = a + 4);
|
|
58
58
|
const G = `${a / n}px`;
|
|
59
59
|
e.current.itemWidth = `calc(${1 / n * 100}% - ${G})`, r.current.querySelectorAll(".card-list > .card-item").forEach((u) => {
|
|
60
|
-
u.style.width = e.current.itemWidth;
|
|
60
|
+
u.style.width = e.current.itemWidth || "";
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
n !== e.current.lineNumCom && (e.current.lineNumCom = n, D(n));
|