inviton-powerduck 0.0.211 → 0.0.213

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.
@@ -0,0 +1,5 @@
1
+ export default class VueUtils {
2
+ static isVNode(item: any): boolean {
3
+ return item?.__v_isVNode;
4
+ }
5
+ }
@@ -1,6 +1,7 @@
1
1
  import type { VNode } from 'vue';
2
2
  import { Prop, toNative } from 'vue-facing-decorator';
3
3
  import TsxComponent, { Component } from '../../app/vuetsx';
4
+ import VueUtils from '../../common/utils/vue-utils';
4
5
 
5
6
  interface CardHeaderArgs {
6
7
  title?: string | VNode;
@@ -15,11 +16,15 @@ class CardHeaderComponent extends TsxComponent<CardHeaderArgs> implements CardHe
15
16
  @Prop() smallTitle?: string;
16
17
 
17
18
  render(h) {
19
+ const titleIsVnode = VueUtils.isVNode(this.title);
20
+
18
21
  return (
19
22
  <div class="card-header ">
20
23
  {this.smallTitle && <h6 class="card-small-title">{this.smallTitle}</h6>}
24
+ {titleIsVnode && this.title
25
+ && <div class="card-title card-title-vnode">{this.title}</div>}
21
26
 
22
- {this.title && (
27
+ {!titleIsVnode && this.title && (
23
28
  <h5 class="card-title">
24
29
  {this.title}
25
30
 
@@ -68,7 +68,7 @@ class CardComponent extends TsxComponent<CardArgs> implements CardArgs {
68
68
 
69
69
  getBoxShadowCardCss(): string {
70
70
  if (this.renderMode == 'inlined' || this.hasShadow == true) {
71
- return ' with-card-shadow';
71
+ return 'with-card-shadow';
72
72
  }
73
73
 
74
74
  return '';
@@ -76,26 +76,18 @@ class CardComponent extends TsxComponent<CardArgs> implements CardArgs {
76
76
 
77
77
  getRenderModeCardCss(): string {
78
78
  if (this.renderMode == 'inlined') {
79
- return ' card-render-inlined';
79
+ return 'card-render-inlined';
80
80
  }
81
81
 
82
82
  return '';
83
83
  }
84
84
 
85
85
  getShadowClass(): string {
86
- if (this.shadow) {
87
- return `card--shadow-${this.shadow}`;
88
- }
89
-
90
- return '';
86
+ return `card--shadow-${this.shadow ?? 'default'}`;
91
87
  }
92
88
 
93
89
  getPaddingClass(): string {
94
- if (this.padding) {
95
- return `card--padding-${this.padding}`;
96
- }
97
-
98
- return '';
90
+ return `card--padding-${this.padding ?? 'default'}`;
99
91
  }
100
92
 
101
93
  getRole() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "inviton-powerduck",
3
3
  "type": "module",
4
- "version": "0.0.211",
4
+ "version": "0.0.213",
5
5
  "files": [
6
6
  "app/",
7
7
  "common/",