@fluentui/web-components 3.0.0-beta.20 → 3.0.0-beta.22
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/CHANGELOG.md +20 -2
- package/dist/dts/accordion/accordion.options.d.ts +2 -2
- package/dist/dts/accordion-item/accordion-item.d.ts +1 -4
- package/dist/dts/accordion-item/accordion-item.template.d.ts +1 -1
- package/dist/dts/accordion-item/index.d.ts +2 -1
- package/dist/dts/anchor-button/index.d.ts +3 -2
- package/dist/dts/button/index.d.ts +4 -3
- package/dist/dts/checkbox/checkbox.d.ts +0 -3
- package/dist/dts/checkbox/index.d.ts +4 -3
- package/dist/dts/dialog/dialog.d.ts +14 -15
- package/dist/dts/divider/divider.d.ts +4 -7
- package/dist/dts/index-rollup.d.ts +29 -35
- package/dist/dts/index.d.ts +49 -34
- package/dist/dts/label/label.d.ts +0 -2
- package/dist/dts/menu/menu.d.ts +27 -25
- package/dist/dts/menu-button/index.d.ts +4 -3
- package/dist/dts/menu-button/menu-button.options.d.ts +1 -1
- package/dist/dts/menu-item/index.d.ts +4 -3
- package/dist/dts/progress-bar/index.d.ts +3 -2
- package/dist/dts/radio/index.d.ts +2 -1
- package/dist/dts/slider/index.d.ts +3 -2
- package/dist/dts/spinner/spinner.d.ts +0 -2
- package/dist/dts/switch/index.d.ts +3 -2
- package/dist/dts/switch/switch.d.ts +0 -1
- package/dist/dts/tab/index.d.ts +4 -3
- package/dist/dts/tab/tab.template.d.ts +1 -1
- package/dist/dts/tabs/index.d.ts +4 -3
- package/dist/dts/tabs/tabs.d.ts +13 -9
- package/dist/dts/text-input/index.d.ts +5 -4
- package/dist/dts/text-input/text-input.d.ts +282 -67
- package/dist/dts/text-input/text-input.definition.d.ts +2 -3
- package/dist/dts/text-input/text-input.options.d.ts +19 -29
- package/dist/dts/text-input/text-input.styles.d.ts +5 -2
- package/dist/dts/text-input/text-input.template.d.ts +9 -3
- package/dist/dts/theme/design-tokens.d.ts +1744 -0
- package/dist/dts/theme/set-theme.d.ts +5 -1
- package/dist/dts/toggle-button/index.d.ts +4 -3
- package/dist/dts/toggle-button/toggle-button.options.d.ts +1 -1
- package/dist/esm/accordion/accordion.js +1 -6
- package/dist/esm/accordion/accordion.js.map +1 -1
- package/dist/esm/accordion/accordion.options.js +1 -1
- package/dist/esm/accordion-item/accordion-item.js +1 -7
- package/dist/esm/accordion-item/accordion-item.js.map +1 -1
- package/dist/esm/accordion-item/index.js.map +1 -1
- package/dist/esm/anchor-button/anchor-button.js +1 -6
- package/dist/esm/anchor-button/anchor-button.js.map +1 -1
- package/dist/esm/anchor-button/index.js +2 -2
- package/dist/esm/anchor-button/index.js.map +1 -1
- package/dist/esm/avatar/avatar.js +1 -6
- package/dist/esm/avatar/avatar.js.map +1 -1
- package/dist/esm/badge/badge.js +1 -6
- package/dist/esm/badge/badge.js.map +1 -1
- package/dist/esm/button/button.js +1 -6
- package/dist/esm/button/button.js.map +1 -1
- package/dist/esm/button/index.js +3 -3
- package/dist/esm/button/index.js.map +1 -1
- package/dist/esm/checkbox/checkbox.js +1 -6
- package/dist/esm/checkbox/checkbox.js.map +1 -1
- package/dist/esm/checkbox/index.js +2 -2
- package/dist/esm/checkbox/index.js.map +1 -1
- package/dist/esm/counter-badge/counter-badge.js +1 -6
- package/dist/esm/counter-badge/counter-badge.js.map +1 -1
- package/dist/esm/dialog/dialog.js +15 -21
- package/dist/esm/dialog/dialog.js.map +1 -1
- package/dist/esm/divider/divider.js +2 -7
- package/dist/esm/divider/divider.js.map +1 -1
- package/dist/esm/image/image.js +1 -6
- package/dist/esm/image/image.js.map +1 -1
- package/dist/esm/index-rollup.js +29 -35
- package/dist/esm/index-rollup.js.map +1 -1
- package/dist/esm/index.js +33 -33
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/label/label.js +1 -6
- package/dist/esm/label/label.js.map +1 -1
- package/dist/esm/menu/menu.js +26 -29
- package/dist/esm/menu/menu.js.map +1 -1
- package/dist/esm/menu-button/index.js +2 -2
- package/dist/esm/menu-button/index.js.map +1 -1
- package/dist/esm/menu-item/index.js +2 -2
- package/dist/esm/menu-item/index.js.map +1 -1
- package/dist/esm/menu-item/menu-item.js +1 -6
- package/dist/esm/menu-item/menu-item.js.map +1 -1
- package/dist/esm/menu-list/menu-list.js +3 -7
- package/dist/esm/menu-list/menu-list.js.map +1 -1
- package/dist/esm/patterns/aria-globals.js +1 -6
- package/dist/esm/patterns/aria-globals.js.map +1 -1
- package/dist/esm/progress-bar/base-progress.js +1 -6
- package/dist/esm/progress-bar/base-progress.js.map +1 -1
- package/dist/esm/progress-bar/index.js +2 -2
- package/dist/esm/progress-bar/index.js.map +1 -1
- package/dist/esm/progress-bar/progress-bar.js +1 -6
- package/dist/esm/progress-bar/progress-bar.js.map +1 -1
- package/dist/esm/radio/index.js +1 -1
- package/dist/esm/radio/index.js.map +1 -1
- package/dist/esm/radio/radio.js +1 -6
- package/dist/esm/radio/radio.js.map +1 -1
- package/dist/esm/radio-group/radio-group.js +1 -6
- package/dist/esm/radio-group/radio-group.js.map +1 -1
- package/dist/esm/slider/index.js +1 -1
- package/dist/esm/slider/index.js.map +1 -1
- package/dist/esm/slider/slider.js +1 -6
- package/dist/esm/slider/slider.js.map +1 -1
- package/dist/esm/spinner/spinner.js +1 -6
- package/dist/esm/spinner/spinner.js.map +1 -1
- package/dist/esm/switch/index.js +1 -1
- package/dist/esm/switch/index.js.map +1 -1
- package/dist/esm/switch/switch.js +1 -6
- package/dist/esm/switch/switch.js.map +1 -1
- package/dist/esm/tab/index.js +2 -2
- package/dist/esm/tab/index.js.map +1 -1
- package/dist/esm/tab/tab.js +1 -6
- package/dist/esm/tab/tab.js.map +1 -1
- package/dist/esm/tabs/index.js +2 -2
- package/dist/esm/tabs/index.js.map +1 -1
- package/dist/esm/tabs/tabs.js +14 -15
- package/dist/esm/tabs/tabs.js.map +1 -1
- package/dist/esm/text/text.js +1 -6
- package/dist/esm/text/text.js.map +1 -1
- package/dist/esm/text-input/index.js +3 -3
- package/dist/esm/text-input/index.js.map +1 -1
- package/dist/esm/text-input/text-input.definition.js +2 -3
- package/dist/esm/text-input/text-input.definition.js.map +1 -1
- package/dist/esm/text-input/text-input.js +271 -102
- package/dist/esm/text-input/text-input.js.map +1 -1
- package/dist/esm/text-input/text-input.options.js +25 -18
- package/dist/esm/text-input/text-input.options.js.map +1 -1
- package/dist/esm/text-input/text-input.styles.js +8 -3
- package/dist/esm/text-input/text-input.styles.js.map +1 -1
- package/dist/esm/text-input/text-input.template.js +16 -32
- package/dist/esm/text-input/text-input.template.js.map +1 -1
- package/dist/esm/theme/design-tokens.js +1744 -0
- package/dist/esm/theme/design-tokens.js.map +1 -1
- package/dist/esm/theme/set-theme.js +5 -1
- package/dist/esm/theme/set-theme.js.map +1 -1
- package/dist/esm/toggle-button/index.js +3 -3
- package/dist/esm/toggle-button/index.js.map +1 -1
- package/dist/esm/toggle-button/toggle-button.js +1 -6
- package/dist/esm/toggle-button/toggle-button.js.map +1 -1
- package/dist/fluent-web-components.api.json +890 -916
- package/dist/web-components.d.ts +2109 -187
- package/dist/web-components.js +1335 -2042
- package/dist/web-components.min.js +266 -266
- package/docs/api-report.md +654 -485
- package/package.json +7 -4
- package/tsdoc.json +44 -0
- package/dist/dts/text-input/text-field.form-associated.d.ts +0 -14
- package/dist/esm/text-input/text-field.form-associated.js +0 -14
- package/dist/esm/text-input/text-field.form-associated.js.map +0 -1
|
@@ -1,153 +1,307 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { attr, nullableNumberConverter, observable, Updates } from '@microsoft/fast-element';
|
|
8
|
-
import { ARIAGlobalStatesAndProperties, StartEnd } from '../patterns/index.js';
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { attr, FASTElement, nullableNumberConverter, Observable, observable } from '@microsoft/fast-element';
|
|
3
|
+
import { keyEnter } from '@microsoft/fast-web-utilities';
|
|
4
|
+
import { StartEnd } from '../patterns/start-end.js';
|
|
9
5
|
import { applyMixins } from '../utils/apply-mixins.js';
|
|
10
|
-
import { TextInputType } from './text-input.options.js';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
import { ImplicitSubmissionBlockingTypes, TextInputType } from './text-input.options.js';
|
|
7
|
+
/**
|
|
8
|
+
* A Text Input Custom HTML Element.
|
|
9
|
+
* Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input | `<input>`} element.
|
|
10
|
+
*
|
|
11
|
+
* @slot start - Content which can be provided before the input
|
|
12
|
+
* @slot end - Content which can be provided after the input
|
|
13
|
+
* @slot - The default slot for button content
|
|
14
|
+
* @csspart label - The internal `<label>` element
|
|
15
|
+
* @csspart root - the root container for the internal control
|
|
16
|
+
* @csspart control - The internal `<input>` control
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
export class TextInput extends FASTElement {
|
|
14
20
|
constructor() {
|
|
15
21
|
super(...arguments);
|
|
16
22
|
/**
|
|
17
23
|
* Allows setting a type or mode of text.
|
|
24
|
+
*
|
|
18
25
|
* @public
|
|
19
26
|
* @remarks
|
|
20
|
-
* HTML Attribute: type
|
|
27
|
+
* HTML Attribute: `type`
|
|
21
28
|
*/
|
|
22
29
|
this.type = TextInputType.text;
|
|
30
|
+
/**
|
|
31
|
+
* The current value of the input.
|
|
32
|
+
*
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
this._value = this.initialValue;
|
|
36
|
+
/**
|
|
37
|
+
* Indicates that the value has been changed by the user.
|
|
38
|
+
*
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
this.dirtyValue = false;
|
|
42
|
+
/**
|
|
43
|
+
* The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
|
|
44
|
+
*
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
this.elementInternals = this.attachInternals();
|
|
23
48
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Updates the control label visibility based on the presence of default slotted content.
|
|
51
|
+
*
|
|
52
|
+
* @internal
|
|
53
|
+
*/
|
|
54
|
+
defaultSlottedNodesChanged(prev, next) {
|
|
55
|
+
if (this.$fastController.isConnected) {
|
|
56
|
+
this.controlLabel.hidden = !(next === null || next === void 0 ? void 0 : next.length);
|
|
28
57
|
}
|
|
29
58
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Sets the value of the element to the initial value.
|
|
61
|
+
*
|
|
62
|
+
* @internal
|
|
63
|
+
*/
|
|
64
|
+
initialValueChanged() {
|
|
65
|
+
if (!this.dirtyValue) {
|
|
66
|
+
this.value = this.initialValue;
|
|
34
67
|
}
|
|
35
68
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Syncs the `ElementInternals.ariaReadOnly` property when the `readonly` property changes.
|
|
71
|
+
*
|
|
72
|
+
* @internal
|
|
73
|
+
*/
|
|
74
|
+
readonlyChanged() {
|
|
75
|
+
if (this.$fastController.isConnected) {
|
|
76
|
+
this.elementInternals.ariaReadOnly = `${!!this.readonly}`;
|
|
39
77
|
}
|
|
40
78
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
79
|
+
/**
|
|
80
|
+
* Syncs the element's internal `aria-required` state with the `required` attribute.
|
|
81
|
+
*
|
|
82
|
+
* @param previous - the previous required state
|
|
83
|
+
* @param next - the current required state
|
|
84
|
+
*
|
|
85
|
+
* @internal
|
|
86
|
+
*/
|
|
87
|
+
requiredChanged(previous, next) {
|
|
88
|
+
if (this.$fastController.isConnected) {
|
|
89
|
+
this.elementInternals.ariaRequired = `${!!next}`;
|
|
45
90
|
}
|
|
46
91
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
92
|
+
/**
|
|
93
|
+
* The element's validity state.
|
|
94
|
+
*
|
|
95
|
+
* @public
|
|
96
|
+
* @remarks
|
|
97
|
+
* Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/validity | `ElementInternals.validity`} property.
|
|
98
|
+
*/
|
|
99
|
+
get validity() {
|
|
100
|
+
return this.elementInternals.validity;
|
|
52
101
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
102
|
+
/**
|
|
103
|
+
* The validation message.
|
|
104
|
+
*
|
|
105
|
+
* @public
|
|
106
|
+
* @remarks
|
|
107
|
+
* Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/validationMessage | `ElementInternals.validationMessage`} property.
|
|
108
|
+
*/
|
|
109
|
+
get validationMessage() {
|
|
110
|
+
return this.elementInternals.validationMessage;
|
|
58
111
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
112
|
+
/**
|
|
113
|
+
* The current value of the input.
|
|
114
|
+
* @public
|
|
115
|
+
*/
|
|
116
|
+
get value() {
|
|
117
|
+
Observable.track(this, 'value');
|
|
118
|
+
return this._value;
|
|
64
119
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
this.
|
|
120
|
+
set value(value) {
|
|
121
|
+
this._value = value;
|
|
122
|
+
if (this.$fastController.isConnected) {
|
|
123
|
+
this.control.value = value;
|
|
124
|
+
this.setFormValue(value);
|
|
125
|
+
this.setValidity();
|
|
126
|
+
Observable.notify(this, 'value');
|
|
69
127
|
}
|
|
70
128
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
129
|
+
/**
|
|
130
|
+
* Determines if the control can be submitted for constraint validation.
|
|
131
|
+
*
|
|
132
|
+
* @public
|
|
133
|
+
* @remarks
|
|
134
|
+
* Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/willValidate | `ElementInternals.willValidate`} property.
|
|
135
|
+
*/
|
|
136
|
+
get willValidate() {
|
|
137
|
+
return this.elementInternals.willValidate;
|
|
75
138
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
139
|
+
/**
|
|
140
|
+
* The associated form element.
|
|
141
|
+
*
|
|
142
|
+
* @public
|
|
143
|
+
* @remarks
|
|
144
|
+
* Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/form | `ElementInternals.form`} property.
|
|
145
|
+
*/
|
|
146
|
+
get form() {
|
|
147
|
+
return this.elementInternals.form;
|
|
80
148
|
}
|
|
81
149
|
/**
|
|
150
|
+
* Change event handler for inner control.
|
|
151
|
+
*
|
|
82
152
|
* @internal
|
|
153
|
+
* @privateRemarks
|
|
154
|
+
* "Change" events are not `composable` so they will not permeate the shadow DOM boundary. This function effectively
|
|
155
|
+
* proxies the change event, emitting a `change` event whenever the internal control emits a `change` event.
|
|
83
156
|
*/
|
|
157
|
+
changeHandler(e) {
|
|
158
|
+
e.preventDefault();
|
|
159
|
+
this.setValidity();
|
|
160
|
+
this.$emit('change', e, {
|
|
161
|
+
bubbles: true,
|
|
162
|
+
cancelable: false,
|
|
163
|
+
composed: false,
|
|
164
|
+
});
|
|
165
|
+
}
|
|
84
166
|
connectedCallback() {
|
|
85
167
|
super.connectedCallback();
|
|
86
|
-
this.
|
|
87
|
-
this.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
168
|
+
this.addEventListener('keypress', this.keypressHandler);
|
|
169
|
+
this.setFormValue(this.value);
|
|
170
|
+
this.setValidity();
|
|
171
|
+
}
|
|
172
|
+
disconnectedCallback() {
|
|
173
|
+
this.removeEventListener('keypress', this.keypressHandler);
|
|
174
|
+
super.disconnectedCallback();
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Resets the value to its initial value when the form is reset.
|
|
178
|
+
*
|
|
179
|
+
* @internal
|
|
180
|
+
*/
|
|
181
|
+
formResetCallback() {
|
|
182
|
+
this.value = this.initialValue;
|
|
183
|
+
this.dirtyValue = false;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Handles implicit form submission when the user presses the "Enter" key.
|
|
187
|
+
*
|
|
188
|
+
* @internal
|
|
189
|
+
*/
|
|
190
|
+
implicitSubmit() {
|
|
191
|
+
if (!this.elementInternals.form) {
|
|
192
|
+
return;
|
|
92
193
|
}
|
|
194
|
+
if (this.elementInternals.form.elements.length === 1) {
|
|
195
|
+
this.elementInternals.form.requestSubmit();
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
const formElements = [...this.elementInternals.form.elements];
|
|
199
|
+
// Try submitting with the first submit button, if any
|
|
200
|
+
const submitButton = formElements.find(x => x.getAttribute('type') === 'submit');
|
|
201
|
+
if (submitButton) {
|
|
202
|
+
submitButton.click();
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
// Determine if there is only one implicit submission blocking element
|
|
206
|
+
const filteredElements = formElements.filter(x => { var _a; return ImplicitSubmissionBlockingTypes.includes((_a = x.getAttribute('type')) !== null && _a !== void 0 ? _a : ''); });
|
|
207
|
+
if (filteredElements.length > 1) {
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
this.elementInternals.form.requestSubmit();
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Handles the internal control's `input` event.
|
|
214
|
+
*
|
|
215
|
+
* @internal
|
|
216
|
+
*/
|
|
217
|
+
inputHandler(e) {
|
|
218
|
+
this.dirtyValue = true;
|
|
219
|
+
this.value = this.control.value;
|
|
220
|
+
return true;
|
|
93
221
|
}
|
|
94
222
|
/**
|
|
95
|
-
*
|
|
223
|
+
* Handles the internal control's `keypress` event.
|
|
224
|
+
*
|
|
225
|
+
* @internal
|
|
226
|
+
*/
|
|
227
|
+
keypressHandler(e) {
|
|
228
|
+
if (e.key === keyEnter) {
|
|
229
|
+
this.implicitSubmit();
|
|
230
|
+
}
|
|
231
|
+
return true;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Selects all the text in the text field.
|
|
96
235
|
*
|
|
97
236
|
* @public
|
|
237
|
+
* @privateRemarks
|
|
238
|
+
* The `select` event does not permeate the shadow DOM boundary. This function effectively proxies the event,
|
|
239
|
+
* emitting a `select` event whenever the internal control emits a `select` event
|
|
240
|
+
*
|
|
98
241
|
*/
|
|
99
242
|
select() {
|
|
100
243
|
this.control.select();
|
|
101
|
-
/**
|
|
102
|
-
* The select event does not permeate the shadow DOM boundary.
|
|
103
|
-
* This fn effectively proxies the select event,
|
|
104
|
-
* emitting a `select` event whenever the internal
|
|
105
|
-
* control emits a `select` event
|
|
106
|
-
*/
|
|
107
244
|
this.$emit('select');
|
|
108
245
|
}
|
|
109
246
|
/**
|
|
110
|
-
*
|
|
247
|
+
* Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/setFormValue | `ElementInternals.setFormValue()`} method.
|
|
248
|
+
*
|
|
111
249
|
* @internal
|
|
112
250
|
*/
|
|
113
|
-
|
|
114
|
-
this.value
|
|
251
|
+
setFormValue(value, state) {
|
|
252
|
+
this.elementInternals.setFormValue(value, value !== null && value !== void 0 ? value : state);
|
|
115
253
|
}
|
|
116
254
|
/**
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
255
|
+
* Sets the validity of the control.
|
|
256
|
+
*
|
|
257
|
+
* @param flags - Validity flags. If not provided, the control's `validity` will be used.
|
|
258
|
+
* @param message - Optional message to supply. If not provided, the control's `validationMessage` will be used. If the control does not have a `validationMessage`, the message will be empty.
|
|
259
|
+
* @param anchor - Optional anchor to use for the validation message. If not provided, the control will be used.
|
|
260
|
+
*
|
|
123
261
|
* @internal
|
|
124
262
|
*/
|
|
125
|
-
|
|
126
|
-
this
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
263
|
+
setValidity(flags = this.control.validity, message = this.control.validationMessage, anchor = this.control) {
|
|
264
|
+
if (this.disabled) {
|
|
265
|
+
this.elementInternals.setValidity({});
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
this.elementInternals.setValidity(flags, message !== null && message !== void 0 ? message : '', anchor);
|
|
131
269
|
}
|
|
132
270
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
271
|
+
/**
|
|
272
|
+
* The form-associated flag.
|
|
273
|
+
* @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-face-example | Form-associated custom elements}
|
|
274
|
+
*
|
|
275
|
+
* @public
|
|
276
|
+
*/
|
|
277
|
+
TextInput.formAssociated = true;
|
|
136
278
|
__decorate([
|
|
137
279
|
attr
|
|
138
280
|
], TextInput.prototype, "appearance", void 0);
|
|
139
281
|
__decorate([
|
|
140
|
-
attr
|
|
141
|
-
], TextInput.prototype, "
|
|
282
|
+
attr
|
|
283
|
+
], TextInput.prototype, "autocomplete", void 0);
|
|
142
284
|
__decorate([
|
|
143
285
|
attr({ mode: 'boolean' })
|
|
144
286
|
], TextInput.prototype, "autofocus", void 0);
|
|
145
287
|
__decorate([
|
|
146
|
-
attr
|
|
147
|
-
], TextInput.prototype, "
|
|
288
|
+
attr({ attribute: 'control-size' })
|
|
289
|
+
], TextInput.prototype, "controlSize", void 0);
|
|
290
|
+
__decorate([
|
|
291
|
+
observable
|
|
292
|
+
], TextInput.prototype, "defaultSlottedNodes", void 0);
|
|
148
293
|
__decorate([
|
|
149
294
|
attr
|
|
150
|
-
], TextInput.prototype, "
|
|
295
|
+
], TextInput.prototype, "dirname", void 0);
|
|
296
|
+
__decorate([
|
|
297
|
+
attr({ mode: 'boolean' })
|
|
298
|
+
], TextInput.prototype, "disabled", void 0);
|
|
299
|
+
__decorate([
|
|
300
|
+
attr({ attribute: 'form' })
|
|
301
|
+
], TextInput.prototype, "formAttribute", void 0);
|
|
302
|
+
__decorate([
|
|
303
|
+
attr({ attribute: 'value', mode: 'fromView' })
|
|
304
|
+
], TextInput.prototype, "initialValue", void 0);
|
|
151
305
|
__decorate([
|
|
152
306
|
attr
|
|
153
307
|
], TextInput.prototype, "list", void 0);
|
|
@@ -157,25 +311,40 @@ __decorate([
|
|
|
157
311
|
__decorate([
|
|
158
312
|
attr({ converter: nullableNumberConverter })
|
|
159
313
|
], TextInput.prototype, "minlength", void 0);
|
|
314
|
+
__decorate([
|
|
315
|
+
attr({ mode: 'boolean' })
|
|
316
|
+
], TextInput.prototype, "multiple", void 0);
|
|
317
|
+
__decorate([
|
|
318
|
+
attr
|
|
319
|
+
], TextInput.prototype, "name", void 0);
|
|
160
320
|
__decorate([
|
|
161
321
|
attr
|
|
162
322
|
], TextInput.prototype, "pattern", void 0);
|
|
323
|
+
__decorate([
|
|
324
|
+
attr
|
|
325
|
+
], TextInput.prototype, "placeholder", void 0);
|
|
326
|
+
__decorate([
|
|
327
|
+
attr({ attribute: 'readonly', mode: 'boolean' })
|
|
328
|
+
], TextInput.prototype, "readonly", void 0);
|
|
329
|
+
__decorate([
|
|
330
|
+
attr({ mode: 'boolean' })
|
|
331
|
+
], TextInput.prototype, "required", void 0);
|
|
163
332
|
__decorate([
|
|
164
333
|
attr({ converter: nullableNumberConverter })
|
|
165
334
|
], TextInput.prototype, "size", void 0);
|
|
166
335
|
__decorate([
|
|
167
|
-
attr({
|
|
336
|
+
attr({
|
|
337
|
+
converter: {
|
|
338
|
+
fromView: value => (typeof value === 'string' ? ['true', ''].includes(value.trim().toLowerCase()) : null),
|
|
339
|
+
toView: value => value.toString(),
|
|
340
|
+
},
|
|
341
|
+
})
|
|
168
342
|
], TextInput.prototype, "spellcheck", void 0);
|
|
343
|
+
__decorate([
|
|
344
|
+
attr
|
|
345
|
+
], TextInput.prototype, "type", void 0);
|
|
169
346
|
__decorate([
|
|
170
347
|
observable
|
|
171
|
-
], TextInput.prototype, "
|
|
172
|
-
|
|
173
|
-
* Includes ARIA states and properties relating to the ARIA textbox role
|
|
174
|
-
*
|
|
175
|
-
* @public
|
|
176
|
-
*/
|
|
177
|
-
export class DelegatesARIATextbox {
|
|
178
|
-
}
|
|
179
|
-
applyMixins(DelegatesARIATextbox, ARIAGlobalStatesAndProperties);
|
|
180
|
-
applyMixins(TextInput, StartEnd, DelegatesARIATextbox);
|
|
348
|
+
], TextInput.prototype, "controlLabel", void 0);
|
|
349
|
+
applyMixins(TextInput, StartEnd);
|
|
181
350
|
//# sourceMappingURL=text-input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-input.js","sourceRoot":"","sources":["../../../src/text-input/text-input.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"text-input.js","sourceRoot":"","sources":["../../../src/text-input/text-input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,uBAAuB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC7G,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,+BAA+B,EAAuB,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE9G;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,SAAU,SAAQ,WAAW;IAA1C;;QAuQE;;;;;;WAMG;QAEI,SAAI,GAAkB,aAAa,CAAC,IAAI,CAAC;QAEhD;;;;WAIG;QACK,WAAM,GAAW,IAAI,CAAC,YAAY,CAAC;QAiB3C;;;;WAIG;QACK,eAAU,GAAY,KAAK,CAAC;QAEpC;;;;WAIG;QACO,qBAAgB,GAAqB,IAAI,CAAC,eAAe,EAAE,CAAC;IA8NxE,CAAC;IA9dC;;;;OAIG;IACI,0BAA0B,CAAC,IAAwB,EAAE,IAAwB;QAClF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E,SAAS,EAAE,uBAAuB,EAAE,CAAC;4CACnB;AAW1B;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;4CACnB;AAW1B;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;2CACA;AAU1B;IADC,IAAI;uCACgB;AAUrB;IADC,IAAI;0CACmB;AAYxB;IADC,IAAI;8CACuB;AAW5B;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;2CACvB;AAqB1B;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;2CACA;AAwB1B;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;uCACxB;AAgBrB;IANC,IAAI,CAAC;QACJ,SAAS,EAAE;YACT,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YACzG,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE;SAClC;KACF,CAAC;6CAC0B;AAU5B;IADC,IAAI;uCAC2C;AAsBhD;IADC,UAAU;+CAC4B;AAuPzC,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Values for the `control-size` attribute on TextInput elements.
|
|
3
|
+
*
|
|
3
4
|
* @public
|
|
4
5
|
*/
|
|
5
6
|
export const TextInputControlSize = {
|
|
@@ -8,7 +9,8 @@ export const TextInputControlSize = {
|
|
|
8
9
|
large: 'large',
|
|
9
10
|
};
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
+
* Values for the `appearance` attribute on TextInput elements.
|
|
13
|
+
*
|
|
12
14
|
* @public
|
|
13
15
|
*/
|
|
14
16
|
export const TextInputAppearance = {
|
|
@@ -18,29 +20,34 @@ export const TextInputAppearance = {
|
|
|
18
20
|
filledDarker: 'filled-darker',
|
|
19
21
|
};
|
|
20
22
|
/**
|
|
21
|
-
*
|
|
23
|
+
* Values for the `type` attribute on TextInput elements.
|
|
24
|
+
*
|
|
22
25
|
* @public
|
|
23
26
|
*/
|
|
24
27
|
export const TextInputType = {
|
|
25
|
-
/**
|
|
26
|
-
* An email TextInput
|
|
27
|
-
*/
|
|
28
28
|
email: 'email',
|
|
29
|
-
/**
|
|
30
|
-
* A password TextInput
|
|
31
|
-
*/
|
|
32
29
|
password: 'password',
|
|
33
|
-
/**
|
|
34
|
-
* A telephone TextInput
|
|
35
|
-
*/
|
|
36
30
|
tel: 'tel',
|
|
37
|
-
/**
|
|
38
|
-
* A text TextInput
|
|
39
|
-
*/
|
|
40
31
|
text: 'text',
|
|
41
|
-
/**
|
|
42
|
-
* A URL TextInput
|
|
43
|
-
*/
|
|
44
32
|
url: 'url',
|
|
45
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* Input types that block implicit form submission.
|
|
36
|
+
*
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
39
|
+
export const ImplicitSubmissionBlockingTypes = [
|
|
40
|
+
'date',
|
|
41
|
+
'datetime-local',
|
|
42
|
+
'email',
|
|
43
|
+
'month',
|
|
44
|
+
'number',
|
|
45
|
+
'password',
|
|
46
|
+
'search',
|
|
47
|
+
'tel',
|
|
48
|
+
'text',
|
|
49
|
+
'time',
|
|
50
|
+
'url',
|
|
51
|
+
'week',
|
|
52
|
+
];
|
|
46
53
|
//# sourceMappingURL=text-input.options.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-input.options.js","sourceRoot":"","sources":["../../../src/text-input/text-input.options.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"text-input.options.js","sourceRoot":"","sources":["../../../src/text-input/text-input.options.ts"],"names":[],"mappings":"AAWA;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;CACN,CAAC;AAIX;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,aAAa,EAAE,gBAAgB;IAC/B,YAAY,EAAE,eAAe;CACrB,CAAC;AAIX;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;CACF,CAAC;AAIX;;;;GAIG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,MAAM;IACN,gBAAgB;IAChB,OAAO;IACP,OAAO;IACP,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,KAAK;IACL,MAAM;IACN,MAAM;IACN,KAAK;IACL,MAAM;CACP,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { css } from '@microsoft/fast-element';
|
|
2
|
-
import { display } from '../utils/index.js';
|
|
3
2
|
import { borderRadiusMedium, colorCompoundBrandStroke, colorCompoundBrandStrokePressed, colorNeutralBackground1, colorNeutralBackground3, colorNeutralBackgroundInverted, colorNeutralForeground1, colorNeutralForeground3, colorNeutralForeground4, colorNeutralForegroundDisabled, colorNeutralForegroundInverted, colorNeutralStroke1, colorNeutralStroke1Hover, colorNeutralStroke1Pressed, colorNeutralStrokeAccessible, colorNeutralStrokeAccessibleHover, colorNeutralStrokeAccessiblePressed, colorNeutralStrokeDisabled, colorTransparentBackground, colorTransparentStroke, colorTransparentStrokeInteractive, curveAccelerateMid, curveDecelerateMid, durationNormal, durationUltraFast, fontFamilyBase, fontSizeBase200, fontSizeBase300, fontSizeBase400, fontSizeBase500, fontSizeBase600, fontWeightRegular, lineHeightBase200, lineHeightBase300, lineHeightBase400, shadow2, spacingHorizontalM, spacingHorizontalMNudge, spacingHorizontalS, spacingHorizontalSNudge, spacingHorizontalXS, spacingHorizontalXXS, spacingVerticalXS, strokeWidthThin, } from '../theme/design-tokens.js';
|
|
4
|
-
|
|
3
|
+
import { display } from '../utils/display.js';
|
|
4
|
+
/**
|
|
5
|
+
* Styles for the TextInput component.
|
|
6
|
+
*
|
|
5
7
|
* @public
|
|
6
8
|
*/
|
|
7
9
|
export const styles = css `
|
|
@@ -21,9 +23,12 @@ export const styles = css `
|
|
|
21
23
|
flex-shrink: 0;
|
|
22
24
|
padding-inline-end: ${spacingHorizontalXS};
|
|
23
25
|
}
|
|
24
|
-
|
|
26
|
+
|
|
27
|
+
.label[hidden],
|
|
28
|
+
:host(:empty) .label {
|
|
25
29
|
display: none;
|
|
26
30
|
}
|
|
31
|
+
|
|
27
32
|
.root {
|
|
28
33
|
position: relative;
|
|
29
34
|
box-sizing: border-box;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-input.styles.js","sourceRoot":"","sources":["../../../src/text-input/text-input.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"text-input.styles.js","sourceRoot":"","sources":["../../../src/text-input/text-input.styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,+BAA+B,EAC/B,uBAAuB,EACvB,uBAAuB,EACvB,8BAA8B,EAC9B,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,8BAA8B,EAC9B,8BAA8B,EAC9B,mBAAmB,EACnB,wBAAwB,EACxB,0BAA0B,EAC1B,4BAA4B,EAC5B,iCAAiC,EACjC,mCAAmC,EACnC,0BAA0B,EAC1B,0BAA0B,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