@para-ui/core 5.0.0-beta.11 → 5.0.0-beta.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +315 -0
- package/AlignBox/component.json +89 -0
- package/Anchor/component.json +130 -0
- package/Argv/component.json +216 -0
- package/AutoBox/component.json +133 -0
- package/AutoButton/component.json +109 -0
- package/AutoTips/component.json +121 -0
- package/Badge/component.json +92 -0
- package/Breadcrumbs/component.json +142 -0
- package/Button/component.json +168 -0
- package/ButtonGroup/component.json +132 -0
- package/Card/component.json +162 -0
- package/Carousel/component.json +142 -0
- package/Cascader/component.json +196 -0
- package/Checkbox/component.json +138 -0
- package/CheckboxGroup/component.json +152 -0
- package/CodeEditor/component.json +189 -0
- package/Collapse/component.json +166 -0
- package/CollapseBox/component.json +84 -0
- package/CollapseLayout/component.json +155 -0
- package/ColorPicker/component.json +142 -0
- package/ComboSelect/component.json +181 -0
- package/Container/component.json +111 -0
- package/ContentBox/component.json +81 -0
- package/CopyText/component.json +118 -0
- package/CycleSelector/component.json +98 -0
- package/DatePicker/component.json +192 -0
- package/Descriptions/component.json +142 -0
- package/Desktop/component.json +171 -0
- package/DragVerify/component.json +114 -0
- package/Drawer/component.json +200 -0
- package/Dropdown/component.json +147 -0
- package/DynamicMultiBox/component.json +278 -0
- package/Empty/component.json +123 -0
- package/FieldForm/component.json +196 -0
- package/Form/component.json +161 -0
- package/FormItem/component.json +171 -0
- package/FunctionModal/component.json +197 -0
- package/Help/component.json +118 -0
- package/HelperText/component.json +126 -0
- package/Image/component.json +165 -0
- package/InputCode/component.json +191 -0
- package/InputLang/component.json +205 -0
- package/InputNumber/component.json +162 -0
- package/Label/component.json +126 -0
- package/Loading/component.json +91 -0
- package/Menu/component.json +180 -0
- package/Message/component.json +246 -0
- package/Modal/component.json +277 -0
- package/MultiBox/component.json +216 -0
- package/Notification/component.json +184 -0
- package/OperateBtn/component.json +134 -0
- package/PageHeader/component.json +112 -0
- package/Pagination/component.json +181 -0
- package/PasswordRules/component.json +105 -0
- package/PopConfirm/component.json +227 -0
- package/PopMenu/component.json +131 -0
- package/Popover/component.json +165 -0
- package/Progress/component.json +161 -0
- package/Prompt/component.json +144 -0
- package/Querying/component.json +96 -0
- package/QuickReply/component.json +129 -0
- package/Radio/component.json +136 -0
- package/RadioGroup/component.json +149 -0
- package/RangeInput/component.json +198 -0
- package/Result/component.json +104 -0
- package/ScrollBar/component.json +115 -0
- package/Search/component.json +177 -0
- package/Select/component.json +244 -0
- package/SelectInput/component.json +184 -0
- package/Selector/component.json +203 -0
- package/SelectorPicker/component.json +179 -0
- package/SingleBox/component.json +151 -0
- package/Slider/component.json +181 -0
- package/SortBox/component.json +108 -0
- package/Status/component.json +104 -0
- package/Stepper/component.json +129 -0
- package/Switch/component.json +207 -0
- package/Table/component.json +547 -0
- package/Tabs/component.json +227 -0
- package/Tag/component.json +221 -0
- package/TextEditor/component.json +186 -0
- package/TextField/component.json +290 -0
- package/TimePicker/component.json +176 -0
- package/Timeline/component.json +110 -0
- package/Title/component.json +156 -0
- package/ToggleButton/component.json +153 -0
- package/Tooltip/component.json +176 -0
- package/Transfer/component.json +157 -0
- package/Tree/component.json +512 -0
- package/Upload/component.json +450 -0
- package/ai-workflows/01-crud-list-multi-drawer.md +278 -0
- package/ai-workflows/02-rbac-operation-buttons.md +290 -0
- package/ai-workflows/03-complex-form-async-cascade.md +350 -0
- package/ai-workflows/04-array-field-form.md +281 -0
- package/ai-workflows/05-popconfirm-async-message-queue.md +333 -0
- package/ai-workflows/06-modal-drawer-form-workflow.md +385 -0
- package/ai-workflows/07-search-filter-table-trio.md +387 -0
- package/ai-workflows/08-table-advanced-features.md +365 -0
- package/ai-workflows/09-batch-operation-export-progress.md +367 -0
- package/ai-workflows/10-cross-component-state-coordination.md +412 -0
- package/es/AlignBox/component.json +89 -0
- package/es/AlignBox/index.css +1 -1
- package/es/AlignBox/index.d.ts +6 -2
- package/es/AlignBox/index.js +1 -1
- package/es/AlignBox/style/index.css +1 -1
- package/es/Anchor/anchorMenu/index.d.ts +2 -1
- package/es/Anchor/anchorMenu/index.js +36 -33
- package/es/Anchor/component.json +130 -0
- package/es/Anchor/index.js +52 -49
- package/es/Anchor/type.d.ts +8 -4
- 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 +19 -19
- 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/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/InputLang/component.json +205 -0
- package/es/InputLang/index.js +2 -2
- package/es/InputNumber/component.json +162 -0
- package/es/Label/component.json +126 -0
- package/es/Label/index.d.ts +2 -2
- package/es/Loading/component.json +91 -0
- package/es/Menu/component.json +180 -0
- package/es/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 +2 -2
- 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.js +20 -20
- package/es/Result/component.json +104 -0
- package/es/ScrollBar/component.json +115 -0
- package/es/Search/component.json +177 -0
- package/es/Search/index.d.ts +1 -1
- package/es/Select/component.json +244 -0
- package/es/Select/index.js +114 -114
- package/es/SelectInput/component.json +184 -0
- 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 -2
- package/es/_virtual/index.js +5 -3
- package/es/_virtual/index2.js +2 -5
- package/es/index.d.ts +2 -0
- package/es/index.js +1 -1
- package/es/locale/en_US.d.ts +361 -0
- package/es/locale/en_US.js +364 -0
- package/es/locale/index.d.ts +1 -723
- package/es/locale/index2.js +10 -0
- package/es/locale/zh_CN.d.ts +361 -0
- package/es/locale/zh_CN.js +364 -0
- package/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/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/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.js +1 -1
- package/lib/Result/component.json +104 -0
- package/lib/ScrollBar/component.json +115 -0
- package/lib/Search/component.json +177 -0
- package/lib/Search/index.d.ts +1 -1
- package/lib/Select/component.json +244 -0
- package/lib/Select/index.js +1 -1
- package/lib/SelectInput/component.json +184 -0
- package/lib/Selector/component.json +203 -0
- package/lib/Selector/index.js +1 -1
- package/lib/Selector/interface.d.ts +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 -2
- package/lib/_virtual/index.js +1 -1
- package/lib/_virtual/index2.js +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +1 -1
- package/lib/locale/en_US.d.ts +361 -0
- package/lib/locale/en_US.js +2 -0
- package/lib/locale/index.d.ts +1 -723
- package/lib/locale/index2.js +2 -0
- package/lib/locale/zh_CN.d.ts +361 -0
- package/lib/locale/zh_CN.js +2 -0
- package/lib/node_modules/classnames/index.js +1 -1
- package/package.json +11 -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/{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,111 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Container",
|
|
3
|
+
"category": "Layout",
|
|
4
|
+
"description": "容器布局,支持上下左右四区域布局",
|
|
5
|
+
"semantic": {
|
|
6
|
+
"intent": [
|
|
7
|
+
"页面布局",
|
|
8
|
+
"分区容器"
|
|
9
|
+
],
|
|
10
|
+
"useCases": [
|
|
11
|
+
"经典布局",
|
|
12
|
+
"管理后台",
|
|
13
|
+
"工作台"
|
|
14
|
+
],
|
|
15
|
+
"riskLevel": "low"
|
|
16
|
+
},
|
|
17
|
+
"variants": {
|
|
18
|
+
"tlr": {
|
|
19
|
+
"meaning": "上左右布局"
|
|
20
|
+
},
|
|
21
|
+
"tlrb": {
|
|
22
|
+
"meaning": "上左右下布局"
|
|
23
|
+
},
|
|
24
|
+
"ltrb": {
|
|
25
|
+
"meaning": "左上右下布局"
|
|
26
|
+
},
|
|
27
|
+
"trb": {
|
|
28
|
+
"meaning": "上右下布局"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"states": [
|
|
32
|
+
"default"
|
|
33
|
+
],
|
|
34
|
+
"idealProps": {
|
|
35
|
+
"type": {
|
|
36
|
+
"type": "enum",
|
|
37
|
+
"values": [
|
|
38
|
+
"tlrb",
|
|
39
|
+
"ltrb",
|
|
40
|
+
"trb",
|
|
41
|
+
"tlr"
|
|
42
|
+
],
|
|
43
|
+
"default": "tlr",
|
|
44
|
+
"description": "布局类型;tlr=上左右、tlrb=上左右下、ltrb=左+上右下(左侧贯通顶部到底部)、trb=上右下(无左侧)"
|
|
45
|
+
},
|
|
46
|
+
"top": {
|
|
47
|
+
"type": "JSX.Element",
|
|
48
|
+
"description": "顶部容器内容;不传则顶部区域高度自动收缩为 0(src/Container/index.tsx:100 `height: top ? '50px' : '0'`)。注:类型是 JSX.Element 而非 ReactNode,传 string / null / number 会被 TS2322 阻断,需用 <div>{node}</div> 包裹"
|
|
49
|
+
},
|
|
50
|
+
"topStyle": {
|
|
51
|
+
"type": "React.CSSProperties",
|
|
52
|
+
"description": "顶部容器样式(背景色/高度等)"
|
|
53
|
+
},
|
|
54
|
+
"left": {
|
|
55
|
+
"type": "JSX.Element",
|
|
56
|
+
"description": "左侧容器内容;不传则左侧区域宽度自动收缩为 0。类型同 top"
|
|
57
|
+
},
|
|
58
|
+
"leftStyle": {
|
|
59
|
+
"type": "React.CSSProperties",
|
|
60
|
+
"description": "左侧容器样式(背景色/宽度等)"
|
|
61
|
+
},
|
|
62
|
+
"right": {
|
|
63
|
+
"type": "JSX.Element",
|
|
64
|
+
"description": "右侧/主体容器内容(在所有 type 下都是主显示区);类型同 top"
|
|
65
|
+
},
|
|
66
|
+
"rightStyle": {
|
|
67
|
+
"type": "React.CSSProperties",
|
|
68
|
+
"description": "右侧/主体容器样式"
|
|
69
|
+
},
|
|
70
|
+
"bottom": {
|
|
71
|
+
"type": "JSX.Element",
|
|
72
|
+
"description": "底部容器内容;不传则底部区域高度自动收缩为 0。类型同 top"
|
|
73
|
+
},
|
|
74
|
+
"bottomStyle": {
|
|
75
|
+
"type": "React.CSSProperties",
|
|
76
|
+
"description": "底部容器样式(背景色/高度等)"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"do": [
|
|
80
|
+
"用于快速搭建经典管理后台布局(tlr=顶部导航+左侧菜单+主区域,tlrb=四区域,trb=无侧边栏)",
|
|
81
|
+
"配合 CollapseLayout 实现可折叠侧边栏:leftStyle={{ width: 200 }} + 内嵌 CollapseLayout",
|
|
82
|
+
"顶部/左侧/底部区域的高宽默认值(如 top 默认 50px)可通过 topStyle/leftStyle 等覆盖"
|
|
83
|
+
],
|
|
84
|
+
"dont": [
|
|
85
|
+
"嵌套过深的 Container(布局嵌套超过 2 层时改用 Flex/Grid 自实现,Container 本身不支持响应式断点)",
|
|
86
|
+
"复杂自适应布局硬用 Container——Container 是固定区域布局,响应式场景改用 Grid/Flex",
|
|
87
|
+
"把 string / null / number 直接传给 top/left/right/bottom——类型是 JSX.Element,需 <div> 包裹"
|
|
88
|
+
],
|
|
89
|
+
"events": {},
|
|
90
|
+
"typescriptPitfalls": [
|
|
91
|
+
{
|
|
92
|
+
"issue": "top/left/right/bottom 的类型是 JSX.Element,不接受 string 或 ReactNode",
|
|
93
|
+
"wrong": "top={'首页标题'} // TS 报错:string 不是 JSX.Element",
|
|
94
|
+
"right": "top={<div>首页标题</div>} // 必须是 JSX 元素"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"issue": "type='trb' 时没有 left 区域,传 left/leftStyle 无效",
|
|
98
|
+
"wrong": "<Container type='trb' left={<Sidebar />} /> // trb 布局无 left 区域,Sidebar 不渲染",
|
|
99
|
+
"right": "<Container type='tlr' left={<Sidebar />} right={<Main />} /> // 需要侧边栏用 tlr/tlrb/ltrb"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"issue": "topStyle/leftStyle 等 Style prop 覆盖默认尺寸,需显式传 width/height",
|
|
103
|
+
"wrong": "leftStyle={{ background: '#f0f0f0' }} // 背景色覆盖但宽度未设置,左侧宽度可能不符合预期",
|
|
104
|
+
"right": "leftStyle={{ background: '#f0f0f0', width: 200 }} // 显式指定宽度"
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
"mapping": {
|
|
108
|
+
"realComponent": "Container",
|
|
109
|
+
"adapter": null
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ContentBox",
|
|
3
|
+
"category": "Layout",
|
|
4
|
+
"description": "内容容器,支持 Loading 和 Empty 状态",
|
|
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
|
+
"loading",
|
|
24
|
+
"empty",
|
|
25
|
+
"default"
|
|
26
|
+
],
|
|
27
|
+
"idealProps": {
|
|
28
|
+
"loading": {
|
|
29
|
+
"type": "boolean",
|
|
30
|
+
"description": "是否正在加载"
|
|
31
|
+
},
|
|
32
|
+
"empty": {
|
|
33
|
+
"type": "boolean",
|
|
34
|
+
"description": "是否为空"
|
|
35
|
+
},
|
|
36
|
+
"scroll": {
|
|
37
|
+
"type": "boolean",
|
|
38
|
+
"description": "是否支持滚动"
|
|
39
|
+
},
|
|
40
|
+
"loadingOverlay": {
|
|
41
|
+
"type": "boolean",
|
|
42
|
+
"description": "loading 是否覆盖内容"
|
|
43
|
+
},
|
|
44
|
+
"children": {
|
|
45
|
+
"type": "ReactNode",
|
|
46
|
+
"description": "子组件"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"do": [
|
|
50
|
+
"统一处理异步数据的三种状态(loading/empty/正常内容)——避免在每个页面重复写 if-else 状态判断",
|
|
51
|
+
"loadingOverlay=true(默认)时 loading 覆盖在内容之上;loadingOverlay=false 时隐藏内容只显示 Loading——根据业务场景选择",
|
|
52
|
+
"需要自定义 Loading/Empty 样式:传 loadingComponent 或 emptyComponent 覆盖默认组件"
|
|
53
|
+
],
|
|
54
|
+
"dont": [
|
|
55
|
+
"在简单静态内容中使用 ContentBox——无异步状态的场景无需 ContentBox,直接渲染内容性能更好",
|
|
56
|
+
"empty=true 时仍期望 children 渲染——empty 状态下 children 被 Empty 组件替换(src/ContentBox/index.tsx:78-86 实证)",
|
|
57
|
+
"loading 和 empty 同时为 true——src 优先处理 loading,empty 判断有 !loading 前置条件,两者同时为 true 时只显示 Loading"
|
|
58
|
+
],
|
|
59
|
+
"events": {},
|
|
60
|
+
"typescriptPitfalls": [
|
|
61
|
+
{
|
|
62
|
+
"issue": "emptyProps 只对默认 Empty 组件生效,传了 emptyComponent 后 emptyProps 被忽略",
|
|
63
|
+
"wrong": "// emptyComponent 和 emptyProps 同时传,期望 emptyProps 能影响自定义 emptyComponent\n<ContentBox empty emptyComponent={<MyEmpty />} emptyProps={{ description: '暂无数据' }} />",
|
|
64
|
+
"right": "// 自定义组件时 emptyProps 无效,直接在 emptyComponent 内传 props\n<ContentBox empty emptyComponent={<MyEmpty description='暂无数据' />} />"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"issue": "loadingComponent 不接受 null/undefined,传 null 时 tsc 报类型错误",
|
|
68
|
+
"wrong": "loadingComponent={null} // ReactNode 可以是 null,但 ContentBox 内部 if(loadingComponent) 判断",
|
|
69
|
+
"right": "// 不传 loadingComponent 或传自定义 JSX 元素(不传时使用默认 Loading 组件)"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"issue": "ContentBox 使用 forwardRef,ref 类型是 HTMLDivElement",
|
|
73
|
+
"wrong": "const ref = useRef<HTMLElement>(null); <ContentBox ref={ref} /> // 类型不匹配",
|
|
74
|
+
"right": "const ref = useRef<HTMLDivElement>(null); <ContentBox ref={ref} />"
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"mapping": {
|
|
78
|
+
"realComponent": "ContentBox",
|
|
79
|
+
"adapter": null
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "CopyText",
|
|
3
|
+
"category": "Data Display",
|
|
4
|
+
"description": "复制文本,点击图标复制内容",
|
|
5
|
+
"semantic": {
|
|
6
|
+
"intent": [
|
|
7
|
+
"一键复制",
|
|
8
|
+
"信息展示"
|
|
9
|
+
],
|
|
10
|
+
"useCases": [
|
|
11
|
+
"密钥展示",
|
|
12
|
+
"链接分享",
|
|
13
|
+
"代码片段"
|
|
14
|
+
],
|
|
15
|
+
"riskLevel": "low"
|
|
16
|
+
},
|
|
17
|
+
"variants": {
|
|
18
|
+
"input": {
|
|
19
|
+
"meaning": "输入框模式"
|
|
20
|
+
},
|
|
21
|
+
"text": {
|
|
22
|
+
"meaning": "纯文本模式"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"states": [
|
|
26
|
+
"default",
|
|
27
|
+
"copied"
|
|
28
|
+
],
|
|
29
|
+
"idealProps": {
|
|
30
|
+
"type": {
|
|
31
|
+
"type": "enum",
|
|
32
|
+
"values": [
|
|
33
|
+
"input",
|
|
34
|
+
"text"
|
|
35
|
+
],
|
|
36
|
+
"default": "text",
|
|
37
|
+
"description": "类型('text' 纯文本展示 + 复制图标 / 'input' 输入框模式 + 复制图标 — 配合 textFieldProps 透传 TextField 配置)"
|
|
38
|
+
},
|
|
39
|
+
"value": {
|
|
40
|
+
"type": "ReactNode",
|
|
41
|
+
"description": "显示值;text 模式既是显示内容又是复制源(.toString() 兜底);input 模式必须 string(api.ts 类型 ReactNode 但 src:57 .toString() 兜底);**复制源优先级**:copyValue > valueCom(input 模式用户键入值) > value?.toString()"
|
|
42
|
+
},
|
|
43
|
+
"copyValue": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"description": "**显式指定写入剪贴板的内容,优先级最高**;适合'显示 ABC 但复制 ABC-with-prefix'或'显示掩码但复制真值'场景;不传则用 value/valueCom 兜底"
|
|
46
|
+
},
|
|
47
|
+
"textFieldProps": {
|
|
48
|
+
"type": "Omit<TextFieldProps, 'label'>",
|
|
49
|
+
"description": "**仅 type='input' 模式生效**;透传给内部 TextField — 可设 placeholder / readOnly / 自定义 onChange 等;text 模式下此 prop 被忽略"
|
|
50
|
+
},
|
|
51
|
+
"label": {
|
|
52
|
+
"type": "ReactNode",
|
|
53
|
+
"description": "组件标题(显示在 value 前)"
|
|
54
|
+
},
|
|
55
|
+
"copyIcon": {
|
|
56
|
+
"type": "ReactNode",
|
|
57
|
+
"description": "复制图标(默认 @para-ui/icons/Copy);复制成功后短暂切换为 CheckS,timeout 后切回"
|
|
58
|
+
},
|
|
59
|
+
"timeout": {
|
|
60
|
+
"type": "number",
|
|
61
|
+
"default": "800",
|
|
62
|
+
"description": "复制成功后图标切回原图的延时(ms);**仅控制状态指示视觉,不影响实际复制行为**(execCommand 已同步完成)"
|
|
63
|
+
},
|
|
64
|
+
"onCopy": {
|
|
65
|
+
"type": "function",
|
|
66
|
+
"description": "**复制前 hook**(点击时立即触发,await 后再 execCommand — src/CopyText/index.tsx:64-72);**不是复制成功回调**;**返回值语义**:返回 string 覆盖默认复制值,返回 undefined/void 用默认值;**组件已自动写剪贴板,不要在此调 navigator.clipboard.writeText**(会重复)"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"do": [
|
|
70
|
+
"在需要用户复制内容的场景使用——密钥/Token 展示、链接分享、代码片段等",
|
|
71
|
+
"提供复制成功反馈(copyIcon 切换为 CheckS,timeout 毫秒后切回)",
|
|
72
|
+
"显示内容与复制内容不同时(如掩码显示、真值复制):传 copyValue 指定真实复制内容",
|
|
73
|
+
"input 模式下用户可编辑内容并复制:type='input' + textFieldProps 配置输入框属性"
|
|
74
|
+
],
|
|
75
|
+
"dont": [
|
|
76
|
+
"复制敏感信息(密码/私钥)时不做视觉遮罩——显示 value 但复制内容不同时用 copyValue 隔离",
|
|
77
|
+
"在 onCopy 内调 navigator.clipboard.writeText——组件已自动 execCommand 写剪贴板,会重复写入",
|
|
78
|
+
"把 onCopy 当作复制成功后的回调——onCopy 是复制前 hook(在 execCommand 前 await),若需成功后 toast 在 onCopy 返回前自行触发",
|
|
79
|
+
"text 模式下传 textFieldProps 期待 placeholder 生效——textFieldProps 仅 type='input' 模式有效"
|
|
80
|
+
],
|
|
81
|
+
"events": {
|
|
82
|
+
"onCopy": {
|
|
83
|
+
"signature": "() => Promise<string | void> | string | void",
|
|
84
|
+
"asyncSupported": true,
|
|
85
|
+
"examples": [
|
|
86
|
+
"动态获取复制值:onCopy={async () => { const token = await fetchToken(); return token; }}(返回 string 覆盖默认复制值)",
|
|
87
|
+
"仅做副作用(不改变复制值):onCopy={() => { analytics.track('copy'); }}(返回 void 时用默认 value)",
|
|
88
|
+
"显示成功 toast:onCopy={async () => { const val = await getVal(); message.success('已复制'); return val; }}"
|
|
89
|
+
],
|
|
90
|
+
"commonMistakes": [
|
|
91
|
+
"把 onCopy 当复制成功回调——onCopy 在 execCommand 之前触发(复制前 hook),不是复制成功后",
|
|
92
|
+
"在 onCopy 内调 navigator.clipboard.writeText——组件已自动写剪贴板(execCommand),调用后会重复写入",
|
|
93
|
+
"onCopy 返回 undefined 以为会阻止复制——返回 undefined 时组件用默认 value 复制,无法阻止复制行为"
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"typescriptPitfalls": [
|
|
98
|
+
{
|
|
99
|
+
"issue": "type='input' 时 value 必须是 string 类型(src 内部 .toString() 兜底但 TS 类型声明为 ReactNode)",
|
|
100
|
+
"wrong": "type='input' value={<span>复杂内容</span>} // input 模式内部 setValueCom(value?.toString()) 导致 [object Object]",
|
|
101
|
+
"right": "type='input' value='plain string' // input 模式只传 string"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"issue": "textFieldProps 类型是 Omit<TextFieldProps, 'label'>,label 已被剔除,不能在此传 label",
|
|
105
|
+
"wrong": "textFieldProps={{ label: '字段名', placeholder: '请输入' }} // TS 报错:label 已被 Omit 剔除",
|
|
106
|
+
"right": "// label 通过 CopyText.label prop 传,textFieldProps 只传 TextField 其他属性\n<CopyText label='字段名' textFieldProps={{ placeholder: '请输入' }} />"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"issue": "copyValue 优先级最高,传了 copyValue 后 value 仅用于显示,不参与复制",
|
|
110
|
+
"wrong": "// 期望 copyValue 只在某些情况覆盖,平时还用 value:\n<CopyText value={displayText} copyValue={undefined} /> // copyValue=undefined 时自动 fallback 到 value,OK",
|
|
111
|
+
"right": "// 需要按条件切换:\ncopyValue={shouldOverride ? realValue : undefined} // undefined 时组件用 value,string 时用 copyValue"
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
"mapping": {
|
|
115
|
+
"realComponent": "CopyText",
|
|
116
|
+
"adapter": null
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "CycleSelector",
|
|
3
|
+
"category": "Data Entry",
|
|
4
|
+
"description": "周期选择器,用于选择周期性时间",
|
|
5
|
+
"semantic": {
|
|
6
|
+
"intent": [
|
|
7
|
+
"周期选择",
|
|
8
|
+
"定时任务"
|
|
9
|
+
],
|
|
10
|
+
"useCases": [
|
|
11
|
+
"定时任务",
|
|
12
|
+
"数据备份",
|
|
13
|
+
"报表生成"
|
|
14
|
+
],
|
|
15
|
+
"riskLevel": "normal"
|
|
16
|
+
},
|
|
17
|
+
"variants": {
|
|
18
|
+
"default": {
|
|
19
|
+
"meaning": "默认样式"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"states": [
|
|
23
|
+
"default",
|
|
24
|
+
"disabled",
|
|
25
|
+
"error"
|
|
26
|
+
],
|
|
27
|
+
"idealProps": {
|
|
28
|
+
"value": {
|
|
29
|
+
"type": "CycleSelectorValueProps",
|
|
30
|
+
"description": "周期配置对象 · cron-like 调度(不是简单 cycle 切换器 · 不要传 string 如 'month')。**完整 9 字段**:`startTime`(开始时间 · string | number)· `cycleType`(周期类型 number · 0=不重复 / 1=每天 / 2=每周 / 3=每月 / 4=每年 / 5=自定义)· `frequency`(周期频率 number)· `frequencyUnit`(频率单位 string · 'day' / 'week' / 'month' / 'year')· `monthCycleType`(月维度 string · 'day' / 'week' · 仅 cycleType=3 时)· `executionDay`(执行周几列表 string · '0,1,2,3,4,5,6' 逗号分隔 · 0=周日)· `endType`(结束方式 number · 0=无限重复 / 1=截至时间 / 2=限定次数)· `limitNum`(限定次数 number · endType=2 时)· `endTime`(结束日期 string | number · endType=1 时)。**示例** 每周三五重复:`{ startTime: '2026-05-15 09:00', cycleType: 2, frequency: 1, frequencyUnit: 'week', executionDay: '3,5', endType: 0 }`。完整 interface 见 `dist/es/CycleSelector/index.d.ts`(发布产物)"
|
|
31
|
+
},
|
|
32
|
+
"onChange": {
|
|
33
|
+
"type": "function",
|
|
34
|
+
"signature": "(val: CycleSelectorValueProps) => void",
|
|
35
|
+
"description": "值变化回调 · 接收完整 CycleSelectorValueProps 对象"
|
|
36
|
+
},
|
|
37
|
+
"timeType": {
|
|
38
|
+
"type": "enum",
|
|
39
|
+
"values": [
|
|
40
|
+
"undefined",
|
|
41
|
+
"zone",
|
|
42
|
+
"stamp"
|
|
43
|
+
],
|
|
44
|
+
"default": "undefined",
|
|
45
|
+
"description": "时间格式:undefined=YYYY-MM-DD HH:mm:ss · zone=YYYY-MM-DD[T]HH:mm:ss[Z] · stamp=时间戳"
|
|
46
|
+
},
|
|
47
|
+
"disabled": {
|
|
48
|
+
"type": "boolean",
|
|
49
|
+
"description": "是否禁用"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"do": [
|
|
53
|
+
"用于 Cron 表达式或周期性任务配置场景——startTime 是触发时间,cycleType 决定重复方式",
|
|
54
|
+
"提供直观的周期选择界面(日/周/月/年/自定义),onChange 返回完整 CycleSelectorValueProps 对象",
|
|
55
|
+
"通过 cRef.current.getTipText() 获取周期摘要文本(用于展示当前配置的自然语言描述)"
|
|
56
|
+
],
|
|
57
|
+
"dont": [
|
|
58
|
+
"在简单日期选择中使用——单纯时间选择用 DatePicker,CycleSelector 专用于周期性重复场景",
|
|
59
|
+
"忽略时区处理——默认出参格式为 'YYYY-MM-DD HH:mm:ss';需要 ISO 时区格式传 timeType='zone',需要时间戳传 timeType='stamp'"
|
|
60
|
+
],
|
|
61
|
+
"events": {
|
|
62
|
+
"onChange": {
|
|
63
|
+
"signature": "(val: CycleSelectorValueProps) => void",
|
|
64
|
+
"asyncSupported": false,
|
|
65
|
+
"examples": [
|
|
66
|
+
"基本用法:<CycleSelector value={cycleValue} onChange={(val) => setCycleValue(val)} />",
|
|
67
|
+
"onChange 返回完整 CycleSelectorValueProps 对象,字段按 cycleType 不同动态增减(非自定义时删除 frequency/frequencyUnit 等字段)",
|
|
68
|
+
"cycleType=0(不重复)时 val 只含 startTime + cycleType,其余字段被删除"
|
|
69
|
+
],
|
|
70
|
+
"commonMistakes": [
|
|
71
|
+
"假设 onChange 每次都返回完整的 9 个字段——实际按 cycleType 动态清除无关字段(如 cycleType=0 时删除 frequency 等)",
|
|
72
|
+
"在 onChange 外部直接修改 val 对象后回传——CycleSelectorValueProps 是内部 state 引用,应拷贝后修改:{ ...val, extraField: value }",
|
|
73
|
+
"value 传 null/undefined——value 是必填 prop(src/CycleSelector/index.tsx:60 无问号),传空会导致运行时错误"
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"typescriptPitfalls": [
|
|
78
|
+
{
|
|
79
|
+
"issue": "value prop 是必填(无问号),不能传 null/undefined",
|
|
80
|
+
"wrong": "const [cycle, setCycle] = useState<CycleSelectorValueProps | null>(null);\n<CycleSelector value={cycle} /> // null 导致运行时错误",
|
|
81
|
+
"right": "const [cycle, setCycle] = useState<CycleSelectorValueProps>({});\n<CycleSelector value={cycle} onChange={setCycle} />"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"issue": "onChange 是必填(无问号),不传会导致 TS 类型错误",
|
|
85
|
+
"wrong": "<CycleSelector value={cycleValue} /> // 缺少 onChange,TS 报错",
|
|
86
|
+
"right": "<CycleSelector value={cycleValue} onChange={(val) => setCycleValue(val)} />"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"issue": "cRef 需要 useRef<CycleSelectorRefProps> 类型,直接 useRef() 推断为 unknown",
|
|
90
|
+
"wrong": "const cRef = useRef(null); cRef.current.getTipText(); // current 可能为 null",
|
|
91
|
+
"right": "import { CycleSelectorRefProps } from '@para-ui/core';\nconst cRef = useRef<CycleSelectorRefProps>({} as CycleSelectorRefProps);\n<CycleSelector cRef={cRef} ... />"
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
"mapping": {
|
|
95
|
+
"realComponent": "CycleSelector",
|
|
96
|
+
"adapter": null
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index.css');const r=require("../_virtual/jsx-runtime.js"),u=require("react"),De=require("clsx"),g=require("dayjs"),Ne=require("../node_modules/@para-ui/icons/Close/index.js"),be=require("../node_modules/@para-ui/icons/WarningCircleF/index.js"),B=require("../GlobalContext/constant.js"),F=require("../DatePicker/index.js"),f=require("../Select/index.js"),qe=require("../TextField/index.js"),ge=require("../Popover/index.js"),k=require("../Button/index.js"),ke=require("../GlobalContext/index.js"),$e=require("../GlobalContext/useFormatMessage.js"),we=require("./lang/index.js"),Se=require("../HelperText/index.js"),Ye=require("../Utils/index.js");;/* empty css */const Me=O=>{const{className:V,style:W,value:p,disabled:E=!1,error:R,hideErrorDom:I,helperText:z,disabledDate:$,disabledTime:w,timeType:S,tipRender:Y,showPopover:y,cRef:A,onChange:G,disabledCustom:M=!1}=O,{language:U,locale:Ue}=u.useContext(ke.default),n=$e.default("CycleSelector",we.default),[i,m]=u.useState({}),[J,L]=u.useState([]),[K,h]=u.useState(!1),[Q,X]=u.useState([]),[Z,ee]=u.useState([]),[te,ne]=u.useState([]),[re,se]=u.useState([]),[ie,H]=u.useState(!1),t=u.useRef({valueCom:i,value:p});t.current.valueCom=i,t.current.value=p,u.useEffect(()=>{const e=[];for(let s=1;s<32;s++)e.push({label:n("every")+s,value:s});return X(e),ee([{label:n("day"),value:"day"},{label:n("week"),value:"week"},{label:n("month"),value:"month"},{label:n("year"),value:"year"}]),ne([{label:n("infiniteRepetition"),value:0},{label:n("deadline"),value:1},{label:n("limitNum"),value:2}]),t.current.endTypeMap={0:n("infiniteRepetition"),1:n("deadline"),2:n("limitNum")},()=>{clearTimeout(t.current.timerTip)}},[U]),u.useEffect(()=>{const e=p?{...p}:{};e.startTime||(e.cycleType=0),e.startTime&&(e.startTime=D(e.startTime,"YYYY-MM-DD HH:mm")),e.endTime&&(e.endTime=D(e.endTime,"YYYY-MM-DD")),m(e),t.current.valueCom=e,le()},[p,U,M]),u.useEffect(()=>{y!==void 0&&y&&N()},[y]),u.useImperativeHandle(A,()=>({getTipText:e=>P(e,!0)}));const _=e=>e?S==="zone"?new Date(e).toISOString():S==="stamp"?new Date(e).getTime():e:"",D=(e,s)=>e?g(e).format(s):"",le=()=>{if(!t.current.valueCom?.startTime){L([{label:n("noRepetition"),value:0}]);return}t.current.timeDetail=Ye.getDateYYYYMMddHHMM(t.current.valueCom?.startTime);const{month:e,day:s,weekDay:l,hm:a,week:c,date:d}=t.current.timeDetail;let o=[{label:n("noRepetition"),value:0},{label:`${n("repeatEveryDay")} ${a}`,value:1},{label:`${n("repeatEveryWeek")} ${n(`week${l}`)} ${a}`,value:2},{label:`${n("repeatEveryMonth")} ${s}${n("th")} ${a}`,value:3},{label:`${n("repeatEveryYear")} ${e}${n("month")}${s}${n("th")} ${a}`,value:4},{label:n("customRepetition"),value:5}];M&&(o=o.filter(v=>v.value!==5)),L(o),se([{label:n(`day${s}`),value:"day"},{label:n(`the${c}`)+n(`week${l}`),value:"week"}]),t.current.monthCycleTypeListMap={day:n(`day${s}`),week:n(`the${c}`)+n(`week${l}`)}},ae=(e,s)=>{t.current.valueCom.startTime=s,ue(),T()},x=e=>{const s=t.current.valueCom[e];return s===void 0||s===""||s===null},N=()=>{if(x("frequency")&&(t.current.valueCom.frequency=1),x("frequencyUnit")&&(t.current.valueCom.frequencyUnit="day"),x("endType")&&(t.current.valueCom.endType=0),x("monthCycleType")&&(t.current.valueCom.monthCycleType="day"),x("endTime")&&(t.current.valueCom.endTime=t.current.timeDetail?.date),x("limitNum")&&(t.current.valueCom.limitNum=1),x("executionDay")){const e=b(Number(t.current.timeDetail?.weekDay));t.current.valueCom.executionDay=`${e}`}m({...t.current.valueCom})},ue=()=>{t.current.valueCom={startTime:t.current.valueCom.startTime,cycleType:0}},ce=e=>{t.current.valueCom.cycleType=e,m({...t.current.valueCom}),e===5?(h(!0),N()):T()},T=e=>{t.current.valueCom.cycleType===5?(t.current.valueCom.frequencyUnit==="week"?delete t.current.valueCom.monthCycleType:(t.current.valueCom.frequencyUnit==="month"||delete t.current.valueCom.monthCycleType,delete t.current.valueCom.executionDay),t.current.valueCom.endType===0?(delete t.current.valueCom.endTime,delete t.current.valueCom.limitNum):t.current.valueCom.endType===1?delete t.current.valueCom.limitNum:delete t.current.valueCom.endTime):(delete t.current.valueCom.frequency,delete t.current.valueCom.frequencyUnit,delete t.current.valueCom.endType,delete t.current.valueCom.monthCycleType,delete t.current.valueCom.endTime,delete t.current.valueCom.limitNum,delete t.current.valueCom.executionDay);const s=e?{...t.current.value}:{...t.current.valueCom};s.startTime&&(s.startTime=_(s.startTime)),s.endTime&&(s.endTime=_(s.endTime)),G(s)},oe=e=>{e||q()},me=()=>{h(!0),N()},P=(e,s)=>{const l=e||p;if(l?.cycleType!==5||R)return;const a=[],c=n("every")+l.frequency+n(l.frequencyUnit),d=t.current.timeDetail?.hm;if(Y)return Y();if(l.frequencyUnit==="week"){const o=[];let v;l.executionDay?.split(",").forEach(Re=>{let C=Number(Re)-1;C===0?(C=7,v=n(`week${C}`)):o.push(n(`week${C}`))}),v&&o.push(v),a.push(n("text1",{every:c+o.join("、"),time:d}))}else if(l.frequencyUnit==="month")a.push(n("text1",{every:c,time:(t.current.monthCycleTypeListMap?.[l.monthCycleType]||"")+(d||"")}));else if(l.frequencyUnit==="day")a.push(n("text1",{every:c,time:d}));else{const o=n("monthDay",{month:t.current.timeDetail?.month,day:t.current.timeDetail?.day});a.push(n("text1",{every:c,time:`${o.join("")} ${d}`}))}return l.endType===2&&a.push(n("text2",{limitNum:l.limitNum})),l.endType===1&&a.push(n("text3",{date:D(l.endTime,"YYYY-MM-DD")})),s?a:r.jsxRuntimeExports.jsxs("p",{className:"text-tip",children:[a,!E&&r.jsxRuntimeExports.jsx(k.Button,{variant:"text",onClick:me,children:n("update")})]})},de=(e,s)=>{i.endTime=s,m({...i})},xe=e=>{e.target.value!==""&&parseInt(e.target.value.toString()),i.limitNum=e.target.value,m({...i})},pe=e=>{(e.target.value!==""?parseInt(e.target.value.toString()):0)<=0&&(i.limitNum=1,m({...i}))},j=e=>s=>{i[e]=s,m({...i})},b=e=>(e+=1,e===8&&(e=1),e),ye=e=>()=>{if(t.current.timeDetail?.weekDay===e){H(!0),clearTimeout(t.current.timerTip),t.current.timerTip=setTimeout(()=>{H(!1)},1300);return}ve(e)},ve=e=>{e=b(e);const s=i.executionDay?.split(",")||[],l={};s.forEach(a=>{l[a]=!0}),l[e.toString()]?delete l[e.toString()]:l[e.toString()]=!0,i.executionDay=Object.keys(l).join(","),t.current.valueCom={...i},m({...i})},fe=()=>r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsxs("div",{className:"item frequency",children:[r.jsxRuntimeExports.jsx("div",{className:"label",children:n("repetitionFrequency")}),r.jsxRuntimeExports.jsxs("div",{className:"form-content",children:[r.jsxRuntimeExports.jsx(f.default,{value:i.frequency,list:Q,className:"frequency-select",onChange:j("frequency")}),r.jsxRuntimeExports.jsx(f.default,{value:i.frequencyUnit,list:Z,onChange:j("frequencyUnit")})]})]}),i.frequencyUnit==="week"&&r.jsxRuntimeExports.jsxs("div",{className:"item execution-day",children:[r.jsxRuntimeExports.jsx("div",{className:"label"}),r.jsxRuntimeExports.jsxs("div",{className:"form-content",children:[r.jsxRuntimeExports.jsx("div",{className:"execution-day-select",children:new Array(7).fill(1).map((e,s)=>{const l={1:"one",2:"two",3:"three",4:"four",5:"five",6:"six",7:"seven"},a=b(s+1),c=i.executionDay?.indexOf(a.toString());let d=c!==void 0&&c!==-1;return t.current.timeDetail?.weekDay===s+1&&(d=!0),r.jsxRuntimeExports.jsx("div",{className:d?"select-item":"",onClick:ye(s+1),children:n(l[s+1])},s)})}),r.jsxRuntimeExports.jsxs("p",{className:ie?"tip show-tip":"tip",children:[r.jsxRuntimeExports.jsx(be.WarningCircleF,{}),r.jsxRuntimeExports.jsx("span",{children:n("weekTip",{week:n(`week${t.current.timeDetail?.weekDay}`)})})]})]})]}),i.frequencyUnit==="month"&&r.jsxRuntimeExports.jsxs("div",{className:"item month-cycle-type-list",children:[r.jsxRuntimeExports.jsx("div",{className:"label"}),r.jsxRuntimeExports.jsxs("div",{className:"form-content",children:[r.jsxRuntimeExports.jsx("div",{}),r.jsxRuntimeExports.jsx(f.default,{value:i.monthCycleType,list:re,onChange:j("monthCycleType")})]})]}),r.jsxRuntimeExports.jsxs("div",{className:"item end-type",children:[r.jsxRuntimeExports.jsx("div",{className:"label",children:n("endRepetition")}),r.jsxRuntimeExports.jsxs("div",{className:"form-content",children:[r.jsxRuntimeExports.jsx(f.default,{value:i.endType,list:te,className:"end-type-select",onChange:j("endType")}),r.jsxRuntimeExports.jsxs("div",{className:"right-box",children:[i.endType===1&&r.jsxRuntimeExports.jsx(F.default,{disabledDate:e=>e&&e<g(new Date(i.startTime).getTime()-1440*60*1e3),value:i.endTime,format:"YYYY-MM-DD",allowClear:!1,onChange:de}),i.endType===2&&r.jsxRuntimeExports.jsx(qe.TextField,{min:1,type:"number",placeholder:n("placeholder"),value:i.limitNum,onChange:xe,onBlur:pe,rightIcon:n("next")})]})]})]})]}),q=()=>{h(!1),T(!0)},he=()=>{h(!1),T()},Te=()=>r.jsxRuntimeExports.jsxs("div",{className:"cycle-selector-popover-content",children:[r.jsxRuntimeExports.jsxs("div",{className:"title",children:[r.jsxRuntimeExports.jsx("span",{className:"label",children:n("customCycle")}),r.jsxRuntimeExports.jsx(Ne.Close,{onClick:q})]}),r.jsxRuntimeExports.jsx("div",{className:"content",children:fe()}),r.jsxRuntimeExports.jsxs("div",{className:"footer",children:[r.jsxRuntimeExports.jsx(k.Button,{variant:"outlined",onClick:q,children:n("cancel")}),r.jsxRuntimeExports.jsx(k.Button,{onClick:he,children:n("confirm")})]})]}),je=()=>$||(e=>e&&e<g(new Date().getTime()-1440*60*1e3)),Ce=()=>{if(w)return w},Ee=()=>y!==void 0?y:K;return r.jsxRuntimeExports.jsxs("div",{className:De(`${B.$prefixCls}-cycle-selector`,V),style:W,children:[r.jsxRuntimeExports.jsx(ge.Popover,{content:Te(),open:Ee(),placement:"bottomRight",overlayClassName:`${B.$prefixCls}-cycle-selector-popover`,onVisibleChange:oe,children:r.jsxRuntimeExports.jsxs("div",{className:"cycle-selector-content",children:[r.jsxRuntimeExports.jsx(F.default,{disabled:E,value:i.startTime,className:"time-select",showTime:!0,format:"YYYY-MM-DD HH:mm",disabledDate:je(),disabledTime:Ce(),placeholder:n("pleaseSelect"),onChange:ae,error:R}),r.jsxRuntimeExports.jsx(f.default,{disabled:!i.startTime||E,list:J,className:"select-type",placeholder:n("pleaseSelect"),value:i.cycleType,onChange:e=>ce(Number(e))})]})}),P(),r.jsxRuntimeExports.jsx(Se.default,{error:R,hideErrorDom:I,helperText:z})]})};exports.default=Me;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index.css');const r=require("../_virtual/jsx-runtime.js"),u=require("react"),De=require("clsx"),g=require("dayjs"),Ne=require("../node_modules/@para-ui/icons/Close/index.js"),be=require("../node_modules/@para-ui/icons/WarningCircleF/index.js"),B=require("../GlobalContext/constant.js"),F=require("../DatePicker/index.js"),f=require("../Select/index.js"),qe=require("../TextField/index.js"),ge=require("../Popover/index.js"),k=require("../Button/index.js"),ke=require("../GlobalContext/index.js"),$e=require("../GlobalContext/useFormatMessage.js"),we=require("./lang/index.js"),Se=require("../HelperText/index.js"),Ye=require("../Utils/index.js");;/* empty css */const Me=O=>{const{className:V,style:W,value:p,disabled:E=!1,error:R,hideErrorDom:I,helperText:z,disabledDate:$,disabledTime:w,timeType:S,tipRender:Y,showPopover:y,cRef:A,onChange:G,disabledCustom:M=!1}=O,{language:U,locale:Ue}=u.useContext(ke.default),n=$e.default("CycleSelector",we.default),[i,m]=u.useState({}),[J,L]=u.useState([]),[K,h]=u.useState(!1),[Q,X]=u.useState([]),[Z,ee]=u.useState([]),[te,ne]=u.useState([]),[re,se]=u.useState([]),[ie,H]=u.useState(!1),t=u.useRef({valueCom:i,value:p});t.current.valueCom=i,t.current.value=p,u.useEffect(()=>{const e=[];for(let s=1;s<32;s++)e.push({label:n("every")+s,value:s});return X(e),ee([{label:n("day"),value:"day"},{label:n("week"),value:"week"},{label:n("month"),value:"month"},{label:n("year"),value:"year"}]),ne([{label:n("infiniteRepetition"),value:0},{label:n("deadline"),value:1},{label:n("limitNum"),value:2}]),t.current.endTypeMap={0:n("infiniteRepetition"),1:n("deadline"),2:n("limitNum")},()=>{clearTimeout(t.current.timerTip)}},[U]),u.useEffect(()=>{const e=p?{...p}:{};e.startTime||(e.cycleType=0),e.startTime&&(e.startTime=D(e.startTime,"YYYY-MM-DD HH:mm")),e.endTime&&(e.endTime=D(e.endTime,"YYYY-MM-DD")),m(e),t.current.valueCom=e,le()},[p,U,M]),u.useEffect(()=>{y!==void 0&&y&&N()},[y]),u.useImperativeHandle(A,()=>({getTipText:e=>P(e,!0)}));const _=e=>e?S==="zone"?new Date(e).toISOString():S==="stamp"?new Date(e).getTime():e:"",D=(e,s)=>e?g(e).format(s):"",le=()=>{if(!t.current.valueCom?.startTime){L([{label:n("noRepetition"),value:0}]);return}t.current.timeDetail=Ye.getDateYYYYMMddHHMM(t.current.valueCom?.startTime);const{month:e,day:s,weekDay:l,hm:a,week:c,date:d}=t.current.timeDetail;let o=[{label:n("noRepetition"),value:0},{label:`${n("repeatEveryDay")} ${a}`,value:1},{label:`${n("repeatEveryWeek")} ${n(`week${l}`)} ${a}`,value:2},{label:`${n("repeatEveryMonth")} ${s}${n("th")} ${a}`,value:3},{label:`${n("repeatEveryYear")} ${e}${n("month")}${s}${n("th")} ${a}`,value:4},{label:n("customRepetition"),value:5}];M&&(o=o.filter(v=>v.value!==5)),L(o),se([{label:n(`day${s}`),value:"day"},{label:n(`the${c}`)+n(`week${l}`),value:"week"}]),t.current.monthCycleTypeListMap={day:n(`day${s}`),week:n(`the${c}`)+n(`week${l}`)}},ae=(e,s)=>{t.current.valueCom.startTime=s,ue(),T()},x=e=>{const s=t.current.valueCom[e];return s===void 0||s===""||s===null},N=()=>{if(x("frequency")&&(t.current.valueCom.frequency=1),x("frequencyUnit")&&(t.current.valueCom.frequencyUnit="day"),x("endType")&&(t.current.valueCom.endType=0),x("monthCycleType")&&(t.current.valueCom.monthCycleType="day"),x("endTime")&&(t.current.valueCom.endTime=t.current.timeDetail?.date),x("limitNum")&&(t.current.valueCom.limitNum=1),x("executionDay")){const e=b(Number(t.current.timeDetail?.weekDay));t.current.valueCom.executionDay=`${e}`}m({...t.current.valueCom})},ue=()=>{t.current.valueCom={startTime:t.current.valueCom.startTime,cycleType:0}},ce=e=>{t.current.valueCom.cycleType=e,m({...t.current.valueCom}),e===5?(h(!0),N()):T()},T=e=>{t.current.valueCom.cycleType===5?(t.current.valueCom.frequencyUnit==="week"?delete t.current.valueCom.monthCycleType:(t.current.valueCom.frequencyUnit==="month"||delete t.current.valueCom.monthCycleType,delete t.current.valueCom.executionDay),t.current.valueCom.endType===0?(delete t.current.valueCom.endTime,delete t.current.valueCom.limitNum):t.current.valueCom.endType===1?delete t.current.valueCom.limitNum:delete t.current.valueCom.endTime):(delete t.current.valueCom.frequency,delete t.current.valueCom.frequencyUnit,delete t.current.valueCom.endType,delete t.current.valueCom.monthCycleType,delete t.current.valueCom.endTime,delete t.current.valueCom.limitNum,delete t.current.valueCom.executionDay);const s=e?{...t.current.value}:{...t.current.valueCom};s.startTime&&(s.startTime=_(s.startTime)),s.endTime&&(s.endTime=_(s.endTime)),G(s)},oe=e=>{e||q()},me=()=>{h(!0),N()},P=(e,s)=>{const l=e||p;if(l?.cycleType!==5||R)return;const a=[],c=n("every")+l.frequency+n(l.frequencyUnit),d=t.current.timeDetail?.hm;if(Y)return Y();if(l.frequencyUnit==="week"){const o=[];let v;l.executionDay?.split(",").forEach(Re=>{let C=Number(Re)-1;C===0?(C=7,v=n(`week${C}`)):o.push(n(`week${C}`))}),v&&o.push(v),a.push(n("text1",{every:c+o.join("、"),time:d}))}else if(l.frequencyUnit==="month")a.push(n("text1",{every:c,time:(t.current.monthCycleTypeListMap?.[l.monthCycleType]||"")+(d||"")}));else if(l.frequencyUnit==="day")a.push(n("text1",{every:c,time:d}));else{const o=n("monthDay",{month:t.current.timeDetail?.month,day:t.current.timeDetail?.day});a.push(n("text1",{every:c,time:`${o.join("")} ${d}`}))}return l.endType===2&&a.push(n("text2",{limitNum:l.limitNum})),l.endType===1&&a.push(n("text3",{date:D(l.endTime,"YYYY-MM-DD")})),s?a:r.jsxRuntimeExports.jsxs("p",{className:"text-tip",children:[a,!E&&r.jsxRuntimeExports.jsx(k.Button,{variant:"text",onClick:me,children:n("update")})]})},de=(e,s)=>{i.endTime=s,m({...i})},xe=e=>{const s=e.target.value!==""?parseInt(e.target.value.toString()):0;i.limitNum=s,m({...i})},pe=e=>{(e.target.value!==""?parseInt(e.target.value.toString()):0)<=0&&(i.limitNum=1,m({...i}))},j=e=>s=>{i[e]=s,m({...i})},b=e=>(e+=1,e===8&&(e=1),e),ye=e=>()=>{if(t.current.timeDetail?.weekDay===e){H(!0),clearTimeout(t.current.timerTip),t.current.timerTip=setTimeout(()=>{H(!1)},1300);return}ve(e)},ve=e=>{e=b(e);const s=i.executionDay?.split(",")||[],l={};s.forEach(a=>{l[a]=!0}),l[e.toString()]?delete l[e.toString()]:l[e.toString()]=!0,i.executionDay=Object.keys(l).join(","),t.current.valueCom={...i},m({...i})},fe=()=>r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsxs("div",{className:"item frequency",children:[r.jsxRuntimeExports.jsx("div",{className:"label",children:n("repetitionFrequency")}),r.jsxRuntimeExports.jsxs("div",{className:"form-content",children:[r.jsxRuntimeExports.jsx(f.default,{value:i.frequency,list:Q,className:"frequency-select",onChange:j("frequency")}),r.jsxRuntimeExports.jsx(f.default,{value:i.frequencyUnit,list:Z,onChange:j("frequencyUnit")})]})]}),i.frequencyUnit==="week"&&r.jsxRuntimeExports.jsxs("div",{className:"item execution-day",children:[r.jsxRuntimeExports.jsx("div",{className:"label"}),r.jsxRuntimeExports.jsxs("div",{className:"form-content",children:[r.jsxRuntimeExports.jsx("div",{className:"execution-day-select",children:new Array(7).fill(1).map((e,s)=>{const l={1:"one",2:"two",3:"three",4:"four",5:"five",6:"six",7:"seven"},a=b(s+1),c=i.executionDay?.indexOf(a.toString());let d=c!==void 0&&c!==-1;return t.current.timeDetail?.weekDay===s+1&&(d=!0),r.jsxRuntimeExports.jsx("div",{className:d?"select-item":"",onClick:ye(s+1),children:n(l[s+1])},s)})}),r.jsxRuntimeExports.jsxs("p",{className:ie?"tip show-tip":"tip",children:[r.jsxRuntimeExports.jsx(be.WarningCircleF,{}),r.jsxRuntimeExports.jsx("span",{children:n("weekTip",{week:n(`week${t.current.timeDetail?.weekDay}`)})})]})]})]}),i.frequencyUnit==="month"&&r.jsxRuntimeExports.jsxs("div",{className:"item month-cycle-type-list",children:[r.jsxRuntimeExports.jsx("div",{className:"label"}),r.jsxRuntimeExports.jsxs("div",{className:"form-content",children:[r.jsxRuntimeExports.jsx("div",{}),r.jsxRuntimeExports.jsx(f.default,{value:i.monthCycleType,list:re,onChange:j("monthCycleType")})]})]}),r.jsxRuntimeExports.jsxs("div",{className:"item end-type",children:[r.jsxRuntimeExports.jsx("div",{className:"label",children:n("endRepetition")}),r.jsxRuntimeExports.jsxs("div",{className:"form-content",children:[r.jsxRuntimeExports.jsx(f.default,{value:i.endType,list:te,className:"end-type-select",onChange:j("endType")}),r.jsxRuntimeExports.jsxs("div",{className:"right-box",children:[i.endType===1&&r.jsxRuntimeExports.jsx(F.default,{disabledDate:e=>e&&e<g(new Date(i.startTime).getTime()-1440*60*1e3),value:i.endTime,format:"YYYY-MM-DD",allowClear:!1,onChange:de}),i.endType===2&&r.jsxRuntimeExports.jsx(qe.TextField,{min:1,type:"number",placeholder:n("placeholder"),value:i.limitNum,onChange:xe,onBlur:pe,rightIcon:n("next")})]})]})]})]}),q=()=>{h(!1),T(!0)},he=()=>{h(!1),T()},Te=()=>r.jsxRuntimeExports.jsxs("div",{className:"cycle-selector-popover-content",children:[r.jsxRuntimeExports.jsxs("div",{className:"title",children:[r.jsxRuntimeExports.jsx("span",{className:"label",children:n("customCycle")}),r.jsxRuntimeExports.jsx(Ne.Close,{onClick:q})]}),r.jsxRuntimeExports.jsx("div",{className:"content",children:fe()}),r.jsxRuntimeExports.jsxs("div",{className:"footer",children:[r.jsxRuntimeExports.jsx(k.Button,{variant:"outlined",onClick:q,children:n("cancel")}),r.jsxRuntimeExports.jsx(k.Button,{onClick:he,children:n("confirm")})]})]}),je=()=>$||(e=>e&&e<g(new Date().getTime()-1440*60*1e3)),Ce=()=>{if(w)return w},Ee=()=>y!==void 0?y:K;return r.jsxRuntimeExports.jsxs("div",{className:De(`${B.$prefixCls}-cycle-selector`,V),style:W,children:[r.jsxRuntimeExports.jsx(ge.Popover,{content:Te(),open:Ee(),placement:"bottomRight",overlayClassName:`${B.$prefixCls}-cycle-selector-popover`,onVisibleChange:oe,children:r.jsxRuntimeExports.jsxs("div",{className:"cycle-selector-content",children:[r.jsxRuntimeExports.jsx(F.default,{disabled:E,value:i.startTime,className:"time-select",showTime:!0,format:"YYYY-MM-DD HH:mm",disabledDate:je(),disabledTime:Ce(),placeholder:n("pleaseSelect"),onChange:ae,error:R}),r.jsxRuntimeExports.jsx(f.default,{disabled:!i.startTime||E,list:J,className:"select-type",placeholder:n("pleaseSelect"),value:i.cycleType,onChange:e=>ce(Number(e))})]})}),P(),r.jsxRuntimeExports.jsx(Se.default,{error:R,hideErrorDom:I,helperText:z})]})};exports.default=Me;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|