@zat-design/sisyphus-react 3.4.11-beta.12 → 3.4.11-beta.13

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.
@@ -166,7 +166,7 @@ var ProEnum = function ProEnum(props) {
166
166
  }
167
167
  switch (type) {
168
168
  case 'ProSelect':
169
- return _jsx(ProSelect, _objectSpread(_objectSpread({}, enumProps), {}, {
169
+ return _jsx(ProSelect, _objectSpread(_objectSpread({}, omit(enumProps, ['showCodeName'])), {}, {
170
170
  otherProps: otherProps,
171
171
  dataSource: list,
172
172
  fieldNames: {
@@ -177,7 +177,7 @@ var ProEnum = function ProEnum(props) {
177
177
  onChange: onChange
178
178
  }));
179
179
  case 'Radio':
180
- return _jsx(_Radio.Group, _objectSpread(_objectSpread({}, omit(enumProps, ['fieldNames'])), {}, {
180
+ return _jsx(_Radio.Group, _objectSpread(_objectSpread({}, omit(enumProps, ['fieldNames', 'showCodeName'])), {}, {
181
181
  options: list,
182
182
  value: value,
183
183
  onChange: onChange,
@@ -190,7 +190,7 @@ var ProEnum = function ProEnum(props) {
190
190
  })
191
191
  }));
192
192
  case 'Checkbox':
193
- return _jsx(_Checkbox.Group, _objectSpread(_objectSpread({}, omit(enumProps, ['fieldNames'])), {}, {
193
+ return _jsx(_Checkbox.Group, _objectSpread(_objectSpread({}, omit(enumProps, ['fieldNames', 'showCodeName'])), {}, {
194
194
  options: list,
195
195
  value: value,
196
196
  onChange: onChange,
@@ -211,7 +211,7 @@ var ProEnum = function ProEnum(props) {
211
211
  dataSource: list
212
212
  });
213
213
  case 'Group':
214
- return _jsx(ProEnumGroup, _objectSpread(_objectSpread({}, enumProps), {}, {
214
+ return _jsx(ProEnumGroup, _objectSpread(_objectSpread({}, omit(enumProps, ['showCodeName'])), {}, {
215
215
  value: value,
216
216
  onChange: onChange,
217
217
  fieldLabel: label,
@@ -49,12 +49,12 @@ var getViewLabel = function getViewLabel(_ref) {
49
49
  return viewLabel;
50
50
  };
51
51
  var ProCascader = function ProCascader(props) {
52
- var _value$slice, _ref7, _ref7$filter, _defaultLabel$filter, _locale$ProAddressBar, _locale$ProAddressBar2;
52
+ var _props$otherProps, _value$slice, _ref7, _ref7$filter, _defaultLabel$filter, _locale$ProAddressBar, _locale$ProAddressBar2;
53
53
  var _ref2 = useProConfig('ProAddressBar') || {},
54
54
  configDetailMaxLength = _ref2.detailMaxLength,
55
55
  configEnumCode = _ref2.enumCode,
56
56
  configCode = _ref2.code;
57
- var isAddressMode = (props === null || props === void 0 ? void 0 : props.mode) === 'address';
57
+ var isAddressMode = (props === null || props === void 0 ? void 0 : props.mode) === 'address' || (props === null || props === void 0 ? void 0 : (_props$otherProps = props.otherProps) === null || _props$otherProps === void 0 ? void 0 : _props$otherProps.type) === 'ProAddressBar';
58
58
  var _props$className = props.className,
59
59
  className = _props$className === void 0 ? '' : _props$className,
60
60
  _props$hasDetail = props.hasDetail,
@@ -12,6 +12,7 @@ export { default as TimePicker } from './base/TimePicker';
12
12
  export { default as FormList } from './combination/FormList';
13
13
  export { default as ProEditTable } from '../../ProEditTable';
14
14
  export { default as ProCascader } from './combination/ProCascader';
15
+ export { default as ProAddressBar } from './combination/ProCascader';
15
16
  export { default as ProCombination } from './combination/ProCombination';
16
17
  export { default as ProNumberRange } from './combination/ProNumberRange';
17
18
  export { default as ProModalSelect } from './combination/ProModalSelect';
@@ -14,6 +14,7 @@ export { default as FormList } from './combination/FormList';
14
14
  export { default as ProEditTable } from '../../ProEditTable';
15
15
  // combination 组合组件
16
16
  export { default as ProCascader } from './combination/ProCascader';
17
+ export { default as ProAddressBar } from './combination/ProCascader';
17
18
  export { default as ProCombination } from './combination/ProCombination';
18
19
  export { default as ProNumberRange } from './combination/ProNumberRange';
19
20
  export { default as ProModalSelect } from './combination/ProModalSelect';
@@ -276,7 +276,7 @@ var Render = function Render(props) {
276
276
  }, 60);
277
277
  }
278
278
  // ProTreeSelect返回option
279
- if (['ProTree'].includes(type)) {
279
+ if (['ProTree'].includes(type) && !_args[2].option) {
280
280
  var _args2, _args2$;
281
281
  _args[2].option = findOptionByValue(lastComponentProps === null || lastComponentProps === void 0 ? void 0 : lastComponentProps.dataSource, (_args2 = _args) === null || _args2 === void 0 ? void 0 : (_args2$ = _args2[0]) === null || _args2$ === void 0 ? void 0 : _args2$[0], (lastComponentProps === null || lastComponentProps === void 0 ? void 0 : lastComponentProps.fieldNames) || {});
282
282
  }
@@ -257,12 +257,15 @@ var ProTree = function ProTree(props) {
257
257
  onChange && onChange(allValue);
258
258
  } else {
259
259
  var values = checkedValues;
260
+ var options = state.flatTreeData.filter(function (item) {
261
+ return values.includes(item[fieldNameValue]);
262
+ });
260
263
  if (labelInValue) {
261
264
  values = state.flatTreeData.filter(function (item) {
262
265
  return values.includes(item[fieldNameValue]);
263
266
  });
264
267
  }
265
- onChange && onChange(values);
268
+ onChange && onChange(values, options);
266
269
  }
267
270
  };
268
271
  // 该方法只有复选框,在勾中checkbox后才会走到这个方法
@@ -348,7 +351,7 @@ var ProTree = function ProTree(props) {
348
351
  /** 点击了树节点开始loading,改变自身state并将值通过onchange上传到form */
349
352
  var onSelectTreeNode = /*#__PURE__*/function () {
350
353
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(props, info) {
351
- var values;
354
+ var values, options;
352
355
  return _regeneratorRuntime().wrap(function _callee$(_context) {
353
356
  while (1) switch (_context.prev = _context.next) {
354
357
  case 0:
@@ -372,17 +375,22 @@ var ProTree = function ProTree(props) {
372
375
  clickShowLoading: false
373
376
  });
374
377
  case 7:
378
+ values = props;
379
+ options = state.flatTreeData.filter(function (item) {
380
+ return values === item[fieldNameValue];
381
+ });
382
+ if (labelInValue) {
383
+ values = state.flatTreeData.filter(function (item) {
384
+ return values === item[fieldNameValue];
385
+ });
386
+ }
375
387
  if (!(other === null || other === void 0 ? void 0 : other.checkable)) {
376
- // 单选将选中节点值冒泡到form
377
- values = props;
378
- if (labelInValue) {
379
- values = state.flatTreeData.filter(function (item) {
380
- return values === item[fieldNameValue];
381
- });
382
- }
383
- onChange && onChange(values);
388
+ // 单选将选中节点值冒泡到form, 给onFieldChange添加options
389
+ onChange && onChange(values, options === null || options === void 0 ? void 0 : options[0]);
390
+ } else {
391
+ onChange && onChange(value, options === null || options === void 0 ? void 0 : options[0]);
384
392
  }
385
- case 8:
393
+ case 11:
386
394
  case "end":
387
395
  return _context.stop();
388
396
  }
@@ -60,7 +60,7 @@ export interface ProTreeProps extends PropTreeSelectProps {
60
60
  /** 树节点文本宽度 */
61
61
  ellipseWidth?: string;
62
62
  /** value改变的回调 */
63
- onChange?: (values: string[] | AllValueType) => void;
63
+ onChange?: (values: string[] | AllValueType, options?: object[]) => void;
64
64
  /** 点击树节点触发 */
65
65
  onSelect?: (values: string[] | AllValueType, info?: any) => any;
66
66
  /** 复选情况下点击checkbox触发,参照antd */
@@ -1,4 +1,15 @@
1
+ @root-entry-name: 'default';
2
+ @import (reference) '~antd/es/style/themes/index.less';
3
+
1
4
  .pro-upload {
5
+ .@{ant-prefix}-upload-disabled{
6
+ .file-action-box{
7
+ .file-name, .file-del{
8
+ color: #ccc;
9
+ cursor: not-allowed !important;
10
+ }
11
+ }
12
+ }
2
13
 
3
14
  .filelist-item-wrapper {
4
15
  .file-info-box {
@@ -167,7 +167,7 @@ var ProEnum = function ProEnum(props) {
167
167
  }
168
168
  switch (type) {
169
169
  case 'ProSelect':
170
- return (0, _jsxRuntime.jsx)(_ProSelect.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, enumProps), {}, {
170
+ return (0, _jsxRuntime.jsx)(_ProSelect.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(enumProps, ['showCodeName'])), {}, {
171
171
  otherProps: otherProps,
172
172
  dataSource: list,
173
173
  fieldNames: {
@@ -178,7 +178,7 @@ var ProEnum = function ProEnum(props) {
178
178
  onChange: onChange
179
179
  }));
180
180
  case 'Radio':
181
- return (0, _jsxRuntime.jsx)(_antd.Radio.Group, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(enumProps, ['fieldNames'])), {}, {
181
+ return (0, _jsxRuntime.jsx)(_antd.Radio.Group, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(enumProps, ['fieldNames', 'showCodeName'])), {}, {
182
182
  options: list,
183
183
  value: value,
184
184
  onChange: onChange,
@@ -191,7 +191,7 @@ var ProEnum = function ProEnum(props) {
191
191
  })
192
192
  }));
193
193
  case 'Checkbox':
194
- return (0, _jsxRuntime.jsx)(_antd.Checkbox.Group, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(enumProps, ['fieldNames'])), {}, {
194
+ return (0, _jsxRuntime.jsx)(_antd.Checkbox.Group, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(enumProps, ['fieldNames', 'showCodeName'])), {}, {
195
195
  options: list,
196
196
  value: value,
197
197
  onChange: onChange,
@@ -212,7 +212,7 @@ var ProEnum = function ProEnum(props) {
212
212
  dataSource: list
213
213
  });
214
214
  case 'Group':
215
- return (0, _jsxRuntime.jsx)(_Group.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, enumProps), {}, {
215
+ return (0, _jsxRuntime.jsx)(_Group.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(enumProps, ['showCodeName'])), {}, {
216
216
  value: value,
217
217
  onChange: onChange,
218
218
  fieldLabel: label,
@@ -49,12 +49,12 @@ var getViewLabel = function getViewLabel(_ref) {
49
49
  return viewLabel;
50
50
  };
51
51
  var ProCascader = function ProCascader(props) {
52
- var _value$slice, _ref7, _ref7$filter, _defaultLabel$filter, _locale$ProAddressBar, _locale$ProAddressBar2;
52
+ var _props$otherProps, _value$slice, _ref7, _ref7$filter, _defaultLabel$filter, _locale$ProAddressBar, _locale$ProAddressBar2;
53
53
  var _ref2 = (0, _ProConfigProvider.useProConfig)('ProAddressBar') || {},
54
54
  configDetailMaxLength = _ref2.detailMaxLength,
55
55
  configEnumCode = _ref2.enumCode,
56
56
  configCode = _ref2.code;
57
- var isAddressMode = (props === null || props === void 0 ? void 0 : props.mode) === 'address';
57
+ var isAddressMode = (props === null || props === void 0 ? void 0 : props.mode) === 'address' || (props === null || props === void 0 ? void 0 : (_props$otherProps = props.otherProps) === null || _props$otherProps === void 0 ? void 0 : _props$otherProps.type) === 'ProAddressBar';
58
58
  var _props$className = props.className,
59
59
  className = _props$className === void 0 ? '' : _props$className,
60
60
  _props$hasDetail = props.hasDetail,
@@ -12,6 +12,7 @@ export { default as TimePicker } from './base/TimePicker';
12
12
  export { default as FormList } from './combination/FormList';
13
13
  export { default as ProEditTable } from '../../ProEditTable';
14
14
  export { default as ProCascader } from './combination/ProCascader';
15
+ export { default as ProAddressBar } from './combination/ProCascader';
15
16
  export { default as ProCombination } from './combination/ProCombination';
16
17
  export { default as ProNumberRange } from './combination/ProNumberRange';
17
18
  export { default as ProModalSelect } from './combination/ProModalSelect';
@@ -71,6 +71,12 @@ Object.defineProperty(exports, "ProAddress", {
71
71
  return _ProAddress.default;
72
72
  }
73
73
  });
74
+ Object.defineProperty(exports, "ProAddressBar", {
75
+ enumerable: true,
76
+ get: function get() {
77
+ return _ProCascader.default;
78
+ }
79
+ });
74
80
  Object.defineProperty(exports, "ProCascader", {
75
81
  enumerable: true,
76
82
  get: function get() {
@@ -274,7 +274,7 @@ var Render = function Render(props) {
274
274
  }, 60);
275
275
  }
276
276
  // ProTreeSelect返回option
277
- if (['ProTree'].includes(type)) {
277
+ if (['ProTree'].includes(type) && !_args[2].option) {
278
278
  var _args2, _args2$;
279
279
  _args[2].option = (0, _index.findOptionByValue)(lastComponentProps === null || lastComponentProps === void 0 ? void 0 : lastComponentProps.dataSource, (_args2 = _args) === null || _args2 === void 0 ? void 0 : (_args2$ = _args2[0]) === null || _args2$ === void 0 ? void 0 : _args2$[0], (lastComponentProps === null || lastComponentProps === void 0 ? void 0 : lastComponentProps.fieldNames) || {});
280
280
  }
@@ -257,12 +257,15 @@ var ProTree = function ProTree(props) {
257
257
  onChange && onChange(allValue);
258
258
  } else {
259
259
  var values = checkedValues;
260
+ var options = state.flatTreeData.filter(function (item) {
261
+ return values.includes(item[fieldNameValue]);
262
+ });
260
263
  if (labelInValue) {
261
264
  values = state.flatTreeData.filter(function (item) {
262
265
  return values.includes(item[fieldNameValue]);
263
266
  });
264
267
  }
265
- onChange && onChange(values);
268
+ onChange && onChange(values, options);
266
269
  }
267
270
  };
268
271
  // 该方法只有复选框,在勾中checkbox后才会走到这个方法
@@ -348,7 +351,7 @@ var ProTree = function ProTree(props) {
348
351
  /** 点击了树节点开始loading,改变自身state并将值通过onchange上传到form */
349
352
  var onSelectTreeNode = /*#__PURE__*/function () {
350
353
  var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(props, info) {
351
- var values;
354
+ var values, options;
352
355
  return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
353
356
  while (1) switch (_context.prev = _context.next) {
354
357
  case 0:
@@ -372,17 +375,22 @@ var ProTree = function ProTree(props) {
372
375
  clickShowLoading: false
373
376
  });
374
377
  case 7:
378
+ values = props;
379
+ options = state.flatTreeData.filter(function (item) {
380
+ return values === item[fieldNameValue];
381
+ });
382
+ if (labelInValue) {
383
+ values = state.flatTreeData.filter(function (item) {
384
+ return values === item[fieldNameValue];
385
+ });
386
+ }
375
387
  if (!(other === null || other === void 0 ? void 0 : other.checkable)) {
376
- // 单选将选中节点值冒泡到form
377
- values = props;
378
- if (labelInValue) {
379
- values = state.flatTreeData.filter(function (item) {
380
- return values === item[fieldNameValue];
381
- });
382
- }
383
- onChange && onChange(values);
388
+ // 单选将选中节点值冒泡到form, 给onFieldChange添加options
389
+ onChange && onChange(values, options === null || options === void 0 ? void 0 : options[0]);
390
+ } else {
391
+ onChange && onChange(value, options === null || options === void 0 ? void 0 : options[0]);
384
392
  }
385
- case 8:
393
+ case 11:
386
394
  case "end":
387
395
  return _context.stop();
388
396
  }
@@ -60,7 +60,7 @@ export interface ProTreeProps extends PropTreeSelectProps {
60
60
  /** 树节点文本宽度 */
61
61
  ellipseWidth?: string;
62
62
  /** value改变的回调 */
63
- onChange?: (values: string[] | AllValueType) => void;
63
+ onChange?: (values: string[] | AllValueType, options?: object[]) => void;
64
64
  /** 点击树节点触发 */
65
65
  onSelect?: (values: string[] | AllValueType, info?: any) => any;
66
66
  /** 复选情况下点击checkbox触发,参照antd */
@@ -1,4 +1,15 @@
1
+ @root-entry-name: 'default';
2
+ @import (reference) '~antd/es/style/themes/index.less';
3
+
1
4
  .pro-upload {
5
+ .@{ant-prefix}-upload-disabled{
6
+ .file-action-box{
7
+ .file-name, .file-del{
8
+ color: #ccc;
9
+ cursor: not-allowed !important;
10
+ }
11
+ }
12
+ }
2
13
 
3
14
  .filelist-item-wrapper {
4
15
  .file-info-box {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.4.11-beta.12",
3
+ "version": "3.4.11-beta.13",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",