@fluid-topics/ft-text-field 1.2.59 → 1.2.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/ft-text-field.js
CHANGED
|
@@ -16,7 +16,7 @@ import { FtRipple } from "@fluid-topics/ft-ripple";
|
|
|
16
16
|
import { FtIcon, FtIcons } from "@fluid-topics/ft-icon";
|
|
17
17
|
import { styles } from "./ft-text-field.styles";
|
|
18
18
|
import { FtTextFieldSuggestion } from "./ft-text-field-suggestion";
|
|
19
|
-
class FtTextField extends toFtFormComponent(FtLitElement
|
|
19
|
+
class FtTextField extends toFtFormComponent(FtLitElement) {
|
|
20
20
|
constructor() {
|
|
21
21
|
super(...arguments);
|
|
22
22
|
this._value = "";
|
|
@@ -631,7 +631,7 @@ Also for action icons.`,t.colorGray200),contentGlobalSubtle:e.extend("--ft-conte
|
|
|
631
631
|
<slot></slot>
|
|
632
632
|
</ft-typography>
|
|
633
633
|
</div>
|
|
634
|
-
`}focus(r){var i;(i=this.container)===null||i===void 0||i.focus(r)}click(){var r;(r=this.container)===null||r===void 0||r.click()}confirmSuggestion(){this.dispatchEvent(new Qe(this.getValue()))}getValue(){return this.value||this.textContent}get textContent(){return this.assignedNodes.map(r=>r.textContent).join("").trim()}onKeyDown(r){["Enter"," "].includes(r.key)&&(r.preventDefault(),r.stopPropagation(),this.confirmSuggestion())}};_.elementDefinitions={"ft-ripple":E,"ft-typography":T,"ft-icon":B};_.styles=$o;_e([(0,ae.property)()],_.prototype,"value",void 0);_e([(0,ae.property)()],_.prototype,"helper",void 0);_e([(0,ae.query)(".ft-text-field-suggestion")],_.prototype,"container",void 0);_e([(0,ae.queryAssignedNodes)()],_.prototype,"assignedNodes",void 0);var C=function(o,r,i,n){var l=arguments.length,c=l<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,i):n,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,r,i,n);else for(var f=o.length-1;f>=0;f--)(d=o[f])&&(c=(l<3?d(c):l>3?d(r,i,c):d(r,i))||c);return l>3&&c&&Object.defineProperty(r,i,c),c},m=class extends(0,Q.toFtFormComponent)(Q.FtLitElement
|
|
634
|
+
`}focus(r){var i;(i=this.container)===null||i===void 0||i.focus(r)}click(){var r;(r=this.container)===null||r===void 0||r.click()}confirmSuggestion(){this.dispatchEvent(new Qe(this.getValue()))}getValue(){return this.value||this.textContent}get textContent(){return this.assignedNodes.map(r=>r.textContent).join("").trim()}onKeyDown(r){["Enter"," "].includes(r.key)&&(r.preventDefault(),r.stopPropagation(),this.confirmSuggestion())}};_.elementDefinitions={"ft-ripple":E,"ft-typography":T,"ft-icon":B};_.styles=$o;_e([(0,ae.property)()],_.prototype,"value",void 0);_e([(0,ae.property)()],_.prototype,"helper",void 0);_e([(0,ae.query)(".ft-text-field-suggestion")],_.prototype,"container",void 0);_e([(0,ae.queryAssignedNodes)()],_.prototype,"assignedNodes",void 0);var C=function(o,r,i,n){var l=arguments.length,c=l<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,i):n,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,r,i,n);else for(var f=o.length-1;f>=0;f--)(d=o[f])&&(c=(l<3?d(c):l>3?d(r,i,c):d(r,i))||c);return l>3&&c&&Object.defineProperty(r,i,c),c},m=class extends(0,Q.toFtFormComponent)(Q.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=re.EYE_SLASH,this.passwordRevealedIcon=re.EYE,this.filterSuggestions=!1,this.password=!1,this.focused=!1,this.hidePassword=!0,this.hideSuggestions=!1,this.visibleSuggestions=[],this.providedSuggestions=[]}get value(){return this._value||""}set value(r){this.setInternalValue(r||""),this.dispatchedValue=r||""}setInternalValue(r){let i=this._value;this._value=r||"",this.setFormValue(this._value),this.requestUpdate("value",i)}focus(){var r;(r=this.input)===null||r===void 0||r.focus()}blur(){var r;(r=this.input)===null||r===void 0||r.blur()}render(){let r={"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.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()},i=this.suggestionsProvider&&this.value&&this.value!=""&&!this.providedSuggestions.map(c=>c.label).includes(this.value),l=!this.suggestionsProvider&&this.filterSuggestions&&this.value&&this.value!=""||i;return A.html`
|
|
635
635
|
<div class="${(0,Uo.classMap)(r)}">
|
|
636
636
|
<div class="ft-text-field--main-panel"
|
|
637
637
|
@keydown=${this.handleKeyboardNavigation}
|