@digital-realty/ix-textbox 2.0.1 → 2.0.5
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/LICENSE +20 -20
- package/README.md +68 -62
- package/dist/src/IxTextbox.d.ts +111 -105
- package/dist/src/IxTextbox.js +250 -239
- package/dist/src/IxTextbox.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/ix-textbox-styles.d.ts +1 -1
- package/dist/src/ix-textbox-styles.js +58 -58
- package/dist/src/ix-textbox-styles.js.map +1 -1
- package/dist/src/ix-textbox.d.ts +1 -1
- package/dist/src/ix-textbox.js +2 -2
- package/dist/src/ix-textbox.js.map +1 -1
- package/dist/src/react/IxTextbox.d.ts +2 -0
- package/dist/src/react/IxTextbox.js +10 -0
- package/dist/src/react/IxTextbox.js.map +1 -0
- package/dist/src/types/index.d.ts +14 -8
- package/dist/src/types/index.js +1 -1
- package/dist/src/types/index.js.map +1 -1
- package/dist/test/ix-textbox.test.d.ts +1 -1
- package/dist/test/ix-textbox.test.js +22 -22
- package/dist/test/ix-textbox.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +94 -91
- package/src/IxTextbox.ts +216 -194
- package/src/index.ts +1 -1
- package/src/ix-textbox-styles.ts +59 -59
- package/src/ix-textbox.ts +3 -3
- package/src/react/IxTextbox.ts +11 -0
- package/src/types/index.ts +29 -24
- package/test/ix-textbox.test.ts +32 -32
- package/tsconfig.json +22 -22
- package/web-dev-server.config.mjs +27 -27
- package/web-test-runner.config.mjs +41 -41
- package/.editorconfig +0 -29
- package/demo/index.html +0 -29
- package/dist/stories/index.stories.d.ts +0 -33
- package/dist/stories/index.stories.js +0 -37
- package/dist/stories/index.stories.js.map +0 -1
package/dist/src/IxTextbox.js
CHANGED
|
@@ -1,240 +1,251 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { html, LitElement } from 'lit';
|
|
3
|
-
import { property } from 'lit/decorators.js';
|
|
4
|
-
import '@material/web/textfield/filled-text-field.js';
|
|
5
|
-
import '@material/web/textfield/outlined-text-field.js';
|
|
6
|
-
export class IxTextbox extends LitElement {
|
|
7
|
-
constructor() {
|
|
8
|
-
super(...arguments);
|
|
9
|
-
this.outlined = true;
|
|
10
|
-
this.type = 'text';
|
|
11
|
-
this.disabled = false;
|
|
12
|
-
/**
|
|
13
|
-
* Gets or sets whether or not the text field is in a visually invalid state.
|
|
14
|
-
*
|
|
15
|
-
* Calling `reportValidity()` will automatically update `error`.
|
|
16
|
-
*/
|
|
17
|
-
this.error = false;
|
|
18
|
-
/**
|
|
19
|
-
* The error message that replaces supporting text when `error` is true. If
|
|
20
|
-
* `errorText` is an empty string, then the supporting text will continue to
|
|
21
|
-
* show.
|
|
22
|
-
*
|
|
23
|
-
* Calling `reportValidity()` will automatically update `errorText` to the
|
|
24
|
-
* native `validationMessage`.
|
|
25
|
-
*/
|
|
26
|
-
this.errorText = '';
|
|
27
|
-
this.label = '';
|
|
28
|
-
this.required = false;
|
|
29
|
-
/**
|
|
30
|
-
* The current value of the text field. It is always a string.
|
|
31
|
-
*/
|
|
32
|
-
this.value = '';
|
|
33
|
-
/**
|
|
34
|
-
* An optional prefix to display before the input value.
|
|
35
|
-
*/
|
|
36
|
-
this.prefixText = '';
|
|
37
|
-
/**
|
|
38
|
-
* An optional suffix to display after the input value.
|
|
39
|
-
*/
|
|
40
|
-
this.suffixText = '';
|
|
41
|
-
/**
|
|
42
|
-
* Whether or not the text field has a leading icon. Used for SSR.
|
|
43
|
-
*/
|
|
44
|
-
this.hasLeadingIcon = false;
|
|
45
|
-
/**
|
|
46
|
-
* Whether or not the text field has a trailing icon. Used for SSR.
|
|
47
|
-
*/
|
|
48
|
-
this.hasTrailingIcon = false;
|
|
49
|
-
/**
|
|
50
|
-
* Conveys additional information below the text field, such as how it should
|
|
51
|
-
* be used.
|
|
52
|
-
*/
|
|
53
|
-
this.supportingText = '';
|
|
54
|
-
/**
|
|
55
|
-
* Override the input text CSS `direction`. Useful for RTL languages that use
|
|
56
|
-
* LTR notation for fractions.
|
|
57
|
-
*/
|
|
58
|
-
this.textDirection = '';
|
|
59
|
-
/**
|
|
60
|
-
* The number of rows to display for a `type="textarea"` text field.
|
|
61
|
-
* Defaults to 2.
|
|
62
|
-
*/
|
|
63
|
-
this.rows = 2;
|
|
64
|
-
// <input> properties
|
|
65
|
-
/**
|
|
66
|
-
* Defines the greatest value in the range of permitted values.
|
|
67
|
-
*
|
|
68
|
-
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#max
|
|
69
|
-
*/
|
|
70
|
-
this.max = '';
|
|
71
|
-
/**
|
|
72
|
-
* The maximum number of characters a user can enter into the text field. Set
|
|
73
|
-
* to -1 for none.
|
|
74
|
-
*
|
|
75
|
-
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#maxlength
|
|
76
|
-
*/
|
|
77
|
-
this.maxLength = -1;
|
|
78
|
-
/**
|
|
79
|
-
* Defines the most negative value in the range of permitted values.
|
|
80
|
-
*
|
|
81
|
-
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#min
|
|
82
|
-
*/
|
|
83
|
-
this.min = '';
|
|
84
|
-
/**
|
|
85
|
-
* The minimum number of characters a user can enter into the text field. Set
|
|
86
|
-
* to -1 for none.
|
|
87
|
-
*
|
|
88
|
-
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#minlength
|
|
89
|
-
*/
|
|
90
|
-
this.minLength = -1;
|
|
91
|
-
/**
|
|
92
|
-
* A regular expression that the text field's value must match to pass
|
|
93
|
-
* constraint validation.
|
|
94
|
-
*
|
|
95
|
-
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#pattern
|
|
96
|
-
*/
|
|
97
|
-
this.pattern = '';
|
|
98
|
-
this.placeholder = '';
|
|
99
|
-
/**
|
|
100
|
-
* Indicates whether or not a user should be able to edit the text field's
|
|
101
|
-
* value.
|
|
102
|
-
*
|
|
103
|
-
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#readonly
|
|
104
|
-
*/
|
|
105
|
-
this.readOnly = false;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, LitElement } from 'lit';
|
|
3
|
+
import { property, query } from 'lit/decorators.js';
|
|
4
|
+
import '@material/web/textfield/filled-text-field.js';
|
|
5
|
+
import '@material/web/textfield/outlined-text-field.js';
|
|
6
|
+
export class IxTextbox extends LitElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.outlined = true;
|
|
10
|
+
this.type = 'text';
|
|
11
|
+
this.disabled = false;
|
|
12
|
+
/**
|
|
13
|
+
* Gets or sets whether or not the text field is in a visually invalid state.
|
|
14
|
+
*
|
|
15
|
+
* Calling `reportValidity()` will automatically update `error`.
|
|
16
|
+
*/
|
|
17
|
+
this.error = false;
|
|
18
|
+
/**
|
|
19
|
+
* The error message that replaces supporting text when `error` is true. If
|
|
20
|
+
* `errorText` is an empty string, then the supporting text will continue to
|
|
21
|
+
* show.
|
|
22
|
+
*
|
|
23
|
+
* Calling `reportValidity()` will automatically update `errorText` to the
|
|
24
|
+
* native `validationMessage`.
|
|
25
|
+
*/
|
|
26
|
+
this.errorText = '';
|
|
27
|
+
this.label = '';
|
|
28
|
+
this.required = false;
|
|
29
|
+
/**
|
|
30
|
+
* The current value of the text field. It is always a string.
|
|
31
|
+
*/
|
|
32
|
+
this.value = '';
|
|
33
|
+
/**
|
|
34
|
+
* An optional prefix to display before the input value.
|
|
35
|
+
*/
|
|
36
|
+
this.prefixText = '';
|
|
37
|
+
/**
|
|
38
|
+
* An optional suffix to display after the input value.
|
|
39
|
+
*/
|
|
40
|
+
this.suffixText = '';
|
|
41
|
+
/**
|
|
42
|
+
* Whether or not the text field has a leading icon. Used for SSR.
|
|
43
|
+
*/
|
|
44
|
+
this.hasLeadingIcon = false;
|
|
45
|
+
/**
|
|
46
|
+
* Whether or not the text field has a trailing icon. Used for SSR.
|
|
47
|
+
*/
|
|
48
|
+
this.hasTrailingIcon = false;
|
|
49
|
+
/**
|
|
50
|
+
* Conveys additional information below the text field, such as how it should
|
|
51
|
+
* be used.
|
|
52
|
+
*/
|
|
53
|
+
this.supportingText = '';
|
|
54
|
+
/**
|
|
55
|
+
* Override the input text CSS `direction`. Useful for RTL languages that use
|
|
56
|
+
* LTR notation for fractions.
|
|
57
|
+
*/
|
|
58
|
+
this.textDirection = '';
|
|
59
|
+
/**
|
|
60
|
+
* The number of rows to display for a `type="textarea"` text field.
|
|
61
|
+
* Defaults to 2.
|
|
62
|
+
*/
|
|
63
|
+
this.rows = 2;
|
|
64
|
+
// <input> properties
|
|
65
|
+
/**
|
|
66
|
+
* Defines the greatest value in the range of permitted values.
|
|
67
|
+
*
|
|
68
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#max
|
|
69
|
+
*/
|
|
70
|
+
this.max = '';
|
|
71
|
+
/**
|
|
72
|
+
* The maximum number of characters a user can enter into the text field. Set
|
|
73
|
+
* to -1 for none.
|
|
74
|
+
*
|
|
75
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#maxlength
|
|
76
|
+
*/
|
|
77
|
+
this.maxLength = -1;
|
|
78
|
+
/**
|
|
79
|
+
* Defines the most negative value in the range of permitted values.
|
|
80
|
+
*
|
|
81
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#min
|
|
82
|
+
*/
|
|
83
|
+
this.min = '';
|
|
84
|
+
/**
|
|
85
|
+
* The minimum number of characters a user can enter into the text field. Set
|
|
86
|
+
* to -1 for none.
|
|
87
|
+
*
|
|
88
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#minlength
|
|
89
|
+
*/
|
|
90
|
+
this.minLength = -1;
|
|
91
|
+
/**
|
|
92
|
+
* A regular expression that the text field's value must match to pass
|
|
93
|
+
* constraint validation.
|
|
94
|
+
*
|
|
95
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#pattern
|
|
96
|
+
*/
|
|
97
|
+
this.pattern = '';
|
|
98
|
+
this.placeholder = '';
|
|
99
|
+
/**
|
|
100
|
+
* Indicates whether or not a user should be able to edit the text field's
|
|
101
|
+
* value.
|
|
102
|
+
*
|
|
103
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#readonly
|
|
104
|
+
*/
|
|
105
|
+
this.readOnly = false;
|
|
106
|
+
}
|
|
107
|
+
handleChange(e) {
|
|
108
|
+
const inputElement = e.target;
|
|
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();
|
|
120
|
+
}
|
|
121
|
+
render() {
|
|
122
|
+
let comp;
|
|
123
|
+
if (this.outlined) {
|
|
124
|
+
comp = html `
|
|
125
|
+
<md-outlined-text-field
|
|
126
|
+
id="md-textfield"
|
|
127
|
+
?disabled="${this.disabled}"
|
|
128
|
+
?required="${this.required}"
|
|
129
|
+
?error="${this.error}"
|
|
130
|
+
error-text="${this.errorText}"
|
|
131
|
+
label="${this.label}"
|
|
132
|
+
value="${this.value}"
|
|
133
|
+
placeholder="${this.placeholder}"
|
|
134
|
+
?readOnly="${this.readOnly}"
|
|
135
|
+
text-direction="${this.textDirection}"
|
|
136
|
+
rows="${this.rows}"
|
|
137
|
+
max="${this.max}"
|
|
138
|
+
maxLength="${this.maxLength}"
|
|
139
|
+
min="${this.min}"
|
|
140
|
+
minLength="${this.minLength}"
|
|
141
|
+
pattern="${this.pattern}"
|
|
142
|
+
prefix-text="${this.prefixText}"
|
|
143
|
+
suffix-text="${this.suffixText}"
|
|
144
|
+
supporting-text="${this.supportingText}"
|
|
145
|
+
type="${this.type}"
|
|
146
|
+
@input="${this.handleChange}"
|
|
147
|
+
>
|
|
148
|
+
</md-outlined-text-field>
|
|
149
|
+
`;
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
comp = html `
|
|
153
|
+
<md-filled-text-field
|
|
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}"
|
|
175
|
+
>
|
|
176
|
+
</md-filled-text-field>
|
|
177
|
+
`;
|
|
178
|
+
}
|
|
179
|
+
return html ` ${comp} `;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
__decorate([
|
|
183
|
+
property({ type: Boolean })
|
|
184
|
+
], IxTextbox.prototype, "outlined", void 0);
|
|
185
|
+
__decorate([
|
|
186
|
+
property({ reflect: true })
|
|
187
|
+
], IxTextbox.prototype, "type", void 0);
|
|
188
|
+
__decorate([
|
|
189
|
+
property({ type: Boolean, reflect: true })
|
|
190
|
+
], IxTextbox.prototype, "disabled", void 0);
|
|
191
|
+
__decorate([
|
|
192
|
+
property({ type: Boolean, reflect: true })
|
|
193
|
+
], IxTextbox.prototype, "error", void 0);
|
|
194
|
+
__decorate([
|
|
195
|
+
property({ attribute: 'error-text' })
|
|
196
|
+
], IxTextbox.prototype, "errorText", void 0);
|
|
197
|
+
__decorate([
|
|
198
|
+
property()
|
|
199
|
+
], IxTextbox.prototype, "label", void 0);
|
|
200
|
+
__decorate([
|
|
201
|
+
property({ type: Boolean, reflect: true })
|
|
202
|
+
], IxTextbox.prototype, "required", void 0);
|
|
203
|
+
__decorate([
|
|
204
|
+
property()
|
|
205
|
+
], IxTextbox.prototype, "value", void 0);
|
|
206
|
+
__decorate([
|
|
207
|
+
property({ attribute: 'prefix-text' })
|
|
208
|
+
], IxTextbox.prototype, "prefixText", void 0);
|
|
209
|
+
__decorate([
|
|
210
|
+
property({ attribute: 'suffix-text' })
|
|
211
|
+
], IxTextbox.prototype, "suffixText", void 0);
|
|
212
|
+
__decorate([
|
|
213
|
+
property({ type: Boolean, attribute: 'has-leading-icon' })
|
|
214
|
+
], IxTextbox.prototype, "hasLeadingIcon", void 0);
|
|
215
|
+
__decorate([
|
|
216
|
+
property({ type: Boolean, attribute: 'has-trailing-icon' })
|
|
217
|
+
], IxTextbox.prototype, "hasTrailingIcon", void 0);
|
|
218
|
+
__decorate([
|
|
219
|
+
property({ attribute: 'supporting-text' })
|
|
220
|
+
], IxTextbox.prototype, "supportingText", void 0);
|
|
221
|
+
__decorate([
|
|
222
|
+
property({ attribute: 'text-direction' })
|
|
223
|
+
], IxTextbox.prototype, "textDirection", void 0);
|
|
224
|
+
__decorate([
|
|
225
|
+
property({ type: Number })
|
|
226
|
+
], IxTextbox.prototype, "rows", void 0);
|
|
227
|
+
__decorate([
|
|
228
|
+
property()
|
|
229
|
+
], IxTextbox.prototype, "max", void 0);
|
|
230
|
+
__decorate([
|
|
231
|
+
property({ type: Number })
|
|
232
|
+
], IxTextbox.prototype, "maxLength", void 0);
|
|
233
|
+
__decorate([
|
|
234
|
+
property()
|
|
235
|
+
], IxTextbox.prototype, "min", void 0);
|
|
236
|
+
__decorate([
|
|
237
|
+
property({ type: Number })
|
|
238
|
+
], IxTextbox.prototype, "minLength", void 0);
|
|
239
|
+
__decorate([
|
|
240
|
+
property()
|
|
241
|
+
], IxTextbox.prototype, "pattern", void 0);
|
|
242
|
+
__decorate([
|
|
243
|
+
property({ reflect: true })
|
|
244
|
+
], IxTextbox.prototype, "placeholder", void 0);
|
|
245
|
+
__decorate([
|
|
246
|
+
property({ type: Boolean, reflect: true })
|
|
247
|
+
], IxTextbox.prototype, "readOnly", void 0);
|
|
248
|
+
__decorate([
|
|
249
|
+
query('#md-textfield')
|
|
250
|
+
], IxTextbox.prototype, "mdTextfield", void 0);
|
|
240
251
|
//# sourceMappingURL=IxTextbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IxTextbox.js","sourceRoot":"","sources":["../../src/IxTextbox.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,8CAA8C,CAAC;AACtD,OAAO,gDAAgD,CAAC;AAGxD,MAAM,OAAO,SAAU,SAAQ,UAAU;IAAzC;;QAC+B,aAAQ,GAAG,IAAI,CAAC;QAG7C,SAAI,GAA6C,MAAM,CAAC;QAEZ,aAAQ,GAAG,KAAK,CAAC;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AAE;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;AAE/B;IAA7B,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;2CAA+B","sourcesContent":["import { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport '@material/web/textfield/filled-text-field.js';\nimport '@material/web/textfield/outlined-text-field.js';\nimport { TextFieldType, UnsupportedTextFieldType } 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 @property({ type: Function }) onChange: Function = () => {};\n\n _handleChange(e: Event) {\n const inputElement = e.target as HTMLInputElement;\n this.onChange({ value: inputElement.value });\n }\n\n render() {\n let comp;\n if (this.outlined) {\n comp = html`\n <md-outlined-text-field\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 ?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.onChange}\"\n >\n </md-filled-text-field>\n `;\n }\n return html` ${comp} `;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IxTextbox.js","sourceRoot":"","sources":["../../src/IxTextbox.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,8CAA8C,CAAC;AACtD,OAAO,gDAAgD,CAAC;AAOxD,MAAM,OAAO,SAAU,SAAQ,UAAU;IAAzC;;QAC+B,aAAQ,GAAG,IAAI,CAAC;QAG7C,SAAI,GAA6C,MAAM,CAAC;QAEZ,aAAQ,GAAG,KAAK,CAAC;QAE7D;;;;WAIG;QACyC,UAAK,GAAG,KAAK,CAAC;QAE1D;;;;;;;WAOG;QACoC,cAAS,GAAG,EAAE,CAAC;QAE1C,UAAK,G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M,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';\r\nimport { property, query } from 'lit/decorators.js';\r\nimport '@material/web/textfield/filled-text-field.js';\r\nimport '@material/web/textfield/outlined-text-field.js';\r\nimport {\r\n TextFieldType,\r\n UnsupportedTextFieldType,\r\n TextChangeEvent,\r\n} from './types/index.js';\r\n\r\nexport class IxTextbox extends LitElement {\r\n @property({ type: Boolean }) outlined = true;\r\n\r\n @property({ reflect: true })\r\n type: TextFieldType | UnsupportedTextFieldType = 'text';\r\n\r\n @property({ type: Boolean, reflect: true }) disabled = false;\r\n\r\n /**\r\n * Gets or sets whether or not the text field is in a visually invalid state.\r\n *\r\n * Calling `reportValidity()` will automatically update `error`.\r\n */\r\n @property({ type: Boolean, reflect: true }) error = false;\r\n\r\n /**\r\n * The error message that replaces supporting text when `error` is true. If\r\n * `errorText` is an empty string, then the supporting text will continue to\r\n * show.\r\n *\r\n * Calling `reportValidity()` will automatically update `errorText` to the\r\n * native `validationMessage`.\r\n */\r\n @property({ attribute: 'error-text' }) errorText = '';\r\n\r\n @property() label = '';\r\n\r\n @property({ type: Boolean, reflect: true }) required = false;\r\n\r\n /**\r\n * The current value of the text field. It is always a string.\r\n */\r\n @property() value = '';\r\n\r\n /**\r\n * An optional prefix to display before the input value.\r\n */\r\n @property({ attribute: 'prefix-text' }) prefixText = '';\r\n\r\n /**\r\n * An optional suffix to display after the input value.\r\n */\r\n @property({ attribute: 'suffix-text' }) suffixText = '';\r\n\r\n /**\r\n * Whether or not the text field has a leading icon. Used for SSR.\r\n */\r\n @property({ type: Boolean, attribute: 'has-leading-icon' })\r\n hasLeadingIcon = false;\r\n\r\n /**\r\n * Whether or not the text field has a trailing icon. Used for SSR.\r\n */\r\n @property({ type: Boolean, attribute: 'has-trailing-icon' })\r\n hasTrailingIcon = false;\r\n\r\n /**\r\n * Conveys additional information below the text field, such as how it should\r\n * be used.\r\n */\r\n @property({ attribute: 'supporting-text' }) supportingText = '';\r\n\r\n /**\r\n * Override the input text CSS `direction`. Useful for RTL languages that use\r\n * LTR notation for fractions.\r\n */\r\n @property({ attribute: 'text-direction' }) textDirection = '';\r\n\r\n /**\r\n * The number of rows to display for a `type=\"textarea\"` text field.\r\n * Defaults to 2.\r\n */\r\n @property({ type: Number }) rows = 2;\r\n\r\n // <input> properties\r\n /**\r\n * Defines the greatest value in the range of permitted values.\r\n *\r\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#max\r\n */\r\n @property() max = '';\r\n\r\n /**\r\n * The maximum number of characters a user can enter into the text field. Set\r\n * to -1 for none.\r\n *\r\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#maxlength\r\n */\r\n @property({ type: Number }) maxLength = -1;\r\n\r\n /**\r\n * Defines the most negative value in the range of permitted values.\r\n *\r\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#min\r\n */\r\n @property() min = '';\r\n\r\n /**\r\n * The minimum number of characters a user can enter into the text field. Set\r\n * to -1 for none.\r\n *\r\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#minlength\r\n */\r\n @property({ type: Number }) minLength = -1;\r\n\r\n /**\r\n * A regular expression that the text field's value must match to pass\r\n * constraint validation.\r\n *\r\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#pattern\r\n */\r\n @property() pattern = '';\r\n\r\n @property({ reflect: true }) placeholder = '';\r\n\r\n /**\r\n * Indicates whether or not a user should be able to edit the text field's\r\n * value.\r\n *\r\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#readonly\r\n */\r\n @property({ type: Boolean, reflect: true }) readOnly = false;\r\n\r\n @query('#md-textfield') mdTextfield!: HTMLInputElement;\r\n\r\n handleChange(e: Event) {\r\n const inputElement = e.target as HTMLInputElement;\r\n const textChangeEvent = new CustomEvent('textChange', {\r\n detail: {\r\n value: inputElement.value,\r\n },\r\n composed: true,\r\n } as TextChangeEvent);\r\n\r\n this.dispatchEvent(textChangeEvent);\r\n }\r\n\r\n getValidityStatus() {\r\n return this.mdTextfield?.reportValidity();\r\n }\r\n\r\n render() {\r\n let comp;\r\n if (this.outlined) {\r\n comp = html`\r\n <md-outlined-text-field\r\n id=\"md-textfield\"\r\n ?disabled=\"${this.disabled}\"\r\n ?required=\"${this.required}\"\r\n ?error=\"${this.error}\"\r\n error-text=\"${this.errorText}\"\r\n label=\"${this.label}\"\r\n value=\"${this.value}\"\r\n placeholder=\"${this.placeholder}\"\r\n ?readOnly=\"${this.readOnly}\"\r\n text-direction=\"${this.textDirection}\"\r\n rows=\"${this.rows}\"\r\n max=\"${this.max}\"\r\n maxLength=\"${this.maxLength}\"\r\n min=\"${this.min}\"\r\n minLength=\"${this.minLength}\"\r\n pattern=\"${this.pattern}\"\r\n prefix-text=\"${this.prefixText}\"\r\n suffix-text=\"${this.suffixText}\"\r\n supporting-text=\"${this.supportingText}\"\r\n type=\"${this.type}\"\r\n @input=\"${this.handleChange}\"\r\n >\r\n </md-outlined-text-field>\r\n `;\r\n } else {\r\n comp = html`\r\n <md-filled-text-field\r\n id=\"md-textfield\"\r\n ?disabled=\"${this.disabled}\"\r\n ?required=\"${this.required}\"\r\n ?error=\"${this.error}\"\r\n error-text=\"${this.errorText}\"\r\n label=\"${this.label}\"\r\n value=\"${this.value}\"\r\n placeholder=\"${this.placeholder}\"\r\n ?readOnly=\"${this.readOnly}\"\r\n text-direction=\"${this.textDirection}\"\r\n rows=\"${this.rows}\"\r\n max=\"${this.max}\"\r\n maxLength=\"${this.maxLength}\"\r\n min=\"${this.min}\"\r\n minLength=\"${this.minLength}\"\r\n pattern=\"${this.pattern}\"\r\n prefix-text=\"${this.prefixText}\"\r\n suffix-text=\"${this.suffixText}\"\r\n supporting-text=\"${this.supportingText}\"\r\n type=\"${this.type}\"\r\n @input=\"${this.handleChange}\"\r\n >\r\n </md-filled-text-field>\r\n `;\r\n }\r\n return html` ${comp} `;\r\n }\r\n}\r\ndeclare global {\r\n interface HTMLElementTagNameMap {\r\n 'ix-textbox': IxTextbox;\r\n }\r\n}\r\n"]}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { IxTextbox } from './IxTextbox.js';
|
|
1
|
+
export { IxTextbox } from './IxTextbox.js';
|
package/dist/src/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { IxTextbox } from './IxTextbox.js';
|
|
1
|
+
export { IxTextbox } from './IxTextbox.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC","sourcesContent":["export { IxTextbox } from './IxTextbox.js';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC","sourcesContent":["export { IxTextbox } from './IxTextbox.js';\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const IxTextboxStyles: import("lit").CSSResult;
|
|
1
|
+
export declare const IxTextboxStyles: import("lit").CSSResult;
|