@dile/ui 2.16.2 → 2.17.0

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.
@@ -2,6 +2,7 @@ import { html, css, LitElement } from "lit";
2
2
  import { DileEmmitChange } from '../../../mixins/form/index.js';
3
3
  import { checkboxBlankIcon, checkboxCheckedIcon } from '@dile/icons';
4
4
  import '../../icon/icon.js';
5
+ import '../../input/input-message.js';
5
6
 
6
7
  export class DileCheckbox extends DileEmmitChange(LitElement) {
7
8
  static get properties() {
@@ -10,6 +11,9 @@ export class DileCheckbox extends DileEmmitChange(LitElement) {
10
11
  disabled: { type: Boolean, reflect: true, },
11
12
  _hasInner: { type: Boolean },
12
13
  name: { type: String },
14
+ message: { type: String },
15
+ errored: { type: Boolean },
16
+ hideErrorOnInput: { type: Boolean },
13
17
  };
14
18
  }
15
19
 
@@ -22,6 +26,7 @@ export class DileCheckbox extends DileEmmitChange(LitElement) {
22
26
  this.checked = false;
23
27
  this.name = '';
24
28
  this.internals = this.attachInternals();
29
+ this.message = ''
25
30
  }
26
31
 
27
32
  static get styles() {
@@ -86,6 +91,10 @@ export class DileCheckbox extends DileEmmitChange(LitElement) {
86
91
  </a>
87
92
  ${this.innerTemplate}
88
93
  </div>
94
+ ${this.message
95
+ ? html`<dile-input-message message="${this.message}" ?errored=${this.errored}></dile-input-message>`
96
+ : ''
97
+ }
89
98
  `;
90
99
  }
91
100
 
@@ -104,6 +113,10 @@ export class DileCheckbox extends DileEmmitChange(LitElement) {
104
113
  if (this.disabled) {
105
114
  return;
106
115
  }
116
+ if(this.hideErrorOnInput && this.errored) {
117
+ this.message = '';
118
+ this.errored = false;
119
+ }
107
120
  this.checked = !this.checked;
108
121
  this.dispatchEvent(
109
122
  new CustomEvent("dile-checkbox-changed", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dile/ui",
3
- "version": "2.16.2",
3
+ "version": "2.17.0",
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": "8ef9bee84a3a5b6acaf22dc3b9d39550f5ceeb80"
29
+ "gitHead": "4ab371cd11a633d2f1e1c0de7057f619e18e8543"
30
30
  }