@fluid-topics/ft-search-bar 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-search-bar.css.js +5 -5
- package/build/ft-search-bar.d.ts +2 -31
- package/build/ft-search-bar.light.js +1281 -1281
- package/build/ft-search-bar.min.js +1338 -1338
- package/build/ft-search-bar.properties.d.ts +33 -0
- package/build/ft-search-bar.properties.js +2 -0
- package/build/index.d.ts +2 -1
- package/build/index.js +2 -1
- package/package.json +14 -14
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* @see https://github.com/webcomponents/polyfills/tree/master/packages/scoped-custom-element-registry
|
|
16
16
|
*/
|
|
17
|
-
if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,e=window.customElements.define,i=window.customElements.get,o=window.customElements,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||[]);d(s,a,l);const c={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,c),this._definitionsByClass.set(s,c);let h=i.call(o,t);h||(h=p(t),e.call(o,t,h)),this===window.customElements&&(r.set(s,c),c.standInClass=h);const f=this._awaitingUpgrade.get(t);if(f){this._awaitingUpgrade.delete(t);for(const t of f)n.delete(t),u(t,c,!0)}const b=this._whenDefinedPromises.get(t);return void 0!==b&&(b.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 e=this._getDefinition(t);if(void 0!==e)return Promise.resolve(e.elementClass);let i=this._whenDefinedPromises.get(t);return void 0===i&&(i={},i.promise=new Promise((t=>i.resolve=t)),this._whenDefinedPromises.set(t,i)),i.promise}_upgradeWhenDefined(t,e,i){let o=this._awaitingUpgrade.get(e);o||this._awaitingUpgrade.set(e,o=new Set),i?o.add(t):o.delete(t)}},window.HTMLElement=function(){let e=a;if(e)return a=void 0,e;const i=r.get(this.constructor);if(!i)throw new TypeError("Illegal constructor (custom element class must be registered with global customElements registry to be newable)");return e=Reflect.construct(t,[],i.standInClass),Object.setPrototypeOf(e,this.constructor.prototype),s.set(e,i),e},window.HTMLElement.prototype=t.prototype;const c=t=>t===document||t instanceof ShadowRoot,h=t=>{let e=t.getRootNode();if(!c(e)){const t=v[v.length-1];if(t instanceof CustomElementRegistry)return t;e=t.getRootNode(),c(e)||(e=l.get(e)?.getRootNode()||document)}return e.customElements},p=e=>class{static get formAssociated(){return!0}constructor(){const i=Reflect.construct(t,[],this.constructor);Object.setPrototypeOf(i,HTMLElement.prototype);const o=h(i)||window.customElements,s=o._getDefinition(e);return s?u(i,s):n.set(i,o),i}connectedCallback(){const t=s.get(this);t?t.connectedCallback&&t.connectedCallback.apply(this,arguments):n.get(this)._upgradeWhenDefined(this,e,!0)}disconnectedCallback(){const t=s.get(this);t?t.disconnectedCallback&&t.disconnectedCallback.apply(this,arguments):n.get(this)._upgradeWhenDefined(this,e,!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)}},d=(t,e,i)=>{if(0===e.size||void 0===i)return;const o=t.prototype.setAttribute;o&&(t.prototype.setAttribute=function(t,s){const n=t.toLowerCase();if(e.has(n)){const t=this.getAttribute(n);o.call(this,n,s),i.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(e.has(o)){const t=this.getAttribute(o);s.call(this,o),i.call(this,o,t,null)}else s.call(this,o)})},f=e=>{const i=Object.getPrototypeOf(e);if(i!==window.HTMLElement)return i===t||"HTMLElement"===i?.prototype?.constructor?.name?Object.setPrototypeOf(e,window.HTMLElement):f(i)},u=(t,e,i=!1)=>{Object.setPrototypeOf(t,e.elementClass.prototype),s.set(t,e),a=t;try{new e.elementClass}catch(t){f(e.elementClass),new e.elementClass}e.observedAttributes.forEach((i=>{t.hasAttribute(i)&&e.attributeChangedCallback.call(t,i,null,t.getAttribute(i))})),i&&e.connectedCallback&&t.isConnected&&e.connectedCallback.call(t)},b=Element.prototype.attachShadow;Element.prototype.attachShadow=function(t){const e=b.apply(this,arguments);return t.customElements&&(e.customElements=t.customElements),e};let v=[document];const g=(t,e,i)=>{const o=(i?Object.getPrototypeOf(i):t.prototype)[e];t.prototype[e]=function(){v.push(this);const t=o.apply(i||this,arguments);return void 0!==t&&l.set(t,this),v.pop(),t}};g(ShadowRoot,"createElement",document),g(ShadowRoot,"importNode",document),g(Element,"insertAdjacentHTML");const x=(t,e)=>{const i=Object.getOwnPropertyDescriptor(t.prototype,e);Object.defineProperty(t.prototype,e,{...i,set(t){v.push(this),i.set.call(this,t),v.pop()}})};if(x(Element,"innerHTML"),x(ShadowRoot,"innerHTML"),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){const t=new WeakMap,e=HTMLElement.prototype.attachInternals,i=["setFormValue","setValidity","checkValidity","reportValidity"];HTMLElement.prototype.attachInternals=function(...i){const o=e.call(this,...i);return t.set(o,this),o},i.forEach((e=>{const i=window.ElementInternals.prototype,o=i[e];i[e]=function(...e){const i=t.get(this);if(!0!==s.get(i).formAssociated)throw new DOMException(`Failed to execute ${o} on 'ElementInternals': The target element is not a form-associated custom element.`);o?.call(this,...e)}}));class o extends Array{constructor(t){super(...t),this._elements=t}get value(){return this._elements.find((t=>!0===t.checked))?.value||""}}class n{constructor(t){const e=new Map;t.forEach(((t,i)=>{const o=t.getAttribute("name"),s=e.get(o)||[];this[+i]=t,s.push(t),e.set(o,s)})),this.length=t.length,e.forEach(((t,e)=>{t&&(1===t.length?this[e]=t[0]:this[e]=new o(t))}))}namedItem(t){return this[t]}}const r=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){const t=r.get.call(this,[]),e=[];for(const i of t){const t=s.get(i);t&&!0!==t.formAssociated||e.push(i)}return new n(e)}})}}try{window.customElements.define("custom-element",null)}catch(
|
|
17
|
+
if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,e=window.customElements.define,i=window.customElements.get,o=window.customElements,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||[]);d(s,a,l);const c={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,c),this._definitionsByClass.set(s,c);let h=i.call(o,t);h||(h=p(t),e.call(o,t,h)),this===window.customElements&&(r.set(s,c),c.standInClass=h);const f=this._awaitingUpgrade.get(t);if(f){this._awaitingUpgrade.delete(t);for(const t of f)n.delete(t),u(t,c,!0)}const b=this._whenDefinedPromises.get(t);return void 0!==b&&(b.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 e=this._getDefinition(t);if(void 0!==e)return Promise.resolve(e.elementClass);let i=this._whenDefinedPromises.get(t);return void 0===i&&(i={},i.promise=new Promise((t=>i.resolve=t)),this._whenDefinedPromises.set(t,i)),i.promise}_upgradeWhenDefined(t,e,i){let o=this._awaitingUpgrade.get(e);o||this._awaitingUpgrade.set(e,o=new Set),i?o.add(t):o.delete(t)}},window.HTMLElement=function(){let e=a;if(e)return a=void 0,e;const i=r.get(this.constructor);if(!i)throw new TypeError("Illegal constructor (custom element class must be registered with global customElements registry to be newable)");return e=Reflect.construct(t,[],i.standInClass),Object.setPrototypeOf(e,this.constructor.prototype),s.set(e,i),e},window.HTMLElement.prototype=t.prototype;const c=t=>t===document||t instanceof ShadowRoot,h=t=>{let e=t.getRootNode();if(!c(e)){const t=v[v.length-1];if(t instanceof CustomElementRegistry)return t;e=t.getRootNode(),c(e)||(e=l.get(e)?.getRootNode()||document)}return e.customElements},p=e=>class{static get formAssociated(){return!0}constructor(){const i=Reflect.construct(t,[],this.constructor);Object.setPrototypeOf(i,HTMLElement.prototype);const o=h(i)||window.customElements,s=o._getDefinition(e);return s?u(i,s):n.set(i,o),i}connectedCallback(){const t=s.get(this);t?t.connectedCallback&&t.connectedCallback.apply(this,arguments):n.get(this)._upgradeWhenDefined(this,e,!0)}disconnectedCallback(){const t=s.get(this);t?t.disconnectedCallback&&t.disconnectedCallback.apply(this,arguments):n.get(this)._upgradeWhenDefined(this,e,!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)}},d=(t,e,i)=>{if(0===e.size||void 0===i)return;const o=t.prototype.setAttribute;o&&(t.prototype.setAttribute=function(t,s){const n=t.toLowerCase();if(e.has(n)){const t=this.getAttribute(n);o.call(this,n,s),i.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(e.has(o)){const t=this.getAttribute(o);s.call(this,o),i.call(this,o,t,null)}else s.call(this,o)})},f=e=>{const i=Object.getPrototypeOf(e);if(i!==window.HTMLElement)return i===t||"HTMLElement"===i?.prototype?.constructor?.name?Object.setPrototypeOf(e,window.HTMLElement):f(i)},u=(t,e,i=!1)=>{Object.setPrototypeOf(t,e.elementClass.prototype),s.set(t,e),a=t;try{new e.elementClass}catch(t){f(e.elementClass),new e.elementClass}e.observedAttributes.forEach((i=>{t.hasAttribute(i)&&e.attributeChangedCallback.call(t,i,null,t.getAttribute(i))})),i&&e.connectedCallback&&t.isConnected&&e.connectedCallback.call(t)},b=Element.prototype.attachShadow;Element.prototype.attachShadow=function(t){const e=b.apply(this,arguments);return t.customElements&&(e.customElements=t.customElements),e};let v=[document];const g=(t,e,i)=>{const o=(i?Object.getPrototypeOf(i):t.prototype)[e];t.prototype[e]=function(){v.push(this);const t=o.apply(i||this,arguments);return void 0!==t&&l.set(t,this),v.pop(),t}};g(ShadowRoot,"createElement",document),g(ShadowRoot,"importNode",document),g(Element,"insertAdjacentHTML");const x=(t,e)=>{const i=Object.getOwnPropertyDescriptor(t.prototype,e);Object.defineProperty(t.prototype,e,{...i,set(t){v.push(this),i.set.call(this,t),v.pop()}})};if(x(Element,"innerHTML"),x(ShadowRoot,"innerHTML"),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){const t=new WeakMap,e=HTMLElement.prototype.attachInternals,i=["setFormValue","setValidity","checkValidity","reportValidity"];HTMLElement.prototype.attachInternals=function(...i){const o=e.call(this,...i);return t.set(o,this),o},i.forEach((e=>{const i=window.ElementInternals.prototype,o=i[e];i[e]=function(...e){const i=t.get(this);if(!0!==s.get(i).formAssociated)throw new DOMException(`Failed to execute ${o} on 'ElementInternals': The target element is not a form-associated custom element.`);o?.call(this,...e)}}));class o extends Array{constructor(t){super(...t),this._elements=t}get value(){return this._elements.find((t=>!0===t.checked))?.value||""}}class n{constructor(t){const e=new Map;t.forEach(((t,i)=>{const o=t.getAttribute("name"),s=e.get(o)||[];this[+i]=t,s.push(t),e.set(o,s)})),this.length=t.length,e.forEach(((t,e)=>{t&&(1===t.length?this[e]=t[0]:this[e]=new o(t))}))}namedItem(t){return this[t]}}const r=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){const t=r.get.call(this,[]),e=[];for(const i of t){const t=s.get(i);t&&!0!==t.formAssociated||e.push(i)}return new n(e)}})}}try{window.customElements.define("custom-element",null)}catch(yi){const t=window.customElements.define;window.customElements.define=(e,i,o)=>{try{t.bind(window.customElements)(e,i,o)}catch(t){console.warn(e,i,o,t)}}}class e{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,e){this.callbacks=[t],this.debounce(e)}queue(t,e){this.callbacks.push(t),this.debounce(e)}cancel(){null!=this._debounce&&window.clearTimeout(this._debounce)}debounce(t){this.cancel(),this._debounce=window.setTimeout((()=>this.runCallbacks()),null!=t?t:this.timeout)}runCallbacks(){for(let t of this.callbacks)t();this.callbacks=[]}}
|
|
18
18
|
/**
|
|
19
19
|
* @license
|
|
20
20
|
* Copyright 2017 Google LLC
|
|
@@ -106,36 +106,36 @@ var ht,pt;null==ct||ct(Q,et),(null!==(z=globalThis.litHtmlVersions)&&void 0!==z?
|
|
|
106
106
|
* @license
|
|
107
107
|
* Copyright 2017 Google LLC
|
|
108
108
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
109
|
-
*/var jt
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
width: 0;
|
|
116
|
-
height: 0;
|
|
117
|
-
overflow: hidden;
|
|
118
|
-
}
|
|
109
|
+
*/var jt;!function(t){t.S="S",t.M="M",t.L="L",t.XL="XL",t.XXL="XXL"}(jt||(jt={}));const Pt=g`
|
|
110
|
+
.ft-size-watcher--pixel {
|
|
111
|
+
width: 0;
|
|
112
|
+
height: 0;
|
|
113
|
+
overflow: hidden;
|
|
114
|
+
}
|
|
119
115
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
116
|
+
.ft-size-watcher--pixel.ft-size-watcher--local {
|
|
117
|
+
width: 100%;
|
|
118
|
+
}
|
|
123
119
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
120
|
+
.ft-size-watcher--watcher {
|
|
121
|
+
height: 1px;
|
|
122
|
+
width: 100vw;
|
|
123
|
+
}
|
|
128
124
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
125
|
+
.ft-size-watcher--local .ft-size-watcher--watcher {
|
|
126
|
+
width: 100%;
|
|
127
|
+
}
|
|
128
|
+
`;var Ut=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class At extends CustomEvent{constructor(t,e){super("change",{detail:{size:t,category:e}})}}class Tt extends xt{constructor(){super(...arguments),this.debounceTimeout=100,this.local=!1,this.size=0,this.category=jt.S,this.resizeObserver=new ResizeObserver((()=>this.updateSize())),this.debouncer=new e}render(){return W`
|
|
129
|
+
<div class="ft-size-watcher--pixel ${this.local?"ft-size-watcher--local":""}">
|
|
130
|
+
<div class="ft-size-watcher--watcher"></div>
|
|
131
|
+
</div>
|
|
132
|
+
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.watcher&&this.resizeObserver.observe(this.watcher),this.updateSize()}updateSize(){this.debouncer.run((()=>{this.watcher&&this.size!==this.watcher.clientWidth&&(this.size=this.watcher.clientWidth,this.size<768?this.category=jt.S:this.size<976?this.category=jt.M:this.size<1024?this.category=jt.L:this.size<1440?this.category=jt.XL:this.category=jt.XXL,this.dispatchEvent(new At(this.size,this.category)))}),this.debounceTimeout)}}Tt.elementDefinitions={},Tt.styles=Pt,Ut([o({type:Number})],Tt.prototype,"debounceTimeout",void 0),Ut([o({type:Boolean})],Tt.prototype,"local",void 0),Ut([o({type:Number,reflect:!0})],Tt.prototype,"size",void 0),Ut([o({type:String,reflect:!0})],Tt.prototype,"category",void 0),Ut([r(".ft-size-watcher--watcher")],Tt.prototype,"watcher",void 0),h("ft-size-watcher")(Tt);
|
|
133
133
|
/**
|
|
134
134
|
* @license
|
|
135
135
|
* Copyright 2020 Google LLC
|
|
136
136
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
137
137
|
*/
|
|
138
|
-
const
|
|
138
|
+
const _t=Symbol.for(""),Ht=t=>{if((null==t?void 0:t.r)===_t)return null==t?void 0:t._$litStatic$},Zt=t=>({_$litStatic$:t,r:_t}),Kt=new Map,Wt=(t=>(e,...i)=>{const o=i.length;let s,n;const r=[],l=[];let a,c=0,h=!1;for(;c<o;){for(a=e[c];c<o&&void 0!==(n=i[c],s=Ht(n));)a+=s+e[++c],h=!0;l.push(n),r.push(a),c++}if(c===o&&r.push(e[o]),h){const t=r.join("$$lit$$");void 0===(e=Kt.get(t))&&(r.raw=r,Kt.set(t,e=r)),i=l}return t(e,...i)})(W);var Vt;!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"}(Vt||(Vt={}));const qt=ut.extend("--ft-typography-font-family",vt.titleFont),Jt=ut.extend("--ft-typography-font-family",vt.contentFont),Xt={fontFamily:Jt,fontSize:ut.create("--ft-typography-font-size","SIZE","16px"),fontWeight:ut.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:ut.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:ut.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:ut.create("--ft-typography-text-transform","UNKNOWN","inherit")},Yt=ut.extend("--ft-typography-title-font-family",qt),Qt=ut.extend("--ft-typography-title-font-size",Xt.fontSize,"20px"),Gt=ut.extend("--ft-typography-title-font-weight",Xt.fontWeight,"normal"),te=ut.extend("--ft-typography-title-letter-spacing",Xt.letterSpacing,"0.15px"),ee=ut.extend("--ft-typography-title-line-height",Xt.lineHeight,"1.2"),ie=ut.extend("--ft-typography-title-text-transform",Xt.textTransform,"inherit"),oe=ut.extend("--ft-typography-title-dense-font-family",qt),se=ut.extend("--ft-typography-title-dense-font-size",Xt.fontSize,"14px"),ne=ut.extend("--ft-typography-title-dense-font-weight",Xt.fontWeight,"normal"),re=ut.extend("--ft-typography-title-dense-letter-spacing",Xt.letterSpacing,"0.105px"),le=ut.extend("--ft-typography-title-dense-line-height",Xt.lineHeight,"1.7"),ae=ut.extend("--ft-typography-title-dense-text-transform",Xt.textTransform,"inherit"),ce=ut.extend("--ft-typography-subtitle1-font-family",Jt),he=ut.extend("--ft-typography-subtitle1-font-size",Xt.fontSize,"16px"),pe=ut.extend("--ft-typography-subtitle1-font-weight",Xt.fontWeight,"600"),de=ut.extend("--ft-typography-subtitle1-letter-spacing",Xt.letterSpacing,"0.144px"),fe=ut.extend("--ft-typography-subtitle1-line-height",Xt.lineHeight,"1.5"),ue=ut.extend("--ft-typography-subtitle1-text-transform",Xt.textTransform,"inherit"),be=ut.extend("--ft-typography-subtitle2-font-family",Jt),ve=ut.extend("--ft-typography-subtitle2-font-size",Xt.fontSize,"14px"),ge=ut.extend("--ft-typography-subtitle2-font-weight",Xt.fontWeight,"normal"),xe=ut.extend("--ft-typography-subtitle2-letter-spacing",Xt.letterSpacing,"0.098px"),ye=ut.extend("--ft-typography-subtitle2-line-height",Xt.lineHeight,"1.7"),me=ut.extend("--ft-typography-subtitle2-text-transform",Xt.textTransform,"inherit"),$e={fontFamily:ut.extend("--ft-typography-body1-font-family",Jt),fontSize:ut.extend("--ft-typography-body1-font-size",Xt.fontSize,"16px"),fontWeight:ut.extend("--ft-typography-body1-font-weight",Xt.fontWeight,"normal"),letterSpacing:ut.extend("--ft-typography-body1-letter-spacing",Xt.letterSpacing,"0.496px"),lineHeight:ut.extend("--ft-typography-body1-line-height",Xt.lineHeight,"1.5"),textTransform:ut.extend("--ft-typography-body1-text-transform",Xt.textTransform,"inherit")},we={fontFamily:ut.extend("--ft-typography-body2-font-family",Jt),fontSize:ut.extend("--ft-typography-body2-font-size",Xt.fontSize,"14px"),fontWeight:ut.extend("--ft-typography-body2-font-weight",Xt.fontWeight,"normal"),letterSpacing:ut.extend("--ft-typography-body2-letter-spacing",Xt.letterSpacing,"0.252px"),lineHeight:ut.extend("--ft-typography-body2-line-height",Xt.lineHeight,"1.4"),textTransform:ut.extend("--ft-typography-body2-text-transform",Xt.textTransform,"inherit")},ke={fontFamily:ut.extend("--ft-typography-caption-font-family",Jt),fontSize:ut.extend("--ft-typography-caption-font-size",Xt.fontSize,"12px"),fontWeight:ut.extend("--ft-typography-caption-font-weight",Xt.fontWeight,"normal"),letterSpacing:ut.extend("--ft-typography-caption-letter-spacing",Xt.letterSpacing,"0.396px"),lineHeight:ut.extend("--ft-typography-caption-line-height",Xt.lineHeight,"1.33"),textTransform:ut.extend("--ft-typography-caption-text-transform",Xt.textTransform,"inherit")},Se=ut.extend("--ft-typography-breadcrumb-font-family",Jt),Oe=ut.extend("--ft-typography-breadcrumb-font-size",Xt.fontSize,"10px"),Ce=ut.extend("--ft-typography-breadcrumb-font-weight",Xt.fontWeight,"normal"),Ee=ut.extend("--ft-typography-breadcrumb-letter-spacing",Xt.letterSpacing,"0.33px"),ze=ut.extend("--ft-typography-breadcrumb-line-height",Xt.lineHeight,"1.6"),Be=ut.extend("--ft-typography-breadcrumb-text-transform",Xt.textTransform,"inherit"),Me=ut.extend("--ft-typography-overline-font-family",Jt),Ne=ut.extend("--ft-typography-overline-font-size",Xt.fontSize,"10px"),Fe=ut.extend("--ft-typography-overline-font-weight",Xt.fontWeight,"normal"),Re=ut.extend("--ft-typography-overline-letter-spacing",Xt.letterSpacing,"1.5px"),Le=ut.extend("--ft-typography-overline-line-height",Xt.lineHeight,"1.6"),De=ut.extend("--ft-typography-overline-text-transform",Xt.textTransform,"uppercase"),Ie={fontFamily:ut.extend("--ft-typography-button-font-family",Jt),fontSize:ut.extend("--ft-typography-button-font-size",Xt.fontSize,"14px"),fontWeight:ut.extend("--ft-typography-button-font-weight",Xt.fontWeight,"600"),letterSpacing:ut.extend("--ft-typography-button-letter-spacing",Xt.letterSpacing,"1.246px"),lineHeight:ut.extend("--ft-typography-button-line-height",Xt.lineHeight,"1.15"),textTransform:ut.extend("--ft-typography-button-text-transform",Xt.textTransform,"uppercase")},je=g`
|
|
139
139
|
.ft-typography--title {
|
|
140
140
|
font-family: ${Yt};
|
|
141
141
|
font-size: ${Qt};
|
|
@@ -226,130 +226,162 @@ const Tt=Symbol.for(""),_t=t=>{if((null==t?void 0:t.r)===Tt)return null==t?void
|
|
|
226
226
|
line-height: ${Ie.lineHeight};
|
|
227
227
|
text-transform: ${Ie.textTransform};
|
|
228
228
|
}
|
|
229
|
-
|
|
230
|
-
|
|
229
|
+
`,Ve=g`
|
|
230
|
+
.ft-typography {
|
|
231
|
+
vertical-align: inherit;
|
|
232
|
+
}
|
|
233
|
+
`;var qe=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Je extends xt{constructor(){super(...arguments),this.variant=Vt.body1}render(){return this.element?Wt`
|
|
234
|
+
<${Zt(this.element)}
|
|
231
235
|
class="ft-typography ft-typography--${this.variant}">
|
|
232
236
|
<slot></slot>
|
|
233
|
-
</${
|
|
234
|
-
`:
|
|
237
|
+
</${Zt(this.element)}>
|
|
238
|
+
`:Wt`
|
|
235
239
|
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
236
|
-
`}}function
|
|
237
|
-
.ft-typography {
|
|
238
|
-
vertical-align: inherit;
|
|
239
|
-
}
|
|
240
|
-
`],Vt([o()],Ve.prototype,"element",void 0),Vt([o()],Ve.prototype,"variant",void 0),h("ft-typography")(Ve);
|
|
240
|
+
`}}function Xe(t,e){return t.flatMap((t=>[t,...Xe(e(t),e)]))}function Ye(t){return t.startsWith('"')&&t.endsWith('"')?t.replace(/(^"+)|("+$)/g,""):t}function Qe(t,e){return{label:t.label,selected:!e&&t.selected,subOptions:t.childNodes.map((e=>Qe(e,t.selected))),value:t.value}}function Ge(t){return{id:t.key,label:t.label,multivalued:t.multiSelectionable,options:t.rootNodes.map((t=>Qe(t,!1)))}}Je.styles=[je,Pe,Ue,Ae,Te,_e,He,Ze,Ke,We,Ve],qe([o()],Je.prototype,"element",void 0),qe([o()],Je.prototype,"variant",void 0),h("ft-typography")(Je);
|
|
241
241
|
/**
|
|
242
242
|
* @license
|
|
243
243
|
* Copyright 2018 Google LLC
|
|
244
244
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
245
245
|
*/
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
width: ${this.rippleSize}px;
|
|
251
|
-
height: ${this.rippleSize}px;
|
|
252
|
-
}
|
|
246
|
+
const ti=Et(class extends zt{constructor(t){var e;if(super(t),t.type!==Ot||"class"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){var i,o;if(void 0===this.nt){this.nt=new Set,void 0!==t.strings&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!(null===(i=this.st)||void 0===i?void 0:i.has(t))&&this.nt.add(t);return this.render(e)}const s=t.element.classList;this.nt.forEach((t=>{t in e||(s.remove(t),this.nt.delete(t))}));for(const t in e){const i=!!e[t];i===this.nt.has(t)||(null===(o=this.st)||void 0===o?void 0:o.has(t))||(i?(s.add(t),this.nt.add(t)):(s.remove(t),this.nt.delete(t)))}return V}}),ei=ut.extend("--ft-ripple-color",vt.colorContent),ii={color:ei,backgroundColor:ut.extend("--ft-ripple-background-color",ei),opacityContentOnSurfacePressed:ut.external(vt.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:ut.external(vt.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:ut.external(vt.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:ut.external(vt.opacityContentOnSurfaceSelected,"Design system")},oi=ut.extend("--ft-ripple-color",vt.colorPrimary),si=oi,ni=ut.extend("--ft-ripple-background-color",oi),ri=ut.extend("--ft-ripple-color",vt.colorSecondary),li=ri,ai=ut.extend("--ft-ripple-background-color",ri),ci=g`
|
|
247
|
+
:host {
|
|
248
|
+
display: contents;
|
|
249
|
+
}
|
|
253
250
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
<div class="${Qe(t)}">
|
|
260
|
-
<div class="ft-ripple--background"></div>
|
|
261
|
-
<div class="ft-ripple--effect"></div>
|
|
262
|
-
</div>
|
|
263
|
-
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){var e,i;super.updated(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(e=this.target)||void 0===e||e.removeAttribute("data-is-ft-ripple-target")):null===(i=this.target)||void 0===i||i.setAttribute("data-is-ft-ripple-target","true")),t.has("unbounded")&&this.setRippleSize()}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}setRippleSize(){if(this.ripple){const t=this.ripple.getBoundingClientRect();this.rippleSize=(this.unbounded?1:1.7)*Math.max(t.width,t.height)}}connectedCallback(){var t;super.connectedCallback();const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;e&&this.setupFor(e),this.setRippleSize()}setupFor(t){if(this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const e=(...t)=>e=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(e)},i=e("mouseup","contextmenu"),o=e("touchend","touchcancel"),s=t=>{["Enter"," "].includes(t.key)&&e("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",i),t.addEventListener("touchstart",o),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",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",i),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 e=t,i=t;let o,s;return null!=e.x?({x:o,y:s}=e):null!=i.touches&&(o=i.touches[0].clientX,s=i.touches[0].clientY),{x:o,y:s}}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let e of t.composedPath()){if(e===this.target)break;if("hasAttribute"in e&&e.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.resizeObserver.disconnect(),this.endRipple()}}ai.elementDefinitions={},ai.styles=g`
|
|
264
|
-
:host {
|
|
265
|
-
display: contents;
|
|
266
|
-
}
|
|
251
|
+
.ft-ripple {
|
|
252
|
+
position: absolute;
|
|
253
|
+
inset: 0;
|
|
254
|
+
pointer-events: none;
|
|
255
|
+
}
|
|
267
256
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
pointer-events: none;
|
|
272
|
-
}
|
|
257
|
+
.ft-ripple:not(.ft-ripple--unbounded) {
|
|
258
|
+
overflow: hidden;
|
|
259
|
+
}
|
|
273
260
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
261
|
+
.ft-ripple .ft-ripple--background,
|
|
262
|
+
.ft-ripple .ft-ripple--effect {
|
|
263
|
+
position: absolute;
|
|
264
|
+
opacity: 0;
|
|
265
|
+
}
|
|
277
266
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
opacity: 0;
|
|
282
|
-
}
|
|
267
|
+
.ft-ripple .ft-ripple--background {
|
|
268
|
+
background-color: ${ii.backgroundColor};
|
|
269
|
+
}
|
|
283
270
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
271
|
+
.ft-ripple .ft-ripple--effect {
|
|
272
|
+
background-color: ${ii.color};
|
|
273
|
+
}
|
|
287
274
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
275
|
+
.ft-ripple.ft-ripple--secondary .ft-ripple--background {
|
|
276
|
+
background-color: ${ai};
|
|
277
|
+
}
|
|
291
278
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
279
|
+
.ft-ripple.ft-ripple--secondary .ft-ripple--effect {
|
|
280
|
+
background-color: ${li};
|
|
281
|
+
}
|
|
295
282
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
283
|
+
.ft-ripple.ft-ripple--primary .ft-ripple--background {
|
|
284
|
+
background-color: ${ni};
|
|
285
|
+
}
|
|
299
286
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
287
|
+
.ft-ripple.ft-ripple--primary .ft-ripple--effect {
|
|
288
|
+
background-color: ${si};
|
|
289
|
+
}
|
|
303
290
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
291
|
+
.ft-ripple .ft-ripple--background {
|
|
292
|
+
top: 0;
|
|
293
|
+
left: 0;
|
|
294
|
+
height: 100%;
|
|
295
|
+
width: 100%;
|
|
296
|
+
transition: opacity 75ms linear;
|
|
297
|
+
}
|
|
307
298
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
width: 100%;
|
|
313
|
-
transition: opacity 75ms linear;
|
|
314
|
-
}
|
|
299
|
+
.ft-ripple .ft-ripple--effect,
|
|
300
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
301
|
+
border-radius: 50%;
|
|
302
|
+
}
|
|
315
303
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
304
|
+
.ft-ripple .ft-ripple--effect {
|
|
305
|
+
transform: translate(-50%, -50%) scale(0.15);
|
|
306
|
+
transition: transform 300ms ease, opacity 75ms linear;
|
|
307
|
+
}
|
|
320
308
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
309
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--effect,
|
|
310
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
311
|
+
left: 50%;
|
|
312
|
+
top: 50%;
|
|
313
|
+
}
|
|
325
314
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
top: 50%;
|
|
330
|
-
}
|
|
315
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
316
|
+
transform: translate(-50%, -50%);
|
|
317
|
+
}
|
|
331
318
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
319
|
+
.ft-ripple.ft-ripple--hovered .ft-ripple--background {
|
|
320
|
+
opacity: ${ii.opacityContentOnSurfaceHover};
|
|
321
|
+
}
|
|
335
322
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
323
|
+
.ft-ripple.ft-ripple--selected .ft-ripple--background {
|
|
324
|
+
opacity: ${ii.opacityContentOnSurfaceSelected};
|
|
325
|
+
}
|
|
339
326
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
327
|
+
.ft-ripple.ft-ripple--focused .ft-ripple--background {
|
|
328
|
+
opacity: ${ii.opacityContentOnSurfaceFocused};
|
|
329
|
+
}
|
|
343
330
|
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
331
|
+
.ft-ripple.ft-ripple--pressed .ft-ripple--effect {
|
|
332
|
+
opacity: ${ii.opacityContentOnSurfacePressed};
|
|
333
|
+
transform: translate(-50%, -50%) scale(1);
|
|
334
|
+
}
|
|
335
|
+
`;var hi=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class pi 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 e(1e3),this.onTransitionStart=t=>{"transform"===t.propertyName&&(this.rippling=this.pressed,this.debouncer.run((()=>this.rippling=!1)))},this.onTransitionEnd=t=>{"transform"===t.propertyName&&(this.rippling=!1)},this.moveRipple=t=>{var e,i;let{x:o,y:s}=this.getCoordinates(t),n=null!==(i=null===(e=this.ripple)||void 0===e?void 0:e.getBoundingClientRect())&&void 0!==i?i:{x:0,y:0,width:0,height:0};this.originX=Math.round(null!=o?o-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 W`
|
|
336
|
+
<style>
|
|
337
|
+
.ft-ripple .ft-ripple--effect,
|
|
338
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
339
|
+
width: ${this.rippleSize}px;
|
|
340
|
+
height: ${this.rippleSize}px;
|
|
341
|
+
}
|
|
347
342
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
343
|
+
.ft-ripple .ft-ripple--effect {
|
|
344
|
+
left: ${this.originX}px;
|
|
345
|
+
top: ${this.originY}px;
|
|
346
|
+
}
|
|
347
|
+
</style>
|
|
348
|
+
<div class="${ti(t)}">
|
|
349
|
+
<div class="ft-ripple--background"></div>
|
|
350
|
+
<div class="ft-ripple--effect"></div>
|
|
351
|
+
</div>
|
|
352
|
+
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){var e,i;super.updated(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(e=this.target)||void 0===e||e.removeAttribute("data-is-ft-ripple-target")):null===(i=this.target)||void 0===i||i.setAttribute("data-is-ft-ripple-target","true")),t.has("unbounded")&&this.setRippleSize()}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}setRippleSize(){if(this.ripple){const t=this.ripple.getBoundingClientRect();this.rippleSize=(this.unbounded?1:1.7)*Math.max(t.width,t.height)}}connectedCallback(){var t;super.connectedCallback();const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;e&&this.setupFor(e),this.setRippleSize()}setupFor(t){if(this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const e=(...t)=>e=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(e)},i=e("mouseup","contextmenu"),o=e("touchend","touchcancel"),s=t=>{["Enter"," "].includes(t.key)&&e("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",i),t.addEventListener("touchstart",o),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",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",i),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 e=t,i=t;let o,s;return null!=e.x?({x:o,y:s}=e):null!=i.touches&&(o=i.touches[0].clientX,s=i.touches[0].clientY),{x:o,y:s}}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let e of t.composedPath()){if(e===this.target)break;if("hasAttribute"in e&&e.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.resizeObserver.disconnect(),this.endRipple()}}pi.elementDefinitions={},pi.styles=ci,hi([o({type:Boolean})],pi.prototype,"primary",void 0),hi([o({type:Boolean})],pi.prototype,"secondary",void 0),hi([o({type:Boolean})],pi.prototype,"unbounded",void 0),hi([o({type:Boolean})],pi.prototype,"activated",void 0),hi([o({type:Boolean})],pi.prototype,"selected",void 0),hi([o({type:Boolean})],pi.prototype,"disabled",void 0),hi([s()],pi.prototype,"hovered",void 0),hi([s()],pi.prototype,"focused",void 0),hi([s()],pi.prototype,"pressed",void 0),hi([s()],pi.prototype,"rippling",void 0),hi([s()],pi.prototype,"rippleSize",void 0),hi([s()],pi.prototype,"originX",void 0),hi([s()],pi.prototype,"originY",void 0),hi([r(".ft-ripple")],pi.prototype,"ripple",void 0),hi([r(".ft-ripple--effect")],pi.prototype,"rippleEffect",void 0),h("ft-ripple")(pi);const di={distance:ut.create("--ft-tooltip-distance","SIZE","4px"),color:ut.create("--ft-tooltip-color","COLOR","#FFFFFF"),backgroundColor:ut.create("--ft-tooltip-background-color","COLOR","#666666"),zIndex:ut.create("--ft-tooltip-z-index","NUMBER","1"),borderRadiusS:ut.external(vt.borderRadiusS,"Design system"),maxWidth:ut.create("--ft-tooltip-max-width","SIZE","150px")},fi=g`
|
|
353
|
+
.ft-tooltip--container {
|
|
354
|
+
display: block;
|
|
355
|
+
position: relative;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.ft-tooltip--inline {
|
|
359
|
+
display: inline-block;
|
|
360
|
+
max-width: 100%;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.ft-tooltip {
|
|
364
|
+
position: absolute;
|
|
365
|
+
box-sizing: border-box;
|
|
366
|
+
overflow: hidden;
|
|
367
|
+
width: max-content;
|
|
368
|
+
max-width: ${di.maxWidth};
|
|
369
|
+
text-align: center;
|
|
370
|
+
padding: ${di.distance};
|
|
371
|
+
z-index: ${di.zIndex};
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.ft-tooltip--content {
|
|
375
|
+
padding: 4px 8px;
|
|
376
|
+
border-radius: ${di.borderRadiusS};
|
|
377
|
+
background-color: ${di.backgroundColor};
|
|
378
|
+
color: ${di.color};
|
|
379
|
+
top: -500px;
|
|
380
|
+
left: -500px;
|
|
381
|
+
position: relative;
|
|
382
|
+
word-break: break-word;
|
|
383
|
+
}
|
|
384
|
+
`;var ui=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class bi 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 e,this.revealDebouncer=new e}render(){return W`
|
|
353
385
|
<div part="container"
|
|
354
386
|
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
355
387
|
@mouseenter=${this.onHover}
|
|
@@ -365,298 +397,266 @@ const Qe=Et(class extends zt{constructor(t){var e;if(super(t),t.type!==Ot||"clas
|
|
|
365
397
|
</div>
|
|
366
398
|
<slot></slot>
|
|
367
399
|
</div>
|
|
368
|
-
`}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 e=t.getBoundingClientRect(),i=(e.height-this.tooltip.clientHeight)/2,o=(e.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=e.height,s=o;break;case"left":n=i,s=-this.tooltip.clientWidth;break;case"right":n=i,s=e.width}e.left+s+this.tooltip.clientWidth>window.innerWidth&&(s=window.innerWidth-this.tooltip.clientWidth-e.left),e.left+s<0&&(s=0);const r=this.tooltip.style;r.left=s+"px",r.top=n+"px",r.maxWidth=`max(${e.width}px, ${
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
.ft-tooltip--inline {
|
|
375
|
-
display: inline-block;
|
|
376
|
-
max-width: 100%;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
.ft-tooltip {
|
|
380
|
-
position: absolute;
|
|
381
|
-
box-sizing: border-box;
|
|
382
|
-
overflow: hidden;
|
|
383
|
-
width: max-content;
|
|
384
|
-
max-width: ${hi.maxWidth};
|
|
385
|
-
text-align: center;
|
|
386
|
-
padding: ${hi.distance};
|
|
387
|
-
z-index: ${hi.zIndex};
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
.ft-tooltip--content {
|
|
391
|
-
padding: 4px 8px;
|
|
392
|
-
border-radius: ${hi.borderRadiusS};
|
|
393
|
-
background-color: ${hi.backgroundColor};
|
|
394
|
-
color: ${hi.color};
|
|
395
|
-
top: -500px;
|
|
396
|
-
left: -500px;
|
|
397
|
-
position: relative;
|
|
398
|
-
word-break: break-word;
|
|
399
|
-
}
|
|
400
|
-
`,ci([o()],pi.prototype,"text",void 0),ci([o({type:Boolean})],pi.prototype,"manual",void 0),ci([o({type:Boolean})],pi.prototype,"inline",void 0),ci([o({type:Number})],pi.prototype,"delay",void 0),ci([o()],pi.prototype,"position",void 0),ci([function(t,e,i){let o,s=t;return"object"==typeof t?(s=t.slot,o=t):o={flatten:e},i?c({slot:s,flatten:e,selector:i}):n({descriptor:t=>({get(){var t,e;const i="slot"+(s?`[name=${s}]`:":not([name])"),n=null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector(i);return null!==(e=null==n?void 0:n.assignedNodes(o))&&void 0!==e?e:[]},enumerable:!0,configurable:!0})})}("",!0)],pi.prototype,"slotNodes",void 0),ci([r(".ft-tooltip--container")],pi.prototype,"container",void 0),ci([r("slot")],pi.prototype,"target",void 0),ci([r(".ft-tooltip")],pi.prototype,"tooltip",void 0),ci([r(".ft-tooltip--content")],pi.prototype,"tooltipContent",void 0),ci([s()],pi.prototype,"visible",void 0),h("ft-tooltip")(pi);const di={color:ut.extend("--ft-loader-color",vt.colorPrimary),size:ut.create("--ft-loader-size","SIZE","80px")};class fi extends xt{static get styles(){return g`
|
|
401
|
-
:host {
|
|
402
|
-
line-height: 0;
|
|
403
|
-
}
|
|
400
|
+
`}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 e=t.getBoundingClientRect(),i=(e.height-this.tooltip.clientHeight)/2,o=(e.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=e.height,s=o;break;case"left":n=i,s=-this.tooltip.clientWidth;break;case"right":n=i,s=e.width}e.left+s+this.tooltip.clientWidth>window.innerWidth&&(s=window.innerWidth-this.tooltip.clientWidth-e.left),e.left+s<0&&(s=0);const r=this.tooltip.style;r.left=s+"px",r.top=n+"px",r.maxWidth=`max(${e.width}px, ${di.maxWidth})`}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())}}bi.elementDefinitions={"ft-typography":Je},bi.styles=fi,ui([o()],bi.prototype,"text",void 0),ui([o({type:Boolean})],bi.prototype,"manual",void 0),ui([o({type:Boolean})],bi.prototype,"inline",void 0),ui([o({type:Number})],bi.prototype,"delay",void 0),ui([o()],bi.prototype,"position",void 0),ui([function(t,e,i){let o,s=t;return"object"==typeof t?(s=t.slot,o=t):o={flatten:e},i?c({slot:s,flatten:e,selector:i}):n({descriptor:t=>({get(){var t,e;const i="slot"+(s?`[name=${s}]`:":not([name])"),n=null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector(i);return null!==(e=null==n?void 0:n.assignedNodes(o))&&void 0!==e?e:[]},enumerable:!0,configurable:!0})})}("",!0)],bi.prototype,"slotNodes",void 0),ui([r(".ft-tooltip--container")],bi.prototype,"container",void 0),ui([r("slot")],bi.prototype,"target",void 0),ui([r(".ft-tooltip")],bi.prototype,"tooltip",void 0),ui([r(".ft-tooltip--content")],bi.prototype,"tooltipContent",void 0),ui([s()],bi.prototype,"visible",void 0),h("ft-tooltip")(bi);const vi={color:ut.extend("--ft-loader-color",vt.colorPrimary),size:ut.create("--ft-loader-size","SIZE","80px")},gi=g`
|
|
401
|
+
:host {
|
|
402
|
+
line-height: 0;
|
|
403
|
+
}
|
|
404
404
|
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
405
|
+
.ft-loader {
|
|
406
|
+
display: inline-block;
|
|
407
|
+
position: relative;
|
|
408
408
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
409
|
+
width: ${vi.size};
|
|
410
|
+
height: ${vi.size};
|
|
411
|
+
}
|
|
412
412
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
413
|
+
.ft-loader div {
|
|
414
|
+
position: absolute;
|
|
415
|
+
top: 37.5%;
|
|
416
|
+
width: 25%;
|
|
417
|
+
height: 25%;
|
|
418
|
+
border-radius: 50%;
|
|
419
|
+
background: ${vi.color};
|
|
420
|
+
animation-timing-function: cubic-bezier(0, 1, 1, 0);
|
|
421
|
+
}
|
|
422
422
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
423
|
+
.ft-loader div:nth-child(1) {
|
|
424
|
+
left: 2.5%;
|
|
425
|
+
animation: appear 0.6s infinite;
|
|
426
|
+
}
|
|
427
427
|
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
428
|
+
.ft-loader div:nth-child(2) {
|
|
429
|
+
left: 2.5%;
|
|
430
|
+
animation: move 0.6s infinite;
|
|
431
|
+
}
|
|
432
432
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
433
|
+
.ft-loader div:nth-child(3) {
|
|
434
|
+
left: 37.5%;
|
|
435
|
+
animation: move 0.6s infinite;
|
|
436
|
+
}
|
|
437
437
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
438
|
+
.ft-loader div:nth-child(4) {
|
|
439
|
+
left: 72.5%;
|
|
440
|
+
animation: disappear 0.6s infinite;
|
|
441
|
+
}
|
|
442
442
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
443
|
+
@keyframes appear {
|
|
444
|
+
0% {
|
|
445
|
+
transform: scale(0);
|
|
446
|
+
}
|
|
447
|
+
100% {
|
|
448
|
+
transform: scale(1);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
451
|
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
452
|
+
@keyframes disappear {
|
|
453
|
+
0% {
|
|
454
|
+
transform: scale(1);
|
|
455
|
+
}
|
|
456
|
+
100% {
|
|
457
|
+
transform: scale(0);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
460
|
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
461
|
+
@keyframes move {
|
|
462
|
+
0% {
|
|
463
|
+
transform: translate(0, 0);
|
|
464
|
+
}
|
|
465
|
+
100% {
|
|
466
|
+
transform: translate(calc(0.35 * ${vi.size}), 0);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
`;class xi extends xt{render(){return W`
|
|
470
470
|
<div class="ft-loader">
|
|
471
471
|
<div></div>
|
|
472
472
|
<div></div>
|
|
473
473
|
<div></div>
|
|
474
474
|
<div></div>
|
|
475
475
|
</div>
|
|
476
|
-
`}}h("ft-loader")(
|
|
476
|
+
`}}xi.styles=gi,h("ft-loader")(xi);
|
|
477
477
|
/**
|
|
478
478
|
* @license
|
|
479
479
|
* Copyright 2017 Google LLC
|
|
480
480
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
481
481
|
*/
|
|
482
|
-
class
|
|
482
|
+
class yi extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===q||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 e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}yi.directiveName="unsafeHTML",yi.resultType=1;const mi=Et(yi);var $i,wi;!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=""}($i||($i={})),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=""}(wi||(wi={}));const ki=new Map([...["abw"].map((t=>[t,wi.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,wi.AUDIO])),...["avi"].map((t=>[t,wi.AVI])),...["chm","xhs"].map((t=>[t,wi.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,wi.CODE])),...["csv"].map((t=>[t,wi.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,wi.DITA])),...["epub"].map((t=>[t,wi.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,wi.EXCEL])),...["flac"].map((t=>[t,wi.FLAC])),...["gif"].map((t=>[t,wi.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,wi.GZIP])),...["html","htm","xhtml"].map((t=>[t,wi.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,wi.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,wi.JPEG])),...["json"].map((t=>[t,wi.JSON])),...["m4a","m4p"].map((t=>[t,wi.M4A])),...["mov","qt"].map((t=>[t,wi.MOV])),...["mp3"].map((t=>[t,wi.MP3])),...["mp4","m4v"].map((t=>[t,wi.MP4])),...["ogg","oga"].map((t=>[t,wi.OGG])),...["pdf","ps"].map((t=>[t,wi.PDF])),...["png"].map((t=>[t,wi.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,wi.POWERPOINT])),...["rar"].map((t=>[t,wi.RAR])),...["stp"].map((t=>[t,wi.STP])),...["txt","rtf","md","mdown"].map((t=>[t,wi.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,wi.VIDEO])),...["wav"].map((t=>[t,wi.WAV])),...["wma"].map((t=>[t,wi.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,wi.WORD])),...["xml","xsl","rdf"].map((t=>[t,wi.XML])),...["yaml","yml","x-yaml"].map((t=>[t,wi.YAML])),...["zip"].map((t=>[t,wi.ZIP]))]),Si=new Map([["application/msword","application/doc"],["application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/docx"],["application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/dotx"],["application/vnd.ms-word.document.macroEnabled.12","application/docm"],["application/vnd.ms-word.template.macroEnabled.12","application/dotm"],["application/vnd.ms-excel","application/xls"],["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/xlsx"],["application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/xltx"],["application/vnd.ms-excel.sheet.macroEnabled.12","application/xlsm"],["application/vnd.ms-excel.template.macroEnabled.12","application/xltm"],["application/vnd.ms-excel.addin.macroEnabled.12","application/xlam"],["application/vnd.ms-excel.sheet.binary.macroEnabled.12","application/xlsb"],["application/vnd.ms-powerpoint","application/ppt"],["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/pptx"],["application/vnd.openxmlformats-officedocument.presentationml.template","application/potx"],["application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/ppsx"],["application/vnd.ms-powerpoint.addin.macroEnabled.12","application/ppam"],["application/vnd.ms-powerpoint.presentation.macroEnabled.12","application/pptm"],["application/vnd.ms-powerpoint.template.macroEnabled.12","application/potm"],["application/vnd.ms-powerpoint.slideshow.macroEnabled.12","application/ppsm"],["application/vnd.ms-access","application/mdb"]]);const Oi={size:ut.create("--ft-icon-font-size","SIZE","24px"),fluidTopicsFontFamily:ut.extend("--ft-icon-fluid-topics-font-family",ut.create("--ft-icon-font-family","UNKNOWN","ft-icons")),fileFormatFontFamily:ut.extend("--ft-icon-file-format-font-family",ut.create("--ft-icon-font-family","UNKNOWN","ft-mime")),materialFontFamily:ut.extend("--ft-icon-material-font-family",ut.create("--ft-icon-font-family","UNKNOWN","Material Icons")),verticalAlign:ut.create("--ft-icon-vertical-align","UNKNOWN","unset")},Ci=g`
|
|
483
|
+
:host {
|
|
484
|
+
display: inline-block;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
:host, i.ft-icon {
|
|
488
|
+
width: ${Oi.size};
|
|
489
|
+
height: ${Oi.size};
|
|
490
|
+
text-align: center;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
i.ft-icon {
|
|
494
|
+
font-size: ${Oi.size};
|
|
495
|
+
line-height: 1;
|
|
496
|
+
font-weight: normal;
|
|
497
|
+
text-transform: none;
|
|
498
|
+
font-style: normal;
|
|
499
|
+
font-variant: normal;
|
|
500
|
+
speak: none;
|
|
501
|
+
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
|
|
502
|
+
text-rendering: auto;
|
|
503
|
+
-webkit-font-smoothing: antialiased;
|
|
504
|
+
-moz-osx-font-smoothing: grayscale;
|
|
505
|
+
vertical-align: ${Oi.verticalAlign};
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
.ft-icon--fluid-topics {
|
|
509
|
+
font-family: ${Oi.fluidTopicsFontFamily}, ft-icons, fticons, sans-serif;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
.ft-icon--file-format {
|
|
513
|
+
font-family: ${Oi.fileFormatFontFamily}, ft-mime, sans-serif;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
.ft-icon--material {
|
|
517
|
+
font-family: ${Oi.materialFontFamily}, "Material Icons", sans-serif;
|
|
518
|
+
}
|
|
519
|
+
`;var Ei;!function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(Ei||(Ei={}));var zi=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Bi extends xt{constructor(){super(...arguments),this.variant=Ei.fluid_topics,this.resolvedIcon=q}render(){const t="material"!==this.variant||this.value;return W`
|
|
483
520
|
<i class="ft-icon ${"ft-icon--"+this.variant}">
|
|
484
|
-
${
|
|
521
|
+
${mi(this.resolvedIcon)}
|
|
485
522
|
<slot ?hidden=${t}></slot>
|
|
486
523
|
</i>
|
|
487
|
-
`}get textContent(){var t,e;return null!==(e=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==e?e:""}update(t){super.update(t),["value","variant"].some((e=>t.has(e)))&&this.resolveIcon()}resolveIcon(){var t,e;let i=this.value||this.textContent;switch(this.variant){case
|
|
524
|
+
`}get textContent(){var t,e;return null!==(e=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==e?e:""}update(t){super.update(t),["value","variant"].some((e=>t.has(e)))&&this.resolveIcon()}resolveIcon(){var t,e;let i=this.value||this.textContent;switch(this.variant){case Ei.file_format:this.resolvedIcon=null!==(t=wi[i.toUpperCase()])&&void 0!==t?t:i;break;case Ei.fluid_topics:this.resolvedIcon=null!==(e=$i[i.toUpperCase()])&&void 0!==e?e:i;break;default:this.resolvedIcon=this.value||q}}firstUpdated(t){super.firstUpdated(t),setTimeout((()=>{this.resolveIcon()}))}}Bi.elementDefinitions={},Bi.styles=Ci,zi([o()],Bi.prototype,"variant",void 0),zi([o()],Bi.prototype,"value",void 0),zi([s()],Bi.prototype,"resolvedIcon",void 0),zi([r("slot")],Bi.prototype,"slottedContent",void 0),h("ft-icon")(Bi);const Mi=ut.extend("--ft-button-color",vt.colorPrimary),Ni={backgroundColor:ut.extend("--ft-button-background-color",vt.colorSurface),borderRadius:ut.extend("--ft-button-border-radius",vt.borderRadiusL),color:Mi,fontSize:ut.extend("--ft-button-font-size",Ie.fontSize),iconSize:ut.create("--ft-button-icon-size","SIZE","24px"),rippleColor:ut.extend("--ft-button-ripple-color",Mi),opacityDisabled:ut.external(vt.colorOpacityDisabled,"Design system")},Fi=ut.extend("--ft-button-primary-color",ut.extend("--ft-button-color",vt.colorOnPrimary)),Ri={backgroundColor:ut.extend("--ft-button-primary-background-color",ut.extend("--ft-button-background-color",vt.colorPrimary)),color:Fi,rippleColor:ut.extend("--ft-button-primary-ripple-color",Fi)},Li=ut.extend("--ft-button-dense-border-radius",ut.extend("--ft-button-border-radius",vt.borderRadiusM)),Di=[yt,g`
|
|
488
525
|
:host {
|
|
489
526
|
display: inline-block;
|
|
527
|
+
max-width: 100%;
|
|
528
|
+
pointer-events: none;
|
|
490
529
|
}
|
|
491
530
|
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
text-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
i.ft-icon {
|
|
499
|
-
font-size: ${wi.size};
|
|
500
|
-
line-height: 1;
|
|
501
|
-
font-weight: normal;
|
|
502
|
-
text-transform: none;
|
|
503
|
-
font-style: normal;
|
|
504
|
-
font-variant: normal;
|
|
505
|
-
speak: none;
|
|
506
|
-
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
|
|
507
|
-
text-rendering: auto;
|
|
508
|
-
-webkit-font-smoothing: antialiased;
|
|
509
|
-
-moz-osx-font-smoothing: grayscale;
|
|
510
|
-
vertical-align: ${wi.verticalAlign};
|
|
531
|
+
button {
|
|
532
|
+
box-shadow: 0px 0px 0px transparent;
|
|
533
|
+
border: 0px solid transparent;
|
|
534
|
+
text-shadow: 0px 0px 0px transparent;
|
|
535
|
+
font-size: ${Ni.fontSize};
|
|
511
536
|
}
|
|
512
537
|
|
|
513
|
-
|
|
514
|
-
|
|
538
|
+
button:hover {
|
|
539
|
+
box-shadow: 0px 0px 0px transparent;
|
|
540
|
+
border: 0px solid transparent;
|
|
541
|
+
text-shadow: 0px 0px 0px transparent;
|
|
515
542
|
}
|
|
516
543
|
|
|
517
|
-
|
|
518
|
-
|
|
544
|
+
button:active {
|
|
545
|
+
outline: none;
|
|
546
|
+
border: none;
|
|
519
547
|
}
|
|
520
548
|
|
|
521
|
-
|
|
522
|
-
|
|
549
|
+
button:focus {
|
|
550
|
+
outline: 0;
|
|
523
551
|
}
|
|
524
|
-
`,$i([o()],ki.prototype,"variant",void 0),$i([o()],ki.prototype,"value",void 0),$i([s()],ki.prototype,"resolvedIcon",void 0),$i([r("slot")],ki.prototype,"slottedContent",void 0),h("ft-icon")(ki);var Si=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const Oi=ut.extend("--ft-button-color",vt.colorPrimary),Ci={backgroundColor:ut.extend("--ft-button-background-color",vt.colorSurface),borderRadius:ut.extend("--ft-button-border-radius",vt.borderRadiusL),color:Oi,fontSize:ut.extend("--ft-button-font-size",Ie.fontSize),iconSize:ut.create("--ft-button-icon-size","SIZE","24px"),rippleColor:ut.extend("--ft-button-ripple-color",Oi),opacityDisabled:ut.external(vt.colorOpacityDisabled,"Design system")},Ei=ut.extend("--ft-button-primary-color",ut.extend("--ft-button-color",vt.colorOnPrimary)),zi={backgroundColor:ut.extend("--ft-button-primary-background-color",ut.extend("--ft-button-background-color",vt.colorPrimary)),color:Ei,rippleColor:ut.extend("--ft-button-primary-ripple-color",Ei)},Bi=ut.extend("--ft-button-dense-border-radius",ut.extend("--ft-button-border-radius",vt.borderRadiusM));class Mi extends xt{constructor(){super(...arguments),this.primary=!1,this.outlined=!1,this.disabled=!1,this.dense=!1,this.round=!1,this.label="",this.icon=void 0,this.iconVariant=mi.material,this.trailingIcon=!1,this.loading=!1,this.tooltipPosition="bottom",this.hideTooltip=!1,this.onclick=t=>{this.isDisabled()&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation())}}static get styles(){return[yt,g`
|
|
525
|
-
:host {
|
|
526
|
-
display: inline-block;
|
|
527
|
-
max-width: 100%;
|
|
528
|
-
pointer-events: none;
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
button {
|
|
532
|
-
box-shadow: 0px 0px 0px transparent;
|
|
533
|
-
border: 0px solid transparent;
|
|
534
|
-
text-shadow: 0px 0px 0px transparent;
|
|
535
|
-
font-size: ${Ci.fontSize};
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
button:hover {
|
|
539
|
-
box-shadow: 0px 0px 0px transparent;
|
|
540
|
-
border: 0px solid transparent;
|
|
541
|
-
text-shadow: 0px 0px 0px transparent;
|
|
542
|
-
}
|
|
543
552
|
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
553
|
+
.ft-button {
|
|
554
|
+
position: relative;
|
|
555
|
+
display: flex;
|
|
556
|
+
justify-content: center;
|
|
557
|
+
align-items: center;
|
|
558
|
+
width: 100%;
|
|
559
|
+
overflow: hidden;
|
|
560
|
+
box-sizing: border-box;
|
|
561
|
+
border: none;
|
|
562
|
+
pointer-events: auto;
|
|
548
563
|
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
564
|
+
--ft-button-internal-line-height: calc(${Ni.fontSize} + 2px);
|
|
565
|
+
--ft-button-internal-color: ${Ni.color};
|
|
566
|
+
${bt(Oi.size,Ni.iconSize)};
|
|
567
|
+
--ft-button-internal-vertical-padding: 6px;
|
|
568
|
+
--ft-button-internal-horizontal-padding: 8px;
|
|
569
|
+
${bt(ii.color,Ni.rippleColor)};
|
|
570
|
+
--ft-button-internal-content-height: max(var(--ft-button-internal-line-height), ${Ni.iconSize});
|
|
552
571
|
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
overflow: hidden;
|
|
560
|
-
box-sizing: border-box;
|
|
561
|
-
border: none;
|
|
562
|
-
pointer-events: auto;
|
|
563
|
-
|
|
564
|
-
--ft-button-internal-line-height: calc(${Ci.fontSize} + 2px);
|
|
565
|
-
--ft-button-internal-color: ${Ci.color};
|
|
566
|
-
${bt(wi.size,Ci.iconSize)};
|
|
567
|
-
--ft-button-internal-vertical-padding: 6px;
|
|
568
|
-
--ft-button-internal-horizontal-padding: 8px;
|
|
569
|
-
${bt(ei.color,Ci.rippleColor)};
|
|
570
|
-
--ft-button-internal-content-height: max(var(--ft-button-internal-line-height), ${Ci.iconSize});
|
|
571
|
-
|
|
572
|
-
border-radius: ${Ci.borderRadius};
|
|
573
|
-
padding: var(--ft-button-internal-vertical-padding) var(--ft-button-internal-horizontal-padding);
|
|
574
|
-
background-color: ${Ci.backgroundColor};
|
|
575
|
-
color: var(--ft-button-internal-color);
|
|
576
|
-
-webkit-mask-image: radial-gradient(white, black);
|
|
577
|
-
}
|
|
572
|
+
border-radius: ${Ni.borderRadius};
|
|
573
|
+
padding: var(--ft-button-internal-vertical-padding) var(--ft-button-internal-horizontal-padding);
|
|
574
|
+
background-color: ${Ni.backgroundColor};
|
|
575
|
+
color: var(--ft-button-internal-color);
|
|
576
|
+
-webkit-mask-image: radial-gradient(white, black);
|
|
577
|
+
}
|
|
578
578
|
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
579
|
+
.ft-button:not([disabled]):hover {
|
|
580
|
+
cursor: pointer;
|
|
581
|
+
}
|
|
582
582
|
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
583
|
+
.ft-button--dense {
|
|
584
|
+
--ft-button-internal-vertical-padding: 2px;
|
|
585
|
+
--ft-button-internal-horizontal-padding: 4px;
|
|
586
|
+
border-radius: ${Li};
|
|
587
|
+
}
|
|
588
588
|
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
589
|
+
.ft-button--round {
|
|
590
|
+
border-radius: calc(var(--ft-button-internal-content-height) / 2 + var(--ft-button-internal-vertical-padding));
|
|
591
|
+
}
|
|
592
592
|
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
593
|
+
.ft-button[disabled] {
|
|
594
|
+
filter: grayscale(1);
|
|
595
|
+
opacity: ${Ni.opacityDisabled};
|
|
596
|
+
}
|
|
597
597
|
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
598
|
+
.ft-button.ft-button--primary {
|
|
599
|
+
background-color: ${Ri.backgroundColor};
|
|
600
|
+
--ft-button-internal-color: ${Ri.color};
|
|
601
|
+
${bt(ii.color,Ri.rippleColor)};
|
|
602
|
+
}
|
|
603
603
|
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
604
|
+
.ft-button.ft-button--outlined {
|
|
605
|
+
border: 1px solid var(--ft-button-internal-color);
|
|
606
|
+
padding: calc(var(--ft-button-internal-vertical-padding) - 1px) calc(var(--ft-button-internal-horizontal-padding) - 1px);
|
|
607
|
+
}
|
|
608
608
|
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
609
|
+
.ft-button:focus {
|
|
610
|
+
outline: none;
|
|
611
|
+
}
|
|
612
612
|
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
613
|
+
.ft-button--label {
|
|
614
|
+
position: relative;
|
|
615
|
+
overflow: hidden;
|
|
616
|
+
white-space: nowrap;
|
|
617
|
+
text-overflow: ellipsis;
|
|
618
|
+
display: block;
|
|
619
|
+
margin: 0 var(--ft-button-internal-horizontal-padding);
|
|
620
|
+
${bt(Ie.fontSize,"1em")};
|
|
621
|
+
${bt(Ie.lineHeight,"var(--ft-button-internal-content-height)")};
|
|
622
|
+
}
|
|
623
623
|
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
624
|
+
.ft-button--safari-fix .ft-button--label {
|
|
625
|
+
margin-right: 0;
|
|
626
|
+
}
|
|
627
627
|
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
628
|
+
.ft-button--safari-fix .ft-button--label:after {
|
|
629
|
+
content: "\\0000a0";
|
|
630
|
+
display: inline-block;
|
|
631
|
+
width: 0;
|
|
632
|
+
}
|
|
633
633
|
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
634
|
+
.ft-button--label[hidden] {
|
|
635
|
+
display: none;
|
|
636
|
+
}
|
|
637
637
|
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
638
|
+
ft-icon {
|
|
639
|
+
flex-shrink: 0;
|
|
640
|
+
position: relative;
|
|
641
|
+
}
|
|
642
642
|
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
643
|
+
.ft-button--label[hidden] + ft-icon {
|
|
644
|
+
margin: 0 calc(var(--ft-button-internal-horizontal-padding) * -1);
|
|
645
|
+
padding: 0 var(--ft-button-internal-vertical-padding);
|
|
646
|
+
}
|
|
647
647
|
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
648
|
+
.ft-button:not(.ft-button--trailing-icon) ft-icon,
|
|
649
|
+
.ft-button:not(.ft-button--trailing-icon) ft-loader {
|
|
650
|
+
order: -1;
|
|
651
|
+
}
|
|
652
652
|
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
653
|
+
ft-loader {
|
|
654
|
+
${bt(vi.size,Ni.iconSize)};
|
|
655
|
+
${bt(vi.color,"var(--ft-button-internal-color)")};
|
|
656
|
+
}
|
|
657
|
+
`];var Ii=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class ji extends xt{constructor(){super(...arguments),this.primary=!1,this.outlined=!1,this.disabled=!1,this.dense=!1,this.round=!1,this.label="",this.icon=void 0,this.iconVariant=Ei.material,this.trailingIcon=!1,this.loading=!1,this.tooltipPosition="bottom",this.hideTooltip=!1,this.onclick=t=>{this.isDisabled()&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation())}}render(){const t={"ft-button":!0,"ft-button--primary":this.primary,"ft-button--outlined":this.outlined,"ft-button--dense":this.dense,"ft-button--round":this.round,"ft-button--trailing-icon":this.trailingIcon,"ft-button--loading":this.trailingIcon,"ft-button--safari-fix":St,"ft-no-text-select":!0};return this.addTooltipIfNeeded(W`
|
|
658
658
|
<button part="button"
|
|
659
|
-
class="${
|
|
659
|
+
class="${ti(t)}"
|
|
660
660
|
aria-label="${this.getLabel()}"
|
|
661
661
|
?disabled=${this.isDisabled()}>
|
|
662
662
|
<ft-ripple part="ripple" ?disabled=${this.isDisabled()}></ft-ripple>
|
|
@@ -676,111 +676,190 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
676
676
|
</ft-tooltip>
|
|
677
677
|
`}resolveIcon(){return this.loading?W`
|
|
678
678
|
<ft-loader></ft-loader> `:this.icon?W`
|
|
679
|
-
<ft-icon variant="${this.iconVariant}" value="${this.icon}"></ft-icon> `:q}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
679
|
+
<ft-icon variant="${this.iconVariant}" value="${this.icon}"></ft-icon> `:q}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}ji.elementDefinitions={"ft-ripple":pi,"ft-tooltip":bi,"ft-typography":Je,"ft-icon":Bi,"ft-loader":xi},ji.styles=Di,Ii([o({type:Boolean})],ji.prototype,"primary",void 0),Ii([o({type:Boolean})],ji.prototype,"outlined",void 0),Ii([o({type:Boolean})],ji.prototype,"disabled",void 0),Ii([o({type:Boolean})],ji.prototype,"dense",void 0),Ii([o({type:Boolean})],ji.prototype,"round",void 0),Ii([o({type:String})],ji.prototype,"label",void 0),Ii([o({type:String})],ji.prototype,"icon",void 0),Ii([o({type:String})],ji.prototype,"iconVariant",void 0),Ii([o({type:Boolean})],ji.prototype,"trailingIcon",void 0),Ii([o({type:Boolean})],ji.prototype,"loading",void 0),Ii([o({type:String})],ji.prototype,"tooltipPosition",void 0),Ii([o({type:Boolean})],ji.prototype,"hideTooltip",void 0),Ii([r(".ft-button")],ji.prototype,"button",void 0),Ii([r(".ft-button--label slot")],ji.prototype,"slottedContent",void 0),h("ft-button")(ji);const Pi=ut.extend("--ft-checkbox-text-color",vt.colorOnSurfaceHigh),Ui=ut.external(vt.colorPrimary,"Design system"),Ai=ut.external(vt.colorOnPrimary,"Design system"),Ti=ut.extend("--ft-checkbox-border-color",vt.colorOnSurfaceMedium),_i=ut.external(vt.colorOnSurfaceDisabled,"Design system"),Hi=g`
|
|
680
|
+
* {
|
|
681
|
+
box-sizing: border-box;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
.ft-checkbox {
|
|
685
|
+
box-sizing: border-box;
|
|
686
|
+
color: ${Pi};
|
|
687
|
+
|
|
688
|
+
display: inline-flex;
|
|
689
|
+
align-items: center;
|
|
690
|
+
gap: 4px;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
.ft-checkbox--disabled {
|
|
694
|
+
color: ${_i};
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
input {
|
|
698
|
+
opacity: 0;
|
|
699
|
+
position: absolute;
|
|
700
|
+
width: 40px;
|
|
701
|
+
height: 40px;
|
|
702
|
+
margin: 0;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
.ft-checkbox--box-container {
|
|
706
|
+
position: relative;
|
|
707
|
+
width: 40px;
|
|
708
|
+
height: 40px;
|
|
709
|
+
|
|
710
|
+
display: flex;
|
|
711
|
+
justify-content: center;
|
|
712
|
+
align-items: center;
|
|
713
|
+
flex-shrink: 0;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
.ft-checkbox--box {
|
|
717
|
+
display: flex;
|
|
718
|
+
border: 2px solid ${Ti};
|
|
719
|
+
border-radius: 2px;
|
|
720
|
+
|
|
721
|
+
width: 18px;
|
|
722
|
+
height: 18px;
|
|
723
|
+
|
|
724
|
+
color: ${Ai};
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
.ft-checkbox--checked .ft-checkbox--box,
|
|
729
|
+
.ft-checkbox--indeterminate .ft-checkbox--box {
|
|
730
|
+
border-color: ${Ui};
|
|
731
|
+
background-color: ${Ui};
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
.ft-checkbox--disabled .ft-checkbox--box {
|
|
735
|
+
border-color: ${_i};
|
|
736
|
+
background-color: transparent;
|
|
737
|
+
color: ${_i};
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
.ft-checkbox--checkmark {
|
|
741
|
+
transition: opacity 180ms cubic-bezier(0, 0, 0.2, 1) 0ms, transform 180ms cubic-bezier(0, 0, 0.2, 1) 0ms;
|
|
742
|
+
opacity: 0;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
.ft-checkbox--checkmark-path {
|
|
746
|
+
stroke-dashoffset: 0;
|
|
747
|
+
stroke: currentcolor;
|
|
748
|
+
stroke-width: 3px;
|
|
749
|
+
stroke-dasharray: 30;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
.ft-checkbox--checked .ft-checkbox--checkmark,
|
|
753
|
+
.ft-checkbox--indeterminate .ft-checkbox--checkmark {
|
|
754
|
+
opacity: 1;
|
|
755
|
+
}
|
|
756
|
+
`;var Zi=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Ki extends xt{constructor(){super(...arguments),this.name="",this.checked=!1,this.indeterminate=!1,this.disabled=!1}render(){const t={"ft-checkbox":!0,"ft-checkbox--checked":this.checked,"ft-checkbox--indeterminate":this.indeterminate,"ft-checkbox--disabled":this.disabled};return W`
|
|
757
|
+
<label class="${ti(t)}" for="checkbox-input">
|
|
758
|
+
<div class="ft-checkbox--box-container">
|
|
759
|
+
<ft-ripple
|
|
760
|
+
?disabled=${this.disabled}
|
|
761
|
+
?primary=${this.checked||this.indeterminate}
|
|
762
|
+
unbounded>
|
|
763
|
+
</ft-ripple>
|
|
764
|
+
<div class="ft-checkbox--box">
|
|
765
|
+
<svg class="ft-checkbox--checkmark" viewBox="0 0 24 24">
|
|
766
|
+
<path class="ft-checkbox--checkmark-path" fill="none"
|
|
767
|
+
d=${this.indeterminate&&!this.checked?"M2,12 22,12":"M1.73,12.91 8.1,19.28 22.79,4.59"}></path>
|
|
768
|
+
</svg>
|
|
769
|
+
</div>
|
|
770
|
+
<input type="checkbox"
|
|
771
|
+
id="checkbox-input"
|
|
772
|
+
name="${this.name}"
|
|
773
|
+
.checked=${this.checked}
|
|
774
|
+
.disabled=${this.disabled}
|
|
775
|
+
@change=${this.onChange}
|
|
776
|
+
>
|
|
777
|
+
</div>
|
|
701
778
|
<ft-typography variant="body2">
|
|
702
779
|
<slot></slot>
|
|
703
780
|
</ft-typography>
|
|
704
781
|
</label>
|
|
705
|
-
`}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("change",{detail:this.checked}))}contentAvailableCallback(t){var e;super.contentAvailableCallback(t),null===(e=this.ripple)||void 0===e||e.setupFor(this.container)}}
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
782
|
+
`}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("change",{detail:this.checked}))}contentAvailableCallback(t){var e;super.contentAvailableCallback(t),null===(e=this.ripple)||void 0===e||e.setupFor(this.container)}}Ki.elementDefinitions={"ft-ripple":pi,"ft-typography":Je},Ki.styles=Hi,Zi([o()],Ki.prototype,"name",void 0),Zi([o({type:Boolean,reflect:!0})],Ki.prototype,"checked",void 0),Zi([o({type:Boolean})],Ki.prototype,"indeterminate",void 0),Zi([o({type:Boolean})],Ki.prototype,"disabled",void 0),Zi([r(".ft-checkbox")],Ki.prototype,"container",void 0),Zi([r("ft-ripple")],Ki.prototype,"ripple",void 0),h("ft-checkbox")(Ki);const Wi=ut.extend("--ft-radio-text-color",vt.colorOnSurfaceHigh),Vi=ut.external(vt.colorPrimary,"Design system"),qi=(ut.external(vt.colorOnPrimary,"Design system"),ut.extend("--ft-radio-border-color",vt.colorOnSurfaceMedium)),Ji=ut.external(vt.colorOnSurfaceDisabled,"Design system"),Xi=g`
|
|
783
|
+
* {
|
|
784
|
+
box-sizing: border-box;
|
|
785
|
+
}
|
|
709
786
|
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
787
|
+
.ft-radio {
|
|
788
|
+
box-sizing: border-box;
|
|
789
|
+
color: ${Wi};
|
|
713
790
|
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
791
|
+
display: inline-flex;
|
|
792
|
+
align-items: center;
|
|
793
|
+
gap: 4px;
|
|
794
|
+
}
|
|
718
795
|
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
796
|
+
.ft-radio--disabled {
|
|
797
|
+
color: ${Ji};
|
|
798
|
+
}
|
|
722
799
|
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
800
|
+
input {
|
|
801
|
+
opacity: 0;
|
|
802
|
+
position: absolute;
|
|
803
|
+
width: 40px;
|
|
804
|
+
height: 40px;
|
|
805
|
+
margin: 0;
|
|
806
|
+
}
|
|
730
807
|
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
808
|
+
.ft-radio--box-container {
|
|
809
|
+
position: relative;
|
|
810
|
+
width: 40px;
|
|
811
|
+
height: 40px;
|
|
735
812
|
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
813
|
+
display: flex;
|
|
814
|
+
justify-content: center;
|
|
815
|
+
align-items: center;
|
|
816
|
+
flex-shrink: 0;
|
|
817
|
+
}
|
|
741
818
|
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
border-radius: 2px;
|
|
819
|
+
.ft-radio--box {
|
|
820
|
+
border: 2px solid ${qi};
|
|
821
|
+
border-radius: 50%;
|
|
746
822
|
|
|
747
|
-
|
|
748
|
-
|
|
823
|
+
display: flex;
|
|
824
|
+
justify-content: center;
|
|
825
|
+
align-items: center;
|
|
749
826
|
|
|
750
|
-
|
|
751
|
-
|
|
827
|
+
width: 20px;
|
|
828
|
+
height: 20px;
|
|
829
|
+
}
|
|
752
830
|
|
|
831
|
+
.ft-radio--box:after {
|
|
832
|
+
content: " ";
|
|
833
|
+
background-color: ${Vi};
|
|
753
834
|
|
|
754
|
-
|
|
755
|
-
.ft-checkbox--indeterminate .ft-checkbox--box {
|
|
756
|
-
border-color: ${Ri};
|
|
757
|
-
background-color: ${Ri};
|
|
758
|
-
}
|
|
835
|
+
border-radius: 50%;
|
|
759
836
|
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
background-color: transparent;
|
|
763
|
-
color: ${Ii};
|
|
764
|
-
}
|
|
837
|
+
width: 12px;
|
|
838
|
+
height: 12px;
|
|
765
839
|
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
}
|
|
840
|
+
transform: scale(0);
|
|
841
|
+
transition: transform 100ms ease;
|
|
842
|
+
}
|
|
770
843
|
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
stroke-width: 3px;
|
|
775
|
-
stroke-dasharray: 30;
|
|
776
|
-
}
|
|
844
|
+
.ft-radio--checked .ft-radio--box {
|
|
845
|
+
border-color: ${Vi};
|
|
846
|
+
}
|
|
777
847
|
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
848
|
+
|
|
849
|
+
.ft-radio--checked .ft-radio--box:after {
|
|
850
|
+
transform: scale(1);
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
.ft-radio--disabled .ft-radio--box {
|
|
854
|
+
border-color: ${Ji};
|
|
855
|
+
background-color: transparent;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
.ft-radio--disabled .ft-radio--box:after {
|
|
859
|
+
background-color: ${Ji};
|
|
860
|
+
}
|
|
861
|
+
`;var Yi=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Qi extends CustomEvent{constructor(t,e){super("change",{detail:{value:t,checked:e},bubbles:!0,composed:!0})}}class Gi extends xt{constructor(){super(...arguments),this.value="",this.name="",this.checked=!1,this.disabled=!1}render(){const t={"ft-radio":!0,"ft-radio--checked":this.checked,"ft-radio--disabled":this.disabled};return W`
|
|
862
|
+
<div class="${ti(t)}">
|
|
784
863
|
<div class="ft-radio--box-container">
|
|
785
864
|
<ft-ripple
|
|
786
865
|
?disabled=${this.disabled}
|
|
@@ -804,96 +883,83 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
804
883
|
</ft-typography>
|
|
805
884
|
</label>
|
|
806
885
|
</div>
|
|
807
|
-
`}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.dispatchEvent(new
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
color: ${_i};
|
|
823
|
-
}
|
|
824
|
-
|
|
825
|
-
input {
|
|
826
|
-
opacity: 0;
|
|
827
|
-
position: absolute;
|
|
828
|
-
width: 40px;
|
|
829
|
-
height: 40px;
|
|
830
|
-
margin: 0;
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
.ft-radio--box-container {
|
|
834
|
-
position: relative;
|
|
835
|
-
width: 40px;
|
|
836
|
-
height: 40px;
|
|
837
|
-
|
|
838
|
-
display: flex;
|
|
839
|
-
justify-content: center;
|
|
840
|
-
align-items: center;
|
|
841
|
-
flex-shrink: 0;
|
|
842
|
-
}
|
|
843
|
-
|
|
844
|
-
.ft-radio--box {
|
|
845
|
-
border: 2px solid ${Ti};
|
|
846
|
-
border-radius: 50%;
|
|
847
|
-
|
|
848
|
-
display: flex;
|
|
849
|
-
justify-content: center;
|
|
850
|
-
align-items: center;
|
|
886
|
+
`}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.dispatchEvent(new Qi(this.value,this.checked))}contentAvailableCallback(t){var e;super.contentAvailableCallback(t),null===(e=this.ripple)||void 0===e||e.setupFor(this.container)}select(){this.checked=!0,this.dispatchEvent(new Qi(this.value,this.checked)),this.focus()}focus(){var t;null===(t=this.input)||void 0===t||t.focus()}}Gi.elementDefinitions={"ft-ripple":pi,"ft-typography":Je},Gi.styles=Xi,Yi([o()],Gi.prototype,"value",void 0),Yi([o()],Gi.prototype,"name",void 0),Yi([o({type:Boolean,reflect:!0})],Gi.prototype,"checked",void 0),Yi([o({type:Boolean})],Gi.prototype,"disabled",void 0),Yi([r(".ft-radio")],Gi.prototype,"container",void 0),Yi([r("ft-ripple")],Gi.prototype,"ripple",void 0),Yi([r("input")],Gi.prototype,"input",void 0);const to=g`
|
|
887
|
+
:host {
|
|
888
|
+
display: contents;
|
|
889
|
+
}
|
|
890
|
+
`;var eo=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class io extends xt{constructor(){super(...arguments),this.name=""}render(){return W`
|
|
891
|
+
<slot @slotchange=${this.onSlotChange}
|
|
892
|
+
@change=${this.onChange}
|
|
893
|
+
@keydown=${this.onKeyDown}
|
|
894
|
+
@focusin=${this.focusCurrentValue}
|
|
895
|
+
></slot>
|
|
896
|
+
`}onSlotChange(){this.radioButtons.forEach((t=>t.name=this.name))}onChange(t){t.stopPropagation(),this.radioButtons.forEach((e=>e.checked=t.detail.value===e.value)),this.dispatchEvent(new CustomEvent("change",{detail:t.detail.value})),this.focusCurrentValue()}onKeyDown(t){switch(t.key){case"ArrowUp":case"ArrowLeft":{let e=this.findFtRadio(t),i=this.radioButtons.indexOf(e)-1;this.radioButtons[i<0?this.radioButtons.length-1:i].select();break}case"ArrowDown":case"ArrowRight":{let e=this.radioButtons.indexOf(this.findFtRadio(t))+1;this.radioButtons[e>this.radioButtons.length-1?0:e].select();break}}}findFtRadio(t){return t.composedPath().find((t=>"FT-RADIO"===t.tagName))}focusCurrentValue(){setTimeout((()=>{var t;return null===(t=this.radioButtons.find((t=>t.checked)))||void 0===t?void 0:t.focus()}),10)}}io.elementDefinitions={},io.styles=to,eo([o()],io.prototype,"name",void 0),eo([c()],io.prototype,"radioButtons",void 0),h("ft-radio")(Gi),h("ft-radio-group")(io);const oo={borderRadiusM:ut.external(vt.borderRadiusM,"Design system"),colorOutline:ut.external(vt.colorOutline,"Design system"),colorOnSurface:ut.external(vt.colorOnSurface,"Design system"),colorOnSurfaceMedium:ut.external(vt.colorOnSurfaceMedium,"Design system"),colorOnSurfaceDisabled:ut.external(vt.colorOnSurfaceDisabled,"Design system"),colorPrimary:ut.external(vt.colorPrimary,"Design system"),colorOnPrimary:ut.external(vt.colorOnPrimary,"Design system"),fontFamily:ut.external(we.fontFamily,"Body2 typography"),fontSize:ut.external(we.fontSize,"Body2 typography"),fontWeight:ut.external(we.fontWeight,"Body2 typography"),letterSpacing:ut.external(we.letterSpacing,"Body2 typography"),lineHeight:ut.external(we.lineHeight,"Body2 typography"),textTransform:ut.external(we.textTransform,"Body2 typography")},so=g`
|
|
897
|
+
.ft-filter-level--container {
|
|
898
|
+
display: flex;
|
|
899
|
+
flex-direction: column;
|
|
900
|
+
}
|
|
851
901
|
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
902
|
+
.ft-filter-level--container > * {
|
|
903
|
+
padding: 0 10px;
|
|
904
|
+
}
|
|
855
905
|
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
906
|
+
.ft-filter-level--go-back {
|
|
907
|
+
flex-shrink: 0;
|
|
908
|
+
text-decoration: none;
|
|
909
|
+
position: relative;
|
|
910
|
+
border-radius: ${oo.borderRadiusM};
|
|
911
|
+
overflow: hidden;
|
|
912
|
+
display: flex;
|
|
913
|
+
align-items: center;
|
|
914
|
+
padding: 4px 4px;
|
|
915
|
+
gap: 4px;
|
|
916
|
+
cursor: pointer;
|
|
917
|
+
color: ${oo.colorOnSurface};
|
|
918
|
+
}
|
|
859
919
|
|
|
860
|
-
|
|
920
|
+
.ft-filter-level--go-back:focus {
|
|
921
|
+
outline: none;
|
|
922
|
+
}
|
|
861
923
|
|
|
862
|
-
|
|
863
|
-
|
|
924
|
+
.ft-filter-level--go-back ft-icon {
|
|
925
|
+
flex-shrink: 0;
|
|
926
|
+
}
|
|
864
927
|
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
928
|
+
.ft-filter-level--go-back ft-typography {
|
|
929
|
+
display: block;
|
|
930
|
+
flex-grow: 1;
|
|
931
|
+
flex-shrink: 0;
|
|
932
|
+
}
|
|
868
933
|
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
934
|
+
.ft-filter-level--option {
|
|
935
|
+
display: flex;
|
|
936
|
+
align-items: center;
|
|
937
|
+
max-width: 100%;
|
|
938
|
+
}
|
|
872
939
|
|
|
940
|
+
.ft-filter-level--option ft-button {
|
|
941
|
+
margin-right: -10px;
|
|
942
|
+
flex-shrink: 0;
|
|
943
|
+
}
|
|
873
944
|
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
945
|
+
ft-button {
|
|
946
|
+
${bt(Ni.color,oo.colorOnSurface)};
|
|
947
|
+
}
|
|
877
948
|
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
949
|
+
ft-radio, ft-checkbox {
|
|
950
|
+
flex-shrink: 1;
|
|
951
|
+
flex-grow: 1;
|
|
952
|
+
display: flex;
|
|
953
|
+
max-width: calc(100% + 10px);
|
|
954
|
+
margin-left: -10px;
|
|
955
|
+
word-break: break-word;
|
|
956
|
+
}
|
|
882
957
|
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
}
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
@change=${this.onChange}
|
|
889
|
-
@keydown=${this.onKeyDown}
|
|
890
|
-
@focusin=${this.focusCurrentValue}
|
|
891
|
-
></slot>
|
|
892
|
-
`}onSlotChange(){this.radioButtons.forEach((t=>t.name=this.name))}onChange(t){t.stopPropagation(),this.radioButtons.forEach((e=>e.checked=t.detail.value===e.value)),this.dispatchEvent(new CustomEvent("change",{detail:t.detail.value})),this.focusCurrentValue()}onKeyDown(t){switch(t.key){case"ArrowUp":case"ArrowLeft":{let e=this.findFtRadio(t),i=this.radioButtons.indexOf(e)-1;this.radioButtons[i<0?this.radioButtons.length-1:i].select();break}case"ArrowDown":case"ArrowRight":{let e=this.radioButtons.indexOf(this.findFtRadio(t))+1;this.radioButtons[e>this.radioButtons.length-1?0:e].select();break}}}findFtRadio(t){return t.composedPath().find((t=>"FT-RADIO"===t.tagName))}focusCurrentValue(){setTimeout((()=>{var t;return null===(t=this.radioButtons.find((t=>t.checked)))||void 0===t?void 0:t.focus()}),10)}}Wi.elementDefinitions={},Wi.styles=g`
|
|
893
|
-
:host {
|
|
894
|
-
display: contents;
|
|
895
|
-
}
|
|
896
|
-
`,Ki([o()],Wi.prototype,"name",void 0),Ki([c()],Wi.prototype,"radioButtons",void 0),h("ft-radio")(Zi),h("ft-radio-group")(Wi);var Vi=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const qi={borderRadiusM:ut.external(vt.borderRadiusM,"Design system"),colorOutline:ut.external(vt.colorOutline,"Design system"),colorOnSurface:ut.external(vt.colorOnSurface,"Design system"),colorOnSurfaceMedium:ut.external(vt.colorOnSurfaceMedium,"Design system"),colorOnSurfaceDisabled:ut.external(vt.colorOnSurfaceDisabled,"Design system"),colorPrimary:ut.external(vt.colorPrimary,"Design system"),colorOnPrimary:ut.external(vt.colorOnPrimary,"Design system"),fontFamily:ut.external(we.fontFamily,"Body2 typography"),fontSize:ut.external(we.fontSize,"Body2 typography"),fontWeight:ut.external(we.fontWeight,"Body2 typography"),letterSpacing:ut.external(we.letterSpacing,"Body2 typography"),lineHeight:ut.external(we.lineHeight,"Body2 typography"),textTransform:ut.external(we.textTransform,"Body2 typography")};class Ji extends xt{constructor(){super(...arguments),this.id="",this.options=[],this.multivalued=!1,this.disabled=!1,this.hideSelectedOptions=!1,this.preventNavigation=!1,this.filter="",this.moreValuesButtonLabel="More",this.displayedValuesLimit=0,this.displayedPages=1}get hasHiddenValues(){let t=this.limit;return null!=t&&t<this.options.length}get limit(){return this.displayedValuesLimit>0?this.displayedPages*this.displayedValuesLimit:void 0}get height(){var t,e;return null!==(e=null===(t=this.container)||void 0===t?void 0:t.scrollHeight)&&void 0!==e?e:0}render(){let t=this.options;this.hideSelectedOptions&&(t=t.filter((t=>!t.selected))),this.filter&&(t=t.filter((t=>t.label.toLowerCase().includes(this.filter.toLowerCase()))));const e=t.slice(0,this.limit);return W`
|
|
958
|
+
.ft-filter-level--no-values {
|
|
959
|
+
margin: 10px 0;
|
|
960
|
+
color: ${oo.colorOnSurfaceMedium};
|
|
961
|
+
}
|
|
962
|
+
`;var no=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class ro extends xt{constructor(){super(...arguments),this.id="",this.options=[],this.multivalued=!1,this.disabled=!1,this.hideSelectedOptions=!1,this.preventNavigation=!1,this.filter="",this.moreValuesButtonLabel="More",this.displayedValuesLimit=0,this.displayedPages=1}get hasHiddenValues(){let t=this.limit;return null!=t&&t<this.options.length}get limit(){return this.displayedValuesLimit>0?this.displayedPages*this.displayedValuesLimit:void 0}get height(){var t,e;return null!==(e=null===(t=this.container)||void 0===t?void 0:t.scrollHeight)&&void 0!==e?e:0}render(){let t=this.options;this.hideSelectedOptions&&(t=t.filter((t=>!t.selected))),this.filter&&(t=t.filter((t=>t.label.toLowerCase().includes(this.filter.toLowerCase()))));const e=t.slice(0,this.limit);return W`
|
|
897
963
|
<div class="ft-filter-level--container ${this.disabled?"ft-filter--disabled":""}">
|
|
898
964
|
${null==this.parent?null:W`
|
|
899
965
|
<div tabindex="0"
|
|
@@ -942,7 +1008,7 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
942
1008
|
data-value="${t.value}"
|
|
943
1009
|
.checked=${t.selected}
|
|
944
1010
|
.disabled=${this.disabled}
|
|
945
|
-
.indeterminate=${
|
|
1011
|
+
.indeterminate=${Xe(null!==(e=t.subOptions)&&void 0!==e?e:[],(t=>{var e;return null!==(e=t.subOptions)&&void 0!==e?e:[]})).some((t=>t.selected))}
|
|
946
1012
|
@change=${e=>this.optionsChanged(e,t)}>
|
|
947
1013
|
${t.label}
|
|
948
1014
|
</ft-checkbox>
|
|
@@ -957,291 +1023,156 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
957
1023
|
@change=${t=>t.stopPropagation()}>
|
|
958
1024
|
${t.label}
|
|
959
1025
|
</ft-radio>
|
|
960
|
-
`}onRadioKeyUp(t,e){e.selected&&" "===t.key&&this.optionsChanged(t,e)}optionsChanged(t,e){t.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{detail:e}))}displayLevel(t){this.dispatchEvent(new CustomEvent("display-level",{detail:t}))}}
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
1026
|
+
`}onRadioKeyUp(t,e){e.selected&&" "===t.key&&this.optionsChanged(t,e)}optionsChanged(t,e){t.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{detail:e}))}displayLevel(t){this.dispatchEvent(new CustomEvent("display-level",{detail:t}))}}ro.elementDefinitions={"ft-button":ji,"ft-ripple":pi,"ft-typography":Je,"ft-checkbox":Ki,"ft-icon":Bi,"ft-radio":Gi},ro.styles=so,no([o({type:String})],ro.prototype,"id",void 0),no([o({type:Object})],ro.prototype,"parent",void 0),no([o({type:Array})],ro.prototype,"options",void 0),no([o({type:Boolean})],ro.prototype,"multivalued",void 0),no([o({type:Boolean})],ro.prototype,"disabled",void 0),no([o({type:Boolean})],ro.prototype,"hideSelectedOptions",void 0),no([o({type:Boolean})],ro.prototype,"preventNavigation",void 0),no([o({type:String})],ro.prototype,"filter",void 0),no([o({type:String})],ro.prototype,"moreValuesButtonLabel",void 0),no([o({type:String})],ro.prototype,"noValuesLabel",void 0),no([o({type:Number})],ro.prototype,"displayedValuesLimit",void 0),no([r(".ft-filter-level--container")],ro.prototype,"container",void 0),no([s()],ro.prototype,"displayedPages",void 0);const lo={buttonsColor:ut.extend("--ft-snap-scroll-buttons-color",vt.colorPrimary),buttonsZIndex:ut.create("--ft-snap-scroll-buttons-z-index","COLOR","1"),gap:ut.create("--ft-snap-scroll-gap","SIZE","0"),colorSurface:ut.external(vt.colorSurface,"Design system")},ao=g`
|
|
1027
|
+
.ft-snap-scroll {
|
|
1028
|
+
box-sizing: border-box;
|
|
1029
|
+
position: relative;
|
|
1030
|
+
display: flex;
|
|
965
1031
|
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
}
|
|
1032
|
+
--ft-snap-scroll-transparent-color: transparent;
|
|
1033
|
+
}
|
|
969
1034
|
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
overflow: hidden;
|
|
976
|
-
display: flex;
|
|
977
|
-
align-items: center;
|
|
978
|
-
padding: 4px 4px;
|
|
979
|
-
gap: 4px;
|
|
980
|
-
cursor: pointer;
|
|
981
|
-
color: ${qi.colorOnSurface};
|
|
982
|
-
}
|
|
1035
|
+
.ft-snap-scroll.ft-snap-scroll--safari-fix {
|
|
1036
|
+
/* Safari handles "transparent" as rgba(0,0,0,0) so it's ugly in linear-gradiant with default --ft-color-surface */
|
|
1037
|
+
/* this value should be overridden with --ft-color-surface with alpha set to 0 when needed */
|
|
1038
|
+
--ft-snap-scroll-transparent-color: rgba(255, 255, 255, 0);
|
|
1039
|
+
}
|
|
983
1040
|
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
1041
|
+
.ft-snap-scroll,
|
|
1042
|
+
.ft-snap-scroll--content {
|
|
1043
|
+
overflow: hidden;
|
|
1044
|
+
}
|
|
987
1045
|
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
1046
|
+
.ft-snap-scroll--limit-size,
|
|
1047
|
+
.ft-snap-scroll--limit-size .ft-snap-scroll--content {
|
|
1048
|
+
width: 100%;
|
|
1049
|
+
height: 100%;
|
|
1050
|
+
}
|
|
991
1051
|
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
1052
|
+
.ft-snap-scroll--content {
|
|
1053
|
+
flex-grow: 1;
|
|
1054
|
+
flex-shrink: 1;
|
|
1055
|
+
box-sizing: border-box;
|
|
1056
|
+
scroll-snap-align: start;
|
|
1057
|
+
display: flex;
|
|
1058
|
+
flex-wrap: nowrap;
|
|
1059
|
+
align-items: flex-start;
|
|
1060
|
+
justify-content: flex-start;
|
|
1061
|
+
gap: ${lo.gap};
|
|
1062
|
+
}
|
|
997
1063
|
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
max-width: 100%;
|
|
1002
|
-
}
|
|
1064
|
+
.ft-snap-scroll--hide-scrollbar .ft-snap-scroll--content::-webkit-scrollbar {
|
|
1065
|
+
display: none;
|
|
1066
|
+
}
|
|
1003
1067
|
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1068
|
+
.ft-snap-scroll--hide-scrollbar .ft-snap-scroll--content {
|
|
1069
|
+
-ms-overflow-style: none;
|
|
1070
|
+
scrollbar-width: none;
|
|
1071
|
+
}
|
|
1008
1072
|
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1073
|
+
.ft-snap-scroll--content::slotted(*) {
|
|
1074
|
+
flex-shrink: 0;
|
|
1075
|
+
flex-grow: 1;
|
|
1076
|
+
max-height: 100%;
|
|
1077
|
+
max-width: 100%;
|
|
1078
|
+
}
|
|
1012
1079
|
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
max-width: calc(100% + 10px);
|
|
1018
|
-
margin-left: -10px;
|
|
1019
|
-
word-break: break-word;
|
|
1020
|
-
}
|
|
1080
|
+
.ft-snap-scroll--horizontal,
|
|
1081
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--content {
|
|
1082
|
+
width: 100%;
|
|
1083
|
+
}
|
|
1021
1084
|
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
`],Vi([o({type:String})],Ji.prototype,"id",void 0),Vi([o({type:Object})],Ji.prototype,"parent",void 0),Vi([o({type:Array})],Ji.prototype,"options",void 0),Vi([o({type:Boolean})],Ji.prototype,"multivalued",void 0),Vi([o({type:Boolean})],Ji.prototype,"disabled",void 0),Vi([o({type:Boolean})],Ji.prototype,"hideSelectedOptions",void 0),Vi([o({type:Boolean})],Ji.prototype,"preventNavigation",void 0),Vi([o({type:String})],Ji.prototype,"filter",void 0),Vi([o({type:String})],Ji.prototype,"moreValuesButtonLabel",void 0),Vi([o({type:String})],Ji.prototype,"noValuesLabel",void 0),Vi([o({type:Number})],Ji.prototype,"displayedValuesLimit",void 0),Vi([r(".ft-filter-level--container")],Ji.prototype,"container",void 0),Vi([s()],Ji.prototype,"displayedPages",void 0);var Xi=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const Yi={buttonsColor:ut.extend("--ft-snap-scroll-buttons-color",vt.colorPrimary),buttonsZIndex:ut.create("--ft-snap-scroll-buttons-z-index","COLOR","1"),gap:ut.create("--ft-snap-scroll-gap","SIZE","0"),colorSurface:ut.external(vt.colorSurface,"Design system")};class Qi extends CustomEvent{constructor(t,e){super("current-element-change",{detail:{index:t,element:e}})}}class Gi extends xt{constructor(){super(...arguments),this.horizontal=!1,this.hideScrollbar=!1,this.controls=!1,this.limitSize=!1,this.elements=[],this.currentElement=0,this.withScroll=!1,this.startReached=!0,this.endReached=!0,this.offsetAttribute="offsetTop",this.scrollAttribute="scrollTop",this.sizeAttribute="clientHeight",this.scrollSizeAttribute="scrollHeight",this.updateScrollCallback=()=>this.onScroll(),this.resizeObserver=new ResizeObserver((()=>this.scheduleUpdateScroll())),this.scrollDebouncer=new e(200),this.updateScrollDebouncer=new e(100)}scrollToIndex(t){this.scrollToElement(this.elements[t])}scrollIndexIntoView(t){let e=this.elements[t];if(e){const t=this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]-this.nextSize,i=this.contentSlot[this.scrollAttribute]+this.prevSize;(e[this.offsetAttribute]<i||e[this.offsetAttribute]+e[this.sizeAttribute]>t)&&this.scrollToElement(e)}}previous(){this.scrollToElement(this.elements[Math.max(0,this.closestIndexFromStart()-1)])}next(){this.scrollToElement(this.elements[Math.min(this.closestIndexFromStart()+1,this.elements.length-1)])}render(){const t=Qe({"ft-snap-scroll":!0,"ft-snap-scroll--horizontal":this.horizontal,"ft-snap-scroll--vertical":!this.horizontal,"ft-snap-scroll--hide-scrollbar":this.hideScrollbar,"ft-snap-scroll--limit-size":this.limitSize,"ft-snap-scroll--safari-fix":St}),e=this.controls&&this.withScroll;return W`
|
|
1027
|
-
<div part="container" class="${t}">
|
|
1028
|
-
<ft-button
|
|
1029
|
-
class="ft-snap-scroll--previous"
|
|
1030
|
-
part="controls"
|
|
1031
|
-
primary
|
|
1032
|
-
icon="${this.horizontal?"arrow_back_ios_new":"expand_less"}"
|
|
1033
|
-
?hidden=${!e||this.startReached}
|
|
1034
|
-
?disabled=${!e||this.startReached}
|
|
1035
|
-
@click=${this.previous}
|
|
1036
|
-
></ft-button>
|
|
1037
|
-
<slot class="ft-snap-scroll--content"
|
|
1038
|
-
part="content"
|
|
1039
|
-
@slotchange=${this.onSlotChange}></slot>
|
|
1040
|
-
<ft-button
|
|
1041
|
-
class="ft-snap-scroll--next"
|
|
1042
|
-
part="controls"
|
|
1043
|
-
primary
|
|
1044
|
-
icon="${this.horizontal?"arrow_forward_ios":"expand_more"}"
|
|
1045
|
-
?hidden=${!e||this.endReached}
|
|
1046
|
-
?disabled=${!e||this.endReached}
|
|
1047
|
-
@click=${this.next}
|
|
1048
|
-
></ft-button>
|
|
1049
|
-
</div>
|
|
1050
|
-
`}updated(t){var e;super.updated(t),this.contentSlot&&(this.resizeObserver.observe(this.contentSlot),this.listenedContainer!==this.contentSlot&&(this.listenedContainer&&this.listenedContainer.removeEventListener("scroll",this.updateScrollCallback),this.listenedContainer=this.contentSlot,null===(e=this.listenedContainer)||void 0===e||e.addEventListener("scroll",this.updateScrollCallback))),t.has("horizontal")&&(this.horizontal?(this.offsetAttribute="offsetLeft",this.scrollAttribute="scrollLeft",this.sizeAttribute="clientWidth",this.scrollSizeAttribute="scrollWidth"):(this.offsetAttribute="offsetTop",this.scrollAttribute="scrollTop",this.sizeAttribute="clientHeight",this.scrollSizeAttribute="scrollHeight")),t.has("currentElement")&&this.dispatchEvent(new Qi(this.currentElement,this.elements[this.currentElement]))}onScroll(){this.scrollDebouncer.run((()=>this.snap())),this.scheduleUpdateScroll()}snap(){let t=this.closestElementFromStart();if(null!=t){const e=this.getDistanceFromStart(t);Math.abs(this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]-this.contentSlot[this.scrollSizeAttribute])<e&&(t=this.lastElement),this.scrollToElement(t)}}scrollToElement(t){var e,i;t&&(this.horizontal?null===(e=this.contentSlot)||void 0===e||e.scrollTo({left:this.getOffset(t)-this.controlsSize,behavior:"smooth"}):null===(i=this.contentSlot)||void 0===i||i.scrollTo({top:this.getOffset(t)-this.controlsSize,behavior:"smooth"}),this.currentElement=this.elements.indexOf(t))}onSlotChange(){var t,e;this.elements=null!==(e=null===(t=this.contentSlot)||void 0===t?void 0:t.assignedElements().map((t=>t)))&&void 0!==e?e:[],this.scheduleUpdateScroll()}closestElementFromStart(){return this.elements[this.closestIndexFromStart()]}closestIndexFromStart(){let t=-1;for(let e=0;e<this.elements.length;e++)(t<0||this.getDistanceFromStart(this.elements[e])<this.getDistanceFromStart(this.elements[t]))&&(t=e);return t}scheduleUpdateScroll(){this.updateScrollDebouncer.run((()=>this.updateScroll()))}updateScroll(){null!=this.contentSlot?(this.withScroll=this.contentSlot[this.scrollSizeAttribute]>this.contentSlot[this.sizeAttribute],this.startReached=0===this.contentSlot[this.scrollAttribute],this.endReached=this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]+1>=this.contentSlot[this.scrollSizeAttribute]):(this.withScroll=!1,this.startReached=!0,this.endReached=!0)}get lastElement(){return this.elements[this.elements.length-1]}get firstElementOffset(){let t=this.elements[0];return t?t[this.offsetAttribute]:0}get controlsSize(){return this.controls?36:0}get nextSize(){return this.endReached?0:this.controlsSize}get prevSize(){return this.startReached?0:this.controlsSize}getOffset(t){return t[this.offsetAttribute]-this.firstElementOffset}getDistanceFromStart(t){const e=t===this.elements[0]?0:this.controlsSize;return Math.abs(this.getOffset(t)-this.contentSlot[this.scrollAttribute]-e)}}Gi.elementDefinitions={"ft-button":Mi},Gi.styles=g`
|
|
1051
|
-
.ft-snap-scroll {
|
|
1052
|
-
box-sizing: border-box;
|
|
1053
|
-
position: relative;
|
|
1054
|
-
display: flex;
|
|
1055
|
-
|
|
1056
|
-
--ft-snap-scroll-transparent-color: transparent;
|
|
1057
|
-
}
|
|
1058
|
-
|
|
1059
|
-
.ft-snap-scroll.ft-snap-scroll--safari-fix {
|
|
1060
|
-
/* Safari handles "transparent" as rgba(0,0,0,0) so it's ugly in linear-gradiant with default --ft-color-surface */
|
|
1061
|
-
/* this value should be overridden with --ft-color-surface with alpha set to 0 when needed */
|
|
1062
|
-
--ft-snap-scroll-transparent-color: rgba(255, 255, 255, 0);
|
|
1063
|
-
}
|
|
1064
|
-
|
|
1065
|
-
.ft-snap-scroll,
|
|
1066
|
-
.ft-snap-scroll--content {
|
|
1067
|
-
overflow: hidden;
|
|
1068
|
-
}
|
|
1069
|
-
|
|
1070
|
-
.ft-snap-scroll--limit-size,
|
|
1071
|
-
.ft-snap-scroll--limit-size .ft-snap-scroll--content {
|
|
1072
|
-
width: 100%;
|
|
1073
|
-
height: 100%;
|
|
1074
|
-
}
|
|
1075
|
-
|
|
1076
|
-
.ft-snap-scroll--content {
|
|
1077
|
-
flex-grow: 1;
|
|
1078
|
-
flex-shrink: 1;
|
|
1079
|
-
box-sizing: border-box;
|
|
1080
|
-
scroll-snap-align: start;
|
|
1081
|
-
display: flex;
|
|
1082
|
-
flex-wrap: nowrap;
|
|
1083
|
-
align-items: flex-start;
|
|
1084
|
-
justify-content: flex-start;
|
|
1085
|
-
gap: ${Yi.gap};
|
|
1086
|
-
}
|
|
1087
|
-
|
|
1088
|
-
.ft-snap-scroll--hide-scrollbar .ft-snap-scroll--content::-webkit-scrollbar {
|
|
1089
|
-
display: none;
|
|
1090
|
-
}
|
|
1091
|
-
|
|
1092
|
-
.ft-snap-scroll--hide-scrollbar .ft-snap-scroll--content {
|
|
1093
|
-
-ms-overflow-style: none;
|
|
1094
|
-
scrollbar-width: none;
|
|
1095
|
-
}
|
|
1096
|
-
|
|
1097
|
-
.ft-snap-scroll--content::slotted(*) {
|
|
1098
|
-
flex-shrink: 0;
|
|
1099
|
-
flex-grow: 1;
|
|
1100
|
-
max-height: 100%;
|
|
1101
|
-
max-width: 100%;
|
|
1102
|
-
}
|
|
1103
|
-
|
|
1104
|
-
.ft-snap-scroll--horizontal,
|
|
1105
|
-
.ft-snap-scroll--horizontal .ft-snap-scroll--content {
|
|
1106
|
-
width: 100%;
|
|
1107
|
-
}
|
|
1108
|
-
|
|
1109
|
-
.ft-snap-scroll--vertical,
|
|
1110
|
-
.ft-snap-scroll--vertical .ft-snap-scroll--content {
|
|
1111
|
-
height: 100%;
|
|
1112
|
-
}
|
|
1085
|
+
.ft-snap-scroll--vertical,
|
|
1086
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--content {
|
|
1087
|
+
height: 100%;
|
|
1088
|
+
}
|
|
1113
1089
|
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1090
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--content {
|
|
1091
|
+
flex-direction: row;
|
|
1092
|
+
overflow-x: auto;
|
|
1093
|
+
}
|
|
1118
1094
|
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1095
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--content {
|
|
1096
|
+
flex-direction: column;
|
|
1097
|
+
overflow-y: auto;
|
|
1098
|
+
}
|
|
1123
1099
|
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1100
|
+
.ft-snap-scroll--previous,
|
|
1101
|
+
.ft-snap-scroll--next {
|
|
1102
|
+
position: absolute;
|
|
1103
|
+
display: flex;
|
|
1104
|
+
z-index: ${lo.buttonsZIndex};
|
|
1105
|
+
opacity: 1;
|
|
1106
|
+
transition: background-color .5s ease-in-out, opacity .5s ease-in-out, z-index .5s ease-in-out;
|
|
1107
|
+
${bt(Ni.backgroundColor,"transparent")};
|
|
1108
|
+
${bt(Ni.color,lo.buttonsColor)};
|
|
1109
|
+
}
|
|
1134
1110
|
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1111
|
+
.ft-snap-scroll--previous[hidden],
|
|
1112
|
+
.ft-snap-scroll--next[hidden] {
|
|
1113
|
+
z-index: -1;
|
|
1114
|
+
opacity: 0;
|
|
1115
|
+
}
|
|
1140
1116
|
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1117
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--previous {
|
|
1118
|
+
top: 0;
|
|
1119
|
+
left: -1px;
|
|
1120
|
+
bottom: 0;
|
|
1121
|
+
background: linear-gradient(to right, ${lo.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
1122
|
+
}
|
|
1147
1123
|
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1124
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--previous {
|
|
1125
|
+
top: -1px;
|
|
1126
|
+
left: 0;
|
|
1127
|
+
right: 0;
|
|
1128
|
+
background: linear-gradient(to bottom, ${lo.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
1129
|
+
}
|
|
1154
1130
|
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1131
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--next {
|
|
1132
|
+
top: 0;
|
|
1133
|
+
right: -1px;
|
|
1134
|
+
bottom: 0;
|
|
1135
|
+
background: linear-gradient(to left, ${lo.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
1136
|
+
}
|
|
1161
1137
|
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1138
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--next {
|
|
1139
|
+
left: 0;
|
|
1140
|
+
right: 0;
|
|
1141
|
+
bottom: -1px;
|
|
1142
|
+
background: linear-gradient(to top, ${lo.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
1143
|
+
}
|
|
1168
1144
|
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
<div
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
<
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
<div class="ft-filter--values">
|
|
1199
|
-
${this.renderLevels()}
|
|
1200
|
-
</div>
|
|
1201
|
-
<slot class="ft-filter--slot"
|
|
1202
|
-
@slotchange=${this.updateOptionsFromSlot}
|
|
1203
|
-
@option-change=${this.optionsChanged}></slot>
|
|
1145
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--previous:hover,
|
|
1146
|
+
.ft-snap-scroll--horizontal .ft-snap-scroll--next:hover,
|
|
1147
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--previous:hover,
|
|
1148
|
+
.ft-snap-scroll--vertical .ft-snap-scroll--next:hover {
|
|
1149
|
+
background-color: ${lo.colorSurface};
|
|
1150
|
+
}
|
|
1151
|
+
`;var co=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class ho extends CustomEvent{constructor(t,e){super("current-element-change",{detail:{index:t,element:e}})}}class po extends xt{constructor(){super(...arguments),this.horizontal=!1,this.hideScrollbar=!1,this.controls=!1,this.limitSize=!1,this.elements=[],this.currentElement=0,this.withScroll=!1,this.startReached=!0,this.endReached=!0,this.offsetAttribute="offsetTop",this.scrollAttribute="scrollTop",this.sizeAttribute="clientHeight",this.scrollSizeAttribute="scrollHeight",this.updateScrollCallback=()=>this.onScroll(),this.resizeObserver=new ResizeObserver((()=>this.scheduleUpdateScroll())),this.scrollDebouncer=new e(200),this.updateScrollDebouncer=new e(100)}scrollToIndex(t){this.scrollToElement(this.elements[t])}scrollIndexIntoView(t){let e=this.elements[t];if(e){const t=this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]-this.nextSize,i=this.contentSlot[this.scrollAttribute]+this.prevSize;(e[this.offsetAttribute]<i||e[this.offsetAttribute]+e[this.sizeAttribute]>t)&&this.scrollToElement(e)}}previous(){this.scrollToElement(this.elements[Math.max(0,this.closestIndexFromStart()-1)])}next(){this.scrollToElement(this.elements[Math.min(this.closestIndexFromStart()+1,this.elements.length-1)])}render(){const t=ti({"ft-snap-scroll":!0,"ft-snap-scroll--horizontal":this.horizontal,"ft-snap-scroll--vertical":!this.horizontal,"ft-snap-scroll--hide-scrollbar":this.hideScrollbar,"ft-snap-scroll--limit-size":this.limitSize,"ft-snap-scroll--safari-fix":St}),e=this.controls&&this.withScroll;return W`
|
|
1152
|
+
<div part="container" class="${t}">
|
|
1153
|
+
<ft-button
|
|
1154
|
+
class="ft-snap-scroll--previous"
|
|
1155
|
+
part="controls"
|
|
1156
|
+
primary
|
|
1157
|
+
icon="${this.horizontal?"arrow_back_ios_new":"expand_less"}"
|
|
1158
|
+
?hidden=${!e||this.startReached}
|
|
1159
|
+
?disabled=${!e||this.startReached}
|
|
1160
|
+
@click=${this.previous}
|
|
1161
|
+
></ft-button>
|
|
1162
|
+
<slot class="ft-snap-scroll--content"
|
|
1163
|
+
part="content"
|
|
1164
|
+
@slotchange=${this.onSlotChange}></slot>
|
|
1165
|
+
<ft-button
|
|
1166
|
+
class="ft-snap-scroll--next"
|
|
1167
|
+
part="controls"
|
|
1168
|
+
primary
|
|
1169
|
+
icon="${this.horizontal?"arrow_forward_ios":"expand_more"}"
|
|
1170
|
+
?hidden=${!e||this.endReached}
|
|
1171
|
+
?disabled=${!e||this.endReached}
|
|
1172
|
+
@click=${this.next}
|
|
1173
|
+
></ft-button>
|
|
1204
1174
|
</div>
|
|
1205
|
-
`}
|
|
1206
|
-
${this.raiseSelectedOptions&&e.length>0?W`
|
|
1207
|
-
<ft-filter-level
|
|
1208
|
-
id="${this.id}"
|
|
1209
|
-
?multivalued=${this.multivalued}
|
|
1210
|
-
?disabled=${this.disabled}
|
|
1211
|
-
preventNavigation
|
|
1212
|
-
.options=${e}
|
|
1213
|
-
@change=${this.onChange}
|
|
1214
|
-
part="values selected-values"
|
|
1215
|
-
.exportpartsPrefixes=${["values","selected-values"]}
|
|
1216
|
-
></ft-filter-level>
|
|
1217
|
-
<div class="ft-filter--separator">
|
|
1218
|
-
`:null}
|
|
1219
|
-
<ft-snap-scroll horizontal hideScrollbar
|
|
1220
|
-
class="ft-filter--levels"
|
|
1221
|
-
@current-element-change=${t=>this.levelsScrollDebouncer.run((()=>{for(;t.detail.index<this.displayedLevels.length;)this.displayedLevels.pop();this.requestUpdate()}))}>
|
|
1222
|
-
${this.renderLevel(o,this.options)}
|
|
1223
|
-
${this.displayedLevels.map((e=>t.find((t=>t.value===e)))).map(((t,e)=>{var o;const s=(null==t?void 0:t.value)===this.slideIn||(null==t?void 0:t.value)===this.slideOut?"ft-filter--level-right":e===i?"ft-filter--level-center":"ft-filter--level-left";return this.renderLevel(s,null!==(o=null==t?void 0:t.subOptions)&&void 0!==o?o:[],t)}))}
|
|
1224
|
-
</ft-snap-scroll>
|
|
1225
|
-
`}renderLevel(t,e,i){return W`
|
|
1226
|
-
<ft-filter-level
|
|
1227
|
-
class="${t}"
|
|
1228
|
-
id="${this.id}"
|
|
1229
|
-
filter="${this.filter}"
|
|
1230
|
-
moreValuesButtonLabel="${this.moreValuesButtonLabel}"
|
|
1231
|
-
?multivalued=${this.multivalued}
|
|
1232
|
-
?disabled=${this.disabled||"ft-filter--level-center"!==t}
|
|
1233
|
-
?hideSelectedOptions=${this.raiseSelectedOptions}
|
|
1234
|
-
.parent=${i}
|
|
1235
|
-
.options=${e}
|
|
1236
|
-
.displayedValuesLimit=${this.displayedValuesLimit}
|
|
1237
|
-
@change=${this.onChange}
|
|
1238
|
-
@go-back=${this.goBack}
|
|
1239
|
-
@display-level=${this.onDisplayLevel}
|
|
1240
|
-
part="values available-values"
|
|
1241
|
-
.exportpartsPrefixes=${["values","available-values"]}
|
|
1242
|
-
noValuesLabel="${this.noValuesLabel}"
|
|
1243
|
-
></ft-filter-level>
|
|
1244
|
-
`}goBack(t){this.slideOut=t.detail.value}onDisplayLevel(t){this.displayedLevels.push(t.detail.value),this.slideIn=t.detail.value}clear(){if(this.flatOptions.forEach((t=>t.selected=!1)),this.displayedLevels.length>0){let t=this.displayedLevels[this.displayedLevels.length-1];this.displayedLevels=[t],this.slideOut=t}this.optionsChanged()}onChange(t){var e;t.stopPropagation();const i=this.flatOptions.find((e=>e.value===t.detail.value));i.selected=!i.selected;const o=t=>{var e;t!==i&&(t.selected=!1),null===(e=t.subOptions)||void 0===e||e.forEach(o)};this.multivalued?null===(e=i.subOptions)||void 0===e||e.forEach(o):this.options.forEach(o),this.optionsChanged()}optionsChanged(){this.changeDebouncer.run((()=>{var t;const e=this.flatOptions.filter((t=>t.selected)).map((t=>t.value));this.dispatchEvent(new ao(e)),this.requestUpdate(),null===(t=this.levels)||void 0===t||t.forEach((t=>t.requestUpdate()))}))}updateOptionsFromSlot(t){t.stopPropagation(),this.options=this.slotElement.assignedElements().map((t=>t)),this.optionsChanged()}onFilterChange(){var t,e;this.filter=null!==(e=null===(t=this.filterInput)||void 0===t?void 0:t.value)&&void 0!==e?e:""}updateScroll(){this.valuesContainer&&(this.withScroll=this.valuesContainer.scrollHeight>this.valuesContainer.clientHeight)}}co.elementDefinitions={"ft-button":Mi,"ft-filter-level":Ji,"ft-snap-scroll":Gi,"ft-typography":Ve},co.styles=[He,g`
|
|
1175
|
+
`}updated(t){var e;super.updated(t),this.contentSlot&&(this.resizeObserver.observe(this.contentSlot),this.listenedContainer!==this.contentSlot&&(this.listenedContainer&&this.listenedContainer.removeEventListener("scroll",this.updateScrollCallback),this.listenedContainer=this.contentSlot,null===(e=this.listenedContainer)||void 0===e||e.addEventListener("scroll",this.updateScrollCallback))),t.has("horizontal")&&(this.horizontal?(this.offsetAttribute="offsetLeft",this.scrollAttribute="scrollLeft",this.sizeAttribute="clientWidth",this.scrollSizeAttribute="scrollWidth"):(this.offsetAttribute="offsetTop",this.scrollAttribute="scrollTop",this.sizeAttribute="clientHeight",this.scrollSizeAttribute="scrollHeight")),t.has("currentElement")&&this.dispatchEvent(new ho(this.currentElement,this.elements[this.currentElement]))}onScroll(){this.scrollDebouncer.run((()=>this.snap())),this.scheduleUpdateScroll()}snap(){let t=this.closestElementFromStart();if(null!=t){const e=this.getDistanceFromStart(t);Math.abs(this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]-this.contentSlot[this.scrollSizeAttribute])<e&&(t=this.lastElement),this.scrollToElement(t)}}scrollToElement(t){var e,i;t&&(this.horizontal?null===(e=this.contentSlot)||void 0===e||e.scrollTo({left:this.getOffset(t)-this.controlsSize,behavior:"smooth"}):null===(i=this.contentSlot)||void 0===i||i.scrollTo({top:this.getOffset(t)-this.controlsSize,behavior:"smooth"}),this.currentElement=this.elements.indexOf(t))}onSlotChange(){var t,e;this.elements=null!==(e=null===(t=this.contentSlot)||void 0===t?void 0:t.assignedElements().map((t=>t)))&&void 0!==e?e:[],this.scheduleUpdateScroll()}closestElementFromStart(){return this.elements[this.closestIndexFromStart()]}closestIndexFromStart(){let t=-1;for(let e=0;e<this.elements.length;e++)(t<0||this.getDistanceFromStart(this.elements[e])<this.getDistanceFromStart(this.elements[t]))&&(t=e);return t}scheduleUpdateScroll(){this.updateScrollDebouncer.run((()=>this.updateScroll()))}updateScroll(){null!=this.contentSlot?(this.withScroll=this.contentSlot[this.scrollSizeAttribute]>this.contentSlot[this.sizeAttribute],this.startReached=0===this.contentSlot[this.scrollAttribute],this.endReached=this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]+1>=this.contentSlot[this.scrollSizeAttribute]):(this.withScroll=!1,this.startReached=!0,this.endReached=!0)}get lastElement(){return this.elements[this.elements.length-1]}get firstElementOffset(){let t=this.elements[0];return t?t[this.offsetAttribute]:0}get controlsSize(){return this.controls?36:0}get nextSize(){return this.endReached?0:this.controlsSize}get prevSize(){return this.startReached?0:this.controlsSize}getOffset(t){return t[this.offsetAttribute]-this.firstElementOffset}getDistanceFromStart(t){const e=t===this.elements[0]?0:this.controlsSize;return Math.abs(this.getOffset(t)-this.contentSlot[this.scrollAttribute]-e)}}po.elementDefinitions={"ft-button":ji},po.styles=ao,co([o({type:Boolean})],po.prototype,"horizontal",void 0),co([o({type:Boolean})],po.prototype,"hideScrollbar",void 0),co([o({type:Boolean})],po.prototype,"controls",void 0),co([o({type:Boolean})],po.prototype,"limitSize",void 0),co([s()],po.prototype,"elements",void 0),co([s()],po.prototype,"currentElement",void 0),co([s()],po.prototype,"withScroll",void 0),co([s()],po.prototype,"startReached",void 0),co([s()],po.prototype,"endReached",void 0),co([r(".ft-snap-scroll--content")],po.prototype,"contentSlot",void 0),h("ft-snap-scroll")(po);const fo=ut.external(vt.colorOutline,"Design system"),uo=ut.external(vt.colorOnSurface,"Design system"),bo=ut.external(vt.colorOnSurfaceMedium,"Design system"),vo=ut.external(vt.colorPrimary,"Design system"),go=ut.external(vt.colorSurface,"Design system"),xo=ut.external(vt.transitionDuration,"Design system"),yo=ut.external(vt.transitionTimingFunction,"Design system"),mo=[He,g`
|
|
1245
1176
|
:host {
|
|
1246
1177
|
display: flex;
|
|
1247
1178
|
max-height: 100%;
|
|
@@ -1254,7 +1185,7 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1254
1185
|
flex-direction: column;
|
|
1255
1186
|
max-height: 100%;
|
|
1256
1187
|
max-width: 100%;
|
|
1257
|
-
color: ${
|
|
1188
|
+
color: ${uo};
|
|
1258
1189
|
}
|
|
1259
1190
|
|
|
1260
1191
|
.ft-filter--header {
|
|
@@ -1270,7 +1201,7 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1270
1201
|
.ft-filter--header ft-button {
|
|
1271
1202
|
flex-shrink: 0;
|
|
1272
1203
|
margin-left: auto;
|
|
1273
|
-
${bt(
|
|
1204
|
+
${bt(Ni.iconSize,"18px")};
|
|
1274
1205
|
}
|
|
1275
1206
|
|
|
1276
1207
|
.ft-filter--label {
|
|
@@ -1290,8 +1221,8 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1290
1221
|
padding: 0 10px;
|
|
1291
1222
|
overflow: hidden;
|
|
1292
1223
|
height: 32px;
|
|
1293
|
-
transition: height ${
|
|
1294
|
-
margin ${
|
|
1224
|
+
transition: height ${xo} ${yo},
|
|
1225
|
+
margin ${xo} ${yo};
|
|
1295
1226
|
transition-delay: 500ms;
|
|
1296
1227
|
}
|
|
1297
1228
|
|
|
@@ -1304,15 +1235,15 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1304
1235
|
display: block;
|
|
1305
1236
|
width: 100%;
|
|
1306
1237
|
border-radius: 4px;
|
|
1307
|
-
border: 1px solid ${
|
|
1238
|
+
border: 1px solid ${fo};
|
|
1308
1239
|
padding: 4px;
|
|
1309
|
-
background-color: ${
|
|
1310
|
-
color: ${
|
|
1311
|
-
outline-color: ${
|
|
1240
|
+
background-color: ${go};
|
|
1241
|
+
color: ${uo};
|
|
1242
|
+
outline-color: ${vo};
|
|
1312
1243
|
}
|
|
1313
1244
|
|
|
1314
1245
|
input::placeholder {
|
|
1315
|
-
color: ${
|
|
1246
|
+
color: ${bo};
|
|
1316
1247
|
}
|
|
1317
1248
|
|
|
1318
1249
|
.ft-filter--values {
|
|
@@ -1324,7 +1255,7 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1324
1255
|
}
|
|
1325
1256
|
|
|
1326
1257
|
.ft-filter--separator {
|
|
1327
|
-
border-top: 1px solid ${
|
|
1258
|
+
border-top: 1px solid ${fo};
|
|
1328
1259
|
margin: 4px 10px;
|
|
1329
1260
|
}
|
|
1330
1261
|
|
|
@@ -1349,217 +1280,286 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1349
1280
|
slot {
|
|
1350
1281
|
display: none;
|
|
1351
1282
|
}
|
|
1352
|
-
`]
|
|
1353
|
-
<
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
`}onChange(t){t.stopPropagation(),this.multi||this.content.assignedElements().forEach((e=>e.active=e===t.target))}}uo.elementDefinitions={},uo.styles=g`
|
|
1359
|
-
.ft-accordion {
|
|
1360
|
-
box-sizing: border-box;
|
|
1361
|
-
}
|
|
1362
|
-
`,fo([o({type:Boolean})],uo.prototype,"multi",void 0),fo([r("slot")],uo.prototype,"content",void 0);var bo=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const vo=ut.create("--ft-accordion-toggle-horizontal-spacing","SIZE","16px"),go=ut.create("--ft-accordion-toggle-vertical-spacing","SIZE","16px"),xo=ut.external(vt.colorOutline,"Design system");class yo extends xt{constructor(){super(...arguments),this.icon="",this.label="",this.active=!1}render(){return W`
|
|
1363
|
-
<div class="ft-accordion-item ${this.active?"ft-accordion-item--active":""}">
|
|
1364
|
-
<div class="ft-accordion-item--toggle"
|
|
1365
|
-
part="toggle"
|
|
1366
|
-
@click=${()=>this.active=!this.active}
|
|
1367
|
-
@keydown=${this.onToggleKeyDown}
|
|
1368
|
-
tabindex="0">
|
|
1369
|
-
<ft-ripple part="toggle-ripple"></ft-ripple>
|
|
1370
|
-
${this.icon?W`
|
|
1371
|
-
<ft-icon variant="material">${this.icon}</ft-icon>
|
|
1372
|
-
`:null}
|
|
1373
|
-
${this.label?W`
|
|
1374
|
-
<ft-typography class="ft-accordion-item--label" variant="body1" part="label">${this.label}
|
|
1283
|
+
`];var $o=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class wo extends CustomEvent{constructor(t){super("change",{detail:t})}}class ko extends xt{constructor(){super(...arguments),this.id="",this.label="",this.filterPlaceHolder="Filter {0}",this.clearButtonLabel="Clear",this.moreValuesButtonLabel="More",this.noValuesLabel="No values available",this.options=[],this.multivalued=!1,this.disabled=!1,this.raiseSelectedOptions=!1,this.displayedValuesLimit=0,this.withScroll=!1,this.filter="",this.displayedLevels=[],this.scrollResizeObserver=new ResizeObserver((()=>this.updateScroll())),this.levelsScrollDebouncer=new e(300),this.changeDebouncer=new e(10)}get flatOptions(){return Xe(this.options,(t=>{var e;return null!==(e=t.subOptions)&&void 0!==e?e:[]}))}render(){var t,e;const i=this.flatOptions.some((t=>t.selected));let o=this.withScroll||this.filter||null!==(e=null===(t=this.lastLevel)||void 0===t?void 0:t.hasHiddenValues)&&void 0!==e&&e;return W`
|
|
1284
|
+
<div class="ft-filter--container ${this.disabled?"ft-filter--disabled":""}"
|
|
1285
|
+
part="container">
|
|
1286
|
+
${this.label||i?W`
|
|
1287
|
+
<div class="ft-filter--header" part="header">
|
|
1288
|
+
<ft-typography class="ft-filter--label" variant="overline" part="label">${this.label}
|
|
1375
1289
|
</ft-typography>
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1290
|
+
${i?W`
|
|
1291
|
+
<ft-button icon="close" dense @click=${this.clear} part="clear-button">
|
|
1292
|
+
${this.clearButtonLabel}
|
|
1293
|
+
</ft-button>
|
|
1294
|
+
`:null}
|
|
1295
|
+
</div>
|
|
1296
|
+
`:null}
|
|
1297
|
+
<div class="ft-filter--filter" ?hidden=${!o}>
|
|
1298
|
+
<input type="search"
|
|
1299
|
+
part="input"
|
|
1300
|
+
class="ft-typography--caption"
|
|
1301
|
+
?disabled=${!o}
|
|
1302
|
+
placeholder="${this.filterPlaceHolder.replace("{0}",this.label)}"
|
|
1303
|
+
@search=${this.onFilterChange}
|
|
1304
|
+
@keyup=${this.onFilterChange}>
|
|
1380
1305
|
</div>
|
|
1381
|
-
<div class="ft-
|
|
1382
|
-
|
|
1306
|
+
<div class="ft-filter--values">
|
|
1307
|
+
${this.renderLevels()}
|
|
1383
1308
|
</div>
|
|
1384
|
-
<
|
|
1309
|
+
<slot class="ft-filter--slot"
|
|
1310
|
+
@slotchange=${this.updateOptionsFromSlot}
|
|
1311
|
+
@option-change=${this.optionsChanged}></slot>
|
|
1385
1312
|
</div>
|
|
1386
|
-
`}update(t){super.update(t),t.has("
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
}
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
display: flex;
|
|
1441
|
-
justify-content: center;
|
|
1442
|
-
align-items: center;
|
|
1443
|
-
width: 100%;
|
|
1444
|
-
overflow: hidden;
|
|
1445
|
-
box-sizing: border-box;
|
|
1446
|
-
pointer-events: auto;
|
|
1447
|
-
|
|
1448
|
-
--ft-chip-internal-font-size: ${wo.fontSize};
|
|
1449
|
-
--ft-chip-internal-line-height: max(20px, calc(var(--ft-chip-internal-font-size) + 2px));
|
|
1450
|
-
${bt(wi.size,wo.iconSize)};
|
|
1451
|
-
--ft-chip-internal-vertical-padding: ${wo.verticalPadding};
|
|
1452
|
-
--ft-chip-internal-horizontal-padding: ${wo.horizontalPadding};
|
|
1453
|
-
--ft-chip-internal-icon-padding: 3px;
|
|
1454
|
-
--ft-chip-internal-content-height: max(var(--ft-chip-internal-line-height), ${wo.iconSize});
|
|
1455
|
-
|
|
1456
|
-
border: 1px solid ${wo.colorOutline};
|
|
1457
|
-
color: ${wo.color};
|
|
1458
|
-
${bt(ei.color,wo.rippleColor)};
|
|
1459
|
-
border-radius: calc(var(--ft-chip-internal-content-height) / 2 + var(--ft-chip-internal-vertical-padding));
|
|
1460
|
-
padding: calc(var(--ft-chip-internal-vertical-padding) - 1px) calc(var(--ft-chip-internal-horizontal-padding) - 1px);
|
|
1461
|
-
background-color: ${wo.backgroundColor};
|
|
1462
|
-
line-height: var(--ft-chip-internal-content-height);
|
|
1463
|
-
}
|
|
1464
|
-
|
|
1465
|
-
.ft-chip > *:not(ft-ripple) {
|
|
1466
|
-
position: relative;
|
|
1467
|
-
}
|
|
1468
|
-
|
|
1469
|
-
.ft-chip--dense {
|
|
1470
|
-
--ft-chip-internal-icon-padding: 3px;
|
|
1471
|
-
--ft-chip-internal-vertical-padding: ${Co};
|
|
1472
|
-
--ft-chip-internal-horizontal-padding: ${Oo};
|
|
1473
|
-
--ft-chip-internal-line-height: max(16px, calc(var(--ft-chip-internal-font-size) + 2px));
|
|
1474
|
-
}
|
|
1475
|
-
|
|
1476
|
-
.ft-chip--no-content {
|
|
1477
|
-
--ft-chip-internal-horizontal-padding: var(--ft-chip-horizontal-padding, var(--ft-chip-internal-vertical-padding));
|
|
1478
|
-
}
|
|
1479
|
-
|
|
1480
|
-
.ft-chip--disabled {
|
|
1481
|
-
cursor: default;
|
|
1482
|
-
pointer-events: none;
|
|
1483
|
-
filter: grayscale(1);
|
|
1484
|
-
opacity: ${wo.opacityDisabled};
|
|
1485
|
-
}
|
|
1486
|
-
|
|
1487
|
-
.ft-chip--highlighted {
|
|
1488
|
-
border: none;
|
|
1489
|
-
padding: var(--ft-chip-internal-vertical-padding) var(--ft-chip-internal-horizontal-padding);
|
|
1490
|
-
background-color: ${So.backgroundColor};
|
|
1491
|
-
${bt(ei.color,So.rippleColor)};
|
|
1492
|
-
color: ${So.color};
|
|
1493
|
-
}
|
|
1494
|
-
|
|
1495
|
-
.ft-chip--clickable {
|
|
1496
|
-
cursor: pointer;
|
|
1497
|
-
-webkit-mask-image: radial-gradient(white, black);
|
|
1498
|
-
}
|
|
1499
|
-
|
|
1500
|
-
.ft-chip:focus {
|
|
1501
|
-
outline: none;
|
|
1502
|
-
}
|
|
1503
|
-
|
|
1504
|
-
.ft-chip--icon-container {
|
|
1505
|
-
display: inline-flex;
|
|
1506
|
-
position: relative;
|
|
1507
|
-
overflow: hidden;
|
|
1508
|
-
border-radius: 100%;
|
|
1509
|
-
justify-content: center;
|
|
1510
|
-
align-items: center;
|
|
1511
|
-
flex-shrink: 0;
|
|
1512
|
-
|
|
1513
|
-
padding: var(--ft-chip-internal-icon-padding);
|
|
1514
|
-
margin: calc((-1) * var(--ft-chip-internal-icon-padding));
|
|
1515
|
-
}
|
|
1313
|
+
`}update(t){if(super.update(t),t.has("options")){const t=new Set(this.flatOptions.map((t=>t.value)));this.displayedLevels=this.displayedLevels.filter((e=>t.has(e)))}}contentAvailableCallback(t){var e,i;super.contentAvailableCallback(t),this.valuesContainer&&this.scrollResizeObserver.observe(this.valuesContainer),this.container&&this.scrollResizeObserver.observe(this.container),t.has("options")&&(this.updateScroll(),null===(e=this.levelsContainer)||void 0===e||e.scrollToIndex(this.displayedLevels.length)),t.has("slideIn")&&this.slideIn&&setTimeout((()=>{var t;null===(t=this.levelsContainer)||void 0===t||t.next(),this.slideIn=void 0}),0),t.has("slideOut")&&this.slideOut&&(null===(i=this.levelsContainer)||void 0===i||i.previous(),setTimeout((()=>{this.displayedLevels.pop(),this.slideOut=void 0}),300))}renderLevels(){const t=this.flatOptions,e=t.filter((t=>t.selected)),i=this.slideIn||this.slideOut?this.displayedLevels.length-2:this.displayedLevels.length-1,o=i<0?"ft-filter--level-center":"ft-filter--level-left";return W`
|
|
1314
|
+
${this.raiseSelectedOptions&&e.length>0?W`
|
|
1315
|
+
<ft-filter-level
|
|
1316
|
+
id="${this.id}"
|
|
1317
|
+
?multivalued=${this.multivalued}
|
|
1318
|
+
?disabled=${this.disabled}
|
|
1319
|
+
preventNavigation
|
|
1320
|
+
.options=${e}
|
|
1321
|
+
@change=${this.onChange}
|
|
1322
|
+
part="values selected-values"
|
|
1323
|
+
.exportpartsPrefixes=${["values","selected-values"]}
|
|
1324
|
+
></ft-filter-level>
|
|
1325
|
+
<div class="ft-filter--separator">
|
|
1326
|
+
`:null}
|
|
1327
|
+
<ft-snap-scroll horizontal hideScrollbar
|
|
1328
|
+
class="ft-filter--levels"
|
|
1329
|
+
@current-element-change=${t=>this.levelsScrollDebouncer.run((()=>{for(;t.detail.index<this.displayedLevels.length;)this.displayedLevels.pop();this.requestUpdate()}))}>
|
|
1330
|
+
${this.renderLevel(o,this.options)}
|
|
1331
|
+
${this.displayedLevels.map((e=>t.find((t=>t.value===e)))).map(((t,e)=>{var o;const s=(null==t?void 0:t.value)===this.slideIn||(null==t?void 0:t.value)===this.slideOut?"ft-filter--level-right":e===i?"ft-filter--level-center":"ft-filter--level-left";return this.renderLevel(s,null!==(o=null==t?void 0:t.subOptions)&&void 0!==o?o:[],t)}))}
|
|
1332
|
+
</ft-snap-scroll>
|
|
1333
|
+
`}renderLevel(t,e,i){return W`
|
|
1334
|
+
<ft-filter-level
|
|
1335
|
+
class="${t}"
|
|
1336
|
+
id="${this.id}"
|
|
1337
|
+
filter="${this.filter}"
|
|
1338
|
+
moreValuesButtonLabel="${this.moreValuesButtonLabel}"
|
|
1339
|
+
?multivalued=${this.multivalued}
|
|
1340
|
+
?disabled=${this.disabled||"ft-filter--level-center"!==t}
|
|
1341
|
+
?hideSelectedOptions=${this.raiseSelectedOptions}
|
|
1342
|
+
.parent=${i}
|
|
1343
|
+
.options=${e}
|
|
1344
|
+
.displayedValuesLimit=${this.displayedValuesLimit}
|
|
1345
|
+
@change=${this.onChange}
|
|
1346
|
+
@go-back=${this.goBack}
|
|
1347
|
+
@display-level=${this.onDisplayLevel}
|
|
1348
|
+
part="values available-values"
|
|
1349
|
+
.exportpartsPrefixes=${["values","available-values"]}
|
|
1350
|
+
noValuesLabel="${this.noValuesLabel}"
|
|
1351
|
+
></ft-filter-level>
|
|
1352
|
+
`}goBack(t){this.slideOut=t.detail.value}onDisplayLevel(t){this.displayedLevels.push(t.detail.value),this.slideIn=t.detail.value}clear(){if(this.flatOptions.forEach((t=>t.selected=!1)),this.displayedLevels.length>0){let t=this.displayedLevels[this.displayedLevels.length-1];this.displayedLevels=[t],this.slideOut=t}this.optionsChanged()}onChange(t){var e;t.stopPropagation();const i=this.flatOptions.find((e=>e.value===t.detail.value));i.selected=!i.selected;const o=t=>{var e;t!==i&&(t.selected=!1),null===(e=t.subOptions)||void 0===e||e.forEach(o)};this.multivalued?null===(e=i.subOptions)||void 0===e||e.forEach(o):this.options.forEach(o),this.optionsChanged()}optionsChanged(){this.changeDebouncer.run((()=>{var t;const e=this.flatOptions.filter((t=>t.selected)).map((t=>t.value));this.dispatchEvent(new wo(e)),this.requestUpdate(),null===(t=this.levels)||void 0===t||t.forEach((t=>t.requestUpdate()))}))}updateOptionsFromSlot(t){t.stopPropagation(),this.options=this.slotElement.assignedElements().map((t=>t)),this.optionsChanged()}onFilterChange(){var t,e;this.filter=null!==(e=null===(t=this.filterInput)||void 0===t?void 0:t.value)&&void 0!==e?e:""}updateScroll(){this.valuesContainer&&(this.withScroll=this.valuesContainer.scrollHeight>this.valuesContainer.clientHeight)}}ko.elementDefinitions={"ft-button":ji,"ft-filter-level":ro,"ft-snap-scroll":po,"ft-typography":Je},ko.styles=mo,$o([o({type:String})],ko.prototype,"id",void 0),$o([o({type:String})],ko.prototype,"label",void 0),$o([o({type:String})],ko.prototype,"filterPlaceHolder",void 0),$o([o({type:String})],ko.prototype,"clearButtonLabel",void 0),$o([o({type:String})],ko.prototype,"moreValuesButtonLabel",void 0),$o([o({type:String})],ko.prototype,"noValuesLabel",void 0),$o([p([])],ko.prototype,"options",void 0),$o([o({type:Boolean})],ko.prototype,"multivalued",void 0),$o([o({type:Boolean})],ko.prototype,"disabled",void 0),$o([o({type:Boolean})],ko.prototype,"raiseSelectedOptions",void 0),$o([o({type:Number})],ko.prototype,"displayedValuesLimit",void 0),$o([r(".ft-filter--slot")],ko.prototype,"slotElement",void 0),$o([r(".ft-filter--container")],ko.prototype,"container",void 0),$o([r(".ft-filter--values")],ko.prototype,"valuesContainer",void 0),$o([r(".ft-filter--levels")],ko.prototype,"levelsContainer",void 0),$o([r(".ft-filter--levels ft-filter-level:last-child")],ko.prototype,"lastLevel",void 0),$o([r(".ft-filter--filter input")],ko.prototype,"filterInput",void 0),$o([function(t){return n({descriptor:e=>({get(){var e,i;return null!==(i=null===(e=this.renderRoot)||void 0===e?void 0:e.querySelectorAll(t))&&void 0!==i?i:[]},enumerable:!0,configurable:!0})})}(".ft-filter--levels ft-filter-level")],ko.prototype,"levels",void 0),$o([s()],ko.prototype,"withScroll",void 0),$o([s()],ko.prototype,"filter",void 0),$o([s()],ko.prototype,"slideIn",void 0),$o([s()],ko.prototype,"slideOut",void 0);var So=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Oo extends xt{constructor(){super(...arguments),this.label="",this.value=null,this.selected=!1,this.subOptions=[]}render(){return W`
|
|
1353
|
+
<slot class="ft-filter-option--slot" @slotchange=${this.updateSubOptionsFromSlot}></slot>
|
|
1354
|
+
`}updateSubOptionsFromSlot(t){t.stopPropagation(),this.subOptions=this.slotElement.assignedElements().map((t=>t))}updated(t){super.updated(t),this.dispatchEvent(new CustomEvent("option-change",{detail:this,bubbles:!0}))}}Oo.elementDefinitions={},So([o({type:String})],Oo.prototype,"label",void 0),So([o({type:Object,converter:t=>t})],Oo.prototype,"value",void 0),So([o({type:Boolean,reflect:!0})],Oo.prototype,"selected",void 0),So([o({type:Object})],Oo.prototype,"subOptions",void 0),So([r(".ft-filter-option--slot")],Oo.prototype,"slotElement",void 0),h("ft-filter")(ko),h("ft-filter-option")(Oo);const Co=g`
|
|
1355
|
+
.ft-accordion {
|
|
1356
|
+
box-sizing: border-box;
|
|
1357
|
+
}
|
|
1358
|
+
`;var Eo=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class zo extends xt{constructor(){super(...arguments),this.multi=!1}render(){return W`
|
|
1359
|
+
<div class="ft-accordion">
|
|
1360
|
+
<slot @activated=${this.onChange}></slot>
|
|
1361
|
+
</div>
|
|
1362
|
+
`}onChange(t){t.stopPropagation(),this.multi||this.content.assignedElements().forEach((e=>e.active=e===t.target))}}zo.elementDefinitions={},zo.styles=Co,Eo([o({type:Boolean})],zo.prototype,"multi",void 0),Eo([r("slot")],zo.prototype,"content",void 0);const Bo=ut.create("--ft-accordion-toggle-horizontal-spacing","SIZE","16px"),Mo=ut.create("--ft-accordion-toggle-vertical-spacing","SIZE","16px"),No=ut.external(vt.colorOutline,"Design system"),Fo=g`
|
|
1363
|
+
.ft-accordion-item {
|
|
1364
|
+
display: flex;
|
|
1365
|
+
flex-direction: column;
|
|
1366
|
+
}
|
|
1516
1367
|
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1368
|
+
.ft-accordion-item--toggle {
|
|
1369
|
+
flex-shrink: 0;
|
|
1370
|
+
flex-grow: 0;
|
|
1371
|
+
position: relative;
|
|
1372
|
+
display: flex;
|
|
1373
|
+
align-items: center;
|
|
1374
|
+
cursor: pointer;
|
|
1375
|
+
padding: ${Mo} ${Bo};
|
|
1376
|
+
gap: calc(${Bo} / 2);
|
|
1377
|
+
outline: none;
|
|
1378
|
+
}
|
|
1520
1379
|
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
margin: 0 var(--ft-chip-internal-horizontal-padding);
|
|
1525
|
-
${bt(we.fontSize,"var(--ft-chip-internal-font-size)")};
|
|
1526
|
-
${bt(we.lineHeight,"var(--ft-chip-internal-content-height)")};
|
|
1527
|
-
}
|
|
1380
|
+
.ft-accordion-item--toggle > *:not(ft-ripple) {
|
|
1381
|
+
position: relative;
|
|
1382
|
+
}
|
|
1528
1383
|
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1384
|
+
.ft-accordion-item--label {
|
|
1385
|
+
flex-grow: 1;
|
|
1386
|
+
flex-shrink: 1;
|
|
1387
|
+
display: block;
|
|
1388
|
+
}
|
|
1532
1389
|
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1390
|
+
.ft-accordion-item--content {
|
|
1391
|
+
box-sizing: border-box;
|
|
1392
|
+
flex-shrink: 1;
|
|
1393
|
+
flex-grow: 1;
|
|
1394
|
+
overflow: hidden;
|
|
1395
|
+
height: 0;
|
|
1396
|
+
}
|
|
1538
1397
|
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1398
|
+
.ft-accordion-item--active .ft-accordion-item--content {
|
|
1399
|
+
height: initial;
|
|
1400
|
+
overflow: visible;
|
|
1401
|
+
padding: ${Mo} ${Bo};
|
|
1402
|
+
}
|
|
1544
1403
|
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1404
|
+
.ft-accordion-item--separator {
|
|
1405
|
+
border-bottom: 1px solid ${No};
|
|
1406
|
+
}
|
|
1407
|
+
`;var Ro=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Lo extends xt{constructor(){super(...arguments),this.icon="",this.label="",this.active=!1}render(){return W`
|
|
1408
|
+
<div class="ft-accordion-item ${this.active?"ft-accordion-item--active":""}">
|
|
1409
|
+
<div class="ft-accordion-item--toggle"
|
|
1410
|
+
part="toggle"
|
|
1411
|
+
@click=${()=>this.active=!this.active}
|
|
1412
|
+
@keydown=${this.onToggleKeyDown}
|
|
1413
|
+
tabindex="0">
|
|
1414
|
+
<ft-ripple part="toggle-ripple"></ft-ripple>
|
|
1415
|
+
${this.icon?W`
|
|
1416
|
+
<ft-icon variant="material">${this.icon}</ft-icon>
|
|
1417
|
+
`:null}
|
|
1418
|
+
${this.label?W`
|
|
1419
|
+
<ft-typography class="ft-accordion-item--label" variant="body1" part="label">${this.label}
|
|
1420
|
+
</ft-typography>
|
|
1421
|
+
`:W`
|
|
1422
|
+
<slot class="ft-accordion-item--label" name="toggle" part="label"></slot>
|
|
1423
|
+
`}
|
|
1424
|
+
<ft-icon variant="material">${this.active?"expand_less":"expand_more"}</ft-icon>
|
|
1425
|
+
</div>
|
|
1426
|
+
<div class="ft-accordion-item--content" part="content" @focusin=${()=>this.active=!0}>
|
|
1427
|
+
<slot></slot>
|
|
1428
|
+
</div>
|
|
1429
|
+
<div class="ft-accordion-item--separator" part="separator"></div>
|
|
1430
|
+
</div>
|
|
1431
|
+
`}update(t){super.update(t),t.has("active")&&this.active&&this.dispatchEvent(new Event("activated",{composed:!0,bubbles:!0}))}onToggleKeyDown(t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.active=!this.active)}}Lo.elementDefinitions={"ft-ripple":pi,"ft-typography":Je,"ft-icon":Bi},Lo.styles=Fo,Ro([o({type:String})],Lo.prototype,"icon",void 0),Ro([o({type:String})],Lo.prototype,"label",void 0),Ro([o({type:Boolean,reflect:!0})],Lo.prototype,"active",void 0),h("ft-accordion")(zo),h("ft-accordion-item")(Lo);const Do=ut.extend("--ft-chip-color",vt.colorOnSurface),Io={backgroundColor:ut.extend("--ft-chip-background-color",vt.colorSurface),color:Do,fontSize:ut.extend("--ft-chip-font-size",we.fontSize),iconSize:ut.create("--ft-chip-icon-size","SIZE","18px"),rippleColor:ut.extend("--ft-chip-ripple-color",Do),horizontalPadding:ut.create("--ft-chip-horizontal-padding","SIZE","6px"),verticalPadding:ut.create("--ft-chip-vertical-padding","SIZE","6px"),colorOutline:ut.external(vt.colorOutline,"Design system"),opacityDisabled:ut.external(vt.colorOpacityDisabled,"Design system")},jo=ut.extend("--ft-chip-highlighted-color",ut.extend("--ft-chip-color",vt.colorOnPrimary)),Po={backgroundColor:ut.extend("--ft-chip-highlighted-background-color",ut.extend("--ft-chip-background-color",vt.colorPrimary)),color:jo,rippleColor:ut.extend("--ft-chip-highlighted-ripple-color",jo)},Uo=ut.create("--ft-chip-dense-horizontal-padding","SIZE","4px"),Ao=ut.create("--ft-chip-dense-vertical-padding","SIZE","4px"),To=[yt,g`
|
|
1432
|
+
:host {
|
|
1433
|
+
display: inline-block;
|
|
1434
|
+
max-width: 100%;
|
|
1435
|
+
pointer-events: none;
|
|
1436
|
+
}
|
|
1548
1437
|
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1438
|
+
.ft-chip {
|
|
1439
|
+
position: relative;
|
|
1440
|
+
display: flex;
|
|
1441
|
+
justify-content: center;
|
|
1442
|
+
align-items: center;
|
|
1443
|
+
width: 100%;
|
|
1444
|
+
overflow: hidden;
|
|
1445
|
+
box-sizing: border-box;
|
|
1446
|
+
pointer-events: auto;
|
|
1447
|
+
|
|
1448
|
+
--ft-chip-internal-font-size: ${Io.fontSize};
|
|
1449
|
+
--ft-chip-internal-line-height: max(20px, calc(var(--ft-chip-internal-font-size) + 2px));
|
|
1450
|
+
${bt(Oi.size,Io.iconSize)};
|
|
1451
|
+
--ft-chip-internal-vertical-padding: ${Io.verticalPadding};
|
|
1452
|
+
--ft-chip-internal-horizontal-padding: ${Io.horizontalPadding};
|
|
1453
|
+
--ft-chip-internal-icon-padding: 3px;
|
|
1454
|
+
--ft-chip-internal-content-height: max(var(--ft-chip-internal-line-height), ${Io.iconSize});
|
|
1455
|
+
|
|
1456
|
+
border: 1px solid ${Io.colorOutline};
|
|
1457
|
+
color: ${Io.color};
|
|
1458
|
+
${bt(ii.color,Io.rippleColor)};
|
|
1459
|
+
border-radius: calc(var(--ft-chip-internal-content-height) / 2 + var(--ft-chip-internal-vertical-padding));
|
|
1460
|
+
padding: calc(var(--ft-chip-internal-vertical-padding) - 1px) calc(var(--ft-chip-internal-horizontal-padding) - 1px);
|
|
1461
|
+
background-color: ${Io.backgroundColor};
|
|
1462
|
+
line-height: var(--ft-chip-internal-content-height);
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
.ft-chip > *:not(ft-ripple) {
|
|
1466
|
+
position: relative;
|
|
1467
|
+
}
|
|
1553
1468
|
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1469
|
+
.ft-chip--dense {
|
|
1470
|
+
--ft-chip-internal-icon-padding: 3px;
|
|
1471
|
+
--ft-chip-internal-vertical-padding: ${Ao};
|
|
1472
|
+
--ft-chip-internal-horizontal-padding: ${Uo};
|
|
1473
|
+
--ft-chip-internal-line-height: max(16px, calc(var(--ft-chip-internal-font-size) + 2px));
|
|
1474
|
+
}
|
|
1557
1475
|
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1476
|
+
.ft-chip--no-content {
|
|
1477
|
+
--ft-chip-internal-horizontal-padding: var(--ft-chip-horizontal-padding, var(--ft-chip-internal-vertical-padding));
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
.ft-chip--disabled {
|
|
1481
|
+
cursor: default;
|
|
1482
|
+
pointer-events: none;
|
|
1483
|
+
filter: grayscale(1);
|
|
1484
|
+
opacity: ${Io.opacityDisabled};
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
.ft-chip--highlighted {
|
|
1488
|
+
border: none;
|
|
1489
|
+
padding: var(--ft-chip-internal-vertical-padding) var(--ft-chip-internal-horizontal-padding);
|
|
1490
|
+
background-color: ${Po.backgroundColor};
|
|
1491
|
+
${bt(ii.color,Po.rippleColor)};
|
|
1492
|
+
color: ${Po.color};
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
.ft-chip--clickable {
|
|
1496
|
+
cursor: pointer;
|
|
1497
|
+
-webkit-mask-image: radial-gradient(white, black);
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
.ft-chip:focus {
|
|
1501
|
+
outline: none;
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
.ft-chip--icon-container {
|
|
1505
|
+
display: inline-flex;
|
|
1506
|
+
position: relative;
|
|
1507
|
+
overflow: hidden;
|
|
1508
|
+
border-radius: 100%;
|
|
1509
|
+
justify-content: center;
|
|
1510
|
+
align-items: center;
|
|
1511
|
+
flex-shrink: 0;
|
|
1512
|
+
|
|
1513
|
+
padding: var(--ft-chip-internal-icon-padding);
|
|
1514
|
+
margin: calc((-1) * var(--ft-chip-internal-icon-padding));
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
.ft-chip--icon-container > *:not(ft-ripple) {
|
|
1518
|
+
position: relative;
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
.ft-chip--label {
|
|
1522
|
+
vertical-align: bottom;
|
|
1523
|
+
display: block;
|
|
1524
|
+
margin: 0 var(--ft-chip-internal-horizontal-padding);
|
|
1525
|
+
${bt(we.fontSize,"var(--ft-chip-internal-font-size)")};
|
|
1526
|
+
${bt(we.lineHeight,"var(--ft-chip-internal-content-height)")};
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
.ft-chip--safari-fix .ft-chip--label {
|
|
1530
|
+
margin-right: 0;
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
.ft-chip:not(.ft-chip--multi-line) .ft-chip--label {
|
|
1534
|
+
overflow: hidden;
|
|
1535
|
+
white-space: nowrap;
|
|
1536
|
+
text-overflow: ellipsis;
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
.ft-chip--safari-fix:not(.ft-chip--multi-line) .ft-chip--label:after {
|
|
1540
|
+
content: "\\0000a0";
|
|
1541
|
+
display: inline-block;
|
|
1542
|
+
width: 0;
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
.ft-chip--no-content .ft-chip--label {
|
|
1546
|
+
display: none;
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
.ft-chip--no-content .ft-chip--label + .ft-chip--icon-container {
|
|
1550
|
+
width: var(--ft-chip-internal-content-height);
|
|
1551
|
+
height: var(--ft-chip-internal-content-height);
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
.ft-chip--icon-container:focus {
|
|
1555
|
+
outline: none;
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
.ft-chip:not(.ft-chip--trailing-icon) .ft-chip--icon-container {
|
|
1559
|
+
order: -1;
|
|
1560
|
+
}
|
|
1561
|
+
`];var _o=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Ho extends CustomEvent{constructor(){super("icon-click")}}class Zo extends xt{constructor(){super(...arguments),this.highlighted=!1,this.removable=!1,this.disabled=!1,this.clickable=!1,this.iconClickable=!1,this.dense=!1,this.multiLine=!1,this.label="",this.icon=void 0,this.trailingIcon=!1}render(){const t={"ft-chip":!0,"ft-chip--highlighted":this.highlighted,"ft-chip--disabled":this.disabled,"ft-chip--clickable":this.interactionsOnChip,"ft-chip--trailing-icon":this.trailingIcon||this.removable,"ft-chip--no-content":!this.hasTextContent(),"ft-chip--dense":this.dense,"ft-chip--multi-line":this.multiLine,"ft-chip--safari-fix":St};return W`
|
|
1562
|
+
<div class="${ti(t)}"
|
|
1563
1563
|
aria-label="${this.getLabel()}"
|
|
1564
1564
|
tabindex="${this.interactionsOnChip?0:-1}"
|
|
1565
1565
|
@keyup=${this.onKeyUp}>
|
|
@@ -1577,8 +1577,124 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1577
1577
|
<ft-ripple ?disabled=${!this.interactionsOnIcon}></ft-ripple>
|
|
1578
1578
|
<ft-icon variant="material">${this.internalIcon}</ft-icon>
|
|
1579
1579
|
</div>
|
|
1580
|
-
`}onKeyUp(t){this.interactionsOnChip&&["Enter"," "].includes(t.key)&&t.target.click()}onIconKeyUp(t){this.interactionsOnIcon&&["Enter"," "].includes(t.key)&&(t.stopPropagation(),this.dispatchEvent(new
|
|
1581
|
-
|
|
1580
|
+
`}onKeyUp(t){this.interactionsOnChip&&["Enter"," "].includes(t.key)&&t.target.click()}onIconKeyUp(t){this.interactionsOnIcon&&["Enter"," "].includes(t.key)&&(t.stopPropagation(),this.dispatchEvent(new Ho))}onIconClick(t){this.interactionsOnIcon&&(t.stopPropagation(),this.dispatchEvent(new Ho))}getLabel(){return this.label||this.textContent}get textContent(){var t,e;return null!==(e=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==e?e:""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}get internalIcon(){return this.icon||(this.removable?"cancel":void 0)}}Zo.elementDefinitions={"ft-ripple":pi,"ft-typography":Je,"ft-icon":Bi},Zo.styles=To,_o([o({type:Boolean})],Zo.prototype,"highlighted",void 0),_o([o({type:Boolean})],Zo.prototype,"removable",void 0),_o([o({type:Boolean})],Zo.prototype,"disabled",void 0),_o([o({type:Boolean})],Zo.prototype,"clickable",void 0),_o([o({type:Boolean})],Zo.prototype,"iconClickable",void 0),_o([o({type:Boolean})],Zo.prototype,"dense",void 0),_o([o({type:Boolean})],Zo.prototype,"multiLine",void 0),_o([o({type:String})],Zo.prototype,"label",void 0),_o([o({type:String})],Zo.prototype,"icon",void 0),_o([o({type:Boolean})],Zo.prototype,"trailingIcon",void 0),_o([r("ft-typography slot")],Zo.prototype,"slottedContent",void 0),h("ft-chip")(Zo);const Ko={fontSize:ut.create("--ft-input-label-font-size","SIZE","14px"),raisedFontSize:ut.create("--ft-input-label-raised-font-size","SIZE","11px"),raisedZIndex:ut.create("--ft-input-label-outlined-raised-z-index","NUMBER","2"),verticalSpacing:ut.create("--ft-input-label-vertical-spacing","SIZE","4px"),horizontalSpacing:ut.create("--ft-input-label-horizontal-spacing","SIZE","12px"),borderColor:ut.extend("--ft-input-label-border-color",vt.colorOutline),textColor:ut.extend("--ft-input-label-text-color",vt.colorOnSurfaceMedium),disabledTextColor:ut.extend("--ft-input-label-disabled-text-color",vt.colorOnSurfaceDisabled),colorSurface:ut.external(vt.colorSurface,"Design system"),borderRadiusS:ut.external(vt.borderRadiusS,"Design system"),colorError:ut.external(vt.colorError,"Design system")},Wo=g`
|
|
1581
|
+
.ft-input-label {
|
|
1582
|
+
position: absolute;
|
|
1583
|
+
inset: 0;
|
|
1584
|
+
display: flex;
|
|
1585
|
+
background-color: ${Ko.colorSurface};
|
|
1586
|
+
border-radius: ${Ko.borderRadiusS} ${Ko.borderRadiusS} 0 0;
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
.ft-input-label--outlined {
|
|
1590
|
+
border-radius: ${Ko.borderRadiusS};
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
.ft-input-label {
|
|
1594
|
+
border-color: ${Ko.borderColor};
|
|
1595
|
+
}
|
|
1596
|
+
|
|
1597
|
+
.ft-input-label.ft-input-label--in-error {
|
|
1598
|
+
border-color: ${Ko.colorError}
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
.ft-input-label:before,
|
|
1602
|
+
.ft-input-label:after {
|
|
1603
|
+
content: "";
|
|
1604
|
+
display: flex;
|
|
1605
|
+
border-bottom-width: 1px;
|
|
1606
|
+
border-bottom-style: solid;
|
|
1607
|
+
border-color: inherit;
|
|
1608
|
+
}
|
|
1609
|
+
|
|
1610
|
+
.ft-input-label:before {
|
|
1611
|
+
width: ${Ko.horizontalSpacing};
|
|
1612
|
+
flex-shrink: 0;
|
|
1613
|
+
}
|
|
1614
|
+
|
|
1615
|
+
.ft-input-label:after {
|
|
1616
|
+
flex-grow: 1;
|
|
1617
|
+
flex-shrink: 1;
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
.ft-input-label--text {
|
|
1621
|
+
display: flex;
|
|
1622
|
+
flex-shrink: 1;
|
|
1623
|
+
position: relative;
|
|
1624
|
+
border-bottom-width: 1px;
|
|
1625
|
+
border-bottom-style: solid;
|
|
1626
|
+
border-color: inherit;
|
|
1627
|
+
color: ${Ko.textColor};
|
|
1628
|
+
transition: font-size 250ms, line-height 250ms, color 250ms;
|
|
1629
|
+
${bt(ke.fontSize,Ko.fontSize)};
|
|
1630
|
+
${bt(ke.lineHeight,Ko.fontSize)};
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1633
|
+
.ft-input-label--in-error .ft-input-label--text {
|
|
1634
|
+
color: ${Ko.colorError}
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
.ft-input-label--disabled .ft-input-label--text {
|
|
1638
|
+
color: ${Ko.disabledTextColor};
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
.ft-input-label--hidden-text {
|
|
1642
|
+
padding: 0 4px;
|
|
1643
|
+
opacity: 0;
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1646
|
+
.ft-input-label--floating-text {
|
|
1647
|
+
position: absolute;
|
|
1648
|
+
top: calc(50% - var(--ft-typography-caption-line-height) / 2);
|
|
1649
|
+
transition: top 250ms;
|
|
1650
|
+
overflow: hidden;
|
|
1651
|
+
white-space: nowrap;
|
|
1652
|
+
text-overflow: ellipsis;
|
|
1653
|
+
padding: ${Ko.verticalSpacing} 4px;
|
|
1654
|
+
margin: calc(${Ko.verticalSpacing} * -1) 0;
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
.ft-input-label--raised .ft-input-label--text {
|
|
1658
|
+
${bt(ke.fontSize,Ko.raisedFontSize)};
|
|
1659
|
+
${bt(ke.lineHeight,Ko.raisedFontSize)};
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
.ft-input-label--raised .ft-input-label--floating-text {
|
|
1663
|
+
top: ${Ko.verticalSpacing};
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1666
|
+
.ft-input-label--outlined .ft-input-label--text,
|
|
1667
|
+
.ft-input-label--outlined:before,
|
|
1668
|
+
.ft-input-label--outlined:after {
|
|
1669
|
+
border-top-width: 1px;
|
|
1670
|
+
border-top-style: solid;
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1673
|
+
.ft-input-label--outlined:before {
|
|
1674
|
+
border-left-width: 1px;
|
|
1675
|
+
border-left-style: solid;
|
|
1676
|
+
border-radius: ${Ko.borderRadiusS} 0 0 ${Ko.borderRadiusS};
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
.ft-input-label--outlined:after {
|
|
1680
|
+
border-right-width: 1px;
|
|
1681
|
+
border-right-style: solid;
|
|
1682
|
+
border-radius: 0 ${Ko.borderRadiusS} ${Ko.borderRadiusS} 0;
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1685
|
+
.ft-input-label--outlined.ft-input-label--raised .ft-input-label--floating-text {
|
|
1686
|
+
padding: 2px 4px;
|
|
1687
|
+
z-index: ${Ko.raisedZIndex};
|
|
1688
|
+
background-color: ${Ko.colorSurface};
|
|
1689
|
+
border-radius: ${Ko.borderRadiusS};
|
|
1690
|
+
top: calc((var(--ft-typography-caption-line-height) / -2) + 2px);
|
|
1691
|
+
}
|
|
1692
|
+
|
|
1693
|
+
.ft-input-label--outlined.ft-input-label--raised .ft-input-label--text {
|
|
1694
|
+
border-top: none;
|
|
1695
|
+
}
|
|
1696
|
+
`;var Vo=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class qo extends xt{constructor(){super(...arguments),this.text="",this.raised=!1,this.outlined=!1,this.disabled=!1,this.error=!1}render(){const t={"ft-input-label":!0,"ft-input-label--raised":this.raised,"ft-input-label--outlined":this.outlined,"ft-input-label--disabled":this.disabled,"ft-input-label--in-error":this.error};return W`
|
|
1697
|
+
<div class="${ti(t)}">
|
|
1582
1698
|
${this.text?W`
|
|
1583
1699
|
<div class="ft-input-label--text ft-typography--caption">
|
|
1584
1700
|
<span class="ft-input-label--floating-text">${this.text}</span>
|
|
@@ -1586,124 +1702,155 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1586
1702
|
</div>
|
|
1587
1703
|
`:null}
|
|
1588
1704
|
</div>
|
|
1589
|
-
`}}
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
display: flex;
|
|
1594
|
-
background-color: ${Mo.colorSurface};
|
|
1595
|
-
border-radius: ${Mo.borderRadiusS} ${Mo.borderRadiusS} 0 0;
|
|
1596
|
-
}
|
|
1705
|
+
`}}qo.elementDefinitions={},qo.styles=[He,Wo],Vo([o({type:String})],qo.prototype,"text",void 0),Vo([o({type:Boolean})],qo.prototype,"raised",void 0),Vo([o({type:Boolean})],qo.prototype,"outlined",void 0),Vo([o({type:Boolean})],qo.prototype,"disabled",void 0),Vo([o({type:Boolean})],qo.prototype,"error",void 0),h("ft-input-label")(qo);const Jo={labelSize:ut.create("--ft-select-label-size","SIZE","11px"),selectedOptionSize:ut.create("--ft-select-selected-option-size","SIZE","14px"),verticalSpacing:ut.create("--ft-select-vertical-spacing","SIZE","4px"),optionsHeight:ut.create("--ft-select-options-height","SIZE","unset"),selectedOptionColor:ut.extend("--ft-select-selected-option-color",vt.colorOnSurface),helperColor:ut.extend("--ft-select-helper-color",vt.colorOnSurfaceMedium),optionsColor:ut.extend("--ft-select-options-color",vt.colorOnSurface),optionsZIndex:ut.create("--ft-select-options-z-index","NUMBER","3"),colorSurface:ut.external(vt.colorSurface,"Design system"),colorOnSurfaceDisabled:ut.external(vt.colorOnSurfaceDisabled,"Design system"),colorPrimary:ut.external(vt.colorPrimary,"Design system"),borderRadiusS:ut.external(vt.borderRadiusS,"Design system"),elevation02:ut.external(vt.elevation02,"Design system"),colorError:ut.external(vt.colorError,"Design system")},Xo=g`
|
|
1706
|
+
*:focus {
|
|
1707
|
+
outline: none;
|
|
1708
|
+
}
|
|
1597
1709
|
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1710
|
+
.ft-select {
|
|
1711
|
+
display: flex;
|
|
1712
|
+
flex-direction: column;
|
|
1713
|
+
align-items: stretch;
|
|
1714
|
+
}
|
|
1601
1715
|
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1716
|
+
.ft-select--main-panel {
|
|
1717
|
+
position: relative;
|
|
1718
|
+
display: flex;
|
|
1719
|
+
height: calc(4 * ${Jo.verticalSpacing} + ${Jo.labelSize} + ${Jo.selectedOptionSize});
|
|
1720
|
+
}
|
|
1605
1721
|
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1722
|
+
.ft-select--input-panel {
|
|
1723
|
+
flex-grow: 1;
|
|
1724
|
+
position: relative;
|
|
1725
|
+
display: flex;
|
|
1726
|
+
align-items: center;
|
|
1727
|
+
overflow: hidden;
|
|
1728
|
+
padding-left: 16px;
|
|
1729
|
+
padding-right: 8px;
|
|
1730
|
+
gap: 8px;
|
|
1731
|
+
color: ${Jo.selectedOptionColor};
|
|
1732
|
+
${bt(ii.color,Jo.selectedOptionColor)};
|
|
1733
|
+
}
|
|
1609
1734
|
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
border-bottom-style: solid;
|
|
1616
|
-
border-color: inherit;
|
|
1617
|
-
}
|
|
1735
|
+
.ft-select--input-panel,
|
|
1736
|
+
.ft-select--option {
|
|
1737
|
+
${bt(ii.opacityContentOnSurfaceHover,"0.08")};
|
|
1738
|
+
${bt(ii.opacityContentOnSurfacePressed,"0.04")};
|
|
1739
|
+
}
|
|
1618
1740
|
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1741
|
+
.ft-select--input-panel > *:not(ft-ripple),
|
|
1742
|
+
.ft-select--option > *:not(ft-ripple) {
|
|
1743
|
+
position: relative;
|
|
1744
|
+
}
|
|
1623
1745
|
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1746
|
+
.ft-select--disabled .ft-select--input-panel,
|
|
1747
|
+
.ft-select--disabled .ft-select--option {
|
|
1748
|
+
color: ${Jo.colorOnSurfaceDisabled};
|
|
1749
|
+
}
|
|
1628
1750
|
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
border-bottom-width: 1px;
|
|
1634
|
-
border-bottom-style: solid;
|
|
1635
|
-
border-color: inherit;
|
|
1636
|
-
color: ${Mo.textColor};
|
|
1637
|
-
transition: font-size 250ms, line-height 250ms, color 250ms;
|
|
1638
|
-
${bt(ke.fontSize,Mo.fontSize)};
|
|
1639
|
-
${bt(ke.lineHeight,Mo.fontSize)};
|
|
1640
|
-
}
|
|
1751
|
+
.ft-select:not(.ft-select--disabled) .ft-select--input-panel,
|
|
1752
|
+
.ft-select:not(.ft-select--disabled) .ft-select--option {
|
|
1753
|
+
cursor: pointer;
|
|
1754
|
+
}
|
|
1641
1755
|
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1756
|
+
ft-input-label {
|
|
1757
|
+
${bt(Ko.fontSize,Jo.selectedOptionSize)};
|
|
1758
|
+
${bt(Ko.raisedFontSize,Jo.labelSize)};
|
|
1759
|
+
${bt(Ko.verticalSpacing,Jo.verticalSpacing)};
|
|
1760
|
+
}
|
|
1645
1761
|
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1762
|
+
.ft-select:not(.ft-select--disabled):focus-within ft-icon {
|
|
1763
|
+
color: ${Jo.colorPrimary};
|
|
1764
|
+
}
|
|
1649
1765
|
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1766
|
+
.ft-select:not(.ft-select--disabled):focus-within ft-input-label {
|
|
1767
|
+
${bt(Ko.borderColor,Jo.colorPrimary)};
|
|
1768
|
+
${bt(Ko.textColor,Jo.colorPrimary)};
|
|
1769
|
+
}
|
|
1654
1770
|
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1771
|
+
.ft-select--selected-option {
|
|
1772
|
+
display: block;
|
|
1773
|
+
flex-grow: 1;
|
|
1774
|
+
flex-shrink: 1;
|
|
1775
|
+
overflow: hidden;
|
|
1776
|
+
white-space: nowrap;
|
|
1777
|
+
text-overflow: ellipsis;
|
|
1778
|
+
${bt($e.fontSize,Jo.selectedOptionSize)};
|
|
1779
|
+
${bt($e.lineHeight,Jo.selectedOptionSize)};
|
|
1780
|
+
}
|
|
1665
1781
|
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
}
|
|
1782
|
+
.ft-select--in-error .ft-select--selected-option {
|
|
1783
|
+
color: ${Jo.colorError};
|
|
1784
|
+
}
|
|
1670
1785
|
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1786
|
+
ft-icon {
|
|
1787
|
+
flex-shrink: 0;
|
|
1788
|
+
}
|
|
1674
1789
|
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
border-top-width: 1px;
|
|
1679
|
-
border-top-style: solid;
|
|
1680
|
-
}
|
|
1790
|
+
slot {
|
|
1791
|
+
display: none;
|
|
1792
|
+
}
|
|
1681
1793
|
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
border-radius: ${Mo.borderRadiusS} 0 0 ${Mo.borderRadiusS};
|
|
1686
|
-
}
|
|
1794
|
+
.ft-select--filled .ft-select--input-panel {
|
|
1795
|
+
border-radius: ${Jo.borderRadiusS} ${Jo.borderRadiusS} 0 0;
|
|
1796
|
+
}
|
|
1687
1797
|
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
}
|
|
1798
|
+
.ft-select--filled:not(.ft-select--no-label) .ft-select--selected-option {
|
|
1799
|
+
align-self: stretch;
|
|
1800
|
+
padding-top: calc(${Jo.labelSize} + 2 * ${Jo.verticalSpacing});
|
|
1801
|
+
}
|
|
1693
1802
|
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
background-color: ${Mo.colorSurface};
|
|
1698
|
-
border-radius: ${Mo.borderRadiusS};
|
|
1699
|
-
top: calc((var(--ft-typography-caption-line-height) / -2) + 2px);
|
|
1700
|
-
}
|
|
1803
|
+
.ft-select--outlined .ft-select--input-panel {
|
|
1804
|
+
border-radius: ${Jo.borderRadiusS};
|
|
1805
|
+
}
|
|
1701
1806
|
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1807
|
+
.ft-select--options {
|
|
1808
|
+
display: none;
|
|
1809
|
+
position: absolute;
|
|
1810
|
+
top: 100%;
|
|
1811
|
+
left: 0;
|
|
1812
|
+
right: 0;
|
|
1813
|
+
color: ${Jo.optionsColor};
|
|
1814
|
+
background: ${Jo.colorSurface};
|
|
1815
|
+
z-index: ${Jo.optionsZIndex};
|
|
1816
|
+
box-shadow: ${Jo.elevation02};
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
.ft-select--fixed .ft-select--options {
|
|
1820
|
+
position: fixed;
|
|
1821
|
+
right: unset;
|
|
1822
|
+
/* left and top are set dynamically */
|
|
1823
|
+
}
|
|
1824
|
+
|
|
1825
|
+
.ft-select--options-displayed .ft-select--options {
|
|
1826
|
+
display: block;
|
|
1827
|
+
max-height: ${Jo.optionsHeight};
|
|
1828
|
+
overflow-y: auto;
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
.ft-select--option {
|
|
1832
|
+
position: relative;
|
|
1833
|
+
padding: 4px 16px;
|
|
1834
|
+
min-height: 32px;
|
|
1835
|
+
display: flex;
|
|
1836
|
+
align-items: center;
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1839
|
+
.ft-select--option span {
|
|
1840
|
+
text-overflow: ellipsis;
|
|
1841
|
+
overflow: hidden;
|
|
1842
|
+
}
|
|
1843
|
+
|
|
1844
|
+
.ft-select--helper-text {
|
|
1845
|
+
padding: 0 12px 0 16px;
|
|
1846
|
+
color: ${Jo.helperColor};
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
.ft-select--in-error .ft-select--helper-text {
|
|
1850
|
+
color: ${Jo.colorError};
|
|
1851
|
+
}
|
|
1852
|
+
`;var Yo=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Qo extends xt{constructor(){super(...arguments),this.label="",this.value=null,this.selected=!1}render(){return W``}updated(t){super.updated(t),this.dispatchEvent(new CustomEvent("option-change",{detail:this,bubbles:!0}))}}Qo.elementDefinitions={},Yo([o({type:String})],Qo.prototype,"label",void 0),Yo([o({type:Object,converter:t=>t})],Qo.prototype,"value",void 0),Yo([o({type:Boolean,reflect:!0})],Qo.prototype,"selected",void 0);class Go extends xt{constructor(){super(...arguments),this.label="",this.helper="",this.outlined=!1,this.disabled=!1,this.error=!1,this.fixedMenuPosition=!1,this.options=[],this.optionsDisplayed=!1,this.focusOptions=!1,this.hideOptions=t=>this.optionsDisplayed=this.optionsDisplayed&&t.composedPath().includes(this.container)}render(){var t,e,i,o,s;let n=this.hasOptionsMenuOpen,r=this.disabled||!this.hasOptions;const l=null!=(null===(t=this.selectedOption)||void 0===t?void 0:t.value)||(null!==(i=null===(e=this.selectedOption)||void 0===e?void 0:e.label)&&void 0!==i?i:"").length>0,a={"ft-select":!0,"ft-select--filled":!this.outlined,"ft-select--outlined":this.outlined,"ft-select--disabled":r,"ft-select--options-displayed":n,"ft-select--has-option-selected":l,"ft-select--no-label":!this.label,"ft-select--fixed":this.fixedMenuPosition,"ft-select--in-error":this.error};return W`
|
|
1853
|
+
<div class="${ti(a)}" part="container">
|
|
1707
1854
|
<div class="ft-select--main-panel" part="main-panel">
|
|
1708
1855
|
<ft-input-label text="${this.label}"
|
|
1709
1856
|
part="label"
|
|
@@ -1741,7 +1888,7 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1741
1888
|
@option-change=${this.updateOptionsFromSlot}
|
|
1742
1889
|
></slot>
|
|
1743
1890
|
`}renderOption(t){let e=this.selectedOption===t;return W`
|
|
1744
|
-
<div class="${
|
|
1891
|
+
<div class="${ti({"ft-select--option":!0,"ft-select--option-selected":e,"ft-typography--body2":!0})}"
|
|
1745
1892
|
part="option"
|
|
1746
1893
|
tabindex="0"
|
|
1747
1894
|
data-value="${t.value}"
|
|
@@ -1750,182 +1897,34 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1750
1897
|
<ft-ripple ?primary=${e} ?activated=${e}></ft-ripple>
|
|
1751
1898
|
<span>${t.label}</span>
|
|
1752
1899
|
</div>
|
|
1753
|
-
`}updated(t){var e;super.updated(t),t.has("options")&&(this.selectedOption=this.options.filter((t=>t.selected))[0]),t.has("selectedOption")&&(this.optionsDisplayed=!1,this.dispatchEvent(new CustomEvent("change",{detail:null===(e=this.selectedOption)||void 0===e?void 0:e.value}))),t.has("optionsDisplayed")&&this.fixedMenuPosition&&this.hasOptionsMenuOpen&&this.positionOptionsMenu()}positionOptionsMenu(){this.optionsMenu.style.top=this.mainPanel.getBoundingClientRect().top+this.mainPanel.getBoundingClientRect().height+"px",this.optionsMenu.style.left=this.mainPanel.getBoundingClientRect().left+"px",this.optionsMenu.style.width=this.mainPanel.getBoundingClientRect().width+"px"}contentAvailableCallback(t){var e,i;t.has("focusOptions")&&this.focusOptions&&(null===(i=null!==(e=this.selectedOptionElement)&&void 0!==e?e:this.firstOption)||void 0===i||i.focus(),this.focusOptions=!1)}get hasOptionsMenuOpen(){return!this.disabled&&this.optionsDisplayed&&this.hasOptions}get hasOptions(){return this.options.length>0}updateOptionsFromSlot(t){var e;t.stopPropagation();let i=null===(e=this.optionsSlot)||void 0===e?void 0:e.assignedElements().map((t=>t));i&&i.length>0&&(this.options=i)}onMainPanelKeyDown(t){switch(t.key){case" ":t.preventDefault(),t.stopPropagation();case"Enter":this.optionsDisplayed=!this.optionsDisplayed,this.focusOptions=!0;break;case"ArrowUp":case"ArrowDown":t.preventDefault(),t.stopPropagation(),this.optionsDisplayed=!0,this.focusOptions=!0}}onOptionsKeyDown(t){var e,i,o,s,n;let r;switch(t.key){case"Escape":this.optionsDisplayed=!1,null===(e=this.mainPanel)||void 0===e||e.focus();break;case"Tab":this.optionsDisplayed=!1;break;case"ArrowUp":t.preventDefault(),t.stopPropagation(),r=null!==(o=null===(i=this.focusedOption)||void 0===i?void 0:i.previousElementSibling)&&void 0!==o?o:this.lastOption;break;case"ArrowDown":t.preventDefault(),t.stopPropagation(),r=null!==(n=null===(s=this.focusedOption)||void 0===s?void 0:s.nextElementSibling)&&void 0!==n?n:this.firstOption}null==r||r.focus()}onOptionKeyDown(t,e){var i;"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),this.selectOption(e),this.optionsDisplayed=!1,null===(i=this.mainPanel)||void 0===i||i.focus())}selectOption(t){this.selectedOption=t;for(let e of this.options)e.selected=e===t}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.hideOptions)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.hideOptions)}}
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
align-items: center;
|
|
1775
|
-
overflow: hidden;
|
|
1776
|
-
padding-left: 16px;
|
|
1777
|
-
padding-right: 8px;
|
|
1778
|
-
gap: 8px;
|
|
1779
|
-
color: ${Lo.selectedOptionColor};
|
|
1780
|
-
${bt(ei.color,Lo.selectedOptionColor)};
|
|
1781
|
-
}
|
|
1782
|
-
|
|
1783
|
-
.ft-select--input-panel,
|
|
1784
|
-
.ft-select--option {
|
|
1785
|
-
${bt(ei.opacityContentOnSurfaceHover,"0.08")};
|
|
1786
|
-
${bt(ei.opacityContentOnSurfacePressed,"0.04")};
|
|
1787
|
-
}
|
|
1788
|
-
|
|
1789
|
-
.ft-select--input-panel > *:not(ft-ripple),
|
|
1790
|
-
.ft-select--option > *:not(ft-ripple) {
|
|
1791
|
-
position: relative;
|
|
1792
|
-
}
|
|
1793
|
-
|
|
1794
|
-
.ft-select--disabled .ft-select--input-panel,
|
|
1795
|
-
.ft-select--disabled .ft-select--option {
|
|
1796
|
-
color: ${Lo.colorOnSurfaceDisabled};
|
|
1797
|
-
}
|
|
1798
|
-
|
|
1799
|
-
.ft-select:not(.ft-select--disabled) .ft-select--input-panel,
|
|
1800
|
-
.ft-select:not(.ft-select--disabled) .ft-select--option {
|
|
1801
|
-
cursor: pointer;
|
|
1802
|
-
}
|
|
1803
|
-
|
|
1804
|
-
ft-input-label {
|
|
1805
|
-
${bt(Mo.fontSize,Lo.selectedOptionSize)};
|
|
1806
|
-
${bt(Mo.raisedFontSize,Lo.labelSize)};
|
|
1807
|
-
${bt(Mo.verticalSpacing,Lo.verticalSpacing)};
|
|
1808
|
-
}
|
|
1809
|
-
|
|
1810
|
-
.ft-select:not(.ft-select--disabled):focus-within ft-icon {
|
|
1811
|
-
color: ${Lo.colorPrimary};
|
|
1812
|
-
}
|
|
1813
|
-
|
|
1814
|
-
.ft-select:not(.ft-select--disabled):focus-within ft-input-label {
|
|
1815
|
-
${bt(Mo.borderColor,Lo.colorPrimary)};
|
|
1816
|
-
${bt(Mo.textColor,Lo.colorPrimary)};
|
|
1817
|
-
}
|
|
1818
|
-
|
|
1819
|
-
.ft-select--selected-option {
|
|
1820
|
-
display: block;
|
|
1821
|
-
flex-grow: 1;
|
|
1822
|
-
flex-shrink: 1;
|
|
1823
|
-
overflow: hidden;
|
|
1824
|
-
white-space: nowrap;
|
|
1825
|
-
text-overflow: ellipsis;
|
|
1826
|
-
${bt($e.fontSize,Lo.selectedOptionSize)};
|
|
1827
|
-
${bt($e.lineHeight,Lo.selectedOptionSize)};
|
|
1828
|
-
}
|
|
1829
|
-
|
|
1830
|
-
.ft-select--in-error .ft-select--selected-option {
|
|
1831
|
-
color: ${Lo.colorError};
|
|
1832
|
-
}
|
|
1833
|
-
|
|
1834
|
-
ft-icon {
|
|
1835
|
-
flex-shrink: 0;
|
|
1836
|
-
}
|
|
1837
|
-
|
|
1838
|
-
slot {
|
|
1839
|
-
display: none;
|
|
1840
|
-
}
|
|
1841
|
-
|
|
1842
|
-
.ft-select--filled .ft-select--input-panel {
|
|
1843
|
-
border-radius: ${Lo.borderRadiusS} ${Lo.borderRadiusS} 0 0;
|
|
1844
|
-
}
|
|
1845
|
-
|
|
1846
|
-
.ft-select--filled:not(.ft-select--no-label) .ft-select--selected-option {
|
|
1847
|
-
align-self: stretch;
|
|
1848
|
-
padding-top: calc(${Lo.labelSize} + 2 * ${Lo.verticalSpacing});
|
|
1849
|
-
}
|
|
1850
|
-
|
|
1851
|
-
.ft-select--outlined .ft-select--input-panel {
|
|
1852
|
-
border-radius: ${Lo.borderRadiusS};
|
|
1853
|
-
}
|
|
1854
|
-
|
|
1855
|
-
.ft-select--options {
|
|
1856
|
-
display: none;
|
|
1857
|
-
position: absolute;
|
|
1858
|
-
top: 100%;
|
|
1859
|
-
left: 0;
|
|
1860
|
-
right: 0;
|
|
1861
|
-
color: ${Lo.optionsColor};
|
|
1862
|
-
background: ${Lo.colorSurface};
|
|
1863
|
-
z-index: ${Lo.optionsZIndex};
|
|
1864
|
-
box-shadow: ${Lo.elevation02};
|
|
1865
|
-
}
|
|
1866
|
-
|
|
1867
|
-
.ft-select--fixed .ft-select--options {
|
|
1868
|
-
position: fixed;
|
|
1869
|
-
right: unset;
|
|
1870
|
-
/* left and top are set dynamically */
|
|
1871
|
-
}
|
|
1872
|
-
|
|
1873
|
-
.ft-select--options-displayed .ft-select--options {
|
|
1874
|
-
display: block;
|
|
1875
|
-
max-height: ${Lo.optionsHeight};
|
|
1876
|
-
overflow-y: auto;
|
|
1877
|
-
}
|
|
1878
|
-
|
|
1879
|
-
.ft-select--option {
|
|
1880
|
-
position: relative;
|
|
1881
|
-
padding: 4px 16px;
|
|
1882
|
-
min-height: 32px;
|
|
1883
|
-
display: flex;
|
|
1884
|
-
align-items: center;
|
|
1885
|
-
}
|
|
1886
|
-
|
|
1887
|
-
.ft-select--option span {
|
|
1888
|
-
text-overflow: ellipsis;
|
|
1889
|
-
overflow: hidden;
|
|
1890
|
-
}
|
|
1891
|
-
|
|
1892
|
-
.ft-select--helper-text {
|
|
1893
|
-
padding: 0 12px 0 16px;
|
|
1894
|
-
color: ${Lo.helperColor};
|
|
1895
|
-
}
|
|
1900
|
+
`}updated(t){var e;super.updated(t),t.has("options")&&(this.selectedOption=this.options.filter((t=>t.selected))[0]),t.has("selectedOption")&&(this.optionsDisplayed=!1,this.dispatchEvent(new CustomEvent("change",{detail:null===(e=this.selectedOption)||void 0===e?void 0:e.value}))),t.has("optionsDisplayed")&&this.fixedMenuPosition&&this.hasOptionsMenuOpen&&this.positionOptionsMenu()}positionOptionsMenu(){this.optionsMenu.style.top=this.mainPanel.getBoundingClientRect().top+this.mainPanel.getBoundingClientRect().height+"px",this.optionsMenu.style.left=this.mainPanel.getBoundingClientRect().left+"px",this.optionsMenu.style.width=this.mainPanel.getBoundingClientRect().width+"px"}contentAvailableCallback(t){var e,i;t.has("focusOptions")&&this.focusOptions&&(null===(i=null!==(e=this.selectedOptionElement)&&void 0!==e?e:this.firstOption)||void 0===i||i.focus(),this.focusOptions=!1)}get hasOptionsMenuOpen(){return!this.disabled&&this.optionsDisplayed&&this.hasOptions}get hasOptions(){return this.options.length>0}updateOptionsFromSlot(t){var e;t.stopPropagation();let i=null===(e=this.optionsSlot)||void 0===e?void 0:e.assignedElements().map((t=>t));i&&i.length>0&&(this.options=i)}onMainPanelKeyDown(t){switch(t.key){case" ":t.preventDefault(),t.stopPropagation();case"Enter":this.optionsDisplayed=!this.optionsDisplayed,this.focusOptions=!0;break;case"ArrowUp":case"ArrowDown":t.preventDefault(),t.stopPropagation(),this.optionsDisplayed=!0,this.focusOptions=!0}}onOptionsKeyDown(t){var e,i,o,s,n;let r;switch(t.key){case"Escape":this.optionsDisplayed=!1,null===(e=this.mainPanel)||void 0===e||e.focus();break;case"Tab":this.optionsDisplayed=!1;break;case"ArrowUp":t.preventDefault(),t.stopPropagation(),r=null!==(o=null===(i=this.focusedOption)||void 0===i?void 0:i.previousElementSibling)&&void 0!==o?o:this.lastOption;break;case"ArrowDown":t.preventDefault(),t.stopPropagation(),r=null!==(n=null===(s=this.focusedOption)||void 0===s?void 0:s.nextElementSibling)&&void 0!==n?n:this.firstOption}null==r||r.focus()}onOptionKeyDown(t,e){var i;"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),this.selectOption(e),this.optionsDisplayed=!1,null===(i=this.mainPanel)||void 0===i||i.focus())}selectOption(t){this.selectedOption=t;for(let e of this.options)e.selected=e===t}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.hideOptions)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.hideOptions)}}Go.elementDefinitions={"ft-input-label":qo,"ft-typography":Je,"ft-ripple":pi,"ft-icon":Bi},Go.styles=[_e,He,Xo],Yo([o({type:String})],Go.prototype,"label",void 0),Yo([o({type:String})],Go.prototype,"helper",void 0),Yo([o({type:Boolean})],Go.prototype,"outlined",void 0),Yo([o({type:Boolean})],Go.prototype,"disabled",void 0),Yo([o({type:Boolean})],Go.prototype,"error",void 0),Yo([o({type:Boolean})],Go.prototype,"fixedMenuPosition",void 0),Yo([o({type:Array})],Go.prototype,"options",void 0),Yo([s()],Go.prototype,"selectedOption",void 0),Yo([s()],Go.prototype,"optionsDisplayed",void 0),Yo([s()],Go.prototype,"focusOptions",void 0),Yo([r(".ft-select")],Go.prototype,"container",void 0),Yo([r(".ft-select--options")],Go.prototype,"optionsMenu",void 0),Yo([r(".ft-select--input-panel")],Go.prototype,"mainPanel",void 0),Yo([r(".ft-select--option:first-child")],Go.prototype,"firstOption",void 0),Yo([r(".ft-select--option:focus")],Go.prototype,"focusedOption",void 0),Yo([r(".ft-select--option.ft-select--option-selected")],Go.prototype,"selectedOptionElement",void 0),Yo([r(".ft-select--option:last-child")],Go.prototype,"lastOption",void 0),Yo([r("slot")],Go.prototype,"optionsSlot",void 0),h("ft-select")(Go),h("ft-select-option")(Qo);const ts={display:ut.create("--ft-skeleton--display","DISPLAY","block"),width:ut.create("--ft-skeleton--width","SIZE","100%"),height:ut.create("--ft-skeleton--height","SIZE","20px"),backgroundColor:ut.create("--ft-skeleton--background-color","COLOR","#f1f1f1"),glareWidth:ut.create("--ft-skeleton--glare-width","SIZE","200px"),glareColor:ut.create("--ft-skeleton--glare-color","COLOR","rgba(255, 255, 255, .6)"),animationDuration:ut.create("--ft-skeleton--animation-duration","UNKNOWN","2s"),borderRadiusM:ut.external(vt.borderRadiusM,"Design system")},es=g`
|
|
1901
|
+
:host {
|
|
1902
|
+
width: ${ts.width};
|
|
1903
|
+
height: ${ts.height};
|
|
1904
|
+
display: ${ts.display};
|
|
1905
|
+
overflow: hidden;
|
|
1906
|
+
border-radius: ${ts.borderRadiusM};
|
|
1907
|
+
background: linear-gradient(
|
|
1908
|
+
90deg,
|
|
1909
|
+
transparent,
|
|
1910
|
+
${ts.glareColor} calc(0.45 * ${ts.glareWidth}),
|
|
1911
|
+
${ts.glareColor} calc(0.55 * ${ts.glareWidth}),
|
|
1912
|
+
transparent ${ts.glareWidth}
|
|
1913
|
+
), ${ts.backgroundColor};
|
|
1914
|
+
background-repeat: repeat-y;
|
|
1915
|
+
background-size: 100vw 100vh;
|
|
1916
|
+
background-attachment: fixed;
|
|
1917
|
+
background-position: calc(${ts.glareWidth} * -1) 0;
|
|
1918
|
+
animation: shine ${ts.animationDuration} infinite;
|
|
1919
|
+
animation-timing-function: linear;
|
|
1920
|
+
}
|
|
1896
1921
|
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
}
|
|
1900
|
-
`],Fo([o({type:String})],Do.prototype,"label",void 0),Fo([o({type:String})],Do.prototype,"helper",void 0),Fo([o({type:Boolean})],Do.prototype,"outlined",void 0),Fo([o({type:Boolean})],Do.prototype,"disabled",void 0),Fo([o({type:Boolean})],Do.prototype,"error",void 0),Fo([o({type:Boolean})],Do.prototype,"fixedMenuPosition",void 0),Fo([o({type:Array})],Do.prototype,"options",void 0),Fo([s()],Do.prototype,"selectedOption",void 0),Fo([s()],Do.prototype,"optionsDisplayed",void 0),Fo([s()],Do.prototype,"focusOptions",void 0),Fo([r(".ft-select")],Do.prototype,"container",void 0),Fo([r(".ft-select--options")],Do.prototype,"optionsMenu",void 0),Fo([r(".ft-select--input-panel")],Do.prototype,"mainPanel",void 0),Fo([r(".ft-select--option:first-child")],Do.prototype,"firstOption",void 0),Fo([r(".ft-select--option:focus")],Do.prototype,"focusedOption",void 0),Fo([r(".ft-select--option.ft-select--option-selected")],Do.prototype,"selectedOptionElement",void 0),Fo([r(".ft-select--option:last-child")],Do.prototype,"lastOption",void 0),Fo([r("slot")],Do.prototype,"optionsSlot",void 0),h("ft-select")(Do),h("ft-select-option")(Ro);const Io={display:ut.create("--ft-skeleton--display","DISPLAY","block"),width:ut.create("--ft-skeleton--width","SIZE","100%"),height:ut.create("--ft-skeleton--height","SIZE","20px"),backgroundColor:ut.create("--ft-skeleton--background-color","COLOR","#f1f1f1"),glareWidth:ut.create("--ft-skeleton--glare-width","SIZE","200px"),glareColor:ut.create("--ft-skeleton--glare-color","COLOR","rgba(255, 255, 255, .6)"),animationDuration:ut.create("--ft-skeleton--animation-duration","UNKNOWN","2s"),borderRadiusM:ut.external(vt.borderRadiusM,"Design system")};class jo extends xt{render(){return W`
|
|
1901
|
-
`}}jo.elementDefinitions={},jo.styles=g`
|
|
1902
|
-
:host {
|
|
1903
|
-
width: ${Io.width};
|
|
1904
|
-
height: ${Io.height};
|
|
1905
|
-
display: ${Io.display};
|
|
1906
|
-
overflow: hidden;
|
|
1907
|
-
border-radius: ${Io.borderRadiusM};
|
|
1908
|
-
background: linear-gradient(
|
|
1909
|
-
90deg,
|
|
1910
|
-
transparent,
|
|
1911
|
-
${Io.glareColor} calc(0.45 * ${Io.glareWidth}),
|
|
1912
|
-
${Io.glareColor} calc(0.55 * ${Io.glareWidth}),
|
|
1913
|
-
transparent ${Io.glareWidth}
|
|
1914
|
-
), ${Io.backgroundColor};
|
|
1915
|
-
background-repeat: repeat-y;
|
|
1916
|
-
background-size: 100vw 100vh;
|
|
1917
|
-
background-attachment: fixed;
|
|
1918
|
-
background-position: calc(${Io.glareWidth} * -1) 0;
|
|
1919
|
-
animation: shine ${Io.animationDuration} infinite;
|
|
1920
|
-
animation-timing-function: linear;
|
|
1921
|
-
}
|
|
1922
|
-
|
|
1923
|
-
@keyframes shine {
|
|
1924
|
-
to {
|
|
1925
|
-
background-position: calc(100vw + ${Io.glareWidth}) 0, calc(${Io.glareWidth} * -1) 0;
|
|
1926
|
-
}
|
|
1922
|
+
@keyframes shine {
|
|
1923
|
+
to {
|
|
1924
|
+
background-position: calc(100vw + ${ts.glareWidth}) 0, calc(${ts.glareWidth} * -1) 0;
|
|
1927
1925
|
}
|
|
1928
|
-
|
|
1926
|
+
}
|
|
1927
|
+
`,is={height:ut.create("--ft-search-bar-height","SIZE","38px"),borderRadius:ut.extend("--ft-search-bar-border-radius",vt.borderRadiusS),mobileOpenPosition:ut.create("--ft-search-bar-mobile-open-position","POSITION","fixed"),mobileOpenTop:ut.create("--ft-search-bar-mobile-open-top","SIZE","0"),mobileOpenBottom:ut.create("--ft-search-bar-mobile-open-bottom","SIZE","0"),mobileOpenLeft:ut.create("--ft-search-bar-mobile-open-left","SIZE","0"),mobileOpenRight:ut.create("--ft-search-bar-mobile-open-right","SIZE","0"),desktopFiltersHeight:ut.create("--ft-search-bar-desktop-filters-height","SIZE","350px"),floatingZIndex:ut.create("--ft-search-bar-floating-components-z-index","NUMBER","3"),colorSurface:ut.external(vt.colorSurface,"Design system"),colorOnSurface:ut.external(vt.colorOnSurface,"Design system"),colorOnSurfaceMedium:ut.external(vt.colorOnSurfaceMedium,"Design system"),colorOutline:ut.external(vt.colorOutline,"Design system"),colorPrimary:ut.external(vt.colorPrimary,"Design system"),elevation02:ut.external(vt.elevation02,"Design system"),buttonColor:ut.external(Ni.color,"Button"),buttonRippleColor:ut.external(Ni.rippleColor,"Button")},os=g`
|
|
1929
1928
|
* {
|
|
1930
1929
|
box-sizing: border-box;
|
|
1931
1930
|
}
|
|
@@ -1934,7 +1933,7 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1934
1933
|
display: flex;
|
|
1935
1934
|
flex-direction: column;
|
|
1936
1935
|
gap: 8px;
|
|
1937
|
-
color: ${
|
|
1936
|
+
color: ${is.colorOnSurface};
|
|
1938
1937
|
outline: none;
|
|
1939
1938
|
}
|
|
1940
1939
|
|
|
@@ -1943,21 +1942,21 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1943
1942
|
}
|
|
1944
1943
|
|
|
1945
1944
|
.ft-search-bar--mobile-menu-open {
|
|
1946
|
-
position: ${
|
|
1947
|
-
top: ${
|
|
1948
|
-
bottom: ${
|
|
1949
|
-
left: ${
|
|
1950
|
-
right: ${
|
|
1951
|
-
z-index: ${
|
|
1945
|
+
position: ${is.mobileOpenPosition};
|
|
1946
|
+
top: ${is.mobileOpenTop};
|
|
1947
|
+
bottom: ${is.mobileOpenBottom};
|
|
1948
|
+
left: ${is.mobileOpenLeft};
|
|
1949
|
+
right: ${is.mobileOpenRight};
|
|
1950
|
+
z-index: ${is.floatingZIndex};
|
|
1952
1951
|
padding: 16px;
|
|
1953
1952
|
}
|
|
1954
1953
|
|
|
1955
1954
|
.ft-search-bar--mobile-menu-open:not(.ft-search-bar--forced-open) {
|
|
1956
|
-
background: ${
|
|
1955
|
+
background: ${is.colorSurface};
|
|
1957
1956
|
}
|
|
1958
1957
|
|
|
1959
1958
|
.ft-search-bar--mobile-menu-open.ft-search-bar--forced-open {
|
|
1960
|
-
position: ${
|
|
1959
|
+
position: ${is.mobileOpenPosition.get("static")};
|
|
1961
1960
|
}
|
|
1962
1961
|
|
|
1963
1962
|
.ft-search-bar {
|
|
@@ -1965,20 +1964,20 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1965
1964
|
display: flex;
|
|
1966
1965
|
flex-direction: row;
|
|
1967
1966
|
align-items: center;
|
|
1968
|
-
height: ${
|
|
1967
|
+
height: ${is.height};
|
|
1969
1968
|
|
|
1970
|
-
background: ${
|
|
1971
|
-
border: 1px solid ${
|
|
1972
|
-
border-radius: ${
|
|
1969
|
+
background: ${is.colorSurface};
|
|
1970
|
+
border: 1px solid ${is.colorOutline};
|
|
1971
|
+
border-radius: ${is.borderRadius};
|
|
1973
1972
|
}
|
|
1974
1973
|
|
|
1975
1974
|
.ft-search-bar--skeleton {
|
|
1976
|
-
${bt(
|
|
1977
|
-
${bt(
|
|
1975
|
+
${bt(ts.height,is.height)};
|
|
1976
|
+
${bt(ts.borderRadiusM,is.borderRadius)};
|
|
1978
1977
|
}
|
|
1979
1978
|
|
|
1980
1979
|
.ft-search-bar--floating-panel-open .ft-search-bar {
|
|
1981
|
-
border-radius: ${
|
|
1980
|
+
border-radius: ${is.borderRadius} ${is.borderRadius} 0 0;
|
|
1982
1981
|
}
|
|
1983
1982
|
|
|
1984
1983
|
.ft-search-bar--input-container {
|
|
@@ -1996,7 +1995,7 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
1996
1995
|
align-self: stretch;
|
|
1997
1996
|
display: grid;
|
|
1998
1997
|
padding: 0 8px;
|
|
1999
|
-
border-radius: ${
|
|
1998
|
+
border-radius: ${is.borderRadius};
|
|
2000
1999
|
}
|
|
2001
2000
|
|
|
2002
2001
|
.ft-search-bar--dense .ft-search-bar--input-outline {
|
|
@@ -2005,7 +2004,7 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2005
2004
|
}
|
|
2006
2005
|
|
|
2007
2006
|
.ft-search-bar--input-container:focus-within .ft-search-bar--input-outline {
|
|
2008
|
-
outline: 2px solid ${
|
|
2007
|
+
outline: 2px solid ${is.colorPrimary};
|
|
2009
2008
|
}
|
|
2010
2009
|
|
|
2011
2010
|
.ft-search-bar--input {
|
|
@@ -2013,12 +2012,12 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2013
2012
|
flex-grow: 1;
|
|
2014
2013
|
border: none;
|
|
2015
2014
|
background-color: transparent;
|
|
2016
|
-
color: ${
|
|
2015
|
+
color: ${is.colorOnSurface};
|
|
2017
2016
|
outline: none;
|
|
2018
2017
|
}
|
|
2019
2018
|
|
|
2020
2019
|
.ft-search-bar--input::placeholder {
|
|
2021
|
-
color: ${
|
|
2020
|
+
color: ${is.colorOnSurfaceMedium};
|
|
2022
2021
|
}
|
|
2023
2022
|
|
|
2024
2023
|
.ft-search-bar--actions {
|
|
@@ -2028,7 +2027,7 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2028
2027
|
align-items: center;
|
|
2029
2028
|
height: 100%;
|
|
2030
2029
|
|
|
2031
|
-
${bt(
|
|
2030
|
+
${bt(di.zIndex,`calc(${is.floatingZIndex} + 1)`)};
|
|
2032
2031
|
}
|
|
2033
2032
|
|
|
2034
2033
|
.ft-search-bar > ft-button,
|
|
@@ -2037,8 +2036,8 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2037
2036
|
}
|
|
2038
2037
|
|
|
2039
2038
|
.ft-search-bar--left-action {
|
|
2040
|
-
${bt(
|
|
2041
|
-
border-right: 1px solid ${
|
|
2039
|
+
${bt(Ni.borderRadius,g`calc(${is.borderRadius} - 1px) 0 0 calc(${is.borderRadius} - 1px)`)};
|
|
2040
|
+
border-right: 1px solid ${is.colorOutline};
|
|
2042
2041
|
height: 100%;
|
|
2043
2042
|
}
|
|
2044
2043
|
|
|
@@ -2047,7 +2046,7 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2047
2046
|
}
|
|
2048
2047
|
|
|
2049
2048
|
.ft-search-bar--floating-panel-open .ft-search-bar--left-action {
|
|
2050
|
-
${bt(
|
|
2049
|
+
${bt(Ni.borderRadius,g`calc(${is.borderRadius} - 1px) 0 0 0`)};
|
|
2051
2050
|
}
|
|
2052
2051
|
|
|
2053
2052
|
.ft-search-bar .ft-search-bar--launch-search,
|
|
@@ -2057,13 +2056,13 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2057
2056
|
|
|
2058
2057
|
.ft-search-bar--separator {
|
|
2059
2058
|
height: 20px;
|
|
2060
|
-
border-right: 1px solid ${
|
|
2059
|
+
border-right: 1px solid ${is.colorOutline};
|
|
2061
2060
|
}
|
|
2062
2061
|
|
|
2063
2062
|
.ft-search-bar--left-action.ft-search-bar--content-locale {
|
|
2064
|
-
${bt(
|
|
2065
|
-
${bt(
|
|
2066
|
-
${bt(
|
|
2063
|
+
${bt(Ko.borderColor,"transparent")};
|
|
2064
|
+
${bt(Ko.borderRadiusS,g`calc(${is.borderRadius} - 1px)`)};
|
|
2065
|
+
${bt(Jo.selectedOptionColor,is.buttonColor)};
|
|
2067
2066
|
}
|
|
2068
2067
|
|
|
2069
2068
|
.ft-search-bar--left-action.ft-search-bar--content-locale,
|
|
@@ -2080,17 +2079,17 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2080
2079
|
}
|
|
2081
2080
|
|
|
2082
2081
|
.ft-search-bar--left-action.ft-search-bar--content-locale::part(selected-value) {
|
|
2083
|
-
border-radius: calc(${
|
|
2082
|
+
border-radius: calc(${is.borderRadius} - 1px) 0 0 calc(${is.borderRadius} - 1px);
|
|
2084
2083
|
}
|
|
2085
2084
|
|
|
2086
|
-
`,
|
|
2085
|
+
`,ss=g`
|
|
2087
2086
|
.ft-search-bar--desktop-menu .ft-search-bar--presets {
|
|
2088
2087
|
margin-right: auto;
|
|
2089
2088
|
}
|
|
2090
2089
|
|
|
2091
2090
|
.ft-search-bar--desktop-menu .ft-search-bar--presets {
|
|
2092
2091
|
min-width: 250px;
|
|
2093
|
-
${bt(
|
|
2092
|
+
${bt(Jo.optionsZIndex,"2")};
|
|
2094
2093
|
}
|
|
2095
2094
|
|
|
2096
2095
|
.ft-search-bar--desktop-menu {
|
|
@@ -2142,7 +2141,7 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2142
2141
|
|
|
2143
2142
|
.ft-search-bar--desktop-menu .ft-search-bar--filters-container {
|
|
2144
2143
|
display: block;
|
|
2145
|
-
height: ${
|
|
2144
|
+
height: ${is.desktopFiltersHeight};
|
|
2146
2145
|
--ft-snap-scroll-gap: 16px;
|
|
2147
2146
|
}
|
|
2148
2147
|
|
|
@@ -2193,7 +2192,7 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2193
2192
|
|
|
2194
2193
|
.ft-search-bar--filter-label > :last-child {
|
|
2195
2194
|
flex-shrink: 1;
|
|
2196
|
-
color: ${
|
|
2195
|
+
color: ${is.colorOnSurfaceMedium};
|
|
2197
2196
|
}
|
|
2198
2197
|
|
|
2199
2198
|
ft-accordion-item::part(toggle) {
|
|
@@ -2213,7 +2212,8 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2213
2212
|
.ft-search-bar--desktop-menu .ft-search-bar--launch-search {
|
|
2214
2213
|
margin: 0;
|
|
2215
2214
|
}
|
|
2216
|
-
`;class
|
|
2215
|
+
`;class ns extends xt{render(){return W`
|
|
2216
|
+
`}}ns.elementDefinitions={},ns.styles=es,h("ft-skeleton")(ns);class rs{constructor(t,i=300){this.searchBar=t,this.updateDebouncer=new e(i)}render(){const t=this.searchBar.recentSearches.filter((t=>t.toLowerCase().includes(this.searchBar.query.toLowerCase()))),e=this.searchBar.suggestions.length>0||t.length>0;return W`
|
|
2217
2217
|
<div class="ft-search-bar--suggestions ${e?"ft-search-bar--suggestions-not-empty":""}"
|
|
2218
2218
|
part="suggestions-container"
|
|
2219
2219
|
@keydown=${t=>this.onSuggestKeyDown(t)}>
|
|
@@ -2247,11 +2247,11 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2247
2247
|
</a>
|
|
2248
2248
|
`))}
|
|
2249
2249
|
</div>
|
|
2250
|
-
`}update(){return new Promise(((t,e)=>{this.updateDebouncer.run((async()=>{this.searchBar.suggestions=this.searchBar.api&&this.searchBar.query.length>2?await this.searchBar.api.getSuggestions(this.searchBar.suggestRequest).then((t=>t.suggestions)).catch((()=>[])):[],t()}))}))}onSuggestKeyDown(t){var e,i,o,s,n,r;switch(t.key){case"ArrowUp":null===(o=null!==(i=null===(e=this.getFocusedSuggestionElement())||void 0===e?void 0:e.previousElementSibling)&&void 0!==i?i:this.getLastSuggestionElement())||void 0===o||o.focus(),t.preventDefault(),t.stopPropagation();break;case"ArrowDown":null===(r=null!==(n=null===(s=this.getFocusedSuggestionElement())||void 0===s?void 0:s.nextElementSibling)&&void 0!==n?n:this.getFirstSuggestionElement())||void 0===r||r.focus(),t.preventDefault(),t.stopPropagation()}}onSuggestKeyUp(t,e){"Enter"!==t.key&&" "!==t.key||this.onSuggestSelected(t,e)}onSuggestClick(t,e){t.ctrlKey||t.metaKey||this.onSuggestSelected(t,e)}onSuggestSelected(t,e){t.preventDefault(),this.searchBar.setQuery(e),this.searchBar.launchSearch()}removeRecentSearch(t,e){var i,o;t.preventDefault(),t.stopPropagation();let s=t.target.closest(".ft-search-bar--suggestion");const n=null!==(o=null!==(i=null==s?void 0:s.previousElementSibling)&&void 0!==i?i:null==s?void 0:s.nextElementSibling)&&void 0!==o?o:this.searchBar.input;null==n||n.focus(),this.searchBar.recentSearches=this.searchBar.recentSearches.filter((t=>t.toLowerCase()!==e.toLowerCase())),this.searchBar.saveRecentSearches()}getIcon(t){const e="DOCUMENT"===t.type?
|
|
2250
|
+
`}update(){return new Promise(((t,e)=>{this.updateDebouncer.run((async()=>{this.searchBar.suggestions=this.searchBar.api&&this.searchBar.query.length>2?await this.searchBar.api.getSuggestions(this.searchBar.suggestRequest).then((t=>t.suggestions)).catch((()=>[])):[],t()}))}))}onSuggestKeyDown(t){var e,i,o,s,n,r;switch(t.key){case"ArrowUp":null===(o=null!==(i=null===(e=this.getFocusedSuggestionElement())||void 0===e?void 0:e.previousElementSibling)&&void 0!==i?i:this.getLastSuggestionElement())||void 0===o||o.focus(),t.preventDefault(),t.stopPropagation();break;case"ArrowDown":null===(r=null!==(n=null===(s=this.getFocusedSuggestionElement())||void 0===s?void 0:s.nextElementSibling)&&void 0!==n?n:this.getFirstSuggestionElement())||void 0===r||r.focus(),t.preventDefault(),t.stopPropagation()}}onSuggestKeyUp(t,e){"Enter"!==t.key&&" "!==t.key||this.onSuggestSelected(t,e)}onSuggestClick(t,e){t.ctrlKey||t.metaKey||this.onSuggestSelected(t,e)}onSuggestSelected(t,e){t.preventDefault(),this.searchBar.setQuery(e),this.searchBar.launchSearch()}removeRecentSearch(t,e){var i,o;t.preventDefault(),t.stopPropagation();let s=t.target.closest(".ft-search-bar--suggestion");const n=null!==(o=null!==(i=null==s?void 0:s.previousElementSibling)&&void 0!==i?i:null==s?void 0:s.nextElementSibling)&&void 0!==o?o:this.searchBar.input;null==n||n.focus(),this.searchBar.recentSearches=this.searchBar.recentSearches.filter((t=>t.toLowerCase()!==e.toLowerCase())),this.searchBar.saveRecentSearches()}getIcon(t){const e="DOCUMENT"===t.type?Ei.file_format:Ei.fluid_topics;let i;switch(t.type){case"MAP":i="BOOK"===t.editorialType?$i.BOOK:$i.ARTICLE;break;case"DOCUMENT":i=function(t,e){var i,o,s,n;t=(null!=t?t:"").toLowerCase(),e=(null!=e?e:"").toLowerCase();const[r,l]=((null!==(i=Si.get(t))&&void 0!==i?i:t)+"/").split("/");return null!==(n=null!==(s=null!==(o=ki.get(l))&&void 0!==o?o:ki.get(e))&&void 0!==s?s:ki.get(r))&&void 0!==n?n:wi.UNKNOWN}(t.mimeType,t.filenameExtension);break;case"TOPIC":i=$i.TOPICS}return W`
|
|
2251
2251
|
<ft-icon variant="${e}" part="suggestion-icon">
|
|
2252
2252
|
${i}
|
|
2253
2253
|
</ft-icon>
|
|
2254
|
-
`}getFocusedSuggestionElement(){return this.searchBar.querySelector(".ft-search-bar--suggestion:focus-within")}getLastSuggestionElement(){let t=this.searchBar.querySelectorAll(".ft-search-bar--suggestion");return t.length>0?t[t.length-1]:null}getFirstSuggestionElement(){return this.searchBar.querySelector(".ft-search-bar--suggestion")}focusFirstSuggestion(){var t;null===(t=this.getFirstSuggestionElement())||void 0===t||t.focus()}}
|
|
2254
|
+
`}getFocusedSuggestionElement(){return this.searchBar.querySelector(".ft-search-bar--suggestion:focus-within")}getLastSuggestionElement(){let t=this.searchBar.querySelectorAll(".ft-search-bar--suggestion");return t.length>0?t[t.length-1]:null}getFirstSuggestionElement(){return this.searchBar.querySelector(".ft-search-bar--suggestion")}focusFirstSuggestion(){var t;null===(t=this.getFirstSuggestionElement())||void 0===t||t.focus()}}rs.styles=g`
|
|
2255
2255
|
.ft-search-bar--mobile .ft-search-bar--suggestions {
|
|
2256
2256
|
flex-grow: 1;
|
|
2257
2257
|
flex-shrink: 1;
|
|
@@ -2260,7 +2260,7 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2260
2260
|
}
|
|
2261
2261
|
|
|
2262
2262
|
.ft-search-bar--mobile-menu-open .ft-search-bar--suggestions {
|
|
2263
|
-
border-top: 1px solid ${
|
|
2263
|
+
border-top: 1px solid ${is.colorOutline};
|
|
2264
2264
|
}
|
|
2265
2265
|
|
|
2266
2266
|
.ft-search-bar--mobile-menu-open .ft-search-bar--suggestions {
|
|
@@ -2270,15 +2270,15 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2270
2270
|
.ft-search-bar--floating-panel,
|
|
2271
2271
|
.ft-search-bar--desktop .ft-search-bar--suggestions {
|
|
2272
2272
|
position: absolute;
|
|
2273
|
-
z-index: ${
|
|
2273
|
+
z-index: ${is.floatingZIndex};
|
|
2274
2274
|
top: 100%;
|
|
2275
2275
|
left: -1px;
|
|
2276
2276
|
right: -1px;
|
|
2277
2277
|
display: none;
|
|
2278
|
-
background: ${
|
|
2279
|
-
border: 1px solid ${
|
|
2280
|
-
border-radius: 0 0 ${
|
|
2281
|
-
box-shadow: ${
|
|
2278
|
+
background: ${is.colorSurface};
|
|
2279
|
+
border: 1px solid ${is.colorOutline};
|
|
2280
|
+
border-radius: 0 0 ${is.borderRadius} ${is.borderRadius};
|
|
2281
|
+
box-shadow: ${is.elevation02};
|
|
2282
2282
|
outline: none;
|
|
2283
2283
|
}
|
|
2284
2284
|
|
|
@@ -2298,7 +2298,7 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2298
2298
|
padding: 8px;
|
|
2299
2299
|
gap: 8px;
|
|
2300
2300
|
cursor: pointer;
|
|
2301
|
-
color: ${
|
|
2301
|
+
color: ${is.colorOnSurface};
|
|
2302
2302
|
min-height: 52px;
|
|
2303
2303
|
}
|
|
2304
2304
|
|
|
@@ -2315,7 +2315,7 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2315
2315
|
}
|
|
2316
2316
|
|
|
2317
2317
|
.ft-search-bar--recent-search + .ft-search-bar--suggestion:not(.ft-search-bar--recent-search) {
|
|
2318
|
-
border-top: 1px solid ${
|
|
2318
|
+
border-top: 1px solid ${is.colorOutline};
|
|
2319
2319
|
}
|
|
2320
2320
|
|
|
2321
2321
|
.ft-search-bar--suggestion ft-typography {
|
|
@@ -2323,7 +2323,7 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2323
2323
|
flex-grow: 1;
|
|
2324
2324
|
flex-shrink: 1;
|
|
2325
2325
|
}
|
|
2326
|
-
`;class
|
|
2326
|
+
`;class ls{constructor(t){this.searchBar=t}render(){if(!this.searchBar.hasLocaleSelector()&&!this.searchBar.hasFacets())return W``;const t=this.searchBar.isMobile(),e=!t&&this.searchBar.dense||t&&this.searchBar.isMobileMenuOpen(),i=W`
|
|
2327
2327
|
${this.searchBar.hasLocaleSelector()&&(this.searchBar.hasFacets()||t)?W`
|
|
2328
2328
|
<ft-chip part="selected-filters selected-filter-ft-locale"
|
|
2329
2329
|
?dense=${this.searchBar.dense&&!t}
|
|
@@ -2334,7 +2334,7 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2334
2334
|
${this.getLocaleLabel(this.searchBar.contentLocale)}
|
|
2335
2335
|
</ft-chip>
|
|
2336
2336
|
`:null}
|
|
2337
|
-
${It(this.searchBar.facets,(t=>t.key),(i=>{const o=function(t){return
|
|
2337
|
+
${It(this.searchBar.facets,(t=>t.key),(i=>{const o=function(t){return Xe(t.rootNodes,(t=>t.selected?[]:t.childNodes)).filter((t=>t.selected)).map((t=>t.value))}(i);return It(o,(s=>{let n=i.label+": "+function(t){return Ye(t).split("|").join(" > ")}(s);const r=i.key.replace(":","-"),l=W`
|
|
2338
2338
|
<ft-chip
|
|
2339
2339
|
part="selected-filters selected-filter-${r}"
|
|
2340
2340
|
?dense=${this.searchBar.dense&&!t}
|
|
@@ -2347,7 +2347,7 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2347
2347
|
@icon-click=${()=>this.searchBar.setFilter(i.key,o.filter((t=>t!==s)))}
|
|
2348
2348
|
data-key="${i.key}"
|
|
2349
2349
|
data-value="${s}">
|
|
2350
|
-
${function(t){return
|
|
2350
|
+
${function(t){return Ye(t).split("|").pop()}(s)}
|
|
2351
2351
|
</ft-chip>
|
|
2352
2352
|
`;return e?l:W`
|
|
2353
2353
|
<ft-tooltip inline text="${n}">
|
|
@@ -2373,7 +2373,7 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2373
2373
|
<div class="ft-search-bar--selected-filters" part="selected-filters-container">
|
|
2374
2374
|
${i}
|
|
2375
2375
|
</div>
|
|
2376
|
-
`}openMobileFilters(t){this.searchBar.isMobile()&&(this.searchBar.mobileMenuOpen=!0,this.searchBar.displayFacets=!0,this.searchBar.scrollToFacet=t)}getLocaleLabel(t){var e;return null!==(e=this.searchBar.availableContentLocales.filter((e=>{var i;return(null!==(i=e.lang)&&void 0!==i?i:"").toLowerCase()===(null!=t?t:"").toLowerCase()})).map((t=>t.label)).pop())&&void 0!==e?e:t}}
|
|
2376
|
+
`}openMobileFilters(t){this.searchBar.isMobile()&&(this.searchBar.mobileMenuOpen=!0,this.searchBar.displayFacets=!0,this.searchBar.scrollToFacet=t)}getLocaleLabel(t){var e;return null!==(e=this.searchBar.availableContentLocales.filter((e=>{var i;return(null!==(i=e.lang)&&void 0!==i?i:"").toLowerCase()===(null!=t?t:"").toLowerCase()})).map((t=>t.label)).pop())&&void 0!==e?e:t}}ls.styles=g`
|
|
2377
2377
|
.ft-search-bar--selected-filters:not(ft-snap-scroll) {
|
|
2378
2378
|
flex-shrink: 0;
|
|
2379
2379
|
display: flex;
|
|
@@ -2384,7 +2384,7 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2384
2384
|
|
|
2385
2385
|
ft-snap-scroll.ft-search-bar--selected-filters {
|
|
2386
2386
|
overflow: hidden;
|
|
2387
|
-
${bt(
|
|
2387
|
+
${bt(lo.gap,"4px")};
|
|
2388
2388
|
}
|
|
2389
2389
|
|
|
2390
2390
|
ft-snap-scroll.ft-search-bar--selected-filters::part(content) {
|
|
@@ -2392,8 +2392,8 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2392
2392
|
}
|
|
2393
2393
|
|
|
2394
2394
|
.ft-search-bar--desktop ft-snap-scroll.ft-search-bar--selected-filters {
|
|
2395
|
-
${bt(
|
|
2396
|
-
${bt(
|
|
2395
|
+
${bt(Io.iconSize,"17px")};
|
|
2396
|
+
${bt(Io.fontSize,"12px")};
|
|
2397
2397
|
}
|
|
2398
2398
|
|
|
2399
2399
|
.ft-search-bar--selected-filters * {
|
|
@@ -2403,8 +2403,8 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2403
2403
|
.ft-search-bar--selected-filters ft-chip {
|
|
2404
2404
|
flex-grow: 0;
|
|
2405
2405
|
}
|
|
2406
|
-
`;class
|
|
2407
|
-
<div class="${
|
|
2406
|
+
`;class as{constructor(t,e,i){this.searchBar=t,this.selectedFacetsManager=null!=e?e:new ls(t),this.suggestManager=null!=i?i:new rs(t)}render(){const t={"ft-search-bar--container":!0,"ft-search-bar--mobile":!0,"ft-search-bar--mobile-menu-open":this.searchBar.isMobileMenuOpen(),"ft-search-bar--forced-open":this.searchBar.forceMobileMenuOpen};return W`
|
|
2407
|
+
<div class="${ti(t)}" part="container" tabindex="-1">
|
|
2408
2408
|
<div class="ft-search-bar">
|
|
2409
2409
|
<div class="ft-search-bar--input-container" part="input-container">
|
|
2410
2410
|
<div class="ft-search-bar--input-outline" part="input-outline">
|
|
@@ -2452,10 +2452,10 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2452
2452
|
@click=${()=>{var t;return this.searchBar.isMobileMenuOpen()?this.searchBar.launchSearch():null===(t=this.searchBar.input)||void 0===t?void 0:t.focus()}}
|
|
2453
2453
|
></ft-button>
|
|
2454
2454
|
</div>
|
|
2455
|
-
`}onSearchBarKeyUp(t){const e=t.composedPath()[0];this.searchBar.query=e.value,"Enter"===t.key&&this.searchBar.launchSearch()}}
|
|
2455
|
+
`}onSearchBarKeyUp(t){const e=t.composedPath()[0];this.searchBar.query=e.value,"Enter"===t.key&&this.searchBar.launchSearch()}}as.styles=g`
|
|
2456
2456
|
|
|
2457
|
-
`;class
|
|
2458
|
-
<div class="${
|
|
2457
|
+
`;class cs{constructor(t,e,i){this.searchBar=t,this.selectedFacetsManager=null!=e?e:new ls(t),this.suggestManager=null!=i?i:new rs(t)}render(){const t={"ft-search-bar--container":!0,"ft-search-bar--dense":this.searchBar.dense,"ft-search-bar--desktop":!0,"ft-search-bar--floating-panel-open":this.searchBar.displayFacets&&!this.searchBar.forceMenuOpen,"ft-search-bar--forced-open":this.searchBar.forceMenuOpen};return W`
|
|
2458
|
+
<div class="${ti(t)}" part="container" tabindex="-1">
|
|
2459
2459
|
<div class="ft-search-bar" part="search-bar">
|
|
2460
2460
|
${this.renderSearchBarLeftAction()}
|
|
2461
2461
|
<div class="ft-search-bar--input-container" part="input-container" tabindex="-1">
|
|
@@ -2519,9 +2519,9 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2519
2519
|
@click=${()=>this.searchBar.launchSearch()}
|
|
2520
2520
|
></ft-button>
|
|
2521
2521
|
</div>
|
|
2522
|
-
`}onSearchBarKeyDown(t){var e;switch(t.key){case"Escape":this.searchBar.mobileMenuOpen=!1,null===(e=this.searchBar.input)||void 0===e||e.blur();break;case"ArrowDown":t.stopPropagation(),t.preventDefault(),this.suggestManager.focusFirstSuggestion()}}onSearchBarKeyUp(t){const e=t.composedPath()[0];this.searchBar.query=e.value,"Enter"===t.key&&this.searchBar.launchSearch()}}
|
|
2522
|
+
`}onSearchBarKeyDown(t){var e;switch(t.key){case"Escape":this.searchBar.mobileMenuOpen=!1,null===(e=this.searchBar.input)||void 0===e||e.blur();break;case"ArrowDown":t.stopPropagation(),t.preventDefault(),this.suggestManager.focusFirstSuggestion()}}onSearchBarKeyUp(t){const e=t.composedPath()[0];this.searchBar.query=e.value,"Enter"===t.key&&this.searchBar.launchSearch()}}cs.styles=g`
|
|
2523
2523
|
|
|
2524
|
-
`;var
|
|
2524
|
+
`;var hs=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};null==window.fluidtopics&&console.warn("Fluid Topics public API was not found. You can find it here: https://www.npmjs.com/package/@fluid-topics/public-api");const ps={filtersButton:"Filters",inputPlaceHolder:"Search",filterInputPlaceHolder:"Filter {0}",clearInputButton:"Clear",clearFilterButton:"Clear",displayMoreFilterValuesButton:"More",noFilterValuesAvailable:"No values available",searchButton:"Search",clearFilters:"Clear filters",contentLocaleSelector:"Lang",presetsSelector:"Preset",removeRecentSearch:"Remove",back:"Back"};class ds extends CustomEvent{constructor(t){super("launch-search",{detail:t,bubbles:!0,composed:!0})}}class fs extends CustomEvent{constructor(t){super("change",{detail:t})}}const us=()=>{};class bs extends xt{constructor(){super(...arguments),this.dense=!1,this.mode="auto",this.forceMobileMenuOpen=!1,this.forceMenuOpen=!1,this.baseUrl="",this.apiIntegrationIdentifier="ft-search-bar",this.availableContentLocales=[],this.availableContentLocalesInitialized=!1,this.labels={},this.labelResolver=new mt(ps,{}),this.displayedFilters=[],this.presets=[],this.priors=[],this.searchRequestSerializer=t=>function(t,e){var i;const o=new URLSearchParams({"content-lang":null!==(i=e.contentLocale)&&void 0!==i?i:"all",query:e.query});if(e.filters.length>0){const t=e.filters.map((t=>{const e=t.values.map((t=>t.replace(/_/g,"\\\\\\\\_").replace(/~/g,"\\\\~").replace(/\*/g,"\\*"))).map((t=>encodeURIComponent(function(t){return`"${t}"`}(t)))).join("_");return`${t.key}~${e}`})).join("*");o.append("filters",t)}return new URL(`${t}/search/all?${o.toString()}`).href}(this.baseUrl,t),this.searchFilters=[],this.sizeCategory=jt.M,this.displayFacets=!1,this.mobileMenuOpen=!1,this.facets=[],this.facetsInitialized=!1,this.knownFacetLabels=new Map,this.query="",this.suggestions=[],this.recentSearches=[],this.updateFacetsDebouncer=new e(500),this.suggestManager=new rs(this),this.selectedFacetsManager=new ls(this),this.desktopSearchBarManager=new cs(this),this.mobileSearchBarManager=new as(this),this.initDataDebouncer=new e(10),this.facetsLoaded=!1,this.closeFloatingContainer=t=>{this.isMobile()||(this.displayFacets=this.displayFacets&&t.composedPath().some((t=>t===this.floatingContainer)))},this.compareFilters=(t,e)=>t.key===e.key&&t.negative==e.negative&&t.values.length===e.values.length&&t.values.every((t=>e.values.includes(t))),this.compareRequests=(t,e)=>(null==t.contentLocale||null==e.contentLocale||t.contentLocale===e.contentLocale)&&t.filters.length===e.filters.length&&t.filters.every((t=>e.filters.some((e=>this.compareFilters(t,e)))))}isMobileMenuOpen(){return this.isMobile()&&(this.forceMobileMenuOpen||this.forceMenuOpen||this.mobileMenuOpen)}get request(){return{uiLocale:this.uiLocale,contentLocale:this.contentLocale,query:this.query,facets:this.facetsRequest,priors:this.hasPriors?this.priors:void 0,filters:this.searchFilters,paging:{perPage:0,page:1},sort:[]}}get facetsRequest(){const t=this.searchFilters.filter((t=>t.values.length>0&&!this.displayedFilters.includes(t.key))).map((t=>({id:t.key})));return[...this.displayedFilters.map((t=>({id:t}))),...t]}get suggestRequest(){return{contentLocale:this.contentLocale,input:this.query,filters:this.searchFilters,sort:[]}}isMobile(){switch(this.mode){case"mobile":return!0;case"desktop":return!1;default:return this.sizeCategory===jt.S}}hasFacets(){return this.facetsRequest.length>0}get hasPresets(){return null!=this.presets&&this.presets.length>0}get hasPriors(){return null!=this.priors&&this.priors.length>0}hasLocaleSelector(){return this.availableContentLocales.length>1}focus(){var t;null===(t=this.container)||void 0===t||t.focus()}focusInput(){this.input?this.input.focus():setTimeout((()=>this.focusInput()),50)}clear(){this.query="",this.searchFilters=[],this.input&&(this.input.value=""),this.mobileMenuOpen=!1,this.displayFacets=!1}render(){return W`
|
|
2525
2525
|
<ft-size-watcher @change=${this.updateSize}></ft-size-watcher>
|
|
2526
2526
|
${this.renderSearchBar()}
|
|
2527
2527
|
`}renderSearchBar(){return this.facetsInitialized&&this.availableContentLocalesInitialized?this.isMobile()?this.mobileSearchBarManager.render():this.desktopSearchBarManager.render():W`
|
|
@@ -2549,12 +2549,12 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2549
2549
|
></ft-filter>
|
|
2550
2550
|
</ft-accordion-item>
|
|
2551
2551
|
`:null}
|
|
2552
|
-
${It(this.facets,(t=>t.key),(t=>{const e=
|
|
2552
|
+
${It(this.facets,(t=>t.key),(t=>{const e=Ge(t),i=t.key.replace(":","-");return t.rootNodes.length>0?W`
|
|
2553
2553
|
<ft-accordion-item data-facet-key="${t.key}">
|
|
2554
2554
|
<div class="ft-search-bar--filter-label" slot="toggle">
|
|
2555
2555
|
<ft-typography variant="button">${t.label}</ft-typography>
|
|
2556
2556
|
<ft-typography variant="body2">
|
|
2557
|
-
${function(t){return
|
|
2557
|
+
${function(t){return Xe(t.options,(t=>{var e;return null!==(e=t.subOptions)&&void 0!==e?e:[]})).filter((t=>t.selected)).map((t=>t.label))}(e).join(", ")}
|
|
2558
2558
|
</ft-typography>
|
|
2559
2559
|
</div>
|
|
2560
2560
|
<ft-filter
|
|
@@ -2630,7 +2630,7 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2630
2630
|
@change=${t=>this.contentLocale=t.detail[0]}
|
|
2631
2631
|
></ft-filter>
|
|
2632
2632
|
`:q}
|
|
2633
|
-
${It(this.facets,(t=>t.key),(t=>{const e=
|
|
2633
|
+
${It(this.facets,(t=>t.key),(t=>{const e=Ge(t),i=e.options.some((t=>{var e,i;return(null!==(i=null===(e=t.subOptions)||void 0===e?void 0:e.length)&&void 0!==i?i:0)>0})),o=t.key.replace(":","-");return W`
|
|
2634
2634
|
<ft-filter
|
|
2635
2635
|
class="${i?"ft-search-bar--hierarchical-filter":""}"
|
|
2636
2636
|
part="filters filter filter-${o}"
|
|
@@ -2649,10 +2649,10 @@ class ui extends zt{constructor(t){if(super(t),this.it=q,t.type!==Ct)throw Error
|
|
|
2649
2649
|
></ft-filter>
|
|
2650
2650
|
`}))}
|
|
2651
2651
|
</ft-snap-scroll>
|
|
2652
|
-
`:q}async firstUpdated(t){super.firstUpdated(t),this.initApi(),window.addEventListener("storage",(t=>{t.key===this.recentSearchesStorageKey&&this.initRecentSearches()}))}update(t){var e,i,o,s,n;if(t.has("labels")&&(this.labelResolver=new mt(
|
|
2652
|
+
`:q}async firstUpdated(t){super.firstUpdated(t),this.initApi(),window.addEventListener("storage",(t=>{t.key===this.recentSearchesStorageKey&&this.initRecentSearches()}))}update(t){var e,i,o,s,n;if(t.has("labels")&&(this.labelResolver=new mt(ps,this.labels)),t.has("sizeCategory")&&(this.mobileMenuOpen=!1,this.displayFacets=this.displayFacets&&!this.isMobile()),super.update(t),(t.has("availableContentLocales")||t.has("contentLocale"))&&this.availableContentLocales.length>0){const i=t=>this.availableContentLocales.some((e=>e.lang===t));i(this.contentLocale)||(this.contentLocale=t.has("contentLocale")&&i(t.get("contentLocale"))?t.get("contentLocale"):null===(e=this.availableContentLocales[0])||void 0===e?void 0:e.lang)}if(t.has("baseUrl")&&this.baseUrl&&(this.baseUrl.endsWith("/")&&(this.baseUrl=this.baseUrl.replace(/\/$/,"")),this.initRecentSearches()),t.has("presets")&&(null!==(i=this.presets)&&void 0!==i?i:[]).forEach((t=>t.filters.forEach((t=>t.values=t.values.map((t=>Ye(t))))))),t.has("selectedPreset")){const t=(null!==(o=this.presets)&&void 0!==o?o:[]).find((t=>t.name===this.selectedPreset));t&&!this.compareRequests(this.request,t)&&this.setFiltersFromPreset(t)}t.has("contentLocale")&&null!=this.contentLocale&&(this.knownFacetLabels=new Map),["contentLocale","searchFilters"].some((e=>t.has(e)))&&(this.selectedPreset=null===(n=(null!==(s=this.presets)&&void 0!==s?s:[]).find((t=>this.compareRequests(t,this.request))))||void 0===n?void 0:n.name),["baseUrl","apiIntegrationIdentifier"].some((e=>t.has(e)))&&(this.api=void 0,this.initApi()),t.has("api")&&this.api&&this.initSearchData(),["uiLocale","contentLocale","searchFilters","displayedFilters"].some((e=>t.has(e)))&&this.updateFacets(),["query","uiLocale","contentLocale","searchFilters","displayedFilters","api"].some((e=>t.has(e)))&&this.suggestManager.update(),["query","uiLocale","contentLocale","searchFilters"].some((e=>t.has(e)))&&this.dispatchEvent(new fs(this.request))}initSearchData(){this.availableContentLocalesInitialized=!1,this.facetsInitialized=!1,this.initDataDebouncer.run((()=>{var t;null===(t=this.api)||void 0===t||t.getAvailableSearchLocales().then((t=>t.contentLocales)).catch((()=>[])).then((t=>{this.availableContentLocales=t,this.availableContentLocalesInitialized=!0})),this.retrieveFacetsFromSearch().then((()=>this.facetsInitialized=!0))}))}contentAvailableCallback(t){var e,i,o;if(super.contentAvailableCallback(t),t.has("displayFacets")&&this.displayFacets&&(null===(e=this.floatingContainer)||void 0===e||e.focus()),null!=this.scrollToFacet&&this.facetsLoaded){null===(i=this.scrollingFiltersContainer)||void 0===i||i.scrollIndexIntoView(this.facets.findIndex((t=>t.key===this.scrollToFacet)));const t=null===(o=this.shadowRoot)||void 0===o?void 0:o.querySelector(`ft-accordion-item[data-facet-key="${this.scrollToFacet}"]`);t&&(t.active=!0),this.scrollToFacet=void 0}}initApi(){null==this.api&&(this.api=window.fluidtopics?new window.fluidtopics.FluidTopicsApi(this.baseUrl,this.apiIntegrationIdentifier,!0):void 0,setTimeout((()=>this.initApi()),10))}updateFacets(){this.api&&this.facetsInitialized&&(this.facetsRequest.length>0?(this.facetsLoaded=!1,this.updateFacetsDebouncer.run((async()=>{await this.retrieveFacetsFromSearch(),this.facetsLoaded=!0}))):this.facets=[])}async retrieveFacetsFromSearch(){var t;const e=new Map;await(null===(t=this.api)||void 0===t?void 0:t.search({...this.request,query:""}).then((t=>t.facets.forEach((t=>{this.knownFacetLabels.set(t.key,t.label),e.set(t.key,t)})))).catch(us)),this.facets=[];for(let t of this.facetsRequest)e.has(t.id)?this.facets.push(e.get(t.id)):this.knownFacetLabels.has(t.id)&&this.facets.push({key:t.id,label:this.knownFacetLabels.get(t.id),rootNodes:[],multiSelectionable:!0,hierarchical:!1})}onFloatingContainerKeyUp(t){var e;"Escape"===t.key&&(this.displayFacets=!1,null===(e=this.filtersOpener)||void 0===e||e.focus())}setQuery(t){this.input&&(this.input.value=t),this.query=t}launchSearch(){if(this.query){let t=this.recentSearches.filter((t=>t.toLowerCase()!==this.query.toLowerCase())).filter(((t,e)=>e<20));this.recentSearches=[this.query,...t],this.saveRecentSearches()}this.dispatchEvent(new ds(this.request)),this.mobileMenuOpen=!1,this.displayFacets=!1,this.focus()}get recentSearchesStorageKey(){return this.baseUrl+":ft:recent-search-queries"}initRecentSearches(){var t;this.recentSearches=JSON.parse(null!==(t=window.localStorage.getItem(this.recentSearchesStorageKey))&&void 0!==t?t:"[]")}saveRecentSearches(){const t=JSON.stringify(this.recentSearches);window.localStorage.setItem(this.recentSearchesStorageKey,t),window.dispatchEvent(new StorageEvent("storage",{key:this.recentSearchesStorageKey,newValue:t,storageArea:window.localStorage,url:window.location.href}))}connectedCallback(){super.connectedCallback(),document.addEventListener("focusin",this.closeFloatingContainer),document.addEventListener("click",this.closeFloatingContainer)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("focusin",this.closeFloatingContainer),document.addEventListener("click",this.closeFloatingContainer)}updateSize(t){this.sizeCategory=t.detail.category}setFilter(t,e){let i=this.searchFilters.filter((e=>e.key!==t));this.facets.forEach((i=>{i.key===t&&Xe(i.rootNodes,(t=>t.childNodes)).forEach((t=>t.selected=e.includes(t.value)))})),e.length&&i.push({key:t,negative:!1,values:e}),this.searchFilters=i,this.scrollToFacet=t}setFiltersFromPreset(t){null!=t&&(null!=t.contentLocale&&(this.contentLocale=t.contentLocale),this.searchFilters=t.filters)}clearFilters(){this.facets.forEach((t=>Xe(t.rootNodes,(t=>t.childNodes)).forEach((t=>t.selected=!1)))),this.searchFilters=[];const t=this.facets[0];this.scrollToFacet=null==t?void 0:t.key}querySelector(t){return this.shadowRoot.querySelector(t)}querySelectorAll(t){return this.shadowRoot.querySelectorAll(t)}renderDesktopFloatingMenu(){return this.forceMenuOpen?q:W`
|
|
2653
2653
|
<div class="ft-search-bar--floating-panel"
|
|
2654
2654
|
@keyup=${this.onFloatingContainerKeyUp}
|
|
2655
2655
|
part="floating-panel"
|
|
2656
2656
|
tabindex="-1">
|
|
2657
2657
|
${this.renderDesktopMenu()}
|
|
2658
|
-
</div>`}}
|
|
2658
|
+
</div>`}}bs.elementDefinitions={"ft-accordion":zo,"ft-accordion-item":Lo,"ft-button":ji,"ft-chip":Zo,"ft-filter":ko,"ft-filter-option":Oo,"ft-icon":Bi,"ft-ripple":pi,"ft-select":Go,"ft-select-option":Qo,"ft-size-watcher":Tt,"ft-skeleton":ns,"ft-snap-scroll":po,"ft-tooltip":bi,"ft-typography":Je},bs.styles=[_e,os,ss,ls.styles,rs.styles],hs([o({type:Boolean})],bs.prototype,"dense",void 0),hs([o()],bs.prototype,"mode",void 0),hs([o({type:Boolean})],bs.prototype,"forceMobileMenuOpen",void 0),hs([o({type:Boolean})],bs.prototype,"forceMenuOpen",void 0),hs([o()],bs.prototype,"baseUrl",void 0),hs([o()],bs.prototype,"apiIntegrationIdentifier",void 0),hs([o()],bs.prototype,"contentLocale",void 0),hs([s()],bs.prototype,"availableContentLocales",void 0),hs([s()],bs.prototype,"availableContentLocalesInitialized",void 0),hs([o()],bs.prototype,"uiLocale",void 0),hs([p({})],bs.prototype,"labels",void 0),hs([p([])],bs.prototype,"displayedFilters",void 0),hs([p([])],bs.prototype,"presets",void 0),hs([o({type:String,reflect:!0})],bs.prototype,"selectedPreset",void 0),hs([p([])],bs.prototype,"priors",void 0),hs([o()],bs.prototype,"searchRequestSerializer",void 0),hs([s()],bs.prototype,"searchFilters",void 0),hs([s()],bs.prototype,"sizeCategory",void 0),hs([s()],bs.prototype,"displayFacets",void 0),hs([s()],bs.prototype,"mobileMenuOpen",void 0),hs([s()],bs.prototype,"facets",void 0),hs([s()],bs.prototype,"facetsInitialized",void 0),hs([r(".ft-search-bar--container")],bs.prototype,"container",void 0),hs([r(".ft-search-bar--filters-opener")],bs.prototype,"filtersOpener",void 0),hs([r(".ft-search-bar--floating-panel")],bs.prototype,"floatingContainer",void 0),hs([r("ft-snap-scroll.ft-search-bar--filters-container")],bs.prototype,"scrollingFiltersContainer",void 0),hs([r(".ft-search-bar--input")],bs.prototype,"input",void 0),hs([s()],bs.prototype,"query",void 0),hs([s()],bs.prototype,"suggestions",void 0),hs([s()],bs.prototype,"recentSearches",void 0),hs([s()],bs.prototype,"scrollToFacet",void 0),hs([s()],bs.prototype,"api",void 0),h("ft-search-bar")(bs),t.DEFAULT_LABELS=ps,t.FtSearchBar=bs,t.FtSearchBarCssVariables=is,t.LaunchSearchEvent=ds,t.SearchStateChangeEvent=fs,t.facetsCss=ss,t.searchBarCss=os,Object.defineProperty(t,"i",{value:!0})}({});
|