@fluentui/web-components 3.0.0-beta.2 → 3.0.0-beta.4

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 (38) hide show
  1. package/CHANGELOG.md +20 -2
  2. package/dist/dts/index.d.ts +1 -0
  3. package/dist/dts/menu/define.d.ts +1 -0
  4. package/dist/dts/menu/index.d.ts +4 -0
  5. package/dist/dts/menu/menu.d.ts +194 -0
  6. package/dist/dts/menu/menu.definition.d.ts +9 -0
  7. package/dist/dts/menu/menu.styles.d.ts +4 -0
  8. package/dist/dts/menu/menu.template.d.ts +4 -0
  9. package/dist/esm/index.js +1 -0
  10. package/dist/esm/index.js.map +1 -1
  11. package/dist/esm/menu/define.js +4 -0
  12. package/dist/esm/menu/define.js.map +1 -0
  13. package/dist/esm/menu/index.js +5 -0
  14. package/dist/esm/menu/index.js.map +1 -0
  15. package/dist/esm/menu/menu.definition.js +17 -0
  16. package/dist/esm/menu/menu.definition.js.map +1 -0
  17. package/dist/esm/menu/menu.js +413 -0
  18. package/dist/esm/menu/menu.js.map +1 -0
  19. package/dist/esm/menu/menu.styles.js +17 -0
  20. package/dist/esm/menu/menu.styles.js.map +1 -0
  21. package/dist/esm/menu/menu.template.js +24 -0
  22. package/dist/esm/menu/menu.template.js.map +1 -0
  23. package/dist/esm/switch/switch.styles.js +3 -2
  24. package/dist/esm/switch/switch.styles.js.map +1 -1
  25. package/dist/fluent-web-components.api.json +1081 -0
  26. package/dist/storybook/{651.e36cf1e8.iframe.bundle.js → 677.939f187f.iframe.bundle.js} +5 -5
  27. package/dist/storybook/{651.e36cf1e8.iframe.bundle.js.map → 677.939f187f.iframe.bundle.js.map} +1 -1
  28. package/dist/storybook/iframe.html +1 -1
  29. package/dist/storybook/main.c98b42a5.iframe.bundle.js +2 -0
  30. package/dist/storybook/main.c98b42a5.iframe.bundle.js.LICENSE.txt +1 -0
  31. package/dist/storybook/project.json +1 -1
  32. package/dist/web-components.d.ts +209 -0
  33. package/dist/web-components.js +559 -223
  34. package/dist/web-components.min.js +67 -66
  35. package/docs/api-report.md +40 -0
  36. package/package.json +5 -1
  37. package/dist/storybook/main.696937e6.iframe.bundle.js +0 -1
  38. /package/dist/storybook/{651.e36cf1e8.iframe.bundle.js.LICENSE.txt → 677.939f187f.iframe.bundle.js.LICENSE.txt} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,12 +1,30 @@
1
1
  # Change Log - @fluentui/web-components
2
2
 
3
- This log was last generated on Mon, 28 Aug 2023 04:18:56 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 13 Oct 2023 04:17:18 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [3.0.0-beta.4](https://github.com/microsoft/fluentui/tree/@fluentui/web-components_v3.0.0-beta.4)
8
+
9
+ Fri, 13 Oct 2023 04:17:18 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/web-components_v3.0.0-beta.3..@fluentui/web-components_v3.0.0-beta.4)
11
+
12
+ ### Changes
13
+
14
+ - fix: update switch to use margin instead of transform for the checked state to support RTL ([PR #29505](https://github.com/microsoft/fluentui/pull/29505) by chhol@microsoft.com)
15
+
16
+ ## [3.0.0-beta.3](https://github.com/microsoft/fluentui/tree/@fluentui/web-components_v3.0.0-beta.3)
17
+
18
+ Thu, 28 Sep 2023 04:18:49 GMT
19
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/web-components_v3.0.0-beta.2..@fluentui/web-components_v3.0.0-beta.3)
20
+
21
+ ### Changes
22
+
23
+ - feat(menu): adds menu web component ([PR #27906](https://github.com/microsoft/fluentui/pull/27906) by brian.christopher.brady@gmail.com)
24
+
7
25
  ## [3.0.0-beta.2](https://github.com/microsoft/fluentui/tree/@fluentui/web-components_v3.0.0-beta.2)
8
26
 
9
- Mon, 28 Aug 2023 04:18:56 GMT
27
+ Mon, 28 Aug 2023 04:19:02 GMT
10
28
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/web-components_v3.0.0-beta.1..@fluentui/web-components_v3.0.0-beta.2)
11
29
 
12
30
  ### Changes
@@ -10,6 +10,7 @@ export * from './counter-badge/index.js';
10
10
  export * from './divider/index.js';
11
11
  export * from './image/index.js';
12
12
  export * from './label/index.js';
13
+ export * from './menu/index.js';
13
14
  export * from './menu-button/index.js';
14
15
  export * from './menu-item/index.js';
15
16
  export * from './menu-list/index.js';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export * from './menu.js';
2
+ export { template as MenuTemplate } from './menu.template.js';
3
+ export { styles as MenuStyles } from './menu.styles.js';
4
+ export { definition as MenuDefinition } from './menu.definition.js';
@@ -0,0 +1,194 @@
1
+ import { FASTElement } from '@microsoft/fast-element';
2
+ import { MenuList } from '../menu-list/menu-list.js';
3
+ /**
4
+ * The Menu class represents a menu component.
5
+ * @public
6
+ */
7
+ export declare class Menu extends FASTElement {
8
+ /**
9
+ * Determines if the menu should open on hover.
10
+ * @public
11
+ */
12
+ openOnHover?: boolean;
13
+ /**
14
+ * Determines if the menu should open on right click.
15
+ * @public
16
+ */
17
+ openOnContext?: boolean;
18
+ /**
19
+ * Determines if the menu should close on scroll.
20
+ * @public
21
+ */
22
+ closeOnScroll?: boolean;
23
+ /**
24
+ * Determines if the menu open state should persis on click of menu item
25
+ * @public
26
+ */
27
+ persistOnItemClick?: boolean;
28
+ /**
29
+ * Defines whether the menu is open or not.
30
+ * @public
31
+ */
32
+ open: boolean;
33
+ /**
34
+ * Holds the slotted menu list.
35
+ * @public
36
+ */
37
+ slottedMenuList: MenuList[];
38
+ /**
39
+ * Holds the slotted triggers.
40
+ * @public
41
+ */
42
+ slottedTriggers: HTMLElement[];
43
+ /**
44
+ * The positioning container of the menu.
45
+ * @internal
46
+ */
47
+ positioningContainer?: HTMLElement;
48
+ /**
49
+ * The trigger element of the menu.
50
+ * @private
51
+ */
52
+ private _trigger?;
53
+ /**
54
+ * The menu list element of the menu.
55
+ * @private
56
+ */
57
+ private _menuList?;
58
+ /**
59
+ * Holds a reference to a function that is used to cleanup resources.
60
+ * @public
61
+ */
62
+ cleanup?: () => void;
63
+ /**
64
+ * Called when the element is connected to the DOM.
65
+ * Sets up the component.
66
+ * @public
67
+ */
68
+ connectedCallback(): void;
69
+ /**
70
+ * Called when the element is disconnected from the DOM.
71
+ * Removes event listeners.
72
+ * @public
73
+ */
74
+ disconnectedCallback(): void;
75
+ /**
76
+ * Sets the component.
77
+ * Sets the trigger and menu list elements and adds event listeners.
78
+ * @public
79
+ */
80
+ setComponent(): void;
81
+ /**
82
+ * Toggles the open state of the menu.
83
+ * @public
84
+ */
85
+ toggleMenu: () => void;
86
+ /**
87
+ * Closes the menu.
88
+ * @public
89
+ */
90
+ closeMenu: () => void;
91
+ /**
92
+ * Opens the menu.
93
+ * @public
94
+ */
95
+ openMenu: (e?: Event) => void;
96
+ /**
97
+ * Focuses on the menu list.
98
+ * @public
99
+ */
100
+ focusMenuList(): void;
101
+ /**
102
+ * Focuses on the menu trigger.
103
+ * @public
104
+ */
105
+ focusTrigger(): void;
106
+ /**
107
+ * Called whenever the open state changes.
108
+ * Updates the 'aria-expanded' attribute and sets the positioning of the menu.
109
+ * Sets menu list position
110
+ * emits openChanged event
111
+ * @public
112
+ * @param {boolean} oldValue - The previous value of 'open'.
113
+ * @param {boolean} newValue - The new value of 'open'.
114
+ */
115
+ openChanged(oldValue: boolean, newValue: boolean): void;
116
+ /**
117
+ * Called whenever the 'openOnHover' property changes.
118
+ * Adds or removes a 'mouseover' event listener to the trigger based on the new value.
119
+ * @public
120
+ * @param {boolean} oldValue - The previous value of 'openOnHover'.
121
+ * @param {boolean} newValue - The new value of 'openOnHover'.
122
+ */
123
+ openOnHoverChanged(oldValue: boolean, newValue: boolean): void;
124
+ /**
125
+ * Called whenever the 'persistOnItemClick' property changes.
126
+ * Adds or removes a 'click' event listener to the menu list based on the new value.
127
+ * @public
128
+ * @param {boolean} oldValue - The previous value of 'persistOnItemClick'.
129
+ * @param {boolean} newValue - The new value of 'persistOnItemClick'.
130
+ */
131
+ persistOnItemClickChanged(oldValue: boolean, newValue: boolean): void;
132
+ /**
133
+ * Called whenever the 'openOnContext' property changes.
134
+ * Adds or removes a 'contextmenu' event listener to the trigger based on the new value.
135
+ * @public
136
+ * @param {boolean} oldValue - The previous value of 'openOnContext'.
137
+ * @param {boolean} newValue - The new value of 'openOnContext'.
138
+ */
139
+ openOnContextChanged(oldValue: boolean, newValue: boolean): void;
140
+ /**
141
+ * Called whenever the 'closeOnScroll' property changes.
142
+ * Adds or removes a 'closeOnScroll' event listener to the trigger based on the new value.
143
+ * @public
144
+ * @param {boolean} oldValue - The previous value of 'closeOnScroll'.
145
+ * @param {boolean} newValue - The new value of 'closeOnScroll'.
146
+ */
147
+ closeOnScrollChanged(oldValue: boolean, newValue: boolean): void;
148
+ /**
149
+ * The task to set the positioning of the menu.
150
+ * @protected
151
+ */
152
+ protected setPositioningTask: () => void;
153
+ /**
154
+ * Sets the positioning of the menu.
155
+ * @protected
156
+ */
157
+ protected setPositioning(): void;
158
+ /**
159
+ * Adds event listeners.
160
+ * Adds click and keydown event listeners to the trigger and a click event listener to the document.
161
+ * If 'openOnHover' is true, adds a 'mouseover' event listener to the trigger.
162
+ * @public
163
+ */
164
+ private addListeners;
165
+ /**
166
+ * Removes event listeners.
167
+ * Removes click and keydown event listeners from the trigger and a click event listener from the document.
168
+ * Also removes 'mouseover' event listeners from the trigger.
169
+ * @private
170
+ */
171
+ private removeListeners;
172
+ /**
173
+ * Handles keyboard interaction for the menu.
174
+ * Closes the menu and focuses on the trigger when the Escape key is pressed.
175
+ * Closes the menu when the Tab key is pressed.
176
+ * @public
177
+ * @param {KeyboardEvent} e - the keyboard event
178
+ */
179
+ handleMenuKeydown(e: KeyboardEvent): boolean | void;
180
+ /**
181
+ * Handles keyboard interaction for the trigger.
182
+ * Toggles the menu when the Space or Enter key is pressed.
183
+ * If the menu is open, focuses on the menu list.
184
+ * @public
185
+ * @param {KeyboardEvent} e - the keyboard event
186
+ */
187
+ handleTriggerKeydown: (e: KeyboardEvent) => boolean | void;
188
+ /**
189
+ * Handles document click events to close the menu when a click occurs outside of the menu or the trigger.
190
+ * @private
191
+ * @param {Event} e - The event triggered on document click.
192
+ */
193
+ private handleDocumentClick;
194
+ }
@@ -0,0 +1,9 @@
1
+ import { Menu } from './menu.js';
2
+ /**
3
+ * The Fluent Menu Element.
4
+ *
5
+ * @public
6
+ * @remarks
7
+ * HTML Element: <fluent-menu>
8
+ */
9
+ export declare const definition: import("@microsoft/fast-element").FASTElementDefinition<typeof Menu>;
@@ -0,0 +1,4 @@
1
+ /** Menu styles
2
+ * @public
3
+ */
4
+ export declare const styles: import("@microsoft/fast-element").ElementStyles;
@@ -0,0 +1,4 @@
1
+ import { ElementViewTemplate } from '@microsoft/fast-element';
2
+ import type { Menu } from './menu.js';
3
+ export declare function menuTemplate<T extends Menu>(): ElementViewTemplate<T>;
4
+ export declare const template: ElementViewTemplate<Menu>;
package/dist/esm/index.js CHANGED
@@ -10,6 +10,7 @@ export * from './counter-badge/index.js';
10
10
  export * from './divider/index.js';
11
11
  export * from './image/index.js';
12
12
  export * from './label/index.js';
13
+ export * from './menu/index.js';
13
14
  export * from './menu-button/index.js';
14
15
  export * from './menu-item/index.js';
15
16
  export * from './menu-list/index.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,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A0B,CAAC;AAEzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { FluentDesignSystem } from '../fluent-design-system.js';
2
+ import { definition } from './menu.definition.js';
3
+ definition.define(FluentDesignSystem.registry);
4
+ //# sourceMappingURL=define.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define.js","sourceRoot":"","sources":["../../../src/menu/define.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,UAAU,CAAC,MAAM,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './menu.js';
2
+ export { template as MenuTemplate } from './menu.template.js';
3
+ export { styles as MenuStyles } from './menu.styles.js';
4
+ export { definition as MenuDefinition } from './menu.definition.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/menu/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { FluentDesignSystem } from '../fluent-design-system.js';
2
+ import { Menu } from './menu.js';
3
+ import { styles } from './menu.styles.js';
4
+ import { template } from './menu.template.js';
5
+ /**
6
+ * The Fluent Menu Element.
7
+ *
8
+ * @public
9
+ * @remarks
10
+ * HTML Element: <fluent-menu>
11
+ */
12
+ export const definition = Menu.compose({
13
+ name: `${FluentDesignSystem.prefix}-menu`,
14
+ template,
15
+ styles,
16
+ });
17
+ //# sourceMappingURL=menu.definition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu.definition.js","sourceRoot":"","sources":["../../../src/menu/menu.definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC;IACrC,IAAI,EAAE,GAAG,kBAAkB,CAAC,MAAM,OAAO;IACzC,QAAQ;IACR,MAAM;CACP,CAAC,CAAC"}