@fluid-topics/ft-viewer 2.2.13 → 2.2.14

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.
@@ -1497,6 +1497,10 @@
1497
1497
  outline: none;
1498
1498
  }
1499
1499
 
1500
+ .ft-text-field-suggestion--remove {
1501
+ margin: 0 4px;
1502
+ }
1503
+
1500
1504
  .ft-text-field-suggestion,
1501
1505
  .ft-text-field-suggestion--suggestion,
1502
1506
  .ft-text-field-suggestion--label {
@@ -1639,7 +1643,7 @@
1639
1643
  .variant=${this.iconVariant}
1640
1644
  .value=${this.icon}
1641
1645
  @click=${()=>{var e;return(e=this.input)===null||e===void 0?void 0:e.focus()}}></ft-icon>
1642
- `:ve.nothing}update(e){super.update(e),(e.has("value")||e.has("filterSuggestions")||e.has("suggestionsProvider"))&&this.updateSuggestions(),e.has("value")&&e.get("value")!=null&&(this.hideSuggestions=!1),e.has("dispatchedValue")&&e.get("dispatchedValue")!=null&&(this.hideSuggestions=!0)}async updateSuggestions(){var e;if(this.suggestionsProvider){(e=this.cancelableSuggest)===null||e===void 0||e.cancel();let i=this.suggestionsProvider(this.value);i instanceof Promise?(this.cancelableSuggest=(0,ze.cancelable)(i),this.providedSuggestions=await this.cancelableSuggest):(this.cancelableSuggest=void 0,this.providedSuggestions=i)}else this.filterSuggestionsIfNeeded()}filterSuggestionsIfNeeded(){this.filterSuggestions?(this.slottedSuggestions.forEach(e=>e.hidden=!e.getValue().toLowerCase().includes(this.value.toLowerCase())),this.visibleSuggestions=this.slottedSuggestions.filter(e=>!e.hidden)):this.visibleSuggestions=this.slottedSuggestions,this.newValueSuggestion&&(this.visibleSuggestions=[...this.visibleSuggestions,this.newValueSuggestion]),this.hideSuggestions=this.visibleSuggestions.length<=0}contentAvailableCallback(e){super.contentAvailableCallback(e),e.has("focused")&&!this.hideSuggestions&&this.visibleSuggestions.length>0&&this.setSuggestionPosition(),e.has("providedSuggestions")&&(this.visibleSuggestions=[...this.providedSuggestionsInDom]),e.has("autocomplete")&&this.setupWatchAutofill(),this.suggestionsShouldBeDisplayed()&&this.setSuggestionPosition()}setupWatchAutofill(){var e;this.clearWatchAutofill(),((e=this.autocomplete)!==null&&e!==void 0?e:"off")!=="off"&&(this.watchAutofillInterval=setInterval(()=>{var i,r,n;!((i=this.input)===null||i===void 0)&&i.matches(":autofill")&&this.dispatchedValue!==((r=this.input)===null||r===void 0?void 0:r.value)&&this.setValue((n=this.input)===null||n===void 0?void 0:n.value,!0)},200))}clearWatchAutofill(){this.watchAutofillInterval&&clearInterval(this.watchAutofillInterval)}connectedCallback(){super.connectedCallback(),this.setupWatchAutofill()}disconnectedCallback(){super.disconnectedCallback(),this.clearWatchAutofill()}setValue(e,i=!1){var r,n;this.value!==e&&(this.inputValid=!0,this.setInternalValue(e),this.dispatchEvent(new ks(e))),i&&this.dispatchedValue!==e&&(this.inputValid=(n=(r=this.input)===null||r===void 0?void 0:r.checkValidity())!==null&&n!==void 0?n:!0,this.inputValid?(this.dispatchedValue=e,this.dispatchEvent(new Ds(e))):this.dispatchEvent(new Ls(this.input.validationMessage)))}handleInput(e){var i;let r=((i=this.input)===null||i===void 0?void 0:i.value)||"";this.setValue(r,e.key=="Escape"||e.key=="Enter")}catchComposingEvents(e){}handleClick(){this.hideSuggestions=!1}handleKeyboardNavigation(e){var i,r;if(e.key==="ArrowDown"||e.key==="ArrowUp"){e.preventDefault(),e.stopPropagation(),this.hideSuggestions=!1;let n=this.visibleSuggestions.findIndex(s=>s.matches(":focus-within")),o;e.key==="ArrowDown"?o=n<this.visibleSuggestions.length-1?n+1:0:o=n>0?n-1:this.visibleSuggestions.length-1,(i=this.visibleSuggestions[o])===null||i===void 0||i.focus(void 0,(r=this.visibleSuggestions[n])===null||r===void 0?void 0:r.isRemoveButtonFocused())}(e.key=="Escape"||e.key=="Enter")&&(this.hideSuggestions=!0)}onSuggestionSelected(e){var i;this.setValue(e.detail,!0),(i=this.input)===null||i===void 0||i.focus(),setTimeout(()=>this.hideSuggestions=!0,0)}onSuggestionRemoved(){setTimeout(()=>this.updateSuggestions())}onFocus(){this.focused=!0,this.hideSuggestions=!1}onMainPanelBlur(){var e,i;!((e=this.mainPanel)===null||e===void 0)&&e.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 e=["bottom","top"];(0,ze.computeOffsetAutoPosition)(this.mainPanel,this.suggestionsContainer,"bottom",e,"fixed","--text-field-internal-suggest-size",0).then(({x:i,y:r})=>{this.suggestionsContainer.style.left=`${i}px`,this.suggestionsContainer.style.top=`${r}px`})}suggestionsShouldBeDisplayed(){return!this.hideSuggestions&&(this.visibleSuggestions.length||this.providedSuggestions.length)}};_.elementDefinitions={"ft-input-label":lt,"ft-ripple":P,"ft-typography":F,"ft-icon":z,"ft-text-field-suggestion":He};_.styles=[fi,ze.noTextInputDefaultClearButton,Sf];$([(0,M.property)()],_.prototype,"label",void 0);$([(0,M.property)({noAccessor:!0})],_.prototype,"value",null);$([(0,M.state)()],_.prototype,"dispatchedValue",void 0);$([(0,M.property)()],_.prototype,"helper",void 0);$([(0,M.property)()],_.prototype,"suggestionsHelper",void 0);$([(0,M.property)({type:Boolean})],_.prototype,"outlined",void 0);$([(0,M.property)({type:Boolean})],_.prototype,"disabled",void 0);$([(0,M.property)({type:Boolean})],_.prototype,"error",void 0);$([(0,M.property)({type:Boolean})],_.prototype,"fixedMenuPosition",void 0);$([(0,M.property)()],_.prototype,"prefix",void 0);$([(0,M.property)()],_.prototype,"icon",void 0);$([(0,M.property)()],_.prototype,"name",void 0);$([(0,M.property)()],_.prototype,"type",void 0);$([(0,M.property)()],_.prototype,"passwordHiddenIcon",void 0);$([(0,M.property)()],_.prototype,"passwordRevealedIcon",void 0);$([(0,M.property)()],_.prototype,"iconVariant",void 0);$([(0,M.property)({type:Boolean})],_.prototype,"filterSuggestions",void 0);$([(0,ze.numberProperty)()],_.prototype,"maxLength",void 0);$([(0,M.property)({type:Boolean})],_.prototype,"password",void 0);$([(0,M.property)({type:String})],_.prototype,"autocomplete",void 0);$([(0,M.property)({attribute:!1})],_.prototype,"suggestionsProvider",void 0);$([(0,M.property)({type:Boolean})],_.prototype,"hideCurrentValueSuggestion",void 0);$([(0,M.state)()],_.prototype,"focused",void 0);$([(0,M.state)()],_.prototype,"inputValid",void 0);$([(0,M.state)()],_.prototype,"hidePassword",void 0);$([(0,M.state)()],_.prototype,"hideSuggestions",void 0);$([(0,M.state)()],_.prototype,"visibleSuggestions",void 0);$([(0,M.state)()],_.prototype,"providedSuggestions",void 0);$([(0,M.query)(".ft-text-field--main-panel")],_.prototype,"mainPanel",void 0);$([(0,M.query)(".ft-text-field--input")],_.prototype,"input",void 0);$([(0,M.query)(".ft-text-field-suggestion--new-value")],_.prototype,"newValueSuggestion",void 0);$([(0,M.query)(".ft-text-field--suggestions")],_.prototype,"suggestionsContainer",void 0);$([(0,M.queryAll)("ft-text-field-suggestion")],_.prototype,"providedSuggestionsInDom",void 0);$([(0,M.queryAssignedElements)({selector:"ft-text-field-suggestion"})],_.prototype,"slottedSuggestions",void 0);$([(0,ze.ignoreComposingEvents)()],_.prototype,"handleInput",null);$([(0,ze.ignoreComposingEvents)()],_.prototype,"catchComposingEvents",null);var Of=c(h());var Rf={"ft-text-field":_,"ft-text-field-suggestion":He};(0,Of.customElements)(Rf);var Is=class extends CustomEvent{constructor(e){super("send-feedback",{detail:e})}};var we=function(t,e,i,r){var n=arguments.length,o=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,i,o):s(e,i))||o);return n>3&&o&&Object.defineProperty(e,i,o),o},Q=class extends mt(Fr.FtLitElementRedux){constructor(){super(),this.hideTitle=!1,this.withMoreOptionsButton=!1,this.emptyStarIcon="STAR",this.filledStarIcon="STAR_PLAIN",this.emptyLikeIcon="THUMBS_UP",this.filledLikeIcon="THUMBS_UP_PLAIN",this.emptyDislikeIcon="THUMBS_DOWN",this.filledDislikeIcon="THUMBS_DOWN_PLAIN",this.canAccessFeedback=!1,this.canRateThisContent=!1,this.from="",this.feedbackMessage="",this.addI18nContext(J,xf),this.addStore(x)}get configuredRatingType(){var e,i;return(i=(e=this.ratingSummary)===null||e===void 0?void 0:e.type)!==null&&i!==void 0?i:_e.NO_RATING}get ratingTypeOfDoneRatingOfThisContent(){var e,i,r;return(r=(i=(e=this.ratingSummary)===null||e===void 0?void 0:e.rating)===null||i===void 0?void 0:i.type)!==null&&r!==void 0?r:_e.NO_RATING}get ratingValue(){var e,i,r;return(r=(i=(e=this.ratingSummary)===null||e===void 0?void 0:e.rating)===null||i===void 0?void 0:i.value)!==null&&r!==void 0?r:-1}get ratingDate(){var e,i;let r=(i=(e=this.ratingSummary)===null||e===void 0?void 0:e.rating)===null||i===void 0?void 0:i.date;return typeof r=="string"?(0,Fr.parseDate)(r):r}render(){return!this.canAccessFeedback&&!this.canRateThisContent?ue.nothing:ue.html`
1646
+ `:ve.nothing}update(e){super.update(e),(e.has("value")||e.has("filterSuggestions")||e.has("suggestionsProvider"))&&this.updateSuggestions(),e.has("value")&&e.get("value")!=null&&(this.hideSuggestions=!1),e.has("dispatchedValue")&&e.get("dispatchedValue")!=null&&(this.hideSuggestions=!0)}async updateSuggestions(){var e;if(this.suggestionsProvider){(e=this.cancelableSuggest)===null||e===void 0||e.cancel();let i=this.suggestionsProvider(this.value);i instanceof Promise?(this.cancelableSuggest=(0,ze.cancelable)(i),this.providedSuggestions=await this.cancelableSuggest):(this.cancelableSuggest=void 0,this.providedSuggestions=i)}else this.filterSuggestionsIfNeeded()}filterSuggestionsIfNeeded(){this.filterSuggestions?(this.slottedSuggestions.forEach(e=>e.hidden=!e.getValue().toLowerCase().includes(this.value.toLowerCase())),this.visibleSuggestions=this.slottedSuggestions.filter(e=>!e.hidden)):this.visibleSuggestions=this.slottedSuggestions,this.newValueSuggestion&&(this.visibleSuggestions=[...this.visibleSuggestions,this.newValueSuggestion]),this.hideSuggestions=this.visibleSuggestions.length<=0}contentAvailableCallback(e){super.contentAvailableCallback(e),e.has("focused")&&!this.hideSuggestions&&this.visibleSuggestions.length>0&&this.setSuggestionPosition(),e.has("providedSuggestions")&&this.suggestionsProvider&&(this.visibleSuggestions=[...this.providedSuggestionsInDom]),e.has("autocomplete")&&this.setupWatchAutofill(),this.suggestionsShouldBeDisplayed()&&this.setSuggestionPosition()}setupWatchAutofill(){var e;this.clearWatchAutofill(),((e=this.autocomplete)!==null&&e!==void 0?e:"off")!=="off"&&(this.watchAutofillInterval=setInterval(()=>{var i,r,n;!((i=this.input)===null||i===void 0)&&i.matches(":autofill")&&this.dispatchedValue!==((r=this.input)===null||r===void 0?void 0:r.value)&&this.setValue((n=this.input)===null||n===void 0?void 0:n.value,!0)},200))}clearWatchAutofill(){this.watchAutofillInterval&&clearInterval(this.watchAutofillInterval)}connectedCallback(){super.connectedCallback(),this.setupWatchAutofill()}disconnectedCallback(){super.disconnectedCallback(),this.clearWatchAutofill()}setValue(e,i=!1){var r,n;this.value!==e&&(this.inputValid=!0,this.setInternalValue(e),this.dispatchEvent(new ks(e))),i&&this.dispatchedValue!==e&&(this.inputValid=(n=(r=this.input)===null||r===void 0?void 0:r.checkValidity())!==null&&n!==void 0?n:!0,this.inputValid?(this.dispatchedValue=e,this.dispatchEvent(new Ds(e))):this.dispatchEvent(new Ls(this.input.validationMessage)))}handleInput(e){var i;let r=((i=this.input)===null||i===void 0?void 0:i.value)||"";this.setValue(r,e.key=="Escape"||e.key=="Enter")}catchComposingEvents(e){}handleClick(){this.hideSuggestions=!1}handleKeyboardNavigation(e){var i,r;if(e.key==="ArrowDown"||e.key==="ArrowUp"){e.preventDefault(),e.stopPropagation(),this.hideSuggestions=!1;let n=this.visibleSuggestions.findIndex(s=>s.matches(":focus-within")),o;e.key==="ArrowDown"?o=n<this.visibleSuggestions.length-1?n+1:0:o=n>0?n-1:this.visibleSuggestions.length-1,(i=this.visibleSuggestions[o])===null||i===void 0||i.focus(void 0,(r=this.visibleSuggestions[n])===null||r===void 0?void 0:r.isRemoveButtonFocused())}(e.key=="Escape"||e.key=="Enter")&&(this.hideSuggestions=!0)}onSuggestionSelected(e){var i;this.setValue(e.detail,!0),(i=this.input)===null||i===void 0||i.focus(),setTimeout(()=>this.hideSuggestions=!0,0)}onSuggestionRemoved(){setTimeout(()=>this.updateSuggestions())}onFocus(){this.focused=!0,this.hideSuggestions=!1}onMainPanelBlur(){var e,i;!((e=this.mainPanel)===null||e===void 0)&&e.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 e=["bottom","top"];(0,ze.computeOffsetAutoPosition)(this.mainPanel,this.suggestionsContainer,"bottom",e,"fixed","--text-field-internal-suggest-size",0).then(({x:i,y:r})=>{this.suggestionsContainer.style.left=`${i}px`,this.suggestionsContainer.style.top=`${r}px`})}suggestionsShouldBeDisplayed(){return!this.hideSuggestions&&(this.visibleSuggestions.length||this.providedSuggestions.length)}};_.elementDefinitions={"ft-input-label":lt,"ft-ripple":P,"ft-typography":F,"ft-icon":z,"ft-text-field-suggestion":He};_.styles=[fi,ze.noTextInputDefaultClearButton,Sf];$([(0,M.property)()],_.prototype,"label",void 0);$([(0,M.property)({noAccessor:!0})],_.prototype,"value",null);$([(0,M.state)()],_.prototype,"dispatchedValue",void 0);$([(0,M.property)()],_.prototype,"helper",void 0);$([(0,M.property)()],_.prototype,"suggestionsHelper",void 0);$([(0,M.property)({type:Boolean})],_.prototype,"outlined",void 0);$([(0,M.property)({type:Boolean})],_.prototype,"disabled",void 0);$([(0,M.property)({type:Boolean})],_.prototype,"error",void 0);$([(0,M.property)({type:Boolean})],_.prototype,"fixedMenuPosition",void 0);$([(0,M.property)()],_.prototype,"prefix",void 0);$([(0,M.property)()],_.prototype,"icon",void 0);$([(0,M.property)()],_.prototype,"name",void 0);$([(0,M.property)()],_.prototype,"type",void 0);$([(0,M.property)()],_.prototype,"passwordHiddenIcon",void 0);$([(0,M.property)()],_.prototype,"passwordRevealedIcon",void 0);$([(0,M.property)()],_.prototype,"iconVariant",void 0);$([(0,M.property)({type:Boolean})],_.prototype,"filterSuggestions",void 0);$([(0,ze.numberProperty)()],_.prototype,"maxLength",void 0);$([(0,M.property)({type:Boolean})],_.prototype,"password",void 0);$([(0,M.property)({type:String})],_.prototype,"autocomplete",void 0);$([(0,M.property)({attribute:!1})],_.prototype,"suggestionsProvider",void 0);$([(0,M.property)({type:Boolean})],_.prototype,"hideCurrentValueSuggestion",void 0);$([(0,M.state)()],_.prototype,"focused",void 0);$([(0,M.state)()],_.prototype,"inputValid",void 0);$([(0,M.state)()],_.prototype,"hidePassword",void 0);$([(0,M.state)()],_.prototype,"hideSuggestions",void 0);$([(0,M.state)()],_.prototype,"visibleSuggestions",void 0);$([(0,M.state)()],_.prototype,"providedSuggestions",void 0);$([(0,M.query)(".ft-text-field--main-panel")],_.prototype,"mainPanel",void 0);$([(0,M.query)(".ft-text-field--input")],_.prototype,"input",void 0);$([(0,M.query)(".ft-text-field-suggestion--new-value")],_.prototype,"newValueSuggestion",void 0);$([(0,M.query)(".ft-text-field--suggestions")],_.prototype,"suggestionsContainer",void 0);$([(0,M.queryAll)("ft-text-field-suggestion")],_.prototype,"providedSuggestionsInDom",void 0);$([(0,M.queryAssignedElements)({selector:"ft-text-field-suggestion"})],_.prototype,"slottedSuggestions",void 0);$([(0,ze.ignoreComposingEvents)()],_.prototype,"handleInput",null);$([(0,ze.ignoreComposingEvents)()],_.prototype,"catchComposingEvents",null);var Of=c(h());var Rf={"ft-text-field":_,"ft-text-field-suggestion":He};(0,Of.customElements)(Rf);var Is=class extends CustomEvent{constructor(e){super("send-feedback",{detail:e})}};var we=function(t,e,i,r){var n=arguments.length,o=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,i,o):s(e,i))||o);return n>3&&o&&Object.defineProperty(e,i,o),o},Q=class extends mt(Fr.FtLitElementRedux){constructor(){super(),this.hideTitle=!1,this.withMoreOptionsButton=!1,this.emptyStarIcon="STAR",this.filledStarIcon="STAR_PLAIN",this.emptyLikeIcon="THUMBS_UP",this.filledLikeIcon="THUMBS_UP_PLAIN",this.emptyDislikeIcon="THUMBS_DOWN",this.filledDislikeIcon="THUMBS_DOWN_PLAIN",this.canAccessFeedback=!1,this.canRateThisContent=!1,this.from="",this.feedbackMessage="",this.addI18nContext(J,xf),this.addStore(x)}get configuredRatingType(){var e,i;return(i=(e=this.ratingSummary)===null||e===void 0?void 0:e.type)!==null&&i!==void 0?i:_e.NO_RATING}get ratingTypeOfDoneRatingOfThisContent(){var e,i,r;return(r=(i=(e=this.ratingSummary)===null||e===void 0?void 0:e.rating)===null||i===void 0?void 0:i.type)!==null&&r!==void 0?r:_e.NO_RATING}get ratingValue(){var e,i,r;return(r=(i=(e=this.ratingSummary)===null||e===void 0?void 0:e.rating)===null||i===void 0?void 0:i.value)!==null&&r!==void 0?r:-1}get ratingDate(){var e,i;let r=(i=(e=this.ratingSummary)===null||e===void 0?void 0:e.rating)===null||i===void 0?void 0:i.date;return typeof r=="string"?(0,Fr.parseDate)(r):r}render(){return!this.canAccessFeedback&&!this.canRateThisContent?ue.nothing:ue.html`
1643
1647
  <div part="container">
1644
1648
  ${this.hideTitle?ue.nothing:ue.html`
1645
1649
  <ft-typography variant="${V.title}" part="main-title">
@@ -1578,6 +1578,10 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:o.extend("--ftds-con
1578
1578
  outline: none;
1579
1579
  }
1580
1580
 
1581
+ .ft-text-field-suggestion--remove {
1582
+ margin: 0 4px;
1583
+ }
1584
+
1581
1585
  .ft-text-field-suggestion,
1582
1586
  .ft-text-field-suggestion--suggestion,
1583
1587
  .ft-text-field-suggestion--label {
@@ -1720,7 +1724,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:o.extend("--ftds-con
1720
1724
  .variant=${this.iconVariant}
1721
1725
  .value=${this.icon}
1722
1726
  @click=${()=>{var e;return(e=this.input)===null||e===void 0?void 0:e.focus()}}></ft-icon>
1723
- `:R}update(e){super.update(e),(e.has("value")||e.has("filterSuggestions")||e.has("suggestionsProvider"))&&this.updateSuggestions(),e.has("value")&&e.get("value")!=null&&(this.hideSuggestions=!1),e.has("dispatchedValue")&&e.get("dispatchedValue")!=null&&(this.hideSuggestions=!0)}async updateSuggestions(){var e;if(this.suggestionsProvider){(e=this.cancelableSuggest)===null||e===void 0||e.cancel();let r=this.suggestionsProvider(this.value);r instanceof Promise?(this.cancelableSuggest=Zo(r),this.providedSuggestions=await this.cancelableSuggest):(this.cancelableSuggest=void 0,this.providedSuggestions=r)}else this.filterSuggestionsIfNeeded()}filterSuggestionsIfNeeded(){this.filterSuggestions?(this.slottedSuggestions.forEach(e=>e.hidden=!e.getValue().toLowerCase().includes(this.value.toLowerCase())),this.visibleSuggestions=this.slottedSuggestions.filter(e=>!e.hidden)):this.visibleSuggestions=this.slottedSuggestions,this.newValueSuggestion&&(this.visibleSuggestions=[...this.visibleSuggestions,this.newValueSuggestion]),this.hideSuggestions=this.visibleSuggestions.length<=0}contentAvailableCallback(e){super.contentAvailableCallback(e),e.has("focused")&&!this.hideSuggestions&&this.visibleSuggestions.length>0&&this.setSuggestionPosition(),e.has("providedSuggestions")&&(this.visibleSuggestions=[...this.providedSuggestionsInDom]),e.has("autocomplete")&&this.setupWatchAutofill(),this.suggestionsShouldBeDisplayed()&&this.setSuggestionPosition()}setupWatchAutofill(){var e;this.clearWatchAutofill(),((e=this.autocomplete)!==null&&e!==void 0?e:"off")!=="off"&&(this.watchAutofillInterval=setInterval(()=>{var r,i,n;!((r=this.input)===null||r===void 0)&&r.matches(":autofill")&&this.dispatchedValue!==((i=this.input)===null||i===void 0?void 0:i.value)&&this.setValue((n=this.input)===null||n===void 0?void 0:n.value,!0)},200))}clearWatchAutofill(){this.watchAutofillInterval&&clearInterval(this.watchAutofillInterval)}connectedCallback(){super.connectedCallback(),this.setupWatchAutofill()}disconnectedCallback(){super.disconnectedCallback(),this.clearWatchAutofill()}setValue(e,r=!1){var i,n;this.value!==e&&(this.inputValid=!0,this.setInternalValue(e),this.dispatchEvent(new wa(e))),r&&this.dispatchedValue!==e&&(this.inputValid=(n=(i=this.input)===null||i===void 0?void 0:i.checkValidity())!==null&&n!==void 0?n:!0,this.inputValid?(this.dispatchedValue=e,this.dispatchEvent(new Ea(e))):this.dispatchEvent(new Oa(this.input.validationMessage)))}handleInput(e){var r;let i=((r=this.input)===null||r===void 0?void 0:r.value)||"";this.setValue(i,e.key=="Escape"||e.key=="Enter")}catchComposingEvents(e){}handleClick(){this.hideSuggestions=!1}handleKeyboardNavigation(e){var r,i;if(e.key==="ArrowDown"||e.key==="ArrowUp"){e.preventDefault(),e.stopPropagation(),this.hideSuggestions=!1;let n=this.visibleSuggestions.findIndex(s=>s.matches(":focus-within")),a;e.key==="ArrowDown"?a=n<this.visibleSuggestions.length-1?n+1:0:a=n>0?n-1:this.visibleSuggestions.length-1,(r=this.visibleSuggestions[a])===null||r===void 0||r.focus(void 0,(i=this.visibleSuggestions[n])===null||i===void 0?void 0:i.isRemoveButtonFocused())}(e.key=="Escape"||e.key=="Enter")&&(this.hideSuggestions=!0)}onSuggestionSelected(e){var r;this.setValue(e.detail,!0),(r=this.input)===null||r===void 0||r.focus(),setTimeout(()=>this.hideSuggestions=!0,0)}onSuggestionRemoved(){setTimeout(()=>this.updateSuggestions())}onFocus(){this.focused=!0,this.hideSuggestions=!1}onMainPanelBlur(){var e,r;!((e=this.mainPanel)===null||e===void 0)&&e.matches(":focus-within")||(this.focused=!1,this.setValue(((r=this.input)===null||r===void 0?void 0:r.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 e=["bottom","top"];Ts(this.mainPanel,this.suggestionsContainer,"bottom",e,"fixed","--text-field-internal-suggest-size",0).then(({x:r,y:i})=>{this.suggestionsContainer.style.left=`${r}px`,this.suggestionsContainer.style.top=`${i}px`})}suggestionsShouldBeDisplayed(){return!this.hideSuggestions&&(this.visibleSuggestions.length||this.providedSuggestions.length)}};B.elementDefinitions={"ft-input-label":st,"ft-ripple":K,"ft-typography":Q,"ft-icon":re,"ft-text-field-suggestion":We};B.styles=[fr,Vs,Ff];J([f()],B.prototype,"label",void 0);J([f({noAccessor:!0})],B.prototype,"value",null);J([T()],B.prototype,"dispatchedValue",void 0);J([f()],B.prototype,"helper",void 0);J([f()],B.prototype,"suggestionsHelper",void 0);J([f({type:Boolean})],B.prototype,"outlined",void 0);J([f({type:Boolean})],B.prototype,"disabled",void 0);J([f({type:Boolean})],B.prototype,"error",void 0);J([f({type:Boolean})],B.prototype,"fixedMenuPosition",void 0);J([f()],B.prototype,"prefix",void 0);J([f()],B.prototype,"icon",void 0);J([f()],B.prototype,"name",void 0);J([f()],B.prototype,"type",void 0);J([f()],B.prototype,"passwordHiddenIcon",void 0);J([f()],B.prototype,"passwordRevealedIcon",void 0);J([f()],B.prototype,"iconVariant",void 0);J([f({type:Boolean})],B.prototype,"filterSuggestions",void 0);J([yt()],B.prototype,"maxLength",void 0);J([f({type:Boolean})],B.prototype,"password",void 0);J([f({type:String})],B.prototype,"autocomplete",void 0);J([f({attribute:!1})],B.prototype,"suggestionsProvider",void 0);J([f({type:Boolean})],B.prototype,"hideCurrentValueSuggestion",void 0);J([T()],B.prototype,"focused",void 0);J([T()],B.prototype,"inputValid",void 0);J([T()],B.prototype,"hidePassword",void 0);J([T()],B.prototype,"hideSuggestions",void 0);J([T()],B.prototype,"visibleSuggestions",void 0);J([T()],B.prototype,"providedSuggestions",void 0);J([U(".ft-text-field--main-panel")],B.prototype,"mainPanel",void 0);J([U(".ft-text-field--input")],B.prototype,"input",void 0);J([U(".ft-text-field-suggestion--new-value")],B.prototype,"newValueSuggestion",void 0);J([U(".ft-text-field--suggestions")],B.prototype,"suggestionsContainer",void 0);J([Ka("ft-text-field-suggestion")],B.prototype,"providedSuggestionsInDom",void 0);J([Go({selector:"ft-text-field-suggestion"})],B.prototype,"slottedSuggestions",void 0);J([Ht()],B.prototype,"handleInput",null);J([Ht()],B.prototype,"catchComposingEvents",null);var Bf={"ft-text-field":B,"ft-text-field-suggestion":We};q(Bf);var Aa=class extends CustomEvent{constructor(e){super("send-feedback",{detail:e})}};var Ae=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(n<3?s(a):n>3?s(e,r,a):s(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},ce=class extends ft(be){constructor(){super(),this.hideTitle=!1,this.withMoreOptionsButton=!1,this.emptyStarIcon="STAR",this.filledStarIcon="STAR_PLAIN",this.emptyLikeIcon="THUMBS_UP",this.filledLikeIcon="THUMBS_UP_PLAIN",this.emptyDislikeIcon="THUMBS_DOWN",this.filledDislikeIcon="THUMBS_DOWN_PLAIN",this.canAccessFeedback=!1,this.canRateThisContent=!1,this.from="",this.feedbackMessage="",this.addI18nContext(le,$f),this.addStore(D)}get configuredRatingType(){var e,r;return(r=(e=this.ratingSummary)===null||e===void 0?void 0:e.type)!==null&&r!==void 0?r:_e.NO_RATING}get ratingTypeOfDoneRatingOfThisContent(){var e,r,i;return(i=(r=(e=this.ratingSummary)===null||e===void 0?void 0:e.rating)===null||r===void 0?void 0:r.type)!==null&&i!==void 0?i:_e.NO_RATING}get ratingValue(){var e,r,i;return(i=(r=(e=this.ratingSummary)===null||e===void 0?void 0:e.rating)===null||r===void 0?void 0:r.value)!==null&&i!==void 0?i:-1}get ratingDate(){var e,r;let i=(r=(e=this.ratingSummary)===null||e===void 0?void 0:e.rating)===null||r===void 0?void 0:r.date;return typeof i=="string"?Zi(i):i}render(){return!this.canAccessFeedback&&!this.canRateThisContent?R:b`
1727
+ `:R}update(e){super.update(e),(e.has("value")||e.has("filterSuggestions")||e.has("suggestionsProvider"))&&this.updateSuggestions(),e.has("value")&&e.get("value")!=null&&(this.hideSuggestions=!1),e.has("dispatchedValue")&&e.get("dispatchedValue")!=null&&(this.hideSuggestions=!0)}async updateSuggestions(){var e;if(this.suggestionsProvider){(e=this.cancelableSuggest)===null||e===void 0||e.cancel();let r=this.suggestionsProvider(this.value);r instanceof Promise?(this.cancelableSuggest=Zo(r),this.providedSuggestions=await this.cancelableSuggest):(this.cancelableSuggest=void 0,this.providedSuggestions=r)}else this.filterSuggestionsIfNeeded()}filterSuggestionsIfNeeded(){this.filterSuggestions?(this.slottedSuggestions.forEach(e=>e.hidden=!e.getValue().toLowerCase().includes(this.value.toLowerCase())),this.visibleSuggestions=this.slottedSuggestions.filter(e=>!e.hidden)):this.visibleSuggestions=this.slottedSuggestions,this.newValueSuggestion&&(this.visibleSuggestions=[...this.visibleSuggestions,this.newValueSuggestion]),this.hideSuggestions=this.visibleSuggestions.length<=0}contentAvailableCallback(e){super.contentAvailableCallback(e),e.has("focused")&&!this.hideSuggestions&&this.visibleSuggestions.length>0&&this.setSuggestionPosition(),e.has("providedSuggestions")&&this.suggestionsProvider&&(this.visibleSuggestions=[...this.providedSuggestionsInDom]),e.has("autocomplete")&&this.setupWatchAutofill(),this.suggestionsShouldBeDisplayed()&&this.setSuggestionPosition()}setupWatchAutofill(){var e;this.clearWatchAutofill(),((e=this.autocomplete)!==null&&e!==void 0?e:"off")!=="off"&&(this.watchAutofillInterval=setInterval(()=>{var r,i,n;!((r=this.input)===null||r===void 0)&&r.matches(":autofill")&&this.dispatchedValue!==((i=this.input)===null||i===void 0?void 0:i.value)&&this.setValue((n=this.input)===null||n===void 0?void 0:n.value,!0)},200))}clearWatchAutofill(){this.watchAutofillInterval&&clearInterval(this.watchAutofillInterval)}connectedCallback(){super.connectedCallback(),this.setupWatchAutofill()}disconnectedCallback(){super.disconnectedCallback(),this.clearWatchAutofill()}setValue(e,r=!1){var i,n;this.value!==e&&(this.inputValid=!0,this.setInternalValue(e),this.dispatchEvent(new wa(e))),r&&this.dispatchedValue!==e&&(this.inputValid=(n=(i=this.input)===null||i===void 0?void 0:i.checkValidity())!==null&&n!==void 0?n:!0,this.inputValid?(this.dispatchedValue=e,this.dispatchEvent(new Ea(e))):this.dispatchEvent(new Oa(this.input.validationMessage)))}handleInput(e){var r;let i=((r=this.input)===null||r===void 0?void 0:r.value)||"";this.setValue(i,e.key=="Escape"||e.key=="Enter")}catchComposingEvents(e){}handleClick(){this.hideSuggestions=!1}handleKeyboardNavigation(e){var r,i;if(e.key==="ArrowDown"||e.key==="ArrowUp"){e.preventDefault(),e.stopPropagation(),this.hideSuggestions=!1;let n=this.visibleSuggestions.findIndex(s=>s.matches(":focus-within")),a;e.key==="ArrowDown"?a=n<this.visibleSuggestions.length-1?n+1:0:a=n>0?n-1:this.visibleSuggestions.length-1,(r=this.visibleSuggestions[a])===null||r===void 0||r.focus(void 0,(i=this.visibleSuggestions[n])===null||i===void 0?void 0:i.isRemoveButtonFocused())}(e.key=="Escape"||e.key=="Enter")&&(this.hideSuggestions=!0)}onSuggestionSelected(e){var r;this.setValue(e.detail,!0),(r=this.input)===null||r===void 0||r.focus(),setTimeout(()=>this.hideSuggestions=!0,0)}onSuggestionRemoved(){setTimeout(()=>this.updateSuggestions())}onFocus(){this.focused=!0,this.hideSuggestions=!1}onMainPanelBlur(){var e,r;!((e=this.mainPanel)===null||e===void 0)&&e.matches(":focus-within")||(this.focused=!1,this.setValue(((r=this.input)===null||r===void 0?void 0:r.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 e=["bottom","top"];Ts(this.mainPanel,this.suggestionsContainer,"bottom",e,"fixed","--text-field-internal-suggest-size",0).then(({x:r,y:i})=>{this.suggestionsContainer.style.left=`${r}px`,this.suggestionsContainer.style.top=`${i}px`})}suggestionsShouldBeDisplayed(){return!this.hideSuggestions&&(this.visibleSuggestions.length||this.providedSuggestions.length)}};B.elementDefinitions={"ft-input-label":st,"ft-ripple":K,"ft-typography":Q,"ft-icon":re,"ft-text-field-suggestion":We};B.styles=[fr,Vs,Ff];J([f()],B.prototype,"label",void 0);J([f({noAccessor:!0})],B.prototype,"value",null);J([T()],B.prototype,"dispatchedValue",void 0);J([f()],B.prototype,"helper",void 0);J([f()],B.prototype,"suggestionsHelper",void 0);J([f({type:Boolean})],B.prototype,"outlined",void 0);J([f({type:Boolean})],B.prototype,"disabled",void 0);J([f({type:Boolean})],B.prototype,"error",void 0);J([f({type:Boolean})],B.prototype,"fixedMenuPosition",void 0);J([f()],B.prototype,"prefix",void 0);J([f()],B.prototype,"icon",void 0);J([f()],B.prototype,"name",void 0);J([f()],B.prototype,"type",void 0);J([f()],B.prototype,"passwordHiddenIcon",void 0);J([f()],B.prototype,"passwordRevealedIcon",void 0);J([f()],B.prototype,"iconVariant",void 0);J([f({type:Boolean})],B.prototype,"filterSuggestions",void 0);J([yt()],B.prototype,"maxLength",void 0);J([f({type:Boolean})],B.prototype,"password",void 0);J([f({type:String})],B.prototype,"autocomplete",void 0);J([f({attribute:!1})],B.prototype,"suggestionsProvider",void 0);J([f({type:Boolean})],B.prototype,"hideCurrentValueSuggestion",void 0);J([T()],B.prototype,"focused",void 0);J([T()],B.prototype,"inputValid",void 0);J([T()],B.prototype,"hidePassword",void 0);J([T()],B.prototype,"hideSuggestions",void 0);J([T()],B.prototype,"visibleSuggestions",void 0);J([T()],B.prototype,"providedSuggestions",void 0);J([U(".ft-text-field--main-panel")],B.prototype,"mainPanel",void 0);J([U(".ft-text-field--input")],B.prototype,"input",void 0);J([U(".ft-text-field-suggestion--new-value")],B.prototype,"newValueSuggestion",void 0);J([U(".ft-text-field--suggestions")],B.prototype,"suggestionsContainer",void 0);J([Ka("ft-text-field-suggestion")],B.prototype,"providedSuggestionsInDom",void 0);J([Go({selector:"ft-text-field-suggestion"})],B.prototype,"slottedSuggestions",void 0);J([Ht()],B.prototype,"handleInput",null);J([Ht()],B.prototype,"catchComposingEvents",null);var Bf={"ft-text-field":B,"ft-text-field-suggestion":We};q(Bf);var Aa=class extends CustomEvent{constructor(e){super("send-feedback",{detail:e})}};var Ae=function(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(n<3?s(a):n>3?s(e,r,a):s(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a},ce=class extends ft(be){constructor(){super(),this.hideTitle=!1,this.withMoreOptionsButton=!1,this.emptyStarIcon="STAR",this.filledStarIcon="STAR_PLAIN",this.emptyLikeIcon="THUMBS_UP",this.filledLikeIcon="THUMBS_UP_PLAIN",this.emptyDislikeIcon="THUMBS_DOWN",this.filledDislikeIcon="THUMBS_DOWN_PLAIN",this.canAccessFeedback=!1,this.canRateThisContent=!1,this.from="",this.feedbackMessage="",this.addI18nContext(le,$f),this.addStore(D)}get configuredRatingType(){var e,r;return(r=(e=this.ratingSummary)===null||e===void 0?void 0:e.type)!==null&&r!==void 0?r:_e.NO_RATING}get ratingTypeOfDoneRatingOfThisContent(){var e,r,i;return(i=(r=(e=this.ratingSummary)===null||e===void 0?void 0:e.rating)===null||r===void 0?void 0:r.type)!==null&&i!==void 0?i:_e.NO_RATING}get ratingValue(){var e,r,i;return(i=(r=(e=this.ratingSummary)===null||e===void 0?void 0:e.rating)===null||r===void 0?void 0:r.value)!==null&&i!==void 0?i:-1}get ratingDate(){var e,r;let i=(r=(e=this.ratingSummary)===null||e===void 0?void 0:e.rating)===null||r===void 0?void 0:r.date;return typeof i=="string"?Zi(i):i}render(){return!this.canAccessFeedback&&!this.canRateThisContent?R:b`
1724
1728
  <div part="container">
1725
1729
  ${this.hideTitle?R:b`
1726
1730
  <ft-typography variant="${ee.title}" part="main-title">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-viewer",
3
- "version": "2.2.13",
3
+ "version": "2.2.14",
4
4
  "description": "File viewer components",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,18 +19,18 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-content-watermark": "2.2.13",
23
- "@fluid-topics/ft-i18n": "2.2.13",
24
- "@fluid-topics/ft-reader-attachments": "2.2.13",
25
- "@fluid-topics/ft-reader-feedback": "2.2.13",
26
- "@fluid-topics/ft-search-result-context": "2.2.13",
27
- "@fluid-topics/ft-wc-utils": "2.2.13",
22
+ "@fluid-topics/ft-content-watermark": "2.2.14",
23
+ "@fluid-topics/ft-i18n": "2.2.14",
24
+ "@fluid-topics/ft-reader-attachments": "2.2.14",
25
+ "@fluid-topics/ft-reader-feedback": "2.2.14",
26
+ "@fluid-topics/ft-search-result-context": "2.2.14",
27
+ "@fluid-topics/ft-wc-utils": "2.2.14",
28
28
  "@fluid-topics/public-api": "1.0.141",
29
29
  "@lit/context": "1.1.6",
30
30
  "lit": "3.3.3"
31
31
  },
32
32
  "devDependencies": {
33
- "@fluid-topics/ft-wc-test-utils": "2.2.13"
33
+ "@fluid-topics/ft-wc-test-utils": "2.2.14"
34
34
  },
35
- "gitHead": "742c6664578e67145345001469f1b4eafa61bcf0"
35
+ "gitHead": "854d6984b9b23dbce23a195e12814084a8317fa5"
36
36
  }