@para-ui/core 5.0.0-beta.9 → 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/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.js +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/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.js +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/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,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ExpressionInput",
|
|
3
|
+
"category": "数据录入",
|
|
4
|
+
"description": "单行表达式变量自动补全输入框,默认要求 {{ }} 包裹触发,候选数据完全由业务方通过 resolveCandidates 注入。",
|
|
5
|
+
"semantic": {
|
|
6
|
+
"intent": ["在文本中输入引用变量的表达式", "按命名空间层级下钻选择变量"],
|
|
7
|
+
"useCases": ["脚本/配置里引用运行时变量", "低代码画布属性面板里的表达式绑定"],
|
|
8
|
+
"riskLevel": "low"
|
|
9
|
+
},
|
|
10
|
+
"variants": {
|
|
11
|
+
"braces": { "meaning": "默认触发模式,要求光标位于 {{ }} 区间内才弹出候选" },
|
|
12
|
+
"bare": { "meaning": "不要求大括号包裹,任意位置匹配 triggerPrefix 即弹出候选" }
|
|
13
|
+
},
|
|
14
|
+
"states": ["default", "focus", "disabled", "readOnly", "popup-open"],
|
|
15
|
+
"idealProps": {
|
|
16
|
+
"value": { "type": "string", "description": "受控值", "required": false },
|
|
17
|
+
"onChange": { "type": "function", "description": "值变化回调", "signature": "(value: string) => void" },
|
|
18
|
+
"resolveCandidates": {
|
|
19
|
+
"type": "function",
|
|
20
|
+
"description": "按命名空间路径返回该层级的完整候选列表,组件内部按 parts 缓存",
|
|
21
|
+
"signature": "(parts: string[]) => ExprCandidate[]",
|
|
22
|
+
"required": true
|
|
23
|
+
},
|
|
24
|
+
"triggerMode": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "触发匹配机制",
|
|
27
|
+
"values": ["braces", "bare"],
|
|
28
|
+
"default": "braces"
|
|
29
|
+
},
|
|
30
|
+
"triggerPrefix": { "type": "string", "description": "触发前缀符号", "default": "$" },
|
|
31
|
+
"virtualizeThreshold": { "type": "number", "description": "候选数超过该阈值启用虚拟滚动", "default": "50" },
|
|
32
|
+
"renderPopupHeader": {
|
|
33
|
+
"type": "function",
|
|
34
|
+
"description": "自定义浮层 header 文案",
|
|
35
|
+
"signature": "(ctx: ExprChainCtx, count: number) => React.ReactNode",
|
|
36
|
+
"required": false
|
|
37
|
+
},
|
|
38
|
+
"expressionTooltip": {
|
|
39
|
+
"type": "ReactNode",
|
|
40
|
+
"description": "表达式说明 tooltip 文案,不传则不展示;仅当 value 命中表达式格式(braces/bare)时 hover/focus 才弹出",
|
|
41
|
+
"required": false
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"commonMisconceptions": [
|
|
45
|
+
"以为 resolveCandidates 每次按键都会被调用——实际只有下钻/回退到新的命名空间层级时才调用,同层级内逐字过滤是客户端完成的",
|
|
46
|
+
"以为默认触发不需要 {{ }} 包裹——默认 triggerMode 是 'braces',裸写 $.xxx 不会触发,需要显式传 triggerMode='bare' 才对齐 Ditto 原始行为",
|
|
47
|
+
"以为传入的 candidate.value 可以是任意字符串——实际必须是合法标识符字符([A-Za-z0-9_$]),否则插入后再次解析会被截断",
|
|
48
|
+
"以为 expressionTooltip 会随打字实时弹出/消失——实际是否命中只在 hover/focus 触发那一刻判定,光标停留期间继续输入使 value 从未命中变为命中不会自动弹出,需要重新 hover/focus",
|
|
49
|
+
"以为花括号着色和 expressionTooltip 用同一套判定标准——实际着色只看 {{ }} 是否配对闭合,不校验内容合法性,门槛比 expressionTooltip 低,{{$.}} 这类值会着色但不会弹出 tooltip,两者可能不一致,这是预期行为"
|
|
50
|
+
],
|
|
51
|
+
"do": [
|
|
52
|
+
"为需要继续下钻子级的候选项设置 chain: true,让选中后自动追加 . 方便连续输入",
|
|
53
|
+
"为敏感字段设置 sensitive: true,组件会自动展示锁图标",
|
|
54
|
+
"在 Modal/Drawer 中使用时无需额外处理,组件内部已对接 usePopupContainer 自动寻找最近可滚动祖先容器"
|
|
55
|
+
],
|
|
56
|
+
"dont": [
|
|
57
|
+
"不要在 resolveCandidates 内部做未做缓存的重量级计算并假设组件会防抖——组件只在 parts 变化时调用一次,但单次调用本身仍需业务方保证足够快",
|
|
58
|
+
"不要给多个实例传相同的 DOM id 或手动操作 document.body 上的浮层 — 组件已经用 UUID 做了实例隔离"
|
|
59
|
+
],
|
|
60
|
+
"events": {
|
|
61
|
+
"onChange": {
|
|
62
|
+
"signature": "(value: string) => void",
|
|
63
|
+
"asyncSupported": false,
|
|
64
|
+
"examples": ["受控更新 value 状态"],
|
|
65
|
+
"commonMistakes": ["忘记把新 value 传回 props.value,导致组件表现为不可编辑"]
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"typescriptPitfalls": [
|
|
69
|
+
{
|
|
70
|
+
"issue": "resolveCandidates 类型签名从 ChainCtx 变成了 parts: string[]",
|
|
71
|
+
"wrong": "resolveCandidates={(ctx) => ctx.partial ? [] : rootCandidates}",
|
|
72
|
+
"right": "resolveCandidates={(parts) => parts.length === 0 ? rootCandidates : []}"
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"mapping": {
|
|
76
|
+
"realComponent": "ExpressionInput",
|
|
77
|
+
"adapter": "无,直接使用"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** partial 片段本身允许出现的字符(不含 .) */
|
|
2
|
+
export declare const ID_TAIL: RegExp;
|
|
3
|
+
export interface DetectChainOptions {
|
|
4
|
+
triggerPrefix: string;
|
|
5
|
+
triggerMode: 'braces' | 'bare';
|
|
6
|
+
}
|
|
7
|
+
export interface ChainResult {
|
|
8
|
+
/** 链路在原文本中的起始下标(含前缀符号) */
|
|
9
|
+
startIdx: number;
|
|
10
|
+
/** 链路在原文本中的结束下标(即光标位置) */
|
|
11
|
+
endIdx: number;
|
|
12
|
+
/** 已确定的上级片段 */
|
|
13
|
+
parts: string[];
|
|
14
|
+
/** 正在输入的片段 */
|
|
15
|
+
partial: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function detectChainAtCursor(text: string, cursor: number, options: DetectChainOptions): ChainResult | null;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=/[A-Za-z0-9_$]/;function x(t){const e=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`[A-Za-z0-9_.${e}]`)}function I(t,e){const i=t.slice(0,e),r=i.lastIndexOf("{{");if(r===-1||i.lastIndexOf("}}")>r)return!1;const o=t.slice(e),n=o.indexOf("}}"),s=o.indexOf("{{");return n===-1?!0:!(s!==-1&&s<n)}function h(t,e,i){const{triggerPrefix:r,triggerMode:c}=i;if(c==="braces"&&!I(t,e))return null;const o=x(r);let n=e;for(;n>0&&o.test(t[n-1]);)n-=1;const s=t.slice(n,e),f=`${r}.`;if(!s.startsWith(f))return null;const a=s.slice(f.length),u=a.length>0?a.split("."):[""],l=u.pop(),g=u;return l.length>0&&!l.split("").every(p=>d.test(p))?null:{startIdx:n,endIdx:e,parts:g,partial:l}}exports.ID_TAIL=d;exports.detectChainAtCursor=h;
|
|
2
|
+
//# sourceMappingURL=detectChainAtCursor.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function a(e,t){if(!t)return e;const r=t.toLowerCase();return e.filter(l=>{if(l.value.toLowerCase().startsWith(r))return!0;const o=l.label?.toLowerCase();return!!o&&o.includes(r)})}exports.filterCandidatesByPartial=a;
|
|
2
|
+
//# sourceMappingURL=filterCandidatesByPartial.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=/\{\{[^{}]*\}\}/g;function g(e){if(!e)return[];const h=[];let i=0,t;for(n.lastIndex=0;(t=n.exec(e))!==null;)t.index>i&&h.push({text:e.slice(i,t.index),highlight:!1}),h.push({text:t[0],highlight:!0}),i=t.index+t[0].length;return i<e.length&&h.push({text:e.slice(i),highlight:!1}),h}exports.highlightSegments=g;
|
|
2
|
+
//# sourceMappingURL=highlightSegments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";.paraui-v4-expression-input{display:inline-block;width:100%}.paraui-v4-expression-input input{position:relative;z-index:1;color:transparent!important;caret-color:#1d2126!important}.paraui-v4-expression-input-overlay{position:absolute;inset:0;z-index:0;overflow:hidden;color:#1d2126;white-space:pre;pointer-events:none}.paraui-v4-expression-input-overlay-highlight{color:#2e65e6}.paraui-v4-expression-input-popup{z-index:1500;min-width:280px;overflow:hidden;background:#fff;border:1px solid rgb(212,218,227);border-radius:4px;box-shadow:0 2px 8px #d4dae366}.paraui-v4-expression-input-popup-header{padding:6px 12px;font-size:12px;color:#a1a8b3;border-bottom:1px solid rgb(234,236,241)}.paraui-v4-expression-input-popup-list{padding:4px 0}.paraui-v4-expression-input-popup-item{display:flex;align-items:center;padding:0 12px;font-size:14px;color:#1d2126;white-space:nowrap;cursor:pointer}.paraui-v4-expression-input-popup-item-active{color:#2e65e6;background:#f0f5ff}.paraui-v4-expression-input-popup-item-value{flex:0 0 auto;margin-right:8px}.paraui-v4-expression-input-popup-item-desc{flex:1 1 auto;overflow:hidden;font-size:12px;color:#a1a8b3;text-overflow:ellipsis}.paraui-v4-expression-input-popup-item-lock{flex:0 0 auto;margin-left:8px;font-size:16px;color:#a1a8b3}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index.css');const a=require("../_virtual/jsx-runtime.js");;/* empty css */const J=require("react"),Q=require("react-dom"),Y=require("@snack-kit/lib"),ee=require("../TextField/index.js"),te=require("../Tooltip/index.js"),ne=require("../GlobalContext/usePopupContainer.js"),re=require("../GlobalContext/useFormatMessage.js"),T=require("../GlobalContext/constant.js"),oe=require("./useExpressionInput.js"),se=require("./Popup.js"),ie=require("./isExpressionValue.js"),ue=require("./highlightSegments.js"),le=require("./HighlightOverlay.js"),ce=require("./lang/index.js");function _(s){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const i in s)if(i!=="default"){const d=Object.getOwnPropertyDescriptor(s,i);Object.defineProperty(r,i,d.get?d:{enumerable:!0,get:()=>s[i]})}}return r.default=s,Object.freeze(r)}const n=_(J),O=_(Q),ae=50,de="$",pe=s=>{const{value:r,onChange:i,resolveCandidates:d,triggerMode:v="braces",triggerPrefix:g=de,virtualizeThreshold:D=ae,renderPopupHeader:S,expressionTooltip:h,disabled:y,readOnly:P,className:R,...w}=s,z=re.default("ExpressionInput",ce.default),[x]=n.useState(()=>`${T.$prefixCls}-expression-input-${Y.UUID()}`),o=n.useRef(null),b=n.useRef(null),F=n.useRef({getRootDomNode:()=>o.current}),I=ne.default(F),[M,$]=n.useState({top:0,left:0,width:0}),c=n.useRef(null),[q,H]=n.useState(null),[U,N]=n.useState({}),V=n.useMemo(()=>ue.highlightSegments(r??""),[r]),{open:u,ctx:p,candidates:E,highlight:W,setHighlight:k,handleValueChange:A,handleKeyDown:B,handleSelect:K,close:L,pendingCursorRef:m}=oe.useExpressionInput({value:r??"",onChange:i,resolveCandidates:d,triggerMode:v,triggerPrefix:g,disabled:y,readOnly:P}),l=n.useCallback(()=>{const e=o.current?.querySelector("input, textarea");if(!e)return;const t=e.getBoundingClientRect();$({top:t.bottom+4,left:t.left,width:Math.max(t.width,280)})},[]),f=n.useCallback(()=>{const e=o.current?.querySelector("input, textarea");if(!e)return;H(e.parentElement);const t=window.getComputedStyle(e);N({paddingTop:t.paddingTop,paddingRight:t.paddingRight,paddingBottom:t.paddingBottom,paddingLeft:t.paddingLeft,fontFamily:t.fontFamily,fontSize:t.fontSize,fontWeight:t.fontWeight,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,boxSizing:t.boxSizing,borderWidth:t.borderWidth,borderStyle:t.borderStyle,borderColor:"transparent"})},[]);n.useLayoutEffect(()=>(f(),window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)),[f]),n.useEffect(()=>{const e=o.current?.querySelector("input, textarea");if(!e)return;const t=()=>{c.current&&(c.current.scrollLeft=e.scrollLeft)};return e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)},[]),n.useEffect(()=>{const e=o.current?.querySelector("input, textarea");e&&c.current&&(c.current.scrollLeft=e.scrollLeft)},[r]),n.useEffect(()=>{const e=m.current;if(e===null)return;const t=o.current?.querySelector("input, textarea");t&&(t.focus(),t.setSelectionRange(e,e)),m.current=null},[r,m]),n.useEffect(()=>{if(u)return l(),window.addEventListener("scroll",l,!0),window.addEventListener("resize",l),()=>{window.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l)}},[u,l]),n.useEffect(()=>{if(!u)return;const e=t=>{const j=t.target;o.current?.contains(j)||b.current?.contains(j)||L()};return document.addEventListener("mousedown",e,!0),()=>document.removeEventListener("mousedown",e,!0)},[u,L,x]);const G=e=>{const t=e.target.selectionStart??e.target.value.length;A(e.target.value,t)},X=p?S?S(p,E.length):z({id:"header"},{path:p.parts.length?p.parts.join("."):g,count:E.length}):null,Z=!!h&&ie.isExpressionValue(r??"",g,v),C=a.jsxRuntimeExports.jsx(ee.TextField,{...w,value:r,disabled:y,onChange:G,onKeydown:e=>{B(e),w.onKeydown?.(e)}});return a.jsxRuntimeExports.jsxs("div",{ref:o,className:`${T.$prefixCls}-expression-input ${x}${R?` ${R}`:""}`,children:[h?a.jsxRuntimeExports.jsx(te.Tooltip,{title:h,trigger:["hover","focus"],...Z?{}:{visible:!1},children:C}):C,q&&O.createPortal(a.jsxRuntimeExports.jsx(le.default,{ref:c,segments:V,style:U}),q),u&&o.current&&O.createPortal(a.jsxRuntimeExports.jsx(se.Popup,{ref:b,instanceClass:x,visible:u,rect:M,header:X,candidates:E,highlight:W,virtualizeThreshold:D,onSelect:K,onHighlightChange:k}),I(o.current))]})};exports.default=pe;
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { TextFieldProps } from '../TextField';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface ExprCandidate {
|
|
4
|
+
/** 插入表达式时使用的实际值 */
|
|
5
|
+
value: string;
|
|
6
|
+
/** 展示用名称,不传则显示 value */
|
|
7
|
+
label?: string;
|
|
8
|
+
/** 右侧描述文案 */
|
|
9
|
+
desc?: string;
|
|
10
|
+
/** 选中后是否自动追加 `.` 以便继续下钻子级 */
|
|
11
|
+
chain?: boolean;
|
|
12
|
+
/** 是否为敏感字段,展示锁图标 */
|
|
13
|
+
sensitive?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface ExprChainCtx {
|
|
16
|
+
/** 当前光标所在链路中,已确定的上级片段(不含正在输入的部分) */
|
|
17
|
+
parts: string[];
|
|
18
|
+
/** 当前正在输入、尚未确定的片段 */
|
|
19
|
+
partial: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ExpressionInputProps extends Omit<TextFieldProps, 'value' | 'onChange'> {
|
|
22
|
+
value?: string;
|
|
23
|
+
onChange?: (value: string) => void;
|
|
24
|
+
/**
|
|
25
|
+
* 只读态,输入触发前缀时不弹出候选浮层。
|
|
26
|
+
* 注:仓库现有 TextField 无 readOnly 能力,该态仅影响候选弹出逻辑,不改变输入框本身的可编辑外观。
|
|
27
|
+
*/
|
|
28
|
+
readOnly?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* 按当前命名空间路径(不含正在输入的 partial)返回该层级的完整候选列表。
|
|
31
|
+
* 仅在 parts 变化(下钻/回退层级)时调用,组件内部按 parts 缓存结果;
|
|
32
|
+
* 同层级内继续输入 partial 只做客户端过滤,不会重复调用。
|
|
33
|
+
*/
|
|
34
|
+
resolveCandidates: (parts: string[]) => ExprCandidate[];
|
|
35
|
+
/**
|
|
36
|
+
* 触发匹配机制,默认 'braces':仅当光标位于 `{{ }}` 区间内且内容匹配
|
|
37
|
+
* `{prefix}.xxx` 才弹窗。'bare':不要求大括号包裹,对齐 Ditto 原始行为。
|
|
38
|
+
*/
|
|
39
|
+
triggerMode?: 'braces' | 'bare';
|
|
40
|
+
/** 触发表达式补全的前缀符号,默认 '$' */
|
|
41
|
+
triggerPrefix?: string;
|
|
42
|
+
/** 候选数量超过该阈值时启用虚拟滚动,默认 50 */
|
|
43
|
+
virtualizeThreshold?: number;
|
|
44
|
+
/** 自定义浮层 header 文案(面包屑 + 数量 + 快捷键提示),不传则使用默认 i18n 文案 */
|
|
45
|
+
renderPopupHeader?: (ctx: ExprChainCtx, count: number) => React.ReactNode;
|
|
46
|
+
/**
|
|
47
|
+
* 表达式说明 tooltip 文案,不传则不展示;仅当 value 命中表达式格式(braces/bare)时,hover/focus 输入框才会真正弹出。
|
|
48
|
+
* 注:是否命中只在触发 hover/focus 那一刻判定,若光标停留期间继续输入使 value 从未命中变为命中,
|
|
49
|
+
* 不会自动弹出,需要重新 hover/focus 才会展示——这是已知的边界行为,非 bug。
|
|
50
|
+
*/
|
|
51
|
+
expressionTooltip?: React.ReactNode;
|
|
52
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./detectChainAtCursor.js");function i(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function o(e){const r=i(e),t=`${s.ID_TAIL.source}+`;return`${r}\\.${t}(?:\\.${t})*`}function c(e,r,t){if(!e)return!1;const n=o(r);return t==="braces"?new RegExp(`\\{\\{\\s*${n}\\s*\\}\\}`).test(e):new RegExp(n).test(e)}exports.isExpressionValue=c;
|
|
2
|
+
//# sourceMappingURL=isExpressionValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.paraui-v4-expression-input{display:inline-block;width:100%}.paraui-v4-expression-input input{position:relative;z-index:1;color:rgba(0,0,0,0) !important;caret-color:#1d2126 !important}.paraui-v4-expression-input-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;overflow:hidden;color:#1d2126;white-space:pre;pointer-events:none}.paraui-v4-expression-input-overlay-highlight{color:#2e65e6}.paraui-v4-expression-input-popup{z-index:1500;min-width:280px;overflow:hidden;background:#fff;border:1px solid #d4dae3;border-radius:4px;box-shadow:0px 2px 8px 0px rgba(212,218,227,.4)}.paraui-v4-expression-input-popup-header{padding:6px 12px;font-size:12px;color:#a1a8b3;border-bottom:1px solid #eaecf1}.paraui-v4-expression-input-popup-list{padding:4px 0}.paraui-v4-expression-input-popup-item{display:flex;align-items:center;padding:0 12px;font-size:14px;color:#1d2126;white-space:nowrap;cursor:pointer}.paraui-v4-expression-input-popup-item-active{color:#2e65e6;background:#f0f5ff}.paraui-v4-expression-input-popup-item-value{flex:0 0 auto;margin-right:8px}.paraui-v4-expression-input-popup-item-desc{flex:1 1 auto;overflow:hidden;font-size:12px;color:#a1a8b3;text-overflow:ellipsis}.paraui-v4-expression-input-popup-item-lock{flex:0 0 auto;margin-left:8px;font-size:16px;color:#a1a8b3}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.css';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ExprCandidate, ExprChainCtx } from './interface';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface UseExpressionInputOptions {
|
|
4
|
+
value: string;
|
|
5
|
+
onChange?: (value: string) => void;
|
|
6
|
+
resolveCandidates: (parts: string[]) => ExprCandidate[];
|
|
7
|
+
triggerMode: 'braces' | 'bare';
|
|
8
|
+
triggerPrefix: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
readOnly?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface UseExpressionInputResult {
|
|
13
|
+
open: boolean;
|
|
14
|
+
ctx: ExprChainCtx | null;
|
|
15
|
+
candidates: ExprCandidate[];
|
|
16
|
+
highlight: number;
|
|
17
|
+
/** 手动指定当前高亮索引,供鼠标移入候选行时与键盘 ArrowUp/Down 共享同一份高亮状态,避免出现两套独立高亮源 */
|
|
18
|
+
setHighlight: (index: number) => void;
|
|
19
|
+
/** 插入候选后期望的光标落点(相对新 value 的下标),供 Task 6 index.tsx 把光标设置到实际 DOM input 上;未处于"刚插入"状态时为 null */
|
|
20
|
+
pendingCursorRef: React.MutableRefObject<number | null>;
|
|
21
|
+
handleValueChange: (nextValue: string, cursor: number) => void;
|
|
22
|
+
handleKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
23
|
+
handleSelect: (candidate: ExprCandidate) => void;
|
|
24
|
+
close: () => void;
|
|
25
|
+
}
|
|
26
|
+
export declare function useExpressionInput(options: UseExpressionInputOptions): UseExpressionInputResult;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("react"),R=require("./detectChainAtCursor.js"),$=require("./filterCandidatesByPartial.js");function A(s){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const a in s)if(a!=="default"){const o=Object.getOwnPropertyDescriptor(s,a);Object.defineProperty(l,a,o.get?o:{enumerable:!0,get:()=>s[a]})}}return l.default=s,Object.freeze(l)}const r=A(P);function E(s){const{value:l,onChange:a,resolveCandidates:o,triggerMode:y,triggerPrefix:u,disabled:p,readOnly:g}=s,[t,i]=r.useState(null),[h,f]=r.useState(0),S=r.useRef(new Map),k=r.useRef(null),m=r.useMemo(()=>{if(!t)return[];const e=t.parts.join("."),n=S.current;return n.has(e)||n.set(e,o(t.parts)),n.get(e)},[t,o]),c=r.useMemo(()=>t?$.filterCandidatesByPartial(m,t.partial):[],[m,t]),C=!p&&!g&&!!t&&c.length>0,j=r.useCallback((e,n)=>{if(p||g){i(null);return}a?.(e);const b=R.detectChainAtCursor(e,n,{triggerPrefix:u,triggerMode:y});i(b),f(0)},[a,p,g,u,y]),w=r.useCallback(()=>i(null),[]),d=r.useCallback(e=>{if(!t)return;const n=l.slice(0,t.startIdx),b=l.slice(t.endIdx),M=[...t.parts,e.value].join("."),D=`${u}.${M}${e.chain?".":""}`;k.current=n.length+D.length,a?.(`${n}${D}${b}`),i(null)},[t,l,a,u]),x=r.useCallback(e=>{C&&(e.key==="ArrowDown"?(e.preventDefault(),f(n=>(n+1)%c.length)):e.key==="ArrowUp"?(e.preventDefault(),f(n=>(n-1+c.length)%c.length)):e.key==="Enter"||e.key==="Tab"?(e.preventDefault(),d(c[h])):e.key==="Escape"&&(e.preventDefault(),i(null)))},[C,c,h,d]),O=r.useCallback(e=>{d(e)},[d]);return{open:C,ctx:t?{parts:t.parts,partial:t.partial}:null,candidates:c,highlight:h,setHighlight:f,pendingCursorRef:k,handleValueChange:j,handleKeyDown:x,handleSelect:O,close:w}}exports.useExpressionInput=E;
|
|
2
|
+
//# sourceMappingURL=useExpressionInput.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../_virtual/jsx-runtime.js"),n=require("react"),F=require("../../_virtual/
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../../_virtual/jsx-runtime.js"),n=require("react"),F=require("../../_virtual/index.js"),H=require("rc-util/lib/Dom/isVisible"),N=require("rc-util/lib/hooks/useLayoutEffect"),h=require("../context.js"),O=require("../FormItemLabel.js"),T=require("../FormItemInput.js"),V=require("./StatusProvider.js");function W(a){const{className:p,style:b,helperText:o,errors:c,warnings:d,status:e,hidden:j,children:y,fieldId:r,required:q,onSubItemMetaChange:S,layout:m,hideLabel:v,hideError:E,noSpacing:I,label:R,labelProps:C,labelAlign:L,colon:M,labelWidth:P,labelWrap:_}=a,{prefixCls:i,layout:x}=n.useContext(h.FormContext),l=n.useMemo(()=>m??x,[m,x]),s=n.useRef(null),f=!!(o!=null||c.length||d.length),$=!!s.current&&H(s.current),[w,g]=n.useState(null);N(()=>{if(f&&s.current){const u=getComputedStyle(s.current);g(parseInt(u.marginBottom,10))}},[f,$]);const B=u=>{u||g(null)};return t.jsxRuntimeExports.jsx(V.default,{...a,prefixCls:i,children:t.jsxRuntimeExports.jsxs("div",{className:F.default(p,`${i}-item`,{[`${i}-item__${r}`]:r,"is-success":e==="success","is-warning":e==="warning","is-error":e==="error","is-validating":e==="validating","is-hidden":j,[`is-${l}`]:l}),style:b,children:[t.jsxRuntimeExports.jsx(O.default,{fieldId:r,label:R,labelWidth:P,labelWrap:_,labelAlign:L,colon:M,labelProps:{required:q,...C},hideLabel:v,layout:l}),t.jsxRuntimeExports.jsx(T.default,{fieldId:r,errors:c,warnings:d,status:e,helperText:o,marginBottom:w,onErrorVisibleChanged:B,hideError:E,noSpacing:I,children:t.jsxRuntimeExports.jsx(h.NoStyleItemContext.Provider,{value:S,children:y})})]})})}exports.default=W;
|
|
2
2
|
//# sourceMappingURL=ItemHolder.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
interface MemoInputProps {
|
|
3
3
|
control: object;
|
|
4
|
-
update:
|
|
4
|
+
update: unknown;
|
|
5
5
|
children: React.ReactNode;
|
|
6
|
-
childProps:
|
|
6
|
+
childProps: unknown[];
|
|
7
7
|
}
|
|
8
8
|
declare const _default: React.MemoExoticComponent<({ children }: MemoInputProps) => JSX.Element>;
|
|
9
9
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../../_virtual/jsx-runtime.js"),l=require("react"),j=require("../../node_modules/@para-ui/icons/Loading/index.js"),C=require("../../node_modules/@para-ui/icons/CheckCircleF/index.js"),g=require("../../node_modules/@para-ui/icons/CloseCircleF/index.js"),k=require("../../node_modules/@para-ui/icons/WarningCircleF/index.js"),v=require("../../_virtual/
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../../_virtual/jsx-runtime.js"),l=require("react"),j=require("../../node_modules/@para-ui/icons/Loading/index.js"),C=require("../../node_modules/@para-ui/icons/CheckCircleF/index.js"),g=require("../../node_modules/@para-ui/icons/CloseCircleF/index.js"),k=require("../../node_modules/@para-ui/icons/WarningCircleF/index.js"),v=require("../../_virtual/index.js"),x=require("../context.js"),$=require("../util.js"),S={success:C.CheckCircleF,warning:k.WarningCircleF,error:g.CloseCircleF,validating:j.Loading};function R({children:I,errors:r,warnings:s,hasFeedback:e,validateStatus:p,prefixCls:u,meta:f,noStyle:c}){const t=$.getStatus(r,s,f,null,!!e,p),{isFormItemInput:i,status:a,hasFeedback:q,feedbackIcon:F}=l.useContext(x.FormItemInputContext),b=l.useMemo(()=>{let d;if(e){const m=t&&S[t];d=m?o.jsxRuntimeExports.jsx("span",{className:v.default(`${u}-feedback-icon`,`${u}-feedback-icon-${t}`),children:o.jsxRuntimeExports.jsx(m,{})}):null}const n={status:t||"",errors:r,warnings:s,hasFeedback:!!e,feedbackIcon:d,isFormItemInput:!0};return c&&(n.status=(t??a)||"",n.isFormItemInput=i,n.hasFeedback=!!(e??q),n.feedbackIcon=e!==void 0?n.feedbackIcon:F),n},[t,e,c,i,a]);return o.jsxRuntimeExports.jsx(x.FormItemInputContext.Provider,{value:b,children:I})}exports.default=R;
|
|
2
2
|
//# sourceMappingURL=StatusProvider.js.map
|
|
@@ -6,9 +6,9 @@ import { FormItemInputProps } from '../FormItemInput';
|
|
|
6
6
|
import { FormItemLabelProps } from '../FormItemLabel';
|
|
7
7
|
import { ReportMetaChange } from '../context';
|
|
8
8
|
import { default as useFormItemStatus } from '../hooks/useFormItemStatus';
|
|
9
|
-
type RenderChildren<Values =
|
|
10
|
-
type RcFieldProps<Values =
|
|
11
|
-
type ChildrenType<Values =
|
|
9
|
+
type RenderChildren<Values = unknown> = (form: FormInstance<Values>) => ReactNode;
|
|
10
|
+
type RcFieldProps<Values = unknown> = Omit<FieldProps<Values>, 'children'>;
|
|
11
|
+
type ChildrenType<Values = unknown> = RenderChildren<Values> | ReactNode;
|
|
12
12
|
declare const ValidateStatuses: readonly ["success", "warning", "error", "validating", ""];
|
|
13
13
|
export type ValidateStatus = (typeof ValidateStatuses)[number];
|
|
14
14
|
export type FeedbackIcons = (itemStatus: {
|
|
@@ -18,7 +18,7 @@ export type FeedbackIcons = (itemStatus: {
|
|
|
18
18
|
}) => {
|
|
19
19
|
[key in ValidateStatus]?: ReactNode;
|
|
20
20
|
};
|
|
21
|
-
export interface FormItemProps<Values =
|
|
21
|
+
export interface FormItemProps<Values = unknown> extends FormItemLabelProps, FormItemInputProps, RcFieldProps<Values> {
|
|
22
22
|
noStyle?: boolean;
|
|
23
23
|
style?: CSSProperties;
|
|
24
24
|
className?: string;
|
|
@@ -28,7 +28,7 @@ export interface FormItemProps<Values = any> extends FormItemLabelProps, FormIte
|
|
|
28
28
|
validateStatus?: ValidateStatus;
|
|
29
29
|
required?: boolean;
|
|
30
30
|
hidden?: boolean;
|
|
31
|
-
initialValue?:
|
|
31
|
+
initialValue?: unknown;
|
|
32
32
|
messageVariables?: Record<string, string>;
|
|
33
33
|
layout?: FormItemLayout;
|
|
34
34
|
hideError?: boolean;
|
|
@@ -45,7 +45,7 @@ export interface ItemHolderProps extends FormItemProps {
|
|
|
45
45
|
isRequired?: boolean;
|
|
46
46
|
onSubItemMetaChange: ReportMetaChange;
|
|
47
47
|
}
|
|
48
|
-
declare function InternalFormItem<Values =
|
|
48
|
+
declare function InternalFormItem<Values = unknown>(props: FormItemProps<Values>): ReactElement;
|
|
49
49
|
type InternalFormItemType = typeof InternalFormItem;
|
|
50
50
|
type CompoundedComponent = InternalFormItemType & {
|
|
51
51
|
useStatus: typeof useFormItemStatus;
|
package/lib/FieldForm/Form.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export type RequiredMark = boolean | 'optional' | ((labelNode: ReactNode, info:
|
|
|
10
10
|
}) => ReactNode);
|
|
11
11
|
export type FormLayout = 'horizontal' | 'vertical';
|
|
12
12
|
export type FormItemLayout = 'horizontal' | 'vertical';
|
|
13
|
-
export interface FormProps<Values =
|
|
13
|
+
export interface FormProps<Values = unknown> extends Omit<RcFormProps<Values>, 'form'> {
|
|
14
14
|
colon?: boolean;
|
|
15
15
|
name?: string;
|
|
16
16
|
layout?: FormLayout;
|
|
@@ -23,6 +23,6 @@ export interface FormProps<Values = any> extends Omit<RcFormProps<Values>, 'form
|
|
|
23
23
|
requiredMark?: RequiredMark;
|
|
24
24
|
size?: 'small' | 'medium' | 'large';
|
|
25
25
|
}
|
|
26
|
-
declare const FieldForm: (<Values =
|
|
26
|
+
declare const FieldForm: (<Values = unknown>(props: PropsWithChildren<FormProps<Values>> & RefAttributes<FormRef<Values>>) => ReactElement) & Pick<FC, "displayName">;
|
|
27
27
|
export { useForm, useWatch, type FormInstance };
|
|
28
28
|
export default FieldForm;
|
package/lib/FieldForm/Form.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("../_virtual/jsx-runtime.js"),e=require("react"),A=require("../_virtual/
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("../_virtual/jsx-runtime.js"),e=require("react"),A=require("../_virtual/index.js"),v=require("rc-field-form"),w=require("../GlobalContext/constant.js"),R=require("./hooks/useForm.js"),p=require("./context.js"),z=require("./lang/index.js"),O=require("../GlobalContext/index.js"),u=`${w.$prefixCls}-field-form`,V=(W,q)=>{const{className:E,disabled:c,form:M,colon:m,labelAlign:d,labelWidth:n,labelWrap:g,layout:f="vertical",onFinishFailed:j,name:r,style:y,size:x,..._}=W,[l,C]=e.useState(0),{language:b}=e.useContext(O.default),L=e.useMemo(()=>z.defaultValidateMessages[b||"zh"],[b]),[s]=R.default(M),{__INTERNAL__:h}=s;h.name=r;const o=e.useRef(null);e.useImperativeHandle(q,()=>({...s,nativeElement:o.current?.nativeElement}));const I=t=>{j?.(t)},P=t=>{if(!t)return;const $=t.querySelectorAll(`.${u}-item`);let a=0;$?.forEach(N=>{const F=N.querySelector("label");if(F){const T=F.offsetWidth;a=Math.max(a,T)}}),C(a)};e.useEffect(()=>{const t=setTimeout(()=>{P(o.current?.nativeElement)},0);return()=>clearTimeout(t)},[]);const S=e.useMemo(()=>({name:r,labelAlign:d,labelWrap:n?g:!1,labelWidth:n||l,labelMaxWidth:l,layout:f,colon:m,itemRef:h.itemRef,form:s,prefixCls:u,disabled:c,size:x}),[r,d,f,m,s,c,l,n,x]);return i.jsxRuntimeExports.jsx(p.FormProvider,{validateMessages:L,children:i.jsxRuntimeExports.jsx(p.FormContext.Provider,{value:S,children:i.jsxRuntimeExports.jsx(v,{id:r,..._,name:r,onFinishFailed:I,form:s,ref:o,className:A.default(E,u),style:{...y}})})})},G=e.forwardRef(V);Object.defineProperty(exports,"useWatch",{enumerable:!0,get:()=>v.useWatch});exports.useForm=R.default;exports.default=G;
|
|
2
2
|
//# sourceMappingURL=Form.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../_virtual/jsx-runtime.js"),h=require("react"),m=require("../_virtual/
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../_virtual/jsx-runtime.js"),h=require("react"),m=require("../_virtual/index.js"),p=require("./ErrorList.js"),j=require("./context.js"),g=x=>{const{fieldId:l,children:a,errors:r,warnings:s,status:t,helperText:i,marginBottom:o,onErrorVisibleChanged:c,hideError:u,noSpacing:d=!1}=x,{prefixCls:n}=h.useContext(j.FormContext);return e.jsxRuntimeExports.jsxs("div",{className:m.default(`${n}-content`,{[`${n}-content__${l}`]:l,"has-spacing":!d,"has-helper-text":!u&&!!(r.length||s.length||i&&(t==="error"||t==="warning"))}),children:[e.jsxRuntimeExports.jsx("div",{className:`${n}-control-input`,children:e.jsxRuntimeExports.jsx("div",{className:`${n}-control-input-content`,children:a})}),e.jsxRuntimeExports.jsx("div",{className:`${n}-helper-text`,children:!u&&(o!==null||r.length||s.length||i&&(t==="error"||t==="warning"))?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(p.default,{errors:r,warnings:s,helperText:i,helpStatus:t,onVisibleChanged:c}),!!o&&e.jsxRuntimeExports.jsx("div",{style:{width:0,height:o}})]}):null})]})};exports.default=g;
|
|
2
2
|
//# sourceMappingURL=FormItemInput.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("../_virtual/jsx-runtime.js"),n=require("react"),_=require("../_virtual/
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("../_virtual/jsx-runtime.js"),n=require("react"),_=require("../_virtual/index.js"),E=require("../GlobalContext/index.js"),y=require("./context.js"),M=require("../Label/index.js"),S=({fieldId:u,label:t,labelProps:d,hideLabel:p,colon:c,layout:r,labelAlign:b,labelWidth:a,labelWrap:g})=>{const{prefixCls:s,colon:m,labelWidth:f,labelAlign:h,labelWrap:C}=n.useContext(y.FormContext),$=b||h,{language:j,locale:L}=n.useContext(E.default),o=n.useRef(null),R=e=>typeof e=="number"?`${e}px`:typeof e=="string"?e.endsWith("px")?e:`${e}px`:e,q=n.useMemo(()=>{const e=a||f||0;return e&&r==="horizontal"?R(e):"auto"},[a,f,r]),W=n.useMemo(()=>{let e=t;return(c===!0||m!==!1&&c!==!1)&&r==="horizontal"&&typeof t=="string"&&t.trim()&&(e=t.replace(/[:|:]\s*$/,"")),i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:e})},[j,L,t,c,m,r]);return n.useLayoutEffect(()=>{if(o.current){const l=o.current.querySelector(`.${s}-label-comp`)?.clientHeight;if(l&&l>32){const x=(l-32)/2;o.current.style.marginTop=`-${x}px`,o.current.classList.add("is-multiline")}}},[]),p||!t?null:i.jsxRuntimeExports.jsx("div",{ref:o,className:_.default(`${s}-label`,{[`${s}-label__${u}`]:u,"is-left":$==="left"&&r==="horizontal","is-wrap":g??C??!1}),style:{width:q},children:i.jsxRuntimeExports.jsx(M.default,{className:`${s}-label-comp`,label:W,...d})})};exports.default=S;
|
|
2
2
|
//# sourceMappingURL=FormItemLabel.js.map
|
|
@@ -3,7 +3,7 @@ import { StoreValue, ValidatorRule } from 'rc-field-form/lib/interface';
|
|
|
3
3
|
export interface FormListFieldData {
|
|
4
4
|
name: number;
|
|
5
5
|
key: number;
|
|
6
|
-
error?:
|
|
6
|
+
error?: unknown;
|
|
7
7
|
}
|
|
8
8
|
export interface FormListOperation {
|
|
9
9
|
add: (defaultValue?: StoreValue, insertIndex?: number) => void;
|
|
@@ -13,7 +13,7 @@ export interface FormListOperation {
|
|
|
13
13
|
export interface FormListProps {
|
|
14
14
|
name: string | number | (string | number)[];
|
|
15
15
|
rules?: ValidatorRule[];
|
|
16
|
-
initialValue?:
|
|
16
|
+
initialValue?: unknown[];
|
|
17
17
|
children: (fields: FormListFieldData[], operation: FormListOperation, meta: {
|
|
18
18
|
errors: ReactNode[];
|
|
19
19
|
warnings: ReactNode[];
|