@fluentui/web-components 3.0.0-beta.20 → 3.0.0-beta.21

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.
Files changed (82) hide show
  1. package/CHANGELOG.md +11 -2
  2. package/dist/dts/text-input/index.d.ts +5 -4
  3. package/dist/dts/text-input/text-input.d.ts +284 -67
  4. package/dist/dts/text-input/text-input.definition.d.ts +2 -3
  5. package/dist/dts/text-input/text-input.options.d.ts +19 -29
  6. package/dist/dts/text-input/text-input.styles.d.ts +5 -2
  7. package/dist/dts/text-input/text-input.template.d.ts +9 -3
  8. package/dist/esm/accordion/accordion.js +1 -6
  9. package/dist/esm/accordion/accordion.js.map +1 -1
  10. package/dist/esm/accordion-item/accordion-item.js +1 -6
  11. package/dist/esm/accordion-item/accordion-item.js.map +1 -1
  12. package/dist/esm/anchor-button/anchor-button.js +1 -6
  13. package/dist/esm/anchor-button/anchor-button.js.map +1 -1
  14. package/dist/esm/avatar/avatar.js +1 -6
  15. package/dist/esm/avatar/avatar.js.map +1 -1
  16. package/dist/esm/badge/badge.js +1 -6
  17. package/dist/esm/badge/badge.js.map +1 -1
  18. package/dist/esm/button/button.js +1 -6
  19. package/dist/esm/button/button.js.map +1 -1
  20. package/dist/esm/checkbox/checkbox.js +1 -6
  21. package/dist/esm/checkbox/checkbox.js.map +1 -1
  22. package/dist/esm/counter-badge/counter-badge.js +1 -6
  23. package/dist/esm/counter-badge/counter-badge.js.map +1 -1
  24. package/dist/esm/dialog/dialog.js +1 -6
  25. package/dist/esm/dialog/dialog.js.map +1 -1
  26. package/dist/esm/divider/divider.js +1 -6
  27. package/dist/esm/divider/divider.js.map +1 -1
  28. package/dist/esm/image/image.js +1 -6
  29. package/dist/esm/image/image.js.map +1 -1
  30. package/dist/esm/label/label.js +1 -6
  31. package/dist/esm/label/label.js.map +1 -1
  32. package/dist/esm/menu/menu.js +1 -6
  33. package/dist/esm/menu/menu.js.map +1 -1
  34. package/dist/esm/menu-item/menu-item.js +1 -6
  35. package/dist/esm/menu-item/menu-item.js.map +1 -1
  36. package/dist/esm/menu-list/menu-list.js +1 -6
  37. package/dist/esm/menu-list/menu-list.js.map +1 -1
  38. package/dist/esm/patterns/aria-globals.js +1 -6
  39. package/dist/esm/patterns/aria-globals.js.map +1 -1
  40. package/dist/esm/progress-bar/base-progress.js +1 -6
  41. package/dist/esm/progress-bar/base-progress.js.map +1 -1
  42. package/dist/esm/progress-bar/progress-bar.js +1 -6
  43. package/dist/esm/progress-bar/progress-bar.js.map +1 -1
  44. package/dist/esm/radio/radio.js +1 -6
  45. package/dist/esm/radio/radio.js.map +1 -1
  46. package/dist/esm/radio-group/radio-group.js +1 -6
  47. package/dist/esm/radio-group/radio-group.js.map +1 -1
  48. package/dist/esm/slider/slider.js +1 -6
  49. package/dist/esm/slider/slider.js.map +1 -1
  50. package/dist/esm/spinner/spinner.js +1 -6
  51. package/dist/esm/spinner/spinner.js.map +1 -1
  52. package/dist/esm/switch/switch.js +1 -6
  53. package/dist/esm/switch/switch.js.map +1 -1
  54. package/dist/esm/tab/tab.js +1 -6
  55. package/dist/esm/tab/tab.js.map +1 -1
  56. package/dist/esm/tabs/tabs.js +1 -6
  57. package/dist/esm/tabs/tabs.js.map +1 -1
  58. package/dist/esm/text/text.js +1 -6
  59. package/dist/esm/text/text.js.map +1 -1
  60. package/dist/esm/text-input/index.js +3 -3
  61. package/dist/esm/text-input/index.js.map +1 -1
  62. package/dist/esm/text-input/text-input.definition.js +2 -3
  63. package/dist/esm/text-input/text-input.definition.js.map +1 -1
  64. package/dist/esm/text-input/text-input.js +271 -102
  65. package/dist/esm/text-input/text-input.js.map +1 -1
  66. package/dist/esm/text-input/text-input.options.js +25 -18
  67. package/dist/esm/text-input/text-input.options.js.map +1 -1
  68. package/dist/esm/text-input/text-input.styles.js +8 -3
  69. package/dist/esm/text-input/text-input.styles.js.map +1 -1
  70. package/dist/esm/text-input/text-input.template.js +16 -32
  71. package/dist/esm/text-input/text-input.template.js.map +1 -1
  72. package/dist/esm/toggle-button/toggle-button.js +1 -6
  73. package/dist/esm/toggle-button/toggle-button.js.map +1 -1
  74. package/dist/fluent-web-components.api.json +346 -217
  75. package/dist/web-components.d.ts +299 -114
  76. package/dist/web-components.js +251 -110
  77. package/dist/web-components.min.js +162 -162
  78. package/docs/api-report.md +52 -37
  79. package/package.json +2 -2
  80. package/dist/dts/text-input/text-field.form-associated.d.ts +0 -14
  81. package/dist/esm/text-input/text-field.form-associated.js +0 -14
  82. package/dist/esm/text-input/text-field.form-associated.js.map +0 -1
@@ -1,153 +1,307 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
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
- import { FormAssociatedTextField } from './text-field.form-associated.js';
12
- export { TextInputType };
13
- export class TextInput extends FormAssociatedTextField {
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
- readOnlyChanged() {
25
- if (this.proxy instanceof HTMLInputElement) {
26
- this.proxy.readOnly = this.readOnly;
27
- this.validate();
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
- autofocusChanged() {
31
- if (this.proxy instanceof HTMLInputElement) {
32
- this.proxy.autofocus = this.autofocus;
33
- this.validate();
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
- placeholderChanged() {
37
- if (this.proxy instanceof HTMLInputElement) {
38
- this.proxy.placeholder = this.placeholder;
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
- typeChanged() {
42
- if (this.proxy instanceof HTMLInputElement) {
43
- this.proxy.type = this.type;
44
- this.validate();
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
- listChanged() {
48
- if (this.proxy instanceof HTMLInputElement) {
49
- this.proxy.setAttribute('list', this.list);
50
- this.validate();
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
- maxlengthChanged() {
54
- if (this.proxy instanceof HTMLInputElement) {
55
- this.proxy.maxLength = this.maxlength;
56
- this.validate();
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
- minlengthChanged() {
60
- if (this.proxy instanceof HTMLInputElement) {
61
- this.proxy.minLength = this.minlength;
62
- this.validate();
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
- patternChanged() {
66
- if (this.proxy instanceof HTMLInputElement) {
67
- this.proxy.pattern = this.pattern;
68
- this.validate();
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
- sizeChanged() {
72
- if (this.proxy instanceof HTMLInputElement) {
73
- this.proxy.size = this.size;
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
- spellcheckChanged() {
77
- if (this.proxy instanceof HTMLInputElement) {
78
- this.proxy.spellcheck = this.spellcheck;
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.proxy.setAttribute('type', this.type);
87
- this.validate();
88
- if (this.autofocus) {
89
- Updates.enqueue(() => {
90
- this.focus();
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
- * Selects all the text in the text field
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
- * Handles the internal control's `input` event
247
+ * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/setFormValue | `ElementInternals.setFormValue()`} method.
248
+ *
111
249
  * @internal
112
250
  */
113
- handleTextInput() {
114
- this.value = this.control.value;
251
+ setFormValue(value, state) {
252
+ this.elementInternals.setFormValue(value, value !== null && value !== void 0 ? value : state);
115
253
  }
116
254
  /**
117
- * Change event handler for inner control.
118
- * @remarks
119
- * "Change" events are not `composable` so they will not
120
- * permeate the shadow DOM boundary. This fn effectively proxies
121
- * the change event, emitting a `change` event whenever the internal
122
- * control emits a `change` event
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
- handleChange() {
126
- this.$emit('change');
127
- }
128
- /** {@inheritDoc (FormAssociated:interface).validate} */
129
- validate() {
130
- super.validate(this.control);
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
- __decorate([
134
- attr({ attribute: 'control-size' })
135
- ], TextInput.prototype, "controlSize", void 0);
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({ attribute: 'readonly', mode: 'boolean' })
141
- ], TextInput.prototype, "readOnly", void 0);
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, "placeholder", void 0);
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, "type", void 0);
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({ mode: 'boolean' })
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, "defaultSlottedNodes", void 0);
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":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,uBAAuB,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAC7F,OAAO,EAAE,6BAA6B,EAAE,QAAQ,EAAmB,MAAM,sBAAsB,CAAC;AAChG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAE1E,OAAO,EAAE,aAAa,EAAE,CAAC;AAIzB,MAAM,OAAO,SAAU,SAAQ,uBAAuB;IAAtD;;QAoEE;;;;;WAKG;QAEI,SAAI,GAAkB,aAAa,CAAC,IAAI,CAAC;IAsKlD,CAAC;IAlNW,eAAe;QACvB,IAAI,IAAI,CAAC,KAAK,YAAY,gBAAgB,EAAE;YAC1C,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;YACpC,IAAI,CAAC,QAAQ,EAAE,CAAC;SACjB;IACH,CAAC;IAUS,gBAAgB;QACxB,IAAI,IAAI,CAAC,KAAK,YAAY,gBAAgB,EAAE;YAC1C,IAAI,CAAC,KAAK,C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5
6
  export const TextInputControlSize = {
@@ -8,7 +9,8 @@ export const TextInputControlSize = {
8
9
  large: 'large',
9
10
  };
10
11
  /**
11
- * TextInput appearance constants
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
- * Text field sub-types
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":"AAEA;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;CACN,CAAC;AAQX;;;GAGG;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;AAQX;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B;;OAEG;IACH,KAAK,EAAE,OAAO;IAEd;;OAEG;IACH,QAAQ,EAAE,UAAU;IAEpB;;OAEG;IACH,GAAG,EAAE,KAAK;IAEV;;OAEG;IACH,IAAI,EAAE,MAAM;IAEZ;;OAEG;IACH,GAAG,EAAE,KAAK;CACF,CAAC"}
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
- /** TextInput styles
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
- .label__hidden {
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":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,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,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pD,8BAA8B;;;aAG9B,8BAA8B;wBACnB,8BAA8B;;;iBAGrC,eAAe;mBACb,iBAAiB;mBACjB,iBAAiB;;;;WAIzB,oBAAoB;iBACd,uBAAuB;;;;iBAIvB,eAAe;;;iBAGf,eAAe;mBACb,iBAAiB;mBACjB,iBAAiB;;;;WAIzB,kBAAkB;iBACZ,kBAAkB;;;;iBAIlB,eAAe;;;kBAGd,0BAA0B;;;qBAGvB,eAAe,UAAU,4BAA4B;;;2BAG/C,iCAAiC;;;2BAGjC,mCAAmC;;;;2BAInC,mCAAmC;;;2BAGnC,0BAA0B;;;;cAIvC,eAAe,UAAU,sBAAsB;kBAC3C,OAAO;;;kBAGP,uBAAuB;;;kBAGvB,uBAAuB;;;;oBAIrB,iCAAiC;;;;oBAIjC,iCAAiC;kBACnC,uBAAuB;;CAExC,CAAC"}
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,EAC1B,sBAAsB,EACtB,iCAAiC,EACjC,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,OAAO,EACP,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,EACvB,m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