km-card-layout-core 0.1.19 → 0.1.21
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/dist/ops/changeBackground.js +1 -1
- package/dist/render/tool.js +1 -1
- package/ops/changeBackground.ts +1 -1
- package/package.json +1 -1
- package/render/tool.ts +1 -1
|
@@ -136,7 +136,7 @@ exports.updateElementsStyle = updateElementsStyle;
|
|
|
136
136
|
const setElementVisible = (layout, key, visible) => {
|
|
137
137
|
return layout.map(la => ({
|
|
138
138
|
...la,
|
|
139
|
-
children: la.children.map(el => (el.
|
|
139
|
+
children: la.children.map(el => (el.key === key ? { ...el, visible } : el)),
|
|
140
140
|
}));
|
|
141
141
|
};
|
|
142
142
|
exports.setElementVisible = setElementVisible;
|
package/dist/render/tool.js
CHANGED
|
@@ -7,7 +7,7 @@ function buildRenderData(layout, items, config) {
|
|
|
7
7
|
// 绑定数据
|
|
8
8
|
let renderLayout = (0, utils_1.applyItemCollectBindings)(layout, items);
|
|
9
9
|
// 设置显示逻辑
|
|
10
|
-
renderLayout = (0, changeBackground_1.setElementVisible)(renderLayout, '
|
|
10
|
+
renderLayout = (0, changeBackground_1.setElementVisible)(renderLayout, 'image', config.showAvatar);
|
|
11
11
|
renderLayout = (0, changeBackground_1.setElementVisible)(renderLayout, 'logo', config.showLogo);
|
|
12
12
|
// 设置背景
|
|
13
13
|
renderLayout = renderLayout.map((la, index) => (0, changeBackground_1.backgroundChange)(config.currentBg[index], la));
|
package/ops/changeBackground.ts
CHANGED
|
@@ -174,6 +174,6 @@ export const setElementVisible = (
|
|
|
174
174
|
): CardLayoutSchema[] => {
|
|
175
175
|
return layout.map(la => ({
|
|
176
176
|
...la,
|
|
177
|
-
children: la.children.map(el => (el.
|
|
177
|
+
children: la.children.map(el => (el.key === key ? { ...el, visible } : el)),
|
|
178
178
|
}));
|
|
179
179
|
};
|
package/package.json
CHANGED
package/render/tool.ts
CHANGED
|
@@ -11,7 +11,7 @@ export function buildRenderData(
|
|
|
11
11
|
// 绑定数据
|
|
12
12
|
let renderLayout = applyItemCollectBindings(layout, items);
|
|
13
13
|
// 设置显示逻辑
|
|
14
|
-
renderLayout = setElementVisible(renderLayout, '
|
|
14
|
+
renderLayout = setElementVisible(renderLayout, 'image', config.showAvatar);
|
|
15
15
|
renderLayout = setElementVisible(renderLayout, 'logo', config.showLogo);
|
|
16
16
|
// 设置背景
|
|
17
17
|
renderLayout = renderLayout.map((la, index) =>
|