@dckj-npm/dc-material 0.1.361 → 0.1.363
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 +48 -0
- package/build/docs/umi.399a9633.js +1 -0
- package/build/docs/{umi.a2a18b22.css → umi.6743fcd4.css} +2 -2
- 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 +47 -0
- package/build/docs/~demos/teletext-list-demo.html +47 -0
- 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.css +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +1 -1
- package/dist/BizComps.css +1 -1
- package/dist/BizComps.js +1 -1
- package/dist/BizComps.js.map +1 -1
- package/es/components/teletext-list/index.scss +9 -0
- package/es/components/teletext-list/teletext-list-item.d.ts +5 -1
- package/es/components/teletext-list/teletext-list-item.js +32 -24
- package/es/components/teletext-list/teletext-list-item.scss +0 -16
- package/es/components/teletext-list/teletext-list.d.ts +4 -4
- package/es/components/teletext-list/teletext-list.js +11 -24
- package/es/types/assets.d.ts +4 -0
- package/es/utils/children-node-handle.js +12 -6
- package/lib/components/teletext-list/index.scss +9 -0
- package/lib/components/teletext-list/teletext-list-item.d.ts +5 -1
- package/lib/components/teletext-list/teletext-list-item.js +33 -24
- package/lib/components/teletext-list/teletext-list-item.scss +0 -16
- package/lib/components/teletext-list/teletext-list.d.ts +4 -4
- package/lib/components/teletext-list/teletext-list.js +11 -24
- package/lib/types/assets.d.ts +4 -0
- package/lib/utils/children-node-handle.js +12 -6
- package/lowcode/teletext-list/meta.ts +266 -38
- package/lowcode_es/meta.js +1 -1
- package/lowcode_es/teletext-list/meta.d.ts +2 -2
- package/lowcode_es/teletext-list/meta.js +272 -24
- package/lowcode_lib/meta.js +1 -1
- package/lowcode_lib/teletext-list/meta.d.ts +2 -2
- package/lowcode_lib/teletext-list/meta.js +274 -26
- package/package.json +3 -3
- package/build/docs/umi.e8fefa28.js +0 -1
|
@@ -1,5 +1,115 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
var
|
|
2
|
+
var IMAGE_KEY = 'image';
|
|
3
|
+
var normalizeNodeKey = function normalizeNodeKey(rawKey) {
|
|
4
|
+
if (rawKey === undefined || rawKey === null) return '';
|
|
5
|
+
return String(rawKey).replace(/^\.?\$?/, '');
|
|
6
|
+
};
|
|
7
|
+
var parsePxNumber = function parsePxNumber(value) {
|
|
8
|
+
if (typeof value === 'number' && Number.isFinite(value)) {
|
|
9
|
+
return value;
|
|
10
|
+
}
|
|
11
|
+
if (typeof value === 'string') {
|
|
12
|
+
var numberLike = Number(value.trim());
|
|
13
|
+
if (Number.isFinite(numberLike)) {
|
|
14
|
+
return numberLike;
|
|
15
|
+
}
|
|
16
|
+
var matched = value.match(/^\s*(\d+(?:\.\d+)?)\s*px\s*$/i);
|
|
17
|
+
if (!matched) return undefined;
|
|
18
|
+
var parsed = Number(matched[1]);
|
|
19
|
+
return Number.isFinite(parsed) ? parsed : undefined;
|
|
20
|
+
}
|
|
21
|
+
return undefined;
|
|
22
|
+
};
|
|
23
|
+
var getSchemaChildren = function getSchemaChildren(target) {
|
|
24
|
+
var _target$node;
|
|
25
|
+
var nodeSchema = target === null || target === void 0 ? void 0 : (_target$node = target.node) === null || _target$node === void 0 ? void 0 : _target$node.schema;
|
|
26
|
+
return Array.isArray(nodeSchema === null || nodeSchema === void 0 ? void 0 : nodeSchema.children) ? nodeSchema.children : [];
|
|
27
|
+
};
|
|
28
|
+
var findImageChildSchema = function findImageChildSchema(target) {
|
|
29
|
+
var schemaChildren = getSchemaChildren(target);
|
|
30
|
+
return schemaChildren.find(function (child) {
|
|
31
|
+
var _child$props;
|
|
32
|
+
var keyFromProps = normalizeNodeKey(child === null || child === void 0 ? void 0 : (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.key);
|
|
33
|
+
var keyFromNode = normalizeNodeKey(child === null || child === void 0 ? void 0 : child.key);
|
|
34
|
+
return keyFromProps === IMAGE_KEY || keyFromNode === IMAGE_KEY;
|
|
35
|
+
});
|
|
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
|
+
};
|
|
55
|
+
var getImageStyleNumber = function getImageStyleNumber(target, styleKey) {
|
|
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 快照读取
|
|
64
|
+
var imageChildSchema = findImageChildSchema(target);
|
|
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]);
|
|
66
|
+
};
|
|
67
|
+
var syncImageStyleValue = function syncImageStyleValue(target, styleKey, value) {
|
|
68
|
+
var _extends3;
|
|
69
|
+
// 优先通过引擎节点 API 更新子节点 style,确保引擎感知变化(布局面板读取时可见)
|
|
70
|
+
var imageChildNode = findImageChildNode(target);
|
|
71
|
+
if (imageChildNode) {
|
|
72
|
+
var _imageChildNode$getPr3, _imageChildNode$setPr, _extends2;
|
|
73
|
+
var _currentStyle = ((_imageChildNode$getPr3 = imageChildNode.getPropValue) === null || _imageChildNode$getPr3 === void 0 ? void 0 : _imageChildNode$getPr3.call(imageChildNode, 'style')) || {};
|
|
74
|
+
(_imageChildNode$setPr = imageChildNode.setPropValue) === null || _imageChildNode$setPr === void 0 ? void 0 : _imageChildNode$setPr.call(imageChildNode, 'style', _extends({}, _currentStyle, (_extends2 = {}, _extends2[styleKey] = value + "px", _extends2)));
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
// 降级:直接写 schema(引擎无法感知,但保留作为兜底)
|
|
78
|
+
var imageChildSchema = findImageChildSchema(target);
|
|
79
|
+
if (!imageChildSchema) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (!imageChildSchema.props) {
|
|
83
|
+
imageChildSchema.props = {};
|
|
84
|
+
}
|
|
85
|
+
var currentStyle = imageChildSchema.props.style || {};
|
|
86
|
+
imageChildSchema.props.style = _extends({}, currentStyle, (_extends3 = {}, _extends3[styleKey] = value + "px", _extends3));
|
|
87
|
+
};
|
|
88
|
+
var syncImageDimensionPropsFromChild = function syncImageDimensionPropsFromChild(target) {
|
|
89
|
+
var _target$getProps;
|
|
90
|
+
var widthFromChild = getImageStyleNumber(target, 'width');
|
|
91
|
+
var heightFromChild = getImageStyleNumber(target, 'height');
|
|
92
|
+
var propsApi = target === null || target === void 0 ? void 0 : (_target$getProps = target.getProps) === null || _target$getProps === void 0 ? void 0 : _target$getProps.call(target);
|
|
93
|
+
if (propsApi && widthFromChild !== undefined) {
|
|
94
|
+
var _propsApi$getPropValu;
|
|
95
|
+
var currentWidth = parsePxNumber((_propsApi$getPropValu = propsApi.getPropValue) === null || _propsApi$getPropValu === void 0 ? void 0 : _propsApi$getPropValu.call(propsApi, 'imgWidth'));
|
|
96
|
+
if (currentWidth !== widthFromChild) {
|
|
97
|
+
propsApi.setPropValue('imgWidth', widthFromChild);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (propsApi && heightFromChild !== undefined) {
|
|
101
|
+
var _propsApi$getPropValu2;
|
|
102
|
+
var currentHeight = parsePxNumber((_propsApi$getPropValu2 = propsApi.getPropValue) === null || _propsApi$getPropValu2 === void 0 ? void 0 : _propsApi$getPropValu2.call(propsApi, 'imgHeight'));
|
|
103
|
+
if (currentHeight !== heightFromChild) {
|
|
104
|
+
propsApi.setPropValue('imgHeight', heightFromChild);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
var isDataListBoundExpression = function isDataListBoundExpression(target) {
|
|
109
|
+
var _target$getProps2, _target$getProps2$cal, _target$getProps2$cal2;
|
|
110
|
+
var dataListValue = target === null || target === void 0 ? void 0 : (_target$getProps2 = target.getProps) === null || _target$getProps2 === void 0 ? void 0 : (_target$getProps2$cal = _target$getProps2.call(target)) === null || _target$getProps2$cal === void 0 ? void 0 : (_target$getProps2$cal2 = _target$getProps2$cal.getPropValue) === null || _target$getProps2$cal2 === void 0 ? void 0 : _target$getProps2$cal2.call(_target$getProps2$cal, 'dataList');
|
|
111
|
+
return !!(dataListValue && typeof dataListValue === 'object' && dataListValue.type === 'JSExpression');
|
|
112
|
+
};
|
|
3
113
|
var TeletextListMeta = {
|
|
4
114
|
group: '低代码组件',
|
|
5
115
|
componentName: 'TeletextList',
|
|
@@ -103,7 +213,18 @@ var TeletextListMeta = {
|
|
|
103
213
|
},
|
|
104
214
|
extraProps: {
|
|
105
215
|
setValue: function setValue(target, value) {
|
|
106
|
-
target.getProps()
|
|
216
|
+
var props = target.getProps();
|
|
217
|
+
// 显式快照需要保护的配置,防止引擎某些实现在写入时触发重初始化导致配置丢失
|
|
218
|
+
var prevDataList = props.getPropValue('dataList');
|
|
219
|
+
var prevDataListBind = props.getPropValue('dataListBind');
|
|
220
|
+
var prevTextImgGap = props.getPropValue('textImgGap');
|
|
221
|
+
props.setPropValue('imagePlacement', value);
|
|
222
|
+
// 写回被保护的配置(幂等操作,若引擎未重置则无副作用)
|
|
223
|
+
if (prevDataList !== undefined) props.setPropValue('dataList', prevDataList);
|
|
224
|
+
if (prevDataListBind !== undefined) props.setPropValue('dataListBind', prevDataListBind);
|
|
225
|
+
if (prevTextImgGap !== undefined) props.setPropValue('textImgGap', prevTextImgGap);
|
|
226
|
+
// 切换图片布局时同步一次子图片尺寸,避免面板回退到默认值
|
|
227
|
+
syncImageDimensionPropsFromChild(target);
|
|
107
228
|
}
|
|
108
229
|
}
|
|
109
230
|
}, {
|
|
@@ -113,8 +234,67 @@ var TeletextListMeta = {
|
|
|
113
234
|
setter: {
|
|
114
235
|
componentName: 'NumberSetter',
|
|
115
236
|
isRequired: false,
|
|
116
|
-
initialValue:
|
|
117
|
-
|
|
237
|
+
initialValue: function initialValue(target) {
|
|
238
|
+
var _target$getProps3, _target$getProps3$get;
|
|
239
|
+
var styleWidth = getImageStyleNumber(target, 'width');
|
|
240
|
+
if (styleWidth !== undefined) {
|
|
241
|
+
return styleWidth;
|
|
242
|
+
}
|
|
243
|
+
var propValue = target === null || target === void 0 ? void 0 : (_target$getProps3 = target.getProps()) === null || _target$getProps3 === void 0 ? void 0 : (_target$getProps3$get = _target$getProps3.getPropValue) === null || _target$getProps3$get === void 0 ? void 0 : _target$getProps3$get.call(_target$getProps3, 'imgWidth');
|
|
244
|
+
var parsedPropValue = parsePxNumber(propValue);
|
|
245
|
+
if (parsedPropValue !== undefined) return parsedPropValue;
|
|
246
|
+
// 数据源已绑定时,避免回退为 100 触发误写回
|
|
247
|
+
if (isDataListBoundExpression(target)) {
|
|
248
|
+
return undefined;
|
|
249
|
+
}
|
|
250
|
+
return 100;
|
|
251
|
+
},
|
|
252
|
+
defaultValue: function defaultValue(target) {
|
|
253
|
+
var _target$getProps4, _target$getProps4$get;
|
|
254
|
+
var styleWidth = getImageStyleNumber(target, 'width');
|
|
255
|
+
if (styleWidth !== undefined) {
|
|
256
|
+
return styleWidth;
|
|
257
|
+
}
|
|
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');
|
|
259
|
+
var parsedPropValue = parsePxNumber(propValue);
|
|
260
|
+
if (parsedPropValue !== undefined) return parsedPropValue;
|
|
261
|
+
if (isDataListBoundExpression(target)) {
|
|
262
|
+
return undefined;
|
|
263
|
+
}
|
|
264
|
+
return 100;
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
extraProps: {
|
|
268
|
+
getValue: function getValue(target) {
|
|
269
|
+
var _target$getProps7, _target$getProps7$get;
|
|
270
|
+
var styleWidth = getImageStyleNumber(target, 'width');
|
|
271
|
+
if (styleWidth !== undefined) {
|
|
272
|
+
var _target$getProps5, _target$getProps5$get;
|
|
273
|
+
var currentWidth = parsePxNumber(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
|
+
if (currentWidth !== styleWidth) {
|
|
275
|
+
var _target$getProps6, _target$getProps6$set;
|
|
276
|
+
target === null || target === void 0 ? void 0 : (_target$getProps6 = target.getProps()) === null || _target$getProps6 === void 0 ? void 0 : (_target$getProps6$set = _target$getProps6.setPropValue) === null || _target$getProps6$set === void 0 ? void 0 : _target$getProps6$set.call(_target$getProps6, 'imgWidth', styleWidth);
|
|
277
|
+
}
|
|
278
|
+
return styleWidth;
|
|
279
|
+
}
|
|
280
|
+
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, 'imgWidth');
|
|
281
|
+
var parsedPropValue = parsePxNumber(propValue);
|
|
282
|
+
if (parsedPropValue !== undefined) {
|
|
283
|
+
return parsedPropValue;
|
|
284
|
+
}
|
|
285
|
+
if (isDataListBoundExpression(target)) {
|
|
286
|
+
return undefined;
|
|
287
|
+
}
|
|
288
|
+
return 100;
|
|
289
|
+
},
|
|
290
|
+
setValue: function setValue(target, value) {
|
|
291
|
+
var parsedValue = parsePxNumber(value);
|
|
292
|
+
if (parsedValue === undefined) {
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
target.getProps().setPropValue('imgWidth', parsedValue);
|
|
296
|
+
syncImageStyleValue(target, 'width', parsedValue);
|
|
297
|
+
}
|
|
118
298
|
}
|
|
119
299
|
}, {
|
|
120
300
|
title: '图片高度',
|
|
@@ -123,8 +303,67 @@ var TeletextListMeta = {
|
|
|
123
303
|
setter: {
|
|
124
304
|
componentName: 'NumberSetter',
|
|
125
305
|
isRequired: false,
|
|
126
|
-
initialValue:
|
|
127
|
-
|
|
306
|
+
initialValue: function initialValue(target) {
|
|
307
|
+
var _target$getProps8, _target$getProps8$get;
|
|
308
|
+
var styleHeight = getImageStyleNumber(target, 'height');
|
|
309
|
+
if (styleHeight !== undefined) {
|
|
310
|
+
return styleHeight;
|
|
311
|
+
}
|
|
312
|
+
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');
|
|
313
|
+
var parsedPropValue = parsePxNumber(propValue);
|
|
314
|
+
if (parsedPropValue !== undefined) return parsedPropValue;
|
|
315
|
+
// 数据源已绑定时,避免回退为 100 触发误写回
|
|
316
|
+
if (isDataListBoundExpression(target)) {
|
|
317
|
+
return undefined;
|
|
318
|
+
}
|
|
319
|
+
return 100;
|
|
320
|
+
},
|
|
321
|
+
defaultValue: function defaultValue(target) {
|
|
322
|
+
var _target$getProps9, _target$getProps9$get;
|
|
323
|
+
var styleHeight = getImageStyleNumber(target, 'height');
|
|
324
|
+
if (styleHeight !== undefined) {
|
|
325
|
+
return styleHeight;
|
|
326
|
+
}
|
|
327
|
+
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');
|
|
328
|
+
var parsedPropValue = parsePxNumber(propValue);
|
|
329
|
+
if (parsedPropValue !== undefined) return parsedPropValue;
|
|
330
|
+
if (isDataListBoundExpression(target)) {
|
|
331
|
+
return undefined;
|
|
332
|
+
}
|
|
333
|
+
return 100;
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
extraProps: {
|
|
337
|
+
getValue: function getValue(target) {
|
|
338
|
+
var _target$getProps10, _target$getProps10$ge;
|
|
339
|
+
var styleHeight = getImageStyleNumber(target, 'height');
|
|
340
|
+
if (styleHeight !== undefined) {
|
|
341
|
+
var _target$getProps0, _target$getProps0$get;
|
|
342
|
+
var currentHeight = parsePxNumber(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'));
|
|
343
|
+
if (currentHeight !== styleHeight) {
|
|
344
|
+
var _target$getProps1, _target$getProps1$set;
|
|
345
|
+
target === null || target === void 0 ? void 0 : (_target$getProps1 = target.getProps()) === null || _target$getProps1 === void 0 ? void 0 : (_target$getProps1$set = _target$getProps1.setPropValue) === null || _target$getProps1$set === void 0 ? void 0 : _target$getProps1$set.call(_target$getProps1, 'imgHeight', styleHeight);
|
|
346
|
+
}
|
|
347
|
+
return styleHeight;
|
|
348
|
+
}
|
|
349
|
+
var propValue = 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');
|
|
350
|
+
var parsedPropValue = parsePxNumber(propValue);
|
|
351
|
+
if (parsedPropValue !== undefined) {
|
|
352
|
+
return parsedPropValue;
|
|
353
|
+
}
|
|
354
|
+
if (isDataListBoundExpression(target)) {
|
|
355
|
+
return undefined;
|
|
356
|
+
}
|
|
357
|
+
return 100;
|
|
358
|
+
},
|
|
359
|
+
setValue: function setValue(target, value) {
|
|
360
|
+
var parsedValue = parsePxNumber(value);
|
|
361
|
+
if (parsedValue === undefined) {
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
364
|
+
target.getProps().setPropValue('imgHeight', parsedValue);
|
|
365
|
+
syncImageStyleValue(target, 'height', parsedValue);
|
|
366
|
+
}
|
|
128
367
|
}
|
|
129
368
|
}, {
|
|
130
369
|
title: '数据源绑定',
|
|
@@ -153,7 +392,7 @@ var TeletextListMeta = {
|
|
|
153
392
|
},
|
|
154
393
|
extraProps: {
|
|
155
394
|
setValue: function setValue(target, value) {
|
|
156
|
-
|
|
395
|
+
target.getProps().setPropValue('dataListBind', value);
|
|
157
396
|
}
|
|
158
397
|
}
|
|
159
398
|
}, {
|
|
@@ -197,16 +436,17 @@ var TeletextListMeta = {
|
|
|
197
436
|
},
|
|
198
437
|
extraProps: {
|
|
199
438
|
setValue: function setValue(target, value) {
|
|
200
|
-
var _target$
|
|
439
|
+
var _target$node3, _schemaChildren$filte, _target$parent, _target$parent$items;
|
|
201
440
|
target.getProps().setPropValue('textLines', value);
|
|
202
|
-
var schema = target === null || target === void 0 ? void 0 : (_target$
|
|
441
|
+
var schema = target === null || target === void 0 ? void 0 : (_target$node3 = target.node) === null || _target$node3 === void 0 ? void 0 : _target$node3.schema;
|
|
203
442
|
var node = target === null || target === void 0 ? void 0 : target.node;
|
|
443
|
+
var schemaChildren = Array.isArray(schema === null || schema === void 0 ? void 0 : schema.children) ? schema.children : [];
|
|
204
444
|
|
|
205
445
|
// 获取当前文本组件数量
|
|
206
|
-
var currentLength = (
|
|
207
|
-
var _child$
|
|
208
|
-
return child.componentName === 'NextText' && ((_child$props$key =
|
|
209
|
-
})) === null ||
|
|
446
|
+
var currentLength = ((_schemaChildren$filte = schemaChildren.filter(function (child) {
|
|
447
|
+
var _child$props2, _child$props2$key;
|
|
448
|
+
return child.componentName === 'NextText' && (child === null || child === void 0 ? void 0 : (_child$props2 = child.props) === null || _child$props2 === void 0 ? void 0 : (_child$props2$key = _child$props2.key) === null || _child$props2$key === void 0 ? void 0 : _child$props2$key.startsWith('text-'));
|
|
449
|
+
})) === null || _schemaChildren$filte === void 0 ? void 0 : _schemaChildren$filte.length) || 0;
|
|
210
450
|
if (value > currentLength) {
|
|
211
451
|
// 需要添加新的文本组件
|
|
212
452
|
for (var i = currentLength + 1; i <= value; i++) {
|
|
@@ -219,20 +459,31 @@ var TeletextListMeta = {
|
|
|
219
459
|
key: "text-" + i
|
|
220
460
|
}
|
|
221
461
|
};
|
|
222
|
-
console.log('node', node, 'node-children', node === null || node === void 0 ? void 0 : node.children);
|
|
223
462
|
node === null || node === void 0 ? void 0 : (_node$children = node.children) === null || _node$children === void 0 ? void 0 : _node$children.push(newChild);
|
|
224
463
|
}
|
|
225
464
|
} else if (value < currentLength) {
|
|
226
|
-
var _node$children2;
|
|
227
|
-
//
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
465
|
+
var _node$children2, _node$children2$forEa;
|
|
466
|
+
// 收集需要移除的节点,再调用 child.remove() 通过引擎 API 逐个删除
|
|
467
|
+
// 避免 node.children = [...] 直接赋值(IPublicModelNodeChildren 不支持重新赋值)
|
|
468
|
+
var nodesToRemove = [];
|
|
469
|
+
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) {
|
|
470
|
+
var _child$schema, _child$schema$props;
|
|
471
|
+
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;
|
|
472
|
+
if ((child === null || child === void 0 ? void 0 : child.componentName) === 'NextText' && typeof key === 'string' && key.startsWith('text-')) {
|
|
473
|
+
var order = Number(key.split('-')[1]);
|
|
474
|
+
if (!Number.isNaN(order) && order > value) {
|
|
475
|
+
nodesToRemove.push(child);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
});
|
|
479
|
+
nodesToRemove.forEach(function (child) {
|
|
480
|
+
var _child$remove;
|
|
481
|
+
return child === null || child === void 0 ? void 0 : (_child$remove = child.remove) === null || _child$remove === void 0 ? void 0 : _child$remove.call(child);
|
|
231
482
|
});
|
|
232
483
|
}
|
|
233
484
|
|
|
234
485
|
// 更新数据源绑定的配置
|
|
235
|
-
var dataListBindProp = target.parent.items.find(function (item) {
|
|
486
|
+
var dataListBindProp = target === null || target === void 0 ? void 0 : (_target$parent = target.parent) === null || _target$parent === void 0 ? void 0 : (_target$parent$items = _target$parent.items) === null || _target$parent$items === void 0 ? void 0 : _target$parent$items.find(function (item) {
|
|
236
487
|
return item.name === 'dataListBind';
|
|
237
488
|
});
|
|
238
489
|
if (dataListBindProp && dataListBindProp.setter) {
|
|
@@ -263,7 +514,6 @@ var TeletextListMeta = {
|
|
|
263
514
|
// 更新setter的attributes
|
|
264
515
|
dataListBindProp.setter.props.attributes[0].children = [].concat(baseChildren, textChildren);
|
|
265
516
|
}
|
|
266
|
-
console.log('文字行数', target, value, schema, target.node, target.parent, target.parent.getPropValue('dataListBind'), (_target$parent$node = target.parent.node) === null || _target$parent$node === void 0 ? void 0 : _target$parent$node.getProp('dataListBind'));
|
|
267
517
|
}
|
|
268
518
|
}
|
|
269
519
|
}, {
|
|
@@ -726,7 +976,5 @@ var getSnippets = function getSnippets(textLines) {
|
|
|
726
976
|
}];
|
|
727
977
|
};
|
|
728
978
|
export default _extends({}, TeletextListMeta, {
|
|
729
|
-
snippets: getSnippets(
|
|
730
|
-
return prop.name === 'textLines';
|
|
731
|
-
})) === null || _props$find === void 0 ? void 0 : (_props$find$setter = _props$find.setter) === null || _props$find$setter === void 0 ? void 0 : (_props$find$setter$ge = _props$find$setter.getValue) === null || _props$find$setter$ge === void 0 ? void 0 : _props$find$setter$ge.call(_props$find$setter)) || 2)
|
|
979
|
+
snippets: getSnippets(2)
|
|
732
980
|
});
|
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.362';
|
|
126
126
|
}
|
|
127
127
|
if (basicLibraryVersion === void 0) {
|
|
128
128
|
basicLibraryVersion = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IPublicTypeSnippet
|
|
1
|
+
import { IPublicTypeSnippet } from '@alilc/lowcode-types';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
snippets: IPublicTypeSnippet[];
|
|
4
4
|
componentName: string;
|
|
@@ -12,7 +12,7 @@ declare const _default: {
|
|
|
12
12
|
devMode?: "proCode" | "lowCode";
|
|
13
13
|
npm?: import("@alilc/lowcode-types").IPublicTypeNpmInfo;
|
|
14
14
|
props?: import("@alilc/lowcode-types").IPublicTypePropConfig[];
|
|
15
|
-
configure?: import("@alilc/lowcode-types").IPublicTypeFieldConfig[] | IPublicTypeConfigure;
|
|
15
|
+
configure?: import("@alilc/lowcode-types").IPublicTypeFieldConfig[] | import("@alilc/lowcode-types").IPublicTypeConfigure;
|
|
16
16
|
experimental?: import("@alilc/lowcode-types").IPublicTypeAdvanced;
|
|
17
17
|
schema?: import("@alilc/lowcode-types").IPublicTypeComponentSchema;
|
|
18
18
|
group?: string | import("@alilc/lowcode-types").IPublicTypeI18nData;
|