@para-ui/core 5.0.0-beta.8 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +315 -0
- package/AlignBox/component.json +89 -0
- package/Anchor/component.json +130 -0
- package/Argv/component.json +216 -0
- package/AutoBox/component.json +133 -0
- package/AutoButton/component.json +109 -0
- package/AutoTips/component.json +121 -0
- package/Badge/component.json +92 -0
- package/Breadcrumbs/component.json +142 -0
- package/Button/component.json +168 -0
- package/ButtonGroup/component.json +132 -0
- package/Card/component.json +162 -0
- package/Carousel/component.json +142 -0
- package/Cascader/component.json +196 -0
- package/Checkbox/component.json +138 -0
- package/CheckboxGroup/component.json +152 -0
- package/CodeEditor/component.json +189 -0
- package/Collapse/component.json +166 -0
- package/CollapseBox/component.json +84 -0
- package/CollapseLayout/component.json +155 -0
- package/ColorPicker/component.json +142 -0
- package/ComboSelect/component.json +181 -0
- package/Container/component.json +111 -0
- package/ContentBox/component.json +81 -0
- package/CopyText/component.json +118 -0
- package/CycleSelector/component.json +98 -0
- package/DatePicker/component.json +192 -0
- package/Descriptions/component.json +142 -0
- package/Desktop/component.json +171 -0
- package/DragVerify/component.json +114 -0
- package/Drawer/component.json +200 -0
- package/Dropdown/component.json +147 -0
- package/DynamicMultiBox/component.json +278 -0
- package/Empty/component.json +123 -0
- package/ExpressionInput/component.json +79 -0
- package/FieldForm/component.json +196 -0
- package/Form/component.json +161 -0
- package/FormItem/component.json +171 -0
- package/FunctionModal/component.json +197 -0
- package/Help/component.json +118 -0
- package/HelperText/component.json +126 -0
- package/Image/component.json +165 -0
- package/InputCode/component.json +191 -0
- package/InputLang/component.json +205 -0
- package/InputNumber/component.json +162 -0
- package/Label/component.json +126 -0
- package/Loading/component.json +91 -0
- package/Menu/component.json +180 -0
- package/Message/component.json +246 -0
- package/Modal/component.json +277 -0
- package/MultiBox/component.json +216 -0
- package/Notification/component.json +184 -0
- package/OperateBtn/component.json +134 -0
- package/PageHeader/component.json +112 -0
- package/Pagination/component.json +181 -0
- package/PasswordRules/component.json +105 -0
- package/PopConfirm/component.json +227 -0
- package/PopMenu/component.json +131 -0
- package/Popover/component.json +165 -0
- package/Progress/component.json +161 -0
- package/Prompt/component.json +144 -0
- package/Querying/component.json +96 -0
- package/QuickReply/component.json +129 -0
- package/README.md +0 -5
- package/Radio/component.json +136 -0
- package/RadioGroup/component.json +149 -0
- package/RangeInput/component.json +198 -0
- package/Result/component.json +104 -0
- package/ScrollBar/component.json +115 -0
- package/Search/component.json +177 -0
- package/Select/component.json +244 -0
- package/SelectInput/component.json +184 -0
- package/Selector/component.json +203 -0
- package/SelectorPicker/component.json +179 -0
- package/SingleBox/component.json +151 -0
- package/Slider/component.json +181 -0
- package/SortBox/component.json +108 -0
- package/Status/component.json +104 -0
- package/Stepper/component.json +129 -0
- package/Switch/component.json +207 -0
- package/Table/component.json +547 -0
- package/Tabs/component.json +227 -0
- package/Tag/component.json +221 -0
- package/TextEditor/component.json +186 -0
- package/TextField/component.json +290 -0
- package/TimePicker/component.json +176 -0
- package/Timeline/component.json +110 -0
- package/Title/component.json +156 -0
- package/ToggleButton/component.json +153 -0
- package/Tooltip/component.json +176 -0
- package/Transfer/component.json +157 -0
- package/Tree/component.json +512 -0
- package/Upload/component.json +450 -0
- package/ai-workflows/01-crud-list-multi-drawer.md +278 -0
- package/ai-workflows/02-rbac-operation-buttons.md +290 -0
- package/ai-workflows/03-complex-form-async-cascade.md +350 -0
- package/ai-workflows/04-array-field-form.md +281 -0
- package/ai-workflows/05-popconfirm-async-message-queue.md +333 -0
- package/ai-workflows/06-modal-drawer-form-workflow.md +385 -0
- package/ai-workflows/07-search-filter-table-trio.md +387 -0
- package/ai-workflows/08-table-advanced-features.md +365 -0
- package/ai-workflows/09-batch-operation-export-progress.md +367 -0
- package/ai-workflows/10-cross-component-state-coordination.md +412 -0
- package/es/AlignBox/component.json +89 -0
- package/es/AlignBox/index.css +1 -1
- package/es/AlignBox/index.d.ts +6 -2
- package/es/AlignBox/index.js +1 -1
- package/es/AlignBox/style/index.css +1 -1
- package/es/Anchor/anchorMenu/index.d.ts +2 -1
- package/es/Anchor/anchorMenu/index.js +36 -33
- package/es/Anchor/component.json +130 -0
- package/es/Anchor/index.js +52 -49
- package/es/Anchor/type.d.ts +8 -4
- package/es/Argv/batchEdit/index.js +1 -1
- package/es/Argv/component.json +216 -0
- package/es/Argv/dataGenerator/index.js +1 -1
- package/es/Argv/index.d.ts +5 -6
- package/es/Argv/index.js +1 -1
- package/es/AutoBox/component.json +133 -0
- package/es/AutoBox/index.d.ts +3 -3
- package/es/AutoBox/index.js +1 -1
- package/es/AutoBox/protal.d.ts +2 -2
- package/es/AutoBox/protal.js +33 -30
- package/es/AutoButton/component.json +109 -0
- package/es/AutoButton/index.js +1 -1
- package/es/AutoTips/autoTipsMultiline/index.d.ts +1 -1
- package/es/AutoTips/autoTipsMultiline/index.js +1 -1
- package/es/AutoTips/component.json +121 -0
- package/es/AutoTips/index.js +1 -1
- package/es/Badge/component.json +92 -0
- package/es/Breadcrumbs/component.json +142 -0
- package/es/Breadcrumbs/index.js +1 -1
- package/es/Button/SplitButton.d.ts +2 -2
- package/es/Button/component.json +168 -0
- package/es/Button/index.js +44 -44
- package/es/ButtonGroup/component.json +132 -0
- package/es/ButtonGroup/index.d.ts +1 -1
- package/es/Card/component.json +162 -0
- package/es/Card/index.d.ts +2 -2
- package/es/Card/index.js +2 -2
- package/es/Carousel/component.json +142 -0
- package/es/Carousel/index.d.ts +1 -1
- package/es/Cascader/Cascader.js +1 -1
- package/es/Cascader/OptionList/Column.js +1 -1
- package/es/Cascader/OptionList/index.js +1 -1
- package/es/Cascader/component.json +196 -0
- package/es/Cascader/hooks/useEntities.js +7 -7
- package/es/Cascader/interface.d.ts +1 -0
- package/es/Cascader/utils/commonUtil.d.ts +1 -1
- package/es/Cascader/utils/commonUtil.js +16 -16
- package/es/Cascader/utils/treeUtil.d.ts +14 -5
- package/es/Cascader/utils/treeUtil.js +1 -1
- package/es/Checkbox/component.json +138 -0
- package/es/CheckboxGroup/component.json +152 -0
- package/es/CheckboxGroup/index.js +1 -1
- package/es/CodeEditor/component.json +189 -0
- package/es/CodeEditor/index.d.ts +11 -10
- package/es/CodeEditor/index.js +25 -25
- package/es/Collapse/component.json +166 -0
- package/es/Collapse/index.d.ts +1 -1
- package/es/Collapse/index.js +23 -22
- package/es/CollapseBox/component.json +84 -0
- package/es/CollapseLayout/component.json +155 -0
- package/es/ColorPicker/component.json +142 -0
- package/es/ComboSelect/component.json +181 -0
- package/es/ComboSelect/index.js +115 -109
- package/es/ComboSelect/interface.d.ts +2 -2
- package/es/ComboSelect/utils.d.ts +3 -3
- package/es/ComboSelect/utils.js +1 -1
- package/es/Container/component.json +111 -0
- package/es/ContentBox/component.json +81 -0
- package/es/CopyText/component.json +118 -0
- package/es/CycleSelector/component.json +98 -0
- package/es/CycleSelector/index.js +14 -13
- package/es/DatePicker/component.json +192 -0
- package/es/DatePicker/generatePicker/generateRangePicker.js +11 -11
- package/es/DatePicker/generatePicker/generateSinglePicker.js +2 -2
- package/es/Descriptions/component.json +142 -0
- package/es/Descriptions/index.d.ts +1 -1
- package/es/Desktop/component.json +171 -0
- package/es/Desktop/index.js +1 -1
- package/es/DragVerify/component.json +114 -0
- package/es/DragVerify/index.js +19 -19
- package/es/Drawer/component.json +200 -0
- package/es/Drawer/index.js +86 -86
- package/es/Drawer/interface.d.ts +1 -1
- package/es/Drawer/util.d.ts +1 -6
- package/es/Drawer/util.js +9 -6
- package/es/Dropdown/component.json +147 -0
- package/es/Dropdown/index.js +1 -1
- package/es/DynamicMultiBox/component.json +278 -0
- package/es/DynamicMultiBox/formItem.d.ts +1 -1
- package/es/DynamicMultiBox/index.d.ts +2 -2
- package/es/DynamicMultiBox/index.js +1 -1
- package/es/DynamicMultiBox/interface.d.ts +76 -76
- package/es/DynamicMultiBox/rowForm.d.ts +2 -2
- package/es/Empty/component.json +123 -0
- package/es/Empty/index.css +1 -1
- package/es/Empty/index.d.ts +2 -2
- package/es/Empty/index.js +27 -26
- package/es/Empty/style/index.css +1 -1
- package/es/ExpressionInput/HighlightOverlay.d.ts +8 -0
- package/es/ExpressionInput/HighlightOverlay.js +27 -0
- package/es/ExpressionInput/Popup.d.ts +19 -0
- package/es/ExpressionInput/Popup.js +93 -0
- package/es/ExpressionInput/component.json +79 -0
- package/es/ExpressionInput/detectChainAtCursor.d.ts +17 -0
- package/es/ExpressionInput/detectChainAtCursor.js +31 -0
- package/es/ExpressionInput/filterCandidatesByPartial.d.ts +2 -0
- package/es/ExpressionInput/filterCandidatesByPartial.js +15 -0
- package/es/ExpressionInput/highlightSegments.d.ts +9 -0
- package/es/ExpressionInput/highlightSegments.js +14 -0
- package/es/ExpressionInput/index.css +1 -0
- package/es/ExpressionInput/index.d.ts +5 -0
- package/es/ExpressionInput/index.js +178 -0
- package/es/ExpressionInput/interface.d.ts +52 -0
- package/es/ExpressionInput/isExpressionValue.d.ts +5 -0
- package/es/ExpressionInput/isExpressionValue.js +18 -0
- package/es/ExpressionInput/lang/en_US.d.ts +4 -0
- package/es/ExpressionInput/lang/en_US.js +7 -0
- package/es/ExpressionInput/lang/index.d.ts +9 -0
- package/es/ExpressionInput/lang/index.js +10 -0
- package/es/ExpressionInput/lang/zh_CN.d.ts +4 -0
- package/es/ExpressionInput/lang/zh_CN.js +7 -0
- package/es/ExpressionInput/style/css.js +1 -0
- package/es/ExpressionInput/style/index.css +1 -0
- package/es/ExpressionInput/style/index.js +1 -0
- package/es/ExpressionInput/useExpressionInput.d.ts +26 -0
- package/es/ExpressionInput/useExpressionInput.js +59 -0
- package/es/FieldForm/FieldFormItem/ItemHolder.js +1 -1
- package/es/FieldForm/FieldFormItem/MemoInput.d.ts +2 -2
- package/es/FieldForm/FieldFormItem/StatusProvider.js +1 -1
- package/es/FieldForm/FieldFormItem/index.d.ts +6 -6
- package/es/FieldForm/Form.d.ts +2 -2
- package/es/FieldForm/Form.js +1 -1
- package/es/FieldForm/FormItemInput.js +1 -1
- package/es/FieldForm/FormItemLabel.js +1 -1
- package/es/FieldForm/FormList.d.ts +2 -2
- package/es/FieldForm/component.json +196 -0
- package/es/FieldForm/context.d.ts +5 -1
- package/es/FieldForm/context.js +2 -2
- package/es/FieldForm/hooks/useForm.d.ts +4 -3
- package/es/FieldForm/hooks/useFormInstance.d.ts +1 -1
- package/es/FieldForm/hooks/useFormItemStatus.d.ts +9 -5
- package/es/FieldForm/hooks/useFormItemStatus.js +2 -2
- package/es/FieldForm/hooks/useItemRef.d.ts +1 -1
- package/es/FieldForm/hooks/useItemRef.js +6 -6
- package/es/Form/component.json +161 -0
- package/es/Form/index.d.ts +52 -49
- package/es/Form/index.js +1 -1
- package/es/FormItem/compoments/defaultCompoments/index.d.ts +5 -5
- package/es/FormItem/compoments/defaultCompoments/index.js +12 -11
- package/es/FormItem/compoments/formCheckboxGroup/index.d.ts +2 -2
- package/es/FormItem/compoments/formFile/index.js +8 -8
- package/es/FormItem/compoments/formRadioGroup/index.d.ts +1 -1
- package/es/FormItem/compoments/formSelect/index.d.ts +1 -1
- package/es/FormItem/component.json +171 -0
- package/es/FormItem/index.d.ts +5 -5
- package/es/FormItem/index.js +23 -23
- package/es/FormItem/itemType.js +1 -1
- package/es/FunctionModal/component.json +197 -0
- package/es/FunctionModal/dialog.d.ts +1 -1
- package/es/FunctionModal/modalContext.d.ts +4 -1
- package/es/GlobalContext/confirmLocale.js +1 -1
- package/es/GlobalContext/index.js +1 -1
- package/es/Help/component.json +118 -0
- package/es/HelperText/component.json +126 -0
- package/es/Image/PreviewGroup.js +1 -1
- package/es/Image/component.json +165 -0
- package/es/Image/index.js +1 -1
- package/es/InputCode/component.json +191 -0
- package/es/InputCode/index.d.ts +2 -2
- package/es/InputCode/index.js +1 -1
- package/es/InputLang/component.json +205 -0
- package/es/InputLang/index.js +2 -2
- package/es/InputNumber/component.json +162 -0
- package/es/InputNumber/index.d.ts +13 -7
- package/es/InputNumber/index.js +152 -144
- package/es/Label/component.json +126 -0
- package/es/Label/index.d.ts +2 -2
- package/es/Loading/component.json +91 -0
- package/es/Menu/component.json +180 -0
- package/es/Menu/verticalMenuList.js +1 -1
- package/es/Message/component.json +246 -0
- package/es/Message/index.d.ts +2 -2
- package/es/Message/index.js +19 -19
- package/es/Modal/Confirm/index.d.ts +1 -1
- package/es/Modal/Confirm/index.js +1 -1
- package/es/Modal/component.json +277 -0
- package/es/Modal/index.d.ts +85 -5
- package/es/Modal/index.js +159 -122
- package/es/Modal/interface.d.ts +1 -0
- package/es/MultiBox/component.json +216 -0
- package/es/MultiBox/index.js +19 -14
- package/es/Notification/component.json +184 -0
- package/es/OperateBtn/component.json +134 -0
- package/es/OperateBtn/index.d.ts +3 -3
- package/es/PageHeader/component.json +112 -0
- package/es/PageHeader/horizontalMeun.js +1 -1
- package/es/PageHeader/horizontalMeunRight.js +1 -1
- package/es/Pagination/component.json +181 -0
- package/es/Pagination/index.js +15 -15
- package/es/ParauiProvider/index.js +1 -1
- package/es/PasswordRules/component.json +105 -0
- package/es/PasswordRules/index.d.ts +4 -4
- package/es/PopConfirm/component.json +227 -0
- package/es/PopConfirm/index.d.ts +1 -1
- package/es/PopConfirm/index.js +1 -1
- package/es/PopMenu/component.json +131 -0
- package/es/PopMenu/hooks.d.ts +1 -1
- package/es/PopMenu/index.js +8 -8
- package/es/Popover/component.json +165 -0
- package/es/Popover/index.js +1 -1
- package/es/Progress/component.json +161 -0
- package/es/Prompt/component.json +144 -0
- package/es/Querying/component.json +96 -0
- package/es/Querying/index.css +1 -1
- package/es/Querying/index.d.ts +2 -2
- package/es/Querying/index.js +20 -19
- package/es/Querying/style/index.css +1 -1
- package/es/QuickReply/QuickReplyCode/index.js +1 -1
- package/es/QuickReply/component.json +129 -0
- package/es/QuickReply/index.d.ts +1 -1
- package/es/Radio/component.json +136 -0
- package/es/RadioGroup/component.json +149 -0
- package/es/RangeInput/component.json +198 -0
- package/es/RangeInput/index.d.ts +15 -7
- package/es/RangeInput/index.js +120 -103
- package/es/Result/component.json +104 -0
- package/es/ScrollBar/component.json +115 -0
- package/es/Search/component.json +177 -0
- package/es/Search/index.d.ts +1 -1
- package/es/Select/component.json +244 -0
- package/es/Select/index.d.ts +11 -8
- package/es/Select/index.js +441 -438
- package/es/SelectInput/component.json +184 -0
- package/es/SelectInput/index.d.ts +4 -4
- package/es/SelectInput/index.js +8 -8
- package/es/Selector/component.json +203 -0
- package/es/Selector/index.js +56 -50
- package/es/Selector/interface.d.ts +2 -2
- package/es/Selector/selectorData/index.js +1 -1
- package/es/Selector/selectorMain/index.js +3 -3
- package/es/Selector/selectorNode/index.js +1 -1
- package/es/Selector/util.d.ts +3 -3
- package/es/Selector/util.js +6 -12
- package/es/SelectorPicker/component.json +179 -0
- package/es/SelectorPicker/index.d.ts +5 -5
- package/es/SelectorPicker/index.js +15 -15
- package/es/SingleBox/component.json +151 -0
- package/es/SingleBox/index.d.ts +2 -2
- package/es/Slider/component.json +181 -0
- package/es/SortBox/component.json +108 -0
- package/es/Status/component.json +104 -0
- package/es/Stepper/component.json +129 -0
- package/es/Stepper/index.d.ts +2 -2
- package/es/Switch/component.json +207 -0
- package/es/Switch/index.css +1 -1
- package/es/Switch/index.d.ts +3 -2
- package/es/Switch/index.js +60 -59
- package/es/Switch/style/index.css +1 -1
- package/es/Table/component.json +547 -0
- package/es/Table/index.d.ts +2 -2
- package/es/Table/index.js +385 -382
- package/es/Table/interface.d.ts +30 -0
- package/es/Table/tableHead.js +1 -1
- package/es/Table/util.d.ts +1 -1
- package/es/Table/util.js +3 -12
- package/es/Tabs/component.json +227 -0
- package/es/Tag/component.json +221 -0
- package/es/Tag/index.css +1 -1
- package/es/Tag/index.d.ts +1 -1
- package/es/Tag/index.js +20 -20
- package/es/Tag/style/index.css +1 -1
- package/es/TextEditor/component.json +186 -0
- package/es/TextEditor/index.d.ts +5 -5
- package/es/TextEditor/index.js +1 -1
- package/es/TextField/component.json +290 -0
- package/es/TextField/index.d.ts +2 -2
- package/es/TextField/index.js +1 -1
- package/es/TimePicker/component.json +176 -0
- package/es/Timeline/component.json +110 -0
- package/es/Title/component.json +156 -0
- package/es/ToggleButton/component.json +153 -0
- package/es/ToggleButton/index.js +1 -1
- package/es/Tooltip/component.json +176 -0
- package/es/Tooltip/index.js +58 -53
- package/es/Tooltip/interface.d.ts +14 -1
- package/es/Tooltip/utils.js +6 -6
- package/es/Transfer/component.json +157 -0
- package/es/Tree/OperateBar/index.js +1 -1
- package/es/Tree/Tree.js +3 -3
- package/es/Tree/component.json +512 -0
- package/es/Tree/interface.d.ts +1 -1
- package/es/Upload/component.json +450 -0
- package/es/Upload/util.js +1 -1
- package/es/Utils/snack-kit-shims.d.ts +18 -0
- package/es/Utils/snack-kit-shims.js +19 -0
- package/es/Utils/type.d.ts +0 -6
- package/es/_virtual/index.js +5 -3
- package/es/_virtual/index2.js +2 -5
- package/es/index.d.ts +4 -0
- package/es/index.js +152 -150
- package/es/locale/en-US.d.ts +3 -0
- package/es/locale/en-US.js +3 -0
- package/es/locale/en_US.d.ts +361 -0
- package/es/locale/en_US.js +364 -0
- package/es/locale/index.d.ts +1 -723
- package/es/locale/index2.js +10 -0
- package/es/locale/zh-CN.d.ts +3 -0
- package/es/locale/zh-CN.js +3 -0
- package/es/locale/zh_CN.d.ts +361 -0
- package/es/locale/zh_CN.js +364 -0
- package/es/node_modules/classnames/index.js +1 -1
- package/lib/AlignBox/component.json +89 -0
- package/lib/AlignBox/index.css +1 -1
- package/lib/AlignBox/index.d.ts +6 -2
- package/lib/AlignBox/index.js +1 -1
- package/lib/AlignBox/style/index.css +1 -1
- package/lib/Anchor/anchorMenu/index.d.ts +2 -1
- package/lib/Anchor/anchorMenu/index.js +1 -1
- package/lib/Anchor/component.json +130 -0
- package/lib/Anchor/index.js +1 -1
- package/lib/Anchor/type.d.ts +8 -4
- package/lib/Argv/component.json +216 -0
- package/lib/Argv/dataGenerator/index.js +1 -1
- package/lib/Argv/index.d.ts +5 -6
- package/lib/Argv/index.js +1 -1
- package/lib/AutoBox/component.json +133 -0
- package/lib/AutoBox/index.d.ts +3 -3
- package/lib/AutoBox/index.js +1 -1
- package/lib/AutoBox/protal.d.ts +2 -2
- package/lib/AutoBox/protal.js +1 -1
- package/lib/AutoButton/component.json +109 -0
- package/lib/AutoButton/index.js +1 -1
- package/lib/AutoTips/autoTipsMultiline/index.d.ts +1 -1
- package/lib/AutoTips/autoTipsMultiline/index.js +1 -1
- package/lib/AutoTips/component.json +121 -0
- package/lib/AutoTips/index.js +1 -1
- package/lib/Badge/component.json +92 -0
- package/lib/Breadcrumbs/component.json +142 -0
- package/lib/Breadcrumbs/index.js +1 -1
- package/lib/Button/SplitButton.d.ts +2 -2
- package/lib/Button/component.json +168 -0
- package/lib/Button/index.js +1 -1
- package/lib/ButtonGroup/component.json +132 -0
- package/lib/ButtonGroup/index.d.ts +1 -1
- package/lib/Card/component.json +162 -0
- package/lib/Card/index.d.ts +2 -2
- package/lib/Card/index.js +1 -1
- package/lib/Carousel/component.json +142 -0
- package/lib/Carousel/index.d.ts +1 -1
- package/lib/Cascader/Cascader.js +1 -1
- package/lib/Cascader/OptionList/Column.js +1 -1
- package/lib/Cascader/OptionList/index.js +1 -1
- package/lib/Cascader/component.json +196 -0
- package/lib/Cascader/hooks/useEntities.js +1 -1
- package/lib/Cascader/interface.d.ts +1 -0
- package/lib/Cascader/utils/commonUtil.d.ts +1 -1
- package/lib/Cascader/utils/commonUtil.js +1 -1
- package/lib/Cascader/utils/treeUtil.d.ts +14 -5
- package/lib/Cascader/utils/treeUtil.js +1 -1
- package/lib/Checkbox/component.json +138 -0
- package/lib/CheckboxGroup/component.json +152 -0
- package/lib/CheckboxGroup/index.js +1 -1
- package/lib/CodeEditor/component.json +189 -0
- package/lib/CodeEditor/index.d.ts +11 -10
- package/lib/CodeEditor/index.js +1 -1
- package/lib/Collapse/component.json +166 -0
- package/lib/Collapse/index.d.ts +1 -1
- package/lib/Collapse/index.js +1 -1
- package/lib/CollapseBox/component.json +84 -0
- package/lib/CollapseLayout/component.json +155 -0
- package/lib/ColorPicker/component.json +142 -0
- package/lib/ComboSelect/component.json +181 -0
- package/lib/ComboSelect/index.js +1 -1
- package/lib/ComboSelect/interface.d.ts +2 -2
- package/lib/ComboSelect/utils.d.ts +3 -3
- package/lib/ComboSelect/utils.js +1 -1
- package/lib/Container/component.json +111 -0
- package/lib/ContentBox/component.json +81 -0
- package/lib/CopyText/component.json +118 -0
- package/lib/CycleSelector/component.json +98 -0
- package/lib/CycleSelector/index.js +1 -1
- package/lib/DatePicker/component.json +192 -0
- package/lib/DatePicker/generatePicker/generateRangePicker.js +1 -1
- package/lib/DatePicker/generatePicker/generateSinglePicker.js +1 -1
- package/lib/Descriptions/component.json +142 -0
- package/lib/Descriptions/index.d.ts +1 -1
- package/lib/Desktop/component.json +171 -0
- package/lib/Desktop/index.js +1 -1
- package/lib/DragVerify/component.json +114 -0
- package/lib/DragVerify/index.js +1 -1
- package/lib/Drawer/component.json +200 -0
- package/lib/Drawer/index.js +1 -1
- package/lib/Drawer/interface.d.ts +1 -1
- package/lib/Drawer/util.d.ts +1 -6
- package/lib/Drawer/util.js +1 -1
- package/lib/Dropdown/component.json +147 -0
- package/lib/Dropdown/index.js +1 -1
- package/lib/DynamicMultiBox/component.json +278 -0
- package/lib/DynamicMultiBox/formItem.d.ts +1 -1
- package/lib/DynamicMultiBox/index.d.ts +2 -2
- package/lib/DynamicMultiBox/index.js +1 -1
- package/lib/DynamicMultiBox/interface.d.ts +76 -76
- package/lib/DynamicMultiBox/rowForm.d.ts +2 -2
- package/lib/Empty/component.json +123 -0
- package/lib/Empty/index.css +1 -1
- package/lib/Empty/index.d.ts +2 -2
- package/lib/Empty/index.js +1 -1
- package/lib/Empty/style/index.css +1 -1
- package/lib/ExpressionInput/HighlightOverlay.d.ts +8 -0
- package/lib/ExpressionInput/HighlightOverlay.js +2 -0
- package/lib/ExpressionInput/Popup.d.ts +19 -0
- package/lib/ExpressionInput/Popup.js +2 -0
- package/lib/ExpressionInput/component.json +79 -0
- package/lib/ExpressionInput/detectChainAtCursor.d.ts +17 -0
- package/lib/ExpressionInput/detectChainAtCursor.js +2 -0
- package/lib/ExpressionInput/filterCandidatesByPartial.d.ts +2 -0
- package/lib/ExpressionInput/filterCandidatesByPartial.js +2 -0
- package/lib/ExpressionInput/highlightSegments.d.ts +9 -0
- package/lib/ExpressionInput/highlightSegments.js +2 -0
- package/lib/ExpressionInput/index.css +1 -0
- package/lib/ExpressionInput/index.d.ts +5 -0
- package/lib/ExpressionInput/index.js +2 -0
- package/lib/ExpressionInput/interface.d.ts +52 -0
- package/lib/ExpressionInput/isExpressionValue.d.ts +5 -0
- package/lib/ExpressionInput/isExpressionValue.js +2 -0
- package/lib/ExpressionInput/lang/en_US.d.ts +4 -0
- package/lib/ExpressionInput/lang/en_US.js +2 -0
- package/lib/ExpressionInput/lang/index.d.ts +9 -0
- package/lib/ExpressionInput/lang/index.js +2 -0
- package/lib/ExpressionInput/lang/zh_CN.d.ts +4 -0
- package/lib/ExpressionInput/lang/zh_CN.js +2 -0
- package/lib/ExpressionInput/style/css.js +1 -0
- package/lib/ExpressionInput/style/index.css +1 -0
- package/lib/ExpressionInput/style/index.js +1 -0
- package/lib/ExpressionInput/useExpressionInput.d.ts +26 -0
- package/lib/ExpressionInput/useExpressionInput.js +2 -0
- package/lib/FieldForm/FieldFormItem/ItemHolder.js +1 -1
- package/lib/FieldForm/FieldFormItem/MemoInput.d.ts +2 -2
- package/lib/FieldForm/FieldFormItem/StatusProvider.js +1 -1
- package/lib/FieldForm/FieldFormItem/index.d.ts +6 -6
- package/lib/FieldForm/Form.d.ts +2 -2
- package/lib/FieldForm/Form.js +1 -1
- package/lib/FieldForm/FormItemInput.js +1 -1
- package/lib/FieldForm/FormItemLabel.js +1 -1
- package/lib/FieldForm/FormList.d.ts +2 -2
- package/lib/FieldForm/component.json +196 -0
- package/lib/FieldForm/context.d.ts +5 -1
- package/lib/FieldForm/context.js +1 -1
- package/lib/FieldForm/hooks/useForm.d.ts +4 -3
- package/lib/FieldForm/hooks/useFormInstance.d.ts +1 -1
- package/lib/FieldForm/hooks/useFormItemStatus.d.ts +9 -5
- package/lib/FieldForm/hooks/useFormItemStatus.js +1 -1
- package/lib/FieldForm/hooks/useItemRef.d.ts +1 -1
- package/lib/FieldForm/hooks/useItemRef.js +1 -1
- package/lib/Form/component.json +161 -0
- package/lib/Form/index.d.ts +52 -49
- package/lib/Form/index.js +1 -1
- package/lib/FormItem/compoments/defaultCompoments/index.d.ts +5 -5
- package/lib/FormItem/compoments/defaultCompoments/index.js +1 -1
- package/lib/FormItem/compoments/formCheckboxGroup/index.d.ts +2 -2
- package/lib/FormItem/compoments/formFile/index.js +1 -1
- package/lib/FormItem/compoments/formRadioGroup/index.d.ts +1 -1
- package/lib/FormItem/compoments/formSelect/index.d.ts +1 -1
- package/lib/FormItem/component.json +171 -0
- package/lib/FormItem/index.d.ts +5 -5
- package/lib/FormItem/index.js +1 -1
- package/lib/FormItem/itemType.js +1 -1
- package/lib/FunctionModal/component.json +197 -0
- package/lib/FunctionModal/dialog.d.ts +1 -1
- package/lib/FunctionModal/modalContext.d.ts +4 -1
- package/lib/GlobalContext/confirmLocale.js +1 -1
- package/lib/GlobalContext/index.js +1 -1
- package/lib/Help/component.json +118 -0
- package/lib/HelperText/component.json +126 -0
- package/lib/Image/PreviewGroup.js +1 -1
- package/lib/Image/component.json +165 -0
- package/lib/Image/index.js +1 -1
- package/lib/InputCode/component.json +191 -0
- package/lib/InputCode/index.d.ts +2 -2
- package/lib/InputLang/component.json +205 -0
- package/lib/InputLang/index.js +1 -1
- package/lib/InputNumber/component.json +162 -0
- package/lib/InputNumber/index.d.ts +13 -7
- package/lib/InputNumber/index.js +1 -1
- package/lib/Label/component.json +126 -0
- package/lib/Label/index.d.ts +2 -2
- package/lib/Loading/component.json +91 -0
- package/lib/Menu/component.json +180 -0
- package/lib/Menu/verticalMenuList.js +1 -1
- package/lib/Message/component.json +246 -0
- package/lib/Message/index.d.ts +2 -2
- package/lib/Message/index.js +1 -1
- package/lib/Modal/Confirm/index.d.ts +1 -1
- package/lib/Modal/Confirm/index.js +1 -1
- package/lib/Modal/component.json +277 -0
- package/lib/Modal/index.d.ts +85 -5
- package/lib/Modal/index.js +1 -1
- package/lib/Modal/interface.d.ts +1 -0
- package/lib/MultiBox/component.json +216 -0
- package/lib/MultiBox/index.js +1 -1
- package/lib/Notification/component.json +184 -0
- package/lib/OperateBtn/component.json +134 -0
- package/lib/OperateBtn/index.d.ts +3 -3
- package/lib/PageHeader/component.json +112 -0
- package/lib/PageHeader/horizontalMeun.js +1 -1
- package/lib/PageHeader/horizontalMeunRight.js +1 -1
- package/lib/Pagination/component.json +181 -0
- package/lib/Pagination/index.js +1 -1
- package/lib/ParauiProvider/index.js +1 -1
- package/lib/PasswordRules/component.json +105 -0
- package/lib/PasswordRules/index.d.ts +4 -4
- package/lib/PopConfirm/component.json +227 -0
- package/lib/PopConfirm/index.d.ts +1 -1
- package/lib/PopConfirm/index.js +1 -1
- package/lib/PopMenu/component.json +131 -0
- package/lib/PopMenu/hooks.d.ts +1 -1
- package/lib/PopMenu/index.js +1 -1
- package/lib/Popover/component.json +165 -0
- package/lib/Popover/index.js +1 -1
- package/lib/Progress/component.json +161 -0
- package/lib/Prompt/component.json +144 -0
- package/lib/Querying/component.json +96 -0
- package/lib/Querying/index.css +1 -1
- package/lib/Querying/index.d.ts +2 -2
- package/lib/Querying/index.js +1 -1
- package/lib/Querying/style/index.css +1 -1
- package/lib/QuickReply/QuickReplyCode/index.js +1 -1
- package/lib/QuickReply/component.json +129 -0
- package/lib/QuickReply/index.d.ts +1 -1
- package/lib/Radio/component.json +136 -0
- package/lib/RadioGroup/component.json +149 -0
- package/lib/RangeInput/component.json +198 -0
- package/lib/RangeInput/index.d.ts +15 -7
- package/lib/RangeInput/index.js +1 -1
- package/lib/Result/component.json +104 -0
- package/lib/ScrollBar/component.json +115 -0
- package/lib/Search/component.json +177 -0
- package/lib/Search/index.d.ts +1 -1
- package/lib/Select/component.json +244 -0
- package/lib/Select/index.d.ts +11 -8
- package/lib/Select/index.js +1 -1
- package/lib/SelectInput/component.json +184 -0
- package/lib/SelectInput/index.d.ts +4 -4
- package/lib/SelectInput/index.js +1 -1
- package/lib/Selector/component.json +203 -0
- package/lib/Selector/index.js +1 -1
- package/lib/Selector/interface.d.ts +2 -2
- package/lib/Selector/selectorData/index.js +1 -1
- package/lib/Selector/selectorMain/index.js +1 -1
- package/lib/Selector/selectorNode/index.js +1 -1
- package/lib/Selector/util.d.ts +3 -3
- package/lib/Selector/util.js +1 -1
- package/lib/SelectorPicker/component.json +179 -0
- package/lib/SelectorPicker/index.d.ts +5 -5
- package/lib/SelectorPicker/index.js +1 -1
- package/lib/SingleBox/component.json +151 -0
- package/lib/SingleBox/index.d.ts +2 -2
- package/lib/Slider/component.json +181 -0
- package/lib/SortBox/component.json +108 -0
- package/lib/Status/component.json +104 -0
- package/lib/Stepper/component.json +129 -0
- package/lib/Stepper/index.d.ts +2 -2
- package/lib/Switch/component.json +207 -0
- package/lib/Switch/index.css +1 -1
- package/lib/Switch/index.d.ts +3 -2
- package/lib/Switch/index.js +1 -1
- package/lib/Switch/style/index.css +1 -1
- package/lib/Table/component.json +547 -0
- package/lib/Table/index.d.ts +2 -2
- package/lib/Table/index.js +1 -1
- package/lib/Table/interface.d.ts +30 -0
- package/lib/Table/tableHead.js +1 -1
- package/lib/Table/util.d.ts +1 -1
- package/lib/Table/util.js +1 -1
- package/lib/Tabs/component.json +227 -0
- package/lib/Tag/component.json +221 -0
- package/lib/Tag/index.css +1 -1
- package/lib/Tag/index.d.ts +1 -1
- package/lib/Tag/index.js +1 -1
- package/lib/Tag/style/index.css +1 -1
- package/lib/TextEditor/component.json +186 -0
- package/lib/TextEditor/index.d.ts +5 -5
- package/lib/TextEditor/index.js +1 -1
- package/lib/TextField/component.json +290 -0
- package/lib/TextField/index.d.ts +2 -2
- package/lib/TextField/index.js +1 -1
- package/lib/TimePicker/component.json +176 -0
- package/lib/Timeline/component.json +110 -0
- package/lib/Title/component.json +156 -0
- package/lib/ToggleButton/component.json +153 -0
- package/lib/ToggleButton/index.js +1 -1
- package/lib/Tooltip/component.json +176 -0
- package/lib/Tooltip/index.js +1 -1
- package/lib/Tooltip/interface.d.ts +14 -1
- package/lib/Tooltip/utils.js +1 -1
- package/lib/Transfer/component.json +157 -0
- package/lib/Tree/OperateBar/index.js +2 -2
- package/lib/Tree/Tree.js +1 -1
- package/lib/Tree/component.json +512 -0
- package/lib/Tree/interface.d.ts +1 -1
- package/lib/Upload/component.json +450 -0
- package/lib/Upload/util.js +1 -1
- package/lib/Utils/snack-kit-shims.d.ts +18 -0
- package/lib/Utils/snack-kit-shims.js +2 -0
- package/lib/Utils/type.d.ts +0 -6
- package/lib/_virtual/index.js +1 -1
- package/lib/_virtual/index2.js +1 -1
- package/lib/index.d.ts +4 -0
- package/lib/index.js +1 -1
- package/lib/locale/en-US.d.ts +3 -0
- package/lib/locale/en-US.js +1 -1
- package/lib/locale/en_US.d.ts +361 -0
- package/lib/locale/en_US.js +2 -0
- package/lib/locale/index.d.ts +1 -723
- package/lib/locale/index2.js +2 -0
- package/lib/locale/zh-CN.d.ts +3 -0
- package/lib/locale/zh-CN.js +1 -1
- package/lib/locale/zh_CN.d.ts +361 -0
- package/lib/locale/zh_CN.js +2 -0
- package/lib/node_modules/classnames/index.js +1 -1
- package/package.json +24 -4
- package/es/_virtual/index3.js +0 -5
- package/es/_virtual/index4.js +0 -5
- package/es/node_modules/@para-snack/core/dist/index.js +0 -5231
- package/lib/_virtual/index3.js +0 -2
- package/lib/_virtual/index4.js +0 -2
- package/lib/node_modules/@para-snack/core/dist/index.js +0 -20
- /package/es/{InputCode → CodeEditor}/index.css +0 -0
- /package/es/{Utils/Hooks → Hooks}/useResizeObserver.d.ts +0 -0
- /package/es/{Utils/Hooks → Hooks}/useResizeObserver.js +0 -0
- /package/lib/{Utils/Hooks → Hooks}/useResizeObserver.d.ts +0 -0
- /package/lib/{Utils/Hooks → Hooks}/useResizeObserver.js +0 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Prompt",
|
|
3
|
+
"category": "Feedback",
|
|
4
|
+
"description": "页面级信息提示条,支持 info/success/warn/error 四种类型及固定/反馈两种模式",
|
|
5
|
+
"semantic": {
|
|
6
|
+
"intent": [
|
|
7
|
+
"页面提示",
|
|
8
|
+
"信息通知"
|
|
9
|
+
],
|
|
10
|
+
"useCases": [
|
|
11
|
+
"操作结果",
|
|
12
|
+
"系统通知",
|
|
13
|
+
"警告信息"
|
|
14
|
+
],
|
|
15
|
+
"riskLevel": "low"
|
|
16
|
+
},
|
|
17
|
+
"variants": {
|
|
18
|
+
"error": {
|
|
19
|
+
"meaning": "错误提示"
|
|
20
|
+
},
|
|
21
|
+
"success": {
|
|
22
|
+
"meaning": "成功提示"
|
|
23
|
+
},
|
|
24
|
+
"warn": {
|
|
25
|
+
"meaning": "警告提示"
|
|
26
|
+
},
|
|
27
|
+
"info": {
|
|
28
|
+
"meaning": "信息提示"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"states": [
|
|
32
|
+
"visible",
|
|
33
|
+
"hidden"
|
|
34
|
+
],
|
|
35
|
+
"idealProps": {
|
|
36
|
+
"type": {
|
|
37
|
+
"type": "enum",
|
|
38
|
+
"values": [
|
|
39
|
+
"error",
|
|
40
|
+
"success",
|
|
41
|
+
"warn",
|
|
42
|
+
"info"
|
|
43
|
+
],
|
|
44
|
+
"default": "info",
|
|
45
|
+
"description": "信息类型,决定左侧图标和配色。⚠️ 警告类型值为 `'warn'`,不是 `'warning'`(与 Notification 的 IconType 不同,混用会 fallback 到默认样式)"
|
|
46
|
+
},
|
|
47
|
+
"status": {
|
|
48
|
+
"type": "enum",
|
|
49
|
+
"values": ["fixed", "feedback"],
|
|
50
|
+
"default": "fixed",
|
|
51
|
+
"required": false,
|
|
52
|
+
"description": "显示模式。fixed=常驻不可关闭(用于强制通知/系统公告);feedback=用户可手动关闭(关闭按钮由 closeIcon 控制)。⚠️ 核心 prop:不传时默认 fixed,即不显示关闭按钮、不可消除"
|
|
53
|
+
},
|
|
54
|
+
"title": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"description": "标题,显示在内容上方的粗体文字"
|
|
57
|
+
},
|
|
58
|
+
"content": {
|
|
59
|
+
"type": "string | string[]",
|
|
60
|
+
"description": "内容正文。传 string 为单行;传 string[] 为多行列表(每项换行展示)。⚠️ 传了 customContent 时此字段失效"
|
|
61
|
+
},
|
|
62
|
+
"customContent": {
|
|
63
|
+
"type": "ReactNode",
|
|
64
|
+
"required": false,
|
|
65
|
+
"description": "完全自定义内容区。传入后 content 失效,由 customContent 完整接管渲染"
|
|
66
|
+
},
|
|
67
|
+
"show": {
|
|
68
|
+
"type": "boolean",
|
|
69
|
+
"description": "是否展示 Prompt,false 时完全不渲染(内部 isShow state 由 show prop 驱动,初始为 true)"
|
|
70
|
+
},
|
|
71
|
+
"closeIcon": {
|
|
72
|
+
"type": "boolean",
|
|
73
|
+
"required": false,
|
|
74
|
+
"description": "是否展示关闭按钮。⚠️ 仅 status='feedback' 时有效,status='fixed' 时即使传 true 也不显示关闭按钮(src/Prompt/index.tsx:108 实证:closeIcon 只在 prompt-status-feedback-close 类下渲染)"
|
|
75
|
+
},
|
|
76
|
+
"hideIcon": {
|
|
77
|
+
"type": "boolean",
|
|
78
|
+
"required": false,
|
|
79
|
+
"description": "是否隐藏左侧类型图标(info/success/warn/error 对应的图标)"
|
|
80
|
+
},
|
|
81
|
+
"outline": {
|
|
82
|
+
"type": "boolean",
|
|
83
|
+
"required": false,
|
|
84
|
+
"description": "是否显示外边框"
|
|
85
|
+
},
|
|
86
|
+
"icon": {
|
|
87
|
+
"type": "ReactNode",
|
|
88
|
+
"required": false,
|
|
89
|
+
"description": "自定义左侧图标,传入后覆盖 type 对应的默认图标"
|
|
90
|
+
},
|
|
91
|
+
"onClose": {
|
|
92
|
+
"type": "() => void",
|
|
93
|
+
"description": "关闭按钮点击回调,status='feedback' 且 closeIcon=true 时有效;触发后组件内部自动隐藏(isShow=false),父组件可在此同步 state"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"do": [
|
|
97
|
+
"在页面顶部或卡片顶部显示,告知用户当前系统状态或操作结果",
|
|
98
|
+
"可关闭提示使用 status='feedback' + closeIcon=true,onClose 同步父组件 show state",
|
|
99
|
+
"警告类型使用 type='warn'(不是 'warning')",
|
|
100
|
+
"多条提示内容使用 content 数组,组件会自动逐行渲染"
|
|
101
|
+
],
|
|
102
|
+
"dont": [
|
|
103
|
+
"同时显示多个 Prompt——多条提示应合并或用通知列表",
|
|
104
|
+
"内容过长——超长内容考虑 Modal 或独立页面,Prompt 适合单行到几行的简短提示",
|
|
105
|
+
"status='fixed' 时传 closeIcon=true 期望出现关闭按钮——fixed 模式下 closeIcon 静默失效"
|
|
106
|
+
],
|
|
107
|
+
"events": {
|
|
108
|
+
"onClose": {
|
|
109
|
+
"signature": "() => void",
|
|
110
|
+
"asyncSupported": false,
|
|
111
|
+
"examples": [
|
|
112
|
+
"同步父组件隐藏状态:onClose={() => setShowPrompt(false)}",
|
|
113
|
+
"关闭后执行操作:onClose={() => { setShowPrompt(false); trackDismiss(); }}",
|
|
114
|
+
"show 受控写法:show={showPrompt} onClose={() => setShowPrompt(false)}"
|
|
115
|
+
],
|
|
116
|
+
"commonMistakes": [
|
|
117
|
+
"只传 onClose 不传 status='feedback' + closeIcon=true——没有关闭按钮时 onClose 永远不会触发",
|
|
118
|
+
"期望 onClose 阻止 Prompt 自动隐藏——组件内部点击关闭后调 setIsShow(false) 然后再调 onClose,隐藏无法阻止",
|
|
119
|
+
"不传 show prop 而依赖 onClose 控制显示——初始渲染时 isShow=true,无法通过 onClose 来控制初始不显示;初始隐藏需 show=false"
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"typescriptPitfalls": [
|
|
124
|
+
{
|
|
125
|
+
"issue": "type='warning' 不存在,警告类型枚举值是 'warn'",
|
|
126
|
+
"wrong": "<Prompt type='warning' content='请注意...' /> // TS 类型报错('warning' 不在联合类型)",
|
|
127
|
+
"right": "<Prompt type='warn' content='请注意...' />"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"issue": "onClose 的类型是 Function(宽泛),严格模式下建议标注为 () => void",
|
|
131
|
+
"wrong": "const handleClose: (e: MouseEvent) => void = () => setShow(false); // 参数类型不匹配",
|
|
132
|
+
"right": "const handleClose: () => void = () => setShow(false); // onClose 签名是无参无返回值"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"issue": "closeIcon 仅在 status='feedback' 时有效,status='fixed'(默认)传 closeIcon 无按钮渲染",
|
|
136
|
+
"wrong": "<Prompt type='info' closeIcon onClose={() => setShow(false)} /> // status 默认 fixed,closeIcon 不生效",
|
|
137
|
+
"right": "<Prompt type='info' status='feedback' closeIcon onClose={() => setShow(false)} />"
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
"mapping": {
|
|
141
|
+
"realComponent": "Prompt",
|
|
142
|
+
"adapter": null
|
|
143
|
+
}
|
|
144
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Querying",
|
|
3
|
+
"category": "Feedback",
|
|
4
|
+
"description": "查询中状态组件,用于数据搜索/加载中的空态占位提示",
|
|
5
|
+
"semantic": {
|
|
6
|
+
"intent": [
|
|
7
|
+
"加载提示",
|
|
8
|
+
"查询中"
|
|
9
|
+
],
|
|
10
|
+
"useCases": [
|
|
11
|
+
"数据搜索",
|
|
12
|
+
"列表加载",
|
|
13
|
+
"初始化"
|
|
14
|
+
],
|
|
15
|
+
"riskLevel": "low"
|
|
16
|
+
},
|
|
17
|
+
"variants": {
|
|
18
|
+
"large": {
|
|
19
|
+
"meaning": "大尺寸"
|
|
20
|
+
},
|
|
21
|
+
"small": {
|
|
22
|
+
"meaning": "小尺寸"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"states": [
|
|
26
|
+
"loading"
|
|
27
|
+
],
|
|
28
|
+
"idealProps": {
|
|
29
|
+
"size": {
|
|
30
|
+
"type": "enum",
|
|
31
|
+
"values": [
|
|
32
|
+
"small",
|
|
33
|
+
"medium",
|
|
34
|
+
"large"
|
|
35
|
+
],
|
|
36
|
+
"default": "large",
|
|
37
|
+
"description": "大小。三档统一为 small / medium / large(2026-05-08 跨组件命名 epic §3.1 选项 B 实施,medium 为新增视觉档,默认 large 不变,既有 small/large 调用零回归)"
|
|
38
|
+
},
|
|
39
|
+
"description": {
|
|
40
|
+
"type": "ReactNode",
|
|
41
|
+
"description": "描述文字;不传时使用 i18n 默认文案('查询中...'),传 null/'' 可隐藏"
|
|
42
|
+
},
|
|
43
|
+
"image": {
|
|
44
|
+
"type": "ReactNode",
|
|
45
|
+
"description": "图片/图标节点;传字符串时渲染为 <img src>;不传时使用内置 SVG 插图(large 用 LargeSearch,small 用 SmallSearch)"
|
|
46
|
+
},
|
|
47
|
+
"imageStyle": {
|
|
48
|
+
"type": "React.CSSProperties",
|
|
49
|
+
"description": "图片容器的内联样式(src/Querying/index.tsx:24 interface 实证)"
|
|
50
|
+
},
|
|
51
|
+
"customQuerying": {
|
|
52
|
+
"type": "React.ReactNode",
|
|
53
|
+
"description": "完全自定义整个 Querying 内容区;传入后 image / description / imageStyle 均被替换,组件只渲染此 ReactNode"
|
|
54
|
+
},
|
|
55
|
+
"className": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"description": "自定义类名"
|
|
58
|
+
},
|
|
59
|
+
"style": {
|
|
60
|
+
"type": "React.CSSProperties",
|
|
61
|
+
"description": "自定义样式"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"do": [
|
|
65
|
+
"在搜索或查询时显示,替换 Table/List 的空态区域",
|
|
66
|
+
"提供清晰的加载中提示——description 说明当前正在做什么(如「正在搜索...」)",
|
|
67
|
+
"使用 customQuerying 完全自定义布局,或通过 image + description 组合定制"
|
|
68
|
+
],
|
|
69
|
+
"dont": [
|
|
70
|
+
"加载时间过长不给提示——超过 300ms 的异步操作应展示 Querying",
|
|
71
|
+
"与其他加载状态(Spinner/Skeleton)混用——同一容器内选用统一加载态组件",
|
|
72
|
+
"把 Querying 用于非加载场景(如「暂无数据」)——空数据场景应用 Empty 组件"
|
|
73
|
+
],
|
|
74
|
+
"events": {},
|
|
75
|
+
"typescriptPitfalls": [
|
|
76
|
+
{
|
|
77
|
+
"issue": "description 不传 vs 传 undefined 行为一致,传空字符串会渲染空区块",
|
|
78
|
+
"wrong": "description='' // 空字符串被当作 truthy ReactNode 渲染,出现空白区域",
|
|
79
|
+
"right": "// 不传 description 或传 null/undefined 使用默认 i18n 文案\n<Querying /> // 显示默认 '查询中...'"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"issue": "image 传字符串时渲染为 <img src>,传 ReactNode 直接渲染——类型合法但行为不同",
|
|
83
|
+
"wrong": "image={svgComponent} // 若 svgComponent 是字符串路径则渲染 img,若是 JSX 则直接渲染",
|
|
84
|
+
"right": "image={<MySvgIcon />} // 明确传 ReactElement 直接渲染;传 URL 字符串时渲染 img"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"issue": "customQuerying 传入后 image/description/imageStyle 全部失效,不要混传",
|
|
88
|
+
"wrong": "<Querying customQuerying={<MyComp />} description='加载中' /> // description 被忽略",
|
|
89
|
+
"right": "// 要么用 customQuerying 完全接管,要么用 image+description 局部定制,不要混用"
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"mapping": {
|
|
93
|
+
"realComponent": "Querying",
|
|
94
|
+
"adapter": null
|
|
95
|
+
}
|
|
96
|
+
}
|
package/es/Querying/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.paraui-v4-querying{display:inline-flex;flex-direction:column;align-items:center}.paraui-v4-querying>.querying-image{line-height:0
|
|
1
|
+
@charset "UTF-8";.paraui-v4-querying{display:inline-flex;flex-direction:column;align-items:center}.paraui-v4-querying>.querying-image{overflow:hidden;line-height:0}.paraui-v4-querying>.querying-image img{width:100%}.paraui-v4-querying .querying-image-large{width:334px;height:238px}.paraui-v4-querying .querying-image-medium{width:220px;height:150px}.paraui-v4-querying .querying-image-small{width:120px;height:80px}.paraui-v4-querying>.querying-description{font-size:14px;font-weight:400;line-height:17px;color:#1d2126}.paraui-v4-querying.paraui-v4-querying-large>.querying-description{margin-top:20px}.paraui-v4-querying.paraui-v4-querying-medium>.querying-description{margin-top:15px;font-size:14px}.paraui-v4-querying.paraui-v4-querying-small>.querying-description{margin-top:10px;font-size:14px}
|
package/es/Querying/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export interface QueryingProps {
|
|
|
5
5
|
/** style */
|
|
6
6
|
style?: React.CSSProperties;
|
|
7
7
|
/** 尺寸 */
|
|
8
|
-
size?: '
|
|
8
|
+
size?: 'small' | 'medium' | 'large';
|
|
9
9
|
/** 图片样式 */
|
|
10
10
|
imageStyle?: React.CSSProperties;
|
|
11
11
|
/** 图片 */
|
|
@@ -14,7 +14,7 @@ export interface QueryingProps {
|
|
|
14
14
|
description?: React.ReactNode;
|
|
15
15
|
/** 自定义节点 */
|
|
16
16
|
customQuerying?: React.ReactNode;
|
|
17
|
-
[name: string]:
|
|
17
|
+
[name: string]: unknown;
|
|
18
18
|
}
|
|
19
19
|
declare const Querying: FC<QueryingProps>;
|
|
20
20
|
export default Querying;
|
package/es/Querying/index.js
CHANGED
|
@@ -1,43 +1,44 @@
|
|
|
1
1
|
import { j as e } from "../_virtual/jsx-runtime.js";
|
|
2
2
|
import p from "clsx";
|
|
3
|
-
import { SmallSearch as
|
|
3
|
+
import { SmallSearch as f, LargeSearch as a } from "./images/index.js";
|
|
4
4
|
import x from "../GlobalContext/useFormatMessage.js";
|
|
5
5
|
import j from "./lang/index.js";
|
|
6
|
-
import { $prefixCls as
|
|
6
|
+
import { $prefixCls as l } from "../GlobalContext/constant.js";
|
|
7
7
|
import q from "../Hooks/useGlobalProps.js";
|
|
8
8
|
import './index.css';/* empty css */
|
|
9
9
|
const h = {
|
|
10
|
-
large: /* @__PURE__ */ e.jsx(
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
large: /* @__PURE__ */ e.jsx(a, {}),
|
|
11
|
+
medium: /* @__PURE__ */ e.jsx(a, {}),
|
|
12
|
+
small: /* @__PURE__ */ e.jsx(f, {})
|
|
13
|
+
}, z = (t) => {
|
|
13
14
|
const {
|
|
14
|
-
className:
|
|
15
|
-
style:
|
|
15
|
+
className: g,
|
|
16
|
+
style: c,
|
|
16
17
|
size: r = "large",
|
|
17
|
-
imageStyle:
|
|
18
|
+
imageStyle: u,
|
|
18
19
|
image: s = h[r],
|
|
19
|
-
description:
|
|
20
|
+
description: o,
|
|
20
21
|
customQuerying: n
|
|
21
|
-
} = q(
|
|
22
|
-
let
|
|
23
|
-
return typeof s == "string" ?
|
|
22
|
+
} = q(t, "Querying"), y = x("Querying", j), i = typeof o < "u" ? o : y({ id: "querying" }), d = typeof i == "string" ? i : "querying";
|
|
23
|
+
let m = null;
|
|
24
|
+
return typeof s == "string" ? m = /* @__PURE__ */ e.jsx(
|
|
24
25
|
"img",
|
|
25
26
|
{
|
|
26
27
|
src: s,
|
|
27
|
-
alt:
|
|
28
|
+
alt: d
|
|
28
29
|
}
|
|
29
|
-
) :
|
|
30
|
+
) : m = s, /* @__PURE__ */ e.jsx(
|
|
30
31
|
"div",
|
|
31
32
|
{
|
|
32
|
-
className: p(`${
|
|
33
|
-
style:
|
|
33
|
+
className: p(`${l}-querying`, g, `${l}-querying-${r}`),
|
|
34
|
+
style: c,
|
|
34
35
|
children: n || /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
35
36
|
/* @__PURE__ */ e.jsx(
|
|
36
37
|
"div",
|
|
37
38
|
{
|
|
38
|
-
className: `querying-image ${
|
|
39
|
-
style:
|
|
40
|
-
children:
|
|
39
|
+
className: `querying-image ${t?.image ? "" : `querying-image-${r}`}`,
|
|
40
|
+
style: u,
|
|
41
|
+
children: m
|
|
41
42
|
}
|
|
42
43
|
),
|
|
43
44
|
i && /* @__PURE__ */ e.jsx("div", { className: "querying-description", children: i })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.paraui-v4-querying{display:inline-flex;flex-direction:column;align-items:center}.paraui-v4-querying>.querying-image{line-height:0
|
|
1
|
+
.paraui-v4-querying{display:inline-flex;flex-direction:column;align-items:center}.paraui-v4-querying>.querying-image{overflow:hidden;line-height:0}.paraui-v4-querying>.querying-image img{width:100%}.paraui-v4-querying .querying-image-large{width:334px;height:238px}.paraui-v4-querying .querying-image-medium{width:220px;height:150px}.paraui-v4-querying .querying-image-small{width:120px;height:80px}.paraui-v4-querying>.querying-description{font-size:14px;font-weight:400;line-height:17px;color:#1d2126}.paraui-v4-querying.paraui-v4-querying-large>.querying-description{margin-top:20px}.paraui-v4-querying.paraui-v4-querying-medium>.querying-description{margin-top:15px;font-size:14px}.paraui-v4-querying.paraui-v4-querying-small>.querying-description{margin-top:10px;font-size:14px}
|
|
@@ -13,7 +13,7 @@ import { Plus as me } from "../../node_modules/@para-ui/icons/Plus/index.js";
|
|
|
13
13
|
import { Drag as pe } from "../../node_modules/@para-ui/icons/Drag/index.js";
|
|
14
14
|
import { Delete as he } from "../../node_modules/@para-ui/icons/Delete/index.js";
|
|
15
15
|
import { EditOutline as fe } from "../../node_modules/@para-ui/icons/EditOutline/index.js";
|
|
16
|
-
import { UUID as w } from "@
|
|
16
|
+
import { UUID as w } from "@snack-kit/lib";
|
|
17
17
|
import xe from "../../GlobalContext/useFormatMessage.js";
|
|
18
18
|
import ke from "../lang/index.js";
|
|
19
19
|
import './index.css';/* empty css */
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "QuickReply",
|
|
3
|
+
"category": "Data Entry",
|
|
4
|
+
"description": "快捷回复组件,集成预设内容选择浮层+文本编辑区,支持预设列表管理",
|
|
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
|
+
],
|
|
25
|
+
"idealProps": {
|
|
26
|
+
"list": {
|
|
27
|
+
"type": "QuickReplyCodeListProps[]",
|
|
28
|
+
"description": "快捷回复预设列表(QuickReplyCodeListProps = { label?: string; value?: string; [name: string]: any });每项至少需要 rowKey 对应字段(默认 id)作为唯一标识,以及 labelKey 字段(默认 label)作为显示文案"
|
|
29
|
+
},
|
|
30
|
+
"value": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"description": "**输入框文本受控值**(textarea 受控,不是被选中预设项的标识!);与 onChange 配对;**点击预设项时此值会被内部 onSelect handler 自动同步**(src/QuickReply/index.tsx:139-144 取 item[valueKey] 后 setValueCom)"
|
|
33
|
+
},
|
|
34
|
+
"defaultValue": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"description": "输入框非受控初始值"
|
|
37
|
+
},
|
|
38
|
+
"rowKey": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"default": "id",
|
|
41
|
+
"description": "list 项唯一标识字段名(默认 'id',与 React key 无关)"
|
|
42
|
+
},
|
|
43
|
+
"labelKey": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"default": "label",
|
|
46
|
+
"description": "list 项展示文案字段名"
|
|
47
|
+
},
|
|
48
|
+
"valueKey": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"default": "label",
|
|
51
|
+
"description": "list 项实际值字段名;⚠️ **默认 'label' 不是 'value'**——反直觉!这决定了点击预设时 onChange 回参取 list[i] 的哪个字段;若 list 项有 value 字段且想让 onChange 收到业务 code,必须显式 `valueKey='value'`(通过 quickReplyCodeProps 工厂透传给内嵌浮层实例)"
|
|
52
|
+
},
|
|
53
|
+
"rows": {
|
|
54
|
+
"type": "number",
|
|
55
|
+
"description": "输入框行数(textarea rows 属性)"
|
|
56
|
+
},
|
|
57
|
+
"placeholder": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"description": "输入框占位文案(默认 i18n '请输入')"
|
|
60
|
+
},
|
|
61
|
+
"quickReplyCodeProps": {
|
|
62
|
+
"type": "function",
|
|
63
|
+
"signature": "(type: 'select' | 'setting') => QuickReplyCodeProps",
|
|
64
|
+
"description": "工厂函数,分别给选择浮层('select')/ 管理浮层('setting')透传子组件参数(如 valueKey / add / edit / del / sort 等)"
|
|
65
|
+
},
|
|
66
|
+
"renderQuickReplyBtn": {
|
|
67
|
+
"type": "ReactNode",
|
|
68
|
+
"description": "自定义触发按钮节点(默认为「快捷回复」文字按钮)"
|
|
69
|
+
},
|
|
70
|
+
"onChange": {
|
|
71
|
+
"type": "(val: string) => void",
|
|
72
|
+
"description": "**输入框文本变化回调**——两种触发场景共用一个回调:① 用户键入文字 ② **用户点击预设项**(内部 onSelect handler 取 item[valueKey] 后自动调 onChange);所以「点击预设填入输入框」是默认行为,**无需也不存在 QuickReply 顶层 onSelect prop**"
|
|
73
|
+
},
|
|
74
|
+
"onChangeList": {
|
|
75
|
+
"type": "(arr: QuickReplyCodeListProps[]) => void",
|
|
76
|
+
"description": "用户在管理浮层中增删改后触发(注意:QuickReplyCode 子组件自己的同语义回调叫 onChange,QuickReply 顶层叫 onChangeList——跨层级看 onChange 务必区分)"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"do": [
|
|
80
|
+
"在需要快速输入预设内容的场景使用,list 每项至少有 rowKey 字段(默认 id)和 labelKey 字段(默认 label)",
|
|
81
|
+
"支持编辑和管理预设内容——onChangeList 里持久化更新后的 list",
|
|
82
|
+
"valueKey 默认是 'label',若预设项有独立 value 字段(业务 code)且需要 onChange 收到此值,通过 quickReplyCodeProps 显式传 valueKey='value'",
|
|
83
|
+
"value 受控写法:value={text} onChange={(val) => setText(val)}——点击预设或手动输入都触发 onChange"
|
|
84
|
+
],
|
|
85
|
+
"dont": [
|
|
86
|
+
"预设内容过多不做分类——超过 20 条考虑搜索或分组",
|
|
87
|
+
"忽略用户自定义需求——提供管理浮层(onChangeList)让用户自己维护预设",
|
|
88
|
+
"期待 QuickReply 顶层有 onSelect prop(它已封装在内部——点击预设直接触发顶层 onChange,无需 onSelect)",
|
|
89
|
+
"把外部 string[] 直接传给 list(必须 map 成 QuickReplyCodeListProps[] 形状:每项至少有 id 和 label 字段)",
|
|
90
|
+
"假设 onChange 与 onChangeList 等价(onChange 是输入框文本回调 string,onChangeList 是 list 增删改后的数组回调——跨子层级 QuickReplyCode.onChange 又是 list 回调,易混)"
|
|
91
|
+
],
|
|
92
|
+
"events": {
|
|
93
|
+
"onChange": {
|
|
94
|
+
"signature": "(val: string) => void",
|
|
95
|
+
"asyncSupported": false,
|
|
96
|
+
"examples": [
|
|
97
|
+
"受控绑定:value={text} onChange={(val) => setText(val)}",
|
|
98
|
+
"点击预设自动填入:onChange 会在点击预设项时被调用,val = item[valueKey](默认取 item.label)",
|
|
99
|
+
"区分键入与预设选择:无法区分,两种场景均调同一 onChange;如需区分,用 quickReplyCodeProps 工厂中的 onSelect 替换逻辑"
|
|
100
|
+
],
|
|
101
|
+
"commonMistakes": [
|
|
102
|
+
"期望 QuickReply 顶层有 onSelect——点击预设触发的是 onChange,不存在独立的 onSelect",
|
|
103
|
+
"valueKey 默认 'label' 导致 onChange 收到 label 文案而非业务 id——需显式 valueKey='value'",
|
|
104
|
+
"onChange 和 onChangeList 混淆——onChange 是 string 回调(输入框文本),onChangeList 是 QuickReplyCodeListProps[] 回调(预设列表变化)"
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"typescriptPitfalls": [
|
|
109
|
+
{
|
|
110
|
+
"issue": "valueKey 默认 'label' 不是 'value',点击预设后 onChange 收到的是 label 文案",
|
|
111
|
+
"wrong": "// list 有 value 字段但未配 valueKey:\nlist={[{ id: '1', label: '您好', value: 'hello' }]}\n// 点击后 onChange 回传 '您好'(label),不是 'hello'(value)",
|
|
112
|
+
"right": "quickReplyCodeProps={() => ({ valueKey: 'value' })} // 两个浮层实例都透传 valueKey='value'"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"issue": "list 每项必须有 rowKey 对应字段(默认 id),缺少会导致删除/排序等操作异常",
|
|
116
|
+
"wrong": "list={[{ label: '您好' }, { label: '谢谢' }]} // 缺少 id 字段,rowKey 默认 'id'",
|
|
117
|
+
"right": "list={[{ id: '1', label: '您好' }, { id: '2', label: '谢谢' }]}"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"issue": "quickReplyCodeProps 是工厂函数,不是对象,接受 'select'|'setting' 参数",
|
|
121
|
+
"wrong": "quickReplyCodeProps={{ add: false, edit: false }} // TS 报错,类型是函数",
|
|
122
|
+
"right": "quickReplyCodeProps={(type) => type === 'select' ? { add: false } : { add: true, edit: true }}"
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
"mapping": {
|
|
126
|
+
"realComponent": "QuickReply",
|
|
127
|
+
"adapter": null
|
|
128
|
+
}
|
|
129
|
+
}
|
package/es/QuickReply/index.d.ts
CHANGED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Radio",
|
|
3
|
+
"category": "Data Entry",
|
|
4
|
+
"description": "单选框,用于在多个选项中选择一个,支持受控/非受控及 disabled tooltip",
|
|
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
|
+
"group": {
|
|
22
|
+
"meaning": "单选框组"
|
|
23
|
+
},
|
|
24
|
+
"button": {
|
|
25
|
+
"meaning": "按钮样式单选"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"states": [
|
|
29
|
+
"checked",
|
|
30
|
+
"unchecked",
|
|
31
|
+
"disabled"
|
|
32
|
+
],
|
|
33
|
+
"idealProps": {
|
|
34
|
+
"checked": {
|
|
35
|
+
"type": "boolean",
|
|
36
|
+
"description": "受控选中态;父维护 state · 互斥实现:`checked={selectedValue === thisValue}`;**onChange 仅 unchecked → checked 单向触发**(单选框选中后无法 UI 取消)"
|
|
37
|
+
},
|
|
38
|
+
"defaultChecked": {
|
|
39
|
+
"type": "boolean",
|
|
40
|
+
"description": "非受控初始选中态;首次渲染后内部维护;onChange 仍单向触发"
|
|
41
|
+
},
|
|
42
|
+
"disabled": {
|
|
43
|
+
"type": "boolean",
|
|
44
|
+
"default": false,
|
|
45
|
+
"description": "禁用(无法点击/触发 onChange);**本组件无 readOnly prop**,只读场景用 disabled+CSS 灰度覆盖"
|
|
46
|
+
},
|
|
47
|
+
"label": {
|
|
48
|
+
"type": "ReactNode",
|
|
49
|
+
"description": "标题文案;支持 ReactNode(AutoTips 包裹可实现超长截断+hover 显示完整,详见 codeString.ts labelOverflowRadio)"
|
|
50
|
+
},
|
|
51
|
+
"labelTooltip": {
|
|
52
|
+
"type": "LabelTooltipProps",
|
|
53
|
+
"description": "**帮助图标式 tooltip**:label 旁渲染 ? 图标 · hover 显示 tooltip;**不是文字截断省略**(截断需配 AutoTips 包 label · 见 codeString.ts)"
|
|
54
|
+
},
|
|
55
|
+
"width": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"description": "组件外层容器宽度;常用配合 label 截断(`width='100px'`)"
|
|
58
|
+
},
|
|
59
|
+
"onChange": {
|
|
60
|
+
"type": "(e: React.MouseEvent<HTMLLabelElement>, checked: boolean) => void",
|
|
61
|
+
"description": "选中态变化回调(src/Radio/index.tsx:38 interface 实证,签名为 MouseEvent on HTMLLabelElement,非 ChangeEvent);**仅在 unchecked → checked 单向触发一次**;第二参数 checked = 切换后的新状态(本组件场景下永远为 true)"
|
|
62
|
+
},
|
|
63
|
+
"size": {
|
|
64
|
+
"type": "enum",
|
|
65
|
+
"values": ["small", "medium", "large"],
|
|
66
|
+
"default": "large",
|
|
67
|
+
"description": "单选框大小(src/Radio/index.tsx:24,46,77 实证:default='large';控制 CSS 类 paraui-v4-radio-{size})"
|
|
68
|
+
},
|
|
69
|
+
"disabledTooltip": {
|
|
70
|
+
"type": "TooltipProps",
|
|
71
|
+
"description": "禁用状态下的 Tooltip 配置(src/Radio/index.tsx:34-35,136-142 实证:disabled 时将整个 Radio 包裹在 Tooltip 内,透传全部 TooltipProps,字段名 `title` 作为提示内容)"
|
|
72
|
+
},
|
|
73
|
+
"inputProps": {
|
|
74
|
+
"type": "React.InputHTMLAttributes<HTMLInputElement>",
|
|
75
|
+
"description": "内层原生 radio input 的额外 props(src/Radio/index.tsx:36,118 实证:透传到 `<input type='radio' {...props.inputProps} />`,可用于设置 name/value 等原生属性)"
|
|
76
|
+
},
|
|
77
|
+
"className": {
|
|
78
|
+
"type": "string",
|
|
79
|
+
"description": "自定义类名(src/Radio/index.tsx:14,43 实证,追加到根 label 元素的 className)"
|
|
80
|
+
},
|
|
81
|
+
"style": {
|
|
82
|
+
"type": "React.CSSProperties",
|
|
83
|
+
"description": "自定义样式(src/Radio/index.tsx:16,51,102 实证,透传到根 label 元素的 style;与 width prop 合并)"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"do": [
|
|
87
|
+
"选项较少(< 5)时优先展示所有选项而非使用 Select",
|
|
88
|
+
"Radio Group 能够清晰展示所有可用选项",
|
|
89
|
+
"**多 Radio 互斥**:父维护 `useState<string> selectedValue` · 每个 Radio 用 `checked={selectedValue === thisValue}` + onChange 触发后 `setSelectedValue(thisValue)`(完整示例见 docs/view/radio/codeString.ts multiRadioGroup)",
|
|
90
|
+
"**label 超长截断 + hover 完整显示**:用 `AutoTips` 包 label,如 `<Radio label={<AutoTips tipMaxWidth='none'>超长 label</AutoTips>} width='180px' />`"
|
|
91
|
+
],
|
|
92
|
+
"dont": [
|
|
93
|
+
"在可以多选的场景使用 Radio",
|
|
94
|
+
"Radio 选中后无法取消(设计上应保持选中状态;若需 on/off 切换语义请用 Checkbox)",
|
|
95
|
+
"**期望 onChange 在选中后再次点击会再触发(单向触发,只在 unchecked → checked 触发一次)**",
|
|
96
|
+
"**依赖 labelTooltip 实现 label 文字截断省略**(labelTooltip 只是 ? 帮助图标 tooltip · 不截断;截断用 AutoTips 包 label)",
|
|
97
|
+
"**期望 Radio 有 readOnly prop**(无;只读用 disabled + CSS)"
|
|
98
|
+
],
|
|
99
|
+
"events": {
|
|
100
|
+
"onChange": {
|
|
101
|
+
"signature": "(e: React.MouseEvent<HTMLLabelElement>, checked: boolean) => void",
|
|
102
|
+
"asyncSupported": false,
|
|
103
|
+
"examples": [
|
|
104
|
+
"受控互斥:onChange={(e, checked) => { if (checked) setSelectedValue(thisValue); }}",
|
|
105
|
+
"非受控监听:onChange={(e, checked) => console.log('选中', checked)} // checked 永远为 true",
|
|
106
|
+
"阻止冒泡:onChange={(e, checked) => { e.stopPropagation(); setSelected(checked); }}"
|
|
107
|
+
],
|
|
108
|
+
"commonMistakes": [
|
|
109
|
+
"期望回调签名是 (e: ChangeEvent<HTMLInputElement>) → 实际是 MouseEvent<HTMLLabelElement>,监听 e.target 行为不同",
|
|
110
|
+
"期望 checked 参数可以是 false(已选后再次点击)——onChange 只在 unchecked→checked 触发,checked 永远为 true",
|
|
111
|
+
"用 onChange 做「取消选中」逻辑——Radio 无法通过点击取消选中;需要 toggle 语义请用 Checkbox"
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"typescriptPitfalls": [
|
|
116
|
+
{
|
|
117
|
+
"issue": "onChange 签名是 MouseEvent on HTMLLabelElement,不是 ChangeEvent<HTMLInputElement>",
|
|
118
|
+
"wrong": "onChange={(e: React.ChangeEvent<HTMLInputElement>) => setValue(e.target.checked)} // 类型不匹配",
|
|
119
|
+
"right": "onChange={(e: React.MouseEvent<HTMLLabelElement>, checked: boolean) => { if (checked) setValue(thisValue); }}"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"issue": "disabledTooltip 的类型是 TooltipProps(完整对象),不是字符串",
|
|
123
|
+
"wrong": "disabledTooltip='此项不可选' // 类型报错,应传对象",
|
|
124
|
+
"right": "disabledTooltip={{ title: '此项不可选', placement: 'top' }}"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"issue": "size 默认值是 'large'(不是 'medium'),与 antd/MUI 业界惯例不同",
|
|
128
|
+
"wrong": "// 不传 size 期望得到中等大小\n<Radio label='选项' /> // 实际渲染 large 尺寸",
|
|
129
|
+
"right": "<Radio label='选项' size='medium' /> // 明确指定 size 避免布局意外"
|
|
130
|
+
}
|
|
131
|
+
],
|
|
132
|
+
"mapping": {
|
|
133
|
+
"realComponent": "Radio",
|
|
134
|
+
"adapter": null
|
|
135
|
+
}
|
|
136
|
+
}
|