@digital-realty/ix-textbox 2.1.4 → 2.1.6
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 +55 -16
- package/dist/IxTextbox.js +121 -86
- package/dist/IxTextbox.js.map +1 -1
- package/package.json +9 -2
- package/dist/types/index.d.ts +0 -14
- package/dist/types/index.js +0 -2
- package/dist/types/index.js.map +0 -1
package/dist/IxTextbox.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
import '@material/web/textfield/filled-text-field.js';
|
|
3
3
|
import '@material/web/textfield/outlined-text-field.js';
|
|
4
|
-
import { TextFieldType, UnsupportedTextFieldType } from '
|
|
4
|
+
import { TextFieldType, UnsupportedTextFieldType } from '@material/web/textfield/internal/text-field.js';
|
|
5
|
+
import '@digital-realty/ix-icon/ix-icon.js';
|
|
5
6
|
export declare class IxTextbox extends LitElement {
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
readonly component: HTMLInputElement;
|
|
8
|
+
filled: boolean;
|
|
8
9
|
disabled: boolean;
|
|
9
10
|
/**
|
|
10
11
|
* Gets or sets whether or not the text field is in a visually invalid state.
|
|
@@ -27,6 +28,10 @@ export declare class IxTextbox extends LitElement {
|
|
|
27
28
|
* The current value of the text field. It is always a string.
|
|
28
29
|
*/
|
|
29
30
|
value: string;
|
|
31
|
+
/**
|
|
32
|
+
* The name of the text field. It is always a string.
|
|
33
|
+
*/
|
|
34
|
+
name: string;
|
|
30
35
|
/**
|
|
31
36
|
* An optional prefix to display before the input value.
|
|
32
37
|
*/
|
|
@@ -36,13 +41,13 @@ export declare class IxTextbox extends LitElement {
|
|
|
36
41
|
*/
|
|
37
42
|
suffixText: string;
|
|
38
43
|
/**
|
|
39
|
-
*
|
|
44
|
+
* Name of icon. It is always a string.
|
|
40
45
|
*/
|
|
41
|
-
|
|
46
|
+
leadingIcon: string;
|
|
42
47
|
/**
|
|
43
|
-
*
|
|
48
|
+
* Name of icon. It is always a string.
|
|
44
49
|
*/
|
|
45
|
-
|
|
50
|
+
trailingIcon: string;
|
|
46
51
|
/**
|
|
47
52
|
* Conveys additional information below the text field, such as how it should
|
|
48
53
|
* be used.
|
|
@@ -58,6 +63,7 @@ export declare class IxTextbox extends LitElement {
|
|
|
58
63
|
* Defaults to 2.
|
|
59
64
|
*/
|
|
60
65
|
rows: number;
|
|
66
|
+
inputMode: string;
|
|
61
67
|
/**
|
|
62
68
|
* Defines the greatest value in the range of permitted values.
|
|
63
69
|
*
|
|
@@ -99,13 +105,46 @@ export declare class IxTextbox extends LitElement {
|
|
|
99
105
|
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#readonly
|
|
100
106
|
*/
|
|
101
107
|
readOnly: boolean;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
108
|
+
/**
|
|
109
|
+
* Indicates that input accepts multiple email addresses.
|
|
110
|
+
*
|
|
111
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email#multiple
|
|
112
|
+
*/
|
|
113
|
+
multiple: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Returns or sets the element's step attribute, which works with min and max
|
|
116
|
+
* to limit the increments at which a numeric or date-time value can be set.
|
|
117
|
+
*
|
|
118
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#step
|
|
119
|
+
*/
|
|
120
|
+
step: string;
|
|
121
|
+
/**
|
|
122
|
+
* The `<input>` type to use, defaults to "text". The type greatly changes how
|
|
123
|
+
* the text field behaves.
|
|
124
|
+
*
|
|
125
|
+
* Text fields support a limited number of `<input>` types:
|
|
126
|
+
*
|
|
127
|
+
* - text
|
|
128
|
+
* - textarea
|
|
129
|
+
* - email
|
|
130
|
+
* - number
|
|
131
|
+
* - password
|
|
132
|
+
* - search
|
|
133
|
+
* - tel
|
|
134
|
+
* - url
|
|
135
|
+
*
|
|
136
|
+
* See
|
|
137
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types
|
|
138
|
+
* for more details on each input type.
|
|
139
|
+
*/
|
|
140
|
+
type: TextFieldType | UnsupportedTextFieldType;
|
|
141
|
+
/**
|
|
142
|
+
* Describes what, if any, type of autocomplete functionality the input
|
|
143
|
+
* should provide.
|
|
144
|
+
*
|
|
145
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
|
|
146
|
+
*/
|
|
147
|
+
autocomplete: string;
|
|
148
|
+
protected createRenderRoot(): this;
|
|
149
|
+
protected render(): import("lit-html").TemplateResult<2 | 1>;
|
|
111
150
|
}
|
package/dist/IxTextbox.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { html, LitElement } from 'lit';
|
|
2
|
+
import { html, LitElement, nothing } from 'lit';
|
|
3
|
+
import { html as staticHtml, literal } from 'lit/static-html.js';
|
|
3
4
|
import { property, query } from 'lit/decorators.js';
|
|
4
5
|
import '@material/web/textfield/filled-text-field.js';
|
|
5
6
|
import '@material/web/textfield/outlined-text-field.js';
|
|
7
|
+
import '@digital-realty/ix-icon/ix-icon.js';
|
|
6
8
|
export class IxTextbox extends LitElement {
|
|
7
9
|
constructor() {
|
|
8
10
|
super(...arguments);
|
|
9
|
-
this.
|
|
10
|
-
this.type = 'text';
|
|
11
|
+
this.filled = false;
|
|
11
12
|
this.disabled = false;
|
|
12
13
|
/**
|
|
13
14
|
* Gets or sets whether or not the text field is in a visually invalid state.
|
|
@@ -30,6 +31,10 @@ export class IxTextbox extends LitElement {
|
|
|
30
31
|
* The current value of the text field. It is always a string.
|
|
31
32
|
*/
|
|
32
33
|
this.value = '';
|
|
34
|
+
/**
|
|
35
|
+
* The name of the text field. It is always a string.
|
|
36
|
+
*/
|
|
37
|
+
this.name = '';
|
|
33
38
|
/**
|
|
34
39
|
* An optional prefix to display before the input value.
|
|
35
40
|
*/
|
|
@@ -39,13 +44,13 @@ export class IxTextbox extends LitElement {
|
|
|
39
44
|
*/
|
|
40
45
|
this.suffixText = '';
|
|
41
46
|
/**
|
|
42
|
-
*
|
|
47
|
+
* Name of icon. It is always a string.
|
|
43
48
|
*/
|
|
44
|
-
this.
|
|
49
|
+
this.leadingIcon = '';
|
|
45
50
|
/**
|
|
46
|
-
*
|
|
51
|
+
* Name of icon. It is always a string.
|
|
47
52
|
*/
|
|
48
|
-
this.
|
|
53
|
+
this.trailingIcon = '';
|
|
49
54
|
/**
|
|
50
55
|
* Conveys additional information below the text field, such as how it should
|
|
51
56
|
* be used.
|
|
@@ -62,6 +67,7 @@ export class IxTextbox extends LitElement {
|
|
|
62
67
|
*/
|
|
63
68
|
this.rows = 2;
|
|
64
69
|
// <input> properties
|
|
70
|
+
this.inputMode = '';
|
|
65
71
|
/**
|
|
66
72
|
* Defines the greatest value in the range of permitted values.
|
|
67
73
|
*
|
|
@@ -103,88 +109,102 @@ export class IxTextbox extends LitElement {
|
|
|
103
109
|
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#readonly
|
|
104
110
|
*/
|
|
105
111
|
this.readOnly = false;
|
|
112
|
+
/**
|
|
113
|
+
* Indicates that input accepts multiple email addresses.
|
|
114
|
+
*
|
|
115
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email#multiple
|
|
116
|
+
*/
|
|
117
|
+
this.multiple = false;
|
|
118
|
+
/**
|
|
119
|
+
* Returns or sets the element's step attribute, which works with min and max
|
|
120
|
+
* to limit the increments at which a numeric or date-time value can be set.
|
|
121
|
+
*
|
|
122
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#step
|
|
123
|
+
*/
|
|
124
|
+
this.step = '';
|
|
125
|
+
/**
|
|
126
|
+
* The `<input>` type to use, defaults to "text". The type greatly changes how
|
|
127
|
+
* the text field behaves.
|
|
128
|
+
*
|
|
129
|
+
* Text fields support a limited number of `<input>` types:
|
|
130
|
+
*
|
|
131
|
+
* - text
|
|
132
|
+
* - textarea
|
|
133
|
+
* - email
|
|
134
|
+
* - number
|
|
135
|
+
* - password
|
|
136
|
+
* - search
|
|
137
|
+
* - tel
|
|
138
|
+
* - url
|
|
139
|
+
*
|
|
140
|
+
* See
|
|
141
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types
|
|
142
|
+
* for more details on each input type.
|
|
143
|
+
*/
|
|
144
|
+
this.type = 'text';
|
|
145
|
+
/**
|
|
146
|
+
* Describes what, if any, type of autocomplete functionality the input
|
|
147
|
+
* should provide.
|
|
148
|
+
*
|
|
149
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
|
|
150
|
+
*/
|
|
151
|
+
this.autocomplete = '';
|
|
106
152
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
const textChangeEvent = new CustomEvent('textChange', {
|
|
110
|
-
detail: {
|
|
111
|
-
value: inputElement.value,
|
|
112
|
-
},
|
|
113
|
-
composed: true,
|
|
114
|
-
});
|
|
115
|
-
this.dispatchEvent(textChangeEvent);
|
|
116
|
-
}
|
|
117
|
-
getValidityStatus() {
|
|
118
|
-
var _a;
|
|
119
|
-
return (_a = this.mdTextfield) === null || _a === void 0 ? void 0 : _a.reportValidity();
|
|
153
|
+
createRenderRoot() {
|
|
154
|
+
return this;
|
|
120
155
|
}
|
|
121
156
|
render() {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
?
|
|
129
|
-
?
|
|
130
|
-
error
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
?
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
id="md-textfield"
|
|
155
|
-
?disabled="${this.disabled}"
|
|
156
|
-
?required="${this.required}"
|
|
157
|
-
?error="${this.error}"
|
|
158
|
-
error-text="${this.errorText}"
|
|
159
|
-
label="${this.label}"
|
|
160
|
-
value="${this.value}"
|
|
161
|
-
placeholder="${this.placeholder}"
|
|
162
|
-
?readOnly="${this.readOnly}"
|
|
163
|
-
text-direction="${this.textDirection}"
|
|
164
|
-
rows="${this.rows}"
|
|
165
|
-
max="${this.max}"
|
|
166
|
-
maxLength="${this.maxLength}"
|
|
167
|
-
min="${this.min}"
|
|
168
|
-
minLength="${this.minLength}"
|
|
169
|
-
pattern="${this.pattern}"
|
|
170
|
-
prefix-text="${this.prefixText}"
|
|
171
|
-
suffix-text="${this.suffixText}"
|
|
172
|
-
supporting-text="${this.supportingText}"
|
|
173
|
-
type="${this.type}"
|
|
174
|
-
@input="${this.handleChange}"
|
|
157
|
+
const tag = this.filled
|
|
158
|
+
? literal `md-filled-text-field`
|
|
159
|
+
: literal `md-outlined-text-field`;
|
|
160
|
+
return staticHtml `
|
|
161
|
+
<${tag}
|
|
162
|
+
class="textfield"
|
|
163
|
+
?disabled=${this.disabled}
|
|
164
|
+
?required=${this.required}
|
|
165
|
+
?error=${this.error}
|
|
166
|
+
?multipule=${this.multiple}
|
|
167
|
+
?readOnly=${this.readOnly}
|
|
168
|
+
?has-leading-icon=${this.leadingIcon.length > 0}
|
|
169
|
+
?has-trailing-icon=${this.trailingIcon.length > 0}
|
|
170
|
+
step=${this.step || nothing}
|
|
171
|
+
autocomplete=${this.autocomplete || nothing}
|
|
172
|
+
error-text=${this.errorText}
|
|
173
|
+
placeholder=${this.placeholder}
|
|
174
|
+
text-direction=${this.textDirection}
|
|
175
|
+
rows=${this.rows}
|
|
176
|
+
max=${this.max}
|
|
177
|
+
maxLength=${this.maxLength}
|
|
178
|
+
min=${this.min}
|
|
179
|
+
minLength=${this.minLength}
|
|
180
|
+
pattern=${this.pattern}
|
|
181
|
+
prefix-text=${this.prefixText}
|
|
182
|
+
suffix-text=${this.suffixText}
|
|
183
|
+
supporting-text=${this.supportingText}
|
|
184
|
+
inputMode=${this.inputMode}
|
|
185
|
+
type=${this.type}
|
|
186
|
+
label=${this.label}
|
|
187
|
+
name=${this.name}
|
|
188
|
+
value=${this.value}
|
|
175
189
|
>
|
|
176
|
-
|
|
190
|
+
${this.leadingIcon
|
|
191
|
+
? html `<ix-icon slot="leading-icon">${this.leadingIcon}</ix-icon>`
|
|
192
|
+
: nothing}
|
|
193
|
+
${this.trailingIcon
|
|
194
|
+
? html `<ix-icon slot="trailing-icon"
|
|
195
|
+
>${this.trailingIcon}</ix-icon
|
|
196
|
+
>`
|
|
197
|
+
: nothing}
|
|
198
|
+
</${tag}>
|
|
177
199
|
`;
|
|
178
|
-
}
|
|
179
|
-
return html ` ${comp} `;
|
|
180
200
|
}
|
|
181
201
|
}
|
|
182
202
|
__decorate([
|
|
183
|
-
|
|
184
|
-
], IxTextbox.prototype, "
|
|
203
|
+
query('.textfield')
|
|
204
|
+
], IxTextbox.prototype, "component", void 0);
|
|
185
205
|
__decorate([
|
|
186
|
-
property({ reflect: true })
|
|
187
|
-
], IxTextbox.prototype, "
|
|
206
|
+
property({ type: Boolean, reflect: true })
|
|
207
|
+
], IxTextbox.prototype, "filled", void 0);
|
|
188
208
|
__decorate([
|
|
189
209
|
property({ type: Boolean, reflect: true })
|
|
190
210
|
], IxTextbox.prototype, "disabled", void 0);
|
|
@@ -203,6 +223,9 @@ __decorate([
|
|
|
203
223
|
__decorate([
|
|
204
224
|
property()
|
|
205
225
|
], IxTextbox.prototype, "value", void 0);
|
|
226
|
+
__decorate([
|
|
227
|
+
property()
|
|
228
|
+
], IxTextbox.prototype, "name", void 0);
|
|
206
229
|
__decorate([
|
|
207
230
|
property({ attribute: 'prefix-text' })
|
|
208
231
|
], IxTextbox.prototype, "prefixText", void 0);
|
|
@@ -210,11 +233,11 @@ __decorate([
|
|
|
210
233
|
property({ attribute: 'suffix-text' })
|
|
211
234
|
], IxTextbox.prototype, "suffixText", void 0);
|
|
212
235
|
__decorate([
|
|
213
|
-
property({
|
|
214
|
-
], IxTextbox.prototype, "
|
|
236
|
+
property({ attribute: 'leading-icon' })
|
|
237
|
+
], IxTextbox.prototype, "leadingIcon", void 0);
|
|
215
238
|
__decorate([
|
|
216
|
-
property({
|
|
217
|
-
], IxTextbox.prototype, "
|
|
239
|
+
property({ attribute: 'trailing-icon' })
|
|
240
|
+
], IxTextbox.prototype, "trailingIcon", void 0);
|
|
218
241
|
__decorate([
|
|
219
242
|
property({ attribute: 'supporting-text' })
|
|
220
243
|
], IxTextbox.prototype, "supportingText", void 0);
|
|
@@ -224,6 +247,9 @@ __decorate([
|
|
|
224
247
|
__decorate([
|
|
225
248
|
property({ type: Number })
|
|
226
249
|
], IxTextbox.prototype, "rows", void 0);
|
|
250
|
+
__decorate([
|
|
251
|
+
property({ reflect: true })
|
|
252
|
+
], IxTextbox.prototype, "inputMode", void 0);
|
|
227
253
|
__decorate([
|
|
228
254
|
property()
|
|
229
255
|
], IxTextbox.prototype, "max", void 0);
|
|
@@ -246,6 +272,15 @@ __decorate([
|
|
|
246
272
|
property({ type: Boolean, reflect: true })
|
|
247
273
|
], IxTextbox.prototype, "readOnly", void 0);
|
|
248
274
|
__decorate([
|
|
249
|
-
|
|
250
|
-
], IxTextbox.prototype, "
|
|
275
|
+
property({ type: Boolean, reflect: true })
|
|
276
|
+
], IxTextbox.prototype, "multiple", void 0);
|
|
277
|
+
__decorate([
|
|
278
|
+
property()
|
|
279
|
+
], IxTextbox.prototype, "step", void 0);
|
|
280
|
+
__decorate([
|
|
281
|
+
property({ reflect: true })
|
|
282
|
+
], IxTextbox.prototype, "type", void 0);
|
|
283
|
+
__decorate([
|
|
284
|
+
property({ reflect: true })
|
|
285
|
+
], IxTextbox.prototype, "autocomplete", void 0);
|
|
251
286
|
//#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,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;iDACpC;AAMvB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;kDACpC;AAMoB;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;AAQzB;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;AAErC;IAAvB,KAAK,CAAC,eAAe,CAAC;8CAAgC","sourcesContent":["import { html, LitElement } from 'lit';\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 TextChangeEvent,\n} from './types/index.js';\n\nexport class IxTextbox extends LitElement {\n @property({ type: Boolean }) outlined = true;\n\n @property({ reflect: true })\n type: TextFieldType | UnsupportedTextFieldType = 'text';\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 * 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 * Whether or not the text field has a leading icon. Used for SSR.\n */\n @property({ type: Boolean, attribute: 'has-leading-icon' })\n hasLeadingIcon = false;\n\n /**\n * Whether or not the text field has a trailing icon. Used for SSR.\n */\n @property({ type: Boolean, attribute: 'has-trailing-icon' })\n hasTrailingIcon = false;\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 /**\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 @query('#md-textfield') mdTextfield!: HTMLInputElement;\n\n handleChange(e: Event) {\n const inputElement = e.target as HTMLInputElement;\n const textChangeEvent = new CustomEvent('textChange', {\n detail: {\n value: inputElement.value,\n },\n composed: true,\n } as TextChangeEvent);\n\n this.dispatchEvent(textChangeEvent);\n }\n\n getValidityStatus() {\n return this.mdTextfield?.reportValidity();\n }\n\n render() {\n let comp;\n if (this.outlined) {\n comp = html`\n <md-outlined-text-field\n id=\"md-textfield\"\n ?disabled=\"${this.disabled}\"\n ?required=\"${this.required}\"\n ?error=\"${this.error}\"\n error-text=\"${this.errorText}\"\n label=\"${this.label}\"\n value=\"${this.value}\"\n placeholder=\"${this.placeholder}\"\n ?readOnly=\"${this.readOnly}\"\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 type=\"${this.type}\"\n @input=\"${this.handleChange}\"\n >\n </md-outlined-text-field>\n `;\n } else {\n comp = html`\n <md-filled-text-field\n id=\"md-textfield\"\n ?disabled=\"${this.disabled}\"\n ?required=\"${this.required}\"\n ?error=\"${this.error}\"\n error-text=\"${this.errorText}\"\n label=\"${this.label}\"\n value=\"${this.value}\"\n placeholder=\"${this.placeholder}\"\n ?readOnly=\"${this.readOnly}\"\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 type=\"${this.type}\"\n @input=\"${this.handleChange}\"\n >\n </md-filled-text-field>\n `;\n }\n return html` ${comp} `;\n }\n}\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ix-textbox': IxTextbox;\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,mBAAmB,CAAC;AACpD,OAAO,8CAA8C,CAAC;AACtD,OAAO,gDAAgD,CAAC;AAKxD,OAAO,oCAAoC,CAAC;AAE5C,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;;WAEG;QAEH,iBAAY,GAAG,E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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';\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 protected createRenderRoot() {\n return this;\n }\n\n protected override render() {\n const tag: StaticValue = this.filled\n ? literal`md-filled-text-field`\n : literal`md-outlined-text-field`;\n\n return staticHtml`\n <${tag}\n class=\"textfield\"\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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digital-realty/ix-textbox",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.6",
|
|
4
4
|
"description": "Webcomponent ix-textbox following open-wc recommendations",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Digital Realty",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"test:watch": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wtr --watch\""
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
+
"@digital-realty/ix-icon": "^0.0.3",
|
|
29
30
|
"@lit-labs/react": "^2.0.3",
|
|
30
31
|
"@material/web": "^1.0.0-pre.15",
|
|
31
32
|
"lit": "^2.7.6",
|
|
@@ -46,6 +47,7 @@
|
|
|
46
47
|
"husky": "^4.3.8",
|
|
47
48
|
"lint-staged": "^10.5.4",
|
|
48
49
|
"prettier": "^2.4.1",
|
|
50
|
+
"sinon": "^16.1.3",
|
|
49
51
|
"tslib": "^2.3.1",
|
|
50
52
|
"typescript": "^4.5.2"
|
|
51
53
|
},
|
|
@@ -61,6 +63,7 @@
|
|
|
61
63
|
"@typescript-eslint"
|
|
62
64
|
],
|
|
63
65
|
"rules": {
|
|
66
|
+
"no-dupe-class-members": "off",
|
|
64
67
|
"class-methods-use-this": "off",
|
|
65
68
|
"no-unused-vars": "off",
|
|
66
69
|
"@typescript-eslint/no-unused-vars": [
|
|
@@ -74,6 +77,10 @@
|
|
|
74
77
|
"ignorePackages": true
|
|
75
78
|
}
|
|
76
79
|
]
|
|
80
|
+
},
|
|
81
|
+
"globals": {
|
|
82
|
+
"ShadowRootInit": true,
|
|
83
|
+
"SelectionMode": true
|
|
77
84
|
}
|
|
78
85
|
},
|
|
79
86
|
"prettier": {
|
|
@@ -98,5 +105,5 @@
|
|
|
98
105
|
"README.md",
|
|
99
106
|
"LICENSE"
|
|
100
107
|
],
|
|
101
|
-
"gitHead": "
|
|
108
|
+
"gitHead": "ed23dcb034e9d2a56ba58c27d995a737442e66ea"
|
|
102
109
|
}
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Input types that are compatible with the text field.
|
|
3
|
-
*/
|
|
4
|
-
export type TextFieldType = 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'url' | 'textarea';
|
|
5
|
-
/**
|
|
6
|
-
* Input types that are not fully supported for the text field.
|
|
7
|
-
*/
|
|
8
|
-
export type UnsupportedTextFieldType = 'color' | 'date' | 'datetime-local' | 'file' | 'month' | 'time' | 'week';
|
|
9
|
-
/**
|
|
10
|
-
* The event that is fired when the text field's value changes.
|
|
11
|
-
*/
|
|
12
|
-
export type TextChangeEvent = CustomEvent<{
|
|
13
|
-
value: string;
|
|
14
|
-
}>;
|
package/dist/types/index.js
DELETED
package/dist/types/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Input types that are compatible with the text field.\n */\nexport type TextFieldType =\n | 'email'\n | 'number'\n | 'password'\n | 'search'\n | 'tel'\n | 'text'\n | 'url'\n | 'textarea';\n\n/**\n * Input types that are not fully supported for the text field.\n */\nexport type UnsupportedTextFieldType =\n | 'color'\n | 'date'\n | 'datetime-local'\n | 'file'\n | 'month'\n | 'time'\n | 'week';\n\n/**\n * The event that is fired when the text field's value changes.\n */\nexport type TextChangeEvent = CustomEvent<{ value: string }>;\n"]}
|