@byteluck-fe/model-driven-engine 2.22.1-beta.7 → 2.22.1-beta.9

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.
@@ -602,12 +602,18 @@ var Engine = /*#__PURE__*/ function(Watcher) {
602
602
  var subtableData = this.getState(subtable.id);
603
603
  this._handlerSubtableUpdateUid(subtableData);
604
604
  this.runtime.getFlatInstances();
605
+ var rowIndexs = createdNewRows.map(function(item) {
606
+ var _item_children_, _item_children;
607
+ var subControl = item === null || item === void 0 ? void 0 : (_item_children = item.children) === null || _item_children === void 0 ? void 0 : (_item_children_ = _item_children[0]) === null || _item_children_ === void 0 ? void 0 : _item_children_.children[0];
608
+ return _this.getInstanceRowIndex(subControl);
609
+ });
605
610
  this.emit('list-change', {
606
611
  instance: subtable,
607
612
  value: subtableData,
608
613
  options: Object.assign({}, options, {
609
614
  changed: createdNewRows,
610
615
  data: createdNewRowsData,
616
+ rowIndexs: rowIndexs,
611
617
  deleted: deleted !== null && deleted !== void 0 ? deleted : [],
612
618
  jsonValue: JSON.stringify(subtableData),
613
619
  isDeleteLastOne: isDeleteLastOne,
@@ -635,6 +641,7 @@ var Engine = /*#__PURE__*/ function(Watcher) {
635
641
  {
636
642
  key: "_handlerObjectUpdate",
637
643
  value: function _handlerObjectUpdate(state, key, value, oldValue) {
644
+ var _this = this;
638
645
  var instance = findItem(this.runtime.flatInstances, key, this.runtime.instanceMap);
639
646
  if (!instance) {
640
647
  return;
@@ -666,6 +673,11 @@ var Engine = /*#__PURE__*/ function(Watcher) {
666
673
  this.runtime.getFlatInstances();
667
674
  }
668
675
  this._handlerSubtableUpdateUid(newValue);
676
+ var rowIndexs = newRows.map(function(item) {
677
+ var _item_children_, _item_children;
678
+ var subControl = item === null || item === void 0 ? void 0 : (_item_children = item.children) === null || _item_children === void 0 ? void 0 : (_item_children_ = _item_children[0]) === null || _item_children_ === void 0 ? void 0 : _item_children_.children[0];
679
+ return _this.getInstanceRowIndex(subControl);
680
+ });
669
681
  this.emit('list-change', {
670
682
  instance: instance,
671
683
  value: value,
@@ -673,6 +685,7 @@ var Engine = /*#__PURE__*/ function(Watcher) {
673
685
  // @ts-ignore
674
686
  changed: newRows,
675
687
  data: newValue,
688
+ rowIndexs: rowIndexs,
676
689
  deleted: deleted,
677
690
  // deleted: oldValue ?? [],
678
691
  type: 'push',
@@ -60,11 +60,11 @@ export var StylePlugin = /*#__PURE__*/ function() {
60
60
  var dom = document.querySelector('head');
61
61
  dom === null || dom === void 0 ? void 0 : dom.appendChild(style);
62
62
  var cssStyleText;
63
- // if (this.isPc) {
64
- // cssStyleText = `[data-engine-id='${engine.id}']{ ${compiledStyle} }`
65
- // } else {
66
- cssStyleText = compiledStyle;
67
- // }
63
+ if (this.isPc) {
64
+ cssStyleText = "[data-engine-id='".concat(engine.id, "']{ ").concat(compiledStyle, " }");
65
+ } else {
66
+ cssStyleText = compiledStyle;
67
+ }
68
68
  style.appendChild(document.createTextNode(cssStyleText));
69
69
  }
70
70
  }