@zat-design/sisyphus-react 4.0.0-beta.4 → 4.0.0-beta.6
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/dist/index.esm.css +1 -0
- package/dist/index.min.js +1 -0
- package/dist/less.esm.css +1 -0
- package/dist/less.min.js +1 -0
- package/es/FormsProvider/index.js +5 -5
- package/es/ProAction/components/CheckModalContent/index.js +5 -7
- package/es/ProAction/index.js +16 -16
- package/es/ProConfigProvider/index.js +31 -17
- package/es/ProDownload/index.js +13 -12
- package/es/ProDownload/utils.js +15 -15
- package/es/ProDrawerForm/components/ProDrawer/index.js +22 -19
- package/es/ProDrawerForm/components/ProModal/index.js +14 -9
- package/es/ProDrawerForm/index.js +6 -10
- package/es/ProDrawerForm/utils/index.js +1 -1
- package/es/ProEditLabel/components/RenderProForm.js +10 -9
- package/es/ProEditLabel/index.js +36 -24
- package/es/ProEditLabel/utils/index.js +4 -3
- package/es/ProEditTable/components/ActionButton/index.js +58 -56
- package/es/ProEditTable/components/RcTable/BaseTable.js +21 -20
- package/es/ProEditTable/components/RcTable/DraggableTable.js +27 -34
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +40 -46
- package/es/ProEditTable/components/RenderField/index.js +98 -121
- package/es/ProEditTable/components/RenderToolbar/index.js +27 -33
- package/es/ProEditTable/components/Summary/index.js +16 -14
- package/es/ProEditTable/components/Validator/index.js +9 -6
- package/es/ProEditTable/index.js +130 -147
- package/es/ProEditTable/utils/config.js +29 -36
- package/es/ProEditTable/utils/diffOriginal.js +13 -13
- package/es/ProEditTable/utils/getDefaultProps.js +6 -7
- package/es/ProEditTable/utils/index.js +52 -58
- package/es/ProEditTable/utils/tools.js +32 -41
- package/es/ProEditTable/utils/transform.js +7 -11
- package/es/ProEditTable/utils/useEditTableError.js +10 -12
- package/es/ProEnum/components/Group.js +18 -22
- package/es/ProEnum/components/Tag.js +10 -14
- package/es/ProEnum/hooks/useEnum.js +6 -10
- package/es/ProEnum/hooks/useEnumRequest.js +23 -25
- package/es/ProEnum/hooks/useFrequentEnumRequest.d.ts +14 -0
- package/es/ProEnum/hooks/useFrequentEnumRequest.js +76 -0
- package/es/ProEnum/index.js +50 -52
- package/es/ProEnum/propsType.d.ts +29 -0
- package/es/ProEnum/utils/eventCenter.js +20 -31
- package/es/ProEnum/utils/frequentEnum.d.ts +40 -0
- package/es/ProEnum/utils/frequentEnum.js +91 -0
- package/es/ProEnum/utils/getEnumLabel.js +8 -12
- package/es/ProEnum/utils/index.js +6 -6
- package/es/ProForm/components/Container.js +4 -3
- package/es/ProForm/components/FormFooter/index.js +16 -13
- package/es/ProForm/components/base/Checkbox/index.js +10 -11
- package/es/ProForm/components/base/DatePicker/index.js +8 -7
- package/es/ProForm/components/base/DatePicker/useDateLimit.js +2 -4
- package/es/ProForm/components/base/Input/index.js +24 -20
- package/es/ProForm/components/base/InputNumber/index.js +21 -18
- package/es/ProForm/components/base/Radio/index.js +11 -12
- package/es/ProForm/components/base/RangePicker/index.js +9 -12
- package/es/ProForm/components/base/RangePicker/useDateRange.js +3 -3
- package/es/ProForm/components/base/Select/index.js +9 -8
- package/es/ProForm/components/base/Switch/index.js +7 -6
- package/es/ProForm/components/base/SwitchCheckbox/index.js +7 -6
- package/es/ProForm/components/base/TextArea/index.js +9 -8
- package/es/ProForm/components/base/TimePicker/index.js +5 -4
- package/es/ProForm/components/combination/Container/index.js +12 -12
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +60 -70
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +11 -7
- package/es/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
- package/es/ProForm/components/combination/FormList/components/Empty.js +9 -10
- package/es/ProForm/components/combination/FormList/components/LineFields.js +10 -9
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +32 -36
- package/es/ProForm/components/combination/FormList/index.js +25 -33
- package/es/ProForm/components/combination/FormList/utils.js +5 -7
- package/es/ProForm/components/combination/Group/component/AddonWrapper/index.js +1 -1
- package/es/ProForm/components/combination/Group/component/ComRender.js +14 -14
- package/es/ProForm/components/combination/Group/hooks/index.d.ts +0 -1
- package/es/ProForm/components/combination/Group/hooks/index.js +30 -35
- package/es/ProForm/components/combination/Group/index.js +35 -29
- package/es/ProForm/components/combination/Group/propsType.d.ts +2 -0
- package/es/ProForm/components/combination/Group/style/index.less +7 -0
- package/es/ProForm/components/combination/Group/utils.d.ts +0 -1
- package/es/ProForm/components/combination/Group/utils.js +38 -39
- package/es/ProForm/components/combination/ProCascader/index.js +43 -52
- package/es/ProForm/components/combination/ProCascader/utils/index.js +3 -3
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +16 -16
- package/es/ProForm/components/combination/ProModalSelect/index.js +102 -108
- package/es/ProForm/components/combination/ProModalSelect/utils/index.js +1 -1
- package/es/ProForm/components/combination/ProNumberRange/index.js +73 -47
- package/es/ProForm/components/combination/ProNumberRange/propsType.d.ts +3 -2
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
- package/es/ProForm/components/combination/ProRangeLimit/index.js +20 -18
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +3 -3
- package/es/ProForm/components/combination/ProTimeLimit/index.js +17 -15
- package/es/ProForm/components/render/ChangedWrapper.js +24 -26
- package/es/ProForm/components/render/ConfirmWrapper.js +10 -11
- package/es/ProForm/components/render/Render.js +107 -102
- package/es/ProForm/components/render/RenderFields.d.ts +0 -1
- package/es/ProForm/components/render/RenderFields.js +22 -24
- package/es/ProForm/index.js +44 -45
- package/es/ProForm/propsType.d.ts +1 -4
- package/es/ProForm/utils/diffOriginal.js +9 -9
- package/es/ProForm/utils/getDefaultProps.js +5 -5
- package/es/ProForm/utils/index.js +62 -90
- package/es/ProForm/utils/processDependencies.js +4 -5
- package/es/ProForm/utils/rulesCreator.js +12 -12
- package/es/ProForm/utils/transformNames.js +2 -2
- package/es/ProForm/utils/transformValue.js +6 -8
- package/es/ProForm/utils/useDeepCompareMemo.js +1 -1
- package/es/ProForm/utils/useFieldProps.js +1 -3
- package/es/ProForm/utils/useForm.js +19 -21
- package/es/ProForm/utils/useRules.js +17 -22
- package/es/ProForm/utils/useShouldUpdate.js +79 -83
- package/es/ProForm/utils/useWatch.js +12 -12
- package/es/ProForm/utils/valueType.js +46 -50
- package/es/ProIcon/index.js +30 -31
- package/es/ProIcon/utils/index.js +5 -5
- package/es/ProLayout/components/Layout/Header/index.js +1 -1
- package/es/ProLayout/components/Layout/Icon/Icon.js +4 -4
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +19 -22
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +23 -30
- package/es/ProLayout/components/Layout/Menu/SideMenu/index.js +3 -3
- package/es/ProLayout/components/Layout/Menu/index.js +9 -9
- package/es/ProLayout/components/Layout/Notice/index.js +3 -3
- package/es/ProLayout/components/ProCollapse/index.js +23 -18
- package/es/ProLayout/components/ProFooter/index.js +13 -14
- package/es/ProLayout/components/ProHeader/components/Copy/index.js +6 -5
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.js +6 -5
- package/es/ProLayout/components/ProHeader/index.js +68 -59
- package/es/ProLayout/components/ProHeader/utils/index.js +1 -1
- package/es/ProLayout/index.js +33 -32
- package/es/ProLayout/utils/index.js +17 -18
- package/es/ProSelect/components/AdaptiveTooltip.js +8 -9
- package/es/ProSelect/index.js +57 -64
- package/es/ProSelect/utils/index.js +17 -28
- package/es/ProStep/components/Anchor/index.js +10 -9
- package/es/ProStep/components/Item/index.js +11 -11
- package/es/ProStep/components/Listener/index.js +6 -10
- package/es/ProStep/components/Step/index.js +9 -11
- package/es/ProStep/index.js +24 -30
- package/es/ProStep/utils/index.js +8 -8
- package/es/ProStepTab/index.js +27 -28
- package/es/ProTable/components/FormatColumn/index.js +54 -59
- package/es/ProTable/components/RcTable/components/BaseTable/index.js +6 -7
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +21 -37
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +16 -17
- package/es/ProTable/components/RcTable/components/DraggableTable/index.js +5 -6
- package/es/ProTable/components/RenderColumn/index.js +36 -35
- package/es/ProTable/components/RenderEmptyText/index.js +1 -1
- package/es/ProTable/components/RenderFooter/index.js +2 -2
- package/es/ProTable/components/RenderSummary/index.js +13 -12
- package/es/ProTable/components/RenderTableHeader/index.js +5 -4
- package/es/ProTable/components/RenderTabs/index.js +26 -29
- package/es/ProTable/components/TableResizable/index.js +8 -8
- package/es/ProTable/components/TooltipTitle/index.js +4 -3
- package/es/ProTable/hooks/useAntdTable.js +80 -95
- package/es/ProTable/index.js +110 -133
- package/es/ProTable/propsType.d.ts +9 -3
- package/es/ProTable/utils/index.js +13 -16
- package/es/ProTabs/components/Card/index.js +14 -8
- package/es/ProTabs/index.js +30 -20
- package/es/ProTabs/propType.d.ts +5 -0
- package/es/ProTabs/style/index.less +40 -3
- package/es/ProThemeTools/component/ProTools/index.js +46 -39
- package/es/ProThemeTools/context/ThemeContext.js +13 -13
- package/es/ProThemeTools/index.js +18 -19
- package/es/ProThemeTools/utils/index.js +14 -18
- package/es/ProTooltip/index.js +24 -27
- package/es/ProTree/components/AdaptiveTooltip.js +5 -6
- package/es/ProTree/components/List.js +10 -13
- package/es/ProTree/components/ProTree.js +47 -64
- package/es/ProTree/components/ProTreeSelect/index.js +77 -76
- package/es/ProTree/components/Tree.js +23 -22
- package/es/ProTree/index.js +1 -1
- package/es/ProTree/utils.js +14 -14
- package/es/ProTreeModal/components/Cascader.js +13 -16
- package/es/ProTreeModal/components/List.js +49 -70
- package/es/ProTreeModal/components/SortableItem.js +7 -8
- package/es/ProTreeModal/components/Tree.js +18 -23
- package/es/ProTreeModal/components/Trigger.js +15 -10
- package/es/ProTreeModal/index.js +98 -151
- package/es/ProTreeModal/utils.js +21 -21
- package/es/ProUpload/components/ButtonRender.js +11 -12
- package/es/ProUpload/components/DragRender.js +17 -20
- package/es/ProUpload/components/DraggableUploadListItem.js +2 -2
- package/es/ProUpload/components/Example.js +3 -3
- package/es/ProUpload/components/FileItem.js +30 -25
- package/es/ProUpload/components/ImageRender.js +29 -22
- package/es/ProUpload/index.js +55 -66
- package/es/ProUpload/uitls.js +2 -2
- package/es/ProUtils/utils/index.js +10 -14
- package/es/ProViewer/index.js +22 -19
- package/es/ProViewer/propsType.js +0 -3
- package/es/ProWaterMark/index.js +4 -3
- package/es/index.d.ts +1 -1
- package/es/locale/index.js +2 -2
- package/es/style/index.less +1 -1
- package/es/style/theme/base.less +1 -0
- package/es/utils/index.js +11 -13
- package/lib/FormsProvider/index.js +30 -50
- package/lib/ProAction/components/CheckModalContent/index.js +31 -27
- package/lib/ProAction/index.js +194 -151
- package/lib/ProAction/propsType.js +4 -16
- package/lib/ProConfigProvider/index.js +136 -136
- package/lib/ProDownload/index.js +192 -124
- package/lib/ProDownload/propsType.js +4 -16
- package/lib/ProDownload/utils.js +189 -143
- package/lib/ProDrawerForm/components/ProDrawer/index.js +243 -169
- package/lib/ProDrawerForm/components/ProModal/index.js +194 -134
- package/lib/ProDrawerForm/components/index.js +17 -39
- package/lib/ProDrawerForm/index.js +79 -88
- package/lib/ProDrawerForm/propsType.js +4 -16
- package/lib/ProDrawerForm/utils/index.js +13 -30
- package/lib/ProEditLabel/components/RenderProForm.js +58 -57
- package/lib/ProEditLabel/index.js +251 -178
- package/lib/ProEditLabel/propsType.js +4 -16
- package/lib/ProEditLabel/utils/index.js +11 -26
- package/lib/ProEditTable/components/ActionButton/index.js +144 -155
- package/lib/ProEditTable/components/RcTable/BaseTable.js +97 -96
- package/lib/ProEditTable/components/RcTable/DraggableTable.js +172 -151
- package/lib/ProEditTable/components/RcTable/index.js +17 -39
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +177 -176
- package/lib/ProEditTable/components/RenderField/index.js +628 -539
- package/lib/ProEditTable/components/RenderToolbar/index.js +119 -105
- package/lib/ProEditTable/components/Summary/index.js +70 -61
- package/lib/ProEditTable/components/Validator/index.js +30 -47
- package/lib/ProEditTable/components/index.js +38 -48
- package/lib/ProEditTable/index.js +379 -324
- package/lib/ProEditTable/propsType.js +4 -16
- package/lib/ProEditTable/utils/config.js +225 -170
- package/lib/ProEditTable/utils/diffOriginal.js +93 -80
- package/lib/ProEditTable/utils/getDefaultProps.js +26 -42
- package/lib/ProEditTable/utils/index.js +318 -244
- package/lib/ProEditTable/utils/tools.js +438 -243
- package/lib/ProEditTable/utils/transform.js +15 -28
- package/lib/ProEditTable/utils/useEditTableError.js +65 -54
- package/lib/ProEnum/components/Group.js +53 -81
- package/lib/ProEnum/components/Tag.js +37 -54
- package/lib/ProEnum/hooks/useEnum.js +72 -52
- package/lib/ProEnum/hooks/useEnumRequest.js +267 -194
- package/lib/ProEnum/hooks/useFrequentEnumRequest.d.ts +14 -0
- package/lib/ProEnum/hooks/useFrequentEnumRequest.js +83 -0
- package/lib/ProEnum/index.js +239 -234
- package/lib/ProEnum/propsType.d.ts +29 -0
- package/lib/ProEnum/propsType.js +4 -16
- package/lib/ProEnum/utils/eventCenter.js +15 -12
- package/lib/ProEnum/utils/frequentEnum.d.ts +40 -0
- package/lib/ProEnum/utils/frequentEnum.js +99 -0
- package/lib/ProEnum/utils/getEnumLabel.js +57 -65
- package/lib/ProEnum/utils/index.js +98 -68
- package/lib/ProForm/components/Container.js +35 -45
- package/lib/ProForm/components/FormFooter/index.js +67 -80
- package/lib/ProForm/components/FormFooter/propsType.js +4 -16
- package/lib/ProForm/components/base/Checkbox/index.js +67 -62
- package/lib/ProForm/components/base/DatePicker/index.js +63 -74
- package/lib/ProForm/components/base/DatePicker/useDateLimit.js +13 -29
- package/lib/ProForm/components/base/Input/index.js +65 -73
- package/lib/ProForm/components/base/Input/propsType.js +4 -16
- package/lib/ProForm/components/base/InputNumber/index.js +230 -176
- package/lib/ProForm/components/base/Radio/index.js +60 -69
- package/lib/ProForm/components/base/RangePicker/index.js +73 -88
- package/lib/ProForm/components/base/RangePicker/useDateRange.js +28 -45
- package/lib/ProForm/components/base/Select/index.js +63 -69
- package/lib/ProForm/components/base/Switch/index.js +43 -59
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +63 -62
- package/lib/ProForm/components/base/TextArea/index.js +52 -65
- package/lib/ProForm/components/base/TimePicker/index.js +45 -59
- package/lib/ProForm/components/combination/Container/index.js +58 -72
- package/lib/ProForm/components/combination/Container/propsType.js +4 -16
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +240 -195
- package/lib/ProForm/components/combination/FormList/components/BlockFields.js +85 -107
- package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +25 -44
- package/lib/ProForm/components/combination/FormList/components/Empty.js +92 -55
- package/lib/ProForm/components/combination/FormList/components/LineFields.js +92 -117
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +133 -101
- package/lib/ProForm/components/combination/FormList/index.js +131 -164
- package/lib/ProForm/components/combination/FormList/propsType.js +4 -16
- package/lib/ProForm/components/combination/FormList/utils.js +32 -52
- package/lib/ProForm/components/combination/Group/component/AddonWrapper/index.js +23 -38
- package/lib/ProForm/components/combination/Group/component/ComRender.js +78 -74
- package/lib/ProForm/components/combination/Group/hooks/index.d.ts +0 -1
- package/lib/ProForm/components/combination/Group/hooks/index.js +123 -123
- package/lib/ProForm/components/combination/Group/index.js +99 -104
- package/lib/ProForm/components/combination/Group/propsType.d.ts +2 -0
- package/lib/ProForm/components/combination/Group/propsType.js +4 -16
- package/lib/ProForm/components/combination/Group/style/index.less +7 -0
- package/lib/ProForm/components/combination/Group/utils.d.ts +0 -1
- package/lib/ProForm/components/combination/Group/utils.js +132 -104
- package/lib/ProForm/components/combination/ProCascader/index.js +271 -226
- package/lib/ProForm/components/combination/ProCascader/propsType.js +4 -16
- package/lib/ProForm/components/combination/ProCascader/utils/index.js +23 -33
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +113 -114
- package/lib/ProForm/components/combination/ProModalSelect/index.js +651 -472
- package/lib/ProForm/components/combination/ProModalSelect/propsType.js +4 -16
- package/lib/ProForm/components/combination/ProModalSelect/utils/index.js +21 -43
- package/lib/ProForm/components/combination/ProNumberRange/index.js +207 -160
- package/lib/ProForm/components/combination/ProNumberRange/propsType.d.ts +3 -2
- package/lib/ProForm/components/combination/ProNumberRange/propsType.js +4 -16
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +169 -139
- package/lib/ProForm/components/combination/ProRangeLimit/propsType.js +4 -16
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +28 -49
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +150 -127
- package/lib/ProForm/components/index.js +192 -115
- package/lib/ProForm/components/render/ChangedWrapper.js +130 -141
- package/lib/ProForm/components/render/ConfirmWrapper.js +120 -78
- package/lib/ProForm/components/render/Render.js +445 -346
- package/lib/ProForm/components/render/RenderFields.d.ts +0 -1
- package/lib/ProForm/components/render/RenderFields.js +195 -181
- package/lib/ProForm/components/render/propsType.js +31 -17
- package/lib/ProForm/index.js +282 -235
- package/lib/ProForm/propsType.d.ts +1 -4
- package/lib/ProForm/propsType.js +9 -38
- package/lib/ProForm/utils/diffOriginal.js +88 -81
- package/lib/ProForm/utils/getDefaultProps.js +26 -42
- package/lib/ProForm/utils/index.js +330 -254
- package/lib/ProForm/utils/processDependencies.js +61 -44
- package/lib/ProForm/utils/rulesCreator.js +58 -81
- package/lib/ProForm/utils/transformNames.js +26 -37
- package/lib/ProForm/utils/transformValue.js +47 -47
- package/lib/ProForm/utils/useDeepCompareMemo.js +15 -34
- package/lib/ProForm/utils/useFieldProps.js +10 -42
- package/lib/ProForm/utils/useForm.js +226 -118
- package/lib/ProForm/utils/useRules.js +50 -60
- package/lib/ProForm/utils/useShouldUpdate.js +233 -126
- package/lib/ProForm/utils/useWatch.js +122 -93
- package/lib/ProForm/utils/valueType.js +222 -155
- package/lib/ProIcon/config/index.js +278 -365
- package/lib/ProIcon/index.js +217 -184
- package/lib/ProIcon/propsTypes.js +4 -16
- package/lib/ProIcon/symbolIcon.js +30 -23
- package/lib/ProIcon/utils/index.js +53 -60
- package/lib/ProLayout/components/Layout/Header/index.js +42 -59
- package/lib/ProLayout/components/Layout/Icon/Icon.js +31 -49
- package/lib/ProLayout/components/Layout/Icon/index.js +7 -34
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +170 -139
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +135 -117
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/propsType.js +4 -16
- package/lib/ProLayout/components/Layout/Menu/SideMenu/index.js +44 -60
- package/lib/ProLayout/components/Layout/Menu/index.js +52 -71
- package/lib/ProLayout/components/Layout/Notice/index.js +31 -39
- package/lib/ProLayout/components/Layout/index.js +31 -45
- package/lib/ProLayout/components/ProCollapse/PropTypes.js +4 -16
- package/lib/ProLayout/components/ProCollapse/index.js +159 -148
- package/lib/ProLayout/components/ProFooter/PropTypes.js +4 -16
- package/lib/ProLayout/components/ProFooter/index.js +41 -56
- package/lib/ProLayout/components/ProHeader/PropTypes.js +4 -16
- package/lib/ProLayout/components/ProHeader/components/Copy/index.js +26 -53
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/index.js +27 -48
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/propsType.js +4 -16
- package/lib/ProLayout/components/ProHeader/components/index.js +17 -39
- package/lib/ProLayout/components/ProHeader/index.js +466 -268
- package/lib/ProLayout/components/ProHeader/utils/index.js +14 -31
- package/lib/ProLayout/components/index.js +24 -42
- package/lib/ProLayout/index.js +139 -130
- package/lib/ProLayout/propTypes.js +4 -16
- package/lib/ProLayout/utils/index.js +120 -86
- package/lib/ProSelect/components/AdaptiveTooltip.js +38 -45
- package/lib/ProSelect/index.js +240 -213
- package/lib/ProSelect/propsType.js +4 -16
- package/lib/ProSelect/utils/index.js +114 -93
- package/lib/ProStep/components/Anchor/index.js +102 -107
- package/lib/ProStep/components/Item/index.js +71 -75
- package/lib/ProStep/components/Listener/index.js +69 -62
- package/lib/ProStep/components/Step/index.js +65 -75
- package/lib/ProStep/index.js +227 -165
- package/lib/ProStep/propsType.js +4 -16
- package/lib/ProStep/utils/index.js +54 -57
- package/lib/ProStepTab/index.js +307 -166
- package/lib/ProStepTab/propsType.js +4 -16
- package/lib/ProTable/components/FormatColumn/index.js +472 -425
- package/lib/ProTable/components/RcTable/components/BaseTable/index.js +39 -53
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +183 -135
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +85 -104
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/propsType.js +4 -16
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +58 -80
- package/lib/ProTable/components/RcTable/index.js +17 -39
- package/lib/ProTable/components/RenderColumn/index.js +203 -194
- package/lib/ProTable/components/RenderEmptyText/index.js +25 -27
- package/lib/ProTable/components/RenderFooter/index.js +17 -33
- package/lib/ProTable/components/RenderSummary/index.js +57 -46
- package/lib/ProTable/components/RenderTableHeader/index.js +62 -68
- package/lib/ProTable/components/RenderTabs/index.js +67 -80
- package/lib/ProTable/components/TableResizable/index.js +87 -87
- package/lib/ProTable/components/TooltipTitle/index.js +27 -40
- package/lib/ProTable/components/index.js +45 -51
- package/lib/ProTable/hooks/useAntdTable.js +351 -304
- package/lib/ProTable/index.js +354 -333
- package/lib/ProTable/propsType.d.ts +9 -3
- package/lib/ProTable/propsType.js +4 -16
- package/lib/ProTable/utils/index.js +89 -78
- package/lib/ProTabs/components/Card/index.js +57 -30
- package/lib/ProTabs/components/index.js +10 -36
- package/lib/ProTabs/index.js +94 -89
- package/lib/ProTabs/propType.d.ts +5 -0
- package/lib/ProTabs/propType.js +4 -16
- package/lib/ProTabs/style/index.less +40 -3
- package/lib/ProThemeTools/component/ProTools/index.js +246 -198
- package/lib/ProThemeTools/component/index.js +10 -36
- package/lib/ProThemeTools/context/ThemeContext.js +99 -89
- package/lib/ProThemeTools/index.js +207 -172
- package/lib/ProThemeTools/propsType.js +4 -16
- package/lib/ProThemeTools/utils/index.js +84 -80
- package/lib/ProTooltip/index.js +217 -214
- package/lib/ProTooltip/propsType.js +4 -16
- package/lib/ProTree/components/AdaptiveTooltip.js +22 -33
- package/lib/ProTree/components/CloseIcon.js +31 -36
- package/lib/ProTree/components/List.js +69 -68
- package/lib/ProTree/components/ProTree.js +346 -258
- package/lib/ProTree/components/ProTreeSelect/index.js +460 -336
- package/lib/ProTree/components/ProTreeSelect/propsType.js +4 -16
- package/lib/ProTree/components/SearchTitle.js +50 -47
- package/lib/ProTree/components/Tree.js +300 -227
- package/lib/ProTree/components/index.js +31 -45
- package/lib/ProTree/index.js +22 -45
- package/lib/ProTree/propsType.js +4 -16
- package/lib/ProTree/utils.js +140 -79
- package/lib/ProTreeModal/components/Cascader.js +90 -97
- package/lib/ProTreeModal/components/CloseIcon.js +31 -36
- package/lib/ProTreeModal/components/List.js +246 -192
- package/lib/ProTreeModal/components/SearchTitle.js +22 -30
- package/lib/ProTreeModal/components/SortableItem.js +59 -60
- package/lib/ProTreeModal/components/Tree.js +171 -157
- package/lib/ProTreeModal/components/Trigger.js +131 -108
- package/lib/ProTreeModal/components/index.js +45 -51
- package/lib/ProTreeModal/index.js +523 -448
- package/lib/ProTreeModal/propsType.js +4 -16
- package/lib/ProTreeModal/utils.js +160 -99
- package/lib/ProUpload/components/ButtonRender.js +106 -85
- package/lib/ProUpload/components/DragRender.js +167 -117
- package/lib/ProUpload/components/DraggableUploadListItem.js +32 -48
- package/lib/ProUpload/components/Example.js +39 -55
- package/lib/ProUpload/components/FileItem.js +215 -113
- package/lib/ProUpload/components/ImageRender.js +250 -175
- package/lib/ProUpload/index.js +185 -181
- package/lib/ProUpload/propsType.js +4 -16
- package/lib/ProUpload/uitls.js +9 -31
- package/lib/ProUtils/utils/index.js +20 -36
- package/lib/ProViewer/index.js +210 -175
- package/lib/ProViewer/propsType.js +1 -17
- package/lib/ProWaterMark/index.js +20 -38
- package/lib/ProWaterMark/propsType.js +4 -16
- package/lib/index.d.ts +1 -1
- package/lib/index.js +272 -123
- package/lib/locale/en_US.js +127 -145
- package/lib/locale/index.js +40 -55
- package/lib/locale/zh_CN.js +128 -146
- package/lib/style/index.less +1 -1
- package/lib/style/theme/base.less +1 -0
- package/lib/tokens.js +87 -103
- package/lib/utils/index.js +66 -88
- package/package.json +11 -11
- package/dist/esm/index.d.ts +0 -5
- package/dist/esm/index.js +0 -5
- package/dist/esm/regExp/index.d.ts +0 -19
- package/dist/esm/regExp/index.js +0 -73
- package/dist/esm/tools/calc/index.d.ts +0 -4
- package/dist/esm/tools/calc/index.js +0 -67
- package/dist/esm/tools/dateUtils.d.ts +0 -7
- package/dist/esm/tools/dateUtils.js +0 -23
- package/dist/esm/tools/disableDate/index.d.ts +0 -9
- package/dist/esm/tools/disableDate/index.js +0 -43
- package/dist/esm/tools/disableTimeRange/index.d.ts +0 -9
- package/dist/esm/tools/disableTimeRange/index.js +0 -121
- package/dist/esm/tools/formatAmount/index.d.ts +0 -7
- package/dist/esm/tools/formatAmount/index.js +0 -14
- package/dist/esm/tools/formatPerMill/index.d.ts +0 -7
- package/dist/esm/tools/formatPerMill/index.js +0 -11
- package/dist/esm/tools/formatPercent/index.d.ts +0 -7
- package/dist/esm/tools/formatPercent/index.js +0 -11
- package/dist/esm/tools/getDataByIdCard/index.d.ts +0 -16
- package/dist/esm/tools/getDataByIdCard/index.js +0 -65
- package/dist/esm/tools/index.d.ts +0 -12
- package/dist/esm/tools/index.js +0 -14
- package/dist/esm/tools/sumAmount/index.d.ts +0 -16
- package/dist/esm/tools/sumAmount/index.js +0 -40
- package/dist/esm/tools/toChineseNum/index.d.ts +0 -7
- package/dist/esm/tools/toChineseNum/index.js +0 -103
- package/dist/esm/tools/toFixed/index.d.ts +0 -2
- package/dist/esm/tools/toFixed/index.js +0 -5
- package/dist/esm/tools/transformDataName/index.d.ts +0 -12
- package/dist/esm/tools/transformDataName/index.js +0 -37
- package/dist/esm/transforms/dateTransformer/index.d.ts +0 -24
- package/dist/esm/transforms/dateTransformer/index.js +0 -67
- package/dist/esm/transforms/index.d.ts +0 -6
- package/dist/esm/transforms/index.js +0 -6
- package/dist/esm/transforms/propTypes.d.ts +0 -7
- package/dist/esm/transforms/propTypes.js +0 -1
- package/dist/esm/transforms/transformDate/index.d.ts +0 -21
- package/dist/esm/transforms/transformDate/index.js +0 -141
- package/dist/esm/transforms/transformDatePicker/index.d.ts +0 -12
- package/dist/esm/transforms/transformDatePicker/index.js +0 -24
- package/dist/esm/transforms/transformRangePicker/index.d.ts +0 -29
- package/dist/esm/transforms/transformRangePicker/index.js +0 -61
- package/dist/esm/transforms/transformSwitch/index.d.ts +0 -13
- package/dist/esm/transforms/transformSwitch/index.js +0 -35
- package/dist/esm/transforms/utils.d.ts +0 -2
- package/dist/esm/transforms/utils.js +0 -8
- package/dist/esm/validate/index.d.ts +0 -107
- package/dist/esm/validate/index.js +0 -284
- package/tests/__mocks__/fileMock.js +0 -1
- package/tests/__mocks__/zatUtils.js +0 -27
- package/tests/setup.ts +0 -484
- package/tests/test-utils.tsx +0 -81
@@ -1,14 +1,15 @@
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
|
+
import "antd/es/checkbox/style";
|
3
|
+
import _Checkbox from "antd/es/checkbox";
|
2
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
3
5
|
import { useEffect } from 'react';
|
4
|
-
import { Checkbox } from 'antd';
|
5
6
|
import { useSetState } from 'ahooks';
|
6
7
|
import classNames from 'classnames';
|
7
8
|
import SearchTitle from "./SearchTitle";
|
8
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
9
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
10
11
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
11
|
-
var Cascader =
|
12
|
+
var Cascader = props => {
|
12
13
|
var _dataSource$, _dataSource$2, _state$options;
|
13
14
|
var dataSource = props.dataSource,
|
14
15
|
checkedValues = props.checkedValues,
|
@@ -28,7 +29,7 @@ var Cascader = function Cascader(props) {
|
|
28
29
|
_useSetState2 = _slicedToArray(_useSetState, 2),
|
29
30
|
state = _useSetState2[0],
|
30
31
|
setState = _useSetState2[1];
|
31
|
-
useEffect(
|
32
|
+
useEffect(() => {
|
32
33
|
if (!state.category && dataSource !== null && dataSource !== void 0 && dataSource.length) {
|
33
34
|
var _dataSource$3, _dataSource$4;
|
34
35
|
setState({
|
@@ -37,7 +38,7 @@ var Cascader = function Cascader(props) {
|
|
37
38
|
});
|
38
39
|
}
|
39
40
|
}, [dataSource]);
|
40
|
-
var handleClick =
|
41
|
+
var handleClick = item => {
|
41
42
|
setState({
|
42
43
|
category: item[fieldNameValue],
|
43
44
|
options: item[fieldNameChildren]
|
@@ -48,12 +49,10 @@ var Cascader = function Cascader(props) {
|
|
48
49
|
className: "pro-tree-modal-cascader-flex",
|
49
50
|
children: [/*#__PURE__*/_jsx("div", {
|
50
51
|
className: "pro-tree-modal-cascader-warp",
|
51
|
-
children: dataSource.map(
|
52
|
-
var title = showCodeName ?
|
52
|
+
children: dataSource.map(item => {
|
53
|
+
var title = showCodeName ? `${item[fieldNameValue]}-${item[fieldNameLabel]}` : item[fieldNameLabel];
|
53
54
|
return /*#__PURE__*/_jsx("div", {
|
54
|
-
onClick:
|
55
|
-
return handleClick(item);
|
56
|
-
},
|
55
|
+
onClick: () => handleClick(item),
|
57
56
|
className: classNames('pro-tree-modal-checkbox-content', 'pro-tree-modal-cascader-content', item[fieldNameValue] === state.category ? 'pro-tree-modal-check-cascader-content' : ''),
|
58
57
|
children: optionRender ? optionRender(item, searchStr) : /*#__PURE__*/_jsx(SearchTitle, {
|
59
58
|
label: title,
|
@@ -63,14 +62,14 @@ var Cascader = function Cascader(props) {
|
|
63
62
|
})
|
64
63
|
}), /*#__PURE__*/_jsx("div", {
|
65
64
|
className: "pro-tree-modal-cascader-warp",
|
66
|
-
children: /*#__PURE__*/_jsx(
|
65
|
+
children: /*#__PURE__*/_jsx(_Checkbox.Group, {
|
67
66
|
disabled: disabled,
|
68
67
|
style: {
|
69
68
|
width: '100%'
|
70
69
|
},
|
71
70
|
value: checkedValues,
|
72
|
-
children: state === null || state === void 0 || (_state$options = state.options) === null || _state$options === void 0 ? void 0 : _state$options.map(
|
73
|
-
var title = showCodeName ?
|
71
|
+
children: state === null || state === void 0 || (_state$options = state.options) === null || _state$options === void 0 ? void 0 : _state$options.map(item => {
|
72
|
+
var title = showCodeName ? `${item[fieldNameValue]}-${item[fieldNameLabel]}` : item[fieldNameLabel];
|
74
73
|
return /*#__PURE__*/_jsx("div", {
|
75
74
|
className: "pro-tree-modal-checkbox-content pro-tree-modal-cascader-content",
|
76
75
|
children: item.checkable ? /*#__PURE__*/_jsx("span", {
|
@@ -78,10 +77,8 @@ var Cascader = function Cascader(props) {
|
|
78
77
|
label: title,
|
79
78
|
searchStr: searchStr
|
80
79
|
})
|
81
|
-
}) : /*#__PURE__*/_jsx(
|
82
|
-
onChange:
|
83
|
-
return handleOnChange(e, item[fieldNameValue]);
|
84
|
-
},
|
80
|
+
}) : /*#__PURE__*/_jsx(_Checkbox, _objectSpread(_objectSpread({}, item), {}, {
|
81
|
+
onChange: e => handleOnChange(e, item[fieldNameValue]),
|
85
82
|
value: item[fieldNameValue],
|
86
83
|
children: /*#__PURE__*/_jsx("span", {
|
87
84
|
children: optionRender ? optionRender(item, searchStr) : /*#__PURE__*/_jsx(SearchTitle, {
|
@@ -1,7 +1,12 @@
|
|
1
|
+
import "antd/es/row/style";
|
2
|
+
import _Row from "antd/es/row";
|
3
|
+
import "antd/es/col/style";
|
4
|
+
import _Col from "antd/es/col";
|
5
|
+
import "antd/es/checkbox/style";
|
6
|
+
import _Checkbox from "antd/es/checkbox";
|
1
7
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
2
8
|
/* eslint-disable brace-style */
|
3
9
|
import React, { forwardRef, useImperativeHandle, useMemo, useRef } from 'react';
|
4
|
-
import { Checkbox, Col, Row } from 'antd';
|
5
10
|
import { DndContext } from '@dnd-kit/core';
|
6
11
|
import { arrayMove, SortableContext, verticalListSortingStrategy } from '@dnd-kit/sortable';
|
7
12
|
import { useDeepCompareEffect, useSetState, useVirtualList } from 'ahooks';
|
@@ -31,9 +36,7 @@ function List(props, ref) {
|
|
31
36
|
handleDragEndChange = props.handleDragEndChange;
|
32
37
|
var containerRef = useRef(null);
|
33
38
|
var wrapperRef = useRef(null);
|
34
|
-
var originalList = useMemo(
|
35
|
-
return treeData;
|
36
|
-
}, [treeData]);
|
39
|
+
var originalList = useMemo(() => treeData, [treeData]);
|
37
40
|
var fieldNameLabel = fieldNames.label;
|
38
41
|
var fieldNameValue = fieldNames.value;
|
39
42
|
var isCASCADER = modeType === CASCADER;
|
@@ -43,26 +46,20 @@ function List(props, ref) {
|
|
43
46
|
_useSetState2 = _slicedToArray(_useSetState, 2),
|
44
47
|
checkedList = _useSetState2[0].checkedList,
|
45
48
|
setState = _useSetState2[1];
|
46
|
-
useImperativeHandle(ref,
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
return item[fieldNameValue];
|
51
|
-
});
|
52
|
-
}
|
53
|
-
};
|
54
|
-
});
|
55
|
-
useDeepCompareEffect(function () {
|
49
|
+
useImperativeHandle(ref, () => ({
|
50
|
+
onChange: () => checkedList.map(item => item[fieldNameValue])
|
51
|
+
}));
|
52
|
+
useDeepCompareEffect(() => {
|
56
53
|
setState({
|
57
54
|
checkedList: treeData
|
58
55
|
});
|
59
56
|
}, [treeData]);
|
60
|
-
var _useMemo = useMemo(
|
57
|
+
var _useMemo = useMemo(() => {
|
61
58
|
var min = -1;
|
62
59
|
var max = (checkedList === null || checkedList === void 0 ? void 0 : checkedList.length) || 0;
|
63
60
|
var minFlag = false;
|
64
61
|
var maxFlag = false;
|
65
|
-
checkedList === null || checkedList === void 0 || checkedList.forEach(
|
62
|
+
checkedList === null || checkedList === void 0 || checkedList.forEach((item, index) => {
|
66
63
|
if (item.disabled && !minFlag) {
|
67
64
|
min = index;
|
68
65
|
} else {
|
@@ -76,22 +73,18 @@ function List(props, ref) {
|
|
76
73
|
}
|
77
74
|
});
|
78
75
|
return {
|
79
|
-
min
|
80
|
-
max
|
76
|
+
min,
|
77
|
+
max
|
81
78
|
};
|
82
79
|
}, [checkedList]),
|
83
80
|
min = _useMemo.min,
|
84
81
|
max = _useMemo.max;
|
85
|
-
var handleDragEnd =
|
82
|
+
var handleDragEnd = _ref => {
|
86
83
|
var active = _ref.active,
|
87
84
|
over = _ref.over;
|
88
85
|
if (active.id !== (over === null || over === void 0 ? void 0 : over.id)) {
|
89
|
-
var activeIndex = checkedList.findIndex(
|
90
|
-
|
91
|
-
});
|
92
|
-
var overIndex = checkedList.findIndex(function (item) {
|
93
|
-
return (item === null || item === void 0 ? void 0 : item[fieldNameValue]) === (over === null || over === void 0 ? void 0 : over.id);
|
94
|
-
});
|
86
|
+
var activeIndex = checkedList.findIndex(item => (item === null || item === void 0 ? void 0 : item[fieldNameValue]) === active.id);
|
87
|
+
var overIndex = checkedList.findIndex(item => (item === null || item === void 0 ? void 0 : item[fieldNameValue]) === (over === null || over === void 0 ? void 0 : over.id));
|
95
88
|
if (overIndex <= min || overIndex >= max) {
|
96
89
|
return;
|
97
90
|
}
|
@@ -99,9 +92,7 @@ function List(props, ref) {
|
|
99
92
|
setState({
|
100
93
|
checkedList: newCheckedList
|
101
94
|
});
|
102
|
-
handleDragEndChange === null || handleDragEndChange === void 0 || handleDragEndChange(newCheckedList.map(
|
103
|
-
return item[fieldNameValue];
|
104
|
-
}));
|
95
|
+
handleDragEndChange === null || handleDragEndChange === void 0 || handleDragEndChange(newCheckedList.map(item => item[fieldNameValue]));
|
105
96
|
}
|
106
97
|
};
|
107
98
|
function getLineHeight(string, width) {
|
@@ -113,7 +104,7 @@ function List(props, ref) {
|
|
113
104
|
temp.style.position = 'absolute';
|
114
105
|
temp.style.visibility = 'hidden';
|
115
106
|
temp.style.right = '-10000px';
|
116
|
-
temp.style.width =
|
107
|
+
temp.style.width = `${width}px`; // 设置宽度
|
117
108
|
temp.style.whiteSpace = 'normal'; // 保持换行
|
118
109
|
temp.innerHTML = string.replace(/\n/g, '<br>'); // 替换换行符
|
119
110
|
document.body.appendChild(temp); // 添加到DOM中以获取计算后的高度
|
@@ -122,22 +113,22 @@ function List(props, ref) {
|
|
122
113
|
document.body.removeChild(temp);
|
123
114
|
return len * 20;
|
124
115
|
}
|
125
|
-
var handleCommonTitle =
|
116
|
+
var handleCommonTitle = item => {
|
126
117
|
if (isCASCADER) {
|
127
118
|
return item === null || item === void 0 ? void 0 : item.title;
|
128
119
|
}
|
129
120
|
return item[fieldNameLabel];
|
130
121
|
};
|
131
|
-
var handleGetTitle =
|
122
|
+
var handleGetTitle = item => {
|
132
123
|
if (showCodeName) {
|
133
124
|
if (isCASCADER) {
|
134
125
|
if (item[fieldNameValue] && item !== null && item !== void 0 && item.title) {
|
135
|
-
return
|
126
|
+
return `${item[fieldNameValue]}-${item.title}`;
|
136
127
|
}
|
137
128
|
return handleCommonTitle(item);
|
138
129
|
}
|
139
130
|
if (item[fieldNameValue] && item[fieldNameValue]) {
|
140
|
-
return
|
131
|
+
return `${item[fieldNameValue]}-${item[fieldNameLabel]}`;
|
141
132
|
}
|
142
133
|
return handleCommonTitle(item);
|
143
134
|
}
|
@@ -146,7 +137,7 @@ function List(props, ref) {
|
|
146
137
|
var _useVirtualList = useVirtualList(originalList, {
|
147
138
|
containerTarget: containerRef,
|
148
139
|
wrapperTarget: wrapperRef,
|
149
|
-
itemHeight:
|
140
|
+
itemHeight: (index, item) => {
|
150
141
|
var title = handleGetTitle(item);
|
151
142
|
return Math.floor(getLineHeight(title, 406)) + 12;
|
152
143
|
}
|
@@ -164,22 +155,16 @@ function List(props, ref) {
|
|
164
155
|
children: /*#__PURE__*/_jsx(DndContext, {
|
165
156
|
onDragEnd: handleDragEnd,
|
166
157
|
children: /*#__PURE__*/_jsx(SortableContext, {
|
167
|
-
items: checkedList === null || checkedList === void 0 ? void 0 : checkedList.map(
|
168
|
-
return item === null || item === void 0 ? void 0 : item[fieldNameValue];
|
169
|
-
}),
|
158
|
+
items: checkedList === null || checkedList === void 0 ? void 0 : checkedList.map(item => item === null || item === void 0 ? void 0 : item[fieldNameValue]),
|
170
159
|
strategy: verticalListSortingStrategy,
|
171
|
-
children: checkedList === null || checkedList === void 0 ? void 0 : checkedList.map(
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
return handleFilterClose(item[fieldNameValue]);
|
180
|
-
}
|
181
|
-
}, "item-".concat(item === null || item === void 0 ? void 0 : item[fieldNameValue]));
|
182
|
-
})
|
160
|
+
children: checkedList === null || checkedList === void 0 ? void 0 : checkedList.map(item => /*#__PURE__*/_jsx(SortableItem, {
|
161
|
+
"data-row-key": item === null || item === void 0 ? void 0 : item[fieldNameValue],
|
162
|
+
label: item === null || item === void 0 ? void 0 : item[fieldNameLabel],
|
163
|
+
item: item,
|
164
|
+
drag: draggable,
|
165
|
+
disabled: disabled,
|
166
|
+
onClose: () => handleFilterClose(item[fieldNameValue])
|
167
|
+
}, `item-${item === null || item === void 0 ? void 0 : item[fieldNameValue]}`))
|
183
168
|
})
|
184
169
|
})
|
185
170
|
});
|
@@ -188,7 +173,7 @@ function List(props, ref) {
|
|
188
173
|
// 编辑状态
|
189
174
|
if (!isRowCols && mode === 'render') {
|
190
175
|
return /*#__PURE__*/_jsx(_Fragment, {
|
191
|
-
children: /*#__PURE__*/_jsx(
|
176
|
+
children: /*#__PURE__*/_jsx(_Checkbox.Group, {
|
192
177
|
disabled: disabled,
|
193
178
|
style: {
|
194
179
|
width: '100%'
|
@@ -203,24 +188,22 @@ function List(props, ref) {
|
|
203
188
|
},
|
204
189
|
children: /*#__PURE__*/_jsx("div", {
|
205
190
|
ref: wrapperRef,
|
206
|
-
children: /*#__PURE__*/_jsx(
|
207
|
-
children: list.map(
|
191
|
+
children: /*#__PURE__*/_jsx(_Row, {
|
192
|
+
children: list.map(_item => {
|
208
193
|
var item = _item.data;
|
209
194
|
var title = handleGetTitle(item);
|
210
195
|
var content = optionRender ? optionRender(item, searchStr) : /*#__PURE__*/_jsx(SearchTitle, {
|
211
196
|
label: title,
|
212
197
|
searchStr: searchStr
|
213
198
|
});
|
214
|
-
return /*#__PURE__*/_jsx(
|
199
|
+
return /*#__PURE__*/_jsx(_Col, {
|
215
200
|
span: span || 24,
|
216
201
|
className: !span || span === 24 ? 'pro-tree-modal-checkbox-content' : '',
|
217
202
|
style: {
|
218
203
|
marginBottom: span ? 16 : 12
|
219
204
|
},
|
220
|
-
children: /*#__PURE__*/_jsx(
|
221
|
-
onChange:
|
222
|
-
return handleOnChange === null || handleOnChange === void 0 ? void 0 : handleOnChange(e, item[fieldNameValue]);
|
223
|
-
},
|
205
|
+
children: /*#__PURE__*/_jsx(_Checkbox, {
|
206
|
+
onChange: e => handleOnChange === null || handleOnChange === void 0 ? void 0 : handleOnChange(e, item[fieldNameValue]),
|
224
207
|
value: item[fieldNameValue],
|
225
208
|
disabled: item.disabled,
|
226
209
|
children: content
|
@@ -237,29 +220,27 @@ function List(props, ref) {
|
|
237
220
|
// 编辑状态
|
238
221
|
if (isRowCols) {
|
239
222
|
return /*#__PURE__*/_jsx(_Fragment, {
|
240
|
-
children: /*#__PURE__*/_jsx(
|
223
|
+
children: /*#__PURE__*/_jsx(_Checkbox.Group, {
|
241
224
|
disabled: disabled,
|
242
225
|
style: {
|
243
226
|
width: '100%'
|
244
227
|
},
|
245
228
|
value: checkedValues,
|
246
|
-
children: /*#__PURE__*/_jsx(
|
247
|
-
children: treeData.map(
|
229
|
+
children: /*#__PURE__*/_jsx(_Row, {
|
230
|
+
children: treeData.map(item => {
|
248
231
|
var title = handleGetTitle(item);
|
249
232
|
var content = optionRender ? optionRender(item, searchStr) : /*#__PURE__*/_jsx(SearchTitle, {
|
250
233
|
label: title,
|
251
234
|
searchStr: searchStr
|
252
235
|
});
|
253
|
-
return /*#__PURE__*/_jsx(
|
236
|
+
return /*#__PURE__*/_jsx(_Col, {
|
254
237
|
span: span || 24,
|
255
238
|
className: !span || span === 24 ? 'pro-tree-modal-checkbox-content' : '',
|
256
239
|
style: {
|
257
240
|
marginBottom: span ? 16 : 12
|
258
241
|
},
|
259
|
-
children: /*#__PURE__*/_jsx(
|
260
|
-
onChange:
|
261
|
-
return handleOnChange(e, item[fieldNameValue]);
|
262
|
-
},
|
242
|
+
children: /*#__PURE__*/_jsx(_Checkbox, {
|
243
|
+
onChange: e => handleOnChange(e, item[fieldNameValue]),
|
263
244
|
value: item[fieldNameValue],
|
264
245
|
disabled: item.disabled,
|
265
246
|
children: content
|
@@ -281,12 +262,12 @@ function List(props, ref) {
|
|
281
262
|
},
|
282
263
|
children: /*#__PURE__*/_jsx("div", {
|
283
264
|
ref: wrapperRef,
|
284
|
-
children: list.map(
|
265
|
+
children: list.map(_item => {
|
285
266
|
var item = _item.data;
|
286
267
|
var title = item[fieldNameLabel];
|
287
268
|
if (showCodeName) {
|
288
269
|
if (item[fieldNameValue] && item[fieldNameLabel]) {
|
289
|
-
title =
|
270
|
+
title = `${item[fieldNameValue]}-${item[fieldNameLabel]}`;
|
290
271
|
}
|
291
272
|
}
|
292
273
|
return /*#__PURE__*/_jsxs("div", {
|
@@ -295,9 +276,7 @@ function List(props, ref) {
|
|
295
276
|
className: "pro-tree-modal-checkbox-content-look",
|
296
277
|
children: optionRender ? optionRender(item, searchStr) : title
|
297
278
|
}), disabled ? null : /*#__PURE__*/_jsx(CloseIcon, {
|
298
|
-
onClick:
|
299
|
-
return handleFilterClose(item[fieldNameValue]);
|
300
|
-
}
|
279
|
+
onClick: () => handleFilterClose(item[fieldNameValue])
|
301
280
|
})]
|
302
281
|
}, item[fieldNames.value]);
|
303
282
|
})
|
@@ -1,13 +1,14 @@
|
|
1
|
+
import "antd/es/tag/style";
|
2
|
+
import _Tag from "antd/es/tag";
|
1
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
4
|
import React from 'react';
|
3
|
-
import { Tag } from 'antd';
|
4
5
|
import { useSortable } from '@dnd-kit/sortable';
|
5
6
|
import { CSS } from '@dnd-kit/utilities';
|
6
7
|
import ProIcon from "../../ProIcon";
|
7
8
|
import { ProTooltip } from "../../index";
|
8
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
9
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
10
|
-
var SortableItem =
|
11
|
+
var SortableItem = props => {
|
11
12
|
var drag = props.drag,
|
12
13
|
label = props.label,
|
13
14
|
item = props.item,
|
@@ -27,7 +28,7 @@ var SortableItem = function SortableItem(props) {
|
|
27
28
|
transform: CSS.Transform.toString(transform && _objectSpread(_objectSpread({}, transform), {}, {
|
28
29
|
scaleY: 1
|
29
30
|
})),
|
30
|
-
transition
|
31
|
+
transition
|
31
32
|
}, isDragging ? {
|
32
33
|
position: 'relative',
|
33
34
|
zIndex: 9999
|
@@ -35,13 +36,11 @@ var SortableItem = function SortableItem(props) {
|
|
35
36
|
return /*#__PURE__*/_jsx("li", _objectSpread(_objectSpread({
|
36
37
|
ref: item.disabled || disabled ? null : setNodeRef,
|
37
38
|
style: style,
|
38
|
-
className:
|
39
|
+
className: `checked-item ${item.disabled || disabled ? 'disabled' : ''} ${drag ? 'dragable' : ''}`
|
39
40
|
}, item.disabled ? {} : attributes), {}, {
|
40
|
-
children: /*#__PURE__*/_jsxs(
|
41
|
+
children: /*#__PURE__*/_jsxs(_Tag, {
|
41
42
|
closable: true,
|
42
|
-
onClose:
|
43
|
-
return _onClose(e);
|
44
|
-
},
|
43
|
+
onClose: e => _onClose(e),
|
45
44
|
children: [drag ? item.disabled || disabled ? /*#__PURE__*/_jsx(ProIcon, {
|
46
45
|
className: "disabled-icon",
|
47
46
|
type: "lock"
|
@@ -1,10 +1,11 @@
|
|
1
|
+
import "antd/es/tree/style";
|
2
|
+
import _Tree from "antd/es/tree";
|
1
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
3
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
4
6
|
var _excluded = ["checkedValues", "disabled", "treeData", "searchStr", "originalTreeData", "showCodeName", "checkStrictly", "flatTreeData", "mode", "fieldNames", "tags", "onCheck", "handleFilterClose", "optionRender"];
|
5
7
|
/* eslint-disable no-plusplus */
|
6
8
|
import React, { forwardRef, useEffect, useMemo, useState } from 'react';
|
7
|
-
import { Tree } from 'antd';
|
8
9
|
import ListComponent from "./List";
|
9
10
|
import SearchTitle from "./SearchTitle";
|
10
11
|
import CloseIcon from "./CloseIcon";
|
@@ -43,27 +44,25 @@ function List(props, ref) {
|
|
43
44
|
_useState4 = _slicedToArray(_useState3, 2),
|
44
45
|
autoExpandParent = _useState4[0],
|
45
46
|
setAutoExpandParent = _useState4[1];
|
46
|
-
useEffect(
|
47
|
+
useEffect(() => {
|
47
48
|
if (searchStr) {
|
48
|
-
var newExpandedKeys = flatTreeData.map(
|
49
|
+
var newExpandedKeys = flatTreeData.map(item => {
|
49
50
|
var title = item[fieldNameValue] + item[fieldNameLabel];
|
50
51
|
if ((title === null || title === void 0 ? void 0 : title.indexOf(searchStr)) > -1) {
|
51
52
|
return getParentKey(item[fieldNameValue], originalTreeData, fieldNames);
|
52
53
|
}
|
53
54
|
return null;
|
54
|
-
}).filter(
|
55
|
-
return item && self.indexOf(item) === i;
|
56
|
-
});
|
55
|
+
}).filter((item, i, self) => item && self.indexOf(item) === i);
|
57
56
|
setExpandedKeys(newExpandedKeys);
|
58
57
|
setAutoExpandParent(true);
|
59
58
|
}
|
60
59
|
}, [searchStr]);
|
61
|
-
var _treeData = useMemo(
|
60
|
+
var _treeData = useMemo(() => {
|
62
61
|
function fn() {
|
63
|
-
var loop =
|
62
|
+
var loop = (data, index) => {
|
64
63
|
index++;
|
65
|
-
return data.map(
|
66
|
-
var title = showCodeName ?
|
64
|
+
return data.map(item => {
|
65
|
+
var title = showCodeName ? `${item[fieldNameValue]}-${item[fieldNameLabel]}` : item[fieldNameLabel];
|
67
66
|
if (item[fieldNames.children]) {
|
68
67
|
return _objectSpread(_objectSpread({}, item), {}, {
|
69
68
|
title: /*#__PURE__*/_jsxs("div", {
|
@@ -122,11 +121,11 @@ function List(props, ref) {
|
|
122
121
|
}
|
123
122
|
return fn();
|
124
123
|
}, [searchStr, expandedKeys, showCodeName]);
|
125
|
-
var treeViewData = useMemo(
|
126
|
-
var loop =
|
124
|
+
var treeViewData = useMemo(() => {
|
125
|
+
var loop = (data, index) => {
|
127
126
|
index++;
|
128
|
-
return data.map(
|
129
|
-
var title = showCodeName ?
|
127
|
+
return data.map(item => {
|
128
|
+
var title = showCodeName ? `${item[fieldNameValue]}-${item[fieldNameLabel]}` : item[fieldNameLabel];
|
130
129
|
if (item[fieldNames.children]) {
|
131
130
|
return _objectSpread(_objectSpread({}, item), {}, {
|
132
131
|
title: /*#__PURE__*/_jsxs("div", {
|
@@ -146,9 +145,7 @@ function List(props, ref) {
|
|
146
145
|
children: optionRender ? optionRender(item) : title
|
147
146
|
})]
|
148
147
|
}), disabled ? null : /*#__PURE__*/_jsx(CloseIcon, {
|
149
|
-
onClick:
|
150
|
-
return handleFilterClose(item[fieldNameValue], item);
|
151
|
-
}
|
148
|
+
onClick: () => handleFilterClose(item[fieldNameValue], item)
|
152
149
|
})]
|
153
150
|
}),
|
154
151
|
key: item[fieldNameValue],
|
@@ -162,9 +159,7 @@ function List(props, ref) {
|
|
162
159
|
className: "pro-tree-modal-checkbox-content-look",
|
163
160
|
children: optionRender ? optionRender(item) : title
|
164
161
|
}), disabled ? null : /*#__PURE__*/_jsx(CloseIcon, {
|
165
|
-
onClick:
|
166
|
-
return handleFilterClose(item[fieldNameValue], item);
|
167
|
-
}
|
162
|
+
onClick: () => handleFilterClose(item[fieldNameValue], item)
|
168
163
|
})]
|
169
164
|
}),
|
170
165
|
key: item[fieldNameValue]
|
@@ -173,12 +168,12 @@ function List(props, ref) {
|
|
173
168
|
};
|
174
169
|
return loop(treeData, -1);
|
175
170
|
}, [treeData]);
|
176
|
-
var onExpand =
|
171
|
+
var onExpand = newExpandedKeys => {
|
177
172
|
setExpandedKeys(newExpandedKeys);
|
178
173
|
setAutoExpandParent(false);
|
179
174
|
};
|
180
175
|
if (mode === 'render') {
|
181
|
-
return /*#__PURE__*/_jsx(
|
176
|
+
return /*#__PURE__*/_jsx(_Tree, {
|
182
177
|
disabled: disabled,
|
183
178
|
style: {
|
184
179
|
width: '100%'
|
@@ -205,7 +200,7 @@ function List(props, ref) {
|
|
205
200
|
showCodeName: showCodeName,
|
206
201
|
disabled: disabled,
|
207
202
|
ref: ref
|
208
|
-
}, restProps)) : /*#__PURE__*/_jsx(
|
203
|
+
}, restProps)) : /*#__PURE__*/_jsx(_Tree, {
|
209
204
|
style: {
|
210
205
|
width: '100%'
|
211
206
|
},
|
@@ -1,8 +1,13 @@
|
|
1
|
+
import "antd/es/input/style";
|
2
|
+
import _Input from "antd/es/input";
|
3
|
+
import "antd/es/space/style";
|
4
|
+
import _Space from "antd/es/space";
|
5
|
+
import "antd/es/select/style";
|
6
|
+
import _Select from "antd/es/select";
|
1
7
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
8
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
3
9
|
import { useEffect } from 'react';
|
4
10
|
import classNames from 'classnames';
|
5
|
-
import { Input, Select, Space } from 'antd';
|
6
11
|
import { CloseOutlined } from '@ant-design/icons';
|
7
12
|
import { ReactSVG } from 'react-svg';
|
8
13
|
import { useSetState } from 'ahooks';
|
@@ -43,7 +48,7 @@ function Trigger(props) {
|
|
43
48
|
_useSetState2 = _slicedToArray(_useSetState, 2),
|
44
49
|
state = _useSetState2[0],
|
45
50
|
setState = _useSetState2[1];
|
46
|
-
useEffect(
|
51
|
+
useEffect(() => {
|
47
52
|
if (allValue === value && appoint) {
|
48
53
|
setState({
|
49
54
|
mode: 'all'
|
@@ -54,7 +59,7 @@ function Trigger(props) {
|
|
54
59
|
});
|
55
60
|
}
|
56
61
|
}, [checkAll]);
|
57
|
-
var onIconClick =
|
62
|
+
var onIconClick = () => {
|
58
63
|
if (appoint && state.mode === 'all') {
|
59
64
|
return;
|
60
65
|
}
|
@@ -80,7 +85,7 @@ function Trigger(props) {
|
|
80
85
|
})]
|
81
86
|
});
|
82
87
|
}
|
83
|
-
var onAppointChange =
|
88
|
+
var onAppointChange = value => {
|
84
89
|
setState({
|
85
90
|
mode: value
|
86
91
|
});
|
@@ -90,12 +95,12 @@ function Trigger(props) {
|
|
90
95
|
appointChange === null || appointChange === void 0 || appointChange(false);
|
91
96
|
}
|
92
97
|
};
|
93
|
-
var TriggerComponent =
|
98
|
+
var TriggerComponent = props => {
|
94
99
|
if (appoint) {
|
95
|
-
return /*#__PURE__*/_jsxs(
|
100
|
+
return /*#__PURE__*/_jsxs(_Space.Compact, {
|
96
101
|
block: true,
|
97
102
|
style: _objectSpread({}, triggerStyle),
|
98
|
-
children: [/*#__PURE__*/_jsxs(
|
103
|
+
children: [/*#__PURE__*/_jsxs(_Select, {
|
99
104
|
style: {
|
100
105
|
width: 'auto'
|
101
106
|
},
|
@@ -104,11 +109,11 @@ function Trigger(props) {
|
|
104
109
|
defaultValue: "appoint",
|
105
110
|
value: state.mode,
|
106
111
|
onChange: onAppointChange,
|
107
|
-
children: [/*#__PURE__*/_jsx(
|
112
|
+
children: [/*#__PURE__*/_jsx(_Select.Option, {
|
108
113
|
value: "all",
|
109
114
|
disabled: allDisabled,
|
110
115
|
children: locale === null || locale === void 0 ? void 0 : locale.ProTreeModal.specifyMode[0]
|
111
|
-
}), /*#__PURE__*/_jsx(
|
116
|
+
}), /*#__PURE__*/_jsx(_Select.Option, {
|
112
117
|
value: "appoint",
|
113
118
|
disabled: specifyDisabled,
|
114
119
|
children: locale === null || locale === void 0 ? void 0 : locale.ProTreeModal.specifyMode[1]
|
@@ -119,7 +124,7 @@ function Trigger(props) {
|
|
119
124
|
return props.children;
|
120
125
|
};
|
121
126
|
return /*#__PURE__*/_jsx(TriggerComponent, {
|
122
|
-
children: /*#__PURE__*/_jsx(
|
127
|
+
children: /*#__PURE__*/_jsx(_Input, {
|
123
128
|
className: classNames(afterDisabled ? 'trigger-no-hover' : '', appoint ? 'pro-tree-modal-input-appoint' : ''),
|
124
129
|
onClick: handleClick,
|
125
130
|
value: checkedValues.length === 0 ? null : state.mode === 'all' ? formatMessage(locale === null || locale === void 0 ? void 0 : locale.ProTreeModal.checkAll1, {
|