@fluid-topics/ft-text-field 1.0.47 → 1.0.48

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.
@@ -157,7 +157,7 @@ class FtTextField extends FtLitElement {
157
157
  contentAvailableCallback(props) {
158
158
  var _a, _b;
159
159
  super.contentAvailableCallback(props);
160
- if (!this.hideSuggestions && this.visibleSuggestions.length > 0) {
160
+ if (props.has("focused") && !this.hideSuggestions && this.visibleSuggestions.length > 0) {
161
161
  const rect = (_a = this.input) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
162
162
  const suggestRect = (_b = this.suggestionsContainer) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
163
163
  if (rect && suggestRect) {
@@ -615,7 +615,7 @@ const F=Symbol.for(""),K=t=>{if((null==t?void 0:t.r)===F)return null==t?void 0:t
615
615
  .variant=${this.iconVariant}
616
616
  .value=${this.icon}
617
617
  @click=${()=>{var t;return null===(t=this.input)||void 0===t?void 0:t.focus()}}></ft-icon>
618
- `:i.nothing}updated(t){super.updated(t),(t.has("value")||t.has("filterSuggestions"))&&this.filterSuggestionsIfNeeded(),t.has("value")&&null!=t.get("value")&&(this.hideSuggestions=!1),t.has("dispatchedValue")&&null!=t.get("dispatchedValue")&&(this.hideSuggestions=!0)}filterSuggestionsIfNeeded(){this.filterSuggestions?(this.suggestions.forEach((t=>t.hidden=!t.getValue().toLowerCase().includes(this.value.toLowerCase()))),this.visibleSuggestions=this.suggestions.filter((t=>!t.hidden))):this.visibleSuggestions=this.suggestions}contentAvailableCallback(t){var e,i;if(super.contentAvailableCallback(t),!this.hideSuggestions&&this.visibleSuggestions.length>0){const t=null===(e=this.input)||void 0===e?void 0:e.getBoundingClientRect(),o=null===(i=this.suggestionsContainer)||void 0===i?void 0:i.getBoundingClientRect();t&&o&&(this.suggestionsOnTop=t.bottom+o.height>window.innerHeight&&t.top-o.height>0)}}setValue(t,e=!1){this.value!==t&&(this.setInternalValue(t),this.dispatchEvent(new CustomEvent("live-change",{detail:t}))),e&&this.dispatchedValue!==t&&(this.dispatchedValue=t,this.dispatchEvent(new CustomEvent("change",{detail:t})))}handleInput(t){var e;const i=(null===(e=this.input)||void 0===e?void 0:e.value)||"";this.setValue(i,"Escape"==t.key||"Enter"==t.key)}handleClick(){this.hideSuggestions=!1}handleKeyboardNavigation(t){var e;if("ArrowDown"===t.key||"ArrowUp"===t.key){t.preventDefault(),t.stopPropagation(),this.hideSuggestions=!1;const i=this.visibleSuggestions.findIndex((t=>t.matches(":focus-within")));let o;o="ArrowDown"===t.key?i<this.visibleSuggestions.length-1?i+1:0:i>0?i-1:this.visibleSuggestions.length-1,null===(e=this.visibleSuggestions[o])||void 0===e||e.focus()}"Escape"!=t.key&&"Enter"!=t.key||(this.hideSuggestions=!0)}onSuggestionSelected(t){var e;this.setValue(t.detail,!0),null===(e=this.input)||void 0===e||e.focus(),setTimeout((()=>this.hideSuggestions=!0),0)}onFocus(){this.focused=!0,this.hideSuggestions=!1}onMainPanelBlur(){var t,e;(null===(t=this.mainPanel)||void 0===t?void 0:t.matches(":focus-within"))||(this.focused=!1,this.setValue((null===(e=this.input)||void 0===e?void 0:e.value)||"",!0))}togglePasswordVisibility(){this.hidePassword=!this.hidePassword}}_e.elementDefinitions={"ft-input-label":pe,"ft-ripple":ke,"ft-typography":ne,"ft-icon":Ae},_e.styles=[Jt,De],Ze([o.property()],_e.prototype,"label",void 0),Ze([o.property({noAccessor:!0})],_e.prototype,"value",null),Ze([o.state()],_e.prototype,"dispatchedValue",void 0),Ze([o.property()],_e.prototype,"helper",void 0),Ze([o.property({type:Boolean})],_e.prototype,"outlined",void 0),Ze([o.property({type:Boolean})],_e.prototype,"disabled",void 0),Ze([o.property({type:Boolean})],_e.prototype,"error",void 0),Ze([o.property()],_e.prototype,"prefix",void 0),Ze([o.property()],_e.prototype,"icon",void 0),Ze([o.property()],_e.prototype,"passwordHiddenIcon",void 0),Ze([o.property()],_e.prototype,"passwordRevealedIcon",void 0),Ze([o.property()],_e.prototype,"iconVariant",void 0),Ze([o.property({type:Boolean})],_e.prototype,"filterSuggestions",void 0),Ze([o.property({type:Number})],_e.prototype,"maxLength",void 0),Ze([o.property({type:Boolean})],_e.prototype,"password",void 0),Ze([o.state()],_e.prototype,"focused",void 0),Ze([o.state()],_e.prototype,"hidePassword",void 0),Ze([o.state()],_e.prototype,"suggestionsOnTop",void 0),Ze([o.state()],_e.prototype,"hideSuggestions",void 0),Ze([o.state()],_e.prototype,"visibleSuggestions",void 0),Ze([o.query(".ft-text-field--main-panel")],_e.prototype,"mainPanel",void 0),Ze([o.query(".ft-text-field--input")],_e.prototype,"input",void 0),Ze([o.query(".ft-text-field--suggestions")],_e.prototype,"suggestionsContainer",void 0),Ze([o.queryAssignedElements({selector:"ft-text-field-suggestion"})],_e.prototype,"suggestions",void 0);const Me=i.css`
618
+ `:i.nothing}updated(t){super.updated(t),(t.has("value")||t.has("filterSuggestions"))&&this.filterSuggestionsIfNeeded(),t.has("value")&&null!=t.get("value")&&(this.hideSuggestions=!1),t.has("dispatchedValue")&&null!=t.get("dispatchedValue")&&(this.hideSuggestions=!0)}filterSuggestionsIfNeeded(){this.filterSuggestions?(this.suggestions.forEach((t=>t.hidden=!t.getValue().toLowerCase().includes(this.value.toLowerCase()))),this.visibleSuggestions=this.suggestions.filter((t=>!t.hidden))):this.visibleSuggestions=this.suggestions}contentAvailableCallback(t){var e,i;if(super.contentAvailableCallback(t),t.has("focused")&&!this.hideSuggestions&&this.visibleSuggestions.length>0){const t=null===(e=this.input)||void 0===e?void 0:e.getBoundingClientRect(),o=null===(i=this.suggestionsContainer)||void 0===i?void 0:i.getBoundingClientRect();t&&o&&(this.suggestionsOnTop=t.bottom+o.height>window.innerHeight&&t.top-o.height>0)}}setValue(t,e=!1){this.value!==t&&(this.setInternalValue(t),this.dispatchEvent(new CustomEvent("live-change",{detail:t}))),e&&this.dispatchedValue!==t&&(this.dispatchedValue=t,this.dispatchEvent(new CustomEvent("change",{detail:t})))}handleInput(t){var e;const i=(null===(e=this.input)||void 0===e?void 0:e.value)||"";this.setValue(i,"Escape"==t.key||"Enter"==t.key)}handleClick(){this.hideSuggestions=!1}handleKeyboardNavigation(t){var e;if("ArrowDown"===t.key||"ArrowUp"===t.key){t.preventDefault(),t.stopPropagation(),this.hideSuggestions=!1;const i=this.visibleSuggestions.findIndex((t=>t.matches(":focus-within")));let o;o="ArrowDown"===t.key?i<this.visibleSuggestions.length-1?i+1:0:i>0?i-1:this.visibleSuggestions.length-1,null===(e=this.visibleSuggestions[o])||void 0===e||e.focus()}"Escape"!=t.key&&"Enter"!=t.key||(this.hideSuggestions=!0)}onSuggestionSelected(t){var e;this.setValue(t.detail,!0),null===(e=this.input)||void 0===e||e.focus(),setTimeout((()=>this.hideSuggestions=!0),0)}onFocus(){this.focused=!0,this.hideSuggestions=!1}onMainPanelBlur(){var t,e;(null===(t=this.mainPanel)||void 0===t?void 0:t.matches(":focus-within"))||(this.focused=!1,this.setValue((null===(e=this.input)||void 0===e?void 0:e.value)||"",!0))}togglePasswordVisibility(){this.hidePassword=!this.hidePassword}}_e.elementDefinitions={"ft-input-label":pe,"ft-ripple":ke,"ft-typography":ne,"ft-icon":Ae},_e.styles=[Jt,De],Ze([o.property()],_e.prototype,"label",void 0),Ze([o.property({noAccessor:!0})],_e.prototype,"value",null),Ze([o.state()],_e.prototype,"dispatchedValue",void 0),Ze([o.property()],_e.prototype,"helper",void 0),Ze([o.property({type:Boolean})],_e.prototype,"outlined",void 0),Ze([o.property({type:Boolean})],_e.prototype,"disabled",void 0),Ze([o.property({type:Boolean})],_e.prototype,"error",void 0),Ze([o.property()],_e.prototype,"prefix",void 0),Ze([o.property()],_e.prototype,"icon",void 0),Ze([o.property()],_e.prototype,"passwordHiddenIcon",void 0),Ze([o.property()],_e.prototype,"passwordRevealedIcon",void 0),Ze([o.property()],_e.prototype,"iconVariant",void 0),Ze([o.property({type:Boolean})],_e.prototype,"filterSuggestions",void 0),Ze([o.property({type:Number})],_e.prototype,"maxLength",void 0),Ze([o.property({type:Boolean})],_e.prototype,"password",void 0),Ze([o.state()],_e.prototype,"focused",void 0),Ze([o.state()],_e.prototype,"hidePassword",void 0),Ze([o.state()],_e.prototype,"suggestionsOnTop",void 0),Ze([o.state()],_e.prototype,"hideSuggestions",void 0),Ze([o.state()],_e.prototype,"visibleSuggestions",void 0),Ze([o.query(".ft-text-field--main-panel")],_e.prototype,"mainPanel",void 0),Ze([o.query(".ft-text-field--input")],_e.prototype,"input",void 0),Ze([o.query(".ft-text-field--suggestions")],_e.prototype,"suggestionsContainer",void 0),Ze([o.queryAssignedElements({selector:"ft-text-field-suggestion"})],_e.prototype,"suggestions",void 0);const Me=i.css`
619
619
  .ft-text-field-suggestion {
620
620
  position: relative;
621
621
  padding: 8px 16px;
@@ -726,7 +726,7 @@ class di extends Ut{constructor(t){if(super(t),this.et=G,t.type!==Mt)throw Error
726
726
  .variant=${this.iconVariant}
727
727
  .value=${this.icon}
728
728
  @click=${()=>{var t;return null===(t=this.input)||void 0===t?void 0:t.focus()}}></ft-icon>
729
- `:G}updated(t){super.updated(t),(t.has("value")||t.has("filterSuggestions"))&&this.filterSuggestionsIfNeeded(),t.has("value")&&null!=t.get("value")&&(this.hideSuggestions=!1),t.has("dispatchedValue")&&null!=t.get("dispatchedValue")&&(this.hideSuggestions=!0)}filterSuggestionsIfNeeded(){this.filterSuggestions?(this.suggestions.forEach((t=>t.hidden=!t.getValue().toLowerCase().includes(this.value.toLowerCase()))),this.visibleSuggestions=this.suggestions.filter((t=>!t.hidden))):this.visibleSuggestions=this.suggestions}contentAvailableCallback(t){var e,i;if(super.contentAvailableCallback(t),!this.hideSuggestions&&this.visibleSuggestions.length>0){const t=null===(e=this.input)||void 0===e?void 0:e.getBoundingClientRect(),o=null===(i=this.suggestionsContainer)||void 0===i?void 0:i.getBoundingClientRect();t&&o&&(this.suggestionsOnTop=t.bottom+o.height>window.innerHeight&&t.top-o.height>0)}}setValue(t,e=!1){this.value!==t&&(this.setInternalValue(t),this.dispatchEvent(new CustomEvent("live-change",{detail:t}))),e&&this.dispatchedValue!==t&&(this.dispatchedValue=t,this.dispatchEvent(new CustomEvent("change",{detail:t})))}handleInput(t){var e;const i=(null===(e=this.input)||void 0===e?void 0:e.value)||"";this.setValue(i,"Escape"==t.key||"Enter"==t.key)}handleClick(){this.hideSuggestions=!1}handleKeyboardNavigation(t){var e;if("ArrowDown"===t.key||"ArrowUp"===t.key){t.preventDefault(),t.stopPropagation(),this.hideSuggestions=!1;const i=this.visibleSuggestions.findIndex((t=>t.matches(":focus-within")));let o;o="ArrowDown"===t.key?i<this.visibleSuggestions.length-1?i+1:0:i>0?i-1:this.visibleSuggestions.length-1,null===(e=this.visibleSuggestions[o])||void 0===e||e.focus()}"Escape"!=t.key&&"Enter"!=t.key||(this.hideSuggestions=!0)}onSuggestionSelected(t){var e;this.setValue(t.detail,!0),null===(e=this.input)||void 0===e||e.focus(),setTimeout((()=>this.hideSuggestions=!0),0)}onFocus(){this.focused=!0,this.hideSuggestions=!1}onMainPanelBlur(){var t,e;(null===(t=this.mainPanel)||void 0===t?void 0:t.matches(":focus-within"))||(this.focused=!1,this.setValue((null===(e=this.input)||void 0===e?void 0:e.value)||"",!0))}togglePasswordVisibility(){this.hidePassword=!this.hidePassword}}Ri.elementDefinitions={"ft-input-label":ei,"ft-ripple":ci,"ft-typography":Ye,"ft-icon":ki},Ri.styles=[We,Ni],Ci([o()],Ri.prototype,"label",void 0),Ci([o({noAccessor:!0})],Ri.prototype,"value",null),Ci([s()],Ri.prototype,"dispatchedValue",void 0),Ci([o()],Ri.prototype,"helper",void 0),Ci([o({type:Boolean})],Ri.prototype,"outlined",void 0),Ci([o({type:Boolean})],Ri.prototype,"disabled",void 0),Ci([o({type:Boolean})],Ri.prototype,"error",void 0),Ci([o()],Ri.prototype,"prefix",void 0),Ci([o()],Ri.prototype,"icon",void 0),Ci([o()],Ri.prototype,"passwordHiddenIcon",void 0),Ci([o()],Ri.prototype,"passwordRevealedIcon",void 0),Ci([o()],Ri.prototype,"iconVariant",void 0),Ci([o({type:Boolean})],Ri.prototype,"filterSuggestions",void 0),Ci([o({type:Number})],Ri.prototype,"maxLength",void 0),Ci([o({type:Boolean})],Ri.prototype,"password",void 0),Ci([s()],Ri.prototype,"focused",void 0),Ci([s()],Ri.prototype,"hidePassword",void 0),Ci([s()],Ri.prototype,"suggestionsOnTop",void 0),Ci([s()],Ri.prototype,"hideSuggestions",void 0),Ci([s()],Ri.prototype,"visibleSuggestions",void 0),Ci([r(".ft-text-field--main-panel")],Ri.prototype,"mainPanel",void 0),Ci([r(".ft-text-field--input")],Ri.prototype,"input",void 0),Ci([r(".ft-text-field--suggestions")],Ri.prototype,"suggestionsContainer",void 0),Ci([p({selector:"ft-text-field-suggestion"})],Ri.prototype,"suggestions",void 0);const Mi=v`
729
+ `:G}updated(t){super.updated(t),(t.has("value")||t.has("filterSuggestions"))&&this.filterSuggestionsIfNeeded(),t.has("value")&&null!=t.get("value")&&(this.hideSuggestions=!1),t.has("dispatchedValue")&&null!=t.get("dispatchedValue")&&(this.hideSuggestions=!0)}filterSuggestionsIfNeeded(){this.filterSuggestions?(this.suggestions.forEach((t=>t.hidden=!t.getValue().toLowerCase().includes(this.value.toLowerCase()))),this.visibleSuggestions=this.suggestions.filter((t=>!t.hidden))):this.visibleSuggestions=this.suggestions}contentAvailableCallback(t){var e,i;if(super.contentAvailableCallback(t),t.has("focused")&&!this.hideSuggestions&&this.visibleSuggestions.length>0){const t=null===(e=this.input)||void 0===e?void 0:e.getBoundingClientRect(),o=null===(i=this.suggestionsContainer)||void 0===i?void 0:i.getBoundingClientRect();t&&o&&(this.suggestionsOnTop=t.bottom+o.height>window.innerHeight&&t.top-o.height>0)}}setValue(t,e=!1){this.value!==t&&(this.setInternalValue(t),this.dispatchEvent(new CustomEvent("live-change",{detail:t}))),e&&this.dispatchedValue!==t&&(this.dispatchedValue=t,this.dispatchEvent(new CustomEvent("change",{detail:t})))}handleInput(t){var e;const i=(null===(e=this.input)||void 0===e?void 0:e.value)||"";this.setValue(i,"Escape"==t.key||"Enter"==t.key)}handleClick(){this.hideSuggestions=!1}handleKeyboardNavigation(t){var e;if("ArrowDown"===t.key||"ArrowUp"===t.key){t.preventDefault(),t.stopPropagation(),this.hideSuggestions=!1;const i=this.visibleSuggestions.findIndex((t=>t.matches(":focus-within")));let o;o="ArrowDown"===t.key?i<this.visibleSuggestions.length-1?i+1:0:i>0?i-1:this.visibleSuggestions.length-1,null===(e=this.visibleSuggestions[o])||void 0===e||e.focus()}"Escape"!=t.key&&"Enter"!=t.key||(this.hideSuggestions=!0)}onSuggestionSelected(t){var e;this.setValue(t.detail,!0),null===(e=this.input)||void 0===e||e.focus(),setTimeout((()=>this.hideSuggestions=!0),0)}onFocus(){this.focused=!0,this.hideSuggestions=!1}onMainPanelBlur(){var t,e;(null===(t=this.mainPanel)||void 0===t?void 0:t.matches(":focus-within"))||(this.focused=!1,this.setValue((null===(e=this.input)||void 0===e?void 0:e.value)||"",!0))}togglePasswordVisibility(){this.hidePassword=!this.hidePassword}}Ri.elementDefinitions={"ft-input-label":ei,"ft-ripple":ci,"ft-typography":Ye,"ft-icon":ki},Ri.styles=[We,Ni],Ci([o()],Ri.prototype,"label",void 0),Ci([o({noAccessor:!0})],Ri.prototype,"value",null),Ci([s()],Ri.prototype,"dispatchedValue",void 0),Ci([o()],Ri.prototype,"helper",void 0),Ci([o({type:Boolean})],Ri.prototype,"outlined",void 0),Ci([o({type:Boolean})],Ri.prototype,"disabled",void 0),Ci([o({type:Boolean})],Ri.prototype,"error",void 0),Ci([o()],Ri.prototype,"prefix",void 0),Ci([o()],Ri.prototype,"icon",void 0),Ci([o()],Ri.prototype,"passwordHiddenIcon",void 0),Ci([o()],Ri.prototype,"passwordRevealedIcon",void 0),Ci([o()],Ri.prototype,"iconVariant",void 0),Ci([o({type:Boolean})],Ri.prototype,"filterSuggestions",void 0),Ci([o({type:Number})],Ri.prototype,"maxLength",void 0),Ci([o({type:Boolean})],Ri.prototype,"password",void 0),Ci([s()],Ri.prototype,"focused",void 0),Ci([s()],Ri.prototype,"hidePassword",void 0),Ci([s()],Ri.prototype,"suggestionsOnTop",void 0),Ci([s()],Ri.prototype,"hideSuggestions",void 0),Ci([s()],Ri.prototype,"visibleSuggestions",void 0),Ci([r(".ft-text-field--main-panel")],Ri.prototype,"mainPanel",void 0),Ci([r(".ft-text-field--input")],Ri.prototype,"input",void 0),Ci([r(".ft-text-field--suggestions")],Ri.prototype,"suggestionsContainer",void 0),Ci([p({selector:"ft-text-field-suggestion"})],Ri.prototype,"suggestions",void 0);const Mi=v`
730
730
  .ft-text-field-suggestion {
731
731
  position: relative;
732
732
  padding: 8px 16px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-text-field",
3
- "version": "1.0.47",
3
+ "version": "1.0.48",
4
4
  "description": "A fluidtopics text field",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,12 +19,12 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-icon": "1.0.47",
23
- "@fluid-topics/ft-input-label": "1.0.47",
24
- "@fluid-topics/ft-ripple": "1.0.47",
25
- "@fluid-topics/ft-typography": "1.0.47",
26
- "@fluid-topics/ft-wc-utils": "1.0.47",
22
+ "@fluid-topics/ft-icon": "1.0.48",
23
+ "@fluid-topics/ft-input-label": "1.0.48",
24
+ "@fluid-topics/ft-ripple": "1.0.48",
25
+ "@fluid-topics/ft-typography": "1.0.48",
26
+ "@fluid-topics/ft-wc-utils": "1.0.48",
27
27
  "lit": "2.7.2"
28
28
  },
29
- "gitHead": "6313471d9f5ceea14a13311e9a6cc24b6fa6f044"
29
+ "gitHead": "a07dca06ede4358afbfe00c06b1ea1da90e3ff51"
30
30
  }