@vaadin/checkbox 24.8.4 → 25.0.0-alpha10
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/README.md +0 -23
- package/package.json +13 -14
- package/src/styles/vaadin-checkbox-base-styles.js +33 -0
- package/src/styles/vaadin-checkbox-core-styles.d.ts +8 -0
- package/src/styles/vaadin-checkbox-core-styles.js +44 -0
- package/src/vaadin-checkbox-mixin.d.ts +0 -2
- package/src/vaadin-checkbox.js +13 -8
- package/theme/lumo/vaadin-checkbox-styles.js +3 -2
- package/web-types.json +1 -1
- package/web-types.lit.json +1 -1
- package/src/vaadin-checkbox-styles.js +0 -95
- package/src/vaadin-lit-checkbox.js +0 -64
- package/theme/lumo/vaadin-lit-checkbox.d.ts +0 -2
- package/theme/lumo/vaadin-lit-checkbox.js +0 -2
- package/theme/material/vaadin-checkbox-styles.d.ts +0 -1
- package/theme/material/vaadin-checkbox-styles.js +0 -189
- package/theme/material/vaadin-checkbox.d.ts +0 -2
- package/theme/material/vaadin-checkbox.js +0 -2
- package/theme/material/vaadin-lit-checkbox.d.ts +0 -2
- package/theme/material/vaadin-lit-checkbox.js +0 -2
- package/vaadin-lit-checkbox.d.ts +0 -1
- package/vaadin-lit-checkbox.js +0 -2
- /package/src/{vaadin-checkbox-styles.d.ts → styles/vaadin-checkbox-base-styles.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -28,29 +28,6 @@ Once installed, import the component in your application:
|
|
|
28
28
|
import '@vaadin/checkbox';
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
## Themes
|
|
32
|
-
|
|
33
|
-
Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/styling), Lumo and Material.
|
|
34
|
-
The [main entrypoint](https://github.com/vaadin/web-components/blob/main/packages/checkbox/vaadin-checkbox.js) of the package uses the Lumo theme.
|
|
35
|
-
|
|
36
|
-
To use the Material theme, import the component from the `theme/material` folder:
|
|
37
|
-
|
|
38
|
-
```js
|
|
39
|
-
import '@vaadin/checkbox/theme/material/vaadin-checkbox.js';
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
You can also import the Lumo version of the component explicitly:
|
|
43
|
-
|
|
44
|
-
```js
|
|
45
|
-
import '@vaadin/checkbox/theme/lumo/vaadin-checkbox.js';
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Finally, you can import the un-themed component from the `src` folder to get a minimal starting point:
|
|
49
|
-
|
|
50
|
-
```js
|
|
51
|
-
import '@vaadin/checkbox/src/vaadin-checkbox.js';
|
|
52
|
-
```
|
|
53
|
-
|
|
54
31
|
## Contributing
|
|
55
32
|
|
|
56
33
|
Read the [contributing guide](https://vaadin.com/docs/latest/contributing) to learn about our development process, how to propose bugfixes and improvements, and how to test your changes to Vaadin components.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/checkbox",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "25.0.0-alpha10",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
"type": "module",
|
|
22
22
|
"files": [
|
|
23
23
|
"src",
|
|
24
|
+
"!src/styles/*-base-styles.d.ts",
|
|
25
|
+
"!src/styles/*-base-styles.js",
|
|
24
26
|
"theme",
|
|
25
27
|
"vaadin-*.d.ts",
|
|
26
28
|
"vaadin-*.js",
|
|
@@ -31,29 +33,26 @@
|
|
|
31
33
|
"Vaadin",
|
|
32
34
|
"checkbox",
|
|
33
35
|
"web-components",
|
|
34
|
-
"web-component"
|
|
35
|
-
"polymer"
|
|
36
|
+
"web-component"
|
|
36
37
|
],
|
|
37
38
|
"dependencies": {
|
|
38
39
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
39
|
-
"@
|
|
40
|
-
"@vaadin/
|
|
41
|
-
"@vaadin/
|
|
42
|
-
"@vaadin/
|
|
43
|
-
"@vaadin/vaadin-
|
|
44
|
-
"@vaadin/vaadin-material-styles": "~24.8.4",
|
|
45
|
-
"@vaadin/vaadin-themable-mixin": "~24.8.4",
|
|
40
|
+
"@vaadin/a11y-base": "25.0.0-alpha10",
|
|
41
|
+
"@vaadin/component-base": "25.0.0-alpha10",
|
|
42
|
+
"@vaadin/field-base": "25.0.0-alpha10",
|
|
43
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha10",
|
|
44
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha10",
|
|
46
45
|
"lit": "^3.0.0"
|
|
47
46
|
},
|
|
48
47
|
"devDependencies": {
|
|
49
|
-
"@vaadin/chai-plugins": "
|
|
50
|
-
"@vaadin/test-runner-commands": "
|
|
51
|
-
"@vaadin/testing-helpers": "^
|
|
48
|
+
"@vaadin/chai-plugins": "25.0.0-alpha10",
|
|
49
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha10",
|
|
50
|
+
"@vaadin/testing-helpers": "^2.0.0",
|
|
52
51
|
"sinon": "^18.0.0"
|
|
53
52
|
},
|
|
54
53
|
"web-types": [
|
|
55
54
|
"web-types.json",
|
|
56
55
|
"web-types.lit.json"
|
|
57
56
|
],
|
|
58
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "6cc6c94079e805fa5b2f0af4dbf3b2a7485e57d0"
|
|
59
58
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2017 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import '@vaadin/component-base/src/style-props.js';
|
|
7
|
+
import { css } from 'lit';
|
|
8
|
+
import { checkable } from '@vaadin/field-base/src/styles/checkable-base-styles.js';
|
|
9
|
+
import { field } from '@vaadin/field-base/src/styles/field-base-styles.js';
|
|
10
|
+
|
|
11
|
+
const checkbox = css`
|
|
12
|
+
[part='checkbox']::after {
|
|
13
|
+
inset: 0;
|
|
14
|
+
mask-image: var(--_vaadin-icon-checkmark);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
:host([readonly]) {
|
|
18
|
+
--vaadin-checkbox-background: transparent;
|
|
19
|
+
--vaadin-checkbox-border-color: var(--vaadin-border-color-strong);
|
|
20
|
+
--vaadin-checkbox-color: var(--vaadin-color);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
:host([readonly]) [part='checkbox'] {
|
|
24
|
+
border-style: dashed;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
:host([indeterminate]) [part='checkbox']::after {
|
|
28
|
+
inset: calc(var(--_border-width) * -1);
|
|
29
|
+
mask-image: var(--_vaadin-icon-minus);
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
export const checkboxStyles = [field, checkable('checkbox'), checkbox];
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2017 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { css } from 'lit';
|
|
7
|
+
import { checkable } from '@vaadin/field-base/src/styles/checkable-core-styles.js';
|
|
8
|
+
|
|
9
|
+
const checkbox = css`
|
|
10
|
+
[part='helper-text'],
|
|
11
|
+
[part='error-message'] {
|
|
12
|
+
grid-column: 2;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
:host(:not([has-helper])) [part='helper-text'],
|
|
16
|
+
:host(:not([has-error-message])) [part='error-message'] {
|
|
17
|
+
display: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@media (forced-colors: active) {
|
|
21
|
+
[part='checkbox'] {
|
|
22
|
+
outline: 1px solid;
|
|
23
|
+
outline-offset: -1px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:host([disabled]) [part='checkbox'],
|
|
27
|
+
:host([disabled]) [part='checkbox']::after {
|
|
28
|
+
outline-color: GrayText;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
:host(:is([checked], [indeterminate])) [part='checkbox']::after {
|
|
32
|
+
outline: 1px solid;
|
|
33
|
+
outline-offset: -1px;
|
|
34
|
+
border-radius: inherit;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
:host([focused]) [part='checkbox'],
|
|
38
|
+
:host([focused]) [part='checkbox']::after {
|
|
39
|
+
outline-width: 2px;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
43
|
+
|
|
44
|
+
export const checkboxStyles = [checkable('checkbox'), checkbox];
|
|
@@ -9,7 +9,6 @@ import type { DelegateFocusMixinClass } from '@vaadin/a11y-base/src/delegate-foc
|
|
|
9
9
|
import type { DisabledMixinClass } from '@vaadin/a11y-base/src/disabled-mixin.js';
|
|
10
10
|
import type { FocusMixinClass } from '@vaadin/a11y-base/src/focus-mixin.js';
|
|
11
11
|
import type { KeyboardMixinClass } from '@vaadin/a11y-base/src/keyboard-mixin.js';
|
|
12
|
-
import type { ControllerMixinClass } from '@vaadin/component-base/src/controller-mixin.js';
|
|
13
12
|
import type { DelegateStateMixinClass } from '@vaadin/component-base/src/delegate-state-mixin.js';
|
|
14
13
|
import type { SlotStylesMixinClass } from '@vaadin/component-base/src/slot-styles-mixin.js';
|
|
15
14
|
import type { CheckedMixinClass } from '@vaadin/field-base/src/checked-mixin.js';
|
|
@@ -26,7 +25,6 @@ export declare function CheckboxMixin<T extends Constructor<HTMLElement>>(
|
|
|
26
25
|
): Constructor<ActiveMixinClass> &
|
|
27
26
|
Constructor<CheckboxMixinClass> &
|
|
28
27
|
Constructor<CheckedMixinClass> &
|
|
29
|
-
Constructor<ControllerMixinClass> &
|
|
30
28
|
Constructor<DelegateFocusMixinClass> &
|
|
31
29
|
Constructor<DelegateStateMixinClass> &
|
|
32
30
|
Constructor<DisabledMixinClass> &
|
package/src/vaadin-checkbox.js
CHANGED
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
* Copyright (c) 2017 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import { html,
|
|
6
|
+
import { html, LitElement } from 'lit';
|
|
7
7
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
8
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
9
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
9
10
|
import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
|
|
10
|
-
import {
|
|
11
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
12
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
|
+
import { checkboxStyles } from './styles/vaadin-checkbox-core-styles.js';
|
|
11
14
|
import { CheckboxMixin } from './vaadin-checkbox-mixin.js';
|
|
12
|
-
import { checkboxStyles } from './vaadin-checkbox-styles.js';
|
|
13
|
-
|
|
14
|
-
registerStyles('vaadin-checkbox', checkboxStyles, { moduleId: 'vaadin-checkbox-styles' });
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* `<vaadin-checkbox>` is an input field representing a binary choice.
|
|
@@ -60,19 +60,24 @@ registerStyles('vaadin-checkbox', checkboxStyles, { moduleId: 'vaadin-checkbox-s
|
|
|
60
60
|
* @mixes ThemableMixin
|
|
61
61
|
* @mixes ElementMixin
|
|
62
62
|
*/
|
|
63
|
-
export class Checkbox extends CheckboxMixin(ElementMixin(ThemableMixin(
|
|
63
|
+
export class Checkbox extends CheckboxMixin(ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
|
64
64
|
static get is() {
|
|
65
65
|
return 'vaadin-checkbox';
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
static get
|
|
68
|
+
static get styles() {
|
|
69
|
+
return checkboxStyles;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** @protected */
|
|
73
|
+
render() {
|
|
69
74
|
return html`
|
|
70
75
|
<div class="vaadin-checkbox-container">
|
|
71
76
|
<div part="checkbox" aria-hidden="true"></div>
|
|
72
77
|
<slot name="input"></slot>
|
|
73
78
|
<div part="label">
|
|
74
79
|
<slot name="label"></slot>
|
|
75
|
-
<div part="required-indicator"
|
|
80
|
+
<div part="required-indicator" @click="${this._onRequiredIndicatorClick}"></div>
|
|
76
81
|
</div>
|
|
77
82
|
<div part="helper-text">
|
|
78
83
|
<slot name="helper"></slot>
|
|
@@ -250,12 +250,13 @@ registerStyles(
|
|
|
250
250
|
}
|
|
251
251
|
|
|
252
252
|
:host([invalid]) [part='checkbox'] {
|
|
253
|
-
background: var(--_invalid-background);
|
|
253
|
+
background-color: var(--_invalid-background);
|
|
254
254
|
background-image: linear-gradient(var(--_invalid-background) 0%, var(--_invalid-background) 100%);
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
:host([invalid]:hover) [part='checkbox'] {
|
|
258
|
-
background-image:
|
|
258
|
+
background-image:
|
|
259
|
+
linear-gradient(var(--_invalid-background) 0%, var(--_invalid-background) 100%),
|
|
259
260
|
linear-gradient(var(--_invalid-background) 0%, var(--_invalid-background) 100%);
|
|
260
261
|
}
|
|
261
262
|
|
package/web-types.json
CHANGED
package/web-types.lit.json
CHANGED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2017 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import { css } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
7
|
-
|
|
8
|
-
export const checkboxStyles = css`
|
|
9
|
-
:host {
|
|
10
|
-
display: inline-block;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
:host([hidden]) {
|
|
14
|
-
display: none !important;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
:host([disabled]) {
|
|
18
|
-
-webkit-tap-highlight-color: transparent;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.vaadin-checkbox-container {
|
|
22
|
-
display: grid;
|
|
23
|
-
grid-template-columns: auto 1fr;
|
|
24
|
-
align-items: baseline;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
[part='checkbox'],
|
|
28
|
-
::slotted(input),
|
|
29
|
-
[part='label'] {
|
|
30
|
-
grid-row: 1;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
[part='checkbox'],
|
|
34
|
-
::slotted(input) {
|
|
35
|
-
grid-column: 1;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
[part='helper-text'],
|
|
39
|
-
[part='error-message'] {
|
|
40
|
-
grid-column: 2;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
:host(:not([has-helper])) [part='helper-text'],
|
|
44
|
-
:host(:not([has-error-message])) [part='error-message'] {
|
|
45
|
-
display: none;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
[part='checkbox'] {
|
|
49
|
-
width: var(--vaadin-checkbox-size, 1em);
|
|
50
|
-
height: var(--vaadin-checkbox-size, 1em);
|
|
51
|
-
--_input-border-width: var(--vaadin-input-field-border-width, 0);
|
|
52
|
-
--_input-border-color: var(--vaadin-input-field-border-color, transparent);
|
|
53
|
-
box-shadow: inset 0 0 0 var(--_input-border-width, 0) var(--_input-border-color);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
[part='checkbox']::before {
|
|
57
|
-
display: block;
|
|
58
|
-
content: '\\202F';
|
|
59
|
-
line-height: var(--vaadin-checkbox-size, 1em);
|
|
60
|
-
contain: paint;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/* visually hidden */
|
|
64
|
-
::slotted(input) {
|
|
65
|
-
cursor: inherit;
|
|
66
|
-
margin: 0;
|
|
67
|
-
align-self: stretch;
|
|
68
|
-
-webkit-appearance: none;
|
|
69
|
-
width: initial;
|
|
70
|
-
height: initial;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
@media (forced-colors: active) {
|
|
74
|
-
[part='checkbox'] {
|
|
75
|
-
outline: 1px solid;
|
|
76
|
-
outline-offset: -1px;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
:host([disabled]) [part='checkbox'],
|
|
80
|
-
:host([disabled]) [part='checkbox']::after {
|
|
81
|
-
outline-color: GrayText;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
:host(:is([checked], [indeterminate])) [part='checkbox']::after {
|
|
85
|
-
outline: 1px solid;
|
|
86
|
-
outline-offset: -1px;
|
|
87
|
-
border-radius: inherit;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
:host([focused]) [part='checkbox'],
|
|
91
|
-
:host([focused]) [part='checkbox']::after {
|
|
92
|
-
outline-width: 2px;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
`;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2017 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import { html, LitElement } from 'lit';
|
|
7
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
-
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
9
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
|
-
import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
|
|
11
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
12
|
-
import { CheckboxMixin } from './vaadin-checkbox-mixin.js';
|
|
13
|
-
import { checkboxStyles } from './vaadin-checkbox-styles.js';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* LitElement based version of `<vaadin-checkbox>` web component.
|
|
17
|
-
*
|
|
18
|
-
* ## Disclaimer
|
|
19
|
-
*
|
|
20
|
-
* This component is an experiment and not yet a part of Vaadin platform.
|
|
21
|
-
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
22
|
-
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
23
|
-
*/
|
|
24
|
-
export class Checkbox extends CheckboxMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
|
|
25
|
-
static get is() {
|
|
26
|
-
return 'vaadin-checkbox';
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
static get styles() {
|
|
30
|
-
return checkboxStyles;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/** @protected */
|
|
34
|
-
render() {
|
|
35
|
-
return html`
|
|
36
|
-
<div class="vaadin-checkbox-container">
|
|
37
|
-
<div part="checkbox" aria-hidden="true"></div>
|
|
38
|
-
<slot name="input"></slot>
|
|
39
|
-
<div part="label">
|
|
40
|
-
<slot name="label"></slot>
|
|
41
|
-
<div part="required-indicator" @click="${this._onRequiredIndicatorClick}"></div>
|
|
42
|
-
</div>
|
|
43
|
-
<div part="helper-text">
|
|
44
|
-
<slot name="helper"></slot>
|
|
45
|
-
</div>
|
|
46
|
-
<div part="error-message">
|
|
47
|
-
<slot name="error-message"></slot>
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
<slot name="tooltip"></slot>
|
|
51
|
-
`;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/** @protected */
|
|
55
|
-
ready() {
|
|
56
|
-
super.ready();
|
|
57
|
-
|
|
58
|
-
this._tooltipController = new TooltipController(this);
|
|
59
|
-
this._tooltipController.setAriaTarget(this.inputElement);
|
|
60
|
-
this.addController(this._tooltipController);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
defineCustomElement(Checkbox);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-material-styles/color.js';
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-material-styles/color.js';
|
|
2
|
-
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
3
|
-
|
|
4
|
-
registerStyles(
|
|
5
|
-
'vaadin-checkbox',
|
|
6
|
-
css`
|
|
7
|
-
:host {
|
|
8
|
-
display: inline-block;
|
|
9
|
-
-webkit-user-select: none;
|
|
10
|
-
user-select: none;
|
|
11
|
-
outline: none;
|
|
12
|
-
-webkit-tap-highlight-color: transparent;
|
|
13
|
-
--_checkbox-size: var(--vaadin-checkbox-size, 16px);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
[part='label'] {
|
|
17
|
-
display: flex;
|
|
18
|
-
position: relative;
|
|
19
|
-
max-width: max-content;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
:host([has-label]) ::slotted(label) {
|
|
23
|
-
padding: 3px 12px 3px 6px;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
[part='checkbox'] {
|
|
27
|
-
width: var(--_checkbox-size);
|
|
28
|
-
height: var(--_checkbox-size);
|
|
29
|
-
margin: 4px;
|
|
30
|
-
position: relative;
|
|
31
|
-
border-radius: 2px;
|
|
32
|
-
box-shadow: inset 0 0 0 2px var(--material-secondary-text-color);
|
|
33
|
-
background-color: transparent;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/* Used for the ripple */
|
|
37
|
-
[part='checkbox']::before {
|
|
38
|
-
pointer-events: none;
|
|
39
|
-
width: 100%;
|
|
40
|
-
height: 100%;
|
|
41
|
-
line-height: var(--_checkbox-size);
|
|
42
|
-
border-radius: 50%;
|
|
43
|
-
background-color: var(--material-disabled-text-color);
|
|
44
|
-
transform: scale(0);
|
|
45
|
-
opacity: 0;
|
|
46
|
-
transition:
|
|
47
|
-
transform 0s 0.8s,
|
|
48
|
-
opacity 0.8s;
|
|
49
|
-
will-change: transform, opacity;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/* Used for the checkmark */
|
|
53
|
-
[part='checkbox']::after {
|
|
54
|
-
content: '';
|
|
55
|
-
pointer-events: none;
|
|
56
|
-
display: inline-block;
|
|
57
|
-
width: 10px;
|
|
58
|
-
height: 19px;
|
|
59
|
-
border: 0 solid var(--material-background-color);
|
|
60
|
-
border-width: 3px 0 0 3px;
|
|
61
|
-
box-sizing: border-box;
|
|
62
|
-
transform-origin: 0 0;
|
|
63
|
-
position: absolute;
|
|
64
|
-
top: 12px;
|
|
65
|
-
left: 6px;
|
|
66
|
-
transform: scale(0) rotate(-135deg);
|
|
67
|
-
transition: transform 0.2s;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
:host([indeterminate]) [part='checkbox'],
|
|
71
|
-
:host([checked]) [part='checkbox'] {
|
|
72
|
-
background-color: var(--material-primary-color);
|
|
73
|
-
box-shadow: none;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
:host([checked]) [part='checkbox']::after {
|
|
77
|
-
transform: scale(0.55) rotate(-135deg);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
:host(:not([checked]):not([indeterminate]):not([disabled]):hover) [part='checkbox'] {
|
|
81
|
-
background-color: transparent;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
:host([focus-ring]) [part='checkbox']::before,
|
|
85
|
-
:host([active]) [part='checkbox']::before {
|
|
86
|
-
transition-duration: 0.08s, 0.01s;
|
|
87
|
-
transition-delay: 0s, 0s;
|
|
88
|
-
transform: scale(2.5);
|
|
89
|
-
opacity: 0.15;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
:host([checked]) [part='checkbox']::before {
|
|
93
|
-
background-color: var(--material-primary-color);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
:host([indeterminate]) [part='checkbox']::after {
|
|
97
|
-
transform: none;
|
|
98
|
-
opacity: 1;
|
|
99
|
-
top: 45%;
|
|
100
|
-
height: 10%;
|
|
101
|
-
left: 22%;
|
|
102
|
-
right: 22%;
|
|
103
|
-
width: auto;
|
|
104
|
-
border: 0;
|
|
105
|
-
background-color: var(--material-background-color);
|
|
106
|
-
transition: opacity 0.4s;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
:host([disabled]) {
|
|
110
|
-
pointer-events: none;
|
|
111
|
-
color: var(--material-disabled-text-color);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
:host([disabled]) ::slotted(label) {
|
|
115
|
-
color: inherit;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
:host([disabled]:not([checked]):not([indeterminate])) [part='checkbox'] {
|
|
119
|
-
box-shadow: inset 0 0 0 2px var(--material-disabled-color);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
:host([disabled][checked]) [part='checkbox'],
|
|
123
|
-
:host([disabled][indeterminate]) [part='checkbox'] {
|
|
124
|
-
background-color: var(--material-disabled-color);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
:host([readonly][checked]:not([disabled])) [part='checkbox'],
|
|
128
|
-
:host([readonly][indeterminate]:not([disabled])) [part='checkbox'],
|
|
129
|
-
:host([readonly]:not([disabled])) [part='checkbox']::before {
|
|
130
|
-
background-color: var(--material-secondary-text-color);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/* RTL specific styles */
|
|
134
|
-
:host([dir='rtl'][has-label]) ::slotted(label) {
|
|
135
|
-
padding: 3px 6px 3px 12px;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/* Required */
|
|
139
|
-
:host([required]) [part='required-indicator'] {
|
|
140
|
-
position: absolute;
|
|
141
|
-
top: 3px;
|
|
142
|
-
right: 2px;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
:host([dir='rtl'][required]) [part='required-indicator'] {
|
|
146
|
-
right: auto;
|
|
147
|
-
left: 2px;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
:host([required]:not([disabled])) [part='required-indicator'] {
|
|
151
|
-
color: var(--material-secondary-text-color);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
:host([required]) [part='required-indicator']::after {
|
|
155
|
-
content: '*';
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
:host([invalid]) [part='required-indicator']::after {
|
|
159
|
-
color: var(--material-error-text-color);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
:host(:not([has-label])) [part='required-indicator'] {
|
|
163
|
-
display: none;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
[part='error-message'],
|
|
167
|
-
[part='helper-text'] {
|
|
168
|
-
font-size: 0.75em;
|
|
169
|
-
line-height: 1;
|
|
170
|
-
padding-left: 6px;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
[part='error-message'] {
|
|
174
|
-
color: var(--material-error-text-color);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
[part='helper-text'] {
|
|
178
|
-
color: var(--material-secondary-text-color);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
:host([has-error-message]) [part='error-message']::before,
|
|
182
|
-
:host([has-helper]) [part='helper-text']::before {
|
|
183
|
-
content: '';
|
|
184
|
-
display: block;
|
|
185
|
-
height: 6px;
|
|
186
|
-
}
|
|
187
|
-
`,
|
|
188
|
-
{ moduleId: 'material-checkbox' },
|
|
189
|
-
);
|
package/vaadin-lit-checkbox.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src/vaadin-checkbox.js';
|
package/vaadin-lit-checkbox.js
DELETED
|
File without changes
|