@dckj-npm/dc-material 0.1.362 → 0.1.364
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.
- package/build/docs/colorful-button.html +3 -3
- package/build/docs/colorful-input.html +3 -3
- package/build/docs/index.html +3 -3
- package/build/docs/teletext-list.html +3 -3
- package/build/docs/{umi.b6edaa19.js → umi.b8e0df6f.js} +1 -1
- package/build/docs/~demos/colorful-button-demo.html +3 -3
- package/build/docs/~demos/colorful-input-demo.html +3 -3
- package/build/docs/~demos/teletext-list-demo-1.html +3 -3
- package/build/docs/~demos/teletext-list-demo.html +3 -3
- package/build/lowcode/assets-daily.json +13 -13
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +13 -13
- package/build/lowcode/meta.design.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/dist/BizComps.js +1 -1
- package/dist/BizComps.js.map +1 -1
- package/es/components/teletext-list/teletext-list-item.js +2 -2
- package/lib/components/teletext-list/teletext-list-item.js +2 -2
- package/lowcode/teletext-list/meta.ts +131 -23
- package/lowcode_es/meta.js +1 -1
- package/lowcode_es/teletext-list/meta.js +152 -45
- package/lowcode_lib/meta.js +1 -1
- package/lowcode_lib/teletext-list/meta.js +154 -47
- package/package.json +3 -3
|
@@ -61,11 +61,11 @@ 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({}, typeof imgWidth === 'number' ? {
|
|
64
|
+
var imageStyle = _extends({}, (imageChildProps === null || imageChildProps === void 0 ? void 0 : imageChildProps.style) || {}, typeof imgWidth === 'number' ? {
|
|
65
65
|
width: imgWidth + "px"
|
|
66
66
|
} : {}, typeof imgHeight === 'number' ? {
|
|
67
67
|
height: imgHeight + "px"
|
|
68
|
-
} : {}
|
|
68
|
+
} : {});
|
|
69
69
|
var containerStyle = _extends({
|
|
70
70
|
padding: itemPadding + "px",
|
|
71
71
|
backgroundColor: itemBgColor,
|
|
@@ -66,11 +66,11 @@ 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"])({}, typeof imgWidth === 'number' ? {
|
|
69
|
+
var imageStyle = (0, _extends2["default"])({}, (imageChildProps === null || imageChildProps === void 0 ? void 0 : imageChildProps.style) || {}, typeof imgWidth === 'number' ? {
|
|
70
70
|
width: imgWidth + "px"
|
|
71
71
|
} : {}, typeof imgHeight === 'number' ? {
|
|
72
72
|
height: imgHeight + "px"
|
|
73
|
-
} : {}
|
|
73
|
+
} : {});
|
|
74
74
|
var containerStyle = (0, _extends2["default"])({
|
|
75
75
|
padding: itemPadding + "px",
|
|
76
76
|
backgroundColor: itemBgColor,
|
|
@@ -41,13 +41,56 @@ const findImageChildSchema = (target: any): any | undefined => {
|
|
|
41
41
|
})
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
/**
|
|
45
|
+
* 通过引擎的 IPublicModelNode API 查找 key='image' 的子节点。
|
|
46
|
+
* 相比直接读 node.schema.children,这里使用的是引擎可感知的公共 API,
|
|
47
|
+
* 保证后续 setPropValue/getPropValue 操作能被引擎正确追踪(触发响应式更新)。
|
|
48
|
+
*/
|
|
49
|
+
const findImageChildNode = (target: any): any | undefined => {
|
|
50
|
+
const children = target?.node?.children
|
|
51
|
+
if (!children) return undefined
|
|
52
|
+
if (typeof children.find === 'function') {
|
|
53
|
+
return children.find((child: any) => {
|
|
54
|
+
return normalizeNodeKey(child?.getPropValue?.('key')) === IMAGE_KEY
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
return undefined
|
|
58
|
+
}
|
|
59
|
+
|
|
44
60
|
const getImageStyleNumber = (target: any, styleKey: 'width' | 'height'): number | undefined => {
|
|
61
|
+
// 优先通过引擎 API 读取,保证与 syncImageStyleValue 写入来源一致
|
|
62
|
+
const imageChildNode = findImageChildNode(target)
|
|
63
|
+
if (imageChildNode) {
|
|
64
|
+
return parsePxNumber(imageChildNode.getPropValue?.('style')?.[styleKey])
|
|
65
|
+
}
|
|
66
|
+
// 降级:从 schema 快照读取
|
|
45
67
|
const imageChildSchema = findImageChildSchema(target)
|
|
46
|
-
|
|
47
|
-
return parsePxNumber(childStyleValue)
|
|
68
|
+
return parsePxNumber(imageChildSchema?.props?.style?.[styleKey])
|
|
48
69
|
}
|
|
49
70
|
|
|
50
71
|
const syncImageStyleValue = (target: any, styleKey: 'width' | 'height', value: number) => {
|
|
72
|
+
// 优先通过引擎节点 API 更新子节点 style,确保引擎感知变化(布局面板读取时可见)
|
|
73
|
+
const imageChildNode = findImageChildNode(target)
|
|
74
|
+
if (imageChildNode) {
|
|
75
|
+
const currentStyle = imageChildNode.getPropValue?.('style') || {}
|
|
76
|
+
// 同时确保 width/height 都存在于子节点 style 中,防止布局面板 replace 时丢失其中一个
|
|
77
|
+
const updatedStyle: Record<string, any> = { ...currentStyle, [styleKey]: `${value}px` }
|
|
78
|
+
// 如果另一轴尺寸在子节点 style 中不存在,则从父级 prop 补充,保证两轴都写入
|
|
79
|
+
const otherKey = styleKey === 'width' ? 'height' : 'width'
|
|
80
|
+
if (!updatedStyle[otherKey]) {
|
|
81
|
+
const otherPropKey = otherKey === 'width' ? 'imgWidth' : 'imgHeight'
|
|
82
|
+
const otherPropValue = parsePxNumber(target?.getProps?.()?.getPropValue?.(otherPropKey))
|
|
83
|
+
if (otherPropValue !== undefined) {
|
|
84
|
+
updatedStyle[otherKey] = `${otherPropValue}px`
|
|
85
|
+
} else {
|
|
86
|
+
// 子节点 style 也没有,使用默认值 100
|
|
87
|
+
updatedStyle[otherKey] = '100px'
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
imageChildNode.setPropValue?.('style', updatedStyle)
|
|
91
|
+
return
|
|
92
|
+
}
|
|
93
|
+
// 降级:直接写 schema(引擎无法感知,但保留作为兜底)
|
|
51
94
|
const imageChildSchema = findImageChildSchema(target)
|
|
52
95
|
if (!imageChildSchema) {
|
|
53
96
|
return
|
|
@@ -82,6 +125,15 @@ const syncImageDimensionPropsFromChild = (target: any) => {
|
|
|
82
125
|
}
|
|
83
126
|
}
|
|
84
127
|
|
|
128
|
+
const isDataListBoundExpression = (target: any): boolean => {
|
|
129
|
+
const dataListValue = target?.getProps?.()?.getPropValue?.('dataList')
|
|
130
|
+
return !!(
|
|
131
|
+
dataListValue &&
|
|
132
|
+
typeof dataListValue === 'object' &&
|
|
133
|
+
(dataListValue as any).type === 'JSExpression'
|
|
134
|
+
)
|
|
135
|
+
}
|
|
136
|
+
|
|
85
137
|
const TeletextListMeta: IPublicTypeComponentMetadata = {
|
|
86
138
|
group: '低代码组件',
|
|
87
139
|
componentName: 'TeletextList',
|
|
@@ -207,7 +259,16 @@ const TeletextListMeta: IPublicTypeComponentMetadata = {
|
|
|
207
259
|
},
|
|
208
260
|
extraProps: {
|
|
209
261
|
setValue: (target, value) => {
|
|
210
|
-
target.getProps()
|
|
262
|
+
const props = target.getProps()
|
|
263
|
+
// 显式快照需要保护的配置,防止引擎某些实现在写入时触发重初始化导致配置丢失
|
|
264
|
+
const prevDataList = props.getPropValue('dataList')
|
|
265
|
+
const prevDataListBind = props.getPropValue('dataListBind')
|
|
266
|
+
const prevTextImgGap = props.getPropValue('textImgGap')
|
|
267
|
+
props.setPropValue('imagePlacement', value)
|
|
268
|
+
// 写回被保护的配置(幂等操作,若引擎未重置则无副作用)
|
|
269
|
+
if (prevDataList !== undefined) props.setPropValue('dataList', prevDataList)
|
|
270
|
+
if (prevDataListBind !== undefined) props.setPropValue('dataListBind', prevDataListBind)
|
|
271
|
+
if (prevTextImgGap !== undefined) props.setPropValue('textImgGap', prevTextImgGap)
|
|
211
272
|
// 切换图片布局时同步一次子图片尺寸,避免面板回退到默认值
|
|
212
273
|
syncImageDimensionPropsFromChild(target)
|
|
213
274
|
},
|
|
@@ -228,9 +289,25 @@ const TeletextListMeta: IPublicTypeComponentMetadata = {
|
|
|
228
289
|
const propValue = target?.getProps()?.getPropValue?.('imgWidth')
|
|
229
290
|
const parsedPropValue = parsePxNumber(propValue)
|
|
230
291
|
if (parsedPropValue !== undefined) return parsedPropValue
|
|
231
|
-
|
|
292
|
+
// 数据源已绑定时,避免回退为 100 触发误写回
|
|
293
|
+
if (isDataListBoundExpression(target)) {
|
|
294
|
+
return undefined
|
|
295
|
+
}
|
|
296
|
+
return 100
|
|
297
|
+
},
|
|
298
|
+
defaultValue: (target) => {
|
|
299
|
+
const styleWidth = getImageStyleNumber(target, 'width')
|
|
300
|
+
if (styleWidth !== undefined) {
|
|
301
|
+
return styleWidth
|
|
302
|
+
}
|
|
303
|
+
const propValue = target?.getProps()?.getPropValue?.('imgWidth')
|
|
304
|
+
const parsedPropValue = parsePxNumber(propValue)
|
|
305
|
+
if (parsedPropValue !== undefined) return parsedPropValue
|
|
306
|
+
if (isDataListBoundExpression(target)) {
|
|
307
|
+
return undefined
|
|
308
|
+
}
|
|
309
|
+
return 100
|
|
232
310
|
},
|
|
233
|
-
defaultValue: (target) => getImageStyleNumber(target, 'width') ?? 100,
|
|
234
311
|
},
|
|
235
312
|
extraProps: {
|
|
236
313
|
getValue: (target) => {
|
|
@@ -245,9 +322,16 @@ const TeletextListMeta: IPublicTypeComponentMetadata = {
|
|
|
245
322
|
const propValue = target?.getProps()?.getPropValue?.('imgWidth')
|
|
246
323
|
const parsedPropValue = parsePxNumber(propValue)
|
|
247
324
|
if (parsedPropValue !== undefined) {
|
|
325
|
+
// prop 有值但子节点 style 中没有,同步写入子节点,保证引擎感知
|
|
326
|
+
syncImageStyleValue(target, 'width', parsedPropValue)
|
|
248
327
|
return parsedPropValue
|
|
249
328
|
}
|
|
250
|
-
|
|
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
|
+
return 100
|
|
251
335
|
},
|
|
252
336
|
setValue: (target, value) => {
|
|
253
337
|
const parsedValue = parsePxNumber(value)
|
|
@@ -274,9 +358,25 @@ const TeletextListMeta: IPublicTypeComponentMetadata = {
|
|
|
274
358
|
const propValue = target?.getProps()?.getPropValue?.('imgHeight')
|
|
275
359
|
const parsedPropValue = parsePxNumber(propValue)
|
|
276
360
|
if (parsedPropValue !== undefined) return parsedPropValue
|
|
277
|
-
|
|
361
|
+
// 数据源已绑定时,避免回退为 100 触发误写回
|
|
362
|
+
if (isDataListBoundExpression(target)) {
|
|
363
|
+
return undefined
|
|
364
|
+
}
|
|
365
|
+
return 100
|
|
366
|
+
},
|
|
367
|
+
defaultValue: (target) => {
|
|
368
|
+
const styleHeight = getImageStyleNumber(target, 'height')
|
|
369
|
+
if (styleHeight !== undefined) {
|
|
370
|
+
return styleHeight
|
|
371
|
+
}
|
|
372
|
+
const propValue = target?.getProps()?.getPropValue?.('imgHeight')
|
|
373
|
+
const parsedPropValue = parsePxNumber(propValue)
|
|
374
|
+
if (parsedPropValue !== undefined) return parsedPropValue
|
|
375
|
+
if (isDataListBoundExpression(target)) {
|
|
376
|
+
return undefined
|
|
377
|
+
}
|
|
378
|
+
return 100
|
|
278
379
|
},
|
|
279
|
-
defaultValue: (target) => getImageStyleNumber(target, 'height') ?? 100,
|
|
280
380
|
},
|
|
281
381
|
extraProps: {
|
|
282
382
|
getValue: (target) => {
|
|
@@ -291,9 +391,15 @@ const TeletextListMeta: IPublicTypeComponentMetadata = {
|
|
|
291
391
|
const propValue = target?.getProps()?.getPropValue?.('imgHeight')
|
|
292
392
|
const parsedPropValue = parsePxNumber(propValue)
|
|
293
393
|
if (parsedPropValue !== undefined) {
|
|
394
|
+
// prop 有值但子节点 style 中没有,同步写入子节点,保证引擎感知
|
|
395
|
+
syncImageStyleValue(target, 'height', parsedPropValue)
|
|
294
396
|
return parsedPropValue
|
|
295
397
|
}
|
|
296
|
-
|
|
398
|
+
// getValue 始终返回默认值 100,不因数据源绑定而返回 undefined
|
|
399
|
+
// 同时将默认值 100 写入 prop 和子节点 style,确保后续引擎可感知
|
|
400
|
+
target?.getProps()?.setPropValue?.('imgHeight', 100)
|
|
401
|
+
syncImageStyleValue(target, 'height', 100)
|
|
402
|
+
return 100
|
|
297
403
|
},
|
|
298
404
|
setValue: (target, value) => {
|
|
299
405
|
const parsedValue = parsePxNumber(value)
|
|
@@ -400,21 +506,23 @@ const TeletextListMeta: IPublicTypeComponentMetadata = {
|
|
|
400
506
|
node?.children?.push(newChild)
|
|
401
507
|
}
|
|
402
508
|
} else if (value < currentLength) {
|
|
403
|
-
//
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
509
|
+
// 收集需要移除的节点,再调用 child.remove() 通过引擎 API 逐个删除
|
|
510
|
+
// 避免 node.children = [...] 直接赋值(IPublicModelNodeChildren 不支持重新赋值)
|
|
511
|
+
const nodesToRemove: any[] = []
|
|
512
|
+
node?.children?.forEach?.((child: any) => {
|
|
513
|
+
const key = child?.schema?.props?.key
|
|
514
|
+
if (
|
|
515
|
+
child?.componentName === 'NextText' &&
|
|
516
|
+
typeof key === 'string' &&
|
|
517
|
+
key.startsWith('text-')
|
|
518
|
+
) {
|
|
413
519
|
const order = Number(key.split('-')[1])
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
520
|
+
if (!Number.isNaN(order) && order > value) {
|
|
521
|
+
nodesToRemove.push(child)
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
})
|
|
525
|
+
nodesToRemove.forEach((child) => child?.remove?.())
|
|
418
526
|
}
|
|
419
527
|
|
|
420
528
|
// 更新数据源绑定的配置
|
package/lowcode_es/meta.js
CHANGED
|
@@ -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.
|
|
120
|
+
version = '0.1.364';
|
|
121
121
|
}
|
|
122
122
|
if (basicLibraryVersion === void 0) {
|
|
123
123
|
basicLibraryVersion = {
|
|
@@ -34,14 +34,62 @@ var findImageChildSchema = function findImageChildSchema(target) {
|
|
|
34
34
|
return keyFromProps === IMAGE_KEY || keyFromNode === IMAGE_KEY;
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* 通过引擎的 IPublicModelNode API 查找 key='image' 的子节点。
|
|
40
|
+
* 相比直接读 node.schema.children,这里使用的是引擎可感知的公共 API,
|
|
41
|
+
* 保证后续 setPropValue/getPropValue 操作能被引擎正确追踪(触发响应式更新)。
|
|
42
|
+
*/
|
|
43
|
+
var findImageChildNode = function findImageChildNode(target) {
|
|
44
|
+
var _target$node2;
|
|
45
|
+
var children = target === null || target === void 0 ? void 0 : (_target$node2 = target.node) === null || _target$node2 === void 0 ? void 0 : _target$node2.children;
|
|
46
|
+
if (!children) return undefined;
|
|
47
|
+
if (typeof children.find === 'function') {
|
|
48
|
+
return children.find(function (child) {
|
|
49
|
+
var _child$getPropValue;
|
|
50
|
+
return normalizeNodeKey(child === null || child === void 0 ? void 0 : (_child$getPropValue = child.getPropValue) === null || _child$getPropValue === void 0 ? void 0 : _child$getPropValue.call(child, 'key')) === IMAGE_KEY;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return undefined;
|
|
54
|
+
};
|
|
37
55
|
var getImageStyleNumber = function getImageStyleNumber(target, styleKey) {
|
|
38
56
|
var _imageChildSchema$pro, _imageChildSchema$pro2;
|
|
57
|
+
// 优先通过引擎 API 读取,保证与 syncImageStyleValue 写入来源一致
|
|
58
|
+
var imageChildNode = findImageChildNode(target);
|
|
59
|
+
if (imageChildNode) {
|
|
60
|
+
var _imageChildNode$getPr, _imageChildNode$getPr2;
|
|
61
|
+
return parsePxNumber((_imageChildNode$getPr = imageChildNode.getPropValue) === null || _imageChildNode$getPr === void 0 ? void 0 : (_imageChildNode$getPr2 = _imageChildNode$getPr.call(imageChildNode, 'style')) === null || _imageChildNode$getPr2 === void 0 ? void 0 : _imageChildNode$getPr2[styleKey]);
|
|
62
|
+
}
|
|
63
|
+
// 降级:从 schema 快照读取
|
|
39
64
|
var imageChildSchema = findImageChildSchema(target);
|
|
40
|
-
|
|
41
|
-
return parsePxNumber(childStyleValue);
|
|
65
|
+
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]);
|
|
42
66
|
};
|
|
43
67
|
var syncImageStyleValue = function syncImageStyleValue(target, styleKey, value) {
|
|
44
|
-
var
|
|
68
|
+
var _extends3;
|
|
69
|
+
// 优先通过引擎节点 API 更新子节点 style,确保引擎感知变化(布局面板读取时可见)
|
|
70
|
+
var imageChildNode = findImageChildNode(target);
|
|
71
|
+
if (imageChildNode) {
|
|
72
|
+
var _imageChildNode$getPr3, _extends2, _imageChildNode$setPr;
|
|
73
|
+
var _currentStyle = ((_imageChildNode$getPr3 = imageChildNode.getPropValue) === null || _imageChildNode$getPr3 === void 0 ? void 0 : _imageChildNode$getPr3.call(imageChildNode, 'style')) || {};
|
|
74
|
+
// 同时确保 width/height 都存在于子节点 style 中,防止布局面板 replace 时丢失其中一个
|
|
75
|
+
var updatedStyle = _extends({}, _currentStyle, (_extends2 = {}, _extends2[styleKey] = value + "px", _extends2));
|
|
76
|
+
// 如果另一轴尺寸在子节点 style 中不存在,则从父级 prop 补充,保证两轴都写入
|
|
77
|
+
var otherKey = styleKey === 'width' ? 'height' : 'width';
|
|
78
|
+
if (!updatedStyle[otherKey]) {
|
|
79
|
+
var _target$getProps, _target$getProps$call, _target$getProps$call2;
|
|
80
|
+
var otherPropKey = otherKey === 'width' ? 'imgWidth' : 'imgHeight';
|
|
81
|
+
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));
|
|
82
|
+
if (otherPropValue !== undefined) {
|
|
83
|
+
updatedStyle[otherKey] = otherPropValue + "px";
|
|
84
|
+
} else {
|
|
85
|
+
// 子节点 style 也没有,使用默认值 100
|
|
86
|
+
updatedStyle[otherKey] = '100px';
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
(_imageChildNode$setPr = imageChildNode.setPropValue) === null || _imageChildNode$setPr === void 0 ? void 0 : _imageChildNode$setPr.call(imageChildNode, 'style', updatedStyle);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
// 降级:直接写 schema(引擎无法感知,但保留作为兜底)
|
|
45
93
|
var imageChildSchema = findImageChildSchema(target);
|
|
46
94
|
if (!imageChildSchema) {
|
|
47
95
|
return;
|
|
@@ -50,13 +98,13 @@ var syncImageStyleValue = function syncImageStyleValue(target, styleKey, value)
|
|
|
50
98
|
imageChildSchema.props = {};
|
|
51
99
|
}
|
|
52
100
|
var currentStyle = imageChildSchema.props.style || {};
|
|
53
|
-
imageChildSchema.props.style = _extends({}, currentStyle, (
|
|
101
|
+
imageChildSchema.props.style = _extends({}, currentStyle, (_extends3 = {}, _extends3[styleKey] = value + "px", _extends3));
|
|
54
102
|
};
|
|
55
103
|
var syncImageDimensionPropsFromChild = function syncImageDimensionPropsFromChild(target) {
|
|
56
|
-
var _target$
|
|
104
|
+
var _target$getProps2;
|
|
57
105
|
var widthFromChild = getImageStyleNumber(target, 'width');
|
|
58
106
|
var heightFromChild = getImageStyleNumber(target, 'height');
|
|
59
|
-
var propsApi = target === null || target === void 0 ? void 0 : (_target$
|
|
107
|
+
var propsApi = target === null || target === void 0 ? void 0 : (_target$getProps2 = target.getProps) === null || _target$getProps2 === void 0 ? void 0 : _target$getProps2.call(target);
|
|
60
108
|
if (propsApi && widthFromChild !== undefined) {
|
|
61
109
|
var _propsApi$getPropValu;
|
|
62
110
|
var currentWidth = parsePxNumber((_propsApi$getPropValu = propsApi.getPropValue) === null || _propsApi$getPropValu === void 0 ? void 0 : _propsApi$getPropValu.call(propsApi, 'imgWidth'));
|
|
@@ -72,6 +120,11 @@ var syncImageDimensionPropsFromChild = function syncImageDimensionPropsFromChild
|
|
|
72
120
|
}
|
|
73
121
|
}
|
|
74
122
|
};
|
|
123
|
+
var isDataListBoundExpression = function isDataListBoundExpression(target) {
|
|
124
|
+
var _target$getProps3, _target$getProps3$cal, _target$getProps3$cal2;
|
|
125
|
+
var dataListValue = target === null || target === void 0 ? void 0 : (_target$getProps3 = target.getProps) === null || _target$getProps3 === void 0 ? void 0 : (_target$getProps3$cal = _target$getProps3.call(target)) === null || _target$getProps3$cal === void 0 ? void 0 : (_target$getProps3$cal2 = _target$getProps3$cal.getPropValue) === null || _target$getProps3$cal2 === void 0 ? void 0 : _target$getProps3$cal2.call(_target$getProps3$cal, 'dataList');
|
|
126
|
+
return !!(dataListValue && typeof dataListValue === 'object' && dataListValue.type === 'JSExpression');
|
|
127
|
+
};
|
|
75
128
|
var TeletextListMeta = {
|
|
76
129
|
group: '低代码组件',
|
|
77
130
|
componentName: 'TeletextList',
|
|
@@ -175,7 +228,16 @@ var TeletextListMeta = {
|
|
|
175
228
|
},
|
|
176
229
|
extraProps: {
|
|
177
230
|
setValue: function setValue(target, value) {
|
|
178
|
-
target.getProps()
|
|
231
|
+
var props = target.getProps();
|
|
232
|
+
// 显式快照需要保护的配置,防止引擎某些实现在写入时触发重初始化导致配置丢失
|
|
233
|
+
var prevDataList = props.getPropValue('dataList');
|
|
234
|
+
var prevDataListBind = props.getPropValue('dataListBind');
|
|
235
|
+
var prevTextImgGap = props.getPropValue('textImgGap');
|
|
236
|
+
props.setPropValue('imagePlacement', value);
|
|
237
|
+
// 写回被保护的配置(幂等操作,若引擎未重置则无副作用)
|
|
238
|
+
if (prevDataList !== undefined) props.setPropValue('dataList', prevDataList);
|
|
239
|
+
if (prevDataListBind !== undefined) props.setPropValue('dataListBind', prevDataListBind);
|
|
240
|
+
if (prevTextImgGap !== undefined) props.setPropValue('textImgGap', prevTextImgGap);
|
|
179
241
|
// 切换图片布局时同步一次子图片尺寸,避免面板回退到默认值
|
|
180
242
|
syncImageDimensionPropsFromChild(target);
|
|
181
243
|
}
|
|
@@ -188,40 +250,61 @@ var TeletextListMeta = {
|
|
|
188
250
|
componentName: 'NumberSetter',
|
|
189
251
|
isRequired: false,
|
|
190
252
|
initialValue: function initialValue(target) {
|
|
191
|
-
var _target$
|
|
253
|
+
var _target$getProps4, _target$getProps4$get;
|
|
192
254
|
var styleWidth = getImageStyleNumber(target, 'width');
|
|
193
255
|
if (styleWidth !== undefined) {
|
|
194
256
|
return styleWidth;
|
|
195
257
|
}
|
|
196
|
-
var propValue = target === null || target === void 0 ? void 0 : (_target$
|
|
258
|
+
var propValue = target === null || target === void 0 ? void 0 : (_target$getProps4 = target.getProps()) === null || _target$getProps4 === void 0 ? void 0 : (_target$getProps4$get = _target$getProps4.getPropValue) === null || _target$getProps4$get === void 0 ? void 0 : _target$getProps4$get.call(_target$getProps4, 'imgWidth');
|
|
197
259
|
var parsedPropValue = parsePxNumber(propValue);
|
|
198
260
|
if (parsedPropValue !== undefined) return parsedPropValue;
|
|
199
|
-
|
|
261
|
+
// 数据源已绑定时,避免回退为 100 触发误写回
|
|
262
|
+
if (isDataListBoundExpression(target)) {
|
|
263
|
+
return undefined;
|
|
264
|
+
}
|
|
265
|
+
return 100;
|
|
200
266
|
},
|
|
201
267
|
defaultValue: function defaultValue(target) {
|
|
202
|
-
var
|
|
203
|
-
|
|
268
|
+
var _target$getProps5, _target$getProps5$get;
|
|
269
|
+
var styleWidth = getImageStyleNumber(target, 'width');
|
|
270
|
+
if (styleWidth !== undefined) {
|
|
271
|
+
return styleWidth;
|
|
272
|
+
}
|
|
273
|
+
var propValue = target === null || target === void 0 ? void 0 : (_target$getProps5 = target.getProps()) === null || _target$getProps5 === void 0 ? void 0 : (_target$getProps5$get = _target$getProps5.getPropValue) === null || _target$getProps5$get === void 0 ? void 0 : _target$getProps5$get.call(_target$getProps5, 'imgWidth');
|
|
274
|
+
var parsedPropValue = parsePxNumber(propValue);
|
|
275
|
+
if (parsedPropValue !== undefined) return parsedPropValue;
|
|
276
|
+
if (isDataListBoundExpression(target)) {
|
|
277
|
+
return undefined;
|
|
278
|
+
}
|
|
279
|
+
return 100;
|
|
204
280
|
}
|
|
205
281
|
},
|
|
206
282
|
extraProps: {
|
|
207
283
|
getValue: function getValue(target) {
|
|
208
|
-
var _target$
|
|
284
|
+
var _target$getProps8, _target$getProps8$get, _target$getProps9, _target$getProps9$set;
|
|
209
285
|
var styleWidth = getImageStyleNumber(target, 'width');
|
|
210
286
|
if (styleWidth !== undefined) {
|
|
211
|
-
var _target$
|
|
212
|
-
var currentWidth = parsePxNumber(target === null || target === void 0 ? void 0 : (_target$
|
|
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'));
|
|
213
289
|
if (currentWidth !== styleWidth) {
|
|
214
|
-
var _target$
|
|
215
|
-
target === null || target === void 0 ? void 0 : (_target$
|
|
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);
|
|
216
292
|
}
|
|
217
293
|
return styleWidth;
|
|
218
294
|
}
|
|
219
|
-
var propValue = target === null || target === void 0 ? void 0 : (_target$
|
|
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');
|
|
220
296
|
var parsedPropValue = parsePxNumber(propValue);
|
|
221
297
|
if (parsedPropValue !== undefined) {
|
|
298
|
+
// prop 有值但子节点 style 中没有,同步写入子节点,保证引擎感知
|
|
299
|
+
syncImageStyleValue(target, 'width', parsedPropValue);
|
|
222
300
|
return parsedPropValue;
|
|
223
301
|
}
|
|
224
|
-
|
|
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
|
+
return 100;
|
|
225
308
|
},
|
|
226
309
|
setValue: function setValue(target, value) {
|
|
227
310
|
var parsedValue = parsePxNumber(value);
|
|
@@ -240,40 +323,60 @@ var TeletextListMeta = {
|
|
|
240
323
|
componentName: 'NumberSetter',
|
|
241
324
|
isRequired: false,
|
|
242
325
|
initialValue: function initialValue(target) {
|
|
243
|
-
var _target$
|
|
326
|
+
var _target$getProps0, _target$getProps0$get;
|
|
244
327
|
var styleHeight = getImageStyleNumber(target, 'height');
|
|
245
328
|
if (styleHeight !== undefined) {
|
|
246
329
|
return styleHeight;
|
|
247
330
|
}
|
|
248
|
-
var propValue = target === null || target === void 0 ? void 0 : (_target$
|
|
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');
|
|
249
332
|
var parsedPropValue = parsePxNumber(propValue);
|
|
250
333
|
if (parsedPropValue !== undefined) return parsedPropValue;
|
|
251
|
-
|
|
334
|
+
// 数据源已绑定时,避免回退为 100 触发误写回
|
|
335
|
+
if (isDataListBoundExpression(target)) {
|
|
336
|
+
return undefined;
|
|
337
|
+
}
|
|
338
|
+
return 100;
|
|
252
339
|
},
|
|
253
340
|
defaultValue: function defaultValue(target) {
|
|
254
|
-
var
|
|
255
|
-
|
|
341
|
+
var _target$getProps1, _target$getProps1$get;
|
|
342
|
+
var styleHeight = getImageStyleNumber(target, 'height');
|
|
343
|
+
if (styleHeight !== undefined) {
|
|
344
|
+
return styleHeight;
|
|
345
|
+
}
|
|
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');
|
|
347
|
+
var parsedPropValue = parsePxNumber(propValue);
|
|
348
|
+
if (parsedPropValue !== undefined) return parsedPropValue;
|
|
349
|
+
if (isDataListBoundExpression(target)) {
|
|
350
|
+
return undefined;
|
|
351
|
+
}
|
|
352
|
+
return 100;
|
|
256
353
|
}
|
|
257
354
|
},
|
|
258
355
|
extraProps: {
|
|
259
356
|
getValue: function getValue(target) {
|
|
260
|
-
var _target$
|
|
357
|
+
var _target$getProps12, _target$getProps12$ge, _target$getProps13, _target$getProps13$se;
|
|
261
358
|
var styleHeight = getImageStyleNumber(target, 'height');
|
|
262
359
|
if (styleHeight !== undefined) {
|
|
263
|
-
var _target$
|
|
264
|
-
var currentHeight = parsePxNumber(target === null || target === void 0 ? void 0 : (_target$
|
|
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'));
|
|
265
362
|
if (currentHeight !== styleHeight) {
|
|
266
|
-
var _target$
|
|
267
|
-
target === null || target === void 0 ? void 0 : (_target$
|
|
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);
|
|
268
365
|
}
|
|
269
366
|
return styleHeight;
|
|
270
367
|
}
|
|
271
|
-
var propValue = target === null || target === void 0 ? void 0 : (_target$
|
|
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');
|
|
272
369
|
var parsedPropValue = parsePxNumber(propValue);
|
|
273
370
|
if (parsedPropValue !== undefined) {
|
|
371
|
+
// prop 有值但子节点 style 中没有,同步写入子节点,保证引擎感知
|
|
372
|
+
syncImageStyleValue(target, 'height', parsedPropValue);
|
|
274
373
|
return parsedPropValue;
|
|
275
374
|
}
|
|
276
|
-
|
|
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
|
+
return 100;
|
|
277
380
|
},
|
|
278
381
|
setValue: function setValue(target, value) {
|
|
279
382
|
var parsedValue = parsePxNumber(value);
|
|
@@ -355,9 +458,9 @@ var TeletextListMeta = {
|
|
|
355
458
|
},
|
|
356
459
|
extraProps: {
|
|
357
460
|
setValue: function setValue(target, value) {
|
|
358
|
-
var _target$
|
|
461
|
+
var _target$node3, _schemaChildren$filte, _target$parent, _target$parent$items;
|
|
359
462
|
target.getProps().setPropValue('textLines', value);
|
|
360
|
-
var schema = target === null || target === void 0 ? void 0 : (_target$
|
|
463
|
+
var schema = target === null || target === void 0 ? void 0 : (_target$node3 = target.node) === null || _target$node3 === void 0 ? void 0 : _target$node3.schema;
|
|
361
464
|
var node = target === null || target === void 0 ? void 0 : target.node;
|
|
362
465
|
var schemaChildren = Array.isArray(schema === null || schema === void 0 ? void 0 : schema.children) ? schema.children : [];
|
|
363
466
|
|
|
@@ -381,20 +484,24 @@ var TeletextListMeta = {
|
|
|
381
484
|
node === null || node === void 0 ? void 0 : (_node$children = node.children) === null || _node$children === void 0 ? void 0 : _node$children.push(newChild);
|
|
382
485
|
}
|
|
383
486
|
} else if (value < currentLength) {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
var key = child === null || child === void 0 ? void 0 : (_child$
|
|
391
|
-
if (
|
|
392
|
-
|
|
487
|
+
var _node$children2, _node$children2$forEa;
|
|
488
|
+
// 收集需要移除的节点,再调用 child.remove() 通过引擎 API 逐个删除
|
|
489
|
+
// 避免 node.children = [...] 直接赋值(IPublicModelNodeChildren 不支持重新赋值)
|
|
490
|
+
var nodesToRemove = [];
|
|
491
|
+
node === null || node === void 0 ? void 0 : (_node$children2 = node.children) === null || _node$children2 === void 0 ? void 0 : (_node$children2$forEa = _node$children2.forEach) === null || _node$children2$forEa === void 0 ? void 0 : _node$children2$forEa.call(_node$children2, function (child) {
|
|
492
|
+
var _child$schema, _child$schema$props;
|
|
493
|
+
var key = child === null || child === void 0 ? void 0 : (_child$schema = child.schema) === null || _child$schema === void 0 ? void 0 : (_child$schema$props = _child$schema.props) === null || _child$schema$props === void 0 ? void 0 : _child$schema$props.key;
|
|
494
|
+
if ((child === null || child === void 0 ? void 0 : child.componentName) === 'NextText' && typeof key === 'string' && key.startsWith('text-')) {
|
|
495
|
+
var order = Number(key.split('-')[1]);
|
|
496
|
+
if (!Number.isNaN(order) && order > value) {
|
|
497
|
+
nodesToRemove.push(child);
|
|
498
|
+
}
|
|
393
499
|
}
|
|
394
|
-
var order = Number(key.split('-')[1]);
|
|
395
|
-
return Number.isNaN(order) || order <= value;
|
|
396
500
|
});
|
|
397
|
-
|
|
501
|
+
nodesToRemove.forEach(function (child) {
|
|
502
|
+
var _child$remove;
|
|
503
|
+
return child === null || child === void 0 ? void 0 : (_child$remove = child.remove) === null || _child$remove === void 0 ? void 0 : _child$remove.call(child);
|
|
504
|
+
});
|
|
398
505
|
}
|
|
399
506
|
|
|
400
507
|
// 更新数据源绑定的配置
|
package/lowcode_lib/meta.js
CHANGED
|
@@ -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.
|
|
125
|
+
version = '0.1.364';
|
|
126
126
|
}
|
|
127
127
|
if (basicLibraryVersion === void 0) {
|
|
128
128
|
basicLibraryVersion = {
|