@digital-realty/ix-textbox 2.2.10 → 2.2.11

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.
@@ -146,7 +146,7 @@ export declare class IxTextbox extends LitElement {
146
146
  * https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
147
147
  */
148
148
  autocomplete: string;
149
- textarea: any;
149
+ textarea: HTMLElement | null | undefined;
150
150
  handleKeydownHandler: any;
151
151
  connectedCallback(): void;
152
152
  firstUpdated(): Promise<void>;
package/dist/IxTextbox.js CHANGED
@@ -154,7 +154,9 @@ export class IxTextbox extends LitElement {
154
154
  this.resizeTextArea = () => {
155
155
  if (this.textarea) {
156
156
  this.textarea.style.height = 'auto';
157
- this.textarea.style.height = `${this.textarea.scrollHeight}px`;
157
+ if (this.textarea.scrollHeight > 0) {
158
+ this.textarea.style.height = `${this.textarea.scrollHeight}px`;
159
+ }
158
160
  }
159
161
  };
160
162
  }
@@ -1 +1 @@
1
- {"version":3,"file":"IxTextbox.js","sourceRoot":"","sources":["../src/IxTextbox.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,IAAI,IAAI,UAAU,EAAe,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,8CAA8C,CAAC;AACtD,OAAO,gDAAgD,CAAC;AAKxD,OAAO,oCAAoC,CAAC;AAC5C,OAAO,kDAAkD,CAAC;AAE1D,MAAM,OAAO,SAAU,SAAQ,UAAU;IAAzC;;QAI8C,WAAM,GAAG,KAAK,CAAC;QAEf,aAAQ,GAAG,KAAK,CAAC;QAE7D;;;;WAIG;QACyC,UAAK,GAAG,KAAK,CAAC;QAE1D;;;;;;;WAOG;QACoC,cAAS,GAAG,EAAE,CAAC;QAE1C,UAAK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EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;8CACvB;AAMjB;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;+CACvB;AAM0B;IAA3C,QAAQ,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;iDAAqB;AAMrB;IAA1C,QAAQ,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;gDAAoB;AAMlC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAAU;AAGR;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAAyB;AAOzC;IAAX,QAAQ,EAAE;sCAAU;AAQO;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAgB;AAO/B;IAAX,QAAQ,EAAE;sCAAU;AAQO;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAgB;AAQ/B;IAAX,QAAQ,EAAE;0CAAc;AAEI;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CAAkB;AAQF;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAAkB;AAOjB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAAkB;AAQjD;IAAX,QAAQ,EAAE;uCAAW;AAsBtB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uCAC4B;AAQ3B;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CAAmB","sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { html as staticHtml, StaticValue, literal } from 'lit/static-html.js';\nimport { property, query } from 'lit/decorators.js';\nimport '@material/web/textfield/filled-text-field.js';\nimport '@material/web/textfield/outlined-text-field.js';\nimport {\n TextFieldType,\n UnsupportedTextFieldType,\n} from '@material/web/textfield/internal/text-field.js';\nimport '@digital-realty/ix-icon/ix-icon.js';\nimport '@digital-realty/ix-phone-input/ix-phone-input.js';\n\nexport class IxTextbox extends LitElement {\n @query('.textfield')\n readonly component!: HTMLInputElement;\n\n @property({ type: Boolean, reflect: true }) filled = false;\n\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /**\n * Gets or sets whether or not the text field is in a visually invalid state.\n *\n * Calling `reportValidity()` will automatically update `error`.\n */\n @property({ type: Boolean, reflect: true }) error = false;\n\n /**\n * The error message that replaces supporting text when `error` is true. If\n * `errorText` is an empty string, then the supporting text will continue to\n * show.\n *\n * Calling `reportValidity()` will automatically update `errorText` to the\n * native `validationMessage`.\n */\n @property({ attribute: 'error-text' }) errorText = '';\n\n @property() label = '';\n\n @property({ type: Boolean, reflect: true }) required = false;\n\n /**\n * The current value of the text field. It is always a string.\n */\n @property() value = '';\n\n /**\n * The name of the text field. It is always a string.\n */\n @property() name = '';\n\n /**\n * An optional prefix to display before the input value.\n */\n @property({ attribute: 'prefix-text' }) prefixText = '';\n\n /**\n * An optional suffix to display after the input value.\n */\n @property({ attribute: 'suffix-text' }) suffixText = '';\n\n /**\n * Name of icon. It is always a string.\n */\n @property({ attribute: 'leading-icon' })\n leadingIcon = '';\n\n /**\n * Name of icon. It is always a string.\n */\n @property({ attribute: 'trailing-icon' })\n trailingIcon = '';\n\n /**\n * Conveys additional information below the text field, such as how it should\n * be used.\n */\n @property({ attribute: 'supporting-text' }) supportingText = '';\n\n /**\n * Override the input text CSS `direction`. Useful for RTL languages that use\n * LTR notation for fractions.\n */\n @property({ attribute: 'text-direction' }) textDirection = '';\n\n /**\n * The number of rows to display for a `type=\"textarea\"` text field.\n * Defaults to 2.\n */\n @property({ type: Number }) rows = 2;\n\n // <input> properties\n @property({ reflect: true }) override inputMode = '';\n\n /**\n * Defines the greatest value in the range of permitted values.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#max\n */\n @property() max = '';\n\n /**\n * The maximum number of characters a user can enter into the text field. Set\n * to -1 for none.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#maxlength\n */\n @property({ type: Number }) maxLength = -1;\n\n /**\n * Defines the most negative value in the range of permitted values.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#min\n */\n @property() min = '';\n\n /**\n * The minimum number of characters a user can enter into the text field. Set\n * to -1 for none.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#minlength\n */\n @property({ type: Number }) minLength = -1;\n\n /**\n * A regular expression that the text field's value must match to pass\n * constraint validation.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#pattern\n */\n @property() pattern = '';\n\n @property({ reflect: true }) placeholder = '';\n\n /**\n * Indicates whether or not a user should be able to edit the text field's\n * value.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#readonly\n */\n @property({ type: Boolean, reflect: true }) readOnly = false;\n\n /**\n * Indicates that input accepts multiple email addresses.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email#multiple\n */\n @property({ type: Boolean, reflect: true }) multiple = false;\n\n /**\n * Returns or sets the element's step attribute, which works with min and max\n * to limit the increments at which a numeric or date-time value can be set.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#step\n */\n @property() step = '';\n\n /**\n * The `<input>` type to use, defaults to \"text\". The type greatly changes how\n * the text field behaves.\n *\n * Text fields support a limited number of `<input>` types:\n *\n * - text\n * - textarea\n * - email\n * - number\n * - password\n * - search\n * - tel\n * - url\n *\n * See\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types\n * for more details on each input type.\n */\n @property({ reflect: true })\n type: TextFieldType | UnsupportedTextFieldType = 'text';\n\n /**\n * Describes what, if any, type of autocomplete functionality the input\n * should provide.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete\n */\n @property({ reflect: true }) autocomplete = '';\n\n textarea: any;\n\n handleKeydownHandler: any = undefined;\n\n connectedCallback() {\n super.connectedCallback();\n if (this.type === 'textarea') {\n this.addEventListener('input', this.resizeTextArea);\n this.addEventListener('keydown', this.resizeTextArea);\n window.addEventListener('load', this.resizeTextArea);\n }\n }\n\n async firstUpdated() {\n if (this.type === 'textarea') {\n if (this.component instanceof LitElement) {\n await this.component.updateComplete;\n }\n await this.updateComplete;\n\n this.textarea = this.component?.shadowRoot?.querySelector('textarea');\n this.resizeTextArea();\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n if (this.handleKeydownHandler) {\n this.removeEventListener('input', this.resizeTextArea);\n this.removeEventListener('keydown', this.resizeTextArea);\n window.removeEventListener('load', this.resizeTextArea);\n }\n }\n\n resizeTextArea = () => {\n if (this.textarea) {\n this.textarea.style.height = 'auto';\n this.textarea.style.height = `${this.textarea.scrollHeight}px`;\n }\n };\n\n focus() {\n this.component.focus();\n }\n\n protected createRenderRoot() {\n return this;\n }\n\n renderStyles() {\n return html`\n <style>\n [error] {\n --md-outlined-field-outline-width: 2px;\n }\n ix-textbox {\n &.comment {\n --md-outlined-text-field-container-shape: 32px;\n --md-outlined-text-field-outline-color: rgba(9, 34, 65, 0.12);\n --md-outlined-text-field-outline-width: 1px;\n --md-outlined-text-field-hover-outline-color: rgba(9, 34, 65, 0.12);\n --md-outlined-text-field-hover-outline-width: 1px;\n --md-outlined-text-field-focus-outline-color: rgba(9, 34, 65, 0.12);\n --md-outlined-text-field-focus-outline-width: 1px;\n --md-outlined-text-field-input-text-placeholder-color: rgba(\n 9,\n 34,\n 65,\n 0.42\n );\n --md-filled-text-field-focus-active-indicator-color: rgba(\n 9,\n 34,\n 65,\n 0.12\n );\n --md-outlined-text-field-input-text-color: rgb(9, 34, 65);\n --md-outlined-field-leading-space: 8px;\n }\n [type='textarea'] {\n resize: none;\n }\n }\n </style>\n `;\n }\n\n protected override render() {\n if (this.type === 'tel') {\n return html`<ix-phone-input\n class=\"textfield\"\n style=\"display: block;\"\n ?disabled=${this.disabled}\n ?required=${this.required}\n ?error=${this.error}\n error-text=${this.errorText}\n supporting-text=${this.supportingText}\n type=${this.type}\n label=${this.label}\n name=${this.name}\n .value=${this.value ?? ''}\n ></ix-phone-input>`;\n }\n\n const tag: StaticValue = this.filled\n ? literal`md-filled-text-field`\n : literal`md-outlined-text-field`;\n\n return staticHtml`\n ${this.renderStyles()}\n <${tag}\n class=\"textfield\"\n style=\"display: block;\"\n ?disabled=${this.disabled}\n ?required=${this.required}\n ?error=${this.error}\n ?multipule=${this.multiple}\n ?readOnly=${this.readOnly}\n ?has-leading-icon=${this.leadingIcon.length > 0}\n ?has-trailing-icon=${this.trailingIcon.length > 0}\n step=${this.step || nothing}\n autocomplete=${this.autocomplete || nothing}\n error-text=${this.errorText}\n placeholder=${this.placeholder}\n text-direction=${this.textDirection}\n rows=${this.rows}\n max=${this.max}\n maxLength=${this.maxLength}\n min=${this.min}\n minLength=${this.minLength}\n pattern=${this.pattern}\n prefix-text=${this.prefixText}\n suffix-text=${this.suffixText}\n supporting-text=${this.supportingText}\n inputMode=${this.inputMode}\n type=${this.type}\n label=${this.label}\n name=${this.name}\n .value=${this.value ?? ''}\n >\n ${\n this.leadingIcon\n ? html`<ix-icon slot=\"leading-icon\">${this.leadingIcon}</ix-icon>`\n : nothing\n }\n ${\n this.trailingIcon\n ? html`<ix-icon slot=\"trailing-icon\"\n >${this.trailingIcon}</ix-icon\n >`\n : nothing\n }\n </${tag}>\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"IxTextbox.js","sourceRoot":"","sources":["../src/IxTextbox.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,IAAI,IAAI,UAAU,EAAe,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAA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C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAAkB;AAQjD;IAAX,QAAQ,EAAE;uCAAW;AAsBtB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uCAC4B;AAQ3B;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CAAmB","sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { html as staticHtml, StaticValue, literal } from 'lit/static-html.js';\nimport { property, query } from 'lit/decorators.js';\nimport '@material/web/textfield/filled-text-field.js';\nimport '@material/web/textfield/outlined-text-field.js';\nimport {\n TextFieldType,\n UnsupportedTextFieldType,\n} from '@material/web/textfield/internal/text-field.js';\nimport '@digital-realty/ix-icon/ix-icon.js';\nimport '@digital-realty/ix-phone-input/ix-phone-input.js';\n\nexport class IxTextbox extends LitElement {\n @query('.textfield')\n readonly component!: HTMLInputElement;\n\n @property({ type: Boolean, reflect: true }) filled = false;\n\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /**\n * Gets or sets whether or not the text field is in a visually invalid state.\n *\n * Calling `reportValidity()` will automatically update `error`.\n */\n @property({ type: Boolean, reflect: true }) error = false;\n\n /**\n * The error message that replaces supporting text when `error` is true. If\n * `errorText` is an empty string, then the supporting text will continue to\n * show.\n *\n * Calling `reportValidity()` will automatically update `errorText` to the\n * native `validationMessage`.\n */\n @property({ attribute: 'error-text' }) errorText = '';\n\n @property() label = '';\n\n @property({ type: Boolean, reflect: true }) required = false;\n\n /**\n * The current value of the text field. It is always a string.\n */\n @property() value = '';\n\n /**\n * The name of the text field. It is always a string.\n */\n @property() name = '';\n\n /**\n * An optional prefix to display before the input value.\n */\n @property({ attribute: 'prefix-text' }) prefixText = '';\n\n /**\n * An optional suffix to display after the input value.\n */\n @property({ attribute: 'suffix-text' }) suffixText = '';\n\n /**\n * Name of icon. It is always a string.\n */\n @property({ attribute: 'leading-icon' })\n leadingIcon = '';\n\n /**\n * Name of icon. It is always a string.\n */\n @property({ attribute: 'trailing-icon' })\n trailingIcon = '';\n\n /**\n * Conveys additional information below the text field, such as how it should\n * be used.\n */\n @property({ attribute: 'supporting-text' }) supportingText = '';\n\n /**\n * Override the input text CSS `direction`. Useful for RTL languages that use\n * LTR notation for fractions.\n */\n @property({ attribute: 'text-direction' }) textDirection = '';\n\n /**\n * The number of rows to display for a `type=\"textarea\"` text field.\n * Defaults to 2.\n */\n @property({ type: Number }) rows = 2;\n\n // <input> properties\n @property({ reflect: true }) override inputMode = '';\n\n /**\n * Defines the greatest value in the range of permitted values.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#max\n */\n @property() max = '';\n\n /**\n * The maximum number of characters a user can enter into the text field. Set\n * to -1 for none.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#maxlength\n */\n @property({ type: Number }) maxLength = -1;\n\n /**\n * Defines the most negative value in the range of permitted values.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#min\n */\n @property() min = '';\n\n /**\n * The minimum number of characters a user can enter into the text field. Set\n * to -1 for none.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#minlength\n */\n @property({ type: Number }) minLength = -1;\n\n /**\n * A regular expression that the text field's value must match to pass\n * constraint validation.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#pattern\n */\n @property() pattern = '';\n\n @property({ reflect: true }) placeholder = '';\n\n /**\n * Indicates whether or not a user should be able to edit the text field's\n * value.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#readonly\n */\n @property({ type: Boolean, reflect: true }) readOnly = false;\n\n /**\n * Indicates that input accepts multiple email addresses.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email#multiple\n */\n @property({ type: Boolean, reflect: true }) multiple = false;\n\n /**\n * Returns or sets the element's step attribute, which works with min and max\n * to limit the increments at which a numeric or date-time value can be set.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#step\n */\n @property() step = '';\n\n /**\n * The `<input>` type to use, defaults to \"text\". The type greatly changes how\n * the text field behaves.\n *\n * Text fields support a limited number of `<input>` types:\n *\n * - text\n * - textarea\n * - email\n * - number\n * - password\n * - search\n * - tel\n * - url\n *\n * See\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types\n * for more details on each input type.\n */\n @property({ reflect: true })\n type: TextFieldType | UnsupportedTextFieldType = 'text';\n\n /**\n * Describes what, if any, type of autocomplete functionality the input\n * should provide.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete\n */\n @property({ reflect: true }) autocomplete = '';\n\n textarea: HTMLElement | null | undefined;\n\n handleKeydownHandler: any = undefined;\n\n connectedCallback() {\n super.connectedCallback();\n if (this.type === 'textarea') {\n this.addEventListener('input', this.resizeTextArea);\n this.addEventListener('keydown', this.resizeTextArea);\n window.addEventListener('load', this.resizeTextArea);\n }\n }\n\n async firstUpdated() {\n if (this.type === 'textarea') {\n if (this.component instanceof LitElement) {\n await this.component.updateComplete;\n }\n await this.updateComplete;\n\n this.textarea = this.component?.shadowRoot?.querySelector('textarea');\n this.resizeTextArea();\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n if (this.handleKeydownHandler) {\n this.removeEventListener('input', this.resizeTextArea);\n this.removeEventListener('keydown', this.resizeTextArea);\n window.removeEventListener('load', this.resizeTextArea);\n }\n }\n\n resizeTextArea = () => {\n if (this.textarea) {\n this.textarea.style.height = 'auto';\n if (this.textarea.scrollHeight > 0) {\n this.textarea.style.height = `${this.textarea.scrollHeight}px`;\n }\n }\n };\n\n focus() {\n this.component.focus();\n }\n\n protected createRenderRoot() {\n return this;\n }\n\n renderStyles() {\n return html`\n <style>\n [error] {\n --md-outlined-field-outline-width: 2px;\n }\n ix-textbox {\n &.comment {\n --md-outlined-text-field-container-shape: 32px;\n --md-outlined-text-field-outline-color: rgba(9, 34, 65, 0.12);\n --md-outlined-text-field-outline-width: 1px;\n --md-outlined-text-field-hover-outline-color: rgba(9, 34, 65, 0.12);\n --md-outlined-text-field-hover-outline-width: 1px;\n --md-outlined-text-field-focus-outline-color: rgba(9, 34, 65, 0.12);\n --md-outlined-text-field-focus-outline-width: 1px;\n --md-outlined-text-field-input-text-placeholder-color: rgba(\n 9,\n 34,\n 65,\n 0.42\n );\n --md-filled-text-field-focus-active-indicator-color: rgba(\n 9,\n 34,\n 65,\n 0.12\n );\n --md-outlined-text-field-input-text-color: rgb(9, 34, 65);\n --md-outlined-field-leading-space: 8px;\n }\n [type='textarea'] {\n resize: none;\n }\n }\n </style>\n `;\n }\n\n protected override render() {\n if (this.type === 'tel') {\n return html`<ix-phone-input\n class=\"textfield\"\n style=\"display: block;\"\n ?disabled=${this.disabled}\n ?required=${this.required}\n ?error=${this.error}\n error-text=${this.errorText}\n supporting-text=${this.supportingText}\n type=${this.type}\n label=${this.label}\n name=${this.name}\n .value=${this.value ?? ''}\n ></ix-phone-input>`;\n }\n\n const tag: StaticValue = this.filled\n ? literal`md-filled-text-field`\n : literal`md-outlined-text-field`;\n\n return staticHtml`\n ${this.renderStyles()}\n <${tag}\n class=\"textfield\"\n style=\"display: block;\"\n ?disabled=${this.disabled}\n ?required=${this.required}\n ?error=${this.error}\n ?multipule=${this.multiple}\n ?readOnly=${this.readOnly}\n ?has-leading-icon=${this.leadingIcon.length > 0}\n ?has-trailing-icon=${this.trailingIcon.length > 0}\n step=${this.step || nothing}\n autocomplete=${this.autocomplete || nothing}\n error-text=${this.errorText}\n placeholder=${this.placeholder}\n text-direction=${this.textDirection}\n rows=${this.rows}\n max=${this.max}\n maxLength=${this.maxLength}\n min=${this.min}\n minLength=${this.minLength}\n pattern=${this.pattern}\n prefix-text=${this.prefixText}\n suffix-text=${this.suffixText}\n supporting-text=${this.supportingText}\n inputMode=${this.inputMode}\n type=${this.type}\n label=${this.label}\n name=${this.name}\n .value=${this.value ?? ''}\n >\n ${\n this.leadingIcon\n ? html`<ix-icon slot=\"leading-icon\">${this.leadingIcon}</ix-icon>`\n : nothing\n }\n ${\n this.trailingIcon\n ? html`<ix-icon slot=\"trailing-icon\"\n >${this.trailingIcon}</ix-icon\n >`\n : nothing\n }\n </${tag}>\n `;\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import{__decorate}from"tslib";import{LitElement,html,nothing}from"lit";import{literal,html as html$1}from"lit/static-html.js";import{query,property}from"lit/decorators.js";import"@material/web/textfield/filled-text-field.js";import"@material/web/textfield/outlined-text-field.js";import"@digital-realty/ix-icon/ix-icon.js";import"@digital-realty/ix-phone-input/ix-phone-input.js";class IxTextbox extends LitElement{constructor(){super(...arguments),this.filled=!1,this.disabled=!1,this.error=!1,this.errorText="",this.label="",this.required=!1,this.value="",this.name="",this.prefixText="",this.suffixText="",this.leadingIcon="",this.trailingIcon="",this.supportingText="",this.textDirection="",this.rows=2,this.inputMode="",this.max="",this.maxLength=-1,this.min="",this.minLength=-1,this.pattern="",this.placeholder="",this.readOnly=!1,this.multiple=!1,this.step="",this.type="text",this.autocomplete="",this.handleKeydownHandler=void 0,this.resizeTextArea=()=>{this.textarea&&(this.textarea.style.height="auto",this.textarea.style.height=this.textarea.scrollHeight+"px")}}connectedCallback(){super.connectedCallback(),"textarea"===this.type&&(this.addEventListener("input",this.resizeTextArea),this.addEventListener("keydown",this.resizeTextArea),window.addEventListener("load",this.resizeTextArea))}async firstUpdated(){var t;"textarea"===this.type&&(this.component instanceof LitElement&&await this.component.updateComplete,await this.updateComplete,this.textarea=null==(t=null==(t=this.component)?void 0:t.shadowRoot)?void 0:t.querySelector("textarea"),this.resizeTextArea())}disconnectedCallback(){super.disconnectedCallback(),this.handleKeydownHandler&&(this.removeEventListener("input",this.resizeTextArea),this.removeEventListener("keydown",this.resizeTextArea),window.removeEventListener("load",this.resizeTextArea))}focus(){this.component.focus()}createRenderRoot(){return this}renderStyles(){return html`
1
+ import{__decorate}from"tslib";import{LitElement,html,nothing}from"lit";import{literal,html as html$1}from"lit/static-html.js";import{query,property}from"lit/decorators.js";import"@material/web/textfield/filled-text-field.js";import"@material/web/textfield/outlined-text-field.js";import"@digital-realty/ix-icon/ix-icon.js";import"@digital-realty/ix-phone-input/ix-phone-input.js";class IxTextbox extends LitElement{constructor(){super(...arguments),this.filled=!1,this.disabled=!1,this.error=!1,this.errorText="",this.label="",this.required=!1,this.value="",this.name="",this.prefixText="",this.suffixText="",this.leadingIcon="",this.trailingIcon="",this.supportingText="",this.textDirection="",this.rows=2,this.inputMode="",this.max="",this.maxLength=-1,this.min="",this.minLength=-1,this.pattern="",this.placeholder="",this.readOnly=!1,this.multiple=!1,this.step="",this.type="text",this.autocomplete="",this.handleKeydownHandler=void 0,this.resizeTextArea=()=>{this.textarea&&(this.textarea.style.height="auto",0<this.textarea.scrollHeight)&&(this.textarea.style.height=this.textarea.scrollHeight+"px")}}connectedCallback(){super.connectedCallback(),"textarea"===this.type&&(this.addEventListener("input",this.resizeTextArea),this.addEventListener("keydown",this.resizeTextArea),window.addEventListener("load",this.resizeTextArea))}async firstUpdated(){var t;"textarea"===this.type&&(this.component instanceof LitElement&&await this.component.updateComplete,await this.updateComplete,this.textarea=null==(t=null==(t=this.component)?void 0:t.shadowRoot)?void 0:t.querySelector("textarea"),this.resizeTextArea())}disconnectedCallback(){super.disconnectedCallback(),this.handleKeydownHandler&&(this.removeEventListener("input",this.resizeTextArea),this.removeEventListener("keydown",this.resizeTextArea),window.removeEventListener("load",this.resizeTextArea))}focus(){this.component.focus()}createRenderRoot(){return this}renderStyles(){return html`
2
2
  <style>
3
3
  [error] {
4
4
  --md-outlined-field-outline-width: 2px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digital-realty/ix-textbox",
3
- "version": "2.2.10",
3
+ "version": "2.2.11",
4
4
  "description": "Webcomponent ix-textbox following open-wc recommendations",
5
5
  "license": "MIT",
6
6
  "author": "Digital Realty",
@@ -111,5 +111,5 @@
111
111
  "README.md",
112
112
  "LICENSE"
113
113
  ],
114
- "gitHead": "e4c11a6977cda71e7bc4c230c8bbbef9df6e3722"
114
+ "gitHead": "e605d674b71082303dbf0dda47081fa6525103f8"
115
115
  }