@byteluck-fe/model-driven-engine 2.23.0-beta.9 → 2.23.1-beta.1-zt

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.
@@ -329,7 +329,7 @@ function _ts_generator(thisArg, body) {
329
329
  }
330
330
  }
331
331
  import { isDataBind } from '@byteluck-fe/model-driven-core';
332
- import { CONTROL_BASE_TYPE, CONTROL_TYPE, DEFAULT_LOCALE, error, genNonDuplicateId, isString, JSONCopy, log, RulesMessage, updateValueFromKeys, warn, Watcher, isBuiltInControls } from '@byteluck-fe/model-driven-shared';
332
+ import { CONTROL_BASE_TYPE, CONTROL_TYPE, DEFAULT_LOCALE, error, genNonDuplicateId, isString, JSONCopy, log, updateValueFromKeys, warn, Watcher, isBuiltInControls } from '@byteluck-fe/model-driven-shared';
333
333
  import { Runtime } from './Runtime';
334
334
  import { Store } from './Store';
335
335
  import { findItem, proxyState } from './proxyState';
@@ -360,7 +360,6 @@ var Engine = /*#__PURE__*/ function(Watcher) {
360
360
  _this.$options = Object.freeze(props);
361
361
  var _this_$options = _this.$options, _this_$options_autoMount = _this_$options.autoMount, autoMount = _this_$options_autoMount === void 0 ? true : _this_$options_autoMount, schema = _this_$options.schema, beforeCreateInstance = _this_$options.beforeCreateInstance, externalParams = _this_$options.externalParams, _this_$options_language = _this_$options.// fieldModel,
362
362
  language, language = _this_$options_language === void 0 ? DEFAULT_LOCALE : _this_$options_language, _this_$options_debug = _this_$options.debug, debug = _this_$options_debug === void 0 ? false : _this_$options_debug, messagesI18n = _this_$options.messagesI18n, children = _this_$options.children;
363
- RulesMessage.setLocale(language, messagesI18n);
364
363
  _this.debug = debug;
365
364
  _this.runtime = new Runtime({
366
365
  schema: schema,
@@ -576,12 +575,18 @@ var Engine = /*#__PURE__*/ function(Watcher) {
576
575
  var subtableData = this.getState(subtable.id);
577
576
  this._handlerSubtableUpdateUid(subtableData);
578
577
  this.runtime.getFlatInstances();
578
+ var rowIndexs = createdNewRows.map(function(item) {
579
+ var _item_children_, _item_children;
580
+ 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];
581
+ return _this.getInstanceRowIndex(subControl);
582
+ });
579
583
  this.emit('list-change', {
580
584
  instance: subtable,
581
585
  value: subtableData,
582
586
  options: Object.assign({}, options, {
583
587
  changed: createdNewRows,
584
588
  data: createdNewRowsData,
589
+ rowIndexs: rowIndexs,
585
590
  deleted: deleted !== null && deleted !== void 0 ? deleted : [],
586
591
  jsonValue: JSON.stringify(subtableData),
587
592
  isDeleteLastOne: isDeleteLastOne,
@@ -610,6 +615,7 @@ var Engine = /*#__PURE__*/ function(Watcher) {
610
615
  {
611
616
  key: "_handlerObjectUpdate",
612
617
  value: function _handlerObjectUpdate(state, key, value, oldValue) {
618
+ var _this = this;
613
619
  var instance = findItem(this.runtime.flatInstances, key, this.runtime.instanceMap);
614
620
  if (!instance) {
615
621
  return;
@@ -637,10 +643,14 @@ var Engine = /*#__PURE__*/ function(Watcher) {
637
643
  var deleted = oldValue !== null && oldValue !== void 0 ? oldValue : [];
638
644
  if ((options === null || options === void 0 ? void 0 : options.setData) === true) {
639
645
  deleted = [];
640
- } else {
641
- this.runtime.getFlatInstances();
642
- }
646
+ } else {}
647
+ this.runtime.getFlatInstances();
643
648
  this._handlerSubtableUpdateUid(newValue);
649
+ var rowIndexs = newRows.map(function(item) {
650
+ var _item_children_, _item_children;
651
+ 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];
652
+ return _this.getInstanceRowIndex(subControl);
653
+ });
644
654
  this.emit('list-change', {
645
655
  instance: instance,
646
656
  value: value,
@@ -648,6 +658,7 @@ var Engine = /*#__PURE__*/ function(Watcher) {
648
658
  // @ts-ignore
649
659
  changed: newRows,
650
660
  data: newValue,
661
+ rowIndexs: rowIndexs,
651
662
  deleted: deleted,
652
663
  // deleted: oldValue ?? [],
653
664
  type: 'push',
@@ -2,7 +2,7 @@
2
2
  * @Author: zhaoxiaoyang zhaoxiaoyang@byteluck.com
3
3
  * @Date: 2022-04-15 14:06:03
4
4
  * @LastEditors: SuperLuckyqi
5
- * @LastEditTime: 2024-07-24 11:38:32
5
+ * @LastEditTime: 2024-11-08 11:17:53
6
6
  * @FilePath: /model-driven/packages/engine/src/plugins/StylePlugin.ts
7
7
  */ function _class_call_check(instance, Constructor) {
8
8
  if (!(instance instanceof Constructor)) {
@@ -61,7 +61,7 @@ export var StylePlugin = /*#__PURE__*/ function() {
61
61
  dom === null || dom === void 0 ? void 0 : dom.appendChild(style);
62
62
  var cssStyleText;
63
63
  if (this.isPc) {
64
- cssStyleText = "[data-engine-id='".concat(engine.id, "']{ ").concat(compiledStyle, " }");
64
+ cssStyleText = ".render-engine-".concat(engine.id, "{ ").concat(compiledStyle, " }");
65
65
  } else {
66
66
  cssStyleText = compiledStyle;
67
67
  }