km-card-layout-component-miniprogram 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.
Files changed (46) hide show
  1. package/example/app.js +11 -1
  2. package/example/pages/home/index.js +324 -101
  3. package/example/pages/home/index.wxml +2 -1
  4. package/miniprogram_dist/components/card-layout/elements/custom-element/index.js +12 -6
  5. package/miniprogram_dist/components/card-layout/elements/custom-element/index.wxml +4 -6
  6. package/miniprogram_dist/components/card-layout/elements/custom-element/index.wxss +1 -1
  7. package/miniprogram_dist/components/card-layout/elements/icon-element/index.js +32 -15
  8. package/miniprogram_dist/components/card-layout/elements/icon-element/index.wxml +3 -7
  9. package/miniprogram_dist/components/card-layout/elements/icon-element/index.wxss +3 -17
  10. package/miniprogram_dist/components/card-layout/elements/icon-font.wxss +429 -0
  11. package/miniprogram_dist/components/card-layout/elements/image-element/index.js +18 -9
  12. package/miniprogram_dist/components/card-layout/elements/image-element/index.wxml +8 -10
  13. package/miniprogram_dist/components/card-layout/elements/image-element/index.wxss +1 -1
  14. package/miniprogram_dist/components/card-layout/elements/layout-panel-element/index.js +37 -0
  15. package/miniprogram_dist/components/card-layout/elements/layout-panel-element/index.json +3 -0
  16. package/miniprogram_dist/components/card-layout/elements/layout-panel-element/index.wxml +5 -0
  17. package/miniprogram_dist/components/card-layout/elements/layout-panel-element/index.wxss +10 -0
  18. package/miniprogram_dist/components/card-layout/elements/text-element/index.js +41 -17
  19. package/miniprogram_dist/components/card-layout/elements/text-element/index.wxml +8 -34
  20. package/miniprogram_dist/components/card-layout/elements/text-element/index.wxss +5 -18
  21. package/miniprogram_dist/components/card-layout/index.js +39 -108
  22. package/miniprogram_dist/components/card-layout/index.json +9 -1
  23. package/miniprogram_dist/components/card-layout/index.wxml +25 -46
  24. package/miniprogram_dist/components/card-layout/index.wxss +1 -538
  25. package/package.json +1 -1
  26. package/src/components/card-layout/elements/custom-element/index.ts +13 -7
  27. package/src/components/card-layout/elements/custom-element/index.wxml +4 -6
  28. package/src/components/card-layout/elements/custom-element/index.wxss +1 -1
  29. package/src/components/card-layout/elements/icon-element/index.ts +34 -16
  30. package/src/components/card-layout/elements/icon-element/index.wxml +3 -7
  31. package/src/components/card-layout/elements/icon-element/index.wxss +3 -17
  32. package/src/components/card-layout/elements/icon-font.wxss +429 -0
  33. package/src/components/card-layout/elements/image-element/index.ts +21 -11
  34. package/src/components/card-layout/elements/image-element/index.wxml +8 -10
  35. package/src/components/card-layout/elements/image-element/index.wxss +1 -1
  36. package/src/components/card-layout/elements/layout-panel-element/index.json +3 -0
  37. package/src/components/card-layout/elements/layout-panel-element/index.ts +40 -0
  38. package/src/components/card-layout/elements/layout-panel-element/index.wxml +5 -0
  39. package/src/components/card-layout/elements/layout-panel-element/index.wxss +10 -0
  40. package/src/components/card-layout/elements/text-element/index.ts +48 -19
  41. package/src/components/card-layout/elements/text-element/index.wxml +8 -34
  42. package/src/components/card-layout/elements/text-element/index.wxss +5 -18
  43. package/src/components/card-layout/index.json +9 -1
  44. package/src/components/card-layout/index.ts +45 -159
  45. package/src/components/card-layout/index.wxml +25 -46
  46. package/src/components/card-layout/index.wxss +1 -538
@@ -2,17 +2,26 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const index_1 = require("../../../../vendor/km-card-layout-core/index");
4
4
  const icon_map_1 = require("../../icon-map");
5
- const mapIconGlyph = (name, fallback) => {
5
+ const normalizeIconName = (name) => {
6
6
  if (!name)
7
- return fallback;
8
- const glyph = icon_map_1.ICON_CODE_MAP[name];
9
- if (glyph)
10
- return String.fromCharCode(parseInt(glyph, 16));
11
- return fallback || name;
7
+ return "";
8
+ return name.startsWith("icon-") ? name.slice(5) : name;
9
+ };
10
+ const buildIconClassName = (name) => {
11
+ const normalized = normalizeIconName(name);
12
+ if (!normalized)
13
+ return "";
14
+ return `icon-${normalized}`;
15
+ };
16
+ const buildIconCode = (name) => {
17
+ const normalized = normalizeIconName(name);
18
+ if (!normalized)
19
+ return "";
20
+ return icon_map_1.ICON_CODE_MAP[normalized] || "";
12
21
  };
13
22
  Component({
14
23
  options: {
15
- styleIsolation: 'apply-shared',
24
+ styleIsolation: "apply-shared",
16
25
  },
17
26
  properties: {
18
27
  element: {
@@ -25,19 +34,27 @@ Component({
25
34
  },
26
35
  },
27
36
  data: {
28
- wrapperStyle: '',
29
- contentStyle: '',
30
- iconText: '',
37
+ wrapperStyle: "",
38
+ contentStyle: "",
39
+ iconClass: "",
40
+ iconCode: "",
31
41
  },
32
42
  observers: {
33
- element(el) {
43
+ element() {
44
+ this.rebuild();
45
+ },
46
+ },
47
+ methods: {
48
+ rebuild() {
49
+ const el = this.data.element;
34
50
  if (!el)
35
51
  return;
36
- const wrapperStyle = (0, index_1.styleObjectToString)((0, index_1.buildWrapperStyle)(el, 'rpx'), 'rpx');
37
- const contentStyle = (0, index_1.styleObjectToString)((0, index_1.buildBaseContentStyle)(el), 'rpx');
52
+ const wrapperStyle = (0, index_1.styleObjectToString)((0, index_1.buildWrapperStyle)(el, "rpx"), "rpx");
53
+ const contentStyle = (0, index_1.styleObjectToString)((0, index_1.buildBaseContentStyle)(el), "rpx");
38
54
  const name = (0, index_1.getIconName)(el);
39
- const iconText = mapIconGlyph(name, name || '');
40
- this.setData({ wrapperStyle, contentStyle, iconText });
55
+ const iconClass = buildIconClassName(name);
56
+ const iconCode = buildIconCode(name);
57
+ this.setData({ wrapperStyle, contentStyle, iconClass, iconCode });
41
58
  },
42
59
  },
43
60
  });
@@ -1,7 +1,3 @@
1
- <template name="icon-element">
2
- <view class="km-node km-node--icon" style="{{wrapperStyle}}">
3
- <view class="km-node__icon icon" style="{{contentStyle}}">
4
- {{iconText}}
5
- </view>
6
- </view>
7
- </template>
1
+ <view class="km-node km-node--icon canvas-item" style="{{wrapperStyle}}">
2
+ <view class="km-node__icon icon {{iconClass}} canvas-item" style="{{contentStyle}}" data-icon="{{iconCode}}"></view>
3
+ </view>
@@ -1,3 +1,5 @@
1
+ @import "../icon-font.wxss";
2
+
1
3
  .km-node {
2
4
  box-sizing: border-box;
3
5
  color: inherit;
@@ -18,20 +20,4 @@
18
20
  font-family: 'km-icon', 'PingFang SC', 'Microsoft Yahei', sans-serif;
19
21
  font-style: normal;
20
22
  font-weight: normal;
21
- }
22
-
23
- @font-face {
24
- font-family: 'km-icon';
25
- src: url('data:font/woff;charset=utf-8;base64,d09GRgABAAAAAEl4AA0AAAAAcmgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAABJXAAAABoAAAAcrMtJV0dERUYAAEk8AAAAHgAAAB4AKQByT1MvMgAAAaQAAABGAAAAYDw3SVljbWFwAAAC7AAAAM8AAAIW8XL3K2dhc3AAAEk0AAAACAAAAAj//wADZ2x5ZgAABJgAAEBZAABkZPJymXJoZWFkAAABMAAAADEAAAA2MtZiFmhoZWEAAAFkAAAAIAAAACQNagmCaG10eAAAAewAAAD/AAABqqs3Ii9sb2NhAAADvAAAANoAAADaKv0P7G1heHAAAAGEAAAAHwAAACABmQHEbmFtZQAARPQAAAFGAAACgl6CAQJwb3N0AABGPAAAAvUAAATh1g15W3jaY2BkYGAA4lqffPd4fpuvDNwsDCDwVIyfA0b///i/gXMWcyeQy8HABBIFAAVdCfwAAAB42mNgZGBgbvjfwBDDOfP/x///OWcxAEVQQCYAuxgH/XjaY2BkYGDIYdzBoMwAAkxAzAWEDAz/wXwGACjlAl8AeNpjYGFRYJzAwMrAwNTJdIaBgaEfQjO+ZjBi5ACKMrAyM2AFAWmuKQwHnjE+y2Ju+N/AwMB8h6ERKMyIpESBgREAenQNCwAAeNo90cErBGEYx/Hf1LMH7MVxoigHtS600pzWnMjBlt2dFAeiNuWgXLgokgslbpyE/Aduyl38J3ty4aCs7/vOk6lPv+d5531n3nfGVF5JIZlUx9fAbawnEfIFq14/YhddFPjFmynZ9n4TbYzg2tcMW6Epr4NQT3jSJ2lcW9ec1fSEAheMnVume7KKBbQwiMye+5/kEpqYwQoOY59pn1xGw3Lt8NwHS7UY35frivqbet2fNYZp+4j76vj+GpUhjZJreLfxODecay/eTzVPzmIj9uX7VLnUmfdb/2fN4trcv0kYv8Oxe/V5Rzhg7inZ8wzjN5b0f6z8PV2d/AHivi0JAHja3dBFUoVRDITR88PD3d3d3d3d3d33zQqYwwVGbIGk8qV6kK7qIN7vlIsCRdlBRT865iPsWOig318/PwOjbwYd+7mKSZAoSbIUqdKky5ApS7YcufLkK1CoSLESpcqCZ4VKVarVqFWnXoNGTZq1aNWmXYdOXbr16NWn34BBQ4aNGDVm3IRJU6bNmDVn3oJFS5atWLVm3YZNW7bt2LVn34FDR46dOHXm3IVLV67duHXn3oNHT8Hv2YtXbyFaot9HfMeMC4jztyL/vr4AXx4eawAAAAAAAAAAAACwAPIDSgQ8BLIFUgWUBcIF/gY8BpIHCgdAB3wHoAgOCHAIxgk+CV4JzAnqCkQKrgtUC8QMEAxsDNQNFA1SDegONg6qDyQPgg/CEAIQxBEwEaQSHBLYE14T4hRcFPIVTBYMFkwWqBckGGAYxhmYGegaEBpeGuIbXhvwHPQd5B62Hygf6CBeILog9CFUIbgiBCJ0ItQjbCQSJGgkuCVsJcImKib0J44ocijOKSApUCo2KmQqtituK34sJixkLMgtdC3WLpgvPC+QMBww/DGCMagyMgAA') format('woff');
26
- font-weight: normal;
27
- font-style: normal;
28
- font-display: swap;
29
- }
30
-
31
- .icon {
32
- font-family: 'km-icon' !important;
33
- font-size: 16px;
34
- font-style: normal;
35
- -webkit-font-smoothing: antialiased;
36
- -moz-osx-font-smoothing: grayscale;
37
- }
23
+ }
@@ -0,0 +1,429 @@
1
+ .icon {
2
+ font-family: 'km-icon' !important;
3
+ font-size: 16px;
4
+ font-style: normal;
5
+ -webkit-font-smoothing: antialiased;
6
+ -moz-osx-font-smoothing: grayscale;
7
+ }
8
+
9
+ .icon-buy-vip-13:before {
10
+ content: '\e66a';
11
+ }
12
+
13
+ .icon-buy-vip-11:before {
14
+ content: '\e669';
15
+ }
16
+
17
+ .icon-buy-vip-12:before {
18
+ content: '\e668';
19
+ }
20
+
21
+ .icon-contact-wechat:before {
22
+ content: '\e667';
23
+ }
24
+
25
+ .icon-contact-phone:before {
26
+ content: '\e666';
27
+ }
28
+
29
+ .icon-column-group:before {
30
+ content: '\e664';
31
+ }
32
+
33
+ .icon-minichat:before {
34
+ content: '\e617';
35
+ }
36
+
37
+ .icon-remove-module:before {
38
+ content: '\e660';
39
+ }
40
+
41
+ .icon-add-module:before {
42
+ content: '\e662';
43
+ }
44
+
45
+ .icon-drag:before {
46
+ content: '\e661';
47
+ }
48
+
49
+ .icon-switch-company:before {
50
+ content: '\e65f';
51
+ }
52
+
53
+ .icon-switch-person:before {
54
+ content: '\e65e';
55
+ }
56
+
57
+ .icon-manual-entry:before {
58
+ content: '\e65d';
59
+ }
60
+
61
+ .icon-play:before {
62
+ content: '\e65c';
63
+ }
64
+
65
+ .icon-plus:before {
66
+ content: '\e659';
67
+ }
68
+
69
+ .icon-file-pdf:before {
70
+ content: '\e65b';
71
+ }
72
+
73
+ .icon-file-video:before {
74
+ content: '\e65a';
75
+ }
76
+
77
+ .icon-upload:before {
78
+ content: '\e650';
79
+ }
80
+
81
+ .icon-cert-company:before {
82
+ content: '\e64f';
83
+ }
84
+
85
+ .icon-qr-code:before {
86
+ content: '\e658';
87
+ }
88
+
89
+ .icon-company-card:before {
90
+ content: '\e657';
91
+ }
92
+
93
+ .icon-card-import:before {
94
+ content: '\e64e';
95
+ }
96
+
97
+ .icon-camera:before {
98
+ content: '\e655';
99
+ }
100
+
101
+ .icon-card-apply:before {
102
+ content: '\e632';
103
+ }
104
+
105
+ .icon-check-2:before {
106
+ content: '\e616';
107
+ }
108
+
109
+ .icon-check:before {
110
+ content: '\e614';
111
+ }
112
+
113
+ .icon-buy-vip-4:before {
114
+ content: '\e613';
115
+ }
116
+
117
+ .icon-buy-vip-10:before {
118
+ content: '\e656';
119
+ }
120
+
121
+ .icon-weixin-2:before {
122
+ content: '\e653';
123
+ }
124
+
125
+ .icon-qrcode-1:before {
126
+ content: '\e654';
127
+ }
128
+
129
+ .icon-local:before {
130
+ content: '\e652';
131
+ }
132
+
133
+ .icon-cert-job:before {
134
+ content: '\e64d';
135
+ }
136
+
137
+ .icon-cert-name:before {
138
+ content: '\e651';
139
+ }
140
+
141
+ .icon-card-style-1:before {
142
+ content: '\e64c';
143
+ }
144
+
145
+ .icon-add-pic:before {
146
+ content: '\e646';
147
+ }
148
+
149
+ .icon-add-text:before {
150
+ content: '\e647';
151
+ }
152
+
153
+ .icon-buy-vip-2:before {
154
+ content: '\e648';
155
+ }
156
+
157
+ .icon-company-upload-logo:before {
158
+ content: '\e649';
159
+ }
160
+
161
+ .icon-Headset-one:before {
162
+ content: '\e64a';
163
+ }
164
+
165
+ .icon-edit-info:before {
166
+ content: '\e64b';
167
+ }
168
+
169
+ .icon-more-action:before {
170
+ content: '\e645';
171
+ }
172
+
173
+ .icon-upload-video:before {
174
+ content: '\e644';
175
+ }
176
+
177
+ .icon-upload-image:before {
178
+ content: '\e643';
179
+ }
180
+
181
+ .icon-company-info:before {
182
+ content: '\e62a';
183
+ }
184
+
185
+ .icon-contact:before {
186
+ content: '\e642';
187
+ }
188
+
189
+ .icon-notice-1:before {
190
+ content: '\e641';
191
+ }
192
+
193
+ .icon-visitor:before {
194
+ content: '\e640';
195
+ }
196
+
197
+ .icon-mobile-2:before {
198
+ content: '\e63e';
199
+ }
200
+
201
+ .icon-weixin-1:before {
202
+ content: '\e63f';
203
+ }
204
+
205
+ .icon-share:before {
206
+ content: '\e63d';
207
+ }
208
+
209
+ .icon-refund-mistake:before {
210
+ content: '\e637';
211
+ }
212
+
213
+ .icon-buy-vip-7:before {
214
+ content: '\e63b';
215
+ }
216
+
217
+ .icon-table-import:before {
218
+ content: '\e63c';
219
+ }
220
+
221
+ .icon-misService:before {
222
+ content: '\e63a';
223
+ }
224
+
225
+ .icon-buy-vip-6:before {
226
+ content: '\e634';
227
+ }
228
+
229
+ .icon-import:before {
230
+ content: '\e638';
231
+ }
232
+
233
+ .icon-download:before {
234
+ content: '\e639';
235
+ }
236
+
237
+ .icon-image:before {
238
+ content: '\e636';
239
+ }
240
+
241
+ .icon-buy-vip-9:before {
242
+ content: '\e635';
243
+ }
244
+
245
+ .icon-buy-vip-5:before {
246
+ content: '\e62f';
247
+ }
248
+
249
+ .icon-buy-vip-3:before {
250
+ content: '\e630';
251
+ }
252
+
253
+ .icon-buy-vip-1:before {
254
+ content: '\e631';
255
+ }
256
+
257
+ .icon-buy-vip-8:before {
258
+ content: '\e633';
259
+ }
260
+
261
+ .icon-companyWx:before {
262
+ content: '\e62b';
263
+ }
264
+
265
+ .icon-dingding:before {
266
+ content: '\e62c';
267
+ }
268
+
269
+ .icon-shui:before {
270
+ content: '\e62d';
271
+ }
272
+
273
+ .icon-gongzhang:before {
274
+ content: '\e62e';
275
+ }
276
+
277
+ .icon-wait:before {
278
+ content: '\e629';
279
+ }
280
+
281
+ .icon-addImg:before {
282
+ content: '\e628';
283
+ }
284
+
285
+ .icon-copy:before {
286
+ content: '\e625';
287
+ }
288
+
289
+ .icon-mobile-1:before {
290
+ content: '\e627';
291
+ }
292
+
293
+ .icon-functional-config:before {
294
+ content: '\e604';
295
+ }
296
+
297
+ .icon-module-config:before {
298
+ content: '\e601';
299
+ }
300
+
301
+ .icon-select-right:before {
302
+ content: '\e626';
303
+ }
304
+
305
+ .icon-like:before {
306
+ content: '\e624';
307
+ }
308
+
309
+ .icon-weixin:before {
310
+ content: '\e620';
311
+ }
312
+
313
+ .icon-column-user:before {
314
+ content: '\e621';
315
+ }
316
+
317
+ .icon-column-card:before {
318
+ content: '\e622';
319
+ }
320
+
321
+ .icon-column-company-card:before {
322
+ content: '\e623';
323
+ }
324
+
325
+ .icon-on-job:before {
326
+ content: '\e61e';
327
+ }
328
+
329
+ .icon-person:before {
330
+ content: '\e61f';
331
+ }
332
+
333
+ .icon-wallet:before {
334
+ content: '\e615';
335
+ }
336
+
337
+ .icon-opinion:before {
338
+ content: '\e618';
339
+ }
340
+
341
+ .icon-sys-set:before {
342
+ content: '\e619';
343
+ }
344
+
345
+ .icon-sys-msg:before {
346
+ content: '\e61d';
347
+ }
348
+
349
+ .icon-add:before {
350
+ content: '\e61a';
351
+ }
352
+
353
+ .icon-search:before {
354
+ content: '\e61b';
355
+ }
356
+
357
+ .icon-delete:before {
358
+ content: '\e61c';
359
+ }
360
+
361
+ .icon-enter:before {
362
+ content: '\e60f';
363
+ }
364
+
365
+ .icon-card-style:before {
366
+ content: '\e610';
367
+ }
368
+
369
+ .icon-switch:before {
370
+ content: '\e612';
371
+ }
372
+
373
+ .icon-card-edit:before {
374
+ content: '\e60a';
375
+ }
376
+
377
+ .icon-close:before {
378
+ content: '\e60d';
379
+ }
380
+
381
+ .icon-notice:before {
382
+ content: '\e611';
383
+ }
384
+
385
+ .icon-edit:before {
386
+ content: '\e60b';
387
+ }
388
+
389
+ .icon-help-info:before {
390
+ content: '\e60c';
391
+ }
392
+
393
+ .icon-tag-filtering:before {
394
+ content: '\e60e';
395
+ }
396
+
397
+ .icon-kuanmai-logo:before {
398
+ content: '\e603';
399
+ }
400
+
401
+ .icon-company:before {
402
+ content: '\e606';
403
+ }
404
+
405
+ .icon-email:before {
406
+ content: '\e607';
407
+ }
408
+
409
+ .icon-round:before {
410
+ content: '\e608';
411
+ }
412
+
413
+ .icon-address:before {
414
+ content: '\e609';
415
+ }
416
+
417
+ .icon-mobile:before {
418
+ content: '\e602';
419
+ }
420
+ .icon-helper:before {
421
+ content: '\e663';
422
+ }
423
+
424
+ .icon-bag:before {
425
+ content: '\e605';
426
+ }
427
+ .icon-group:before {
428
+ content: '\e665';
429
+ }
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const index_1 = require("../../../../vendor/km-card-layout-core/index");
4
4
  Component({
5
5
  options: {
6
- styleIsolation: 'apply-shared',
6
+ styleIsolation: "apply-shared",
7
7
  },
8
8
  properties: {
9
9
  element: {
@@ -16,20 +16,29 @@ Component({
16
16
  },
17
17
  },
18
18
  data: {
19
- wrapperStyle: '',
20
- contentStyle: '',
21
- imageSrc: '',
22
- mode: 'aspectFill',
19
+ wrapperStyle: "",
20
+ contentStyle: "",
21
+ imageSrc: "",
22
+ mode: "aspectFill",
23
23
  },
24
24
  observers: {
25
- element(el) {
25
+ element() {
26
+ this.rebuild();
27
+ },
28
+ rootData() {
29
+ this.rebuild();
30
+ },
31
+ },
32
+ methods: {
33
+ rebuild() {
34
+ const el = this.data.element;
26
35
  if (!el)
27
36
  return;
28
37
  const data = this.data.rootData || {};
29
- const wrapperStyle = (0, index_1.styleObjectToString)((0, index_1.buildWrapperStyle)(el, 'rpx'), 'rpx');
30
- const contentStyle = (0, index_1.styleObjectToString)((0, index_1.buildImageContentStyle)(el), 'rpx');
38
+ const wrapperStyle = (0, index_1.styleObjectToString)((0, index_1.buildWrapperStyle)(el, "rpx"), "rpx");
39
+ const contentStyle = (0, index_1.styleObjectToString)((0, index_1.buildImageContentStyle)(el), "rpx");
31
40
  const imageSrc = (0, index_1.getImageSrc)(el, data);
32
- const mode = el.fit === 'contain' ? 'aspectFit' : 'aspectFill';
41
+ const mode = el.fit === "contain" ? "aspectFit" : "aspectFill";
33
42
  this.setData({ wrapperStyle, contentStyle, imageSrc, mode });
34
43
  },
35
44
  },
@@ -1,10 +1,8 @@
1
- <template name="image-element">
2
- <view class="km-node" style="{{wrapperStyle}}">
3
- <image
4
- class="km-node__image"
5
- style="{{contentStyle}}"
6
- src="{{imageSrc}}"
7
- mode="{{mode}}"
8
- />
9
- </view>
10
- </template>
1
+ <view class="km-node canvas-item" style="{{wrapperStyle}}">
2
+ <image
3
+ class="km-node__image canvas-item"
4
+ style="{{contentStyle}}"
5
+ src="{{imageSrc}}"
6
+ mode="{{mode}}"
7
+ />
8
+ </view>
@@ -7,4 +7,4 @@
7
7
  width: 100%;
8
8
  height: 100%;
9
9
  display: block;
10
- }
10
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const index_1 = require("../../../../vendor/km-card-layout-core/index");
4
+ Component({
5
+ options: {
6
+ styleIsolation: "apply-shared",
7
+ },
8
+ properties: {
9
+ element: {
10
+ type: Object,
11
+ value: {},
12
+ },
13
+ rootData: {
14
+ type: Object,
15
+ value: {},
16
+ },
17
+ },
18
+ data: {
19
+ wrapperStyle: "",
20
+ contentStyle: "",
21
+ },
22
+ observers: {
23
+ element() {
24
+ this.rebuild();
25
+ },
26
+ },
27
+ methods: {
28
+ rebuild() {
29
+ const el = this.data.element;
30
+ if (!el)
31
+ return;
32
+ const wrapperStyle = (0, index_1.styleObjectToString)((0, index_1.buildWrapperStyle)(el, "rpx"), "rpx");
33
+ const contentStyle = (0, index_1.styleObjectToString)((0, index_1.buildPanelContentStyle)(el, "rpx"), "rpx");
34
+ this.setData({ wrapperStyle, contentStyle });
35
+ },
36
+ },
37
+ });
@@ -0,0 +1,5 @@
1
+ <view class="km-node itemClass" style="{{wrapperStyle}}">
2
+ <view class="km-node__panel itemClass" style="{{contentStyle}}">
3
+ <slot></slot>
4
+ </view>
5
+ </view>
@@ -0,0 +1,10 @@
1
+ .km-node {
2
+ box-sizing: border-box;
3
+ color: inherit;
4
+ }
5
+
6
+ .km-node__panel {
7
+ width: 100%;
8
+ height: 100%;
9
+ box-sizing: border-box;
10
+ }