@zat-design/sisyphus-react 3.4.5-beta.2 → 3.4.5-beta.20
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 +55 -13
- package/dist/less.esm.css +55 -13
- package/es/ProConfigProvider/index.d.ts +2 -2
- package/es/ProEditTable/components/RenderField/index.js +36 -29
- package/es/ProEditTable/index.js +3 -3
- package/es/ProEditTable/utils/tools.d.ts +12 -0
- package/es/ProEditTable/utils/tools.js +77 -1
- package/es/ProForm/components/base/RangePicker/index.js +9 -9
- package/es/ProForm/components/combination/Container/index.js +3 -2
- package/es/ProForm/components/combination/Container/style/index.less +5 -1
- package/es/ProForm/components/combination/{ProAddressBar → ProCascader}/index.d.ts +2 -2
- package/es/ProForm/components/combination/ProCascader/index.js +255 -0
- package/es/ProForm/components/combination/{ProAddressBar → ProCascader}/propsType.d.ts +8 -6
- package/es/ProForm/components/combination/ProModalSelect/index.js +3 -4
- package/es/ProForm/components/index.d.ts +1 -2
- package/es/ProForm/components/index.js +1 -4
- package/es/ProForm/components/render/Render.js +1 -1
- package/es/ProForm/components/render/RenderFields.js +3 -1
- package/es/ProForm/components/render/propsType.d.ts +3 -7
- package/es/ProForm/index.js +2 -2
- package/es/ProForm/propsType.d.ts +2 -0
- package/es/ProForm/style/index.less +1 -1
- package/es/ProForm/utils/index.js +1 -1
- package/es/ProIcon/index.js +148 -85
- package/es/ProIcon/propsTypes.d.ts +6 -1
- package/es/ProIcon/utils/index.d.ts +5 -0
- package/es/ProIcon/utils/index.js +60 -0
- package/es/ProLayout/components/ProCollapse/style/index.less +1 -1
- package/es/ProSelect/index.js +1 -1
- package/es/ProStep/components/Step/index.js +1 -1
- package/es/ProStep/style/index.less +17 -0
- package/es/ProTable/utils.js +6 -3
- package/es/ProThemeTools/component/PrdTools/index.js +8 -2
- package/es/ProTree/components/ProTree.js +48 -26
- package/es/ProTree/components/Tree.js +52 -36
- package/es/ProTree/style/index.less +24 -17
- package/es/ProUpload/index.js +9 -11
- package/es/ProUpload/propsType.d.ts +8 -3
- package/lib/ProConfigProvider/index.d.ts +2 -2
- package/lib/ProEditTable/components/RenderField/index.js +35 -28
- package/lib/ProEditTable/index.js +3 -3
- package/lib/ProEditTable/utils/tools.d.ts +12 -0
- package/lib/ProEditTable/utils/tools.js +78 -1
- package/lib/ProForm/components/base/RangePicker/index.js +9 -9
- package/lib/ProForm/components/combination/Container/index.js +3 -2
- package/lib/ProForm/components/combination/Container/style/index.less +5 -1
- package/lib/ProForm/components/combination/{ProAddressBar → ProCascader}/index.d.ts +2 -2
- package/lib/ProForm/components/combination/ProCascader/index.js +255 -0
- package/lib/ProForm/components/combination/{ProAddressBar → ProCascader}/propsType.d.ts +8 -6
- package/lib/ProForm/components/combination/ProModalSelect/index.js +3 -4
- package/lib/ProForm/components/index.d.ts +1 -2
- package/lib/ProForm/components/index.js +1 -8
- package/lib/ProForm/components/render/Render.js +1 -1
- package/lib/ProForm/components/render/RenderFields.js +3 -1
- package/lib/ProForm/components/render/propsType.d.ts +3 -7
- package/lib/ProForm/index.js +1 -1
- package/lib/ProForm/propsType.d.ts +2 -0
- package/lib/ProForm/style/index.less +1 -1
- package/lib/ProForm/utils/index.js +1 -1
- package/lib/ProIcon/index.js +143 -80
- package/lib/ProIcon/propsTypes.d.ts +6 -1
- package/lib/ProIcon/utils/index.d.ts +5 -0
- package/lib/ProIcon/utils/index.js +62 -1
- package/lib/ProLayout/components/ProCollapse/style/index.less +1 -1
- package/lib/ProSelect/index.js +1 -1
- package/lib/ProStep/components/Step/index.js +1 -1
- package/lib/ProStep/style/index.less +17 -0
- package/lib/ProTable/utils.js +6 -3
- package/lib/ProThemeTools/component/PrdTools/index.js +8 -2
- package/lib/ProTree/components/ProTree.js +48 -26
- package/lib/ProTree/components/Tree.js +52 -36
- package/lib/ProTree/style/index.less +24 -17
- package/lib/ProUpload/index.js +8 -10
- package/lib/ProUpload/propsType.d.ts +8 -3
- package/package.json +1 -1
- package/es/ProForm/components/base/ProCascader/index.d.ts +0 -14
- package/es/ProForm/components/base/ProCascader/index.js +0 -72
- package/es/ProForm/components/combination/ProAddressBar/index.js +0 -437
- package/lib/ProForm/components/base/ProCascader/index.d.ts +0 -14
- package/lib/ProForm/components/base/ProCascader/index.js +0 -78
- package/lib/ProForm/components/combination/ProAddressBar/index.js +0 -437
- /package/es/ProForm/components/combination/{ProAddressBar → ProCascader}/propsType.js +0 -0
- /package/es/ProForm/components/combination/{ProAddressBar → ProCascader}/style/index.less +0 -0
- /package/lib/ProForm/components/combination/{ProAddressBar → ProCascader}/propsType.js +0 -0
- /package/lib/ProForm/components/combination/{ProAddressBar → ProCascader}/style/index.less +0 -0
package/dist/index.esm.css
CHANGED
|
@@ -686,7 +686,10 @@
|
|
|
686
686
|
display: none !important;
|
|
687
687
|
}
|
|
688
688
|
.pro-collapse.pro-collapse-no-title .pro-collapse-level2 .ant-collapse-header {
|
|
689
|
-
display:
|
|
689
|
+
display: -webkit-box !important;
|
|
690
|
+
display: -webkit-flex !important;
|
|
691
|
+
display: -ms-flexbox !important;
|
|
692
|
+
display: flex !important;
|
|
690
693
|
}
|
|
691
694
|
.pro-collapse.ant-collapse .pro-collapse-panel {
|
|
692
695
|
margin-bottom: 16px;
|
|
@@ -1497,6 +1500,32 @@
|
|
|
1497
1500
|
width: 48px;
|
|
1498
1501
|
height: 24px;
|
|
1499
1502
|
}
|
|
1503
|
+
.pro-step > .step-menu > .anticon > button {
|
|
1504
|
+
width: auto !important;
|
|
1505
|
+
height: auto !important;
|
|
1506
|
+
}
|
|
1507
|
+
.pro-step > .step-menu > .anticon > button > .menu-icon {
|
|
1508
|
+
width: auto !important;
|
|
1509
|
+
height: auto !important;
|
|
1510
|
+
font-size: var(--zaui-font-size-lg-title, 24px);
|
|
1511
|
+
fill: var(--zaui-brand, #006aff);
|
|
1512
|
+
}
|
|
1513
|
+
.pro-step > .step-menu > .anticon > button > .menu-icon > div {
|
|
1514
|
+
display: -webkit-box;
|
|
1515
|
+
display: -webkit-flex;
|
|
1516
|
+
display: -ms-flexbox;
|
|
1517
|
+
display: flex;
|
|
1518
|
+
-webkit-box-align: center;
|
|
1519
|
+
-webkit-align-items: center;
|
|
1520
|
+
-ms-flex-align: center;
|
|
1521
|
+
align-items: center;
|
|
1522
|
+
-webkit-box-pack: center;
|
|
1523
|
+
-webkit-justify-content: center;
|
|
1524
|
+
-ms-flex-pack: center;
|
|
1525
|
+
justify-content: center;
|
|
1526
|
+
width: 48px;
|
|
1527
|
+
height: 24px;
|
|
1528
|
+
}
|
|
1500
1529
|
.pro-step > .step-menu > .menu-icon {
|
|
1501
1530
|
font-size: var(--zaui-font-size-lg-title, 24px);
|
|
1502
1531
|
fill: var(--zaui-brand, #006aff);
|
|
@@ -2485,6 +2514,9 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2485
2514
|
color: var(--ant-error-color);
|
|
2486
2515
|
border-color: var(--ant-error-color);
|
|
2487
2516
|
}
|
|
2517
|
+
.pro-container.pro-container-empty .ant-collapse-content {
|
|
2518
|
+
display: none;
|
|
2519
|
+
}
|
|
2488
2520
|
.pro-container.pro-container-diy .pro-container-content {
|
|
2489
2521
|
display: -webkit-box;
|
|
2490
2522
|
display: -webkit-flex;
|
|
@@ -3577,6 +3609,28 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
3577
3609
|
.pro-tree {
|
|
3578
3610
|
height: 100%;
|
|
3579
3611
|
}
|
|
3612
|
+
.pro-tree .ant-tree-node-content-wrapper {
|
|
3613
|
+
display: -webkit-box;
|
|
3614
|
+
display: -webkit-flex;
|
|
3615
|
+
display: -ms-flexbox;
|
|
3616
|
+
display: flex;
|
|
3617
|
+
-webkit-box-align: baseline;
|
|
3618
|
+
-webkit-align-items: baseline;
|
|
3619
|
+
-ms-flex-align: baseline;
|
|
3620
|
+
align-items: baseline;
|
|
3621
|
+
}
|
|
3622
|
+
.pro-tree .ant-tree .ant-tree-treenode-disabled .ant-tree-node-content-wrapper {
|
|
3623
|
+
color: var(--zaui-text);
|
|
3624
|
+
}
|
|
3625
|
+
.pro-tree .ant-tree .ant-tree-treenode-disabled .pro-tree-tree-node.checked {
|
|
3626
|
+
color: var(--zaui-text);
|
|
3627
|
+
}
|
|
3628
|
+
.pro-tree .ant-tree .ant-tree-treenode-disabled .pro-tree-tree-node.checked .brand-bg-opa-ten {
|
|
3629
|
+
background-color: inherit;
|
|
3630
|
+
}
|
|
3631
|
+
.pro-tree .ant-select-dropdown.pro-tree-select-drop-down-container.checkable-tree {
|
|
3632
|
+
overflow: hidden!important;
|
|
3633
|
+
}
|
|
3580
3634
|
.pro-tree .ant-spin-nested-loading {
|
|
3581
3635
|
height: 100%;
|
|
3582
3636
|
}
|
|
@@ -3893,15 +3947,6 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
3893
3947
|
background-color: var(--zaui-brand);
|
|
3894
3948
|
opacity: 0.08;
|
|
3895
3949
|
}
|
|
3896
|
-
.ant-tree .ant-tree-treenode-disabled .ant-tree-node-content-wrapper {
|
|
3897
|
-
color: var(--zaui-text);
|
|
3898
|
-
}
|
|
3899
|
-
.ant-tree .ant-tree-treenode-disabled .pro-tree-tree-node.checked {
|
|
3900
|
-
color: var(--zaui-text);
|
|
3901
|
-
}
|
|
3902
|
-
.ant-tree .ant-tree-treenode-disabled .pro-tree-tree-node.checked .brand-bg-opa-ten {
|
|
3903
|
-
background-color: inherit;
|
|
3904
|
-
}
|
|
3905
3950
|
.pro-form.pro-form-view .ant-form-item .pro-tree * {
|
|
3906
3951
|
line-height: 1 !important;
|
|
3907
3952
|
height: auto !important;
|
|
@@ -3916,9 +3961,6 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
3916
3961
|
.pro-form.pro-form-view .ant-form-item .pro-tree .ant-tree-checkbox * {
|
|
3917
3962
|
height: 16px !important;
|
|
3918
3963
|
}
|
|
3919
|
-
.ant-select-dropdown.pro-tree-select-drop-down-container.checkable-tree {
|
|
3920
|
-
overflow: hidden!important;
|
|
3921
|
-
}
|
|
3922
3964
|
.pro-drawer .pro-drawer-close {
|
|
3923
3965
|
position: absolute;
|
|
3924
3966
|
top: 6px;
|
package/dist/less.esm.css
CHANGED
|
@@ -686,7 +686,10 @@
|
|
|
686
686
|
display: none !important;
|
|
687
687
|
}
|
|
688
688
|
.pro-collapse.pro-collapse-no-title .pro-collapse-level2 .ant-collapse-header {
|
|
689
|
-
display:
|
|
689
|
+
display: -webkit-box !important;
|
|
690
|
+
display: -webkit-flex !important;
|
|
691
|
+
display: -ms-flexbox !important;
|
|
692
|
+
display: flex !important;
|
|
690
693
|
}
|
|
691
694
|
.pro-collapse.ant-collapse .pro-collapse-panel {
|
|
692
695
|
margin-bottom: 16px;
|
|
@@ -1497,6 +1500,32 @@
|
|
|
1497
1500
|
width: 48px;
|
|
1498
1501
|
height: 24px;
|
|
1499
1502
|
}
|
|
1503
|
+
.pro-step > .step-menu > .anticon > button {
|
|
1504
|
+
width: auto !important;
|
|
1505
|
+
height: auto !important;
|
|
1506
|
+
}
|
|
1507
|
+
.pro-step > .step-menu > .anticon > button > .menu-icon {
|
|
1508
|
+
width: auto !important;
|
|
1509
|
+
height: auto !important;
|
|
1510
|
+
font-size: var(--zaui-font-size-lg-title, 24px);
|
|
1511
|
+
fill: var(--zaui-brand, #006aff);
|
|
1512
|
+
}
|
|
1513
|
+
.pro-step > .step-menu > .anticon > button > .menu-icon > div {
|
|
1514
|
+
display: -webkit-box;
|
|
1515
|
+
display: -webkit-flex;
|
|
1516
|
+
display: -ms-flexbox;
|
|
1517
|
+
display: flex;
|
|
1518
|
+
-webkit-box-align: center;
|
|
1519
|
+
-webkit-align-items: center;
|
|
1520
|
+
-ms-flex-align: center;
|
|
1521
|
+
align-items: center;
|
|
1522
|
+
-webkit-box-pack: center;
|
|
1523
|
+
-webkit-justify-content: center;
|
|
1524
|
+
-ms-flex-pack: center;
|
|
1525
|
+
justify-content: center;
|
|
1526
|
+
width: 48px;
|
|
1527
|
+
height: 24px;
|
|
1528
|
+
}
|
|
1500
1529
|
.pro-step > .step-menu > .menu-icon {
|
|
1501
1530
|
font-size: var(--zaui-font-size-lg-title, 24px);
|
|
1502
1531
|
fill: var(--zaui-brand, #006aff);
|
|
@@ -2485,6 +2514,9 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2485
2514
|
color: var(--ant-error-color);
|
|
2486
2515
|
border-color: var(--ant-error-color);
|
|
2487
2516
|
}
|
|
2517
|
+
.pro-container.pro-container-empty .ant-collapse-content {
|
|
2518
|
+
display: none;
|
|
2519
|
+
}
|
|
2488
2520
|
.pro-container.pro-container-diy .pro-container-content {
|
|
2489
2521
|
display: -webkit-box;
|
|
2490
2522
|
display: -webkit-flex;
|
|
@@ -3577,6 +3609,28 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
3577
3609
|
.pro-tree {
|
|
3578
3610
|
height: 100%;
|
|
3579
3611
|
}
|
|
3612
|
+
.pro-tree .ant-tree-node-content-wrapper {
|
|
3613
|
+
display: -webkit-box;
|
|
3614
|
+
display: -webkit-flex;
|
|
3615
|
+
display: -ms-flexbox;
|
|
3616
|
+
display: flex;
|
|
3617
|
+
-webkit-box-align: baseline;
|
|
3618
|
+
-webkit-align-items: baseline;
|
|
3619
|
+
-ms-flex-align: baseline;
|
|
3620
|
+
align-items: baseline;
|
|
3621
|
+
}
|
|
3622
|
+
.pro-tree .ant-tree .ant-tree-treenode-disabled .ant-tree-node-content-wrapper {
|
|
3623
|
+
color: var(--zaui-text);
|
|
3624
|
+
}
|
|
3625
|
+
.pro-tree .ant-tree .ant-tree-treenode-disabled .pro-tree-tree-node.checked {
|
|
3626
|
+
color: var(--zaui-text);
|
|
3627
|
+
}
|
|
3628
|
+
.pro-tree .ant-tree .ant-tree-treenode-disabled .pro-tree-tree-node.checked .brand-bg-opa-ten {
|
|
3629
|
+
background-color: inherit;
|
|
3630
|
+
}
|
|
3631
|
+
.pro-tree .ant-select-dropdown.pro-tree-select-drop-down-container.checkable-tree {
|
|
3632
|
+
overflow: hidden!important;
|
|
3633
|
+
}
|
|
3580
3634
|
.pro-tree .ant-spin-nested-loading {
|
|
3581
3635
|
height: 100%;
|
|
3582
3636
|
}
|
|
@@ -3893,15 +3947,6 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
3893
3947
|
background-color: var(--zaui-brand);
|
|
3894
3948
|
opacity: 0.08;
|
|
3895
3949
|
}
|
|
3896
|
-
.ant-tree .ant-tree-treenode-disabled .ant-tree-node-content-wrapper {
|
|
3897
|
-
color: var(--zaui-text);
|
|
3898
|
-
}
|
|
3899
|
-
.ant-tree .ant-tree-treenode-disabled .pro-tree-tree-node.checked {
|
|
3900
|
-
color: var(--zaui-text);
|
|
3901
|
-
}
|
|
3902
|
-
.ant-tree .ant-tree-treenode-disabled .pro-tree-tree-node.checked .brand-bg-opa-ten {
|
|
3903
|
-
background-color: inherit;
|
|
3904
|
-
}
|
|
3905
3950
|
.pro-form.pro-form-view .ant-form-item .pro-tree * {
|
|
3906
3951
|
line-height: 1 !important;
|
|
3907
3952
|
height: auto !important;
|
|
@@ -3916,9 +3961,6 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
3916
3961
|
.pro-form.pro-form-view .ant-form-item .pro-tree .ant-tree-checkbox * {
|
|
3917
3962
|
height: 16px !important;
|
|
3918
3963
|
}
|
|
3919
|
-
.ant-select-dropdown.pro-tree-select-drop-down-container.checkable-tree {
|
|
3920
|
-
overflow: hidden!important;
|
|
3921
|
-
}
|
|
3922
3964
|
.pro-drawer .pro-drawer-close {
|
|
3923
3965
|
position: absolute;
|
|
3924
3966
|
top: 6px;
|
|
@@ -2,14 +2,14 @@ import React, { FC } from 'react';
|
|
|
2
2
|
import { FormInstance } from 'antd';
|
|
3
3
|
import { PropSelectProps } from '../ProSelect/propsType';
|
|
4
4
|
import { ProModalSelectPropsType } from '../ProForm/components/combination/ProModalSelect/propsType';
|
|
5
|
-
import {
|
|
5
|
+
import { ProCascaderProps } from '../ProForm/components/combination/ProCascader/propsType';
|
|
6
6
|
import { ProEnumConfig } from '../ProEnum/propsType';
|
|
7
7
|
export interface ProConfigState {
|
|
8
8
|
locale?: string;
|
|
9
9
|
ProEnum?: Partial<ProEnumConfig>;
|
|
10
10
|
ProSelect?: Partial<PropSelectProps> & Record<string, any>;
|
|
11
11
|
ProModalSelect?: Partial<ProModalSelectPropsType> & Record<string, any>;
|
|
12
|
-
ProAddressBar?: Partial<
|
|
12
|
+
ProAddressBar?: Partial<ProCascaderProps> & Record<string, any>;
|
|
13
13
|
forms: Record<string, FormInstance | undefined>;
|
|
14
14
|
[key: string]: any;
|
|
15
15
|
}
|
|
@@ -20,7 +20,7 @@ import classNames from 'classnames';
|
|
|
20
20
|
import { cloneDeep, isEqual, debounce, omit, isFunction } from 'lodash';
|
|
21
21
|
import valueTypeMap from '../../../ProForm/utils/valueType';
|
|
22
22
|
import transformMap from '../../utils/transform';
|
|
23
|
-
import { getNamePath, difference } from '../../utils/tools';
|
|
23
|
+
import { getNamePath, difference, getDisabled } from '../../utils/tools';
|
|
24
24
|
import * as componentMap from '../../../ProForm/components';
|
|
25
25
|
import Container from '../../../ProForm/components/Container';
|
|
26
26
|
import transformNames from '../../../ProForm/utils/transformNames';
|
|
@@ -29,7 +29,7 @@ import { useListChanged } from '../../../ProForm/utils/useListChanged';
|
|
|
29
29
|
import useRules from '../../../ProForm/utils/useRules';
|
|
30
30
|
import { isSelect } from '../../../ProForm/utils';
|
|
31
31
|
var RenderField = function RenderField(_ref) {
|
|
32
|
-
var _type, _type$replace, _fieldProps2,
|
|
32
|
+
var _type, _type$replace, _fieldProps2, _names, _TargetComponent4, _componentProps;
|
|
33
33
|
var value = _ref.text,
|
|
34
34
|
record = _ref.record,
|
|
35
35
|
index = _ref.index,
|
|
@@ -75,7 +75,8 @@ var RenderField = function RenderField(_ref) {
|
|
|
75
75
|
formNamePath = config.namePath,
|
|
76
76
|
_config$originalDiffT = config.originalDiffTip,
|
|
77
77
|
originalDiffTip = _config$originalDiffT === void 0 ? true : _config$originalDiffT,
|
|
78
|
-
rowDisabled = config.rowDisabled
|
|
78
|
+
rowDisabled = config.rowDisabled,
|
|
79
|
+
otherProps = config.otherProps;
|
|
79
80
|
var _fieldProps = fieldProps || formItemProps || {};
|
|
80
81
|
var _rules = rules || [];
|
|
81
82
|
var _required = required;
|
|
@@ -96,35 +97,41 @@ var RenderField = function RenderField(_ref) {
|
|
|
96
97
|
form: form,
|
|
97
98
|
namePath: [].concat(_toConsumableArray(namePath), [index])
|
|
98
99
|
};
|
|
100
|
+
// 行参数
|
|
101
|
+
var rowParams = [currentValue, rowData, options];
|
|
99
102
|
if (typeof isEditable === 'function') {
|
|
100
|
-
isEditable = isEditable(
|
|
103
|
+
isEditable = isEditable.apply(void 0, rowParams);
|
|
101
104
|
}
|
|
105
|
+
// 获取最终的disabled
|
|
106
|
+
_disabled = getDisabled({
|
|
107
|
+
globalControl: otherProps === null || otherProps === void 0 ? void 0 : otherProps.globalControl,
|
|
108
|
+
formDisabled: otherProps === null || otherProps === void 0 ? void 0 : otherProps.formDisabled,
|
|
109
|
+
column: column,
|
|
110
|
+
tabledDisabled: config === null || config === void 0 ? void 0 : config.disabled,
|
|
111
|
+
columnFieldProps: _fieldProps,
|
|
112
|
+
params: rowParams
|
|
113
|
+
});
|
|
102
114
|
// 是否只读文本
|
|
103
|
-
var isView = !isEditable || (record === null || record === void 0 ? void 0 : record['is-view']) || config.isView || virtualKey && !isEditing || (
|
|
115
|
+
var isView = !isEditable || (record === null || record === void 0 ? void 0 : record['is-view']) || config.isView || virtualKey && !isEditing || getDisabled({
|
|
116
|
+
globalControl: otherProps === null || otherProps === void 0 ? void 0 : otherProps.globalControl,
|
|
117
|
+
formDisabled: otherProps === null || otherProps === void 0 ? void 0 : otherProps.formDisabled,
|
|
118
|
+
column: column,
|
|
119
|
+
tabledDisabled: config === null || config === void 0 ? void 0 : config.disabled,
|
|
120
|
+
columnFieldProps: _fieldProps,
|
|
121
|
+
params: rowParams,
|
|
122
|
+
rowDisabled: rowDisabled || 'empty'
|
|
123
|
+
});
|
|
104
124
|
// 只读文本时,采用当前formItem的name,单行编辑时,使用生成的虚拟的name
|
|
105
125
|
var baseName = isView ? name : namePath;
|
|
106
126
|
var TargetComponent;
|
|
107
|
-
if (
|
|
108
|
-
_required = required(
|
|
109
|
-
}
|
|
110
|
-
if (typeof fieldProps === 'function') {
|
|
111
|
-
_fieldProps = fieldProps(currentValue, rowData, options);
|
|
112
|
-
}
|
|
113
|
-
if (typeof ((_fieldProps2 = _fieldProps) === null || _fieldProps2 === void 0 ? void 0 : _fieldProps2.disabled) === 'function') {
|
|
114
|
-
_disabled = _fieldProps.disabled(currentValue, rowData, options);
|
|
115
|
-
} else if (((_fieldProps3 = _fieldProps) === null || _fieldProps3 === void 0 ? void 0 : _fieldProps3.disabled) === true) {
|
|
116
|
-
_disabled = _fieldProps.disabled;
|
|
117
|
-
}
|
|
118
|
-
if (typeof column.disabled === 'function') {
|
|
119
|
-
_disabled = column.disabled(currentValue, rowData, options);
|
|
120
|
-
} else if (column.disabled === true) {
|
|
121
|
-
_disabled = column.disabled;
|
|
127
|
+
if (isFunction(required)) {
|
|
128
|
+
_required = required.apply(void 0, rowParams);
|
|
122
129
|
}
|
|
123
|
-
if ((
|
|
124
|
-
|
|
130
|
+
if (isFunction(fieldProps)) {
|
|
131
|
+
_fieldProps = fieldProps.apply(void 0, rowParams);
|
|
125
132
|
}
|
|
126
|
-
if (
|
|
127
|
-
_rules = rules(
|
|
133
|
+
if (isFunction(rules)) {
|
|
134
|
+
_rules = rules.apply(void 0, rowParams);
|
|
128
135
|
}
|
|
129
136
|
// 设置校验规则
|
|
130
137
|
var internalRule = useRules({
|
|
@@ -134,7 +141,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
134
141
|
required: !isView && _required,
|
|
135
142
|
rules: isEditing ? _rules : [],
|
|
136
143
|
isSelect: isSelect({
|
|
137
|
-
dataSource: (
|
|
144
|
+
dataSource: (_fieldProps2 = _fieldProps) === null || _fieldProps2 === void 0 ? void 0 : _fieldProps2.dataSource,
|
|
138
145
|
type: type
|
|
139
146
|
}),
|
|
140
147
|
type: type
|
|
@@ -169,7 +176,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
169
176
|
* @returns {}
|
|
170
177
|
*/
|
|
171
178
|
var valueTypeTransform = useCallback(function () {
|
|
172
|
-
var
|
|
179
|
+
var _fieldProps3;
|
|
173
180
|
// 不存在valueType返回空
|
|
174
181
|
if (!valueType) {
|
|
175
182
|
return {};
|
|
@@ -179,7 +186,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
179
186
|
valueType = 'switch';
|
|
180
187
|
}
|
|
181
188
|
var params = _objectSpread(_objectSpread({}, column), {}, {
|
|
182
|
-
mode: (
|
|
189
|
+
mode: (_fieldProps3 = _fieldProps) === null || _fieldProps3 === void 0 ? void 0 : _fieldProps3.mode
|
|
183
190
|
});
|
|
184
191
|
return isFunction(valueTypeMap[valueType]) ? valueTypeMap[valueType](params) : {};
|
|
185
192
|
}, [valueType]);
|
|
@@ -224,7 +231,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
224
231
|
}
|
|
225
232
|
if (isEditable && isEditing) {
|
|
226
233
|
if (typeof _editRender === 'function') {
|
|
227
|
-
TargetComponent = _editRender(
|
|
234
|
+
TargetComponent = _editRender.apply(void 0, rowParams);
|
|
228
235
|
}
|
|
229
236
|
if ( /*#__PURE__*/React.isValidElement(_editRender)) {
|
|
230
237
|
TargetComponent = _editRender;
|
|
@@ -266,7 +273,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
266
273
|
case 'ProEnum':
|
|
267
274
|
nextArgs[2].option = _args[1];
|
|
268
275
|
break;
|
|
269
|
-
case '
|
|
276
|
+
case 'ProCascader':
|
|
270
277
|
nextArgs[2].selectedOptions = _args[1];
|
|
271
278
|
break;
|
|
272
279
|
case 'DatePicker':
|
package/es/ProEditTable/index.js
CHANGED
|
@@ -66,12 +66,12 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
66
66
|
// 判断是否在formList内
|
|
67
67
|
if (namePath === null || namePath === void 0 ? void 0 : namePath.length) {
|
|
68
68
|
name = [].concat(_toConsumableArray(namePath), _toConsumableArray(name.slice(1)));
|
|
69
|
+
disabled = (formFieldProps === null || formFieldProps === void 0 ? void 0 : formFieldProps.disabled) || disabled; // formFieldProps?.disabled可能是函数??
|
|
69
70
|
}
|
|
70
71
|
var tableRef = useRef(null);
|
|
71
72
|
var _React$useContext = React.useContext(_ConfigProvider.ConfigContext),
|
|
72
73
|
getPrefixCls = _React$useContext.getPrefixCls;
|
|
73
74
|
var prefixCls = getPrefixCls();
|
|
74
|
-
disabled = (formFieldProps === null || formFieldProps === void 0 ? void 0 : formFieldProps.disabled) || disabled;
|
|
75
75
|
var _useLocalStorageState = useLocalStorageState('themeConfig'),
|
|
76
76
|
_useLocalStorageState2 = _slicedToArray(_useLocalStorageState, 1),
|
|
77
77
|
themeConfig = _useLocalStorageState2[0];
|
|
@@ -129,7 +129,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
129
129
|
return getRowKey(item) === getRowKey(record);
|
|
130
130
|
}));
|
|
131
131
|
};
|
|
132
|
-
var config = {
|
|
132
|
+
var config = _objectSpread({
|
|
133
133
|
form: form,
|
|
134
134
|
mode: mode,
|
|
135
135
|
isView: isView,
|
|
@@ -162,7 +162,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
162
162
|
originalDiffTip: originalDiffTip,
|
|
163
163
|
prefixCls: prefixCls,
|
|
164
164
|
rowDisabled: rowDisabled
|
|
165
|
-
};
|
|
165
|
+
}, resetProps);
|
|
166
166
|
// 编辑行设置下样式
|
|
167
167
|
var _rowClassName = function _rowClassName(record) {
|
|
168
168
|
var isEdit = !virtualKey || editingKeys.includes(record.rowKey);
|
|
@@ -14,3 +14,15 @@ export declare const onDelete: ({ name, form, virtualKey, selectedRowKeys }: {
|
|
|
14
14
|
virtualKey: any;
|
|
15
15
|
selectedRowKeys: any;
|
|
16
16
|
}) => void;
|
|
17
|
+
/** 获取最终的disabled, 两张模式【子级优先,全局优先】
|
|
18
|
+
* 全局优先:globalControl为true时,全局控制
|
|
19
|
+
* 子级优先:globalControl为false时,子级控制
|
|
20
|
+
* @param globalControl 全局控制
|
|
21
|
+
* @param formDisabled 表单的disabled
|
|
22
|
+
* @param column 当前列
|
|
23
|
+
* @param tabledDisabled 表格的disabled
|
|
24
|
+
* @param columnFieldProps 当前列的fieldProps
|
|
25
|
+
* @param params 当前列的参数
|
|
26
|
+
* @param rowDisabled 行禁用参数
|
|
27
|
+
*/
|
|
28
|
+
export declare const getDisabled: ({ globalControl, formDisabled, column, tabledDisabled, columnFieldProps, params, rowDisabled }: any) => any;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
+
import { cloneDeep, isString, isObject, isEqual, transform, isFunction, isBoolean } from 'lodash';
|
|
2
3
|
export var getRandom = function getRandom() {
|
|
3
4
|
return Math.random().toString(36).slice(-6);
|
|
4
5
|
};
|
|
@@ -74,4 +75,79 @@ export var onDelete = function onDelete(_ref) {
|
|
|
74
75
|
form.setFieldValue(namePath, virtualList);
|
|
75
76
|
}
|
|
76
77
|
}
|
|
78
|
+
};
|
|
79
|
+
/** 获取最终的disabled, 两张模式【子级优先,全局优先】
|
|
80
|
+
* 全局优先:globalControl为true时,全局控制
|
|
81
|
+
* 子级优先:globalControl为false时,子级控制
|
|
82
|
+
* @param globalControl 全局控制
|
|
83
|
+
* @param formDisabled 表单的disabled
|
|
84
|
+
* @param column 当前列
|
|
85
|
+
* @param tabledDisabled 表格的disabled
|
|
86
|
+
* @param columnFieldProps 当前列的fieldProps
|
|
87
|
+
* @param params 当前列的参数
|
|
88
|
+
* @param rowDisabled 行禁用参数
|
|
89
|
+
*/
|
|
90
|
+
export var getDisabled = function getDisabled(_ref2) {
|
|
91
|
+
var globalControl = _ref2.globalControl,
|
|
92
|
+
formDisabled = _ref2.formDisabled,
|
|
93
|
+
column = _ref2.column,
|
|
94
|
+
tabledDisabled = _ref2.tabledDisabled,
|
|
95
|
+
columnFieldProps = _ref2.columnFieldProps,
|
|
96
|
+
params = _ref2.params,
|
|
97
|
+
rowDisabled = _ref2.rowDisabled;
|
|
98
|
+
var convertToBoolean = function convertToBoolean(value) {
|
|
99
|
+
if (Array.isArray(value)) {
|
|
100
|
+
return value;
|
|
101
|
+
}
|
|
102
|
+
if (value === null || value === undefined || value === '') {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
if (value === 0) {
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
return Boolean(value);
|
|
109
|
+
};
|
|
110
|
+
// 判断是否有column的disabled属性
|
|
111
|
+
var noColumnDisabled = function noColumnDisabled() {
|
|
112
|
+
if (isFunction(column === null || column === void 0 ? void 0 : column.disabled) || isFunction(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled) || isBoolean(column === null || column === void 0 ? void 0 : column.disabled) || isBoolean(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled)) {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
// 判断FieldProps是否有disabled属性
|
|
116
|
+
if (isFunction(columnFieldProps)) {
|
|
117
|
+
var _columnFieldProps = columnFieldProps.apply(void 0, _toConsumableArray(params)),
|
|
118
|
+
disabled = _columnFieldProps.disabled;
|
|
119
|
+
if (isFunction(disabled) || isBoolean(disabled)) {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return true;
|
|
124
|
+
};
|
|
125
|
+
if (globalControl) {
|
|
126
|
+
return convertToBoolean(formDisabled) || convertToBoolean(tabledDisabled);
|
|
127
|
+
}
|
|
128
|
+
if (rowDisabled === 'empty') {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
// 当表单含有diabled属性时,优先使用表单的disabled
|
|
132
|
+
if (isFunction(rowDisabled) && noColumnDisabled()) {
|
|
133
|
+
return rowDisabled(params[1]);
|
|
134
|
+
}
|
|
135
|
+
if (isFunction(column === null || column === void 0 ? void 0 : column.disabled)) {
|
|
136
|
+
return convertToBoolean(column === null || column === void 0 ? void 0 : column.disabled.apply(column, _toConsumableArray(params)));
|
|
137
|
+
}
|
|
138
|
+
// 表单FieldProps为函数时
|
|
139
|
+
if (isFunction(columnFieldProps)) {
|
|
140
|
+
var _columnFieldProps2 = columnFieldProps.apply(void 0, _toConsumableArray(params)),
|
|
141
|
+
disabled = _columnFieldProps2.disabled;
|
|
142
|
+
if (isFunction(disabled)) {
|
|
143
|
+
return convertToBoolean(disabled.apply(void 0, _toConsumableArray(params)));
|
|
144
|
+
}
|
|
145
|
+
if (isBoolean(disabled)) {
|
|
146
|
+
return convertToBoolean(disabled);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if (isFunction(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled)) {
|
|
150
|
+
return convertToBoolean(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled.apply(columnFieldProps, _toConsumableArray(params)));
|
|
151
|
+
}
|
|
152
|
+
return convertToBoolean(column === null || column === void 0 ? void 0 : column.disabled) || convertToBoolean(columnFieldProps === null || columnFieldProps === void 0 ? void 0 : columnFieldProps.disabled);
|
|
77
153
|
};
|
|
@@ -25,9 +25,16 @@ var RangePicker = function RangePicker(props) {
|
|
|
25
25
|
viewEmpty = _ref.viewEmpty,
|
|
26
26
|
valueType = _ref.valueType;
|
|
27
27
|
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon;
|
|
28
|
+
var _res = _objectSpread(_objectSpread({}, rest), {}, {
|
|
29
|
+
showTime: !rest.showTime && valueType === 'dateTime' || rest.showTime
|
|
30
|
+
});
|
|
31
|
+
// 字符串时间格式兼容
|
|
32
|
+
if (Array.isArray(_res.value) && isString(_res.value[0]) && isString(_res.value[1])) {
|
|
33
|
+
_res.value = [moment(_res.value[0]), moment(_res.value[1])];
|
|
34
|
+
}
|
|
28
35
|
if (isView) {
|
|
29
|
-
var
|
|
30
|
-
value =
|
|
36
|
+
var _res$value = _res.value,
|
|
37
|
+
value = _res$value === void 0 ? [] : _res$value;
|
|
31
38
|
var viewChildren = null;
|
|
32
39
|
if (!value || !value[0] || !value[1]) {
|
|
33
40
|
viewChildren = null;
|
|
@@ -49,13 +56,6 @@ var RangePicker = function RangePicker(props) {
|
|
|
49
56
|
children: viewChildren
|
|
50
57
|
});
|
|
51
58
|
}
|
|
52
|
-
var _res = _objectSpread(_objectSpread({}, rest), {}, {
|
|
53
|
-
showTime: !rest.showTime && valueType === 'dateTime' || rest.showTime
|
|
54
|
-
});
|
|
55
|
-
// 字符串时间格式兼容
|
|
56
|
-
if (Array.isArray(_res.value) && isString(_res.value[0]) && isString(_res.value[1])) {
|
|
57
|
-
_res.value = [moment(_res.value[0]), moment(_res.value[1])];
|
|
58
|
-
}
|
|
59
59
|
return _jsx(AntRangePicker, _objectSpread(_objectSpread({}, initialConfig), omit(_res, ['separator'])));
|
|
60
60
|
};
|
|
61
61
|
export default RangePicker;
|
|
@@ -21,10 +21,11 @@ var Container = function Container(props) {
|
|
|
21
21
|
disabled = _ref.disabled;
|
|
22
22
|
var _className = classnames(_defineProperty({
|
|
23
23
|
'pro-container': true,
|
|
24
|
-
'pro-container-diy': type === 'Container'
|
|
24
|
+
'pro-container-diy': type === 'Container',
|
|
25
|
+
'pro-container-empty': !(children === null || children === void 0 ? void 0 : children.length)
|
|
25
26
|
}, "".concat(className), className));
|
|
26
27
|
var _children = useMemo(function () {
|
|
27
|
-
var result = children.map(function (item) {
|
|
28
|
+
var result = children === null || children === void 0 ? void 0 : children.map(function (item) {
|
|
28
29
|
return _objectSpread({
|
|
29
30
|
clearNotShow: clearNotShow,
|
|
30
31
|
show: show,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
declare const _default: import("react").MemoExoticComponent<(props:
|
|
2
|
+
import { ProCascaderProps } from './propsType';
|
|
3
|
+
declare const _default: import("react").MemoExoticComponent<(props: ProCascaderProps) => JSX.Element>;
|
|
4
4
|
export default _default;
|