form-driver 0.4.0 → 0.4.2

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/lib/m3.js CHANGED
@@ -18,10 +18,10 @@ var _assertThisInitialized = require('@babel/runtime/helpers/assertThisInitializ
18
18
  var icons = require('@ant-design/icons');
19
19
  var TextArea = require('antd/lib/input/TextArea');
20
20
  var Select = require('antd/lib/select');
21
- var Button = require('antd/lib/button');
22
- var _objectWithoutPropertiesLoose = require('@babel/runtime/helpers/objectWithoutPropertiesLoose');
23
21
  var adapter = require('@atlaskit/pragmatic-drag-and-drop/element/adapter');
24
22
  var clsx = require('clsx');
23
+ var Button = require('antd/lib/button');
24
+ var _objectWithoutPropertiesLoose = require('@babel/runtime/helpers/objectWithoutPropertiesLoose');
25
25
  var ReactDOM = require('react-dom');
26
26
  var debounce = require('lodash/debounce');
27
27
  var _extends = require('@babel/runtime/helpers/extends');
@@ -39,17 +39,17 @@ var zhCN__default = /*#__PURE__*/_interopDefaultLegacy(zhCN);
39
39
  var _assertThisInitialized__default = /*#__PURE__*/_interopDefaultLegacy(_assertThisInitialized);
40
40
  var TextArea__default = /*#__PURE__*/_interopDefaultLegacy(TextArea);
41
41
  var Select__default = /*#__PURE__*/_interopDefaultLegacy(Select);
42
+ var clsx__default = /*#__PURE__*/_interopDefaultLegacy(clsx);
42
43
  var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
43
44
  var _objectWithoutPropertiesLoose__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutPropertiesLoose);
44
- var clsx__default = /*#__PURE__*/_interopDefaultLegacy(clsx);
45
45
  var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
46
46
  var debounce__default = /*#__PURE__*/_interopDefaultLegacy(debounce);
47
47
  var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
48
48
  var OSS__default = /*#__PURE__*/_interopDefaultLegacy(OSS);
49
49
 
50
- function ownKeys$w(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
50
+ function ownKeys$x(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
51
51
 
52
- function _objectSpread$w(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$w(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$w(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
52
+ function _objectSpread$x(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$x(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$x(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
53
53
 
54
54
  function generateQueryStr(obj) {
55
55
  if (obj === void 0) {
@@ -83,7 +83,7 @@ var Ajax = {
83
83
  var args = {
84
84
  method: method,
85
85
  body: JSON.stringify(body),
86
- headers: _objectSpread$w({
86
+ headers: _objectSpread$x({
87
87
  'Content-Type': 'application/json'
88
88
  }, headers)
89
89
  };
@@ -195,11 +195,11 @@ var SchemaFunc = {
195
195
  }
196
196
  };
197
197
 
198
- function _createForOfIteratorHelperLoose$d(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray$d(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
198
+ function _createForOfIteratorHelperLoose$e(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray$e(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
199
199
 
200
- function _unsupportedIterableToArray$d(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$d(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$d(o, minLen); }
200
+ function _unsupportedIterableToArray$e(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$e(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$e(o, minLen); }
201
201
 
202
- function _arrayLikeToArray$d(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
202
+ function _arrayLikeToArray$e(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
203
203
  var next = Date.now() - 1617265950471; // /** 用来测量字符串长度 */
204
204
  // let _messurer: HTMLCanvasElement|undefined;
205
205
 
@@ -366,12 +366,12 @@ var MUtil = {
366
366
 
367
367
  var r = {};
368
368
 
369
- for (var _iterator = _createForOfIteratorHelperLoose$d((_spec$segments = spec.segments) != null ? _spec$segments : []), _step; !(_step = _iterator()).done;) {
369
+ for (var _iterator = _createForOfIteratorHelperLoose$e((_spec$segments = spec.segments) != null ? _spec$segments : []), _step; !(_step = _iterator()).done;) {
370
370
  var _spec$segments;
371
371
 
372
372
  var s = _step.value;
373
373
 
374
- for (var _iterator2 = _createForOfIteratorHelperLoose$d((_s$fields = s.fields) != null ? _s$fields : []), _step2; !(_step2 = _iterator2()).done;) {
374
+ for (var _iterator2 = _createForOfIteratorHelperLoose$e((_s$fields = s.fields) != null ? _s$fields : []), _step2; !(_step2 = _iterator2()).done;) {
375
375
  var _s$fields;
376
376
 
377
377
  var f = _step2.value;
@@ -438,7 +438,7 @@ var MUtil = {
438
438
  applyDefaultValue: function applyDefaultValue(schema, database, path) {
439
439
  // FIXME 多测试下,type是object或其他简单类型的情况
440
440
  if (schema.type === "object") {
441
- for (var _iterator3 = _createForOfIteratorHelperLoose$d((_schema$objectFields = schema.objectFields) != null ? _schema$objectFields : []), _step3; !(_step3 = _iterator3()).done;) {
441
+ for (var _iterator3 = _createForOfIteratorHelperLoose$e((_schema$objectFields = schema.objectFields) != null ? _schema$objectFields : []), _step3; !(_step3 = _iterator3()).done;) {
442
442
  var _schema$objectFields;
443
443
 
444
444
  var f = _step3.value;
@@ -490,7 +490,7 @@ var MUtil = {
490
490
 
491
491
  var showIfScript = "let {" + l1fields.join(",") + "} = data || {};\nlet hide = {";
492
492
 
493
- for (var _iterator4 = _createForOfIteratorHelperLoose$d(objectFields), _step4; !(_step4 = _iterator4()).done;) {
493
+ for (var _iterator4 = _createForOfIteratorHelperLoose$e(objectFields), _step4; !(_step4 = _iterator4()).done;) {
494
494
  var f = _step4.value;
495
495
 
496
496
  if (f.showIf) {
@@ -498,7 +498,7 @@ var MUtil = {
498
498
  }
499
499
  }
500
500
 
501
- for (var _iterator5 = _createForOfIteratorHelperLoose$d((_uispec$segments = uispec == null ? void 0 : uispec.segments) != null ? _uispec$segments : []), _step5; !(_step5 = _iterator5()).done;) {
501
+ for (var _iterator5 = _createForOfIteratorHelperLoose$e((_uispec$segments = uispec == null ? void 0 : uispec.segments) != null ? _uispec$segments : []), _step5; !(_step5 = _iterator5()).done;) {
502
502
  var _uispec$segments;
503
503
 
504
504
  var s = _step5.value;
@@ -510,7 +510,7 @@ var MUtil = {
510
510
 
511
511
  showIfScript += "}\n"; // 如果一个segment里的所有字段都隐藏,segment就要隐藏
512
512
 
513
- for (var _iterator6 = _createForOfIteratorHelperLoose$d((_uispec$segments2 = uispec == null ? void 0 : uispec.segments) != null ? _uispec$segments2 : []), _step6; !(_step6 = _iterator6()).done;) {
513
+ for (var _iterator6 = _createForOfIteratorHelperLoose$e((_uispec$segments2 = uispec == null ? void 0 : uispec.segments) != null ? _uispec$segments2 : []), _step6; !(_step6 = _iterator6()).done;) {
514
514
  var _uispec$segments2;
515
515
 
516
516
  var _s = _step6.value;
@@ -579,7 +579,7 @@ var MUtil = {
579
579
  var score = 0;
580
580
  var opts = MUtil.standardFields(f.setFields);
581
581
 
582
- for (var _iterator7 = _createForOfIteratorHelperLoose$d(opts), _step7; !(_step7 = _iterator7()).done;) {
582
+ for (var _iterator7 = _createForOfIteratorHelperLoose$e(opts), _step7; !(_step7 = _iterator7()).done;) {
583
583
  var s = _step7.value;
584
584
 
585
585
  if (___default["default"].find(opts, {
@@ -634,7 +634,7 @@ var MUtil = {
634
634
 
635
635
  var prevSize = Object.keys(dep).length;
636
636
 
637
- for (var _iterator8 = _createForOfIteratorHelperLoose$d(newDepNames), _step8; !(_step8 = _iterator8()).done;) {
637
+ for (var _iterator8 = _createForOfIteratorHelperLoose$e(newDepNames), _step8; !(_step8 = _iterator8()).done;) {
638
638
  var n = _step8.value;
639
639
  dep[n] = allFieldsIdx[n];
640
640
  delete ndep[n];
@@ -898,7 +898,7 @@ var MUtil = {
898
898
  return f.name;
899
899
  }), "字段名有重复");
900
900
 
901
- for (var _iterator9 = _createForOfIteratorHelperLoose$d(s.objectFields), _step9; !(_step9 = _iterator9()).done;) {
901
+ for (var _iterator9 = _createForOfIteratorHelperLoose$e(s.objectFields), _step9; !(_step9 = _iterator9()).done;) {
902
902
  var f = _step9.value;
903
903
  result = ___default["default"].concat(result, MUtil.validateSchema(f, MUtil.jsonPath(parentPath, s.name)));
904
904
  }
@@ -1054,11 +1054,11 @@ var CompactArray = {
1054
1054
  }
1055
1055
  };
1056
1056
 
1057
- function _createForOfIteratorHelperLoose$c(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray$c(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
1057
+ function _createForOfIteratorHelperLoose$d(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray$d(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
1058
1058
 
1059
- function _unsupportedIterableToArray$c(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$c(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$c(o, minLen); }
1059
+ function _unsupportedIterableToArray$d(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$d(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$d(o, minLen); }
1060
1060
 
1061
- function _arrayLikeToArray$c(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
1061
+ function _arrayLikeToArray$d(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
1062
1062
  var defaultTheme = {
1063
1063
  READABLE_UNKNOWN: "?",
1064
1064
  READABLE_BLANK: "-",
@@ -1105,13 +1105,13 @@ var Assembly = /*#__PURE__*/function () {
1105
1105
 
1106
1106
  var result = undefined;
1107
1107
 
1108
- for (var _iterator = _createForOfIteratorHelperLoose$c(this.types[s.type].validators), _step; !(_step = _iterator()).done;) {
1108
+ for (var _iterator = _createForOfIteratorHelperLoose$d(this.types[s.type].validators), _step; !(_step = _iterator()).done;) {
1109
1109
  var validator = _step.value;
1110
1110
  result = validator(this, s, v, path);
1111
1111
 
1112
- if (result === "pass") {
1112
+ if (result === "pass" && s.type !== "weight") {
1113
1113
  return undefined;
1114
- } else if (result) {
1114
+ } else if (typeof result === "object") {
1115
1115
  MUtil.debug("校验", path, result.message);
1116
1116
  return result;
1117
1117
  }
@@ -1217,9 +1217,9 @@ var assembly = new Assembly();
1217
1217
 
1218
1218
  var MContext = /*#__PURE__*/React__default["default"].createContext(undefined);
1219
1219
 
1220
- function ownKeys$v(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1220
+ function ownKeys$w(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1221
1221
 
1222
- function _objectSpread$v(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$v(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$v(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1222
+ function _objectSpread$w(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$w(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$w(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1223
1223
  /**
1224
1224
  * 一个字段的视图
1225
1225
  */
@@ -1242,7 +1242,7 @@ var MFieldViewer = /*#__PURE__*/function (_React$Component) {
1242
1242
  return MUtil.error("\u5B57\u6BB5\u7684\u89C6\u56FE\u5C1A\u672A\u5B9E\u73B0", this.props.schema);
1243
1243
  }
1244
1244
 
1245
- var props = _objectSpread$v({
1245
+ var props = _objectSpread$w({
1246
1246
  afterChange: function afterChange() {},
1247
1247
  changeSchema: function changeSchema() {},
1248
1248
  changeDatabase: function changeDatabase() {},
@@ -1276,11 +1276,9 @@ var MFieldViewer = /*#__PURE__*/function (_React$Component) {
1276
1276
 
1277
1277
  function validateRequired$1(a, schema, value, path) {
1278
1278
  if (schema.required) {
1279
- console.log('validateRequired-value', path, value);
1280
-
1281
1279
  if (___default["default"].isNil(value) || value === "" || ___default["default"].isNaN(value) || ___default["default"].isArray(value) && value.length == 0) {
1282
1280
  return {
1283
- message: '您还没有填完这一项',
1281
+ message: "您还没有填完这一项",
1284
1282
  path: path
1285
1283
  };
1286
1284
  } // 凡是总有例外
@@ -1289,7 +1287,7 @@ function validateRequired$1(a, schema, value, path) {
1289
1287
  if (schema.type === "set" && schema.openOption) {
1290
1288
  if (value.length === 1 && !value[0]) {
1291
1289
  return {
1292
- message: '您还没有填完这一项',
1290
+ message: "您还没有填完这一项",
1293
1291
  path: path
1294
1292
  }; // 开放set,只勾了开放选项,没有填内容,也要算空
1295
1293
  }
@@ -1476,11 +1474,11 @@ var Validator = {
1476
1474
  generateRegexValidate: generateRegexValidate$1
1477
1475
  };
1478
1476
 
1479
- function _createForOfIteratorHelperLoose$b(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray$b(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
1477
+ function _createForOfIteratorHelperLoose$c(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray$c(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
1480
1478
 
1481
- function _unsupportedIterableToArray$b(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$b(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$b(o, minLen); }
1479
+ function _unsupportedIterableToArray$c(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$c(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$c(o, minLen); }
1482
1480
 
1483
- function _arrayLikeToArray$b(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
1481
+ function _arrayLikeToArray$c(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
1484
1482
 
1485
1483
  function validateCandidate$1(a, schema, value, path) {
1486
1484
  var _schema$openOption;
@@ -1488,7 +1486,7 @@ function validateCandidate$1(a, schema, value, path) {
1488
1486
  var fs = MUtil.option(schema);
1489
1487
  console.log('validateCandidate', value);
1490
1488
 
1491
- for (var _iterator = _createForOfIteratorHelperLoose$b(fs), _step; !(_step = _iterator()).done;) {
1489
+ for (var _iterator = _createForOfIteratorHelperLoose$c(fs), _step; !(_step = _iterator()).done;) {
1492
1490
  var f = _step.value;
1493
1491
 
1494
1492
  // @ts-ignore
@@ -1523,7 +1521,7 @@ var MEnumType = {
1523
1521
  toReadable: function toReadable(assembly, s, v) {
1524
1522
  var fs = MUtil.option(s);
1525
1523
 
1526
- for (var _iterator2 = _createForOfIteratorHelperLoose$b(fs), _step2; !(_step2 = _iterator2()).done;) {
1524
+ for (var _iterator2 = _createForOfIteratorHelperLoose$c(fs), _step2; !(_step2 = _iterator2()).done;) {
1527
1525
  var f = _step2.value;
1528
1526
 
1529
1527
  if (f.value === v) {
@@ -1544,7 +1542,7 @@ var MEnumType = {
1544
1542
 
1545
1543
  var fs = MUtil.option(s);
1546
1544
 
1547
- for (var _iterator3 = _createForOfIteratorHelperLoose$b(fs), _step3; !(_step3 = _iterator3()).done;) {
1545
+ for (var _iterator3 = _createForOfIteratorHelperLoose$c(fs), _step3; !(_step3 = _iterator3()).done;) {
1548
1546
  var f = _step3.value;
1549
1547
 
1550
1548
  // @ts-ignore
@@ -15060,11 +15058,11 @@ var gb2260 = [
15060
15058
  }
15061
15059
  ];
15062
15060
 
15063
- function _createForOfIteratorHelperLoose$a(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray$a(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15061
+ function _createForOfIteratorHelperLoose$b(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray$b(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15064
15062
 
15065
- function _unsupportedIterableToArray$a(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$a(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$a(o, minLen); }
15063
+ function _unsupportedIterableToArray$b(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$b(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$b(o, minLen); }
15066
15064
 
15067
- function _arrayLikeToArray$a(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
15065
+ function _arrayLikeToArray$b(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
15068
15066
  var MGB2260Type = ___default["default"].assign({}, EmtpyType, {
15069
15067
  validators: [validateRequired$1],
15070
15068
  toReadable: function toReadable(assembly, s, v) {
@@ -15078,7 +15076,7 @@ var MGB2260Type = ___default["default"].assign({}, EmtpyType, {
15078
15076
  },
15079
15077
  gb2260: gb2260,
15080
15078
  lookup: function lookup(code) {
15081
- for (var _iterator = _createForOfIteratorHelperLoose$a(gb2260), _step; !(_step = _iterator()).done;) {
15079
+ for (var _iterator = _createForOfIteratorHelperLoose$b(gb2260), _step; !(_step = _iterator()).done;) {
15082
15080
  var prv = _step.value;
15083
15081
  // @ts-ignore prv.value全是数字,ts并不知道
15084
15082
  var pdiff = code - prv.value;
@@ -15092,7 +15090,7 @@ var MGB2260Type = ___default["default"].assign({}, EmtpyType, {
15092
15090
  };
15093
15091
  }
15094
15092
 
15095
- for (var _iterator2 = _createForOfIteratorHelperLoose$a(prv.children), _step2; !(_step2 = _iterator2()).done;) {
15093
+ for (var _iterator2 = _createForOfIteratorHelperLoose$b(prv.children), _step2; !(_step2 = _iterator2()).done;) {
15096
15094
  var city = _step2.value;
15097
15095
  // @ts-ignore city.value全是数字,ts并不知道
15098
15096
  var cdiff = code - city.value; // @ts-ignore
@@ -15104,7 +15102,7 @@ var MGB2260Type = ___default["default"].assign({}, EmtpyType, {
15104
15102
  };
15105
15103
  } else if (cdiff > 0 && cdiff < 100) {
15106
15104
  // @ts-ignore
15107
- for (var _iterator3 = _createForOfIteratorHelperLoose$a((_city$children = city.children) != null ? _city$children : []), _step3; !(_step3 = _iterator3()).done;) {
15105
+ for (var _iterator3 = _createForOfIteratorHelperLoose$b((_city$children = city.children) != null ? _city$children : []), _step3; !(_step3 = _iterator3()).done;) {
15108
15106
  var _city$children;
15109
15107
 
15110
15108
  var dst = _step3.value;
@@ -15192,11 +15190,11 @@ var MDateTimeType = ___default["default"].assign({}, EmtpyType, {
15192
15190
  }
15193
15191
  });
15194
15192
 
15195
- function _createForOfIteratorHelperLoose$9(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray$9(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15193
+ function _createForOfIteratorHelperLoose$a(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray$a(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15196
15194
 
15197
- function _unsupportedIterableToArray$9(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$9(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$9(o, minLen); }
15195
+ function _unsupportedIterableToArray$a(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$a(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$a(o, minLen); }
15198
15196
 
15199
- function _arrayLikeToArray$9(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
15197
+ function _arrayLikeToArray$a(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
15200
15198
 
15201
15199
  function validateCandidate(a, schema, value, path) {
15202
15200
  var _schema$openOption;
@@ -15205,11 +15203,13 @@ function validateCandidate(a, schema, value, path) {
15205
15203
 
15206
15204
  var openOption = ___default["default"].clone((_schema$openOption = schema.openOption) != null ? _schema$openOption : schema.setOpen);
15207
15205
 
15208
- for (var _iterator = _createForOfIteratorHelperLoose$9(value), _step; !(_step = _iterator()).done;) {
15206
+ if (!value) return undefined;
15207
+
15208
+ for (var _iterator = _createForOfIteratorHelperLoose$a(value), _step; !(_step = _iterator()).done;) {
15209
15209
  var v = _step.value;
15210
15210
  var vIsOk = false;
15211
15211
 
15212
- for (var _iterator2 = _createForOfIteratorHelperLoose$9(fs), _step2; !(_step2 = _iterator2()).done;) {
15212
+ for (var _iterator2 = _createForOfIteratorHelperLoose$a(fs), _step2; !(_step2 = _iterator2()).done;) {
15213
15213
  var f = _step2.value;
15214
15214
 
15215
15215
  if (MUtil.isEquals(f.value, v, schema.tolerate)) {
@@ -15252,7 +15252,7 @@ var MSetType = {
15252
15252
  }
15253
15253
 
15254
15254
  return vs.map(function (v) {
15255
- for (var _iterator3 = _createForOfIteratorHelperLoose$9(fs), _step3; !(_step3 = _iterator3()).done;) {
15255
+ for (var _iterator3 = _createForOfIteratorHelperLoose$a(fs), _step3; !(_step3 = _iterator3()).done;) {
15256
15256
  var f = _step3.value;
15257
15257
 
15258
15258
  if (f.value === v) {
@@ -15281,13 +15281,13 @@ var MSetType = {
15281
15281
  var result = [];
15282
15282
  var openValueFound = false; // 只能有一个开放值
15283
15283
 
15284
- for (var _iterator4 = _createForOfIteratorHelperLoose$9(vs), _step4; !(_step4 = _iterator4()).done;) {
15284
+ for (var _iterator4 = _createForOfIteratorHelperLoose$a(vs), _step4; !(_step4 = _iterator4()).done;) {
15285
15285
  var _s$openOption;
15286
15286
 
15287
15287
  var v = _step4.value;
15288
15288
  var matched = false;
15289
15289
 
15290
- for (var _iterator5 = _createForOfIteratorHelperLoose$9(fs), _step5; !(_step5 = _iterator5()).done;) {
15290
+ for (var _iterator5 = _createForOfIteratorHelperLoose$a(fs), _step5; !(_step5 = _iterator5()).done;) {
15291
15291
  var f = _step5.value;
15292
15292
 
15293
15293
  if (MUtil.isEquals(f.value, v, s.tolerate)) {
@@ -15367,7 +15367,7 @@ var MSetType = {
15367
15367
 
15368
15368
  while (max > 0 && prevValue.length > max) {
15369
15369
  // 超过上限了,要删到上限为止,但不能删新加的那条
15370
- for (var _iterator6 = _createForOfIteratorHelperLoose$9(prevValue), _step6; !(_step6 = _iterator6()).done;) {
15370
+ for (var _iterator6 = _createForOfIteratorHelperLoose$a(prevValue), _step6; !(_step6 = _iterator6()).done;) {
15371
15371
  var d = _step6.value;
15372
15372
 
15373
15373
  if (d !== newValue) {
@@ -15489,11 +15489,11 @@ var MSetType = {
15489
15489
  }
15490
15490
  };
15491
15491
 
15492
- function _createForOfIteratorHelperLoose$8(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray$8(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15492
+ function _createForOfIteratorHelperLoose$9(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray$9(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15493
15493
 
15494
- function _unsupportedIterableToArray$8(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$8(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$8(o, minLen); }
15494
+ function _unsupportedIterableToArray$9(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$9(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$9(o, minLen); }
15495
15495
 
15496
- function _arrayLikeToArray$8(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
15496
+ function _arrayLikeToArray$9(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
15497
15497
 
15498
15498
  function arrayValidator(assembly, schema, value, path) {
15499
15499
  var _schema$min, _schema$max;
@@ -15545,7 +15545,7 @@ var MArrayType = {
15545
15545
  return (_vs$map$join = vs == null ? void 0 : (_vs$map = vs.map(function (v) {
15546
15546
  var itemValueArr = [];
15547
15547
 
15548
- for (var _iterator = _createForOfIteratorHelperLoose$8(olfs), _step; !(_step = _iterator()).done;) {
15548
+ for (var _iterator = _createForOfIteratorHelperLoose$9(olfs), _step; !(_step = _iterator()).done;) {
15549
15549
  var ofs = _step.value;
15550
15550
  itemValueArr.push(v[ofs]);
15551
15551
  }
@@ -15645,11 +15645,11 @@ var MIntType = ___default["default"].assign({}, EmtpyType, {
15645
15645
 
15646
15646
  var MIntDiffType = MIntType;
15647
15647
 
15648
- function _createForOfIteratorHelperLoose$7(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray$7(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15648
+ function _createForOfIteratorHelperLoose$8(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray$8(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15649
15649
 
15650
- function _unsupportedIterableToArray$7(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$7(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$7(o, minLen); }
15650
+ function _unsupportedIterableToArray$8(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$8(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$8(o, minLen); }
15651
15651
 
15652
- function _arrayLikeToArray$7(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
15652
+ function _arrayLikeToArray$8(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
15653
15653
  function validateMatrix(a, schema, value, path) {
15654
15654
  var _schema$matrix, _schema$matrix3;
15655
15655
 
@@ -15696,7 +15696,7 @@ function validateMatrix(a, schema, value, path) {
15696
15696
 
15697
15697
  var yy = MUtil.standardFields((_schema$matrix4 = schema.matrix) == null ? void 0 : _schema$matrix4.y);
15698
15698
 
15699
- for (var _iterator = _createForOfIteratorHelperLoose$7(yy), _step; !(_step = _iterator()).done;) {
15699
+ for (var _iterator = _createForOfIteratorHelperLoose$8(yy), _step; !(_step = _iterator()).done;) {
15700
15700
  var _y$value;
15701
15701
 
15702
15702
  var y = _step.value;
@@ -15724,11 +15724,11 @@ var MMatrixType = ___default["default"].assign({}, EmtpyType, {
15724
15724
 
15725
15725
  });
15726
15726
 
15727
- function _createForOfIteratorHelperLoose$6(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray$6(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15727
+ function _createForOfIteratorHelperLoose$7(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray$7(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15728
15728
 
15729
- function _unsupportedIterableToArray$6(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$6(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$6(o, minLen); }
15729
+ function _unsupportedIterableToArray$7(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$7(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$7(o, minLen); }
15730
15730
 
15731
- function _arrayLikeToArray$6(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
15731
+ function _arrayLikeToArray$7(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
15732
15732
  function validateObject(assembly, schema, value, path) {
15733
15733
  if (schema.objectFields) {
15734
15734
  var _schema$uispec;
@@ -15807,7 +15807,7 @@ var MObjectType = {
15807
15807
  // 注意,m3的object是开放的,允许数据中出现未定义的字段,所以只处理在schema里有的字段,不会改变schema里没有的字段
15808
15808
 
15809
15809
 
15810
- for (var _iterator = _createForOfIteratorHelperLoose$6(s.objectFields), _step; !(_step = _iterator()).done;) {
15810
+ for (var _iterator = _createForOfIteratorHelperLoose$7(s.objectFields), _step; !(_step = _iterator()).done;) {
15811
15811
  var f = _step.value;
15812
15812
  var type = assembly.types[f.type];
15813
15813
 
@@ -15829,7 +15829,7 @@ var MObjectType = {
15829
15829
  } else {
15830
15830
  newItem = {};
15831
15831
 
15832
- for (var _iterator2 = _createForOfIteratorHelperLoose$6(schema.objectFields), _step2; !(_step2 = _iterator2()).done;) {
15832
+ for (var _iterator2 = _createForOfIteratorHelperLoose$7(schema.objectFields), _step2; !(_step2 = _iterator2()).done;) {
15833
15833
  var _assembly$types$membe;
15834
15834
 
15835
15835
  var memberField = _step2.value;
@@ -15894,11 +15894,11 @@ var MDateRangeType = ___default["default"].assign({}, EmtpyType, {
15894
15894
  }
15895
15895
  });
15896
15896
 
15897
- function _createForOfIteratorHelperLoose$5(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray$5(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15897
+ function _createForOfIteratorHelperLoose$6(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray$6(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15898
15898
 
15899
- function _unsupportedIterableToArray$5(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$5(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$5(o, minLen); }
15899
+ function _unsupportedIterableToArray$6(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$6(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$6(o, minLen); }
15900
15900
 
15901
- function _arrayLikeToArray$5(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
15901
+ function _arrayLikeToArray$6(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
15902
15902
  function validateExperience(assembly, schema, value, path) {
15903
15903
  var _schema$dataFormat, _schema$experience;
15904
15904
 
@@ -15917,7 +15917,7 @@ function validateExperience(assembly, schema, value, path) {
15917
15917
  var format = (_schema$dataFormat = schema.dataFormat) != null ? _schema$dataFormat : "x";
15918
15918
  var dim = [];
15919
15919
 
15920
- for (var _iterator = _createForOfIteratorHelperLoose$5(value), _step; !(_step = _iterator()).done;) {
15920
+ for (var _iterator = _createForOfIteratorHelperLoose$6(value), _step; !(_step = _iterator()).done;) {
15921
15921
  var _item = _step.value;
15922
15922
  var from = moment__default["default"](_item["from"], format).valueOf();
15923
15923
  var to = moment__default["default"](_item["to"], format).valueOf();
@@ -15954,7 +15954,7 @@ function validateExperience(assembly, schema, value, path) {
15954
15954
  if (!((_schema$experience = schema.experience) != null && _schema$experience.overlap)) {
15955
15955
  var prevTo = Number.MIN_VALUE;
15956
15956
 
15957
- for (var _iterator2 = _createForOfIteratorHelperLoose$5(dim), _step2; !(_step2 = _iterator2()).done;) {
15957
+ for (var _iterator2 = _createForOfIteratorHelperLoose$6(dim), _step2; !(_step2 = _iterator2()).done;) {
15958
15958
  var item = _step2.value;
15959
15959
 
15960
15960
  if (item.from < prevTo) {
@@ -15990,11 +15990,11 @@ var MExperienceType = ___default["default"].assign({}, EmtpyType, {
15990
15990
  return assembly.theme.READABLE_INVALID;
15991
15991
  }
15992
15992
 
15993
- for (var _iterator3 = _createForOfIteratorHelperLoose$5(vs), _step3; !(_step3 = _iterator3()).done;) {
15993
+ for (var _iterator3 = _createForOfIteratorHelperLoose$6(vs), _step3; !(_step3 = _iterator3()).done;) {
15994
15994
  var item = _step3.value;
15995
15995
  var exp = [];
15996
15996
 
15997
- for (var _iterator4 = _createForOfIteratorHelperLoose$5((_s$experience$members = (_s$experience = s.experience) == null ? void 0 : _s$experience.members) != null ? _s$experience$members : []), _step4; !(_step4 = _iterator4()).done;) {
15997
+ for (var _iterator4 = _createForOfIteratorHelperLoose$6((_s$experience$members = (_s$experience = s.experience) == null ? void 0 : _s$experience.members) != null ? _s$experience$members : []), _step4; !(_step4 = _iterator4()).done;) {
15998
15998
  var _s$experience$members, _s$experience;
15999
15999
 
16000
16000
  var childschema = _step4.value;
@@ -16007,11 +16007,11 @@ var MExperienceType = ___default["default"].assign({}, EmtpyType, {
16007
16007
  }
16008
16008
  });
16009
16009
 
16010
- function _createForOfIteratorHelperLoose$4(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray$4(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
16010
+ function _createForOfIteratorHelperLoose$5(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray$5(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
16011
16011
 
16012
- function _unsupportedIterableToArray$4(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$4(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$4(o, minLen); }
16012
+ function _unsupportedIterableToArray$5(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$5(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$5(o, minLen); }
16013
16013
 
16014
- function _arrayLikeToArray$4(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
16014
+ function _arrayLikeToArray$5(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
16015
16015
  var MCnAddress = ___default["default"].assign({}, EmtpyType, {
16016
16016
  validators: [validateRequired$1],
16017
16017
  toReadable: function toReadable(assembly, s, vs) {
@@ -16027,17 +16027,17 @@ var MCnAddress = ___default["default"].assign({}, EmtpyType, {
16027
16027
 
16028
16028
 
16029
16029
  if (vs.province && !vs.code) {
16030
- for (var _iterator = _createForOfIteratorHelperLoose$4(MGB2260Type.gb2260), _step; !(_step = _iterator()).done;) {
16030
+ for (var _iterator = _createForOfIteratorHelperLoose$5(MGB2260Type.gb2260), _step; !(_step = _iterator()).done;) {
16031
16031
  var p = _step.value;
16032
16032
 
16033
16033
  if (p.label === vs.province) {
16034
16034
  if (vs.city && p.children) {
16035
- for (var _iterator2 = _createForOfIteratorHelperLoose$4(p.children), _step2; !(_step2 = _iterator2()).done;) {
16035
+ for (var _iterator2 = _createForOfIteratorHelperLoose$5(p.children), _step2; !(_step2 = _iterator2()).done;) {
16036
16036
  var c = _step2.value;
16037
16037
 
16038
16038
  if (c.label === vs.city) {
16039
16039
  if (vs.district && c.children) {
16040
- for (var _iterator3 = _createForOfIteratorHelperLoose$4(c.children), _step3; !(_step3 = _iterator3()).done;) {
16040
+ for (var _iterator3 = _createForOfIteratorHelperLoose$5(c.children), _step3; !(_step3 = _iterator3()).done;) {
16041
16041
  var d = _step3.value;
16042
16042
 
16043
16043
  if (d.label === vs.district) {
@@ -16223,9 +16223,9 @@ var BaseViewer = /*#__PURE__*/function (_Viewer) {
16223
16223
  return BaseViewer;
16224
16224
  }(Viewer);
16225
16225
 
16226
- function ownKeys$u(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16226
+ function ownKeys$v(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16227
16227
 
16228
- function _objectSpread$u(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$u(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$u(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16228
+ function _objectSpread$v(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$v(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$v(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16229
16229
  var ArrayViewer = /*#__PURE__*/function (_BaseViewer) {
16230
16230
  _inheritsLoose__default["default"](ArrayViewer, _BaseViewer);
16231
16231
 
@@ -16243,35 +16243,35 @@ var ArrayViewer = /*#__PURE__*/function (_BaseViewer) {
16243
16243
 
16244
16244
  if (___default["default"].isNil(vs)) {
16245
16245
  return jsxRuntime.jsx("div", {
16246
- style: _objectSpread$u({}, s),
16246
+ style: _objectSpread$v({}, s),
16247
16247
  children: assembly.theme.READABLE_BLANK
16248
16248
  });
16249
16249
  } else if (!___default["default"].isArray(vs)) {
16250
16250
  return jsxRuntime.jsx("div", {
16251
- style: _objectSpread$u({}, s),
16251
+ style: _objectSpread$v({}, s),
16252
16252
  children: assembly.theme.READABLE_INVALID
16253
16253
  });
16254
16254
  } else if (vs.length === 0) {
16255
16255
  return jsxRuntime.jsx("div", {
16256
- style: _objectSpread$u({}, s),
16256
+ style: _objectSpread$v({}, s),
16257
16257
  children: assembly.theme.READABLE_BLANK
16258
16258
  });
16259
16259
  }
16260
16260
 
16261
16261
  if (this.props.schema.toReadable) {
16262
16262
  return jsxRuntime.jsxs("div", {
16263
- children: [" style=", _objectSpread$u({}, s), assembly.toReadable(this.props.schema, vs, _BaseViewer.prototype.getParentValue.call(this))]
16263
+ children: [" style=", _objectSpread$v({}, s), assembly.toReadable(this.props.schema, vs, _BaseViewer.prototype.getParentValue.call(this))]
16264
16264
  });
16265
16265
  } else if (this.props.schema.remote) {
16266
16266
  return jsxRuntime.jsxs("div", {
16267
- style: _objectSpread$u({}, s),
16267
+ style: _objectSpread$v({}, s),
16268
16268
  children: [" ", vs.map(function (v) {
16269
16269
  return v.label;
16270
16270
  }).join(", "), " "]
16271
16271
  });
16272
16272
  } else if (!this.props.schema.arrayMember) {
16273
16273
  return jsxRuntime.jsx("div", {
16274
- style: _objectSpread$u({}, s),
16274
+ style: _objectSpread$v({}, s),
16275
16275
  children: vs.join(', ')
16276
16276
  });
16277
16277
  } else {
@@ -16314,9 +16314,9 @@ var ArrayViewer = /*#__PURE__*/function (_BaseViewer) {
16314
16314
  return ArrayViewer;
16315
16315
  }(BaseViewer);
16316
16316
 
16317
- function ownKeys$t(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16317
+ function ownKeys$u(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16318
16318
 
16319
- function _objectSpread$t(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$t(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$t(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16319
+ function _objectSpread$u(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$u(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$u(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16320
16320
  /**
16321
16321
  * 日期选择框
16322
16322
  * 配置示例:
@@ -16365,7 +16365,7 @@ var ADatetimePicker = /*#__PURE__*/function (_BaseViewer) {
16365
16365
 
16366
16366
  if (MUtil.phoneLike()) {
16367
16367
  // 手机
16368
- return jsxRuntime.jsx(antdMobile.DatePicker, _objectSpread$t(_objectSpread$t({
16368
+ return jsxRuntime.jsx(antdMobile.DatePicker, _objectSpread$u(_objectSpread$u({
16369
16369
  disabled: this.props.disable,
16370
16370
  value: dataAsDate,
16371
16371
  minDate: this.props.schema.min ? moment__default["default"](this.props.schema.min, antConf.dataFormat).toDate() : undefined,
@@ -16380,7 +16380,7 @@ var ADatetimePicker = /*#__PURE__*/function (_BaseViewer) {
16380
16380
  }), this.props.path);
16381
16381
  } else {
16382
16382
  // 大屏
16383
- return jsxRuntime.jsx(antd.DatePicker, _objectSpread$t({
16383
+ return jsxRuntime.jsx(antd.DatePicker, _objectSpread$u({
16384
16384
  disabled: this.props.disable,
16385
16385
  bordered: this.props.hideBorder ? false : true,
16386
16386
  disabledDate: function disabledDate(m) {
@@ -16401,9 +16401,9 @@ var ADatetimePicker = /*#__PURE__*/function (_BaseViewer) {
16401
16401
  return ADatetimePicker;
16402
16402
  }(BaseViewer);
16403
16403
 
16404
- function ownKeys$s(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16404
+ function ownKeys$t(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16405
16405
 
16406
- function _objectSpread$s(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$s(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$s(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16406
+ function _objectSpread$t(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$t(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$t(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16407
16407
  /**
16408
16408
  * 选择中国的省市县
16409
16409
  * 示例:{label:"1.5 您目前的居住地",name:"reside", type:"gb2260"},
@@ -16437,7 +16437,7 @@ var AGB2260 = /*#__PURE__*/function (_BaseViewer) {
16437
16437
  var _looked$label;
16438
16438
 
16439
16439
  // 手机
16440
- return jsxRuntime.jsx(antdMobile.Picker, _objectSpread$s(_objectSpread$s({
16440
+ return jsxRuntime.jsx(antdMobile.Picker, _objectSpread$t(_objectSpread$t({
16441
16441
  extra: _BaseViewer.prototype.getPlaceholder.call(this),
16442
16442
  disabled: this.props.disable,
16443
16443
  className: "AGB2260",
@@ -16459,7 +16459,7 @@ var AGB2260 = /*#__PURE__*/function (_BaseViewer) {
16459
16459
  }), this.props.path);
16460
16460
  } else {
16461
16461
  // PC
16462
- return jsxRuntime.jsx(antd.Cascader, _objectSpread$s({
16462
+ return jsxRuntime.jsx(antd.Cascader, _objectSpread$t({
16463
16463
  options: MGB2260Type.gb2260,
16464
16464
  disabled: this.props.disable,
16465
16465
  placeholder: _BaseViewer.prototype.getPlaceholder.call(this),
@@ -16477,9 +16477,9 @@ var AGB2260 = /*#__PURE__*/function (_BaseViewer) {
16477
16477
  return AGB2260;
16478
16478
  }(BaseViewer);
16479
16479
 
16480
- function ownKeys$r(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16480
+ function ownKeys$s(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16481
16481
 
16482
- function _objectSpread$r(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$r(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$r(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16482
+ function _objectSpread$s(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$s(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$s(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16483
16483
 
16484
16484
  var OPEN_ENUM_RADIO_VALUE = -1;
16485
16485
  /**
@@ -16588,7 +16588,7 @@ var ARadio = /*#__PURE__*/function (_BaseViewer) {
16588
16588
  }
16589
16589
 
16590
16590
  var p = (_this$props$schema$pr = this.props.schema.props) != null ? _this$props$schema$pr : {};
16591
- return jsxRuntime.jsx(antd.Radio.Group, _objectSpread$r(_objectSpread$r({
16591
+ return jsxRuntime.jsx(antd.Radio.Group, _objectSpread$s(_objectSpread$s({
16592
16592
  defaultValue: initIndex,
16593
16593
  onChange: function onChange(vv) {
16594
16594
  var v = vv.target.value;
@@ -16611,9 +16611,9 @@ var ARadio = /*#__PURE__*/function (_BaseViewer) {
16611
16611
  return ARadio;
16612
16612
  }(BaseViewer);
16613
16613
 
16614
- function ownKeys$q(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16614
+ function ownKeys$r(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16615
16615
 
16616
- function _objectSpread$q(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$q(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$q(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16616
+ function _objectSpread$r(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$r(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$r(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16617
16617
  /**
16618
16618
  * antd 的评分组件 https://ant.design/components/rate-cn/
16619
16619
  * { editor: 'ARate', name: 'score', label: "评分", required: true, props: {count: 8} }
@@ -16638,7 +16638,7 @@ var ARate = /*#__PURE__*/function (_BaseViewer) {
16638
16638
 
16639
16639
  var p = (_this$props$schema$pr = this.props.schema.props) != null ? _this$props$schema$pr : {};
16640
16640
 
16641
- var props = _objectSpread$q({
16641
+ var props = _objectSpread$r({
16642
16642
  count: this.props.schema.max,
16643
16643
  defaultValue: this.value,
16644
16644
  onChange: function onChange(value, label, extra) {
@@ -16668,7 +16668,7 @@ var ARate = /*#__PURE__*/function (_BaseViewer) {
16668
16668
  className: "m3-nps-tip-right",
16669
16669
  children: p.rightTip
16670
16670
  })]
16671
- }) : null, jsxRuntime.jsx(antd.Rate, _objectSpread$q({
16671
+ }) : null, jsxRuntime.jsx(antd.Rate, _objectSpread$r({
16672
16672
  className: "m3-nps-rate"
16673
16673
  }, props))]
16674
16674
  });
@@ -16677,9 +16677,9 @@ var ARate = /*#__PURE__*/function (_BaseViewer) {
16677
16677
  return ARate;
16678
16678
  }(BaseViewer);
16679
16679
 
16680
- function ownKeys$p(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16680
+ function ownKeys$q(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16681
16681
 
16682
- function _objectSpread$p(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$p(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$p(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16682
+ function _objectSpread$q(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$q(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$q(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16683
16683
  /**
16684
16684
  * antd 的上传组件 https://ant.design/components/upload-cn/
16685
16685
  * {
@@ -16759,7 +16759,7 @@ var AUpload = /*#__PURE__*/function (_BaseViewer) {
16759
16759
  });
16760
16760
  }
16761
16761
 
16762
- var props = _objectSpread$p(_objectSpread$p({}, a), {}, {
16762
+ var props = _objectSpread$q(_objectSpread$q({}, a), {}, {
16763
16763
  onChange: function onChange(info) {
16764
16764
  if (p.onChange) p.onChange(info);
16765
16765
  console.log(info);
@@ -16821,7 +16821,7 @@ var AUpload = /*#__PURE__*/function (_BaseViewer) {
16821
16821
  }
16822
16822
  }, p);
16823
16823
 
16824
- return jsxRuntime.jsx(antd.Upload, _objectSpread$p(_objectSpread$p({
16824
+ return jsxRuntime.jsx(antd.Upload, _objectSpread$q(_objectSpread$q({
16825
16825
  disabled: this.loading !== undefined
16826
16826
  }, props), {}, {
16827
16827
  children: jsxRuntime.jsx(antd.Button, {
@@ -16834,9 +16834,9 @@ var AUpload = /*#__PURE__*/function (_BaseViewer) {
16834
16834
  return AUpload;
16835
16835
  }(BaseViewer);
16836
16836
 
16837
- function ownKeys$o(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16837
+ function ownKeys$p(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16838
16838
 
16839
- function _objectSpread$o(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$o(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$o(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16839
+ function _objectSpread$p(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$p(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$p(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16840
16840
  /**
16841
16841
  * antd 的树型选择控件 https://ant.design/components/tree-select-cn/
16842
16842
  * {
@@ -16868,7 +16868,7 @@ var ATreeSelect = /*#__PURE__*/function (_BaseViewer) {
16868
16868
 
16869
16869
  var p = (_this$props$schema$pr = this.props.schema.props) != null ? _this$props$schema$pr : {};
16870
16870
 
16871
- var props = _objectSpread$o({
16871
+ var props = _objectSpread$p({
16872
16872
  defaultValue: this.value,
16873
16873
  onChange: function onChange(value, label, extra) {
16874
16874
  if (p.onChange) p.onChange(value, label, extra);
@@ -16882,7 +16882,7 @@ var ATreeSelect = /*#__PURE__*/function (_BaseViewer) {
16882
16882
  }
16883
16883
  }, p);
16884
16884
 
16885
- return jsxRuntime.jsx(antd.TreeSelect, _objectSpread$o({
16885
+ return jsxRuntime.jsx(antd.TreeSelect, _objectSpread$p({
16886
16886
  style: {
16887
16887
  width: "100%"
16888
16888
  }
@@ -16892,9 +16892,9 @@ var ATreeSelect = /*#__PURE__*/function (_BaseViewer) {
16892
16892
  return ATreeSelect;
16893
16893
  }(BaseViewer);
16894
16894
 
16895
- function ownKeys$n(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16895
+ function ownKeys$o(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16896
16896
 
16897
- function _objectSpread$n(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$n(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$n(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16897
+ function _objectSpread$o(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$o(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$o(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16898
16898
  /**
16899
16899
  * NPS 打分组件,基于 antd 的评分组件 https://ant.design/components/rate-cn/
16900
16900
  * 定义示例:{ editor: 'NPS', name: 'possibility', label: "您向朋友或同事推荐本堂课程的可能性有多大?", required: true },
@@ -16922,7 +16922,7 @@ var NPS = /*#__PURE__*/function (_BaseViewer) {
16922
16922
 
16923
16923
  var p = (_this$props$schema$pr = this.props.schema.props) != null ? _this$props$schema$pr : {};
16924
16924
 
16925
- var props = _objectSpread$n({
16925
+ var props = _objectSpread$o({
16926
16926
  count: 11,
16927
16927
  character: function character(_ref) {
16928
16928
  var index = _ref.index;
@@ -16955,7 +16955,7 @@ var NPS = /*#__PURE__*/function (_BaseViewer) {
16955
16955
  className: "m3-nps-tip-right",
16956
16956
  children: (_p$rightTip = p.rightTip) != null ? _p$rightTip : '极有可能'
16957
16957
  })]
16958
- }), jsxRuntime.jsx(antd.Rate, _objectSpread$n({
16958
+ }), jsxRuntime.jsx(antd.Rate, _objectSpread$o({
16959
16959
  className: "m3-nps-rate"
16960
16960
  }, props)), p.remark ? jsxRuntime.jsx("div", {
16961
16961
  className: "m3-nps-remark",
@@ -16967,9 +16967,9 @@ var NPS = /*#__PURE__*/function (_BaseViewer) {
16967
16967
  return NPS;
16968
16968
  }(BaseViewer);
16969
16969
 
16970
- function ownKeys$m(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16970
+ function ownKeys$n(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16971
16971
 
16972
- function _objectSpread$m(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$m(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$m(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16972
+ function _objectSpread$n(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$n(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$n(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16973
16973
  /**
16974
16974
  * 输入整数的输入框
16975
16975
  * 定义示例:{label:"2.3 请问今年以来您平均每月工作多少天?",name:"workdayPerMonth", type:"int"},
@@ -16989,10 +16989,11 @@ var AIntBox = /*#__PURE__*/function (_BaseViewer) {
16989
16989
  _this = this;
16990
16990
 
16991
16991
  var p = (_this$props$schema$pr = this.props.schema.props) != null ? _this$props$schema$pr : {};
16992
+ console.log("AIntBox", p);
16992
16993
 
16993
- var props = _objectSpread$m(_objectSpread$m({}, _BaseViewer.prototype.antProp.call(this)), {}, {
16994
+ var props = _objectSpread$n(_objectSpread$n({}, _BaseViewer.prototype.antProp.call(this)), {}, {
16994
16995
  bordered: undefined,
16995
- style: _objectSpread$m({
16996
+ style: _objectSpread$n({
16996
16997
  border: this.props.hideBorder ? "none" : undefined
16997
16998
  }, this.props.style),
16998
16999
  min: this.props.schema.min,
@@ -17019,7 +17020,7 @@ var AIntBox = /*#__PURE__*/function (_BaseViewer) {
17019
17020
  }
17020
17021
  }, p);
17021
17022
 
17022
- return jsxRuntime.jsx(antd.InputNumber, _objectSpread$m({}, props));
17023
+ return jsxRuntime.jsx(antd.InputNumber, _objectSpread$n({}, props));
17023
17024
  };
17024
17025
 
17025
17026
  return AIntBox;
@@ -17188,9 +17189,9 @@ var ACheckBox = /*#__PURE__*/function (_BaseViewer) {
17188
17189
  return ACheckBox;
17189
17190
  }(BaseViewer);
17190
17191
 
17191
- function ownKeys$l(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17192
+ function ownKeys$m(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17192
17193
 
17193
- function _objectSpread$l(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$l(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$l(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
17194
+ function _objectSpread$m(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$m(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$m(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
17194
17195
  var AInputBox = /*#__PURE__*/function (_BaseViewer) {
17195
17196
  _inheritsLoose__default["default"](AInputBox, _BaseViewer);
17196
17197
 
@@ -17212,7 +17213,7 @@ var AInputBox = /*#__PURE__*/function (_BaseViewer) {
17212
17213
  var lines = (_this$props$schema$st = this.props.schema.stringLines) != null ? _this$props$schema$st : 1;
17213
17214
  var p = (_this$props$schema$pr = this.props.schema.props) != null ? _this$props$schema$pr : {};
17214
17215
 
17215
- var commonProps = _objectSpread$l({
17216
+ var commonProps = _objectSpread$m({
17216
17217
  defaultValue: this.getValue(),
17217
17218
  key: this.props.path,
17218
17219
  onChange: function onChange(v) {
@@ -17243,13 +17244,13 @@ var AInputBox = /*#__PURE__*/function (_BaseViewer) {
17243
17244
  });
17244
17245
  }
17245
17246
 
17246
- var inputProps = _objectSpread$l({
17247
+ var inputProps = _objectSpread$m({
17247
17248
  className: "AInputBox",
17248
17249
  style: this.props.style
17249
17250
  }, commonProps); //if(addon) {
17250
17251
 
17251
17252
 
17252
- return jsxRuntime.jsx(antd.Input, _objectSpread$l(_objectSpread$l({}, inputProps), {}, {
17253
+ return jsxRuntime.jsx(antd.Input, _objectSpread$m(_objectSpread$m({}, inputProps), {}, {
17253
17254
  addonAfter: addon
17254
17255
  })); // } else {
17255
17256
  // return <UnderlineInputBox {...inputProps}/>; // 等 UnderlineInputBox 支持addonAfter,上面的就能干掉了
@@ -17264,7 +17265,7 @@ var AInputBox = /*#__PURE__*/function (_BaseViewer) {
17264
17265
  styles.border = "none";
17265
17266
  }
17266
17267
 
17267
- return jsxRuntime.jsx(TextArea__default["default"], _objectSpread$l({
17268
+ return jsxRuntime.jsx(TextArea__default["default"], _objectSpread$m({
17268
17269
  style: styles
17269
17270
  }, commonProps));
17270
17271
  }
@@ -17273,9 +17274,9 @@ var AInputBox = /*#__PURE__*/function (_BaseViewer) {
17273
17274
  return AInputBox;
17274
17275
  }(BaseViewer);
17275
17276
 
17276
- function ownKeys$k(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17277
+ function ownKeys$l(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17277
17278
 
17278
- function _objectSpread$k(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$k(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$k(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
17279
+ function _objectSpread$l(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$l(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$l(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
17279
17280
  var UnderlineInputBox = /*#__PURE__*/function (_React$Component) {
17280
17281
  _inheritsLoose__default["default"](UnderlineInputBox, _React$Component);
17281
17282
 
@@ -17286,7 +17287,7 @@ var UnderlineInputBox = /*#__PURE__*/function (_React$Component) {
17286
17287
  var _proto = UnderlineInputBox.prototype;
17287
17288
 
17288
17289
  _proto.render = function render() {
17289
- return jsxRuntime.jsx("input", _objectSpread$k({
17290
+ return jsxRuntime.jsx("input", _objectSpread$l({
17290
17291
  className: assembly.theme.themeName + "InputBox"
17291
17292
  }, this.props));
17292
17293
  };
@@ -17349,11 +17350,11 @@ var SelectBox = /*#__PURE__*/function (_React$Component) {
17349
17350
  return SelectBox;
17350
17351
  }(React__default["default"].Component);
17351
17352
 
17352
- function _createForOfIteratorHelperLoose$3(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray$3(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
17353
+ function _createForOfIteratorHelperLoose$4(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray$4(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
17353
17354
 
17354
- function _unsupportedIterableToArray$3(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$3(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$3(o, minLen); }
17355
+ function _unsupportedIterableToArray$4(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$4(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$4(o, minLen); }
17355
17356
 
17356
- function _arrayLikeToArray$3(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
17357
+ function _arrayLikeToArray$4(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
17357
17358
  /**
17358
17359
  * 单选矩阵.
17359
17360
  * 暂不支持字符串以外的值。
@@ -17507,7 +17508,7 @@ var AMatrix = /*#__PURE__*/function (_BaseViewer) {
17507
17508
  var trs = [];
17508
17509
  var titleRow = [jsxRuntime.jsx("td", {}, "空的格子")];
17509
17510
 
17510
- for (var _iterator = _createForOfIteratorHelperLoose$3(xx), _step; !(_step = _iterator()).done;) {
17511
+ for (var _iterator = _createForOfIteratorHelperLoose$4(xx), _step; !(_step = _iterator()).done;) {
17511
17512
  var _x$value;
17512
17513
 
17513
17514
  var x = _step.value;
@@ -17598,7 +17599,7 @@ var AMatrix = /*#__PURE__*/function (_BaseViewer) {
17598
17599
  }, (_x$value4 = x.value) == null ? void 0 : _x$value4.toString()));
17599
17600
  };
17600
17601
 
17601
- for (var _iterator3 = _createForOfIteratorHelperLoose$3(xx), _step3; !(_step3 = _iterator3()).done;) {
17602
+ for (var _iterator3 = _createForOfIteratorHelperLoose$4(xx), _step3; !(_step3 = _iterator3()).done;) {
17602
17603
  _loop2();
17603
17604
  }
17604
17605
 
@@ -17607,7 +17608,7 @@ var AMatrix = /*#__PURE__*/function (_BaseViewer) {
17607
17608
  }, (_y$value2 = y.value) == null ? void 0 : _y$value2.toString()));
17608
17609
  };
17609
17610
 
17610
- for (var _iterator2 = _createForOfIteratorHelperLoose$3(yy), _step2; !(_step2 = _iterator2()).done;) {
17611
+ for (var _iterator2 = _createForOfIteratorHelperLoose$4(yy), _step2; !(_step2 = _iterator2()).done;) {
17611
17612
  _loop();
17612
17613
  }
17613
17614
 
@@ -17691,7 +17692,7 @@ var AMatrix = /*#__PURE__*/function (_BaseViewer) {
17691
17692
  }, (_y$value6 = y.value) == null ? void 0 : _y$value6.toString()));
17692
17693
  };
17693
17694
 
17694
- for (var _iterator4 = _createForOfIteratorHelperLoose$3(yy), _step4; !(_step4 = _iterator4()).done;) {
17695
+ for (var _iterator4 = _createForOfIteratorHelperLoose$4(yy), _step4; !(_step4 = _iterator4()).done;) {
17695
17696
  _loop3();
17696
17697
  }
17697
17698
  } else if (((_this$props$schema$ma11 = this.props.schema.matrix) == null ? void 0 : _this$props$schema$ma11.minY) === 1) {
@@ -17725,7 +17726,7 @@ var AMatrix = /*#__PURE__*/function (_BaseViewer) {
17725
17726
  }, (_x$value7 = x.value) == null ? void 0 : _x$value7.toString()));
17726
17727
  };
17727
17728
 
17728
- for (var _iterator5 = _createForOfIteratorHelperLoose$3(xx), _step5; !(_step5 = _iterator5()).done;) {
17729
+ for (var _iterator5 = _createForOfIteratorHelperLoose$4(xx), _step5; !(_step5 = _iterator5()).done;) {
17729
17730
  _loop4();
17730
17731
  }
17731
17732
  })();
@@ -17756,9 +17757,9 @@ function _openKey(data, yyClosed) {
17756
17757
  return (_$first = ___default["default"].first(___default["default"].difference(___default["default"].keys(data), yyClosed))) == null ? void 0 : _$first.toString();
17757
17758
  }
17758
17759
 
17759
- function ownKeys$j(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17760
+ function ownKeys$k(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17760
17761
 
17761
- function _objectSpread$j(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$j(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$j(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
17762
+ function _objectSpread$k(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$k(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$k(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
17762
17763
  /**
17763
17764
  * 手机号/邮箱等输入框
17764
17765
  * cnPhone/tel/email
@@ -17783,7 +17784,7 @@ var ASpecInputBox = /*#__PURE__*/function (_BaseViewer) {
17783
17784
 
17784
17785
  var selfOnChange = p.onChange;
17785
17786
  delete deepCloneP.onChange;
17786
- return jsxRuntime.jsx(antd.Input, _objectSpread$j(_objectSpread$j({}, _BaseViewer.prototype.antProp.call(this)), {}, {
17787
+ return jsxRuntime.jsx(antd.Input, _objectSpread$k(_objectSpread$k({}, _BaseViewer.prototype.antProp.call(this)), {}, {
17787
17788
  defaultValue: _BaseViewer.prototype.getValue.call(this),
17788
17789
  onBlur: function onBlur() {
17789
17790
  return _this.changeValueEx(_BaseViewer.prototype.getValue.call(_this), false, true);
@@ -17799,9 +17800,9 @@ var ASpecInputBox = /*#__PURE__*/function (_BaseViewer) {
17799
17800
  return ASpecInputBox;
17800
17801
  }(BaseViewer);
17801
17802
 
17802
- function ownKeys$i(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17803
+ function ownKeys$j(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17803
17804
 
17804
- function _objectSpread$i(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$i(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$i(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
17805
+ function _objectSpread$j(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$j(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$j(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
17805
17806
  var Segment = /*#__PURE__*/function (_React$Component) {
17806
17807
  _inheritsLoose__default["default"](Segment, _React$Component);
17807
17808
 
@@ -17815,7 +17816,7 @@ var Segment = /*#__PURE__*/function (_React$Component) {
17815
17816
  return jsxRuntime.jsxs("div", {
17816
17817
  style: this.props.style,
17817
17818
  className: "AForm_segment",
17818
- children: [jsxRuntime.jsxs("div", _objectSpread$i(_objectSpread$i({
17819
+ children: [jsxRuntime.jsxs("div", _objectSpread$j(_objectSpread$j({
17819
17820
  className: "AForm_segmentTitleBar"
17820
17821
  }, {
17821
17822
  name: this.props.labelName
@@ -17896,9 +17897,9 @@ function SegmentEditSwitch(props) {
17896
17897
  }
17897
17898
  }
17898
17899
 
17899
- function ownKeys$h(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17900
+ function ownKeys$i(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17900
17901
 
17901
- function _objectSpread$h(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$h(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$h(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
17902
+ function _objectSpread$i(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$i(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$i(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
17902
17903
  /**
17903
17904
  * 可以折叠的元素,折叠时可带动画效果
17904
17905
  *
@@ -17961,7 +17962,7 @@ var Collapsible = /*#__PURE__*/function (_React$Component) {
17961
17962
 
17962
17963
  if (open) {
17963
17964
  return {
17964
- css: _objectSpread$h(_objectSpread$h({}, self.props.style), {}, {
17965
+ css: _objectSpread$i(_objectSpread$i({}, self.props.style), {}, {
17965
17966
  maxHeight: changing ? self.height + "px" : undefined,
17966
17967
  visibility: "visible",
17967
17968
  opacity: "1",
@@ -17970,7 +17971,7 @@ var Collapsible = /*#__PURE__*/function (_React$Component) {
17970
17971
  };
17971
17972
  } else {
17972
17973
  var r = {
17973
- css: _objectSpread$h(_objectSpread$h({}, self.closeStyle), {}, {
17974
+ css: _objectSpread$i(_objectSpread$i({}, self.closeStyle), {}, {
17974
17975
  maxHeight: "0px",
17975
17976
  visibility: "hidden",
17976
17977
  opacity: "0",
@@ -18056,15 +18057,15 @@ var Collapsible = /*#__PURE__*/function (_React$Component) {
18056
18057
  return Collapsible;
18057
18058
  }(React__default["default"].Component);
18058
18059
 
18059
- function _createForOfIteratorHelperLoose$2(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray$2(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
18060
+ function _createForOfIteratorHelperLoose$3(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray$3(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
18060
18061
 
18061
- function _unsupportedIterableToArray$2(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$2(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$2(o, minLen); }
18062
+ function _unsupportedIterableToArray$3(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$3(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$3(o, minLen); }
18062
18063
 
18063
- function _arrayLikeToArray$2(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
18064
+ function _arrayLikeToArray$3(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
18064
18065
 
18065
- function ownKeys$g(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
18066
+ function ownKeys$h(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
18066
18067
 
18067
- function _objectSpread$g(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$g(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$g(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
18068
+ function _objectSpread$h(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$h(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$h(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
18068
18069
 
18069
18070
  function ItemLabel(props) {
18070
18071
  var _props$uispec;
@@ -18073,8 +18074,8 @@ function ItemLabel(props) {
18073
18074
  var label = props.schema.label;
18074
18075
 
18075
18076
  if ((_props$uispec = props.uispec) != null && _props$uispec.comma) {
18076
- // @ts-ignore trimEnd支持正则的,但lodash的声明写得不对
18077
- label = ___default["default"].trimEnd(label, new RegExp("::" + props.uispec.comma)) + props.uispec.comma;
18077
+ label = // @ts-ignore trimEnd支持正则的,但lodash的声明写得不对
18078
+ ___default["default"].trimEnd(label, new RegExp("::" + props.uispec.comma)) + props.uispec.comma;
18078
18079
  } // 必填label加星号
18079
18080
 
18080
18081
 
@@ -18102,8 +18103,6 @@ function ItemLabel(props) {
18102
18103
  }, ":popoverDesc");
18103
18104
  }
18104
18105
 
18105
- console.log('ItemLabel', props);
18106
-
18107
18106
  if (props.labelWidth) {
18108
18107
  // 防止 提示信息 换行
18109
18108
  return jsxRuntime.jsxs("span", {
@@ -18122,7 +18121,7 @@ function ItemLabel(props) {
18122
18121
  }
18123
18122
  } // /**
18124
18123
  // * 判断是否应该使用动画。
18125
- // *
18124
+ // *
18126
18125
  // * 当相邻的题,状态变化不同向(都是隐藏,或者都是出现)时,不能使用折叠动画,否则会出现抖动
18127
18126
  // * 这个函数判断所有的字段,是否需要折叠动画
18128
18127
  // */
@@ -18164,7 +18163,7 @@ var AForm = /*#__PURE__*/function (_Viewer) {
18164
18163
 
18165
18164
  _this = _Viewer.call(this, p) || this;
18166
18165
  _this.state = {
18167
- //shouldAnimation:{},
18166
+ //shouldAnimation:{},
18168
18167
  editing: {},
18169
18168
  saving: {},
18170
18169
  ctrlVersion: 1,
@@ -18211,7 +18210,7 @@ var AForm = /*#__PURE__*/function (_Viewer) {
18211
18210
  if (column > 1) {
18212
18211
  // 计算每项的宽度(保留2位有效数字)
18213
18212
  Object.assign(wrapperProp.style, {
18214
- width: Math.floor(100 / column * 100) / 100 + '%'
18213
+ width: Math.floor(100 / column * 100) / 100 + "%"
18215
18214
  });
18216
18215
  }
18217
18216
 
@@ -18243,7 +18242,7 @@ var AForm = /*#__PURE__*/function (_Viewer) {
18243
18242
 
18244
18243
  if (uispec.layout === "vertical") {
18245
18244
  // label在字段上面的分段布局
18246
- ele = jsxRuntime.jsxs(Collapsible, _objectSpread$g(_objectSpread$g({}, wrapperProp), {}, {
18245
+ ele = jsxRuntime.jsxs(Collapsible, _objectSpread$h(_objectSpread$h({}, wrapperProp), {}, {
18247
18246
  children: [jsxRuntime.jsx(ItemLabel, {
18248
18247
  uispec: uispec,
18249
18248
  schema: f,
@@ -18253,7 +18252,7 @@ var AForm = /*#__PURE__*/function (_Viewer) {
18253
18252
  } else if (uispec.layout === "horizontal") {
18254
18253
  // label在字段左边的分段布局 TODO
18255
18254
  wrapperProp.style.display = "flex";
18256
- ele = jsxRuntime.jsxs(Collapsible, _objectSpread$g(_objectSpread$g({}, wrapperProp), {}, {
18255
+ ele = jsxRuntime.jsxs(Collapsible, _objectSpread$h(_objectSpread$h({}, wrapperProp), {}, {
18257
18256
  children: [jsxRuntime.jsx(ItemLabel, {
18258
18257
  uispec: uispec,
18259
18258
  schema: f,
@@ -18290,7 +18289,7 @@ var AForm = /*#__PURE__*/function (_Viewer) {
18290
18289
  _proto._segmentForm = function _segmentForm(objectFields, uispec, column) {
18291
18290
  var _this3 = this;
18292
18291
 
18293
- var objectFieldMap = ___default["default"].chain(objectFields).keyBy('name').value();
18292
+ var objectFieldMap = ___default["default"].chain(objectFields).keyBy("name").value();
18294
18293
 
18295
18294
  var hideMap = MUtil.hideMap(MUtil.get(this.props.database, this.props.path), objectFields, uispec);
18296
18295
 
@@ -18302,10 +18301,10 @@ var AForm = /*#__PURE__*/function (_Viewer) {
18302
18301
  var labelWidth = 0;
18303
18302
 
18304
18303
  if (uispec.layout === "horizontal") {
18305
- for (var _iterator = _createForOfIteratorHelperLoose$2(uispec.segments), _step; !(_step = _iterator()).done;) {
18304
+ for (var _iterator = _createForOfIteratorHelperLoose$3(uispec.segments), _step; !(_step = _iterator()).done;) {
18306
18305
  var segment = _step.value;
18307
18306
 
18308
- for (var _iterator2 = _createForOfIteratorHelperLoose$2(segment.fields), _step2; !(_step2 = _iterator2()).done;) {
18307
+ for (var _iterator2 = _createForOfIteratorHelperLoose$3(segment.fields), _step2; !(_step2 = _iterator2()).done;) {
18309
18308
  var fieldName = _step2.value;
18310
18309
  var f = objectFieldMap[fieldName];
18311
18310
 
@@ -18329,7 +18328,7 @@ var AForm = /*#__PURE__*/function (_Viewer) {
18329
18328
  var items = [];
18330
18329
  var segmentFieldNames = [];
18331
18330
 
18332
- for (var _iterator4 = _createForOfIteratorHelperLoose$2(segment.fields), _step4; !(_step4 = _iterator4()).done;) {
18331
+ for (var _iterator4 = _createForOfIteratorHelperLoose$3(segment.fields), _step4; !(_step4 = _iterator4()).done;) {
18333
18332
  var _fieldName = _step4.value;
18334
18333
  var _f = objectFieldMap[_fieldName];
18335
18334
 
@@ -18382,7 +18381,7 @@ var AForm = /*#__PURE__*/function (_Viewer) {
18382
18381
 
18383
18382
  if (!___default["default"].isEqual(prev, current)) {
18384
18383
  antd.Modal.confirm({
18385
- content: '会丢失刚才的修改,确定吗?',
18384
+ content: "会丢失刚才的修改,确定吗?",
18386
18385
  okText: "刚才的修改不要了",
18387
18386
  cancelText: "继续编辑",
18388
18387
  onOk: cancel
@@ -18407,7 +18406,7 @@ var AForm = /*#__PURE__*/function (_Viewer) {
18407
18406
 
18408
18407
  segments.push(jsxRuntime.jsx(Segment, {
18409
18408
  column: column,
18410
- style: _objectSpread$g(_objectSpread$g({}, segment.style), {}, {
18409
+ style: _objectSpread$h(_objectSpread$h({}, segment.style), {}, {
18411
18410
  display: segHide ? "none" : undefined
18412
18411
  }),
18413
18412
  mainTitle: segment.label,
@@ -18417,7 +18416,7 @@ var AForm = /*#__PURE__*/function (_Viewer) {
18417
18416
  }, fno++));
18418
18417
  };
18419
18418
 
18420
- for (var _iterator3 = _createForOfIteratorHelperLoose$2(uispec.segments), _step3; !(_step3 = _iterator3()).done;) {
18419
+ for (var _iterator3 = _createForOfIteratorHelperLoose$3(uispec.segments), _step3; !(_step3 = _iterator3()).done;) {
18421
18420
  _loop();
18422
18421
  }
18423
18422
 
@@ -18441,7 +18440,7 @@ var AForm = /*#__PURE__*/function (_Viewer) {
18441
18440
  var labelWidth = 0;
18442
18441
 
18443
18442
  if (uispec.layout === "horizontal") {
18444
- for (var _iterator5 = _createForOfIteratorHelperLoose$2(objectFields), _step5; !(_step5 = _iterator5()).done;) {
18443
+ for (var _iterator5 = _createForOfIteratorHelperLoose$3(objectFields), _step5; !(_step5 = _iterator5()).done;) {
18445
18444
  var f = _step5.value;
18446
18445
  var label = f.label;
18447
18446
  labelWidth = Math.max(labelWidth, MUtil.antdTextWidth(label != null ? label : ""));
@@ -18451,7 +18450,7 @@ var AForm = /*#__PURE__*/function (_Viewer) {
18451
18450
 
18452
18451
  var items = [];
18453
18452
 
18454
- for (var _iterator6 = _createForOfIteratorHelperLoose$2(objectFields), _step6; !(_step6 = _iterator6()).done;) {
18453
+ for (var _iterator6 = _createForOfIteratorHelperLoose$3(objectFields), _step6; !(_step6 = _iterator6()).done;) {
18455
18454
  var _f2 = _step6.value;
18456
18455
  items.push(this.formItem(hideMap[_f2.name], hideMap, _f2, objectFields, uispec, this.props.morph, labelWidth, "layout\u503C\u65E0\u6548\uFF1A" + uispec.layout, column));
18457
18456
  }
@@ -18460,9 +18459,9 @@ var AForm = /*#__PURE__*/function (_Viewer) {
18460
18459
  return jsxRuntime.jsx("div", {
18461
18460
  className: "AForm",
18462
18461
  style: {
18463
- display: 'flex',
18464
- flexFlow: 'row wrap',
18465
- alignContent: 'flex-start'
18462
+ display: "flex",
18463
+ flexFlow: "row wrap",
18464
+ alignContent: "flex-start"
18466
18465
  },
18467
18466
  children: items
18468
18467
  });
@@ -18512,9 +18511,9 @@ var AForm = /*#__PURE__*/function (_Viewer) {
18512
18511
  return AForm;
18513
18512
  }(Viewer);
18514
18513
 
18515
- function ownKeys$f(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
18514
+ function ownKeys$g(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
18516
18515
 
18517
- function _objectSpread$f(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$f(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$f(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
18516
+ function _objectSpread$g(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$g(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$g(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
18518
18517
  var DivViewer = /*#__PURE__*/function (_BaseViewer) {
18519
18518
  _inheritsLoose__default["default"](DivViewer, _BaseViewer);
18520
18519
 
@@ -18526,7 +18525,7 @@ var DivViewer = /*#__PURE__*/function (_BaseViewer) {
18526
18525
 
18527
18526
  _proto.element = function element() {
18528
18527
  return jsxRuntime.jsx("pre", {
18529
- style: _objectSpread$f({
18528
+ style: _objectSpread$g({
18530
18529
  marginBottom: 0,
18531
18530
  color: "rgba(0,0,0,0.6)",
18532
18531
  overflow: "initial",
@@ -18540,9 +18539,9 @@ var DivViewer = /*#__PURE__*/function (_BaseViewer) {
18540
18539
  return DivViewer;
18541
18540
  }(BaseViewer);
18542
18541
 
18543
- function ownKeys$e(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
18542
+ function ownKeys$f(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
18544
18543
 
18545
- function _objectSpread$e(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$e(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$e(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
18544
+ function _objectSpread$f(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$f(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$f(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
18546
18545
  /**
18547
18546
  * 下拉选择框
18548
18547
  * 定义示例: {label:"1.1 您的性别是", name:"gendar", type:"enum", typeArg: [{label:"男", value:"M"},{label:"女", value:"F"}] },
@@ -18577,7 +18576,7 @@ var ASelector = /*#__PURE__*/function (_BaseViewer) {
18577
18576
  return MUtil.error("手机上的ASelector还不支持openOption");
18578
18577
  }
18579
18578
 
18580
- return jsxRuntime.jsx(SelectBox, _objectSpread$e(_objectSpread$e({
18579
+ return jsxRuntime.jsx(SelectBox, _objectSpread$f(_objectSpread$f({
18581
18580
  data: value,
18582
18581
  // @ts-ignore
18583
18582
  options: this._enums.map(function (e) {
@@ -18616,7 +18615,7 @@ var ASelector = /*#__PURE__*/function (_BaseViewer) {
18616
18615
  }, index);
18617
18616
  });
18618
18617
 
18619
- return jsxRuntime.jsx(Select__default["default"], _objectSpread$e(_objectSpread$e({
18618
+ return jsxRuntime.jsx(Select__default["default"], _objectSpread$f(_objectSpread$f({
18620
18619
  defaultValue: initIndex,
18621
18620
  placeholder: _BaseViewer.prototype.getPlaceholder.call(this),
18622
18621
  bordered: this.props.hideBorder ? false : true,
@@ -18688,9 +18687,9 @@ var ASelector = /*#__PURE__*/function (_BaseViewer) {
18688
18687
  return ASelector;
18689
18688
  }(BaseViewer);
18690
18689
 
18691
- function ownKeys$d(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
18690
+ function ownKeys$e(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
18692
18691
 
18693
- function _objectSpread$d(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$d(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$d(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
18692
+ function _objectSpread$e(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$e(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$e(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
18694
18693
  /**
18695
18694
  * 下拉框多选
18696
18695
  * 示例:{label:"1.13 除爱人/对象之外,目前和您一起生活的家庭成员包括(多选):",name:"familyAccompany",type:"set", editor:"ASetSelector", option: "父亲 母亲 孩子 爱人/对象的父亲 爱人/对象的母亲 兄弟姐妹"},
@@ -18728,7 +18727,7 @@ var ASetSelector = /*#__PURE__*/function (_BaseViewer) {
18728
18727
  return value2Fields[v].index;
18729
18728
  });
18730
18729
  var p = (_this$props$schema$pr = this.props.schema.props) != null ? _this$props$schema$pr : {};
18731
- return jsxRuntime.jsx(antd.Select, _objectSpread$d(_objectSpread$d({
18730
+ return jsxRuntime.jsx(antd.Select, _objectSpread$e(_objectSpread$e({
18732
18731
  mode: "multiple",
18733
18732
  placeholder: this.props.schema.placeholder,
18734
18733
  optionFilterProp: "children",
@@ -18772,98 +18771,497 @@ var ASetSelector = /*#__PURE__*/function (_BaseViewer) {
18772
18771
  return ASetSelector;
18773
18772
  }(BaseViewer);
18774
18773
 
18775
- function ownKeys$c(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
18776
-
18777
- function _objectSpread$c(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$c(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$c(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
18774
+ function ownKeys$d(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
18778
18775
 
18779
- function uuid(len, radix) {
18780
- if (len === void 0) {
18781
- len = 8;
18782
- }
18776
+ function _objectSpread$d(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$d(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$d(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
18777
+ /**
18778
+ * 增强版通用拖拽排序组件
18779
+ * 解决原组件的性能问题和功能局限性
18780
+ */
18783
18781
 
18784
- if (radix === void 0) {
18785
- radix = 16;
18786
- }
18782
+ var EnhancedSortDrag = /*#__PURE__*/React.memo(function (props) {
18783
+ var items = props.items,
18784
+ onChange = props.onChange,
18785
+ _props$enableAnimatio = props.enableAnimation,
18786
+ enableAnimation = _props$enableAnimatio === void 0 ? true : _props$enableAnimatio;
18787
+ props.enableCrossContainer;
18788
+ var _props$direction = props.direction,
18789
+ direction = _props$direction === void 0 ? "vertical" : _props$direction,
18790
+ onDragFail = props.onDragFail,
18791
+ renderDragHandle = props.renderDragHandle;
18792
+ props.renderDragPreview;
18793
+ var _props$isTableRow = props.isTableRow,
18794
+ isTableRow = _props$isTableRow === void 0 ? false : _props$isTableRow; // 使用 useRef 缓存 items 避免不必要的重渲染
18795
+
18796
+ var itemsRef = React.useRef(items);
18797
+ itemsRef.current = items; // 拖拽状态管理
18798
+
18799
+ var _useState = React.useState({
18800
+ draggingId: null,
18801
+ droppingId: null,
18802
+ isAnimating: false
18803
+ }),
18804
+ dragState = _useState[0],
18805
+ setDragState = _useState[1]; // 使用 Map 替代对象,提高查找性能
18806
+
18807
+
18808
+ var itemRefs = React.useRef(new Map());
18809
+ var dragHandleRefs = React.useRef(new Map()); // 清理函数缓存,避免重复注册
18810
+
18811
+ var cleanupRefs = React.useRef(new Map());
18812
+ /**
18813
+ * 验证拖拽操作是否有效
18814
+ */
18787
18815
 
18788
- var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
18789
- var uuid = [];
18790
- var i = 0;
18791
- radix = radix || chars.length;
18816
+ var validateDragOperation = React.useCallback(function (sourceId, targetId, items) {
18817
+ // 检查源项目是否存在
18818
+ var sourceItem = items.find(function (item) {
18819
+ return item.id === sourceId;
18820
+ });
18792
18821
 
18793
- if (len) {
18794
- for (i = 0; i < len; i++) {
18795
- uuid[i] = chars[0 | Math.random() * radix];
18796
- }
18797
- } else {
18798
- var r;
18799
- uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
18800
- uuid[14] = '4';
18822
+ if (!sourceItem) {
18823
+ return {
18824
+ isValid: false,
18825
+ error: {
18826
+ type: "VALIDATION_ERROR",
18827
+ message: "源项目不存在",
18828
+ sourceId: sourceId
18829
+ }
18830
+ };
18831
+ } // 检查目标项目是否存在
18801
18832
 
18802
- for (i = 0; i < 36; i++) {
18803
- if (!uuid[i]) {
18804
- r = 0 | Math.random() * 16;
18805
- uuid[i] = chars[i == 19 ? r & 0x3 | 0x8 : r];
18806
- }
18807
- }
18808
- }
18809
18833
 
18810
- return uuid.join('');
18811
- }
18812
- /**
18813
- * 数据表格
18814
- * 数据是这样的数组:
18815
- * [
18816
- * {from:"1606997544611",to:"", tillNow:true, company:"阿里巴巴", position:"CEO"},
18817
- * {from:"1606997544611",to:"", tillNow:true, company:"阿里巴巴", position:"CEO"},
18818
- * ]
18819
- */
18834
+ var targetItem = items.find(function (item) {
18835
+ return item.id === targetId;
18836
+ });
18820
18837
 
18838
+ if (!targetItem) {
18839
+ return {
18840
+ isValid: false,
18841
+ error: {
18842
+ type: "VALIDATION_ERROR",
18843
+ message: "目标项目不存在",
18844
+ targetId: targetId
18845
+ }
18846
+ };
18847
+ } // 检查是否允许拖拽
18821
18848
 
18822
- var AArrayGrid = /*#__PURE__*/function (_BaseViewer) {
18823
- _inheritsLoose__default["default"](AArrayGrid, _BaseViewer);
18824
18849
 
18825
- function AArrayGrid() {
18826
- return _BaseViewer.apply(this, arguments) || this;
18827
- }
18850
+ if (!sourceItem.isChecked) {
18851
+ return {
18852
+ isValid: false,
18853
+ error: {
18854
+ type: "VALIDATION_ERROR",
18855
+ message: "源项目不允许拖拽",
18856
+ sourceId: sourceId
18857
+ }
18858
+ };
18859
+ } // 检查是否允许放置
18828
18860
 
18829
- var _proto = AArrayGrid.prototype;
18830
18861
 
18831
- _proto.element = function element() {
18832
- var _this = this,
18833
- _schema$max;
18862
+ if (!targetItem.isChecked) {
18863
+ return {
18864
+ isValid: false,
18865
+ error: {
18866
+ type: "VALIDATION_ERROR",
18867
+ message: "目标位置不允许放置",
18868
+ targetId: targetId
18869
+ }
18870
+ };
18871
+ } // 检查是否为同一项目
18834
18872
 
18835
- var schema = this.props.schema;
18836
18873
 
18837
- if (!schema.arrayMember) {
18838
- return MUtil.error("arrayMember未定义", schema);
18874
+ if (sourceId === targetId) {
18875
+ return {
18876
+ isValid: false,
18877
+ error: {
18878
+ type: "VALIDATION_ERROR",
18879
+ message: "不能拖拽到自身位置",
18880
+ sourceId: sourceId,
18881
+ targetId: targetId
18882
+ }
18883
+ };
18839
18884
  }
18840
18885
 
18841
- var members = schema.arrayMember.objectFields // 成员是复杂结构
18842
- || [_objectSpread$c({
18843
- name: undefined
18844
- }, schema.arrayMember)]; // 成员是简单结构
18845
- // if(!members) {
18846
- // return MUtil.error("AArrayGrid只适用于对象数组", schema);
18847
- // }
18886
+ return {
18887
+ isValid: true
18888
+ };
18889
+ }, []);
18890
+ /**
18891
+ * 交换数据逻辑 - 核心拖拽算法
18892
+ */
18848
18893
 
18849
- var data = _BaseViewer.prototype.getValue.call(this);
18894
+ var swapItems = React.useCallback(function (fromId, toId) {
18895
+ try {
18896
+ var currentItems = [].concat(itemsRef.current); // 验证拖拽操作
18850
18897
 
18851
- if (!___default["default"].isArray(data)) {
18852
- // 只接受数组
18853
- data = [];
18854
- }
18898
+ var validation = validateDragOperation(fromId, toId, currentItems);
18855
18899
 
18856
- var cols = 1 + members.length; //let headTh = [<td key=":操作栏" width="40px" align="center" style={{backgroundImage: "linear-gradient(to bottom left, transparent calc(50% - 1px), #d3d3d3, transparent calc(50% + 1px))"}}></td>]
18900
+ if (!validation.isValid) {
18901
+ var _validation$error;
18857
18902
 
18858
- var rows = [];
18903
+ throw new Error(((_validation$error = validation.error) == null ? void 0 : _validation$error.message) || "拖拽验证失败");
18904
+ }
18859
18905
 
18860
- var _loop = function _loop(idx) {
18861
- var _schema$min;
18906
+ var fromIndex = currentItems.findIndex(function (item) {
18907
+ return item.id === fromId;
18908
+ });
18909
+ var toIndex = currentItems.findIndex(function (item) {
18910
+ return item.id === toId;
18911
+ }); // 边界条件检查
18862
18912
 
18863
- var i = idx;
18864
- rows.push(jsxRuntime.jsxs("tr", {
18865
- children: [members.map(function (f, idx) {
18866
- return jsxRuntime.jsx("td", {
18913
+ if (fromIndex === -1 || toIndex === -1 || fromIndex === toIndex) {
18914
+ return;
18915
+ }
18916
+
18917
+ var _currentItems$splice = currentItems.splice(fromIndex, 1),
18918
+ moved = _currentItems$splice[0];
18919
+
18920
+ currentItems.splice(toIndex, 0, moved); // 更新引用
18921
+
18922
+ itemsRef.current = currentItems; // 触发回调
18923
+
18924
+ onChange(currentItems);
18925
+ } catch (error) {
18926
+ console.error("拖拽交换数据失败:", error); // 触发错误回调
18927
+
18928
+ var dragError = {
18929
+ type: "DATA_ERROR",
18930
+ message: error instanceof Error ? error.message : "未知错误",
18931
+ sourceId: fromId,
18932
+ targetId: toId
18933
+ };
18934
+ onDragFail == null ? void 0 : onDragFail(dragError);
18935
+ }
18936
+ }, [onChange, onDragFail, validateDragOperation]);
18937
+ /**
18938
+ * 注册单个项目的拖拽监听器
18939
+ */
18940
+
18941
+ var registerDragListeners = React.useCallback(function (item, index) {
18942
+ var el = itemRefs.current.get(item.id);
18943
+ var dragHandle = dragHandleRefs.current.get(item.id);
18944
+ if (!el) return; // 清理之前的监听器
18945
+
18946
+ var existingCleanup = cleanupRefs.current.get(item.id);
18947
+
18948
+ if (existingCleanup) {
18949
+ existingCleanup();
18950
+ }
18951
+
18952
+ var cleanups = []; // 注册为可拖拽元素
18953
+
18954
+ cleanups.push(adapter.draggable({
18955
+ element: el,
18956
+ dragHandle: dragHandle,
18957
+ canDrag: function canDrag() {
18958
+ return item.isChecked;
18959
+ },
18960
+ getInitialData: function getInitialData() {
18961
+ return {
18962
+ id: item.id,
18963
+ index: index,
18964
+ label: item.label
18965
+ };
18966
+ },
18967
+ onDragStart: function onDragStart() {
18968
+ setDragState(function (prev) {
18969
+ return _objectSpread$d(_objectSpread$d({}, prev), {}, {
18970
+ draggingId: item.id,
18971
+ isAnimating: !!enableAnimation
18972
+ });
18973
+ });
18974
+ console.log("开始拖拽:", item.label);
18975
+ },
18976
+ onDrop: function onDrop() {
18977
+ setDragState(function (prev) {
18978
+ return _objectSpread$d(_objectSpread$d({}, prev), {}, {
18979
+ draggingId: null,
18980
+ droppingId: null,
18981
+ isAnimating: false
18982
+ });
18983
+ });
18984
+ }
18985
+ })); // 注册为拖拽目标
18986
+
18987
+ cleanups.push(adapter.dropTargetForElements({
18988
+ element: el,
18989
+ canDrop: function canDrop() {
18990
+ return item.isChecked;
18991
+ },
18992
+ onDragEnter: function onDragEnter(args) {
18993
+ var sourceId = args.source.data.id;
18994
+ if (sourceId === item.id) return;
18995
+ console.log("拖拽进入:", item.id);
18996
+ setDragState(function (prev) {
18997
+ return _objectSpread$d(_objectSpread$d({}, prev), {}, {
18998
+ droppingId: item.id
18999
+ });
19000
+ });
19001
+ },
19002
+ onDragLeave: function onDragLeave() {
19003
+ setDragState(function (prev) {
19004
+ return _objectSpread$d(_objectSpread$d({}, prev), {}, {
19005
+ droppingId: null
19006
+ });
19007
+ });
19008
+ },
19009
+ onDrop: function onDrop(_ref) {
19010
+ var source = _ref.source;
19011
+ if (!source) return;
19012
+ var sourceId = source.data.id;
19013
+ if (sourceId === item.id) return; // 执行数据交换
19014
+
19015
+ swapItems(sourceId, item.id);
19016
+ }
19017
+ })); // 存储清理函数
19018
+
19019
+ var combinedCleanup = function combinedCleanup() {
19020
+ cleanups.forEach(function (fn) {
19021
+ return fn();
19022
+ });
19023
+ };
19024
+
19025
+ cleanupRefs.current.set(item.id, combinedCleanup);
19026
+ }, [swapItems, enableAnimation]);
19027
+ /**
19028
+ * 性能优化:只在必要的时候注册监听器
19029
+ */
19030
+
19031
+ React.useEffect(function () {
19032
+ // 清理所有旧的监听器
19033
+ cleanupRefs.current.forEach(function (cleanup) {
19034
+ return cleanup();
19035
+ });
19036
+ cleanupRefs.current.clear(); // 注册所有项目的监听器
19037
+
19038
+ items.forEach(function (item, index) {
19039
+ registerDragListeners(item, index);
19040
+ }); // 监听全局拖拽结束
19041
+
19042
+ var monitorCleanup = adapter.monitorForElements({
19043
+ onDrop: function onDrop() {
19044
+ setDragState(function (prev) {
19045
+ return _objectSpread$d(_objectSpread$d({}, prev), {}, {
19046
+ draggingId: null,
19047
+ droppingId: null,
19048
+ isAnimating: false
19049
+ });
19050
+ });
19051
+ }
19052
+ });
19053
+ cleanupRefs.current.set("monitor", monitorCleanup);
19054
+ return function () {
19055
+ cleanupRefs.current.forEach(function (cleanup) {
19056
+ return cleanup();
19057
+ });
19058
+ cleanupRefs.current.clear();
19059
+ };
19060
+ }, [items.length, registerDragListeners]); // 只在列表长度变化时重新注册
19061
+
19062
+ /**
19063
+ * 渲染默认拖拽句柄
19064
+ */
19065
+
19066
+ var renderDefaultDragHandle = React.useCallback(function (item, isDragging) {
19067
+ return jsxRuntime.jsx(icons.HolderOutlined, {
19068
+ ref: function ref(el) {
19069
+ if (el) {
19070
+ dragHandleRefs.current.set(item.id, el);
19071
+ }
19072
+ },
19073
+ style: {
19074
+ cursor: isDragging ? "grabbing" : "grab",
19075
+ marginLeft: "8px",
19076
+ opacity: isDragging ? 0.5 : 1,
19077
+ transition: enableAnimation ? "opacity 0.2s" : "none"
19078
+ }
19079
+ });
19080
+ }, [enableAnimation]);
19081
+ /**
19082
+ * 渲染拖拽项
19083
+ */
19084
+
19085
+ var renderDragItem = React.useCallback(function (item, index) {
19086
+ var _clsx;
19087
+
19088
+ var isDragging = dragState.draggingId === item.id;
19089
+ var isDropping = dragState.droppingId === item.id; // 如果是表格行模式,直接返回组件内容
19090
+
19091
+ if (isTableRow) {
19092
+ // console.log("表格行数据", item);
19093
+ return jsxRuntime.jsxs("tr", {
19094
+ ref: function ref(el) {
19095
+ if (el) {
19096
+ itemRefs.current.set(item.id, el);
19097
+ }
19098
+ },
19099
+ "data-drag-id": item.id,
19100
+ "data-drag-index": index,
19101
+ style: {
19102
+ transition: enableAnimation ? "all 0.3s ease" : "none",
19103
+ opacity: isDragging ? 0.5 : 1,
19104
+ backgroundColor: isDropping ? "#e6f7ff" : "transparent"
19105
+ },
19106
+ children: [renderDragHandle && renderDragHandle(item, isDragging), !renderDragHandle && jsxRuntime.jsx("td", {
19107
+ ref: function ref(el) {
19108
+ if (el) {
19109
+ dragHandleRefs.current.set(item.id, el);
19110
+ }
19111
+ },
19112
+ style: {
19113
+ cursor: isDragging ? "grabbing" : "grab",
19114
+ textAlign: "center",
19115
+ width: "40px"
19116
+ },
19117
+ children: jsxRuntime.jsx(icons.HolderOutlined, {
19118
+ style: {
19119
+ opacity: isDragging ? 0.5 : 1,
19120
+ transition: enableAnimation ? "opacity 0.2s" : "none"
19121
+ }
19122
+ })
19123
+ }), item.cpn]
19124
+ }, item.id);
19125
+ }
19126
+
19127
+ var itemClass = clsx__default["default"]("enhanced-dragItem", (_clsx = {
19128
+ dragging: isDragging,
19129
+ dropping: isDropping,
19130
+ disabled: !item.isChecked
19131
+ }, _clsx["direction-" + direction] = true, _clsx));
19132
+ return jsxRuntime.jsxs("div", {
19133
+ className: itemClass,
19134
+ ref: function ref(el) {
19135
+ if (el) {
19136
+ itemRefs.current.set(item.id, el);
19137
+ }
19138
+ },
19139
+ "data-drag-id": item.id,
19140
+ "data-drag-index": index,
19141
+ style: {
19142
+ transition: enableAnimation ? "all 0.3s ease" : "none"
19143
+ },
19144
+ children: [jsxRuntime.jsx("div", {
19145
+ className: "enhanced-dragBody",
19146
+ children: item.cpn
19147
+ }), jsxRuntime.jsx("div", {
19148
+ className: "enhanced-dragHandle",
19149
+ children: item.isChecked && (renderDragHandle ? renderDragHandle(item, isDragging) : renderDefaultDragHandle(item, isDragging))
19150
+ })]
19151
+ }, item.id);
19152
+ }, [dragState, direction, enableAnimation, renderDragHandle, renderDefaultDragHandle, isTableRow]); // 如果是表格行模式,直接渲染子元素而不是包装div
19153
+
19154
+ if (isTableRow) {
19155
+ return jsxRuntime.jsx(jsxRuntime.Fragment, {
19156
+ children: items.map(renderDragItem)
19157
+ });
19158
+ }
19159
+
19160
+ return jsxRuntime.jsx("div", {
19161
+ className: "enhanced-sortDrag direction-" + direction,
19162
+ children: items.map(renderDragItem)
19163
+ });
19164
+ });
19165
+
19166
+ function ownKeys$c(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
19167
+
19168
+ function _objectSpread$c(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$c(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$c(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
19169
+
19170
+ function uuid(len, radix) {
19171
+ if (len === void 0) {
19172
+ len = 8;
19173
+ }
19174
+
19175
+ if (radix === void 0) {
19176
+ radix = 16;
19177
+ }
19178
+
19179
+ var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
19180
+ var uuid = [];
19181
+ var i = 0;
19182
+ radix = radix || chars.length;
19183
+
19184
+ if (len) {
19185
+ for (i = 0; i < len; i++) {
19186
+ uuid[i] = chars[0 | Math.random() * radix];
19187
+ }
19188
+ } else {
19189
+ var r;
19190
+ uuid[8] = uuid[13] = uuid[18] = uuid[23] = "-";
19191
+ uuid[14] = "4";
19192
+
19193
+ for (i = 0; i < 36; i++) {
19194
+ if (!uuid[i]) {
19195
+ r = 0 | Math.random() * 16;
19196
+ uuid[i] = chars[i == 19 ? r & 0x3 | 0x8 : r];
19197
+ }
19198
+ }
19199
+ }
19200
+
19201
+ return uuid.join("");
19202
+ }
19203
+ /**
19204
+ * 数据表格
19205
+ * 数据是这样的数组:
19206
+ * [
19207
+ * {from:"1606997544611",to:"", tillNow:true, company:"阿里巴巴", position:"CEO"},
19208
+ * {from:"1606997544611",to:"", tillNow:true, company:"阿里巴巴", position:"CEO"},
19209
+ * ]
19210
+ */
19211
+
19212
+
19213
+ var AArrayGrid = /*#__PURE__*/function (_BaseViewer) {
19214
+ _inheritsLoose__default["default"](AArrayGrid, _BaseViewer);
19215
+
19216
+ function AArrayGrid() {
19217
+ return _BaseViewer.apply(this, arguments) || this;
19218
+ }
19219
+
19220
+ var _proto = AArrayGrid.prototype;
19221
+
19222
+ _proto.element = function element() {
19223
+ var _this = this,
19224
+ _schema$max;
19225
+
19226
+ var schema = this.props.schema;
19227
+
19228
+ if (!schema.arrayMember) {
19229
+ return MUtil.error("arrayMember未定义", schema);
19230
+ }
19231
+
19232
+ var members = schema.arrayMember.objectFields || [// 成员是复杂结构
19233
+ _objectSpread$c({
19234
+ name: undefined
19235
+ }, schema.arrayMember)]; // 成员是简单结构
19236
+ // if(!members) {
19237
+ // return MUtil.error("AArrayGrid只适用于对象数组", schema);
19238
+ // }
19239
+
19240
+ var data = _BaseViewer.prototype.getValue.call(this);
19241
+
19242
+ if (!___default["default"].isArray(data)) {
19243
+ // 只接受数组
19244
+ data = [];
19245
+ }
19246
+
19247
+ data = data.map(function (d) {
19248
+ if (!d.uniqueId) {
19249
+ d.uniqueId = uuid();
19250
+ }
19251
+
19252
+ return d;
19253
+ });
19254
+ var cols = 1 + members.length; //let headTh = [<td key=":操作栏" width="40px" align="center" style={{backgroundImage: "linear-gradient(to bottom left, transparent calc(50% - 1px), #d3d3d3, transparent calc(50% + 1px))"}}></td>]
19255
+
19256
+ var rows = [];
19257
+
19258
+ var _loop = function _loop(idx) {
19259
+ var _schema$min2;
19260
+
19261
+ var i = idx;
19262
+ rows.push(jsxRuntime.jsxs("tr", {
19263
+ children: [members.map(function (f, idx) {
19264
+ return jsxRuntime.jsx("td", {
18867
19265
  children: jsxRuntime.jsx(MFieldViewer, {
18868
19266
  parent: schema,
18869
19267
  morph: _this.props.morph,
@@ -18907,7 +19305,7 @@ var AArrayGrid = /*#__PURE__*/function (_BaseViewer) {
18907
19305
  style: {
18908
19306
  display: "block"
18909
19307
  },
18910
- hidden: data.length == ((_schema$min = schema.min) != null ? _schema$min : 0)
19308
+ hidden: data.length == ((_schema$min2 = schema.min) != null ? _schema$min2 : 0)
18911
19309
  })
18912
19310
  }), jsxRuntime.jsx(icons.CaretDownOutlined, {
18913
19311
  style: {
@@ -18915,6 +19313,8 @@ var AArrayGrid = /*#__PURE__*/function (_BaseViewer) {
18915
19313
  },
18916
19314
  hidden: data.length <= 1,
18917
19315
  onClick: function onClick() {
19316
+ console.log("当前选择数据", data);
19317
+
18918
19318
  if (i === data.length - 1) {
18919
19319
  antd.message.warn("已经到底了");
18920
19320
  } else {
@@ -18934,7 +19334,24 @@ var AArrayGrid = /*#__PURE__*/function (_BaseViewer) {
18934
19334
  _loop(idx);
18935
19335
  }
18936
19336
 
18937
- var isMax = data.length >= ((_schema$max = schema.max) != null ? _schema$max : Number.MAX_VALUE);
19337
+ var isMax = data.length >= ((_schema$max = schema.max) != null ? _schema$max : Number.MAX_VALUE); // 处理拖拽后的数据变化
19338
+
19339
+ var handleDragChange = function handleDragChange(newItems) {
19340
+ // 根据拖拽后的新顺序,重新排列原始表格数据
19341
+ var newData = newItems.map(function (item) {
19342
+ // 从原始数据中找到对应的行数据
19343
+ var originalRow = data.find(function (row) {
19344
+ return String(row.uniqueId) === item.id;
19345
+ }); // 正常情况下一定能找到对应的行数据,因为我们是基于原始数据创建的拖拽项
19346
+
19347
+ return _objectSpread$c({}, originalRow); // 使用 ! 断言,因为我们确信能找到匹配项
19348
+ });
19349
+
19350
+ _BaseViewer.prototype.changeValueEx.call(_this, newData, true, true);
19351
+ };
19352
+
19353
+ var handleDragFail = function handleDragFail() {};
19354
+
18938
19355
  return jsxRuntime.jsx("table", {
18939
19356
  className: "AExperience M3_table",
18940
19357
  style: {
@@ -18942,7 +19359,7 @@ var AArrayGrid = /*#__PURE__*/function (_BaseViewer) {
18942
19359
  },
18943
19360
  children: jsxRuntime.jsxs("tbody", {
18944
19361
  children: [jsxRuntime.jsxs("tr", {
18945
- children: [members.map(function (f, i) {
19362
+ children: [jsxRuntime.jsx("th", {}, "拖拽"), members.map(function (f, i) {
18946
19363
  var _f$label;
18947
19364
 
18948
19365
  return jsxRuntime.jsxs("th", {
@@ -18957,7 +19374,56 @@ var AArrayGrid = /*#__PURE__*/function (_BaseViewer) {
18957
19374
  width: "40px",
18958
19375
  align: "center"
18959
19376
  }, ":\u64CD\u4F5C\u680F")]
18960
- }, ":header"), rows, jsxRuntime.jsx("tr", {
19377
+ }, ":header"), jsxRuntime.jsx(EnhancedSortDrag, {
19378
+ items: data.map(function (row, index) {
19379
+ var _schema$min;
19380
+
19381
+ return {
19382
+ id: String(row.uniqueId),
19383
+ cpn: jsxRuntime.jsxs(jsxRuntime.Fragment, {
19384
+ children: [members.map(function (f, idx) {
19385
+ return jsxRuntime.jsx("td", {
19386
+ children: jsxRuntime.jsx(MFieldViewer, {
19387
+ parent: schema,
19388
+ morph: _this.props.morph,
19389
+ schema: f,
19390
+ database: data,
19391
+ path: MUtil.jsonPath("[" + index + "]", f.name),
19392
+ hideBorder: true,
19393
+ afterChange: function afterChange(path, v, final) {
19394
+ _BaseViewer.prototype.changeValueEx.call(_this, data, false, final);
19395
+ }
19396
+ }, _this.state.ctrlVersion + "." + f.name)
19397
+ }, f.name + idx);
19398
+ }), jsxRuntime.jsx(antd.Popconfirm, {
19399
+ title: "\u786E\u5B9A\u8981\u5220\u9664\u5417\u8FD9\u4E00\u9879\u5417\uFF1F",
19400
+ onConfirm: function onConfirm() {
19401
+ data.splice(index, 1);
19402
+
19403
+ _BaseViewer.prototype.changeValueEx.call(_this, data, true, true);
19404
+ },
19405
+ okText: "\u5220\u9664",
19406
+ cancelText: "\u4E0D\u5220",
19407
+ children: jsxRuntime.jsx("td", {
19408
+ children: jsxRuntime.jsx(icons.CloseOutlined, {
19409
+ style: {
19410
+ display: "block"
19411
+ },
19412
+ hidden: data.length == ((_schema$min = schema.min) != null ? _schema$min : 0)
19413
+ })
19414
+ })
19415
+ })]
19416
+ }),
19417
+ isChecked: true,
19418
+ label: "" + row.name,
19419
+ checkedIndex: index
19420
+ };
19421
+ }),
19422
+ onChange: handleDragChange,
19423
+ enableAnimation: true,
19424
+ isTableRow: true,
19425
+ onDragFail: handleDragFail
19426
+ }), jsxRuntime.jsx("tr", {
18961
19427
  children: jsxRuntime.jsxs("th", {
18962
19428
  colSpan: cols,
18963
19429
  children: [jsxRuntime.jsx(antd.Button, {
@@ -18987,7 +19453,7 @@ var AArrayGrid = /*#__PURE__*/function (_BaseViewer) {
18987
19453
  });
18988
19454
  }
18989
19455
 
18990
- console.log('data', data);
19456
+ console.log("data", data);
18991
19457
 
18992
19458
  _BaseViewer.prototype.changeValue.call(_this, data);
18993
19459
  },
@@ -19106,11 +19572,11 @@ var AExperience = /*#__PURE__*/function (_BaseViewer) {
19106
19572
  return AExperience;
19107
19573
  }(BaseViewer);
19108
19574
 
19109
- function _createForOfIteratorHelperLoose$1(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
19575
+ function _createForOfIteratorHelperLoose$2(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray$2(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
19110
19576
 
19111
- function _unsupportedIterableToArray$1(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$1(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen); }
19577
+ function _unsupportedIterableToArray$2(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$2(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$2(o, minLen); }
19112
19578
 
19113
- function _arrayLikeToArray$1(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
19579
+ function _arrayLikeToArray$2(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
19114
19580
  /**
19115
19581
  * 国内地址,用以编辑省市区和详细地址
19116
19582
  * 数据类似{province:"陕西省",city:"西安市",district:"长安区", address:"紫薇田园都市A区", code:610116}
@@ -19132,17 +19598,17 @@ var ACnAddress = /*#__PURE__*/function (_BaseViewer) {
19132
19598
  var gb2260 = (_BaseViewer$prototype = _BaseViewer.prototype.getValue.call(this)) != null ? _BaseViewer$prototype : {}; // 当传入的 database,没有 code,但有 province 时,反查 code
19133
19599
 
19134
19600
  if (gb2260.province && !gb2260.code) {
19135
- for (var _iterator = _createForOfIteratorHelperLoose$1(MGB2260Type.gb2260), _step; !(_step = _iterator()).done;) {
19601
+ for (var _iterator = _createForOfIteratorHelperLoose$2(MGB2260Type.gb2260), _step; !(_step = _iterator()).done;) {
19136
19602
  var p = _step.value;
19137
19603
 
19138
19604
  if (p.label === gb2260.province) {
19139
19605
  if (gb2260.city && p.children) {
19140
- for (var _iterator2 = _createForOfIteratorHelperLoose$1(p.children), _step2; !(_step2 = _iterator2()).done;) {
19606
+ for (var _iterator2 = _createForOfIteratorHelperLoose$2(p.children), _step2; !(_step2 = _iterator2()).done;) {
19141
19607
  var c = _step2.value;
19142
19608
 
19143
19609
  if (c.label === gb2260.city) {
19144
19610
  if (gb2260.district && c.children) {
19145
- for (var _iterator3 = _createForOfIteratorHelperLoose$1(c.children), _step3; !(_step3 = _iterator3()).done;) {
19611
+ for (var _iterator3 = _createForOfIteratorHelperLoose$2(c.children), _step3; !(_step3 = _iterator3()).done;) {
19146
19612
  var d = _step3.value;
19147
19613
 
19148
19614
  if (d.label === gb2260.district) {
@@ -19502,7 +19968,7 @@ var SortDrag = /*#__PURE__*/React.memo(function (props) {
19502
19968
  var sortList = props.sortList,
19503
19969
  changeOriginDataSource = props.changeOriginDataSource;
19504
19970
 
19505
- var _useState = React.useState([]),
19971
+ var _useState = React.useState(sortList),
19506
19972
  items = _useState[0],
19507
19973
  setItems = _useState[1]; // 记录当前拖拽的 item id
19508
19974
 
@@ -19601,22 +20067,6 @@ var SortDrag = /*#__PURE__*/React.memo(function (props) {
19601
20067
  });
19602
20068
  };
19603
20069
  }, [items]);
19604
- React.useEffect(function () {
19605
- var checkedItems = sortList.filter(function (item) {
19606
- return item.isChecked;
19607
- }).sort(function (a, b) {
19608
- return a.checkedIndex - b.checkedIndex;
19609
- });
19610
- var unCheckedItems = sortList.filter(function (item) {
19611
- return !item.isChecked;
19612
- });
19613
- console.log("DRAG: 排序之后实际展示的数据", {
19614
- sortList: sortList,
19615
- checkedItems: checkedItems,
19616
- unCheckedItems: unCheckedItems
19617
- });
19618
- setItems([].concat(checkedItems, unCheckedItems));
19619
- }, [sortList]);
19620
20070
  return jsxRuntime.jsx("div", {
19621
20071
  className: "sortDrag",
19622
20072
  children: items.map(function (item, index) {
@@ -19721,15 +20171,12 @@ var ACheckDrag = /*#__PURE__*/function (_Viewer) {
19721
20171
  };
19722
20172
 
19723
20173
  _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState, snapshot) {
19724
- var _this2 = this;
19725
-
19726
- setTimeout(function () {
19727
- console.log("DRAG: 组件更新", _this2.checkFields, _this2.state.data);
20174
+ setTimeout(function () {// console.log("DRAG: 组件更新", this.checkFields, this.state.data);
19728
20175
  }, 2000);
19729
20176
  };
19730
20177
 
19731
20178
  _proto.element = function element(ctx) {
19732
- var _this3 = this,
20179
+ var _this2 = this,
19733
20180
  _ref;
19734
20181
 
19735
20182
  var data = this.state.data;
@@ -19744,30 +20191,30 @@ var ACheckDrag = /*#__PURE__*/function (_Viewer) {
19744
20191
  var checkboxs = this.checkFields.map(function (m, index) {
19745
20192
  var _ctx$rootProps$schema;
19746
20193
 
19747
- var isShow = MUtil.isShow(_this3.props.database, (_ctx$rootProps$schema = ctx.rootProps.schema) == null ? void 0 : _ctx$rootProps$schema.objectFields, m.showIf);
20194
+ var isShow = MUtil.isShow(_this2.props.database, (_ctx$rootProps$schema = ctx.rootProps.schema) == null ? void 0 : _ctx$rootProps$schema.objectFields, m.showIf);
19748
20195
  if (!isShow) return null;
19749
20196
  var checkIndex = values == null ? void 0 : values.findIndex(function (e) {
19750
20197
  return e === m.value;
19751
20198
  });
19752
20199
 
19753
20200
  if (m.remark === "openOption") {
19754
- var _this3$props$schema$o;
20201
+ var _this2$props$schema$o;
19755
20202
 
19756
- var key = _this3._inputBoxValue;
20203
+ var key = _this2._inputBoxValue;
19757
20204
  var checked = values == null ? void 0 : values.findIndex(function (e) {
19758
20205
  return e === key;
19759
20206
  });
19760
20207
  return [jsxRuntime.jsxs(DIYCheckbox, {
19761
- disabled: _this3.props.disable,
20208
+ disabled: _this2.props.disable,
19762
20209
  checked: checked !== -1,
19763
20210
  checkedIcon: checked ? checked + 1 : 1,
19764
20211
  onChange: function onChange(e) {
19765
- var max = _this3.props.schema.max;
20212
+ var max = _this2.props.schema.max;
19766
20213
 
19767
20214
  if (max > 0 && e.target.checked) {
19768
20215
  var len = values ? values.length : 0; // 选择第 max + 1 项时,提示并组织
19769
20216
 
19770
- if (len >= _this3.props.schema.max) {
20217
+ if (len >= _this2.props.schema.max) {
19771
20218
  antd.Modal.info({
19772
20219
  title: "\u6B64\u9898\u6700\u591A\u53EA\u80FD\u9009\u62E9 " + max + " \u9879",
19773
20220
  okText: "确认",
@@ -19779,13 +20226,13 @@ var ACheckDrag = /*#__PURE__*/function (_Viewer) {
19779
20226
  }
19780
20227
  }
19781
20228
 
19782
- var currentCheckValue = MSetType.change(e.target.checked, key, values, _this3.props.schema, true);
19783
- console.log("当前选中的数据ccc", currentCheckValue);
19784
- _this3.dataRef = currentCheckValue;
20229
+ var currentCheckValue = MSetType.change(e.target.checked, key, values, _this2.props.schema, true); // console.log("当前选中的数据ccc", currentCheckValue);
20230
+
20231
+ _this2.dataRef = currentCheckValue;
19785
20232
  setTimeout(function () {
19786
- _Viewer.prototype.changeValue.call(_this3, currentCheckValue);
20233
+ _Viewer.prototype.changeValue.call(_this2, currentCheckValue);
19787
20234
 
19788
- _this3.setState({
20235
+ _this2.setState({
19789
20236
  data: currentCheckValue
19790
20237
  });
19791
20238
  }, 0);
@@ -19794,36 +20241,35 @@ var ACheckDrag = /*#__PURE__*/function (_Viewer) {
19794
20241
  style: {
19795
20242
  marginRight: "10px"
19796
20243
  },
19797
- children: (_this3$props$schema$o = _this3.props.schema.openOption.label) != null ? _this3$props$schema$o : "其他"
20244
+ children: (_this2$props$schema$o = _this2.props.schema.openOption.label) != null ? _this2$props$schema$o : "其他"
19798
20245
  }), jsxRuntime.jsx("span", {
19799
20246
  onBlurCapture: function onBlurCapture(e) {
19800
- console.log("输入框失去焦点", _this3.dataRef);
20247
+ // console.log("输入框失去焦点", this.dataRef);
19801
20248
  setTimeout(function () {
19802
- _Viewer.prototype.changeValue.call(_this3, _this3.dataRef);
20249
+ _Viewer.prototype.changeValue.call(_this2, _this2.dataRef);
19803
20250
 
19804
- _this3.setState({
19805
- data: _this3.dataRef
20251
+ _this2.setState({
20252
+ data: _this2.dataRef
19806
20253
  });
19807
20254
  }, 0);
19808
20255
  },
19809
20256
  children: jsxRuntime.jsx(MFieldViewer, {
19810
- morph: _this3.props.morph,
19811
- schema: _this3.props.schema.openOption,
19812
- database: _this3,
20257
+ morph: _this2.props.morph,
20258
+ schema: _this2.props.schema.openOption,
20259
+ database: _this2,
19813
20260
  path: "_inputBoxValue",
19814
20261
  afterChange: function afterChange(path, str, final) {
19815
- var matchEnum = _this3.checkFields.find(function (e) {
20262
+ var matchEnum = _this2.checkFields.find(function (e) {
19816
20263
  return e.value === str && e.remark !== "openOption";
19817
- });
20264
+ }); // console.log("输入框 afterChange", str, values, matchEnum);
19818
20265
 
19819
- console.log("输入框 afterChange", str, values, matchEnum);
19820
20266
 
19821
20267
  if (matchEnum) {
19822
20268
  // 不能让用户输入某个枚举值
19823
- _this3._inputBoxValue = "";
20269
+ _this2._inputBoxValue = "";
19824
20270
 
19825
20271
  ___default["default"].remove(values, function (e) {
19826
- return !_this3.checkValues.includes(e);
20272
+ return !_this2.checkValues.includes(e);
19827
20273
  });
19828
20274
 
19829
20275
  if (!values.includes(str)) {
@@ -19831,15 +20277,15 @@ var ACheckDrag = /*#__PURE__*/function (_Viewer) {
19831
20277
  }
19832
20278
 
19833
20279
  queueMicrotask(function () {
19834
- _Viewer.prototype.changeValueEx.call(_this3, values, true, final);
20280
+ _Viewer.prototype.changeValueEx.call(_this2, values, true, final);
19835
20281
 
19836
- _this3.setState({
20282
+ _this2.setState({
19837
20283
  data: values
19838
20284
  });
19839
20285
  });
19840
20286
  } else {
19841
20287
  var idx = values.findIndex(function (v) {
19842
- var index = _this3.checkFields.filter(function (e) {
20288
+ var index = _this2.checkFields.filter(function (e) {
19843
20289
  return e.remark !== "openOption";
19844
20290
  }).findIndex(function (e) {
19845
20291
  return e.value === v;
@@ -19849,24 +20295,24 @@ var ACheckDrag = /*#__PURE__*/function (_Viewer) {
19849
20295
  });
19850
20296
 
19851
20297
  if (!___default["default"].isNil(idx) || str === "") {
19852
- _this3._inputBoxValue = str;
20298
+ _this2._inputBoxValue = str;
19853
20299
  values[idx] = str;
19854
- _this3.dataRef = values;
19855
- _this3.checkFields = _this3.checkFields.map(function (e) {
20300
+ _this2.dataRef = values;
20301
+ _this2.checkFields = _this2.checkFields.map(function (e) {
19856
20302
  return e.remark === "openOption" ? _objectSpread$9(_objectSpread$9({}, e), {}, {
19857
20303
  value: str
19858
20304
  }) : e;
19859
- });
19860
- console.log("输入框数据", {
19861
- values: values,
19862
- checkFields: _this3.checkFields,
19863
- dataRef: _this3.dataRef
19864
- });
19865
- MUtil.set(_this3.props.database, _this3.props.path, values);
20305
+ }); // console.log("输入框数据", {
20306
+ // values,
20307
+ // checkFields: this.checkFields,
20308
+ // dataRef: this.dataRef,
20309
+ // });
20310
+
20311
+ MUtil.set(_this2.props.database, _this2.props.path, values);
19866
20312
  }
19867
20313
  }
19868
20314
  },
19869
- parent: _this3.props.schema,
20315
+ parent: _this2.props.schema,
19870
20316
  forceValid: false,
19871
20317
  disable: openIndex < 0,
19872
20318
  style: {
@@ -19874,22 +20320,22 @@ var ACheckDrag = /*#__PURE__*/function (_Viewer) {
19874
20320
  }
19875
20321
  })
19876
20322
  })]
19877
- }, "openOption"), _this3._createBr()];
20323
+ }, "openOption"), _this2._createBr()];
19878
20324
  }
19879
20325
 
19880
20326
  return [jsxRuntime.jsx(DIYCheckbox, {
19881
- disabled: _this3.props.disable,
20327
+ disabled: _this2.props.disable,
19882
20328
  checkedIcon: checkIndex === -1 ? 1 : checkIndex + 1,
19883
20329
  checked: ___default["default"].includes(values, m.value),
19884
20330
  onChange: function onChange(e) {
19885
- var currentCheckValue = MSetType.change(e.target.checked, m.value, values, _this3.props.schema, true);
19886
- console.log("当前变化的 value", values, currentCheckValue);
19887
- var max = _this3.props.schema.max;
20331
+ var currentCheckValue = MSetType.change(e.target.checked, m.value, values, _this2.props.schema, true); // console.log("当前变化的 value", values, currentCheckValue);
20332
+
20333
+ var max = _this2.props.schema.max;
19888
20334
 
19889
20335
  if (max > 0 && e.target.checked) {
19890
20336
  var len = values ? values.length : 0; // 选择第 max + 1 项时,提示并组织
19891
20337
 
19892
- if (len >= _this3.props.schema.max) {
20338
+ if (len >= _this2.props.schema.max) {
19893
20339
  antd.Modal.info({
19894
20340
  title: "\u6B64\u9898\u6700\u591A\u53EA\u80FD\u9009\u62E9 " + max + " \u9879",
19895
20341
  okText: "确认",
@@ -19901,22 +20347,22 @@ var ACheckDrag = /*#__PURE__*/function (_Viewer) {
19901
20347
  }
19902
20348
  }
19903
20349
 
19904
- _this3.dataRef = currentCheckValue;
20350
+ _this2.dataRef = currentCheckValue;
19905
20351
  queueMicrotask(function () {
19906
- _Viewer.prototype.changeValue.call(_this3, currentCheckValue);
20352
+ _Viewer.prototype.changeValue.call(_this2, currentCheckValue);
19907
20353
 
19908
- _this3.setState({
20354
+ _this2.setState({
19909
20355
  data: currentCheckValue
19910
20356
  });
19911
20357
  });
19912
20358
  },
19913
20359
  children: ACheckBoxLabel(m)
19914
- }, m.value), _this3._createBr()];
20360
+ }, m.value), _this2._createBr()];
19915
20361
  }); // 定义更换数据源的方法
19916
20362
 
19917
20363
  var changeOriginDataSource = function changeOriginDataSource(newData) {
19918
- console.log("新数据", newData); // 更新排序后的选项数据
19919
-
20364
+ // console.log("新数据", newData);
20365
+ // 更新排序后的选项数据
19920
20366
  var sortedCheckFields = newData.map(function (item) {
19921
20367
  return _objectSpread$9(_objectSpread$9({}, item), {}, {
19922
20368
  label: item.label,
@@ -19930,12 +20376,12 @@ var ACheckDrag = /*#__PURE__*/function (_Viewer) {
19930
20376
  return item.id;
19931
20377
  }); // 同时更新schema中的option顺序,以确保后续操作基于新的排序
19932
20378
 
19933
- var newSchema = _objectSpread$9({}, _this3.props.schema);
20379
+ var newSchema = _objectSpread$9({}, _this2.props.schema);
19934
20380
 
19935
20381
  var isHaveOpenOption = sortedCheckFields.filter(function (e) {
19936
20382
  return e.remark === "openOption";
19937
- });
19938
- console.log("isHaveOpenOption", isHaveOpenOption);
20383
+ }); // console.log("isHaveOpenOption", isHaveOpenOption);
20384
+
19939
20385
  newSchema.option = isHaveOpenOption ? sortedCheckFields == null ? void 0 : sortedCheckFields.filter(function (e) {
19940
20386
  return e.remark !== "openOption";
19941
20387
  }) : sortedCheckFields;
@@ -19946,55 +20392,282 @@ var ACheckDrag = /*#__PURE__*/function (_Viewer) {
19946
20392
  // newSchema,
19947
20393
  // });
19948
20394
 
19949
- _this3.checkFields = sortedCheckFields;
19950
- _this3.dataRef = sortedData;
20395
+ _this2.checkFields = sortedCheckFields;
20396
+ _this2.dataRef = sortedData;
19951
20397
  setTimeout(function () {
19952
- _this3.setState({
20398
+ _this2.setState({
19953
20399
  data: sortedData
19954
20400
  });
19955
20401
 
19956
- MUtil.set(_this3.props.database, _this3.props.path, sortedData);
20402
+ MUtil.set(_this2.props.database, _this2.props.path, sortedData);
19957
20403
  }, 0);
19958
20404
  };
19959
20405
 
20406
+ var sortList = (_ref = checkboxs != null ? checkboxs : []) == null ? void 0 : _ref.map(function (cpn, index) {
20407
+ var _this2$checkFields$in, _this2$checkFields$in2, _this2$dataRef, _this2$dataRef2, _this2$checkFields$in3, _this2$checkFields$in4;
20408
+
20409
+ var checkFieldsValue;
20410
+ checkFieldsValue = (_this2$checkFields$in = _this2.checkFields[index]) == null ? void 0 : _this2$checkFields$in.value;
20411
+ var isOpenOp = ((_this2$checkFields$in2 = _this2.checkFields[index]) == null ? void 0 : _this2$checkFields$in2.remark) === "openOption";
20412
+
20413
+ if (isOpenOp) {
20414
+ checkFieldsValue = _this2._inputBoxValue;
20415
+ } // console.log("DRAG: 实际传递进如 SortDrag的数据", {
20416
+ // data,
20417
+ // dataRef: this.dataRef,
20418
+ // checkFields: this.checkFields,
20419
+ // schema: this.props.database,
20420
+ // isOpenOp,
20421
+ // openValue: this._inputBoxValue,
20422
+ // });
20423
+
20424
+
20425
+ return {
20426
+ isChecked: _this2.dataRef ? ((_this2$dataRef = _this2.dataRef) == null ? void 0 : _this2$dataRef.findIndex(function (e) {
20427
+ return e === checkFieldsValue;
20428
+ })) !== -1 : false,
20429
+ checkedIndex: ((_this2$dataRef2 = _this2.dataRef) == null ? void 0 : _this2$dataRef2.findIndex(function (e) {
20430
+ return e === checkFieldsValue;
20431
+ })) + 1,
20432
+ cpn: cpn,
20433
+ id: "" + checkFieldsValue,
20434
+ label: (_this2$checkFields$in3 = _this2.checkFields[index]) == null ? void 0 : _this2$checkFields$in3.label,
20435
+ remark: (_this2$checkFields$in4 = _this2.checkFields[index]) == null ? void 0 : _this2$checkFields$in4.remark
20436
+ };
20437
+ });
20438
+ var finalSortList = sortList.filter(function (item) {
20439
+ return item.isChecked;
20440
+ }).sort(function (a, b) {
20441
+ return a.checkedIndex - b.checkedIndex;
20442
+ }).concat(sortList.filter(function (item) {
20443
+ return !item.isChecked;
20444
+ }));
19960
20445
  return jsxRuntime.jsx(SortDrag, {
19961
20446
  changeOriginDataSource: changeOriginDataSource,
19962
- sortList: (_ref = checkboxs != null ? checkboxs : []) == null ? void 0 : _ref.map(function (cpn, index) {
19963
- var _this3$checkFields$in, _this3$checkFields$in2, _this3$dataRef, _this3$dataRef2, _this3$checkFields$in3, _this3$checkFields$in4;
20447
+ sortList: finalSortList
20448
+ }, MUtil.unique());
20449
+ };
19964
20450
 
19965
- var checkFieldsValue;
19966
- checkFieldsValue = (_this3$checkFields$in = _this3.checkFields[index]) == null ? void 0 : _this3$checkFields$in.value;
19967
- var isOpenOp = ((_this3$checkFields$in2 = _this3.checkFields[index]) == null ? void 0 : _this3$checkFields$in2.remark) === "openOption";
20451
+ return ACheckDrag;
20452
+ }(Viewer);
19968
20453
 
19969
- if (isOpenOp) {
19970
- checkFieldsValue = _this3._inputBoxValue;
19971
- }
20454
+ var InputSlider = /*#__PURE__*/React.memo(function (props) {
20455
+ var _marks;
19972
20456
 
19973
- console.log("DRAG: 实际传递进如 SortDrag的数据", {
19974
- data: data,
19975
- dataRef: _this3.dataRef,
19976
- checkFields: _this3.checkFields,
19977
- schema: _this3.props.database,
19978
- isOpenOp: isOpenOp,
19979
- openValue: _this3._inputBoxValue
19980
- });
19981
- return {
19982
- isChecked: _this3.dataRef ? ((_this3$dataRef = _this3.dataRef) == null ? void 0 : _this3$dataRef.findIndex(function (e) {
19983
- return e === checkFieldsValue;
19984
- })) !== -1 : false,
19985
- checkedIndex: ((_this3$dataRef2 = _this3.dataRef) == null ? void 0 : _this3$dataRef2.findIndex(function (e) {
19986
- return e === checkFieldsValue;
19987
- })) + 1,
19988
- cpn: cpn,
19989
- id: "" + checkFieldsValue,
19990
- label: (_this3$checkFields$in3 = _this3.checkFields[index]) == null ? void 0 : _this3$checkFields$in3.label,
19991
- remark: (_this3$checkFields$in4 = _this3.checkFields[index]) == null ? void 0 : _this3$checkFields$in4.remark
19992
- };
20457
+ var value = props.value,
20458
+ min = props.min,
20459
+ max = props.max,
20460
+ onCpnChange = props.onChange,
20461
+ onAfterChange = props.onAfterChange;
20462
+
20463
+ var _onChange = function onChange(newValue, isInputChange) {
20464
+ onCpnChange(newValue, isInputChange);
20465
+ };
20466
+
20467
+ return jsxRuntime.jsxs(antd.Row, {
20468
+ gutter: [12, 12],
20469
+ children: [jsxRuntime.jsx(antd.Col, {
20470
+ span: 4,
20471
+ children: jsxRuntime.jsx(antd.InputNumber, {
20472
+ precision: 0,
20473
+ style: {
20474
+ width: "100%"
20475
+ },
20476
+ min: min,
20477
+ max: max,
20478
+ value: value,
20479
+ onChange: function onChange(v) {
20480
+ return _onChange(v, true);
20481
+ },
20482
+ onBlur: onAfterChange
20483
+ })
20484
+ }), jsxRuntime.jsx(antd.Col, {
20485
+ span: 20,
20486
+ children: jsxRuntime.jsx(antd.Slider, {
20487
+ min: min,
20488
+ max: max,
20489
+ marks: (_marks = {}, _marks[min] = min, _marks[max] = max, _marks),
20490
+ onChange: _onChange,
20491
+ onAfterChange: onAfterChange,
20492
+ value: typeof value === "number" ? value : 0
19993
20493
  })
20494
+ })]
20495
+ });
20496
+ });
20497
+ var AWeight = /*#__PURE__*/function (_Viewer) {
20498
+ _inheritsLoose__default["default"](AWeight, _Viewer);
20499
+
20500
+ function AWeight(props) {
20501
+ var _Viewer$prototype$get, _Viewer$prototype$get2;
20502
+
20503
+ var _this;
20504
+
20505
+ console.log("AWeight props", props);
20506
+ _this = _Viewer.call(this, props) || this;
20507
+ _this.allSliderValuesChanged = []; // 添加防抖定时器
20508
+
20509
+ _this.debounceTimer = null;
20510
+ _this.lastUpdateTime = 0;
20511
+ _this.THROTTLE_DELAY = 16; // 约 60fps
20512
+
20513
+ _this.totalWeight = 0;
20514
+ _this.allValues = [];
20515
+ var schema = props.schema;
20516
+ _this._enumFields = MUtil.option(_this.props.schema);
20517
+ console.log("this._enumFields", _this._enumFields);
20518
+ _this.totalWeight = schema.weight;
20519
+ _this.allValues = (_Viewer$prototype$get = (_Viewer$prototype$get2 = _Viewer.prototype.getValue.call(_assertThisInitialized__default["default"](_this))) == null ? void 0 : _Viewer$prototype$get2.map(function (i) {
20520
+ return i.value;
20521
+ })) != null ? _Viewer$prototype$get : new Array(_this._enumFields.length).fill(0);
20522
+ _this.state = {
20523
+ allSliderValues: _this.allValues,
20524
+ ctrlVersion: 1
20525
+ };
20526
+ return _this;
20527
+ }
20528
+
20529
+ var _proto = AWeight.prototype;
20530
+
20531
+ _proto.componentDidMount = function componentDidMount() {
20532
+ console.log("滑动组件初始化"); // const { cpnData } = this.state;
20533
+ // const allSliderValues = Object.values(cpnData);
20534
+ // this.setState({ allSliderValues });
20535
+ };
20536
+
20537
+ _proto.componentDidUpdate = function componentDidUpdate(pre, cur) {// console.log("当前数据88", super.getValue());
20538
+ } // 更新关联的滑动条
20539
+ ;
20540
+
20541
+ _proto.updateLinkedSliders = function updateLinkedSliders(numbers, currentIndex, isAfterChange) {
20542
+ var _this2 = this;
20543
+
20544
+ var newNumbers = [].concat(numbers);
20545
+ var targetIndex = numbers.length - 1;
20546
+ var isSelectNumber = this.allSliderValuesChanged.slice(0, targetIndex).every(function (changed) {
20547
+ return changed;
19994
20548
  });
20549
+ var totalData = numbers.reduce(function (total, current, index) {
20550
+ if (index !== targetIndex) {
20551
+ total += current;
20552
+ }
20553
+
20554
+ return total;
20555
+ }, 0);
20556
+
20557
+ if (targetIndex !== -1 && currentIndex !== targetIndex && isSelectNumber) {
20558
+ var finalValue = this.totalWeight - totalData;
20559
+ console.log("totalData", totalData, finalValue);
20560
+
20561
+ if (finalValue >= 0 && finalValue <= this.totalWeight) {
20562
+ // 使用插值算法平滑过渡
20563
+ var currentValue = numbers[targetIndex];
20564
+ var smoothedValue = isAfterChange ? finalValue : Math.floor(this.smoothValue(currentValue, finalValue, 0.3)); // 0.3 是平滑系数
20565
+
20566
+ newNumbers[targetIndex] = smoothedValue;
20567
+ this.setState({
20568
+ allSliderValues: newNumbers
20569
+ });
20570
+ } else {
20571
+ newNumbers[targetIndex] = 0;
20572
+ this.setState({
20573
+ allSliderValues: newNumbers
20574
+ });
20575
+ }
20576
+ } else {
20577
+ // 如果不联动更新的情况下,那么就直接更新滑动条
20578
+ this.setState({
20579
+ allSliderValues: newNumbers
20580
+ });
20581
+ }
20582
+
20583
+ this.allSliderValuesChanged[currentIndex] = true;
20584
+
20585
+ _Viewer.prototype.changeValue.call(this, newNumbers.map(function (n, index) {
20586
+ return {
20587
+ label: _this2._enumFields[index].value,
20588
+ value: n
20589
+ };
20590
+ }));
20591
+
20592
+ console.log("更改后的 weight database", _Viewer.prototype.getValue.call(this));
20593
+ } // 平滑插值算法
20594
+ ;
20595
+
20596
+ _proto.smoothValue = function smoothValue(current, target, factor) {
20597
+ return current + (target - current) * factor;
19995
20598
  };
19996
20599
 
19997
- return ACheckDrag;
20600
+ _proto.element = function element() {
20601
+ var _this3 = this;
20602
+
20603
+ var hasAssignWeight = this.state.allSliderValues.reduce(function (total, current) {
20604
+ return total + current;
20605
+ }, 0);
20606
+ return jsxRuntime.jsxs("div", {
20607
+ style: {
20608
+ padding: 16
20609
+ },
20610
+ children: [this._enumFields.map(function (option, index) {
20611
+ return jsxRuntime.jsxs("div", {
20612
+ children: [jsxRuntime.jsx("div", {
20613
+ style: {
20614
+ marginBottom: 8,
20615
+ fontWeight: "bold"
20616
+ },
20617
+ children: option.label
20618
+ }), jsxRuntime.jsx(InputSlider, {
20619
+ onChange: function onChange(value, isInputChange) {
20620
+ var numbers = [].concat(_this3.state.allSliderValues);
20621
+ numbers[index] = value;
20622
+
20623
+ _Viewer.prototype.changeValue.call(_this3, numbers.map(function (n, index) {
20624
+ return {
20625
+ label: _this3._enumFields[index].value,
20626
+ value: n
20627
+ };
20628
+ })); // 使用节流控制联动更新频率
20629
+
20630
+
20631
+ var now = Date.now();
20632
+
20633
+ if (now - _this3.lastUpdateTime >= _this3.THROTTLE_DELAY) {
20634
+ _this3.updateLinkedSliders(numbers, index, isInputChange);
20635
+
20636
+ _this3.lastUpdateTime = now;
20637
+ } else {
20638
+ // 使用防抖确保最后一次更新被执行
20639
+ if (_this3.debounceTimer) {
20640
+ clearTimeout(_this3.debounceTimer);
20641
+ }
20642
+
20643
+ _this3.debounceTimer = setTimeout(function () {
20644
+ _this3.updateLinkedSliders(numbers, index, isInputChange);
20645
+
20646
+ _this3.lastUpdateTime = Date.now();
20647
+ }, _this3.THROTTLE_DELAY);
20648
+ }
20649
+ },
20650
+ value: _this3.state.allSliderValues[index],
20651
+ onAfterChange: function onAfterChange(value) {
20652
+ // 结束更新后,再重设一遍数据,确保数据的准确性
20653
+ _this3.updateLinkedSliders(_this3.state.allSliderValues, index, true);
20654
+ },
20655
+ max: _this3.totalWeight,
20656
+ min: 0
20657
+ })]
20658
+ }, option.value);
20659
+ }), this.totalWeight > 0 && this._enumFields.length > 0 ? jsxRuntime.jsxs("div", {
20660
+ children: ["\u63D0\u793A\uFF1A\u603B\u6BD4\u91CD\u5FC5\u987B\u4E3A", this.totalWeight, "\uFF0C\u5DF2\u5206\u914D\u6BD4\u91CD\uFF1A", jsxRuntime.jsxs("span", {
20661
+ style: {
20662
+ color: hasAssignWeight > this.totalWeight ? "red" : "#000"
20663
+ },
20664
+ children: [hasAssignWeight, hasAssignWeight > this.totalWeight ? "\uFF0C\u8BF7\u4FEE\u6539" : ""]
20665
+ })]
20666
+ }) : null]
20667
+ });
20668
+ };
20669
+
20670
+ return AWeight;
19998
20671
  }(Viewer);
19999
20672
 
20000
20673
  function ownKeys$8(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -20917,6 +21590,117 @@ var MKvSetType = ___default["default"].assign({}, EmtpyType, {
20917
21590
  }
20918
21591
  });
20919
21592
 
21593
+ function _createForOfIteratorHelperLoose$1(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
21594
+
21595
+ function _unsupportedIterableToArray$1(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$1(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen); }
21596
+
21597
+ function _arrayLikeToArray$1(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
21598
+
21599
+ function validateWeightValue(a, schema, value, path) {
21600
+
21601
+ if (___default["default"].isNil(value)) {
21602
+ return undefined;
21603
+ }
21604
+
21605
+ if (!___default["default"].isObject(value)) {
21606
+ return {
21607
+ message: "比重值格式错误",
21608
+ path: path
21609
+ };
21610
+ }
21611
+
21612
+ MUtil.option(schema);
21613
+
21614
+ var currentTotal = 0; // 计算当前已分配比重
21615
+
21616
+ if (Array.isArray(value)) {
21617
+ currentTotal = value == null ? void 0 : value.reduce == null ? void 0 : value.reduce(function (acc, val) {
21618
+ return acc + val.value;
21619
+ }, 0);
21620
+ } // 比重题的校验文案都是固定显示在表单上,所以返回的 message 都是空的
21621
+ // 验证总比重是否小于目标值
21622
+
21623
+
21624
+ if (schema.weight && currentTotal < schema.weight && currentTotal !== 0) {
21625
+ return {
21626
+ message: "\u5DF2\u5206\u914D\u6BD4\u91CD\u4E0D\u5F97\u5C0F\u4E8E\u603B\u6BD4\u91CD",
21627
+ path: path
21628
+ };
21629
+ } // 验证总比重是否超过最大值
21630
+
21631
+
21632
+ if (schema.weight !== undefined && currentTotal > schema.weight) {
21633
+ return {
21634
+ message: "",
21635
+ path: path
21636
+ };
21637
+ }
21638
+
21639
+ console.log("验证参数", value, currentTotal, schema.weight);
21640
+ return undefined;
21641
+ }
21642
+
21643
+ var MWeightType = {
21644
+ validators: [validateRequired$1, validateWeightValue],
21645
+ toReadable: function toReadable(assembly, s, vs) {
21646
+ var fs = MUtil.option(s);
21647
+
21648
+ if (___default["default"].isNil(vs)) {
21649
+ return assembly.theme.READABLE_BLANK;
21650
+ } else if (!___default["default"].isObject(vs)) {
21651
+ return assembly.theme.READABLE_ERROR;
21652
+ }
21653
+
21654
+ var parts = [];
21655
+
21656
+ for (var _iterator = _createForOfIteratorHelperLoose$1(fs), _step; !(_step = _iterator()).done;) {
21657
+ var f = _step.value;
21658
+ var weight = vs[f.value];
21659
+
21660
+ if (!___default["default"].isNil(weight) && weight !== 0) {
21661
+ parts.push(f.label + ": " + weight);
21662
+ }
21663
+ }
21664
+
21665
+ return parts.length > 0 ? parts.join(", ") : assembly.theme.READABLE_BLANK;
21666
+ },
21667
+ standardValue: function standardValue(a, s, vs, strict) {
21668
+ if (!___default["default"].isObject(vs)) {
21669
+ return s.defaultValue;
21670
+ }
21671
+
21672
+ if (!strict) {
21673
+ return vs;
21674
+ }
21675
+
21676
+ var fs = MUtil.option(s);
21677
+ var result = {};
21678
+
21679
+ for (var _iterator2 = _createForOfIteratorHelperLoose$1(fs), _step2; !(_step2 = _iterator2()).done;) {
21680
+ var f = _step2.value;
21681
+ var weight = vs[f.value];
21682
+
21683
+ if (!___default["default"].isNil(weight) && ___default["default"].isNumber(weight) && weight >= 0) {
21684
+ // 如果要求整数,则转换为整数
21685
+ if (s.requireInteger) {
21686
+ result[f.value] = Math.round(weight);
21687
+ } else {
21688
+ result[f.value] = weight;
21689
+ }
21690
+ }
21691
+ }
21692
+
21693
+ return result;
21694
+ },
21695
+ createDefaultValue: function createDefaultValue(assembly, s) {
21696
+ if (s.defaultValue) {
21697
+ return ___default["default"].clone(s.defaultValue);
21698
+ } else {
21699
+ return {}; // 默认为空对象
21700
+ }
21701
+ }
21702
+ };
21703
+
20920
21704
  var defaultBoxSchema = {
20921
21705
  type: "string",
20922
21706
  name: ""
@@ -21747,6 +22531,7 @@ function ensureM3() {
21747
22531
  yearMonth: MDateTimeType,
21748
22532
  yearMonthDay: MDateTimeType,
21749
22533
  set: MSetType,
22534
+ weight: MWeightType,
21750
22535
  array: MArrayType,
21751
22536
  string: MStringType,
21752
22537
  intDiff: MIntDiffType,
@@ -21798,7 +22583,8 @@ function ensureM3() {
21798
22583
  A: A,
21799
22584
  ADialogForm: ADialogForm,
21800
22585
  AKvSet: AKvSet,
21801
- ACascadePicker: ACascadePicker
22586
+ ACascadePicker: ACascadePicker,
22587
+ AWeight: AWeight
21802
22588
  });
21803
22589
  assembly.morph = ___default["default"].merge(assembly.morph, {
21804
22590
  // 编辑
@@ -21966,10 +22752,12 @@ var MViewer = /*#__PURE__*/function (_React$Component) {
21966
22752
  var _this;
21967
22753
 
21968
22754
  _this = _React$Component.call(this, p) || this;
22755
+ _this.database = {};
21969
22756
  _this.state = {
21970
22757
  forceValid: false,
21971
22758
  ctrlVersion: 1
21972
22759
  };
22760
+ console.log("执行 constructor");
21973
22761
  ensureM3();
21974
22762
  var props = _this.props; // 值类型兼容预处理
21975
22763
 
@@ -21980,10 +22768,32 @@ var MViewer = /*#__PURE__*/function (_React$Component) {
21980
22768
  _this.recover();
21981
22769
 
21982
22770
  return _this;
21983
- }
22771
+ } // ⚠️ 新增:监听 props 变化
22772
+
21984
22773
 
21985
22774
  var _proto = MViewer.prototype;
21986
22775
 
22776
+ _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
22777
+ console.log("MViewer: componentDidUpdate"); // 检查 schema 是否变化
22778
+
22779
+ if (!___default["default"].isEqual(prevProps.schema, this.props.schema)) {
22780
+ var _assembly$types$this$;
22781
+
22782
+ console.log("MViewer: schema changed", {
22783
+ prevSchema: prevProps.schema,
22784
+ nextSchema: this.props.schema
22785
+ }); // 重新初始化 database
22786
+
22787
+ this.database = (_assembly$types$this$ = assembly.types[this.props.schema.type]) == null ? void 0 : _assembly$types$this$.standardValue(assembly, this.props.schema, this.props.database, false); // 填入默认值
22788
+
22789
+ MUtil.applyDefaultValue(this.props.schema, this.props.database, ""); // 触发重新渲染
22790
+
22791
+ this.setState({
22792
+ ctrlVersion: this.state.ctrlVersion + 1
22793
+ });
22794
+ }
22795
+ };
22796
+
21987
22797
  _proto.recover = function recover() {
21988
22798
  var _this2 = this;
21989
22799
 
@@ -22006,7 +22816,9 @@ var MViewer = /*#__PURE__*/function (_React$Component) {
22006
22816
  forceValid = _this$state.forceValid;
22007
22817
  return jsxRuntime.jsx(MContext.Provider, {
22008
22818
  value: {
22009
- rootProps: props,
22819
+ rootProps: _objectSpread$2(_objectSpread$2({}, props), {}, {
22820
+ database: database
22821
+ }),
22010
22822
  forceValid: forceValid,
22011
22823
  setForceValid: function setForceValid(b) {
22012
22824
  _this3.setState({
@@ -22075,11 +22887,7 @@ function SubmitBar(props) {
22075
22887
  return;
22076
22888
  }
22077
22889
 
22078
- var r = assembly.validate(ctx.rootProps.schema, ctx.rootProps.database); // console.log("当前数据格式", {
22079
- // schema: ctx.rootProps.schema,
22080
- // database: ctx.rootProps.database,
22081
- // });
22082
-
22890
+ var r = assembly.validate(ctx.rootProps.schema, ctx.rootProps.database);
22083
22891
  var submit = (_props$onSubmit = props.onSubmit) != null ? _props$onSubmit : ctx.rootProps.onSubmit;
22084
22892
  ctx.setForceValid(true);
22085
22893
 
@@ -22421,17 +23229,19 @@ var M3 = function M3(props) {
22421
23229
  React.useEffect(function () {
22422
23230
  changeDatabase(props.database);
22423
23231
  }, [props.database]);
22424
- return debug ? jsxRuntime.jsx(MViewerDebug, _objectSpread(_objectSpread({}, props), {}, {
23232
+ return debug ? jsxRuntime.jsx(MViewerDebug // key={k}
23233
+ , _objectSpread(_objectSpread({}, props), {}, {
22425
23234
  database: database,
22426
23235
  schema: schema,
22427
23236
  changeSchema: changeSchema,
22428
23237
  changeDatabase: changeDatabase
22429
- }), k) : jsxRuntime.jsx(MViewer, _objectSpread(_objectSpread({}, props), {}, {
23238
+ })) : jsxRuntime.jsx(MViewer // key={k}
23239
+ , _objectSpread(_objectSpread({}, props), {}, {
22430
23240
  database: database,
22431
23241
  schema: schema,
22432
23242
  changeSchema: changeSchema,
22433
23243
  changeDatabase: changeDatabase
22434
- }), k);
23244
+ }));
22435
23245
  };
22436
23246
  function useForm() {
22437
23247
  return {