@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/lib/Form/index.d.ts
CHANGED
|
@@ -11,6 +11,50 @@ type FormHtmlProps = FormHTMLAttributes<HTMLFormElement>;
|
|
|
11
11
|
* 配置项项类型
|
|
12
12
|
*/
|
|
13
13
|
export type configListProps = Array<FormItemProps>;
|
|
14
|
+
/**
|
|
15
|
+
* form ref 暴露的命令式 API(Form-DEFECT-001 起公开导出,业务方可 `import { FormRefObject } from '@para-ui/core/Form'`)
|
|
16
|
+
*/
|
|
17
|
+
export interface FormRefObject {
|
|
18
|
+
/**
|
|
19
|
+
* 校验表单方法,校验成功返回表单的键值对;失败返回 false(src jsdoc 实证)
|
|
20
|
+
* @return {false | {[name: string]: unknown}}
|
|
21
|
+
*/
|
|
22
|
+
check?: Function;
|
|
23
|
+
/**
|
|
24
|
+
* 存储所有表单item最后的配置,方便提交时做总的校验
|
|
25
|
+
*/
|
|
26
|
+
items?: {
|
|
27
|
+
[name: string]: ItemTypeProps;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* 所有值
|
|
31
|
+
*/
|
|
32
|
+
values?: {
|
|
33
|
+
[name: string]: unknown;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* 强制刷新表单状态方法
|
|
37
|
+
*/
|
|
38
|
+
refreshForm?: (list: Array<FormItemProps> | '', bData?: {
|
|
39
|
+
[name: string]: unknown;
|
|
40
|
+
}) => void;
|
|
41
|
+
/**
|
|
42
|
+
* 对象数据集合
|
|
43
|
+
*/
|
|
44
|
+
refData?: RefDataProps;
|
|
45
|
+
/**
|
|
46
|
+
* 获取生效项目的值对象,会过滤掉不显示或是不启用的项目的值
|
|
47
|
+
*/
|
|
48
|
+
getValidValues?: Function;
|
|
49
|
+
/**
|
|
50
|
+
* 重置表单
|
|
51
|
+
*/
|
|
52
|
+
reset?: Function;
|
|
53
|
+
/**
|
|
54
|
+
* 清空表单数据,允许清空单个
|
|
55
|
+
*/
|
|
56
|
+
clear?: (name?: string | string[]) => void;
|
|
57
|
+
}
|
|
14
58
|
/**
|
|
15
59
|
* form 表单组件属性
|
|
16
60
|
* @typedef {object} FormProps
|
|
@@ -20,51 +64,10 @@ export interface FormProps {
|
|
|
20
64
|
* form 表单对象存储关键数据和校验方法
|
|
21
65
|
* @property {Function} check 表单校验方法
|
|
22
66
|
* @property {configListProps} items 配置项,最后经过加工的合计
|
|
23
|
-
* @property {{ [name: string]:
|
|
67
|
+
* @property {{ [name: string]: unknown }} values 已经保存的值的键值对
|
|
24
68
|
* @property {Function} refreshForm 强制刷新表单状态
|
|
25
69
|
*/
|
|
26
|
-
form?: React.MutableRefObject<
|
|
27
|
-
/**
|
|
28
|
-
* 校验表单方法,校验成功返回表单的键值对
|
|
29
|
-
* @return {false | {[name: string]: any}}
|
|
30
|
-
*/
|
|
31
|
-
check?: Function;
|
|
32
|
-
/**
|
|
33
|
-
* 存储所有表单item最后的配置,方便提交时做总的校验
|
|
34
|
-
*/
|
|
35
|
-
items?: {
|
|
36
|
-
[name: string]: ItemTypeProps;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* 所有值
|
|
40
|
-
*/
|
|
41
|
-
values?: {
|
|
42
|
-
[name: string]: any;
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* 强制刷新表单状态方法
|
|
46
|
-
*/
|
|
47
|
-
refreshForm?: (list: Array<FormItemProps> | '', bData?: {
|
|
48
|
-
[name: string]: any;
|
|
49
|
-
}) => void;
|
|
50
|
-
/**
|
|
51
|
-
* 对象数据集合
|
|
52
|
-
*/
|
|
53
|
-
refData?: RefDataProps;
|
|
54
|
-
/**
|
|
55
|
-
* 获取生效项目的值对象,会过滤掉不显示或是不启用的项目的值,
|
|
56
|
-
*/
|
|
57
|
-
getValidValues?: Function;
|
|
58
|
-
/**
|
|
59
|
-
* 重置表单
|
|
60
|
-
*/
|
|
61
|
-
reset?: Function;
|
|
62
|
-
/**
|
|
63
|
-
* 清空表单数据
|
|
64
|
-
* 允许清空单个
|
|
65
|
-
*/
|
|
66
|
-
clear?: (name?: string | string[]) => void;
|
|
67
|
-
}>;
|
|
70
|
+
form?: React.MutableRefObject<FormRefObject>;
|
|
68
71
|
/**
|
|
69
72
|
* from 表单的默认属性
|
|
70
73
|
*/
|
|
@@ -76,19 +79,19 @@ export interface FormProps {
|
|
|
76
79
|
/**
|
|
77
80
|
* 获取表单的校验方法,会传出表单的校验方法
|
|
78
81
|
*/
|
|
79
|
-
getCheckForm?: (checkFrom: Function) =>
|
|
82
|
+
getCheckForm?: (checkFrom: Function) => void;
|
|
80
83
|
/**
|
|
81
84
|
* 输入框内容改变传出
|
|
82
85
|
* @param {string} name 表单项的name
|
|
83
86
|
* @param {any} value 当前表单输入项修改的值
|
|
84
87
|
*/
|
|
85
|
-
onChange?: (name: string, value:
|
|
88
|
+
onChange?: (name: string, value: unknown) => void;
|
|
86
89
|
/**
|
|
87
90
|
* 强制刷新配置
|
|
88
91
|
* @param {Function} configHook 传出内部设置表单项,和回填参数的 hook方法
|
|
89
92
|
*/
|
|
90
93
|
getForcedRefresh?: (setConfigHook: (configList: configListProps, bData?: {
|
|
91
|
-
[name: string]:
|
|
94
|
+
[name: string]: unknown;
|
|
92
95
|
}) => void) => void;
|
|
93
96
|
/**
|
|
94
97
|
* 表单项的配置
|
|
@@ -98,7 +101,7 @@ export interface FormProps {
|
|
|
98
101
|
* 回填数据
|
|
99
102
|
*/
|
|
100
103
|
backData?: {
|
|
101
|
-
[name: string]:
|
|
104
|
+
[name: string]: unknown;
|
|
102
105
|
};
|
|
103
106
|
/**
|
|
104
107
|
* 是否禁用
|
|
@@ -136,7 +139,7 @@ export interface FormProps {
|
|
|
136
139
|
/**
|
|
137
140
|
* form 存储各种参数的集合类型
|
|
138
141
|
*/
|
|
139
|
-
interface RefDataProps {
|
|
142
|
+
export interface RefDataProps {
|
|
140
143
|
/**
|
|
141
144
|
* 存储所有表单item最后的配置,方便提交时做总的校验
|
|
142
145
|
*/
|
|
@@ -159,7 +162,7 @@ interface RefDataProps {
|
|
|
159
162
|
* 表单保存的值集合
|
|
160
163
|
*/
|
|
161
164
|
allValues: {
|
|
162
|
-
[name: string]:
|
|
165
|
+
[name: string]: unknown;
|
|
163
166
|
};
|
|
164
167
|
/**
|
|
165
168
|
* 最新配置信息
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
2
|
interface DefaultCompomentsProps {
|
|
3
|
-
moudle:
|
|
3
|
+
moudle: (props: object) => ReactNode;
|
|
4
4
|
error: boolean;
|
|
5
5
|
placeholder: string;
|
|
6
|
-
defaultValue:
|
|
6
|
+
defaultValue: unknown;
|
|
7
7
|
disabled?: boolean;
|
|
8
|
-
onChange: (e:
|
|
8
|
+
onChange: (e: unknown) => void;
|
|
9
9
|
inputProps?: {
|
|
10
|
-
[name: string]:
|
|
10
|
+
[name: string]: unknown;
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../../../_virtual/jsx-runtime.js"),s=require("react"),f=l=>{const{error:n,placeholder:a,defaultValue:e,disabled:i,onChange:c,inputProps:d,moudle:m}=l,[p,t]=s.useState(e);return s.useEffect(()=>{t(e)},[e]),o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:m({error:n,placeholder:a,value:p,disabled:i,hideErrorDom:null,...d,onChange:u=>{const r=u?.target?.value??u;t(r),c(r)}})})};exports.default=f;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { CheckboxGroupProps } from '../../../CheckboxGroup';
|
|
3
3
|
export interface FormCheckboxGroupProps extends CheckboxGroupProps {
|
|
4
|
-
defaultValue?:
|
|
5
|
-
change?: (value:
|
|
4
|
+
defaultValue?: (string | number)[];
|
|
5
|
+
change?: (value: unknown) => unknown;
|
|
6
6
|
}
|
|
7
7
|
declare const FormCheckboxGroup: FC<FormCheckboxGroupProps>;
|
|
8
8
|
export default FormCheckboxGroup;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index.css');const e=require("../../../_virtual/jsx-runtime.js"),u=require("react"),E=require("../../../node_modules/@para-ui/icons/Delete/index.js"),h=require("../../../node_modules/@para-ui/icons/LinkGroup/index.js"),q=require("../../../AutoTips/index.js"),F=require("../../../Button/index.js"),g=require("../../../node_modules/@para-ui/icons/UploadFile/index.js"),b=require("../../../GlobalContext/useFormatMessage.js"),v=require("../../lang/index.js");;/* empty css */const y=a=>{const{fileType:n="",defaultValue:t,onChange:c,disabled:r,buttonLabel:p,inputProps:f,buttonProps:j}=a,m=b.default("FormItem",v.default),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index.css');const e=require("../../../_virtual/jsx-runtime.js"),u=require("react"),E=require("../../../node_modules/@para-ui/icons/Delete/index.js"),h=require("../../../node_modules/@para-ui/icons/LinkGroup/index.js"),q=require("../../../AutoTips/index.js"),F=require("../../../Button/index.js"),g=require("../../../node_modules/@para-ui/icons/UploadFile/index.js"),b=require("../../../GlobalContext/useFormatMessage.js"),v=require("../../lang/index.js");;/* empty css */const y=a=>{const{fileType:n="",defaultValue:t,onChange:c,disabled:r,buttonLabel:p,inputProps:f,buttonProps:j}=a,m=b.default("FormItem",v.default),s=u.useRef(null),R=()=>{s.current?.click()},x=o=>{const d=o!==void 0?o:s.current?.files??null;l(d),c&&c(d),o===null&&s.current&&(s.current.value="")},[i,l]=u.useState();return u.useEffect(()=>{t&&l(t)},[t]),e.jsxRuntimeExports.jsxs("div",{className:"form-file",children:[!r&&e.jsxRuntimeExports.jsx(F.Button,{variant:"outlined",...j,startIcon:e.jsxRuntimeExports.jsx(g.UploadFile,{}),onClick:R,children:p||m({id:"chooseFile"})}),e.jsxRuntimeExports.jsx("input",{...f,ref:s,type:"file",onInput:()=>x(),hidden:!0,accept:typeof n=="string"?n:n.join(",")}),i&&i[0]&&e.jsxRuntimeExports.jsx("div",{className:`file-tips ${r&&"file-tips-disabled"||""}`,children:e.jsxRuntimeExports.jsxs("div",{className:"file-tips-item",children:[e.jsxRuntimeExports.jsx(h.LinkGroup,{}),e.jsxRuntimeExports.jsx("span",{className:"file-tips-context",children:e.jsxRuntimeExports.jsx(q.default,{children:typeof i=="string"?i:i[0].name})}),!r&&e.jsxRuntimeExports.jsx(E.Delete,{onClick:()=>x(null)})]})})]})};exports.default=y;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -2,7 +2,7 @@ import { FC } from 'react';
|
|
|
2
2
|
import { RadioGroupProps } from '../../../RadioGroup';
|
|
3
3
|
export interface FormRadioGroupProps extends RadioGroupProps {
|
|
4
4
|
defaultValue?: string;
|
|
5
|
-
change?: (value:
|
|
5
|
+
change?: (value: unknown) => unknown;
|
|
6
6
|
}
|
|
7
7
|
declare const FormRadioGroup: FC<FormRadioGroupProps>;
|
|
8
8
|
export default FormRadioGroup;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "FormItem",
|
|
3
|
+
"category": "Data Entry",
|
|
4
|
+
"description": "表单项,通常作 FieldForm 子组件使用,形成\"校验/收集值/提交\"链路。可独立用但脱离 FieldForm 时不会自动校验。需 FormItem 自渲染控件请用 InputType prop。",
|
|
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
|
+
"error",
|
|
25
|
+
"validating"
|
|
26
|
+
],
|
|
27
|
+
"idealProps": {
|
|
28
|
+
"name": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"description": "字段名(**仅 string,不支持 array 路径写法**)。需在 Form/FieldForm 上下文中保持唯一;不要传 `['user','address','city']`——会触发 TS2322。\n\n**字符串点路径协议**:`name` 可以写成 `'user.address.city'` 形式(TS 合法,不报错),但 FormItem 和 Form 均**不解析点路径**——表单聚合值是 `{ 'user.address.city': value }`(扁平 key,含字面量点),而**不是** `{ user: { address: { city: value } } }`(深度嵌套对象)。点路径字段可以正常传值、校验、回填,仅聚合 key 保持原字符串。这与 antd / rc-field-form 的 `name=['a','b','c']` 深度路径解析行为**不同**——本组件不做路径解析,只做 key 直传。若业务提交需要深度嵌套对象,在提交前自行将扁平结果转换(如 `{ 'user.address.city': 'Beijing' }` → `{ user: { address: { city: 'Beijing' } } }`),或改用 `FieldForm.Item`(支持 `name={['user','address','city']}` 数组路径)。"
|
|
31
|
+
},
|
|
32
|
+
"label": {
|
|
33
|
+
"type": "string | (props: FormItemProps) => ReactNode",
|
|
34
|
+
"description": "标签文案;可传字符串或函数式渲染。**不支持 null**——传 label={null} 会触发 TS2322。要『无 label』请使用 hideLabel。"
|
|
35
|
+
},
|
|
36
|
+
"hideLabel": {
|
|
37
|
+
"type": "boolean",
|
|
38
|
+
"default": false,
|
|
39
|
+
"description": "隐藏 label 区块(连同 label 占位一起去掉)。这是『无 label 字段』的正确写法。"
|
|
40
|
+
},
|
|
41
|
+
"rules": {
|
|
42
|
+
"type": "ruleType",
|
|
43
|
+
"description": "校验规则。**这是单个对象不是数组**(与 antd 的 rules: Rule[] 不同)。结构为 `{ validate: { required, maxlength, minLength, pattern, min, max, disOnlySpace, [自定义key]: fn }, message?: { required: '...', pattern: '...' } }`。 message 与 validate 中的 key 一一对应。校验函数签名 `(item, val, intl) => true | string`:返回 true 表示通过、返回字符串表示报错文案。**⚠️ 重要:脱离 FieldForm 独立使用时,rules 不会自动触发校验**——rules 仅渲染必填红星等视觉提示,required/pattern 等不会在 children 失焦/变更时执行;完整校验链路必须配合 FieldForm 上下文。"
|
|
44
|
+
},
|
|
45
|
+
"InputType": {
|
|
46
|
+
"type": "'default' | 'select' | 'switch' | 'textarea' | 'number' | 'file' | 'radioGroup' | 'checkGroup' | 'comboSelect' | ReactNode | FC",
|
|
47
|
+
"description": "FormItem 自动渲染输入控件的类型;不传 children 时按此类型渲染对应 paraui 组件。传 children 时 InputType 不生效(外部受控)。"
|
|
48
|
+
},
|
|
49
|
+
"inputProps": {
|
|
50
|
+
"type": "Record<string, any>",
|
|
51
|
+
"description": "InputType 渲染的内部控件透传 props(如 placeholder、options 等)。"
|
|
52
|
+
},
|
|
53
|
+
"type": {
|
|
54
|
+
"type": "'horizontal' | 'vertical'",
|
|
55
|
+
"values": [
|
|
56
|
+
"horizontal",
|
|
57
|
+
"vertical"
|
|
58
|
+
],
|
|
59
|
+
"default": "'horizontal'",
|
|
60
|
+
"description": "label 与表单项的横纵布局。"
|
|
61
|
+
},
|
|
62
|
+
"labelWidth": {
|
|
63
|
+
"type": "number",
|
|
64
|
+
"description": "label 区块宽度(仅 type='vertical' 时生效)。"
|
|
65
|
+
},
|
|
66
|
+
"tips": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"description": "label 旁的 tooltip 提示文案。"
|
|
69
|
+
},
|
|
70
|
+
"hideError": {
|
|
71
|
+
"type": "boolean",
|
|
72
|
+
"default": false,
|
|
73
|
+
"description": "隐藏校验错误提示(不影响校验逻辑本身)。"
|
|
74
|
+
},
|
|
75
|
+
"defaultValue": {
|
|
76
|
+
"type": "any",
|
|
77
|
+
"description": "默认值。会被 FieldForm 的回填数据 backData 覆盖。"
|
|
78
|
+
},
|
|
79
|
+
"disabled": {
|
|
80
|
+
"type": "boolean",
|
|
81
|
+
"description": "InputType 渲染的控件是否禁用(仅自动渲染场景生效)。"
|
|
82
|
+
},
|
|
83
|
+
"change": {
|
|
84
|
+
"type": "(value: any) => void",
|
|
85
|
+
"description": "值变化回调(仅 InputType 自动渲染场景由内部 ItemType 触发;外部 children 受控时不会自动触发——需自己监听)。"
|
|
86
|
+
},
|
|
87
|
+
"children": {
|
|
88
|
+
"type": "ReactNode",
|
|
89
|
+
"description": "自定义渲染输入控件——FormItem **不会自动注入 value/onChange**,使用方需自行受控。传了 children 时 InputType 自动渲染分支会被跳过。"
|
|
90
|
+
},
|
|
91
|
+
"errorMessage": {
|
|
92
|
+
"type": "string",
|
|
93
|
+
"description": "**脱离 FieldForm 独立使用时的受控错误文案(父组件接管 pattern)**。独立使用时 FormItem 不会自动触发 rules 校验——rules 仅渲染必填红星。错误文案必须由父组件主动驱动:① 父组件自行执行校验逻辑(如在 onBlur 中判断);② 把校验结果写入 `errorMessage` prop(非空字符串 → 显示错误外壳;`''`/`null`/`undefined` → 清除错误状态)。不要同时传 `error` 或 `helperText`——独立使用场景统一用 `errorMessage`。"
|
|
94
|
+
},
|
|
95
|
+
"hide": {
|
|
96
|
+
"type": "boolean",
|
|
97
|
+
"description": "是否隐藏该表单项(src/FormItem/index.tsx:109 interface 实证)。hide=true 时 FormItem 不渲染(不占位),且 form.current.check() 和 form.current.getValidValues() 会跳过该字段。**与 CSS display:none 不同**——hide=true 时字段值不参与校验也不出现在提交结果中"
|
|
98
|
+
},
|
|
99
|
+
"className": {
|
|
100
|
+
"type": "string",
|
|
101
|
+
"description": "表单项容器自定义类名(src/FormItem/index.tsx:170 interface 实证)"
|
|
102
|
+
},
|
|
103
|
+
"itemType": {
|
|
104
|
+
"type": "'default' | 'select' | 'switch' | 'textarea' | 'number' | 'file' | 'radioGroup' | 'checkGroup' | 'comboSelect' | ReactNode | FC",
|
|
105
|
+
"description": "InputType 的别名(src/FormItem/index.tsx:74 interface 实证:itemType 与 InputType 同义,src 内部两者都检查)。**推荐用 InputType**——itemType 是历史命名,两者功能完全相同"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"do": [
|
|
109
|
+
"把 FormItem 作为 FieldForm 的子组件使用——形成完整的校验 + 提交链路",
|
|
110
|
+
"字段名仅传 string;嵌套字段在 FieldForm 层面用 schema 表达",
|
|
111
|
+
"校验规则用 paraui 自有 schema:`{ validate: { required: true, minLength: 8 }, message: { required: '请输入', minLength: '至少 8 位' } }`,不要传 `[{ required, message }]` 数组形式(会触发 TS2559)",
|
|
112
|
+
"无 label 字段使用 `hideLabel` 而不是 `label={null}`",
|
|
113
|
+
"需要自定义控件时把控件放在 children;需要自动渲染时用 InputType + inputProps",
|
|
114
|
+
"脱离 FieldForm 独立使用时:由父组件管理 children 的 value/onChange + 在父组件主动调用业务校验函数,把校验结果写入 FormItem 的 `errorMessage` prop 受控显示"
|
|
115
|
+
],
|
|
116
|
+
"dont": [
|
|
117
|
+
"不要嵌套 FormItem",
|
|
118
|
+
"不要传 `name={['user', 'address', 'city']}`——name 仅 string",
|
|
119
|
+
"不要传 `label={null}`——会触发 TS2322;要无 label 用 `hideLabel`",
|
|
120
|
+
"不要按 antd 风格写 `rules={[{ required: true, message: '...' }]}`——会触发 TS2559;本组件 rules 是单对象 ruleType",
|
|
121
|
+
"不要假设 FormItem 自动给 children cloneElement 注入 value/onChange——本组件不做注入",
|
|
122
|
+
"不要期望 FormItem 在脱离 FieldForm 时自动触发 rules.validate.required 等校验——独立模式下 rules 仅作类型描述,业务校验需父组件主动驱动"
|
|
123
|
+
],
|
|
124
|
+
"events": {
|
|
125
|
+
"change": {
|
|
126
|
+
"signature": "(value: any) => void",
|
|
127
|
+
"asyncSupported": false,
|
|
128
|
+
"examples": [
|
|
129
|
+
"change={(val) => setValue(val)} — 仅 InputType 自动渲染场景由内部 ItemType 触发;外部 children 受控时不会自动触发",
|
|
130
|
+
"InputType='select' 时 change 在用户选中选项时触发,value 为选中项的 value 字段值",
|
|
131
|
+
"InputType='switch' 时 change 在用户 toggle 时触发,value 为布尔值 true/false"
|
|
132
|
+
],
|
|
133
|
+
"commonMistakes": [
|
|
134
|
+
"传了 children 还期望 change 自动触发——children 受控时 ItemType 不渲染,change 永不触发,需在 children 中自己监听",
|
|
135
|
+
"假设 change 签名与 onChange 相同是 (e) => void 原生事件——实际签名是 (value: any) => void,直接是值而非 event",
|
|
136
|
+
"脱离 FieldForm 独立使用时期望 change 携带字段名——change 只传 value,字段名需父组件通过 name 自行关联"
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"typescriptPitfalls": [
|
|
141
|
+
{
|
|
142
|
+
"issue": "FormItem.name 只接受 string,不能传数组路径",
|
|
143
|
+
"wrong": "const fieldName: string[] = ['user', 'address']; <FormItem name={fieldName} /> // TS2322 string[] 不能赋给 string",
|
|
144
|
+
"right": "<FormItem name='user.address' /> // 点路径字符串是合法的 string,但不会被解析为嵌套对象,聚合 key 保持原字符串形态"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"issue": "rules 是单对象不是数组——antd 风格写法 rules={[{required}]} 触发 TS2559",
|
|
148
|
+
"wrong": "<FormItem name='email' rules={[{ required: true, message: '必填' }]} /> // TS2559: Type '...[]' has no properties in common with ruleType",
|
|
149
|
+
"right": "<FormItem name='email' rules={{ validate: { required: true }, message: { required: '必填' } }} />"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"issue": "label 不支持传 null,要无 label 应用 hideLabel",
|
|
153
|
+
"wrong": "<FormItem name='code' label={null} /> // TS2322: Type 'null' is not assignable to 'string | (props: FormItemProps) => ReactNode'",
|
|
154
|
+
"right": "<FormItem name='code' hideLabel /> // 正确隐藏 label 区块"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"issue": "InputType 和 itemType 同时存在时,src 优先取 InputType(itemType 是别名)",
|
|
158
|
+
"wrong": "// 同时传两个不同值,期望 itemType 生效\n<FormItem name='x' itemType='select' InputType='default' /> // InputType 优先,select 不生效",
|
|
159
|
+
"right": "// 统一用 InputType,itemType 是历史别名\n<FormItem name='x' InputType='select' />"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"issue": "select 子项的 list 字段用 value,radioGroup/checkGroup 用 name——混用导致选中后 change 不传值",
|
|
163
|
+
"wrong": "InputType='select' list={[{label: 'A', name: 'a'}]} // select 读 value 字段,name 被忽略",
|
|
164
|
+
"right": "InputType='select' list={[{label: 'A', value: 'a'}]} // 而 radioGroup/checkGroup 用 name 字段"
|
|
165
|
+
}
|
|
166
|
+
],
|
|
167
|
+
"mapping": {
|
|
168
|
+
"realComponent": "FormItem",
|
|
169
|
+
"adapter": null
|
|
170
|
+
}
|
|
171
|
+
}
|
package/lib/FormItem/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export type formInputType = 'checkGroup' | 'select' | 'radioGroup' | 'textarea'
|
|
|
8
8
|
* 表单操作项的其他配置
|
|
9
9
|
*/
|
|
10
10
|
interface inputProps {
|
|
11
|
-
[name: string]:
|
|
11
|
+
[name: string]: unknown;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* 校验规则
|
|
@@ -73,7 +73,7 @@ export interface FormItemProps {
|
|
|
73
73
|
/**
|
|
74
74
|
* 值改变传出
|
|
75
75
|
*/
|
|
76
|
-
change?: (value:
|
|
76
|
+
change?: (value: unknown) => void;
|
|
77
77
|
/**
|
|
78
78
|
* 不显示 该选项
|
|
79
79
|
*/
|
|
@@ -114,7 +114,7 @@ export interface FormItemProps {
|
|
|
114
114
|
* 回填数据
|
|
115
115
|
*/
|
|
116
116
|
backData?: {
|
|
117
|
-
[name: string]:
|
|
117
|
+
[name: string]: unknown;
|
|
118
118
|
};
|
|
119
119
|
/**
|
|
120
120
|
* 是否启用必填框,不允许输入纯空格
|
|
@@ -131,7 +131,7 @@ export interface FormItemProps {
|
|
|
131
131
|
/**
|
|
132
132
|
* 其他配置
|
|
133
133
|
*/
|
|
134
|
-
[name: string]:
|
|
134
|
+
[name: string]: unknown;
|
|
135
135
|
/**
|
|
136
136
|
* 自定义class
|
|
137
137
|
*/
|
|
@@ -140,7 +140,7 @@ export interface FormItemProps {
|
|
|
140
140
|
* 默认值
|
|
141
141
|
* 会被backData,回填数据替换
|
|
142
142
|
*/
|
|
143
|
-
defaultValue?:
|
|
143
|
+
defaultValue?: unknown;
|
|
144
144
|
/**
|
|
145
145
|
* 是否是paraui表单组件
|
|
146
146
|
* */
|
package/lib/FormItem/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index.css');const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index.css');const e=require("../_virtual/jsx-runtime.js"),f=require("react"),w=require("./itemType.js"),I=require("./errorTips.js"),p=require("clsx"),L=require("../Label/index.js"),u=require("../GlobalContext/constant.js");;/* empty css */const S={checkGroup:!0,select:!0,radioGroup:!0,textarea:!0,default:!0,switch:!0,number:!0,file:!0,comboSelect:!0},k=s=>{const{type:o="horizontal",labelWidth:c,tips:m,label:i,itemType:h,InputType:l=h,setValue:j,errorMessage:x,hideLabel:b,backData:n={},defaultValue:E,name:t,hideError:$=!1,className:d="",labelProps:v,helperTextProps:R,requiredElement:y,disRequiredElement:q=!1}=s;n[t]===void 0&&(n[t]=E);const a=f.useRef(),T=r=>{a.current&&a.current(r)},g=r=>o==="vertical"?e.jsxRuntimeExports.jsx("div",{className:`form-content-vertical form-content-vertical-${t}`,style:{width:`calc(100% - ${c}px)`},children:r.children}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:r.children}),N=f.useCallback(()=>i?typeof i=="string"?i:i(s):"",[i]),C=()=>{let r=`${u.$prefixCls}-form-item ${u.$prefixCls}-form-item-${t}`;return d&&(r+=` ${d}`),typeof l=="string"&&S[l]&&(r+=` ${u.$prefixCls}-form-item-${l}`),r};return e.jsxRuntimeExports.jsxs("div",{className:C(),children:[!b&&e.jsxRuntimeExports.jsx("div",{className:p(`form-label form-label-${t}`,o==="vertical"&&"form-label-vertical"),style:{width:o==="vertical"?`${c}px`:""},children:e.jsxRuntimeExports.jsx(L.default,{className:p("form-labe-text",m&&"form-labe-text-hastips"),label:N(),required:!!s?.rules?.validate?.required,tooltip:m,tooltipIcon:q?"":y,...v})}),e.jsxRuntimeExports.jsxs(g,{children:[e.jsxRuntimeExports.jsx("div",{className:`form-edit form-edit-${t}`,children:s.children?s.children:e.jsxRuntimeExports.jsx(w.default,{setError:T,error:!!x,itemType:l,backData:n,...s,setValue:j})}),!$&&e.jsxRuntimeExports.jsx("div",{className:`form-error form-error-${t}`,children:e.jsxRuntimeExports.jsx(I.default,{getSetError:r=>a.current=r,helperTextProps:R,errorMessage:x})})]})]})};exports.default=k;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/lib/FormItem/itemType.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("../_virtual/jsx-runtime.js"),h=require("react"),g=require("../TextField/index.js"),y=require("./compoments/formRadioGroup/index.js"),F=require("./compoments/formSelect/index.js"),$=require("./compoments/formCheckboxGroup/index.js"),v=require("./validateFunction.js"),_=require("../Switch/index.js"),w=require("./compoments/formFile/index.js"),I=require("../InputNumber/index.js"),M=require("../ComboSelect/index.js"),k=require("./compoments/defaultCompoments/index.js"),D=require("../GlobalContext/useFormatMessage.js"),G=require("./lang/index.js"),N=o=>{const{itemType:l,error:p,placeholder:E,label:q,inputProps:i,name:t,rules:
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("../_virtual/jsx-runtime.js"),h=require("react"),g=require("../TextField/index.js"),y=require("./compoments/formRadioGroup/index.js"),F=require("./compoments/formSelect/index.js"),$=require("./compoments/formCheckboxGroup/index.js"),v=require("./validateFunction.js"),_=require("../Switch/index.js"),w=require("./compoments/formFile/index.js"),I=require("../InputNumber/index.js"),M=require("../ComboSelect/index.js"),k=require("./compoments/defaultCompoments/index.js"),D=require("../GlobalContext/useFormatMessage.js"),G=require("./lang/index.js"),N=o=>{const{itemType:l,error:p,placeholder:E,label:q,inputProps:i,name:t,rules:C,setValue:u,setError:m,backData:r,disabled:s,change:j,isComponent:V}=o,b=D.default("FormItem",G.default),d=E||`${q}`,[c,R]=h.useState(!!p),n=e=>{if(u&&u(t,"value",e),j&&j(e),!C)return;const S={...o,setErrorMsg:x,setAndValidateValue:f},T=v.default(S,e,b)||"";x(T)},f=n,x=h.useCallback(e=>{m&&m(e),R(!!e),u&&u(t,"message",e)},[t,m,u]);return h.useEffect(()=>{const e={...o,setErrorMsg:x,setAndValidateValue:f};u&&u(t,"item",e)},[t,o,x,u]),(()=>{if(!V&&l&&typeof l!="string"&&(!l.name||l.name==="InputType")){const e={...o,setErrorMsg:x,setAndValidateValue:f};return l(e)}switch(l){case"file":return a.jsxRuntimeExports.jsx(w.default,{...o,defaultValue:r[t],disabled:s,onChange:e=>{n(e)}});case"switch":return r[t]===void 0&&u&&u(t,"initValue",!!r[t]),a.jsxRuntimeExports.jsx(_.Switch,{defaultChecked:!!r[t],onChange:e=>{n(e)},...i,disabled:s});case"checkGroup":return a.jsxRuntimeExports.jsx($.default,{error:c,defaultValue:r[t],change:e=>{n(e)},list:o.list,...i,disabled:s});case"select":return a.jsxRuntimeExports.jsx(F.default,{placeholder:d,defaultValue:r[t],error:c,change:e=>{n(e)},list:o.list,disabled:s,...i});case"radioGroup":return a.jsxRuntimeExports.jsx(y.default,{error:c,defaultValue:r[t],change:e=>{n(e)},list:o.list,disabled:s,...i});case"textarea":return a.jsxRuntimeExports.jsx(g.TextField,{error:c,placeholder:d,defaultValue:r[t]||"",disabled:s,multiline:!0,rows:3,name:t,hideErrorDom:null,onChange:e=>{n(e.target.value)},...i});case"number":return a.jsxRuntimeExports.jsx(I.InputNumber,{error:c,placeholder:d,defaultValue:r[t],disabled:s,name:t,hideErrorDom:null,onChange:e=>{n(e)},...i});case"comboSelect":return a.jsxRuntimeExports.jsx(M.ComboSelect,{error:c,placeholder:d,defaultValue:r[t],disabled:s,onChange:e=>{n(e)},...i});default:return l&&typeof l!="string"?a.jsxRuntimeExports.jsx(k.default,{moudle:l,error:c,placeholder:d,defaultValue:r[t],disabled:s,onChange:e=>{n(e)},inputProps:i}):a.jsxRuntimeExports.jsx(g.TextField,{defaultValue:r[t]||"",autoComplete:"off",error:c,placeholder:d,onChange:e=>{n(e.target.value)},name:t,hideErrorDom:null,disabled:s,...i})}})()};exports.default=N;
|
|
2
2
|
//# sourceMappingURL=itemType.js.map
|