@fluentui/web-components 3.0.0-beta.39 → 3.0.0-beta.40
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 +13 -2
- package/dist/dts/accordion/accordion.d.ts +35 -12
- package/dist/dts/accordion-item/accordion-item.d.ts +42 -14
- package/dist/dts/accordion-item/accordion-item.options.d.ts +2 -2
- package/dist/dts/accordion-item/index.d.ts +1 -1
- package/dist/dts/checkbox/checkbox.d.ts +98 -48
- package/dist/dts/field/field.d.ts +30 -1
- package/dist/dts/field/field.options.d.ts +2 -0
- package/dist/dts/index.d.ts +1 -1
- package/dist/dts/radio/index.d.ts +1 -1
- package/dist/dts/radio/radio.d.ts +38 -35
- package/dist/dts/radio/radio.options.d.ts +14 -0
- package/dist/dts/radio/radio.styles.d.ts +3 -1
- package/dist/dts/radio/radio.template.d.ts +13 -1
- package/dist/dts/radio-group/radio-group.d.ts +211 -49
- package/dist/dts/radio-group/radio-group.template.d.ts +1 -1
- package/dist/dts/styles/states/index.d.ts +20 -0
- package/dist/dts/switch/switch.d.ts +1 -0
- package/dist/dts/utils/root-active-element.d.ts +1 -0
- package/dist/esm/accordion/accordion.js +46 -85
- package/dist/esm/accordion/accordion.js.map +1 -1
- package/dist/esm/accordion-item/accordion-item.js +63 -19
- package/dist/esm/accordion-item/accordion-item.js.map +1 -1
- package/dist/esm/accordion-item/accordion-item.options.js +1 -1
- package/dist/esm/accordion-item/accordion-item.options.js.map +1 -1
- package/dist/esm/accordion-item/accordion-item.styles.js +41 -63
- package/dist/esm/accordion-item/accordion-item.styles.js.map +1 -1
- package/dist/esm/accordion-item/accordion-item.template.js +24 -43
- package/dist/esm/accordion-item/accordion-item.template.js.map +1 -1
- package/dist/esm/accordion-item/index.js +1 -1
- package/dist/esm/accordion-item/index.js.map +1 -1
- package/dist/esm/checkbox/checkbox.js +146 -97
- package/dist/esm/checkbox/checkbox.js.map +1 -1
- package/dist/esm/checkbox/checkbox.styles.js +1 -6
- package/dist/esm/checkbox/checkbox.styles.js.map +1 -1
- package/dist/esm/checkbox/checkbox.template.js.map +1 -1
- package/dist/esm/field/field.js +91 -29
- package/dist/esm/field/field.js.map +1 -1
- package/dist/esm/field/field.options.js.map +1 -1
- package/dist/esm/field/field.styles.js +31 -16
- package/dist/esm/field/field.styles.js.map +1 -1
- package/dist/esm/field/field.template.js +1 -1
- package/dist/esm/field/field.template.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/radio/radio.js +59 -72
- package/dist/esm/radio/radio.js.map +1 -1
- package/dist/esm/radio/radio.options.js +2 -0
- package/dist/esm/radio/radio.options.js.map +1 -0
- package/dist/esm/radio/radio.styles.js +95 -88
- package/dist/esm/radio/radio.styles.js.map +1 -1
- package/dist/esm/radio/radio.template.js +21 -24
- package/dist/esm/radio/radio.template.js.map +1 -1
- package/dist/esm/radio-group/radio-group.js +416 -313
- package/dist/esm/radio-group/radio-group.js.map +1 -1
- package/dist/esm/radio-group/radio-group.styles.js +26 -32
- package/dist/esm/radio-group/radio-group.styles.js.map +1 -1
- package/dist/esm/radio-group/radio-group.template.js +6 -21
- package/dist/esm/radio-group/radio-group.template.js.map +1 -1
- package/dist/esm/styles/states/index.js +20 -0
- package/dist/esm/styles/states/index.js.map +1 -1
- package/dist/esm/switch/switch.js +4 -0
- package/dist/esm/switch/switch.js.map +1 -1
- package/dist/esm/switch/switch.styles.js +3 -6
- package/dist/esm/switch/switch.styles.js.map +1 -1
- package/dist/esm/switch/switch.template.js.map +1 -1
- package/dist/esm/theme/set-theme.js +3 -6
- package/dist/esm/theme/set-theme.js.map +1 -1
- package/dist/esm/utils/root-active-element.js +9 -0
- package/dist/esm/utils/root-active-element.js.map +1 -0
- package/dist/web-components.d.ts +461 -181
- package/dist/web-components.js +1387 -1233
- package/dist/web-components.min.js +262 -258
- package/package.json +1 -1
- package/dist/dts/radio/radio.form-associated.d.ts +0 -14
- package/dist/esm/radio/radio.form-associated.js +0 -14
- package/dist/esm/radio/radio.form-associated.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
# Change Log - @fluentui/web-components
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 04 Jul 2024 04:08:06 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [3.0.0-beta.40](https://github.com/microsoft/fluentui/tree/@fluentui/web-components_v3.0.0-beta.40)
|
|
8
|
+
|
|
9
|
+
Thu, 04 Jul 2024 04:08:06 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/web-components_v3.0.0-beta.39..@fluentui/web-components_v3.0.0-beta.40)
|
|
11
|
+
|
|
12
|
+
### Changes
|
|
13
|
+
|
|
14
|
+
- feat: update radio and radio-group to use ElementInternals for form association ([PR #31783](https://github.com/microsoft/fluentui/pull/31783) by 863023+radium-v@users.noreply.github.com)
|
|
15
|
+
- fix for setTheme in Firefox ([PR #31911](https://github.com/microsoft/fluentui/pull/31911) by rupertdavid@microsoft.com)
|
|
16
|
+
- refactor(web-components): cleanup accordion and convert to element internals for states ([PR #31866](https://github.com/microsoft/fluentui/pull/31866) by rupertdavid@microsoft.com)
|
|
17
|
+
|
|
7
18
|
## [3.0.0-beta.39](https://github.com/microsoft/fluentui/tree/@fluentui/web-components_v3.0.0-beta.39)
|
|
8
19
|
|
|
9
|
-
Wed, 03 Jul 2024 04:
|
|
20
|
+
Wed, 03 Jul 2024 04:08:00 GMT
|
|
10
21
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/web-components_v3.0.0-beta.38..@fluentui/web-components_v3.0.0-beta.39)
|
|
11
22
|
|
|
12
23
|
### Changes
|
|
@@ -4,8 +4,9 @@ import { AccordionExpandMode } from './accordion.options.js';
|
|
|
4
4
|
* An Accordion Custom HTML Element
|
|
5
5
|
* Implements {@link https://www.w3.org/TR/wai-aria-practices-1.1/#accordion | ARIA Accordion}.
|
|
6
6
|
*
|
|
7
|
+
* @slot - The default slot for the accordion items
|
|
7
8
|
* @fires change - Fires a custom 'change' event when the active item changes
|
|
8
|
-
*
|
|
9
|
+
*
|
|
9
10
|
* @public
|
|
10
11
|
*/
|
|
11
12
|
export declare class Accordion extends FASTElement {
|
|
@@ -23,29 +24,51 @@ export declare class Accordion extends FASTElement {
|
|
|
23
24
|
* @internal
|
|
24
25
|
*/
|
|
25
26
|
slottedAccordionItems: HTMLElement[];
|
|
27
|
+
/**
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
26
30
|
protected accordionItems: Element[];
|
|
27
31
|
/**
|
|
28
32
|
* @internal
|
|
29
33
|
*/
|
|
30
34
|
slottedAccordionItemsChanged(oldValue: HTMLElement[], newValue: HTMLElement[]): void;
|
|
31
35
|
/**
|
|
36
|
+
* Watch for changes to the slotted accordion items `disabled` and `expanded` attributes
|
|
32
37
|
* @internal
|
|
33
38
|
*/
|
|
34
39
|
handleChange(source: any, propertyName: string): void;
|
|
35
|
-
private activeid;
|
|
36
40
|
private activeItemIndex;
|
|
37
|
-
|
|
38
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Find the first expanded item in the accordion
|
|
43
|
+
* @returns {void}
|
|
44
|
+
*/
|
|
39
45
|
private findExpandedItem;
|
|
46
|
+
/**
|
|
47
|
+
* Resets event listeners and sets the `accordionItems` property
|
|
48
|
+
* then rebinds event listeners to each non-disabled item
|
|
49
|
+
* @returns {void}
|
|
50
|
+
*/
|
|
40
51
|
private setItems;
|
|
52
|
+
/**
|
|
53
|
+
* Checks if the accordion is in single expand mode
|
|
54
|
+
* @returns {boolean}
|
|
55
|
+
*/
|
|
56
|
+
private isSingleExpandMode;
|
|
57
|
+
/**
|
|
58
|
+
* Controls the behavior of the accordion in single expand mode
|
|
59
|
+
* @param expandedItem The item to expand in single expand mode
|
|
60
|
+
* @returns {void}
|
|
61
|
+
*/
|
|
41
62
|
private setSingleExpandMode;
|
|
63
|
+
/**
|
|
64
|
+
* Removes event listeners from the previous accordion items
|
|
65
|
+
* @param oldValue An array of the previous accordion items
|
|
66
|
+
*/
|
|
42
67
|
private removeItemListeners;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
private
|
|
49
|
-
private adjust;
|
|
50
|
-
private focusItem;
|
|
68
|
+
/**
|
|
69
|
+
* Changes the expanded state of the accordion item
|
|
70
|
+
* @param evt Click event
|
|
71
|
+
* @returns
|
|
72
|
+
*/
|
|
73
|
+
private expandedChangedHandler;
|
|
51
74
|
}
|
|
@@ -2,7 +2,7 @@ import { FASTElement } from '@microsoft/fast-element';
|
|
|
2
2
|
import type { StaticallyComposableHTML } from '../utils/index.js';
|
|
3
3
|
import { StartEnd } from '../patterns/index.js';
|
|
4
4
|
import type { StartEndOptions } from '../patterns/index.js';
|
|
5
|
-
import {
|
|
5
|
+
import { AccordionItemMarkerPosition, AccordionItemSize } from './accordion-item.options.js';
|
|
6
6
|
/**
|
|
7
7
|
* Accordion Item configuration options
|
|
8
8
|
* @public
|
|
@@ -13,22 +13,24 @@ export type AccordionItemOptions = StartEndOptions<AccordionItem> & {
|
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
15
|
*
|
|
16
|
-
* @slot start - Content
|
|
17
|
-
* @slot end - Content which can be provided between the start slot and icon
|
|
16
|
+
* @slot start - Content positioned before heading in the collapsed state
|
|
18
17
|
* @slot heading - Content which serves as the accordion item heading and text of the expand button
|
|
19
18
|
* @slot - The default slot for accordion item content
|
|
20
|
-
* @slot expanded
|
|
21
|
-
* @slot collapsed
|
|
22
|
-
* @fires change - Fires a custom 'change' event when the button is invoked
|
|
19
|
+
* @slot marker-expanded - The expanded icon
|
|
20
|
+
* @slot marker-collapsed - The collapsed icon
|
|
23
21
|
* @csspart heading - Wraps the button
|
|
24
22
|
* @csspart button - The button which serves to invoke the item
|
|
25
|
-
* @csspart
|
|
26
|
-
* @csspart icon - The icon container
|
|
27
|
-
* @csspart region - The wrapper for the accordion item content
|
|
23
|
+
* @csspart content - The wrapper for the accordion item content
|
|
28
24
|
*
|
|
29
25
|
* @public
|
|
30
26
|
*/
|
|
31
27
|
export declare class AccordionItem extends FASTElement {
|
|
28
|
+
/**
|
|
29
|
+
* The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
|
|
30
|
+
*
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
elementInternals: ElementInternals;
|
|
32
34
|
/**
|
|
33
35
|
* Configures the {@link https://www.w3.org/TR/wai-aria-1.1/#aria-level | level} of the
|
|
34
36
|
* heading element.
|
|
@@ -46,6 +48,12 @@ export declare class AccordionItem extends FASTElement {
|
|
|
46
48
|
* HTML attribute: expanded
|
|
47
49
|
*/
|
|
48
50
|
expanded: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Handles expanded changes
|
|
53
|
+
* @param prev - previous value
|
|
54
|
+
* @param next - next value
|
|
55
|
+
*/
|
|
56
|
+
expandedChanged(prev: boolean, next: boolean): void;
|
|
49
57
|
/**
|
|
50
58
|
* Disables an accordion item
|
|
51
59
|
*
|
|
@@ -54,6 +62,12 @@ export declare class AccordionItem extends FASTElement {
|
|
|
54
62
|
* HTML attribute: disabled
|
|
55
63
|
*/
|
|
56
64
|
disabled: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Handles disabled changes
|
|
67
|
+
* @param prev - previous value
|
|
68
|
+
* @param next - next value
|
|
69
|
+
*/
|
|
70
|
+
disabledChanged(prev: boolean, next: boolean): void;
|
|
57
71
|
/**
|
|
58
72
|
* The item ID
|
|
59
73
|
*
|
|
@@ -70,6 +84,12 @@ export declare class AccordionItem extends FASTElement {
|
|
|
70
84
|
* HTML Attribute: size
|
|
71
85
|
*/
|
|
72
86
|
size?: AccordionItemSize;
|
|
87
|
+
/**
|
|
88
|
+
* Handles changes to size attribute
|
|
89
|
+
* @param prev - previous value
|
|
90
|
+
* @param next - next value
|
|
91
|
+
*/
|
|
92
|
+
sizeChanged(prev: AccordionItemSize, next: AccordionItemSize): void;
|
|
73
93
|
/**
|
|
74
94
|
* Sets the width of the focus state.
|
|
75
95
|
*
|
|
@@ -78,22 +98,30 @@ export declare class AccordionItem extends FASTElement {
|
|
|
78
98
|
* HTML Attribute: block
|
|
79
99
|
*/
|
|
80
100
|
block: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Handles changes to block attribute
|
|
103
|
+
* @param prev - previous value
|
|
104
|
+
* @param next - next value
|
|
105
|
+
*/
|
|
106
|
+
blockChanged(prev: boolean, next: boolean): void;
|
|
81
107
|
/**
|
|
82
108
|
* Sets expand and collapsed icon position.
|
|
83
109
|
*
|
|
84
110
|
* @public
|
|
85
111
|
* @remarks
|
|
86
|
-
* HTML Attribute:
|
|
112
|
+
* HTML Attribute: marker-position
|
|
87
113
|
*/
|
|
88
|
-
|
|
114
|
+
markerPosition?: AccordionItemMarkerPosition;
|
|
89
115
|
/**
|
|
90
|
-
*
|
|
116
|
+
* Handles changes to marker-position attribute
|
|
117
|
+
* @param prev - previous value
|
|
118
|
+
* @param next - next value
|
|
91
119
|
*/
|
|
92
|
-
|
|
120
|
+
markerPositionChanged(prev: AccordionItemMarkerPosition, next: AccordionItemMarkerPosition): void;
|
|
93
121
|
/**
|
|
94
122
|
* @internal
|
|
95
123
|
*/
|
|
96
|
-
|
|
124
|
+
expandbutton: HTMLElement;
|
|
97
125
|
}
|
|
98
126
|
/**
|
|
99
127
|
* Mark internal because exporting class and interface of the same name
|
|
@@ -16,7 +16,7 @@ export type AccordionItemSize = ValuesOf<typeof AccordionItemSize>;
|
|
|
16
16
|
/**
|
|
17
17
|
* An Accordion Item expand/collapse icon can appear at the start or end of the accordion
|
|
18
18
|
*/
|
|
19
|
-
export declare const
|
|
19
|
+
export declare const AccordionItemMarkerPosition: {
|
|
20
20
|
readonly start: "start";
|
|
21
21
|
readonly end: "end";
|
|
22
22
|
};
|
|
@@ -24,4 +24,4 @@ export declare const AccordionItemExpandIconPosition: {
|
|
|
24
24
|
* Applies expand/collapse icon position
|
|
25
25
|
* @public
|
|
26
26
|
*/
|
|
27
|
-
export type
|
|
27
|
+
export type AccordionItemMarkerPosition = ValuesOf<typeof AccordionItemMarkerPosition>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { AccordionItem } from './accordion-item.js';
|
|
2
2
|
export type { AccordionItemOptions } from './accordion-item.js';
|
|
3
|
-
export { AccordionItemSize,
|
|
3
|
+
export { AccordionItemSize, AccordionItemMarkerPosition } from './accordion-item.options.js';
|
|
4
4
|
export { styles as accordionItemStyles } from './accordion-item.styles.js';
|
|
5
5
|
export { definition as accordionItemDefinition } from './accordion-item.definition.js';
|
|
6
6
|
export { template as accordionItemTemplate } from './accordion-item.template.js';
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { FASTElement } from '@microsoft/fast-element';
|
|
2
2
|
import { CheckboxShape, CheckboxSize } from './checkbox.options.js';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#checkbox | ARIA checkbox }.
|
|
6
|
-
*
|
|
7
|
-
* @slot checked-indicator - The checked indicator
|
|
8
|
-
* @slot indeterminate-indicator - The indeterminate indicator
|
|
9
|
-
* @fires change - Emits a custom change event when the checked state changes
|
|
10
|
-
* @fires input - Emits a custom input event when the checked state changes
|
|
4
|
+
* The base class for a component with a toggleable checked state.
|
|
11
5
|
*
|
|
12
6
|
* @public
|
|
13
7
|
*/
|
|
@@ -27,37 +21,46 @@ export declare class BaseCheckbox extends FASTElement {
|
|
|
27
21
|
* @public
|
|
28
22
|
*/
|
|
29
23
|
get checked(): boolean;
|
|
30
|
-
set checked(
|
|
24
|
+
set checked(next: boolean);
|
|
31
25
|
/**
|
|
32
|
-
* The
|
|
26
|
+
* The disabled state of the control.
|
|
27
|
+
*
|
|
33
28
|
* @public
|
|
34
|
-
* @remarks
|
|
35
|
-
* HTML Attribute: `disabled`
|
|
36
29
|
*/
|
|
37
|
-
disabled
|
|
30
|
+
disabled?: boolean;
|
|
38
31
|
/**
|
|
39
|
-
*
|
|
40
|
-
* @see The {@link https://developer.mozilla.org/docs/Web/HTML/Element/input#form | `form`} attribute
|
|
32
|
+
* Toggles the disabled state when the user changes the `disabled` property.
|
|
41
33
|
*
|
|
42
|
-
* @
|
|
43
|
-
* @remarks
|
|
44
|
-
* HTML Attribute: `form`
|
|
34
|
+
* @internal
|
|
45
35
|
*/
|
|
46
|
-
|
|
36
|
+
protected disabledChanged(prev: boolean | undefined, next: boolean | undefined): void;
|
|
47
37
|
/**
|
|
48
|
-
*
|
|
38
|
+
* The initial disabled state of the control.
|
|
49
39
|
*
|
|
50
40
|
* @public
|
|
41
|
+
* @remarks
|
|
42
|
+
* HTML Attribute: `disabled`
|
|
51
43
|
*/
|
|
52
|
-
|
|
44
|
+
disabledAttribute?: boolean;
|
|
53
45
|
/**
|
|
54
|
-
*
|
|
46
|
+
* Sets the disabled state when the `disabled` attribute changes.
|
|
55
47
|
*
|
|
48
|
+
* @param prev - the previous value
|
|
49
|
+
* @param next - the current value
|
|
56
50
|
* @internal
|
|
57
51
|
*/
|
|
58
|
-
|
|
52
|
+
protected disabledAttributeChanged(prev: boolean | undefined, next: boolean | undefined): void;
|
|
53
|
+
/**
|
|
54
|
+
* The id of a form to associate the element to.
|
|
55
|
+
* @see The {@link https://developer.mozilla.org/docs/Web/HTML/Element/input#form | `form`} attribute
|
|
56
|
+
*
|
|
57
|
+
* @public
|
|
58
|
+
* @remarks
|
|
59
|
+
* HTML Attribute: `form`
|
|
60
|
+
*/
|
|
61
|
+
formAttribute?: string;
|
|
59
62
|
/**
|
|
60
|
-
* The
|
|
63
|
+
* The initial checked state of the element.
|
|
61
64
|
*
|
|
62
65
|
* @public
|
|
63
66
|
* @remarks
|
|
@@ -65,11 +68,13 @@ export declare class BaseCheckbox extends FASTElement {
|
|
|
65
68
|
*/
|
|
66
69
|
initialChecked?: boolean;
|
|
67
70
|
/**
|
|
68
|
-
* Updates the
|
|
71
|
+
* Updates the checked state when the `checked` attribute is changed, unless the checked state has been changed by the user.
|
|
69
72
|
*
|
|
73
|
+
* @param prev - The previous initial checked state
|
|
74
|
+
* @param next - The current initial checked state
|
|
70
75
|
* @internal
|
|
71
76
|
*/
|
|
72
|
-
initialCheckedChanged(prev: boolean | undefined, next: boolean): void;
|
|
77
|
+
protected initialCheckedChanged(prev: boolean | undefined, next: boolean | undefined): void;
|
|
73
78
|
/**
|
|
74
79
|
* The initial value of the input.
|
|
75
80
|
*
|
|
@@ -79,13 +84,13 @@ export declare class BaseCheckbox extends FASTElement {
|
|
|
79
84
|
*/
|
|
80
85
|
initialValue: string;
|
|
81
86
|
/**
|
|
82
|
-
* Sets the value of the input when the value attribute changes.
|
|
87
|
+
* Sets the value of the input when the `value` attribute changes.
|
|
83
88
|
*
|
|
84
|
-
* @param prev - The previous value
|
|
85
|
-
* @param next - The current value
|
|
89
|
+
* @param prev - The previous initial value
|
|
90
|
+
* @param next - The current initial value
|
|
86
91
|
* @internal
|
|
87
92
|
*/
|
|
88
|
-
initialValueChanged(prev: string, next: string): void;
|
|
93
|
+
protected initialValueChanged(prev: string, next: string): void;
|
|
89
94
|
/**
|
|
90
95
|
* The name of the element. This element's value will be surfaced during form submission under the provided name.
|
|
91
96
|
*
|
|
@@ -109,13 +114,13 @@ export declare class BaseCheckbox extends FASTElement {
|
|
|
109
114
|
* @param next - The current required state
|
|
110
115
|
* @internal
|
|
111
116
|
*/
|
|
112
|
-
requiredChanged(prev: boolean, next: boolean): void;
|
|
117
|
+
protected requiredChanged(prev: boolean, next: boolean): void;
|
|
113
118
|
/**
|
|
114
119
|
* The internal checked state of the control.
|
|
115
120
|
*
|
|
116
121
|
* @internal
|
|
117
122
|
*/
|
|
118
|
-
private _checked
|
|
123
|
+
private _checked?;
|
|
119
124
|
/**
|
|
120
125
|
* Indicates that the checked state has been changed by the user.
|
|
121
126
|
*
|
|
@@ -148,7 +153,7 @@ export declare class BaseCheckbox extends FASTElement {
|
|
|
148
153
|
*
|
|
149
154
|
* @public
|
|
150
155
|
*/
|
|
151
|
-
get labels(): ReadonlyArray<
|
|
156
|
+
get labels(): ReadonlyArray<HTMLLabelElement>;
|
|
152
157
|
/**
|
|
153
158
|
* The fallback validation message, taken from a native checkbox `<input>` element.
|
|
154
159
|
*
|
|
@@ -193,12 +198,6 @@ export declare class BaseCheckbox extends FASTElement {
|
|
|
193
198
|
* Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/willValidate | `ElementInternals.willValidate`} property.
|
|
194
199
|
*/
|
|
195
200
|
get willValidate(): boolean;
|
|
196
|
-
/**
|
|
197
|
-
* Sets the `elementInternals.ariaChecked` value based on the checked state.
|
|
198
|
-
*
|
|
199
|
-
* @internal
|
|
200
|
-
*/
|
|
201
|
-
private setAriaChecked;
|
|
202
201
|
/**
|
|
203
202
|
* Checks the validity of the element and returns the result.
|
|
204
203
|
*
|
|
@@ -215,14 +214,13 @@ export declare class BaseCheckbox extends FASTElement {
|
|
|
215
214
|
*/
|
|
216
215
|
clickHandler(e: MouseEvent): boolean | void;
|
|
217
216
|
connectedCallback(): void;
|
|
218
|
-
constructor();
|
|
219
217
|
/**
|
|
220
218
|
* Updates the form value when a user changes the `checked` state.
|
|
221
219
|
*
|
|
222
220
|
* @param e - the event object
|
|
223
221
|
* @internal
|
|
224
222
|
*/
|
|
225
|
-
inputHandler(e:
|
|
223
|
+
inputHandler(e: InputEvent): boolean | void;
|
|
226
224
|
/**
|
|
227
225
|
* Prevents scrolling when the user presses the space key.
|
|
228
226
|
*
|
|
@@ -251,6 +249,13 @@ export declare class BaseCheckbox extends FASTElement {
|
|
|
251
249
|
* Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/reportValidity | `HTMLInputElement.reportValidity()`} method.
|
|
252
250
|
*/
|
|
253
251
|
reportValidity(): boolean;
|
|
252
|
+
/**
|
|
253
|
+
* Sets the ARIA checked state.
|
|
254
|
+
*
|
|
255
|
+
* @param value - The checked state
|
|
256
|
+
* @internal
|
|
257
|
+
*/
|
|
258
|
+
protected setAriaChecked(value?: boolean): void;
|
|
254
259
|
/**
|
|
255
260
|
* Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/setFormValue | `ElementInternals.setFormValue()`} method.
|
|
256
261
|
*
|
|
@@ -277,11 +282,37 @@ export declare class BaseCheckbox extends FASTElement {
|
|
|
277
282
|
/**
|
|
278
283
|
* Toggles the checked state of the control.
|
|
279
284
|
*
|
|
285
|
+
* @param force - Forces the element to be checked or unchecked
|
|
280
286
|
* @public
|
|
281
287
|
*/
|
|
282
|
-
|
|
288
|
+
toggleChecked(force?: boolean): void;
|
|
283
289
|
}
|
|
290
|
+
/**
|
|
291
|
+
* A Checkbox Custom HTML Element.
|
|
292
|
+
* Implements the {@link https://w3c.github.io/aria/#checkbox | ARIA checkbox }.
|
|
293
|
+
*
|
|
294
|
+
* @slot checked-indicator - The checked indicator
|
|
295
|
+
* @slot indeterminate-indicator - The indeterminate indicator
|
|
296
|
+
* @fires change - Emits a custom change event when the checked state changes
|
|
297
|
+
* @fires input - Emits a custom input event when the checked state changes
|
|
298
|
+
*
|
|
299
|
+
* @public
|
|
300
|
+
*/
|
|
284
301
|
export declare class Checkbox extends BaseCheckbox {
|
|
302
|
+
/**
|
|
303
|
+
* Indicates that the element is in an indeterminate or mixed state.
|
|
304
|
+
*
|
|
305
|
+
* @public
|
|
306
|
+
*/
|
|
307
|
+
indeterminate?: boolean;
|
|
308
|
+
/**
|
|
309
|
+
* Updates the indeterminate state when the `indeterminate` property changes.
|
|
310
|
+
*
|
|
311
|
+
* @param prev - the indeterminate state
|
|
312
|
+
* @param next - the current indeterminate state
|
|
313
|
+
* @internal
|
|
314
|
+
*/
|
|
315
|
+
protected indeterminateChanged(prev: boolean | undefined, next: boolean | undefined): void;
|
|
285
316
|
/**
|
|
286
317
|
* Indicates the shape of the checkbox.
|
|
287
318
|
*
|
|
@@ -291,13 +322,15 @@ export declare class Checkbox extends BaseCheckbox {
|
|
|
291
322
|
*/
|
|
292
323
|
shape?: CheckboxShape;
|
|
293
324
|
/**
|
|
294
|
-
*
|
|
295
|
-
*
|
|
296
|
-
* @param
|
|
325
|
+
* Applies shape states when the `shape` property changes.
|
|
326
|
+
*
|
|
327
|
+
* @param prev - the previous shape value
|
|
328
|
+
* @param next - the next shape value
|
|
329
|
+
* @internal
|
|
297
330
|
*/
|
|
298
|
-
shapeChanged(prev: CheckboxShape | undefined, next: CheckboxShape | undefined): void;
|
|
331
|
+
protected shapeChanged(prev: CheckboxShape | undefined, next: CheckboxShape | undefined): void;
|
|
299
332
|
/**
|
|
300
|
-
* Indicates the size of the
|
|
333
|
+
* Indicates the size of the control.
|
|
301
334
|
*
|
|
302
335
|
* @public
|
|
303
336
|
* @remarks
|
|
@@ -305,9 +338,26 @@ export declare class Checkbox extends BaseCheckbox {
|
|
|
305
338
|
*/
|
|
306
339
|
size?: CheckboxSize;
|
|
307
340
|
/**
|
|
308
|
-
*
|
|
341
|
+
* Applies size states when the `size` property changes.
|
|
342
|
+
*
|
|
309
343
|
* @param prev - the previous state
|
|
310
344
|
* @param next - the next state
|
|
345
|
+
* @internal
|
|
346
|
+
*/
|
|
347
|
+
protected sizeChanged(prev: CheckboxSize | undefined, next: CheckboxSize | undefined): void;
|
|
348
|
+
constructor();
|
|
349
|
+
/**
|
|
350
|
+
* Sets the ARIA checked state. If the `indeterminate` flag is true, the value will be 'mixed'.
|
|
351
|
+
*
|
|
352
|
+
* @internal
|
|
353
|
+
* @override
|
|
354
|
+
*/
|
|
355
|
+
protected setAriaChecked(value?: boolean): void;
|
|
356
|
+
/**
|
|
357
|
+
* Toggles the checked state of the control.
|
|
358
|
+
*
|
|
359
|
+
* @param force - Forces the element to be checked or unchecked
|
|
360
|
+
* @public
|
|
311
361
|
*/
|
|
312
|
-
|
|
362
|
+
toggleChecked(force?: boolean): void;
|
|
313
363
|
}
|
|
@@ -14,6 +14,19 @@ export declare class Field extends FASTElement {
|
|
|
14
14
|
* HTML Attribute: `label-position`
|
|
15
15
|
*/
|
|
16
16
|
labelPosition: LabelPosition;
|
|
17
|
+
/**
|
|
18
|
+
* The slotted label elements.
|
|
19
|
+
*
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
labelSlot: Node[];
|
|
23
|
+
/**
|
|
24
|
+
* Updates attributes on the slotted label elements.
|
|
25
|
+
*
|
|
26
|
+
* @param prev - the previous list of slotted label elements
|
|
27
|
+
* @param next - the current list of slotted label elements
|
|
28
|
+
*/
|
|
29
|
+
protected labelSlotChanged(prev: Node[], next: Node[]): void;
|
|
17
30
|
/**
|
|
18
31
|
* The slotted message elements. Filtered to only include elements with a `flag` attribute.
|
|
19
32
|
*
|
|
@@ -56,19 +69,28 @@ export declare class Field extends FASTElement {
|
|
|
56
69
|
* @public
|
|
57
70
|
*/
|
|
58
71
|
input: SlottableInput;
|
|
72
|
+
/**
|
|
73
|
+
* Updates the field's states and label properties when the assigned input changes.
|
|
74
|
+
*
|
|
75
|
+
* @param prev - the previous input
|
|
76
|
+
* @param next - the current input
|
|
77
|
+
*/
|
|
78
|
+
inputChanged(prev: SlottableInput | undefined, next: SlottableInput | undefined): void;
|
|
59
79
|
/**
|
|
60
80
|
* Calls the `setStates` method when a `change` event is emitted from the slotted input.
|
|
61
81
|
*
|
|
62
82
|
* @param e - the event object
|
|
63
83
|
* @internal
|
|
64
84
|
*/
|
|
65
|
-
changeHandler(e: Event): void;
|
|
85
|
+
changeHandler(e: Event): boolean | void;
|
|
66
86
|
/**
|
|
67
87
|
* Redirects `click` events to the slotted input.
|
|
68
88
|
*
|
|
89
|
+
* @param e - the event object
|
|
69
90
|
* @internal
|
|
70
91
|
*/
|
|
71
92
|
clickHandler(e: MouseEvent): boolean | void;
|
|
93
|
+
constructor();
|
|
72
94
|
/**
|
|
73
95
|
* Applies the `focus-visible` state to the element when the slotted input receives visible focus.
|
|
74
96
|
*
|
|
@@ -90,10 +112,17 @@ export declare class Field extends FASTElement {
|
|
|
90
112
|
* @internal
|
|
91
113
|
*/
|
|
92
114
|
invalidHandler(e: Event): boolean | void;
|
|
115
|
+
/**
|
|
116
|
+
* Sets ARIA and form-related attributes on slotted label elements.
|
|
117
|
+
*
|
|
118
|
+
* @internal
|
|
119
|
+
*/
|
|
120
|
+
private setLabelProperties;
|
|
93
121
|
/**
|
|
94
122
|
* Toggles the field's states based on the slotted input.
|
|
95
123
|
*
|
|
96
124
|
* @internal
|
|
97
125
|
*/
|
|
98
126
|
setStates(): void;
|
|
127
|
+
setValidationStates(): void;
|
|
99
128
|
}
|
package/dist/dts/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AccordionItem, accordionItemDefinition,
|
|
1
|
+
export { AccordionItem, accordionItemDefinition, AccordionItemMarkerPosition, AccordionItemSize, accordionItemStyles, accordionItemTemplate, } from './accordion-item/index.js';
|
|
2
2
|
export type { AccordionItemOptions } from './accordion-item/index.js';
|
|
3
3
|
export { Accordion, accordionDefinition, AccordionExpandMode, accordionStyles, accordionTemplate, } from './accordion/index.js';
|
|
4
4
|
export { Link, LinkAppearance, LinkDefinition, LinkTemplate, LinkTarget } from './link/index.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { definition as RadioDefinition } from './radio.definition.js';
|
|
2
2
|
export { Radio } from './radio.js';
|
|
3
|
-
export type { RadioControl, RadioOptions } from './radio.js';
|
|
3
|
+
export type { RadioControl, RadioOptions } from './radio.options.js';
|
|
4
4
|
export { styles as RadioStyles } from './radio.styles.js';
|
|
5
5
|
export { template as RadioTemplate } from './radio.template.js';
|