@dile/ui 2.9.0 → 2.10.1

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.
@@ -1,5 +1,6 @@
1
1
  import { html, css, LitElement } from "lit";
2
2
  import { DileEmmitChange } from '../../../mixins/form/index.js';
3
+ import { checkboxBlankIcon, checkboxCheckedIcon } from '@dile/icons';
3
4
 
4
5
  export class DileCheckbox extends DileEmmitChange(LitElement) {
5
6
  static get properties() {
@@ -26,6 +27,7 @@ export class DileCheckbox extends DileEmmitChange(LitElement) {
26
27
  return css`
27
28
  :host {
28
29
  display: inline-block;
30
+ --dile-icon-size: var(--dile-checkbox-size, 20px);
29
31
  }
30
32
  div {
31
33
  display: flex;
@@ -38,34 +40,15 @@ export class DileCheckbox extends DileEmmitChange(LitElement) {
38
40
  }
39
41
  .checkbox {
40
42
  display: flex;
41
- background-color: var(--dile-checkbox-checked-color, #30a030);
42
- border-radius: 4px;
43
- width: var(--dile-checkbox-size, 20px);
44
- height: var(--dile-checkbox-size, 20px);
45
- line-height: 0;
43
+ --dile-icon-color: var(--dile-checkbox-checked-color, #30a030);
46
44
  align-items: center;
47
45
  justify-content: center;
48
46
  }
49
47
  .isUnchecked {
50
- background-color: var(--dile-checkbox-unchecked-color, #ccc);
51
- }
52
- path[fill="none"],
53
- .checked path[fill="none"] {
54
- fill: transparent;
55
- }
56
- path {
57
- fill: var(--dile-checkbox-fill-color, #fff);
58
- }
59
- .checked path {
60
- fill: var(--dile-checkbox-unchecked-fill-color, #fff);
61
- }
62
- svg {
63
- width: var(--dile-checkbox-size, 20px);
64
- height: var(--dile-checkbox-size, 20px);
65
- line-height: var(--dile-checkbox-size, 20px);
48
+ --dile-icon-color: var(--dile-checkbox-unchecked-color, #303030);
66
49
  }
67
50
  .label {
68
- margin-left: 10px;
51
+ margin-left: var(--dile-checkbox-label-margin-left, 0.25rem);
69
52
  font-weight: var(--dile-checkbox-font-weight, normal);
70
53
  color: var(--dile-checkbox-label-color, var(--dile-on-background-color, #303030));
71
54
  }
@@ -88,7 +71,7 @@ export class DileCheckbox extends DileEmmitChange(LitElement) {
88
71
  }
89
72
 
90
73
  updated(changedProperties) {
91
- if (changedProperties.has("checked")) {
74
+ if (changedProperties.has('checked')) {
92
75
  this.emmitChange();
93
76
  this.internals.setFormValue(this.checked ? 'true' : null);
94
77
  }
@@ -134,20 +117,10 @@ export class DileCheckbox extends DileEmmitChange(LitElement) {
134
117
  }
135
118
 
136
119
  get checkedIcon() {
137
- return html`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
138
- <path d="M0 0h24v24H0z" fill="none" />
139
- <path
140
- d="M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
141
- />
142
- </svg>`;
120
+ return html`<dile-icon .icon="${checkboxCheckedIcon}"></dile-icon>`;
143
121
  }
144
122
  get unCheckedIcon() {
145
- return html`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
146
- <path
147
- d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"
148
- />
149
- <path d="M0 0h24v24H0z" fill="none" />
150
- </svg>`;
123
+ return html`<dile-icon .icon="${checkboxBlankIcon}"></dile-icon>`;
151
124
  }
152
125
 
153
126
  doKeyPress(e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dile/ui",
3
- "version": "2.9.0",
3
+ "version": "2.10.1",
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": "cb639a4e7f368e3d9239a4bd1bf28154d759c9d8"
29
+ "gitHead": "da7dcc3e69b2e1f5b02f7c603d99e6d7972c2e07"
30
30
  }