@dckj-npm/dc-material 0.1.371 → 0.1.373

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.
@@ -69,41 +69,50 @@ var getImageStyleNumber = function getImageStyleNumber(target, styleKey) {
69
69
  var imageChildSchema = findImageChildSchema(target);
70
70
  return parsePxNumber(imageChildSchema === null || imageChildSchema === void 0 ? void 0 : (_imageChildSchema$pro = imageChildSchema.props) === null || _imageChildSchema$pro === void 0 ? void 0 : (_imageChildSchema$pro2 = _imageChildSchema$pro.style) === null || _imageChildSchema$pro2 === void 0 ? void 0 : _imageChildSchema$pro2[styleKey]);
71
71
  };
72
+
73
+ /**
74
+ * 异步写入 Image 子节点的 style,避免在 imgWidth/imgHeight.setValue 的同步执行栈内
75
+ * 触发引擎重评估 dataList.initialValue(会先清空 dataList prop,导致默认图覆盖绑定数据)。
76
+ * 通过 Promise.resolve().then() 将写入推迟到当前 settings 重评估完成后执行,
77
+ * 此时 dataList 已稳定为正确的 JSExpression,重评估无副作用。
78
+ */
72
79
  var syncImageStyleValue = function syncImageStyleValue(target, styleKey, value) {
73
- var _extends3;
74
- // 优先通过引擎节点 API 更新子节点 style,确保引擎感知变化(布局面板读取时可见)
75
- var imageChildNode = findImageChildNode(target);
76
- if (imageChildNode) {
77
- var _imageChildNode$getPr3, _extends2, _imageChildNode$setPr;
78
- var _currentStyle = ((_imageChildNode$getPr3 = imageChildNode.getPropValue) === null || _imageChildNode$getPr3 === void 0 ? void 0 : _imageChildNode$getPr3.call(imageChildNode, 'style')) || {};
79
- // 同时确保 width/height 都存在于子节点 style 中,防止布局面板 replace 时丢失其中一个
80
- var updatedStyle = (0, _extends4["default"])({}, _currentStyle, (_extends2 = {}, _extends2[styleKey] = value + "px", _extends2));
81
- // 如果另一轴尺寸在子节点 style 中不存在,则从父级 prop 补充,保证两轴都写入
82
- var otherKey = styleKey === 'width' ? 'height' : 'width';
83
- if (!updatedStyle[otherKey]) {
84
- var _target$getProps, _target$getProps$call, _target$getProps$call2;
85
- var otherPropKey = otherKey === 'width' ? 'imgWidth' : 'imgHeight';
86
- var otherPropValue = parsePxNumber(target === null || target === void 0 ? void 0 : (_target$getProps = target.getProps) === null || _target$getProps === void 0 ? void 0 : (_target$getProps$call = _target$getProps.call(target)) === null || _target$getProps$call === void 0 ? void 0 : (_target$getProps$call2 = _target$getProps$call.getPropValue) === null || _target$getProps$call2 === void 0 ? void 0 : _target$getProps$call2.call(_target$getProps$call, otherPropKey));
87
- if (otherPropValue !== undefined) {
88
- updatedStyle[otherKey] = otherPropValue + "px";
89
- } else {
90
- // 子节点 style 也没有,使用默认值 100
91
- updatedStyle[otherKey] = '100px';
80
+ Promise.resolve().then(function () {
81
+ var _extends3;
82
+ // 优先通过引擎节点 API 更新子节点 style,确保引擎感知变化(布局面板读取时可见)
83
+ var imageChildNode = findImageChildNode(target);
84
+ if (imageChildNode) {
85
+ var _imageChildNode$getPr3, _extends2, _imageChildNode$setPr;
86
+ var _currentStyle = ((_imageChildNode$getPr3 = imageChildNode.getPropValue) === null || _imageChildNode$getPr3 === void 0 ? void 0 : _imageChildNode$getPr3.call(imageChildNode, 'style')) || {};
87
+ // 同时确保 width/height 都存在于子节点 style 中,防止布局面板 replace 时丢失其中一个
88
+ var updatedStyle = (0, _extends4["default"])({}, _currentStyle, (_extends2 = {}, _extends2[styleKey] = value + "px", _extends2));
89
+ // 如果另一轴尺寸在子节点 style 中不存在,则从父级 prop 补充,保证两轴都写入
90
+ var otherKey = styleKey === 'width' ? 'height' : 'width';
91
+ if (!updatedStyle[otherKey]) {
92
+ var _target$getProps, _target$getProps$call, _target$getProps$call2;
93
+ var otherPropKey = otherKey === 'width' ? 'imgWidth' : 'imgHeight';
94
+ var otherPropValue = parsePxNumber(target === null || target === void 0 ? void 0 : (_target$getProps = target.getProps) === null || _target$getProps === void 0 ? void 0 : (_target$getProps$call = _target$getProps.call(target)) === null || _target$getProps$call === void 0 ? void 0 : (_target$getProps$call2 = _target$getProps$call.getPropValue) === null || _target$getProps$call2 === void 0 ? void 0 : _target$getProps$call2.call(_target$getProps$call, otherPropKey));
95
+ if (otherPropValue !== undefined) {
96
+ updatedStyle[otherKey] = otherPropValue + "px";
97
+ } else {
98
+ // 子节点 style 也没有,使用默认值 100
99
+ updatedStyle[otherKey] = '100px';
100
+ }
92
101
  }
102
+ (_imageChildNode$setPr = imageChildNode.setPropValue) === null || _imageChildNode$setPr === void 0 ? void 0 : _imageChildNode$setPr.call(imageChildNode, 'style', updatedStyle);
103
+ return;
93
104
  }
94
- (_imageChildNode$setPr = imageChildNode.setPropValue) === null || _imageChildNode$setPr === void 0 ? void 0 : _imageChildNode$setPr.call(imageChildNode, 'style', updatedStyle);
95
- return;
96
- }
97
- // 降级:直接写 schema(引擎无法感知,但保留作为兜底)
98
- var imageChildSchema = findImageChildSchema(target);
99
- if (!imageChildSchema) {
100
- return;
101
- }
102
- if (!imageChildSchema.props) {
103
- imageChildSchema.props = {};
104
- }
105
- var currentStyle = imageChildSchema.props.style || {};
106
- imageChildSchema.props.style = (0, _extends4["default"])({}, currentStyle, (_extends3 = {}, _extends3[styleKey] = value + "px", _extends3));
105
+ // 降级:直接写 schema(引擎无法感知,但保留作为兜底)
106
+ var imageChildSchema = findImageChildSchema(target);
107
+ if (!imageChildSchema) {
108
+ return;
109
+ }
110
+ if (!imageChildSchema.props) {
111
+ imageChildSchema.props = {};
112
+ }
113
+ var currentStyle = imageChildSchema.props.style || {};
114
+ imageChildSchema.props.style = (0, _extends4["default"])({}, currentStyle, (_extends3 = {}, _extends3[styleKey] = value + "px", _extends3));
115
+ });
107
116
  };
108
117
  var syncImageDimensionPropsFromChild = function syncImageDimensionPropsFromChild(target) {
109
118
  var _target$getProps2;
@@ -132,30 +141,30 @@ var isDataListBoundExpression = function isDataListBoundExpression(target) {
132
141
  };
133
142
 
134
143
  /**
135
- * 模块级 WeakMap 缓存:以 IPublicModelNode 对象引用为 key,存储每个 TeletextList 节点
136
- * 最后一次已知的「非默认」dataList 值。
137
- *
138
- * 作用:在 setPropValue 触发的 settings 重评估中,引擎可能先将 node prop 清空再调用
139
- * dataList.initialValue;此时 node.getPropValue 与 getProps().getPropValue 均返回
140
- * undefined,导致 initialValue 回退默认数组、覆盖已绑定的 JSExpression 或用户数据。
141
- * 通过在每次 imgWidth/imgHeight/imagePlacement.setValue 执行任何 setPropValue 之前
142
- * 将当前 dataList 写入此缓存,initialValue 可从缓存安全恢复,彻底切断引擎中间态影响。
144
+ * 模块级缓存:使用 node.id(稳定的字符串 ID)作为 key
145
+ * 替代 WeakMap 方案:WeakMap 以 target.node 对象引用为 key,
146
+ * 但引擎可能通过 Proxy/getter 每次返回不同的包装对象,导致缓存命中失败。
147
+ * 使用 node.id 字符串做 key 彻底消除引用不一致问题。
143
148
  */
144
- var _nodeDataListCache = new WeakMap();
149
+ var _dataListCacheById = {};
145
150
  var _cacheDataList = function _cacheDataList(target) {
146
- var _node$getPropValue, _target$getProps4, _target$getProps4$cal, _target$getProps4$cal2;
147
- var node = target === null || target === void 0 ? void 0 : target.node;
148
- if (!node) return;
149
- // 优先从 node API 读取(schema 层,不受 settings 重评估中间态影响)
150
- var fromNode = node === null || node === void 0 ? void 0 : (_node$getPropValue = node.getPropValue) === null || _node$getPropValue === void 0 ? void 0 : _node$getPropValue.call(node, 'dataList');
151
+ var _target$node3, _target$node4, _target$node4$getProp, _target$node5, _target$node5$schema, _target$node5$schema$, _target$getProps4, _target$getProps4$cal, _target$getProps4$cal2;
152
+ var nodeId = target === null || target === void 0 ? void 0 : (_target$node3 = target.node) === null || _target$node3 === void 0 ? void 0 : _target$node3.id;
153
+ if (!nodeId) return;
154
+ var fromNode = target === null || target === void 0 ? void 0 : (_target$node4 = target.node) === null || _target$node4 === void 0 ? void 0 : (_target$node4$getProp = _target$node4.getPropValue) === null || _target$node4$getProp === void 0 ? void 0 : _target$node4$getProp.call(_target$node4, 'dataList');
151
155
  if (fromNode !== undefined) {
152
- _nodeDataListCache.set(node, fromNode);
156
+ _dataListCacheById[nodeId] = fromNode;
157
+ return;
158
+ }
159
+ // schema 序列化快照:源头数据,不受 settings 中间态影响
160
+ var fromSchema = target === null || target === void 0 ? void 0 : (_target$node5 = target.node) === null || _target$node5 === void 0 ? void 0 : (_target$node5$schema = _target$node5.schema) === null || _target$node5$schema === void 0 ? void 0 : (_target$node5$schema$ = _target$node5$schema.props) === null || _target$node5$schema$ === void 0 ? void 0 : _target$node5$schema$.dataList;
161
+ if (fromSchema !== undefined) {
162
+ _dataListCacheById[nodeId] = fromSchema;
153
163
  return;
154
164
  }
155
- // 降级:从 settings API 读取
156
165
  var fromProps = target === null || target === void 0 ? void 0 : (_target$getProps4 = target.getProps) === null || _target$getProps4 === void 0 ? void 0 : (_target$getProps4$cal = _target$getProps4.call(target)) === null || _target$getProps4$cal === void 0 ? void 0 : (_target$getProps4$cal2 = _target$getProps4$cal.getPropValue) === null || _target$getProps4$cal2 === void 0 ? void 0 : _target$getProps4$cal2.call(_target$getProps4$cal, 'dataList');
157
166
  if (fromProps !== undefined) {
158
- _nodeDataListCache.set(node, fromProps);
167
+ _dataListCacheById[nodeId] = fromProps;
159
168
  }
160
169
  };
161
170
  var TeletextListMeta = {
@@ -341,17 +350,15 @@ var TeletextListMeta = {
341
350
  return;
342
351
  }
343
352
  var props = target.getProps();
344
- // 在任何 setPropValue 之前先写入模块级缓存(与 imagePlacement.setValue 同策略)
345
353
  _cacheDataList(target);
346
- // 快照需要保护的数据,防止 syncImageStyleValue imageChildNode.setPropValue
347
- // 触发引擎重评估 dataList.initialValue,导致 dataList 被重置为默认图
354
+ // 快照 dataList:在 setPropValue 前捕获,防止引擎重评估时被默认值覆盖
348
355
  var prevDataList = props.getPropValue('dataList');
349
- var prevDataListBind = props.getPropValue('dataListBind');
350
356
  props.setPropValue('imgWidth', parsedValue);
357
+ // 还原 dataList(幂等操作,若引擎未覆盖则无副作用)
358
+ if (prevDataList !== undefined) {
359
+ props.setPropValue('dataList', prevDataList);
360
+ }
351
361
  syncImageStyleValue(target, 'width', parsedValue);
352
- // 还原被保护的数据(幂等操作,若引擎未重置则无副作用)
353
- if (prevDataList !== undefined) props.setPropValue('dataList', prevDataList);
354
- if (prevDataListBind !== undefined) props.setPropValue('dataListBind', prevDataListBind);
355
362
  }
356
363
  }
357
364
  }, {
@@ -412,17 +419,15 @@ var TeletextListMeta = {
412
419
  return;
413
420
  }
414
421
  var props = target.getProps();
415
- // 在任何 setPropValue 之前先写入模块级缓存(与 imagePlacement.setValue 同策略)
416
422
  _cacheDataList(target);
417
- // 快照需要保护的数据,防止 syncImageStyleValue imageChildNode.setPropValue
418
- // 触发引擎重评估 dataList.initialValue,导致 dataList 被重置为默认图
423
+ // 快照 dataList:在 setPropValue 前捕获,防止引擎重评估时被默认值覆盖
419
424
  var prevDataList = props.getPropValue('dataList');
420
- var prevDataListBind = props.getPropValue('dataListBind');
421
425
  props.setPropValue('imgHeight', parsedValue);
426
+ // 还原 dataList(幂等操作,若引擎未覆盖则无副作用)
427
+ if (prevDataList !== undefined) {
428
+ props.setPropValue('dataList', prevDataList);
429
+ }
422
430
  syncImageStyleValue(target, 'height', parsedValue);
423
- // 还原被保护的数据(幂等操作,若引擎未重置则无副作用)
424
- if (prevDataList !== undefined) props.setPropValue('dataList', prevDataList);
425
- if (prevDataListBind !== undefined) props.setPropValue('dataListBind', prevDataListBind);
426
431
  }
427
432
  }
428
433
  }, {
@@ -496,9 +501,9 @@ var TeletextListMeta = {
496
501
  },
497
502
  extraProps: {
498
503
  setValue: function setValue(target, value) {
499
- var _target$node3, _schemaChildren$filte, _target$parent, _target$parent$items;
504
+ var _target$node6, _schemaChildren$filte, _target$parent, _target$parent$items;
500
505
  target.getProps().setPropValue('textLines', value);
501
- var schema = target === null || target === void 0 ? void 0 : (_target$node3 = target.node) === null || _target$node3 === void 0 ? void 0 : _target$node3.schema;
506
+ var schema = target === null || target === void 0 ? void 0 : (_target$node6 = target.node) === null || _target$node6 === void 0 ? void 0 : _target$node6.schema;
502
507
  var node = target === null || target === void 0 ? void 0 : target.node;
503
508
  var schemaChildren = Array.isArray(schema === null || schema === void 0 ? void 0 : schema.children) ? schema.children : [];
504
509
 
@@ -892,30 +897,31 @@ var TeletextListMeta = {
892
897
  }
893
898
  },
894
899
  initialValue: function initialValue(target) {
895
- var _node$getPropValue2, _target$getProps1, _target$getProps1$cal, _target$getProps1$cal2;
896
- // 读取顺序(由最可靠到最不可靠):
897
- // 1. node API(schema 层,引擎重评估前通常仍有值)
898
- // 2. 模块级 WeakMap 缓存(在任何 setPropValue 之前写入,完全不受引擎清空影响)
899
- // 3. settings API(重评估中间态下可能已清空,作为最后手段)
900
- // 4. 默认占位数据(仅首次创建组件时触达)
901
- var node = target === null || target === void 0 ? void 0 : target.node;
902
- var fromNode = node === null || node === void 0 ? void 0 : (_node$getPropValue2 = node.getPropValue) === null || _node$getPropValue2 === void 0 ? void 0 : _node$getPropValue2.call(node, 'dataList');
900
+ var _target$node7, _target$node8, _target$node8$getProp, _target$getProps1, _target$getProps1$cal, _target$getProps1$cal2, _target$node9, _target$node9$schema, _target$node9$schema$;
901
+ var nodeId = target === null || target === void 0 ? void 0 : (_target$node7 = target.node) === null || _target$node7 === void 0 ? void 0 : _target$node7.id;
902
+ // 1. node API
903
+ var fromNode = target === null || target === void 0 ? void 0 : (_target$node8 = target.node) === null || _target$node8 === void 0 ? void 0 : (_target$node8$getProp = _target$node8.getPropValue) === null || _target$node8$getProp === void 0 ? void 0 : _target$node8$getProp.call(_target$node8, 'dataList');
903
904
  if (fromNode !== undefined) {
904
- // 同步更新缓存,为后续可能的重评估提供后备
905
- if (node) _nodeDataListCache.set(node, fromNode);
905
+ if (nodeId) _dataListCacheById[nodeId] = fromNode;
906
906
  return fromNode;
907
907
  }
908
- // node.getPropValue 返回 undefined:引擎已在调用 initialValue 前清空 node prop
909
- // 读取模块级缓存(在 setValue 中任何 setPropValue 之前写入,最可靠的后备)
910
- var cached = node ? _nodeDataListCache.get(node) : undefined;
911
- if (cached !== undefined) {
912
- return cached;
908
+ // 2. 模块级缓存(node.id 索引,不受 Proxy 引用问题影响)
909
+ if (nodeId && _dataListCacheById[nodeId] !== undefined) {
910
+ return _dataListCacheById[nodeId];
913
911
  }
912
+ // 3. settings API
914
913
  var current = target === null || target === void 0 ? void 0 : (_target$getProps1 = target.getProps) === null || _target$getProps1 === void 0 ? void 0 : (_target$getProps1$cal = _target$getProps1.call(target)) === null || _target$getProps1$cal === void 0 ? void 0 : (_target$getProps1$cal2 = _target$getProps1$cal.getPropValue) === null || _target$getProps1$cal2 === void 0 ? void 0 : _target$getProps1$cal2.call(_target$getProps1$cal, 'dataList');
915
914
  if (current !== undefined) {
916
- if (node) _nodeDataListCache.set(node, current);
915
+ if (nodeId) _dataListCacheById[nodeId] = current;
917
916
  return current;
918
917
  }
918
+ // 4. schema 序列化快照(源头数据,不受 settings 中间态影响)
919
+ var fromSchema = target === null || target === void 0 ? void 0 : (_target$node9 = target.node) === null || _target$node9 === void 0 ? void 0 : (_target$node9$schema = _target$node9.schema) === null || _target$node9$schema === void 0 ? void 0 : (_target$node9$schema$ = _target$node9$schema.props) === null || _target$node9$schema$ === void 0 ? void 0 : _target$node9$schema$.dataList;
920
+ if (fromSchema !== undefined) {
921
+ if (nodeId) _dataListCacheById[nodeId] = fromSchema;
922
+ return fromSchema;
923
+ }
924
+ // 5. 默认数据(仅首次创建组件时触达)
919
925
  return [{
920
926
  image: 'https://img.alicdn.com/tps/TB16TQvOXXXXXbiaFXXXXXXXXXX-120-120.svg',
921
927
  title: '标题名称',
@@ -936,55 +942,49 @@ var TeletextListMeta = {
936
942
  },
937
943
  extraProps: {
938
944
  /**
939
- * 自定义 getValue:保证引擎重评估期间 field.getValue() 始终返回有效值(非 undefined),
940
- * 从而阻止 initDefaultValue 在不应该的时机调用 initialValue 并覆盖为默认图数组。
941
- *
942
- * 触发场景:修改 imgWidth/imgHeight 或通过布局面板修改图片 margin 时,
943
- * imageChildNode.setPropValue('style', ...) 会触发引擎对父节点 settings 的重评估;
944
- * 若此时 dataList Prop 处于 "unset" 中间态,parent.getPropValue 会返回 undefined,
945
- * 导致不带 getValue 时 field.getValue() = undefined → initDefaultValue 触发 → 默认图。
946
- * 有了此 getValue 后,即使 schema 层暂时返回 undefined,从缓存取值仍可返回用户数据,
947
- * field.getValue() 非 undefined → initDefaultValue 永远跳过 → 默认图问题彻底消失。
945
+ * 保证引擎重评估期间 field.getValue() 始终返回有效值(非 undefined),
946
+ * 阻止 initDefaultValue 覆盖已绑定的 JSExpression。
947
+ * 回退链:currentValue → 缓存(node.id) → schema 快照 → node API。
948
948
  */
949
949
  getValue: function getValue(target, currentValue) {
950
- var node = target === null || target === void 0 ? void 0 : target.node;
950
+ var _target$node0, _target$node1, _target$node1$schema, _target$node1$schema$, _target$node10, _target$node10$getPro;
951
+ var nodeId = target === null || target === void 0 ? void 0 : (_target$node0 = target.node) === null || _target$node0 === void 0 ? void 0 : _target$node0.id;
951
952
  if (currentValue !== undefined) {
952
- // schema 层有值:同步更新缓存,确保用户最新编辑的数据被记录
953
- if (node) _nodeDataListCache.set(node, currentValue);
953
+ if (nodeId) _dataListCacheById[nodeId] = currentValue;
954
954
  return currentValue;
955
955
  }
956
- // schema 层暂时无值(引擎重评估中间态):从缓存恢复,避免 initDefaultValue 触发
957
- var cached = node ? _nodeDataListCache.get(node) : undefined;
958
- return cached; // undefined 仅在缓存为空(全新组件首次初始化)时出现,属正常情况
956
+ // 引擎 currentValue undefined(重评估中间态),逐级回退:
957
+ if (nodeId && _dataListCacheById[nodeId] !== undefined) {
958
+ return _dataListCacheById[nodeId];
959
+ }
960
+ // node.schema 序列化快照:不受 settings 中间态影响,是最可靠的源头数据
961
+ var fromSchema = target === null || target === void 0 ? void 0 : (_target$node1 = target.node) === null || _target$node1 === void 0 ? void 0 : (_target$node1$schema = _target$node1.schema) === null || _target$node1$schema === void 0 ? void 0 : (_target$node1$schema$ = _target$node1$schema.props) === null || _target$node1$schema$ === void 0 ? void 0 : _target$node1$schema$.dataList;
962
+ if (fromSchema !== undefined) {
963
+ if (nodeId) _dataListCacheById[nodeId] = fromSchema;
964
+ return fromSchema;
965
+ }
966
+ var fromNode = target === null || target === void 0 ? void 0 : (_target$node10 = target.node) === null || _target$node10 === void 0 ? void 0 : (_target$node10$getPro = _target$node10.getPropValue) === null || _target$node10$getPro === void 0 ? void 0 : _target$node10$getPro.call(_target$node10, 'dataList');
967
+ if (fromNode !== undefined) {
968
+ if (nodeId) _dataListCacheById[nodeId] = fromNode;
969
+ return fromNode;
970
+ }
971
+ return undefined;
959
972
  },
960
973
  /**
961
- * 自定义 setValue:用户每次编辑 dataList 条目时,先更新 WeakMap 缓存,
962
- * 再通过 node.setPropValue 将值持久化到 schema
963
- *
964
- * ⚠️ 此引擎中 extraProps.setValue 完全接管写入逻辑,引擎不会自动持久化:
965
- * 若不在此处显式调用 setPropValue,用户编辑的数据将只存于内存缓存,
966
- * 页面刷新后丢失,同时 imgWidth/imgHeight.setValue 的快照–还原机制也因
967
- * props.getPropValue('dataList') 返回 undefined 而失效,导致还原跳过,
968
- * 进而触发引擎 initDefaultValue,画布回退默认图。
969
- *
970
- * 写入顺序:先缓存(供 initialValue/getValue 兜底),再写 schema(持久化)。
971
- * 写入 schema 会触发引擎对 settings 的重评估,但此时 schema 已有值,
972
- * initialValue 不会被调用,不会产生循环。
974
+ * 用户编辑 dataList 时同步更新缓存并持久化到 schema。
975
+ * 引擎 extraProps.setValue 完全接管写入,必须显式 setPropValue
973
976
  */
974
977
  setValue: function setValue(target, value) {
975
- var node = target === null || target === void 0 ? void 0 : target.node;
976
- if (!node) return;
978
+ var _target$node11;
979
+ var nodeId = target === null || target === void 0 ? void 0 : (_target$node11 = target.node) === null || _target$node11 === void 0 ? void 0 : _target$node11.id;
980
+ if (!nodeId) return;
977
981
  if (value !== undefined) {
978
982
  var _target$getProps10, _target$getProps10$ca, _target$getProps10$ca2;
979
- // 先写缓存,确保重评估期间 getValue 可从缓存返回有效值
980
- _nodeDataListCache.set(node, value);
981
- // 再持久化到 schema(引擎不会自动写入,必须显式调用)
983
+ _dataListCacheById[nodeId] = value;
982
984
  (_target$getProps10 = target.getProps) === null || _target$getProps10 === void 0 ? void 0 : (_target$getProps10$ca = _target$getProps10.call(target)) === null || _target$getProps10$ca === void 0 ? void 0 : (_target$getProps10$ca2 = _target$getProps10$ca.setPropValue) === null || _target$getProps10$ca2 === void 0 ? void 0 : _target$getProps10$ca2.call(_target$getProps10$ca, 'dataList', value);
983
985
  } else {
984
986
  var _target$getProps11, _target$getProps11$ca, _target$getProps11$ca2;
985
- // clearValue 场景(value = undefined):清空缓存,使下次 initDefaultValue
986
- // 可正常返回默认数组(仅用于组件被显式清除数据的情况)
987
- _nodeDataListCache["delete"](node);
987
+ delete _dataListCacheById[nodeId];
988
988
  (_target$getProps11 = target.getProps) === null || _target$getProps11 === void 0 ? void 0 : (_target$getProps11$ca = _target$getProps11.call(target)) === null || _target$getProps11$ca === void 0 ? void 0 : (_target$getProps11$ca2 = _target$getProps11$ca.setPropValue) === null || _target$getProps11$ca2 === void 0 ? void 0 : _target$getProps11$ca2.call(_target$getProps11$ca, 'dataList', undefined);
989
989
  }
990
990
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dckj-npm/dc-material",
3
- "version": "0.1.371",
3
+ "version": "0.1.373",
4
4
  "description": "dc低代码物料",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -114,10 +114,10 @@
114
114
  },
115
115
  "componentConfig": {
116
116
  "isComponentLibrary": true,
117
- "materialSchema": "https://unpkg.com/@dckj-npm/dc-material@0.1.371/build/lowcode/assets-prod.json"
117
+ "materialSchema": "https://unpkg.com/@dckj-npm/dc-material@0.1.373/build/lowcode/assets-prod.json"
118
118
  },
119
119
  "lcMeta": {
120
120
  "type": "component"
121
121
  },
122
- "homepage": "https://unpkg.com/@dckj-npm/dc-material@0.1.371/build/index.html"
122
+ "homepage": "https://unpkg.com/@dckj-npm/dc-material@0.1.373/build/index.html"
123
123
  }