@fluentui/web-components 3.0.0-beta.11 → 3.0.0-beta.12
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 +11 -2
- package/dist/dts/button/button.d.ts +173 -90
- package/dist/dts/button/button.definition.d.ts +3 -1
- package/dist/dts/button/button.options.d.ts +16 -1
- package/dist/dts/button/button.styles.d.ts +5 -0
- package/dist/dts/button/button.template.d.ts +7 -1
- package/dist/dts/form-associated/form-associated.d.ts +0 -74
- package/dist/dts/toggle-button/toggle-button.d.ts +29 -26
- package/dist/dts/toggle-button/toggle-button.styles.d.ts +7 -0
- package/dist/esm/anchor-button/anchor-button.styles.js +254 -3
- package/dist/esm/anchor-button/anchor-button.styles.js.map +1 -1
- package/dist/esm/button/button.definition.js +3 -4
- package/dist/esm/button/button.definition.js.map +1 -1
- package/dist/esm/button/button.js +233 -126
- package/dist/esm/button/button.js.map +1 -1
- package/dist/esm/button/button.options.js +10 -0
- package/dist/esm/button/button.options.js.map +1 -1
- package/dist/esm/button/button.styles.js +51 -54
- package/dist/esm/button/button.styles.js.map +1 -1
- package/dist/esm/button/button.template.js +13 -39
- package/dist/esm/button/button.template.js.map +1 -1
- package/dist/esm/compound-button/compound-button.definition.js +0 -3
- package/dist/esm/compound-button/compound-button.definition.js.map +1 -1
- package/dist/esm/compound-button/compound-button.styles.js +7 -7
- package/dist/esm/compound-button/compound-button.template.js +3 -39
- package/dist/esm/compound-button/compound-button.template.js.map +1 -1
- package/dist/esm/form-associated/form-associated.js.map +1 -1
- package/dist/esm/menu-button/menu-button.definition.js +0 -3
- package/dist/esm/menu-button/menu-button.definition.js.map +1 -1
- package/dist/esm/menu-button/menu-button.template.js +5 -1
- package/dist/esm/menu-button/menu-button.template.js.map +1 -1
- package/dist/esm/toggle-button/toggle-button.definition.js +0 -3
- package/dist/esm/toggle-button/toggle-button.definition.js.map +1 -1
- package/dist/esm/toggle-button/toggle-button.js +42 -85
- package/dist/esm/toggle-button/toggle-button.js.map +1 -1
- package/dist/esm/toggle-button/toggle-button.styles.js +31 -26
- package/dist/esm/toggle-button/toggle-button.styles.js.map +1 -1
- package/dist/fluent-web-components.api.json +342 -673
- package/dist/storybook/iframe.html +1 -1
- package/dist/storybook/main.d55b693e.iframe.bundle.js +2 -0
- package/dist/storybook/project.json +1 -1
- package/dist/web-components.d.ts +250 -223
- package/dist/web-components.js +236 -229
- package/dist/web-components.min.js +51 -50
- package/docs/api-report.md +63 -79
- package/package.json +3 -2
- package/playwright.config.ts +2 -3
- package/dist/dts/button/button.form-associated.d.ts +0 -14
- package/dist/esm/button/button.form-associated.js +0 -14
- package/dist/esm/button/button.form-associated.js.map +0 -1
- package/dist/storybook/main.81e47c59.iframe.bundle.js +0 -2
- /package/dist/storybook/{main.81e47c59.iframe.bundle.js.LICENSE.txt → main.d55b693e.iframe.bundle.js.LICENSE.txt} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
# Change Log - @fluentui/web-components
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 23 Apr 2024 04:08:58 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [3.0.0-beta.12](https://github.com/microsoft/fluentui/tree/@fluentui/web-components_v3.0.0-beta.12)
|
|
8
|
+
|
|
9
|
+
Tue, 23 Apr 2024 04:08:58 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/web-components_v3.0.0-beta.11..@fluentui/web-components_v3.0.0-beta.12)
|
|
11
|
+
|
|
12
|
+
### Changes
|
|
13
|
+
|
|
14
|
+
- Use ElementInternals for Button components ([PR #30999](https://github.com/microsoft/fluentui/pull/30999) by 863023+radium-v@users.noreply.github.com)
|
|
15
|
+
|
|
7
16
|
## [3.0.0-beta.11](https://github.com/microsoft/fluentui/tree/@fluentui/web-components_v3.0.0-beta.11)
|
|
8
17
|
|
|
9
|
-
Mon, 15 Apr 2024 04:09:
|
|
18
|
+
Mon, 15 Apr 2024 04:09:34 GMT
|
|
10
19
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/web-components_v3.0.0-beta.10..@fluentui/web-components_v3.0.0-beta.11)
|
|
11
20
|
|
|
12
21
|
### Changes
|
|
@@ -1,193 +1,276 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { ButtonAppearance, ButtonShape, ButtonSize
|
|
1
|
+
import { FASTElement } from '@microsoft/fast-element';
|
|
2
|
+
import { StartEnd } from '../patterns/index.js';
|
|
3
|
+
import type { ButtonAppearance, ButtonFormTarget, ButtonShape, ButtonSize } from './button.options.js';
|
|
4
|
+
import { ButtonType } from './button.options.js';
|
|
4
5
|
/**
|
|
5
6
|
* A Button Custom HTML Element.
|
|
6
|
-
* Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button |
|
|
7
|
+
* Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button | `<button>`} element.
|
|
7
8
|
*
|
|
8
9
|
* @slot start - Content which can be provided before the button content
|
|
9
10
|
* @slot end - Content which can be provided after the button content
|
|
10
11
|
* @slot - The default slot for button content
|
|
11
|
-
* @csspart
|
|
12
|
-
* @csspart content - The element wrapping button content
|
|
12
|
+
* @csspart content - The button content container
|
|
13
13
|
*
|
|
14
14
|
* @public
|
|
15
15
|
*/
|
|
16
|
-
export declare class Button extends
|
|
16
|
+
export declare class Button extends FASTElement {
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Indicates the styled appearance of the button.
|
|
19
19
|
*
|
|
20
20
|
* @public
|
|
21
21
|
* @remarks
|
|
22
|
-
* HTML Attribute:
|
|
22
|
+
* HTML Attribute: `appearance`
|
|
23
|
+
*/
|
|
24
|
+
appearance?: ButtonAppearance;
|
|
25
|
+
/**
|
|
26
|
+
* Indicates the button should be focused when the page is loaded.
|
|
27
|
+
* @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#autofocus | `autofocus`} attribute
|
|
28
|
+
*
|
|
29
|
+
* @public
|
|
30
|
+
* @remarks
|
|
31
|
+
* HTML Attribute: `autofocus`
|
|
23
32
|
*/
|
|
24
33
|
autofocus: boolean;
|
|
25
34
|
/**
|
|
26
|
-
*
|
|
35
|
+
* Default slotted content.
|
|
36
|
+
*
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
39
|
+
defaultSlottedContent: HTMLElement[];
|
|
40
|
+
/**
|
|
41
|
+
* Sets the element's disabled state.
|
|
42
|
+
* @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#disabled | `disabled`} attribute
|
|
27
43
|
*
|
|
28
44
|
* @public
|
|
29
45
|
* @remarks
|
|
30
|
-
* HTML Attribute:
|
|
46
|
+
* HTML Attribute: `disabled`
|
|
31
47
|
*/
|
|
32
|
-
|
|
48
|
+
disabled?: boolean;
|
|
33
49
|
/**
|
|
34
|
-
*
|
|
50
|
+
* Indicates that the button is focusable while disabled.
|
|
35
51
|
*
|
|
36
52
|
* @public
|
|
37
53
|
* @remarks
|
|
38
|
-
* HTML Attribute:
|
|
54
|
+
* HTML Attribute: `disabled-focusable`
|
|
55
|
+
*/
|
|
56
|
+
disabledFocusable: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Sets the element's internal disabled state when the element is focusable while disabled.
|
|
59
|
+
*
|
|
60
|
+
* @param previous - the previous disabledFocusable value
|
|
61
|
+
* @param next - the current disabledFocusable value
|
|
62
|
+
* @internal
|
|
63
|
+
*/
|
|
64
|
+
disabledFocusableChanged(previous: boolean, next: boolean): void;
|
|
65
|
+
/**
|
|
66
|
+
* The internal {@link https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
|
|
67
|
+
*
|
|
68
|
+
* @internal
|
|
69
|
+
*/
|
|
70
|
+
protected elementInternals: ElementInternals;
|
|
71
|
+
/**
|
|
72
|
+
* The associated form element.
|
|
73
|
+
*
|
|
74
|
+
* @public
|
|
39
75
|
*/
|
|
40
|
-
|
|
41
|
-
protected formactionChanged(): void;
|
|
76
|
+
get form(): HTMLFormElement | null;
|
|
42
77
|
/**
|
|
43
|
-
*
|
|
78
|
+
* The URL that processes the form submission.
|
|
79
|
+
* @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#formaction | `formaction`} attribute
|
|
44
80
|
*
|
|
45
81
|
* @public
|
|
46
82
|
* @remarks
|
|
47
|
-
* HTML Attribute:
|
|
83
|
+
* HTML Attribute: `formaction`
|
|
48
84
|
*/
|
|
49
|
-
|
|
50
|
-
protected formenctypeChanged(): void;
|
|
85
|
+
formAction?: string;
|
|
51
86
|
/**
|
|
52
|
-
*
|
|
87
|
+
* The form-associated flag.
|
|
88
|
+
* @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-face-example | Form-associated custom elements}
|
|
89
|
+
*
|
|
90
|
+
* @public
|
|
91
|
+
*/
|
|
92
|
+
static readonly formAssociated = true;
|
|
93
|
+
/**
|
|
94
|
+
* The id of a form to associate the element to.
|
|
95
|
+
* @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#form | `form`} attribute
|
|
53
96
|
*
|
|
54
97
|
* @public
|
|
55
98
|
* @remarks
|
|
56
|
-
* HTML Attribute:
|
|
99
|
+
* HTML Attribute: `form`
|
|
57
100
|
*/
|
|
58
|
-
|
|
59
|
-
protected formmethodChanged(): void;
|
|
101
|
+
formAttribute?: string;
|
|
60
102
|
/**
|
|
61
|
-
*
|
|
103
|
+
* The encoding type for the form submission.
|
|
104
|
+
* @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#formenctype | `formenctype`} attribute
|
|
62
105
|
*
|
|
63
106
|
* @public
|
|
64
107
|
* @remarks
|
|
65
|
-
* HTML Attribute:
|
|
108
|
+
* HTML Attribute: `formenctype`
|
|
66
109
|
*/
|
|
67
|
-
|
|
68
|
-
protected formnovalidateChanged(): void;
|
|
110
|
+
formEnctype?: string;
|
|
69
111
|
/**
|
|
70
|
-
*
|
|
112
|
+
* The HTTP method that the browser uses to submit the form.
|
|
113
|
+
* @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#formmethod | `formmethod`} attribute
|
|
71
114
|
*
|
|
72
115
|
* @public
|
|
73
116
|
* @remarks
|
|
74
|
-
* HTML Attribute:
|
|
117
|
+
* HTML Attribute: `formmethod`
|
|
75
118
|
*/
|
|
76
|
-
|
|
77
|
-
protected formtargetChanged(): void;
|
|
119
|
+
formMethod?: string;
|
|
78
120
|
/**
|
|
79
|
-
*
|
|
121
|
+
* Indicates that the form will not be validated when submitted.
|
|
122
|
+
* @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#formnovalidate | `formnovalidate`} attribute
|
|
80
123
|
*
|
|
81
124
|
* @public
|
|
82
125
|
* @remarks
|
|
83
|
-
* HTML Attribute:
|
|
126
|
+
* HTML Attribute: `formnovalidate`
|
|
84
127
|
*/
|
|
85
|
-
|
|
86
|
-
|
|
128
|
+
formNoValidate?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* The internal form submission fallback control.
|
|
131
|
+
*
|
|
132
|
+
* @internal
|
|
133
|
+
*/
|
|
134
|
+
private formSubmissionFallbackControl?;
|
|
135
|
+
/**
|
|
136
|
+
* The internal slot for the form submission fallback control.
|
|
137
|
+
*
|
|
138
|
+
* @internal
|
|
139
|
+
*/
|
|
140
|
+
private formSubmissionFallbackControlSlot?;
|
|
141
|
+
/**
|
|
142
|
+
* The target frame or window to open the form submission in.
|
|
143
|
+
* @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#formtarget | `formtarget`} attribute
|
|
144
|
+
*
|
|
145
|
+
* @public
|
|
146
|
+
* @remarks
|
|
147
|
+
* HTML Attribute: `formtarget`
|
|
148
|
+
*/
|
|
149
|
+
formTarget?: ButtonFormTarget;
|
|
87
150
|
/**
|
|
88
|
-
*
|
|
151
|
+
* Indicates that the button should only display as an icon with no text content.
|
|
89
152
|
*
|
|
90
153
|
* @public
|
|
91
154
|
* @remarks
|
|
92
|
-
* HTML Attribute:
|
|
155
|
+
* HTML Attribute: `icon-only`
|
|
156
|
+
*/
|
|
157
|
+
iconOnly: boolean;
|
|
158
|
+
/**
|
|
159
|
+
* A reference to all associated label elements.
|
|
160
|
+
*
|
|
161
|
+
* @public
|
|
93
162
|
*/
|
|
94
|
-
|
|
163
|
+
get labels(): ReadonlyArray<Node>;
|
|
95
164
|
/**
|
|
96
|
-
* The
|
|
165
|
+
* The name of the element. This element's value will be surfaced during form submission under the provided name.
|
|
166
|
+
* @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#name | `name`} attribute
|
|
97
167
|
*
|
|
98
168
|
* @public
|
|
99
169
|
* @remarks
|
|
100
|
-
* HTML Attribute:
|
|
170
|
+
* HTML Attribute: `name`
|
|
101
171
|
*/
|
|
102
|
-
|
|
172
|
+
name?: string;
|
|
103
173
|
/**
|
|
104
|
-
* The
|
|
174
|
+
* The shape of the button.
|
|
105
175
|
*
|
|
106
176
|
* @public
|
|
107
177
|
* @remarks
|
|
108
|
-
* HTML Attribute:
|
|
178
|
+
* HTML Attribute: `shape`
|
|
109
179
|
*/
|
|
110
|
-
|
|
180
|
+
shape?: ButtonShape;
|
|
111
181
|
/**
|
|
112
|
-
* The
|
|
182
|
+
* The size of the button.
|
|
113
183
|
*
|
|
114
184
|
* @public
|
|
115
185
|
* @remarks
|
|
116
|
-
* HTML Attribute:
|
|
186
|
+
* HTML Attribute: `size`
|
|
117
187
|
*/
|
|
118
|
-
|
|
188
|
+
size?: ButtonSize;
|
|
119
189
|
/**
|
|
120
|
-
* The button
|
|
190
|
+
* The button type.
|
|
191
|
+
* @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#type | `type`} attribute
|
|
121
192
|
*
|
|
122
193
|
* @public
|
|
123
194
|
* @remarks
|
|
124
|
-
* HTML Attribute:
|
|
195
|
+
* HTML Attribute: `type`
|
|
125
196
|
*/
|
|
126
|
-
|
|
127
|
-
protected disabledFocusableChanged(prev: boolean, next: boolean): void;
|
|
197
|
+
type: ButtonType;
|
|
128
198
|
/**
|
|
129
|
-
*
|
|
199
|
+
* Removes the form submission fallback control when the type changes.
|
|
200
|
+
*
|
|
201
|
+
* @param previous - the previous type value
|
|
202
|
+
* @param next - the new type value
|
|
203
|
+
* @internal
|
|
130
204
|
*/
|
|
131
|
-
|
|
205
|
+
typeChanged(previous: ButtonType, next: ButtonType): void;
|
|
132
206
|
/**
|
|
207
|
+
* The value attribute.
|
|
133
208
|
*
|
|
134
|
-
*
|
|
209
|
+
* @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#value | `value`} attribute
|
|
135
210
|
*
|
|
136
211
|
* @public
|
|
137
212
|
* @remarks
|
|
213
|
+
* HTML Attribute: `value`
|
|
138
214
|
*/
|
|
139
|
-
|
|
140
|
-
/** {@inheritDoc (FormAssociated:interface).validate} */
|
|
141
|
-
validate(): void;
|
|
215
|
+
value?: string;
|
|
142
216
|
/**
|
|
217
|
+
* Handles the button click event.
|
|
218
|
+
*
|
|
219
|
+
* @param e - The event object
|
|
143
220
|
* @internal
|
|
144
221
|
*/
|
|
222
|
+
clickHandler(e: Event): boolean | void;
|
|
145
223
|
connectedCallback(): void;
|
|
146
|
-
|
|
224
|
+
constructor();
|
|
147
225
|
/**
|
|
148
|
-
*
|
|
226
|
+
* This fallback creates a new slot, then creates a submit button to mirror the custom element's
|
|
227
|
+
* properties. The submit button is then appended to the slot and the form is submitted.
|
|
228
|
+
*
|
|
229
|
+
* @internal
|
|
230
|
+
* @privateRemarks
|
|
231
|
+
* This is a workaround until {@link https://github.com/WICG/webcomponents/issues/814 | WICG/webcomponents/issues/814} is resolved.
|
|
149
232
|
*/
|
|
150
|
-
private
|
|
233
|
+
private createAndInsertFormSubmissionFallbackControl;
|
|
151
234
|
/**
|
|
152
|
-
*
|
|
235
|
+
* Invoked when a connected component's form or fieldset has its disabled state changed.
|
|
236
|
+
*
|
|
237
|
+
* @param disabled - the disabled value of the form / fieldset
|
|
238
|
+
*
|
|
239
|
+
* @internal
|
|
153
240
|
*/
|
|
154
|
-
|
|
155
|
-
control: HTMLButtonElement;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Includes ARIA states and properties relating to the ARIA button role
|
|
159
|
-
*
|
|
160
|
-
* @public
|
|
161
|
-
*/
|
|
162
|
-
export declare class DelegatesARIAButton {
|
|
241
|
+
formDisabledCallback(disabled: boolean): void;
|
|
163
242
|
/**
|
|
164
|
-
*
|
|
243
|
+
* Handles keypress events for the button.
|
|
244
|
+
*
|
|
245
|
+
* @param e - the keyboard event
|
|
246
|
+
* @returns - the return value of the click handler
|
|
165
247
|
* @public
|
|
166
|
-
* @remarks
|
|
167
|
-
* HTML Attribute: aria-expanded
|
|
168
248
|
*/
|
|
169
|
-
|
|
249
|
+
keypressHandler(e: KeyboardEvent): boolean | void;
|
|
170
250
|
/**
|
|
171
|
-
*
|
|
251
|
+
* Presses the button.
|
|
252
|
+
*
|
|
172
253
|
* @public
|
|
173
|
-
* @remarks
|
|
174
|
-
* HTML Attribute: aria-pressed
|
|
175
254
|
*/
|
|
176
|
-
|
|
255
|
+
protected press(): void;
|
|
256
|
+
/**
|
|
257
|
+
* Resets the associated form.
|
|
258
|
+
*
|
|
259
|
+
* @public
|
|
260
|
+
*/
|
|
261
|
+
resetForm(): void;
|
|
262
|
+
/**
|
|
263
|
+
* Submits the associated form.
|
|
264
|
+
*
|
|
265
|
+
* @internal
|
|
266
|
+
*/
|
|
267
|
+
private submitForm;
|
|
177
268
|
}
|
|
178
269
|
/**
|
|
179
|
-
* Mark internal because exporting class and interface of the same name
|
|
180
|
-
* confuses API documenter.
|
|
181
|
-
* TODO: https://github.com/microsoft/fast/issues/3317
|
|
182
270
|
* @internal
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Mark internal because exporting class and interface of the same name
|
|
188
|
-
* confuses API documenter.
|
|
271
|
+
* @privateRemarks
|
|
272
|
+
* Mark internal because exporting class and interface of the same name confuses API documenter.
|
|
189
273
|
* TODO: https://github.com/microsoft/fast/issues/3317
|
|
190
|
-
* @internal
|
|
191
274
|
*/
|
|
192
|
-
export interface Button extends StartEnd
|
|
275
|
+
export interface Button extends StartEnd {
|
|
193
276
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Button } from './button.js';
|
|
2
2
|
/**
|
|
3
|
+
* The definition for the Fluent Button component.
|
|
4
|
+
*
|
|
3
5
|
* @public
|
|
4
6
|
* @remarks
|
|
5
|
-
* HTML Element:
|
|
7
|
+
* HTML Element: `<fluent-button>`
|
|
6
8
|
*/
|
|
7
9
|
export declare const definition: import("@microsoft/fast-element").FASTElementDefinition<typeof Button>;
|
|
@@ -62,7 +62,22 @@ export declare const ButtonType: {
|
|
|
62
62
|
*/
|
|
63
63
|
export declare type ButtonType = ValuesOf<typeof ButtonType>;
|
|
64
64
|
/**
|
|
65
|
-
* Button configuration options
|
|
65
|
+
* Button configuration options.
|
|
66
66
|
* @public
|
|
67
67
|
*/
|
|
68
68
|
export declare type ButtonOptions = StartEndOptions<Button>;
|
|
69
|
+
/**
|
|
70
|
+
* Button `formtarget` attribute values.
|
|
71
|
+
* @public
|
|
72
|
+
*/
|
|
73
|
+
export declare const ButtonFormTarget: {
|
|
74
|
+
readonly blank: "_blank";
|
|
75
|
+
readonly self: "_self";
|
|
76
|
+
readonly parent: "_parent";
|
|
77
|
+
readonly top: "_top";
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Types for the `formtarget` attribute values.
|
|
81
|
+
* @public
|
|
82
|
+
*/
|
|
83
|
+
export declare type ButtonFormTarget = ValuesOf<typeof ButtonFormTarget>;
|
|
@@ -2,8 +2,14 @@ import { ElementViewTemplate } from '@microsoft/fast-element';
|
|
|
2
2
|
import type { Button } from './button.js';
|
|
3
3
|
import { ButtonOptions } from './button.options.js';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Generates a template for the Button component.
|
|
6
|
+
*
|
|
6
7
|
* @public
|
|
7
8
|
*/
|
|
8
9
|
export declare function buttonTemplate<T extends Button>(options?: ButtonOptions): ElementViewTemplate<T>;
|
|
10
|
+
/**
|
|
11
|
+
* The template for the Button component.
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
9
15
|
export declare const template: ElementViewTemplate<Button>;
|
|
@@ -1,77 +1,4 @@
|
|
|
1
1
|
import type { Constructable, FASTElement } from '@microsoft/fast-element';
|
|
2
|
-
/**
|
|
3
|
-
* This file enables typing support for ElementInternals APIs.
|
|
4
|
-
* It is largely taken from https://github.com/microsoft/TSJS-lib-generator/pull/818/files.
|
|
5
|
-
*
|
|
6
|
-
* When TypeScript adds support for these APIs we can delete this file.
|
|
7
|
-
*/
|
|
8
|
-
interface ValidityStateFlags {
|
|
9
|
-
badInput?: boolean;
|
|
10
|
-
customError?: boolean;
|
|
11
|
-
patternMismatch?: boolean;
|
|
12
|
-
rangeOverflow?: boolean;
|
|
13
|
-
rangeUnderflow?: boolean;
|
|
14
|
-
stepMismatch?: boolean;
|
|
15
|
-
tooLong?: boolean;
|
|
16
|
-
tooShort?: boolean;
|
|
17
|
-
typeMismatch?: boolean;
|
|
18
|
-
valueMissing?: boolean;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Source:
|
|
22
|
-
* https://html.spec.whatwg.org/multipage/custom-elements.html#elementinternals
|
|
23
|
-
*/
|
|
24
|
-
interface ElementInternals {
|
|
25
|
-
/**
|
|
26
|
-
* Returns the form owner of internals target element.
|
|
27
|
-
*/
|
|
28
|
-
readonly form: HTMLFormElement | null;
|
|
29
|
-
/**
|
|
30
|
-
* Returns a NodeList of all the label elements that internals target element is associated with.
|
|
31
|
-
*/
|
|
32
|
-
readonly labels: NodeList;
|
|
33
|
-
/**
|
|
34
|
-
* Returns the error message that would be shown to the user if internals target element was to be checked for validity.
|
|
35
|
-
*/
|
|
36
|
-
readonly validationMessage: string;
|
|
37
|
-
/**
|
|
38
|
-
* Returns the ValidityState object for internals target element.
|
|
39
|
-
*/
|
|
40
|
-
readonly validity: ValidityState;
|
|
41
|
-
/**
|
|
42
|
-
* Returns true if internals target element will be validated when the form is submitted; false otherwise.
|
|
43
|
-
*/
|
|
44
|
-
readonly willValidate: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Returns true if internals target element has no validity problems; false otherwise. Fires an invalid event at the element in the latter case.
|
|
47
|
-
*/
|
|
48
|
-
checkValidity(): boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Returns true if internals target element has no validity problems; otherwise,
|
|
51
|
-
* returns false, fires an invalid event at the element, and (if the event isn't canceled) reports the problem to the user.
|
|
52
|
-
*/
|
|
53
|
-
reportValidity(): boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Sets both the state and submission value of internals target element to value.
|
|
56
|
-
*
|
|
57
|
-
* While "null" isn't enumerated as a argument type (here)[https://html.spec.whatwg.org/multipage/custom-elements.html#the-elementinternals-interface],
|
|
58
|
-
* In practice it appears to remove the value from the form data on submission. Adding it as a valid type here
|
|
59
|
-
* becuase that capability is required for checkbox and radio types
|
|
60
|
-
*/
|
|
61
|
-
setFormValue(value: File | string | FormData | null, state?: File | string | FormData | null): void;
|
|
62
|
-
/**
|
|
63
|
-
* Marks internals target element as suffering from the constraints indicated by the flags argument,
|
|
64
|
-
* and sets the element's validation message to message.
|
|
65
|
-
* If anchor is specified, the user agent might use
|
|
66
|
-
* it to indicate problems with the constraints of internals target
|
|
67
|
-
* element when the form owner is validated interactively or reportValidity() is called.
|
|
68
|
-
*/
|
|
69
|
-
setValidity(flags: ValidityStateFlags, message?: string, anchor?: HTMLElement): void;
|
|
70
|
-
}
|
|
71
|
-
declare let ElementInternals: {
|
|
72
|
-
prototype: ElementInternals;
|
|
73
|
-
new (): ElementInternals;
|
|
74
|
-
};
|
|
75
2
|
/**
|
|
76
3
|
* @alpha
|
|
77
4
|
*/
|
|
@@ -175,4 +102,3 @@ export declare function FormAssociated<T extends ConstructableFormAssociated>(Ba
|
|
|
175
102
|
* @beta
|
|
176
103
|
*/
|
|
177
104
|
export declare function CheckableFormAssociated<T extends ConstructableFormAssociated>(BaseCtor: T): T;
|
|
178
|
-
export {};
|
|
@@ -1,48 +1,51 @@
|
|
|
1
1
|
import { Button } from '../button/button.js';
|
|
2
2
|
/**
|
|
3
|
-
* The base class used for constructing a fluent-toggle-button custom element
|
|
3
|
+
* The base class used for constructing a `<fluent-toggle-button>` custom element.
|
|
4
|
+
*
|
|
4
5
|
* @public
|
|
5
6
|
*/
|
|
6
7
|
export declare class ToggleButton extends Button {
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* Indicates the pressed state of the control.
|
|
10
|
+
*
|
|
11
|
+
* @public
|
|
12
|
+
* @remarks
|
|
13
|
+
* HTML Attribute: `pressed`
|
|
11
14
|
*/
|
|
12
|
-
|
|
15
|
+
pressed: boolean;
|
|
13
16
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
17
|
+
* Updates the pressed state when the `pressed` property changes.
|
|
18
|
+
*
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
protected pressedChanged(): void;
|
|
22
|
+
/**
|
|
23
|
+
* Indicates the mixed state of the control. This property takes precedence over `pressed`.
|
|
16
24
|
*
|
|
17
25
|
* @public
|
|
18
26
|
* @remarks
|
|
19
|
-
* HTML Attribute:
|
|
27
|
+
* HTML Attribute: `mixed`
|
|
20
28
|
*/
|
|
21
|
-
|
|
22
|
-
protected checkedAttributeChanged(): void;
|
|
23
|
-
defaultChecked: boolean;
|
|
24
|
-
protected defaultCheckedChanged(): void;
|
|
29
|
+
mixed?: boolean;
|
|
25
30
|
/**
|
|
26
|
-
*
|
|
31
|
+
* Updates the pressed state when the `mixed` property changes.
|
|
27
32
|
*
|
|
28
|
-
* @
|
|
33
|
+
* @param previous - the previous mixed state
|
|
34
|
+
* @param next - the current mixed state
|
|
35
|
+
* @internal
|
|
29
36
|
*/
|
|
30
|
-
|
|
31
|
-
protected checkedChanged(prev: boolean | undefined, next: boolean): void;
|
|
37
|
+
protected mixedChanged(): void;
|
|
32
38
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* in UI libraries that bind data through the .setAttribute() API
|
|
37
|
-
* and don't support IDL attribute binding.
|
|
39
|
+
* Toggles the pressed state of the button.
|
|
40
|
+
*
|
|
41
|
+
* @override
|
|
38
42
|
*/
|
|
39
|
-
|
|
40
|
-
currentCheckedChanged(prev: boolean | undefined, next: boolean): void;
|
|
41
|
-
constructor();
|
|
43
|
+
protected press(): void;
|
|
42
44
|
connectedCallback(): void;
|
|
43
|
-
disconnectedCallback(): void;
|
|
44
45
|
/**
|
|
46
|
+
* Sets the `aria-pressed` attribute based on the `pressed` and `mixed` properties.
|
|
47
|
+
*
|
|
45
48
|
* @internal
|
|
46
49
|
*/
|
|
47
|
-
|
|
50
|
+
private setPressedState;
|
|
48
51
|
}
|