@umbraco-ui/uui-checkbox 1.9.0-rc.1 → 1.10.0-rc.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.
- package/custom-elements.json +13 -0
- package/lib/index.js +36 -11
- package/lib/uui-checkbox-indeterminate.example.d.ts +20 -0
- package/package.json +5 -5
package/custom-elements.json
CHANGED
|
@@ -18,6 +18,12 @@
|
|
|
18
18
|
"type": "boolean",
|
|
19
19
|
"default": "\"false\""
|
|
20
20
|
},
|
|
21
|
+
{
|
|
22
|
+
"name": "indeterminate",
|
|
23
|
+
"description": "Indeterminate state for the input.",
|
|
24
|
+
"type": "boolean",
|
|
25
|
+
"default": "\"false\""
|
|
26
|
+
},
|
|
21
27
|
{
|
|
22
28
|
"name": "disabled",
|
|
23
29
|
"description": "Disables the input.",
|
|
@@ -93,6 +99,13 @@
|
|
|
93
99
|
"type": "boolean",
|
|
94
100
|
"default": "\"false\""
|
|
95
101
|
},
|
|
102
|
+
{
|
|
103
|
+
"name": "indeterminate",
|
|
104
|
+
"attribute": "indeterminate",
|
|
105
|
+
"description": "Indeterminate state for the input.",
|
|
106
|
+
"type": "boolean",
|
|
107
|
+
"default": "\"false\""
|
|
108
|
+
},
|
|
96
109
|
{
|
|
97
110
|
"name": "disabled",
|
|
98
111
|
"attribute": "disabled",
|
package/lib/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UUIHorizontalShakeKeyframes, UUIHorizontalShakeAnimationValue } from '@umbraco-ui/uui-base/lib/animations';
|
|
2
2
|
import { defineElement } from '@umbraco-ui/uui-base/lib/registration';
|
|
3
3
|
import { UUIBooleanInputElement } from '@umbraco-ui/uui-boolean-input/lib';
|
|
4
|
-
import { iconCheck } from '@umbraco-ui/uui-icon-registry-essential/lib/svgs';
|
|
4
|
+
import { iconSubtract, iconCheck } from '@umbraco-ui/uui-icon-registry-essential/lib/svgs';
|
|
5
5
|
import { css, html } from 'lit';
|
|
6
6
|
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
@@ -18,7 +18,9 @@ let UUICheckboxElement = class extends UUIBooleanInputElement {
|
|
|
18
18
|
renderCheckbox() {
|
|
19
19
|
return html`
|
|
20
20
|
<div id="ticker">
|
|
21
|
-
<div id="icon-check"
|
|
21
|
+
<div id="icon-check">
|
|
22
|
+
${this.indeterminate ? iconSubtract : iconCheck}
|
|
23
|
+
</div>
|
|
22
24
|
</div>
|
|
23
25
|
`;
|
|
24
26
|
}
|
|
@@ -81,15 +83,18 @@ UUICheckboxElement.styles = [
|
|
|
81
83
|
var(--uui-color-surface-emphasis,rgb(250, 250, 250))
|
|
82
84
|
);
|
|
83
85
|
}
|
|
84
|
-
input:checked:not([disabled]) + #ticker
|
|
86
|
+
input:checked:not([disabled]) + #ticker,
|
|
87
|
+
input:indeterminate:not([disabled]) + #ticker {
|
|
85
88
|
border-color: var(--uui-color-selected,#3544b1);
|
|
86
89
|
}
|
|
87
90
|
|
|
88
|
-
label:hover input:checked:not([disabled]) + #ticker
|
|
91
|
+
label:hover input:checked:not([disabled]) + #ticker,
|
|
92
|
+
label:hover input:indeterminate:not([disabled]) + #ticker {
|
|
89
93
|
border-color: var(--uui-color-selected-emphasis,rgb(70, 86, 200));
|
|
90
94
|
}
|
|
91
95
|
|
|
92
|
-
label:focus input:checked + #ticker
|
|
96
|
+
label:focus input:checked + #ticker,
|
|
97
|
+
label:focus input:indeterminate + #ticker {
|
|
93
98
|
border-color: var(--uui-color-selected-emphasis,rgb(70, 86, 200));
|
|
94
99
|
}
|
|
95
100
|
|
|
@@ -124,18 +129,22 @@ UUICheckboxElement.styles = [
|
|
|
124
129
|
transform: scale(0);
|
|
125
130
|
opacity: 0;
|
|
126
131
|
}
|
|
127
|
-
label:hover input:checked:not([disabled]) + #ticker::before
|
|
132
|
+
label:hover input:checked:not([disabled]) + #ticker::before,
|
|
133
|
+
label:hover input:indeterminate:not([disabled]) + #ticker::before {
|
|
128
134
|
background-color: var(--uui-color-selected-emphasis,rgb(70, 86, 200));
|
|
129
135
|
}
|
|
130
136
|
|
|
131
|
-
input:checked + #ticker::before
|
|
137
|
+
input:checked + #ticker::before,
|
|
138
|
+
input:indeterminate + #ticker::before {
|
|
132
139
|
transform: scale(1);
|
|
133
140
|
opacity: 1;
|
|
134
141
|
}
|
|
135
|
-
input:checked + #ticker #icon-check
|
|
142
|
+
input:checked + #ticker #icon-check,
|
|
143
|
+
input:indeterminate + #ticker #icon-check {
|
|
136
144
|
opacity: 1;
|
|
137
145
|
}
|
|
138
|
-
label:focus input:checked + #ticker
|
|
146
|
+
label:focus input:checked + #ticker,
|
|
147
|
+
label:focus input:indeterminate + #ticker {
|
|
139
148
|
background-color: var(--uui-color-selected-emphasis,rgb(70, 86, 200));
|
|
140
149
|
}
|
|
141
150
|
|
|
@@ -152,15 +161,27 @@ UUICheckboxElement.styles = [
|
|
|
152
161
|
transform: scale(0.9);
|
|
153
162
|
}
|
|
154
163
|
|
|
164
|
+
:host(:not([disabled], [readonly]))
|
|
165
|
+
label:active
|
|
166
|
+
input:indeterminate
|
|
167
|
+
+ #ticker::before {
|
|
168
|
+
/** Stretch when mouse down */
|
|
169
|
+
transform: scale(0.9);
|
|
170
|
+
}
|
|
171
|
+
|
|
155
172
|
:host(:not([pristine]):invalid) #ticker,
|
|
156
173
|
:host(:not([pristine]):invalid) label:hover #ticker,
|
|
157
174
|
:host(:not([pristine]):invalid) label:hover input:checked:not([disabled]) + #ticker,
|
|
175
|
+
:host(:not([pristine]):invalid) label:hover input:indeterminate:not([disabled]) + #ticker,
|
|
158
176
|
:host(:not([pristine]):invalid) label:focus input:checked + #ticker,
|
|
177
|
+
:host(:not([pristine]):invalid) label:focus input:indeterminate + #ticker,
|
|
159
178
|
/* polyfill support */
|
|
160
179
|
:host(:not([pristine])[internals-invalid]) #ticker,
|
|
161
180
|
:host(:not([pristine])[internals-invalid]) label:hover #ticker,
|
|
162
181
|
:host(:not([pristine])[internals-invalid]) label:hover input:checked:not([disabled]) + #ticker,
|
|
163
|
-
:host(:not([pristine])[internals-invalid]) label:
|
|
182
|
+
:host(:not([pristine])[internals-invalid]) label:hover input:indeterminate:not([disabled]) + #ticker,
|
|
183
|
+
:host(:not([pristine])[internals-invalid]) label:focus input:checked + #ticker,
|
|
184
|
+
:host(:not([pristine])[internals-invalid]) label:focus input:indeterminate + #ticker {
|
|
164
185
|
border: 1px solid var(--uui-color-danger-standalone,rgb(191, 33, 78));
|
|
165
186
|
}
|
|
166
187
|
|
|
@@ -170,6 +191,9 @@ UUICheckboxElement.styles = [
|
|
|
170
191
|
:host([disabled]) input:checked + #ticker {
|
|
171
192
|
background-color: var(--uui-color-disabled,#f3f3f5);
|
|
172
193
|
}
|
|
194
|
+
:host([disabled]) input:indeterminate + #ticker {
|
|
195
|
+
background-color: var(--uui-color-disabled,#f3f3f5);
|
|
196
|
+
}
|
|
173
197
|
:host([disabled]) #ticker::before {
|
|
174
198
|
background-color: var(--uui-color-disabled,#f3f3f5);
|
|
175
199
|
}
|
|
@@ -179,7 +203,8 @@ UUICheckboxElement.styles = [
|
|
|
179
203
|
:host([disabled]) label:active #ticker {
|
|
180
204
|
animation: ${UUIHorizontalShakeAnimationValue};
|
|
181
205
|
}
|
|
182
|
-
:host([disabled]) input:checked + #ticker #icon-check
|
|
206
|
+
:host([disabled]) input:checked + #ticker #icon-check,
|
|
207
|
+
:host([disabled]) input:indeterminate + #ticker #icon-check {
|
|
183
208
|
color: var(--uui-color-disabled-contrast,#c4c4c4);
|
|
184
209
|
}
|
|
185
210
|
`
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import '@umbraco-ui/uui-checkbox/lib';
|
|
3
|
+
export type Option = {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
};
|
|
7
|
+
export default class UUICheckboxIndeterminateExample extends LitElement {
|
|
8
|
+
label: string;
|
|
9
|
+
parent: Option;
|
|
10
|
+
options: Option[];
|
|
11
|
+
values: string[];
|
|
12
|
+
private _handleParentChange;
|
|
13
|
+
private _handleOptionChange;
|
|
14
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
15
|
+
}
|
|
16
|
+
declare global {
|
|
17
|
+
interface HTMLElementTagNameMap {
|
|
18
|
+
'uui-checkbox-indeterminate-example': UUICheckboxIndeterminateExample;
|
|
19
|
+
}
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umbraco-ui/uui-checkbox",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0-rc.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Umbraco",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"custom-elements.json"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@umbraco-ui/uui-base": "1.
|
|
37
|
-
"@umbraco-ui/uui-boolean-input": "1.
|
|
38
|
-
"@umbraco-ui/uui-icon-registry-essential": "1.
|
|
36
|
+
"@umbraco-ui/uui-base": "1.10.0-rc.0",
|
|
37
|
+
"@umbraco-ui/uui-boolean-input": "1.10.0-rc.0",
|
|
38
|
+
"@umbraco-ui/uui-icon-registry-essential": "1.10.0-rc.0"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "npm run analyze && tsc --build && rollup -c rollup.config.js",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
48
|
"homepage": "https://uui.umbraco.com/?path=/story/uui-checkbox",
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "f7982264bca0f2db4109c638e458f10719b1c22f"
|
|
50
50
|
}
|