ronds-metadata 1.2.94 → 1.2.95
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/es/comps/MetadataForm/DataCell/Select.js +23 -10
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/package.json +1 -1
|
@@ -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-
|
|
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$
|
|
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 =
|
|
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
|
|
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
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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
|
|
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