@dckj-npm/dc-material 0.1.213 → 0.1.214
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.
|
@@ -152,9 +152,6 @@ const TeletextListMeta: IPublicTypeComponentMetadata = {
|
|
|
152
152
|
},
|
|
153
153
|
},
|
|
154
154
|
extraProps: {
|
|
155
|
-
getValue(target, value) {
|
|
156
|
-
console.log('dataList getValue', target, value)
|
|
157
|
-
},
|
|
158
155
|
setValue: (target, value) => {
|
|
159
156
|
console.log('dataList setValue', target, value)
|
|
160
157
|
},
|
|
@@ -318,16 +315,16 @@ const TeletextListMeta: IPublicTypeComponentMetadata = {
|
|
|
318
315
|
setValue(target, value) {
|
|
319
316
|
target.getProps().setPropValue('textLines', value)
|
|
320
317
|
// 获取组件schema
|
|
321
|
-
const
|
|
318
|
+
const children = target?.node?.children
|
|
322
319
|
const currentLength =
|
|
323
|
-
|
|
320
|
+
children?.filter(
|
|
324
321
|
(child) =>
|
|
325
|
-
child.componentName === 'NextText' && child.
|
|
322
|
+
child.componentName === 'NextText' && child.propsData?.key?.startsWith('text-'),
|
|
326
323
|
)?.length || 0
|
|
327
324
|
if (value > currentLength) {
|
|
328
325
|
// 需要添加新的文本组件
|
|
329
326
|
for (let i = currentLength + 1; i <= value; i++) {
|
|
330
|
-
|
|
327
|
+
children?.push({
|
|
331
328
|
componentName: 'NextText',
|
|
332
329
|
props: {
|
|
333
330
|
type: 'inherit',
|
|
@@ -338,15 +335,16 @@ const TeletextListMeta: IPublicTypeComponentMetadata = {
|
|
|
338
335
|
}
|
|
339
336
|
} else if (value < currentLength) {
|
|
340
337
|
// 需要移除多余的文本组件
|
|
341
|
-
|
|
338
|
+
children = children.filter(
|
|
342
339
|
(child) =>
|
|
343
340
|
!(
|
|
344
341
|
child.componentName === 'NextText' &&
|
|
345
|
-
child.
|
|
346
|
-
parseInt(child.
|
|
342
|
+
child.propsData?.key?.startsWith('text-') &&
|
|
343
|
+
parseInt(child.propsData?.key?.split('-')[1]) > value
|
|
347
344
|
),
|
|
348
345
|
)
|
|
349
346
|
}
|
|
347
|
+
target?.node?.children?.importSchema()
|
|
350
348
|
|
|
351
349
|
// 更新数据源绑定的配置
|
|
352
350
|
const dataListBindProp = target.parent.items.find(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dckj-npm/dc-material",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.214",
|
|
4
4
|
"description": "dc低代码物料",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -112,4 +112,4 @@
|
|
|
112
112
|
"type": "component"
|
|
113
113
|
},
|
|
114
114
|
"homepage": "https://unpkg.com/@dckj-npm/dc-material@0.1.148/build/index.html"
|
|
115
|
-
}
|
|
115
|
+
}
|