@digital-realty/ix-textbox 2.3.1 → 2.3.2
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/dist/IxTextbox.d.ts +33 -0
- package/dist/IxTextbox.js +102 -1
- package/dist/IxTextbox.js.map +1 -1
- package/dist/ix-textbox.min.js +29 -3
- package/package.json +4 -3
package/dist/IxTextbox.d.ts
CHANGED
|
@@ -49,6 +49,18 @@ export declare class IxTextbox extends LitElement {
|
|
|
49
49
|
* Name of icon. It is always a string.
|
|
50
50
|
*/
|
|
51
51
|
trailingIcon: string;
|
|
52
|
+
/**
|
|
53
|
+
* Enables navigation icons for search input types.
|
|
54
|
+
*/
|
|
55
|
+
searchEnabled: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* The number of search results found.
|
|
58
|
+
*/
|
|
59
|
+
searchResultCount: number;
|
|
60
|
+
/**
|
|
61
|
+
* The index of the selected search result. This property is 1-based (i.e. begins with 1, not zero-based).
|
|
62
|
+
*/
|
|
63
|
+
searchResultIndex: number;
|
|
52
64
|
/**
|
|
53
65
|
* Conveys additional information below the text field, such as how it should
|
|
54
66
|
* be used.
|
|
@@ -146,6 +158,10 @@ export declare class IxTextbox extends LitElement {
|
|
|
146
158
|
* https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
|
|
147
159
|
*/
|
|
148
160
|
autocomplete: string;
|
|
161
|
+
/**
|
|
162
|
+
* True if the input has text.
|
|
163
|
+
*/
|
|
164
|
+
hasText: boolean;
|
|
149
165
|
textarea: HTMLElement | null | undefined;
|
|
150
166
|
handleKeydownHandler: any;
|
|
151
167
|
connectedCallback(): void;
|
|
@@ -155,5 +171,22 @@ export declare class IxTextbox extends LitElement {
|
|
|
155
171
|
focus(): void;
|
|
156
172
|
protected createRenderRoot(): this;
|
|
157
173
|
renderStyles(): import("lit-html").TemplateResult<1>;
|
|
174
|
+
/**
|
|
175
|
+
* Handles search navigation icon clicks and emits search-navigation event.
|
|
176
|
+
*/
|
|
177
|
+
private onSearchNavigation;
|
|
178
|
+
/**
|
|
179
|
+
* Handles input event and sets hasText state when an input event is received.
|
|
180
|
+
*/
|
|
181
|
+
private onInput;
|
|
182
|
+
/**
|
|
183
|
+
* Clears the input field and resets hasText state.
|
|
184
|
+
*/
|
|
185
|
+
private clearInput;
|
|
186
|
+
/**
|
|
187
|
+
* Sets the search result text based on the current search state.
|
|
188
|
+
* @returns The search result text.
|
|
189
|
+
*/
|
|
190
|
+
private setSearchResultText;
|
|
158
191
|
protected render(): import("lit-html").TemplateResult<1 | 2 | 3>;
|
|
159
192
|
}
|
package/dist/IxTextbox.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { html, LitElement, nothing } from 'lit';
|
|
3
3
|
import { html as staticHtml, literal } from 'lit/static-html.js';
|
|
4
|
-
import { property, query } from 'lit/decorators.js';
|
|
4
|
+
import { property, query, state } from 'lit/decorators.js';
|
|
5
5
|
import '@material/web/textfield/filled-text-field.js';
|
|
6
6
|
import '@material/web/textfield/outlined-text-field.js';
|
|
7
7
|
import '@digital-realty/ix-icon/ix-icon.js';
|
|
@@ -52,6 +52,18 @@ export class IxTextbox extends LitElement {
|
|
|
52
52
|
* Name of icon. It is always a string.
|
|
53
53
|
*/
|
|
54
54
|
this.trailingIcon = '';
|
|
55
|
+
/**
|
|
56
|
+
* Enables navigation icons for search input types.
|
|
57
|
+
*/
|
|
58
|
+
this.searchEnabled = false;
|
|
59
|
+
/**
|
|
60
|
+
* The number of search results found.
|
|
61
|
+
*/
|
|
62
|
+
this.searchResultCount = 0;
|
|
63
|
+
/**
|
|
64
|
+
* The index of the selected search result. This property is 1-based (i.e. begins with 1, not zero-based).
|
|
65
|
+
*/
|
|
66
|
+
this.searchResultIndex = 0;
|
|
55
67
|
/**
|
|
56
68
|
* Conveys additional information below the text field, such as how it should
|
|
57
69
|
* be used.
|
|
@@ -150,6 +162,10 @@ export class IxTextbox extends LitElement {
|
|
|
150
162
|
* https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
|
|
151
163
|
*/
|
|
152
164
|
this.autocomplete = '';
|
|
165
|
+
/**
|
|
166
|
+
* True if the input has text.
|
|
167
|
+
*/
|
|
168
|
+
this.hasText = false;
|
|
153
169
|
this.handleKeydownHandler = undefined;
|
|
154
170
|
this.resizeTextArea = () => {
|
|
155
171
|
if (this.textarea) {
|
|
@@ -159,6 +175,24 @@ export class IxTextbox extends LitElement {
|
|
|
159
175
|
}
|
|
160
176
|
}
|
|
161
177
|
};
|
|
178
|
+
/**
|
|
179
|
+
* Handles input event and sets hasText state when an input event is received.
|
|
180
|
+
*/
|
|
181
|
+
this.onInput = (e) => {
|
|
182
|
+
const input = e.target;
|
|
183
|
+
this.hasText = input.value.length > 0;
|
|
184
|
+
this.dispatchEvent(new CustomEvent('search-text-change', {
|
|
185
|
+
detail: { searchText: input.value },
|
|
186
|
+
}));
|
|
187
|
+
};
|
|
188
|
+
/**
|
|
189
|
+
* Clears the input field and resets hasText state.
|
|
190
|
+
*/
|
|
191
|
+
this.clearInput = () => {
|
|
192
|
+
this.value = '';
|
|
193
|
+
this.hasText = false;
|
|
194
|
+
this.dispatchEvent(new Event('input', { bubbles: true, composed: true }));
|
|
195
|
+
};
|
|
162
196
|
}
|
|
163
197
|
connectedCallback() {
|
|
164
198
|
super.connectedCallback();
|
|
@@ -230,6 +264,29 @@ export class IxTextbox extends LitElement {
|
|
|
230
264
|
</style>
|
|
231
265
|
`;
|
|
232
266
|
}
|
|
267
|
+
/**
|
|
268
|
+
* Handles search navigation icon clicks and emits search-navigation event.
|
|
269
|
+
*/
|
|
270
|
+
onSearchNavigation(e, direction) {
|
|
271
|
+
this.dispatchEvent(new CustomEvent('search-navigation', {
|
|
272
|
+
detail: { direction },
|
|
273
|
+
bubbles: true,
|
|
274
|
+
composed: true,
|
|
275
|
+
}));
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Sets the search result text based on the current search state.
|
|
279
|
+
* @returns The search result text.
|
|
280
|
+
*/
|
|
281
|
+
setSearchResultText() {
|
|
282
|
+
if (this.searchResultCount === 0) {
|
|
283
|
+
return `${this.searchResultCount} results`;
|
|
284
|
+
}
|
|
285
|
+
if (this.searchResultIndex === 0) {
|
|
286
|
+
return `${this.searchResultCount} results`;
|
|
287
|
+
}
|
|
288
|
+
return `${this.searchResultIndex}/${this.searchResultCount} results`;
|
|
289
|
+
}
|
|
233
290
|
render() {
|
|
234
291
|
var _a, _b;
|
|
235
292
|
if (this.type === 'tel') {
|
|
@@ -281,10 +338,42 @@ export class IxTextbox extends LitElement {
|
|
|
281
338
|
label=${this.label}
|
|
282
339
|
name=${this.name}
|
|
283
340
|
.value=${(_b = this.value) !== null && _b !== void 0 ? _b : ''}
|
|
341
|
+
@input=${this.onInput}
|
|
284
342
|
>
|
|
285
343
|
${this.leadingIcon
|
|
286
344
|
? html `<ix-icon slot="leading-icon">${this.leadingIcon}</ix-icon>`
|
|
287
345
|
: nothing}
|
|
346
|
+
${this.searchEnabled && this.hasText && this.value.length > 1
|
|
347
|
+
? html `<div
|
|
348
|
+
style="font-size: 14px; align-items: center;"
|
|
349
|
+
slot="trailing-icon"
|
|
350
|
+
>
|
|
351
|
+
${this.setSearchResultText()}
|
|
352
|
+
</div>`
|
|
353
|
+
: nothing}
|
|
354
|
+
${this.searchEnabled && this.searchResultCount > 0
|
|
355
|
+
? html `<ix-icon
|
|
356
|
+
style="padding: 0px 3px; align-items: center; cursor: pointer;"
|
|
357
|
+
slot="trailing-icon"
|
|
358
|
+
@click=${(ev) => this.onSearchNavigation(ev, 'previous')}
|
|
359
|
+
>chevron_left</ix-icon
|
|
360
|
+
>
|
|
361
|
+
|
|
362
|
+
<ix-icon
|
|
363
|
+
slot="trailing-icon"
|
|
364
|
+
style="padding: 0px 3px; align-items: center; cursor: pointer;"
|
|
365
|
+
@click=${(ev) => this.onSearchNavigation(ev, 'next')}
|
|
366
|
+
>chevron_right</ix-icon
|
|
367
|
+
>`
|
|
368
|
+
: nothing}
|
|
369
|
+
${this.hasText
|
|
370
|
+
? html `<ix-icon
|
|
371
|
+
style="padding: 0px 3px; align-items: center; cursor: pointer;"
|
|
372
|
+
slot="trailing-icon"
|
|
373
|
+
@click=${this.clearInput}
|
|
374
|
+
>close</ix-icon
|
|
375
|
+
>`
|
|
376
|
+
: nothing}
|
|
288
377
|
${this.trailingIcon
|
|
289
378
|
? html `<ix-icon slot="trailing-icon"
|
|
290
379
|
>${this.trailingIcon}</ix-icon
|
|
@@ -333,6 +422,15 @@ __decorate([
|
|
|
333
422
|
__decorate([
|
|
334
423
|
property({ attribute: 'trailing-icon' })
|
|
335
424
|
], IxTextbox.prototype, "trailingIcon", void 0);
|
|
425
|
+
__decorate([
|
|
426
|
+
property({ type: Boolean })
|
|
427
|
+
], IxTextbox.prototype, "searchEnabled", void 0);
|
|
428
|
+
__decorate([
|
|
429
|
+
property({ type: Number })
|
|
430
|
+
], IxTextbox.prototype, "searchResultCount", void 0);
|
|
431
|
+
__decorate([
|
|
432
|
+
property({ type: Number })
|
|
433
|
+
], IxTextbox.prototype, "searchResultIndex", void 0);
|
|
336
434
|
__decorate([
|
|
337
435
|
property({ attribute: 'supporting-text' })
|
|
338
436
|
], IxTextbox.prototype, "supportingText", void 0);
|
|
@@ -378,4 +476,7 @@ __decorate([
|
|
|
378
476
|
__decorate([
|
|
379
477
|
property({ reflect: true })
|
|
380
478
|
], IxTextbox.prototype, "autocomplete", void 0);
|
|
479
|
+
__decorate([
|
|
480
|
+
state()
|
|
481
|
+
], IxTextbox.prototype, "hasText", void 0);
|
|
381
482
|
//# sourceMappingURL=IxTextbox.js.map
|
package/dist/IxTextbox.js.map
CHANGED
|
@@ -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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AO,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: 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
|
+
{"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,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC3D,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,GAAG,EAAE,CAAC;QAEqB,aAAQ,GAAG,KAAK,CAAC;QAE7D;;WAEG;QACS,UAAK,GAAG,EAAE,CAAC;QAEvB;;WAEG;QACS,SAAI,GAAG,EAAE,CAAC;QAEtB;;WAEG;QACqC,eAAU,GAAG,EAAE,CAAC;QAExD;;WAEG;QACqC,eAAU,GAAG,EAAE,CAAC;QAExD;;WAEG;QAEH,gBAAW,GAAG,EAAE,CAAC;QAEjB;;WAE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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;AAKtC;IAAR,KAAK,EAAE;0CAA0B","sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { html as staticHtml, StaticValue, literal } from 'lit/static-html.js';\nimport { property, query, state } 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 * Enables navigation icons for search input types.\n */\n @property({ type: Boolean }) searchEnabled = false;\n\n /**\n * The number of search results found.\n */\n @property({ type: Number }) searchResultCount = 0;\n\n /**\n * The index of the selected search result. This property is 1-based (i.e. begins with 1, not zero-based).\n */\n @property({ type: Number }) searchResultIndex = 0;\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 /**\n * True if the input has text.\n */\n @state() hasText: boolean = false;\n\n textarea: HTMLElement | null | undefined;\n\n handleKeydownHandler: any = undefined;\n\n connectedCallback() {\n super.connectedCallback();\n\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 /**\n * Handles search navigation icon clicks and emits search-navigation event.\n */\n private onSearchNavigation(e: CustomEvent, direction: string) {\n this.dispatchEvent(\n new CustomEvent('search-navigation', {\n detail: { direction },\n bubbles: true,\n composed: true,\n })\n );\n }\n\n /**\n * Handles input event and sets hasText state when an input event is received.\n */\n private onInput = (e: Event) => {\n const input = e.target as HTMLInputElement;\n this.hasText = input.value.length > 0;\n\n this.dispatchEvent(\n new CustomEvent('search-text-change', {\n detail: { searchText: input.value },\n })\n );\n };\n\n /**\n * Clears the input field and resets hasText state.\n */\n private clearInput = () => {\n this.value = '';\n this.hasText = false;\n this.dispatchEvent(new Event('input', { bubbles: true, composed: true }));\n };\n\n /**\n * Sets the search result text based on the current search state.\n * @returns The search result text.\n */\n private setSearchResultText(): string {\n if (this.searchResultCount === 0) {\n return `${this.searchResultCount} results`;\n }\n\n if (this.searchResultIndex === 0) {\n return `${this.searchResultCount} results`;\n }\n\n return `${this.searchResultIndex}/${this.searchResultCount} results`;\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 @input=${this.onInput}\n >\n ${\n this.leadingIcon\n ? html`<ix-icon slot=\"leading-icon\">${this.leadingIcon}</ix-icon>`\n : nothing\n }\n ${\n this.searchEnabled && this.hasText && this.value.length > 1\n ? html`<div\n style=\"font-size: 14px; align-items: center;\"\n slot=\"trailing-icon\"\n >\n ${this.setSearchResultText()}\n </div>`\n : nothing\n }\n ${\n this.searchEnabled && this.searchResultCount > 0\n ? html`<ix-icon\n style=\"padding: 0px 3px; align-items: center; cursor: pointer;\"\n slot=\"trailing-icon\"\n @click=${(ev: CustomEvent) =>\n this.onSearchNavigation(ev, 'previous')}\n >chevron_left</ix-icon\n >\n\n <ix-icon\n slot=\"trailing-icon\"\n style=\"padding: 0px 3px; align-items: center; cursor: pointer;\"\n @click=${(ev: CustomEvent) =>\n this.onSearchNavigation(ev, 'next')}\n >chevron_right</ix-icon\n >`\n : nothing\n }\n ${\n this.hasText\n ? html`<ix-icon\n style=\"padding: 0px 3px; align-items: center; cursor: pointer;\"\n slot=\"trailing-icon\"\n @click=${this.clearInput}\n >close</ix-icon\n >`\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"]}
|
package/dist/ix-textbox.min.js
CHANGED
|
@@ -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",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`
|
|
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,state}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.searchEnabled=!1,this.searchResultCount=0,this.searchResultIndex=0,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.hasText=!1,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")},this.onInput=t=>{t=t.target;this.hasText=0<t.value.length,this.dispatchEvent(new CustomEvent("search-text-change",{detail:{searchText:t.value}}))},this.clearInput=()=>{this.value="",this.hasText=!1,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}}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;
|
|
@@ -32,7 +32,7 @@ import{__decorate}from"tslib";import{LitElement,html,nothing}from"lit";import{li
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
</style>
|
|
35
|
-
`}render(){var t,e;return"tel"===this.type?html`<ix-phone-input
|
|
35
|
+
`}onSearchNavigation(t,e){this.dispatchEvent(new CustomEvent("search-navigation",{detail:{direction:e},bubbles:!0,composed:!0}))}setSearchResultText(){return 0===this.searchResultCount||0===this.searchResultIndex?this.searchResultCount+" results":`${this.searchResultIndex}/${this.searchResultCount} results`}render(){var t,e;return"tel"===this.type?html`<ix-phone-input
|
|
36
36
|
class="textfield"
|
|
37
37
|
style="display: block;"
|
|
38
38
|
?disabled=${this.disabled}
|
|
@@ -75,10 +75,36 @@ import{__decorate}from"tslib";import{LitElement,html,nothing}from"lit";import{li
|
|
|
75
75
|
label=${this.label}
|
|
76
76
|
name=${this.name}
|
|
77
77
|
.value=${null!=(t=this.value)?t:""}
|
|
78
|
+
@input=${this.onInput}
|
|
78
79
|
>
|
|
79
80
|
${this.leadingIcon?html`<ix-icon slot="leading-icon">${this.leadingIcon}</ix-icon>`:nothing}
|
|
81
|
+
${this.searchEnabled&&this.hasText&&1<this.value.length?html`<div
|
|
82
|
+
style="font-size: 14px; align-items: center;"
|
|
83
|
+
slot="trailing-icon"
|
|
84
|
+
>
|
|
85
|
+
${this.setSearchResultText()}
|
|
86
|
+
</div>`:nothing}
|
|
87
|
+
${this.searchEnabled&&0<this.searchResultCount?html`<ix-icon
|
|
88
|
+
style="padding: 0px 3px; align-items: center; cursor: pointer;"
|
|
89
|
+
slot="trailing-icon"
|
|
90
|
+
@click=${t=>this.onSearchNavigation(t,"previous")}
|
|
91
|
+
>chevron_left</ix-icon
|
|
92
|
+
>
|
|
93
|
+
|
|
94
|
+
<ix-icon
|
|
95
|
+
slot="trailing-icon"
|
|
96
|
+
style="padding: 0px 3px; align-items: center; cursor: pointer;"
|
|
97
|
+
@click=${t=>this.onSearchNavigation(t,"next")}
|
|
98
|
+
>chevron_right</ix-icon
|
|
99
|
+
>`:nothing}
|
|
100
|
+
${this.hasText?html`<ix-icon
|
|
101
|
+
style="padding: 0px 3px; align-items: center; cursor: pointer;"
|
|
102
|
+
slot="trailing-icon"
|
|
103
|
+
@click=${this.clearInput}
|
|
104
|
+
>close</ix-icon
|
|
105
|
+
>`:nothing}
|
|
80
106
|
${this.trailingIcon?html`<ix-icon slot="trailing-icon"
|
|
81
107
|
>${this.trailingIcon}</ix-icon
|
|
82
108
|
>`:nothing}
|
|
83
109
|
</${e}>
|
|
84
|
-
`)}}__decorate([query(".textfield")],IxTextbox.prototype,"component",void 0),__decorate([property({type:Boolean,reflect:!0})],IxTextbox.prototype,"filled",void 0),__decorate([property({type:Boolean,reflect:!0})],IxTextbox.prototype,"disabled",void 0),__decorate([property({type:Boolean,reflect:!0})],IxTextbox.prototype,"error",void 0),__decorate([property({attribute:"error-text"})],IxTextbox.prototype,"errorText",void 0),__decorate([property()],IxTextbox.prototype,"label",void 0),__decorate([property({type:Boolean,reflect:!0})],IxTextbox.prototype,"required",void 0),__decorate([property()],IxTextbox.prototype,"value",void 0),__decorate([property()],IxTextbox.prototype,"name",void 0),__decorate([property({attribute:"prefix-text"})],IxTextbox.prototype,"prefixText",void 0),__decorate([property({attribute:"suffix-text"})],IxTextbox.prototype,"suffixText",void 0),__decorate([property({attribute:"leading-icon"})],IxTextbox.prototype,"leadingIcon",void 0),__decorate([property({attribute:"trailing-icon"})],IxTextbox.prototype,"trailingIcon",void 0),__decorate([property({attribute:"supporting-text"})],IxTextbox.prototype,"supportingText",void 0),__decorate([property({attribute:"text-direction"})],IxTextbox.prototype,"textDirection",void 0),__decorate([property({type:Number})],IxTextbox.prototype,"rows",void 0),__decorate([property({reflect:!0})],IxTextbox.prototype,"inputMode",void 0),__decorate([property()],IxTextbox.prototype,"max",void 0),__decorate([property({type:Number})],IxTextbox.prototype,"maxLength",void 0),__decorate([property()],IxTextbox.prototype,"min",void 0),__decorate([property({type:Number})],IxTextbox.prototype,"minLength",void 0),__decorate([property()],IxTextbox.prototype,"pattern",void 0),__decorate([property({reflect:!0})],IxTextbox.prototype,"placeholder",void 0),__decorate([property({type:Boolean,reflect:!0})],IxTextbox.prototype,"readOnly",void 0),__decorate([property({type:Boolean,reflect:!0})],IxTextbox.prototype,"multiple",void 0),__decorate([property()],IxTextbox.prototype,"step",void 0),__decorate([property({reflect:!0})],IxTextbox.prototype,"type",void 0),__decorate([property({reflect:!0})],IxTextbox.prototype,"autocomplete",void 0),customElements.define("ix-textbox",IxTextbox);
|
|
110
|
+
`)}}__decorate([query(".textfield")],IxTextbox.prototype,"component",void 0),__decorate([property({type:Boolean,reflect:!0})],IxTextbox.prototype,"filled",void 0),__decorate([property({type:Boolean,reflect:!0})],IxTextbox.prototype,"disabled",void 0),__decorate([property({type:Boolean,reflect:!0})],IxTextbox.prototype,"error",void 0),__decorate([property({attribute:"error-text"})],IxTextbox.prototype,"errorText",void 0),__decorate([property()],IxTextbox.prototype,"label",void 0),__decorate([property({type:Boolean,reflect:!0})],IxTextbox.prototype,"required",void 0),__decorate([property()],IxTextbox.prototype,"value",void 0),__decorate([property()],IxTextbox.prototype,"name",void 0),__decorate([property({attribute:"prefix-text"})],IxTextbox.prototype,"prefixText",void 0),__decorate([property({attribute:"suffix-text"})],IxTextbox.prototype,"suffixText",void 0),__decorate([property({attribute:"leading-icon"})],IxTextbox.prototype,"leadingIcon",void 0),__decorate([property({attribute:"trailing-icon"})],IxTextbox.prototype,"trailingIcon",void 0),__decorate([property({type:Boolean})],IxTextbox.prototype,"searchEnabled",void 0),__decorate([property({type:Number})],IxTextbox.prototype,"searchResultCount",void 0),__decorate([property({type:Number})],IxTextbox.prototype,"searchResultIndex",void 0),__decorate([property({attribute:"supporting-text"})],IxTextbox.prototype,"supportingText",void 0),__decorate([property({attribute:"text-direction"})],IxTextbox.prototype,"textDirection",void 0),__decorate([property({type:Number})],IxTextbox.prototype,"rows",void 0),__decorate([property({reflect:!0})],IxTextbox.prototype,"inputMode",void 0),__decorate([property()],IxTextbox.prototype,"max",void 0),__decorate([property({type:Number})],IxTextbox.prototype,"maxLength",void 0),__decorate([property()],IxTextbox.prototype,"min",void 0),__decorate([property({type:Number})],IxTextbox.prototype,"minLength",void 0),__decorate([property()],IxTextbox.prototype,"pattern",void 0),__decorate([property({reflect:!0})],IxTextbox.prototype,"placeholder",void 0),__decorate([property({type:Boolean,reflect:!0})],IxTextbox.prototype,"readOnly",void 0),__decorate([property({type:Boolean,reflect:!0})],IxTextbox.prototype,"multiple",void 0),__decorate([property()],IxTextbox.prototype,"step",void 0),__decorate([property({reflect:!0})],IxTextbox.prototype,"type",void 0),__decorate([property({reflect:!0})],IxTextbox.prototype,"autocomplete",void 0),__decorate([state()],IxTextbox.prototype,"hasText",void 0),customElements.define("ix-textbox",IxTextbox);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digital-realty/ix-textbox",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2",
|
|
4
4
|
"description": "Webcomponent ix-textbox following open-wc recommendations",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Digital Realty",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"lint": "eslint --ext .ts,.html . --ignore-path .gitignore && prettier \"**/*.ts\" --check --ignore-path .gitignore",
|
|
25
25
|
"format": "eslint --ext .ts,.html . --fix --ignore-path .gitignore && prettier \"**/*.ts\" --write --ignore-path .gitignore",
|
|
26
26
|
"test": "tsc && wtr --coverage",
|
|
27
|
-
"test:watch": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wtr --watch\""
|
|
27
|
+
"test:watch": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wtr --watch\"",
|
|
28
|
+
"ts:watch": "tsc --watch --preserveWatchOutput"
|
|
28
29
|
},
|
|
29
30
|
"dependencies": {
|
|
30
31
|
"@digital-realty/ix-icon": "^1.2.1",
|
|
@@ -111,5 +112,5 @@
|
|
|
111
112
|
"README.md",
|
|
112
113
|
"LICENSE"
|
|
113
114
|
],
|
|
114
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "4ff0578d0a641c2ac91a56463dee62ec1377fb56"
|
|
115
116
|
}
|