@fluid-topics/ft-switch 0.3.53 → 0.3.55
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.d.ts +1 -1
- package/build/ft-switch-option.js +8 -5
- package/build/ft-switch.light.js +3 -3
- package/build/ft-switch.min.js +165 -155
- package/package.json +7 -7
|
@@ -8,7 +8,7 @@ export declare class SwitchOptionChange extends CustomEvent<void> {
|
|
|
8
8
|
}
|
|
9
9
|
export declare class FtSwitchOption extends FtLitElement implements FtSwitchOptionProperties {
|
|
10
10
|
static elementDefinitions: ElementDefinitionsMap;
|
|
11
|
-
static styles: import("lit").CSSResult;
|
|
11
|
+
static styles: import("lit").CSSResult[];
|
|
12
12
|
value: any;
|
|
13
13
|
icon?: string;
|
|
14
14
|
iconVariant?: FtIconVariants;
|
|
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { html, nothing } from "lit";
|
|
8
8
|
import { property, query } from "lit/decorators.js";
|
|
9
|
-
import { FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
9
|
+
import { FtLitElement, isSafari, safariEllipsisFix } from "@fluid-topics/ft-wc-utils";
|
|
10
10
|
import { FtRipple } from "@fluid-topics/ft-ripple";
|
|
11
11
|
import { FtTypography } from "@fluid-topics/ft-typography";
|
|
12
12
|
import { classMap } from "lit/directives/class-map.js";
|
|
@@ -41,7 +41,7 @@ export class FtSwitchOption extends FtLitElement {
|
|
|
41
41
|
render() {
|
|
42
42
|
const classes = {
|
|
43
43
|
"ft-switch-option": true,
|
|
44
|
-
"ft-switch-option--trailing-icon": this.trailingIcon
|
|
44
|
+
"ft-switch-option--trailing-icon": this.trailingIcon
|
|
45
45
|
};
|
|
46
46
|
return this.addTooltip(html `
|
|
47
47
|
<label part="label" for="input" class=${classMap(classes)}>
|
|
@@ -52,7 +52,7 @@ export class FtSwitchOption extends FtLitElement {
|
|
|
52
52
|
<ft-ripple part="ripple" class="ft-switch-option--ripple"></ft-ripple>
|
|
53
53
|
<ft-typography part="text"
|
|
54
54
|
variant="button"
|
|
55
|
-
class="ft-switch-option--label"
|
|
55
|
+
class="ft-switch-option--label ${isSafari ? "ft-safari-ellipsis-fix" : ""}"
|
|
56
56
|
?hidden=${!this.hasTextContent()}>
|
|
57
57
|
<slot @slotchange=${this.onSlotchange}></slot>
|
|
58
58
|
</ft-typography>
|
|
@@ -78,7 +78,7 @@ export class FtSwitchOption extends FtLitElement {
|
|
|
78
78
|
}
|
|
79
79
|
resolveIcon() {
|
|
80
80
|
return this.icon ? html `
|
|
81
|
-
<ft-icon part="icon" .variant=${this.iconVariant}
|
|
81
|
+
<ft-icon part="icon" .variant=${this.iconVariant} value=${this.icon}></ft-icon>
|
|
82
82
|
` : nothing;
|
|
83
83
|
}
|
|
84
84
|
get textContent() {
|
|
@@ -98,7 +98,10 @@ FtSwitchOption.elementDefinitions = {
|
|
|
98
98
|
"ft-tooltip": FtTooltip,
|
|
99
99
|
"ft-icon": FtIcon
|
|
100
100
|
};
|
|
101
|
-
FtSwitchOption.styles =
|
|
101
|
+
FtSwitchOption.styles = [
|
|
102
|
+
safariEllipsisFix,
|
|
103
|
+
optionStyles
|
|
104
|
+
];
|
|
102
105
|
__decorate([
|
|
103
106
|
property()
|
|
104
107
|
], FtSwitchOption.prototype, "value", void 0);
|
package/build/ft-switch.light.js
CHANGED
|
@@ -407,7 +407,7 @@ const J=Symbol.for(""),Q=t=>{if((null==t?void 0:t.r)===J)return null==t?void 0:t
|
|
|
407
407
|
<ft-ripple part="ripple" class="ft-switch-option--ripple"></ft-ripple>
|
|
408
408
|
<ft-typography part="text"
|
|
409
409
|
variant="button"
|
|
410
|
-
class="ft-switch-option--label"
|
|
410
|
+
class="ft-switch-option--label ${i.isSafari?"ft-safari-ellipsis-fix":""}"
|
|
411
411
|
?hidden=${!this.hasTextContent()}>
|
|
412
412
|
<slot @slotchange=${this.onSlotchange}></slot>
|
|
413
413
|
</ft-typography>
|
|
@@ -421,8 +421,8 @@ const J=Symbol.for(""),Q=t=>{if((null==t?void 0:t.r)===J)return null==t?void 0:t
|
|
|
421
421
|
${t}
|
|
422
422
|
</ft-tooltip>
|
|
423
423
|
`}onChange(){this.selected=!this.unselectable||!this.selected}getLabel(){return this.label||this.textContent}resolveIcon(){return this.icon?e.html`
|
|
424
|
-
<ft-icon part="icon" .variant=${this.iconVariant}
|
|
425
|
-
`:e.nothing}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()}}Di.elementDefinitions={"ft-ripple":y,"ft-typography":mi,"ft-tooltip":Ei,"ft-icon":Ri},Di.styles=Mi,Wi([o.property()],Di.prototype,"value",void 0),Wi([o.property()],Di.prototype,"icon",void 0),Wi([o.property()],Di.prototype,"iconVariant",void 0),Wi([o.property()],Di.prototype,"label",void 0),Wi([o.property()],Di.prototype,"tooltipPosition",void 0),Wi([o.property({type:Boolean,reflect:!0})],Di.prototype,"selected",void 0),Wi([o.property({type:Boolean})],Di.prototype,"trailingIcon",void 0),Wi([o.property({type:Boolean})],Di.prototype,"unselectable",void 0),Wi([o.query(".ft-switch-option--content slot")],Di.prototype,"slottedContent",void 0),Wi([o.query(".ft-switch-option--input")],Di.prototype,"input",void 0);var Ki=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 Li extends CustomEvent{constructor(t){super("change",{detail:t})}}class Gi extends i.FtLitElement{constructor(){super(...arguments),this.dense=!1,this.unselectable=!1,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 Li(null===(i=this.selectedOption)||void 0===i?void 0:i.value))),t.has("unselectable")&&this.options.forEach((t=>t.unselectable=this.unselectable))}render(){const t={"ft-switch":!0,"ft-switch--dense":this.dense};return e.html`
|
|
424
|
+
<ft-icon part="icon" .variant=${this.iconVariant} value=${this.icon}></ft-icon>
|
|
425
|
+
`:e.nothing}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()}}Di.elementDefinitions={"ft-ripple":y,"ft-typography":mi,"ft-tooltip":Ei,"ft-icon":Ri},Di.styles=[i.safariEllipsisFix,Mi],Wi([o.property()],Di.prototype,"value",void 0),Wi([o.property()],Di.prototype,"icon",void 0),Wi([o.property()],Di.prototype,"iconVariant",void 0),Wi([o.property()],Di.prototype,"label",void 0),Wi([o.property()],Di.prototype,"tooltipPosition",void 0),Wi([o.property({type:Boolean,reflect:!0})],Di.prototype,"selected",void 0),Wi([o.property({type:Boolean})],Di.prototype,"trailingIcon",void 0),Wi([o.property({type:Boolean})],Di.prototype,"unselectable",void 0),Wi([o.query(".ft-switch-option--content slot")],Di.prototype,"slottedContent",void 0),Wi([o.query(".ft-switch-option--input")],Di.prototype,"input",void 0);var Ki=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 Li extends CustomEvent{constructor(t){super("change",{detail:t})}}class Gi extends i.FtLitElement{constructor(){super(...arguments),this.dense=!1,this.unselectable=!1,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 Li(null===(i=this.selectedOption)||void 0===i?void 0:i.value))),t.has("unselectable")&&this.options.forEach((t=>t.unselectable=this.unselectable))}render(){const t={"ft-switch":!0,"ft-switch--dense":this.dense};return e.html`
|
|
426
426
|
<div @keydown=${this.onKeyDown} tabindex="0" class="${s.classMap(t)}">
|
|
427
427
|
<slot @slotchange=${this.onSlotchange}
|
|
428
428
|
@option-change=${this.onOptionChange}></slot>
|
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(){v.push(this),o.upgrade.apply(o,arguments),v.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=v[v.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 v=[document];const x=(t,i,e)=>{const o=(e?Object.getPrototypeOf(e):t.prototype)[i];t.prototype[i]=function(){v.push(this);const t=o.apply(e||this,arguments);return void 0!==t&&l.set(t,this),v.pop(),t}};x(ShadowRoot,"createElement",document),x(ShadowRoot,"importNode",document),x(Element,"insertAdjacentHTML");const g=(t,i)=>{const e=Object.getOwnPropertyDescriptor(t.prototype,i);Object.defineProperty(t.prototype,i,{...e,set(t){v.push(this),e.set.call(this,t),v.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(){v.push(this),o.upgrade.apply(o,arguments),v.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=v[v.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 v=[document];const x=(t,i,e)=>{const o=(e?Object.getPrototypeOf(e):t.prototype)[i];t.prototype[i]=function(){v.push(this);const t=o.apply(e||this,arguments);return void 0!==t&&l.set(t,this),v.pop(),t}};x(ShadowRoot,"createElement",document),x(ShadowRoot,"importNode",document),x(Element,"insertAdjacentHTML");const g=(t,i)=>{const e=Object.getOwnPropertyDescriptor(t.prototype,i);Object.defineProperty(t.prototype,i,{...e,set(t){v.push(this),e.set.call(this,t),v.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(xe){const t=window.customElements.define;window.customElements.define=(i,e,o)=>{try{t.bind(window.customElements)(i,e,o)}catch(t){console.info(i,e,o,t)}}}class i{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,i){return this.callbacks=[t],this.debounce(i)}queue(t,i){return this.callbacks.push(t),this.debounce(i)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(t){return null==this.promise&&(this.promise=new Promise(((t,i)=>{this.resolvePromise=t,this.rejectPromise=i}))),this.clearTimeout(),this._debounce=window.setTimeout((()=>this.runCallbacks()),null!=t?t:this.timeout),this.promise}async runCallbacks(){var t,i;const e=[...this.callbacks];this.callbacks=[];const o=null!==(t=this.rejectPromise)&&void 0!==t?t:()=>null,s=null!==(i=this.resolvePromise)&&void 0!==i?i:()=>null;this.clearPromise();for(let t of e)try{await t()}catch(t){return void o(t)}s(!0)}clearTimeout(){null!=this._debounce&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}}
|
|
18
18
|
/**
|
|
19
19
|
* @license
|
|
20
20
|
* Copyright 2017 Google LLC
|
|
@@ -67,12 +67,12 @@ var ht,ct;class pt extends N{constructor(){super(...arguments),this.renderOption
|
|
|
67
67
|
* @license
|
|
68
68
|
* Copyright 2021 Google LLC
|
|
69
69
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
70
|
-
*/var vt
|
|
70
|
+
*/var vt=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 xt extends(function(t){return class extends t{createRenderRoot(){const t=this.constructor,{registry:i,elementDefinitions:e,shadowRootOptions:o}=t;e&&!i&&(t.registry=new CustomElementRegistry,Object.entries(e).forEach((([i,e])=>t.registry.define(i,e))));const s=this.renderOptions.creationScope=this.attachShadow({...o,customElements:t.registry});return x(s,this.constructor.elementStyles),s}}}(pt)){constructor(){super(),this.exportpartsDebouncer=new i(5),this.constructorName=this.constructor.name,this.constructorPrototype=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this.constructorName&&Object.setPrototypeOf(this,this.constructorPrototype)}getStyles(){return[]}getTemplate(){return null}render(){let t=this.getStyles();return Array.isArray(t)||(t=[t]),Z`
|
|
71
71
|
${t.map((t=>Z`
|
|
72
72
|
<style>${t}</style>
|
|
73
73
|
`))}
|
|
74
74
|
${this.getTemplate()}
|
|
75
|
-
`}updated(t){super.updated(t),setTimeout((()=>{this.contentAvailableCallback(t),this.scheduleExportpartsUpdate()}),0)}contentAvailableCallback(t){var i,e;if((null!==(e=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelectorAll(".ft-lit-element--custom-stylesheet"))&&void 0!==e?e:[]).forEach((t=>t.remove())),this.customStylesheet){const t=document.createElement("style");t.classList.add("ft-lit-element--custom-stylesheet"),t.innerHTML=this.customStylesheet,this.shadowRoot.append(t)}}scheduleExportpartsUpdate(){this.exportpartsDebouncer.run((()=>{var t;(null===(t=this.exportpartsPrefix)||void 0===t?void 0:t.trim())?this.setExportpartsAttribute([this.exportpartsPrefix]):null!=this.exportpartsPrefixes&&this.exportpartsPrefixes.length>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)}))}setExportpartsAttribute(t){var i,e,o,s,n,r;const l=t=>null!=t&&t.trim().length>0,a=t.filter(l).map((t=>t.trim()));if(0===a.length)return void this.removeAttribute("exportparts");const h=new Set;for(let t of null!==(e=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelectorAll("[part],[exportparts]"))&&void 0!==e?e:[]){const i=null!==(s=null===(o=t.getAttribute("part"))||void 0===o?void 0:o.split(" "))&&void 0!==s?s:[],e=null!==(r=null===(n=t.getAttribute("exportparts"))||void 0===n?void 0:n.split(",").map((t=>t.split(":")[1])))&&void 0!==r?r:[];new Array(...i,...e).filter(l).map((t=>t.trim())).forEach((t=>h.add(t)))}if(0===h.size)return void this.removeAttribute("exportparts");const c=[...h.values()].flatMap((t=>a.map((i=>`${t}:${i}--${t}`))));this.setAttribute("exportparts",[...this.part,...c].join(", "))}}
|
|
75
|
+
`}updated(t){super.updated(t),setTimeout((()=>{this.contentAvailableCallback(t),this.scheduleExportpartsUpdate()}),0)}contentAvailableCallback(t){var i,e;if((null!==(e=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelectorAll(".ft-lit-element--custom-stylesheet"))&&void 0!==e?e:[]).forEach((t=>t.remove())),this.customStylesheet){const t=document.createElement("style");t.classList.add("ft-lit-element--custom-stylesheet"),t.innerHTML=this.customStylesheet,this.shadowRoot.append(t)}}scheduleExportpartsUpdate(){this.exportpartsDebouncer.run((()=>{var t;(null===(t=this.exportpartsPrefix)||void 0===t?void 0:t.trim())?this.setExportpartsAttribute([this.exportpartsPrefix]):null!=this.exportpartsPrefixes&&this.exportpartsPrefixes.length>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)}))}setExportpartsAttribute(t){var i,e,o,s,n,r;const l=t=>null!=t&&t.trim().length>0,a=t.filter(l).map((t=>t.trim()));if(0===a.length)return void this.removeAttribute("exportparts");const h=new Set;for(let t of null!==(e=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelectorAll("[part],[exportparts]"))&&void 0!==e?e:[]){const i=null!==(s=null===(o=t.getAttribute("part"))||void 0===o?void 0:o.split(" "))&&void 0!==s?s:[],e=null!==(r=null===(n=t.getAttribute("exportparts"))||void 0===n?void 0:n.split(",").map((t=>t.split(":")[1])))&&void 0!==r?r:[];new Array(...i,...e).filter(l).map((t=>t.trim())).forEach((t=>h.add(t)))}if(0===h.size)return void this.removeAttribute("exportparts");const c=[...h.values()].flatMap((t=>a.map((i=>`${t}:${i}--${t}`))));this.setAttribute("exportparts",[...this.part,...c].join(", "))}}vt([o()],xt.prototype,"exportpartsPrefix",void 0),vt([function(t,i){const e=()=>JSON.parse(JSON.stringify(t));return o({type:Object,converter:{fromAttribute:t=>{if(null==t)return e();try{return JSON.parse(t)}catch{return e()}},toAttribute:t=>JSON.stringify(t)},...null!=i?i:{}})}([])],xt.prototype,"exportpartsPrefixes",void 0),vt([o()],xt.prototype,"customStylesheet",void 0),v`
|
|
76
76
|
.ft-no-text-select {
|
|
77
77
|
-webkit-touch-callout: none;
|
|
78
78
|
-webkit-user-select: none;
|
|
@@ -93,18 +93,28 @@ var ht,ct;class pt extends N{constructor(){super(...arguments),this.renderOption
|
|
|
93
93
|
-webkit-hyphens: auto;
|
|
94
94
|
hyphens: auto
|
|
95
95
|
}
|
|
96
|
-
|
|
96
|
+
`;const gt=v`
|
|
97
|
+
.ft-safari-ellipsis-fix {
|
|
98
|
+
margin-right: 0;
|
|
99
|
+
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.ft-safari-ellipsis-fix:after {
|
|
103
|
+
content: "\\0000a0";
|
|
104
|
+
display: inline-block;
|
|
105
|
+
width: 0;
|
|
106
|
+
}
|
|
107
|
+
`;var bt,mt,wt;const $t=navigator.vendor&&!!navigator.vendor.match(/apple/i)||"[object SafariRemoteNotification]"===(null!==(wt=null===(mt=null===(bt=window.safari)||void 0===bt?void 0:bt.pushNotification)||void 0===mt?void 0:mt.toString())&&void 0!==wt?wt:""),Ot=1,St=2,kt=t=>(...i)=>({_$litDirective$:t,values:i});
|
|
97
108
|
/**
|
|
98
109
|
* @license
|
|
99
110
|
* Copyright 2017 Google LLC
|
|
100
111
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
101
|
-
*/
|
|
102
|
-
const mt=1,wt=2,$t=t=>(...i)=>({_$litDirective$:t,values:i});class Ot{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,e){this._$Ct=t,this._$AM=i,this._$Ci=e}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}}
|
|
112
|
+
*/class Ct{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,e){this._$Ct=t,this._$AM=i,this._$Ci=e}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}}
|
|
103
113
|
/**
|
|
104
114
|
* @license
|
|
105
115
|
* Copyright 2018 Google LLC
|
|
106
116
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
107
|
-
*/const
|
|
117
|
+
*/const Nt=kt(class extends Ct{constructor(t){var i;if(super(t),t.type!==Ot||"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 V}}),Et=dt.extend("--ft-ripple-color",yt.colorContent),Rt={color:Et,backgroundColor:dt.extend("--ft-ripple-background-color",Et),opacityContentOnSurfacePressed:dt.external(yt.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:dt.external(yt.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:dt.external(yt.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:dt.external(yt.opacityContentOnSurfaceSelected,"Design system")},Mt=dt.extend("--ft-ripple-color",yt.colorPrimary),Ut=Mt,Ft=dt.extend("--ft-ripple-background-color",Mt),zt=dt.extend("--ft-ripple-color",yt.colorSecondary),jt=zt,At=dt.extend("--ft-ripple-background-color",zt),Lt=v`
|
|
108
118
|
:host {
|
|
109
119
|
display: contents;
|
|
110
120
|
}
|
|
@@ -126,27 +136,27 @@ const mt=1,wt=2,$t=t=>(...i)=>({_$litDirective$:t,values:i});class Ot{constructo
|
|
|
126
136
|
}
|
|
127
137
|
|
|
128
138
|
.ft-ripple .ft-ripple--background {
|
|
129
|
-
background-color: ${
|
|
139
|
+
background-color: ${Rt.backgroundColor};
|
|
130
140
|
}
|
|
131
141
|
|
|
132
142
|
.ft-ripple .ft-ripple--effect {
|
|
133
|
-
background-color: ${
|
|
143
|
+
background-color: ${Rt.color};
|
|
134
144
|
}
|
|
135
145
|
|
|
136
146
|
.ft-ripple.ft-ripple--secondary .ft-ripple--background {
|
|
137
|
-
background-color: ${
|
|
147
|
+
background-color: ${At};
|
|
138
148
|
}
|
|
139
149
|
|
|
140
150
|
.ft-ripple.ft-ripple--secondary .ft-ripple--effect {
|
|
141
|
-
background-color: ${
|
|
151
|
+
background-color: ${jt};
|
|
142
152
|
}
|
|
143
153
|
|
|
144
154
|
.ft-ripple.ft-ripple--primary .ft-ripple--background {
|
|
145
|
-
background-color: ${
|
|
155
|
+
background-color: ${Ft};
|
|
146
156
|
}
|
|
147
157
|
|
|
148
158
|
.ft-ripple.ft-ripple--primary .ft-ripple--effect {
|
|
149
|
-
background-color: ${
|
|
159
|
+
background-color: ${Ut};
|
|
150
160
|
}
|
|
151
161
|
|
|
152
162
|
.ft-ripple .ft-ripple--background {
|
|
@@ -178,22 +188,22 @@ const mt=1,wt=2,$t=t=>(...i)=>({_$litDirective$:t,values:i});class Ot{constructo
|
|
|
178
188
|
}
|
|
179
189
|
|
|
180
190
|
.ft-ripple.ft-ripple--hovered .ft-ripple--background {
|
|
181
|
-
opacity: ${
|
|
191
|
+
opacity: ${Rt.opacityContentOnSurfaceHover};
|
|
182
192
|
}
|
|
183
193
|
|
|
184
194
|
.ft-ripple.ft-ripple--selected .ft-ripple--background {
|
|
185
|
-
opacity: ${
|
|
195
|
+
opacity: ${Rt.opacityContentOnSurfaceSelected};
|
|
186
196
|
}
|
|
187
197
|
|
|
188
198
|
.ft-ripple.ft-ripple--focused .ft-ripple--background {
|
|
189
|
-
opacity: ${
|
|
199
|
+
opacity: ${Rt.opacityContentOnSurfaceFocused};
|
|
190
200
|
}
|
|
191
201
|
|
|
192
202
|
.ft-ripple.ft-ripple--pressed .ft-ripple--effect {
|
|
193
|
-
opacity: ${
|
|
203
|
+
opacity: ${Rt.opacityContentOnSurfacePressed};
|
|
194
204
|
transform: translate(-50%, -50%) scale(1);
|
|
195
205
|
}
|
|
196
|
-
`;var
|
|
206
|
+
`;var Bt=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 Tt 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 Z`
|
|
197
207
|
<style>
|
|
198
208
|
.ft-ripple .ft-ripple--effect,
|
|
199
209
|
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
@@ -206,119 +216,119 @@ const mt=1,wt=2,$t=t=>(...i)=>({_$litDirective$:t,values:i});class Ot{constructo
|
|
|
206
216
|
top: ${this.originY}px;
|
|
207
217
|
}
|
|
208
218
|
</style>
|
|
209
|
-
<div class="${
|
|
219
|
+
<div class="${Nt(t)}">
|
|
210
220
|
<div class="ft-ripple--background"></div>
|
|
211
221
|
<div class="ft-ripple--effect"></div>
|
|
212
222
|
</div>
|
|
213
|
-
`}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()}}
|
|
223
|
+
`}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()}}Tt.elementDefinitions={},Tt.styles=Lt,Bt([o({type:Boolean})],Tt.prototype,"primary",void 0),Bt([o({type:Boolean})],Tt.prototype,"secondary",void 0),Bt([o({type:Boolean})],Tt.prototype,"unbounded",void 0),Bt([o({type:Boolean})],Tt.prototype,"activated",void 0),Bt([o({type:Boolean})],Tt.prototype,"selected",void 0),Bt([o({type:Boolean})],Tt.prototype,"disabled",void 0),Bt([s()],Tt.prototype,"hovered",void 0),Bt([s()],Tt.prototype,"focused",void 0),Bt([s()],Tt.prototype,"pressed",void 0),Bt([s()],Tt.prototype,"rippling",void 0),Bt([s()],Tt.prototype,"rippleSize",void 0),Bt([s()],Tt.prototype,"originX",void 0),Bt([s()],Tt.prototype,"originY",void 0),Bt([r(".ft-ripple")],Tt.prototype,"ripple",void 0),Bt([r(".ft-ripple--effect")],Tt.prototype,"rippleEffect",void 0),h("ft-ripple")(Tt);
|
|
214
224
|
/**
|
|
215
225
|
* @license
|
|
216
226
|
* Copyright 2020 Google LLC
|
|
217
227
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
218
228
|
*/
|
|
219
|
-
const
|
|
229
|
+
const Pt=Symbol.for(""),_t=t=>{if((null==t?void 0:t.r)===Pt)return null==t?void 0:t._$litStatic$},Wt=t=>({_$litStatic$:t,r:Pt}),Dt=new Map,It=(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=_t(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=Dt.get(t))&&(r.raw=r,Dt.set(t,i=r)),e=l}return t(i,...e)})(Z);var Ht;!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"}(Ht||(Ht={}));const Kt=dt.extend("--ft-typography-font-family",yt.titleFont),Zt=dt.extend("--ft-typography-font-family",yt.contentFont),Vt={fontFamily:Zt,fontSize:dt.create("--ft-typography-font-size","SIZE","16px"),fontWeight:dt.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:dt.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:dt.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:dt.create("--ft-typography-text-transform","UNKNOWN","inherit")},Jt=dt.extend("--ft-typography-title-font-family",Kt),qt=dt.extend("--ft-typography-title-font-size",Vt.fontSize,"20px"),Xt=dt.extend("--ft-typography-title-font-weight",Vt.fontWeight,"normal"),Yt=dt.extend("--ft-typography-title-letter-spacing",Vt.letterSpacing,"0.15px"),Gt=dt.extend("--ft-typography-title-line-height",Vt.lineHeight,"1.2"),Qt=dt.extend("--ft-typography-title-text-transform",Vt.textTransform,"inherit"),ti=dt.extend("--ft-typography-title-dense-font-family",Kt),ii=dt.extend("--ft-typography-title-dense-font-size",Vt.fontSize,"14px"),ei=dt.extend("--ft-typography-title-dense-font-weight",Vt.fontWeight,"normal"),oi=dt.extend("--ft-typography-title-dense-letter-spacing",Vt.letterSpacing,"0.105px"),si=dt.extend("--ft-typography-title-dense-line-height",Vt.lineHeight,"1.7"),ni=dt.extend("--ft-typography-title-dense-text-transform",Vt.textTransform,"inherit"),ri=dt.extend("--ft-typography-subtitle1-font-family",Zt),li=dt.extend("--ft-typography-subtitle1-font-size",Vt.fontSize,"16px"),ai=dt.extend("--ft-typography-subtitle1-font-weight",Vt.fontWeight,"600"),hi=dt.extend("--ft-typography-subtitle1-letter-spacing",Vt.letterSpacing,"0.144px"),ci=dt.extend("--ft-typography-subtitle1-line-height",Vt.lineHeight,"1.5"),pi=dt.extend("--ft-typography-subtitle1-text-transform",Vt.textTransform,"inherit"),fi=dt.extend("--ft-typography-subtitle2-font-family",Zt),di=dt.extend("--ft-typography-subtitle2-font-size",Vt.fontSize,"14px"),ui=dt.extend("--ft-typography-subtitle2-font-weight",Vt.fontWeight,"normal"),yi=dt.extend("--ft-typography-subtitle2-letter-spacing",Vt.letterSpacing,"0.098px"),vi=dt.extend("--ft-typography-subtitle2-line-height",Vt.lineHeight,"1.7"),xi=dt.extend("--ft-typography-subtitle2-text-transform",Vt.textTransform,"inherit"),gi=dt.extend("--ft-typography-body1-font-family",Zt),bi=dt.extend("--ft-typography-body1-font-size",Vt.fontSize,"16px"),mi=dt.extend("--ft-typography-body1-font-weight",Vt.fontWeight,"normal"),wi=dt.extend("--ft-typography-body1-letter-spacing",Vt.letterSpacing,"0.496px"),$i=dt.extend("--ft-typography-body1-line-height",Vt.lineHeight,"1.5"),Oi=dt.extend("--ft-typography-body1-text-transform",Vt.textTransform,"inherit"),Si=dt.extend("--ft-typography-body2-font-family",Zt),ki=dt.extend("--ft-typography-body2-font-size",Vt.fontSize,"14px"),Ci=dt.extend("--ft-typography-body2-font-weight",Vt.fontWeight,"normal"),Ni=dt.extend("--ft-typography-body2-letter-spacing",Vt.letterSpacing,"0.252px"),Ei=dt.extend("--ft-typography-body2-line-height",Vt.lineHeight,"1.4"),Ri=dt.extend("--ft-typography-body2-text-transform",Vt.textTransform,"inherit"),Mi=dt.extend("--ft-typography-caption-font-family",Zt),Ui=dt.extend("--ft-typography-caption-font-size",Vt.fontSize,"12px"),Fi=dt.extend("--ft-typography-caption-font-weight",Vt.fontWeight,"normal"),zi=dt.extend("--ft-typography-caption-letter-spacing",Vt.letterSpacing,"0.396px"),ji=dt.extend("--ft-typography-caption-line-height",Vt.lineHeight,"1.33"),Ai=dt.extend("--ft-typography-caption-text-transform",Vt.textTransform,"inherit"),Li=dt.extend("--ft-typography-breadcrumb-font-family",Zt),Bi=dt.extend("--ft-typography-breadcrumb-font-size",Vt.fontSize,"10px"),Ti=dt.extend("--ft-typography-breadcrumb-font-weight",Vt.fontWeight,"normal"),Pi=dt.extend("--ft-typography-breadcrumb-letter-spacing",Vt.letterSpacing,"0.33px"),_i=dt.extend("--ft-typography-breadcrumb-line-height",Vt.lineHeight,"1.6"),Wi=dt.extend("--ft-typography-breadcrumb-text-transform",Vt.textTransform,"inherit"),Di=dt.extend("--ft-typography-overline-font-family",Zt),Ii=dt.extend("--ft-typography-overline-font-size",Vt.fontSize,"10px"),Hi=dt.extend("--ft-typography-overline-font-weight",Vt.fontWeight,"normal"),Ki=dt.extend("--ft-typography-overline-letter-spacing",Vt.letterSpacing,"1.5px"),Zi=dt.extend("--ft-typography-overline-line-height",Vt.lineHeight,"1.6"),Vi=dt.extend("--ft-typography-overline-text-transform",Vt.textTransform,"uppercase"),Ji={fontFamily:dt.extend("--ft-typography-button-font-family",Zt),fontSize:dt.extend("--ft-typography-button-font-size",Vt.fontSize,"14px"),fontWeight:dt.extend("--ft-typography-button-font-weight",Vt.fontWeight,"600"),letterSpacing:dt.extend("--ft-typography-button-letter-spacing",Vt.letterSpacing,"1.246px"),lineHeight:dt.extend("--ft-typography-button-line-height",Vt.lineHeight,"1.15"),textTransform:dt.extend("--ft-typography-button-text-transform",Vt.textTransform,"uppercase")},qi=v`
|
|
220
230
|
.ft-typography--title {
|
|
221
|
-
font-family: ${
|
|
222
|
-
font-size: ${
|
|
223
|
-
font-weight: ${
|
|
224
|
-
letter-spacing: ${
|
|
225
|
-
line-height: ${
|
|
226
|
-
text-transform: ${
|
|
227
|
-
}
|
|
228
|
-
`,Vi=v`
|
|
229
|
-
.ft-typography--title-dense {
|
|
230
|
-
font-family: ${Yt};
|
|
231
|
-
font-size: ${Gt};
|
|
232
|
-
font-weight: ${Qt};
|
|
233
|
-
letter-spacing: ${ti};
|
|
234
|
-
line-height: ${ii};
|
|
235
|
-
text-transform: ${ei};
|
|
236
|
-
}
|
|
237
|
-
`,Ji=v`
|
|
238
|
-
.ft-typography--subtitle1 {
|
|
239
|
-
font-family: ${oi};
|
|
240
|
-
font-size: ${si};
|
|
241
|
-
font-weight: ${ni};
|
|
242
|
-
letter-spacing: ${ri};
|
|
243
|
-
line-height: ${li};
|
|
244
|
-
text-transform: ${ai};
|
|
245
|
-
}
|
|
246
|
-
`,qi=v`
|
|
247
|
-
.ft-typography--subtitle2 {
|
|
248
|
-
font-family: ${hi};
|
|
249
|
-
font-size: ${ci};
|
|
250
|
-
font-weight: ${pi};
|
|
251
|
-
letter-spacing: ${fi};
|
|
252
|
-
line-height: ${di};
|
|
253
|
-
text-transform: ${ui};
|
|
231
|
+
font-family: ${Jt};
|
|
232
|
+
font-size: ${qt};
|
|
233
|
+
font-weight: ${Xt};
|
|
234
|
+
letter-spacing: ${Yt};
|
|
235
|
+
line-height: ${Gt};
|
|
236
|
+
text-transform: ${Qt};
|
|
254
237
|
}
|
|
255
|
-
|
|
256
238
|
`,Xi=v`
|
|
257
|
-
.ft-typography--
|
|
258
|
-
font-family: ${
|
|
259
|
-
font-size: ${
|
|
260
|
-
font-weight: ${
|
|
261
|
-
letter-spacing: ${
|
|
262
|
-
line-height: ${
|
|
263
|
-
text-transform: ${
|
|
239
|
+
.ft-typography--title-dense {
|
|
240
|
+
font-family: ${ti};
|
|
241
|
+
font-size: ${ii};
|
|
242
|
+
font-weight: ${ei};
|
|
243
|
+
letter-spacing: ${oi};
|
|
244
|
+
line-height: ${si};
|
|
245
|
+
text-transform: ${ni};
|
|
264
246
|
}
|
|
265
247
|
`,Yi=v`
|
|
266
|
-
.ft-typography--
|
|
267
|
-
font-family: ${
|
|
268
|
-
font-size: ${
|
|
269
|
-
font-weight: ${
|
|
270
|
-
letter-spacing: ${
|
|
271
|
-
line-height: ${
|
|
272
|
-
text-transform: ${
|
|
248
|
+
.ft-typography--subtitle1 {
|
|
249
|
+
font-family: ${ri};
|
|
250
|
+
font-size: ${li};
|
|
251
|
+
font-weight: ${ai};
|
|
252
|
+
letter-spacing: ${hi};
|
|
253
|
+
line-height: ${ci};
|
|
254
|
+
text-transform: ${pi};
|
|
273
255
|
}
|
|
274
256
|
`,Gi=v`
|
|
275
|
-
.ft-typography--
|
|
276
|
-
font-family: ${
|
|
277
|
-
font-size: ${
|
|
278
|
-
font-weight: ${
|
|
279
|
-
letter-spacing: ${
|
|
280
|
-
line-height: ${
|
|
281
|
-
text-transform: ${
|
|
257
|
+
.ft-typography--subtitle2 {
|
|
258
|
+
font-family: ${fi};
|
|
259
|
+
font-size: ${di};
|
|
260
|
+
font-weight: ${ui};
|
|
261
|
+
letter-spacing: ${yi};
|
|
262
|
+
line-height: ${vi};
|
|
263
|
+
text-transform: ${xi};
|
|
282
264
|
}
|
|
265
|
+
|
|
283
266
|
`,Qi=v`
|
|
284
|
-
.ft-typography--
|
|
285
|
-
font-family: ${
|
|
286
|
-
font-size: ${
|
|
287
|
-
font-weight: ${
|
|
288
|
-
letter-spacing: ${
|
|
289
|
-
line-height: ${
|
|
290
|
-
text-transform: ${
|
|
267
|
+
.ft-typography--body1 {
|
|
268
|
+
font-family: ${gi};
|
|
269
|
+
font-size: ${bi};
|
|
270
|
+
font-weight: ${mi};
|
|
271
|
+
letter-spacing: ${wi};
|
|
272
|
+
line-height: ${$i};
|
|
273
|
+
text-transform: ${Oi};
|
|
291
274
|
}
|
|
292
275
|
`,te=v`
|
|
293
|
-
.ft-typography--
|
|
294
|
-
font-family: ${
|
|
295
|
-
font-size: ${
|
|
296
|
-
font-weight: ${
|
|
297
|
-
letter-spacing: ${
|
|
298
|
-
line-height: ${
|
|
299
|
-
text-transform: ${
|
|
276
|
+
.ft-typography--body2 {
|
|
277
|
+
font-family: ${Si};
|
|
278
|
+
font-size: ${ki};
|
|
279
|
+
font-weight: ${Ci};
|
|
280
|
+
letter-spacing: ${Ni};
|
|
281
|
+
line-height: ${Ei};
|
|
282
|
+
text-transform: ${Ri};
|
|
300
283
|
}
|
|
301
284
|
`,ie=v`
|
|
302
|
-
.ft-typography--
|
|
303
|
-
font-family: ${
|
|
304
|
-
font-size: ${
|
|
305
|
-
font-weight: ${
|
|
306
|
-
letter-spacing: ${
|
|
307
|
-
line-height: ${
|
|
308
|
-
text-transform: ${
|
|
285
|
+
.ft-typography--caption {
|
|
286
|
+
font-family: ${Mi};
|
|
287
|
+
font-size: ${Ui};
|
|
288
|
+
font-weight: ${Fi};
|
|
289
|
+
letter-spacing: ${zi};
|
|
290
|
+
line-height: ${ji};
|
|
291
|
+
text-transform: ${Ai};
|
|
309
292
|
}
|
|
310
293
|
`,ee=v`
|
|
294
|
+
.ft-typography--breadcrumb {
|
|
295
|
+
font-family: ${Li};
|
|
296
|
+
font-size: ${Bi};
|
|
297
|
+
font-weight: ${Ti};
|
|
298
|
+
letter-spacing: ${Pi};
|
|
299
|
+
line-height: ${_i};
|
|
300
|
+
text-transform: ${Wi};
|
|
301
|
+
}
|
|
302
|
+
`,oe=v`
|
|
303
|
+
.ft-typography--overline {
|
|
304
|
+
font-family: ${Di};
|
|
305
|
+
font-size: ${Ii};
|
|
306
|
+
font-weight: ${Hi};
|
|
307
|
+
letter-spacing: ${Ki};
|
|
308
|
+
line-height: ${Zi};
|
|
309
|
+
text-transform: ${Vi};
|
|
310
|
+
}
|
|
311
|
+
`,se=v`
|
|
312
|
+
.ft-typography--button {
|
|
313
|
+
font-family: ${Ji.fontFamily};
|
|
314
|
+
font-size: ${Ji.fontSize};
|
|
315
|
+
font-weight: ${Ji.fontWeight};
|
|
316
|
+
letter-spacing: ${Ji.letterSpacing};
|
|
317
|
+
line-height: ${Ji.lineHeight};
|
|
318
|
+
text-transform: ${Ji.textTransform};
|
|
319
|
+
}
|
|
320
|
+
`,ne=v`
|
|
311
321
|
.ft-typography {
|
|
312
322
|
vertical-align: inherit;
|
|
313
323
|
}
|
|
314
|
-
`;var
|
|
315
|
-
<${
|
|
324
|
+
`;var re=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 le extends xt{constructor(){super(...arguments),this.variant=Ht.body1}render(){return this.element?It`
|
|
325
|
+
<${Wt(this.element)}
|
|
316
326
|
class="ft-typography ft-typography--${this.variant}">
|
|
317
327
|
<slot></slot>
|
|
318
|
-
</${
|
|
319
|
-
`:
|
|
328
|
+
</${Wt(this.element)}>
|
|
329
|
+
`:It`
|
|
320
330
|
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
321
|
-
`}}
|
|
331
|
+
`}}le.styles=[qi,Xi,Yi,Gi,Qi,te,ie,ee,oe,se,ne],re([o()],le.prototype,"element",void 0),re([o()],le.prototype,"variant",void 0),h("ft-typography")(le);const ae=dt.create("--ft-tooltip-distance","SIZE","4px"),he=dt.create("--ft-tooltip-color","COLOR","#FFFFFF"),ce=dt.create("--ft-tooltip-background-color","COLOR","#666666"),pe=dt.create("--ft-tooltip-z-index","NUMBER","1"),fe=dt.external(yt.borderRadiusS,"Design system"),de=dt.create("--ft-tooltip-max-width","SIZE","150px"),ue=v`
|
|
322
332
|
.ft-tooltip--container {
|
|
323
333
|
display: block;
|
|
324
334
|
position: relative;
|
|
@@ -334,23 +344,23 @@ const Lt=Symbol.for(""),Bt=t=>{if((null==t?void 0:t.r)===Lt)return null==t?void
|
|
|
334
344
|
box-sizing: border-box;
|
|
335
345
|
overflow: hidden;
|
|
336
346
|
width: max-content;
|
|
337
|
-
max-width: ${
|
|
347
|
+
max-width: ${de};
|
|
338
348
|
text-align: center;
|
|
339
|
-
padding: ${
|
|
340
|
-
z-index: ${
|
|
349
|
+
padding: ${ae};
|
|
350
|
+
z-index: ${pe};
|
|
341
351
|
}
|
|
342
352
|
|
|
343
353
|
.ft-tooltip--content {
|
|
344
354
|
padding: 4px 8px;
|
|
345
|
-
border-radius: ${
|
|
346
|
-
background-color: ${
|
|
347
|
-
color: ${
|
|
355
|
+
border-radius: ${fe};
|
|
356
|
+
background-color: ${ce};
|
|
357
|
+
color: ${he};
|
|
348
358
|
top: -500px;
|
|
349
359
|
left: -500px;
|
|
350
360
|
position: relative;
|
|
351
361
|
word-break: break-word;
|
|
352
362
|
}
|
|
353
|
-
`;var
|
|
363
|
+
`;var ye=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 ve extends xt{constructor(){super(...arguments),this.text="",this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.visible=!1,this.validPositions=new Set(["top","bottom","left","right"]),this.hideDebounce=new i,this.revealDebouncer=new i}get validPosition(){return this.validPositions.has(this.position)?this.position:"bottom"}render(){return Z`
|
|
354
364
|
<div part="container"
|
|
355
365
|
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
356
366
|
@mouseenter=${this.onHover}
|
|
@@ -368,19 +378,19 @@ const Lt=Symbol.for(""),Bt=t=>{if((null==t?void 0:t.r)===Lt)return null==t?void
|
|
|
368
378
|
</div>
|
|
369
379
|
</div>
|
|
370
380
|
</div>
|
|
371
|
-
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){["visible","text"].some((i=>t.has(i)))&&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.validPosition){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.validPosition){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, ${
|
|
381
|
+
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){["visible","text"].some((i=>t.has(i)))&&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.validPosition){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.validPosition){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, ${de})`}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())}}ve.elementDefinitions={"ft-typography":le},ve.styles=ue,ye([o()],ve.prototype,"text",void 0),ye([o({type:Boolean})],ve.prototype,"manual",void 0),ye([o({type:Boolean})],ve.prototype,"inline",void 0),ye([o({type:Number})],ve.prototype,"delay",void 0),ye([o()],ve.prototype,"position",void 0),ye([
|
|
372
382
|
/**
|
|
373
383
|
* @license
|
|
374
384
|
* Copyright 2017 Google LLC
|
|
375
385
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
376
386
|
*/
|
|
377
|
-
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)],
|
|
387
|
+
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)],ve.prototype,"slotNodes",void 0),ye([r(".ft-tooltip--container")],ve.prototype,"container",void 0),ye([r("slot")],ve.prototype,"target",void 0),ye([r(".ft-tooltip")],ve.prototype,"tooltip",void 0),ye([r(".ft-tooltip--content")],ve.prototype,"tooltipContent",void 0),ye([s()],ve.prototype,"visible",void 0),h("ft-tooltip")(ve);
|
|
378
388
|
/**
|
|
379
389
|
* @license
|
|
380
390
|
* Copyright 2017 Google LLC
|
|
381
391
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
382
392
|
*/
|
|
383
|
-
class
|
|
393
|
+
class xe extends Ct{constructor(t){if(super(t),this.it=J,t.type!==St)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===J||null==t)return this._t=void 0,this.it=t;if(t===V)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:[]}}}xe.directiveName="unsafeHTML",xe.resultType=1;const ge=kt(xe);var be,me;!function(t){t.THUMBS_DOWN="",t.THUMBS_DOWN_PLAIN="",t.THUMBS_UP="",t.THUMBS_UP_PLAIN="",t.STAR="",t.STAR_PLAIN="",t.DESKTOP="",t.TABLET_LANDSCAPE="",t.TABLET_PORTRAIT="",t.MOBILE_LANDSCAPE="",t.MOBILE_PORTRAIT="",t.ARROW_RIGHT_TO_LINE="",t.THIN_ARROW_UP="",t.CONTEXTUAL="",t.UNSTRUCTURED_DOC="",t.RESET="",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.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="",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=""}(be||(be={})),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=""}(me||(me={})),new Map([...["abw"].map((t=>[t,me.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,me.AUDIO])),...["avi"].map((t=>[t,me.AVI])),...["chm","xhs"].map((t=>[t,me.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,me.CODE])),...["csv"].map((t=>[t,me.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,me.DITA])),...["epub"].map((t=>[t,me.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,me.EXCEL])),...["flac"].map((t=>[t,me.FLAC])),...["gif"].map((t=>[t,me.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,me.GZIP])),...["html","htm","xhtml"].map((t=>[t,me.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,me.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,me.JPEG])),...["json"].map((t=>[t,me.JSON])),...["m4a","m4p"].map((t=>[t,me.M4A])),...["mov","qt"].map((t=>[t,me.MOV])),...["mp3"].map((t=>[t,me.MP3])),...["mp4","m4v"].map((t=>[t,me.MP4])),...["ogg","oga"].map((t=>[t,me.OGG])),...["pdf","ps"].map((t=>[t,me.PDF])),...["png"].map((t=>[t,me.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,me.POWERPOINT])),...["rar"].map((t=>[t,me.RAR])),...["stp"].map((t=>[t,me.STP])),...["txt","rtf","md","mdown"].map((t=>[t,me.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,me.VIDEO])),...["wav"].map((t=>[t,me.WAV])),...["wma"].map((t=>[t,me.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,me.WORD])),...["xml","xsl","rdf"].map((t=>[t,me.XML])),...["yaml","yml","x-yaml"].map((t=>[t,me.YAML])),...["zip"].map((t=>[t,me.ZIP]))]);const we={size:dt.create("--ft-icon-font-size","SIZE","24px"),fluidTopicsFontFamily:dt.extend("--ft-icon-fluid-topics-font-family",dt.create("--ft-icon-font-family","UNKNOWN","ft-icons")),fileFormatFontFamily:dt.extend("--ft-icon-file-format-font-family",dt.create("--ft-icon-font-family","UNKNOWN","ft-mime")),materialFontFamily:dt.extend("--ft-icon-material-font-family",dt.create("--ft-icon-font-family","UNKNOWN","Material Icons")),verticalAlign:dt.create("--ft-icon-vertical-align","UNKNOWN","unset")},$e=v`
|
|
384
394
|
:host, i.ft-icon {
|
|
385
395
|
display: inline-flex;
|
|
386
396
|
align-items: center;
|
|
@@ -389,14 +399,14 @@ class ue extends Ot{constructor(t){if(super(t),this.it=J,t.type!==wt)throw Error
|
|
|
389
399
|
}
|
|
390
400
|
|
|
391
401
|
:host {
|
|
392
|
-
width: ${
|
|
393
|
-
height: ${
|
|
402
|
+
width: ${we.size};
|
|
403
|
+
height: ${we.size};
|
|
394
404
|
}
|
|
395
405
|
|
|
396
406
|
i.ft-icon {
|
|
397
407
|
width: 100%;
|
|
398
408
|
height: 100%;
|
|
399
|
-
font-size: ${
|
|
409
|
+
font-size: ${we.size};
|
|
400
410
|
line-height: 1;
|
|
401
411
|
font-weight: normal;
|
|
402
412
|
text-transform: none;
|
|
@@ -407,32 +417,32 @@ class ue extends Ot{constructor(t){if(super(t),this.it=J,t.type!==wt)throw Error
|
|
|
407
417
|
text-rendering: auto;
|
|
408
418
|
-webkit-font-smoothing: antialiased;
|
|
409
419
|
-moz-osx-font-smoothing: grayscale;
|
|
410
|
-
vertical-align: ${
|
|
420
|
+
vertical-align: ${we.verticalAlign};
|
|
411
421
|
}
|
|
412
422
|
|
|
413
423
|
i.ft-icon.ft-icon--fluid-topics {
|
|
414
|
-
font-family: ${
|
|
424
|
+
font-family: ${we.fluidTopicsFontFamily}, ft-icons, fticons, sans-serif;
|
|
415
425
|
|
|
416
426
|
/* Ugly fix because font is broken */
|
|
417
|
-
font-size: calc(0.9 * ${
|
|
427
|
+
font-size: calc(0.9 * ${we.size});
|
|
418
428
|
position: relative;
|
|
419
429
|
top: -5%;
|
|
420
430
|
justify-content: center;
|
|
421
431
|
}
|
|
422
432
|
|
|
423
433
|
.ft-icon--file-format {
|
|
424
|
-
font-family: ${
|
|
434
|
+
font-family: ${we.fileFormatFontFamily}, ft-mime, sans-serif;
|
|
425
435
|
}
|
|
426
436
|
|
|
427
437
|
.ft-icon--material {
|
|
428
|
-
font-family: ${
|
|
438
|
+
font-family: ${we.materialFontFamily}, "Material Icons", sans-serif;
|
|
429
439
|
}
|
|
430
|
-
`;var
|
|
440
|
+
`;var Oe;!function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(Oe||(Oe={}));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 xt{constructor(){super(...arguments),this.variant=Oe.fluid_topics,this.resolvedIcon=J}render(){const t="material"!==this.variant||this.value;return Z`
|
|
431
441
|
<i class="ft-icon ${"ft-icon--"+this.variant}">
|
|
432
|
-
${
|
|
442
|
+
${ge(this.resolvedIcon)}
|
|
433
443
|
<slot ?hidden=${t}></slot>
|
|
434
444
|
</i>
|
|
435
|
-
`}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
|
|
445
|
+
`}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 Oe.file_format:this.resolvedIcon=null!==(t=me[e.replace("-","_").toUpperCase()])&&void 0!==t?t:e;break;case Oe.fluid_topics:this.resolvedIcon=null!==(i=be[e.replace("-","_").toUpperCase()])&&void 0!==i?i:e;break;default:this.resolvedIcon=this.value||J}}firstUpdated(t){super.firstUpdated(t),setTimeout((()=>this.resolveIcon()))}}ke.elementDefinitions={},ke.styles=$e,Se([o()],ke.prototype,"variant",void 0),Se([o()],ke.prototype,"value",void 0),Se([s()],ke.prototype,"resolvedIcon",void 0),Se([r("slot")],ke.prototype,"slottedContent",void 0),h("ft-icon")(ke);const Ce={textColor:dt.extend("--ft-switch-text-color",yt.colorOnSurfaceHigh),backgroundColor:dt.extend("--ft-switch-background-color",yt.colorSurface),selectedTextColor:dt.extend("--ft-switch-selected-text-color",yt.colorPrimary),selectedBackgroundColor:dt.extend("--ft-switch-selected-background-color",yt.colorPrimary),borderColor:dt.extend("--ft-switch-border-color",yt.colorOutline),borderRadius:dt.extend("--ft-switch-border-radius",yt.borderRadiusL),fontSize:dt.extend("--ft-switch-font-size",Ji.fontSize),iconSize:dt.create("--ft-switch-icon-size","SIZE","24px"),iconColor:dt.extend("--ft-switch-text-color",yt.colorOnSurfaceMedium),rippleColor:dt.extend("--ft-switch-ripple-color",yt.colorPrimary),outlineColor:dt.extend("--ft-switch-outline-color",yt.colorPrimary)},Ne={borderRadiusLeft:dt.extend("--ft-switch-option-border-radius-left",yt.borderRadiusL),borderRadiusRight:dt.extend("--ft-switch-option-border-radius-right",yt.borderRadiusL),borderWidthLeft:dt.create("--ft-switch-option-border-width-left","SIZE","1px"),borderWidthRight:dt.create("--ft-switch-option-border-width-right","SIZE","1px"),borderWidthVertical:dt.create("--ft-switch-option-border-width-vertical","SIZE","1px")},Ee=v`
|
|
436
446
|
.ft-switch-option {
|
|
437
447
|
position: relative;
|
|
438
448
|
display: inline-block;
|
|
@@ -446,20 +456,20 @@ class ue extends Ot{constructor(t){if(super(t),this.it=J,t.type!==wt)throw Error
|
|
|
446
456
|
}
|
|
447
457
|
|
|
448
458
|
.ft-switch-option--content {
|
|
449
|
-
--ft-switch-option-internal-line-height: calc(${
|
|
450
|
-
--ft-switch-option-internal-content-height: max(var(--ft-switch-option-internal-line-height), ${
|
|
459
|
+
--ft-switch-option-internal-line-height: calc(${Ce.fontSize} + 2px);
|
|
460
|
+
--ft-switch-option-internal-content-height: max(var(--ft-switch-option-internal-line-height), ${Ce.iconSize});
|
|
451
461
|
|
|
452
462
|
border-style: solid;
|
|
453
|
-
border-color: ${
|
|
454
|
-
border-width: ${
|
|
455
|
-
border-radius: ${
|
|
463
|
+
border-color: ${Ce.borderColor};
|
|
464
|
+
border-width: ${Ne.borderWidthVertical} ${Ne.borderWidthRight} ${Ne.borderWidthVertical} ${Ne.borderWidthLeft};
|
|
465
|
+
border-radius: ${Ne.borderRadiusLeft} ${Ne.borderRadiusRight} ${Ne.borderRadiusRight} ${Ne.borderRadiusLeft};
|
|
456
466
|
display: flex;
|
|
457
467
|
align-items: center;
|
|
458
468
|
justify-content: center;
|
|
459
469
|
overflow: hidden;
|
|
460
|
-
${ut(
|
|
470
|
+
${ut(we.size,Ce.iconSize)};
|
|
461
471
|
padding: var(--ft-switch-internal-vertical-padding, 6px) var(--ft-switch-internal-horizontal-padding, 8px);
|
|
462
|
-
background-color: ${
|
|
472
|
+
background-color: ${Ce.backgroundColor};
|
|
463
473
|
-webkit-mask-image: radial-gradient(white, black);
|
|
464
474
|
}
|
|
465
475
|
|
|
@@ -468,8 +478,8 @@ class ue extends Ot{constructor(t){if(super(t),this.it=J,t.type!==wt)throw Error
|
|
|
468
478
|
}
|
|
469
479
|
|
|
470
480
|
.ft-switch-option--input:checked + .ft-switch-option--content:before {
|
|
471
|
-
background-color: ${
|
|
472
|
-
border-radius: ${
|
|
481
|
+
background-color: ${Ce.selectedBackgroundColor};
|
|
482
|
+
border-radius: ${Ne.borderRadiusLeft} ${Ne.borderRadiusRight} ${Ne.borderRadiusRight} ${Ne.borderRadiusLeft};
|
|
473
483
|
position: absolute;
|
|
474
484
|
inset: 0;
|
|
475
485
|
content: "";
|
|
@@ -478,18 +488,18 @@ class ue extends Ot{constructor(t){if(super(t),this.it=J,t.type!==wt)throw Error
|
|
|
478
488
|
}
|
|
479
489
|
|
|
480
490
|
.ft-switch-option--label {
|
|
481
|
-
color: ${
|
|
491
|
+
color: ${Ce.textColor};
|
|
482
492
|
overflow: hidden;
|
|
483
493
|
white-space: nowrap;
|
|
484
494
|
text-overflow: ellipsis;
|
|
485
495
|
display: block;
|
|
486
496
|
margin: 0 8px;
|
|
487
|
-
${ut(
|
|
488
|
-
${ut(
|
|
497
|
+
${ut(Ji.fontSize,Ce.fontSize)};
|
|
498
|
+
${ut(Ji.lineHeight,"var(--ft-switch-option-internal-content-height)")}
|
|
489
499
|
}
|
|
490
500
|
|
|
491
501
|
.ft-switch-option--input:checked + .ft-switch-option--content .ft-switch-option--label {
|
|
492
|
-
color: ${
|
|
502
|
+
color: ${Ce.selectedTextColor};
|
|
493
503
|
}
|
|
494
504
|
|
|
495
505
|
.ft-switch-option--label[hidden] {
|
|
@@ -497,7 +507,7 @@ class ue extends Ot{constructor(t){if(super(t),this.it=J,t.type!==wt)throw Error
|
|
|
497
507
|
}
|
|
498
508
|
|
|
499
509
|
.ft-switch-option--ripple {
|
|
500
|
-
${ut(
|
|
510
|
+
${ut(Rt.color,Ce.rippleColor)};
|
|
501
511
|
}
|
|
502
512
|
|
|
503
513
|
ft-icon, ft-ripple, ft-typography {
|
|
@@ -510,14 +520,14 @@ class ue extends Ot{constructor(t){if(super(t),this.it=J,t.type!==wt)throw Error
|
|
|
510
520
|
|
|
511
521
|
ft-icon {
|
|
512
522
|
flex-shrink: 0;
|
|
513
|
-
color: ${
|
|
523
|
+
color: ${Ce.iconColor};
|
|
514
524
|
}
|
|
515
525
|
|
|
516
526
|
.ft-switch-option--input:checked + .ft-switch-option--content ft-icon {
|
|
517
|
-
color: ${
|
|
527
|
+
color: ${Ce.selectedTextColor};
|
|
518
528
|
}
|
|
519
|
-
`;var
|
|
520
|
-
<label part="label" for="input" class=${
|
|
529
|
+
`;var Re=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 Me extends CustomEvent{constructor(){super("option-change",{bubbles:!0})}}class Ue extends xt{constructor(){super(...arguments),this.value="",this.iconVariant=Oe.material,this.label="",this.tooltipPosition="bottom",this.selected=!1,this.trailingIcon=!1,this.unselectable=!1}focus(){this.input.focus()}updated(t){super.updated(t),t.has("selected")&&this.dispatchEvent(new Me)}render(){const t={"ft-switch-option":!0,"ft-switch-option--trailing-icon":this.trailingIcon};return this.addTooltip(Z`
|
|
530
|
+
<label part="label" for="input" class=${Nt(t)}>
|
|
521
531
|
<input id="input" type="radio" class="ft-switch-option--input"
|
|
522
532
|
.checked=${this.selected}
|
|
523
533
|
@click=${this.onChange}>
|
|
@@ -525,7 +535,7 @@ class ue extends Ot{constructor(t){if(super(t),this.it=J,t.type!==wt)throw Error
|
|
|
525
535
|
<ft-ripple part="ripple" class="ft-switch-option--ripple"></ft-ripple>
|
|
526
536
|
<ft-typography part="text"
|
|
527
537
|
variant="button"
|
|
528
|
-
class="ft-switch-option--label"
|
|
538
|
+
class="ft-switch-option--label ${$t?"ft-safari-ellipsis-fix":""}"
|
|
529
539
|
?hidden=${!this.hasTextContent()}>
|
|
530
540
|
<slot @slotchange=${this.onSlotchange}></slot>
|
|
531
541
|
</ft-typography>
|
|
@@ -539,20 +549,20 @@ class ue extends Ot{constructor(t){if(super(t),this.it=J,t.type!==wt)throw Error
|
|
|
539
549
|
${t}
|
|
540
550
|
</ft-tooltip>
|
|
541
551
|
`}onChange(){this.selected=!this.unselectable||!this.selected}getLabel(){return this.label||this.textContent}resolveIcon(){return this.icon?Z`
|
|
542
|
-
<ft-icon part="icon" .variant=${this.iconVariant}
|
|
543
|
-
`:J}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()}}
|
|
544
|
-
<div @keydown=${this.onKeyDown} tabindex="0" class="${
|
|
552
|
+
<ft-icon part="icon" .variant=${this.iconVariant} value=${this.icon}></ft-icon>
|
|
553
|
+
`:J}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()}}Ue.elementDefinitions={"ft-ripple":Tt,"ft-typography":le,"ft-tooltip":ve,"ft-icon":ke},Ue.styles=[gt,Ee],Re([o()],Ue.prototype,"value",void 0),Re([o()],Ue.prototype,"icon",void 0),Re([o()],Ue.prototype,"iconVariant",void 0),Re([o()],Ue.prototype,"label",void 0),Re([o()],Ue.prototype,"tooltipPosition",void 0),Re([o({type:Boolean,reflect:!0})],Ue.prototype,"selected",void 0),Re([o({type:Boolean})],Ue.prototype,"trailingIcon",void 0),Re([o({type:Boolean})],Ue.prototype,"unselectable",void 0),Re([r(".ft-switch-option--content slot")],Ue.prototype,"slottedContent",void 0),Re([r(".ft-switch-option--input")],Ue.prototype,"input",void 0);var Fe=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 ze extends CustomEvent{constructor(t){super("change",{detail:t})}}class je extends xt{constructor(){super(...arguments),this.dense=!1,this.unselectable=!1,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 ze(null===(i=this.selectedOption)||void 0===i?void 0:i.value))),t.has("unselectable")&&this.options.forEach((t=>t.unselectable=this.unselectable))}render(){const t={"ft-switch":!0,"ft-switch--dense":this.dense};return Z`
|
|
554
|
+
<div @keydown=${this.onKeyDown} tabindex="0" class="${Nt(t)}">
|
|
545
555
|
<slot @slotchange=${this.onSlotchange}
|
|
546
556
|
@option-change=${this.onOptionChange}></slot>
|
|
547
557
|
</div>
|
|
548
|
-
`}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
|
|
558
|
+
`}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 Ue&&this.registerOption(t)})),this.selectedOption=this.options.find((t=>t.selected))}registerOption(t){t.setAttribute("tabindex","-1"),t.unselectable=this.unselectable,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}))}}je.elementDefinitions={},je.styles=v`
|
|
549
559
|
:host {
|
|
550
560
|
display: inline-block;
|
|
551
561
|
}
|
|
552
562
|
|
|
553
563
|
.ft-switch {
|
|
554
|
-
border-radius: ${
|
|
555
|
-
outline-color: ${
|
|
564
|
+
border-radius: ${Ce.borderRadius};
|
|
565
|
+
outline-color: ${Ce.outlineColor};
|
|
556
566
|
}
|
|
557
567
|
|
|
558
568
|
.ft-switch slot {
|
|
@@ -561,22 +571,22 @@ class ue extends Ot{constructor(t){if(super(t),this.it=J,t.type!==wt)throw Error
|
|
|
561
571
|
}
|
|
562
572
|
|
|
563
573
|
.ft-switch slot::slotted(ft-switch-option) {
|
|
564
|
-
${ut(
|
|
565
|
-
${ut(
|
|
566
|
-
${ut(
|
|
574
|
+
${ut(Ne.borderRadiusLeft,"0")};
|
|
575
|
+
${ut(Ne.borderRadiusRight,"0")};
|
|
576
|
+
${ut(Ne.borderWidthLeft,"0")};
|
|
567
577
|
}
|
|
568
578
|
|
|
569
579
|
.ft-switch slot::slotted(ft-switch-option:first-child) {
|
|
570
|
-
${ut(
|
|
571
|
-
${ut(
|
|
580
|
+
${ut(Ne.borderRadiusLeft,Ce.borderRadius)};
|
|
581
|
+
${ut(Ne.borderWidthLeft,"1px")};
|
|
572
582
|
}
|
|
573
583
|
|
|
574
584
|
.ft-switch slot::slotted(ft-switch-option:last-child) {
|
|
575
|
-
${ut(
|
|
585
|
+
${ut(Ne.borderRadiusRight,Ce.borderRadius)};
|
|
576
586
|
}
|
|
577
587
|
|
|
578
588
|
.ft-switch--dense slot::slotted(ft-switch-option) {
|
|
579
589
|
--ft-switch-internal-vertical-padding: 2px;
|
|
580
590
|
--ft-switch-internal-horizontal-padding: 4px;
|
|
581
591
|
}
|
|
582
|
-
`,
|
|
592
|
+
`,Fe([o({type:Boolean})],je.prototype,"dense",void 0),Fe([o({type:Boolean})],je.prototype,"unselectable",void 0),Fe([r(".ft-switch slot")],je.prototype,"slottedContent",void 0),Fe([s()],je.prototype,"selectedOption",void 0),Fe([r(".ft-switch")],je.prototype,"ftSwitchDiv",void 0),h("ft-switch")(je),h("ft-switch-option")(Ue),t.FtSwitch=je,t.FtSwitchChange=ze,t.FtSwitchCssVariables=Ce,t.FtSwitchOption=Ue,t.FtSwitchOptionCssVariables=Ne,t.SwitchOptionChange=Me,t.optionStyles=Ee,Object.defineProperty(t,"i",{value:!0})}({});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-switch",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.55",
|
|
4
4
|
"description": "two-state",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-icon": "0.3.
|
|
23
|
-
"@fluid-topics/ft-ripple": "0.3.
|
|
24
|
-
"@fluid-topics/ft-tooltip": "0.3.
|
|
25
|
-
"@fluid-topics/ft-typography": "0.3.
|
|
26
|
-
"@fluid-topics/ft-wc-utils": "0.3.
|
|
22
|
+
"@fluid-topics/ft-icon": "0.3.55",
|
|
23
|
+
"@fluid-topics/ft-ripple": "0.3.55",
|
|
24
|
+
"@fluid-topics/ft-tooltip": "0.3.55",
|
|
25
|
+
"@fluid-topics/ft-typography": "0.3.55",
|
|
26
|
+
"@fluid-topics/ft-wc-utils": "0.3.55",
|
|
27
27
|
"lit": "2.2.8"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "4106f01e238edeb1c85fba22d6d50a18757e0b3e"
|
|
30
30
|
}
|