@fluid-topics/ft-checkbox 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -0
- package/build/ft-checkbox.d.ts +29 -0
- package/build/ft-checkbox.inline-styles.js +402 -0
- package/build/ft-checkbox.js +174 -0
- package/build/ft-checkbox.light.js +308 -0
- package/build/ft-checkbox.min.js +397 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +5 -0
- package/build/inline-styles.d.ts +2 -0
- package/build/inline-styles.js +4 -0
- package/package.json +28 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { css, html } from "lit";
|
|
8
|
+
import { property, query } from "lit/decorators.js";
|
|
9
|
+
import { designSystemVariables, FtCssVariable, FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
10
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
11
|
+
import { FtRipple } from "@fluid-topics/ft-ripple";
|
|
12
|
+
import { FtTypography } from "@fluid-topics/ft-typography";
|
|
13
|
+
export const FtCheckboxCssVariables = {
|
|
14
|
+
textColor: FtCssVariable.extend("--ft-checkbox-text-color", designSystemVariables.colorOnSurfaceHigh),
|
|
15
|
+
colorPrimary: FtCssVariable.external(designSystemVariables.colorPrimary, "Design system"),
|
|
16
|
+
colorOnPrimary: FtCssVariable.external(designSystemVariables.colorOnPrimary, "Design system"),
|
|
17
|
+
borderColor: FtCssVariable.extend("--ft-checkbox-border-color", designSystemVariables.colorOnSurfaceMedium),
|
|
18
|
+
colorOnSurfaceDisabled: FtCssVariable.external(designSystemVariables.colorOnSurfaceDisabled, "Design system"),
|
|
19
|
+
};
|
|
20
|
+
export class FtCheckbox extends FtLitElement {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
this.name = "";
|
|
24
|
+
this.checked = false;
|
|
25
|
+
this.indeterminate = false;
|
|
26
|
+
this.disabled = false;
|
|
27
|
+
}
|
|
28
|
+
render() {
|
|
29
|
+
const classes = {
|
|
30
|
+
"ft-checkbox": true,
|
|
31
|
+
"ft-checkbox--checked": this.checked,
|
|
32
|
+
"ft-checkbox--indeterminate": this.indeterminate,
|
|
33
|
+
"ft-checkbox--disabled": this.disabled,
|
|
34
|
+
};
|
|
35
|
+
return html `
|
|
36
|
+
<label class="${classMap(classes)}">
|
|
37
|
+
<div class="ft-checkbox--box-container">
|
|
38
|
+
<input type="checkbox"
|
|
39
|
+
name=${this.name}
|
|
40
|
+
.checked=${this.checked}
|
|
41
|
+
.disabled=${this.disabled}
|
|
42
|
+
@change=${this.onChange}
|
|
43
|
+
>
|
|
44
|
+
<ft-ripple
|
|
45
|
+
?disabled=${this.disabled}
|
|
46
|
+
?primary=${this.checked || this.indeterminate}
|
|
47
|
+
unbounded>
|
|
48
|
+
</ft-ripple>
|
|
49
|
+
<div class="ft-checkbox--box">
|
|
50
|
+
<svg class="ft-checkbox--checkmark" viewBox="0 0 24 24">
|
|
51
|
+
<path class="ft-checkbox--checkmark-path" fill="none"
|
|
52
|
+
d=${(this.indeterminate && !this.checked) ? "M2,12 22,12" : "M1.73,12.91 8.1,19.28 22.79,4.59"}></path>
|
|
53
|
+
</svg>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
<ft-typography variant="body2">
|
|
57
|
+
<slot></slot>
|
|
58
|
+
</ft-typography>
|
|
59
|
+
</label>
|
|
60
|
+
`;
|
|
61
|
+
}
|
|
62
|
+
onChange(event) {
|
|
63
|
+
event.stopPropagation();
|
|
64
|
+
this.checked = event.target.checked;
|
|
65
|
+
this.indeterminate = false;
|
|
66
|
+
this.dispatchEvent(new CustomEvent("change", { detail: this.checked }));
|
|
67
|
+
}
|
|
68
|
+
contentAvailableCallback(props) {
|
|
69
|
+
var _a;
|
|
70
|
+
super.contentAvailableCallback(props);
|
|
71
|
+
(_a = this.ripple) === null || _a === void 0 ? void 0 : _a.setupFor(this.container);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
FtCheckbox.elementDefinitions = {
|
|
75
|
+
"ft-ripple": FtRipple,
|
|
76
|
+
"ft-typography": FtTypography
|
|
77
|
+
};
|
|
78
|
+
// language=CSS
|
|
79
|
+
FtCheckbox.styles = css `
|
|
80
|
+
* {
|
|
81
|
+
box-sizing: border-box;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.ft-checkbox {
|
|
85
|
+
box-sizing: border-box;
|
|
86
|
+
color: ${FtCheckboxCssVariables.textColor};
|
|
87
|
+
|
|
88
|
+
display: inline-flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
gap: 4px;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.ft-checkbox--disabled {
|
|
94
|
+
color: ${FtCheckboxCssVariables.colorOnSurfaceDisabled};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
input {
|
|
98
|
+
opacity: 0;
|
|
99
|
+
position: absolute;
|
|
100
|
+
width: 40px;
|
|
101
|
+
height: 40px;
|
|
102
|
+
margin: 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.ft-checkbox--box-container {
|
|
106
|
+
position: relative;
|
|
107
|
+
width: 40px;
|
|
108
|
+
height: 40px;
|
|
109
|
+
|
|
110
|
+
display: flex;
|
|
111
|
+
justify-content: center;
|
|
112
|
+
align-items: center;
|
|
113
|
+
flex-shrink: 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.ft-checkbox--box {
|
|
117
|
+
border: 2px solid ${FtCheckboxCssVariables.borderColor};
|
|
118
|
+
border-radius: 2px;
|
|
119
|
+
|
|
120
|
+
width: 18px;
|
|
121
|
+
height: 18px;
|
|
122
|
+
|
|
123
|
+
color: ${FtCheckboxCssVariables.colorOnPrimary};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
.ft-checkbox--checked .ft-checkbox--box,
|
|
128
|
+
.ft-checkbox--indeterminate .ft-checkbox--box {
|
|
129
|
+
border-color: ${FtCheckboxCssVariables.colorPrimary};
|
|
130
|
+
background-color: ${FtCheckboxCssVariables.colorPrimary};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.ft-checkbox--disabled .ft-checkbox--box {
|
|
134
|
+
border-color: ${FtCheckboxCssVariables.colorOnSurfaceDisabled};
|
|
135
|
+
background-color: transparent;
|
|
136
|
+
color: ${FtCheckboxCssVariables.colorOnSurfaceDisabled};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.ft-checkbox--checkmark {
|
|
140
|
+
transition: opacity 180ms cubic-bezier(0, 0, 0.2, 1) 0ms, transform 180ms cubic-bezier(0, 0, 0.2, 1) 0ms;
|
|
141
|
+
opacity: 0;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.ft-checkbox--checkmark-path {
|
|
145
|
+
stroke-dashoffset: 0;
|
|
146
|
+
stroke: currentcolor;
|
|
147
|
+
stroke-width: 3px;
|
|
148
|
+
stroke-dasharray: 30;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.ft-checkbox--checked .ft-checkbox--checkmark,
|
|
152
|
+
.ft-checkbox--indeterminate .ft-checkbox--checkmark {
|
|
153
|
+
opacity: 1;
|
|
154
|
+
}
|
|
155
|
+
`;
|
|
156
|
+
__decorate([
|
|
157
|
+
property()
|
|
158
|
+
], FtCheckbox.prototype, "name", void 0);
|
|
159
|
+
__decorate([
|
|
160
|
+
property({ type: Boolean })
|
|
161
|
+
], FtCheckbox.prototype, "checked", void 0);
|
|
162
|
+
__decorate([
|
|
163
|
+
property({ type: Boolean })
|
|
164
|
+
], FtCheckbox.prototype, "indeterminate", void 0);
|
|
165
|
+
__decorate([
|
|
166
|
+
property({ type: Boolean })
|
|
167
|
+
], FtCheckbox.prototype, "disabled", void 0);
|
|
168
|
+
__decorate([
|
|
169
|
+
query(".ft-checkbox")
|
|
170
|
+
], FtCheckbox.prototype, "container", void 0);
|
|
171
|
+
__decorate([
|
|
172
|
+
query("ft-ripple")
|
|
173
|
+
], FtCheckbox.prototype, "ripple", void 0);
|
|
174
|
+
//# sourceMappingURL=ft-checkbox.js.map
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
!function(t,i,e,o,s){var r=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};const n=i.FtCssVariable.extend("--ft-ripple-color",i.designSystemVariables.colorContent),h=i.FtCssVariable.extend("--ft-ripple-primary-color",i.FtCssVariable.extend("--ft-ripple-color",i.designSystemVariables.colorPrimary)),p=i.FtCssVariable.extend("--ft-ripple-secondary-color",i.FtCssVariable.extend("--ft-ripple-color",i.designSystemVariables.colorSecondary)),l=i.FtCssVariable.external(i.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),a=i.FtCssVariable.external(i.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),f=i.FtCssVariable.external(i.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),c=i.FtCssVariable.external(i.designSystemVariables.opacityContentOnSurfaceSelected,"Design system");class y 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.onTransitionStart=t=>{"transform"===t.propertyName&&(this.rippling=this.pressed)},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
|
+
<style>
|
|
3
|
+
.ft-ripple .ft-ripple--effect,
|
|
4
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
5
|
+
width: ${this.rippleSize}px;
|
|
6
|
+
height: ${this.rippleSize}px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.ft-ripple .ft-ripple--effect {
|
|
10
|
+
left: ${this.originX}px;
|
|
11
|
+
top: ${this.originY}px;
|
|
12
|
+
}
|
|
13
|
+
</style>
|
|
14
|
+
<div class="${s.classMap(t)}">
|
|
15
|
+
<div class="ft-ripple--background"></div>
|
|
16
|
+
<div class="ft-ripple--effect"></div>
|
|
17
|
+
</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){super.updated(t),t.has("disabled")&&this.disabled&&this.endRipple(),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 d;y.elementDefinitions={},y.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
|
+
background-color: ${n};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ft-ripple.ft-ripple--secondary .ft-ripple--background,
|
|
47
|
+
.ft-ripple.ft-ripple--secondary .ft-ripple--effect {
|
|
48
|
+
background-color: ${p};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.ft-ripple.ft-ripple--primary .ft-ripple--background,
|
|
52
|
+
.ft-ripple.ft-ripple--primary .ft-ripple--effect {
|
|
53
|
+
background-color: ${h};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.ft-ripple .ft-ripple--background {
|
|
57
|
+
top: 0;
|
|
58
|
+
left: 0;
|
|
59
|
+
height: 100%;
|
|
60
|
+
width: 100%;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.ft-ripple .ft-ripple--effect,
|
|
64
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
65
|
+
border-radius: 50%;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.ft-ripple .ft-ripple--effect {
|
|
69
|
+
transform: translate(-50%, -50%) scale(0.15);
|
|
70
|
+
transition: transform 300ms ease, opacity 75ms linear;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--effect,
|
|
74
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
75
|
+
left: 50%;
|
|
76
|
+
top: 50%;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
80
|
+
transform: translate(-50%, -50%);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.ft-ripple.ft-ripple--hovered .ft-ripple--background {
|
|
84
|
+
opacity: ${a};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.ft-ripple.ft-ripple--selected .ft-ripple--background {
|
|
88
|
+
opacity: ${c};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.ft-ripple.ft-ripple--focused .ft-ripple--background {
|
|
92
|
+
opacity: ${f};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.ft-ripple.ft-ripple--pressed .ft-ripple--effect {
|
|
96
|
+
opacity: ${l};
|
|
97
|
+
transform: translate(-50%, -50%) scale(1);
|
|
98
|
+
}
|
|
99
|
+
`,r([o.property({type:Boolean})],y.prototype,"primary",void 0),r([o.property({type:Boolean})],y.prototype,"secondary",void 0),r([o.property({type:Boolean})],y.prototype,"unbounded",void 0),r([o.property({type:Boolean})],y.prototype,"activated",void 0),r([o.property({type:Boolean})],y.prototype,"selected",void 0),r([o.property({type:Boolean})],y.prototype,"disabled",void 0),r([o.state()],y.prototype,"hovered",void 0),r([o.state()],y.prototype,"focused",void 0),r([o.state()],y.prototype,"pressed",void 0),r([o.state()],y.prototype,"rippling",void 0),r([o.state()],y.prototype,"rippleSize",void 0),r([o.state()],y.prototype,"originX",void 0),r([o.state()],y.prototype,"originY",void 0),r([o.query(".ft-ripple")],y.prototype,"ripple",void 0),r([o.query(".ft-ripple--effect")],y.prototype,"rippleEffect",void 0),i.customElement("ft-ripple")(y);const g=globalThis.trustedTypes,u=g?g.createPolicy("lit-html",{createHTML:t=>t}):void 0,b=`lit$${(Math.random()+"").slice(9)}$`,v="?"+b,m=`<${v}>`,x=document,$=(t="")=>x.createComment(t),k=t=>null===t||"object"!=typeof t&&"function"!=typeof t,w=Array.isArray,z=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,A=/-->/g,_=/>/g,S=/>|[ \n\r](?:([^\s"'>=/]+)([ \n\r]*=[ \n\r]*(?:[^ \n\r"'`<>=]|("|')|))|$)/g,C=/'/g,O=/"/g,M=/^(?:script|style|textarea|title)$/i,N=(t=>(i,...e)=>({_$litType$:t,strings:i,values:e}))(1),B=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),j=new WeakMap,T=x.createTreeWalker(x,129,null,!1),D=(t,i)=>{const e=t.length-1,o=[];let s,r=2===i?"<svg>":"",n=z;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===z?"!--"===p[1]?n=A:void 0!==p[1]?n=_:void 0!==p[2]?(M.test(p[2])&&(s=RegExp("</"+p[2],"g")),n=S):void 0!==p[3]&&(n=S):n===S?">"===p[0]?(n=null!=s?s:z,l=-1):void 0===p[1]?l=-2:(l=n.lastIndex-p[2].length,h=p[1],n=void 0===p[3]?S:'"'===p[3]?O:C):n===O||n===C?n=S:n===A||n===_?n=z:(n=S,s=void 0);const f=n===S&&t[i+1].startsWith("/>")?" ":"";r+=n===z?e+m:l>=0?(o.push(h),e.slice(0,l)+"$lit$"+e.slice(l)+b+f):e+b+(-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!==u?u.createHTML(h):h,o]};class I{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]=D(t,i);if(this.el=I.createElement(p,e),T.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(o=T.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(b)){const e=l[r++];if(t.push(i),void 0!==e){const t=o.getAttribute(e.toLowerCase()+"$lit$").split(b),i=/([.?@])?(.*)/.exec(e);h.push({type:1,index:s,name:i[2],strings:t,ctor:"."===i[1]?W:"?"===i[1]?H:"@"===i[1]?K:G})}else h.push({type:6,index:s})}for(const i of t)o.removeAttribute(i)}if(M.test(o.tagName)){const t=o.textContent.split(b),i=t.length-1;if(i>0){o.textContent=g?g.emptyScript:"";for(let e=0;e<i;e++)o.append(t[e],$()),T.nextNode(),h.push({type:2,index:++s});o.append(t[i],$())}}}else if(8===o.nodeType)if(o.data===v)h.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(b,t+1));)h.push({type:7,index:s}),t+=b.length-1}s++}}static createElement(t,i){const e=x.createElement("template");return e.innerHTML=t,e}}function U(t,i,e=t,o){var s,r,n,h;if(i===B)return i;let p=void 0!==o?null===(s=e._$Cl)||void 0===s?void 0:s[o]:e._$Cu;const l=k(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=U(t,p._$AS(t,i.values),p,o)),i}class R{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:x).importNode(e,!0);T.currentNode=s;let r=T.nextNode(),n=0,h=0,p=o[0];for(;void 0!==p;){if(n===p.index){let i;2===p.type?i=new Z(r,r.nextSibling,this,t):1===p.type?i=new p.ctor(r,p.name,p.strings,this,t):6===p.type&&(i=new P(r,this,t)),this.v.push(i),p=o[++h]}n!==(null==p?void 0:p.index)&&(r=T.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 Z{constructor(t,i,e,o){var s;this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=e,this.options=o,this._$Cg=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._$Cg}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=U(this,t,i),k(t)?t===E||null==t||""===t?(this._$AH!==E&&this._$AR(),this._$AH=E):t!==this._$AH&&t!==B&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.S(t):(t=>{var i;return w(t)||"function"==typeof(null===(i=t)||void 0===i?void 0:i[Symbol.iterator])})(t)?this.A(t):this.$(t)}M(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}S(t){this._$AH!==t&&(this._$AR(),this._$AH=this.M(t))}$(t){this._$AH!==E&&k(this._$AH)?this._$AA.nextSibling.data=t:this.S(x.createTextNode(t)),this._$AH=t}T(t){var i;const{values:e,_$litType$:o}=t,s="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=I.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 R(s,this),i=t.p(this.options);t.m(e),this.S(i),this._$AH=t}}_$AC(t){let i=j.get(t.strings);return void 0===i&&j.set(t.strings,i=new I(t)),i}A(t){w(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 Z(this.M($()),this.M($()),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._$Cg=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class G{constructor(t,i,e,o,s){this.type=1,this._$AH=E,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=E}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=U(this,t,i,0),r=!k(t)||t!==this._$AH&&t!==B,r&&(this._$AH=t);else{const o=t;let n,h;for(t=s[0],n=0;n<s.length-1;n++)h=U(this,o[e+n],i,n),h===B&&(h=this._$AH[n]),r||(r=!k(h)||h!==this._$AH[n]),h===E?t=E:t!==E&&(t+=(null!=h?h:"")+s[n+1]),this._$AH[n]=h}r&&!o&&this.k(t)}k(t){t===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class W extends G{constructor(){super(...arguments),this.type=3}k(t){this.element[this.name]=t===E?void 0:t}}const F=g?g.emptyScript:"";class H extends G{constructor(){super(...arguments),this.type=4}k(t){t&&t!==E?this.element.setAttribute(this.name,F):this.element.removeAttribute(this.name)}}class K extends G{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=U(this,t,i,0))&&void 0!==e?e:E)===B)return;const o=this._$AH,s=t===E&&o!==E||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,r=t!==E&&(o===E||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 P{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){U(this,t)}}const L=window.litHtmlPolyfillSupport;null==L||L(I,Z),(null!==(d=globalThis.litHtmlVersions)&&void 0!==d?d:globalThis.litHtmlVersions=[]).push("2.1.3");
|
|
100
|
+
/**
|
|
101
|
+
* @license
|
|
102
|
+
* Copyright 2020 Google LLC
|
|
103
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
104
|
+
*/
|
|
105
|
+
const X=t=>({_$litStatic$:t}),Y=new Map,q=(t=>(i,...e)=>{var o;const s=e.length;let r,n;const h=[],p=[];let l,a=0,f=!1;for(;a<s;){for(l=i[a];a<s&&void 0!==(n=e[a],r=null===(o=n)||void 0===o?void 0:o._$litStatic$);)l+=r+i[++a],f=!0;p.push(n),h.push(l),a++}if(a===s&&h.push(i[s]),f){const t=h.join("$$lit$$");void 0===(i=Y.get(t))&&(h.raw=h,Y.set(t,i=h)),e=p}return t(i,...e)})(N);var J,Q=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};!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"}(J||(J={}));const V=i.FtCssVariable.extend("--ft-typography-font-family",i.designSystemVariables.titleFont),tt=i.FtCssVariable.extend("--ft-typography-font-family",i.designSystemVariables.contentFont),it={fontFamily:tt,fontSize:i.FtCssVariable.create("--ft-typography-font-size","SIZE","16px"),fontWeight:i.FtCssVariable.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:i.FtCssVariable.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:i.FtCssVariable.create("--ft-typography-line-height","SIZE","24px"),textTransform:i.FtCssVariable.create("--ft-typography-text-transform","UNKNOWN","inherit")},et=i.FtCssVariable.extend("--ft-typography-title-font-family",V),ot=i.FtCssVariable.extend("--ft-typography-title-font-size",it.fontSize,"20px"),st=i.FtCssVariable.extend("--ft-typography-title-font-weight",it.fontWeight,"normal"),rt=i.FtCssVariable.extend("--ft-typography-title-letter-spacing",it.letterSpacing,"0.15px"),nt=i.FtCssVariable.extend("--ft-typography-title-line-height",it.lineHeight,"24px"),ht=i.FtCssVariable.extend("--ft-typography-title-text-transform",it.textTransform,"inherit"),pt=i.FtCssVariable.extend("--ft-typography-title-dense-font-family",V),lt=i.FtCssVariable.extend("--ft-typography-title-dense-font-size",it.fontSize,"14px"),at=i.FtCssVariable.extend("--ft-typography-title-dense-font-weight",it.fontWeight,"normal"),ft=i.FtCssVariable.extend("--ft-typography-title-dense-letter-spacing",it.letterSpacing,"0.105px"),ct=i.FtCssVariable.extend("--ft-typography-title-dense-line-height",it.lineHeight,"24px"),yt=i.FtCssVariable.extend("--ft-typography-title-dense-text-transform",it.textTransform,"inherit"),dt=i.FtCssVariable.extend("--ft-typography-subtitle1-font-family",tt),gt=i.FtCssVariable.extend("--ft-typography-subtitle1-font-size",it.fontSize,"16px"),ut=i.FtCssVariable.extend("--ft-typography-subtitle1-font-weight",it.fontWeight,"600"),bt=i.FtCssVariable.extend("--ft-typography-subtitle1-letter-spacing",it.letterSpacing,"0.144px"),vt=i.FtCssVariable.extend("--ft-typography-subtitle1-line-height",it.lineHeight,"24px"),mt=i.FtCssVariable.extend("--ft-typography-subtitle1-text-transform",it.textTransform,"inherit"),xt=i.FtCssVariable.extend("--ft-typography-subtitle2-font-family",tt),$t=i.FtCssVariable.extend("--ft-typography-subtitle2-font-size",it.fontSize,"14px"),kt=i.FtCssVariable.extend("--ft-typography-subtitle2-font-weight",it.fontWeight,"normal"),wt=i.FtCssVariable.extend("--ft-typography-subtitle2-letter-spacing",it.letterSpacing,"0.098px"),zt=i.FtCssVariable.extend("--ft-typography-subtitle2-line-height",it.lineHeight,"24px"),At=i.FtCssVariable.extend("--ft-typography-subtitle2-text-transform",it.textTransform,"inherit"),_t=i.FtCssVariable.extend("--ft-typography-body1-font-family",tt),St=i.FtCssVariable.extend("--ft-typography-body1-font-size",it.fontSize,"16px"),Ct=i.FtCssVariable.extend("--ft-typography-body1-font-weight",it.fontWeight,"normal"),Ot=i.FtCssVariable.extend("--ft-typography-body1-letter-spacing",it.letterSpacing,"0.496px"),Mt=i.FtCssVariable.extend("--ft-typography-body1-line-height",it.lineHeight,"24px"),Nt=i.FtCssVariable.extend("--ft-typography-body1-text-transform",it.textTransform,"inherit"),Bt=i.FtCssVariable.extend("--ft-typography-body2-font-family",tt),Et=i.FtCssVariable.extend("--ft-typography-body2-font-size",it.fontSize,"14px"),jt=i.FtCssVariable.extend("--ft-typography-body2-font-weight",it.fontWeight,"normal"),Tt=i.FtCssVariable.extend("--ft-typography-body2-letter-spacing",it.letterSpacing,"0.252px"),Dt=i.FtCssVariable.extend("--ft-typography-body2-line-height",it.lineHeight,"20px"),It=i.FtCssVariable.extend("--ft-typography-body2-text-transform",it.textTransform,"inherit"),Ut=i.FtCssVariable.extend("--ft-typography-caption-font-family",tt),Rt=i.FtCssVariable.extend("--ft-typography-caption-font-size",it.fontSize,"12px"),Zt=i.FtCssVariable.extend("--ft-typography-caption-font-weight",it.fontWeight,"normal"),Gt=i.FtCssVariable.extend("--ft-typography-caption-letter-spacing",it.letterSpacing,"0.396px"),Wt=i.FtCssVariable.extend("--ft-typography-caption-line-height",it.lineHeight,"16px"),Ft=i.FtCssVariable.extend("--ft-typography-caption-text-transform",it.textTransform,"inherit"),Ht=i.FtCssVariable.extend("--ft-typography-breadcrumb-font-family",tt),Kt=i.FtCssVariable.extend("--ft-typography-breadcrumb-font-size",it.fontSize,"10px"),Pt=i.FtCssVariable.extend("--ft-typography-breadcrumb-font-weight",it.fontWeight,"normal"),Lt=i.FtCssVariable.extend("--ft-typography-breadcrumb-letter-spacing",it.letterSpacing,"0.33px"),Xt=i.FtCssVariable.extend("--ft-typography-breadcrumb-line-height",it.lineHeight,"16px"),Yt=i.FtCssVariable.extend("--ft-typography-breadcrumb-text-transform",it.textTransform,"inherit"),qt=i.FtCssVariable.extend("--ft-typography-overline-font-family",tt),Jt=i.FtCssVariable.extend("--ft-typography-overline-font-size",it.fontSize,"10px"),Qt=i.FtCssVariable.extend("--ft-typography-overline-font-weight",it.fontWeight,"normal"),Vt=i.FtCssVariable.extend("--ft-typography-overline-letter-spacing",it.letterSpacing,"1.5px"),ti=i.FtCssVariable.extend("--ft-typography-overline-line-height",it.lineHeight,"16px"),ii=i.FtCssVariable.extend("--ft-typography-overline-text-transform",it.textTransform,"uppercase"),ei=i.FtCssVariable.extend("--ft-typography-button-font-family",tt),oi=i.FtCssVariable.extend("--ft-typography-button-font-size",it.fontSize,"14px"),si=i.FtCssVariable.extend("--ft-typography-button-font-weight",it.fontWeight,"600"),ri=i.FtCssVariable.extend("--ft-typography-button-letter-spacing",it.letterSpacing,"1.246px"),ni=i.FtCssVariable.extend("--ft-typography-button-line-height",it.lineHeight,"16px"),hi=i.FtCssVariable.extend("--ft-typography-button-text-transform",it.textTransform,"uppercase"),pi=e.css`
|
|
106
|
+
.ft-typography--title {
|
|
107
|
+
font-family: ${et};
|
|
108
|
+
font-size: ${ot};
|
|
109
|
+
font-weight: ${st};
|
|
110
|
+
letter-spacing: ${rt};
|
|
111
|
+
line-height: ${nt};
|
|
112
|
+
text-transform: ${ht};
|
|
113
|
+
}
|
|
114
|
+
`,li=e.css`
|
|
115
|
+
.ft-typography--title-dense {
|
|
116
|
+
font-family: ${pt};
|
|
117
|
+
font-size: ${lt};
|
|
118
|
+
font-weight: ${at};
|
|
119
|
+
letter-spacing: ${ft};
|
|
120
|
+
line-height: ${ct};
|
|
121
|
+
text-transform: ${yt};
|
|
122
|
+
}
|
|
123
|
+
`,ai=e.css`
|
|
124
|
+
.ft-typography--subtitle1 {
|
|
125
|
+
font-family: ${dt};
|
|
126
|
+
font-size: ${gt};
|
|
127
|
+
font-weight: ${ut};
|
|
128
|
+
letter-spacing: ${bt};
|
|
129
|
+
line-height: ${vt};
|
|
130
|
+
text-transform: ${mt};
|
|
131
|
+
}
|
|
132
|
+
`,fi=e.css`
|
|
133
|
+
.ft-typography--subtitle2 {
|
|
134
|
+
font-family: ${xt};
|
|
135
|
+
font-size: ${$t};
|
|
136
|
+
font-weight: ${kt};
|
|
137
|
+
letter-spacing: ${wt};
|
|
138
|
+
line-height: ${zt};
|
|
139
|
+
text-transform: ${At};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
`,ci=e.css`
|
|
143
|
+
.ft-typography--body1 {
|
|
144
|
+
font-family: ${_t};
|
|
145
|
+
font-size: ${St};
|
|
146
|
+
font-weight: ${Ct};
|
|
147
|
+
letter-spacing: ${Ot};
|
|
148
|
+
line-height: ${Mt};
|
|
149
|
+
text-transform: ${Nt};
|
|
150
|
+
}
|
|
151
|
+
`,yi=e.css`
|
|
152
|
+
.ft-typography--body2 {
|
|
153
|
+
font-family: ${Bt};
|
|
154
|
+
font-size: ${Et};
|
|
155
|
+
font-weight: ${jt};
|
|
156
|
+
letter-spacing: ${Tt};
|
|
157
|
+
line-height: ${Dt};
|
|
158
|
+
text-transform: ${It};
|
|
159
|
+
}
|
|
160
|
+
`,di=e.css`
|
|
161
|
+
.ft-typography--caption {
|
|
162
|
+
font-family: ${Ut};
|
|
163
|
+
font-size: ${Rt};
|
|
164
|
+
font-weight: ${Zt};
|
|
165
|
+
letter-spacing: ${Gt};
|
|
166
|
+
line-height: ${Wt};
|
|
167
|
+
text-transform: ${Ft};
|
|
168
|
+
}
|
|
169
|
+
`,gi=e.css`
|
|
170
|
+
.ft-typography--breadcrumb {
|
|
171
|
+
font-family: ${Ht};
|
|
172
|
+
font-size: ${Kt};
|
|
173
|
+
font-weight: ${Pt};
|
|
174
|
+
letter-spacing: ${Lt};
|
|
175
|
+
line-height: ${Xt};
|
|
176
|
+
text-transform: ${Yt};
|
|
177
|
+
}
|
|
178
|
+
`,ui=e.css`
|
|
179
|
+
.ft-typography--overline {
|
|
180
|
+
font-family: ${qt};
|
|
181
|
+
font-size: ${Jt};
|
|
182
|
+
font-weight: ${Qt};
|
|
183
|
+
letter-spacing: ${Vt};
|
|
184
|
+
line-height: ${ti};
|
|
185
|
+
text-transform: ${ii};
|
|
186
|
+
}
|
|
187
|
+
`,bi=e.css`
|
|
188
|
+
.ft-typography--button {
|
|
189
|
+
font-family: ${ei};
|
|
190
|
+
font-size: ${oi};
|
|
191
|
+
font-weight: ${si};
|
|
192
|
+
letter-spacing: ${ri};
|
|
193
|
+
line-height: ${ni};
|
|
194
|
+
text-transform: ${hi};
|
|
195
|
+
}
|
|
196
|
+
`;class vi extends i.FtLitElement{constructor(){super(...arguments),this.variant=J.body1}render(){return this.element?q`
|
|
197
|
+
<${X(this.element)}
|
|
198
|
+
class="ft-typography ft-typography--${this.variant}">
|
|
199
|
+
<slot></slot>
|
|
200
|
+
</${X(this.element)}>
|
|
201
|
+
`:q`
|
|
202
|
+
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
203
|
+
`}}vi.styles=[pi,li,ai,fi,ci,yi,di,gi,ui,bi,e.css`
|
|
204
|
+
.ft-typography {
|
|
205
|
+
vertical-align: inherit;
|
|
206
|
+
}
|
|
207
|
+
`],Q([o.property()],vi.prototype,"element",void 0),Q([o.property()],vi.prototype,"variant",void 0),i.customElement("ft-typography")(vi);var mi=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};const xi={textColor:i.FtCssVariable.extend("--ft-checkbox-text-color",i.designSystemVariables.colorOnSurfaceHigh),colorPrimary:i.FtCssVariable.external(i.designSystemVariables.colorPrimary,"Design system"),colorOnPrimary:i.FtCssVariable.external(i.designSystemVariables.colorOnPrimary,"Design system"),borderColor:i.FtCssVariable.extend("--ft-checkbox-border-color",i.designSystemVariables.colorOnSurfaceMedium),colorOnSurfaceDisabled:i.FtCssVariable.external(i.designSystemVariables.colorOnSurfaceDisabled,"Design system")};class $i 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`
|
|
208
|
+
<label class="${s.classMap(t)}">
|
|
209
|
+
<div class="ft-checkbox--box-container">
|
|
210
|
+
<input type="checkbox"
|
|
211
|
+
name=${this.name}
|
|
212
|
+
.checked=${this.checked}
|
|
213
|
+
.disabled=${this.disabled}
|
|
214
|
+
@change=${this.onChange}
|
|
215
|
+
>
|
|
216
|
+
<ft-ripple
|
|
217
|
+
?disabled=${this.disabled}
|
|
218
|
+
?primary=${this.checked||this.indeterminate}
|
|
219
|
+
unbounded>
|
|
220
|
+
</ft-ripple>
|
|
221
|
+
<div class="ft-checkbox--box">
|
|
222
|
+
<svg class="ft-checkbox--checkmark" viewBox="0 0 24 24">
|
|
223
|
+
<path class="ft-checkbox--checkmark-path" fill="none"
|
|
224
|
+
d=${this.indeterminate&&!this.checked?"M2,12 22,12":"M1.73,12.91 8.1,19.28 22.79,4.59"}></path>
|
|
225
|
+
</svg>
|
|
226
|
+
</div>
|
|
227
|
+
</div>
|
|
228
|
+
<ft-typography variant="body2">
|
|
229
|
+
<slot></slot>
|
|
230
|
+
</ft-typography>
|
|
231
|
+
</label>
|
|
232
|
+
`}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)}}$i.elementDefinitions={"ft-ripple":y,"ft-typography":vi},$i.styles=e.css`
|
|
233
|
+
* {
|
|
234
|
+
box-sizing: border-box;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.ft-checkbox {
|
|
238
|
+
box-sizing: border-box;
|
|
239
|
+
color: ${xi.textColor};
|
|
240
|
+
|
|
241
|
+
display: inline-flex;
|
|
242
|
+
align-items: center;
|
|
243
|
+
gap: 4px;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.ft-checkbox--disabled {
|
|
247
|
+
color: ${xi.colorOnSurfaceDisabled};
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
input {
|
|
251
|
+
opacity: 0;
|
|
252
|
+
position: absolute;
|
|
253
|
+
width: 40px;
|
|
254
|
+
height: 40px;
|
|
255
|
+
margin: 0;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.ft-checkbox--box-container {
|
|
259
|
+
position: relative;
|
|
260
|
+
width: 40px;
|
|
261
|
+
height: 40px;
|
|
262
|
+
|
|
263
|
+
display: flex;
|
|
264
|
+
justify-content: center;
|
|
265
|
+
align-items: center;
|
|
266
|
+
flex-shrink: 0;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.ft-checkbox--box {
|
|
270
|
+
border: 2px solid ${xi.borderColor};
|
|
271
|
+
border-radius: 2px;
|
|
272
|
+
|
|
273
|
+
width: 18px;
|
|
274
|
+
height: 18px;
|
|
275
|
+
|
|
276
|
+
color: ${xi.colorOnPrimary};
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
.ft-checkbox--checked .ft-checkbox--box,
|
|
281
|
+
.ft-checkbox--indeterminate .ft-checkbox--box {
|
|
282
|
+
border-color: ${xi.colorPrimary};
|
|
283
|
+
background-color: ${xi.colorPrimary};
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.ft-checkbox--disabled .ft-checkbox--box {
|
|
287
|
+
border-color: ${xi.colorOnSurfaceDisabled};
|
|
288
|
+
background-color: transparent;
|
|
289
|
+
color: ${xi.colorOnSurfaceDisabled};
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.ft-checkbox--checkmark {
|
|
293
|
+
transition: opacity 180ms cubic-bezier(0, 0, 0.2, 1) 0ms, transform 180ms cubic-bezier(0, 0, 0.2, 1) 0ms;
|
|
294
|
+
opacity: 0;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.ft-checkbox--checkmark-path {
|
|
298
|
+
stroke-dashoffset: 0;
|
|
299
|
+
stroke: currentcolor;
|
|
300
|
+
stroke-width: 3px;
|
|
301
|
+
stroke-dasharray: 30;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.ft-checkbox--checked .ft-checkbox--checkmark,
|
|
305
|
+
.ft-checkbox--indeterminate .ft-checkbox--checkmark {
|
|
306
|
+
opacity: 1;
|
|
307
|
+
}
|
|
308
|
+
`,mi([o.property()],$i.prototype,"name",void 0),mi([o.property({type:Boolean})],$i.prototype,"checked",void 0),mi([o.property({type:Boolean})],$i.prototype,"indeterminate",void 0),mi([o.property({type:Boolean})],$i.prototype,"disabled",void 0),mi([o.query(".ft-checkbox")],$i.prototype,"container",void 0),mi([o.query("ft-ripple")],$i.prototype,"ripple",void 0),i.customElement("ft-checkbox")($i),t.FtCheckbox=$i,t.FtCheckboxCssVariables=xi,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litClassMap);
|