@fluid-topics/ft-search-selected-facets 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -0
- package/build/ft-search-selected-facets.css.d.ts +4 -0
- package/build/ft-search-selected-facets.css.js +13 -0
- package/build/ft-search-selected-facets.d.ts +16 -0
- package/build/ft-search-selected-facets.js +75 -0
- package/build/ft-search-selected-facets.light.js +742 -0
- package/build/ft-search-selected-facets.min.js +869 -0
- package/build/ft-search-selected-facets.properties.d.ts +2 -0
- package/build/ft-search-selected-facets.properties.js +1 -0
- package/build/index.d.ts +3 -0
- package/build/index.js +6 -0
- package/package.json +29 -0
|
@@ -0,0 +1,742 @@
|
|
|
1
|
+
!function(t,i,e,o,n,s,r){const a={spacing:i.FtCssVariableFactory.create("--ft-search-selected-facets-spacing","SIZE","8px")},l=e.css`
|
|
2
|
+
.ft-search-selected-facets--container {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-wrap: wrap;
|
|
5
|
+
gap: ${a.spacing};
|
|
6
|
+
}
|
|
7
|
+
`,h=e.css`
|
|
8
|
+
`,p=i.FtReduxStore.get({name:"ft-app-info",reducers:{setBaseUrl:(t,i)=>{t.baseUrl=i.payload},setApiIntegrationIdentifier:(t,i)=>{t.apiIntegrationIdentifier=i.payload},setUiLocale:(t,i)=>{t.uiLocale=i.payload},setAvailableUiLocales:(t,i)=>{t.availableUiLocales=i.payload},setEditorMode:(t,i)=>{t.editorMode=i.payload},setNoCustom:(t,i)=>{t.noCustom=i.payload},setNoCustomComponent:(t,i)=>{t.noCustomComponent=i.payload},setSession:(t,i)=>{t.session=i.payload}},initialState:{uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],editorMode:!1,noCustom:!1,noCustomComponent:!1}});class c{static build(t){const{baseUrl:i,apiIntegrationIdentifier:e}=p.getState(),o=null!=t?t:e;if(i&&o&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(i,o,!0)}static get(t){var i;return null!=t?c.build(t):null!==(i=c.API)&&void 0!==i?i:c.API=c.build()}static await(t){return new Promise((i=>{let e=c.get(t);if(e)i(e);else{const o=p.subscribe((()=>{e=c.get(t),e&&(o(),i(e))}))}}))}}var f;const d=Symbol("clearAfterUnitTest");class u{constructor(t){this.messageContextProvider=t,this.defaultMessages={},this.cache=new i.CacheRegistry,this.listeners={},this.currentUiLocale="",this[f]=()=>{this.defaultMessages={},this.cache=new i.CacheRegistry,this.listeners={}},this.currentUiLocale=p.getState().uiLocale,p.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=p.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const i=t.name.toLowerCase();this.cache.setFinal(i,t),this.notify(i)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,e){var o;if(t=t.toLowerCase(),Object.keys(e).length>0){const n={...null!==(o=this.defaultMessages[t])&&void 0!==o?o:{},...e};i.deepEqual(this.defaultMessages[t],n)||(this.defaultMessages[t]=n,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,e,...o){var n,s,r;t=t.toLowerCase(),this.fetchContext(t);const a=null!==(s=null===(n=this.cache.getNow(t))||void 0===n?void 0:n.messages)&&void 0!==s?s:{};return new i.ParametrizedLabelResolver(null!==(r=this.defaultMessages[t])&&void 0!==r?r:{},a).resolve(e,...o)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(()=>this.messageContextProvider(this.currentUiLocale,t))),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,i){var e;return t=t.toLowerCase(),this.listeners[t]=null!==(e=this.listeners[t])&&void 0!==e?e:new Set,this.listeners[t].add(i),()=>{var e;return null===(e=this.listeners[t])||void 0===e?void 0:e.delete(i)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map((t=>this.notify(t))))}async notify(t){null!=this.listeners[t]&&await Promise.all([...this.listeners[t].values()].map((t=>i.delay(0).then((()=>t())).catch((()=>null)))))}}f=d,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new u((async(t,i)=>(await c.await()).getFluidTopicsMessageContext(t,i)))),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new u((async(t,i)=>(await c.await()).getCustomMessageContext(t,i))));const g=window.FluidTopicsI18nService;var v=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class x extends i.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.availableUiLocales=[],this.editorMode=!1,this.noCustom=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>c.get(),this.cache=new i.CacheRegistry,this.cleanSessionDebouncer=new i.Debouncer}render(){return e.html`
|
|
9
|
+
<slot></slot>
|
|
10
|
+
`}updated(t){super.updated(t),t.has("baseUrl")&&p.actions.setBaseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&p.actions.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&p.actions.setUiLocale(this.uiLocale),t.has("noCustom")&&p.actions.setNoCustom(this.noCustom),t.has("editorMode")&&p.actions.setEditorMode(this.editorMode),t.has("noCustomComponent")&&p.actions.setNoCustomComponent(this.noCustomComponent),t.has("session")&&p.actions.setSession(this.session),t.has("availableUiLocales")&&p.actions.setAvailableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>g.addContext(t))),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){const t=this.apiProvider();!this.withManualResources&&t&&(null==this.session&&(this.session=await this.cache.get("session",(async()=>{const i=await t.getCurrentSession();return i.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),i.idleTimeoutInMillis),i}))),null==this.availableUiLocales&&(this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>t.getAvailableUiLocales()))))}}x.elementDefinitions={},x.styles=h,v([n.property()],x.prototype,"baseUrl",void 0),v([n.property()],x.prototype,"apiIntegrationIdentifier",void 0),v([n.property()],x.prototype,"uiLocale",void 0),v([i.jsonProperty([])],x.prototype,"availableUiLocales",void 0),v([n.property({type:Boolean})],x.prototype,"editorMode",void 0),v([n.property({type:Boolean})],x.prototype,"noCustom",void 0),v([n.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],x.prototype,"noCustomComponent",void 0),v([n.property({type:Boolean})],x.prototype,"withManualResources",void 0),v([i.jsonProperty([])],x.prototype,"messageContexts",void 0),v([i.jsonProperty(void 0)],x.prototype,"session",void 0),v([n.property({type:Object})],x.prototype,"apiProvider",void 0),i.customElement("ft-app-context")(x);var b=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class y extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const m=Symbol("registerInterval");class $ extends(function(t){var i;class e extends t{constructor(){super(...arguments),this[i]=0}setSearchStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[m]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[m]):this.dispatchEvent(new y)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return i=m,b([n.state()],e.prototype,"stateManager",void 0),e}(i.FtLitElementRedux)){}const w=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorContent),k={color:w,backgroundColor:i.FtCssVariableFactory.extend("--ft-ripple-background-color",w),opacityContentOnSurfacePressed:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:i.FtCssVariableFactory.external(i.designSystemVariables.opacityContentOnSurfaceSelected,"Design system"),borderRadius:i.FtCssVariableFactory.create("--ft-ripple-border-radius","SIZE","0px")},z=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorPrimary),S=z,C=i.FtCssVariableFactory.extend("--ft-ripple-background-color",z),I=i.FtCssVariableFactory.extend("--ft-ripple-color",i.designSystemVariables.colorSecondary),O=I,j=i.FtCssVariableFactory.extend("--ft-ripple-background-color",I),E=e.css`
|
|
11
|
+
:host {
|
|
12
|
+
display: contents;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.ft-ripple {
|
|
16
|
+
position: absolute;
|
|
17
|
+
inset: 0;
|
|
18
|
+
pointer-events: none;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.ft-ripple:not(.ft-ripple--unbounded) {
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
border-radius: ${k.borderRadius};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ft-ripple .ft-ripple--background,
|
|
27
|
+
.ft-ripple .ft-ripple--effect {
|
|
28
|
+
position: absolute;
|
|
29
|
+
opacity: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.ft-ripple .ft-ripple--background {
|
|
33
|
+
background-color: ${k.backgroundColor};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.ft-ripple .ft-ripple--effect {
|
|
37
|
+
background-color: ${k.color};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.ft-ripple.ft-ripple--secondary .ft-ripple--background {
|
|
41
|
+
background-color: ${j};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.ft-ripple.ft-ripple--secondary .ft-ripple--effect {
|
|
45
|
+
background-color: ${O};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.ft-ripple.ft-ripple--primary .ft-ripple--background {
|
|
49
|
+
background-color: ${C};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.ft-ripple.ft-ripple--primary .ft-ripple--effect {
|
|
53
|
+
background-color: ${S};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.ft-ripple .ft-ripple--background {
|
|
57
|
+
top: 0;
|
|
58
|
+
left: 0;
|
|
59
|
+
height: 100%;
|
|
60
|
+
width: 100%;
|
|
61
|
+
transition: opacity 75ms linear;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.ft-ripple .ft-ripple--effect,
|
|
65
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
66
|
+
border-radius: 50%;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.ft-ripple .ft-ripple--effect {
|
|
70
|
+
transform: translate(-50%, -50%) scale(0.15);
|
|
71
|
+
transition: transform 300ms ease, opacity 75ms linear;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--effect,
|
|
75
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
76
|
+
left: 50%;
|
|
77
|
+
top: 50%;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
81
|
+
transform: translate(-50%, -50%);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.ft-ripple.ft-ripple--hovered .ft-ripple--background {
|
|
85
|
+
opacity: ${k.opacityContentOnSurfaceHover};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.ft-ripple.ft-ripple--selected .ft-ripple--background {
|
|
89
|
+
opacity: ${k.opacityContentOnSurfaceSelected};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.ft-ripple.ft-ripple--focused .ft-ripple--background {
|
|
93
|
+
opacity: ${k.opacityContentOnSurfaceFocused};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.ft-ripple.ft-ripple--pressed .ft-ripple--effect {
|
|
97
|
+
opacity: ${k.opacityContentOnSurfacePressed};
|
|
98
|
+
transform: translate(-50%, -50%) scale(1);
|
|
99
|
+
}
|
|
100
|
+
`;var B,N=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class U extends i.FtLitElement{constructor(){super(...arguments),this.primary=!1,this.secondary=!1,this.unbounded=!1,this.activated=!1,this.selected=!1,this.disabled=!1,this.hovered=!1,this.focused=!1,this.pressed=!1,this.rippling=!1,this.rippleSize=0,this.originX=0,this.originY=0,this.resizeObserver=new ResizeObserver((()=>this.setRippleSize())),this.debouncer=new i.Debouncer(1e3),this.onTransitionStart=t=>{"transform"===t.propertyName&&(this.rippling=this.pressed,this.debouncer.run((()=>this.rippling=!1)))},this.onTransitionEnd=t=>{"transform"===t.propertyName&&(this.rippling=!1)},this.setupDebouncer=new i.Debouncer(10),this.moveRipple=t=>{var i,e;let{x:o,y:n}=this.getCoordinates(t),s=null!==(e=null===(i=this.ripple)||void 0===i?void 0:i.getBoundingClientRect())&&void 0!==e?e:{x:0,y:0,width:0,height:0};this.originX=Math.round(null!=o?o-s.x:s.width/2),this.originY=Math.round(null!=n?n-s.y:s.height/2)},this.startPress=t=>{this.moveRipple(t),this.pressed=!this.isIgnored(t)},this.endPress=()=>{this.pressed=!1},this.startHover=t=>{this.hovered=!this.isIgnored(t)},this.endHover=()=>{this.hovered=!1},this.startFocus=t=>{this.focused=!this.isIgnored(t)},this.endFocus=()=>{this.focused=!1}}render(){let t={"ft-ripple":!0,"ft-ripple--primary":this.primary,"ft-ripple--secondary":this.secondary,"ft-ripple--unbounded":this.unbounded,"ft-ripple--selected":(this.selected||this.activated)&&!this.disabled,"ft-ripple--pressed":(this.pressed||this.rippling)&&!this.disabled,"ft-ripple--hovered":this.hovered&&!this.disabled,"ft-ripple--focused":this.focused&&!this.disabled};return e.html`
|
|
101
|
+
<style>
|
|
102
|
+
.ft-ripple .ft-ripple--effect,
|
|
103
|
+
.ft-ripple.ft-ripple--unbounded .ft-ripple--background {
|
|
104
|
+
width: ${this.rippleSize}px;
|
|
105
|
+
height: ${this.rippleSize}px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.ft-ripple .ft-ripple--effect {
|
|
109
|
+
left: ${this.originX}px;
|
|
110
|
+
top: ${this.originY}px;
|
|
111
|
+
}
|
|
112
|
+
</style>
|
|
113
|
+
<div class="${s.classMap(t)}">
|
|
114
|
+
<div class="ft-ripple--background"></div>
|
|
115
|
+
<div class="ft-ripple--effect"></div>
|
|
116
|
+
</div>
|
|
117
|
+
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.ripple&&this.resizeObserver.observe(this.ripple),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}updated(t){var i,e;super.updated(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(i=this.target)||void 0===i||i.removeAttribute("data-is-ft-ripple-target")):null===(e=this.target)||void 0===e||e.setAttribute("data-is-ft-ripple-target","true")),t.has("unbounded")&&this.setRippleSize()}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}setRippleSize(){if(this.ripple){const t=this.ripple.getBoundingClientRect();this.rippleSize=(this.unbounded?1:1.7)*Math.max(t.width,t.height)}}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run((()=>this.defaultSetup()))}defaultSetup(){var t,i;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;e&&this.setupFor(null!==(i=this.target)&&void 0!==i?i:e),this.setRippleSize()}setupFor(t){if(this.setupDebouncer.cancel(),this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const i=(...t)=>i=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(i)},e=i("mouseup","contextmenu"),o=i("touchend","touchcancel"),n=t=>{["Enter"," "].includes(t.key)&&i("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",e),t.addEventListener("touchstart",o),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",n),t.addEventListener("focus",this.startFocus),t.addEventListener("blur",this.endFocus),t.addEventListener("focusin",this.startFocus),t.addEventListener("focusout",this.endFocus),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover),t.removeEventListener("mousemove",this.moveRipple),t.removeEventListener("mouseleave",this.endHover),t.removeEventListener("mousedown",e),t.removeEventListener("touchstart",o),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",n),t.removeEventListener("focus",this.startFocus),t.removeEventListener("blur",this.endFocus),t.removeEventListener("focusin",this.startFocus),t.removeEventListener("focusout",this.endFocus),this.onDisconnect=void 0,this.target=void 0}}getCoordinates(t){const i=t,e=t;let o,n;return null!=i.x?({x:o,y:n}=i):null!=e.touches&&(o=e.touches[0].clientX,n=e.touches[0].clientY),{x:o,y:n}}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let i of t.composedPath()){if(i===this.target)break;if("hasAttribute"in i&&i.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.resizeObserver.disconnect(),this.endRipple()}}U.elementDefinitions={},U.styles=E,N([n.property({type:Boolean})],U.prototype,"primary",void 0),N([n.property({type:Boolean})],U.prototype,"secondary",void 0),N([n.property({type:Boolean})],U.prototype,"unbounded",void 0),N([n.property({type:Boolean})],U.prototype,"activated",void 0),N([n.property({type:Boolean})],U.prototype,"selected",void 0),N([n.property({type:Boolean})],U.prototype,"disabled",void 0),N([n.state()],U.prototype,"hovered",void 0),N([n.state()],U.prototype,"focused",void 0),N([n.state()],U.prototype,"pressed",void 0),N([n.state()],U.prototype,"rippling",void 0),N([n.state()],U.prototype,"rippleSize",void 0),N([n.state()],U.prototype,"originX",void 0),N([n.state()],U.prototype,"originY",void 0),N([n.query(".ft-ripple")],U.prototype,"ripple",void 0),N([n.query(".ft-ripple--effect")],U.prototype,"rippleEffect",void 0),i.customElement("ft-ripple")(U);const A=window,T=A.trustedTypes,M=T?T.createPolicy("lit-html",{createHTML:t=>t}):void 0,Z="$lit$",F=`lit$${(Math.random()+"").slice(9)}$`,L="?"+F,_=`<${L}>`,R=document,P=()=>R.createComment(""),D=t=>null===t||"object"!=typeof t&&"function"!=typeof t,W=Array.isArray,K="[ \t\n\f\r]",H=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,G=/-->/g,V=/>/g,q=RegExp(`>|${K}(?:([^\\s"'>=/]+)(${K}*=${K}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),X=/'/g,Y=/"/g,J=/^(?:script|style|textarea|title)$/i,Q=(t=>(i,...e)=>({_$litType$:t,strings:i,values:e}))(1),tt=Symbol.for("lit-noChange"),it=Symbol.for("lit-nothing"),et=new WeakMap,ot=R.createTreeWalker(R,129,null,!1),nt=(t,i)=>{const e=t.length-1,o=[];let n,s=2===i?"<svg>":"",r=H;for(let i=0;i<e;i++){const e=t[i];let a,l,h=-1,p=0;for(;p<e.length&&(r.lastIndex=p,l=r.exec(e),null!==l);)p=r.lastIndex,r===H?"!--"===l[1]?r=G:void 0!==l[1]?r=V:void 0!==l[2]?(J.test(l[2])&&(n=RegExp("</"+l[2],"g")),r=q):void 0!==l[3]&&(r=q):r===q?">"===l[0]?(r=null!=n?n:H,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?q:'"'===l[3]?Y:X):r===Y||r===X?r=q:r===G||r===V?r=H:(r=q,n=void 0);const c=r===q&&t[i+1].startsWith("/>")?" ":"";s+=r===H?e+_:h>=0?(o.push(a),e.slice(0,h)+Z+e.slice(h)+F+c):e+F+(-2===h?(o.push(void 0),i):c)}const a=s+(t[e]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==M?M.createHTML(a):a,o]};class st{constructor({strings:t,_$litType$:i},e){let o;this.parts=[];let n=0,s=0;const r=t.length-1,a=this.parts,[l,h]=nt(t,i);if(this.el=st.createElement(l,e),ot.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(o=ot.nextNode())&&a.length<r;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const i of o.getAttributeNames())if(i.endsWith(Z)||i.startsWith(F)){const e=h[s++];if(t.push(i),void 0!==e){const t=o.getAttribute(e.toLowerCase()+Z).split(F),i=/([.?@])?(.*)/.exec(e);a.push({type:1,index:n,name:i[2],strings:t,ctor:"."===i[1]?pt:"?"===i[1]?ft:"@"===i[1]?dt:ht})}else a.push({type:6,index:n})}for(const i of t)o.removeAttribute(i)}if(J.test(o.tagName)){const t=o.textContent.split(F),i=t.length-1;if(i>0){o.textContent=T?T.emptyScript:"";for(let e=0;e<i;e++)o.append(t[e],P()),ot.nextNode(),a.push({type:2,index:++n});o.append(t[i],P())}}}else if(8===o.nodeType)if(o.data===L)a.push({type:2,index:n});else{let t=-1;for(;-1!==(t=o.data.indexOf(F,t+1));)a.push({type:7,index:n}),t+=F.length-1}n++}}static createElement(t,i){const e=R.createElement("template");return e.innerHTML=t,e}}function rt(t,i,e=t,o){var n,s,r,a;if(i===tt)return i;let l=void 0!==o?null===(n=e._$Co)||void 0===n?void 0:n[o]:e._$Cl;const h=D(i)?void 0:i._$litDirective$;return(null==l?void 0:l.constructor)!==h&&(null===(s=null==l?void 0:l._$AO)||void 0===s||s.call(l,!1),void 0===h?l=void 0:(l=new h(t),l._$AT(t,e,o)),void 0!==o?(null!==(r=(a=e)._$Co)&&void 0!==r?r:a._$Co=[])[o]=l:e._$Cl=l),void 0!==l&&(i=rt(t,l._$AS(t,i.values),l,o)),i}class at{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var i;const{el:{content:e},parts:o}=this._$AD,n=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:R).importNode(e,!0);ot.currentNode=n;let s=ot.nextNode(),r=0,a=0,l=o[0];for(;void 0!==l;){if(r===l.index){let i;2===l.type?i=new lt(s,s.nextSibling,this,t):1===l.type?i=new l.ctor(s,l.name,l.strings,this,t):6===l.type&&(i=new ut(s,this,t)),this._$AV.push(i),l=o[++a]}r!==(null==l?void 0:l.index)&&(s=ot.nextNode(),r++)}return n}v(t){let i=0;for(const e of this._$AV)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,i),i+=e.strings.length-2):e._$AI(t[i])),i++}}class lt{constructor(t,i,e,o){var n;this.type=2,this._$AH=it,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=e,this.options=o,this._$Cp=null===(n=null==o?void 0:o.isConnected)||void 0===n||n}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===(null==t?void 0:t.nodeType)&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=rt(this,t,i),D(t)?t===it||null==t||""===t?(this._$AH!==it&&this._$AR(),this._$AH=it):t!==this._$AH&&t!==tt&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>W(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==it&&D(this._$AH)?this._$AA.nextSibling.data=t:this.$(R.createTextNode(t)),this._$AH=t}g(t){var i;const{values:e,_$litType$:o}=t,n="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=st.createElement(o.h,this.options)),o);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===n)this._$AH.v(e);else{const t=new at(n,this),i=t.u(this.options);t.v(e),this.$(i),this._$AH=t}}_$AC(t){let i=et.get(t.strings);return void 0===i&&et.set(t.strings,i=new st(t)),i}T(t){W(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let e,o=0;for(const n of t)o===i.length?i.push(e=new lt(this.k(P()),this.k(P()),this,this.options)):e=i[o],e._$AI(n),o++;o<i.length&&(this._$AR(e&&e._$AB.nextSibling,o),i.length=o)}_$AR(t=this._$AA.nextSibling,i){var e;for(null===(e=this._$AP)||void 0===e||e.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cp=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class ht{constructor(t,i,e,o,n){this.type=1,this._$AH=it,this._$AN=void 0,this.element=t,this.name=i,this._$AM=o,this.options=n,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=it}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,e,o){const n=this.strings;let s=!1;if(void 0===n)t=rt(this,t,i,0),s=!D(t)||t!==this._$AH&&t!==tt,s&&(this._$AH=t);else{const o=t;let r,a;for(t=n[0],r=0;r<n.length-1;r++)a=rt(this,o[e+r],i,r),a===tt&&(a=this._$AH[r]),s||(s=!D(a)||a!==this._$AH[r]),a===it?t=it:t!==it&&(t+=(null!=a?a:"")+n[r+1]),this._$AH[r]=a}s&&!o&&this.j(t)}j(t){t===it?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class pt extends ht{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===it?void 0:t}}const ct=T?T.emptyScript:"";class ft extends ht{constructor(){super(...arguments),this.type=4}j(t){t&&t!==it?this.element.setAttribute(this.name,ct):this.element.removeAttribute(this.name)}}class dt extends ht{constructor(t,i,e,o,n){super(t,i,e,o,n),this.type=5}_$AI(t,i=this){var e;if((t=null!==(e=rt(this,t,i,0))&&void 0!==e?e:it)===tt)return;const o=this._$AH,n=t===it&&o!==it||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,s=t!==it&&(o===it||n);n&&this.element.removeEventListener(this.name,this,o),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,e;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==e?e:this.element,t):this._$AH.handleEvent(t)}}class ut{constructor(t,i,e){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(t){rt(this,t)}}const gt=A.litHtmlPolyfillSupport;null==gt||gt(st,lt),(null!==(B=A.litHtmlVersions)&&void 0!==B?B:A.litHtmlVersions=[]).push("2.7.3");
|
|
118
|
+
/**
|
|
119
|
+
* @license
|
|
120
|
+
* Copyright 2020 Google LLC
|
|
121
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
122
|
+
*/
|
|
123
|
+
const vt=Symbol.for(""),xt=t=>{if((null==t?void 0:t.r)===vt)return null==t?void 0:t._$litStatic$},bt=t=>({_$litStatic$:t,r:vt}),yt=new Map,mt=(t=>(i,...e)=>{const o=e.length;let n,s;const r=[],a=[];let l,h=0,p=!1;for(;h<o;){for(l=i[h];h<o&&void 0!==(s=e[h],n=xt(s));)l+=n+i[++h],p=!0;h!==o&&a.push(s),r.push(l),h++}if(h===o&&r.push(i[o]),p){const t=r.join("$$lit$$");void 0===(i=yt.get(t))&&(r.raw=r,yt.set(t,i=r)),e=a}return t(i,...e)})(Q);var $t;!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"}($t||($t={}));const wt=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.titleFont),kt=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.contentFont),zt={fontFamily:kt,fontSize:i.FtCssVariableFactory.create("--ft-typography-font-size","SIZE","16px"),fontWeight:i.FtCssVariableFactory.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:i.FtCssVariableFactory.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:i.FtCssVariableFactory.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:i.FtCssVariableFactory.create("--ft-typography-text-transform","UNKNOWN","inherit")},St=i.FtCssVariableFactory.extend("--ft-typography-title-font-family",wt),Ct=i.FtCssVariableFactory.extend("--ft-typography-title-font-size",zt.fontSize,"20px"),It=i.FtCssVariableFactory.extend("--ft-typography-title-font-weight",zt.fontWeight,"normal"),Ot=i.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing",zt.letterSpacing,"0.15px"),jt=i.FtCssVariableFactory.extend("--ft-typography-title-line-height",zt.lineHeight,"1.2"),Et=i.FtCssVariableFactory.extend("--ft-typography-title-text-transform",zt.textTransform,"inherit"),Bt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family",wt),Nt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size",zt.fontSize,"14px"),Ut=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-weight",zt.fontWeight,"normal"),At=i.FtCssVariableFactory.extend("--ft-typography-title-dense-letter-spacing",zt.letterSpacing,"0.105px"),Tt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-line-height",zt.lineHeight,"1.7"),Mt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-text-transform",zt.textTransform,"inherit"),Zt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-family",kt),Ft=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-size",zt.fontSize,"16px"),Lt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-weight",zt.fontWeight,"600"),_t=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-letter-spacing",zt.letterSpacing,"0.144px"),Rt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-line-height",zt.lineHeight,"1.5"),Pt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-text-transform",zt.textTransform,"inherit"),Dt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-family",kt),Wt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-size",zt.fontSize,"14px"),Kt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-weight",zt.fontWeight,"normal"),Ht=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-letter-spacing",zt.letterSpacing,"0.098px"),Gt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-line-height",zt.lineHeight,"1.7"),Vt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-text-transform",zt.textTransform,"inherit"),qt=i.FtCssVariableFactory.extend("--ft-typography-body1-font-family",kt),Xt=i.FtCssVariableFactory.extend("--ft-typography-body1-font-size",zt.fontSize,"16px"),Yt=i.FtCssVariableFactory.extend("--ft-typography-body1-font-weight",zt.fontWeight,"normal"),Jt=i.FtCssVariableFactory.extend("--ft-typography-body1-letter-spacing",zt.letterSpacing,"0.496px"),Qt=i.FtCssVariableFactory.extend("--ft-typography-body1-line-height",zt.lineHeight,"1.5"),ti=i.FtCssVariableFactory.extend("--ft-typography-body1-text-transform",zt.textTransform,"inherit"),ii={fontFamily:i.FtCssVariableFactory.extend("--ft-typography-body2-font-family",kt),fontSize:i.FtCssVariableFactory.extend("--ft-typography-body2-font-size",zt.fontSize,"14px"),fontWeight:i.FtCssVariableFactory.extend("--ft-typography-body2-font-weight",zt.fontWeight,"normal"),letterSpacing:i.FtCssVariableFactory.extend("--ft-typography-body2-letter-spacing",zt.letterSpacing,"0.252px"),lineHeight:i.FtCssVariableFactory.extend("--ft-typography-body2-line-height",zt.lineHeight,"1.4"),textTransform:i.FtCssVariableFactory.extend("--ft-typography-body2-text-transform",zt.textTransform,"inherit")},ei=i.FtCssVariableFactory.extend("--ft-typography-caption-font-family",kt),oi=i.FtCssVariableFactory.extend("--ft-typography-caption-font-size",zt.fontSize,"12px"),ni=i.FtCssVariableFactory.extend("--ft-typography-caption-font-weight",zt.fontWeight,"normal"),si=i.FtCssVariableFactory.extend("--ft-typography-caption-letter-spacing",zt.letterSpacing,"0.396px"),ri=i.FtCssVariableFactory.extend("--ft-typography-caption-line-height",zt.lineHeight,"1.33"),ai=i.FtCssVariableFactory.extend("--ft-typography-caption-text-transform",zt.textTransform,"inherit"),li=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-family",kt),hi=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-size",zt.fontSize,"10px"),pi=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-weight",zt.fontWeight,"normal"),ci=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-letter-spacing",zt.letterSpacing,"0.33px"),fi=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-line-height",zt.lineHeight,"1.6"),di=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-text-transform",zt.textTransform,"inherit"),ui=i.FtCssVariableFactory.extend("--ft-typography-overline-font-family",kt),gi=i.FtCssVariableFactory.extend("--ft-typography-overline-font-size",zt.fontSize,"10px"),vi=i.FtCssVariableFactory.extend("--ft-typography-overline-font-weight",zt.fontWeight,"normal"),xi=i.FtCssVariableFactory.extend("--ft-typography-overline-letter-spacing",zt.letterSpacing,"1.5px"),bi=i.FtCssVariableFactory.extend("--ft-typography-overline-line-height",zt.lineHeight,"1.6"),yi=i.FtCssVariableFactory.extend("--ft-typography-overline-text-transform",zt.textTransform,"uppercase"),mi={fontFamily:i.FtCssVariableFactory.extend("--ft-typography-button-font-family",kt),fontSize:i.FtCssVariableFactory.extend("--ft-typography-button-font-size",zt.fontSize,"14px"),fontWeight:i.FtCssVariableFactory.extend("--ft-typography-button-font-weight",zt.fontWeight,"600"),letterSpacing:i.FtCssVariableFactory.extend("--ft-typography-button-letter-spacing",zt.letterSpacing,"1.246px"),lineHeight:i.FtCssVariableFactory.extend("--ft-typography-button-line-height",zt.lineHeight,"1.15"),textTransform:i.FtCssVariableFactory.extend("--ft-typography-button-text-transform",zt.textTransform,"uppercase")},$i=e.css`
|
|
124
|
+
.ft-typography--title {
|
|
125
|
+
font-family: ${St};
|
|
126
|
+
font-size: ${Ct};
|
|
127
|
+
font-weight: ${It};
|
|
128
|
+
letter-spacing: ${Ot};
|
|
129
|
+
line-height: ${jt};
|
|
130
|
+
text-transform: ${Et};
|
|
131
|
+
}
|
|
132
|
+
`,wi=e.css`
|
|
133
|
+
.ft-typography--title-dense {
|
|
134
|
+
font-family: ${Bt};
|
|
135
|
+
font-size: ${Nt};
|
|
136
|
+
font-weight: ${Ut};
|
|
137
|
+
letter-spacing: ${At};
|
|
138
|
+
line-height: ${Tt};
|
|
139
|
+
text-transform: ${Mt};
|
|
140
|
+
}
|
|
141
|
+
`,ki=e.css`
|
|
142
|
+
.ft-typography--subtitle1 {
|
|
143
|
+
font-family: ${Zt};
|
|
144
|
+
font-size: ${Ft};
|
|
145
|
+
font-weight: ${Lt};
|
|
146
|
+
letter-spacing: ${_t};
|
|
147
|
+
line-height: ${Rt};
|
|
148
|
+
text-transform: ${Pt};
|
|
149
|
+
}
|
|
150
|
+
`,zi=e.css`
|
|
151
|
+
.ft-typography--subtitle2 {
|
|
152
|
+
font-family: ${Dt};
|
|
153
|
+
font-size: ${Wt};
|
|
154
|
+
font-weight: ${Kt};
|
|
155
|
+
letter-spacing: ${Ht};
|
|
156
|
+
line-height: ${Gt};
|
|
157
|
+
text-transform: ${Vt};
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
`,Si=e.css`
|
|
161
|
+
.ft-typography--body1 {
|
|
162
|
+
font-family: ${qt};
|
|
163
|
+
font-size: ${Xt};
|
|
164
|
+
font-weight: ${Yt};
|
|
165
|
+
letter-spacing: ${Jt};
|
|
166
|
+
line-height: ${Qt};
|
|
167
|
+
text-transform: ${ti};
|
|
168
|
+
}
|
|
169
|
+
`,Ci=e.css`
|
|
170
|
+
.ft-typography--body2 {
|
|
171
|
+
font-family: ${ii.fontFamily};
|
|
172
|
+
font-size: ${ii.fontSize};
|
|
173
|
+
font-weight: ${ii.fontWeight};
|
|
174
|
+
letter-spacing: ${ii.letterSpacing};
|
|
175
|
+
line-height: ${ii.lineHeight};
|
|
176
|
+
text-transform: ${ii.textTransform};
|
|
177
|
+
}
|
|
178
|
+
`,Ii=e.css`
|
|
179
|
+
.ft-typography--caption {
|
|
180
|
+
font-family: ${ei};
|
|
181
|
+
font-size: ${oi};
|
|
182
|
+
font-weight: ${ni};
|
|
183
|
+
letter-spacing: ${si};
|
|
184
|
+
line-height: ${ri};
|
|
185
|
+
text-transform: ${ai};
|
|
186
|
+
}
|
|
187
|
+
`,Oi=e.css`
|
|
188
|
+
.ft-typography--breadcrumb {
|
|
189
|
+
font-family: ${li};
|
|
190
|
+
font-size: ${hi};
|
|
191
|
+
font-weight: ${pi};
|
|
192
|
+
letter-spacing: ${ci};
|
|
193
|
+
line-height: ${fi};
|
|
194
|
+
text-transform: ${di};
|
|
195
|
+
}
|
|
196
|
+
`,ji=e.css`
|
|
197
|
+
.ft-typography--overline {
|
|
198
|
+
font-family: ${ui};
|
|
199
|
+
font-size: ${gi};
|
|
200
|
+
font-weight: ${vi};
|
|
201
|
+
letter-spacing: ${xi};
|
|
202
|
+
line-height: ${bi};
|
|
203
|
+
text-transform: ${yi};
|
|
204
|
+
}
|
|
205
|
+
`,Ei=e.css`
|
|
206
|
+
.ft-typography--button {
|
|
207
|
+
font-family: ${mi.fontFamily};
|
|
208
|
+
font-size: ${mi.fontSize};
|
|
209
|
+
font-weight: ${mi.fontWeight};
|
|
210
|
+
letter-spacing: ${mi.letterSpacing};
|
|
211
|
+
line-height: ${mi.lineHeight};
|
|
212
|
+
text-transform: ${mi.textTransform};
|
|
213
|
+
}
|
|
214
|
+
`,Bi=e.css`
|
|
215
|
+
.ft-typography {
|
|
216
|
+
vertical-align: inherit;
|
|
217
|
+
}
|
|
218
|
+
`;var Ni,Ui,Ai=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class Ti extends i.FtLitElement{constructor(){super(...arguments),this.variant=$t.body1}render(){return this.element?mt`
|
|
219
|
+
<${bt(this.element)}
|
|
220
|
+
class="ft-typography ft-typography--${this.variant}">
|
|
221
|
+
<slot></slot>
|
|
222
|
+
</${bt(this.element)}>
|
|
223
|
+
`:mt`
|
|
224
|
+
<slot class="ft-typography ft-typography--${this.variant}"></slot>
|
|
225
|
+
`}}Ti.styles=[$i,wi,ki,zi,Si,Ci,Ii,Oi,ji,Ei,Bi],Ai([n.property()],Ti.prototype,"element",void 0),Ai([n.property()],Ti.prototype,"variant",void 0),i.customElement("ft-typography")(Ti),function(t){t.THUMBS_DOWN="",t.THUMBS_DOWN_PLAIN="",t.THUMBS_UP="",t.THUMBS_UP_PLAIN="",t.STAR="",t.STAR_PLAIN="",t.DESKTOP="",t.TABLET_LANDSCAPE="",t.TABLET_PORTRAIT="",t.MOBILE_LANDSCAPE="",t.MOBILE_PORTRAIT="",t.ARROW_RIGHT_TO_LINE="",t.THIN_ARROW_UP="",t.CONTEXTUAL="",t.UNSTRUCTURED_DOC="",t.RESET="",t.THIN_ARROW_LEFT="",t.THIN_ARROW_RIGHT="",t.MY_COLLECTIONS="",t.OFFLINE_SETTINGS="",t.MY_LIBRARY="",t.RATE_PLAIN="",t.RATE="",t.FEEDBACK_PLAIN="",t.PAUSE="",t.PLAY="",t.RELATIVES_PLAIN="",t.RELATIVES="",t.SHORTCUT_MENU="",t.PRINT="",t.DEFAULT_ROLES="",t.ACCOUNT_SETTINGS="",t.ONLINE="",t.OFFLINE="",t.UPLOAD="",t.BOOK_PLAIN="",t.SYNC="",t.SHARED_PBK="",t.COLLECTIONS="",t.SEARCH_IN_PUBLICATION="",t.BOOKS="",t.LOCKER="",t.ARROW_DOWN="",t.ARROW_LEFT="",t.ARROW_RIGHT="",t.ARROW_UP="",t.SAVE="",t.MAILS_AND_NOTIFICATIONS="",t.DOT="",t.MINUS="",t.PLUS="",t.FILTERS="",t.STRIPE_ARROW_RIGHT="",t.STRIPE_ARROW_LEFT="",t.ATTACHMENTS="",t.ADD_BOOKMARK="",t.BOOKMARK="",t.EXPORT="",t.MENU="",t.TAG="",t.TAG_PLAIN="",t.COPY_TO_CLIPBOARD="",t.COLUMNS="",t.ARTICLE="",t.CLOSE_PLAIN="",t.CHECK_PLAIN="",t.LOGOUT="",t.SIGN_IN="",t.THIN_ARROW="",t.TRIANGLE_BOTTOM="",t.TRIANGLE_LEFT="",t.TRIANGLE_RIGHT="",t.TRIANGLE_TOP="",t.FACET_HAS_DESCENDANT="",t.MINUS_PLAIN="",t.PLUS_PLAIN="",t.INFO="",t.ICON_EXPAND="",t.ICON_COLLAPSE="",t.ADD_TO_PBK="",t.ALERT="",t.ADD_ALERT="",t.BACK_TO_SEARCH="",t.DOWNLOAD="",t.EDIT="",t.FEEDBACK="",t.MODIFY_PBK="",t.SCHEDULED="",t.SEARCH="",t.SHARE="󨃱",t.TOC="",t.WRITE_UGC="",t.TRASH="",t.EXTLINK="",t.CALENDAR="",t.BOOK="",t.DOWNLOAD_PLAIN="",t.CHECK="",t.TOPICS="",t.EYE="",t.DISC="",t.CIRCLE="",t.SHARED="",t.SORT_UNSORTED="",t.SORT_UP="",t.SORT_DOWN="",t.WORKING="",t.CLOSE="",t.ZOOM_OUT="",t.ZOOM_IN="",t.ZOOM_REALSIZE="",t.ZOOM_FULLSCREEN="",t.ADMIN_RESTRICTED="",t.ADMIN_THEME="",t.WARNING="",t.CONTEXT="",t.SEARCH_HOME="",t.STEPS="",t.HOME="",t.TRANSLATE="",t.USER="",t.ADMIN="",t.ANALYTICS="",t.ADMIN_KHUB="",t.ADMIN_USERS="",t.ADMIN_INTEGRATION="",t.ADMIN_PORTAL=""}(Ni||(Ni={})),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=""}(Ui||(Ui={})),new Map([...["abw"].map((t=>[t,Ui.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,Ui.AUDIO])),...["avi"].map((t=>[t,Ui.AVI])),...["chm","xhs"].map((t=>[t,Ui.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,Ui.CODE])),...["csv"].map((t=>[t,Ui.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,Ui.DITA])),...["epub"].map((t=>[t,Ui.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,Ui.EXCEL])),...["flac"].map((t=>[t,Ui.FLAC])),...["gif"].map((t=>[t,Ui.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,Ui.GZIP])),...["html","htm","xhtml"].map((t=>[t,Ui.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,Ui.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,Ui.JPEG])),...["json"].map((t=>[t,Ui.JSON])),...["m4a","m4p"].map((t=>[t,Ui.M4A])),...["mov","qt"].map((t=>[t,Ui.MOV])),...["mp3"].map((t=>[t,Ui.MP3])),...["mp4","m4v"].map((t=>[t,Ui.MP4])),...["ogg","oga"].map((t=>[t,Ui.OGG])),...["pdf","ps"].map((t=>[t,Ui.PDF])),...["png"].map((t=>[t,Ui.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,Ui.POWERPOINT])),...["rar"].map((t=>[t,Ui.RAR])),...["stp"].map((t=>[t,Ui.STP])),...["txt","rtf","md","mdown"].map((t=>[t,Ui.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,Ui.VIDEO])),...["wav"].map((t=>[t,Ui.WAV])),...["wma"].map((t=>[t,Ui.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,Ui.WORD])),...["xml","xsl","rdf"].map((t=>[t,Ui.XML])),...["yaml","yml","x-yaml"].map((t=>[t,Ui.YAML])),...["zip"].map((t=>[t,Ui.ZIP]))]);const Mi={size:i.FtCssVariableFactory.create("--ft-icon-font-size","SIZE","24px"),fluidTopicsFontFamily:i.FtCssVariableFactory.extend("--ft-icon-fluid-topics-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-icons")),fileFormatFontFamily:i.FtCssVariableFactory.extend("--ft-icon-file-format-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-mime")),materialFontFamily:i.FtCssVariableFactory.extend("--ft-icon-material-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","Material Icons")),verticalAlign:i.FtCssVariableFactory.create("--ft-icon-vertical-align","UNKNOWN","unset")},Zi=e.css`
|
|
226
|
+
:host, i.ft-icon {
|
|
227
|
+
display: inline-flex;
|
|
228
|
+
align-items: center;
|
|
229
|
+
flex-shrink: 0;
|
|
230
|
+
flex-grow: 0;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
:host {
|
|
234
|
+
width: ${Mi.size};
|
|
235
|
+
height: ${Mi.size};
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
i.ft-icon {
|
|
239
|
+
width: 100%;
|
|
240
|
+
height: 100%;
|
|
241
|
+
font-size: ${Mi.size};
|
|
242
|
+
line-height: 1;
|
|
243
|
+
font-weight: normal;
|
|
244
|
+
text-transform: none;
|
|
245
|
+
font-style: normal;
|
|
246
|
+
font-variant: normal;
|
|
247
|
+
speak: none;
|
|
248
|
+
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
|
|
249
|
+
text-rendering: auto;
|
|
250
|
+
-webkit-font-smoothing: antialiased;
|
|
251
|
+
-moz-osx-font-smoothing: grayscale;
|
|
252
|
+
vertical-align: ${Mi.verticalAlign};
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
i.ft-icon.ft-icon--fluid-topics {
|
|
256
|
+
font-family: ${Mi.fluidTopicsFontFamily}, ft-icons, fticons, sans-serif;
|
|
257
|
+
|
|
258
|
+
/* Ugly fix because font is broken */
|
|
259
|
+
font-size: calc(0.75 * ${Mi.size});
|
|
260
|
+
line-height: ${Mi.size};
|
|
261
|
+
position: relative;
|
|
262
|
+
top: -4%;
|
|
263
|
+
justify-content: center;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.ft-icon--file-format {
|
|
267
|
+
font-family: ${Mi.fileFormatFontFamily}, ft-mime, sans-serif;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.ft-icon--material {
|
|
271
|
+
font-family: ${Mi.materialFontFamily}, "Material Icons", sans-serif;
|
|
272
|
+
}
|
|
273
|
+
`;var Fi;!function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(Fi||(Fi={}));var Li=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class _i extends i.FtLitElement{constructor(){super(...arguments),this.resolvedIcon=e.nothing}render(){const t=this.variant&&Object.values(Fi).includes(this.variant)?this.variant:Fi.fluid_topics,i=t!==Fi.material||!!this.value;return e.html`
|
|
274
|
+
<i class="ft-icon ft-icon--${t}" part="icon icon-${t}">
|
|
275
|
+
${r.unsafeHTML(this.resolvedIcon)}
|
|
276
|
+
<slot ?hidden=${i}></slot>
|
|
277
|
+
</i>
|
|
278
|
+
`}get textContent(){var t,i;return null!==(i=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==i?i:""}update(t){super.update(t),["value","variant"].some((i=>t.has(i)))&&this.resolveIcon()}resolveIcon(){var t,i;let o=this.value||this.textContent;switch(this.variant){case Fi.file_format:this.resolvedIcon=null!==(t=Ui[o.replace("-","_").toUpperCase()])&&void 0!==t?t:o;break;case Fi.material:this.resolvedIcon=this.value||e.nothing;break;default:this.resolvedIcon=null!==(i=Ni[o.replace("-","_").toUpperCase()])&&void 0!==i?i:o}}firstUpdated(t){super.firstUpdated(t),setTimeout((()=>this.resolveIcon()))}}_i.elementDefinitions={},_i.styles=Zi,Li([n.property()],_i.prototype,"variant",void 0),Li([n.property()],_i.prototype,"value",void 0),Li([n.state()],_i.prototype,"resolvedIcon",void 0),Li([n.query("slot")],_i.prototype,"slottedContent",void 0),i.customElement("ft-icon")(_i);const Ri=i.FtCssVariableFactory.create("--ft-tooltip-distance","SIZE","4px"),Pi=i.FtCssVariableFactory.create("--ft-tooltip-color","COLOR","#FFFFFF"),Di=i.FtCssVariableFactory.create("--ft-tooltip-background-color","COLOR","#666666"),Wi=i.FtCssVariableFactory.create("--ft-tooltip-z-index","NUMBER","1"),Ki=i.FtCssVariableFactory.external(i.designSystemVariables.borderRadiusS,"Design system"),Hi=i.FtCssVariableFactory.create("--ft-tooltip-max-width","SIZE","150px"),Gi=e.css`
|
|
279
|
+
.ft-tooltip--container {
|
|
280
|
+
display: block;
|
|
281
|
+
position: relative;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.ft-tooltip--inline {
|
|
285
|
+
display: inline-block;
|
|
286
|
+
max-width: 100%;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.ft-tooltip {
|
|
290
|
+
position: absolute;
|
|
291
|
+
box-sizing: border-box;
|
|
292
|
+
overflow: hidden;
|
|
293
|
+
width: max-content;
|
|
294
|
+
max-width: ${Hi};
|
|
295
|
+
text-align: center;
|
|
296
|
+
padding: ${Ri};
|
|
297
|
+
z-index: ${Wi};
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.ft-tooltip--content {
|
|
301
|
+
padding: 4px 8px;
|
|
302
|
+
border-radius: ${Ki};
|
|
303
|
+
background-color: ${Di};
|
|
304
|
+
color: ${Pi};
|
|
305
|
+
top: -500px;
|
|
306
|
+
left: -500px;
|
|
307
|
+
position: relative;
|
|
308
|
+
word-break: break-word;
|
|
309
|
+
}
|
|
310
|
+
`;var Vi=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class qi extends i.FtLitElement{constructor(){super(...arguments),this.text="",this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.visible=!1,this.validPositions=new Set(["top","bottom","left","right"]),this.hideDebounce=new i.Debouncer,this.revealDebouncer=new i.Debouncer}get validPosition(){return this.validPositions.has(this.position)?this.position:"bottom"}render(){return e.html`
|
|
311
|
+
<div part="container"
|
|
312
|
+
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
313
|
+
@mouseenter=${this.onHover}
|
|
314
|
+
@mouseleave=${this.onOut}
|
|
315
|
+
@focusin=${this.onHover}
|
|
316
|
+
@focusout=${this.onOut}
|
|
317
|
+
@touchstart=${this.onTouch}>
|
|
318
|
+
<slot></slot>
|
|
319
|
+
<div part="tooltip" role="tooltip" inert
|
|
320
|
+
class="ft-tooltip ft-tooltip--${this.validPosition}"
|
|
321
|
+
?hidden=${!this.visible}>
|
|
322
|
+
<div part="tooltip-content" class="ft-tooltip--content">
|
|
323
|
+
<slot name="text"></slot>
|
|
324
|
+
<ft-typography variant="caption" ?hidden=${!this.text}>${this.text}</ft-typography>
|
|
325
|
+
</div>
|
|
326
|
+
</div>
|
|
327
|
+
</div>
|
|
328
|
+
`}update(t){t.has("visible")&&!this.visible&&this.resetTooltipContent(),super.update(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((i=>t.has(i)))&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent();const t=this.slottedElement;if(this.tooltip&&t){const i=t.getBoundingClientRect(),e=(i.height-this.tooltip.clientHeight)/2,o=(i.width-this.tooltip.clientWidth)/2;let n=0,s=0;switch(this.validPosition){case"top":s=-this.tooltip.clientHeight,n=o;break;case"bottom":s=i.height,n=o;break;case"left":s=e,n=-this.tooltip.clientWidth;break;case"right":s=e,n=i.width}i.left+n+this.tooltip.clientWidth>window.innerWidth&&(n=window.innerWidth-this.tooltip.clientWidth-i.left),i.left+n<0&&(n=4-i.left);const r=this.tooltip.style;r.left=n+"px",r.top=s+"px",r.maxWidth=`max(${i.width}px, ${Hi})`}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())}}qi.elementDefinitions={"ft-typography":Ti},qi.styles=Gi,Vi([n.property()],qi.prototype,"text",void 0),Vi([n.property({type:Boolean})],qi.prototype,"manual",void 0),Vi([n.property({type:Boolean})],qi.prototype,"inline",void 0),Vi([n.property({type:Number})],qi.prototype,"delay",void 0),Vi([n.property()],qi.prototype,"position",void 0),Vi([n.queryAssignedNodes("",!0)],qi.prototype,"slotNodes",void 0),Vi([n.query(".ft-tooltip--container")],qi.prototype,"container",void 0),Vi([n.query("slot")],qi.prototype,"target",void 0),Vi([n.query(".ft-tooltip")],qi.prototype,"tooltip",void 0),Vi([n.query(".ft-tooltip--content")],qi.prototype,"tooltipContent",void 0),Vi([n.state()],qi.prototype,"visible",void 0),i.customElement("ft-tooltip")(qi);const Xi={color:i.FtCssVariableFactory.extend("--ft-loader-color",i.designSystemVariables.colorPrimary),size:i.FtCssVariableFactory.create("--ft-loader-size","SIZE","80px")},Yi=e.css`
|
|
329
|
+
:host {
|
|
330
|
+
line-height: 0;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.ft-loader {
|
|
334
|
+
display: inline-block;
|
|
335
|
+
position: relative;
|
|
336
|
+
|
|
337
|
+
width: ${Xi.size};
|
|
338
|
+
height: ${Xi.size};
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.ft-loader div {
|
|
342
|
+
position: absolute;
|
|
343
|
+
top: 37.5%;
|
|
344
|
+
width: 25%;
|
|
345
|
+
height: 25%;
|
|
346
|
+
border-radius: 50%;
|
|
347
|
+
background: ${Xi.color};
|
|
348
|
+
animation-timing-function: cubic-bezier(0, 1, 1, 0);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.ft-loader div:nth-child(1) {
|
|
352
|
+
left: 2.5%;
|
|
353
|
+
animation: appear 0.6s infinite;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.ft-loader div:nth-child(2) {
|
|
357
|
+
left: 2.5%;
|
|
358
|
+
animation: move 0.6s infinite;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.ft-loader div:nth-child(3) {
|
|
362
|
+
left: 37.5%;
|
|
363
|
+
animation: move 0.6s infinite;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.ft-loader div:nth-child(4) {
|
|
367
|
+
left: 72.5%;
|
|
368
|
+
animation: disappear 0.6s infinite;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
@keyframes appear {
|
|
372
|
+
0% {
|
|
373
|
+
transform: scale(0);
|
|
374
|
+
}
|
|
375
|
+
100% {
|
|
376
|
+
transform: scale(1);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
@keyframes disappear {
|
|
381
|
+
0% {
|
|
382
|
+
transform: scale(1);
|
|
383
|
+
}
|
|
384
|
+
100% {
|
|
385
|
+
transform: scale(0);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
@keyframes move {
|
|
390
|
+
0% {
|
|
391
|
+
transform: translate(0, 0);
|
|
392
|
+
}
|
|
393
|
+
100% {
|
|
394
|
+
transform: translate(calc(0.35 * ${Xi.size}), 0);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
`;class Ji extends i.FtLitElement{render(){return e.html`
|
|
398
|
+
<div class="ft-loader">
|
|
399
|
+
<div></div>
|
|
400
|
+
<div></div>
|
|
401
|
+
<div></div>
|
|
402
|
+
<div></div>
|
|
403
|
+
</div>
|
|
404
|
+
`}}Ji.styles=Yi,i.customElement("ft-loader")(Ji);const Qi=i.FtCssVariableFactory.extend("--ft-button-color",i.designSystemVariables.colorPrimary),te={backgroundColor:i.FtCssVariableFactory.extend("--ft-button-background-color",i.designSystemVariables.colorSurface),borderRadius:i.FtCssVariableFactory.extend("--ft-button-border-radius",i.designSystemVariables.borderRadiusL),color:Qi,fontSize:i.FtCssVariableFactory.extend("--ft-button-font-size",mi.fontSize),iconSize:i.FtCssVariableFactory.create("--ft-button-icon-size","SIZE","24px"),rippleColor:i.FtCssVariableFactory.extend("--ft-button-ripple-color",Qi),verticalPadding:i.FtCssVariableFactory.create("--ft-button-vertical-padding","SIZE","6px"),horizontalPadding:i.FtCssVariableFactory.create("--ft-button-horizontal-padding","SIZE","8px"),iconPadding:i.FtCssVariableFactory.create("--ft-button-icon-padding","SIZE","8px"),opacityDisabled:i.FtCssVariableFactory.external(i.designSystemVariables.colorOpacityDisabled,"Design system")},ie=i.FtCssVariableFactory.extend("--ft-button-primary-color",i.FtCssVariableFactory.extend("--ft-button-color",i.designSystemVariables.colorOnPrimary)),ee={backgroundColor:i.FtCssVariableFactory.extend("--ft-button-primary-background-color",i.FtCssVariableFactory.extend("--ft-button-background-color",i.designSystemVariables.colorPrimary)),color:ie,rippleColor:i.FtCssVariableFactory.extend("--ft-button-primary-ripple-color",ie)},oe=i.FtCssVariableFactory.extend("--ft-button-dense-border-radius",i.FtCssVariableFactory.extend("--ft-button-border-radius",i.designSystemVariables.borderRadiusM)),ne=i.FtCssVariableFactory.create("--ft-button-dense-vertical-padding","SIZE","2px"),se=i.FtCssVariableFactory.create("--ft-button-dense-horizontal-padding","SIZE","4px"),re=i.FtCssVariableFactory.create("--ft-button-dense-icon-padding","SIZE","4px"),ae=[e.css`
|
|
405
|
+
:host {
|
|
406
|
+
display: inline-block;
|
|
407
|
+
max-width: 100%;
|
|
408
|
+
pointer-events: none;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
button {
|
|
412
|
+
box-shadow: 0px 0px 0px transparent;
|
|
413
|
+
border: 0px solid transparent;
|
|
414
|
+
text-shadow: 0px 0px 0px transparent;
|
|
415
|
+
font-size: ${te.fontSize};
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
button:hover {
|
|
419
|
+
box-shadow: 0px 0px 0px transparent;
|
|
420
|
+
border: 0px solid transparent;
|
|
421
|
+
text-shadow: 0px 0px 0px transparent;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
button:active {
|
|
425
|
+
outline: none;
|
|
426
|
+
border: none;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
button:focus {
|
|
430
|
+
outline: 0;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
.ft-button {
|
|
434
|
+
position: relative;
|
|
435
|
+
display: flex;
|
|
436
|
+
justify-content: center;
|
|
437
|
+
align-items: center;
|
|
438
|
+
width: 100%;
|
|
439
|
+
overflow: hidden;
|
|
440
|
+
box-sizing: border-box;
|
|
441
|
+
border: none;
|
|
442
|
+
pointer-events: auto;
|
|
443
|
+
|
|
444
|
+
--ft-button-internal-line-height: max(calc(${te.fontSize} + 2px), ${te.iconSize});
|
|
445
|
+
--ft-button-internal-color: ${te.color};
|
|
446
|
+
${i.setVariable(Mi.size,te.iconSize)};
|
|
447
|
+
${i.setVariable(k.color,te.rippleColor)};
|
|
448
|
+
|
|
449
|
+
border-radius: ${te.borderRadius};
|
|
450
|
+
padding: ${te.verticalPadding} ${te.horizontalPadding};
|
|
451
|
+
background-color: ${te.backgroundColor};
|
|
452
|
+
color: var(--ft-button-internal-color);
|
|
453
|
+
-webkit-mask-image: radial-gradient(white, black);
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
.ft-button.ft-button--outlined {
|
|
457
|
+
border: 1px solid var(--ft-button-internal-color);
|
|
458
|
+
padding: calc(${te.verticalPadding} - 1px) calc(${te.horizontalPadding} - 1px);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
.ft-button.ft-button--dense {
|
|
462
|
+
padding: ${ne} ${se};
|
|
463
|
+
border-radius: ${oe};
|
|
464
|
+
gap: ${re};
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
.ft-button.ft-button--dense.ft-button--outlined {
|
|
468
|
+
padding: calc(${ne} - 1px) calc(${se} - 1px);
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
.ft-button:not([disabled]):hover {
|
|
472
|
+
cursor: pointer;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
.ft-button--round {
|
|
476
|
+
border-radius: calc(var(--ft-button-internal-line-height) / 2 + ${te.verticalPadding});
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
.ft-button--round.ft-button--dense {
|
|
480
|
+
border-radius: calc(var(--ft-button-internal-line-height) / 2 + ${ne});
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
.ft-button[disabled] {
|
|
484
|
+
filter: grayscale(1);
|
|
485
|
+
opacity: ${te.opacityDisabled};
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
.ft-button.ft-button--primary {
|
|
489
|
+
background-color: ${ee.backgroundColor};
|
|
490
|
+
--ft-button-internal-color: ${ee.color};
|
|
491
|
+
${i.setVariable(k.color,ee.rippleColor)};
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
.ft-button:focus {
|
|
495
|
+
outline: none;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
.ft-button--label {
|
|
499
|
+
position: relative;
|
|
500
|
+
overflow: hidden;
|
|
501
|
+
white-space: nowrap;
|
|
502
|
+
text-overflow: ellipsis;
|
|
503
|
+
display: block;
|
|
504
|
+
margin: 0 ${te.iconPadding};
|
|
505
|
+
${i.setVariable(mi.fontSize,"1em")};
|
|
506
|
+
${i.setVariable(mi.lineHeight,"var(--ft-button-internal-line-height)")};
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
.ft-button--dense .ft-button--label {
|
|
510
|
+
margin: 0 ${re};
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
.ft-button--label[hidden] {
|
|
514
|
+
display: none;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
ft-icon {
|
|
518
|
+
flex-shrink: 0;
|
|
519
|
+
position: relative;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
.ft-button--label[hidden] + ft-icon {
|
|
523
|
+
margin: 0 calc(${te.horizontalPadding} * -1);
|
|
524
|
+
padding: 0 ${te.verticalPadding};
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
.ft-button--dense .ft-button--label[hidden] + ft-icon {
|
|
528
|
+
margin: 0 calc(${se} * -1);
|
|
529
|
+
padding: 0 ${ne};
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
.ft-button:not(.ft-button--trailing-icon) ft-icon,
|
|
533
|
+
.ft-button:not(.ft-button--trailing-icon) ft-loader {
|
|
534
|
+
order: -1;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
ft-loader {
|
|
538
|
+
${i.setVariable(Xi.size,te.iconSize)};
|
|
539
|
+
${i.setVariable(Xi.color,"var(--ft-button-internal-color)")};
|
|
540
|
+
}
|
|
541
|
+
`,i.noTextSelect];var le=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class he extends i.FtLitElement{constructor(){super(...arguments),this.role="button",this.primary=!1,this.outlined=!1,this.disabled=!1,this.dense=!1,this.round=!1,this.label="",this.icon=void 0,this.trailingIcon=!1,this.loading=!1,this.tooltipPosition="bottom",this.hideTooltip=!1,this.forceTooltip=!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-no-text-select":!0};return this.addTooltipIfNeeded(e.html`
|
|
542
|
+
<button part="button"
|
|
543
|
+
class="${s.classMap(t)}"
|
|
544
|
+
aria-label="${this.getLabel()}"
|
|
545
|
+
?disabled=${this.isDisabled()}>
|
|
546
|
+
<ft-ripple part="ripple" ?disabled=${this.isDisabled()}></ft-ripple>
|
|
547
|
+
<ft-typography part="label"
|
|
548
|
+
variant="button"
|
|
549
|
+
element="span"
|
|
550
|
+
class="ft-button--label ${i.isSafari?"ft-safari-ellipsis-fix":""}"
|
|
551
|
+
?hidden=${!this.hasTextContent()}>
|
|
552
|
+
<slot @slotchange=${this.onSlotchange}></slot>
|
|
553
|
+
</ft-typography>
|
|
554
|
+
${this.resolveIcon()}
|
|
555
|
+
</button>
|
|
556
|
+
`)}addTooltipIfNeeded(t){return this.getLabel().trim().length>0&&(this.forceTooltip||!this.hasTextContent()&&!this.hideTooltip)?e.html`
|
|
557
|
+
<ft-tooltip part="tooltip"
|
|
558
|
+
text="${this.getLabel()}"
|
|
559
|
+
position="${this.tooltipPosition}">
|
|
560
|
+
${t}
|
|
561
|
+
</ft-tooltip>
|
|
562
|
+
`:t}resolveIcon(){return this.loading?e.html`
|
|
563
|
+
<ft-loader part="loader icon"></ft-loader> `:this.icon?e.html`
|
|
564
|
+
<ft-icon part="icon" .variant="${this.iconVariant}" .value="${this.icon}"></ft-icon> `:e.nothing}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}}he.elementDefinitions={"ft-ripple":U,"ft-tooltip":qi,"ft-typography":Ti,"ft-icon":_i,"ft-loader":Ji},he.styles=[i.safariEllipsisFix,ae],le([n.property({type:String,reflect:!0})],he.prototype,"role",void 0),le([n.property({type:Boolean})],he.prototype,"primary",void 0),le([n.property({type:Boolean})],he.prototype,"outlined",void 0),le([n.property({type:Boolean})],he.prototype,"disabled",void 0),le([n.property({type:Boolean})],he.prototype,"dense",void 0),le([n.property({type:Boolean})],he.prototype,"round",void 0),le([n.property()],he.prototype,"label",void 0),le([n.property()],he.prototype,"icon",void 0),le([n.property()],he.prototype,"iconVariant",void 0),le([n.property({type:Boolean})],he.prototype,"trailingIcon",void 0),le([n.property({type:Boolean})],he.prototype,"loading",void 0),le([n.property()],he.prototype,"tooltipPosition",void 0),le([n.property({type:Boolean})],he.prototype,"hideTooltip",void 0),le([n.property({type:Boolean})],he.prototype,"forceTooltip",void 0),le([n.query(".ft-button")],he.prototype,"button",void 0),le([n.query(".ft-button--label slot")],he.prototype,"slottedContent",void 0),i.customElement("ft-button")(he);const pe=i.FtCssVariableFactory.extend("--ft-chip-color",i.designSystemVariables.colorOnSurface),ce={backgroundColor:i.FtCssVariableFactory.extend("--ft-chip-background-color",i.designSystemVariables.colorSurface),color:pe,fontSize:i.FtCssVariableFactory.extend("--ft-chip-font-size",ii.fontSize),iconSize:i.FtCssVariableFactory.create("--ft-chip-icon-size","SIZE","18px"),rippleColor:i.FtCssVariableFactory.extend("--ft-chip-ripple-color",pe),horizontalPadding:i.FtCssVariableFactory.create("--ft-chip-horizontal-padding","SIZE","6px"),verticalPadding:i.FtCssVariableFactory.create("--ft-chip-vertical-padding","SIZE","6px"),colorOutline:i.FtCssVariableFactory.external(i.designSystemVariables.colorOutline,"Design system"),opacityDisabled:i.FtCssVariableFactory.external(i.designSystemVariables.colorOpacityDisabled,"Design system")},fe=i.FtCssVariableFactory.extend("--ft-chip-highlighted-color",i.FtCssVariableFactory.extend("--ft-chip-color",i.designSystemVariables.colorOnPrimary)),de={backgroundColor:i.FtCssVariableFactory.extend("--ft-chip-highlighted-background-color",i.FtCssVariableFactory.extend("--ft-chip-background-color",i.designSystemVariables.colorPrimary)),color:fe,rippleColor:i.FtCssVariableFactory.extend("--ft-chip-highlighted-ripple-color",fe)},ue=i.FtCssVariableFactory.create("--ft-chip-dense-horizontal-padding","SIZE","4px"),ge=i.FtCssVariableFactory.create("--ft-chip-dense-vertical-padding","SIZE","4px"),ve=[i.noTextSelect,e.css`
|
|
565
|
+
:host {
|
|
566
|
+
display: inline-block;
|
|
567
|
+
max-width: 100%;
|
|
568
|
+
pointer-events: none;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
.ft-chip {
|
|
572
|
+
position: relative;
|
|
573
|
+
display: flex;
|
|
574
|
+
justify-content: center;
|
|
575
|
+
align-items: center;
|
|
576
|
+
width: 100%;
|
|
577
|
+
box-sizing: border-box;
|
|
578
|
+
pointer-events: auto;
|
|
579
|
+
|
|
580
|
+
--ft-chip-internal-font-size: ${ce.fontSize};
|
|
581
|
+
--ft-chip-internal-line-height: max(20px, calc(var(--ft-chip-internal-font-size) + 2px));
|
|
582
|
+
${i.setVariable(Mi.size,ce.iconSize)};
|
|
583
|
+
--ft-chip-internal-vertical-padding: ${ce.verticalPadding};
|
|
584
|
+
--ft-chip-internal-horizontal-padding: ${ce.horizontalPadding};
|
|
585
|
+
--ft-chip-internal-icon-padding: 3px;
|
|
586
|
+
--ft-chip-internal-content-height: max(var(--ft-chip-internal-line-height), ${ce.iconSize});
|
|
587
|
+
|
|
588
|
+
border: 1px solid ${ce.colorOutline};
|
|
589
|
+
color: ${ce.color};
|
|
590
|
+
${i.setVariable(k.color,ce.rippleColor)};
|
|
591
|
+
border-radius: calc(var(--ft-chip-internal-content-height) / 2 + var(--ft-chip-internal-vertical-padding));
|
|
592
|
+
padding: calc(var(--ft-chip-internal-vertical-padding) - 1px) calc(var(--ft-chip-internal-horizontal-padding) - 1px);
|
|
593
|
+
background-color: ${ce.backgroundColor};
|
|
594
|
+
line-height: var(--ft-chip-internal-content-height);
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
.ft-chip > *:not(ft-ripple) {
|
|
598
|
+
position: relative;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
.ft-chip--dense {
|
|
602
|
+
--ft-chip-internal-icon-padding: 3px;
|
|
603
|
+
--ft-chip-internal-vertical-padding: ${ge};
|
|
604
|
+
--ft-chip-internal-horizontal-padding: ${ue};
|
|
605
|
+
--ft-chip-internal-line-height: max(16px, calc(var(--ft-chip-internal-font-size) + 2px));
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
.ft-chip--no-content {
|
|
609
|
+
--ft-chip-internal-horizontal-padding: var(--ft-chip-horizontal-padding, var(--ft-chip-internal-vertical-padding));
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
.ft-chip--disabled {
|
|
613
|
+
cursor: default;
|
|
614
|
+
pointer-events: none;
|
|
615
|
+
filter: grayscale(1);
|
|
616
|
+
opacity: ${ce.opacityDisabled};
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
.ft-chip--highlighted {
|
|
620
|
+
border: none;
|
|
621
|
+
padding: var(--ft-chip-internal-vertical-padding) var(--ft-chip-internal-horizontal-padding);
|
|
622
|
+
background-color: ${de.backgroundColor};
|
|
623
|
+
${i.setVariable(k.color,de.rippleColor)};
|
|
624
|
+
color: ${de.color};
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
.ft-chip--clickable {
|
|
628
|
+
cursor: pointer;
|
|
629
|
+
-webkit-mask-image: radial-gradient(white, black);
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
.ft-chip:focus {
|
|
633
|
+
outline: none;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
.ft-chip--icon-container {
|
|
637
|
+
display: inline-flex;
|
|
638
|
+
position: relative;
|
|
639
|
+
overflow: hidden;
|
|
640
|
+
border-radius: 100%;
|
|
641
|
+
justify-content: center;
|
|
642
|
+
align-items: center;
|
|
643
|
+
flex-shrink: 0;
|
|
644
|
+
|
|
645
|
+
padding: var(--ft-chip-internal-icon-padding);
|
|
646
|
+
margin: calc((-1) * var(--ft-chip-internal-icon-padding));
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
.ft-chip--icon-container > *:not(ft-ripple) {
|
|
650
|
+
position: relative;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
.ft-chip--icon-button {
|
|
654
|
+
${i.setVariable(te.iconSize,ce.iconSize)};
|
|
655
|
+
${i.setVariable(te.horizontalPadding,"var(--ft-chip-internal-icon-padding)")};
|
|
656
|
+
${i.setVariable(te.verticalPadding,"var(--ft-chip-internal-icon-padding)")};
|
|
657
|
+
margin: calc((-1) * var(--ft-chip-internal-icon-padding));
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
.ft-chip--label {
|
|
661
|
+
vertical-align: bottom;
|
|
662
|
+
display: block;
|
|
663
|
+
margin: 0 var(--ft-chip-internal-horizontal-padding);
|
|
664
|
+
${i.setVariable(ii.fontSize,"var(--ft-chip-internal-font-size)")};
|
|
665
|
+
${i.setVariable(ii.lineHeight,"var(--ft-chip-internal-content-height)")};
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
.ft-chip--safari-fix .ft-chip--label {
|
|
669
|
+
margin-right: 0;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
.ft-chip:not(.ft-chip--multi-line) .ft-chip--label {
|
|
673
|
+
overflow: hidden;
|
|
674
|
+
white-space: nowrap;
|
|
675
|
+
text-overflow: ellipsis;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
.ft-chip--safari-fix:not(.ft-chip--multi-line) .ft-chip--label:after {
|
|
679
|
+
content: "\\0000a0";
|
|
680
|
+
display: inline-block;
|
|
681
|
+
width: 0;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
.ft-chip--no-content .ft-chip--label {
|
|
685
|
+
display: none;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
.ft-chip--no-content .ft-chip--label + .ft-chip--icon-container {
|
|
689
|
+
width: var(--ft-chip-internal-content-height);
|
|
690
|
+
height: var(--ft-chip-internal-content-height);
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
.ft-chip--icon-container:focus {
|
|
694
|
+
outline: none;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
.ft-chip:not(.ft-chip--trailing-icon) .ft-chip--icon-container,
|
|
698
|
+
.ft-chip:not(.ft-chip--trailing-icon) .ft-chip--icon-button {
|
|
699
|
+
order: -1;
|
|
700
|
+
}
|
|
701
|
+
`];var xe=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class be extends CustomEvent{constructor(){super("icon-click")}}class ye extends i.FtLitElement{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.iconLabel="",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":i.isSafari};return e.html`
|
|
702
|
+
<div class="${s.classMap(t)}"
|
|
703
|
+
aria-label="${this.getLabel()}"
|
|
704
|
+
tabindex="${this.interactionsOnChip?0:-1}"
|
|
705
|
+
@keyup=${this.onKeyUp}>
|
|
706
|
+
<ft-ripple ?disabled=${!this.interactionsOnChip}></ft-ripple>
|
|
707
|
+
<ft-typography variant="body2" element="span" class="ft-chip--label">
|
|
708
|
+
<slot @slotchange=${this.onSlotchange}></slot>
|
|
709
|
+
</ft-typography>
|
|
710
|
+
${this.internalIcon?this.renderIcon():null}
|
|
711
|
+
</div>
|
|
712
|
+
`}get interactionsOnChip(){return this.clickable&&!this.disabled}get interactionsOnIcon(){return(this.iconClickable||this.removable)&&!this.disabled}renderIcon(){return this.interactionsOnIcon?e.html`
|
|
713
|
+
<ft-button round
|
|
714
|
+
class="ft-chip--icon-button"
|
|
715
|
+
@click=${this.onIconClick}
|
|
716
|
+
.iconVariant=${this.iconVariant}
|
|
717
|
+
icon="${this.internalIcon}"
|
|
718
|
+
label="${this.iconLabel}"
|
|
719
|
+
></ft-button>
|
|
720
|
+
`:e.html`
|
|
721
|
+
<div class="ft-chip--icon-container ft-no-text-select">
|
|
722
|
+
<ft-icon .variant=${this.iconVariant} .value="${this.internalIcon}"></ft-icon>
|
|
723
|
+
</div>
|
|
724
|
+
`}onKeyUp(t){this.interactionsOnChip&&["Enter"," "].includes(t.key)&&t.target.click()}onIconKeyUp(t){this.interactionsOnIcon&&["Enter"," "].includes(t.key)&&(t.stopPropagation(),this.dispatchEvent(new be))}onIconClick(t){this.interactionsOnIcon&&(t.stopPropagation(),this.dispatchEvent(new be))}getLabel(){return this.label||this.textContent}get textContent(){var t,i;return null!==(i=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==i?i:""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}get internalIcon(){return this.icon||(this.removable?"close":void 0)}}ye.elementDefinitions={"ft-ripple":U,"ft-typography":Ti,"ft-icon":_i,"ft-button":he},ye.styles=ve,xe([n.property({type:Boolean})],ye.prototype,"highlighted",void 0),xe([n.property({type:Boolean})],ye.prototype,"removable",void 0),xe([n.property({type:Boolean})],ye.prototype,"disabled",void 0),xe([n.property({type:Boolean})],ye.prototype,"clickable",void 0),xe([n.property({type:Boolean})],ye.prototype,"iconClickable",void 0),xe([n.property({type:Boolean})],ye.prototype,"dense",void 0),xe([n.property({type:Boolean})],ye.prototype,"multiLine",void 0),xe([n.property()],ye.prototype,"label",void 0),xe([n.property()],ye.prototype,"iconLabel",void 0),xe([n.property()],ye.prototype,"icon",void 0),xe([n.property()],ye.prototype,"iconVariant",void 0),xe([n.property({type:Boolean})],ye.prototype,"trailingIcon",void 0),xe([n.query("ft-typography slot")],ye.prototype,"slottedContent",void 0),i.customElement("ft-chip")(ye);var me=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class $e extends ${render(){return null==this.facets||0===this.facets.length?e.nothing:e.html`
|
|
725
|
+
|
|
726
|
+
<div class="ft-search-selected-facets--container">
|
|
727
|
+
${o.repeat(this.facets,(t=>t.key),(t=>{const i=this.getSelectedValues(t);return o.repeat(i,(i=>t.key+"-"+i),(o=>{let n=t.label+": "+this.getBreadcrumbFromValue(o);const s=t.key.replace(":","-");return e.html`
|
|
728
|
+
<ft-tooltip inline text="${n}"
|
|
729
|
+
part="tooltips tooltip-${s}">
|
|
730
|
+
<ft-chip
|
|
731
|
+
part="ft-search-selected-facets ft-search-selected-facet-${s}"
|
|
732
|
+
removable
|
|
733
|
+
label="${n}"
|
|
734
|
+
@icon-click=${()=>{var e;return null===(e=this.stateManager)||void 0===e?void 0:e.setFilter(t.key,i.filter((t=>t!==o)))}}
|
|
735
|
+
data-key="${t.key}"
|
|
736
|
+
data-value="${o}">
|
|
737
|
+
${this.getLabelFromValue(o)}
|
|
738
|
+
</ft-chip>
|
|
739
|
+
</ft-tooltip>
|
|
740
|
+
`}))}))}
|
|
741
|
+
</div>
|
|
742
|
+
`}getSelectedValues(t){return i.flatDeep(t.rootNodes,(t=>t.selected?[]:t.childNodes)).filter((t=>t.selected)).map((t=>t.value))}getLabelFromValue(t){return this.unquote(t).split("|").pop()}getBreadcrumbFromValue(t){return this.unquote(t).split("|").join(" > ")}quote(t){return`"${t}"`}unquote(t){return t.startsWith('"')&&t.endsWith('"')?t.replace(/(^"+)|("+$)/g,""):t}}$e.elementDefinitions={"ft-chip":ye,"ft-tooltip":qi},$e.styles=l,me([i.redux()],$e.prototype,"facets",void 0),i.customElement("ft-search-selected-facets")($e),t.FtSearchSelectedFacets=$e,t.FtSearchSelectedFacetsCssVariables=a,t.styles=l}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litRepeat,ftGlobals.litDecorators,ftGlobals.litClassMap,ftGlobals.litUnsafeHTML);
|