@dckj-npm/dc-material 0.1.364 → 0.1.366

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.
@@ -61,10 +61,17 @@ var TeletextListItem = function TeletextListItem(_ref) {
61
61
  };
62
62
  var imageChildProps = getChildPropsByKey('image');
63
63
  var imageClassName = ['teletext-list__panel__item_image', imageChildProps === null || imageChildProps === void 0 ? void 0 : imageChildProps.className].filter(Boolean).join(' ');
64
- var imageStyle = _extends({}, (imageChildProps === null || imageChildProps === void 0 ? void 0 : imageChildProps.style) || {}, typeof imgWidth === 'number' ? {
65
- width: imgWidth + "px"
66
- } : {}, typeof imgHeight === 'number' ? {
67
- height: imgHeight + "px"
64
+ // 合并策略:子节点 style 所有属性(含布局面板设置的 margin-left 等)优先保留;
65
+ // width/height 若子节点 style 中没有,则用父级 imgWidth/imgHeight prop 兜底补充;
66
+ // 两者都没有时,使用默认尺寸 100px 防止图片无尺寸。
67
+ // 布局面板 replace style 时可能只保留 margin-left(丢失 width/height),
68
+ // 此时 imgWidth/imgHeight prop 的兜底确保图片尺寸不丢失。
69
+ var childStyle = (imageChildProps === null || imageChildProps === void 0 ? void 0 : imageChildProps.style) || {};
70
+ var DEFAULT_IMG_SIZE = 100;
71
+ var imageStyle = _extends({}, childStyle, childStyle.width == null ? {
72
+ width: (typeof imgWidth === 'number' ? imgWidth : DEFAULT_IMG_SIZE) + "px"
73
+ } : {}, childStyle.height == null ? {
74
+ height: (typeof imgHeight === 'number' ? imgHeight : DEFAULT_IMG_SIZE) + "px"
68
75
  } : {});
69
76
  var containerStyle = _extends({
70
77
  padding: itemPadding + "px",
@@ -66,10 +66,17 @@ var TeletextListItem = function TeletextListItem(_ref) {
66
66
  };
67
67
  var imageChildProps = getChildPropsByKey('image');
68
68
  var imageClassName = ['teletext-list__panel__item_image', imageChildProps === null || imageChildProps === void 0 ? void 0 : imageChildProps.className].filter(Boolean).join(' ');
69
- var imageStyle = (0, _extends2["default"])({}, (imageChildProps === null || imageChildProps === void 0 ? void 0 : imageChildProps.style) || {}, typeof imgWidth === 'number' ? {
70
- width: imgWidth + "px"
71
- } : {}, typeof imgHeight === 'number' ? {
72
- height: imgHeight + "px"
69
+ // 合并策略:子节点 style 所有属性(含布局面板设置的 margin-left 等)优先保留;
70
+ // width/height 若子节点 style 中没有,则用父级 imgWidth/imgHeight prop 兜底补充;
71
+ // 两者都没有时,使用默认尺寸 100px 防止图片无尺寸。
72
+ // 布局面板 replace style 时可能只保留 margin-left(丢失 width/height),
73
+ // 此时 imgWidth/imgHeight prop 的兜底确保图片尺寸不丢失。
74
+ var childStyle = (imageChildProps === null || imageChildProps === void 0 ? void 0 : imageChildProps.style) || {};
75
+ var DEFAULT_IMG_SIZE = 100;
76
+ var imageStyle = (0, _extends2["default"])({}, childStyle, childStyle.width == null ? {
77
+ width: (typeof imgWidth === 'number' ? imgWidth : DEFAULT_IMG_SIZE) + "px"
78
+ } : {}, childStyle.height == null ? {
79
+ height: (typeof imgHeight === 'number' ? imgHeight : DEFAULT_IMG_SIZE) + "px"
73
80
  } : {});
74
81
  var containerStyle = (0, _extends2["default"])({
75
82
  padding: itemPadding + "px",
@@ -264,11 +264,15 @@ const TeletextListMeta: IPublicTypeComponentMetadata = {
264
264
  const prevDataList = props.getPropValue('dataList')
265
265
  const prevDataListBind = props.getPropValue('dataListBind')
266
266
  const prevTextImgGap = props.getPropValue('textImgGap')
267
+ const prevImgWidth = props.getPropValue('imgWidth')
268
+ const prevImgHeight = props.getPropValue('imgHeight')
267
269
  props.setPropValue('imagePlacement', value)
268
270
  // 写回被保护的配置(幂等操作,若引擎未重置则无副作用)
269
271
  if (prevDataList !== undefined) props.setPropValue('dataList', prevDataList)
270
272
  if (prevDataListBind !== undefined) props.setPropValue('dataListBind', prevDataListBind)
271
273
  if (prevTextImgGap !== undefined) props.setPropValue('textImgGap', prevTextImgGap)
274
+ if (prevImgWidth !== undefined) props.setPropValue('imgWidth', prevImgWidth)
275
+ if (prevImgHeight !== undefined) props.setPropValue('imgHeight', prevImgHeight)
272
276
  // 切换图片布局时同步一次子图片尺寸,避免面板回退到默认值
273
277
  syncImageDimensionPropsFromChild(target)
274
278
  },
@@ -311,26 +315,17 @@ const TeletextListMeta: IPublicTypeComponentMetadata = {
311
315
  },
312
316
  extraProps: {
313
317
  getValue: (target) => {
318
+ // getValue 纯读操作,不做任何写入,避免触发引擎重评估其他 setter 的 initialValue
319
+ // (写操作会导致引擎重初始化 dataList 等 prop,画布图片回退到默认图)
314
320
  const styleWidth = getImageStyleNumber(target, 'width')
315
321
  if (styleWidth !== undefined) {
316
- const currentWidth = parsePxNumber(target?.getProps()?.getPropValue?.('imgWidth'))
317
- if (currentWidth !== styleWidth) {
318
- target?.getProps()?.setPropValue?.('imgWidth', styleWidth)
319
- }
320
322
  return styleWidth
321
323
  }
322
324
  const propValue = target?.getProps()?.getPropValue?.('imgWidth')
323
325
  const parsedPropValue = parsePxNumber(propValue)
324
326
  if (parsedPropValue !== undefined) {
325
- // prop 有值但子节点 style 中没有,同步写入子节点,保证引擎感知
326
- syncImageStyleValue(target, 'width', parsedPropValue)
327
327
  return parsedPropValue
328
328
  }
329
- // getValue 始终返回默认值 100,不因数据源绑定而返回 undefined
330
- // isDataListBoundExpression 只影响 initialValue/defaultValue(防止初始化时误写入 mock 数据)
331
- // 同时将默认值 100 写入 prop 和子节点 style,确保后续引擎可感知
332
- target?.getProps()?.setPropValue?.('imgWidth', 100)
333
- syncImageStyleValue(target, 'width', 100)
334
329
  return 100
335
330
  },
336
331
  setValue: (target, value) => {
@@ -380,25 +375,16 @@ const TeletextListMeta: IPublicTypeComponentMetadata = {
380
375
  },
381
376
  extraProps: {
382
377
  getValue: (target) => {
378
+ // getValue 纯读操作,不做任何写入,避免触发引擎重评估其他 setter 的 initialValue
383
379
  const styleHeight = getImageStyleNumber(target, 'height')
384
380
  if (styleHeight !== undefined) {
385
- const currentHeight = parsePxNumber(target?.getProps()?.getPropValue?.('imgHeight'))
386
- if (currentHeight !== styleHeight) {
387
- target?.getProps()?.setPropValue?.('imgHeight', styleHeight)
388
- }
389
381
  return styleHeight
390
382
  }
391
383
  const propValue = target?.getProps()?.getPropValue?.('imgHeight')
392
384
  const parsedPropValue = parsePxNumber(propValue)
393
385
  if (parsedPropValue !== undefined) {
394
- // prop 有值但子节点 style 中没有,同步写入子节点,保证引擎感知
395
- syncImageStyleValue(target, 'height', parsedPropValue)
396
386
  return parsedPropValue
397
387
  }
398
- // getValue 始终返回默认值 100,不因数据源绑定而返回 undefined
399
- // 同时将默认值 100 写入 prop 和子节点 style,确保后续引擎可感知
400
- target?.getProps()?.setPropValue?.('imgHeight', 100)
401
- syncImageStyleValue(target, 'height', 100)
402
388
  return 100
403
389
  },
404
390
  setValue: (target, value) => {
@@ -918,30 +904,40 @@ const TeletextListMeta: IPublicTypeComponentMetadata = {
918
904
  },
919
905
  },
920
906
  },
921
- initialValue: [
922
- {
923
- image: 'https://img.alicdn.com/tps/TB16TQvOXXXXXbiaFXXXXXXXXXX-120-120.svg',
924
- title: '标题名称',
925
- description:
926
- '说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字',
927
- },
928
- {
929
- image: 'https://img.alicdn.com/tps/TB16TQvOXXXXXbiaFXXXXXXXXXX-120-120.svg',
930
- title: '标题名称',
931
- description:
932
- '说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字',
933
- tags: [
934
- {
935
- name: '报名火热',
936
- color: 'orange',
937
- },
938
- {
939
- name: '人数众多',
940
- color: 'blue',
941
- },
942
- ],
943
- },
944
- ],
907
+ initialValue: (target) => {
908
+ // 若 dataList prop 已有值(用户自定义数组、JSExpression 数据源绑定等),
909
+ // 直接返回当前值,防止引擎在任意 setPropValue 触发重评估时用静态默认数组
910
+ // 覆盖已设置的 dataList,导致画布图片回退为默认图(问题 12.4 残留路径)。
911
+ // 仅当 dataList 为 undefined(首次创建组件)时才注入默认占位数据。
912
+ const current = target?.getProps?.()?.getPropValue?.('dataList')
913
+ if (current !== undefined) {
914
+ return current
915
+ }
916
+ return [
917
+ {
918
+ image: 'https://img.alicdn.com/tps/TB16TQvOXXXXXbiaFXXXXXXXXXX-120-120.svg',
919
+ title: '标题名称',
920
+ description:
921
+ '说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字',
922
+ },
923
+ {
924
+ image: 'https://img.alicdn.com/tps/TB16TQvOXXXXXbiaFXXXXXXXXXX-120-120.svg',
925
+ title: '标题名称',
926
+ description:
927
+ '说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字',
928
+ tags: [
929
+ {
930
+ name: '报名火热',
931
+ color: 'orange',
932
+ },
933
+ {
934
+ name: '人数众多',
935
+ color: 'blue',
936
+ },
937
+ ],
938
+ },
939
+ ]
940
+ },
945
941
  },
946
942
  },
947
943
  ],
@@ -117,7 +117,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
117
117
  packageName = '@dckj-npm/dc-material';
118
118
  }
119
119
  if (version === void 0) {
120
- version = '0.1.364';
120
+ version = '0.1.366';
121
121
  }
122
122
  if (basicLibraryVersion === void 0) {
123
123
  basicLibraryVersion = {
@@ -233,11 +233,15 @@ var TeletextListMeta = {
233
233
  var prevDataList = props.getPropValue('dataList');
234
234
  var prevDataListBind = props.getPropValue('dataListBind');
235
235
  var prevTextImgGap = props.getPropValue('textImgGap');
236
+ var prevImgWidth = props.getPropValue('imgWidth');
237
+ var prevImgHeight = props.getPropValue('imgHeight');
236
238
  props.setPropValue('imagePlacement', value);
237
239
  // 写回被保护的配置(幂等操作,若引擎未重置则无副作用)
238
240
  if (prevDataList !== undefined) props.setPropValue('dataList', prevDataList);
239
241
  if (prevDataListBind !== undefined) props.setPropValue('dataListBind', prevDataListBind);
240
242
  if (prevTextImgGap !== undefined) props.setPropValue('textImgGap', prevTextImgGap);
243
+ if (prevImgWidth !== undefined) props.setPropValue('imgWidth', prevImgWidth);
244
+ if (prevImgHeight !== undefined) props.setPropValue('imgHeight', prevImgHeight);
241
245
  // 切换图片布局时同步一次子图片尺寸,避免面板回退到默认值
242
246
  syncImageDimensionPropsFromChild(target);
243
247
  }
@@ -281,29 +285,18 @@ var TeletextListMeta = {
281
285
  },
282
286
  extraProps: {
283
287
  getValue: function getValue(target) {
284
- var _target$getProps8, _target$getProps8$get, _target$getProps9, _target$getProps9$set;
288
+ var _target$getProps6, _target$getProps6$get;
289
+ // getValue 纯读操作,不做任何写入,避免触发引擎重评估其他 setter 的 initialValue
290
+ // (写操作会导致引擎重初始化 dataList 等 prop,画布图片回退到默认图)
285
291
  var styleWidth = getImageStyleNumber(target, 'width');
286
292
  if (styleWidth !== undefined) {
287
- var _target$getProps6, _target$getProps6$get;
288
- var currentWidth = parsePxNumber(target === null || target === void 0 ? void 0 : (_target$getProps6 = target.getProps()) === null || _target$getProps6 === void 0 ? void 0 : (_target$getProps6$get = _target$getProps6.getPropValue) === null || _target$getProps6$get === void 0 ? void 0 : _target$getProps6$get.call(_target$getProps6, 'imgWidth'));
289
- if (currentWidth !== styleWidth) {
290
- var _target$getProps7, _target$getProps7$set;
291
- target === null || target === void 0 ? void 0 : (_target$getProps7 = target.getProps()) === null || _target$getProps7 === void 0 ? void 0 : (_target$getProps7$set = _target$getProps7.setPropValue) === null || _target$getProps7$set === void 0 ? void 0 : _target$getProps7$set.call(_target$getProps7, 'imgWidth', styleWidth);
292
- }
293
293
  return styleWidth;
294
294
  }
295
- var propValue = target === null || target === void 0 ? void 0 : (_target$getProps8 = target.getProps()) === null || _target$getProps8 === void 0 ? void 0 : (_target$getProps8$get = _target$getProps8.getPropValue) === null || _target$getProps8$get === void 0 ? void 0 : _target$getProps8$get.call(_target$getProps8, 'imgWidth');
295
+ var propValue = target === null || target === void 0 ? void 0 : (_target$getProps6 = target.getProps()) === null || _target$getProps6 === void 0 ? void 0 : (_target$getProps6$get = _target$getProps6.getPropValue) === null || _target$getProps6$get === void 0 ? void 0 : _target$getProps6$get.call(_target$getProps6, 'imgWidth');
296
296
  var parsedPropValue = parsePxNumber(propValue);
297
297
  if (parsedPropValue !== undefined) {
298
- // prop 有值但子节点 style 中没有,同步写入子节点,保证引擎感知
299
- syncImageStyleValue(target, 'width', parsedPropValue);
300
298
  return parsedPropValue;
301
299
  }
302
- // getValue 始终返回默认值 100,不因数据源绑定而返回 undefined
303
- // isDataListBoundExpression 只影响 initialValue/defaultValue(防止初始化时误写入 mock 数据)
304
- // 同时将默认值 100 写入 prop 和子节点 style,确保后续引擎可感知
305
- target === null || target === void 0 ? void 0 : (_target$getProps9 = target.getProps()) === null || _target$getProps9 === void 0 ? void 0 : (_target$getProps9$set = _target$getProps9.setPropValue) === null || _target$getProps9$set === void 0 ? void 0 : _target$getProps9$set.call(_target$getProps9, 'imgWidth', 100);
306
- syncImageStyleValue(target, 'width', 100);
307
300
  return 100;
308
301
  },
309
302
  setValue: function setValue(target, value) {
@@ -323,12 +316,12 @@ var TeletextListMeta = {
323
316
  componentName: 'NumberSetter',
324
317
  isRequired: false,
325
318
  initialValue: function initialValue(target) {
326
- var _target$getProps0, _target$getProps0$get;
319
+ var _target$getProps7, _target$getProps7$get;
327
320
  var styleHeight = getImageStyleNumber(target, 'height');
328
321
  if (styleHeight !== undefined) {
329
322
  return styleHeight;
330
323
  }
331
- var propValue = target === null || target === void 0 ? void 0 : (_target$getProps0 = target.getProps()) === null || _target$getProps0 === void 0 ? void 0 : (_target$getProps0$get = _target$getProps0.getPropValue) === null || _target$getProps0$get === void 0 ? void 0 : _target$getProps0$get.call(_target$getProps0, 'imgHeight');
324
+ var propValue = target === null || target === void 0 ? void 0 : (_target$getProps7 = target.getProps()) === null || _target$getProps7 === void 0 ? void 0 : (_target$getProps7$get = _target$getProps7.getPropValue) === null || _target$getProps7$get === void 0 ? void 0 : _target$getProps7$get.call(_target$getProps7, 'imgHeight');
332
325
  var parsedPropValue = parsePxNumber(propValue);
333
326
  if (parsedPropValue !== undefined) return parsedPropValue;
334
327
  // 数据源已绑定时,避免回退为 100 触发误写回
@@ -338,12 +331,12 @@ var TeletextListMeta = {
338
331
  return 100;
339
332
  },
340
333
  defaultValue: function defaultValue(target) {
341
- var _target$getProps1, _target$getProps1$get;
334
+ var _target$getProps8, _target$getProps8$get;
342
335
  var styleHeight = getImageStyleNumber(target, 'height');
343
336
  if (styleHeight !== undefined) {
344
337
  return styleHeight;
345
338
  }
346
- var propValue = target === null || target === void 0 ? void 0 : (_target$getProps1 = target.getProps()) === null || _target$getProps1 === void 0 ? void 0 : (_target$getProps1$get = _target$getProps1.getPropValue) === null || _target$getProps1$get === void 0 ? void 0 : _target$getProps1$get.call(_target$getProps1, 'imgHeight');
339
+ var propValue = target === null || target === void 0 ? void 0 : (_target$getProps8 = target.getProps()) === null || _target$getProps8 === void 0 ? void 0 : (_target$getProps8$get = _target$getProps8.getPropValue) === null || _target$getProps8$get === void 0 ? void 0 : _target$getProps8$get.call(_target$getProps8, 'imgHeight');
347
340
  var parsedPropValue = parsePxNumber(propValue);
348
341
  if (parsedPropValue !== undefined) return parsedPropValue;
349
342
  if (isDataListBoundExpression(target)) {
@@ -354,28 +347,17 @@ var TeletextListMeta = {
354
347
  },
355
348
  extraProps: {
356
349
  getValue: function getValue(target) {
357
- var _target$getProps12, _target$getProps12$ge, _target$getProps13, _target$getProps13$se;
350
+ var _target$getProps9, _target$getProps9$get;
351
+ // getValue 纯读操作,不做任何写入,避免触发引擎重评估其他 setter 的 initialValue
358
352
  var styleHeight = getImageStyleNumber(target, 'height');
359
353
  if (styleHeight !== undefined) {
360
- var _target$getProps10, _target$getProps10$ge;
361
- var currentHeight = parsePxNumber(target === null || target === void 0 ? void 0 : (_target$getProps10 = target.getProps()) === null || _target$getProps10 === void 0 ? void 0 : (_target$getProps10$ge = _target$getProps10.getPropValue) === null || _target$getProps10$ge === void 0 ? void 0 : _target$getProps10$ge.call(_target$getProps10, 'imgHeight'));
362
- if (currentHeight !== styleHeight) {
363
- var _target$getProps11, _target$getProps11$se;
364
- target === null || target === void 0 ? void 0 : (_target$getProps11 = target.getProps()) === null || _target$getProps11 === void 0 ? void 0 : (_target$getProps11$se = _target$getProps11.setPropValue) === null || _target$getProps11$se === void 0 ? void 0 : _target$getProps11$se.call(_target$getProps11, 'imgHeight', styleHeight);
365
- }
366
354
  return styleHeight;
367
355
  }
368
- var propValue = target === null || target === void 0 ? void 0 : (_target$getProps12 = target.getProps()) === null || _target$getProps12 === void 0 ? void 0 : (_target$getProps12$ge = _target$getProps12.getPropValue) === null || _target$getProps12$ge === void 0 ? void 0 : _target$getProps12$ge.call(_target$getProps12, 'imgHeight');
356
+ var propValue = target === null || target === void 0 ? void 0 : (_target$getProps9 = target.getProps()) === null || _target$getProps9 === void 0 ? void 0 : (_target$getProps9$get = _target$getProps9.getPropValue) === null || _target$getProps9$get === void 0 ? void 0 : _target$getProps9$get.call(_target$getProps9, 'imgHeight');
369
357
  var parsedPropValue = parsePxNumber(propValue);
370
358
  if (parsedPropValue !== undefined) {
371
- // prop 有值但子节点 style 中没有,同步写入子节点,保证引擎感知
372
- syncImageStyleValue(target, 'height', parsedPropValue);
373
359
  return parsedPropValue;
374
360
  }
375
- // getValue 始终返回默认值 100,不因数据源绑定而返回 undefined
376
- // 同时将默认值 100 写入 prop 和子节点 style,确保后续引擎可感知
377
- target === null || target === void 0 ? void 0 : (_target$getProps13 = target.getProps()) === null || _target$getProps13 === void 0 ? void 0 : (_target$getProps13$se = _target$getProps13.setPropValue) === null || _target$getProps13$se === void 0 ? void 0 : _target$getProps13$se.call(_target$getProps13, 'imgHeight', 100);
378
- syncImageStyleValue(target, 'height', 100);
379
361
  return 100;
380
362
  },
381
363
  setValue: function setValue(target, value) {
@@ -853,22 +835,33 @@ var TeletextListMeta = {
853
835
  }
854
836
  }
855
837
  },
856
- initialValue: [{
857
- image: 'https://img.alicdn.com/tps/TB16TQvOXXXXXbiaFXXXXXXXXXX-120-120.svg',
858
- title: '标题名称',
859
- description: '说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字'
860
- }, {
861
- image: 'https://img.alicdn.com/tps/TB16TQvOXXXXXbiaFXXXXXXXXXX-120-120.svg',
862
- title: '标题名称',
863
- description: '说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字',
864
- tags: [{
865
- name: '报名火热',
866
- color: 'orange'
838
+ initialValue: function initialValue(target) {
839
+ var _target$getProps0, _target$getProps0$cal, _target$getProps0$cal2;
840
+ // 若 dataList prop 已有值(用户自定义数组、JSExpression 数据源绑定等),
841
+ // 直接返回当前值,防止引擎在任意 setPropValue 触发重评估时用静态默认数组
842
+ // 覆盖已设置的 dataList,导致画布图片回退为默认图(问题 12.4 残留路径)。
843
+ // 仅当 dataList 为 undefined(首次创建组件)时才注入默认占位数据。
844
+ var current = target === null || target === void 0 ? void 0 : (_target$getProps0 = target.getProps) === null || _target$getProps0 === void 0 ? void 0 : (_target$getProps0$cal = _target$getProps0.call(target)) === null || _target$getProps0$cal === void 0 ? void 0 : (_target$getProps0$cal2 = _target$getProps0$cal.getPropValue) === null || _target$getProps0$cal2 === void 0 ? void 0 : _target$getProps0$cal2.call(_target$getProps0$cal, 'dataList');
845
+ if (current !== undefined) {
846
+ return current;
847
+ }
848
+ return [{
849
+ image: 'https://img.alicdn.com/tps/TB16TQvOXXXXXbiaFXXXXXXXXXX-120-120.svg',
850
+ title: '标题名称',
851
+ description: '说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字'
867
852
  }, {
868
- name: '人数众多',
869
- color: 'blue'
870
- }]
871
- }]
853
+ image: 'https://img.alicdn.com/tps/TB16TQvOXXXXXbiaFXXXXXXXXXX-120-120.svg',
854
+ title: '标题名称',
855
+ description: '说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字',
856
+ tags: [{
857
+ name: '报名火热',
858
+ color: 'orange'
859
+ }, {
860
+ name: '人数众多',
861
+ color: 'blue'
862
+ }]
863
+ }];
864
+ }
872
865
  }
873
866
  }],
874
867
  supports: {
@@ -122,7 +122,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
122
122
  packageName = '@dckj-npm/dc-material';
123
123
  }
124
124
  if (version === void 0) {
125
- version = '0.1.364';
125
+ version = '0.1.366';
126
126
  }
127
127
  if (basicLibraryVersion === void 0) {
128
128
  basicLibraryVersion = {
@@ -238,11 +238,15 @@ var TeletextListMeta = {
238
238
  var prevDataList = props.getPropValue('dataList');
239
239
  var prevDataListBind = props.getPropValue('dataListBind');
240
240
  var prevTextImgGap = props.getPropValue('textImgGap');
241
+ var prevImgWidth = props.getPropValue('imgWidth');
242
+ var prevImgHeight = props.getPropValue('imgHeight');
241
243
  props.setPropValue('imagePlacement', value);
242
244
  // 写回被保护的配置(幂等操作,若引擎未重置则无副作用)
243
245
  if (prevDataList !== undefined) props.setPropValue('dataList', prevDataList);
244
246
  if (prevDataListBind !== undefined) props.setPropValue('dataListBind', prevDataListBind);
245
247
  if (prevTextImgGap !== undefined) props.setPropValue('textImgGap', prevTextImgGap);
248
+ if (prevImgWidth !== undefined) props.setPropValue('imgWidth', prevImgWidth);
249
+ if (prevImgHeight !== undefined) props.setPropValue('imgHeight', prevImgHeight);
246
250
  // 切换图片布局时同步一次子图片尺寸,避免面板回退到默认值
247
251
  syncImageDimensionPropsFromChild(target);
248
252
  }
@@ -286,29 +290,18 @@ var TeletextListMeta = {
286
290
  },
287
291
  extraProps: {
288
292
  getValue: function getValue(target) {
289
- var _target$getProps8, _target$getProps8$get, _target$getProps9, _target$getProps9$set;
293
+ var _target$getProps6, _target$getProps6$get;
294
+ // getValue 纯读操作,不做任何写入,避免触发引擎重评估其他 setter 的 initialValue
295
+ // (写操作会导致引擎重初始化 dataList 等 prop,画布图片回退到默认图)
290
296
  var styleWidth = getImageStyleNumber(target, 'width');
291
297
  if (styleWidth !== undefined) {
292
- var _target$getProps6, _target$getProps6$get;
293
- var currentWidth = parsePxNumber(target === null || target === void 0 ? void 0 : (_target$getProps6 = target.getProps()) === null || _target$getProps6 === void 0 ? void 0 : (_target$getProps6$get = _target$getProps6.getPropValue) === null || _target$getProps6$get === void 0 ? void 0 : _target$getProps6$get.call(_target$getProps6, 'imgWidth'));
294
- if (currentWidth !== styleWidth) {
295
- var _target$getProps7, _target$getProps7$set;
296
- target === null || target === void 0 ? void 0 : (_target$getProps7 = target.getProps()) === null || _target$getProps7 === void 0 ? void 0 : (_target$getProps7$set = _target$getProps7.setPropValue) === null || _target$getProps7$set === void 0 ? void 0 : _target$getProps7$set.call(_target$getProps7, 'imgWidth', styleWidth);
297
- }
298
298
  return styleWidth;
299
299
  }
300
- var propValue = target === null || target === void 0 ? void 0 : (_target$getProps8 = target.getProps()) === null || _target$getProps8 === void 0 ? void 0 : (_target$getProps8$get = _target$getProps8.getPropValue) === null || _target$getProps8$get === void 0 ? void 0 : _target$getProps8$get.call(_target$getProps8, 'imgWidth');
300
+ var propValue = target === null || target === void 0 ? void 0 : (_target$getProps6 = target.getProps()) === null || _target$getProps6 === void 0 ? void 0 : (_target$getProps6$get = _target$getProps6.getPropValue) === null || _target$getProps6$get === void 0 ? void 0 : _target$getProps6$get.call(_target$getProps6, 'imgWidth');
301
301
  var parsedPropValue = parsePxNumber(propValue);
302
302
  if (parsedPropValue !== undefined) {
303
- // prop 有值但子节点 style 中没有,同步写入子节点,保证引擎感知
304
- syncImageStyleValue(target, 'width', parsedPropValue);
305
303
  return parsedPropValue;
306
304
  }
307
- // getValue 始终返回默认值 100,不因数据源绑定而返回 undefined
308
- // isDataListBoundExpression 只影响 initialValue/defaultValue(防止初始化时误写入 mock 数据)
309
- // 同时将默认值 100 写入 prop 和子节点 style,确保后续引擎可感知
310
- target === null || target === void 0 ? void 0 : (_target$getProps9 = target.getProps()) === null || _target$getProps9 === void 0 ? void 0 : (_target$getProps9$set = _target$getProps9.setPropValue) === null || _target$getProps9$set === void 0 ? void 0 : _target$getProps9$set.call(_target$getProps9, 'imgWidth', 100);
311
- syncImageStyleValue(target, 'width', 100);
312
305
  return 100;
313
306
  },
314
307
  setValue: function setValue(target, value) {
@@ -328,12 +321,12 @@ var TeletextListMeta = {
328
321
  componentName: 'NumberSetter',
329
322
  isRequired: false,
330
323
  initialValue: function initialValue(target) {
331
- var _target$getProps0, _target$getProps0$get;
324
+ var _target$getProps7, _target$getProps7$get;
332
325
  var styleHeight = getImageStyleNumber(target, 'height');
333
326
  if (styleHeight !== undefined) {
334
327
  return styleHeight;
335
328
  }
336
- var propValue = target === null || target === void 0 ? void 0 : (_target$getProps0 = target.getProps()) === null || _target$getProps0 === void 0 ? void 0 : (_target$getProps0$get = _target$getProps0.getPropValue) === null || _target$getProps0$get === void 0 ? void 0 : _target$getProps0$get.call(_target$getProps0, 'imgHeight');
329
+ var propValue = target === null || target === void 0 ? void 0 : (_target$getProps7 = target.getProps()) === null || _target$getProps7 === void 0 ? void 0 : (_target$getProps7$get = _target$getProps7.getPropValue) === null || _target$getProps7$get === void 0 ? void 0 : _target$getProps7$get.call(_target$getProps7, 'imgHeight');
337
330
  var parsedPropValue = parsePxNumber(propValue);
338
331
  if (parsedPropValue !== undefined) return parsedPropValue;
339
332
  // 数据源已绑定时,避免回退为 100 触发误写回
@@ -343,12 +336,12 @@ var TeletextListMeta = {
343
336
  return 100;
344
337
  },
345
338
  defaultValue: function defaultValue(target) {
346
- var _target$getProps1, _target$getProps1$get;
339
+ var _target$getProps8, _target$getProps8$get;
347
340
  var styleHeight = getImageStyleNumber(target, 'height');
348
341
  if (styleHeight !== undefined) {
349
342
  return styleHeight;
350
343
  }
351
- var propValue = target === null || target === void 0 ? void 0 : (_target$getProps1 = target.getProps()) === null || _target$getProps1 === void 0 ? void 0 : (_target$getProps1$get = _target$getProps1.getPropValue) === null || _target$getProps1$get === void 0 ? void 0 : _target$getProps1$get.call(_target$getProps1, 'imgHeight');
344
+ var propValue = target === null || target === void 0 ? void 0 : (_target$getProps8 = target.getProps()) === null || _target$getProps8 === void 0 ? void 0 : (_target$getProps8$get = _target$getProps8.getPropValue) === null || _target$getProps8$get === void 0 ? void 0 : _target$getProps8$get.call(_target$getProps8, 'imgHeight');
352
345
  var parsedPropValue = parsePxNumber(propValue);
353
346
  if (parsedPropValue !== undefined) return parsedPropValue;
354
347
  if (isDataListBoundExpression(target)) {
@@ -359,28 +352,17 @@ var TeletextListMeta = {
359
352
  },
360
353
  extraProps: {
361
354
  getValue: function getValue(target) {
362
- var _target$getProps12, _target$getProps12$ge, _target$getProps13, _target$getProps13$se;
355
+ var _target$getProps9, _target$getProps9$get;
356
+ // getValue 纯读操作,不做任何写入,避免触发引擎重评估其他 setter 的 initialValue
363
357
  var styleHeight = getImageStyleNumber(target, 'height');
364
358
  if (styleHeight !== undefined) {
365
- var _target$getProps10, _target$getProps10$ge;
366
- var currentHeight = parsePxNumber(target === null || target === void 0 ? void 0 : (_target$getProps10 = target.getProps()) === null || _target$getProps10 === void 0 ? void 0 : (_target$getProps10$ge = _target$getProps10.getPropValue) === null || _target$getProps10$ge === void 0 ? void 0 : _target$getProps10$ge.call(_target$getProps10, 'imgHeight'));
367
- if (currentHeight !== styleHeight) {
368
- var _target$getProps11, _target$getProps11$se;
369
- target === null || target === void 0 ? void 0 : (_target$getProps11 = target.getProps()) === null || _target$getProps11 === void 0 ? void 0 : (_target$getProps11$se = _target$getProps11.setPropValue) === null || _target$getProps11$se === void 0 ? void 0 : _target$getProps11$se.call(_target$getProps11, 'imgHeight', styleHeight);
370
- }
371
359
  return styleHeight;
372
360
  }
373
- var propValue = target === null || target === void 0 ? void 0 : (_target$getProps12 = target.getProps()) === null || _target$getProps12 === void 0 ? void 0 : (_target$getProps12$ge = _target$getProps12.getPropValue) === null || _target$getProps12$ge === void 0 ? void 0 : _target$getProps12$ge.call(_target$getProps12, 'imgHeight');
361
+ var propValue = target === null || target === void 0 ? void 0 : (_target$getProps9 = target.getProps()) === null || _target$getProps9 === void 0 ? void 0 : (_target$getProps9$get = _target$getProps9.getPropValue) === null || _target$getProps9$get === void 0 ? void 0 : _target$getProps9$get.call(_target$getProps9, 'imgHeight');
374
362
  var parsedPropValue = parsePxNumber(propValue);
375
363
  if (parsedPropValue !== undefined) {
376
- // prop 有值但子节点 style 中没有,同步写入子节点,保证引擎感知
377
- syncImageStyleValue(target, 'height', parsedPropValue);
378
364
  return parsedPropValue;
379
365
  }
380
- // getValue 始终返回默认值 100,不因数据源绑定而返回 undefined
381
- // 同时将默认值 100 写入 prop 和子节点 style,确保后续引擎可感知
382
- target === null || target === void 0 ? void 0 : (_target$getProps13 = target.getProps()) === null || _target$getProps13 === void 0 ? void 0 : (_target$getProps13$se = _target$getProps13.setPropValue) === null || _target$getProps13$se === void 0 ? void 0 : _target$getProps13$se.call(_target$getProps13, 'imgHeight', 100);
383
- syncImageStyleValue(target, 'height', 100);
384
366
  return 100;
385
367
  },
386
368
  setValue: function setValue(target, value) {
@@ -858,22 +840,33 @@ var TeletextListMeta = {
858
840
  }
859
841
  }
860
842
  },
861
- initialValue: [{
862
- image: 'https://img.alicdn.com/tps/TB16TQvOXXXXXbiaFXXXXXXXXXX-120-120.svg',
863
- title: '标题名称',
864
- description: '说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字'
865
- }, {
866
- image: 'https://img.alicdn.com/tps/TB16TQvOXXXXXbiaFXXXXXXXXXX-120-120.svg',
867
- title: '标题名称',
868
- description: '说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字',
869
- tags: [{
870
- name: '报名火热',
871
- color: 'orange'
843
+ initialValue: function initialValue(target) {
844
+ var _target$getProps0, _target$getProps0$cal, _target$getProps0$cal2;
845
+ // 若 dataList prop 已有值(用户自定义数组、JSExpression 数据源绑定等),
846
+ // 直接返回当前值,防止引擎在任意 setPropValue 触发重评估时用静态默认数组
847
+ // 覆盖已设置的 dataList,导致画布图片回退为默认图(问题 12.4 残留路径)。
848
+ // 仅当 dataList 为 undefined(首次创建组件)时才注入默认占位数据。
849
+ var current = target === null || target === void 0 ? void 0 : (_target$getProps0 = target.getProps) === null || _target$getProps0 === void 0 ? void 0 : (_target$getProps0$cal = _target$getProps0.call(target)) === null || _target$getProps0$cal === void 0 ? void 0 : (_target$getProps0$cal2 = _target$getProps0$cal.getPropValue) === null || _target$getProps0$cal2 === void 0 ? void 0 : _target$getProps0$cal2.call(_target$getProps0$cal, 'dataList');
850
+ if (current !== undefined) {
851
+ return current;
852
+ }
853
+ return [{
854
+ image: 'https://img.alicdn.com/tps/TB16TQvOXXXXXbiaFXXXXXXXXXX-120-120.svg',
855
+ title: '标题名称',
856
+ description: '说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字'
872
857
  }, {
873
- name: '人数众多',
874
- color: 'blue'
875
- }]
876
- }]
858
+ image: 'https://img.alicdn.com/tps/TB16TQvOXXXXXbiaFXXXXXXXXXX-120-120.svg',
859
+ title: '标题名称',
860
+ description: '说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字',
861
+ tags: [{
862
+ name: '报名火热',
863
+ color: 'orange'
864
+ }, {
865
+ name: '人数众多',
866
+ color: 'blue'
867
+ }]
868
+ }];
869
+ }
877
870
  }
878
871
  }],
879
872
  supports: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dckj-npm/dc-material",
3
- "version": "0.1.364",
3
+ "version": "0.1.366",
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.364/build/lowcode/assets-prod.json"
117
+ "materialSchema": "https://unpkg.com/@dckj-npm/dc-material@0.1.366/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.364/build/index.html"
122
+ "homepage": "https://unpkg.com/@dckj-npm/dc-material@0.1.366/build/index.html"
123
123
  }