ronds-metadata 1.2.94 → 1.2.96

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,7 +16,7 @@ import _Input from "antd/es/input";
16
16
  /*
17
17
  * @Author: wangxian
18
18
  * @Date: 2021-09-18 14:15:04
19
- * @LastEditTime: 2023-06-02 10:46:41
19
+ * @LastEditTime: 2023-08-14 19:17:56
20
20
  */
21
21
  import React from 'react';
22
22
  import { UploadOutlined } from '@ant-design/icons';
@@ -114,7 +114,14 @@ function Index(props) {
114
114
  })
115
115
  );
116
116
  case 'upload':
117
- return /*#__PURE__*/React.createElement(_Upload, null, /*#__PURE__*/React.createElement(_Button, {
117
+ return /*#__PURE__*/React.createElement(_Upload, {
118
+ customRequest: function customRequest(options) {
119
+ // 模拟上传过程
120
+ setTimeout(function () {
121
+ options.onSuccess();
122
+ }, 1000);
123
+ }
124
+ }, /*#__PURE__*/React.createElement(_Button, {
118
125
  disabled: (_extraInfo$disabled5 = extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.disabled) !== null && _extraInfo$disabled5 !== void 0 ? _extraInfo$disabled5 : disabled,
119
126
  icon: /*#__PURE__*/React.createElement(UploadOutlined, null)
120
127
  }, "\u4E0A\u4F20"));
@@ -37,7 +37,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
37
37
  /*
38
38
  * @Author:wangxian
39
39
  * @Date: 2021-09-18 14:15:04
40
- * @LastEditTime: 2023-07-04 16:30:59
40
+ * @LastEditTime: 2023-08-14 09:44:23
41
41
  */
42
42
  import React from 'react';
43
43
  import { MetadataFormContext, MetadataRefContext } from '../interface';
@@ -49,7 +49,7 @@ import { tr } from '../../../framework/locale';
49
49
  import useObservable from '../../../framework/rxjs-hooks/useObservable';
50
50
  import { assignReplace, findTopParentIndex } from '../utils';
51
51
  function Index(props) {
52
- var _extraInfo$http9, _extraInfo$http10, _extraInfo$http11, _extraInfo$http12, _extraInfo$http13, _extraInfo$http14;
52
+ var _extraInfo$http11, _extraInfo$http12, _extraInfo$http13, _extraInfo$http14, _extraInfo$http15, _extraInfo$http16;
53
53
  var id = props.id,
54
54
  name = props.name,
55
55
  isRefForm = props.isRefForm,
@@ -274,12 +274,12 @@ function Index(props) {
274
274
  return processSelectOptionsData();
275
275
  }, [initEnumValue, myEnum, id, extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.maxSelect]);
276
276
  var httpOptions = useAsyncMemo( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
277
- var _extraInfo$http3, _extraInfo$http4, _extraInfo$http5, res;
277
+ var _extraInfo$http3, _extraInfo$http4, _extraInfo$http5, res, _extraInfo$http6, _extraInfo$http7, _enum;
278
278
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
279
279
  while (1) switch (_context2.prev = _context2.next) {
280
280
  case 0:
281
281
  if (!((extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.http) && (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.http.url))) {
282
- _context2.next = 7;
282
+ _context2.next = 9;
283
283
  break;
284
284
  }
285
285
  _context2.next = 3;
@@ -293,9 +293,22 @@ function Index(props) {
293
293
  setTreeData(_toConsumableArray(res));
294
294
  }
295
295
  return _context2.abrupt("return", res);
296
- case 7:
296
+ case 9:
297
+ if (!initEnumValue[id]) {
298
+ _context2.next = 14;
299
+ break;
300
+ }
301
+ _enum = deepClone(initEnumValue[id]);
302
+ if (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$http6 = extraInfo.http) === null || _extraInfo$http6 === void 0 ? void 0 : _extraInfo$http6.isCascader) {
303
+ setCascaderOption(_toConsumableArray(_enum));
304
+ }
305
+ if (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$http7 = extraInfo.http) === null || _extraInfo$http7 === void 0 ? void 0 : _extraInfo$http7.isTreeSelect) {
306
+ setTreeData(_toConsumableArray(_enum));
307
+ }
308
+ return _context2.abrupt("return", _enum);
309
+ case 14:
297
310
  return _context2.abrupt("return", []);
298
- case 8:
311
+ case 15:
299
312
  case "end":
300
313
  return _context2.stop();
301
314
  }
@@ -524,7 +537,7 @@ function Index(props) {
524
537
  }
525
538
  };
526
539
  if (isObj && isRefForm && field) {
527
- var _extraInfo$http6, _extraInfo$http7, _extraInfo$http8;
540
+ var _extraInfo$http8, _extraInfo$http9, _extraInfo$http10;
528
541
  return /*#__PURE__*/React.createElement(_Form.Item, _extends({}, field, {
529
542
  style: {
530
543
  flex: 1,
@@ -552,7 +565,7 @@ function Index(props) {
552
565
  }],
553
566
  help: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.help,
554
567
  tooltip: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.tooltip
555
- }), processSelectType((_extraInfo$http6 = extraInfo.http) === null || _extraInfo$http6 === void 0 ? void 0 : _extraInfo$http6.isCascader, (_extraInfo$http7 = extraInfo.http) === null || _extraInfo$http7 === void 0 ? void 0 : _extraInfo$http7.isTreeSelect, (_extraInfo$http8 = extraInfo.http) === null || _extraInfo$http8 === void 0 ? void 0 : _extraInfo$http8.isPagination));
568
+ }), processSelectType((_extraInfo$http8 = extraInfo.http) === null || _extraInfo$http8 === void 0 ? void 0 : _extraInfo$http8.isCascader, (_extraInfo$http9 = extraInfo.http) === null || _extraInfo$http9 === void 0 ? void 0 : _extraInfo$http9.isTreeSelect, (_extraInfo$http10 = extraInfo.http) === null || _extraInfo$http10 === void 0 ? void 0 : _extraInfo$http10.isPagination));
556
569
  }
557
570
  return !field ? /*#__PURE__*/React.createElement(_Form.Item, {
558
571
  key: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.defaultValue,
@@ -582,7 +595,7 @@ function Index(props) {
582
595
  }],
583
596
  help: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.help,
584
597
  tooltip: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.tooltip
585
- }, processSelectType((_extraInfo$http9 = extraInfo.http) === null || _extraInfo$http9 === void 0 ? void 0 : _extraInfo$http9.isCascader, (_extraInfo$http10 = extraInfo.http) === null || _extraInfo$http10 === void 0 ? void 0 : _extraInfo$http10.isTreeSelect, (_extraInfo$http11 = extraInfo.http) === null || _extraInfo$http11 === void 0 ? void 0 : _extraInfo$http11.isPagination)) : /*#__PURE__*/React.createElement(_Form.Item, _extends({}, field, {
598
+ }, processSelectType((_extraInfo$http11 = extraInfo.http) === null || _extraInfo$http11 === void 0 ? void 0 : _extraInfo$http11.isCascader, (_extraInfo$http12 = extraInfo.http) === null || _extraInfo$http12 === void 0 ? void 0 : _extraInfo$http12.isTreeSelect, (_extraInfo$http13 = extraInfo.http) === null || _extraInfo$http13 === void 0 ? void 0 : _extraInfo$http13.isPagination)) : /*#__PURE__*/React.createElement(_Form.Item, _extends({}, field, {
586
599
  style: {
587
600
  flex: 1,
588
601
  paddingRight: '10px'
@@ -593,6 +606,6 @@ function Index(props) {
593
606
  }],
594
607
  help: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.help,
595
608
  tooltip: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.tooltip
596
- }), processSelectType((_extraInfo$http12 = extraInfo.http) === null || _extraInfo$http12 === void 0 ? void 0 : _extraInfo$http12.isCascader, (_extraInfo$http13 = extraInfo.http) === null || _extraInfo$http13 === void 0 ? void 0 : _extraInfo$http13.isTreeSelect, (_extraInfo$http14 = extraInfo.http) === null || _extraInfo$http14 === void 0 ? void 0 : _extraInfo$http14.isPagination));
609
+ }), processSelectType((_extraInfo$http14 = extraInfo.http) === null || _extraInfo$http14 === void 0 ? void 0 : _extraInfo$http14.isCascader, (_extraInfo$http15 = extraInfo.http) === null || _extraInfo$http15 === void 0 ? void 0 : _extraInfo$http15.isTreeSelect, (_extraInfo$http16 = extraInfo.http) === null || _extraInfo$http16 === void 0 ? void 0 : _extraInfo$http16.isPagination));
597
610
  }
598
611
  export default /*#__PURE__*/React.memo(Index);
package/es/index.d.ts CHANGED
@@ -19,7 +19,7 @@ export * from './framework/metadata/index';
19
19
  export { default as http, addInterceptor } from './framework/http/index';
20
20
  export { default as useMemoSubject } from './framework/rxjs-hooks/useMemoSubject';
21
21
  export { default as useObservable } from './framework/rxjs-hooks/useObservable';
22
- export { useModel, Provider, Context, Model } from './framework/hooks/useModel';
22
+ export { useModel, Provider, Context } from './framework/hooks/useModel';
23
23
  export { default as useSyncScroll, useSyncScrollByRefs } from './framework/hooks/use-sync-scroll';
24
24
  export { registerMetadataAPI } from './framework/metadata/MetadataService';
25
25
  export { FormRobot } from './framework/fg/index';
package/es/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * @Author:wangxian
3
3
  * @Date: 2021-09-18 14:15:04
4
- * @LastEditTime: 2023-08-02 08:35:33
4
+ * @LastEditTime: 2023-08-02 08:41:39
5
5
  */
6
6
  import './theme.less';
7
7
  export { default as MetadataEdit } from './comps/MetadataEdit';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "public": true,
3
3
  "name": "ronds-metadata",
4
- "version": "1.2.94",
4
+ "version": "1.2.96",
5
5
  "scripts": {
6
6
  "start": "dumi dev",
7
7
  "docs:build": "dumi build",