@zat-design/sisyphus-react 3.9.1-beta.5 → 3.9.1-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.
@@ -27,8 +27,9 @@ import getEnumLabel from './utils/getEnumLabel';
27
27
  import useEnum from './hooks/useEnum';
28
28
  import locale from '../locale';
29
29
  import './style/index.less';
30
+ import { useFieldProps } from '../ProForm/utils/useFieldProps';
30
31
  var ProEnum = function ProEnum(props) {
31
- var _enumProps$showCodeNa;
32
+ var _otherProps$isView, _enumProps$showCodeNa;
32
33
  var code = props.code,
33
34
  _props$type = props.type,
34
35
  type = _props$type === void 0 ? 'ProSelect' : _props$type,
@@ -43,8 +44,9 @@ var ProEnum = function ProEnum(props) {
43
44
  enumProps = _objectWithoutProperties(props, _excluded);
44
45
  var _ref = otherProps || {},
45
46
  viewEmpty = _ref.viewEmpty;
46
- var _isView = isView !== undefined && isView !== null ? isView : otherProps === null || otherProps === void 0 ? void 0 : otherProps.isView;
47
47
  var _defalutValue = props === null || props === void 0 ? void 0 : props.defaultValue;
48
+ var _useFieldProps = useFieldProps(),
49
+ configIsView = _useFieldProps.isView;
48
50
  var _ref2 = useProConfig('ProEnum') || {},
49
51
  fieldNames = _ref2.fieldNames,
50
52
  _ref2$clear = _ref2.clear,
@@ -53,6 +55,7 @@ var ProEnum = function ProEnum(props) {
53
55
  cacheKey = _ref2$cacheKey === void 0 ? 'zat-design-pro-component-cacheKey' : _ref2$cacheKey,
54
56
  showCodeName = _ref2.showCodeName,
55
57
  resProps = _objectWithoutProperties(_ref2, _excluded2);
58
+ var _isView = isView !== undefined && isView !== null ? isView : (_otherProps$isView = otherProps === null || otherProps === void 0 ? void 0 : otherProps.isView) !== null && _otherProps$isView !== void 0 ? _otherProps$isView : configIsView;
56
59
  enumProps.showCodeName = (_enumProps$showCodeNa = enumProps.showCodeName) !== null && _enumProps$showCodeNa !== void 0 ? _enumProps$showCodeNa : showCodeName;
57
60
  var label = 'label';
58
61
  var fieldValue = 'value';
@@ -26,10 +26,11 @@ var _getEnumLabel = _interopRequireDefault(require("./utils/getEnumLabel"));
26
26
  var _useEnum = _interopRequireDefault(require("./hooks/useEnum"));
27
27
  var _locale = _interopRequireDefault(require("../locale"));
28
28
  require("./style/index.less");
29
+ var _useFieldProps2 = require("../ProForm/utils/useFieldProps");
29
30
  var _excluded = ["code", "type", "dataSource", "useRequest", "value", "component", "onChange", "transformResponse", "otherProps", "isView"],
30
31
  _excluded2 = ["fieldNames", "clear", "cacheKey", "showCodeName"];
31
32
  var ProEnum = function ProEnum(props) {
32
- var _enumProps$showCodeNa;
33
+ var _otherProps$isView, _enumProps$showCodeNa;
33
34
  var code = props.code,
34
35
  _props$type = props.type,
35
36
  type = _props$type === void 0 ? 'ProSelect' : _props$type,
@@ -44,8 +45,9 @@ var ProEnum = function ProEnum(props) {
44
45
  enumProps = (0, _objectWithoutProperties2.default)(props, _excluded);
45
46
  var _ref = otherProps || {},
46
47
  viewEmpty = _ref.viewEmpty;
47
- var _isView = isView !== undefined && isView !== null ? isView : otherProps === null || otherProps === void 0 ? void 0 : otherProps.isView;
48
48
  var _defalutValue = props === null || props === void 0 ? void 0 : props.defaultValue;
49
+ var _useFieldProps = (0, _useFieldProps2.useFieldProps)(),
50
+ configIsView = _useFieldProps.isView;
49
51
  var _ref2 = (0, _ProConfigProvider.useProConfig)('ProEnum') || {},
50
52
  fieldNames = _ref2.fieldNames,
51
53
  _ref2$clear = _ref2.clear,
@@ -54,6 +56,7 @@ var ProEnum = function ProEnum(props) {
54
56
  cacheKey = _ref2$cacheKey === void 0 ? 'zat-design-pro-component-cacheKey' : _ref2$cacheKey,
55
57
  showCodeName = _ref2.showCodeName,
56
58
  resProps = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
59
+ var _isView = isView !== undefined && isView !== null ? isView : (_otherProps$isView = otherProps === null || otherProps === void 0 ? void 0 : otherProps.isView) !== null && _otherProps$isView !== void 0 ? _otherProps$isView : configIsView;
57
60
  enumProps.showCodeName = (_enumProps$showCodeNa = enumProps.showCodeName) !== null && _enumProps$showCodeNa !== void 0 ? _enumProps$showCodeNa : showCodeName;
58
61
  var label = 'label';
59
62
  var fieldValue = 'value';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.9.1-beta.5",
3
+ "version": "3.9.1-beta.6",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -1,5 +0,0 @@
1
- {
2
- "recommendations": [
3
- "kisstkondoros.vscode-codemetrics"
4
- ]
5
- }