@fluid-topics/ft-switch 0.3.12 → 0.3.13
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-switch-option.css.d.ts +9 -0
- package/build/ft-switch-option.css.js +101 -0
- package/build/ft-switch-option.d.ts +2 -7
- package/build/ft-switch-option.js +7 -95
- package/build/ft-switch-option.properties.d.ts +7 -0
- package/build/ft-switch-option.properties.js +2 -0
- package/build/{css-variables.d.ts → ft-switch.css.d.ts} +2 -8
- package/build/{css-variables.js → ft-switch.css.js} +36 -10
- package/build/ft-switch.d.ts +2 -4
- package/build/ft-switch.js +4 -36
- package/build/ft-switch.light.js +288 -294
- package/build/ft-switch.min.js +292 -292
- package/build/ft-switch.properties.d.ts +4 -0
- package/build/ft-switch.properties.js +2 -0
- package/build/index.d.ts +4 -1
- package/build/index.js +4 -1
- package/package.json +7 -7
package/build/ft-switch.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,i=window.customElements.define,e=window.customElements.get,o=window.customElements,s=new WeakMap,n=new WeakMap,r=new WeakMap,l=new WeakMap;let a;window.CustomElementRegistry=class{constructor(){this._definitionsByTag=new Map,this._definitionsByClass=new Map,this._whenDefinedPromises=new Map,this._awaitingUpgrade=new Map}define(t,s){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(s))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");const l=s.prototype.attributeChangedCallback,a=new Set(s.observedAttributes||[]);f(s,a,l);const h={elementClass:s,connectedCallback:s.prototype.connectedCallback,disconnectedCallback:s.prototype.disconnectedCallback,adoptedCallback:s.prototype.adoptedCallback,attributeChangedCallback:l,formAssociated:s.formAssociated,formAssociatedCallback:s.prototype.formAssociatedCallback,formDisabledCallback:s.prototype.formDisabledCallback,formResetCallback:s.prototype.formResetCallback,formStateRestoreCallback:s.prototype.formStateRestoreCallback,observedAttributes:a};this._definitionsByTag.set(t,h),this._definitionsByClass.set(s,h);let c=e.call(o,t);c||(c=p(t),i.call(o,t,c)),this===window.customElements&&(r.set(s,h),h.standInClass=c);const d=this._awaitingUpgrade.get(t);if(d){this._awaitingUpgrade.delete(t);for(const t of d)n.delete(t),u(t,h,!0)}const y=this._whenDefinedPromises.get(t);return void 0!==y&&(y.resolve(s),this._whenDefinedPromises.delete(t)),s}upgrade(){x.push(this),o.upgrade.apply(o,arguments),x.pop()}get(t){return this._definitionsByTag.get(t)?.elementClass}_getDefinition(t){return this._definitionsByTag.get(t)}whenDefined(t){const i=this._getDefinition(t);if(void 0!==i)return Promise.resolve(i.elementClass);let e=this._whenDefinedPromises.get(t);return void 0===e&&(e={},e.promise=new Promise((t=>e.resolve=t)),this._whenDefinedPromises.set(t,e)),e.promise}_upgradeWhenDefined(t,i,e){let o=this._awaitingUpgrade.get(i);o||this._awaitingUpgrade.set(i,o=new Set),e?o.add(t):o.delete(t)}},window.HTMLElement=function(){let i=a;if(i)return a=void 0,i;const e=r.get(this.constructor);if(!e)throw new TypeError("Illegal constructor (custom element class must be registered with global customElements registry to be newable)");return i=Reflect.construct(t,[],e.standInClass),Object.setPrototypeOf(i,this.constructor.prototype),s.set(i,e),i},window.HTMLElement.prototype=t.prototype;const h=t=>t===document||t instanceof ShadowRoot,c=t=>{let i=t.getRootNode();if(!h(i)){const t=x[x.length-1];if(t instanceof CustomElementRegistry)return t;i=t.getRootNode(),h(i)||(i=l.get(i)?.getRootNode()||document)}return i.customElements},p=i=>class{static get formAssociated(){return!0}constructor(){const e=Reflect.construct(t,[],this.constructor);Object.setPrototypeOf(e,HTMLElement.prototype);const o=c(e)||window.customElements,s=o._getDefinition(i);return s?u(e,s):n.set(e,o),e}connectedCallback(){const t=s.get(this);t?t.connectedCallback&&t.connectedCallback.apply(this,arguments):n.get(this)._upgradeWhenDefined(this,i,!0)}disconnectedCallback(){const t=s.get(this);t?t.disconnectedCallback&&t.disconnectedCallback.apply(this,arguments):n.get(this)._upgradeWhenDefined(this,i,!1)}adoptedCallback(){s.get(this)?.adoptedCallback?.apply(this,arguments)}formAssociatedCallback(){const t=s.get(this);t&&t.formAssociated&&t?.formAssociatedCallback?.apply(this,arguments)}formDisabledCallback(){const t=s.get(this);t?.formAssociated&&t?.formDisabledCallback?.apply(this,arguments)}formResetCallback(){const t=s.get(this);t?.formAssociated&&t?.formResetCallback?.apply(this,arguments)}formStateRestoreCallback(){const t=s.get(this);t?.formAssociated&&t?.formStateRestoreCallback?.apply(this,arguments)}},f=(t,i,e)=>{if(0===i.size||void 0===e)return;const o=t.prototype.setAttribute;o&&(t.prototype.setAttribute=function(t,s){const n=t.toLowerCase();if(i.has(n)){const t=this.getAttribute(n);o.call(this,n,s),e.call(this,n,t,s)}else o.call(this,n,s)});const s=t.prototype.removeAttribute;s&&(t.prototype.removeAttribute=function(t){const o=t.toLowerCase();if(i.has(o)){const t=this.getAttribute(o);s.call(this,o),e.call(this,o,t,null)}else s.call(this,o)})},d=i=>{const e=Object.getPrototypeOf(i);if(e!==window.HTMLElement)return e===t||"HTMLElement"===e?.prototype?.constructor?.name?Object.setPrototypeOf(i,window.HTMLElement):d(e)},u=(t,i,e=!1)=>{Object.setPrototypeOf(t,i.elementClass.prototype),s.set(t,i),a=t;try{new i.elementClass}catch(t){d(i.elementClass),new i.elementClass}i.observedAttributes.forEach((e=>{t.hasAttribute(e)&&i.attributeChangedCallback.call(t,e,null,t.getAttribute(e))})),e&&i.connectedCallback&&t.isConnected&&i.connectedCallback.call(t)},y=Element.prototype.attachShadow;Element.prototype.attachShadow=function(t){const i=y.apply(this,arguments);return t.customElements&&(i.customElements=t.customElements),i};let x=[document];const v=(t,i,e)=>{const o=(e?Object.getPrototypeOf(e):t.prototype)[i];t.prototype[i]=function(){x.push(this);const t=o.apply(e||this,arguments);return void 0!==t&&l.set(t,this),x.pop(),t}};v(ShadowRoot,"createElement",document),v(ShadowRoot,"importNode",document),v(Element,"insertAdjacentHTML");const g=(t,i)=>{const e=Object.getOwnPropertyDescriptor(t.prototype,i);Object.defineProperty(t.prototype,i,{...e,set(t){x.push(this),e.set.call(this,t),x.pop()}})};if(g(Element,"innerHTML"),g(ShadowRoot,"innerHTML"),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){const t=new WeakMap,i=HTMLElement.prototype.attachInternals,e=["setFormValue","setValidity","checkValidity","reportValidity"];HTMLElement.prototype.attachInternals=function(...e){const o=i.call(this,...e);return t.set(o,this),o},e.forEach((i=>{const e=window.ElementInternals.prototype,o=e[i];e[i]=function(...i){const e=t.get(this);if(!0!==s.get(e).formAssociated)throw new DOMException(`Failed to execute ${o} on 'ElementInternals': The target element is not a form-associated custom element.`);o?.call(this,...i)}}));class o extends Array{constructor(t){super(...t),this._elements=t}get value(){return this._elements.find((t=>!0===t.checked))?.value||""}}class n{constructor(t){const i=new Map;t.forEach(((t,e)=>{const o=t.getAttribute("name"),s=i.get(o)||[];this[+e]=t,s.push(t),i.set(o,s)})),this.length=t.length,i.forEach(((t,i)=>{t&&(1===t.length?this[i]=t[0]:this[i]=new o(t))}))}namedItem(t){return this[t]}}const r=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){const t=r.get.call(this,[]),i=[];for(const e of t){const t=s.get(e);t&&!0!==t.formAssociated||i.push(e)}return new n(i)}})}}try{window.customElements.define("custom-element",null)}catch(
|
|
17
|
+
if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,i=window.customElements.define,e=window.customElements.get,o=window.customElements,s=new WeakMap,n=new WeakMap,r=new WeakMap,l=new WeakMap;let a;window.CustomElementRegistry=class{constructor(){this._definitionsByTag=new Map,this._definitionsByClass=new Map,this._whenDefinedPromises=new Map,this._awaitingUpgrade=new Map}define(t,s){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(s))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");const l=s.prototype.attributeChangedCallback,a=new Set(s.observedAttributes||[]);f(s,a,l);const h={elementClass:s,connectedCallback:s.prototype.connectedCallback,disconnectedCallback:s.prototype.disconnectedCallback,adoptedCallback:s.prototype.adoptedCallback,attributeChangedCallback:l,formAssociated:s.formAssociated,formAssociatedCallback:s.prototype.formAssociatedCallback,formDisabledCallback:s.prototype.formDisabledCallback,formResetCallback:s.prototype.formResetCallback,formStateRestoreCallback:s.prototype.formStateRestoreCallback,observedAttributes:a};this._definitionsByTag.set(t,h),this._definitionsByClass.set(s,h);let c=e.call(o,t);c||(c=p(t),i.call(o,t,c)),this===window.customElements&&(r.set(s,h),h.standInClass=c);const d=this._awaitingUpgrade.get(t);if(d){this._awaitingUpgrade.delete(t);for(const t of d)n.delete(t),u(t,h,!0)}const y=this._whenDefinedPromises.get(t);return void 0!==y&&(y.resolve(s),this._whenDefinedPromises.delete(t)),s}upgrade(){x.push(this),o.upgrade.apply(o,arguments),x.pop()}get(t){return this._definitionsByTag.get(t)?.elementClass}_getDefinition(t){return this._definitionsByTag.get(t)}whenDefined(t){const i=this._getDefinition(t);if(void 0!==i)return Promise.resolve(i.elementClass);let e=this._whenDefinedPromises.get(t);return void 0===e&&(e={},e.promise=new Promise((t=>e.resolve=t)),this._whenDefinedPromises.set(t,e)),e.promise}_upgradeWhenDefined(t,i,e){let o=this._awaitingUpgrade.get(i);o||this._awaitingUpgrade.set(i,o=new Set),e?o.add(t):o.delete(t)}},window.HTMLElement=function(){let i=a;if(i)return a=void 0,i;const e=r.get(this.constructor);if(!e)throw new TypeError("Illegal constructor (custom element class must be registered with global customElements registry to be newable)");return i=Reflect.construct(t,[],e.standInClass),Object.setPrototypeOf(i,this.constructor.prototype),s.set(i,e),i},window.HTMLElement.prototype=t.prototype;const h=t=>t===document||t instanceof ShadowRoot,c=t=>{let i=t.getRootNode();if(!h(i)){const t=x[x.length-1];if(t instanceof CustomElementRegistry)return t;i=t.getRootNode(),h(i)||(i=l.get(i)?.getRootNode()||document)}return i.customElements},p=i=>class{static get formAssociated(){return!0}constructor(){const e=Reflect.construct(t,[],this.constructor);Object.setPrototypeOf(e,HTMLElement.prototype);const o=c(e)||window.customElements,s=o._getDefinition(i);return s?u(e,s):n.set(e,o),e}connectedCallback(){const t=s.get(this);t?t.connectedCallback&&t.connectedCallback.apply(this,arguments):n.get(this)._upgradeWhenDefined(this,i,!0)}disconnectedCallback(){const t=s.get(this);t?t.disconnectedCallback&&t.disconnectedCallback.apply(this,arguments):n.get(this)._upgradeWhenDefined(this,i,!1)}adoptedCallback(){s.get(this)?.adoptedCallback?.apply(this,arguments)}formAssociatedCallback(){const t=s.get(this);t&&t.formAssociated&&t?.formAssociatedCallback?.apply(this,arguments)}formDisabledCallback(){const t=s.get(this);t?.formAssociated&&t?.formDisabledCallback?.apply(this,arguments)}formResetCallback(){const t=s.get(this);t?.formAssociated&&t?.formResetCallback?.apply(this,arguments)}formStateRestoreCallback(){const t=s.get(this);t?.formAssociated&&t?.formStateRestoreCallback?.apply(this,arguments)}},f=(t,i,e)=>{if(0===i.size||void 0===e)return;const o=t.prototype.setAttribute;o&&(t.prototype.setAttribute=function(t,s){const n=t.toLowerCase();if(i.has(n)){const t=this.getAttribute(n);o.call(this,n,s),e.call(this,n,t,s)}else o.call(this,n,s)});const s=t.prototype.removeAttribute;s&&(t.prototype.removeAttribute=function(t){const o=t.toLowerCase();if(i.has(o)){const t=this.getAttribute(o);s.call(this,o),e.call(this,o,t,null)}else s.call(this,o)})},d=i=>{const e=Object.getPrototypeOf(i);if(e!==window.HTMLElement)return e===t||"HTMLElement"===e?.prototype?.constructor?.name?Object.setPrototypeOf(i,window.HTMLElement):d(e)},u=(t,i,e=!1)=>{Object.setPrototypeOf(t,i.elementClass.prototype),s.set(t,i),a=t;try{new i.elementClass}catch(t){d(i.elementClass),new i.elementClass}i.observedAttributes.forEach((e=>{t.hasAttribute(e)&&i.attributeChangedCallback.call(t,e,null,t.getAttribute(e))})),e&&i.connectedCallback&&t.isConnected&&i.connectedCallback.call(t)},y=Element.prototype.attachShadow;Element.prototype.attachShadow=function(t){const i=y.apply(this,arguments);return t.customElements&&(i.customElements=t.customElements),i};let x=[document];const v=(t,i,e)=>{const o=(e?Object.getPrototypeOf(e):t.prototype)[i];t.prototype[i]=function(){x.push(this);const t=o.apply(e||this,arguments);return void 0!==t&&l.set(t,this),x.pop(),t}};v(ShadowRoot,"createElement",document),v(ShadowRoot,"importNode",document),v(Element,"insertAdjacentHTML");const g=(t,i)=>{const e=Object.getOwnPropertyDescriptor(t.prototype,i);Object.defineProperty(t.prototype,i,{...e,set(t){x.push(this),e.set.call(this,t),x.pop()}})};if(g(Element,"innerHTML"),g(ShadowRoot,"innerHTML"),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){const t=new WeakMap,i=HTMLElement.prototype.attachInternals,e=["setFormValue","setValidity","checkValidity","reportValidity"];HTMLElement.prototype.attachInternals=function(...e){const o=i.call(this,...e);return t.set(o,this),o},e.forEach((i=>{const e=window.ElementInternals.prototype,o=e[i];e[i]=function(...i){const e=t.get(this);if(!0!==s.get(e).formAssociated)throw new DOMException(`Failed to execute ${o} on 'ElementInternals': The target element is not a form-associated custom element.`);o?.call(this,...i)}}));class o extends Array{constructor(t){super(...t),this._elements=t}get value(){return this._elements.find((t=>!0===t.checked))?.value||""}}class n{constructor(t){const i=new Map;t.forEach(((t,e)=>{const o=t.getAttribute("name"),s=i.get(o)||[];this[+e]=t,s.push(t),i.set(o,s)})),this.length=t.length,i.forEach(((t,i)=>{t&&(1===t.length?this[i]=t[0]:this[i]=new o(t))}))}namedItem(t){return this[t]}}const r=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){const t=r.get.call(this,[]),i=[];for(const e of t){const t=s.get(e);t&&!0!==t.formAssociated||i.push(e)}return new n(i)}})}}try{window.customElements.define("custom-element",null)}catch(pe){const t=window.customElements.define;window.customElements.define=(i,e,o)=>{try{t.bind(window.customElements)(i,e,o)}catch(t){console.warn(i,e,o,t)}}}class i{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,i){this.callbacks=[t],this.debounce(i)}queue(t,i){this.callbacks.push(t),this.debounce(i)}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
|
|
@@ -92,7 +92,96 @@ const vt=1,gt=2,bt=t=>(...i)=>({_$litDirective$:t,values:i});class mt{constructo
|
|
|
92
92
|
* @license
|
|
93
93
|
* Copyright 2018 Google LLC
|
|
94
94
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
95
|
-
*/const wt=bt(class extends mt{constructor(t){var i;if(super(t),t.type!==vt||"class"!==t.name||(null===(i=t.strings)||void 0===i?void 0:i.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((i=>t[i])).join(" ")+" "}update(t,[i]){var e,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 i)i[t]&&!(null===(e=this.st)||void 0===e?void 0:e.has(t))&&this.nt.add(t);return this.render(i)}const s=t.element.classList;this.nt.forEach((t=>{t in i||(s.remove(t),this.nt.delete(t))}));for(const t in i){const e=!!i[t];e===this.nt.has(t)||(null===(o=this.st)||void 0===o?void 0:o.has(t))||(e?(s.add(t),this.nt.add(t)):(s.remove(t),this.nt.delete(t)))}return H}})
|
|
95
|
+
*/const wt=bt(class extends mt{constructor(t){var i;if(super(t),t.type!==vt||"class"!==t.name||(null===(i=t.strings)||void 0===i?void 0:i.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((i=>t[i])).join(" ")+" "}update(t,[i]){var e,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 i)i[t]&&!(null===(e=this.st)||void 0===e?void 0:e.has(t))&&this.nt.add(t);return this.render(i)}const s=t.element.classList;this.nt.forEach((t=>{t in i||(s.remove(t),this.nt.delete(t))}));for(const t in i){const e=!!i[t];e===this.nt.has(t)||(null===(o=this.st)||void 0===o?void 0:o.has(t))||(e?(s.add(t),this.nt.add(t)):(s.remove(t),this.nt.delete(t)))}return H}}),$t=ct.extend("--ft-ripple-color",ft.colorContent),Ot={color:$t,backgroundColor:ct.extend("--ft-ripple-background-color",$t),opacityContentOnSurfacePressed:ct.external(ft.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:ct.external(ft.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:ct.external(ft.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:ct.external(ft.opacityContentOnSurfaceSelected,"Design system")},St=ct.extend("--ft-ripple-color",ft.colorPrimary),kt=St,Ct=ct.extend("--ft-ripple-background-color",St),Nt=ct.extend("--ft-ripple-color",ft.colorSecondary),Et=Nt,Rt=ct.extend("--ft-ripple-background-color",Nt),Mt=y`
|
|
96
|
+
:host {
|
|
97
|
+
display: contents;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.ft-ripple {
|
|
101
|
+
position: absolute;
|
|
102
|
+
inset: 0;
|
|
103
|
+
pointer-events: none;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.ft-ripple:not(.ft-ripple--unbounded) {
|
|
107
|
+
overflow: hidden;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.ft-ripple .ft-ripple--background,
|
|
111
|
+
.ft-ripple .ft-ripple--effect {
|
|
112
|
+
position: absolute;
|
|
113
|
+
opacity: 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.ft-ripple .ft-ripple--background {
|
|
117
|
+
background-color: ${Ot.backgroundColor};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.ft-ripple .ft-ripple--effect {
|
|
121
|
+
background-color: ${Ot.color};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.ft-ripple.ft-ripple--secondary .ft-ripple--background {
|
|
125
|
+
background-color: ${Rt};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.ft-ripple.ft-ripple--secondary .ft-ripple--effect {
|
|
129
|
+
background-color: ${Et};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.ft-ripple.ft-ripple--primary .ft-ripple--background {
|
|
133
|
+
background-color: ${Ct};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.ft-ripple.ft-ripple--primary .ft-ripple--effect {
|
|
137
|
+
background-color: ${kt};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.ft-ripple .ft-ripple--background {
|
|
141
|
+
top: 0;
|
|
142
|
+
left: 0;
|
|
143
|
+
height: 100%;
|
|
144
|
+
width: 100%;
|
|
145
|
+
transition: opacity 75ms linear;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.ft-ripple .ft-ripple--effect,
|
|
149
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
150
|
+
border-radius: 50%;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.ft-ripple .ft-ripple--effect {
|
|
154
|
+
transform: translate(-50%, -50%) scale(0.15);
|
|
155
|
+
transition: transform 300ms ease, opacity 75ms linear;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--effect,
|
|
159
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
160
|
+
left: 50%;
|
|
161
|
+
top: 50%;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
165
|
+
transform: translate(-50%, -50%);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.ft-ripple.ft-ripple--hovered .ft-ripple--background {
|
|
169
|
+
opacity: ${Ot.opacityContentOnSurfaceHover};
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.ft-ripple.ft-ripple--selected .ft-ripple--background {
|
|
173
|
+
opacity: ${Ot.opacityContentOnSurfaceSelected};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.ft-ripple.ft-ripple--focused .ft-ripple--background {
|
|
177
|
+
opacity: ${Ot.opacityContentOnSurfaceFocused};
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.ft-ripple.ft-ripple--pressed .ft-ripple--effect {
|
|
181
|
+
opacity: ${Ot.opacityContentOnSurfacePressed};
|
|
182
|
+
transform: translate(-50%, -50%) scale(1);
|
|
183
|
+
}
|
|
184
|
+
`;var Ut=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Ft extends xt{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(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),n=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-n.x:n.width/2),this.originY=Math.round(null!=s?s-n.y:n.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 I`
|
|
96
185
|
<style>
|
|
97
186
|
.ft-ripple .ft-ripple--effect,
|
|
98
187
|
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
@@ -109,102 +198,13 @@ const vt=1,gt=2,bt=t=>(...i)=>({_$litDirective$:t,values:i});class mt{constructo
|
|
|
109
198
|
<div class="ft-ripple--background"></div>
|
|
110
199
|
<div class="ft-ripple--effect"></div>
|
|
111
200
|
</div>
|
|
112
|
-
`}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()}}
|
|
113
|
-
:host {
|
|
114
|
-
display: contents;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.ft-ripple {
|
|
118
|
-
position: absolute;
|
|
119
|
-
inset: 0;
|
|
120
|
-
pointer-events: none;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.ft-ripple:not(.ft-ripple--unbounded) {
|
|
124
|
-
overflow: hidden;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.ft-ripple .ft-ripple--background,
|
|
128
|
-
.ft-ripple .ft-ripple--effect {
|
|
129
|
-
position: absolute;
|
|
130
|
-
opacity: 0;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.ft-ripple .ft-ripple--background {
|
|
134
|
-
background-color: ${St.backgroundColor};
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.ft-ripple .ft-ripple--effect {
|
|
138
|
-
background-color: ${St.color};
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.ft-ripple.ft-ripple--secondary .ft-ripple--background {
|
|
142
|
-
background-color: ${Mt};
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.ft-ripple.ft-ripple--secondary .ft-ripple--effect {
|
|
146
|
-
background-color: ${Rt};
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.ft-ripple.ft-ripple--primary .ft-ripple--background {
|
|
150
|
-
background-color: ${Nt};
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.ft-ripple.ft-ripple--primary .ft-ripple--effect {
|
|
154
|
-
background-color: ${Ct};
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
.ft-ripple .ft-ripple--background {
|
|
158
|
-
top: 0;
|
|
159
|
-
left: 0;
|
|
160
|
-
height: 100%;
|
|
161
|
-
width: 100%;
|
|
162
|
-
transition: opacity 75ms linear;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
.ft-ripple .ft-ripple--effect,
|
|
166
|
-
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
167
|
-
border-radius: 50%;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
.ft-ripple .ft-ripple--effect {
|
|
171
|
-
transform: translate(-50%, -50%) scale(0.15);
|
|
172
|
-
transition: transform 300ms ease, opacity 75ms linear;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
.ft-ripple.ft-ripple--unbounded .ft-ripple--effect,
|
|
176
|
-
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
177
|
-
left: 50%;
|
|
178
|
-
top: 50%;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
182
|
-
transform: translate(-50%, -50%);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
.ft-ripple.ft-ripple--hovered .ft-ripple--background {
|
|
186
|
-
opacity: ${St.opacityContentOnSurfaceHover};
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.ft-ripple.ft-ripple--selected .ft-ripple--background {
|
|
190
|
-
opacity: ${St.opacityContentOnSurfaceSelected};
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
.ft-ripple.ft-ripple--focused .ft-ripple--background {
|
|
194
|
-
opacity: ${St.opacityContentOnSurfaceFocused};
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
.ft-ripple.ft-ripple--pressed .ft-ripple--effect {
|
|
198
|
-
opacity: ${St.opacityContentOnSurfacePressed};
|
|
199
|
-
transform: translate(-50%, -50%) scale(1);
|
|
200
|
-
}
|
|
201
|
-
`,$t([o({type:Boolean})],Ut.prototype,"primary",void 0),$t([o({type:Boolean})],Ut.prototype,"secondary",void 0),$t([o({type:Boolean})],Ut.prototype,"unbounded",void 0),$t([o({type:Boolean})],Ut.prototype,"activated",void 0),$t([o({type:Boolean})],Ut.prototype,"selected",void 0),$t([o({type:Boolean})],Ut.prototype,"disabled",void 0),$t([s()],Ut.prototype,"hovered",void 0),$t([s()],Ut.prototype,"focused",void 0),$t([s()],Ut.prototype,"pressed",void 0),$t([s()],Ut.prototype,"rippling",void 0),$t([s()],Ut.prototype,"rippleSize",void 0),$t([s()],Ut.prototype,"originX",void 0),$t([s()],Ut.prototype,"originY",void 0),$t([r(".ft-ripple")],Ut.prototype,"ripple",void 0),$t([r(".ft-ripple--effect")],Ut.prototype,"rippleEffect",void 0),h("ft-ripple")(Ut);
|
|
201
|
+
`}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()}}Ft.elementDefinitions={},Ft.styles=Mt,Ut([o({type:Boolean})],Ft.prototype,"primary",void 0),Ut([o({type:Boolean})],Ft.prototype,"secondary",void 0),Ut([o({type:Boolean})],Ft.prototype,"unbounded",void 0),Ut([o({type:Boolean})],Ft.prototype,"activated",void 0),Ut([o({type:Boolean})],Ft.prototype,"selected",void 0),Ut([o({type:Boolean})],Ft.prototype,"disabled",void 0),Ut([s()],Ft.prototype,"hovered",void 0),Ut([s()],Ft.prototype,"focused",void 0),Ut([s()],Ft.prototype,"pressed",void 0),Ut([s()],Ft.prototype,"rippling",void 0),Ut([s()],Ft.prototype,"rippleSize",void 0),Ut([s()],Ft.prototype,"originX",void 0),Ut([s()],Ft.prototype,"originY",void 0),Ut([r(".ft-ripple")],Ft.prototype,"ripple",void 0),Ut([r(".ft-ripple--effect")],Ft.prototype,"rippleEffect",void 0),h("ft-ripple")(Ft);
|
|
202
202
|
/**
|
|
203
203
|
* @license
|
|
204
204
|
* Copyright 2020 Google LLC
|
|
205
205
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
206
206
|
*/
|
|
207
|
-
const
|
|
207
|
+
const zt=Symbol.for(""),jt=t=>{if((null==t?void 0:t.r)===zt)return null==t?void 0:t._$litStatic$},At=t=>({_$litStatic$:t,r:zt}),Lt=new Map,Tt=(t=>(i,...e)=>{const o=e.length;let s,n;const r=[],l=[];let a,h=0,c=!1;for(;h<o;){for(a=i[h];h<o&&void 0!==(n=e[h],s=jt(n));)a+=s+i[++h],c=!0;l.push(n),r.push(a),h++}if(h===o&&r.push(i[o]),c){const t=r.join("$$lit$$");void 0===(i=Lt.get(t))&&(r.raw=r,Lt.set(t,i=r)),e=l}return t(i,...e)})(I);var Bt;!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"}(Bt||(Bt={}));const Pt=ct.extend("--ft-typography-font-family",ft.titleFont),_t=ct.extend("--ft-typography-font-family",ft.contentFont),Wt={fontFamily:_t,fontSize:ct.create("--ft-typography-font-size","SIZE","16px"),fontWeight:ct.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:ct.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:ct.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:ct.create("--ft-typography-text-transform","UNKNOWN","inherit")},Dt=ct.extend("--ft-typography-title-font-family",Pt),It=ct.extend("--ft-typography-title-font-size",Wt.fontSize,"20px"),Ht=ct.extend("--ft-typography-title-font-weight",Wt.fontWeight,"normal"),Kt=ct.extend("--ft-typography-title-letter-spacing",Wt.letterSpacing,"0.15px"),Zt=ct.extend("--ft-typography-title-line-height",Wt.lineHeight,"1.2"),Vt=ct.extend("--ft-typography-title-text-transform",Wt.textTransform,"inherit"),Jt=ct.extend("--ft-typography-title-dense-font-family",Pt),qt=ct.extend("--ft-typography-title-dense-font-size",Wt.fontSize,"14px"),Xt=ct.extend("--ft-typography-title-dense-font-weight",Wt.fontWeight,"normal"),Yt=ct.extend("--ft-typography-title-dense-letter-spacing",Wt.letterSpacing,"0.105px"),Gt=ct.extend("--ft-typography-title-dense-line-height",Wt.lineHeight,"1.7"),Qt=ct.extend("--ft-typography-title-dense-text-transform",Wt.textTransform,"inherit"),ti=ct.extend("--ft-typography-subtitle1-font-family",_t),ii=ct.extend("--ft-typography-subtitle1-font-size",Wt.fontSize,"16px"),ei=ct.extend("--ft-typography-subtitle1-font-weight",Wt.fontWeight,"600"),oi=ct.extend("--ft-typography-subtitle1-letter-spacing",Wt.letterSpacing,"0.144px"),si=ct.extend("--ft-typography-subtitle1-line-height",Wt.lineHeight,"1.5"),ni=ct.extend("--ft-typography-subtitle1-text-transform",Wt.textTransform,"inherit"),ri=ct.extend("--ft-typography-subtitle2-font-family",_t),li=ct.extend("--ft-typography-subtitle2-font-size",Wt.fontSize,"14px"),ai=ct.extend("--ft-typography-subtitle2-font-weight",Wt.fontWeight,"normal"),hi=ct.extend("--ft-typography-subtitle2-letter-spacing",Wt.letterSpacing,"0.098px"),ci=ct.extend("--ft-typography-subtitle2-line-height",Wt.lineHeight,"1.7"),pi=ct.extend("--ft-typography-subtitle2-text-transform",Wt.textTransform,"inherit"),fi=ct.extend("--ft-typography-body1-font-family",_t),di=ct.extend("--ft-typography-body1-font-size",Wt.fontSize,"16px"),ui=ct.extend("--ft-typography-body1-font-weight",Wt.fontWeight,"normal"),yi=ct.extend("--ft-typography-body1-letter-spacing",Wt.letterSpacing,"0.496px"),xi=ct.extend("--ft-typography-body1-line-height",Wt.lineHeight,"1.5"),vi=ct.extend("--ft-typography-body1-text-transform",Wt.textTransform,"inherit"),gi=ct.extend("--ft-typography-body2-font-family",_t),bi=ct.extend("--ft-typography-body2-font-size",Wt.fontSize,"14px"),mi=ct.extend("--ft-typography-body2-font-weight",Wt.fontWeight,"normal"),wi=ct.extend("--ft-typography-body2-letter-spacing",Wt.letterSpacing,"0.252px"),$i=ct.extend("--ft-typography-body2-line-height",Wt.lineHeight,"1.4"),Oi=ct.extend("--ft-typography-body2-text-transform",Wt.textTransform,"inherit"),Si=ct.extend("--ft-typography-caption-font-family",_t),ki=ct.extend("--ft-typography-caption-font-size",Wt.fontSize,"12px"),Ci=ct.extend("--ft-typography-caption-font-weight",Wt.fontWeight,"normal"),Ni=ct.extend("--ft-typography-caption-letter-spacing",Wt.letterSpacing,"0.396px"),Ei=ct.extend("--ft-typography-caption-line-height",Wt.lineHeight,"1.33"),Ri=ct.extend("--ft-typography-caption-text-transform",Wt.textTransform,"inherit"),Mi=ct.extend("--ft-typography-breadcrumb-font-family",_t),Ui=ct.extend("--ft-typography-breadcrumb-font-size",Wt.fontSize,"10px"),Fi=ct.extend("--ft-typography-breadcrumb-font-weight",Wt.fontWeight,"normal"),zi=ct.extend("--ft-typography-breadcrumb-letter-spacing",Wt.letterSpacing,"0.33px"),ji=ct.extend("--ft-typography-breadcrumb-line-height",Wt.lineHeight,"1.6"),Ai=ct.extend("--ft-typography-breadcrumb-text-transform",Wt.textTransform,"inherit"),Li=ct.extend("--ft-typography-overline-font-family",_t),Ti=ct.extend("--ft-typography-overline-font-size",Wt.fontSize,"10px"),Bi=ct.extend("--ft-typography-overline-font-weight",Wt.fontWeight,"normal"),Pi=ct.extend("--ft-typography-overline-letter-spacing",Wt.letterSpacing,"1.5px"),_i=ct.extend("--ft-typography-overline-line-height",Wt.lineHeight,"1.6"),Wi=ct.extend("--ft-typography-overline-text-transform",Wt.textTransform,"uppercase"),Di={fontFamily:ct.extend("--ft-typography-button-font-family",_t),fontSize:ct.extend("--ft-typography-button-font-size",Wt.fontSize,"14px"),fontWeight:ct.extend("--ft-typography-button-font-weight",Wt.fontWeight,"600"),letterSpacing:ct.extend("--ft-typography-button-letter-spacing",Wt.letterSpacing,"1.246px"),lineHeight:ct.extend("--ft-typography-button-line-height",Wt.lineHeight,"1.15"),textTransform:ct.extend("--ft-typography-button-text-transform",Wt.textTransform,"uppercase")},Ii=y`
|
|
208
208
|
.ft-typography--title {
|
|
209
209
|
font-family: ${Dt};
|
|
210
210
|
font-size: ${It};
|
|
@@ -295,18 +295,50 @@ const Ft=Symbol.for(""),zt=t=>{if((null==t?void 0:t.r)===Ft)return null==t?void
|
|
|
295
295
|
line-height: ${Di.lineHeight};
|
|
296
296
|
text-transform: ${Di.textTransform};
|
|
297
297
|
}
|
|
298
|
-
|
|
299
|
-
|
|
298
|
+
`,Qi=y`
|
|
299
|
+
.ft-typography {
|
|
300
|
+
vertical-align: inherit;
|
|
301
|
+
}
|
|
302
|
+
`;var te=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class ie extends xt{constructor(){super(...arguments),this.variant=Bt.body1}render(){return this.element?Tt`
|
|
303
|
+
<${At(this.element)}
|
|
300
304
|
class="ft-typography ft-typography--${this.variant}">
|
|
301
305
|
<slot></slot>
|
|
302
|
-
</${
|
|
303
|
-
`:
|
|
306
|
+
</${At(this.element)}>
|
|
307
|
+
`:Tt`
|
|
304
308
|
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
305
|
-
`}}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
309
|
+
`}}ie.styles=[Ii,Hi,Ki,Zi,Vi,Ji,qi,Xi,Yi,Gi,Qi],te([o()],ie.prototype,"element",void 0),te([o()],ie.prototype,"variant",void 0),h("ft-typography")(ie);const ee=ct.create("--ft-tooltip-distance","SIZE","4px"),oe=ct.create("--ft-tooltip-color","COLOR","#FFFFFF"),se=ct.create("--ft-tooltip-background-color","COLOR","#666666"),ne=ct.create("--ft-tooltip-z-index","NUMBER","1"),re=ct.external(ft.borderRadiusS,"Design system"),le=ct.create("--ft-tooltip-max-width","SIZE","150px"),ae=y`
|
|
310
|
+
.ft-tooltip--container {
|
|
311
|
+
display: block;
|
|
312
|
+
position: relative;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.ft-tooltip--inline {
|
|
316
|
+
display: inline-block;
|
|
317
|
+
max-width: 100%;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.ft-tooltip {
|
|
321
|
+
position: absolute;
|
|
322
|
+
box-sizing: border-box;
|
|
323
|
+
overflow: hidden;
|
|
324
|
+
width: max-content;
|
|
325
|
+
max-width: ${le};
|
|
326
|
+
text-align: center;
|
|
327
|
+
padding: ${ee};
|
|
328
|
+
z-index: ${ne};
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.ft-tooltip--content {
|
|
332
|
+
padding: 4px 8px;
|
|
333
|
+
border-radius: ${re};
|
|
334
|
+
background-color: ${se};
|
|
335
|
+
color: ${oe};
|
|
336
|
+
top: -500px;
|
|
337
|
+
left: -500px;
|
|
338
|
+
position: relative;
|
|
339
|
+
word-break: break-word;
|
|
340
|
+
}
|
|
341
|
+
`;var he=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class ce extends xt{constructor(){super(...arguments),this.text="",this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.visible=!1,this.hideDebounce=new i,this.revealDebouncer=new i}render(){return I`
|
|
310
342
|
<div part="container"
|
|
311
343
|
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
312
344
|
@mouseenter=${this.onHover}
|
|
@@ -322,178 +354,175 @@ const Ft=Symbol.for(""),zt=t=>{if((null==t?void 0:t.r)===Ft)return null==t?void
|
|
|
322
354
|
</div>
|
|
323
355
|
<slot></slot>
|
|
324
356
|
</div>
|
|
325
|
-
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){t.has("visible")&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.position){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent();const t=this.slottedElement;if(this.tooltip&&t){const i=t.getBoundingClientRect(),e=(i.height-this.tooltip.clientHeight)/2,o=(i.width-this.tooltip.clientWidth)/2;let s=0,n=0;switch(this.position){case"top":n=-this.tooltip.clientHeight,s=o;break;case"bottom":n=i.height,s=o;break;case"left":n=e,s=-this.tooltip.clientWidth;break;case"right":n=e,s=i.width}i.left+s+this.tooltip.clientWidth>window.innerWidth&&(s=window.innerWidth-this.tooltip.clientWidth-i.left),i.left+s<0&&(s=0);const r=this.tooltip.style;r.left=s+"px",r.top=n+"px",r.maxWidth=`max(${i.width}px, ${
|
|
326
|
-
.ft-tooltip--container {
|
|
327
|
-
display: block;
|
|
328
|
-
position: relative;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
.ft-tooltip--inline {
|
|
332
|
-
display: inline-block;
|
|
333
|
-
max-width: 100%;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
.ft-tooltip {
|
|
337
|
-
position: absolute;
|
|
338
|
-
box-sizing: border-box;
|
|
339
|
-
overflow: hidden;
|
|
340
|
-
width: max-content;
|
|
341
|
-
max-width: ${re};
|
|
342
|
-
text-align: center;
|
|
343
|
-
padding: ${ie};
|
|
344
|
-
z-index: ${se};
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
.ft-tooltip--content {
|
|
348
|
-
padding: 4px 8px;
|
|
349
|
-
border-radius: ${ne};
|
|
350
|
-
background-color: ${oe};
|
|
351
|
-
color: ${ee};
|
|
352
|
-
top: -500px;
|
|
353
|
-
left: -500px;
|
|
354
|
-
position: relative;
|
|
355
|
-
word-break: break-word;
|
|
356
|
-
}
|
|
357
|
-
`,te([o()],le.prototype,"text",void 0),te([o({type:Boolean})],le.prototype,"manual",void 0),te([o({type:Boolean})],le.prototype,"inline",void 0),te([o({type:Number})],le.prototype,"delay",void 0),te([o()],le.prototype,"position",void 0),te([
|
|
357
|
+
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){t.has("visible")&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.position){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent();const t=this.slottedElement;if(this.tooltip&&t){const i=t.getBoundingClientRect(),e=(i.height-this.tooltip.clientHeight)/2,o=(i.width-this.tooltip.clientWidth)/2;let s=0,n=0;switch(this.position){case"top":n=-this.tooltip.clientHeight,s=o;break;case"bottom":n=i.height,s=o;break;case"left":n=e,s=-this.tooltip.clientWidth;break;case"right":n=e,s=i.width}i.left+s+this.tooltip.clientWidth>window.innerWidth&&(s=window.innerWidth-this.tooltip.clientWidth-i.left),i.left+s<0&&(s=0);const r=this.tooltip.style;r.left=s+"px",r.top=n+"px",r.maxWidth=`max(${i.width}px, ${le})`}this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}}ce.elementDefinitions={"ft-typography":ie},ce.styles=ae,he([o()],ce.prototype,"text",void 0),he([o({type:Boolean})],ce.prototype,"manual",void 0),he([o({type:Boolean})],ce.prototype,"inline",void 0),he([o({type:Number})],ce.prototype,"delay",void 0),he([o()],ce.prototype,"position",void 0),he([
|
|
358
358
|
/**
|
|
359
359
|
* @license
|
|
360
360
|
* Copyright 2017 Google LLC
|
|
361
361
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
362
362
|
*/
|
|
363
|
-
function(t,i,e){let o,s=t;return"object"==typeof t?(s=t.slot,o=t):o={flatten:i},e?function(t){const{slot:i,selector:e}=null!=t?t:{};return n({descriptor:o=>({get(){var o;const s="slot"+(i?`[name=${i}]`:":not([name])"),n=null===(o=this.renderRoot)||void 0===o?void 0:o.querySelector(s),r=null!=n?a(n,t):[];return e?r.filter((t=>t.matches(e))):r},enumerable:!0,configurable:!0})})}({slot:s,flatten:i,selector:e}):n({descriptor:t=>({get(){var t,i;const e="slot"+(s?`[name=${s}]`:":not([name])"),n=null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector(e);return null!==(i=null==n?void 0:n.assignedNodes(o))&&void 0!==i?i:[]},enumerable:!0,configurable:!0})})}("",!0)],
|
|
363
|
+
function(t,i,e){let o,s=t;return"object"==typeof t?(s=t.slot,o=t):o={flatten:i},e?function(t){const{slot:i,selector:e}=null!=t?t:{};return n({descriptor:o=>({get(){var o;const s="slot"+(i?`[name=${i}]`:":not([name])"),n=null===(o=this.renderRoot)||void 0===o?void 0:o.querySelector(s),r=null!=n?a(n,t):[];return e?r.filter((t=>t.matches(e))):r},enumerable:!0,configurable:!0})})}({slot:s,flatten:i,selector:e}):n({descriptor:t=>({get(){var t,i;const e="slot"+(s?`[name=${s}]`:":not([name])"),n=null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector(e);return null!==(i=null==n?void 0:n.assignedNodes(o))&&void 0!==i?i:[]},enumerable:!0,configurable:!0})})}("",!0)],ce.prototype,"slotNodes",void 0),he([r(".ft-tooltip--container")],ce.prototype,"container",void 0),he([r("slot")],ce.prototype,"target",void 0),he([r(".ft-tooltip")],ce.prototype,"tooltip",void 0),he([r(".ft-tooltip--content")],ce.prototype,"tooltipContent",void 0),he([s()],ce.prototype,"visible",void 0),h("ft-tooltip")(ce);
|
|
364
364
|
/**
|
|
365
365
|
* @license
|
|
366
366
|
* Copyright 2017 Google LLC
|
|
367
367
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
368
368
|
*/
|
|
369
|
-
class
|
|
369
|
+
class pe extends mt{constructor(t){if(super(t),this.it=K,t.type!==gt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===K||null==t)return this._t=void 0,this.it=t;if(t===H)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const i=[t];return i.raw=i,this._t={_$litType$:this.constructor.resultType,strings:i,values:[]}}}pe.directiveName="unsafeHTML",pe.resultType=1;const fe=bt(pe);var de,ue;!function(t){t.THIN_ARROW_LEFT="",t.THIN_ARROW_RIGHT="",t.MY_COLLECTIONS="",t.OFFLINE_SETTINGS="",t.MY_LIBRARY="",t.RATE_PLAIN="",t.RATE="",t.FEEDBACK_PLAIN="",t.STAR_PLAIN="",t.STAR="",t.THUMBS_DOWN_PLAIN="",t.THUMBS_DOWN="",t.THUMBS_UP_PLAIN="",t.THUMBS_UP="",t.PAUSE="",t.PLAY="",t.RELATIVES_PLAIN="",t.RELATIVES="",t.SHORTCUT_MENU="",t.PRINT="",t.DEFAULT_ROLES="",t.ACCOUNT_SETTINGS="",t.ONLINE="",t.OFFLINE="",t.UPLOAD="",t.BOOK_PLAIN="",t.SYNC="",t.SHARED_PBK="",t.COLLECTIONS="",t.SEARCH_IN_PUBLICATION="",t.BOOKS="",t.LOCKER="",t.ARROW_DOWN="",t.ARROW_LEFT="",t.ARROW_RIGHT="",t.ARROW_UP="",t.SAVE="",t.MAILS_AND_NOTIFICATIONS="",t.DOT="",t.MINUS="",t.PLUS="",t.FILTERS="",t.STRIPE_ARROW_RIGHT="",t.STRIPE_ARROW_LEFT="",t.ATTACHMENTS="",t.ADD_BOOKMARK="",t.BOOKMARK="",t.EXPORT="",t.MENU="",t.TAG="",t.TAG_PLAIN="",t.COPY_TO_CLIPBOARD="",t.COLUMNS="",t.ARTICLE="",t.CLOSE_PLAIN="",t.CHECK_PLAIN="",t.LOGOUT="",t.SIGN_IN="",t.THIN_ARROW="",t.TRIANGLE_BOTTOM="",t.TRIANGLE_LEFT="",t.TRIANGLE_RIGHT="",t.TRIANGLE_TOP="",t.FACET_HAS_DESCENDANT="",t.MINUS_PLAIN="",t.PLUS_PLAIN="",t.INFO="",t.ICON_EXPAND="",t.ICON_COLLAPSE="",t.ADD_TO_PBK="",t.ALERT="",t.ADD_ALERT="",t.BACK_TO_SEARCH="",t.DOWNLOAD="",t.EDIT="",t.FEEDBACK="",t.MODIFY_PBK="",t.SCHEDULED="",t.SEARCH="",t.SHARE="󨃱",t.TOC="",t.WRITE_UGC="",t.TRASH="",t.EXTLINK="",t.CALENDAR="",t.BOOK="",t.DOWNLOAD_PLAIN="",t.CHECK="",t.TOPICS="",t.EYE="\f06e",t.DISC="",t.CIRCLE="",t.SHARED="",t.SORT_UNSORTED="",t.SORT_UP="",t.SORT_DOWN="",t.WORKING="",t.CLOSE="",t.ZOOM_OUT="",t.ZOOM_IN="",t.ZOOM_REALSIZE="",t.ZOOM_FULLSCREEN="",t.ADMIN_RESTRICTED="",t.ADMIN_THEME="",t.WARNING="",t.CONTEXT="",t.SEARCH_HOME="",t.STEPS="",t.HOME="",t.TRANSLATE="",t.USER="",t.ADMIN="",t.ANALYTICS="",t.ADMIN_KHUB="",t.ADMIN_USERS="",t.ADMIN_INTEGRATION="",t.ADMIN_PORTAL=""}(de||(de={})),function(t){t.UNKNOWN="",t.ABW="",t.AUDIO="",t.AVI="",t.CHM="",t.CODE="",t.CSV="",t.DITA="",t.EPUB="",t.EXCEL="",t.FLAC="",t.GIF="",t.GZIP="",t.HTML="",t.IMAGE="",t.JPEG="",t.JSON="",t.M4A="",t.MOV="",t.MP3="",t.MP4="",t.OGG="",t.PDF="",t.PNG="",t.POWERPOINT="",t.RAR="",t.STP="",t.TEXT="",t.VIDEO="",t.WAV="",t.WMA="",t.WORD="",t.XML="",t.YAML="",t.ZIP=""}(ue||(ue={})),new Map([...["abw"].map((t=>[t,ue.ABW])),...["3gp","act","aiff","aac","amr","au","awb","dct","dss","dvf","gsm","iklax","ivs","mmf","mpc","msv","opus","ra","rm","raw","sln","tta","vox","wv"].map((t=>[t,ue.AUDIO])),...["avi"].map((t=>[t,ue.AVI])),...["chm","xhs"].map((t=>[t,ue.CHM])),...["java","py","php","php3","php4","php5","js","javascript","rb","rbw","c","cpp","cxx","h","hh","hpp","hxx","sh","bash","zsh","tcsh","ksh","csh","vb","scala","pl","prl","perl","groovy","ceylon","aspx","jsp","scpt","applescript","bas","bat","lua","jsp","mk","cmake","css","sass","less","m","mm","xcodeproj"].map((t=>[t,ue.CODE])),...["csv"].map((t=>[t,ue.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,ue.DITA])),...["epub"].map((t=>[t,ue.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,ue.EXCEL])),...["flac"].map((t=>[t,ue.FLAC])),...["gif"].map((t=>[t,ue.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,ue.GZIP])),...["html","htm","xhtml"].map((t=>[t,ue.HTML])),...["ai","vml","xps","img","cpt","psd","psp","xcf","svg","svg+xml","bmp","bpg","ppm","pgm","pbm","pnm","rif","tif","tiff","webp","wmf"].map((t=>[t,ue.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,ue.JPEG])),...["json"].map((t=>[t,ue.JSON])),...["m4a","m4p"].map((t=>[t,ue.M4A])),...["mov","qt"].map((t=>[t,ue.MOV])),...["mp3"].map((t=>[t,ue.MP3])),...["mp4","m4v"].map((t=>[t,ue.MP4])),...["ogg","oga"].map((t=>[t,ue.OGG])),...["pdf","ps"].map((t=>[t,ue.PDF])),...["png"].map((t=>[t,ue.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,ue.POWERPOINT])),...["rar"].map((t=>[t,ue.RAR])),...["stp"].map((t=>[t,ue.STP])),...["txt","rtf","md","mdown"].map((t=>[t,ue.TEXT])),...["webm","mkv","flv","vob","ogv","ogg","drc","mng","wmv","yuv","rm","rmvb","asf","mpg","mp2","mpeg","mpe","mpv","m2v","svi","3gp","3g2","mxf","roq","nsv"].map((t=>[t,ue.VIDEO])),...["wav"].map((t=>[t,ue.WAV])),...["wma"].map((t=>[t,ue.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,ue.WORD])),...["xml","xsl","rdf"].map((t=>[t,ue.XML])),...["yaml","yml","x-yaml"].map((t=>[t,ue.YAML])),...["zip"].map((t=>[t,ue.ZIP]))]);const ye={size:ct.create("--ft-icon-font-size","SIZE","24px"),fluidTopicsFontFamily:ct.extend("--ft-icon-fluid-topics-font-family",ct.create("--ft-icon-font-family","UNKNOWN","ft-icons")),fileFormatFontFamily:ct.extend("--ft-icon-file-format-font-family",ct.create("--ft-icon-font-family","UNKNOWN","ft-mime")),materialFontFamily:ct.extend("--ft-icon-material-font-family",ct.create("--ft-icon-font-family","UNKNOWN","Material Icons")),verticalAlign:ct.create("--ft-icon-vertical-align","UNKNOWN","unset")},xe=y`
|
|
370
|
+
:host {
|
|
371
|
+
display: inline-block;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
:host, i.ft-icon {
|
|
375
|
+
width: ${ye.size};
|
|
376
|
+
height: ${ye.size};
|
|
377
|
+
text-align: center;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
i.ft-icon {
|
|
381
|
+
font-size: ${ye.size};
|
|
382
|
+
line-height: 1;
|
|
383
|
+
font-weight: normal;
|
|
384
|
+
text-transform: none;
|
|
385
|
+
font-style: normal;
|
|
386
|
+
font-variant: normal;
|
|
387
|
+
speak: none;
|
|
388
|
+
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
|
|
389
|
+
text-rendering: auto;
|
|
390
|
+
-webkit-font-smoothing: antialiased;
|
|
391
|
+
-moz-osx-font-smoothing: grayscale;
|
|
392
|
+
vertical-align: ${ye.verticalAlign};
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.ft-icon--fluid-topics {
|
|
396
|
+
font-family: ${ye.fluidTopicsFontFamily}, ft-icons, fticons, sans-serif;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.ft-icon--file-format {
|
|
400
|
+
font-family: ${ye.fileFormatFontFamily}, ft-mime, sans-serif;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.ft-icon--material {
|
|
404
|
+
font-family: ${ye.materialFontFamily}, "Material Icons", sans-serif;
|
|
405
|
+
}
|
|
406
|
+
`;var ve;!function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(ve||(ve={}));var ge=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class be extends xt{constructor(){super(...arguments),this.variant=ve.fluid_topics,this.resolvedIcon=K}render(){const t="material"!==this.variant||this.value;return I`
|
|
370
407
|
<i class="ft-icon ${"ft-icon--"+this.variant}">
|
|
371
|
-
${
|
|
408
|
+
${fe(this.resolvedIcon)}
|
|
372
409
|
<slot ?hidden=${t}></slot>
|
|
373
410
|
</i>
|
|
374
|
-
`}get textContent(){var t,i;return null!==(i=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==i?i:""}update(t){super.update(t),["value","variant"].some((i=>t.has(i)))&&this.resolveIcon()}resolveIcon(){var t,i;let e=this.value||this.textContent;switch(this.variant){case
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
flex-shrink: 0;
|
|
490
|
-
color: ${xe.iconColor};
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
.ft-switch-option--input:checked + .ft-switch-option--content ft-icon {
|
|
494
|
-
color: ${xe.selectedTextColor};
|
|
495
|
-
}
|
|
496
|
-
`}focus(){this.input.focus()}updated(t){super.updated(t),t.has("selected")&&this.dispatchEvent(new be)}render(){const t={"ft-switch-option":!0,"ft-switch-option--trailing-icon":this.trailingIcon};return this.addTooltip(I`
|
|
411
|
+
`}get textContent(){var t,i;return null!==(i=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==i?i:""}update(t){super.update(t),["value","variant"].some((i=>t.has(i)))&&this.resolveIcon()}resolveIcon(){var t,i;let e=this.value||this.textContent;switch(this.variant){case ve.file_format:this.resolvedIcon=null!==(t=ue[e.toUpperCase()])&&void 0!==t?t:e;break;case ve.fluid_topics:this.resolvedIcon=null!==(i=de[e.toUpperCase()])&&void 0!==i?i:e;break;default:this.resolvedIcon=this.value||K}}firstUpdated(t){super.firstUpdated(t),setTimeout((()=>{this.resolveIcon()}))}}be.elementDefinitions={},be.styles=xe,ge([o()],be.prototype,"variant",void 0),ge([o()],be.prototype,"value",void 0),ge([s()],be.prototype,"resolvedIcon",void 0),ge([r("slot")],be.prototype,"slottedContent",void 0),h("ft-icon")(be);const me={textColor:ct.extend("--ft-switch-text-color",ft.colorOnSurfaceHigh),backgroundColor:ct.extend("--ft-switch-background-color",ft.colorSurface),selectedTextColor:ct.extend("--ft-switch-selected-text-color",ft.colorPrimary),selectedBackgroundColor:ct.extend("--ft-switch-selected-background-color",ft.colorPrimary),borderColor:ct.extend("--ft-switch-border-color",ft.colorOutline),borderRadius:ct.extend("--ft-switch-border-radius",ft.borderRadiusL),fontSize:ct.extend("--ft-switch-font-size",Di.fontSize),iconSize:ct.create("--ft-switch-icon-size","SIZE","24px"),iconColor:ct.extend("--ft-switch-text-color",ft.colorOnSurfaceMedium),rippleColor:ct.extend("--ft-switch-ripple-color",ft.colorPrimary),outlineColor:ct.extend("--ft-switch-outline-color",ft.colorPrimary)},we=y`
|
|
412
|
+
:host {
|
|
413
|
+
display: inline-block;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.ft-switch {
|
|
417
|
+
border-radius: ${me.borderRadius};
|
|
418
|
+
outline-color: ${me.outlineColor};
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
.ft-switch slot {
|
|
422
|
+
display: flex;
|
|
423
|
+
align-items: center;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
.ft-switch slot::slotted(ft-switch-option) {
|
|
427
|
+
${pt($e.borderRadiusLeft,"0")};
|
|
428
|
+
${pt($e.borderRadiusRight,"0")};
|
|
429
|
+
${pt($e.borderWidthLeft,"0")};
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
.ft-switch slot::slotted(ft-switch-option:first-child) {
|
|
433
|
+
${pt($e.borderRadiusLeft,me.borderRadius)};
|
|
434
|
+
${pt($e.borderWidthLeft,"1px")};
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.ft-switch slot::slotted(ft-switch-option:last-child) {
|
|
438
|
+
${pt($e.borderRadiusRight,me.borderRadius)};
|
|
439
|
+
}
|
|
440
|
+
`,$e={borderRadiusLeft:ct.extend("--ft-switch-option-border-radius-left",ft.borderRadiusL),borderRadiusRight:ct.extend("--ft-switch-option-border-radius-right",ft.borderRadiusL),borderWidthLeft:ct.create("--ft-switch-option-border-width-left","SIZE","1px"),borderWidthRight:ct.create("--ft-switch-option-border-width-right","SIZE","1px"),borderWidthVertical:ct.create("--ft-switch-option-border-width-vertical","SIZE","1px")},Oe=y`
|
|
441
|
+
.ft-switch-option {
|
|
442
|
+
position: relative;
|
|
443
|
+
display: inline-block;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
.ft-switch-option--input {
|
|
447
|
+
position: absolute;
|
|
448
|
+
opacity: 0;
|
|
449
|
+
width: 0;
|
|
450
|
+
height: 0;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
.ft-switch-option--content {
|
|
454
|
+
--ft-switch-option-internal-line-height: calc(${me.fontSize} + 2px);
|
|
455
|
+
--ft-switch-option-internal-content-height: max(var(--ft-switch-option-internal-line-height), ${me.iconSize});
|
|
456
|
+
|
|
457
|
+
border-style: solid;
|
|
458
|
+
border-color: ${me.borderColor};
|
|
459
|
+
border-width: ${$e.borderWidthVertical} ${$e.borderWidthRight} ${$e.borderWidthVertical} ${$e.borderWidthLeft};
|
|
460
|
+
border-radius: ${$e.borderRadiusLeft} ${$e.borderRadiusRight} ${$e.borderRadiusRight} ${$e.borderRadiusLeft};
|
|
461
|
+
display: flex;
|
|
462
|
+
align-items: center;
|
|
463
|
+
justify-content: center;
|
|
464
|
+
overflow: hidden;
|
|
465
|
+
|
|
466
|
+
${pt(ye.size,me.iconSize)};
|
|
467
|
+
padding: 6px 8px;
|
|
468
|
+
background-color: ${me.backgroundColor};
|
|
469
|
+
-webkit-mask-image: radial-gradient(white, black);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
.ft-switch-option--content > *:not(ft-ripple) {
|
|
473
|
+
position: relative;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
.ft-switch-option--input:checked + .ft-switch-option--content:before {
|
|
477
|
+
background-color: ${me.selectedBackgroundColor};
|
|
478
|
+
border-radius: ${$e.borderRadiusLeft} ${$e.borderRadiusRight} ${$e.borderRadiusRight} ${$e.borderRadiusLeft};
|
|
479
|
+
position: absolute;
|
|
480
|
+
inset: 0;
|
|
481
|
+
content: "";
|
|
482
|
+
z-index: 1;
|
|
483
|
+
opacity: ${ft.opacityPrimaryOnSurfaceSelected};
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
.ft-switch-option--label {
|
|
487
|
+
color: ${me.textColor};
|
|
488
|
+
overflow: hidden;
|
|
489
|
+
white-space: nowrap;
|
|
490
|
+
text-overflow: ellipsis;
|
|
491
|
+
display: block;
|
|
492
|
+
margin: 0 8px;
|
|
493
|
+
${pt(Di.fontSize,me.fontSize)};
|
|
494
|
+
${pt(Di.lineHeight,"var(--ft-switch-option-internal-content-height)")}
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
.ft-switch-option--input:checked + .ft-switch-option--content .ft-switch-option--label {
|
|
498
|
+
color: ${me.selectedTextColor};
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
.ft-switch-option--label[hidden] {
|
|
502
|
+
display: none;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
.ft-switch-option--ripple {
|
|
506
|
+
${pt(Ot.color,me.rippleColor)};
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
ft-icon, ft-ripple, ft-typography {
|
|
510
|
+
z-index: 2;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
.ft-switch-option:not(.ft-switch-option--trailing-icon) ft-icon {
|
|
514
|
+
order: -1;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
ft-icon {
|
|
518
|
+
flex-shrink: 0;
|
|
519
|
+
color: ${me.iconColor};
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
.ft-switch-option--input:checked + .ft-switch-option--content ft-icon {
|
|
523
|
+
color: ${me.selectedTextColor};
|
|
524
|
+
}
|
|
525
|
+
`;var Se=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class ke extends CustomEvent{constructor(){super("option-change",{bubbles:!0})}}class Ce extends xt{constructor(){super(...arguments),this.value="",this.label="",this.tooltipPosition="bottom",this.selected=!1,this.trailingIcon=!1}focus(){this.input.focus()}updated(t){super.updated(t),t.has("selected")&&this.dispatchEvent(new ke)}render(){const t={"ft-switch-option":!0,"ft-switch-option--trailing-icon":this.trailingIcon};return this.addTooltip(I`
|
|
497
526
|
<label for="input" class=${wt(t)}>
|
|
498
527
|
<input id="input" type="radio" class="ft-switch-option--input"
|
|
499
528
|
.checked=${this.selected}
|
|
@@ -514,38 +543,9 @@ class ae extends mt{constructor(t){if(super(t),this.it=K,t.type!==gt)throw Error
|
|
|
514
543
|
${t}
|
|
515
544
|
</ft-tooltip>
|
|
516
545
|
`}onChange(){this.selected=!0}getLabel(){return this.label||this.textContent}resolveIcon(){return this.icon?I`
|
|
517
|
-
<ft-icon variant="material">${this.icon}</ft-icon> `:K}get textContent(){var t,i;return null!==(i=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==i?i:""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}}
|
|
518
|
-
:host {
|
|
519
|
-
display: inline-block;
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
.ft-switch {
|
|
523
|
-
border-radius: ${xe.borderRadius};
|
|
524
|
-
outline-color: ${xe.outlineColor};
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
.ft-switch slot {
|
|
528
|
-
display: flex;
|
|
529
|
-
align-items: center;
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
.ft-switch slot::slotted(ft-switch-option) {
|
|
533
|
-
${pt(ve.borderRadiusLeft,"0")};
|
|
534
|
-
${pt(ve.borderRadiusRight,"0")};
|
|
535
|
-
${pt(ve.borderWidthLeft,"0")};
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
.ft-switch slot::slotted(ft-switch-option:first-child) {
|
|
539
|
-
${pt(ve.borderRadiusLeft,xe.borderRadius)};
|
|
540
|
-
${pt(ve.borderWidthLeft,"1px")};
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
.ft-switch slot::slotted(ft-switch-option:last-child) {
|
|
544
|
-
${pt(ve.borderRadiusRight,xe.borderRadius)};
|
|
545
|
-
}
|
|
546
|
-
`}render(){return I`
|
|
546
|
+
<ft-icon variant="material">${this.icon}</ft-icon> `:K}get textContent(){var t,i;return null!==(i=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==i?i:""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}}Ce.elementDefinitions={"ft-ripple":Ft,"ft-typography":ie,"ft-tooltip":ce,"ft-icon":be},Ce.styles=Oe,Se([o({type:String})],Ce.prototype,"value",void 0),Se([o({type:String})],Ce.prototype,"icon",void 0),Se([o({type:String})],Ce.prototype,"label",void 0),Se([o({type:String})],Ce.prototype,"tooltipPosition",void 0),Se([o({type:Boolean,reflect:!0})],Ce.prototype,"selected",void 0),Se([o({type:Boolean})],Ce.prototype,"trailingIcon",void 0),Se([r(".ft-switch-option--content slot")],Ce.prototype,"slottedContent",void 0),Se([r(".ft-switch-option--input")],Ce.prototype,"input",void 0);var Ne=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Ee extends CustomEvent{constructor(t){super("change",{detail:t})}}class Re extends xt{constructor(){super(...arguments),this.options=[]}get value(){var t;return null===(t=this.selectedOption)||void 0===t?void 0:t.value}updated(t){var i;super.updated(t),t.has("selectedOption")&&(this.updateOptions(),this.dispatchEvent(new Ee(null===(i=this.selectedOption)||void 0===i?void 0:i.value)))}render(){return I`
|
|
547
547
|
<div class="ft-switch" @keydown=${this.onKeyDown} tabindex="0">
|
|
548
548
|
<slot @slotchange=${this.onSlotchange}
|
|
549
549
|
@option-change=${this.onOptionChange}></slot>
|
|
550
550
|
</div>
|
|
551
|
-
`}onKeyDown(t){let i;"ArrowDown"!=t.key&&"ArrowRight"!=t.key||(i=this.selectedOption?this.options.indexOf(this.selectedOption)+1:0),"ArrowUp"!=t.key&&"ArrowLeft"!=t.key||(i=this.selectedOption?this.options.indexOf(this.selectedOption)-1:this.options.length-1),null!=i&&(t.preventDefault(),this.options[this.fixIndex(i)].selected=!0)}fixIndex(t){return t<0?this.options.length-1:t>this.options.length-1?0:t}onSlotchange(){var t;this.options=[],null===(t=this.slottedContent)||void 0===t||t.assignedElements().forEach((t=>{t instanceof
|
|
551
|
+
`}onKeyDown(t){let i;"ArrowDown"!=t.key&&"ArrowRight"!=t.key||(i=this.selectedOption?this.options.indexOf(this.selectedOption)+1:0),"ArrowUp"!=t.key&&"ArrowLeft"!=t.key||(i=this.selectedOption?this.options.indexOf(this.selectedOption)-1:this.options.length-1),null!=i&&(t.preventDefault(),this.options[this.fixIndex(i)].selected=!0)}fixIndex(t){return t<0?this.options.length-1:t>this.options.length-1?0:t}onSlotchange(){var t;this.options=[],null===(t=this.slottedContent)||void 0===t||t.assignedElements().forEach((t=>{t instanceof Ce&&this.registerOption(t)})),this.selectedOption=this.options.find((t=>t.selected))}registerOption(t){t.setAttribute("tabindex","-1"),this.options.push(t)}onOptionChange(t){let i=t.target;i.selected?this.selectedOption=i:this.selectedOption=this.options.find((t=>t.selected))}focus(){this.ftSwitchDiv.focus()}updateOptions(){this.options.forEach((t=>{t.selected=t==this.selectedOption}))}}Re.elementDefinitions={},Re.styles=we,Ne([r(".ft-switch slot")],Re.prototype,"slottedContent",void 0),Ne([s()],Re.prototype,"selectedOption",void 0),Ne([r(".ft-switch")],Re.prototype,"ftSwitchDiv",void 0),h("ft-switch")(Re),h("ft-switch-option")(Ce),t.FtSwitch=Re,t.FtSwitchChange=Ee,t.FtSwitchCssVariables=me,t.FtSwitchOption=Ce,t.FtSwitchOptionCssVariables=$e,t.SwitchOptionChange=ke,t.optionStyles=Oe,t.styles=we,Object.defineProperty(t,"i",{value:!0})}({});
|