@dile/ui 2.1.18 → 2.1.19

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.
@@ -109,6 +109,7 @@ export class DileCheckbox extends DileEmmitChange(LitElement) {
109
109
  }
110
110
  `
111
111
  }
112
+
112
113
  doClick() {
113
114
  if (this.disabled) {
114
115
  return;
@@ -42,17 +42,39 @@ export class DileSwitch extends DileCheckbox {
42
42
  `
43
43
  ];
44
44
 
45
+ static get properties() {
46
+ return {
47
+ useReactiveLabels: { type: Boolean },
48
+ checkedLabel: { type: String },
49
+ uncheckedLabel: { type: String },
50
+ };
51
+ }
52
+
45
53
  render() {
46
54
  return html`
47
55
  <div @click=${this.toggle}>
48
56
  <section>
49
57
  <span></span>
50
58
  </section>
51
- ${this.innerTemplate}
59
+ ${this.useReactiveLabels
60
+ ? this.reactiveLabelsTemplate
61
+ : this.innerTemplate
62
+ }
52
63
  </div>
53
64
  `;
54
65
  }
55
66
 
67
+ get reactiveLabelsTemplate() {
68
+ return html`
69
+ <label class="label">
70
+ ${this.checked
71
+ ? this.checkedLabel
72
+ : this.uncheckedLabel
73
+ }
74
+ </label>
75
+ `
76
+ }
77
+
56
78
  toggle() {
57
79
  if (this.disabled) {
58
80
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dile/ui",
3
- "version": "2.1.18",
3
+ "version": "2.1.19",
4
4
  "description": "UI Core components from dile-components.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -26,5 +26,5 @@
26
26
  "publishConfig": {
27
27
  "access": "public"
28
28
  },
29
- "gitHead": "590589b6c02e4ad4ca232a7959b19eccaea30295"
29
+ "gitHead": "6f6fd44a9d3244f6f73e29d50a00a4eb8277286b"
30
30
  }