@fluid-topics/ft-checkbox 0.3.12 → 0.3.14
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/build/ft-checkbox.css.d.ts +9 -0
- package/build/ft-checkbox.css.js +89 -0
- package/build/ft-checkbox.d.ts +1 -13
- package/build/ft-checkbox.js +4 -88
- package/build/ft-checkbox.light.js +179 -185
- package/build/ft-checkbox.min.js +180 -180
- package/build/ft-checkbox.properties.d.ts +7 -0
- package/build/ft-checkbox.properties.js +2 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +2 -0
- package/package.json +5 -5
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const FtCheckboxCssVariables: {
|
|
2
|
+
textColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
3
|
+
colorPrimary: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
4
|
+
colorOnPrimary: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
5
|
+
borderColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
6
|
+
colorOnSurfaceDisabled: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
7
|
+
};
|
|
8
|
+
export declare const styles: import("lit").CSSResult;
|
|
9
|
+
//# sourceMappingURL=ft-checkbox.css.d.ts.map
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { designSystemVariables, FtCssVariableFactory } from "@fluid-topics/ft-wc-utils";
|
|
2
|
+
import { css } from "lit";
|
|
3
|
+
export const FtCheckboxCssVariables = {
|
|
4
|
+
textColor: FtCssVariableFactory.extend("--ft-checkbox-text-color", designSystemVariables.colorOnSurfaceHigh),
|
|
5
|
+
colorPrimary: FtCssVariableFactory.external(designSystemVariables.colorPrimary, "Design system"),
|
|
6
|
+
colorOnPrimary: FtCssVariableFactory.external(designSystemVariables.colorOnPrimary, "Design system"),
|
|
7
|
+
borderColor: FtCssVariableFactory.extend("--ft-checkbox-border-color", designSystemVariables.colorOnSurfaceMedium),
|
|
8
|
+
colorOnSurfaceDisabled: FtCssVariableFactory.external(designSystemVariables.colorOnSurfaceDisabled, "Design system"),
|
|
9
|
+
};
|
|
10
|
+
// language=CSS
|
|
11
|
+
export const styles = css `
|
|
12
|
+
* {
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.ft-checkbox {
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
color: ${FtCheckboxCssVariables.textColor};
|
|
19
|
+
|
|
20
|
+
display: inline-flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
gap: 4px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.ft-checkbox--disabled {
|
|
26
|
+
color: ${FtCheckboxCssVariables.colorOnSurfaceDisabled};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
input {
|
|
30
|
+
opacity: 0;
|
|
31
|
+
position: absolute;
|
|
32
|
+
width: 40px;
|
|
33
|
+
height: 40px;
|
|
34
|
+
margin: 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.ft-checkbox--box-container {
|
|
38
|
+
position: relative;
|
|
39
|
+
width: 40px;
|
|
40
|
+
height: 40px;
|
|
41
|
+
|
|
42
|
+
display: flex;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
align-items: center;
|
|
45
|
+
flex-shrink: 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.ft-checkbox--box {
|
|
49
|
+
display: flex;
|
|
50
|
+
border: 2px solid ${FtCheckboxCssVariables.borderColor};
|
|
51
|
+
border-radius: 2px;
|
|
52
|
+
|
|
53
|
+
width: 18px;
|
|
54
|
+
height: 18px;
|
|
55
|
+
|
|
56
|
+
color: ${FtCheckboxCssVariables.colorOnPrimary};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
.ft-checkbox--checked .ft-checkbox--box,
|
|
61
|
+
.ft-checkbox--indeterminate .ft-checkbox--box {
|
|
62
|
+
border-color: ${FtCheckboxCssVariables.colorPrimary};
|
|
63
|
+
background-color: ${FtCheckboxCssVariables.colorPrimary};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.ft-checkbox--disabled .ft-checkbox--box {
|
|
67
|
+
border-color: ${FtCheckboxCssVariables.colorOnSurfaceDisabled};
|
|
68
|
+
background-color: transparent;
|
|
69
|
+
color: ${FtCheckboxCssVariables.colorOnSurfaceDisabled};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.ft-checkbox--checkmark {
|
|
73
|
+
transition: opacity 180ms cubic-bezier(0, 0, 0.2, 1) 0ms, transform 180ms cubic-bezier(0, 0, 0.2, 1) 0ms;
|
|
74
|
+
opacity: 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.ft-checkbox--checkmark-path {
|
|
78
|
+
stroke-dashoffset: 0;
|
|
79
|
+
stroke: currentcolor;
|
|
80
|
+
stroke-width: 3px;
|
|
81
|
+
stroke-dasharray: 30;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.ft-checkbox--checked .ft-checkbox--checkmark,
|
|
85
|
+
.ft-checkbox--indeterminate .ft-checkbox--checkmark {
|
|
86
|
+
opacity: 1;
|
|
87
|
+
}
|
|
88
|
+
`;
|
|
89
|
+
//# sourceMappingURL=ft-checkbox.css.js.map
|
package/build/ft-checkbox.d.ts
CHANGED
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
import { PropertyValues } from "lit";
|
|
2
2
|
import { ElementDefinitionsMap, FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
3
|
-
|
|
4
|
-
name: string;
|
|
5
|
-
checked: boolean;
|
|
6
|
-
indeterminate: boolean;
|
|
7
|
-
disabled: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare const FtCheckboxCssVariables: {
|
|
10
|
-
textColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
11
|
-
colorPrimary: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
12
|
-
colorOnPrimary: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
13
|
-
borderColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
14
|
-
colorOnSurfaceDisabled: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
15
|
-
};
|
|
3
|
+
import { FtCheckboxProperties } from "./ft-checkbox.properties";
|
|
16
4
|
export declare class FtCheckbox extends FtLitElement implements FtCheckboxProperties {
|
|
17
5
|
static elementDefinitions: ElementDefinitionsMap;
|
|
18
6
|
static styles: import("lit").CSSResult;
|
package/build/ft-checkbox.js
CHANGED
|
@@ -4,19 +4,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import {
|
|
7
|
+
import { html } from "lit";
|
|
8
8
|
import { property, query } from "lit/decorators.js";
|
|
9
|
-
import {
|
|
9
|
+
import { FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
10
10
|
import { classMap } from "lit/directives/class-map.js";
|
|
11
11
|
import { FtRipple } from "@fluid-topics/ft-ripple";
|
|
12
12
|
import { FtTypography } from "@fluid-topics/ft-typography";
|
|
13
|
-
|
|
14
|
-
textColor: FtCssVariableFactory.extend("--ft-checkbox-text-color", designSystemVariables.colorOnSurfaceHigh),
|
|
15
|
-
colorPrimary: FtCssVariableFactory.external(designSystemVariables.colorPrimary, "Design system"),
|
|
16
|
-
colorOnPrimary: FtCssVariableFactory.external(designSystemVariables.colorOnPrimary, "Design system"),
|
|
17
|
-
borderColor: FtCssVariableFactory.extend("--ft-checkbox-border-color", designSystemVariables.colorOnSurfaceMedium),
|
|
18
|
-
colorOnSurfaceDisabled: FtCssVariableFactory.external(designSystemVariables.colorOnSurfaceDisabled, "Design system"),
|
|
19
|
-
};
|
|
13
|
+
import { styles } from "./ft-checkbox.css";
|
|
20
14
|
export class FtCheckbox extends FtLitElement {
|
|
21
15
|
constructor() {
|
|
22
16
|
super(...arguments);
|
|
@@ -76,85 +70,7 @@ FtCheckbox.elementDefinitions = {
|
|
|
76
70
|
"ft-ripple": FtRipple,
|
|
77
71
|
"ft-typography": FtTypography
|
|
78
72
|
};
|
|
79
|
-
|
|
80
|
-
FtCheckbox.styles = css `
|
|
81
|
-
* {
|
|
82
|
-
box-sizing: border-box;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.ft-checkbox {
|
|
86
|
-
box-sizing: border-box;
|
|
87
|
-
color: ${FtCheckboxCssVariables.textColor};
|
|
88
|
-
|
|
89
|
-
display: inline-flex;
|
|
90
|
-
align-items: center;
|
|
91
|
-
gap: 4px;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.ft-checkbox--disabled {
|
|
95
|
-
color: ${FtCheckboxCssVariables.colorOnSurfaceDisabled};
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
input {
|
|
99
|
-
opacity: 0;
|
|
100
|
-
position: absolute;
|
|
101
|
-
width: 40px;
|
|
102
|
-
height: 40px;
|
|
103
|
-
margin: 0;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.ft-checkbox--box-container {
|
|
107
|
-
position: relative;
|
|
108
|
-
width: 40px;
|
|
109
|
-
height: 40px;
|
|
110
|
-
|
|
111
|
-
display: flex;
|
|
112
|
-
justify-content: center;
|
|
113
|
-
align-items: center;
|
|
114
|
-
flex-shrink: 0;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.ft-checkbox--box {
|
|
118
|
-
display: flex;
|
|
119
|
-
border: 2px solid ${FtCheckboxCssVariables.borderColor};
|
|
120
|
-
border-radius: 2px;
|
|
121
|
-
|
|
122
|
-
width: 18px;
|
|
123
|
-
height: 18px;
|
|
124
|
-
|
|
125
|
-
color: ${FtCheckboxCssVariables.colorOnPrimary};
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
.ft-checkbox--checked .ft-checkbox--box,
|
|
130
|
-
.ft-checkbox--indeterminate .ft-checkbox--box {
|
|
131
|
-
border-color: ${FtCheckboxCssVariables.colorPrimary};
|
|
132
|
-
background-color: ${FtCheckboxCssVariables.colorPrimary};
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.ft-checkbox--disabled .ft-checkbox--box {
|
|
136
|
-
border-color: ${FtCheckboxCssVariables.colorOnSurfaceDisabled};
|
|
137
|
-
background-color: transparent;
|
|
138
|
-
color: ${FtCheckboxCssVariables.colorOnSurfaceDisabled};
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.ft-checkbox--checkmark {
|
|
142
|
-
transition: opacity 180ms cubic-bezier(0, 0, 0.2, 1) 0ms, transform 180ms cubic-bezier(0, 0, 0.2, 1) 0ms;
|
|
143
|
-
opacity: 0;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.ft-checkbox--checkmark-path {
|
|
147
|
-
stroke-dashoffset: 0;
|
|
148
|
-
stroke: currentcolor;
|
|
149
|
-
stroke-width: 3px;
|
|
150
|
-
stroke-dasharray: 30;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.ft-checkbox--checked .ft-checkbox--checkmark,
|
|
154
|
-
.ft-checkbox--indeterminate .ft-checkbox--checkmark {
|
|
155
|
-
opacity: 1;
|
|
156
|
-
}
|
|
157
|
-
`;
|
|
73
|
+
FtCheckbox.styles = styles;
|
|
158
74
|
__decorate([
|
|
159
75
|
property()
|
|
160
76
|
], FtCheckbox.prototype, "name", void 0);
|
|
@@ -1,4 +1,93 @@
|
|
|
1
|
-
!function(t,i,e,o,s){
|
|
1
|
+
!function(t,i,e,o,s){const r=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorContent),n=r,h=i.FtCssVariableFactory.extend("--ft-ripple-background-color",r),p=i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),l=i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),a=i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),f=i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfaceSelected,"Design system"),c=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorPrimary),d=c,y=i.FtCssVariableFactory.extend("--ft-ripple-background-color",c),g=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorSecondary),u=g,b=i.FtCssVariableFactory.extend("--ft-ripple-background-color",g),v=e.css`
|
|
2
|
+
:host {
|
|
3
|
+
display: contents;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.ft-ripple {
|
|
7
|
+
position: absolute;
|
|
8
|
+
inset: 0;
|
|
9
|
+
pointer-events: none;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.ft-ripple:not(.ft-ripple--unbounded) {
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.ft-ripple .ft-ripple--background,
|
|
17
|
+
.ft-ripple .ft-ripple--effect {
|
|
18
|
+
position: absolute;
|
|
19
|
+
opacity: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.ft-ripple .ft-ripple--background {
|
|
23
|
+
background-color: ${h};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ft-ripple .ft-ripple--effect {
|
|
27
|
+
background-color: ${n};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ft-ripple.ft-ripple--secondary .ft-ripple--background {
|
|
31
|
+
background-color: ${b};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.ft-ripple.ft-ripple--secondary .ft-ripple--effect {
|
|
35
|
+
background-color: ${u};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.ft-ripple.ft-ripple--primary .ft-ripple--background {
|
|
39
|
+
background-color: ${y};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ft-ripple.ft-ripple--primary .ft-ripple--effect {
|
|
43
|
+
background-color: ${d};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ft-ripple .ft-ripple--background {
|
|
47
|
+
top: 0;
|
|
48
|
+
left: 0;
|
|
49
|
+
height: 100%;
|
|
50
|
+
width: 100%;
|
|
51
|
+
transition: opacity 75ms linear;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.ft-ripple .ft-ripple--effect,
|
|
55
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
56
|
+
border-radius: 50%;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.ft-ripple .ft-ripple--effect {
|
|
60
|
+
transform: translate(-50%, -50%) scale(0.15);
|
|
61
|
+
transition: transform 300ms ease, opacity 75ms linear;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--effect,
|
|
65
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
66
|
+
left: 50%;
|
|
67
|
+
top: 50%;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
71
|
+
transform: translate(-50%, -50%);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.ft-ripple.ft-ripple--hovered .ft-ripple--background {
|
|
75
|
+
opacity: ${l};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.ft-ripple.ft-ripple--selected .ft-ripple--background {
|
|
79
|
+
opacity: ${f};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.ft-ripple.ft-ripple--focused .ft-ripple--background {
|
|
83
|
+
opacity: ${a};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.ft-ripple.ft-ripple--pressed .ft-ripple--effect {
|
|
87
|
+
opacity: ${p};
|
|
88
|
+
transform: translate(-50%, -50%) scale(1);
|
|
89
|
+
}
|
|
90
|
+
`;var m,$=function(t,i,e,o){for(var s,r=arguments.length,n=r<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,h=t.length-1;h>=0;h--)(s=t[h])&&(n=(r<3?s(n):r>3?s(i,e,n):s(i,e))||n);return r>3&&n&&Object.defineProperty(i,e,n),n};class x extends i.FtLitElement{constructor(){super(...arguments),this.primary=!1,this.secondary=!1,this.unbounded=!1,this.activated=!1,this.selected=!1,this.disabled=!1,this.hovered=!1,this.focused=!1,this.pressed=!1,this.rippling=!1,this.rippleSize=0,this.originX=0,this.originY=0,this.resizeObserver=new ResizeObserver((()=>this.setRippleSize())),this.debouncer=new i.Debouncer(1e3),this.onTransitionStart=t=>{"transform"===t.propertyName&&(this.rippling=this.pressed,this.debouncer.run((()=>this.rippling=!1)))},this.onTransitionEnd=t=>{"transform"===t.propertyName&&(this.rippling=!1)},this.moveRipple=t=>{var i,e;let{x:o,y:s}=this.getCoordinates(t),r=null!==(e=null===(i=this.ripple)||void 0===i?void 0:i.getBoundingClientRect())&&void 0!==e?e:{x:0,y:0,width:0,height:0};this.originX=Math.round(null!=o?o-r.x:r.width/2),this.originY=Math.round(null!=s?s-r.y:r.height/2)},this.startPress=t=>{this.moveRipple(t),this.pressed=!this.isIgnored(t)},this.endPress=()=>{this.pressed=!1},this.startHover=t=>{this.hovered=!this.isIgnored(t)},this.endHover=()=>{this.hovered=!1},this.startFocus=t=>{this.focused=!this.isIgnored(t)},this.endFocus=()=>{this.focused=!1}}render(){let t={"ft-ripple":!0,"ft-ripple--primary":this.primary,"ft-ripple--secondary":this.secondary,"ft-ripple--unbounded":this.unbounded,"ft-ripple--selected":(this.selected||this.activated)&&!this.disabled,"ft-ripple--pressed":(this.pressed||this.rippling)&&!this.disabled,"ft-ripple--hovered":this.hovered&&!this.disabled,"ft-ripple--focused":this.focused&&!this.disabled};return e.html`
|
|
2
91
|
<style>
|
|
3
92
|
.ft-ripple .ft-ripple--effect,
|
|
4
93
|
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
@@ -15,108 +104,13 @@
|
|
|
15
104
|
<div class="ft-ripple--background"></div>
|
|
16
105
|
<div class="ft-ripple--effect"></div>
|
|
17
106
|
</div>
|
|
18
|
-
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){var i,e;super.updated(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(i=this.target)||void 0===i||i.removeAttribute("data-is-ft-ripple-target")):null===(e=this.target)||void 0===e||e.setAttribute("data-is-ft-ripple-target","true")),t.has("unbounded")&&this.setRippleSize()}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}setRippleSize(){if(this.ripple){const t=this.ripple.getBoundingClientRect();this.rippleSize=(this.unbounded?1:1.7)*Math.max(t.width,t.height)}}connectedCallback(){var t;super.connectedCallback();const i=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;i&&this.setupFor(i),this.setRippleSize()}setupFor(t){if(this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const i=(...t)=>i=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(i)},e=i("mouseup","contextmenu"),o=i("touchend","touchcancel"),s=t=>{["Enter"," "].includes(t.key)&&i("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",e),t.addEventListener("touchstart",o),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",s),t.addEventListener("focus",this.startFocus),t.addEventListener("blur",this.endFocus),t.addEventListener("focusin",this.startFocus),t.addEventListener("focusout",this.endFocus),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover),t.removeEventListener("mousemove",this.moveRipple),t.removeEventListener("mouseleave",this.endHover),t.removeEventListener("mousedown",e),t.removeEventListener("touchstart",o),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",s),t.removeEventListener("focus",this.startFocus),t.removeEventListener("blur",this.endFocus),t.removeEventListener("focusin",this.startFocus),t.removeEventListener("focusout",this.endFocus),this.onDisconnect=void 0}}getCoordinates(t){const i=t,e=t;let o,s;return null!=i.x?({x:o,y:s}=i):null!=e.touches&&(o=e.touches[0].clientX,s=e.touches[0].clientY),{x:o,y:s}}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let i of t.composedPath()){if(i===this.target)break;if("hasAttribute"in i&&i.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.resizeObserver.disconnect(),this.endRipple()}}
|
|
19
|
-
/**
|
|
20
|
-
* @license
|
|
21
|
-
* Copyright 2017 Google LLC
|
|
22
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
-
*/
|
|
24
|
-
var $;m.elementDefinitions={},m.styles=e.css`
|
|
25
|
-
:host {
|
|
26
|
-
display: contents;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.ft-ripple {
|
|
30
|
-
position: absolute;
|
|
31
|
-
inset: 0;
|
|
32
|
-
pointer-events: none;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.ft-ripple:not(.ft-ripple--unbounded) {
|
|
36
|
-
overflow: hidden;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.ft-ripple .ft-ripple--background,
|
|
40
|
-
.ft-ripple .ft-ripple--effect {
|
|
41
|
-
position: absolute;
|
|
42
|
-
opacity: 0;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.ft-ripple .ft-ripple--background {
|
|
46
|
-
background-color: ${p};
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.ft-ripple .ft-ripple--effect {
|
|
50
|
-
background-color: ${h};
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.ft-ripple.ft-ripple--secondary .ft-ripple--background {
|
|
54
|
-
background-color: ${v};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.ft-ripple.ft-ripple--secondary .ft-ripple--effect {
|
|
58
|
-
background-color: ${b};
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.ft-ripple.ft-ripple--primary .ft-ripple--background {
|
|
62
|
-
background-color: ${g};
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.ft-ripple.ft-ripple--primary .ft-ripple--effect {
|
|
66
|
-
background-color: ${y};
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.ft-ripple .ft-ripple--background {
|
|
70
|
-
top: 0;
|
|
71
|
-
left: 0;
|
|
72
|
-
height: 100%;
|
|
73
|
-
width: 100%;
|
|
74
|
-
transition: opacity 75ms linear;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.ft-ripple .ft-ripple--effect,
|
|
78
|
-
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
79
|
-
border-radius: 50%;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.ft-ripple .ft-ripple--effect {
|
|
83
|
-
transform: translate(-50%, -50%) scale(0.15);
|
|
84
|
-
transition: transform 300ms ease, opacity 75ms linear;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.ft-ripple.ft-ripple--unbounded .ft-ripple--effect,
|
|
88
|
-
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
89
|
-
left: 50%;
|
|
90
|
-
top: 50%;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
94
|
-
transform: translate(-50%, -50%);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.ft-ripple.ft-ripple--hovered .ft-ripple--background {
|
|
98
|
-
opacity: ${a};
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.ft-ripple.ft-ripple--selected .ft-ripple--background {
|
|
102
|
-
opacity: ${c};
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.ft-ripple.ft-ripple--focused .ft-ripple--background {
|
|
106
|
-
opacity: ${f};
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.ft-ripple.ft-ripple--pressed .ft-ripple--effect {
|
|
110
|
-
opacity: ${l};
|
|
111
|
-
transform: translate(-50%, -50%) scale(1);
|
|
112
|
-
}
|
|
113
|
-
`,r([o.property({type:Boolean})],m.prototype,"primary",void 0),r([o.property({type:Boolean})],m.prototype,"secondary",void 0),r([o.property({type:Boolean})],m.prototype,"unbounded",void 0),r([o.property({type:Boolean})],m.prototype,"activated",void 0),r([o.property({type:Boolean})],m.prototype,"selected",void 0),r([o.property({type:Boolean})],m.prototype,"disabled",void 0),r([o.state()],m.prototype,"hovered",void 0),r([o.state()],m.prototype,"focused",void 0),r([o.state()],m.prototype,"pressed",void 0),r([o.state()],m.prototype,"rippling",void 0),r([o.state()],m.prototype,"rippleSize",void 0),r([o.state()],m.prototype,"originX",void 0),r([o.state()],m.prototype,"originY",void 0),r([o.query(".ft-ripple")],m.prototype,"ripple",void 0),r([o.query(".ft-ripple--effect")],m.prototype,"rippleEffect",void 0),i.customElement("ft-ripple")(m);const x=globalThis.trustedTypes,k=x?x.createPolicy("lit-html",{createHTML:t=>t}):void 0,w=`lit$${(Math.random()+"").slice(9)}$`,z="?"+w,A=`<${z}>`,_=document,S=(t="")=>_.createComment(t),C=t=>null===t||"object"!=typeof t&&"function"!=typeof t,N=Array.isArray,O=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,B=/-->/g,E=/>/g,M=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),j=/'/g,T=/"/g,D=/^(?:script|style|textarea|title)$/i,I=(t=>(i,...e)=>({_$litType$:t,strings:i,values:e}))(1),R=Symbol.for("lit-noChange"),U=Symbol.for("lit-nothing"),P=new WeakMap,G=_.createTreeWalker(_,129,null,!1),W=(t,i)=>{const e=t.length-1,o=[];let s,r=2===i?"<svg>":"",n=O;for(let i=0;i<e;i++){const e=t[i];let h,p,l=-1,a=0;for(;a<e.length&&(n.lastIndex=a,p=n.exec(e),null!==p);)a=n.lastIndex,n===O?"!--"===p[1]?n=B:void 0!==p[1]?n=E:void 0!==p[2]?(D.test(p[2])&&(s=RegExp("</"+p[2],"g")),n=M):void 0!==p[3]&&(n=M):n===M?">"===p[0]?(n=null!=s?s:O,l=-1):void 0===p[1]?l=-2:(l=n.lastIndex-p[2].length,h=p[1],n=void 0===p[3]?M:'"'===p[3]?T:j):n===T||n===j?n=M:n===B||n===E?n=O:(n=M,s=void 0);const f=n===M&&t[i+1].startsWith("/>")?" ":"";r+=n===O?e+A:l>=0?(o.push(h),e.slice(0,l)+"$lit$"+e.slice(l)+w+f):e+w+(-2===l?(o.push(void 0),i):f)}const h=r+(t[e]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==k?k.createHTML(h):h,o]};class Z{constructor({strings:t,_$litType$:i},e){let o;this.parts=[];let s=0,r=0;const n=t.length-1,h=this.parts,[p,l]=W(t,i);if(this.el=Z.createElement(p,e),G.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(o=G.nextNode())&&h.length<n;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const i of o.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(w)){const e=l[r++];if(t.push(i),void 0!==e){const t=o.getAttribute(e.toLowerCase()+"$lit$").split(w),i=/([.?@])?(.*)/.exec(e);h.push({type:1,index:s,name:i[2],strings:t,ctor:"."===i[1]?X:"?"===i[1]?q:"@"===i[1]?J:L})}else h.push({type:6,index:s})}for(const i of t)o.removeAttribute(i)}if(D.test(o.tagName)){const t=o.textContent.split(w),i=t.length-1;if(i>0){o.textContent=x?x.emptyScript:"";for(let e=0;e<i;e++)o.append(t[e],S()),G.nextNode(),h.push({type:2,index:++s});o.append(t[i],S())}}}else if(8===o.nodeType)if(o.data===z)h.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(w,t+1));)h.push({type:7,index:s}),t+=w.length-1}s++}}static createElement(t,i){const e=_.createElement("template");return e.innerHTML=t,e}}function F(t,i,e=t,o){var s,r,n,h;if(i===R)return i;let p=void 0!==o?null===(s=e._$Cl)||void 0===s?void 0:s[o]:e._$Cu;const l=C(i)?void 0:i._$litDirective$;return(null==p?void 0:p.constructor)!==l&&(null===(r=null==p?void 0:p._$AO)||void 0===r||r.call(p,!1),void 0===l?p=void 0:(p=new l(t),p._$AT(t,e,o)),void 0!==o?(null!==(n=(h=e)._$Cl)&&void 0!==n?n:h._$Cl=[])[o]=p:e._$Cu=p),void 0!==p&&(i=F(t,p._$AS(t,i.values),p,o)),i}class H{constructor(t,i){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var i;const{el:{content:e},parts:o}=this._$AD,s=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:_).importNode(e,!0);G.currentNode=s;let r=G.nextNode(),n=0,h=0,p=o[0];for(;void 0!==p;){if(n===p.index){let i;2===p.type?i=new K(r,r.nextSibling,this,t):1===p.type?i=new p.ctor(r,p.name,p.strings,this,t):6===p.type&&(i=new Q(r,this,t)),this.v.push(i),p=o[++h]}n!==(null==p?void 0:p.index)&&(r=G.nextNode(),n++)}return s}m(t){let i=0;for(const e of this.v)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,i),i+=e.strings.length-2):e._$AI(t[i])),i++}}class K{constructor(t,i,e,o){var s;this.type=2,this._$AH=U,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=e,this.options=o,this._$C_=null===(s=null==o?void 0:o.isConnected)||void 0===s||s}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$C_}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=F(this,t,i),C(t)?t===U||null==t||""===t?(this._$AH!==U&&this._$AR(),this._$AH=U):t!==this._$AH&&t!==R&&this.T(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.k(t):(t=>N(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.S(t):this.T(t)}j(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.j(t))}T(t){this._$AH!==U&&C(this._$AH)?this._$AA.nextSibling.data=t:this.k(_.createTextNode(t)),this._$AH=t}$(t){var i;const{values:e,_$litType$:o}=t,s="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=Z.createElement(o.h,this.options)),o);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===s)this._$AH.m(e);else{const t=new H(s,this),i=t.p(this.options);t.m(e),this.k(i),this._$AH=t}}_$AC(t){let i=P.get(t.strings);return void 0===i&&P.set(t.strings,i=new Z(t)),i}S(t){N(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let e,o=0;for(const s of t)o===i.length?i.push(e=new K(this.j(S()),this.j(S()),this,this.options)):e=i[o],e._$AI(s),o++;o<i.length&&(this._$AR(e&&e._$AB.nextSibling,o),i.length=o)}_$AR(t=this._$AA.nextSibling,i){var e;for(null===(e=this._$AP)||void 0===e||e.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$C_=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class L{constructor(t,i,e,o,s){this.type=1,this._$AH=U,this._$AN=void 0,this.element=t,this.name=i,this._$AM=o,this.options=s,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=U}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,e,o){const s=this.strings;let r=!1;if(void 0===s)t=F(this,t,i,0),r=!C(t)||t!==this._$AH&&t!==R,r&&(this._$AH=t);else{const o=t;let n,h;for(t=s[0],n=0;n<s.length-1;n++)h=F(this,o[e+n],i,n),h===R&&(h=this._$AH[n]),r||(r=!C(h)||h!==this._$AH[n]),h===U?t=U:t!==U&&(t+=(null!=h?h:"")+s[n+1]),this._$AH[n]=h}r&&!o&&this.P(t)}P(t){t===U?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class X extends L{constructor(){super(...arguments),this.type=3}P(t){this.element[this.name]=t===U?void 0:t}}const Y=x?x.emptyScript:"";class q extends L{constructor(){super(...arguments),this.type=4}P(t){t&&t!==U?this.element.setAttribute(this.name,Y):this.element.removeAttribute(this.name)}}class J extends L{constructor(t,i,e,o,s){super(t,i,e,o,s),this.type=5}_$AI(t,i=this){var e;if((t=null!==(e=F(this,t,i,0))&&void 0!==e?e:U)===R)return;const o=this._$AH,s=t===U&&o!==U||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,r=t!==U&&(o===U||s);s&&this.element.removeEventListener(this.name,this,o),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,e;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==e?e:this.element,t):this._$AH.handleEvent(t)}}class Q{constructor(t,i,e){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(t){F(this,t)}}const V=window.litHtmlPolyfillSupport;null==V||V(Z,K),(null!==($=globalThis.litHtmlVersions)&&void 0!==$?$:globalThis.litHtmlVersions=[]).push("2.2.7");
|
|
107
|
+
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){var i,e;super.updated(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(i=this.target)||void 0===i||i.removeAttribute("data-is-ft-ripple-target")):null===(e=this.target)||void 0===e||e.setAttribute("data-is-ft-ripple-target","true")),t.has("unbounded")&&this.setRippleSize()}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}setRippleSize(){if(this.ripple){const t=this.ripple.getBoundingClientRect();this.rippleSize=(this.unbounded?1:1.7)*Math.max(t.width,t.height)}}connectedCallback(){var t;super.connectedCallback();const i=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;i&&this.setupFor(i),this.setRippleSize()}setupFor(t){if(this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const i=(...t)=>i=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(i)},e=i("mouseup","contextmenu"),o=i("touchend","touchcancel"),s=t=>{["Enter"," "].includes(t.key)&&i("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",e),t.addEventListener("touchstart",o),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",s),t.addEventListener("focus",this.startFocus),t.addEventListener("blur",this.endFocus),t.addEventListener("focusin",this.startFocus),t.addEventListener("focusout",this.endFocus),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover),t.removeEventListener("mousemove",this.moveRipple),t.removeEventListener("mouseleave",this.endHover),t.removeEventListener("mousedown",e),t.removeEventListener("touchstart",o),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",s),t.removeEventListener("focus",this.startFocus),t.removeEventListener("blur",this.endFocus),t.removeEventListener("focusin",this.startFocus),t.removeEventListener("focusout",this.endFocus),this.onDisconnect=void 0}}getCoordinates(t){const i=t,e=t;let o,s;return null!=i.x?({x:o,y:s}=i):null!=e.touches&&(o=e.touches[0].clientX,s=e.touches[0].clientY),{x:o,y:s}}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let i of t.composedPath()){if(i===this.target)break;if("hasAttribute"in i&&i.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.resizeObserver.disconnect(),this.endRipple()}}x.elementDefinitions={},x.styles=v,$([o.property({type:Boolean})],x.prototype,"primary",void 0),$([o.property({type:Boolean})],x.prototype,"secondary",void 0),$([o.property({type:Boolean})],x.prototype,"unbounded",void 0),$([o.property({type:Boolean})],x.prototype,"activated",void 0),$([o.property({type:Boolean})],x.prototype,"selected",void 0),$([o.property({type:Boolean})],x.prototype,"disabled",void 0),$([o.state()],x.prototype,"hovered",void 0),$([o.state()],x.prototype,"focused",void 0),$([o.state()],x.prototype,"pressed",void 0),$([o.state()],x.prototype,"rippling",void 0),$([o.state()],x.prototype,"rippleSize",void 0),$([o.state()],x.prototype,"originX",void 0),$([o.state()],x.prototype,"originY",void 0),$([o.query(".ft-ripple")],x.prototype,"ripple",void 0),$([o.query(".ft-ripple--effect")],x.prototype,"rippleEffect",void 0),i.customElement("ft-ripple")(x);const k=globalThis.trustedTypes,w=k?k.createPolicy("lit-html",{createHTML:t=>t}):void 0,z=`lit$${(Math.random()+"").slice(9)}$`,A="?"+z,_=`<${A}>`,S=document,C=(t="")=>S.createComment(t),N=t=>null===t||"object"!=typeof t&&"function"!=typeof t,O=Array.isArray,B=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,E=/-->/g,M=/>/g,j=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),T=/'/g,D=/"/g,I=/^(?:script|style|textarea|title)$/i,R=(t=>(i,...e)=>({_$litType$:t,strings:i,values:e}))(1),U=Symbol.for("lit-noChange"),P=Symbol.for("lit-nothing"),G=new WeakMap,W=S.createTreeWalker(S,129,null,!1),Z=(t,i)=>{const e=t.length-1,o=[];let s,r=2===i?"<svg>":"",n=B;for(let i=0;i<e;i++){const e=t[i];let h,p,l=-1,a=0;for(;a<e.length&&(n.lastIndex=a,p=n.exec(e),null!==p);)a=n.lastIndex,n===B?"!--"===p[1]?n=E:void 0!==p[1]?n=M:void 0!==p[2]?(I.test(p[2])&&(s=RegExp("</"+p[2],"g")),n=j):void 0!==p[3]&&(n=j):n===j?">"===p[0]?(n=null!=s?s:B,l=-1):void 0===p[1]?l=-2:(l=n.lastIndex-p[2].length,h=p[1],n=void 0===p[3]?j:'"'===p[3]?D:T):n===D||n===T?n=j:n===E||n===M?n=B:(n=j,s=void 0);const f=n===j&&t[i+1].startsWith("/>")?" ":"";r+=n===B?e+_:l>=0?(o.push(h),e.slice(0,l)+"$lit$"+e.slice(l)+z+f):e+z+(-2===l?(o.push(void 0),i):f)}const h=r+(t[e]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==w?w.createHTML(h):h,o]};class F{constructor({strings:t,_$litType$:i},e){let o;this.parts=[];let s=0,r=0;const n=t.length-1,h=this.parts,[p,l]=Z(t,i);if(this.el=F.createElement(p,e),W.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(o=W.nextNode())&&h.length<n;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const i of o.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(z)){const e=l[r++];if(t.push(i),void 0!==e){const t=o.getAttribute(e.toLowerCase()+"$lit$").split(z),i=/([.?@])?(.*)/.exec(e);h.push({type:1,index:s,name:i[2],strings:t,ctor:"."===i[1]?Y:"?"===i[1]?J:"@"===i[1]?Q:X})}else h.push({type:6,index:s})}for(const i of t)o.removeAttribute(i)}if(I.test(o.tagName)){const t=o.textContent.split(z),i=t.length-1;if(i>0){o.textContent=k?k.emptyScript:"";for(let e=0;e<i;e++)o.append(t[e],C()),W.nextNode(),h.push({type:2,index:++s});o.append(t[i],C())}}}else if(8===o.nodeType)if(o.data===A)h.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(z,t+1));)h.push({type:7,index:s}),t+=z.length-1}s++}}static createElement(t,i){const e=S.createElement("template");return e.innerHTML=t,e}}function H(t,i,e=t,o){var s,r,n,h;if(i===U)return i;let p=void 0!==o?null===(s=e._$Cl)||void 0===s?void 0:s[o]:e._$Cu;const l=N(i)?void 0:i._$litDirective$;return(null==p?void 0:p.constructor)!==l&&(null===(r=null==p?void 0:p._$AO)||void 0===r||r.call(p,!1),void 0===l?p=void 0:(p=new l(t),p._$AT(t,e,o)),void 0!==o?(null!==(n=(h=e)._$Cl)&&void 0!==n?n:h._$Cl=[])[o]=p:e._$Cu=p),void 0!==p&&(i=H(t,p._$AS(t,i.values),p,o)),i}class K{constructor(t,i){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var i;const{el:{content:e},parts:o}=this._$AD,s=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:S).importNode(e,!0);W.currentNode=s;let r=W.nextNode(),n=0,h=0,p=o[0];for(;void 0!==p;){if(n===p.index){let i;2===p.type?i=new L(r,r.nextSibling,this,t):1===p.type?i=new p.ctor(r,p.name,p.strings,this,t):6===p.type&&(i=new V(r,this,t)),this.v.push(i),p=o[++h]}n!==(null==p?void 0:p.index)&&(r=W.nextNode(),n++)}return s}m(t){let i=0;for(const e of this.v)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,i),i+=e.strings.length-2):e._$AI(t[i])),i++}}class L{constructor(t,i,e,o){var s;this.type=2,this._$AH=P,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=e,this.options=o,this._$C_=null===(s=null==o?void 0:o.isConnected)||void 0===s||s}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$C_}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=H(this,t,i),N(t)?t===P||null==t||""===t?(this._$AH!==P&&this._$AR(),this._$AH=P):t!==this._$AH&&t!==U&&this.T(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.k(t):(t=>O(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.S(t):this.T(t)}j(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.j(t))}T(t){this._$AH!==P&&N(this._$AH)?this._$AA.nextSibling.data=t:this.k(S.createTextNode(t)),this._$AH=t}$(t){var i;const{values:e,_$litType$:o}=t,s="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=F.createElement(o.h,this.options)),o);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===s)this._$AH.m(e);else{const t=new K(s,this),i=t.p(this.options);t.m(e),this.k(i),this._$AH=t}}_$AC(t){let i=G.get(t.strings);return void 0===i&&G.set(t.strings,i=new F(t)),i}S(t){O(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let e,o=0;for(const s of t)o===i.length?i.push(e=new L(this.j(C()),this.j(C()),this,this.options)):e=i[o],e._$AI(s),o++;o<i.length&&(this._$AR(e&&e._$AB.nextSibling,o),i.length=o)}_$AR(t=this._$AA.nextSibling,i){var e;for(null===(e=this._$AP)||void 0===e||e.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$C_=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class X{constructor(t,i,e,o,s){this.type=1,this._$AH=P,this._$AN=void 0,this.element=t,this.name=i,this._$AM=o,this.options=s,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=P}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,e,o){const s=this.strings;let r=!1;if(void 0===s)t=H(this,t,i,0),r=!N(t)||t!==this._$AH&&t!==U,r&&(this._$AH=t);else{const o=t;let n,h;for(t=s[0],n=0;n<s.length-1;n++)h=H(this,o[e+n],i,n),h===U&&(h=this._$AH[n]),r||(r=!N(h)||h!==this._$AH[n]),h===P?t=P:t!==P&&(t+=(null!=h?h:"")+s[n+1]),this._$AH[n]=h}r&&!o&&this.P(t)}P(t){t===P?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class Y extends X{constructor(){super(...arguments),this.type=3}P(t){this.element[this.name]=t===P?void 0:t}}const q=k?k.emptyScript:"";class J extends X{constructor(){super(...arguments),this.type=4}P(t){t&&t!==P?this.element.setAttribute(this.name,q):this.element.removeAttribute(this.name)}}class Q extends X{constructor(t,i,e,o,s){super(t,i,e,o,s),this.type=5}_$AI(t,i=this){var e;if((t=null!==(e=H(this,t,i,0))&&void 0!==e?e:P)===U)return;const o=this._$AH,s=t===P&&o!==P||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,r=t!==P&&(o===P||s);s&&this.element.removeEventListener(this.name,this,o),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,e;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==e?e:this.element,t):this._$AH.handleEvent(t)}}class V{constructor(t,i,e){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(t){H(this,t)}}const tt=window.litHtmlPolyfillSupport;null==tt||tt(F,L),(null!==(m=globalThis.litHtmlVersions)&&void 0!==m?m:globalThis.litHtmlVersions=[]).push("2.2.7");
|
|
114
108
|
/**
|
|
115
109
|
* @license
|
|
116
110
|
* Copyright 2020 Google LLC
|
|
117
111
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
118
112
|
*/
|
|
119
|
-
const
|
|
113
|
+
const it=Symbol.for(""),et=t=>{if((null==t?void 0:t.r)===it)return null==t?void 0:t._$litStatic$},ot=t=>({_$litStatic$:t,r:it}),st=new Map,rt=(t=>(i,...e)=>{const o=e.length;let s,r;const n=[],h=[];let p,l=0,a=!1;for(;l<o;){for(p=i[l];l<o&&void 0!==(r=e[l],s=et(r));)p+=s+i[++l],a=!0;h.push(r),n.push(p),l++}if(l===o&&n.push(i[o]),a){const t=n.join("$$lit$$");void 0===(i=st.get(t))&&(n.raw=n,st.set(t,i=n)),e=h}return t(i,...e)})(R);var nt;!function(t){t.title="title",t.title_dense="title-dense",t.subtitle1="subtitle1",t.subtitle2="subtitle2",t.body1="body1",t.body2="body2",t.caption="caption",t.breadcrumb="breadcrumb",t.overline="overline",t.button="button"}(nt||(nt={}));const ht=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.titleFont),pt=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.contentFont),lt={fontFamily:pt,fontSize:i.FtCssVariableFactory.create("--ft-typography-font-size","SIZE","16px"),fontWeight:i.FtCssVariableFactory.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:i.FtCssVariableFactory.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:i.FtCssVariableFactory.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:i.FtCssVariableFactory.create("--ft-typography-text-transform","UNKNOWN","inherit")},at=i.FtCssVariableFactory.extend("--ft-typography-title-font-family",ht),ft=i.FtCssVariableFactory.extend("--ft-typography-title-font-size",lt.fontSize,"20px"),ct=i.FtCssVariableFactory.extend("--ft-typography-title-font-weight",lt.fontWeight,"normal"),dt=i.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing",lt.letterSpacing,"0.15px"),yt=i.FtCssVariableFactory.extend("--ft-typography-title-line-height",lt.lineHeight,"1.2"),gt=i.FtCssVariableFactory.extend("--ft-typography-title-text-transform",lt.textTransform,"inherit"),ut=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family",ht),bt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size",lt.fontSize,"14px"),vt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-weight",lt.fontWeight,"normal"),mt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-letter-spacing",lt.letterSpacing,"0.105px"),$t=i.FtCssVariableFactory.extend("--ft-typography-title-dense-line-height",lt.lineHeight,"1.7"),xt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-text-transform",lt.textTransform,"inherit"),kt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-family",pt),wt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-size",lt.fontSize,"16px"),zt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-weight",lt.fontWeight,"600"),At=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-letter-spacing",lt.letterSpacing,"0.144px"),_t=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-line-height",lt.lineHeight,"1.5"),St=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-text-transform",lt.textTransform,"inherit"),Ct=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-family",pt),Nt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-size",lt.fontSize,"14px"),Ot=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-weight",lt.fontWeight,"normal"),Bt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-letter-spacing",lt.letterSpacing,"0.098px"),Et=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-line-height",lt.lineHeight,"1.7"),Mt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-text-transform",lt.textTransform,"inherit"),jt=i.FtCssVariableFactory.extend("--ft-typography-body1-font-family",pt),Tt=i.FtCssVariableFactory.extend("--ft-typography-body1-font-size",lt.fontSize,"16px"),Dt=i.FtCssVariableFactory.extend("--ft-typography-body1-font-weight",lt.fontWeight,"normal"),It=i.FtCssVariableFactory.extend("--ft-typography-body1-letter-spacing",lt.letterSpacing,"0.496px"),Rt=i.FtCssVariableFactory.extend("--ft-typography-body1-line-height",lt.lineHeight,"1.5"),Ut=i.FtCssVariableFactory.extend("--ft-typography-body1-text-transform",lt.textTransform,"inherit"),Pt=i.FtCssVariableFactory.extend("--ft-typography-body2-font-family",pt),Gt=i.FtCssVariableFactory.extend("--ft-typography-body2-font-size",lt.fontSize,"14px"),Wt=i.FtCssVariableFactory.extend("--ft-typography-body2-font-weight",lt.fontWeight,"normal"),Zt=i.FtCssVariableFactory.extend("--ft-typography-body2-letter-spacing",lt.letterSpacing,"0.252px"),Ft=i.FtCssVariableFactory.extend("--ft-typography-body2-line-height",lt.lineHeight,"1.4"),Ht=i.FtCssVariableFactory.extend("--ft-typography-body2-text-transform",lt.textTransform,"inherit"),Kt=i.FtCssVariableFactory.extend("--ft-typography-caption-font-family",pt),Lt=i.FtCssVariableFactory.extend("--ft-typography-caption-font-size",lt.fontSize,"12px"),Xt=i.FtCssVariableFactory.extend("--ft-typography-caption-font-weight",lt.fontWeight,"normal"),Yt=i.FtCssVariableFactory.extend("--ft-typography-caption-letter-spacing",lt.letterSpacing,"0.396px"),qt=i.FtCssVariableFactory.extend("--ft-typography-caption-line-height",lt.lineHeight,"1.33"),Jt=i.FtCssVariableFactory.extend("--ft-typography-caption-text-transform",lt.textTransform,"inherit"),Qt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-family",pt),Vt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-size",lt.fontSize,"10px"),ti=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-weight",lt.fontWeight,"normal"),ii=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-letter-spacing",lt.letterSpacing,"0.33px"),ei=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-line-height",lt.lineHeight,"1.6"),oi=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-text-transform",lt.textTransform,"inherit"),si=i.FtCssVariableFactory.extend("--ft-typography-overline-font-family",pt),ri=i.FtCssVariableFactory.extend("--ft-typography-overline-font-size",lt.fontSize,"10px"),ni=i.FtCssVariableFactory.extend("--ft-typography-overline-font-weight",lt.fontWeight,"normal"),hi=i.FtCssVariableFactory.extend("--ft-typography-overline-letter-spacing",lt.letterSpacing,"1.5px"),pi=i.FtCssVariableFactory.extend("--ft-typography-overline-line-height",lt.lineHeight,"1.6"),li=i.FtCssVariableFactory.extend("--ft-typography-overline-text-transform",lt.textTransform,"uppercase"),ai=i.FtCssVariableFactory.extend("--ft-typography-button-font-family",pt),fi=i.FtCssVariableFactory.extend("--ft-typography-button-font-size",lt.fontSize,"14px"),ci=i.FtCssVariableFactory.extend("--ft-typography-button-font-weight",lt.fontWeight,"600"),di=i.FtCssVariableFactory.extend("--ft-typography-button-letter-spacing",lt.letterSpacing,"1.246px"),yi=i.FtCssVariableFactory.extend("--ft-typography-button-line-height",lt.lineHeight,"1.15"),gi=i.FtCssVariableFactory.extend("--ft-typography-button-text-transform",lt.textTransform,"uppercase"),ui=e.css`
|
|
120
114
|
.ft-typography--title {
|
|
121
115
|
font-family: ${at};
|
|
122
116
|
font-size: ${ft};
|
|
@@ -207,18 +201,95 @@ const tt=Symbol.for(""),it=t=>{if((null==t?void 0:t.r)===tt)return null==t?void
|
|
|
207
201
|
line-height: ${yi};
|
|
208
202
|
text-transform: ${gi};
|
|
209
203
|
}
|
|
210
|
-
|
|
211
|
-
|
|
204
|
+
`,_i=e.css`
|
|
205
|
+
.ft-typography {
|
|
206
|
+
vertical-align: inherit;
|
|
207
|
+
}
|
|
208
|
+
`;var Si=function(t,i,e,o){for(var s,r=arguments.length,n=r<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,h=t.length-1;h>=0;h--)(s=t[h])&&(n=(r<3?s(n):r>3?s(i,e,n):s(i,e))||n);return r>3&&n&&Object.defineProperty(i,e,n),n};class Ci extends i.FtLitElement{constructor(){super(...arguments),this.variant=nt.body1}render(){return this.element?rt`
|
|
209
|
+
<${ot(this.element)}
|
|
212
210
|
class="ft-typography ft-typography--${this.variant}">
|
|
213
211
|
<slot></slot>
|
|
214
|
-
</${
|
|
215
|
-
`:
|
|
212
|
+
</${ot(this.element)}>
|
|
213
|
+
`:rt`
|
|
216
214
|
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
217
|
-
`}}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
215
|
+
`}}Ci.styles=[ui,bi,vi,mi,$i,xi,ki,wi,zi,Ai,_i],Si([o.property()],Ci.prototype,"element",void 0),Si([o.property()],Ci.prototype,"variant",void 0),i.customElement("ft-typography")(Ci);const Ni={textColor:i.FtCssVariableFactory.extend("--ft-checkbox-text-color",i.designSystemVariables.colorOnSurfaceHigh),colorPrimary:i.FtCssVariableFactory.external(i.designSystemVariables.colorPrimary,"Design system"),colorOnPrimary:i.FtCssVariableFactory.external(i.designSystemVariables.colorOnPrimary,"Design system"),borderColor:i.FtCssVariableFactory.extend("--ft-checkbox-border-color",i.designSystemVariables.colorOnSurfaceMedium),colorOnSurfaceDisabled:i.FtCssVariableFactory.external(i.designSystemVariables.colorOnSurfaceDisabled,"Design system")},Oi=e.css`
|
|
216
|
+
* {
|
|
217
|
+
box-sizing: border-box;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.ft-checkbox {
|
|
221
|
+
box-sizing: border-box;
|
|
222
|
+
color: ${Ni.textColor};
|
|
223
|
+
|
|
224
|
+
display: inline-flex;
|
|
225
|
+
align-items: center;
|
|
226
|
+
gap: 4px;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.ft-checkbox--disabled {
|
|
230
|
+
color: ${Ni.colorOnSurfaceDisabled};
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
input {
|
|
234
|
+
opacity: 0;
|
|
235
|
+
position: absolute;
|
|
236
|
+
width: 40px;
|
|
237
|
+
height: 40px;
|
|
238
|
+
margin: 0;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.ft-checkbox--box-container {
|
|
242
|
+
position: relative;
|
|
243
|
+
width: 40px;
|
|
244
|
+
height: 40px;
|
|
245
|
+
|
|
246
|
+
display: flex;
|
|
247
|
+
justify-content: center;
|
|
248
|
+
align-items: center;
|
|
249
|
+
flex-shrink: 0;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.ft-checkbox--box {
|
|
253
|
+
display: flex;
|
|
254
|
+
border: 2px solid ${Ni.borderColor};
|
|
255
|
+
border-radius: 2px;
|
|
256
|
+
|
|
257
|
+
width: 18px;
|
|
258
|
+
height: 18px;
|
|
259
|
+
|
|
260
|
+
color: ${Ni.colorOnPrimary};
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
.ft-checkbox--checked .ft-checkbox--box,
|
|
265
|
+
.ft-checkbox--indeterminate .ft-checkbox--box {
|
|
266
|
+
border-color: ${Ni.colorPrimary};
|
|
267
|
+
background-color: ${Ni.colorPrimary};
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.ft-checkbox--disabled .ft-checkbox--box {
|
|
271
|
+
border-color: ${Ni.colorOnSurfaceDisabled};
|
|
272
|
+
background-color: transparent;
|
|
273
|
+
color: ${Ni.colorOnSurfaceDisabled};
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.ft-checkbox--checkmark {
|
|
277
|
+
transition: opacity 180ms cubic-bezier(0, 0, 0.2, 1) 0ms, transform 180ms cubic-bezier(0, 0, 0.2, 1) 0ms;
|
|
278
|
+
opacity: 0;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.ft-checkbox--checkmark-path {
|
|
282
|
+
stroke-dashoffset: 0;
|
|
283
|
+
stroke: currentcolor;
|
|
284
|
+
stroke-width: 3px;
|
|
285
|
+
stroke-dasharray: 30;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.ft-checkbox--checked .ft-checkbox--checkmark,
|
|
289
|
+
.ft-checkbox--indeterminate .ft-checkbox--checkmark {
|
|
290
|
+
opacity: 1;
|
|
291
|
+
}
|
|
292
|
+
`;var Bi=function(t,i,e,o){for(var s,r=arguments.length,n=r<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,h=t.length-1;h>=0;h--)(s=t[h])&&(n=(r<3?s(n):r>3?s(i,e,n):s(i,e))||n);return r>3&&n&&Object.defineProperty(i,e,n),n};class Ei extends i.FtLitElement{constructor(){super(...arguments),this.name="",this.checked=!1,this.indeterminate=!1,this.disabled=!1}render(){const t={"ft-checkbox":!0,"ft-checkbox--checked":this.checked,"ft-checkbox--indeterminate":this.indeterminate,"ft-checkbox--disabled":this.disabled};return e.html`
|
|
222
293
|
<label class="${s.classMap(t)}" for="checkbox-input">
|
|
223
294
|
<div class="ft-checkbox--box-container">
|
|
224
295
|
<ft-ripple
|
|
@@ -244,81 +315,4 @@ const tt=Symbol.for(""),it=t=>{if((null==t?void 0:t.r)===tt)return null==t?void
|
|
|
244
315
|
<slot></slot>
|
|
245
316
|
</ft-typography>
|
|
246
317
|
</label>
|
|
247
|
-
`}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("change",{detail:this.checked}))}contentAvailableCallback(t){var i;super.contentAvailableCallback(t),null===(i=this.ripple)||void 0===i||i.setupFor(this.container)}}
|
|
248
|
-
* {
|
|
249
|
-
box-sizing: border-box;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
.ft-checkbox {
|
|
253
|
-
box-sizing: border-box;
|
|
254
|
-
color: ${Ci.textColor};
|
|
255
|
-
|
|
256
|
-
display: inline-flex;
|
|
257
|
-
align-items: center;
|
|
258
|
-
gap: 4px;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
.ft-checkbox--disabled {
|
|
262
|
-
color: ${Ci.colorOnSurfaceDisabled};
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
input {
|
|
266
|
-
opacity: 0;
|
|
267
|
-
position: absolute;
|
|
268
|
-
width: 40px;
|
|
269
|
-
height: 40px;
|
|
270
|
-
margin: 0;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
.ft-checkbox--box-container {
|
|
274
|
-
position: relative;
|
|
275
|
-
width: 40px;
|
|
276
|
-
height: 40px;
|
|
277
|
-
|
|
278
|
-
display: flex;
|
|
279
|
-
justify-content: center;
|
|
280
|
-
align-items: center;
|
|
281
|
-
flex-shrink: 0;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
.ft-checkbox--box {
|
|
285
|
-
display: flex;
|
|
286
|
-
border: 2px solid ${Ci.borderColor};
|
|
287
|
-
border-radius: 2px;
|
|
288
|
-
|
|
289
|
-
width: 18px;
|
|
290
|
-
height: 18px;
|
|
291
|
-
|
|
292
|
-
color: ${Ci.colorOnPrimary};
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
.ft-checkbox--checked .ft-checkbox--box,
|
|
297
|
-
.ft-checkbox--indeterminate .ft-checkbox--box {
|
|
298
|
-
border-color: ${Ci.colorPrimary};
|
|
299
|
-
background-color: ${Ci.colorPrimary};
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
.ft-checkbox--disabled .ft-checkbox--box {
|
|
303
|
-
border-color: ${Ci.colorOnSurfaceDisabled};
|
|
304
|
-
background-color: transparent;
|
|
305
|
-
color: ${Ci.colorOnSurfaceDisabled};
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
.ft-checkbox--checkmark {
|
|
309
|
-
transition: opacity 180ms cubic-bezier(0, 0, 0.2, 1) 0ms, transform 180ms cubic-bezier(0, 0, 0.2, 1) 0ms;
|
|
310
|
-
opacity: 0;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
.ft-checkbox--checkmark-path {
|
|
314
|
-
stroke-dashoffset: 0;
|
|
315
|
-
stroke: currentcolor;
|
|
316
|
-
stroke-width: 3px;
|
|
317
|
-
stroke-dasharray: 30;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
.ft-checkbox--checked .ft-checkbox--checkmark,
|
|
321
|
-
.ft-checkbox--indeterminate .ft-checkbox--checkmark {
|
|
322
|
-
opacity: 1;
|
|
323
|
-
}
|
|
324
|
-
`,Si([o.property()],Ni.prototype,"name",void 0),Si([o.property({type:Boolean,reflect:!0})],Ni.prototype,"checked",void 0),Si([o.property({type:Boolean})],Ni.prototype,"indeterminate",void 0),Si([o.property({type:Boolean})],Ni.prototype,"disabled",void 0),Si([o.query(".ft-checkbox")],Ni.prototype,"container",void 0),Si([o.query("ft-ripple")],Ni.prototype,"ripple",void 0),i.customElement("ft-checkbox")(Ni),t.FtCheckbox=Ni,t.FtCheckboxCssVariables=Ci,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litClassMap);
|
|
318
|
+
`}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("change",{detail:this.checked}))}contentAvailableCallback(t){var i;super.contentAvailableCallback(t),null===(i=this.ripple)||void 0===i||i.setupFor(this.container)}}Ei.elementDefinitions={"ft-ripple":x,"ft-typography":Ci},Ei.styles=Oi,Bi([o.property()],Ei.prototype,"name",void 0),Bi([o.property({type:Boolean,reflect:!0})],Ei.prototype,"checked",void 0),Bi([o.property({type:Boolean})],Ei.prototype,"indeterminate",void 0),Bi([o.property({type:Boolean})],Ei.prototype,"disabled",void 0),Bi([o.query(".ft-checkbox")],Ei.prototype,"container",void 0),Bi([o.query("ft-ripple")],Ei.prototype,"ripple",void 0),i.customElement("ft-checkbox")(Ei),t.FtCheckbox=Ei,t.FtCheckboxCssVariables=Ni,t.styles=Oi,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litClassMap);
|
package/build/ft-checkbox.min.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* @see https://github.com/webcomponents/polyfills/tree/master/packages/scoped-custom-element-registry
|
|
16
16
|
*/
|
|
17
|
-
if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,e=window.customElements.define,i=window.customElements.get,o=window.customElements,r=new WeakMap,s=new WeakMap,n=new WeakMap,a=new WeakMap;let l;window.CustomElementRegistry=class{constructor(){this._definitionsByTag=new Map,this._definitionsByClass=new Map,this._whenDefinedPromises=new Map,this._awaitingUpgrade=new Map}define(t,r){if(t=t.toLowerCase(),void 0!==this._getDefinition(t))throw new DOMException(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);if(void 0!==this._definitionsByClass.get(r))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");const a=r.prototype.attributeChangedCallback,l=new Set(r.observedAttributes||[]);f(r,l,a);const h={elementClass:r,connectedCallback:r.prototype.connectedCallback,disconnectedCallback:r.prototype.disconnectedCallback,adoptedCallback:r.prototype.adoptedCallback,attributeChangedCallback:a,formAssociated:r.formAssociated,formAssociatedCallback:r.prototype.formAssociatedCallback,formDisabledCallback:r.prototype.formDisabledCallback,formResetCallback:r.prototype.formResetCallback,formStateRestoreCallback:r.prototype.formStateRestoreCallback,observedAttributes:l};this._definitionsByTag.set(t,h),this._definitionsByClass.set(r,h);let c=i.call(o,t);c||(c=p(t),e.call(o,t,c)),this===window.customElements&&(n.set(r,h),h.standInClass=c);const d=this._awaitingUpgrade.get(t);if(d){this._awaitingUpgrade.delete(t);for(const t of d)s.delete(t),u(t,h,!0)}const y=this._whenDefinedPromises.get(t);return void 0!==y&&(y.resolve(r),this._whenDefinedPromises.delete(t)),r}upgrade(){g.push(this),o.upgrade.apply(o,arguments),g.pop()}get(t){return this._definitionsByTag.get(t)?.elementClass}_getDefinition(t){return this._definitionsByTag.get(t)}whenDefined(t){const e=this._getDefinition(t);if(void 0!==e)return Promise.resolve(e.elementClass);let i=this._whenDefinedPromises.get(t);return void 0===i&&(i={},i.promise=new Promise((t=>i.resolve=t)),this._whenDefinedPromises.set(t,i)),i.promise}_upgradeWhenDefined(t,e,i){let o=this._awaitingUpgrade.get(e);o||this._awaitingUpgrade.set(e,o=new Set),i?o.add(t):o.delete(t)}},window.HTMLElement=function(){let e=l;if(e)return l=void 0,e;const i=n.get(this.constructor);if(!i)throw new TypeError("Illegal constructor (custom element class must be registered with global customElements registry to be newable)");return e=Reflect.construct(t,[],i.standInClass),Object.setPrototypeOf(e,this.constructor.prototype),r.set(e,i),e},window.HTMLElement.prototype=t.prototype;const h=t=>t===document||t instanceof ShadowRoot,c=t=>{let e=t.getRootNode();if(!h(e)){const t=g[g.length-1];if(t instanceof CustomElementRegistry)return t;e=t.getRootNode(),h(e)||(e=a.get(e)?.getRootNode()||document)}return e.customElements},p=e=>class{static get formAssociated(){return!0}constructor(){const i=Reflect.construct(t,[],this.constructor);Object.setPrototypeOf(i,HTMLElement.prototype);const o=c(i)||window.customElements,r=o._getDefinition(e);return r?u(i,r):s.set(i,o),i}connectedCallback(){const t=r.get(this);t?t.connectedCallback&&t.connectedCallback.apply(this,arguments):s.get(this)._upgradeWhenDefined(this,e,!0)}disconnectedCallback(){const t=r.get(this);t?t.disconnectedCallback&&t.disconnectedCallback.apply(this,arguments):s.get(this)._upgradeWhenDefined(this,e,!1)}adoptedCallback(){r.get(this)?.adoptedCallback?.apply(this,arguments)}formAssociatedCallback(){const t=r.get(this);t&&t.formAssociated&&t?.formAssociatedCallback?.apply(this,arguments)}formDisabledCallback(){const t=r.get(this);t?.formAssociated&&t?.formDisabledCallback?.apply(this,arguments)}formResetCallback(){const t=r.get(this);t?.formAssociated&&t?.formResetCallback?.apply(this,arguments)}formStateRestoreCallback(){const t=r.get(this);t?.formAssociated&&t?.formStateRestoreCallback?.apply(this,arguments)}},f=(t,e,i)=>{if(0===e.size||void 0===i)return;const o=t.prototype.setAttribute;o&&(t.prototype.setAttribute=function(t,r){const s=t.toLowerCase();if(e.has(s)){const t=this.getAttribute(s);o.call(this,s,r),i.call(this,s,t,r)}else o.call(this,s,r)});const r=t.prototype.removeAttribute;r&&(t.prototype.removeAttribute=function(t){const o=t.toLowerCase();if(e.has(o)){const t=this.getAttribute(o);r.call(this,o),i.call(this,o,t,null)}else r.call(this,o)})},d=e=>{const i=Object.getPrototypeOf(e);if(i!==window.HTMLElement)return i===t||"HTMLElement"===i?.prototype?.constructor?.name?Object.setPrototypeOf(e,window.HTMLElement):d(i)},u=(t,e,i=!1)=>{Object.setPrototypeOf(t,e.elementClass.prototype),r.set(t,e),l=t;try{new e.elementClass}catch(t){d(e.elementClass),new e.elementClass}e.observedAttributes.forEach((i=>{t.hasAttribute(i)&&e.attributeChangedCallback.call(t,i,null,t.getAttribute(i))})),i&&e.connectedCallback&&t.isConnected&&e.connectedCallback.call(t)},y=Element.prototype.attachShadow;Element.prototype.attachShadow=function(t){const e=y.apply(this,arguments);return t.customElements&&(e.customElements=t.customElements),e};let g=[document];const b=(t,e,i)=>{const o=(i?Object.getPrototypeOf(i):t.prototype)[e];t.prototype[e]=function(){g.push(this);const t=o.apply(i||this,arguments);return void 0!==t&&a.set(t,this),g.pop(),t}};b(ShadowRoot,"createElement",document),b(ShadowRoot,"importNode",document),b(Element,"insertAdjacentHTML");const v=(t,e)=>{const i=Object.getOwnPropertyDescriptor(t.prototype,e);Object.defineProperty(t.prototype,e,{...i,set(t){g.push(this),i.set.call(this,t),g.pop()}})};if(v(Element,"innerHTML"),v(ShadowRoot,"innerHTML"),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){const t=new WeakMap,e=HTMLElement.prototype.attachInternals,i=["setFormValue","setValidity","checkValidity","reportValidity"];HTMLElement.prototype.attachInternals=function(...i){const o=e.call(this,...i);return t.set(o,this),o},i.forEach((e=>{const i=window.ElementInternals.prototype,o=i[e];i[e]=function(...e){const i=t.get(this);if(!0!==r.get(i).formAssociated)throw new DOMException(`Failed to execute ${o} on 'ElementInternals': The target element is not a form-associated custom element.`);o?.call(this,...e)}}));class o extends Array{constructor(t){super(...t),this._elements=t}get value(){return this._elements.find((t=>!0===t.checked))?.value||""}}class s{constructor(t){const e=new Map;t.forEach(((t,i)=>{const o=t.getAttribute("name"),r=e.get(o)||[];this[+i]=t,r.push(t),e.set(o,r)})),this.length=t.length,e.forEach(((t,e)=>{t&&(1===t.length?this[e]=t[0]:this[e]=new o(t))}))}namedItem(t){return this[t]}}const n=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){const t=n.get.call(this,[]),e=[];for(const i of t){const t=r.get(i);t&&!0!==t.formAssociated||e.push(i)}return new s(e)}})}}try{window.customElements.define("custom-element",null)}catch(
|
|
17
|
+
if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,e=window.customElements.define,i=window.customElements.get,o=window.customElements,r=new WeakMap,s=new WeakMap,n=new WeakMap,a=new WeakMap;let l;window.CustomElementRegistry=class{constructor(){this._definitionsByTag=new Map,this._definitionsByClass=new Map,this._whenDefinedPromises=new Map,this._awaitingUpgrade=new Map}define(t,r){if(t=t.toLowerCase(),void 0!==this._getDefinition(t))throw new DOMException(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);if(void 0!==this._definitionsByClass.get(r))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");const a=r.prototype.attributeChangedCallback,l=new Set(r.observedAttributes||[]);f(r,l,a);const h={elementClass:r,connectedCallback:r.prototype.connectedCallback,disconnectedCallback:r.prototype.disconnectedCallback,adoptedCallback:r.prototype.adoptedCallback,attributeChangedCallback:a,formAssociated:r.formAssociated,formAssociatedCallback:r.prototype.formAssociatedCallback,formDisabledCallback:r.prototype.formDisabledCallback,formResetCallback:r.prototype.formResetCallback,formStateRestoreCallback:r.prototype.formStateRestoreCallback,observedAttributes:l};this._definitionsByTag.set(t,h),this._definitionsByClass.set(r,h);let c=i.call(o,t);c||(c=p(t),e.call(o,t,c)),this===window.customElements&&(n.set(r,h),h.standInClass=c);const d=this._awaitingUpgrade.get(t);if(d){this._awaitingUpgrade.delete(t);for(const t of d)s.delete(t),u(t,h,!0)}const y=this._whenDefinedPromises.get(t);return void 0!==y&&(y.resolve(r),this._whenDefinedPromises.delete(t)),r}upgrade(){g.push(this),o.upgrade.apply(o,arguments),g.pop()}get(t){return this._definitionsByTag.get(t)?.elementClass}_getDefinition(t){return this._definitionsByTag.get(t)}whenDefined(t){const e=this._getDefinition(t);if(void 0!==e)return Promise.resolve(e.elementClass);let i=this._whenDefinedPromises.get(t);return void 0===i&&(i={},i.promise=new Promise((t=>i.resolve=t)),this._whenDefinedPromises.set(t,i)),i.promise}_upgradeWhenDefined(t,e,i){let o=this._awaitingUpgrade.get(e);o||this._awaitingUpgrade.set(e,o=new Set),i?o.add(t):o.delete(t)}},window.HTMLElement=function(){let e=l;if(e)return l=void 0,e;const i=n.get(this.constructor);if(!i)throw new TypeError("Illegal constructor (custom element class must be registered with global customElements registry to be newable)");return e=Reflect.construct(t,[],i.standInClass),Object.setPrototypeOf(e,this.constructor.prototype),r.set(e,i),e},window.HTMLElement.prototype=t.prototype;const h=t=>t===document||t instanceof ShadowRoot,c=t=>{let e=t.getRootNode();if(!h(e)){const t=g[g.length-1];if(t instanceof CustomElementRegistry)return t;e=t.getRootNode(),h(e)||(e=a.get(e)?.getRootNode()||document)}return e.customElements},p=e=>class{static get formAssociated(){return!0}constructor(){const i=Reflect.construct(t,[],this.constructor);Object.setPrototypeOf(i,HTMLElement.prototype);const o=c(i)||window.customElements,r=o._getDefinition(e);return r?u(i,r):s.set(i,o),i}connectedCallback(){const t=r.get(this);t?t.connectedCallback&&t.connectedCallback.apply(this,arguments):s.get(this)._upgradeWhenDefined(this,e,!0)}disconnectedCallback(){const t=r.get(this);t?t.disconnectedCallback&&t.disconnectedCallback.apply(this,arguments):s.get(this)._upgradeWhenDefined(this,e,!1)}adoptedCallback(){r.get(this)?.adoptedCallback?.apply(this,arguments)}formAssociatedCallback(){const t=r.get(this);t&&t.formAssociated&&t?.formAssociatedCallback?.apply(this,arguments)}formDisabledCallback(){const t=r.get(this);t?.formAssociated&&t?.formDisabledCallback?.apply(this,arguments)}formResetCallback(){const t=r.get(this);t?.formAssociated&&t?.formResetCallback?.apply(this,arguments)}formStateRestoreCallback(){const t=r.get(this);t?.formAssociated&&t?.formStateRestoreCallback?.apply(this,arguments)}},f=(t,e,i)=>{if(0===e.size||void 0===i)return;const o=t.prototype.setAttribute;o&&(t.prototype.setAttribute=function(t,r){const s=t.toLowerCase();if(e.has(s)){const t=this.getAttribute(s);o.call(this,s,r),i.call(this,s,t,r)}else o.call(this,s,r)});const r=t.prototype.removeAttribute;r&&(t.prototype.removeAttribute=function(t){const o=t.toLowerCase();if(e.has(o)){const t=this.getAttribute(o);r.call(this,o),i.call(this,o,t,null)}else r.call(this,o)})},d=e=>{const i=Object.getPrototypeOf(e);if(i!==window.HTMLElement)return i===t||"HTMLElement"===i?.prototype?.constructor?.name?Object.setPrototypeOf(e,window.HTMLElement):d(i)},u=(t,e,i=!1)=>{Object.setPrototypeOf(t,e.elementClass.prototype),r.set(t,e),l=t;try{new e.elementClass}catch(t){d(e.elementClass),new e.elementClass}e.observedAttributes.forEach((i=>{t.hasAttribute(i)&&e.attributeChangedCallback.call(t,i,null,t.getAttribute(i))})),i&&e.connectedCallback&&t.isConnected&&e.connectedCallback.call(t)},y=Element.prototype.attachShadow;Element.prototype.attachShadow=function(t){const e=y.apply(this,arguments);return t.customElements&&(e.customElements=t.customElements),e};let g=[document];const b=(t,e,i)=>{const o=(i?Object.getPrototypeOf(i):t.prototype)[e];t.prototype[e]=function(){g.push(this);const t=o.apply(i||this,arguments);return void 0!==t&&a.set(t,this),g.pop(),t}};b(ShadowRoot,"createElement",document),b(ShadowRoot,"importNode",document),b(Element,"insertAdjacentHTML");const v=(t,e)=>{const i=Object.getOwnPropertyDescriptor(t.prototype,e);Object.defineProperty(t.prototype,e,{...i,set(t){g.push(this),i.set.call(this,t),g.pop()}})};if(v(Element,"innerHTML"),v(ShadowRoot,"innerHTML"),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){const t=new WeakMap,e=HTMLElement.prototype.attachInternals,i=["setFormValue","setValidity","checkValidity","reportValidity"];HTMLElement.prototype.attachInternals=function(...i){const o=e.call(this,...i);return t.set(o,this),o},i.forEach((e=>{const i=window.ElementInternals.prototype,o=i[e];i[e]=function(...e){const i=t.get(this);if(!0!==r.get(i).formAssociated)throw new DOMException(`Failed to execute ${o} on 'ElementInternals': The target element is not a form-associated custom element.`);o?.call(this,...e)}}));class o extends Array{constructor(t){super(...t),this._elements=t}get value(){return this._elements.find((t=>!0===t.checked))?.value||""}}class s{constructor(t){const e=new Map;t.forEach(((t,i)=>{const o=t.getAttribute("name"),r=e.get(o)||[];this[+i]=t,r.push(t),e.set(o,r)})),this.length=t.length,e.forEach(((t,e)=>{t&&(1===t.length?this[e]=t[0]:this[e]=new o(t))}))}namedItem(t){return this[t]}}const n=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){const t=n.get.call(this,[]),e=[];for(const i of t){const t=r.get(i);t&&!0!==t.formAssociated||e.push(i)}return new s(e)}})}}try{window.customElements.define("custom-element",null)}catch(Ft){const t=window.customElements.define;window.customElements.define=(e,i,o)=>{try{t.bind(window.customElements)(e,i,o)}catch(t){console.warn(e,i,o,t)}}}class e{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,e){this.callbacks=[t],this.debounce(e)}queue(t,e){this.callbacks.push(t),this.debounce(e)}cancel(){null!=this._debounce&&window.clearTimeout(this._debounce)}debounce(t){this.cancel(),this._debounce=window.setTimeout((()=>this.runCallbacks()),null!=t?t:this.timeout)}runCallbacks(){for(let t of this.callbacks)t();this.callbacks=[]}}
|
|
18
18
|
/**
|
|
19
19
|
* @license
|
|
20
20
|
* Copyright 2017 Google LLC
|
|
@@ -94,7 +94,96 @@ const ut=1;
|
|
|
94
94
|
* Copyright 2018 Google LLC
|
|
95
95
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
96
96
|
*/
|
|
97
|
-
const yt=(t=>(...e)=>({_$litDirective$:t,values:e}))(class extends class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}{constructor(t){var e;if(super(t),t.type!==ut||"class"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){var i,o;if(void 0===this.nt){this.nt=new Set,void 0!==t.strings&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!(null===(i=this.st)||void 0===i?void 0:i.has(t))&&this.nt.add(t);return this.render(e)}const r=t.element.classList;this.nt.forEach((t=>{t in e||(r.remove(t),this.nt.delete(t))}));for(const t in e){const i=!!e[t];i===this.nt.has(t)||(null===(o=this.st)||void 0===o?void 0:o.has(t))||(i?(r.add(t),this.nt.add(t)):(r.remove(t),this.nt.delete(t)))}return W}})
|
|
97
|
+
const yt=(t=>(...e)=>({_$litDirective$:t,values:e}))(class extends class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}{constructor(t){var e;if(super(t),t.type!==ut||"class"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){var i,o;if(void 0===this.nt){this.nt=new Set,void 0!==t.strings&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!(null===(i=this.st)||void 0===i?void 0:i.has(t))&&this.nt.add(t);return this.render(e)}const r=t.element.classList;this.nt.forEach((t=>{t in e||(r.remove(t),this.nt.delete(t))}));for(const t in e){const i=!!e[t];i===this.nt.has(t)||(null===(o=this.st)||void 0===o?void 0:o.has(t))||(i?(r.add(t),this.nt.add(t)):(r.remove(t),this.nt.delete(t)))}return W}}),gt=lt.extend("--ft-ripple-color",ht.colorContent),bt=gt,vt=lt.extend("--ft-ripple-background-color",gt),mt=lt.external(ht.opacityContentOnSurfacePressed,"Design system"),xt=lt.external(ht.opacityContentOnSurfaceHover,"Design system"),wt=lt.external(ht.opacityContentOnSurfaceFocused,"Design system"),$t=lt.external(ht.opacityContentOnSurfaceSelected,"Design system"),Ot=lt.extend("--ft-ripple-color",ht.colorPrimary),kt=Ot,St=lt.extend("--ft-ripple-background-color",Ot),Nt=lt.extend("--ft-ripple-color",ht.colorSecondary),Ct=Nt,Et=lt.extend("--ft-ripple-background-color",Nt),Rt=d`
|
|
98
|
+
:host {
|
|
99
|
+
display: contents;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.ft-ripple {
|
|
103
|
+
position: absolute;
|
|
104
|
+
inset: 0;
|
|
105
|
+
pointer-events: none;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.ft-ripple:not(.ft-ripple--unbounded) {
|
|
109
|
+
overflow: hidden;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.ft-ripple .ft-ripple--background,
|
|
113
|
+
.ft-ripple .ft-ripple--effect {
|
|
114
|
+
position: absolute;
|
|
115
|
+
opacity: 0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.ft-ripple .ft-ripple--background {
|
|
119
|
+
background-color: ${vt};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.ft-ripple .ft-ripple--effect {
|
|
123
|
+
background-color: ${bt};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.ft-ripple.ft-ripple--secondary .ft-ripple--background {
|
|
127
|
+
background-color: ${Et};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.ft-ripple.ft-ripple--secondary .ft-ripple--effect {
|
|
131
|
+
background-color: ${Ct};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.ft-ripple.ft-ripple--primary .ft-ripple--background {
|
|
135
|
+
background-color: ${St};
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.ft-ripple.ft-ripple--primary .ft-ripple--effect {
|
|
139
|
+
background-color: ${kt};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.ft-ripple .ft-ripple--background {
|
|
143
|
+
top: 0;
|
|
144
|
+
left: 0;
|
|
145
|
+
height: 100%;
|
|
146
|
+
width: 100%;
|
|
147
|
+
transition: opacity 75ms linear;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.ft-ripple .ft-ripple--effect,
|
|
151
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
152
|
+
border-radius: 50%;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.ft-ripple .ft-ripple--effect {
|
|
156
|
+
transform: translate(-50%, -50%) scale(0.15);
|
|
157
|
+
transition: transform 300ms ease, opacity 75ms linear;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--effect,
|
|
161
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
162
|
+
left: 50%;
|
|
163
|
+
top: 50%;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
167
|
+
transform: translate(-50%, -50%);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.ft-ripple.ft-ripple--hovered .ft-ripple--background {
|
|
171
|
+
opacity: ${xt};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.ft-ripple.ft-ripple--selected .ft-ripple--background {
|
|
175
|
+
opacity: ${$t};
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.ft-ripple.ft-ripple--focused .ft-ripple--background {
|
|
179
|
+
opacity: ${wt};
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.ft-ripple.ft-ripple--pressed .ft-ripple--effect {
|
|
183
|
+
opacity: ${mt};
|
|
184
|
+
transform: translate(-50%, -50%) scale(1);
|
|
185
|
+
}
|
|
186
|
+
`;var Mt=function(t,e,i,o){for(var r,s=arguments.length,n=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};class Ut extends dt{constructor(){super(...arguments),this.primary=!1,this.secondary=!1,this.unbounded=!1,this.activated=!1,this.selected=!1,this.disabled=!1,this.hovered=!1,this.focused=!1,this.pressed=!1,this.rippling=!1,this.rippleSize=0,this.originX=0,this.originY=0,this.resizeObserver=new ResizeObserver((()=>this.setRippleSize())),this.debouncer=new e(1e3),this.onTransitionStart=t=>{"transform"===t.propertyName&&(this.rippling=this.pressed,this.debouncer.run((()=>this.rippling=!1)))},this.onTransitionEnd=t=>{"transform"===t.propertyName&&(this.rippling=!1)},this.moveRipple=t=>{var e,i;let{x:o,y:r}=this.getCoordinates(t),s=null!==(i=null===(e=this.ripple)||void 0===e?void 0:e.getBoundingClientRect())&&void 0!==i?i:{x:0,y:0,width:0,height:0};this.originX=Math.round(null!=o?o-s.x:s.width/2),this.originY=Math.round(null!=r?r-s.y:s.height/2)},this.startPress=t=>{this.moveRipple(t),this.pressed=!this.isIgnored(t)},this.endPress=()=>{this.pressed=!1},this.startHover=t=>{this.hovered=!this.isIgnored(t)},this.endHover=()=>{this.hovered=!1},this.startFocus=t=>{this.focused=!this.isIgnored(t)},this.endFocus=()=>{this.focused=!1}}render(){let t={"ft-ripple":!0,"ft-ripple--primary":this.primary,"ft-ripple--secondary":this.secondary,"ft-ripple--unbounded":this.unbounded,"ft-ripple--selected":(this.selected||this.activated)&&!this.disabled,"ft-ripple--pressed":(this.pressed||this.rippling)&&!this.disabled,"ft-ripple--hovered":this.hovered&&!this.disabled,"ft-ripple--focused":this.focused&&!this.disabled};return T`
|
|
98
187
|
<style>
|
|
99
188
|
.ft-ripple .ft-ripple--effect,
|
|
100
189
|
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
@@ -111,102 +200,13 @@ const yt=(t=>(...e)=>({_$litDirective$:t,values:e}))(class extends class{constru
|
|
|
111
200
|
<div class="ft-ripple--background"></div>
|
|
112
201
|
<div class="ft-ripple--effect"></div>
|
|
113
202
|
</div>
|
|
114
|
-
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){var e,i;super.updated(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(e=this.target)||void 0===e||e.removeAttribute("data-is-ft-ripple-target")):null===(i=this.target)||void 0===i||i.setAttribute("data-is-ft-ripple-target","true")),t.has("unbounded")&&this.setRippleSize()}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}setRippleSize(){if(this.ripple){const t=this.ripple.getBoundingClientRect();this.rippleSize=(this.unbounded?1:1.7)*Math.max(t.width,t.height)}}connectedCallback(){var t;super.connectedCallback();const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;e&&this.setupFor(e),this.setRippleSize()}setupFor(t){if(this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const e=(...t)=>e=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(e)},i=e("mouseup","contextmenu"),o=e("touchend","touchcancel"),r=t=>{["Enter"," "].includes(t.key)&&e("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",i),t.addEventListener("touchstart",o),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",r),t.addEventListener("focus",this.startFocus),t.addEventListener("blur",this.endFocus),t.addEventListener("focusin",this.startFocus),t.addEventListener("focusout",this.endFocus),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover),t.removeEventListener("mousemove",this.moveRipple),t.removeEventListener("mouseleave",this.endHover),t.removeEventListener("mousedown",i),t.removeEventListener("touchstart",o),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",r),t.removeEventListener("focus",this.startFocus),t.removeEventListener("blur",this.endFocus),t.removeEventListener("focusin",this.startFocus),t.removeEventListener("focusout",this.endFocus),this.onDisconnect=void 0}}getCoordinates(t){const e=t,i=t;let o,r;return null!=e.x?({x:o,y:r}=e):null!=i.touches&&(o=i.touches[0].clientX,r=i.touches[0].clientY),{x:o,y:r}}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let e of t.composedPath()){if(e===this.target)break;if("hasAttribute"in e&&e.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.resizeObserver.disconnect(),this.endRipple()}}
|
|
115
|
-
:host {
|
|
116
|
-
display: contents;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.ft-ripple {
|
|
120
|
-
position: absolute;
|
|
121
|
-
inset: 0;
|
|
122
|
-
pointer-events: none;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.ft-ripple:not(.ft-ripple--unbounded) {
|
|
126
|
-
overflow: hidden;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.ft-ripple .ft-ripple--background,
|
|
130
|
-
.ft-ripple .ft-ripple--effect {
|
|
131
|
-
position: absolute;
|
|
132
|
-
opacity: 0;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.ft-ripple .ft-ripple--background {
|
|
136
|
-
background-color: ${mt};
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.ft-ripple .ft-ripple--effect {
|
|
140
|
-
background-color: ${vt};
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.ft-ripple.ft-ripple--secondary .ft-ripple--background {
|
|
144
|
-
background-color: ${Rt};
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
.ft-ripple.ft-ripple--secondary .ft-ripple--effect {
|
|
148
|
-
background-color: ${Et};
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.ft-ripple.ft-ripple--primary .ft-ripple--background {
|
|
152
|
-
background-color: ${Nt};
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.ft-ripple.ft-ripple--primary .ft-ripple--effect {
|
|
156
|
-
background-color: ${St};
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.ft-ripple .ft-ripple--background {
|
|
160
|
-
top: 0;
|
|
161
|
-
left: 0;
|
|
162
|
-
height: 100%;
|
|
163
|
-
width: 100%;
|
|
164
|
-
transition: opacity 75ms linear;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
.ft-ripple .ft-ripple--effect,
|
|
168
|
-
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
169
|
-
border-radius: 50%;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.ft-ripple .ft-ripple--effect {
|
|
173
|
-
transform: translate(-50%, -50%) scale(0.15);
|
|
174
|
-
transition: transform 300ms ease, opacity 75ms linear;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
.ft-ripple.ft-ripple--unbounded .ft-ripple--effect,
|
|
178
|
-
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
179
|
-
left: 50%;
|
|
180
|
-
top: 50%;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
184
|
-
transform: translate(-50%, -50%);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
.ft-ripple.ft-ripple--hovered .ft-ripple--background {
|
|
188
|
-
opacity: ${wt};
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
.ft-ripple.ft-ripple--selected .ft-ripple--background {
|
|
192
|
-
opacity: ${Ot};
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.ft-ripple.ft-ripple--focused .ft-ripple--background {
|
|
196
|
-
opacity: ${$t};
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
.ft-ripple.ft-ripple--pressed .ft-ripple--effect {
|
|
200
|
-
opacity: ${xt};
|
|
201
|
-
transform: translate(-50%, -50%) scale(1);
|
|
202
|
-
}
|
|
203
|
-
`,gt([o({type:Boolean})],Mt.prototype,"primary",void 0),gt([o({type:Boolean})],Mt.prototype,"secondary",void 0),gt([o({type:Boolean})],Mt.prototype,"unbounded",void 0),gt([o({type:Boolean})],Mt.prototype,"activated",void 0),gt([o({type:Boolean})],Mt.prototype,"selected",void 0),gt([o({type:Boolean})],Mt.prototype,"disabled",void 0),gt([r()],Mt.prototype,"hovered",void 0),gt([r()],Mt.prototype,"focused",void 0),gt([r()],Mt.prototype,"pressed",void 0),gt([r()],Mt.prototype,"rippling",void 0),gt([r()],Mt.prototype,"rippleSize",void 0),gt([r()],Mt.prototype,"originX",void 0),gt([r()],Mt.prototype,"originY",void 0),gt([s(".ft-ripple")],Mt.prototype,"ripple",void 0),gt([s(".ft-ripple--effect")],Mt.prototype,"rippleEffect",void 0),a("ft-ripple")(Mt);
|
|
203
|
+
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){var e,i;super.updated(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(e=this.target)||void 0===e||e.removeAttribute("data-is-ft-ripple-target")):null===(i=this.target)||void 0===i||i.setAttribute("data-is-ft-ripple-target","true")),t.has("unbounded")&&this.setRippleSize()}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}setRippleSize(){if(this.ripple){const t=this.ripple.getBoundingClientRect();this.rippleSize=(this.unbounded?1:1.7)*Math.max(t.width,t.height)}}connectedCallback(){var t;super.connectedCallback();const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;e&&this.setupFor(e),this.setRippleSize()}setupFor(t){if(this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const e=(...t)=>e=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(e)},i=e("mouseup","contextmenu"),o=e("touchend","touchcancel"),r=t=>{["Enter"," "].includes(t.key)&&e("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",i),t.addEventListener("touchstart",o),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",r),t.addEventListener("focus",this.startFocus),t.addEventListener("blur",this.endFocus),t.addEventListener("focusin",this.startFocus),t.addEventListener("focusout",this.endFocus),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover),t.removeEventListener("mousemove",this.moveRipple),t.removeEventListener("mouseleave",this.endHover),t.removeEventListener("mousedown",i),t.removeEventListener("touchstart",o),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",r),t.removeEventListener("focus",this.startFocus),t.removeEventListener("blur",this.endFocus),t.removeEventListener("focusin",this.startFocus),t.removeEventListener("focusout",this.endFocus),this.onDisconnect=void 0}}getCoordinates(t){const e=t,i=t;let o,r;return null!=e.x?({x:o,y:r}=e):null!=i.touches&&(o=i.touches[0].clientX,r=i.touches[0].clientY),{x:o,y:r}}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let e of t.composedPath()){if(e===this.target)break;if("hasAttribute"in e&&e.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.resizeObserver.disconnect(),this.endRipple()}}Ut.elementDefinitions={},Ut.styles=Rt,Mt([o({type:Boolean})],Ut.prototype,"primary",void 0),Mt([o({type:Boolean})],Ut.prototype,"secondary",void 0),Mt([o({type:Boolean})],Ut.prototype,"unbounded",void 0),Mt([o({type:Boolean})],Ut.prototype,"activated",void 0),Mt([o({type:Boolean})],Ut.prototype,"selected",void 0),Mt([o({type:Boolean})],Ut.prototype,"disabled",void 0),Mt([r()],Ut.prototype,"hovered",void 0),Mt([r()],Ut.prototype,"focused",void 0),Mt([r()],Ut.prototype,"pressed",void 0),Mt([r()],Ut.prototype,"rippling",void 0),Mt([r()],Ut.prototype,"rippleSize",void 0),Mt([r()],Ut.prototype,"originX",void 0),Mt([r()],Ut.prototype,"originY",void 0),Mt([s(".ft-ripple")],Ut.prototype,"ripple",void 0),Mt([s(".ft-ripple--effect")],Ut.prototype,"rippleEffect",void 0),a("ft-ripple")(Ut);
|
|
204
204
|
/**
|
|
205
205
|
* @license
|
|
206
206
|
* Copyright 2020 Google LLC
|
|
207
207
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
208
208
|
*/
|
|
209
|
-
const
|
|
209
|
+
const Ft=Symbol.for(""),At=t=>{if((null==t?void 0:t.r)===Ft)return null==t?void 0:t._$litStatic$},Bt=t=>({_$litStatic$:t,r:Ft}),zt=new Map,Lt=(t=>(e,...i)=>{const o=i.length;let r,s;const n=[],a=[];let l,h=0,c=!1;for(;h<o;){for(l=e[h];h<o&&void 0!==(s=i[h],r=At(s));)l+=r+e[++h],c=!0;a.push(s),n.push(l),h++}if(h===o&&n.push(e[o]),c){const t=n.join("$$lit$$");void 0===(e=zt.get(t))&&(n.raw=n,zt.set(t,e=n)),i=a}return t(e,...i)})(T);var Pt;!function(t){t.title="title",t.title_dense="title-dense",t.subtitle1="subtitle1",t.subtitle2="subtitle2",t.body1="body1",t.body2="body2",t.caption="caption",t.breadcrumb="breadcrumb",t.overline="overline",t.button="button"}(Pt||(Pt={}));const jt=lt.extend("--ft-typography-font-family",ht.titleFont),_t=lt.extend("--ft-typography-font-family",ht.contentFont),Dt={fontFamily:_t,fontSize:lt.create("--ft-typography-font-size","SIZE","16px"),fontWeight:lt.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:lt.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:lt.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:lt.create("--ft-typography-text-transform","UNKNOWN","inherit")},Tt=lt.extend("--ft-typography-title-font-family",jt),Wt=lt.extend("--ft-typography-title-font-size",Dt.fontSize,"20px"),Ht=lt.extend("--ft-typography-title-font-weight",Dt.fontWeight,"normal"),Kt=lt.extend("--ft-typography-title-letter-spacing",Dt.letterSpacing,"0.15px"),It=lt.extend("--ft-typography-title-line-height",Dt.lineHeight,"1.2"),Zt=lt.extend("--ft-typography-title-text-transform",Dt.textTransform,"inherit"),Vt=lt.extend("--ft-typography-title-dense-font-family",jt),Jt=lt.extend("--ft-typography-title-dense-font-size",Dt.fontSize,"14px"),Xt=lt.extend("--ft-typography-title-dense-font-weight",Dt.fontWeight,"normal"),qt=lt.extend("--ft-typography-title-dense-letter-spacing",Dt.letterSpacing,"0.105px"),Yt=lt.extend("--ft-typography-title-dense-line-height",Dt.lineHeight,"1.7"),Gt=lt.extend("--ft-typography-title-dense-text-transform",Dt.textTransform,"inherit"),Qt=lt.extend("--ft-typography-subtitle1-font-family",_t),te=lt.extend("--ft-typography-subtitle1-font-size",Dt.fontSize,"16px"),ee=lt.extend("--ft-typography-subtitle1-font-weight",Dt.fontWeight,"600"),ie=lt.extend("--ft-typography-subtitle1-letter-spacing",Dt.letterSpacing,"0.144px"),oe=lt.extend("--ft-typography-subtitle1-line-height",Dt.lineHeight,"1.5"),re=lt.extend("--ft-typography-subtitle1-text-transform",Dt.textTransform,"inherit"),se=lt.extend("--ft-typography-subtitle2-font-family",_t),ne=lt.extend("--ft-typography-subtitle2-font-size",Dt.fontSize,"14px"),ae=lt.extend("--ft-typography-subtitle2-font-weight",Dt.fontWeight,"normal"),le=lt.extend("--ft-typography-subtitle2-letter-spacing",Dt.letterSpacing,"0.098px"),he=lt.extend("--ft-typography-subtitle2-line-height",Dt.lineHeight,"1.7"),ce=lt.extend("--ft-typography-subtitle2-text-transform",Dt.textTransform,"inherit"),pe=lt.extend("--ft-typography-body1-font-family",_t),fe=lt.extend("--ft-typography-body1-font-size",Dt.fontSize,"16px"),de=lt.extend("--ft-typography-body1-font-weight",Dt.fontWeight,"normal"),ue=lt.extend("--ft-typography-body1-letter-spacing",Dt.letterSpacing,"0.496px"),ye=lt.extend("--ft-typography-body1-line-height",Dt.lineHeight,"1.5"),ge=lt.extend("--ft-typography-body1-text-transform",Dt.textTransform,"inherit"),be=lt.extend("--ft-typography-body2-font-family",_t),ve=lt.extend("--ft-typography-body2-font-size",Dt.fontSize,"14px"),me=lt.extend("--ft-typography-body2-font-weight",Dt.fontWeight,"normal"),xe=lt.extend("--ft-typography-body2-letter-spacing",Dt.letterSpacing,"0.252px"),we=lt.extend("--ft-typography-body2-line-height",Dt.lineHeight,"1.4"),$e=lt.extend("--ft-typography-body2-text-transform",Dt.textTransform,"inherit"),Oe=lt.extend("--ft-typography-caption-font-family",_t),ke=lt.extend("--ft-typography-caption-font-size",Dt.fontSize,"12px"),Se=lt.extend("--ft-typography-caption-font-weight",Dt.fontWeight,"normal"),Ne=lt.extend("--ft-typography-caption-letter-spacing",Dt.letterSpacing,"0.396px"),Ce=lt.extend("--ft-typography-caption-line-height",Dt.lineHeight,"1.33"),Ee=lt.extend("--ft-typography-caption-text-transform",Dt.textTransform,"inherit"),Re=lt.extend("--ft-typography-breadcrumb-font-family",_t),Me=lt.extend("--ft-typography-breadcrumb-font-size",Dt.fontSize,"10px"),Ue=lt.extend("--ft-typography-breadcrumb-font-weight",Dt.fontWeight,"normal"),Fe=lt.extend("--ft-typography-breadcrumb-letter-spacing",Dt.letterSpacing,"0.33px"),Ae=lt.extend("--ft-typography-breadcrumb-line-height",Dt.lineHeight,"1.6"),Be=lt.extend("--ft-typography-breadcrumb-text-transform",Dt.textTransform,"inherit"),ze=lt.extend("--ft-typography-overline-font-family",_t),Le=lt.extend("--ft-typography-overline-font-size",Dt.fontSize,"10px"),Pe=lt.extend("--ft-typography-overline-font-weight",Dt.fontWeight,"normal"),je=lt.extend("--ft-typography-overline-letter-spacing",Dt.letterSpacing,"1.5px"),_e=lt.extend("--ft-typography-overline-line-height",Dt.lineHeight,"1.6"),De=lt.extend("--ft-typography-overline-text-transform",Dt.textTransform,"uppercase"),Te=lt.extend("--ft-typography-button-font-family",_t),We=lt.extend("--ft-typography-button-font-size",Dt.fontSize,"14px"),He=lt.extend("--ft-typography-button-font-weight",Dt.fontWeight,"600"),Ke=lt.extend("--ft-typography-button-letter-spacing",Dt.letterSpacing,"1.246px"),Ie=lt.extend("--ft-typography-button-line-height",Dt.lineHeight,"1.15"),Ze=lt.extend("--ft-typography-button-text-transform",Dt.textTransform,"uppercase"),Ve=d`
|
|
210
210
|
.ft-typography--title {
|
|
211
211
|
font-family: ${Tt};
|
|
212
212
|
font-size: ${Wt};
|
|
@@ -297,18 +297,95 @@ const Ut=Symbol.for(""),Ft=t=>{if((null==t?void 0:t.r)===Ut)return null==t?void
|
|
|
297
297
|
line-height: ${Ie};
|
|
298
298
|
text-transform: ${Ze};
|
|
299
299
|
}
|
|
300
|
-
|
|
301
|
-
|
|
300
|
+
`,oi=d`
|
|
301
|
+
.ft-typography {
|
|
302
|
+
vertical-align: inherit;
|
|
303
|
+
}
|
|
304
|
+
`;var ri=function(t,e,i,o){for(var r,s=arguments.length,n=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};class si extends dt{constructor(){super(...arguments),this.variant=Pt.body1}render(){return this.element?Lt`
|
|
305
|
+
<${Bt(this.element)}
|
|
302
306
|
class="ft-typography ft-typography--${this.variant}">
|
|
303
307
|
<slot></slot>
|
|
304
|
-
</${
|
|
305
|
-
`:
|
|
308
|
+
</${Bt(this.element)}>
|
|
309
|
+
`:Lt`
|
|
306
310
|
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
307
|
-
`}}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
311
|
+
`}}si.styles=[Ve,Je,Xe,qe,Ye,Ge,Qe,ti,ei,ii,oi],ri([o()],si.prototype,"element",void 0),ri([o()],si.prototype,"variant",void 0),a("ft-typography")(si);const ni={textColor:lt.extend("--ft-checkbox-text-color",ht.colorOnSurfaceHigh),colorPrimary:lt.external(ht.colorPrimary,"Design system"),colorOnPrimary:lt.external(ht.colorOnPrimary,"Design system"),borderColor:lt.extend("--ft-checkbox-border-color",ht.colorOnSurfaceMedium),colorOnSurfaceDisabled:lt.external(ht.colorOnSurfaceDisabled,"Design system")},ai=d`
|
|
312
|
+
* {
|
|
313
|
+
box-sizing: border-box;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.ft-checkbox {
|
|
317
|
+
box-sizing: border-box;
|
|
318
|
+
color: ${ni.textColor};
|
|
319
|
+
|
|
320
|
+
display: inline-flex;
|
|
321
|
+
align-items: center;
|
|
322
|
+
gap: 4px;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.ft-checkbox--disabled {
|
|
326
|
+
color: ${ni.colorOnSurfaceDisabled};
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
input {
|
|
330
|
+
opacity: 0;
|
|
331
|
+
position: absolute;
|
|
332
|
+
width: 40px;
|
|
333
|
+
height: 40px;
|
|
334
|
+
margin: 0;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.ft-checkbox--box-container {
|
|
338
|
+
position: relative;
|
|
339
|
+
width: 40px;
|
|
340
|
+
height: 40px;
|
|
341
|
+
|
|
342
|
+
display: flex;
|
|
343
|
+
justify-content: center;
|
|
344
|
+
align-items: center;
|
|
345
|
+
flex-shrink: 0;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.ft-checkbox--box {
|
|
349
|
+
display: flex;
|
|
350
|
+
border: 2px solid ${ni.borderColor};
|
|
351
|
+
border-radius: 2px;
|
|
352
|
+
|
|
353
|
+
width: 18px;
|
|
354
|
+
height: 18px;
|
|
355
|
+
|
|
356
|
+
color: ${ni.colorOnPrimary};
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
.ft-checkbox--checked .ft-checkbox--box,
|
|
361
|
+
.ft-checkbox--indeterminate .ft-checkbox--box {
|
|
362
|
+
border-color: ${ni.colorPrimary};
|
|
363
|
+
background-color: ${ni.colorPrimary};
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.ft-checkbox--disabled .ft-checkbox--box {
|
|
367
|
+
border-color: ${ni.colorOnSurfaceDisabled};
|
|
368
|
+
background-color: transparent;
|
|
369
|
+
color: ${ni.colorOnSurfaceDisabled};
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.ft-checkbox--checkmark {
|
|
373
|
+
transition: opacity 180ms cubic-bezier(0, 0, 0.2, 1) 0ms, transform 180ms cubic-bezier(0, 0, 0.2, 1) 0ms;
|
|
374
|
+
opacity: 0;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.ft-checkbox--checkmark-path {
|
|
378
|
+
stroke-dashoffset: 0;
|
|
379
|
+
stroke: currentcolor;
|
|
380
|
+
stroke-width: 3px;
|
|
381
|
+
stroke-dasharray: 30;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.ft-checkbox--checked .ft-checkbox--checkmark,
|
|
385
|
+
.ft-checkbox--indeterminate .ft-checkbox--checkmark {
|
|
386
|
+
opacity: 1;
|
|
387
|
+
}
|
|
388
|
+
`;var li=function(t,e,i,o){for(var r,s=arguments.length,n=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};class hi extends dt{constructor(){super(...arguments),this.name="",this.checked=!1,this.indeterminate=!1,this.disabled=!1}render(){const t={"ft-checkbox":!0,"ft-checkbox--checked":this.checked,"ft-checkbox--indeterminate":this.indeterminate,"ft-checkbox--disabled":this.disabled};return T`
|
|
312
389
|
<label class="${yt(t)}" for="checkbox-input">
|
|
313
390
|
<div class="ft-checkbox--box-container">
|
|
314
391
|
<ft-ripple
|
|
@@ -334,81 +411,4 @@ const Ut=Symbol.for(""),Ft=t=>{if((null==t?void 0:t.r)===Ut)return null==t?void
|
|
|
334
411
|
<slot></slot>
|
|
335
412
|
</ft-typography>
|
|
336
413
|
</label>
|
|
337
|
-
`}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("change",{detail:this.checked}))}contentAvailableCallback(t){var e;super.contentAvailableCallback(t),null===(e=this.ripple)||void 0===e||e.setupFor(this.container)}}
|
|
338
|
-
* {
|
|
339
|
-
box-sizing: border-box;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
.ft-checkbox {
|
|
343
|
-
box-sizing: border-box;
|
|
344
|
-
color: ${si.textColor};
|
|
345
|
-
|
|
346
|
-
display: inline-flex;
|
|
347
|
-
align-items: center;
|
|
348
|
-
gap: 4px;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
.ft-checkbox--disabled {
|
|
352
|
-
color: ${si.colorOnSurfaceDisabled};
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
input {
|
|
356
|
-
opacity: 0;
|
|
357
|
-
position: absolute;
|
|
358
|
-
width: 40px;
|
|
359
|
-
height: 40px;
|
|
360
|
-
margin: 0;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
.ft-checkbox--box-container {
|
|
364
|
-
position: relative;
|
|
365
|
-
width: 40px;
|
|
366
|
-
height: 40px;
|
|
367
|
-
|
|
368
|
-
display: flex;
|
|
369
|
-
justify-content: center;
|
|
370
|
-
align-items: center;
|
|
371
|
-
flex-shrink: 0;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
.ft-checkbox--box {
|
|
375
|
-
display: flex;
|
|
376
|
-
border: 2px solid ${si.borderColor};
|
|
377
|
-
border-radius: 2px;
|
|
378
|
-
|
|
379
|
-
width: 18px;
|
|
380
|
-
height: 18px;
|
|
381
|
-
|
|
382
|
-
color: ${si.colorOnPrimary};
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
.ft-checkbox--checked .ft-checkbox--box,
|
|
387
|
-
.ft-checkbox--indeterminate .ft-checkbox--box {
|
|
388
|
-
border-color: ${si.colorPrimary};
|
|
389
|
-
background-color: ${si.colorPrimary};
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
.ft-checkbox--disabled .ft-checkbox--box {
|
|
393
|
-
border-color: ${si.colorOnSurfaceDisabled};
|
|
394
|
-
background-color: transparent;
|
|
395
|
-
color: ${si.colorOnSurfaceDisabled};
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
.ft-checkbox--checkmark {
|
|
399
|
-
transition: opacity 180ms cubic-bezier(0, 0, 0.2, 1) 0ms, transform 180ms cubic-bezier(0, 0, 0.2, 1) 0ms;
|
|
400
|
-
opacity: 0;
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
.ft-checkbox--checkmark-path {
|
|
404
|
-
stroke-dashoffset: 0;
|
|
405
|
-
stroke: currentcolor;
|
|
406
|
-
stroke-width: 3px;
|
|
407
|
-
stroke-dasharray: 30;
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
.ft-checkbox--checked .ft-checkbox--checkmark,
|
|
411
|
-
.ft-checkbox--indeterminate .ft-checkbox--checkmark {
|
|
412
|
-
opacity: 1;
|
|
413
|
-
}
|
|
414
|
-
`,ri([o()],ni.prototype,"name",void 0),ri([o({type:Boolean,reflect:!0})],ni.prototype,"checked",void 0),ri([o({type:Boolean})],ni.prototype,"indeterminate",void 0),ri([o({type:Boolean})],ni.prototype,"disabled",void 0),ri([s(".ft-checkbox")],ni.prototype,"container",void 0),ri([s("ft-ripple")],ni.prototype,"ripple",void 0),a("ft-checkbox")(ni),t.FtCheckbox=ni,t.FtCheckboxCssVariables=si,Object.defineProperty(t,"i",{value:!0})}({});
|
|
414
|
+
`}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("change",{detail:this.checked}))}contentAvailableCallback(t){var e;super.contentAvailableCallback(t),null===(e=this.ripple)||void 0===e||e.setupFor(this.container)}}hi.elementDefinitions={"ft-ripple":Ut,"ft-typography":si},hi.styles=ai,li([o()],hi.prototype,"name",void 0),li([o({type:Boolean,reflect:!0})],hi.prototype,"checked",void 0),li([o({type:Boolean})],hi.prototype,"indeterminate",void 0),li([o({type:Boolean})],hi.prototype,"disabled",void 0),li([s(".ft-checkbox")],hi.prototype,"container",void 0),li([s("ft-ripple")],hi.prototype,"ripple",void 0),a("ft-checkbox")(hi),t.FtCheckbox=hi,t.FtCheckboxCssVariables=ni,t.styles=ai,Object.defineProperty(t,"i",{value:!0})}({});
|
package/build/index.d.ts
CHANGED
package/build/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { customElement } from "@fluid-topics/ft-wc-utils";
|
|
2
2
|
import { FtCheckbox } from "./ft-checkbox";
|
|
3
3
|
export * from "./ft-checkbox";
|
|
4
|
+
export * from "./ft-checkbox.css";
|
|
5
|
+
export * from "./ft-checkbox.properties";
|
|
4
6
|
customElement("ft-checkbox")(FtCheckbox);
|
|
5
7
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-checkbox",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.14",
|
|
4
4
|
"description": "A checkbox component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-ripple": "0.3.
|
|
23
|
-
"@fluid-topics/ft-typography": "0.3.
|
|
24
|
-
"@fluid-topics/ft-wc-utils": "0.3.
|
|
22
|
+
"@fluid-topics/ft-ripple": "0.3.14",
|
|
23
|
+
"@fluid-topics/ft-typography": "0.3.14",
|
|
24
|
+
"@fluid-topics/ft-wc-utils": "0.3.14",
|
|
25
25
|
"lit": "2.2.8"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "46cc9dd160b2f3189a2e581a8237e962f1ae464d"
|
|
28
28
|
}
|