@dckj-npm/dc-material 0.1.373 → 0.1.374
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.8274544c.js → umi.f5910099.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/lowcode/teletext-list/meta.ts +71 -322
- package/lowcode_es/meta.js +1 -1
- package/lowcode_es/teletext-list/meta.js +79 -330
- package/lowcode_lib/meta.js +1 -1
- package/lowcode_lib/teletext-list/meta.js +81 -332
- package/package.json +3 -3
|
@@ -20,29 +20,9 @@ var parsePxNumber = function parsePxNumber(value) {
|
|
|
20
20
|
}
|
|
21
21
|
return undefined;
|
|
22
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
23
|
var findImageChildNode = function findImageChildNode(target) {
|
|
44
|
-
var _target$
|
|
45
|
-
var children = target === null || target === void 0 ? void 0 : (_target$
|
|
24
|
+
var _target$node;
|
|
25
|
+
var children = target === null || target === void 0 ? void 0 : (_target$node = target.node) === null || _target$node === void 0 ? void 0 : _target$node.children;
|
|
46
26
|
if (!children) return undefined;
|
|
47
27
|
if (typeof children.find === 'function') {
|
|
48
28
|
return children.find(function (child) {
|
|
@@ -53,115 +33,36 @@ var findImageChildNode = function findImageChildNode(target) {
|
|
|
53
33
|
return undefined;
|
|
54
34
|
};
|
|
55
35
|
var getImageStyleNumber = function getImageStyleNumber(target, styleKey) {
|
|
56
|
-
var _imageChildSchema$pro, _imageChildSchema$pro2;
|
|
57
|
-
// 优先通过引擎 API 读取,保证与 syncImageStyleValue 写入来源一致
|
|
58
36
|
var imageChildNode = findImageChildNode(target);
|
|
59
37
|
if (imageChildNode) {
|
|
60
38
|
var _imageChildNode$getPr, _imageChildNode$getPr2;
|
|
61
39
|
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
40
|
}
|
|
63
|
-
|
|
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]);
|
|
41
|
+
return undefined;
|
|
66
42
|
};
|
|
67
43
|
|
|
68
44
|
/**
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* 此时 dataList 已稳定为正确的 JSExpression,重评估无副作用。
|
|
45
|
+
* 同步 Image 子节点的 style.width / style.height。
|
|
46
|
+
* 使用 Promise.resolve().then() 异步执行,避免在父节点 setPropValue
|
|
47
|
+
* 的 MobX 同步响应链中触发子节点变更(可能导致 SettingField 重建)。
|
|
73
48
|
*/
|
|
74
49
|
var syncImageStyleValue = function syncImageStyleValue(target, styleKey, value) {
|
|
75
50
|
Promise.resolve().then(function () {
|
|
76
|
-
var
|
|
77
|
-
// 优先通过引擎节点 API 更新子节点 style,确保引擎感知变化(布局面板读取时可见)
|
|
51
|
+
var _imageChildNode$getPr3, _extends2, _imageChildNode$setPr;
|
|
78
52
|
var imageChildNode = findImageChildNode(target);
|
|
79
|
-
if (imageChildNode)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
var
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
var otherPropKey = otherKey === 'width' ? 'imgWidth' : 'imgHeight';
|
|
89
|
-
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));
|
|
90
|
-
if (otherPropValue !== undefined) {
|
|
91
|
-
updatedStyle[otherKey] = otherPropValue + "px";
|
|
92
|
-
} else {
|
|
93
|
-
// 子节点 style 也没有,使用默认值 100
|
|
94
|
-
updatedStyle[otherKey] = '100px';
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
(_imageChildNode$setPr = imageChildNode.setPropValue) === null || _imageChildNode$setPr === void 0 ? void 0 : _imageChildNode$setPr.call(imageChildNode, 'style', updatedStyle);
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
// 降级:直接写 schema(引擎无法感知,但保留作为兜底)
|
|
101
|
-
var imageChildSchema = findImageChildSchema(target);
|
|
102
|
-
if (!imageChildSchema) {
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
if (!imageChildSchema.props) {
|
|
106
|
-
imageChildSchema.props = {};
|
|
53
|
+
if (!imageChildNode) return;
|
|
54
|
+
var currentStyle = ((_imageChildNode$getPr3 = imageChildNode.getPropValue) === null || _imageChildNode$getPr3 === void 0 ? void 0 : _imageChildNode$getPr3.call(imageChildNode, 'style')) || {};
|
|
55
|
+
var updatedStyle = _extends({}, currentStyle, (_extends2 = {}, _extends2[styleKey] = value + "px", _extends2));
|
|
56
|
+
var otherKey = styleKey === 'width' ? 'height' : 'width';
|
|
57
|
+
if (!updatedStyle[otherKey]) {
|
|
58
|
+
var _target$getProps, _target$getProps$call, _target$getProps$call2;
|
|
59
|
+
var otherPropKey = otherKey === 'width' ? 'imgWidth' : 'imgHeight';
|
|
60
|
+
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));
|
|
61
|
+
updatedStyle[otherKey] = (otherPropValue !== null && otherPropValue !== void 0 ? otherPropValue : 100) + "px";
|
|
107
62
|
}
|
|
108
|
-
|
|
109
|
-
imageChildSchema.props.style = _extends({}, currentStyle, (_extends3 = {}, _extends3[styleKey] = value + "px", _extends3));
|
|
63
|
+
(_imageChildNode$setPr = imageChildNode.setPropValue) === null || _imageChildNode$setPr === void 0 ? void 0 : _imageChildNode$setPr.call(imageChildNode, 'style', updatedStyle);
|
|
110
64
|
});
|
|
111
65
|
};
|
|
112
|
-
var syncImageDimensionPropsFromChild = function syncImageDimensionPropsFromChild(target) {
|
|
113
|
-
var _target$getProps2;
|
|
114
|
-
var widthFromChild = getImageStyleNumber(target, 'width');
|
|
115
|
-
var heightFromChild = getImageStyleNumber(target, 'height');
|
|
116
|
-
var propsApi = target === null || target === void 0 ? void 0 : (_target$getProps2 = target.getProps) === null || _target$getProps2 === void 0 ? void 0 : _target$getProps2.call(target);
|
|
117
|
-
if (propsApi && widthFromChild !== undefined) {
|
|
118
|
-
var _propsApi$getPropValu;
|
|
119
|
-
var currentWidth = parsePxNumber((_propsApi$getPropValu = propsApi.getPropValue) === null || _propsApi$getPropValu === void 0 ? void 0 : _propsApi$getPropValu.call(propsApi, 'imgWidth'));
|
|
120
|
-
if (currentWidth !== widthFromChild) {
|
|
121
|
-
propsApi.setPropValue('imgWidth', widthFromChild);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
if (propsApi && heightFromChild !== undefined) {
|
|
125
|
-
var _propsApi$getPropValu2;
|
|
126
|
-
var currentHeight = parsePxNumber((_propsApi$getPropValu2 = propsApi.getPropValue) === null || _propsApi$getPropValu2 === void 0 ? void 0 : _propsApi$getPropValu2.call(propsApi, 'imgHeight'));
|
|
127
|
-
if (currentHeight !== heightFromChild) {
|
|
128
|
-
propsApi.setPropValue('imgHeight', heightFromChild);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
var isDataListBoundExpression = function isDataListBoundExpression(target) {
|
|
133
|
-
var _target$getProps3, _target$getProps3$cal, _target$getProps3$cal2;
|
|
134
|
-
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');
|
|
135
|
-
return !!(dataListValue && typeof dataListValue === 'object' && dataListValue.type === 'JSExpression');
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* 模块级缓存:使用 node.id(稳定的字符串 ID)作为 key。
|
|
140
|
-
* 替代 WeakMap 方案:WeakMap 以 target.node 对象引用为 key,
|
|
141
|
-
* 但引擎可能通过 Proxy/getter 每次返回不同的包装对象,导致缓存命中失败。
|
|
142
|
-
* 使用 node.id 字符串做 key 彻底消除引用不一致问题。
|
|
143
|
-
*/
|
|
144
|
-
var _dataListCacheById = {};
|
|
145
|
-
var _cacheDataList = function _cacheDataList(target) {
|
|
146
|
-
var _target$node3, _target$node4, _target$node4$getProp, _target$node5, _target$node5$schema, _target$node5$schema$, _target$getProps4, _target$getProps4$cal, _target$getProps4$cal2;
|
|
147
|
-
var nodeId = target === null || target === void 0 ? void 0 : (_target$node3 = target.node) === null || _target$node3 === void 0 ? void 0 : _target$node3.id;
|
|
148
|
-
if (!nodeId) return;
|
|
149
|
-
var fromNode = target === null || target === void 0 ? void 0 : (_target$node4 = target.node) === null || _target$node4 === void 0 ? void 0 : (_target$node4$getProp = _target$node4.getPropValue) === null || _target$node4$getProp === void 0 ? void 0 : _target$node4$getProp.call(_target$node4, 'dataList');
|
|
150
|
-
if (fromNode !== undefined) {
|
|
151
|
-
_dataListCacheById[nodeId] = fromNode;
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
// schema 序列化快照:源头数据,不受 settings 中间态影响
|
|
155
|
-
var fromSchema = target === null || target === void 0 ? void 0 : (_target$node5 = target.node) === null || _target$node5 === void 0 ? void 0 : (_target$node5$schema = _target$node5.schema) === null || _target$node5$schema === void 0 ? void 0 : (_target$node5$schema$ = _target$node5$schema.props) === null || _target$node5$schema$ === void 0 ? void 0 : _target$node5$schema$.dataList;
|
|
156
|
-
if (fromSchema !== undefined) {
|
|
157
|
-
_dataListCacheById[nodeId] = fromSchema;
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
var fromProps = target === null || target === void 0 ? void 0 : (_target$getProps4 = target.getProps) === null || _target$getProps4 === void 0 ? void 0 : (_target$getProps4$cal = _target$getProps4.call(target)) === null || _target$getProps4$cal === void 0 ? void 0 : (_target$getProps4$cal2 = _target$getProps4$cal.getPropValue) === null || _target$getProps4$cal2 === void 0 ? void 0 : _target$getProps4$cal2.call(_target$getProps4$cal, 'dataList');
|
|
161
|
-
if (fromProps !== undefined) {
|
|
162
|
-
_dataListCacheById[nodeId] = fromProps;
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
66
|
var TeletextListMeta = {
|
|
166
67
|
group: '低代码组件',
|
|
167
68
|
componentName: 'TeletextList',
|
|
@@ -264,27 +165,8 @@ var TeletextListMeta = {
|
|
|
264
165
|
initialValue: 'left'
|
|
265
166
|
},
|
|
266
167
|
extraProps: {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
// 在任何 setPropValue 之前先写入模块级缓存,确保 dataList.initialValue
|
|
270
|
-
// 重评估时即使 engine 已清空 node prop 也能从缓存恢复正确值
|
|
271
|
-
_cacheDataList(target);
|
|
272
|
-
// 显式快照需要保护的配置,防止引擎某些实现在写入时触发重初始化导致配置丢失
|
|
273
|
-
var prevDataList = props.getPropValue('dataList');
|
|
274
|
-
var prevDataListBind = props.getPropValue('dataListBind');
|
|
275
|
-
var prevTextImgGap = props.getPropValue('textImgGap');
|
|
276
|
-
var prevImgWidth = props.getPropValue('imgWidth');
|
|
277
|
-
var prevImgHeight = props.getPropValue('imgHeight');
|
|
278
|
-
props.setPropValue('imagePlacement', value);
|
|
279
|
-
// 写回被保护的配置(幂等操作,若引擎未重置则无副作用)
|
|
280
|
-
if (prevDataList !== undefined) props.setPropValue('dataList', prevDataList);
|
|
281
|
-
if (prevDataListBind !== undefined) props.setPropValue('dataListBind', prevDataListBind);
|
|
282
|
-
if (prevTextImgGap !== undefined) props.setPropValue('textImgGap', prevTextImgGap);
|
|
283
|
-
if (prevImgWidth !== undefined) props.setPropValue('imgWidth', prevImgWidth);
|
|
284
|
-
if (prevImgHeight !== undefined) props.setPropValue('imgHeight', prevImgHeight);
|
|
285
|
-
// 切换图片布局时同步一次子图片尺寸,避免面板回退到默认值
|
|
286
|
-
syncImageDimensionPropsFromChild(target);
|
|
287
|
-
}
|
|
168
|
+
// 引擎已自动 setPropValue('imagePlacement', value),无需再做任何额外写入
|
|
169
|
+
// 之前的快照-还原逻辑反而触发多余的 MobX 响应链,导致 dataList 被覆盖
|
|
288
170
|
}
|
|
289
171
|
}, {
|
|
290
172
|
title: '图片宽度',
|
|
@@ -293,67 +175,23 @@ var TeletextListMeta = {
|
|
|
293
175
|
setter: {
|
|
294
176
|
componentName: 'NumberSetter',
|
|
295
177
|
isRequired: false,
|
|
296
|
-
initialValue:
|
|
297
|
-
var _target$getProps5, _target$getProps5$get;
|
|
298
|
-
var styleWidth = getImageStyleNumber(target, 'width');
|
|
299
|
-
if (styleWidth !== undefined) {
|
|
300
|
-
return styleWidth;
|
|
301
|
-
}
|
|
302
|
-
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');
|
|
303
|
-
var parsedPropValue = parsePxNumber(propValue);
|
|
304
|
-
if (parsedPropValue !== undefined) return parsedPropValue;
|
|
305
|
-
// 数据源已绑定时,避免回退为 100 触发误写回
|
|
306
|
-
if (isDataListBoundExpression(target)) {
|
|
307
|
-
return undefined;
|
|
308
|
-
}
|
|
309
|
-
return 100;
|
|
310
|
-
},
|
|
311
|
-
defaultValue: function defaultValue(target) {
|
|
312
|
-
var _target$getProps6, _target$getProps6$get;
|
|
313
|
-
var styleWidth = getImageStyleNumber(target, 'width');
|
|
314
|
-
if (styleWidth !== undefined) {
|
|
315
|
-
return styleWidth;
|
|
316
|
-
}
|
|
317
|
-
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');
|
|
318
|
-
var parsedPropValue = parsePxNumber(propValue);
|
|
319
|
-
if (parsedPropValue !== undefined) return parsedPropValue;
|
|
320
|
-
if (isDataListBoundExpression(target)) {
|
|
321
|
-
return undefined;
|
|
322
|
-
}
|
|
323
|
-
return 100;
|
|
324
|
-
}
|
|
178
|
+
initialValue: 100
|
|
325
179
|
},
|
|
326
180
|
extraProps: {
|
|
327
|
-
getValue: function getValue(target) {
|
|
328
|
-
var
|
|
329
|
-
|
|
330
|
-
// (写操作会导致引擎重初始化 dataList 等 prop,画布图片回退到默认图)
|
|
181
|
+
getValue: function getValue(target, value) {
|
|
182
|
+
var _parsePxNumber;
|
|
183
|
+
if (value !== undefined) return (_parsePxNumber = parsePxNumber(value)) !== null && _parsePxNumber !== void 0 ? _parsePxNumber : 100;
|
|
331
184
|
var styleWidth = getImageStyleNumber(target, 'width');
|
|
332
|
-
if (styleWidth !== undefined)
|
|
333
|
-
return styleWidth;
|
|
334
|
-
}
|
|
335
|
-
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');
|
|
336
|
-
var parsedPropValue = parsePxNumber(propValue);
|
|
337
|
-
if (parsedPropValue !== undefined) {
|
|
338
|
-
return parsedPropValue;
|
|
339
|
-
}
|
|
185
|
+
if (styleWidth !== undefined) return styleWidth;
|
|
340
186
|
return 100;
|
|
341
187
|
},
|
|
342
188
|
setValue: function setValue(target, value) {
|
|
189
|
+
// 引擎已自动 setPropValue('imgWidth', value)
|
|
190
|
+
// 只需同步到 Image 子节点的 style
|
|
343
191
|
var parsedValue = parsePxNumber(value);
|
|
344
|
-
if (parsedValue
|
|
345
|
-
|
|
346
|
-
}
|
|
347
|
-
var props = target.getProps();
|
|
348
|
-
_cacheDataList(target);
|
|
349
|
-
// 快照 dataList:在 setPropValue 前捕获,防止引擎重评估时被默认值覆盖
|
|
350
|
-
var prevDataList = props.getPropValue('dataList');
|
|
351
|
-
props.setPropValue('imgWidth', parsedValue);
|
|
352
|
-
// 还原 dataList(幂等操作,若引擎未覆盖则无副作用)
|
|
353
|
-
if (prevDataList !== undefined) {
|
|
354
|
-
props.setPropValue('dataList', prevDataList);
|
|
192
|
+
if (parsedValue !== undefined) {
|
|
193
|
+
syncImageStyleValue(target, 'width', parsedValue);
|
|
355
194
|
}
|
|
356
|
-
syncImageStyleValue(target, 'width', parsedValue);
|
|
357
195
|
}
|
|
358
196
|
}
|
|
359
197
|
}, {
|
|
@@ -363,66 +201,23 @@ var TeletextListMeta = {
|
|
|
363
201
|
setter: {
|
|
364
202
|
componentName: 'NumberSetter',
|
|
365
203
|
isRequired: false,
|
|
366
|
-
initialValue:
|
|
367
|
-
var _target$getProps8, _target$getProps8$get;
|
|
368
|
-
var styleHeight = getImageStyleNumber(target, 'height');
|
|
369
|
-
if (styleHeight !== undefined) {
|
|
370
|
-
return styleHeight;
|
|
371
|
-
}
|
|
372
|
-
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');
|
|
373
|
-
var parsedPropValue = parsePxNumber(propValue);
|
|
374
|
-
if (parsedPropValue !== undefined) return parsedPropValue;
|
|
375
|
-
// 数据源已绑定时,避免回退为 100 触发误写回
|
|
376
|
-
if (isDataListBoundExpression(target)) {
|
|
377
|
-
return undefined;
|
|
378
|
-
}
|
|
379
|
-
return 100;
|
|
380
|
-
},
|
|
381
|
-
defaultValue: function defaultValue(target) {
|
|
382
|
-
var _target$getProps9, _target$getProps9$get;
|
|
383
|
-
var styleHeight = getImageStyleNumber(target, 'height');
|
|
384
|
-
if (styleHeight !== undefined) {
|
|
385
|
-
return styleHeight;
|
|
386
|
-
}
|
|
387
|
-
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');
|
|
388
|
-
var parsedPropValue = parsePxNumber(propValue);
|
|
389
|
-
if (parsedPropValue !== undefined) return parsedPropValue;
|
|
390
|
-
if (isDataListBoundExpression(target)) {
|
|
391
|
-
return undefined;
|
|
392
|
-
}
|
|
393
|
-
return 100;
|
|
394
|
-
}
|
|
204
|
+
initialValue: 100
|
|
395
205
|
},
|
|
396
206
|
extraProps: {
|
|
397
|
-
getValue: function getValue(target) {
|
|
398
|
-
var
|
|
399
|
-
|
|
207
|
+
getValue: function getValue(target, value) {
|
|
208
|
+
var _parsePxNumber2;
|
|
209
|
+
if (value !== undefined) return (_parsePxNumber2 = parsePxNumber(value)) !== null && _parsePxNumber2 !== void 0 ? _parsePxNumber2 : 100;
|
|
400
210
|
var styleHeight = getImageStyleNumber(target, 'height');
|
|
401
|
-
if (styleHeight !== undefined)
|
|
402
|
-
return styleHeight;
|
|
403
|
-
}
|
|
404
|
-
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');
|
|
405
|
-
var parsedPropValue = parsePxNumber(propValue);
|
|
406
|
-
if (parsedPropValue !== undefined) {
|
|
407
|
-
return parsedPropValue;
|
|
408
|
-
}
|
|
211
|
+
if (styleHeight !== undefined) return styleHeight;
|
|
409
212
|
return 100;
|
|
410
213
|
},
|
|
411
214
|
setValue: function setValue(target, value) {
|
|
215
|
+
// 引擎已自动 setPropValue('imgHeight', value)
|
|
216
|
+
// 只需同步到 Image 子节点的 style
|
|
412
217
|
var parsedValue = parsePxNumber(value);
|
|
413
|
-
if (parsedValue
|
|
414
|
-
|
|
218
|
+
if (parsedValue !== undefined) {
|
|
219
|
+
syncImageStyleValue(target, 'height', parsedValue);
|
|
415
220
|
}
|
|
416
|
-
var props = target.getProps();
|
|
417
|
-
_cacheDataList(target);
|
|
418
|
-
// 快照 dataList:在 setPropValue 前捕获,防止引擎重评估时被默认值覆盖
|
|
419
|
-
var prevDataList = props.getPropValue('dataList');
|
|
420
|
-
props.setPropValue('imgHeight', parsedValue);
|
|
421
|
-
// 还原 dataList(幂等操作,若引擎未覆盖则无副作用)
|
|
422
|
-
if (prevDataList !== undefined) {
|
|
423
|
-
props.setPropValue('dataList', prevDataList);
|
|
424
|
-
}
|
|
425
|
-
syncImageStyleValue(target, 'height', parsedValue);
|
|
426
221
|
}
|
|
427
222
|
}
|
|
428
223
|
}, {
|
|
@@ -496,16 +291,16 @@ var TeletextListMeta = {
|
|
|
496
291
|
},
|
|
497
292
|
extraProps: {
|
|
498
293
|
setValue: function setValue(target, value) {
|
|
499
|
-
var _target$
|
|
294
|
+
var _target$node2, _schemaChildren$filte, _target$parent, _target$parent$items;
|
|
500
295
|
target.getProps().setPropValue('textLines', value);
|
|
501
|
-
var schema = target === null || target === void 0 ? void 0 : (_target$
|
|
296
|
+
var schema = target === null || target === void 0 ? void 0 : (_target$node2 = target.node) === null || _target$node2 === void 0 ? void 0 : _target$node2.schema;
|
|
502
297
|
var node = target === null || target === void 0 ? void 0 : target.node;
|
|
503
298
|
var schemaChildren = Array.isArray(schema === null || schema === void 0 ? void 0 : schema.children) ? schema.children : [];
|
|
504
299
|
|
|
505
300
|
// 获取当前文本组件数量
|
|
506
301
|
var currentLength = ((_schemaChildren$filte = schemaChildren.filter(function (child) {
|
|
507
|
-
var _child$
|
|
508
|
-
return child.componentName === 'NextText' && (child === null || child === void 0 ? void 0 : (_child$
|
|
302
|
+
var _child$props, _child$props$key;
|
|
303
|
+
return child.componentName === 'NextText' && (child === null || child === void 0 ? void 0 : (_child$props = child.props) === null || _child$props === void 0 ? void 0 : (_child$props$key = _child$props.key) === null || _child$props$key === void 0 ? void 0 : _child$props$key.startsWith('text-'));
|
|
509
304
|
})) === null || _schemaChildren$filte === void 0 ? void 0 : _schemaChildren$filte.length) || 0;
|
|
510
305
|
if (value > currentLength) {
|
|
511
306
|
// 需要添加新的文本组件
|
|
@@ -892,96 +687,35 @@ var TeletextListMeta = {
|
|
|
892
687
|
}
|
|
893
688
|
},
|
|
894
689
|
initialValue: function initialValue(target) {
|
|
895
|
-
var _target$
|
|
896
|
-
|
|
897
|
-
//
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
}
|
|
903
|
-
// 2. 模块级缓存(node.id 索引,不受 Proxy 引用问题影响)
|
|
904
|
-
if (nodeId && _dataListCacheById[nodeId] !== undefined) {
|
|
905
|
-
return _dataListCacheById[nodeId];
|
|
906
|
-
}
|
|
907
|
-
// 3. settings API
|
|
908
|
-
var current = target === null || target === void 0 ? void 0 : (_target$getProps1 = target.getProps) === null || _target$getProps1 === void 0 ? void 0 : (_target$getProps1$cal = _target$getProps1.call(target)) === null || _target$getProps1$cal === void 0 ? void 0 : (_target$getProps1$cal2 = _target$getProps1$cal.getPropValue) === null || _target$getProps1$cal2 === void 0 ? void 0 : _target$getProps1$cal2.call(_target$getProps1$cal, 'dataList');
|
|
909
|
-
if (current !== undefined) {
|
|
910
|
-
if (nodeId) _dataListCacheById[nodeId] = current;
|
|
911
|
-
return current;
|
|
912
|
-
}
|
|
913
|
-
// 4. schema 序列化快照(源头数据,不受 settings 中间态影响)
|
|
914
|
-
var fromSchema = target === null || target === void 0 ? void 0 : (_target$node9 = target.node) === null || _target$node9 === void 0 ? void 0 : (_target$node9$schema = _target$node9.schema) === null || _target$node9$schema === void 0 ? void 0 : (_target$node9$schema$ = _target$node9$schema.props) === null || _target$node9$schema$ === void 0 ? void 0 : _target$node9$schema$.dataList;
|
|
915
|
-
if (fromSchema !== undefined) {
|
|
916
|
-
if (nodeId) _dataListCacheById[nodeId] = fromSchema;
|
|
917
|
-
return fromSchema;
|
|
918
|
-
}
|
|
919
|
-
// 5. 默认数据(仅首次创建组件时触达)
|
|
920
|
-
return [{
|
|
921
|
-
image: 'https://img.alicdn.com/tps/TB16TQvOXXXXXbiaFXXXXXXXXXX-120-120.svg',
|
|
922
|
-
title: '标题名称',
|
|
923
|
-
description: '说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字'
|
|
924
|
-
}, {
|
|
925
|
-
image: 'https://img.alicdn.com/tps/TB16TQvOXXXXXbiaFXXXXXXXXXX-120-120.svg',
|
|
926
|
-
title: '标题名称',
|
|
927
|
-
description: '说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字',
|
|
928
|
-
tags: [{
|
|
929
|
-
name: '报名火热',
|
|
930
|
-
color: 'orange'
|
|
931
|
-
}, {
|
|
932
|
-
name: '人数众多',
|
|
933
|
-
color: 'blue'
|
|
934
|
-
}]
|
|
935
|
-
}];
|
|
690
|
+
var _target$node$schema$p, _target$node3, _target$node3$schema, _target$node3$schema$, _target$getProps2, _target$getProps2$cal, _target$getProps2$cal2;
|
|
691
|
+
// ignoreDefaultValue: () => true 保证此函数在 SettingFieldView remount 时
|
|
692
|
+
// 永远不会被 initDefaultValue 调用,仅作为安全兜底保留。
|
|
693
|
+
// 正常的首次创建数据由 snippet.props.dataList 提供。
|
|
694
|
+
var existing = (_target$node$schema$p = target === null || target === void 0 ? void 0 : (_target$node3 = target.node) === null || _target$node3 === void 0 ? void 0 : (_target$node3$schema = _target$node3.schema) === null || _target$node3$schema === void 0 ? void 0 : (_target$node3$schema$ = _target$node3$schema.props) === null || _target$node3$schema$ === void 0 ? void 0 : _target$node3$schema$.dataList) !== null && _target$node$schema$p !== void 0 ? _target$node$schema$p : 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');
|
|
695
|
+
if (existing !== undefined) return existing;
|
|
696
|
+
return DEFAULT_DATA_LIST;
|
|
936
697
|
}
|
|
937
698
|
},
|
|
938
699
|
extraProps: {
|
|
939
700
|
/**
|
|
940
|
-
*
|
|
941
|
-
*
|
|
942
|
-
*
|
|
701
|
+
* ignoreDefaultValue: 彻底阻止引擎在 SettingFieldView remount 时
|
|
702
|
+
* 调用 initDefaultValue → 把 initialValue(默认数据数组)通过 field.setValue
|
|
703
|
+
* 写入 dataList prop,覆盖已绑定的 JSExpression。
|
|
704
|
+
*
|
|
705
|
+
* 这是根本性解决方案:在引擎层面阻断 initDefaultValue 的执行,
|
|
706
|
+
* 而不是试图在 initialValue/getValue/setValue 中做缓存和还原来补救。
|
|
943
707
|
*/
|
|
708
|
+
ignoreDefaultValue: function ignoreDefaultValue() {
|
|
709
|
+
return true;
|
|
710
|
+
},
|
|
944
711
|
getValue: function getValue(target, currentValue) {
|
|
945
|
-
var _target$
|
|
946
|
-
|
|
947
|
-
if (currentValue !== undefined)
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
// 引擎 currentValue 为 undefined(重评估中间态),逐级回退:
|
|
952
|
-
if (nodeId && _dataListCacheById[nodeId] !== undefined) {
|
|
953
|
-
return _dataListCacheById[nodeId];
|
|
954
|
-
}
|
|
955
|
-
// node.schema 序列化快照:不受 settings 中间态影响,是最可靠的源头数据
|
|
956
|
-
var fromSchema = target === null || target === void 0 ? void 0 : (_target$node1 = target.node) === null || _target$node1 === void 0 ? void 0 : (_target$node1$schema = _target$node1.schema) === null || _target$node1$schema === void 0 ? void 0 : (_target$node1$schema$ = _target$node1$schema.props) === null || _target$node1$schema$ === void 0 ? void 0 : _target$node1$schema$.dataList;
|
|
957
|
-
if (fromSchema !== undefined) {
|
|
958
|
-
if (nodeId) _dataListCacheById[nodeId] = fromSchema;
|
|
959
|
-
return fromSchema;
|
|
960
|
-
}
|
|
961
|
-
var fromNode = target === null || target === void 0 ? void 0 : (_target$node10 = target.node) === null || _target$node10 === void 0 ? void 0 : (_target$node10$getPro = _target$node10.getPropValue) === null || _target$node10$getPro === void 0 ? void 0 : _target$node10$getPro.call(_target$node10, 'dataList');
|
|
962
|
-
if (fromNode !== undefined) {
|
|
963
|
-
if (nodeId) _dataListCacheById[nodeId] = fromNode;
|
|
964
|
-
return fromNode;
|
|
965
|
-
}
|
|
712
|
+
var _target$node4, _target$node4$schema, _target$node4$schema$;
|
|
713
|
+
// currentValue 已有值时直接返回
|
|
714
|
+
if (currentValue !== undefined) return currentValue;
|
|
715
|
+
// 从 schema 快照兜底读取(最可靠的源头数据,始终反映持久化状态)
|
|
716
|
+
var fromSchema = target === null || target === void 0 ? void 0 : (_target$node4 = target.node) === null || _target$node4 === void 0 ? void 0 : (_target$node4$schema = _target$node4.schema) === null || _target$node4$schema === void 0 ? void 0 : (_target$node4$schema$ = _target$node4$schema.props) === null || _target$node4$schema$ === void 0 ? void 0 : _target$node4$schema$.dataList;
|
|
717
|
+
if (fromSchema !== undefined) return fromSchema;
|
|
966
718
|
return undefined;
|
|
967
|
-
},
|
|
968
|
-
/**
|
|
969
|
-
* 用户编辑 dataList 时同步更新缓存并持久化到 schema。
|
|
970
|
-
* 引擎 extraProps.setValue 完全接管写入,必须显式 setPropValue。
|
|
971
|
-
*/
|
|
972
|
-
setValue: function setValue(target, value) {
|
|
973
|
-
var _target$node11;
|
|
974
|
-
var nodeId = target === null || target === void 0 ? void 0 : (_target$node11 = target.node) === null || _target$node11 === void 0 ? void 0 : _target$node11.id;
|
|
975
|
-
if (!nodeId) return;
|
|
976
|
-
if (value !== undefined) {
|
|
977
|
-
var _target$getProps10, _target$getProps10$ca, _target$getProps10$ca2;
|
|
978
|
-
_dataListCacheById[nodeId] = value;
|
|
979
|
-
(_target$getProps10 = target.getProps) === null || _target$getProps10 === void 0 ? void 0 : (_target$getProps10$ca = _target$getProps10.call(target)) === null || _target$getProps10$ca === void 0 ? void 0 : (_target$getProps10$ca2 = _target$getProps10$ca.setPropValue) === null || _target$getProps10$ca2 === void 0 ? void 0 : _target$getProps10$ca2.call(_target$getProps10$ca, 'dataList', value);
|
|
980
|
-
} else {
|
|
981
|
-
var _target$getProps11, _target$getProps11$ca, _target$getProps11$ca2;
|
|
982
|
-
delete _dataListCacheById[nodeId];
|
|
983
|
-
(_target$getProps11 = target.getProps) === null || _target$getProps11 === void 0 ? void 0 : (_target$getProps11$ca = _target$getProps11.call(target)) === null || _target$getProps11$ca === void 0 ? void 0 : (_target$getProps11$ca2 = _target$getProps11$ca.setPropValue) === null || _target$getProps11$ca2 === void 0 ? void 0 : _target$getProps11$ca2.call(_target$getProps11$ca, 'dataList', undefined);
|
|
984
|
-
}
|
|
985
719
|
}
|
|
986
720
|
}
|
|
987
721
|
}],
|
|
@@ -1000,6 +734,15 @@ var TeletextListMeta = {
|
|
|
1000
734
|
}
|
|
1001
735
|
}
|
|
1002
736
|
};
|
|
737
|
+
var DEFAULT_DATA_LIST = [{
|
|
738
|
+
image: 'https://img.alicdn.com/tps/TB16TQvOXXXXXbiaFXXXXXXXXXX-120-120.svg',
|
|
739
|
+
title: '标题名称',
|
|
740
|
+
description: '说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字'
|
|
741
|
+
}, {
|
|
742
|
+
image: 'https://img.alicdn.com/tps/TB16TQvOXXXXXbiaFXXXXXXXXXX-120-120.svg',
|
|
743
|
+
title: '标题名称',
|
|
744
|
+
description: '说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字'
|
|
745
|
+
}];
|
|
1003
746
|
var getSnippets = function getSnippets(textLines) {
|
|
1004
747
|
if (textLines === void 0) {
|
|
1005
748
|
textLines = 2;
|
|
@@ -1009,7 +752,13 @@ var getSnippets = function getSnippets(textLines) {
|
|
|
1009
752
|
screenshot: '',
|
|
1010
753
|
schema: {
|
|
1011
754
|
componentName: 'TeletextList',
|
|
1012
|
-
props: {
|
|
755
|
+
props: {
|
|
756
|
+
// 将默认数据放到 snippet props 中,而非依赖 setter.initialValue。
|
|
757
|
+
// 因为 dataList 使用了 ignoreDefaultValue:()=>true 来阻止引擎在
|
|
758
|
+
// SettingFieldView remount 时覆盖已绑定的 JSExpression,
|
|
759
|
+
// 所以 initDefaultValue 永远不会运行,首次拖入的初始数据必须由 snippet 提供。
|
|
760
|
+
dataList: DEFAULT_DATA_LIST
|
|
761
|
+
},
|
|
1013
762
|
children: [{
|
|
1014
763
|
componentName: 'NextText',
|
|
1015
764
|
props: {
|
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.374';
|
|
126
126
|
}
|
|
127
127
|
if (basicLibraryVersion === void 0) {
|
|
128
128
|
basicLibraryVersion = {
|