@fluentui/web-components 3.0.0-alpha.18 → 3.0.0-alpha.19
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.json +16 -1
- package/CHANGELOG.md +11 -2
- package/dist/dts/index.d.ts +2 -0
- package/dist/dts/menu-item/define.d.ts +1 -0
- package/dist/dts/menu-item/index.d.ts +4 -0
- package/dist/dts/menu-item/menu-item.d.ts +8 -0
- package/dist/dts/menu-item/menu-item.definition.d.ts +11 -0
- package/dist/dts/menu-item/menu-item.styles.d.ts +4 -0
- package/dist/dts/menu-item/menu-item.template.d.ts +3 -0
- package/dist/dts/menu-list/define.d.ts +1 -0
- package/dist/dts/menu-list/index.d.ts +4 -0
- package/dist/dts/menu-list/menu-list.d.ts +9 -0
- package/dist/dts/menu-list/menu-list.definition.d.ts +11 -0
- package/dist/dts/menu-list/menu-list.styles.d.ts +4 -0
- package/dist/dts/menu-list/menu-list.template.d.ts +3 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/menu-item/define.js +4 -0
- package/dist/esm/menu-item/define.js.map +1 -0
- package/dist/esm/menu-item/index.js +5 -0
- package/dist/esm/menu-item/index.js.map +1 -0
- package/dist/esm/menu-item/menu-item.definition.js +19 -0
- package/dist/esm/menu-item/menu-item.definition.js.map +1 -0
- package/dist/esm/menu-item/menu-item.js +8 -0
- package/dist/esm/menu-item/menu-item.js.map +1 -0
- package/dist/esm/menu-item/menu-item.styles.js +183 -0
- package/dist/esm/menu-item/menu-item.styles.js.map +1 -0
- package/dist/esm/menu-item/menu-item.template.js +10 -0
- package/dist/esm/menu-item/menu-item.template.js.map +1 -0
- package/dist/esm/menu-list/define.js +4 -0
- package/dist/esm/menu-list/define.js.map +1 -0
- package/dist/esm/menu-list/index.js +5 -0
- package/dist/esm/menu-list/index.js.map +1 -0
- package/dist/esm/menu-list/menu-list.definition.js +19 -0
- package/dist/esm/menu-list/menu-list.definition.js.map +1 -0
- package/dist/esm/menu-list/menu-list.js +36 -0
- package/dist/esm/menu-list/menu-list.js.map +1 -0
- package/dist/esm/menu-list/menu-list.styles.js +24 -0
- package/dist/esm/menu-list/menu-list.styles.js.map +1 -0
- package/dist/esm/menu-list/menu-list.template.js +3 -0
- package/dist/esm/menu-list/menu-list.template.js.map +1 -0
- package/dist/fluent-web-components.api.json +320 -0
- package/dist/web-components.d.ts +56 -0
- package/dist/web-components.js +2022 -93
- package/dist/web-components.min.js +158 -152
- package/docs/api-report.md +33 -0
- package/package.json +13 -5
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,22 @@
|
|
|
2
2
|
"name": "@fluentui/web-components",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Fri, 21 Apr 2023 04:19:13 GMT",
|
|
6
|
+
"tag": "@fluentui/web-components_v3.0.0-alpha.19",
|
|
7
|
+
"version": "3.0.0-alpha.19",
|
|
8
|
+
"comments": {
|
|
9
|
+
"prerelease": [
|
|
10
|
+
{
|
|
11
|
+
"author": "brianbrady@microsoft.com",
|
|
12
|
+
"package": "@fluentui/web-components",
|
|
13
|
+
"commit": "f801e34cdc25ba01ccf3b2baa9fac1080d987e9b",
|
|
14
|
+
"comment": "feat(menu-list): Add menu-list and menu-item web components"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Thu, 20 Apr 2023 04:20:30 GMT",
|
|
6
21
|
"tag": "@fluentui/web-components_v3.0.0-alpha.18",
|
|
7
22
|
"version": "3.0.0-alpha.18",
|
|
8
23
|
"comments": {
|
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 Fri, 21 Apr 2023 04:19:13 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [3.0.0-alpha.19](https://github.com/microsoft/fluentui/tree/@fluentui/web-components_v3.0.0-alpha.19)
|
|
8
|
+
|
|
9
|
+
Fri, 21 Apr 2023 04:19:13 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/web-components_v3.0.0-alpha.18..@fluentui/web-components_v3.0.0-alpha.19)
|
|
11
|
+
|
|
12
|
+
### Changes
|
|
13
|
+
|
|
14
|
+
- feat(menu-list): Add menu-list and menu-item web components ([PR #26765](https://github.com/microsoft/fluentui/pull/26765) by brianbrady@microsoft.com)
|
|
15
|
+
|
|
7
16
|
## [3.0.0-alpha.18](https://github.com/microsoft/fluentui/tree/@fluentui/web-components_v3.0.0-alpha.18)
|
|
8
17
|
|
|
9
|
-
Thu, 20 Apr 2023 04:20:
|
|
18
|
+
Thu, 20 Apr 2023 04:20:30 GMT
|
|
10
19
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/web-components_v3.0.0-alpha.17..@fluentui/web-components_v3.0.0-alpha.18)
|
|
11
20
|
|
|
12
21
|
### Changes
|
package/dist/dts/index.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export * from './divider/index.js';
|
|
|
10
10
|
export * from './image/index.js';
|
|
11
11
|
export * from './label/index.js';
|
|
12
12
|
export * from './menu-button/index.js';
|
|
13
|
+
export * from './menu-item/index.js';
|
|
14
|
+
export * from './menu-list/index.js';
|
|
13
15
|
export * from './progress-bar/index.js';
|
|
14
16
|
export * from './slider/index.js';
|
|
15
17
|
export * from './spinner/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FASTMenuItem } from '@microsoft/fast-foundation';
|
|
2
|
+
export declare type MenuItemColumnCount = 0 | 1 | 2;
|
|
3
|
+
/**
|
|
4
|
+
* The base class used for constructing a fluent-menu-item custom element
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export declare class MenuItem extends FASTMenuItem {
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MenuItem } from './menu-item.js';
|
|
2
|
+
/**
|
|
3
|
+
* The Fluent Menu Item Element. Implements {@link @microsoft/fast-foundation#MenuItem },
|
|
4
|
+
* {@link @microsoft/fast-foundation#menuItemTemplate}
|
|
5
|
+
*
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
* @remarks
|
|
9
|
+
* HTML Element: <fluent-menu-item>
|
|
10
|
+
*/
|
|
11
|
+
export declare const definition: import("@microsoft/fast-element").FASTElementDefinition<typeof MenuItem>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FASTMenu } from '@microsoft/fast-foundation';
|
|
2
|
+
/**
|
|
3
|
+
* The base class used for constructing a fluent-menu-list custom element
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export declare class MenuList extends FASTMenu {
|
|
7
|
+
protected setItems(): void;
|
|
8
|
+
private static elementIndent;
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MenuList } from './menu-list.js';
|
|
2
|
+
/**
|
|
3
|
+
* The Fluent MenuList Element. Implements {@link @microsoft/fast-foundation#Menu },
|
|
4
|
+
* {@link @microsoft/fast-foundation#menuTemplate}
|
|
5
|
+
*
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
* @remarks
|
|
9
|
+
* HTML Element: <fluent-menu-list>
|
|
10
|
+
*/
|
|
11
|
+
export declare const definition: import("@microsoft/fast-element").FASTElementDefinition<typeof MenuList>;
|
package/dist/esm/index.js
CHANGED
|
@@ -10,6 +10,8 @@ export * from './divider/index.js';
|
|
|
10
10
|
export * from './image/index.js';
|
|
11
11
|
export * from './label/index.js';
|
|
12
12
|
export * from './menu-button/index.js';
|
|
13
|
+
export * from './menu-item/index.js';
|
|
14
|
+
export * from './menu-list/index.js';
|
|
13
15
|
export * from './progress-bar/index.js';
|
|
14
16
|
export * from './slider/index.js';
|
|
15
17
|
export * from './spinner/index.js';
|
package/dist/esm/index.js.map
CHANGED
|
@@ -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,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AAEzC,cAAc,kBAAkB,CAAC"}
|
|
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,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AAEzC,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define.js","sourceRoot":"","sources":["../../../src/menu-item/define.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD,UAAU,CAAC,MAAM,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from './menu-item.js';
|
|
2
|
+
export { template as MenuItemTemplate } from './menu-item.template.js';
|
|
3
|
+
export { styles as MenuItemStyles } from './menu-item.styles.js';
|
|
4
|
+
export { definition as MenuItemDefinition } from './menu-item.definition.js';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/menu-item/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,QAAQ,IAAI,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,UAAU,IAAI,kBAAkB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FluentDesignSystem } from '../fluent-design-system.js';
|
|
2
|
+
import { MenuItem } from './menu-item.js';
|
|
3
|
+
import { styles } from './menu-item.styles.js';
|
|
4
|
+
import { template } from './menu-item.template.js';
|
|
5
|
+
/**
|
|
6
|
+
* The Fluent Menu Item Element. Implements {@link @microsoft/fast-foundation#MenuItem },
|
|
7
|
+
* {@link @microsoft/fast-foundation#menuItemTemplate}
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
* @remarks
|
|
12
|
+
* HTML Element: <fluent-menu-item>
|
|
13
|
+
*/
|
|
14
|
+
export const definition = MenuItem.compose({
|
|
15
|
+
name: `${FluentDesignSystem.prefix}-menu-item`,
|
|
16
|
+
template,
|
|
17
|
+
styles,
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=menu-item.definition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-item.definition.js","sourceRoot":"","sources":["../../../src/menu-item/menu-item.definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,CAAC;IACzC,IAAI,EAAE,GAAG,kBAAkB,CAAC,MAAM,YAAY;IAC9C,QAAQ;IACR,MAAM;CACP,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-item.js","sourceRoot":"","sources":["../../../src/menu-item/menu-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAI1D;;;GAGG;AACH,MAAM,OAAO,QAAS,SAAQ,YAAY;CAAG"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { css } from '@microsoft/fast-element';
|
|
2
|
+
import { display } from '@microsoft/fast-foundation';
|
|
3
|
+
import { borderRadiusMedium, colorCompoundBrandForeground1Hover, colorCompoundBrandForeground1Pressed, colorNeutralBackground1, colorNeutralBackground1Hover, colorNeutralBackground1Selected, colorNeutralBackgroundDisabled, colorNeutralForeground2, colorNeutralForeground2Hover, colorNeutralForeground2Pressed, colorNeutralForeground3, colorNeutralForegroundDisabled, fontFamilyBase, fontSizeBase200, fontSizeBase300, fontSizeBase500, fontWeightRegular, lineHeightBase200, lineHeightBase300, } from '../theme/design-tokens.js';
|
|
4
|
+
/** MenuItem styles
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export const styles = css `
|
|
8
|
+
${display('grid')}
|
|
9
|
+
|
|
10
|
+
:host {
|
|
11
|
+
grid-template-columns: 20px 20px auto 20px;
|
|
12
|
+
align-items: center;
|
|
13
|
+
grid-gap: 4px;
|
|
14
|
+
height: 32px;
|
|
15
|
+
background: ${colorNeutralBackground1};
|
|
16
|
+
font: ${fontWeightRegular} ${fontSizeBase300} / ${lineHeightBase300} ${fontFamilyBase};
|
|
17
|
+
border-radius: ${borderRadiusMedium};
|
|
18
|
+
color: ${colorNeutralForeground2};
|
|
19
|
+
padding: 0 10px;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
overflow: visible;
|
|
22
|
+
contain: layout;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:host(:hover) {
|
|
26
|
+
background: ${colorNeutralBackground1Hover};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.content {
|
|
30
|
+
white-space: nowrap;
|
|
31
|
+
flex-grow: 1;
|
|
32
|
+
grid-column: auto / span 2;
|
|
33
|
+
padding: 0 2px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.checkbox,
|
|
37
|
+
.radio {
|
|
38
|
+
display: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.input-container,
|
|
42
|
+
.expand-collapse-glyph-container,
|
|
43
|
+
::slotted([slot='start']),
|
|
44
|
+
::slotted([slot='end']),
|
|
45
|
+
:host([checked]) .checkbox,
|
|
46
|
+
:host([checked]) .radio {
|
|
47
|
+
display: inline-flex;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
align-items: center;
|
|
50
|
+
color: ${colorNeutralForeground2};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.expand-collapse-glyph-container,
|
|
54
|
+
::slotted([slot='start']),
|
|
55
|
+
::slotted([slot='end']) {
|
|
56
|
+
height: 32px;
|
|
57
|
+
font-size: ${fontSizeBase500};
|
|
58
|
+
width: fit-content;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.input-container {
|
|
62
|
+
width: 20px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
::slotted([slot='end']) {
|
|
66
|
+
color: ${colorNeutralForeground3};
|
|
67
|
+
font: ${fontWeightRegular} ${fontSizeBase200} / ${lineHeightBase200} ${fontFamilyBase};
|
|
68
|
+
white-space: nowrap;
|
|
69
|
+
grid-column: 4 / span 1;
|
|
70
|
+
justify-self: flex-end;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.expand-collapse-glyph-container {
|
|
74
|
+
grid-column: 4 / span 1;
|
|
75
|
+
justify-self: flex-end;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
:host(:hover) .input-container,
|
|
79
|
+
:host(:hover) .expand-collapse-glyph-container,
|
|
80
|
+
:host(:hover) .content {
|
|
81
|
+
color: ${colorNeutralForeground2Hover};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:host([icon]:hover) ::slotted([slot='start']) {
|
|
85
|
+
color: ${colorCompoundBrandForeground1Hover};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
:host(:active) {
|
|
89
|
+
background-color: ${colorNeutralBackground1Selected};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
:host(:active) .input-container,
|
|
93
|
+
:host(:active) .expand-collapse-glyph-container,
|
|
94
|
+
:host(:active) .content {
|
|
95
|
+
color: ${colorNeutralForeground2Pressed};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
:host(:active) ::slotted([slot='start']) {
|
|
99
|
+
color: ${colorCompoundBrandForeground1Pressed};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
:host([disabled]) {
|
|
103
|
+
background-color: ${colorNeutralBackgroundDisabled};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
:host([disabled]) .content,
|
|
107
|
+
:host([disabled]) .expand-collapse-glyph-container,
|
|
108
|
+
:host([disabled]) ::slotted([slot='end']),
|
|
109
|
+
:host([disabled]) ::slotted([slot='start']) {
|
|
110
|
+
color: ${colorNeutralForegroundDisabled};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
:host([data-indent]) {
|
|
114
|
+
display: grid;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
:host([data-indent='1']) .content {
|
|
118
|
+
grid-column: 2 / span 1;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
:host([data-indent='1'][role='menuitemcheckbox']) {
|
|
122
|
+
display: grid;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
:host([data-indent='2'][aria-haspopup='menu']) ::slotted([slot='end']) {
|
|
126
|
+
grid-column: 4 / span 1;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
:host([data-indent='2'][aria-haspopup='menu']) .expand-collapse-glyph-container {
|
|
130
|
+
grid-column: 5 / span 1;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
:host([data-indent='1']) .content {
|
|
134
|
+
grid-column: 2 / span 1;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
:host([data-indent='1'][role='menuitemcheckbox']) .content,
|
|
138
|
+
:host([data-indent='1'][role='menuitemradio']) .content {
|
|
139
|
+
grid-column: auto / span 1;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
:host([icon]) ::slotted([slot='end']),
|
|
143
|
+
:host([data-indent='1']) ::slotted([slot='end']) {
|
|
144
|
+
grid-column: 4 / span 1;
|
|
145
|
+
justify-self: flex-end;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
:host([data-indent='2']) {
|
|
149
|
+
display: grid;
|
|
150
|
+
grid-template-columns: 20px 20px auto auto;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
:host([data-indent='2']) .content {
|
|
154
|
+
grid-column: 3 / span 1;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
:host([data-indent='2']) .input-container {
|
|
158
|
+
grid-column: 1 / span 1;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
:host([data-indent='2']) ::slotted([slot='start']) {
|
|
162
|
+
grid-column: 2 / span 1;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
:host([aria-haspopup='menu']) {
|
|
166
|
+
grid-template-columns: 20px auto auto 20px;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
:host([data-indent='2'][aria-haspopup='menu']) {
|
|
170
|
+
grid-template-columns: 20px 20px auto auto 20px;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
:host([aria-haspopup='menu']) ::slotted([slot='end']) {
|
|
174
|
+
grid-column: 3 / span 1;
|
|
175
|
+
justify-self: flex-end;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
:host([data-indent='2'][aria-haspopup='menu']) ::slotted([slot='end']) {
|
|
179
|
+
grid-column: 4 / span 1;
|
|
180
|
+
justify-self: flex-end;
|
|
181
|
+
}
|
|
182
|
+
`;
|
|
183
|
+
//# sourceMappingURL=menu-item.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-item.styles.js","sourceRoot":"","sources":["../../../src/menu-item/menu-item.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACL,kBAAkB,EAClB,kCAAkC,EAClC,oCAAoC,EACpC,uBAAuB,EACvB,4BAA4B,EAC5B,+BAA+B,EAC/B,8BAA8B,EAC9B,uBAAuB,EACvB,4BAA4B,EAC5B,8BAA8B,EAC9B,uBAAuB,EACvB,8BAA8B,EAC9B,cAAc,EACd,eAAe,EACf,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AAEnC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;IACrB,OAAO,CAAC,MAAM,CAAC;;;;;;;kBAOD,uBAAuB;YAC7B,iBAAiB,IAAI,eAAe,MAAM,iBAAiB,IAAI,cAAc;qBACpE,kBAAkB;aAC1B,uBAAuB;;;;;;;;kBAQlB,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;aAwBjC,uBAAuB;;;;;;;iBAOnB,eAAe;;;;;;;;;aASnB,uBAAuB;YACxB,iBAAiB,IAAI,eAAe,MAAM,iBAAiB,IAAI,cAAc;;;;;;;;;;;;;;aAc5E,4BAA4B;;;;aAI5B,kCAAkC;;;;wBAIvB,+BAA+B;;;;;;aAM1C,8BAA8B;;;;aAI9B,oCAAoC;;;;wBAIzB,8BAA8B;;;;;;;aAOzC,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwE1C,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { html } from '@microsoft/fast-element';
|
|
2
|
+
import { menuItemTemplate } from '@microsoft/fast-foundation';
|
|
3
|
+
const Checkmark16Filled = html.partial(`<svg fill="currentColor" class="___12fm75w f1w7gpdv fez10in fg4l7m0" aria-hidden="true" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.05 3.49c.28.3.27.77-.04 1.06l-7.93 7.47A.85.85 0 014.9 12L2.22 9.28a.75.75 0 111.06-1.06l2.24 2.27 7.47-7.04a.75.75 0 011.06.04z" fill="currentColor"></path></svg>`);
|
|
4
|
+
const chevronRight16Filled = html.partial(`<svg fill="currentColor" class="___12fm75w f1w7gpdv fez10in fg4l7m0" aria-hidden="true" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M5.74 3.2a.75.75 0 00-.04 1.06L9.23 8 5.7 11.74a.75.75 0 101.1 1.02l4-4.25a.75.75 0 000-1.02l-4-4.25a.75.75 0 00-1.06-.04z" fill="currentColor"></path></svg>`);
|
|
5
|
+
export const template = menuItemTemplate({
|
|
6
|
+
checkboxIndicator: Checkmark16Filled,
|
|
7
|
+
expandCollapseGlyph: chevronRight16Filled,
|
|
8
|
+
radioIndicator: Checkmark16Filled,
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=menu-item.template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-item.template.js","sourceRoot":"","sources":["../../../src/menu-item/menu-item.template.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAG9D,MAAM,iBAAiB,GAAG,IAAI,CAAC,OAAO,CACpC,wVAAwV,CACzV,CAAC;AACF,MAAM,oBAAoB,GAAG,IAAI,CAAC,OAAO,CACvC,8UAA8U,CAC/U,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAkC,gBAAgB,CAAC;IACtE,iBAAiB,EAAE,iBAAiB;IACpC,mBAAmB,EAAE,oBAAoB;IACzC,cAAc,EAAE,iBAAiB;CAClC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define.js","sourceRoot":"","sources":["../../../src/menu-list/define.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD,UAAU,CAAC,MAAM,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from './menu-list.js';
|
|
2
|
+
export { template as MenuListTemplate } from './menu-list.template.js';
|
|
3
|
+
export { styles as MenuListStyles } from './menu-list.styles.js';
|
|
4
|
+
export { definition as MenuListDefinition } from './menu-list.definition.js';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/menu-list/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,QAAQ,IAAI,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,UAAU,IAAI,kBAAkB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FluentDesignSystem } from '../fluent-design-system.js';
|
|
2
|
+
import { MenuList } from './menu-list.js';
|
|
3
|
+
import { styles } from './menu-list.styles.js';
|
|
4
|
+
import { template } from './menu-list.template.js';
|
|
5
|
+
/**
|
|
6
|
+
* The Fluent MenuList Element. Implements {@link @microsoft/fast-foundation#Menu },
|
|
7
|
+
* {@link @microsoft/fast-foundation#menuTemplate}
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
* @remarks
|
|
12
|
+
* HTML Element: <fluent-menu-list>
|
|
13
|
+
*/
|
|
14
|
+
export const definition = MenuList.compose({
|
|
15
|
+
name: `${FluentDesignSystem.prefix}-menu-list`,
|
|
16
|
+
template,
|
|
17
|
+
styles,
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=menu-list.definition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-list.definition.js","sourceRoot":"","sources":["../../../src/menu-list/menu-list.definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,CAAC;IACzC,IAAI,EAAE,GAAG,kBAAkB,CAAC,MAAM,YAAY;IAC9C,QAAQ;IACR,MAAM;CACP,CAAC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { FASTMenu, MenuItemRole } from '@microsoft/fast-foundation';
|
|
2
|
+
import { MenuItem } from '../menu-item/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* The base class used for constructing a fluent-menu-list custom element
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export class MenuList extends FASTMenu {
|
|
8
|
+
setItems() {
|
|
9
|
+
var _a;
|
|
10
|
+
super.setItems();
|
|
11
|
+
/**
|
|
12
|
+
* Set the indent attribute on MenuItem elements based on their
|
|
13
|
+
* position in the MenuList. Each MenuItem element has a data-indent attribute that is
|
|
14
|
+
* used to set the indent of the element's start slot content.
|
|
15
|
+
*/
|
|
16
|
+
const filteredMenuListItems = (_a = this.menuItems) === null || _a === void 0 ? void 0 : _a.filter(this.isMenuItemElement);
|
|
17
|
+
filteredMenuListItems === null || filteredMenuListItems === void 0 ? void 0 : filteredMenuListItems.forEach((item, index) => {
|
|
18
|
+
const indent = filteredMenuListItems === null || filteredMenuListItems === void 0 ? void 0 : filteredMenuListItems.reduce((accum, current) => {
|
|
19
|
+
const elementValue = MenuList.elementIndent(current);
|
|
20
|
+
return Math.max(accum, elementValue);
|
|
21
|
+
}, 0);
|
|
22
|
+
if (item instanceof MenuItem) {
|
|
23
|
+
item.setAttribute('data-indent', `${indent}`);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
static elementIndent(el) {
|
|
28
|
+
const role = el.getAttribute('role');
|
|
29
|
+
const startSlot = el.querySelector('[slot=start]');
|
|
30
|
+
if (role && role !== MenuItemRole.menuitem) {
|
|
31
|
+
return startSlot ? 2 : 1;
|
|
32
|
+
}
|
|
33
|
+
return startSlot ? 1 : 0;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=menu-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-list.js","sourceRoot":"","sources":["../../../src/menu-list/menu-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAuB,MAAM,uBAAuB,CAAC;AAEtE;;;GAGG;AAEH,MAAM,OAAO,QAAS,SAAQ,QAAQ;IAC1B,QAAQ;;QAChB,KAAK,CAAC,QAAQ,EAAE,CAAC;QAEjB;;;;WAIG;QACH,MAAM,qBAAqB,GAAG,MAAA,IAAI,CAAC,SAAS,0CAAE,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAE7E,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,OAAO,CAAC,CAAC,IAAiB,EAAE,KAAa,EAAE,EAAE;YAClE,MAAM,MAAM,GAAwB,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,MAAM,CAAsB,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;gBACxG,MAAM,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAsB,CAAC,CAAC;gBAEpE,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,YAAsB,CAAwB,CAAC;YACxE,CAAC,EAAE,CAAC,CAAC,CAAC;YAEN,IAAI,IAAI,YAAY,QAAQ,EAAE;gBAC5B,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;aAC/C;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,MAAM,CAAC,aAAa,CAAC,EAAe;QAC1C,MAAM,IAAI,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QACrC,MAAM,SAAS,GAAG,EAAE,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;QAEnD,IAAI,IAAI,IAAI,IAAI,KAAK,YAAY,CAAC,QAAQ,EAAE;YAC1C,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC1B;QAED,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;CACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { css } from '@microsoft/fast-element';
|
|
2
|
+
import { display } from '@microsoft/fast-foundation';
|
|
3
|
+
import { borderRadiusMedium, colorNeutralBackground1, colorTransparentStroke, shadow16, } from '../theme/design-tokens.js';
|
|
4
|
+
/** MenuList styles
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export const styles = css `
|
|
8
|
+
${display('flex')}
|
|
9
|
+
|
|
10
|
+
:host {
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
height: fit-content;
|
|
13
|
+
max-width: 300px;
|
|
14
|
+
min-width: 160px;
|
|
15
|
+
width: auto;
|
|
16
|
+
background-color: ${colorNeutralBackground1};
|
|
17
|
+
border: 1px solid ${colorTransparentStroke};
|
|
18
|
+
border-radius: ${borderRadiusMedium};
|
|
19
|
+
box-shadow: ${shadow16};
|
|
20
|
+
padding: 4px;
|
|
21
|
+
row-gap: 2px;
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
//# sourceMappingURL=menu-list.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-list.styles.js","sourceRoot":"","sources":["../../../src/menu-list/menu-list.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,sBAAsB,EACtB,QAAQ,GACT,MAAM,2BAA2B,CAAC;AAEnC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;IACrB,OAAO,CAAC,MAAM,CAAC;;;;;;;;wBAQK,uBAAuB;wBACvB,sBAAsB;qBACzB,kBAAkB;kBACrB,QAAQ;;;;CAIzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-list.template.js","sourceRoot":"","sources":["../../../src/menu-list/menu-list.template.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAG1D,MAAM,CAAC,MAAM,QAAQ,GAAkC,YAAY,EAAE,CAAC"}
|