@byteluck-fe/model-driven-upgrade 2.7.0-beta.1 → 2.7.0-beta.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.
@@ -60,12 +60,11 @@ import { loop, toNumberOrEmpty, isLanguageObject, camelizeKeys, decamelizeKeys,
60
60
  import { DataSourceBind } from "@byteluck-fe/model-driven-core";
61
61
  import { Col, SubTableColumn, ListView, DataView } from "@byteluck-fe/model-driven-controls";
62
62
  var dataCleaner = function(schemaItems, payload) {
63
- var _payload;
64
63
  var isArray = Array.isArray(schemaItems);
65
64
  var schemaArray = isArray ? schemaItems : [
66
65
  schemaItems
67
66
  ];
68
- conversionPageEvents((_payload = payload) === null || _payload === void 0 ? void 0 : _payload.events);
67
+ conversionPageEvents(payload === null || payload === void 0 ? void 0 : payload.events);
69
68
  conversionGroupPanel(schemaArray);
70
69
  conversionLayoutControl(schemaArray);
71
70
  var dataView = conversionDataViewPage(schemaArray);
@@ -92,7 +91,7 @@ var searchViewControlKeys = [
92
91
  "simple-search"
93
92
  ];
94
93
  function conversion(item, payload) {
95
- var _item_props, _item, _item_props1, _item1, _item_props2, _item2, _payload;
94
+ var _item_props, _item_props1, _item_props2;
96
95
  var new_item = item;
97
96
  if (!new_item.controlType) {
98
97
  if (new_item.is_layout_control === true) {
@@ -123,13 +122,13 @@ function conversion(item, payload) {
123
122
  item.props.defaultValue = item.props.value;
124
123
  }
125
124
  //caption/placeholder/placeholder_end 的 zh 属性将被保留,国际化资源都丢弃,放到外部
126
- if (isLanguageObject((_item = item) === null || _item === void 0 ? void 0 : (_item_props = _item.props) === null || _item_props === void 0 ? void 0 : _item_props.caption)) {
125
+ if (isLanguageObject(item === null || item === void 0 ? void 0 : (_item_props = item.props) === null || _item_props === void 0 ? void 0 : _item_props.caption)) {
127
126
  new_item.props.caption = item.props.caption.zh;
128
127
  }
129
- if (isLanguageObject((_item1 = item) === null || _item1 === void 0 ? void 0 : (_item_props1 = _item1.props) === null || _item_props1 === void 0 ? void 0 : _item_props1.placeholder)) {
128
+ if (isLanguageObject(item === null || item === void 0 ? void 0 : (_item_props1 = item.props) === null || _item_props1 === void 0 ? void 0 : _item_props1.placeholder)) {
130
129
  new_item.props.placeholder = item.props.placeholder.zh;
131
130
  }
132
- if (isLanguageObject((_item2 = item) === null || _item2 === void 0 ? void 0 : (_item_props2 = _item2.props) === null || _item_props2 === void 0 ? void 0 : _item_props2.placeholder_end)) {
131
+ if (isLanguageObject(item === null || item === void 0 ? void 0 : (_item_props2 = item.props) === null || _item_props2 === void 0 ? void 0 : _item_props2.placeholder_end)) {
133
132
  new_item.props.placeholder_end = item.props.placeholder_end.zh;
134
133
  }
135
134
  // 部门组件
@@ -261,9 +260,8 @@ function conversion(item, payload) {
261
260
  new_item.type = "tab-pane";
262
261
  }
263
262
  if (item.type === "calc") {
264
- var _new_item, _new_item1;
265
- var calcValue = (_new_item = new_item) === null || _new_item === void 0 ? void 0 : _new_item.children[0];
266
- var calcUnit = (_new_item1 = new_item) === null || _new_item1 === void 0 ? void 0 : _new_item1.children[1];
263
+ var calcValue = new_item === null || new_item === void 0 ? void 0 : new_item.children[0];
264
+ var calcUnit = new_item === null || new_item === void 0 ? void 0 : new_item.children[1];
267
265
  var newDataBind = {};
268
266
  if (calcValue) {
269
267
  conversionDisplayBoListAndBehaviors(new_item, payload);
@@ -286,11 +284,10 @@ function conversion(item, payload) {
286
284
  delete new_item.children;
287
285
  }
288
286
  if (item.type === "amount-currency") {
289
- var _new_item2, _new_item3;
290
287
  new_item.type = "amount";
291
288
  new_item.controlType = "form";
292
- var amount = (_new_item2 = new_item) === null || _new_item2 === void 0 ? void 0 : _new_item2.children[0];
293
- var currency = (_new_item3 = new_item) === null || _new_item3 === void 0 ? void 0 : _new_item3.children[1];
289
+ var amount = new_item === null || new_item === void 0 ? void 0 : new_item.children[0];
290
+ var currency = new_item === null || new_item === void 0 ? void 0 : new_item.children[1];
294
291
  var newDataBind1 = {};
295
292
  var defaultValue = {};
296
293
  // new_item.
@@ -324,10 +321,9 @@ function conversion(item, payload) {
324
321
  delete new_item.children;
325
322
  }
326
323
  if (item.type === "date-range") {
327
- var _new_item4, _new_item5;
328
324
  new_item.controlType = "form";
329
- var min = (_new_item4 = new_item) === null || _new_item4 === void 0 ? void 0 : _new_item4.children[0];
330
- var max = (_new_item5 = new_item) === null || _new_item5 === void 0 ? void 0 : _new_item5.children[1];
325
+ var min = new_item === null || new_item === void 0 ? void 0 : new_item.children[0];
326
+ var max = new_item === null || new_item === void 0 ? void 0 : new_item.children[1];
331
327
  new_item.props.placeholderStart = isLanguageObject(item.props.placeholder) ? item.props.placeholder.zh : item.props.placeholder;
332
328
  new_item.props.caption = isLanguageObject(item.props.caption) ? item.props.caption.zh : item.props.caption;
333
329
  var newDataBind2 = {};
@@ -362,7 +358,7 @@ function conversion(item, payload) {
362
358
  new_item.props.buttonType = "default";
363
359
  }
364
360
  }
365
- conversionControlEvents(new_item, (_payload = payload) === null || _payload === void 0 ? void 0 : _payload.control_events);
361
+ conversionControlEvents(new_item, payload === null || payload === void 0 ? void 0 : payload.control_events);
366
362
  return new_item;
367
363
  }
368
364
  function conversionDisplayBoListAndBehaviors(control, payload) {
@@ -437,7 +433,7 @@ function conversionLayoutControl(schemArray) {
437
433
  });
438
434
  }
439
435
  function conversionListPage(controlArray, payload) {
440
- var _listPageProps_source_config, _listPageProps, _listPageProps_source_config1, _listPageProps1, _payload, _listPageProps_source_config2, _listPageProps2, _listPageProps_source_config3, _listPageProps3, _listPageProps_sublist_page, _listPageProps4;
436
+ var _listPageProps_source_config, _listPageProps_source_config1, _listPageProps_source_config2, _listPageProps_source_config3, _listPageProps_sublist_page;
441
437
  if (!(Array.isArray(controlArray) && controlArray.length === 1)) {
442
438
  return controlArray;
443
439
  }
@@ -449,7 +445,7 @@ function conversionListPage(controlArray, payload) {
449
445
  var listPageProps = listPage.props, children = listPage.children;
450
446
  var _children = _sliced_to_array(children, 3), search = _children[0], toolbox = _children[1], table = _children[2];
451
447
  conversionSearch(search);
452
- table.props.is_fixed_header = (_listPageProps = listPageProps) === null || _listPageProps === void 0 ? void 0 : (_listPageProps_source_config = _listPageProps.source_config) === null || _listPageProps_source_config === void 0 ? void 0 : _listPageProps_source_config.is_fixed_header;
448
+ table.props.is_fixed_header = listPageProps === null || listPageProps === void 0 ? void 0 : (_listPageProps_source_config = listPageProps.source_config) === null || _listPageProps_source_config === void 0 ? void 0 : _listPageProps_source_config.is_fixed_header;
453
449
  // table.props.datasource_bind = new DataSourceBind({
454
450
  // dataCode: listPageProps?.source_config?data_code,
455
451
  // svcCode: listPageProps?.source_config?svc_code,
@@ -457,11 +453,11 @@ function conversionListPage(controlArray, payload) {
457
453
  // })
458
454
  conversionGridTable(table, toolbox);
459
455
  var _listPageProps_source_config_data_code;
460
- var dataCode = (_listPageProps_source_config_data_code = (_listPageProps1 = listPageProps) === null || _listPageProps1 === void 0 ? void 0 : (_listPageProps_source_config1 = _listPageProps1.source_config) === null || _listPageProps_source_config1 === void 0 ? void 0 : _listPageProps_source_config1.data_code) !== null && _listPageProps_source_config_data_code !== void 0 ? _listPageProps_source_config_data_code : (_payload = payload) === null || _payload === void 0 ? void 0 : _payload.dataCode;
456
+ var dataCode = (_listPageProps_source_config_data_code = listPageProps === null || listPageProps === void 0 ? void 0 : (_listPageProps_source_config1 = listPageProps.source_config) === null || _listPageProps_source_config1 === void 0 ? void 0 : _listPageProps_source_config1.data_code) !== null && _listPageProps_source_config_data_code !== void 0 ? _listPageProps_source_config_data_code : payload === null || payload === void 0 ? void 0 : payload.dataCode;
461
457
  var _listPageProps_source_config_svc_code;
462
- var svcCode = ((_listPageProps_source_config_svc_code = (_listPageProps2 = listPageProps) === null || _listPageProps2 === void 0 ? void 0 : (_listPageProps_source_config2 = _listPageProps2.source_config) === null || _listPageProps_source_config2 === void 0 ? void 0 : _listPageProps_source_config2.svc_code) !== null && _listPageProps_source_config_svc_code !== void 0 ? _listPageProps_source_config_svc_code : dataCode) ? "".concat(dataCode, "_selectMore") : undefined;
458
+ var svcCode = ((_listPageProps_source_config_svc_code = listPageProps === null || listPageProps === void 0 ? void 0 : (_listPageProps_source_config2 = listPageProps.source_config) === null || _listPageProps_source_config2 === void 0 ? void 0 : _listPageProps_source_config2.svc_code) !== null && _listPageProps_source_config_svc_code !== void 0 ? _listPageProps_source_config_svc_code : dataCode) ? "".concat(dataCode, "_selectMore") : undefined;
463
459
  var _listPageProps_source_config_orders;
464
- var orders = (_listPageProps_source_config_orders = (_listPageProps3 = listPageProps) === null || _listPageProps3 === void 0 ? void 0 : (_listPageProps_source_config3 = _listPageProps3.source_config) === null || _listPageProps_source_config3 === void 0 ? void 0 : _listPageProps_source_config3.orders) !== null && _listPageProps_source_config_orders !== void 0 ? _listPageProps_source_config_orders : [];
460
+ var orders = (_listPageProps_source_config_orders = listPageProps === null || listPageProps === void 0 ? void 0 : (_listPageProps_source_config3 = listPageProps.source_config) === null || _listPageProps_source_config3 === void 0 ? void 0 : _listPageProps_source_config3.orders) !== null && _listPageProps_source_config_orders !== void 0 ? _listPageProps_source_config_orders : [];
465
461
  var listView = new ListView.Designer();
466
462
  listView.props.datasourceBind = new DataSourceBind({
467
463
  dataCode: dataCode,
@@ -471,7 +467,7 @@ function conversionListPage(controlArray, payload) {
471
467
  listView.props.isShowSubList = listPageProps.is_show_sublist;
472
468
  listView.props.triggerType = listPageProps.timing_type;
473
469
  listView.props.triggerFieldCode = listPageProps.ctrl_field_code;
474
- (_listPageProps4 = listPageProps) === null || _listPageProps4 === void 0 ? void 0 : (_listPageProps_sublist_page = _listPageProps4.sublist_page) === null || _listPageProps_sublist_page === void 0 ? void 0 : _listPageProps_sublist_page.sublists.forEach(function(item) {
470
+ listPageProps === null || listPageProps === void 0 ? void 0 : (_listPageProps_sublist_page = listPageProps.sublist_page) === null || _listPageProps_sublist_page === void 0 ? void 0 : _listPageProps_sublist_page.sublists.forEach(function(item) {
475
471
  item.title = isLanguageObject(item.title) ? item.title.zh : item.title;
476
472
  });
477
473
  listView.props.sublistPage = listPageProps.sublist_page;
@@ -26,7 +26,7 @@ function conversion(schema, payload) {
26
26
  if (schema.type === CONTROL_TYPE.GRID_TABLE) {
27
27
  schema.props.headers.map(function(item) {
28
28
  if (item.type === CONTROL_TYPE.OPERATION_COLUMN) {
29
- var _item, _item_props, _item_props1, _item_props2;
29
+ var _item_props, _item_props1, _item_props2;
30
30
  if (item.props.width_type === "auto") {
31
31
  item.props.auto_width = {
32
32
  min_width: 120,
@@ -42,7 +42,7 @@ function conversion(schema, payload) {
42
42
  }
43
43
  item.props.width_type = "auto";
44
44
  var _item_children;
45
- item.children = (_item_children = (_item = item) === null || _item === void 0 ? void 0 : _item.children) !== null && _item_children !== void 0 ? _item_children : [];
45
+ item.children = (_item_children = item === null || item === void 0 ? void 0 : item.children) !== null && _item_children !== void 0 ? _item_children : [];
46
46
  delete item.props.custom;
47
47
  if (((_item_props = item.props) === null || _item_props === void 0 ? void 0 : _item_props.check) !== undefined) {
48
48
  var _item_props3, _item_props4, _item_props5, _item_props6, _item_props7, _item_props8;