@fluid-topics/ft-text-field 2.2.4 → 2.2.5

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.
@@ -31,6 +31,7 @@ export declare class FtTextField extends FtTextField_base implements FtTextField
31
31
  password: boolean;
32
32
  autocomplete?: string;
33
33
  suggestionsProvider?: (query: string) => FtTextFieldSuggestionDefinition[] | Promise<FtTextFieldSuggestionDefinition[]>;
34
+ hideCurrentValueSuggestion: boolean;
34
35
  focused: boolean;
35
36
  inputValid: boolean;
36
37
  hidePassword: boolean;
@@ -52,6 +53,7 @@ export declare class FtTextField extends FtTextField_base implements FtTextField
52
53
  private renderPasswordIcon;
53
54
  private renderIcon;
54
55
  protected update(props: PropertyValues): void;
56
+ private cancelableSuggest?;
55
57
  private updateSuggestions;
56
58
  private filterSuggestionsIfNeeded;
57
59
  protected contentAvailableCallback(props: PropertyValues): void;
@@ -9,7 +9,7 @@ import { property, query, queryAll, queryAssignedElements, state, } from "lit/de
9
9
  import { repeat } from "lit/directives/repeat.js";
10
10
  import { classMap } from "lit/directives/class-map.js";
11
11
  import { ifDefined } from "lit/directives/if-defined.js";
12
- import { computeOffsetAutoPosition, FtLitElement, ignoreComposingEvents, noTextInputDefaultClearButton, numberProperty, toFtFormComponent, } from "@fluid-topics/ft-wc-utils";
12
+ import { cancelable, computeOffsetAutoPosition, FtLitElement, ignoreComposingEvents, noTextInputDefaultClearButton, numberProperty, toFtFormComponent, } from "@fluid-topics/ft-wc-utils";
13
13
  import { FtTypography, FtTypographyBody1, FtTypographyVariants, } from "@fluid-topics/ft-typography";
14
14
  import { FtInputLabel } from "@fluid-topics/ft-input-label";
15
15
  import { FtRipple } from "@fluid-topics/ft-ripple";
@@ -31,6 +31,7 @@ export class FtTextField extends toFtFormComponent(FtLitElement) {
31
31
  this.passwordRevealedIcon = FtIcons.EYE;
32
32
  this.filterSuggestions = false;
33
33
  this.password = false;
34
+ this.hideCurrentValueSuggestion = false;
34
35
  this.focused = false;
35
36
  this.inputValid = true;
36
37
  this.hidePassword = true;
@@ -118,18 +119,22 @@ export class FtTextField extends toFtFormComponent(FtLitElement) {
118
119
  ?disabled=${this.disabled}
119
120
  .value=${this.value}
120
121
  @click=${this.handleClick}
121
- @keydown=${this.handleInput}
122
- @keyup=${this.catchComposingEvents}
122
+ @keyup=${this.handleInput}
123
+ @keydown=${this.catchComposingEvents}
123
124
  @focus=${this.onFocus}
124
125
  />
125
126
  ${this.renderIcon()}
126
127
  </div>
127
128
  <div class="ft-text-field--suggestions"
129
+ part="suggestions"
128
130
  @suggestion-selected=${this.onSuggestionSelected}>
129
131
  ${this.renderSuggestions()}
130
- ${shouldDisplayQueryAsNewSuggestion
132
+ ${!this.hideCurrentValueSuggestion && shouldDisplayQueryAsNewSuggestion
131
133
  ? html `
132
- <ft-text-field-suggestion class="ft-text-field-suggestion--new-value" helper="${this.suggestionsHelper}">
134
+ <ft-text-field-suggestion
135
+ class="ft-text-field-suggestion--new-value"
136
+ part="suggestion current-value-suggestion"
137
+ helper="${this.suggestionsHelper}">
133
138
  ${this.value}
134
139
  </ft-text-field-suggestion>
135
140
  `
@@ -155,7 +160,7 @@ export class FtTextField extends toFtFormComponent(FtLitElement) {
155
160
  if (this.suggestionsProvider) {
156
161
  return html `
157
162
  ${repeat(this.providedSuggestions, (suggestion) => html `
158
- <ft-text-field-suggestion value="${suggestion.value}" @click=${(e) => this.onSuggestionClick(e, suggestion.clickHandler)}>
163
+ <ft-text-field-suggestion part="suggestion" value="${suggestion.value}" @click=${(e) => this.onSuggestionClick(e, suggestion.clickHandler)}>
159
164
  ${suggestion.icon ? html `
160
165
  <ft-icon .value=${suggestion.icon}></ft-icon>
161
166
  `
@@ -211,8 +216,18 @@ export class FtTextField extends toFtFormComponent(FtLitElement) {
211
216
  }
212
217
  }
213
218
  async updateSuggestions() {
219
+ var _a;
214
220
  if (this.suggestionsProvider) {
215
- this.providedSuggestions = await this.suggestionsProvider(this.value);
221
+ (_a = this.cancelableSuggest) === null || _a === void 0 ? void 0 : _a.cancel();
222
+ const result = this.suggestionsProvider(this.value);
223
+ if (result instanceof Promise) {
224
+ this.cancelableSuggest = cancelable(result);
225
+ this.providedSuggestions = await this.cancelableSuggest;
226
+ }
227
+ else {
228
+ this.cancelableSuggest = undefined;
229
+ this.providedSuggestions = result;
230
+ }
216
231
  }
217
232
  else {
218
233
  this.filterSuggestionsIfNeeded();
@@ -432,6 +447,9 @@ __decorate([
432
447
  __decorate([
433
448
  property({ attribute: false })
434
449
  ], FtTextField.prototype, "suggestionsProvider", void 0);
450
+ __decorate([
451
+ property({ type: Boolean })
452
+ ], FtTextField.prototype, "hideCurrentValueSuggestion", void 0);
435
453
  __decorate([
436
454
  state()
437
455
  ], FtTextField.prototype, "focused", void 0);
@@ -1,6 +1,6 @@
1
1
  "use strict";(()=>{var mi=Object.create;var Qe=Object.defineProperty;var yi=Object.getOwnPropertyDescriptor;var bi=Object.getOwnPropertyNames;var vi=Object.getPrototypeOf,Si=Object.prototype.hasOwnProperty;var te=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(i){throw t=0,i}};var _i=(e,t,i,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of bi(t))!Si.call(e,r)&&r!==i&&Qe(e,r,{get:()=>t[r],enumerable:!(o=yi(t,r))||o.enumerable});return e};var c=(e,t,i)=>(i=e!=null?mi(vi(e)):{},_i(t||!e||!e.__esModule?Qe(i,"default",{value:e,enumerable:!0}):i,e));var T=te((Ri,Je)=>{Je.exports=ftGlobals.wcUtils});var P=te((Li,Fe)=>{Fe.exports=ftGlobals.lit});var j=te((Ni,et)=>{et.exports=ftGlobals.litDecorators});var it=te((wi,tt)=>{tt.exports=ftGlobals.litRepeat});var ue=te((Pi,ot)=>{ot.exports=ftGlobals.litClassMap});var ii=te((zo,ti)=>{ti.exports=ftGlobals.litUnsafeHTML});var gi=c(T());var C=c(P()),g=c(j()),ui=c(it()),ci=c(ue());var Ue=globalThis,rt=e=>e,Ee=Ue.trustedTypes,nt=Ee?Ee.createPolicy("lit-html",{createHTML:e=>e}):void 0,dt="$lit$",Y=`lit$${Math.random().toFixed(9).slice(2)}$`,ht="?"+Y,Ai=`<${ht}>`,Q=document,$e=()=>Q.createComment(""),xe=e=>e===null||typeof e!="object"&&typeof e!="function",Ve=Array.isArray,Ei=e=>Ve(e)||typeof e?.[Symbol.iterator]=="function",De=`[
2
2
  \f\r]`,ce=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,lt=/>/g,I=RegExp(`>|${De}(?:([^\\s"'>=/]+)(${De}*=${De}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),at=/'/g,pt=/"/g,ut=/^(?:script|style|textarea|title)$/i,ke=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),ct=ke(1),xt=ke(2),gt=ke(3),ge=Symbol.for("lit-noChange"),A=Symbol.for("lit-nothing"),ft=new WeakMap,q=Q.createTreeWalker(Q,129);function mt(e,t){if(!Ve(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return nt!==void 0?nt.createHTML(t):t}var $i=(e,t)=>{let i=e.length-1,o=[],r,n=t===2?"<svg>":t===3?"<math>":"",s=ce;for(let f=0;f<i;f++){let u=e[f],b,$,v=-1,V=0;for(;V<u.length&&(s.lastIndex=V,$=s.exec(u),$!==null);)V=s.lastIndex,s===ce?$[1]==="!--"?s=st:$[1]!==void 0?s=lt:$[2]!==void 0?(ut.test($[2])&&(r=RegExp("</"+$[2],"g")),s=I):$[3]!==void 0&&(s=I):s===I?$[0]===">"?(s=r??ce,v=-1):$[1]===void 0?v=-2:(v=s.lastIndex-$[2].length,b=$[1],s=$[3]===void 0?I:$[3]==='"'?pt:at):s===pt||s===at?s=I:s===st||s===lt?s=ce:(s=I,r=void 0);let K=s===I&&e[f+1].startsWith("/>")?" ":"";n+=s===ce?u+Ai:v>=0?(o.push(b),u.slice(0,v)+dt+u.slice(v)+Y+K):u+Y+(v===-2?f:K)}return[mt(e,n+(e[i]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),o]},me=class e{constructor({strings:t,_$litType$:i},o){let r;this.parts=[];let n=0,s=0,f=t.length-1,u=this.parts,[b,$]=$i(t,i);if(this.el=e.createElement(b,o),q.currentNode=this.el.content,i===2||i===3){let v=this.el.content.firstChild;v.replaceWith(...v.childNodes)}for(;(r=q.nextNode())!==null&&u.length<f;){if(r.nodeType===1){if(r.hasAttributes())for(let v of r.getAttributeNames())if(v.endsWith(dt)){let V=$[s++],K=r.getAttribute(v).split(Y),Ae=/([.?@])?(.*)/.exec(V);u.push({type:1,index:n,name:Ae[2],strings:K,ctor:Ae[1]==="."?Me:Ae[1]==="?"?Be:Ae[1]==="@"?ze:oe}),r.removeAttribute(v)}else v.startsWith(Y)&&(u.push({type:6,index:n}),r.removeAttribute(v));if(ut.test(r.tagName)){let v=r.textContent.split(Y),V=v.length-1;if(V>0){r.textContent=Ee?Ee.emptyScript:"";for(let K=0;K<V;K++)r.append(v[K],$e()),q.nextNode(),u.push({type:2,index:++n});r.append(v[V],$e())}}}else if(r.nodeType===8)if(r.data===ht)u.push({type:2,index:n});else{let v=-1;for(;(v=r.data.indexOf(Y,v+1))!==-1;)u.push({type:7,index:n}),v+=Y.length-1}n++}}static createElement(t,i){let o=Q.createElement("template");return o.innerHTML=t,o}};function ie(e,t,i=e,o){if(t===ge)return t;let r=o!==void 0?i._$Co?.[o]:i._$Cl,n=xe(t)?void 0:t._$litDirective$;return r?.constructor!==n&&(r?._$AO?.(!1),n===void 0?r=void 0:(r=new n(e),r._$AT(e,i,o)),o!==void 0?(i._$Co??=[])[o]=r:i._$Cl=r),r!==void 0&&(t=ie(e,r._$AS(e,t.values),r,o)),t}var He=class{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){let{el:{content:i},parts:o}=this._$AD,r=(t?.creationScope??Q).importNode(i,!0);q.currentNode=r;let n=q.nextNode(),s=0,f=0,u=o[0];for(;u!==void 0;){if(s===u.index){let b;u.type===2?b=new Ce(n,n.nextSibling,this,t):u.type===1?b=new u.ctor(n,u.name,u.strings,this,t):u.type===6&&(b=new We(n,this,t)),this._$AV.push(b),u=o[++f]}s!==u?.index&&(n=q.nextNode(),s++)}return q.currentNode=Q,r}p(t){let i=0;for(let o of this._$AV)o!==void 0&&(o.strings!==void 0?(o._$AI(t,o,i),i+=o.strings.length-2):o._$AI(t[i])),i++}},Ce=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,o,r){this.type=2,this._$AH=A,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=o,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,i=this._$AM;return i!==void 0&&t?.nodeType===11&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=ie(this,t,i),xe(t)?t===A||t==null||t===""?(this._$AH!==A&&this._$AR(),this._$AH=A):t!==this._$AH&&t!==ge&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Ei(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==A&&xe(this._$AH)?this._$AA.nextSibling.data=t:this.T(Q.createTextNode(t)),this._$AH=t}$(t){let{values:i,_$litType$:o}=t,r=typeof o=="number"?this._$AC(t):(o.el===void 0&&(o.el=me.createElement(mt(o.h,o.h[0]),this.options)),o);if(this._$AH?._$AD===r)this._$AH.p(i);else{let n=new He(r,this),s=n.u(this.options);n.p(i),this.T(s),this._$AH=n}}_$AC(t){let i=ft.get(t.strings);return i===void 0&&ft.set(t.strings,i=new me(t)),i}k(t){Ve(this._$AH)||(this._$AH=[],this._$AR());let i=this._$AH,o,r=0;for(let n of t)r===i.length?i.push(o=new e(this.O($e()),this.O($e()),this,this.options)):o=i[r],o._$AI(n),r++;r<i.length&&(this._$AR(o&&o._$AB.nextSibling,r),i.length=r)}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(!1,!0,i);t!==this._$AB;){let o=rt(t).nextSibling;rt(t).remove(),t=o}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},oe=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,o,r,n){this.type=1,this._$AH=A,this._$AN=void 0,this.element=t,this.name=i,this._$AM=r,this.options=n,o.length>2||o[0]!==""||o[1]!==""?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=A}_$AI(t,i=this,o,r){let n=this.strings,s=!1;if(n===void 0)t=ie(this,t,i,0),s=!xe(t)||t!==this._$AH&&t!==ge,s&&(this._$AH=t);else{let f=t,u,b;for(t=n[0],u=0;u<n.length-1;u++)b=ie(this,f[o+u],i,u),b===ge&&(b=this._$AH[u]),s||=!xe(b)||b!==this._$AH[u],b===A?t=A:t!==A&&(t+=(b??"")+n[u+1]),this._$AH[u]=b}s&&!r&&this.j(t)}j(t){t===A?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},Me=class extends oe{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===A?void 0:t}},Be=class extends oe{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==A)}},ze=class extends oe{constructor(t,i,o,r,n){super(t,i,o,r,n),this.type=5}_$AI(t,i=this){if((t=ie(this,t,i,0)??A)===ge)return;let o=this._$AH,r=t===A&&o!==A||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==A&&(o===A||r);r&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},We=class{constructor(t,i,o){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=o}get _$AU(){return this._$AM._$AU}_$AI(t){ie(this,t)}};var Ci=Ue.litHtmlPolyfillSupport;Ci?.(me,Ce),(Ue.litHtmlVersions??=[]).push("3.3.3");var ye=e=>e??A;var w=c(T());var bt=Symbol.for(""),Ti=e=>{if(e?.r===bt)return e?._$litStatic$},Ge=e=>({_$litStatic$:e,r:bt});var yt=new Map,Ke=e=>(t,...i)=>{let o=i.length,r,n,s=[],f=[],u,b=0,$=!1;for(;b<o;){for(u=t[b];b<o&&(n=i[b],(r=Ti(n))!==void 0);)u+=r+t[++b],$=!0;b!==o&&f.push(n),s.push(u),b++}if(b===o&&s.push(t[o]),$){let v=s.join("$$lit$$");(t=yt.get(v))===void 0&&(s.raw=s,yt.set(v,t=s)),i=f}return e(t,...i)},je=Ke(ct),Ui=Ke(xt),Vi=Ke(gt);var Ye=c(j()),Nt=c(T());var re;(function(e){e.title="title",e.title_dense="title-dense",e.subtitle1="subtitle1",e.subtitle2="subtitle2",e.body1="body1",e.body2="body2",e.caption="caption",e.breadcrumb="breadcrumb",e.overline="overline",e.button="button"})(re||(re={}));var D=c(P()),a=c(T()),vt=a.FtCssVariableFactory.extend("--ft-typography-font-family","",a.designSystemVariables.titleFont),G=a.FtCssVariableFactory.extend("--ft-typography-font-family","",a.designSystemVariables.contentFont),p={fontFamily:G,fontSize:a.FtCssVariableFactory.create("--ft-typography-font-size","","SIZE","16px"),fontWeight:a.FtCssVariableFactory.create("--ft-typography-font-weight","","UNKNOWN","normal"),letterSpacing:a.FtCssVariableFactory.create("--ft-typography-letter-spacing","","SIZE","0.496px"),lineHeight:a.FtCssVariableFactory.create("--ft-typography-line-height","","NUMBER","1.5"),textTransform:a.FtCssVariableFactory.create("--ft-typography-text-transform","","UNKNOWN","inherit")},ne={fontFamily:a.FtCssVariableFactory.extend("--ft-typography-title-font-family","",vt),fontSize:a.FtCssVariableFactory.extend("--ft-typography-title-font-size","",p.fontSize,"20px"),fontWeight:a.FtCssVariableFactory.extend("--ft-typography-title-font-weight","",p.fontWeight,"normal"),letterSpacing:a.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing","",p.letterSpacing,"0.15px"),lineHeight:a.FtCssVariableFactory.extend("--ft-typography-title-line-height","",p.lineHeight,"1.2"),textTransform:a.FtCssVariableFactory.extend("--ft-typography-title-text-transform","",p.textTransform,"inherit")},se={fontFamily:a.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family","",vt),fontSize:a.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size","",p.fontSize,"14px"),fontWeight:a.FtCssVariableFactory.extend("--ft-typography-title-dense-font-weight","",p.fontWeight,"normal"),letterSpacing:a.FtCssVariableFactory.extend("--ft-typography-title-dense-letter-spacing","",p.letterSpacing,"0.105px"),lineHeight:a.FtCssVariableFactory.extend("--ft-typography-title-dense-line-height","",p.lineHeight,"1.7"),textTransform:a.FtCssVariableFactory.extend("--ft-typography-title-dense-text-transform","",p.textTransform,"inherit")},le={fontFamily:a.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-family","",G),fontSize:a.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-size","",p.fontSize,"16px"),fontWeight:a.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-weight","",p.fontWeight,"600"),letterSpacing:a.FtCssVariableFactory.extend("--ft-typography-subtitle1-letter-spacing","",p.letterSpacing,"0.144px"),lineHeight:a.FtCssVariableFactory.extend("--ft-typography-subtitle1-line-height","",p.lineHeight,"1.5"),textTransform:a.FtCssVariableFactory.extend("--ft-typography-subtitle1-text-transform","",p.textTransform,"inherit")},ae={fontFamily:a.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-family","",G),fontSize:a.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-size","",p.fontSize,"14px"),fontWeight:a.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-weight","",p.fontWeight,"normal"),letterSpacing:a.FtCssVariableFactory.extend("--ft-typography-subtitle2-letter-spacing","",p.letterSpacing,"0.098px"),lineHeight:a.FtCssVariableFactory.extend("--ft-typography-subtitle2-line-height","",p.lineHeight,"1.7"),textTransform:a.FtCssVariableFactory.extend("--ft-typography-subtitle2-text-transform","",p.textTransform,"inherit")},k={fontFamily:a.FtCssVariableFactory.extend("--ft-typography-body1-font-family","",G),fontSize:a.FtCssVariableFactory.extend("--ft-typography-body1-font-size","",p.fontSize,"16px"),fontWeight:a.FtCssVariableFactory.extend("--ft-typography-body1-font-weight","",p.fontWeight,"normal"),letterSpacing:a.FtCssVariableFactory.extend("--ft-typography-body1-letter-spacing","",p.letterSpacing,"0.496px"),lineHeight:a.FtCssVariableFactory.extend("--ft-typography-body1-line-height","",p.lineHeight,"1.5"),textTransform:a.FtCssVariableFactory.extend("--ft-typography-body1-text-transform","",p.textTransform,"inherit")},pe={fontFamily:a.FtCssVariableFactory.extend("--ft-typography-body2-font-family","",G),fontSize:a.FtCssVariableFactory.extend("--ft-typography-body2-font-size","",p.fontSize,"14px"),fontWeight:a.FtCssVariableFactory.extend("--ft-typography-body2-font-weight","",p.fontWeight,"normal"),letterSpacing:a.FtCssVariableFactory.extend("--ft-typography-body2-letter-spacing","",p.letterSpacing,"0.252px"),lineHeight:a.FtCssVariableFactory.extend("--ft-typography-body2-line-height","",p.lineHeight,"1.4"),textTransform:a.FtCssVariableFactory.extend("--ft-typography-body2-text-transform","",p.textTransform,"inherit")},N={fontFamily:a.FtCssVariableFactory.extend("--ft-typography-caption-font-family","",G),fontSize:a.FtCssVariableFactory.extend("--ft-typography-caption-font-size","",p.fontSize,"12px"),fontWeight:a.FtCssVariableFactory.extend("--ft-typography-caption-font-weight","",p.fontWeight,"normal"),letterSpacing:a.FtCssVariableFactory.extend("--ft-typography-caption-letter-spacing","",p.letterSpacing,"0.396px"),lineHeight:a.FtCssVariableFactory.extend("--ft-typography-caption-line-height","",p.lineHeight,"1.33"),textTransform:a.FtCssVariableFactory.extend("--ft-typography-caption-text-transform","",p.textTransform,"inherit")},fe={fontFamily:a.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-family","",G),fontSize:a.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-size","",p.fontSize,"10px"),fontWeight:a.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-weight","",p.fontWeight,"normal"),letterSpacing:a.FtCssVariableFactory.extend("--ft-typography-breadcrumb-letter-spacing","",p.letterSpacing,"0.33px"),lineHeight:a.FtCssVariableFactory.extend("--ft-typography-breadcrumb-line-height","",p.lineHeight,"1.6"),textTransform:a.FtCssVariableFactory.extend("--ft-typography-breadcrumb-text-transform","",p.textTransform,"inherit")},de={fontFamily:a.FtCssVariableFactory.extend("--ft-typography-overline-font-family","",G),fontSize:a.FtCssVariableFactory.extend("--ft-typography-overline-font-size","",p.fontSize,"10px"),fontWeight:a.FtCssVariableFactory.extend("--ft-typography-overline-font-weight","",p.fontWeight,"normal"),letterSpacing:a.FtCssVariableFactory.extend("--ft-typography-overline-letter-spacing","",p.letterSpacing,"1.5px"),lineHeight:a.FtCssVariableFactory.extend("--ft-typography-overline-line-height","",p.lineHeight,"1.6"),textTransform:a.FtCssVariableFactory.extend("--ft-typography-overline-text-transform","",p.textTransform,"uppercase")},he={fontFamily:a.FtCssVariableFactory.extend("--ft-typography-button-font-family","",G),fontSize:a.FtCssVariableFactory.extend("--ft-typography-button-font-size","",p.fontSize,"14px"),fontWeight:a.FtCssVariableFactory.extend("--ft-typography-button-font-weight","",p.fontWeight,"600"),letterSpacing:a.FtCssVariableFactory.extend("--ft-typography-button-letter-spacing","",p.letterSpacing,"1.246px"),lineHeight:a.FtCssVariableFactory.extend("--ft-typography-button-line-height","",p.lineHeight,"1.15"),textTransform:a.FtCssVariableFactory.extend("--ft-typography-button-text-transform","",p.textTransform,"uppercase")},St=D.css`
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),at=/'/g,pt=/"/g,ut=/^(?:script|style|textarea|title)$/i,ke=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),ct=ke(1),xt=ke(2),gt=ke(3),ge=Symbol.for("lit-noChange"),A=Symbol.for("lit-nothing"),ft=new WeakMap,q=Q.createTreeWalker(Q,129);function mt(e,t){if(!Ve(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return nt!==void 0?nt.createHTML(t):t}var $i=(e,t)=>{let i=e.length-1,o=[],r,n=t===2?"<svg>":t===3?"<math>":"",s=ce;for(let f=0;f<i;f++){let u=e[f],b,$,v=-1,V=0;for(;V<u.length&&(s.lastIndex=V,$=s.exec(u),$!==null);)V=s.lastIndex,s===ce?$[1]==="!--"?s=st:$[1]!==void 0?s=lt:$[2]!==void 0?(ut.test($[2])&&(r=RegExp("</"+$[2],"g")),s=I):$[3]!==void 0&&(s=I):s===I?$[0]===">"?(s=r??ce,v=-1):$[1]===void 0?v=-2:(v=s.lastIndex-$[2].length,b=$[1],s=$[3]===void 0?I:$[3]==='"'?pt:at):s===pt||s===at?s=I:s===st||s===lt?s=ce:(s=I,r=void 0);let K=s===I&&e[f+1].startsWith("/>")?" ":"";n+=s===ce?u+Ai:v>=0?(o.push(b),u.slice(0,v)+dt+u.slice(v)+Y+K):u+Y+(v===-2?f:K)}return[mt(e,n+(e[i]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),o]},me=class e{constructor({strings:t,_$litType$:i},o){let r;this.parts=[];let n=0,s=0,f=t.length-1,u=this.parts,[b,$]=$i(t,i);if(this.el=e.createElement(b,o),q.currentNode=this.el.content,i===2||i===3){let v=this.el.content.firstChild;v.replaceWith(...v.childNodes)}for(;(r=q.nextNode())!==null&&u.length<f;){if(r.nodeType===1){if(r.hasAttributes())for(let v of r.getAttributeNames())if(v.endsWith(dt)){let V=$[s++],K=r.getAttribute(v).split(Y),Ae=/([.?@])?(.*)/.exec(V);u.push({type:1,index:n,name:Ae[2],strings:K,ctor:Ae[1]==="."?Me:Ae[1]==="?"?Be:Ae[1]==="@"?ze:oe}),r.removeAttribute(v)}else v.startsWith(Y)&&(u.push({type:6,index:n}),r.removeAttribute(v));if(ut.test(r.tagName)){let v=r.textContent.split(Y),V=v.length-1;if(V>0){r.textContent=Ee?Ee.emptyScript:"";for(let K=0;K<V;K++)r.append(v[K],$e()),q.nextNode(),u.push({type:2,index:++n});r.append(v[V],$e())}}}else if(r.nodeType===8)if(r.data===ht)u.push({type:2,index:n});else{let v=-1;for(;(v=r.data.indexOf(Y,v+1))!==-1;)u.push({type:7,index:n}),v+=Y.length-1}n++}}static createElement(t,i){let o=Q.createElement("template");return o.innerHTML=t,o}};function ie(e,t,i=e,o){if(t===ge)return t;let r=o!==void 0?i._$Co?.[o]:i._$Cl,n=xe(t)?void 0:t._$litDirective$;return r?.constructor!==n&&(r?._$AO?.(!1),n===void 0?r=void 0:(r=new n(e),r._$AT(e,i,o)),o!==void 0?(i._$Co??=[])[o]=r:i._$Cl=r),r!==void 0&&(t=ie(e,r._$AS(e,t.values),r,o)),t}var He=class{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){let{el:{content:i},parts:o}=this._$AD,r=(t?.creationScope??Q).importNode(i,!0);q.currentNode=r;let n=q.nextNode(),s=0,f=0,u=o[0];for(;u!==void 0;){if(s===u.index){let b;u.type===2?b=new Ce(n,n.nextSibling,this,t):u.type===1?b=new u.ctor(n,u.name,u.strings,this,t):u.type===6&&(b=new We(n,this,t)),this._$AV.push(b),u=o[++f]}s!==u?.index&&(n=q.nextNode(),s++)}return q.currentNode=Q,r}p(t){let i=0;for(let o of this._$AV)o!==void 0&&(o.strings!==void 0?(o._$AI(t,o,i),i+=o.strings.length-2):o._$AI(t[i])),i++}},Ce=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,o,r){this.type=2,this._$AH=A,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=o,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,i=this._$AM;return i!==void 0&&t?.nodeType===11&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=ie(this,t,i),xe(t)?t===A||t==null||t===""?(this._$AH!==A&&this._$AR(),this._$AH=A):t!==this._$AH&&t!==ge&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Ei(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==A&&xe(this._$AH)?this._$AA.nextSibling.data=t:this.T(Q.createTextNode(t)),this._$AH=t}$(t){let{values:i,_$litType$:o}=t,r=typeof o=="number"?this._$AC(t):(o.el===void 0&&(o.el=me.createElement(mt(o.h,o.h[0]),this.options)),o);if(this._$AH?._$AD===r)this._$AH.p(i);else{let n=new He(r,this),s=n.u(this.options);n.p(i),this.T(s),this._$AH=n}}_$AC(t){let i=ft.get(t.strings);return i===void 0&&ft.set(t.strings,i=new me(t)),i}k(t){Ve(this._$AH)||(this._$AH=[],this._$AR());let i=this._$AH,o,r=0;for(let n of t)r===i.length?i.push(o=new e(this.O($e()),this.O($e()),this,this.options)):o=i[r],o._$AI(n),r++;r<i.length&&(this._$AR(o&&o._$AB.nextSibling,r),i.length=r)}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(!1,!0,i);t!==this._$AB;){let o=rt(t).nextSibling;rt(t).remove(),t=o}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},oe=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,o,r,n){this.type=1,this._$AH=A,this._$AN=void 0,this.element=t,this.name=i,this._$AM=r,this.options=n,o.length>2||o[0]!==""||o[1]!==""?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=A}_$AI(t,i=this,o,r){let n=this.strings,s=!1;if(n===void 0)t=ie(this,t,i,0),s=!xe(t)||t!==this._$AH&&t!==ge,s&&(this._$AH=t);else{let f=t,u,b;for(t=n[0],u=0;u<n.length-1;u++)b=ie(this,f[o+u],i,u),b===ge&&(b=this._$AH[u]),s||=!xe(b)||b!==this._$AH[u],b===A?t=A:t!==A&&(t+=(b??"")+n[u+1]),this._$AH[u]=b}s&&!r&&this.j(t)}j(t){t===A?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},Me=class extends oe{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===A?void 0:t}},Be=class extends oe{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==A)}},ze=class extends oe{constructor(t,i,o,r,n){super(t,i,o,r,n),this.type=5}_$AI(t,i=this){if((t=ie(this,t,i,0)??A)===ge)return;let o=this._$AH,r=t===A&&o!==A||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==A&&(o===A||r);r&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},We=class{constructor(t,i,o){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=o}get _$AU(){return this._$AM._$AU}_$AI(t){ie(this,t)}};var Ci=Ue.litHtmlPolyfillSupport;Ci?.(me,Ce),(Ue.litHtmlVersions??=[]).push("3.3.3");var ye=e=>e??A;var L=c(T());var bt=Symbol.for(""),Ti=e=>{if(e?.r===bt)return e?._$litStatic$},Ge=e=>({_$litStatic$:e,r:bt});var yt=new Map,Ke=e=>(t,...i)=>{let o=i.length,r,n,s=[],f=[],u,b=0,$=!1;for(;b<o;){for(u=t[b];b<o&&(n=i[b],(r=Ti(n))!==void 0);)u+=r+t[++b],$=!0;b!==o&&f.push(n),s.push(u),b++}if(b===o&&s.push(t[o]),$){let v=s.join("$$lit$$");(t=yt.get(v))===void 0&&(s.raw=s,yt.set(v,t=s)),i=f}return e(t,...i)},je=Ke(ct),Ui=Ke(xt),Vi=Ke(gt);var Ye=c(j()),Nt=c(T());var re;(function(e){e.title="title",e.title_dense="title-dense",e.subtitle1="subtitle1",e.subtitle2="subtitle2",e.body1="body1",e.body2="body2",e.caption="caption",e.breadcrumb="breadcrumb",e.overline="overline",e.button="button"})(re||(re={}));var D=c(P()),a=c(T()),vt=a.FtCssVariableFactory.extend("--ft-typography-font-family","",a.designSystemVariables.titleFont),G=a.FtCssVariableFactory.extend("--ft-typography-font-family","",a.designSystemVariables.contentFont),p={fontFamily:G,fontSize:a.FtCssVariableFactory.create("--ft-typography-font-size","","SIZE","16px"),fontWeight:a.FtCssVariableFactory.create("--ft-typography-font-weight","","UNKNOWN","normal"),letterSpacing:a.FtCssVariableFactory.create("--ft-typography-letter-spacing","","SIZE","0.496px"),lineHeight:a.FtCssVariableFactory.create("--ft-typography-line-height","","NUMBER","1.5"),textTransform:a.FtCssVariableFactory.create("--ft-typography-text-transform","","UNKNOWN","inherit")},ne={fontFamily:a.FtCssVariableFactory.extend("--ft-typography-title-font-family","",vt),fontSize:a.FtCssVariableFactory.extend("--ft-typography-title-font-size","",p.fontSize,"20px"),fontWeight:a.FtCssVariableFactory.extend("--ft-typography-title-font-weight","",p.fontWeight,"normal"),letterSpacing:a.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing","",p.letterSpacing,"0.15px"),lineHeight:a.FtCssVariableFactory.extend("--ft-typography-title-line-height","",p.lineHeight,"1.2"),textTransform:a.FtCssVariableFactory.extend("--ft-typography-title-text-transform","",p.textTransform,"inherit")},se={fontFamily:a.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family","",vt),fontSize:a.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size","",p.fontSize,"14px"),fontWeight:a.FtCssVariableFactory.extend("--ft-typography-title-dense-font-weight","",p.fontWeight,"normal"),letterSpacing:a.FtCssVariableFactory.extend("--ft-typography-title-dense-letter-spacing","",p.letterSpacing,"0.105px"),lineHeight:a.FtCssVariableFactory.extend("--ft-typography-title-dense-line-height","",p.lineHeight,"1.7"),textTransform:a.FtCssVariableFactory.extend("--ft-typography-title-dense-text-transform","",p.textTransform,"inherit")},le={fontFamily:a.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-family","",G),fontSize:a.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-size","",p.fontSize,"16px"),fontWeight:a.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-weight","",p.fontWeight,"600"),letterSpacing:a.FtCssVariableFactory.extend("--ft-typography-subtitle1-letter-spacing","",p.letterSpacing,"0.144px"),lineHeight:a.FtCssVariableFactory.extend("--ft-typography-subtitle1-line-height","",p.lineHeight,"1.5"),textTransform:a.FtCssVariableFactory.extend("--ft-typography-subtitle1-text-transform","",p.textTransform,"inherit")},ae={fontFamily:a.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-family","",G),fontSize:a.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-size","",p.fontSize,"14px"),fontWeight:a.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-weight","",p.fontWeight,"normal"),letterSpacing:a.FtCssVariableFactory.extend("--ft-typography-subtitle2-letter-spacing","",p.letterSpacing,"0.098px"),lineHeight:a.FtCssVariableFactory.extend("--ft-typography-subtitle2-line-height","",p.lineHeight,"1.7"),textTransform:a.FtCssVariableFactory.extend("--ft-typography-subtitle2-text-transform","",p.textTransform,"inherit")},k={fontFamily:a.FtCssVariableFactory.extend("--ft-typography-body1-font-family","",G),fontSize:a.FtCssVariableFactory.extend("--ft-typography-body1-font-size","",p.fontSize,"16px"),fontWeight:a.FtCssVariableFactory.extend("--ft-typography-body1-font-weight","",p.fontWeight,"normal"),letterSpacing:a.FtCssVariableFactory.extend("--ft-typography-body1-letter-spacing","",p.letterSpacing,"0.496px"),lineHeight:a.FtCssVariableFactory.extend("--ft-typography-body1-line-height","",p.lineHeight,"1.5"),textTransform:a.FtCssVariableFactory.extend("--ft-typography-body1-text-transform","",p.textTransform,"inherit")},pe={fontFamily:a.FtCssVariableFactory.extend("--ft-typography-body2-font-family","",G),fontSize:a.FtCssVariableFactory.extend("--ft-typography-body2-font-size","",p.fontSize,"14px"),fontWeight:a.FtCssVariableFactory.extend("--ft-typography-body2-font-weight","",p.fontWeight,"normal"),letterSpacing:a.FtCssVariableFactory.extend("--ft-typography-body2-letter-spacing","",p.letterSpacing,"0.252px"),lineHeight:a.FtCssVariableFactory.extend("--ft-typography-body2-line-height","",p.lineHeight,"1.4"),textTransform:a.FtCssVariableFactory.extend("--ft-typography-body2-text-transform","",p.textTransform,"inherit")},w={fontFamily:a.FtCssVariableFactory.extend("--ft-typography-caption-font-family","",G),fontSize:a.FtCssVariableFactory.extend("--ft-typography-caption-font-size","",p.fontSize,"12px"),fontWeight:a.FtCssVariableFactory.extend("--ft-typography-caption-font-weight","",p.fontWeight,"normal"),letterSpacing:a.FtCssVariableFactory.extend("--ft-typography-caption-letter-spacing","",p.letterSpacing,"0.396px"),lineHeight:a.FtCssVariableFactory.extend("--ft-typography-caption-line-height","",p.lineHeight,"1.33"),textTransform:a.FtCssVariableFactory.extend("--ft-typography-caption-text-transform","",p.textTransform,"inherit")},fe={fontFamily:a.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-family","",G),fontSize:a.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-size","",p.fontSize,"10px"),fontWeight:a.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-weight","",p.fontWeight,"normal"),letterSpacing:a.FtCssVariableFactory.extend("--ft-typography-breadcrumb-letter-spacing","",p.letterSpacing,"0.33px"),lineHeight:a.FtCssVariableFactory.extend("--ft-typography-breadcrumb-line-height","",p.lineHeight,"1.6"),textTransform:a.FtCssVariableFactory.extend("--ft-typography-breadcrumb-text-transform","",p.textTransform,"inherit")},de={fontFamily:a.FtCssVariableFactory.extend("--ft-typography-overline-font-family","",G),fontSize:a.FtCssVariableFactory.extend("--ft-typography-overline-font-size","",p.fontSize,"10px"),fontWeight:a.FtCssVariableFactory.extend("--ft-typography-overline-font-weight","",p.fontWeight,"normal"),letterSpacing:a.FtCssVariableFactory.extend("--ft-typography-overline-letter-spacing","",p.letterSpacing,"1.5px"),lineHeight:a.FtCssVariableFactory.extend("--ft-typography-overline-line-height","",p.lineHeight,"1.6"),textTransform:a.FtCssVariableFactory.extend("--ft-typography-overline-text-transform","",p.textTransform,"uppercase")},he={fontFamily:a.FtCssVariableFactory.extend("--ft-typography-button-font-family","",G),fontSize:a.FtCssVariableFactory.extend("--ft-typography-button-font-size","",p.fontSize,"14px"),fontWeight:a.FtCssVariableFactory.extend("--ft-typography-button-font-weight","",p.fontWeight,"600"),letterSpacing:a.FtCssVariableFactory.extend("--ft-typography-button-letter-spacing","",p.letterSpacing,"1.246px"),lineHeight:a.FtCssVariableFactory.extend("--ft-typography-button-line-height","",p.lineHeight,"1.15"),textTransform:a.FtCssVariableFactory.extend("--ft-typography-button-text-transform","",p.textTransform,"uppercase")},St=D.css`
4
4
  .ft-typography--title {
5
5
  font-family: ${ne.fontFamily};
6
6
  font-size: ${ne.fontSize};
@@ -57,12 +57,12 @@
57
57
  }
58
58
  `,Oe=D.css`
59
59
  .ft-typography--caption {
60
- font-family: ${N.fontFamily};
61
- font-size: ${N.fontSize};
62
- font-weight: ${N.fontWeight};
63
- letter-spacing: ${N.letterSpacing};
64
- line-height: ${N.lineHeight};
65
- text-transform: ${N.textTransform};
60
+ font-family: ${w.fontFamily};
61
+ font-size: ${w.fontSize};
62
+ font-weight: ${w.fontWeight};
63
+ letter-spacing: ${w.letterSpacing};
64
+ line-height: ${w.lineHeight};
65
+ text-transform: ${w.textTransform};
66
66
  }
67
67
  `,Ct=D.css`
68
68
  .ft-typography--breadcrumb {
@@ -154,8 +154,8 @@
154
154
  transition: font-size 250ms, line-height 250ms, color 250ms;
155
155
  max-width: calc(${m.labelMaxWidth} - 2 * (${m.horizontalSpacing} - 4px)); /* -2px on spacing for label padding */
156
156
  text-overflow: ellipsis;
157
- ${(0,S.setVariable)(N.fontSize,m.fontSize)};
158
- ${(0,S.setVariable)(N.lineHeight,m.fontSize)};
157
+ ${(0,S.setVariable)(w.fontSize,m.fontSize)};
158
+ ${(0,S.setVariable)(w.lineHeight,m.fontSize)};
159
159
  }
160
160
 
161
161
  .ft-input-label--in-error .ft-input-label--text {
@@ -175,7 +175,7 @@
175
175
 
176
176
  .ft-input-label--floating-text {
177
177
  position: absolute;
178
- top: calc(50% - ${N.lineHeight} / 2);
178
+ top: calc(50% - ${w.lineHeight} / 2);
179
179
  transition: top 250ms;
180
180
  overflow: hidden;
181
181
  white-space: nowrap;
@@ -187,8 +187,8 @@
187
187
  }
188
188
 
189
189
  .ft-input-label--raised .ft-input-label--text {
190
- ${(0,S.setVariable)(N.fontSize,m.raisedFontSize)};
191
- ${(0,S.setVariable)(N.lineHeight,m.raisedFontSize)};
190
+ ${(0,S.setVariable)(w.fontSize,m.raisedFontSize)};
191
+ ${(0,S.setVariable)(w.lineHeight,m.raisedFontSize)};
192
192
  }
193
193
 
194
194
  .ft-input-label--raised .ft-input-label--floating-text {
@@ -219,7 +219,7 @@
219
219
  z-index: ${m.raisedZIndex};
220
220
  background-color: ${m.backgroundColor};
221
221
  border-radius: ${m.borderRadius};
222
- top: calc((${N.lineHeight} / -2) + 2px);
222
+ top: calc((${w.lineHeight} / -2) + 2px);
223
223
  }
224
224
 
225
225
  .ft-input-label--outlined.ft-input-label--raised .ft-input-label--text {
@@ -346,7 +346,7 @@
346
346
  opacity: ${U.opacityContentOnSurfacePressed};
347
347
  transform: translate(-50%, -50%) scale(1);
348
348
  }
349
- `;var L=function(e,t,i,o){var r=arguments.length,n=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,o);else for(var f=e.length-1;f>=0;f--)(s=e[f])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n},_=class extends be.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.originX=0,this.originY=0,this.debouncer=new be.Debouncer(1e3),this.onTransitionStart=t=>{t.propertyName==="transform"&&(this.rippling=this.pressed,this.debouncer.run(()=>this.rippling=!1))},this.onTransitionEnd=t=>{t.propertyName==="transform"&&(this.rippling=!1)},this.setupDebouncer=new be.Debouncer(10),this.moveRipple=t=>{var i,o;let{x:r,y:n}=this.getCoordinates(t),s=(o=(i=this.ripple)===null||i===void 0?void 0:i.getBoundingClientRect())!==null&&o!==void 0?o:{x:0,y:0,width:0,height:0};this.originX=Math.round(r!=null?r-s.x:s.width/2),this.originY=Math.round(n!=null?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.isFocusVisible(t?.target)&&!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 It.html`
349
+ `;var N=function(e,t,i,o){var r=arguments.length,n=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,o);else for(var f=e.length-1;f>=0;f--)(s=e[f])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n},_=class extends be.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.originX=0,this.originY=0,this.debouncer=new be.Debouncer(1e3),this.onTransitionStart=t=>{t.propertyName==="transform"&&(this.rippling=this.pressed,this.debouncer.run(()=>this.rippling=!1))},this.onTransitionEnd=t=>{t.propertyName==="transform"&&(this.rippling=!1)},this.setupDebouncer=new be.Debouncer(10),this.moveRipple=t=>{var i,o;let{x:r,y:n}=this.getCoordinates(t),s=(o=(i=this.ripple)===null||i===void 0?void 0:i.getBoundingClientRect())!==null&&o!==void 0?o:{x:0,y:0,width:0,height:0};this.originX=Math.round(r!=null?r-s.x:s.width/2),this.originY=Math.round(n!=null?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.isFocusVisible(t?.target)&&!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 It.html`
350
350
  <style>
351
351
  .ft-ripple .ft-ripple--effect {
352
352
  left: ${this.originX}px;
@@ -357,7 +357,7 @@
357
357
  <div class="ft-ripple--background"></div>
358
358
  <div class="ft-ripple--effect"></div>
359
359
  </div>
360
- `}contentAvailableCallback(t){super.contentAvailableCallback(t),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}update(t){var i,o;super.update(t),t.has("disabled")&&(this.disabled?(this.endRipple(),(i=this.target)===null||i===void 0||i.removeAttribute("data-is-ft-ripple-target")):(o=this.target)===null||o===void 0||o.setAttribute("data-is-ft-ripple-target","true"))}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run(()=>this.defaultSetup())}defaultSetup(){var t,i;let o=(t=this.shadowRoot)===null||t===void 0?void 0:t.host.parentElement;o&&this.setupFor((i=this.target)!==null&&i!==void 0?i:o)}forceFocusUpdate(){var t;!((t=this.target)===null||t===void 0)&&t.matches(":focus-within")?this.startFocus():this.endFocus()}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");let i=(...f)=>u=>{f.forEach(b=>window.addEventListener(b,this.endPress,{once:!0})),this.startPress(u)},o=i("mouseup","contextmenu"),r=i("touchend","touchcancel"),n=f=>{["Enter"," "].includes(f.key)&&i("keyup")(f)},s={passive:!0};t.addEventListener("mouseover",this.startHover,s),t.addEventListener("mousemove",this.moveRipple,s),t.addEventListener("mouseleave",this.endHover,s),t.addEventListener("mousedown",o,s),t.addEventListener("touchstart",r,s),t.addEventListener("touchmove",this.moveRipple,s),t.addEventListener("keydown",n,s),t.addEventListener("focus",this.startFocus,s),t.addEventListener("blur",this.endFocus,s),t.addEventListener("focusin",this.startFocus,s),t.addEventListener("focusout",this.endFocus,s),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover,s),t.removeEventListener("mousemove",this.moveRipple,s),t.removeEventListener("mouseleave",this.endHover,s),t.removeEventListener("mousedown",o,s),t.removeEventListener("touchstart",r,s),t.removeEventListener("touchmove",this.moveRipple,s),t.removeEventListener("keydown",n,s),t.removeEventListener("focus",this.startFocus,s),t.removeEventListener("blur",this.endFocus,s),t.removeEventListener("focusin",this.startFocus,s),t.removeEventListener("focusout",this.endFocus,s),this.onDisconnect=void 0,this.target=void 0}}getCoordinates(t){let i=t,o=t,r,n;return i.x!=null?{x:r,y:n}=i:o.touches!=null&&(r=o.touches[0].clientX,n=o.touches[0].clientY),{x:r,y:n}}isFocusVisible(t){return t instanceof HTMLElement?t.matches(":focus-visible"):!0}isIgnored(t){if(this.disabled)return!0;if(t!=null)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.endRipple()}};_.elementDefinitions={};_.styles=Xt;L([(0,O.property)({type:Boolean})],_.prototype,"primary",void 0);L([(0,O.property)({type:Boolean})],_.prototype,"secondary",void 0);L([(0,O.property)({type:Boolean})],_.prototype,"unbounded",void 0);L([(0,O.property)({type:Boolean})],_.prototype,"activated",void 0);L([(0,O.property)({type:Boolean})],_.prototype,"selected",void 0);L([(0,O.property)({type:Boolean})],_.prototype,"disabled",void 0);L([(0,O.state)()],_.prototype,"hovered",void 0);L([(0,O.state)()],_.prototype,"focused",void 0);L([(0,O.state)()],_.prototype,"pressed",void 0);L([(0,O.state)()],_.prototype,"rippling",void 0);L([(0,O.state)()],_.prototype,"originX",void 0);L([(0,O.state)()],_.prototype,"originY",void 0);L([(0,O.query)(".ft-ripple")],_.prototype,"ripple",void 0);L([(0,O.query)(".ft-ripple--effect")],_.prototype,"rippleEffect",void 0);var Jt=c(T());var Qt={"ft-ripple":_};(0,Jt.customElements)(Qt);var Ft=c(P()),W=c(T()),z={size:W.FtCssVariableFactory.create("--ft-icon-font-size","","SIZE","24px"),fluidTopicsFontFamily:W.FtCssVariableFactory.extend("--ft-icon-fluid-topics-font-family","",W.FtCssVariableFactory.create("--ft-icon-font-family","","UNKNOWN","ft-icons")),fileFormatFontFamily:W.FtCssVariableFactory.extend("--ft-icon-file-format-font-family","",W.FtCssVariableFactory.create("--ft-icon-font-family","","UNKNOWN","ft-mime")),materialFontFamily:W.FtCssVariableFactory.extend("--ft-icon-material-font-family","",W.FtCssVariableFactory.create("--ft-icon-font-family","","UNKNOWN","Material Icons")),verticalAlign:W.FtCssVariableFactory.create("--ft-icon-vertical-align","","UNKNOWN","unset")},ei=[Ft.css`
360
+ `}contentAvailableCallback(t){super.contentAvailableCallback(t),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}update(t){var i,o;super.update(t),t.has("disabled")&&(this.disabled?(this.endRipple(),(i=this.target)===null||i===void 0||i.removeAttribute("data-is-ft-ripple-target")):(o=this.target)===null||o===void 0||o.setAttribute("data-is-ft-ripple-target","true"))}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run(()=>this.defaultSetup())}defaultSetup(){var t,i;let o=(t=this.shadowRoot)===null||t===void 0?void 0:t.host.parentElement;o&&this.setupFor((i=this.target)!==null&&i!==void 0?i:o)}forceFocusUpdate(){var t;!((t=this.target)===null||t===void 0)&&t.matches(":focus-within")?this.startFocus():this.endFocus()}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");let i=(...f)=>u=>{f.forEach(b=>window.addEventListener(b,this.endPress,{once:!0})),this.startPress(u)},o=i("mouseup","contextmenu"),r=i("touchend","touchcancel"),n=f=>{["Enter"," "].includes(f.key)&&i("keyup")(f)},s={passive:!0};t.addEventListener("mouseover",this.startHover,s),t.addEventListener("mousemove",this.moveRipple,s),t.addEventListener("mouseleave",this.endHover,s),t.addEventListener("mousedown",o,s),t.addEventListener("touchstart",r,s),t.addEventListener("touchmove",this.moveRipple,s),t.addEventListener("keydown",n,s),t.addEventListener("focus",this.startFocus,s),t.addEventListener("blur",this.endFocus,s),t.addEventListener("focusin",this.startFocus,s),t.addEventListener("focusout",this.endFocus,s),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover,s),t.removeEventListener("mousemove",this.moveRipple,s),t.removeEventListener("mouseleave",this.endHover,s),t.removeEventListener("mousedown",o,s),t.removeEventListener("touchstart",r,s),t.removeEventListener("touchmove",this.moveRipple,s),t.removeEventListener("keydown",n,s),t.removeEventListener("focus",this.startFocus,s),t.removeEventListener("blur",this.endFocus,s),t.removeEventListener("focusin",this.startFocus,s),t.removeEventListener("focusout",this.endFocus,s),this.onDisconnect=void 0,this.target=void 0}}getCoordinates(t){let i=t,o=t,r,n;return i.x!=null?{x:r,y:n}=i:o.touches!=null&&(r=o.touches[0].clientX,n=o.touches[0].clientY),{x:r,y:n}}isFocusVisible(t){return t instanceof HTMLElement?t.matches(":focus-visible"):!0}isIgnored(t){if(this.disabled)return!0;if(t!=null)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.endRipple()}};_.elementDefinitions={};_.styles=Xt;N([(0,O.property)({type:Boolean})],_.prototype,"primary",void 0);N([(0,O.property)({type:Boolean})],_.prototype,"secondary",void 0);N([(0,O.property)({type:Boolean})],_.prototype,"unbounded",void 0);N([(0,O.property)({type:Boolean})],_.prototype,"activated",void 0);N([(0,O.property)({type:Boolean})],_.prototype,"selected",void 0);N([(0,O.property)({type:Boolean})],_.prototype,"disabled",void 0);N([(0,O.state)()],_.prototype,"hovered",void 0);N([(0,O.state)()],_.prototype,"focused",void 0);N([(0,O.state)()],_.prototype,"pressed",void 0);N([(0,O.state)()],_.prototype,"rippling",void 0);N([(0,O.state)()],_.prototype,"originX",void 0);N([(0,O.state)()],_.prototype,"originY",void 0);N([(0,O.query)(".ft-ripple")],_.prototype,"ripple",void 0);N([(0,O.query)(".ft-ripple--effect")],_.prototype,"rippleEffect",void 0);var Jt=c(T());var Qt={"ft-ripple":_};(0,Jt.customElements)(Qt);var Ft=c(P()),W=c(T()),z={size:W.FtCssVariableFactory.create("--ft-icon-font-size","","SIZE","24px"),fluidTopicsFontFamily:W.FtCssVariableFactory.extend("--ft-icon-fluid-topics-font-family","",W.FtCssVariableFactory.create("--ft-icon-font-family","","UNKNOWN","ft-icons")),fileFormatFontFamily:W.FtCssVariableFactory.extend("--ft-icon-file-format-font-family","",W.FtCssVariableFactory.create("--ft-icon-font-family","","UNKNOWN","ft-mime")),materialFontFamily:W.FtCssVariableFactory.extend("--ft-icon-material-font-family","",W.FtCssVariableFactory.create("--ft-icon-font-family","","UNKNOWN","Material Icons")),verticalAlign:W.FtCssVariableFactory.create("--ft-icon-vertical-align","","UNKNOWN","unset")},ei=[Ft.css`
361
361
  :host, i.ft-icon {
362
362
  display: inline-flex;
363
363
  align-items: center;
@@ -621,7 +621,7 @@
621
621
  <slot></slot>
622
622
  </ft-typography>
623
623
  </div>
624
- `}focus(t){var i;(i=this.container)===null||i===void 0||i.focus(t)}click(){var t;(t=this.container)===null||t===void 0||t.click()}confirmSuggestion(){this.dispatchEvent(new qe(this.getValue()))}getValue(){return this.value||this.getTextContent()}getTextContent(){return this.assignedNodes.map(t=>t.textContent).join("").trim()}onKeyDown(t){["Enter"," "].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),this.confirmSuggestion())}};H.elementDefinitions={"ft-ripple":_,"ft-typography":M,"ft-icon":R};H.styles=fi;Le([(0,ee.property)()],H.prototype,"value",void 0);Le([(0,ee.property)()],H.prototype,"helper",void 0);Le([(0,ee.query)(".ft-text-field-suggestion")],H.prototype,"container",void 0);Le([(0,ee.queryAssignedNodes)()],H.prototype,"assignedNodes",void 0);var Ne=class extends CustomEvent{constructor(t){super("live-change",{detail:t})}},we=class extends CustomEvent{constructor(t){super("change",{detail:t})}},Pe=class extends CustomEvent{constructor(t){super("invalid",{detail:t})}};var y=function(e,t,i,o){var r=arguments.length,n=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,o);else for(var f=e.length-1;f>=0;f--)(s=e[f])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n},h=class extends(0,w.toFtFormComponent)(w.FtLitElement){constructor(){super(...arguments),this._value="",this.dispatchedValue="",this.outlined=!1,this.disabled=!1,this.error=!1,this.fixedMenuPosition=!1,this.prefix=null,this.passwordHiddenIcon=F.EYE_SLASH,this.passwordRevealedIcon=F.EYE,this.filterSuggestions=!1,this.password=!1,this.focused=!1,this.inputValid=!0,this.hidePassword=!0,this.hideSuggestions=!1,this.visibleSuggestions=[],this.providedSuggestions=[]}get value(){return this._value||""}set value(t){this.setInternalValue(t||""),this.dispatchedValue=t||""}setInternalValue(t){let i=this._value;this._value=t||"",this.setFormValue(this._value),this.requestUpdate("value",i)}focus(){var t;(t=this.input)===null||t===void 0||t.focus()}blur(){var t;(t=this.input)===null||t===void 0||t.blur()}render(){var t;let i={"ft-text-field":!0,"ft-text-field--filled":!this.outlined,"ft-text-field--outlined":this.outlined,"ft-text-field--disabled":this.disabled,"ft-text-field--has-value":!!this.value,"ft-text-field--with-label":!!this.label,"ft-text-field--in-error":!this.inputValid||this.error,"ft-text-field--fixed":this.fixedMenuPosition,"ft-text-field--with-prefix":!!this.prefix,"ft-text-field--hide-suggestions":!this.suggestionsShouldBeDisplayed(),"ft-text-field--raised-label":this.focused||this.value!="","ft-text-field--with-icon":!!this.icon,"ft-text-field--with-password":this.isPasswordField()},o=this.suggestionsProvider&&this.value&&this.value!=""&&!this.providedSuggestions.map(f=>f.label).includes(this.value),n=!this.suggestionsProvider&&this.filterSuggestions&&this.value&&this.value!=""||o,s=this.inputValid?this.helper:(t=this.input)===null||t===void 0?void 0:t.validationMessage;return C.html`
624
+ `}focus(t){var i;(i=this.container)===null||i===void 0||i.focus(t)}click(){var t;(t=this.container)===null||t===void 0||t.click()}confirmSuggestion(){this.dispatchEvent(new qe(this.getValue()))}getValue(){return this.value||this.getTextContent()}getTextContent(){return this.assignedNodes.map(t=>t.textContent).join("").trim()}onKeyDown(t){["Enter"," "].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),this.confirmSuggestion())}};H.elementDefinitions={"ft-ripple":_,"ft-typography":M,"ft-icon":R};H.styles=fi;Le([(0,ee.property)()],H.prototype,"value",void 0);Le([(0,ee.property)()],H.prototype,"helper",void 0);Le([(0,ee.query)(".ft-text-field-suggestion")],H.prototype,"container",void 0);Le([(0,ee.queryAssignedNodes)()],H.prototype,"assignedNodes",void 0);var Ne=class extends CustomEvent{constructor(t){super("live-change",{detail:t})}},we=class extends CustomEvent{constructor(t){super("change",{detail:t})}},Pe=class extends CustomEvent{constructor(t){super("invalid",{detail:t})}};var y=function(e,t,i,o){var r=arguments.length,n=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,o);else for(var f=e.length-1;f>=0;f--)(s=e[f])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n},h=class extends(0,L.toFtFormComponent)(L.FtLitElement){constructor(){super(...arguments),this._value="",this.dispatchedValue="",this.outlined=!1,this.disabled=!1,this.error=!1,this.fixedMenuPosition=!1,this.prefix=null,this.passwordHiddenIcon=F.EYE_SLASH,this.passwordRevealedIcon=F.EYE,this.filterSuggestions=!1,this.password=!1,this.hideCurrentValueSuggestion=!1,this.focused=!1,this.inputValid=!0,this.hidePassword=!0,this.hideSuggestions=!1,this.visibleSuggestions=[],this.providedSuggestions=[]}get value(){return this._value||""}set value(t){this.setInternalValue(t||""),this.dispatchedValue=t||""}setInternalValue(t){let i=this._value;this._value=t||"",this.setFormValue(this._value),this.requestUpdate("value",i)}focus(){var t;(t=this.input)===null||t===void 0||t.focus()}blur(){var t;(t=this.input)===null||t===void 0||t.blur()}render(){var t;let i={"ft-text-field":!0,"ft-text-field--filled":!this.outlined,"ft-text-field--outlined":this.outlined,"ft-text-field--disabled":this.disabled,"ft-text-field--has-value":!!this.value,"ft-text-field--with-label":!!this.label,"ft-text-field--in-error":!this.inputValid||this.error,"ft-text-field--fixed":this.fixedMenuPosition,"ft-text-field--with-prefix":!!this.prefix,"ft-text-field--hide-suggestions":!this.suggestionsShouldBeDisplayed(),"ft-text-field--raised-label":this.focused||this.value!="","ft-text-field--with-icon":!!this.icon,"ft-text-field--with-password":this.isPasswordField()},o=this.suggestionsProvider&&this.value&&this.value!=""&&!this.providedSuggestions.map(f=>f.label).includes(this.value),n=!this.suggestionsProvider&&this.filterSuggestions&&this.value&&this.value!=""||o,s=this.inputValid?this.helper:(t=this.input)===null||t===void 0?void 0:t.validationMessage;return C.html`
625
625
  <div class="${(0,ci.classMap)(i)}">
626
626
  <div class="ft-text-field--main-panel"
627
627
  @keydown=${this.handleKeyboardNavigation}
@@ -652,17 +652,21 @@
652
652
  ?disabled=${this.disabled}
653
653
  .value=${this.value}
654
654
  @click=${this.handleClick}
655
- @keydown=${this.handleInput}
656
- @keyup=${this.catchComposingEvents}
655
+ @keyup=${this.handleInput}
656
+ @keydown=${this.catchComposingEvents}
657
657
  @focus=${this.onFocus}
658
658
  />
659
659
  ${this.renderIcon()}
660
660
  </div>
661
661
  <div class="ft-text-field--suggestions"
662
+ part="suggestions"
662
663
  @suggestion-selected=${this.onSuggestionSelected}>
663
664
  ${this.renderSuggestions()}
664
- ${n?C.html`
665
- <ft-text-field-suggestion class="ft-text-field-suggestion--new-value" helper="${this.suggestionsHelper}">
665
+ ${!this.hideCurrentValueSuggestion&&n?C.html`
666
+ <ft-text-field-suggestion
667
+ class="ft-text-field-suggestion--new-value"
668
+ part="suggestion current-value-suggestion"
669
+ helper="${this.suggestionsHelper}">
666
670
  ${this.value}
667
671
  </ft-text-field-suggestion>
668
672
  `:C.nothing}
@@ -676,7 +680,7 @@
676
680
  </div>
677
681
  `}resolveInputType(){var t;return this.isPasswordField()?this.hidePassword?"password":"text":(t=this.type)!==null&&t!==void 0?t:"text"}renderSuggestions(){return this.suggestionsProvider?C.html`
678
682
  ${(0,ui.repeat)(this.providedSuggestions,t=>C.html`
679
- <ft-text-field-suggestion value="${t.value}" @click=${i=>this.onSuggestionClick(i,t.clickHandler)}>
683
+ <ft-text-field-suggestion part="suggestion" value="${t.value}" @click=${i=>this.onSuggestionClick(i,t.clickHandler)}>
680
684
  ${t.icon?C.html`
681
685
  <ft-icon .value=${t.icon}></ft-icon>
682
686
  `:C.nothing}
@@ -695,7 +699,7 @@
695
699
  .variant=${this.iconVariant}
696
700
  .value=${this.icon}
697
701
  @click=${()=>{var t;return(t=this.input)===null||t===void 0?void 0:t.focus()}}></ft-icon>
698
- `:C.nothing}update(t){super.update(t),(t.has("value")||t.has("filterSuggestions")||t.has("suggestionsProvider"))&&this.updateSuggestions(),t.has("value")&&t.get("value")!=null&&(this.hideSuggestions=!1),t.has("dispatchedValue")&&t.get("dispatchedValue")!=null&&(this.hideSuggestions=!0)}async updateSuggestions(){this.suggestionsProvider?this.providedSuggestions=await this.suggestionsProvider(this.value):this.filterSuggestionsIfNeeded()}filterSuggestionsIfNeeded(){this.filterSuggestions?(this.slottedSuggestions.forEach(t=>t.hidden=!t.getValue().toLowerCase().includes(this.value.toLowerCase())),this.visibleSuggestions=this.slottedSuggestions.filter(t=>!t.hidden)):this.visibleSuggestions=this.slottedSuggestions,this.newValueSuggestion&&(this.visibleSuggestions=[...this.visibleSuggestions,this.newValueSuggestion]),this.hideSuggestions=this.visibleSuggestions.length<=0}contentAvailableCallback(t){super.contentAvailableCallback(t),t.has("focused")&&!this.hideSuggestions&&this.visibleSuggestions.length>0&&this.setSuggestionPosition(),t.has("value")&&this.suggestionsProvider&&(this.visibleSuggestions=[...this.providedSuggestionsInDom]),t.has("autocomplete")&&this.setupWatchAutofill(),this.suggestionsShouldBeDisplayed()&&this.setSuggestionPosition()}setupWatchAutofill(){var t;this.clearWatchAutofill(),((t=this.autocomplete)!==null&&t!==void 0?t:"off")!=="off"&&(this.watchAutofillInterval=setInterval(()=>{var i,o,r;!((i=this.input)===null||i===void 0)&&i.matches(":autofill")&&this.dispatchedValue!==((o=this.input)===null||o===void 0?void 0:o.value)&&this.setValue((r=this.input)===null||r===void 0?void 0:r.value,!0)},200))}clearWatchAutofill(){this.watchAutofillInterval&&clearInterval(this.watchAutofillInterval)}connectedCallback(){super.connectedCallback(),this.setupWatchAutofill()}disconnectedCallback(){super.disconnectedCallback(),this.clearWatchAutofill()}setValue(t,i=!1){var o,r;this.value!==t&&(this.inputValid=!0,this.setInternalValue(t),this.dispatchEvent(new Ne(t))),i&&this.dispatchedValue!==t&&(this.inputValid=(r=(o=this.input)===null||o===void 0?void 0:o.checkValidity())!==null&&r!==void 0?r:!0,this.inputValid?(this.dispatchedValue=t,this.dispatchEvent(new we(t))):this.dispatchEvent(new Pe(this.input.validationMessage)))}handleInput(t){var i;let o=((i=this.input)===null||i===void 0?void 0:i.value)||"";this.setValue(o,t.key=="Escape"||t.key=="Enter")}catchComposingEvents(t){}handleClick(){this.hideSuggestions=!1}handleKeyboardNavigation(t){var i;if(t.key==="ArrowDown"||t.key==="ArrowUp"){t.preventDefault(),t.stopPropagation(),this.hideSuggestions=!1;let o=this.visibleSuggestions.findIndex(n=>n.matches(":focus-within")),r;t.key==="ArrowDown"?r=o<this.visibleSuggestions.length-1?o+1:0:r=o>0?o-1:this.visibleSuggestions.length-1,(i=this.visibleSuggestions[r])===null||i===void 0||i.focus()}(t.key=="Escape"||t.key=="Enter")&&(this.hideSuggestions=!0)}onSuggestionSelected(t){var i;this.setValue(t.detail,!0),(i=this.input)===null||i===void 0||i.focus(),setTimeout(()=>this.hideSuggestions=!0,0)}onFocus(){this.focused=!0,this.hideSuggestions=!1}onMainPanelBlur(){var t,i;!((t=this.mainPanel)===null||t===void 0)&&t.matches(":focus-within")||(this.focused=!1,this.setValue(((i=this.input)===null||i===void 0?void 0:i.value)||"",!0))}togglePasswordVisibility(){this.hidePassword=!this.hidePassword}isPasswordField(){return this.password||this.type==="password"}setSuggestionPosition(){this.suggestionsContainer.style.width=this.mainPanel.getBoundingClientRect().width+"px";let t=["bottom","top"];(0,w.computeOffsetAutoPosition)(this.mainPanel,this.suggestionsContainer,"bottom",t,"fixed","--text-field-internal-suggest-size",0).then(({x:i,y:o})=>{this.suggestionsContainer.style.left=`${i}px`,this.suggestionsContainer.style.top=`${o}px`})}suggestionsShouldBeDisplayed(){return!this.hideSuggestions&&(this.visibleSuggestions.length||this.providedSuggestions.length)}};h.elementDefinitions={"ft-input-label":B,"ft-ripple":_,"ft-typography":M,"ft-icon":R,"ft-text-field-suggestion":H};h.styles=[Te,w.noTextInputDefaultClearButton,ai];y([(0,g.property)()],h.prototype,"label",void 0);y([(0,g.property)({noAccessor:!0})],h.prototype,"value",null);y([(0,g.state)()],h.prototype,"dispatchedValue",void 0);y([(0,g.property)()],h.prototype,"helper",void 0);y([(0,g.property)()],h.prototype,"suggestionsHelper",void 0);y([(0,g.property)({type:Boolean})],h.prototype,"outlined",void 0);y([(0,g.property)({type:Boolean})],h.prototype,"disabled",void 0);y([(0,g.property)({type:Boolean})],h.prototype,"error",void 0);y([(0,g.property)({type:Boolean})],h.prototype,"fixedMenuPosition",void 0);y([(0,g.property)()],h.prototype,"prefix",void 0);y([(0,g.property)()],h.prototype,"icon",void 0);y([(0,g.property)()],h.prototype,"name",void 0);y([(0,g.property)()],h.prototype,"type",void 0);y([(0,g.property)()],h.prototype,"passwordHiddenIcon",void 0);y([(0,g.property)()],h.prototype,"passwordRevealedIcon",void 0);y([(0,g.property)()],h.prototype,"iconVariant",void 0);y([(0,g.property)({type:Boolean})],h.prototype,"filterSuggestions",void 0);y([(0,w.numberProperty)()],h.prototype,"maxLength",void 0);y([(0,g.property)({type:Boolean})],h.prototype,"password",void 0);y([(0,g.property)({type:String})],h.prototype,"autocomplete",void 0);y([(0,g.property)({attribute:!1})],h.prototype,"suggestionsProvider",void 0);y([(0,g.state)()],h.prototype,"focused",void 0);y([(0,g.state)()],h.prototype,"inputValid",void 0);y([(0,g.state)()],h.prototype,"hidePassword",void 0);y([(0,g.state)()],h.prototype,"hideSuggestions",void 0);y([(0,g.state)()],h.prototype,"visibleSuggestions",void 0);y([(0,g.state)()],h.prototype,"providedSuggestions",void 0);y([(0,g.query)(".ft-text-field--main-panel")],h.prototype,"mainPanel",void 0);y([(0,g.query)(".ft-text-field--input")],h.prototype,"input",void 0);y([(0,g.query)(".ft-text-field-suggestion--new-value")],h.prototype,"newValueSuggestion",void 0);y([(0,g.query)(".ft-text-field--suggestions")],h.prototype,"suggestionsContainer",void 0);y([(0,g.queryAll)("ft-text-field-suggestion")],h.prototype,"providedSuggestionsInDom",void 0);y([(0,g.queryAssignedElements)({selector:"ft-text-field-suggestion"})],h.prototype,"slottedSuggestions",void 0);y([(0,w.ignoreComposingEvents)()],h.prototype,"handleInput",null);y([(0,w.ignoreComposingEvents)()],h.prototype,"catchComposingEvents",null);var xi={"ft-text-field":h,"ft-text-field-suggestion":H};(0,gi.customElements)(xi);})();
702
+ `:C.nothing}update(t){super.update(t),(t.has("value")||t.has("filterSuggestions")||t.has("suggestionsProvider"))&&this.updateSuggestions(),t.has("value")&&t.get("value")!=null&&(this.hideSuggestions=!1),t.has("dispatchedValue")&&t.get("dispatchedValue")!=null&&(this.hideSuggestions=!0)}async updateSuggestions(){var t;if(this.suggestionsProvider){(t=this.cancelableSuggest)===null||t===void 0||t.cancel();let i=this.suggestionsProvider(this.value);i instanceof Promise?(this.cancelableSuggest=(0,L.cancelable)(i),this.providedSuggestions=await this.cancelableSuggest):(this.cancelableSuggest=void 0,this.providedSuggestions=i)}else this.filterSuggestionsIfNeeded()}filterSuggestionsIfNeeded(){this.filterSuggestions?(this.slottedSuggestions.forEach(t=>t.hidden=!t.getValue().toLowerCase().includes(this.value.toLowerCase())),this.visibleSuggestions=this.slottedSuggestions.filter(t=>!t.hidden)):this.visibleSuggestions=this.slottedSuggestions,this.newValueSuggestion&&(this.visibleSuggestions=[...this.visibleSuggestions,this.newValueSuggestion]),this.hideSuggestions=this.visibleSuggestions.length<=0}contentAvailableCallback(t){super.contentAvailableCallback(t),t.has("focused")&&!this.hideSuggestions&&this.visibleSuggestions.length>0&&this.setSuggestionPosition(),t.has("value")&&this.suggestionsProvider&&(this.visibleSuggestions=[...this.providedSuggestionsInDom]),t.has("autocomplete")&&this.setupWatchAutofill(),this.suggestionsShouldBeDisplayed()&&this.setSuggestionPosition()}setupWatchAutofill(){var t;this.clearWatchAutofill(),((t=this.autocomplete)!==null&&t!==void 0?t:"off")!=="off"&&(this.watchAutofillInterval=setInterval(()=>{var i,o,r;!((i=this.input)===null||i===void 0)&&i.matches(":autofill")&&this.dispatchedValue!==((o=this.input)===null||o===void 0?void 0:o.value)&&this.setValue((r=this.input)===null||r===void 0?void 0:r.value,!0)},200))}clearWatchAutofill(){this.watchAutofillInterval&&clearInterval(this.watchAutofillInterval)}connectedCallback(){super.connectedCallback(),this.setupWatchAutofill()}disconnectedCallback(){super.disconnectedCallback(),this.clearWatchAutofill()}setValue(t,i=!1){var o,r;this.value!==t&&(this.inputValid=!0,this.setInternalValue(t),this.dispatchEvent(new Ne(t))),i&&this.dispatchedValue!==t&&(this.inputValid=(r=(o=this.input)===null||o===void 0?void 0:o.checkValidity())!==null&&r!==void 0?r:!0,this.inputValid?(this.dispatchedValue=t,this.dispatchEvent(new we(t))):this.dispatchEvent(new Pe(this.input.validationMessage)))}handleInput(t){var i;let o=((i=this.input)===null||i===void 0?void 0:i.value)||"";this.setValue(o,t.key=="Escape"||t.key=="Enter")}catchComposingEvents(t){}handleClick(){this.hideSuggestions=!1}handleKeyboardNavigation(t){var i;if(t.key==="ArrowDown"||t.key==="ArrowUp"){t.preventDefault(),t.stopPropagation(),this.hideSuggestions=!1;let o=this.visibleSuggestions.findIndex(n=>n.matches(":focus-within")),r;t.key==="ArrowDown"?r=o<this.visibleSuggestions.length-1?o+1:0:r=o>0?o-1:this.visibleSuggestions.length-1,(i=this.visibleSuggestions[r])===null||i===void 0||i.focus()}(t.key=="Escape"||t.key=="Enter")&&(this.hideSuggestions=!0)}onSuggestionSelected(t){var i;this.setValue(t.detail,!0),(i=this.input)===null||i===void 0||i.focus(),setTimeout(()=>this.hideSuggestions=!0,0)}onFocus(){this.focused=!0,this.hideSuggestions=!1}onMainPanelBlur(){var t,i;!((t=this.mainPanel)===null||t===void 0)&&t.matches(":focus-within")||(this.focused=!1,this.setValue(((i=this.input)===null||i===void 0?void 0:i.value)||"",!0))}togglePasswordVisibility(){this.hidePassword=!this.hidePassword}isPasswordField(){return this.password||this.type==="password"}setSuggestionPosition(){this.suggestionsContainer.style.width=this.mainPanel.getBoundingClientRect().width+"px";let t=["bottom","top"];(0,L.computeOffsetAutoPosition)(this.mainPanel,this.suggestionsContainer,"bottom",t,"fixed","--text-field-internal-suggest-size",0).then(({x:i,y:o})=>{this.suggestionsContainer.style.left=`${i}px`,this.suggestionsContainer.style.top=`${o}px`})}suggestionsShouldBeDisplayed(){return!this.hideSuggestions&&(this.visibleSuggestions.length||this.providedSuggestions.length)}};h.elementDefinitions={"ft-input-label":B,"ft-ripple":_,"ft-typography":M,"ft-icon":R,"ft-text-field-suggestion":H};h.styles=[Te,L.noTextInputDefaultClearButton,ai];y([(0,g.property)()],h.prototype,"label",void 0);y([(0,g.property)({noAccessor:!0})],h.prototype,"value",null);y([(0,g.state)()],h.prototype,"dispatchedValue",void 0);y([(0,g.property)()],h.prototype,"helper",void 0);y([(0,g.property)()],h.prototype,"suggestionsHelper",void 0);y([(0,g.property)({type:Boolean})],h.prototype,"outlined",void 0);y([(0,g.property)({type:Boolean})],h.prototype,"disabled",void 0);y([(0,g.property)({type:Boolean})],h.prototype,"error",void 0);y([(0,g.property)({type:Boolean})],h.prototype,"fixedMenuPosition",void 0);y([(0,g.property)()],h.prototype,"prefix",void 0);y([(0,g.property)()],h.prototype,"icon",void 0);y([(0,g.property)()],h.prototype,"name",void 0);y([(0,g.property)()],h.prototype,"type",void 0);y([(0,g.property)()],h.prototype,"passwordHiddenIcon",void 0);y([(0,g.property)()],h.prototype,"passwordRevealedIcon",void 0);y([(0,g.property)()],h.prototype,"iconVariant",void 0);y([(0,g.property)({type:Boolean})],h.prototype,"filterSuggestions",void 0);y([(0,L.numberProperty)()],h.prototype,"maxLength",void 0);y([(0,g.property)({type:Boolean})],h.prototype,"password",void 0);y([(0,g.property)({type:String})],h.prototype,"autocomplete",void 0);y([(0,g.property)({attribute:!1})],h.prototype,"suggestionsProvider",void 0);y([(0,g.property)({type:Boolean})],h.prototype,"hideCurrentValueSuggestion",void 0);y([(0,g.state)()],h.prototype,"focused",void 0);y([(0,g.state)()],h.prototype,"inputValid",void 0);y([(0,g.state)()],h.prototype,"hidePassword",void 0);y([(0,g.state)()],h.prototype,"hideSuggestions",void 0);y([(0,g.state)()],h.prototype,"visibleSuggestions",void 0);y([(0,g.state)()],h.prototype,"providedSuggestions",void 0);y([(0,g.query)(".ft-text-field--main-panel")],h.prototype,"mainPanel",void 0);y([(0,g.query)(".ft-text-field--input")],h.prototype,"input",void 0);y([(0,g.query)(".ft-text-field-suggestion--new-value")],h.prototype,"newValueSuggestion",void 0);y([(0,g.query)(".ft-text-field--suggestions")],h.prototype,"suggestionsContainer",void 0);y([(0,g.queryAll)("ft-text-field-suggestion")],h.prototype,"providedSuggestionsInDom",void 0);y([(0,g.queryAssignedElements)({selector:"ft-text-field-suggestion"})],h.prototype,"slottedSuggestions",void 0);y([(0,L.ignoreComposingEvents)()],h.prototype,"handleInput",null);y([(0,L.ignoreComposingEvents)()],h.prototype,"catchComposingEvents",null);var xi={"ft-text-field":h,"ft-text-field-suggestion":H};(0,gi.customElements)(xi);})();
699
703
  /*! Bundled license information:
700
704
 
701
705
  lit-html/lit-html.js: