@zat-design/sisyphus-react 3.4.5-beta.6 → 3.4.5-beta.8
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.
|
@@ -17,7 +17,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
17
17
|
/* eslint-disable prefer-const */
|
|
18
18
|
import React, { useCallback, useEffect } from 'react';
|
|
19
19
|
import classNames from 'classnames';
|
|
20
|
-
import { cloneDeep, isEqual, debounce, omit, isFunction } from 'lodash';
|
|
20
|
+
import { cloneDeep, isEqual, debounce, omit, isFunction, isBoolean } from 'lodash';
|
|
21
21
|
import valueTypeMap from '../../../ProForm/utils/valueType';
|
|
22
22
|
import transformMap from '../../utils/transform';
|
|
23
23
|
import { getNamePath, difference } from '../../utils/tools';
|
|
@@ -112,17 +112,17 @@ var RenderField = function RenderField(_ref) {
|
|
|
112
112
|
}
|
|
113
113
|
if (typeof ((_fieldProps2 = _fieldProps) === null || _fieldProps2 === void 0 ? void 0 : _fieldProps2.disabled) === 'function') {
|
|
114
114
|
_disabled = _fieldProps.disabled(currentValue, rowData, options);
|
|
115
|
-
} else if (((_fieldProps3 = _fieldProps) === null || _fieldProps3 === void 0 ? void 0 : _fieldProps3.disabled)
|
|
115
|
+
} else if (isBoolean((_fieldProps3 = _fieldProps) === null || _fieldProps3 === void 0 ? void 0 : _fieldProps3.disabled)) {
|
|
116
116
|
_disabled = _fieldProps.disabled;
|
|
117
117
|
}
|
|
118
|
+
if ((config === null || config === void 0 ? void 0 : config.disabled) === true) {
|
|
119
|
+
_disabled = column.disabled || (config === null || config === void 0 ? void 0 : config.disabled);
|
|
120
|
+
}
|
|
118
121
|
if (typeof column.disabled === 'function') {
|
|
119
122
|
_disabled = column.disabled(currentValue, rowData, options);
|
|
120
|
-
} else if (column.disabled
|
|
123
|
+
} else if (isBoolean(column.disabled)) {
|
|
121
124
|
_disabled = column.disabled;
|
|
122
125
|
}
|
|
123
|
-
if ((config === null || config === void 0 ? void 0 : config.disabled) === true) {
|
|
124
|
-
_disabled = config === null || config === void 0 ? void 0 : config.disabled;
|
|
125
|
-
}
|
|
126
126
|
if (typeof rules === 'function') {
|
|
127
127
|
_rules = rules(currentValue, rowData, options);
|
|
128
128
|
}
|
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];
|
|
@@ -115,17 +115,17 @@ var RenderField = function RenderField(_ref) {
|
|
|
115
115
|
}
|
|
116
116
|
if (typeof ((_fieldProps2 = _fieldProps) === null || _fieldProps2 === void 0 ? void 0 : _fieldProps2.disabled) === 'function') {
|
|
117
117
|
_disabled = _fieldProps.disabled(currentValue, rowData, options);
|
|
118
|
-
} else if (((_fieldProps3 = _fieldProps) === null || _fieldProps3 === void 0 ? void 0 : _fieldProps3.disabled)
|
|
118
|
+
} else if ((0, _lodash.isBoolean)((_fieldProps3 = _fieldProps) === null || _fieldProps3 === void 0 ? void 0 : _fieldProps3.disabled)) {
|
|
119
119
|
_disabled = _fieldProps.disabled;
|
|
120
120
|
}
|
|
121
|
+
if ((config === null || config === void 0 ? void 0 : config.disabled) === true) {
|
|
122
|
+
_disabled = column.disabled || (config === null || config === void 0 ? void 0 : config.disabled);
|
|
123
|
+
}
|
|
121
124
|
if (typeof column.disabled === 'function') {
|
|
122
125
|
_disabled = column.disabled(currentValue, rowData, options);
|
|
123
|
-
} else if (column.disabled
|
|
126
|
+
} else if ((0, _lodash.isBoolean)(column.disabled)) {
|
|
124
127
|
_disabled = column.disabled;
|
|
125
128
|
}
|
|
126
|
-
if ((config === null || config === void 0 ? void 0 : config.disabled) === true) {
|
|
127
|
-
_disabled = config === null || config === void 0 ? void 0 : config.disabled;
|
|
128
|
-
}
|
|
129
129
|
if (typeof rules === 'function') {
|
|
130
130
|
_rules = rules(currentValue, rowData, options);
|
|
131
131
|
}
|
|
@@ -69,12 +69,12 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
69
69
|
// 判断是否在formList内
|
|
70
70
|
if (namePath === null || namePath === void 0 ? void 0 : namePath.length) {
|
|
71
71
|
name = [].concat((0, _toConsumableArray2.default)(namePath), (0, _toConsumableArray2.default)(name.slice(1)));
|
|
72
|
+
disabled = (formFieldProps === null || formFieldProps === void 0 ? void 0 : formFieldProps.disabled) || disabled; // formFieldProps?.disabled可能是函数??
|
|
72
73
|
}
|
|
73
74
|
var tableRef = (0, _react.useRef)(null);
|
|
74
75
|
var _React$useContext = _react.default.useContext(_antd.ConfigProvider.ConfigContext),
|
|
75
76
|
getPrefixCls = _React$useContext.getPrefixCls;
|
|
76
77
|
var prefixCls = getPrefixCls();
|
|
77
|
-
disabled = (formFieldProps === null || formFieldProps === void 0 ? void 0 : formFieldProps.disabled) || disabled;
|
|
78
78
|
var _useLocalStorageState = (0, _ahooks.useLocalStorageState)('themeConfig'),
|
|
79
79
|
_useLocalStorageState2 = (0, _slicedToArray2.default)(_useLocalStorageState, 1),
|
|
80
80
|
themeConfig = _useLocalStorageState2[0];
|