@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,104 +1,92 @@
|
|
1
|
-
|
2
|
-
var __defProp = Object.defineProperty;
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
-
var __export = (target, all) => {
|
8
|
-
for (var name in all)
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
10
|
-
};
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
13
|
-
for (let key of __getOwnPropNames(from))
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
16
|
-
}
|
17
|
-
return to;
|
18
|
-
};
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
25
|
-
mod
|
26
|
-
));
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
1
|
+
"use strict";
|
28
2
|
|
29
|
-
|
30
|
-
var
|
31
|
-
|
32
|
-
|
33
|
-
getParentElement: () => getParentElement
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
34
7
|
});
|
35
|
-
|
36
|
-
|
37
|
-
var
|
38
|
-
var
|
39
|
-
var
|
40
|
-
var
|
41
|
-
var
|
42
|
-
var
|
43
|
-
var
|
44
|
-
var
|
45
|
-
var
|
46
|
-
var
|
47
|
-
var
|
48
|
-
var
|
49
|
-
var
|
50
|
-
var
|
8
|
+
exports.getParentElement = exports.formatColumn = void 0;
|
9
|
+
require("antd/es/space/style");
|
10
|
+
var _space = _interopRequireDefault(require("antd/es/space"));
|
11
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
13
|
+
var _react = _interopRequireWildcard(require("react"));
|
14
|
+
var _dayjs15 = _interopRequireDefault(require("dayjs"));
|
15
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
16
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
17
|
+
var _lodash = require("lodash");
|
18
|
+
var _utils = require("@zat-design/utils");
|
19
|
+
var _TooltipTitle = _interopRequireDefault(require("../TooltipTitle"));
|
20
|
+
var _RenderColumn = _interopRequireDefault(require("../RenderColumn"));
|
21
|
+
var _utils2 = require("../../utils");
|
22
|
+
var _utils3 = require("../../../utils");
|
23
|
+
var _getEnumLabel = _interopRequireDefault(require("../../../ProEnum/utils/getEnumLabel"));
|
24
|
+
var _index = require("../../../ProForm/components/index");
|
25
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
26
|
+
var _excluded = ["title", "valueType", "format", "precision", "ellipsis", "code", "copyable", "width", "tooltip", "transform", "prefix", "suffix", "dataIndex", "toolTipProps", "minWidth", "onDiff"];
|
27
|
+
/**
|
28
|
+
* 调整点:
|
29
|
+
*/
|
30
|
+
var isReactElement = element => /*#__PURE__*/(0, _react.isValidElement)(element);
|
31
|
+
var calcMinWidth = _ref => {
|
32
|
+
var minWidth = _ref.minWidth,
|
33
|
+
width = _ref.width,
|
34
|
+
title = _ref.title,
|
35
|
+
isMaxContentOverFlow = _ref.isMaxContentOverFlow,
|
36
|
+
callback = _ref.callback;
|
51
37
|
if (!minWidth && !width && isMaxContentOverFlow) {
|
52
|
-
|
53
|
-
tempEl.style.display =
|
38
|
+
var tempEl = document.createElement('div');
|
39
|
+
tempEl.style.display = 'inline-block';
|
54
40
|
document.body.appendChild(tempEl);
|
55
|
-
if ((0,
|
56
|
-
|
57
|
-
|
41
|
+
if ((0, _lodash.isFunction)(title)) {
|
42
|
+
var component = title();
|
43
|
+
_reactDom.default.render(component, tempEl);
|
58
44
|
} else if (isReactElement(title)) {
|
59
|
-
|
45
|
+
_reactDom.default.render(title, tempEl);
|
60
46
|
} else {
|
61
47
|
tempEl.innerHTML = title;
|
62
48
|
}
|
49
|
+
// 使用 requestAnimationFrame 确保在下一个浏览器重绘周期中获取宽度
|
63
50
|
requestAnimationFrame(() => {
|
64
|
-
|
65
|
-
|
51
|
+
var _width = tempEl.offsetWidth;
|
52
|
+
_reactDom.default.unmountComponentAtNode(tempEl);
|
66
53
|
tempEl.remove();
|
67
54
|
callback(_width);
|
68
55
|
});
|
69
56
|
}
|
70
57
|
};
|
71
|
-
var formatColumn =
|
72
|
-
column,
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
toolTipProps = {},
|
96
|
-
minWidth,
|
97
|
-
onDiff,
|
98
|
-
|
99
|
-
} = column;
|
58
|
+
var formatColumn = _ref2 => {
|
59
|
+
var column = _ref2.column,
|
60
|
+
originalObj = _ref2.originalObj,
|
61
|
+
rowKey = _ref2.rowKey,
|
62
|
+
wrapToolTipProps = _ref2.wrapToolTipProps,
|
63
|
+
scroll = _ref2.scroll,
|
64
|
+
onUpdateMinWidth = _ref2.onUpdateMinWidth,
|
65
|
+
isInNewRow = _ref2.isInNewRow,
|
66
|
+
diffConfig = _ref2.diffConfig;
|
67
|
+
var title = column.title,
|
68
|
+
valueType = column.valueType,
|
69
|
+
_column$format = column.format,
|
70
|
+
format = _column$format === void 0 ? 'YYYY-MM-DD HH:mm:ss' : _column$format,
|
71
|
+
precision = column.precision,
|
72
|
+
ellipsis = column.ellipsis,
|
73
|
+
code = column.code,
|
74
|
+
copyable = column.copyable,
|
75
|
+
width = column.width,
|
76
|
+
tooltip = column.tooltip,
|
77
|
+
transform = column.transform,
|
78
|
+
prefix = column.prefix,
|
79
|
+
suffix = column.suffix,
|
80
|
+
dataIndex = column.dataIndex,
|
81
|
+
_column$toolTipProps = column.toolTipProps,
|
82
|
+
toolTipProps = _column$toolTipProps === void 0 ? {} : _column$toolTipProps,
|
83
|
+
minWidth = column.minWidth,
|
84
|
+
onDiff = column.onDiff,
|
85
|
+
otherProps = (0, _objectWithoutProperties2.default)(column, _excluded);
|
100
86
|
otherProps.scroll = scroll;
|
101
|
-
|
87
|
+
|
88
|
+
// 仅在 {x: 'max-content', y: 300 } 且 column无指定 width minWidth 情况下 才开启 minWidth的自动计算
|
89
|
+
var isMaxContentOverFlow = (0, _lodash.isObject)(scroll) ? (scroll === null || scroll === void 0 ? void 0 : scroll.x) === 'max-content' && Reflect.ownKeys(scroll).includes('y') : false;
|
102
90
|
calcMinWidth({
|
103
91
|
minWidth,
|
104
92
|
width,
|
@@ -106,53 +94,59 @@ var formatColumn = ({
|
|
106
94
|
isMaxContentOverFlow,
|
107
95
|
callback: onUpdateMinWidth
|
108
96
|
});
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
const prefixNode = (value, record, index) => {
|
97
|
+
var _toolTipProps = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, toolTipProps), wrapToolTipProps);
|
98
|
+
|
99
|
+
// 前缀处理
|
100
|
+
var prefixNode = (value, record, index) => {
|
114
101
|
if (!prefix) {
|
115
|
-
if (valueType ===
|
116
|
-
return
|
102
|
+
if (valueType === 'thousandthCNY') {
|
103
|
+
return 'CNY';
|
117
104
|
}
|
118
|
-
return
|
105
|
+
return '';
|
119
106
|
}
|
120
|
-
if ((0,
|
107
|
+
if ((0, _lodash.isString)(prefix) || /*#__PURE__*/(0, _react.isValidElement)(prefix)) {
|
121
108
|
return prefix;
|
122
109
|
}
|
123
|
-
if ((0,
|
110
|
+
if ((0, _lodash.isFunction)(prefix)) {
|
124
111
|
return prefix(value, record, index);
|
125
112
|
}
|
126
113
|
};
|
127
|
-
|
128
|
-
|
114
|
+
|
115
|
+
// 后缀处理
|
116
|
+
var suffixNode = (value, record, index) => {
|
117
|
+
if ((0, _lodash.isString)(suffix) || /*#__PURE__*/(0, _react.isValidElement)(suffix)) {
|
129
118
|
return suffix;
|
130
119
|
}
|
131
|
-
if ((0,
|
120
|
+
if ((0, _lodash.isFunction)(suffix)) {
|
132
121
|
return suffix(value, record, index);
|
133
122
|
}
|
134
123
|
};
|
135
|
-
if (column
|
136
|
-
|
124
|
+
if (column !== null && column !== void 0 && column.render) {
|
125
|
+
var originalRender = column.render; // 保存原始的 render 方法
|
126
|
+
// 自定义render 手动重载下
|
137
127
|
column.render = (value, record, index) => {
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
128
|
+
var isFn = (0, _lodash.isFunction)(originalRender);
|
129
|
+
var _value = isFn ? originalRender === null || originalRender === void 0 ? void 0 : originalRender(value, record !== null && record !== void 0 ? record : {}, index) : null;
|
130
|
+
var originalResult = (0, _utils2.getOriginalValue)(value, record !== null && record !== void 0 ? record : {}, originalObj, rowKey, dataIndex);
|
131
|
+
var originalValue = originalResult.originalValue;
|
132
|
+
var isChanged = originalResult.isChanged,
|
133
|
+
isAddCell = originalResult.isAddCell;
|
134
|
+
var isInNewRowFlag = isInNewRow(record);
|
135
|
+
var _isAddCell = isAddCell;
|
145
136
|
otherProps.isChanged = isChanged;
|
146
|
-
if (Array.isArray(diffConfig
|
147
|
-
|
148
|
-
|
137
|
+
if (Array.isArray(diffConfig === null || diffConfig === void 0 ? void 0 : diffConfig.originalDataSource)) {
|
138
|
+
// 存在比对
|
139
|
+
if ((0, _lodash.isFunction)(otherProps === null || otherProps === void 0 ? void 0 : otherProps.viewRender)) {
|
140
|
+
var _originalObj$record$r;
|
141
|
+
var diffResult = otherProps.viewRender({
|
149
142
|
originValue: originalValue,
|
150
|
-
originRecord: (originalObj
|
143
|
+
originRecord: (_originalObj$record$r = originalObj === null || originalObj === void 0 ? void 0 : originalObj[record === null || record === void 0 ? void 0 : record[rowKey]]) !== null && _originalObj$record$r !== void 0 ? _originalObj$record$r : {},
|
151
144
|
value,
|
152
145
|
record,
|
153
146
|
index
|
154
147
|
});
|
155
|
-
|
148
|
+
// viewRender 返回值为 false 时,不显示对比
|
149
|
+
if ((0, _lodash.isBoolean)(diffResult)) {
|
156
150
|
if (!diffResult) {
|
157
151
|
otherProps.isChanged = false;
|
158
152
|
_isAddCell = false;
|
@@ -161,427 +155,480 @@ var formatColumn = ({
|
|
161
155
|
_isAddCell = false;
|
162
156
|
}
|
163
157
|
}
|
164
|
-
|
165
|
-
|
158
|
+
// 指定返回相同了
|
159
|
+
if (typeof diffResult === 'string') {
|
160
|
+
if (diffResult === 'changed') {
|
166
161
|
_isAddCell = false;
|
167
162
|
otherProps.isChanged = true;
|
168
163
|
}
|
169
|
-
if (diffResult ===
|
164
|
+
if (diffResult === 'same') {
|
170
165
|
_isAddCell = false;
|
171
166
|
otherProps.isChanged = false;
|
172
167
|
}
|
173
|
-
if (diffResult ===
|
168
|
+
if (diffResult === 'add') {
|
174
169
|
_isAddCell = true;
|
175
170
|
otherProps.isChanged = false;
|
176
171
|
}
|
177
172
|
}
|
178
173
|
originalValue = diffResult;
|
179
174
|
}
|
180
|
-
|
181
|
-
|
175
|
+
// 存在自定义onDiff比对
|
176
|
+
if ((0, _lodash.isFunction)(onDiff)) {
|
177
|
+
var _originalObj$record$r2;
|
178
|
+
var _diffResult = onDiff({
|
182
179
|
originValue: originalValue,
|
183
|
-
originRecord: (originalObj
|
180
|
+
originRecord: (_originalObj$record$r2 = originalObj === null || originalObj === void 0 ? void 0 : originalObj[record === null || record === void 0 ? void 0 : record[rowKey]]) !== null && _originalObj$record$r2 !== void 0 ? _originalObj$record$r2 : {},
|
184
181
|
value,
|
185
182
|
record,
|
186
183
|
index
|
187
184
|
});
|
188
|
-
if (
|
185
|
+
if (_diffResult === 'changed') {
|
189
186
|
_isAddCell = false;
|
190
187
|
otherProps.isChanged = true;
|
191
188
|
}
|
192
|
-
if (
|
189
|
+
if (_diffResult === 'same') {
|
193
190
|
_isAddCell = false;
|
194
191
|
otherProps.isChanged = false;
|
195
192
|
}
|
196
|
-
if (
|
193
|
+
if (_diffResult === 'add') {
|
197
194
|
_isAddCell = true;
|
198
195
|
otherProps.isChanged = false;
|
199
196
|
}
|
200
197
|
}
|
201
198
|
}
|
202
|
-
return
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
isInNewRowFlag,
|
216
|
-
isAddCell: _isAddCell
|
217
|
-
}
|
218
|
-
);
|
199
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RenderColumn.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, otherProps), {}, {
|
200
|
+
valueType: valueType,
|
201
|
+
originalValue: (0, _utils3.isEmpty)(originalValue) ? null : originalValue,
|
202
|
+
ellipsis: ellipsis,
|
203
|
+
width: width,
|
204
|
+
value: _value,
|
205
|
+
node: _value,
|
206
|
+
currentValue: _value,
|
207
|
+
toolTipProps: _toolTipProps,
|
208
|
+
minWidth: minWidth,
|
209
|
+
isInNewRowFlag: isInNewRowFlag,
|
210
|
+
isAddCell: _isAddCell
|
211
|
+
}));
|
219
212
|
};
|
220
213
|
return;
|
221
214
|
}
|
222
215
|
if (tooltip) {
|
223
|
-
column.title =
|
216
|
+
column.title = /*#__PURE__*/(0, _jsxRuntime.jsx)(_TooltipTitle.default, {
|
217
|
+
title: title,
|
218
|
+
tooltip: tooltip
|
219
|
+
});
|
224
220
|
}
|
225
221
|
if (ellipsis) {
|
226
222
|
column.ellipsis = false;
|
227
223
|
}
|
228
|
-
|
229
|
-
|
230
|
-
|
224
|
+
var valueTypePrecision = precision !== null && precision !== void 0 ? precision : 0;
|
225
|
+
// 千分位、千分位带CNY前缀, 百分比、千分比保留小数点2位
|
226
|
+
if (['percentage', 'permillage', 'thousandth', 'thousandthCNY'].includes(valueType)) {
|
227
|
+
valueTypePrecision = precision !== null && precision !== void 0 ? precision : 2;
|
231
228
|
}
|
232
|
-
|
229
|
+
// 百分比、千分比
|
230
|
+
if (['percentage', 'permillage'].includes(valueType)) {
|
233
231
|
column.render = (value, record, index) => {
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
232
|
+
var multiple = valueType === 'percentage' ? 100 : 1000;
|
233
|
+
var realValue = _utils.tools.calc(Number(value !== null && value !== void 0 ? value : 0), '*', multiple);
|
234
|
+
var renderValue = (0, _utils2.getDecimalDigits)(value) > valueTypePrecision ? realValue : realValue.toFixed(valueTypePrecision);
|
235
|
+
var originalResult = (0, _utils2.getOriginalValue)(value, record, originalObj, rowKey, dataIndex);
|
236
|
+
var isChanged = originalResult.isChanged,
|
237
|
+
originalValue = originalResult.originalValue,
|
238
|
+
isAddCell = originalResult.isAddCell;
|
239
239
|
otherProps.isChanged = isChanged;
|
240
|
-
|
241
|
-
|
242
|
-
if ((0,
|
243
|
-
originalRenderValue =
|
240
|
+
var originalRealValue = _utils.tools.calc(Number(originalValue || null), '*', multiple);
|
241
|
+
var originalRenderValue = (0, _utils2.getDecimalDigits)(originalValue) > valueTypePrecision ? originalRealValue : originalRealValue.toFixed(valueTypePrecision);
|
242
|
+
if ((0, _utils3.isEmpty)(originalValue)) {
|
243
|
+
originalRenderValue = '-';
|
244
244
|
}
|
245
245
|
if (!value && value !== 0 && renderValue === originalRenderValue) {
|
246
|
-
return
|
246
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
247
|
+
style: {
|
248
|
+
minWidth
|
249
|
+
},
|
250
|
+
children: "-"
|
251
|
+
});
|
247
252
|
}
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
);
|
253
|
+
var node = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_space.default, {
|
254
|
+
size: 8,
|
255
|
+
children: [prefixNode(value, record, index), renderValue, suffixNode(value, record, index)]
|
256
|
+
});
|
257
|
+
var isInNewRowFlag = isInNewRow(record);
|
258
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RenderColumn.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, otherProps), {}, {
|
259
|
+
valueType: valueType,
|
260
|
+
originalValue: originalValue === null ? null : originalRenderValue,
|
261
|
+
ellipsis: ellipsis,
|
262
|
+
width: width,
|
263
|
+
node: node,
|
264
|
+
value: value,
|
265
|
+
currentValue: renderValue,
|
266
|
+
toolTipProps: _toolTipProps,
|
267
|
+
minWidth: minWidth,
|
268
|
+
isInNewRowFlag: isInNewRowFlag,
|
269
|
+
isAddCell: isAddCell
|
270
|
+
}));
|
267
271
|
};
|
268
|
-
|
272
|
+
// 千分位, 千分位带CNY前缀
|
273
|
+
} else if (['thousandth', 'thousandthCNY'].includes(valueType)) {
|
269
274
|
column.render = (value, record, index) => {
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
275
|
+
var valueStr = valueTypePrecision || valueTypePrecision === 0 ? `${Number(value).toFixed(valueTypePrecision)}` : `${value}`;
|
276
|
+
var renderValue = valueStr.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
277
|
+
var originalResult = (0, _utils2.getOriginalValue)(value, record, originalObj, rowKey, dataIndex);
|
278
|
+
var isChanged = originalResult.isChanged,
|
279
|
+
originalValue = originalResult.originalValue,
|
280
|
+
isAddCell = originalResult.isAddCell;
|
274
281
|
otherProps.isChanged = isChanged;
|
275
|
-
|
276
|
-
|
277
|
-
if ((0,
|
278
|
-
originalRenderValue =
|
282
|
+
var originalRealValue = valueTypePrecision ? `${Number(originalValue).toFixed(valueTypePrecision)}` : `${originalValue}`;
|
283
|
+
var originalRenderValue = originalRealValue.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
284
|
+
if ((0, _utils3.isEmpty)(originalValue)) {
|
285
|
+
originalRenderValue = '-';
|
279
286
|
}
|
280
|
-
|
287
|
+
var node = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_space.default, {
|
288
|
+
size: 8,
|
289
|
+
children: [prefixNode(value, record, index), renderValue, suffixNode(value, record, index)]
|
290
|
+
});
|
281
291
|
if (!value && value !== 0 && renderValue === originalRenderValue) {
|
282
|
-
|
292
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
293
|
+
style: {
|
294
|
+
minWidth
|
295
|
+
},
|
296
|
+
children: "-"
|
297
|
+
});
|
283
298
|
}
|
284
|
-
|
285
|
-
return
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
isInNewRowFlag,
|
299
|
-
isAddCell
|
300
|
-
}
|
301
|
-
);
|
299
|
+
var isInNewRowFlag = isInNewRow(record);
|
300
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RenderColumn.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, otherProps), {}, {
|
301
|
+
valueType: valueType,
|
302
|
+
originalValue: originalValue === null ? null : originalRenderValue,
|
303
|
+
ellipsis: ellipsis,
|
304
|
+
width: width,
|
305
|
+
node: node,
|
306
|
+
value: value,
|
307
|
+
currentValue: renderValue,
|
308
|
+
toolTipProps: _toolTipProps,
|
309
|
+
minWidth: minWidth,
|
310
|
+
isInNewRowFlag: isInNewRowFlag,
|
311
|
+
isAddCell: isAddCell
|
312
|
+
}));
|
302
313
|
};
|
303
|
-
} else if ([
|
304
|
-
valueType
|
305
|
-
)) {
|
314
|
+
} else if (['datePicker', 'date', 'dateTime', 'dateStartTime', 'dateEndTime', 'dateStartEndTime'].includes(valueType)) {
|
306
315
|
column.render = (value, record, index) => {
|
307
|
-
var
|
308
|
-
|
309
|
-
|
310
|
-
|
316
|
+
var _dayjs, _dayjs2, _dayjs3, _dayjs4, _dayjs5, _dayjs6, _dayjs7, _dayjs8, _dayjs9, _dayjs10, _dayjs11, _dayjs12, _dayjs13, _dayjs14;
|
317
|
+
var renderValue = (_dayjs = (0, _dayjs15.default)(value)) === null || _dayjs === void 0 ? void 0 : _dayjs.format(format);
|
318
|
+
var originalResult = (0, _utils2.getOriginalValue)(value, record, originalObj, rowKey, dataIndex);
|
319
|
+
var isChanged = originalResult.isChanged,
|
320
|
+
originalValue = originalResult.originalValue,
|
321
|
+
isAddCell = originalResult.isAddCell;
|
311
322
|
otherProps.isChanged = isChanged;
|
312
|
-
|
323
|
+
var originalRenderValue = (_dayjs2 = (0, _dayjs15.default)(originalValue)) === null || _dayjs2 === void 0 ? void 0 : _dayjs2.format(format);
|
313
324
|
switch (valueType) {
|
314
|
-
case
|
315
|
-
renderValue = (
|
316
|
-
originalRenderValue = (
|
325
|
+
case 'date':
|
326
|
+
renderValue = (_dayjs3 = (0, _dayjs15.default)(value)) === null || _dayjs3 === void 0 ? void 0 : _dayjs3.format('YYYY-MM-DD');
|
327
|
+
originalRenderValue = (_dayjs4 = (0, _dayjs15.default)(originalValue)) === null || _dayjs4 === void 0 ? void 0 : _dayjs4.format('YYYY-MM-DD');
|
317
328
|
break;
|
318
|
-
case
|
319
|
-
renderValue = (
|
320
|
-
originalRenderValue = (
|
329
|
+
case 'dateTime':
|
330
|
+
renderValue = (_dayjs5 = (0, _dayjs15.default)(value)) === null || _dayjs5 === void 0 ? void 0 : _dayjs5.format('YYYY-MM-DD HH:mm:ss');
|
331
|
+
originalRenderValue = (_dayjs6 = (0, _dayjs15.default)(originalValue)) === null || _dayjs6 === void 0 ? void 0 : _dayjs6.format('YYYY-MM-DD HH:mm:ss');
|
321
332
|
break;
|
322
|
-
case
|
323
|
-
renderValue = `${(
|
324
|
-
originalRenderValue = `${(
|
333
|
+
case 'dateStartTime':
|
334
|
+
renderValue = `${(_dayjs7 = (0, _dayjs15.default)(value)) === null || _dayjs7 === void 0 ? void 0 : _dayjs7.format('YYYY-MM-DD')} 00:00:00`;
|
335
|
+
originalRenderValue = `${(_dayjs8 = (0, _dayjs15.default)(originalValue)) === null || _dayjs8 === void 0 ? void 0 : _dayjs8.format('YYYY-MM-DD')} 00:00:00`;
|
325
336
|
break;
|
326
|
-
case
|
327
|
-
renderValue = `${(
|
328
|
-
originalRenderValue = `${(
|
337
|
+
case 'dateEndTime':
|
338
|
+
renderValue = `${(_dayjs9 = (0, _dayjs15.default)(value)) === null || _dayjs9 === void 0 ? void 0 : _dayjs9.format('YYYY-MM-DD')} 23:59:59`;
|
339
|
+
originalRenderValue = `${(_dayjs10 = (0, _dayjs15.default)(originalValue)) === null || _dayjs10 === void 0 ? void 0 : _dayjs10.format('YYYY-MM-DD')} 23:59:59`;
|
329
340
|
break;
|
330
|
-
case
|
331
|
-
renderValue = `${(
|
332
|
-
|
333
|
-
)) == null ? void 0 : _l.format("YYYY-MM-DD")} 23:59:59`;
|
334
|
-
originalRenderValue = `${(_m = (0, import_dayjs.default)(originalValue == null ? void 0 : originalValue[0])) == null ? void 0 : _m.format(
|
335
|
-
"YYYY-MM-DD"
|
336
|
-
)} 00:00:00~${(_n = (0, import_dayjs.default)(originalValue == null ? void 0 : originalValue[1])) == null ? void 0 : _n.format("YYYY-MM-DD")} 23:59:59`;
|
341
|
+
case 'dateStartEndTime':
|
342
|
+
renderValue = `${(_dayjs11 = (0, _dayjs15.default)(value === null || value === void 0 ? void 0 : value[0])) === null || _dayjs11 === void 0 ? void 0 : _dayjs11.format('YYYY-MM-DD')} 00:00:00~${(_dayjs12 = (0, _dayjs15.default)(value === null || value === void 0 ? void 0 : value[1])) === null || _dayjs12 === void 0 ? void 0 : _dayjs12.format('YYYY-MM-DD')} 23:59:59`;
|
343
|
+
originalRenderValue = `${(_dayjs13 = (0, _dayjs15.default)(originalValue === null || originalValue === void 0 ? void 0 : originalValue[0])) === null || _dayjs13 === void 0 ? void 0 : _dayjs13.format('YYYY-MM-DD')} 00:00:00~${(_dayjs14 = (0, _dayjs15.default)(originalValue === null || originalValue === void 0 ? void 0 : originalValue[1])) === null || _dayjs14 === void 0 ? void 0 : _dayjs14.format('YYYY-MM-DD')} 23:59:59`;
|
337
344
|
break;
|
338
345
|
}
|
339
346
|
if (!value) {
|
340
|
-
renderValue =
|
347
|
+
renderValue = '-';
|
341
348
|
}
|
342
349
|
if (!originalValue) {
|
343
|
-
originalRenderValue =
|
350
|
+
originalRenderValue = '-';
|
344
351
|
}
|
345
|
-
|
352
|
+
var node = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_space.default, {
|
353
|
+
size: 8,
|
354
|
+
children: [prefixNode(value, record, index), renderValue, suffixNode(value, record, index)]
|
355
|
+
});
|
346
356
|
if (!value && renderValue === originalRenderValue) {
|
347
|
-
|
357
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
358
|
+
style: {
|
359
|
+
minWidth
|
360
|
+
},
|
361
|
+
children: "-"
|
362
|
+
});
|
348
363
|
}
|
349
|
-
|
350
|
-
return
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
isInNewRowFlag,
|
364
|
-
isAddCell
|
365
|
-
}
|
366
|
-
);
|
364
|
+
var isInNewRowFlag = isInNewRow(record);
|
365
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RenderColumn.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, otherProps), {}, {
|
366
|
+
valueType: valueType,
|
367
|
+
originalValue: originalValue === null ? null : originalRenderValue,
|
368
|
+
ellipsis: ellipsis,
|
369
|
+
width: width,
|
370
|
+
node: node,
|
371
|
+
value: value,
|
372
|
+
currentValue: renderValue,
|
373
|
+
toolTipProps: _toolTipProps,
|
374
|
+
minWidth: minWidth,
|
375
|
+
isInNewRowFlag: isInNewRowFlag,
|
376
|
+
isAddCell: isAddCell
|
377
|
+
}));
|
367
378
|
};
|
368
|
-
} else if ([
|
379
|
+
} else if (['enumName', 'enumCodeName'].includes(valueType)) {
|
369
380
|
column.render = (value, record, index) => {
|
370
|
-
var
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
381
|
+
var realCode = typeof code === 'function' ? code(value, record) : code;
|
382
|
+
var renderValue = (0, _getEnumLabel.default)(realCode, value, valueType === 'enumCodeName');
|
383
|
+
var originalResult = (0, _utils2.getOriginalValue)(value, record, originalObj, rowKey, dataIndex);
|
384
|
+
var isChanged = originalResult.isChanged,
|
385
|
+
originalValue = originalResult.originalValue,
|
386
|
+
isAddCell = originalResult.isAddCell;
|
375
387
|
otherProps.isChanged = isChanged;
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
renderValue = /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, labelName || "-");
|
388
|
+
var originalRenderValue = (0, _getEnumLabel.default)(realCode, originalValue, valueType === 'enumCodeName');
|
389
|
+
if (Array.isArray(column === null || column === void 0 ? void 0 : column.codeValues) && !realCode) {
|
390
|
+
var _column$codeValues$fi;
|
391
|
+
var labelName = column === null || column === void 0 || (_column$codeValues$fi = column.codeValues.find(item => item.value === value)) === null || _column$codeValues$fi === void 0 ? void 0 : _column$codeValues$fi.label;
|
392
|
+
if (valueType === 'enumName') {
|
393
|
+
renderValue = /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
394
|
+
children: labelName || '-'
|
395
|
+
});
|
385
396
|
}
|
386
|
-
if (valueType ===
|
387
|
-
renderValue =
|
397
|
+
if (valueType === 'enumCodeName') {
|
398
|
+
renderValue = /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
399
|
+
children: labelName ? `${value}-${labelName}` : labelName
|
400
|
+
});
|
388
401
|
}
|
389
402
|
}
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
);
|
403
|
+
var node = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_space.default, {
|
404
|
+
size: 8,
|
405
|
+
children: [prefixNode(value, record, index), renderValue, suffixNode(value, record, index)]
|
406
|
+
});
|
407
|
+
var isInNewRowFlag = isInNewRow(record);
|
408
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RenderColumn.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, otherProps), {}, {
|
409
|
+
valueType: valueType,
|
410
|
+
originalValue: originalValue === null ? null : originalRenderValue,
|
411
|
+
ellipsis: ellipsis,
|
412
|
+
width: width,
|
413
|
+
node: node,
|
414
|
+
value: value,
|
415
|
+
currentValue: renderValue,
|
416
|
+
toolTipProps: _toolTipProps,
|
417
|
+
minWidth: minWidth,
|
418
|
+
isInNewRowFlag: isInNewRowFlag,
|
419
|
+
isAddCell: isAddCell
|
420
|
+
}));
|
409
421
|
};
|
410
422
|
} else if (precision || prefix || suffix) {
|
411
423
|
column.render = (value, record, index) => {
|
412
|
-
|
413
|
-
|
414
|
-
|
424
|
+
var renderValue = value === 'number' ? value.toFixed(precision) : value;
|
425
|
+
var originalResult = (0, _utils2.getOriginalValue)(value, record, originalObj, rowKey, dataIndex);
|
426
|
+
var isChanged = originalResult.isChanged,
|
427
|
+
originalValue = originalResult.originalValue,
|
428
|
+
isAddCell = originalResult.isAddCell;
|
415
429
|
otherProps.isChanged = isChanged;
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
430
|
+
var originalRenderValue = originalValue === 'number' ? originalValue.toFixed(precision) : originalValue;
|
431
|
+
var node = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_space.default, {
|
432
|
+
size: 8,
|
433
|
+
children: [prefixNode(value, record, index), renderValue, suffixNode(value, record, index)]
|
434
|
+
});
|
435
|
+
if ((0, _utils3.isEmpty)(originalValue)) {
|
436
|
+
originalRenderValue = '-';
|
420
437
|
}
|
421
438
|
if (!value && value !== 0 && renderValue === originalRenderValue) {
|
422
|
-
|
439
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
440
|
+
style: {
|
441
|
+
minWidth
|
442
|
+
},
|
443
|
+
children: "-"
|
444
|
+
});
|
423
445
|
}
|
424
|
-
|
425
|
-
return
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
isInNewRowFlag,
|
439
|
-
isAddCell
|
440
|
-
}
|
441
|
-
);
|
446
|
+
var isInNewRowFlag = isInNewRow(record);
|
447
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RenderColumn.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, otherProps), {}, {
|
448
|
+
valueType: valueType,
|
449
|
+
originalValue: originalValue === null ? null : originalRenderValue,
|
450
|
+
ellipsis: ellipsis,
|
451
|
+
width: width,
|
452
|
+
node: node,
|
453
|
+
value: value,
|
454
|
+
currentValue: renderValue,
|
455
|
+
toolTipProps: _toolTipProps,
|
456
|
+
minWidth: minWidth,
|
457
|
+
isInNewRowFlag: isInNewRowFlag,
|
458
|
+
isAddCell: isAddCell
|
459
|
+
}));
|
442
460
|
};
|
443
|
-
} else if (valueType ===
|
461
|
+
} else if (valueType === 'address') {
|
444
462
|
column.render = (value, record, index) => {
|
445
|
-
var
|
446
|
-
|
447
|
-
|
448
|
-
|
463
|
+
var _realValue$filter;
|
464
|
+
var realValue = transform ? transform(value, record) : value;
|
465
|
+
var originalResult = (0, _utils2.getOriginalValue)(value, record, originalObj, rowKey, dataIndex);
|
466
|
+
var isChanged = originalResult.isChanged,
|
467
|
+
originalValue = originalResult.originalValue,
|
468
|
+
isAddCell = originalResult.isAddCell;
|
449
469
|
otherProps.isChanged = isChanged;
|
450
|
-
|
451
|
-
|
452
|
-
if ((0,
|
453
|
-
|
470
|
+
var originalRealValue = transform ? transform(originalValue, record) : originalValue;
|
471
|
+
var isEmpty = !realValue || Array.isArray(realValue) && (realValue === null || realValue === void 0 || (_realValue$filter = realValue.filter(item => !!item)) === null || _realValue$filter === void 0 ? void 0 : _realValue$filter.length) === 0;
|
472
|
+
if ((0, _lodash.isEqual)(value, originalValue) && isEmpty) {
|
473
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
474
|
+
style: {
|
475
|
+
minWidth
|
476
|
+
},
|
477
|
+
children: "-"
|
478
|
+
});
|
454
479
|
}
|
455
|
-
|
456
|
-
|
480
|
+
var className = (0, _classnames.default)({
|
481
|
+
'empty-cell': isEmpty
|
457
482
|
});
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
483
|
+
|
484
|
+
// 处理 code 为函数的情况
|
485
|
+
var realCode = typeof code === 'function' ? code(value, record) : code;
|
486
|
+
var renderValue = /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ProCascader, {
|
487
|
+
isView: true,
|
488
|
+
mode: "address",
|
489
|
+
code: realCode,
|
490
|
+
value: realValue
|
491
|
+
});
|
492
|
+
var originalRenderValue = /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ProCascader, {
|
493
|
+
isView: true,
|
494
|
+
mode: "address",
|
495
|
+
code: realCode,
|
496
|
+
value: originalRealValue
|
497
|
+
});
|
498
|
+
var renderNode = /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ProCascader, {
|
499
|
+
className: className,
|
500
|
+
isView: true,
|
501
|
+
mode: "address",
|
502
|
+
code: realCode,
|
503
|
+
value: realValue,
|
504
|
+
tooltip: false
|
505
|
+
});
|
506
|
+
var isInNewRowFlag = isInNewRow(record);
|
507
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RenderColumn.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, otherProps), {}, {
|
508
|
+
valueType: valueType,
|
509
|
+
originalValue: originalValue === null ? null : originalRenderValue,
|
510
|
+
ellipsis: ellipsis,
|
511
|
+
width: width,
|
512
|
+
node: renderNode,
|
513
|
+
value: renderValue,
|
514
|
+
currentValue: renderValue,
|
515
|
+
toolTipProps: _toolTipProps,
|
516
|
+
minWidth: minWidth,
|
517
|
+
isInNewRowFlag: isInNewRowFlag,
|
518
|
+
isAddCell: isAddCell
|
519
|
+
}));
|
490
520
|
};
|
491
521
|
} else if (copyable) {
|
492
522
|
column.render = (value, record, index) => {
|
493
|
-
|
494
|
-
return
|
495
|
-
|
496
|
-
{
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
width,
|
523
|
+
var isInNewRowFlag = isInNewRow(record);
|
524
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_space.default, {
|
525
|
+
size: 8,
|
526
|
+
children: [prefixNode(value, record, index), /*#__PURE__*/(0, _jsxRuntime.jsx)(_RenderColumn.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, otherProps), {}, {
|
527
|
+
valueType: valueType,
|
528
|
+
copyable: copyable,
|
529
|
+
ellipsis: ellipsis,
|
530
|
+
width: width,
|
502
531
|
node: value,
|
503
|
-
value,
|
532
|
+
value: value,
|
504
533
|
currentValue: value,
|
505
534
|
toolTipProps: _toolTipProps,
|
506
|
-
minWidth,
|
507
|
-
isInNewRowFlag
|
508
|
-
}
|
509
|
-
)
|
535
|
+
minWidth: minWidth,
|
536
|
+
isInNewRowFlag: isInNewRowFlag
|
537
|
+
})), suffixNode(value, record, index)]
|
538
|
+
});
|
510
539
|
};
|
511
540
|
} else if (ellipsis) {
|
512
541
|
column.render = (value, record, index) => {
|
513
|
-
|
514
|
-
|
542
|
+
var originalResult = (0, _utils2.getOriginalValue)(value, record, originalObj, rowKey, dataIndex);
|
543
|
+
var isChanged = originalResult.isChanged,
|
544
|
+
originalValue = originalResult.originalValue,
|
545
|
+
isAddCell = originalResult.isAddCell;
|
515
546
|
otherProps.isChanged = isChanged;
|
516
547
|
if (!value && value !== 0 && value === originalValue) {
|
517
|
-
|
548
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
549
|
+
style: {
|
550
|
+
minWidth
|
551
|
+
},
|
552
|
+
children: "-"
|
553
|
+
});
|
518
554
|
}
|
519
|
-
|
520
|
-
return
|
521
|
-
|
522
|
-
{
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
width,
|
555
|
+
var isInNewRowFlag = isInNewRow(record);
|
556
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_space.default, {
|
557
|
+
size: 8,
|
558
|
+
children: [prefixNode(value, record, index), /*#__PURE__*/(0, _jsxRuntime.jsx)(_RenderColumn.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, otherProps), {}, {
|
559
|
+
valueType: valueType,
|
560
|
+
originalValue: originalValue === null ? null : originalValue || '-',
|
561
|
+
ellipsis: ellipsis,
|
562
|
+
width: width,
|
528
563
|
node: value,
|
529
|
-
value,
|
530
|
-
currentValue: value ||
|
564
|
+
value: value,
|
565
|
+
currentValue: value || '-',
|
531
566
|
toolTipProps: _toolTipProps,
|
532
|
-
minWidth,
|
533
|
-
isInNewRowFlag,
|
534
|
-
isAddCell
|
535
|
-
}
|
536
|
-
)
|
567
|
+
minWidth: minWidth,
|
568
|
+
isInNewRowFlag: isInNewRowFlag,
|
569
|
+
isAddCell: isAddCell
|
570
|
+
})), suffixNode(value, record, index)]
|
571
|
+
});
|
537
572
|
};
|
538
573
|
} else {
|
539
574
|
column.render = (value, record, index) => {
|
540
|
-
|
541
|
-
|
575
|
+
var originalResult = (0, _utils2.getOriginalValue)(value, record, originalObj, rowKey, dataIndex);
|
576
|
+
var isChanged = originalResult.isChanged,
|
577
|
+
originalValue = originalResult.originalValue,
|
578
|
+
isAddCell = originalResult.isAddCell;
|
542
579
|
otherProps.isChanged = isChanged;
|
543
|
-
|
580
|
+
var node = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_space.default, {
|
581
|
+
size: 8,
|
582
|
+
children: [prefixNode(value, record, index), value, suffixNode(value, record, index)]
|
583
|
+
});
|
544
584
|
if (!value && value !== 0 && value === originalValue) {
|
545
|
-
|
585
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
586
|
+
style: {
|
587
|
+
minWidth
|
588
|
+
},
|
589
|
+
children: "-"
|
590
|
+
});
|
546
591
|
}
|
547
|
-
|
548
|
-
return
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
isInNewRowFlag,
|
562
|
-
isAddCell
|
563
|
-
}
|
564
|
-
);
|
592
|
+
var isInNewRowFlag = isInNewRow(record);
|
593
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RenderColumn.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, otherProps), {}, {
|
594
|
+
valueType: valueType,
|
595
|
+
originalValue: originalValue === null ? null : originalValue || '-',
|
596
|
+
ellipsis: ellipsis,
|
597
|
+
width: width,
|
598
|
+
node: node,
|
599
|
+
value: value,
|
600
|
+
currentValue: value || '-',
|
601
|
+
toolTipProps: _toolTipProps,
|
602
|
+
minWidth: minWidth,
|
603
|
+
isInNewRowFlag: isInNewRowFlag,
|
604
|
+
isAddCell: isAddCell
|
605
|
+
}));
|
565
606
|
};
|
566
607
|
}
|
567
608
|
};
|
568
|
-
|
569
|
-
|
609
|
+
|
610
|
+
/**
|
611
|
+
* 查找最近的父级className
|
612
|
+
* @param element 当前node节点
|
613
|
+
* @param type 'className' | 'id' 查找class或者id
|
614
|
+
* @param name string class或者id的值
|
615
|
+
* @returns ReactNode 父级element
|
616
|
+
*/
|
617
|
+
exports.formatColumn = formatColumn;
|
618
|
+
var getParentElement = exports.getParentElement = function getParentElement(element, name) {
|
619
|
+
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'className';
|
620
|
+
var result = /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {});
|
570
621
|
if (!element || !name) {
|
571
622
|
return result;
|
572
623
|
}
|
573
|
-
|
574
|
-
|
575
|
-
|
624
|
+
var searchDom = function searchDom(element, name) {
|
625
|
+
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'className';
|
626
|
+
if (element.parentElement[type] === name) {
|
627
|
+
result = element.parentElement;
|
576
628
|
return false;
|
577
629
|
}
|
578
|
-
searchDom(
|
630
|
+
searchDom(element.parentElement, name, type = 'className');
|
579
631
|
};
|
580
|
-
searchDom(element, name, type =
|
632
|
+
searchDom(element, name, type = 'className');
|
581
633
|
return result;
|
582
|
-
};
|
583
|
-
// Annotate the CommonJS export names for ESM import in node:
|
584
|
-
0 && (module.exports = {
|
585
|
-
formatColumn,
|
586
|
-
getParentElement
|
587
|
-
});
|
634
|
+
};
|