@zat-design/sisyphus-react 3.4.2-beta.25 → 3.4.2-beta.26
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 -1
- package/dist/less.esm.css +1 -1
- package/es/ProEditTable/components/RenderField/index.js +5 -1
- package/es/ProForm/components/combination/Group/index.js +10 -4
- package/es/ProForm/components/combination/Group/propsType.d.ts +5 -0
- package/es/ProForm/components/render/Render.js +3 -0
- package/es/ProForm/style/index.less +1 -1
- package/lib/ProEditTable/components/RenderField/index.js +5 -1
- package/lib/ProForm/components/combination/Group/index.js +10 -4
- package/lib/ProForm/components/combination/Group/propsType.d.ts +5 -0
- package/lib/ProForm/components/render/Render.js +3 -0
- package/lib/ProForm/style/index.less +1 -1
- package/package.json +1 -1
package/dist/index.esm.css
CHANGED
|
@@ -2691,7 +2691,7 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2691
2691
|
.pro-form .ant-form-item.pro-form-item-changed .ant-select-selector input,
|
|
2692
2692
|
.pro-form .ant-form-item.pro-form-item-changed .ant-picker input,
|
|
2693
2693
|
.pro-form .ant-form-item.pro-form-item-changed .ant-input-number input {
|
|
2694
|
-
background:
|
|
2694
|
+
background: transparent;
|
|
2695
2695
|
}
|
|
2696
2696
|
.pro-form .ant-form-item.pro-form-item-changed span.ant-input-affix-wrapper .ant-select-selection-placeholder,
|
|
2697
2697
|
.pro-form .ant-form-item.pro-form-item-changed .ant-select-selector .ant-select-selection-placeholder,
|
package/dist/less.esm.css
CHANGED
|
@@ -2691,7 +2691,7 @@ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
|
2691
2691
|
.pro-form .ant-form-item.pro-form-item-changed .ant-select-selector input,
|
|
2692
2692
|
.pro-form .ant-form-item.pro-form-item-changed .ant-picker input,
|
|
2693
2693
|
.pro-form .ant-form-item.pro-form-item-changed .ant-input-number input {
|
|
2694
|
-
background:
|
|
2694
|
+
background: transparent;
|
|
2695
2695
|
}
|
|
2696
2696
|
.pro-form .ant-form-item.pro-form-item-changed span.ant-input-affix-wrapper .ant-select-selection-placeholder,
|
|
2697
2697
|
.pro-form .ant-form-item.pro-form-item-changed .ant-select-selector .ant-select-selection-placeholder,
|
|
@@ -473,6 +473,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
473
473
|
disabled: _disabled,
|
|
474
474
|
onChange: _onchange,
|
|
475
475
|
onBlur: _onblur,
|
|
476
|
+
index: index,
|
|
476
477
|
otherProps: {
|
|
477
478
|
form: form,
|
|
478
479
|
names: names,
|
|
@@ -483,7 +484,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
483
484
|
}
|
|
484
485
|
});
|
|
485
486
|
if (type !== 'Group') {
|
|
486
|
-
componentProps = omit(componentProps, ['onFieldChange']);
|
|
487
|
+
componentProps = omit(componentProps, ['onFieldChange', 'index']);
|
|
487
488
|
}
|
|
488
489
|
// 单元格编辑时,设置各个单元格disabled属性
|
|
489
490
|
if (isCell) {
|
|
@@ -534,6 +535,9 @@ var RenderField = function RenderField(_ref) {
|
|
|
534
535
|
children: !originalDiffTip || ['FormList', 'ProEditTable'].includes(type) ? FormItem : _jsx(_Tooltip, {
|
|
535
536
|
title: originalTitle,
|
|
536
537
|
open: changed ? undefined : false,
|
|
538
|
+
getPopupContainer: function getPopupContainer(target) {
|
|
539
|
+
return target.parentElement;
|
|
540
|
+
},
|
|
537
541
|
children: FormItem
|
|
538
542
|
})
|
|
539
543
|
});
|
|
@@ -23,7 +23,9 @@ var Group = function Group(props) {
|
|
|
23
23
|
id = props.id,
|
|
24
24
|
value = props.value,
|
|
25
25
|
isView = props.isView,
|
|
26
|
-
|
|
26
|
+
index = props.index,
|
|
27
|
+
onFieldChange = props.onFieldChange,
|
|
28
|
+
namePath = props.namePath;
|
|
27
29
|
var _ref = ProForm.useFieldProps() || {},
|
|
28
30
|
names = _ref.names,
|
|
29
31
|
name = _ref.name,
|
|
@@ -39,7 +41,8 @@ var Group = function Group(props) {
|
|
|
39
41
|
}, item), {}, {
|
|
40
42
|
isView: isView !== null && isView !== void 0 ? isView : item.isView,
|
|
41
43
|
noStyle: (space === null || space === void 0 ? void 0 : space.compact) || (space === null || space === void 0 ? void 0 : space.separator),
|
|
42
|
-
parentNames: id
|
|
44
|
+
parentNames: id,
|
|
45
|
+
namePath: namePath
|
|
43
46
|
});
|
|
44
47
|
});
|
|
45
48
|
var node = _jsx(_Button, {
|
|
@@ -67,8 +70,11 @@ var Group = function Group(props) {
|
|
|
67
70
|
var touchName = ((_document = document) === null || _document === void 0 ? void 0 : (_document$activeEleme = _document.activeElement) === null || _document$activeEleme === void 0 ? void 0 : _document$activeEleme.id) || '';
|
|
68
71
|
// 模拟change,初始化不执行onFieldChange
|
|
69
72
|
if (isFunction(onFieldChange) && form.isFieldsTouched(names) && transformNamesString(names).includes(touchName)) {
|
|
70
|
-
|
|
71
|
-
|
|
73
|
+
var record = namePath ? form.getFieldValue(namePath) : form.getFieldsValue();
|
|
74
|
+
onFieldChange(value, record, {
|
|
75
|
+
form: form,
|
|
76
|
+
namePath: namePath,
|
|
77
|
+
index: index
|
|
72
78
|
});
|
|
73
79
|
}
|
|
74
80
|
}, [value]);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { RowProps, SpaceProps } from 'antd';
|
|
3
3
|
import { FormInstance } from 'antd/es/form/Form';
|
|
4
|
+
import { NamePath } from 'antd/lib/form/interface';
|
|
4
5
|
import { ProColumnProps, ProFormOtherProps } from '../../../propsType';
|
|
5
6
|
export interface SpaceType extends SpaceProps {
|
|
6
7
|
/**
|
|
@@ -24,7 +25,11 @@ export interface GroupProps {
|
|
|
24
25
|
id?: string;
|
|
25
26
|
disabled?: boolean | (() => void);
|
|
26
27
|
isView?: boolean;
|
|
28
|
+
namePath?: NamePath;
|
|
29
|
+
index?: number;
|
|
27
30
|
onFieldChange?: (value: any[] | null, record: any, { form, }: {
|
|
28
31
|
form: FormInstance;
|
|
32
|
+
namePath?: NamePath;
|
|
33
|
+
index?: number;
|
|
29
34
|
}) => any;
|
|
30
35
|
}
|
|
@@ -447,6 +447,9 @@ var Render = function Render(props) {
|
|
|
447
447
|
return _jsx(_Tooltip, {
|
|
448
448
|
title: title,
|
|
449
449
|
visible: changed ? undefined : false,
|
|
450
|
+
getPopupContainer: function getPopupContainer(target) {
|
|
451
|
+
return target.parentElement;
|
|
452
|
+
},
|
|
450
453
|
children: formItem
|
|
451
454
|
});
|
|
452
455
|
};
|
|
@@ -476,6 +476,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
476
476
|
disabled: _disabled,
|
|
477
477
|
onChange: _onchange,
|
|
478
478
|
onBlur: _onblur,
|
|
479
|
+
index: index,
|
|
479
480
|
otherProps: {
|
|
480
481
|
form: form,
|
|
481
482
|
names: names,
|
|
@@ -486,7 +487,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
486
487
|
}
|
|
487
488
|
});
|
|
488
489
|
if (type !== 'Group') {
|
|
489
|
-
componentProps = (0, _lodash.omit)(componentProps, ['onFieldChange']);
|
|
490
|
+
componentProps = (0, _lodash.omit)(componentProps, ['onFieldChange', 'index']);
|
|
490
491
|
}
|
|
491
492
|
// 单元格编辑时,设置各个单元格disabled属性
|
|
492
493
|
if (isCell) {
|
|
@@ -537,6 +538,9 @@ var RenderField = function RenderField(_ref) {
|
|
|
537
538
|
children: !originalDiffTip || ['FormList', 'ProEditTable'].includes(type) ? FormItem : (0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
538
539
|
title: originalTitle,
|
|
539
540
|
open: changed ? undefined : false,
|
|
541
|
+
getPopupContainer: function getPopupContainer(target) {
|
|
542
|
+
return target.parentElement;
|
|
543
|
+
},
|
|
540
544
|
children: FormItem
|
|
541
545
|
})
|
|
542
546
|
});
|
|
@@ -27,7 +27,9 @@ var Group = function Group(props) {
|
|
|
27
27
|
id = props.id,
|
|
28
28
|
value = props.value,
|
|
29
29
|
isView = props.isView,
|
|
30
|
-
|
|
30
|
+
index = props.index,
|
|
31
|
+
onFieldChange = props.onFieldChange,
|
|
32
|
+
namePath = props.namePath;
|
|
31
33
|
var _ref = _ProForm.default.useFieldProps() || {},
|
|
32
34
|
names = _ref.names,
|
|
33
35
|
name = _ref.name,
|
|
@@ -43,7 +45,8 @@ var Group = function Group(props) {
|
|
|
43
45
|
}, item), {}, {
|
|
44
46
|
isView: isView !== null && isView !== void 0 ? isView : item.isView,
|
|
45
47
|
noStyle: (space === null || space === void 0 ? void 0 : space.compact) || (space === null || space === void 0 ? void 0 : space.separator),
|
|
46
|
-
parentNames: id
|
|
48
|
+
parentNames: id,
|
|
49
|
+
namePath: namePath
|
|
47
50
|
});
|
|
48
51
|
});
|
|
49
52
|
var node = (0, _jsxRuntime.jsx)(_antd.Button, {
|
|
@@ -71,8 +74,11 @@ var Group = function Group(props) {
|
|
|
71
74
|
var touchName = ((_document = document) === null || _document === void 0 ? void 0 : (_document$activeEleme = _document.activeElement) === null || _document$activeEleme === void 0 ? void 0 : _document$activeEleme.id) || '';
|
|
72
75
|
// 模拟change,初始化不执行onFieldChange
|
|
73
76
|
if ((0, _lodash.isFunction)(onFieldChange) && form.isFieldsTouched(names) && (0, _utils.transformNamesString)(names).includes(touchName)) {
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
var record = namePath ? form.getFieldValue(namePath) : form.getFieldsValue();
|
|
78
|
+
onFieldChange(value, record, {
|
|
79
|
+
form: form,
|
|
80
|
+
namePath: namePath,
|
|
81
|
+
index: index
|
|
76
82
|
});
|
|
77
83
|
}
|
|
78
84
|
}, [value]);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { RowProps, SpaceProps } from 'antd';
|
|
3
3
|
import { FormInstance } from 'antd/es/form/Form';
|
|
4
|
+
import { NamePath } from 'antd/lib/form/interface';
|
|
4
5
|
import { ProColumnProps, ProFormOtherProps } from '../../../propsType';
|
|
5
6
|
export interface SpaceType extends SpaceProps {
|
|
6
7
|
/**
|
|
@@ -24,7 +25,11 @@ export interface GroupProps {
|
|
|
24
25
|
id?: string;
|
|
25
26
|
disabled?: boolean | (() => void);
|
|
26
27
|
isView?: boolean;
|
|
28
|
+
namePath?: NamePath;
|
|
29
|
+
index?: number;
|
|
27
30
|
onFieldChange?: (value: any[] | null, record: any, { form, }: {
|
|
28
31
|
form: FormInstance;
|
|
32
|
+
namePath?: NamePath;
|
|
33
|
+
index?: number;
|
|
29
34
|
}) => any;
|
|
30
35
|
}
|
|
@@ -445,6 +445,9 @@ var Render = function Render(props) {
|
|
|
445
445
|
return (0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
446
446
|
title: title,
|
|
447
447
|
visible: changed ? undefined : false,
|
|
448
|
+
getPopupContainer: function getPopupContainer(target) {
|
|
449
|
+
return target.parentElement;
|
|
450
|
+
},
|
|
448
451
|
children: formItem
|
|
449
452
|
});
|
|
450
453
|
};
|