@fluentui/web-components 3.0.0-beta.84 → 3.0.0-beta.86
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 +21 -2
- package/dist/dts/anchor-button/index.d.ts +1 -0
- package/dist/dts/index-rollup.d.ts +2 -0
- package/dist/dts/index.d.ts +7 -8
- package/dist/dts/tree/define.d.ts +1 -0
- package/dist/dts/tree/index.d.ts +5 -0
- package/dist/dts/tree/tree.base.d.ts +68 -0
- package/dist/dts/tree/tree.bench.d.ts +3 -0
- package/dist/dts/tree/tree.d.ts +28 -0
- package/dist/dts/tree/tree.definition.d.ts +8 -0
- package/dist/dts/tree/tree.styles.d.ts +1 -0
- package/dist/dts/tree/tree.template.d.ts +2 -0
- package/dist/dts/tree-item/define.d.ts +1 -0
- package/dist/dts/tree-item/index.d.ts +6 -0
- package/dist/dts/tree-item/tree-item.base.d.ts +99 -0
- package/dist/dts/tree-item/tree-item.bench.d.ts +3 -0
- package/dist/dts/tree-item/tree-item.d.ts +38 -0
- package/dist/dts/tree-item/tree-item.definition.d.ts +8 -0
- package/dist/dts/tree-item/tree-item.options.d.ts +22 -0
- package/dist/dts/tree-item/tree-item.styles.d.ts +1 -0
- package/dist/dts/tree-item/tree-item.template.d.ts +2 -0
- package/dist/esm/anchor-button/index.js +1 -0
- package/dist/esm/anchor-button/index.js.map +1 -1
- package/dist/esm/index-rollup.js +2 -0
- package/dist/esm/index-rollup.js.map +1 -1
- package/dist/esm/index.js +6 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/tree/define.js +4 -0
- package/dist/esm/tree/define.js.map +1 -0
- package/dist/esm/tree/index.js +6 -0
- package/dist/esm/tree/index.js.map +1 -0
- package/dist/esm/tree/tree.base.js +232 -0
- package/dist/esm/tree/tree.base.js.map +1 -0
- package/dist/esm/tree/tree.bench.js +10 -0
- package/dist/esm/tree/tree.bench.js.map +1 -0
- package/dist/esm/tree/tree.definition.js +16 -0
- package/dist/esm/tree/tree.definition.js.map +1 -0
- package/dist/esm/tree/tree.js +55 -0
- package/dist/esm/tree/tree.js.map +1 -0
- package/dist/esm/tree/tree.styles.js +9 -0
- package/dist/esm/tree/tree.styles.js.map +1 -0
- package/dist/esm/tree/tree.template.js +19 -0
- package/dist/esm/tree/tree.template.js.map +1 -0
- package/dist/esm/tree-item/define.js +4 -0
- package/dist/esm/tree-item/define.js.map +1 -0
- package/dist/esm/tree-item/index.js +6 -0
- package/dist/esm/tree-item/index.js.map +1 -0
- package/dist/esm/tree-item/tree-item.base.js +165 -0
- package/dist/esm/tree-item/tree-item.base.js.map +1 -0
- package/dist/esm/tree-item/tree-item.bench.js +10 -0
- package/dist/esm/tree-item/tree-item.bench.js.map +1 -0
- package/dist/esm/tree-item/tree-item.definition.js +16 -0
- package/dist/esm/tree-item/tree-item.definition.js.map +1 -0
- package/dist/esm/tree-item/tree-item.js +65 -0
- package/dist/esm/tree-item/tree-item.js.map +1 -0
- package/dist/esm/tree-item/tree-item.options.js +24 -0
- package/dist/esm/tree-item/tree-item.options.js.map +1 -0
- package/dist/esm/tree-item/tree-item.styles.js +157 -0
- package/dist/esm/tree-item/tree-item.styles.js.map +1 -0
- package/dist/esm/tree-item/tree-item.template.js +39 -0
- package/dist/esm/tree-item/tree-item.template.js.map +1 -0
- package/dist/web-components.d.ts +173 -0
- package/dist/web-components.js +1327 -800
- package/dist/web-components.min.js +291 -284
- package/package.json +1 -1
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { attr } from '@microsoft/fast-element';
|
|
3
|
+
import { TreeItemAppearance, TreeItemSize } from './tree-item.options.js';
|
|
4
|
+
import { BaseTreeItem } from './tree-item.base';
|
|
5
|
+
export class TreeItem extends BaseTreeItem {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
/**
|
|
9
|
+
* The size of the tree item element
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
this.size = TreeItemSize.small;
|
|
13
|
+
/**
|
|
14
|
+
* The size of the tree item element
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
this.appearance = TreeItemAppearance.subtle;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Handles changes to the size attribute
|
|
21
|
+
* we update the child tree items' size based on the size
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
sizeChanged() {
|
|
25
|
+
this.updateSizeAndAppearance();
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Handles changes to the appearance attribute
|
|
29
|
+
*
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
appearanceChanged() {
|
|
33
|
+
this.updateSizeAndAppearance();
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* child tree items supered change event
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
39
|
+
childTreeItemsChanged() {
|
|
40
|
+
super.childTreeItemsChanged();
|
|
41
|
+
this.updateSizeAndAppearance();
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 1. Update the child items' size based on the tree's size
|
|
45
|
+
* 2. Update the child items' appearance based on the tree's appearance
|
|
46
|
+
*
|
|
47
|
+
* @public
|
|
48
|
+
*/
|
|
49
|
+
updateSizeAndAppearance() {
|
|
50
|
+
if (!this.childTreeItems?.length) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
this.childTreeItems.forEach(item => {
|
|
54
|
+
item.size = this.size;
|
|
55
|
+
item.appearance = this.appearance;
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
__decorate([
|
|
60
|
+
attr
|
|
61
|
+
], TreeItem.prototype, "size", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
attr
|
|
64
|
+
], TreeItem.prototype, "appearance", void 0);
|
|
65
|
+
//# sourceMappingURL=tree-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-item.js","sourceRoot":"","sources":["../../../src/tree-item/tree-item.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,MAAM,OAAO,QAAS,SAAQ,YAAY;IAA1C;;QACE;;;WAGG;QAEI,SAAI,GAAiB,YAAY,CAAC,KAAK,CAAC;QAW/C;;;WAGG;QAEI,eAAU,GAAuB,kBAAkB,CAAC,MAAM,CAAC;IAoCpE,CAAC;IAlDC;;;;OAIG;IACK,WAAW;QACjB,IAAI,CAAC,uBAAuB,EAAE,CAAC;IACjC,CAAC;IASD;;;;OAIG;IACK,iBAAiB;QACvB,IAAI,CAAC,uBAAuB,EAAE,CAAC;IACjC,CAAC;IAED;;;OAGG;IACI,qBAAqB;QAC1B,KAAK,CAAC,qBAAqB,EAAE,CAAC;QAC9B,IAAI,CAAC,uBAAuB,EAAE,CAAC;IACjC,CAAC;IAED;;;;;OAKG;IACI,uBAAuB;QAC5B,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,EAAE,CAAC;YACjC,OAAO;QACT,CAAC;QAED,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAChC,IAAiB,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;YACnC,IAAiB,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAClD,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AApDQ;IADN,IAAI;sCAC0C;AAgBxC;IADN,IAAI;4CAC6D"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export const TreeItemAppearance = {
|
|
2
|
+
subtle: 'subtle',
|
|
3
|
+
subtleAlpha: 'subtle-alpha',
|
|
4
|
+
transparent: 'transparent',
|
|
5
|
+
};
|
|
6
|
+
export const TreeItemSize = {
|
|
7
|
+
small: 'small',
|
|
8
|
+
medium: 'medium',
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Predicate function that determines if the element should be considered an tree-item.
|
|
12
|
+
*
|
|
13
|
+
* @param element - The element to check.
|
|
14
|
+
* @param tagName - The tag name to check.
|
|
15
|
+
* @returns true if the element is a dropdown.
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
export function isTreeItem(element, tagName = '-tree-item') {
|
|
19
|
+
if (element?.nodeType !== Node.ELEMENT_NODE) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
return element.tagName.toLowerCase().endsWith(tagName);
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=tree-item.options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-item.options.js","sourceRoot":"","sources":["../../../src/tree-item/tree-item.options.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,MAAM,EAAE,QAAQ;IAChB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,aAAa;CAClB,CAAC;AAIX,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;CACR,CAAC;AAIX;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,OAAqB,EAAE,UAAkB,YAAY;IAC9E,IAAI,OAAO,EAAE,QAAQ,KAAK,IAAI,CAAC,YAAY,EAAE,CAAC;QAC5C,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAQ,OAAmB,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { css } from '@microsoft/fast-element';
|
|
2
|
+
import { borderRadiusMedium, colorNeutralForeground2, colorNeutralForeground2Hover, colorNeutralForeground2Pressed, colorNeutralForeground2Selected, colorNeutralForeground3Selected, colorStrokeFocus2, colorSubtleBackground, colorSubtleBackgroundHover, colorSubtleBackgroundLightAlphaHover, colorSubtleBackgroundLightAlphaPressed, colorSubtleBackgroundLightAlphaSelected, colorSubtleBackgroundPressed, colorSubtleBackgroundSelected, colorTransparentBackground, colorTransparentBackgroundHover, colorTransparentBackgroundPressed, colorTransparentBackgroundSelected, curveEasyEaseMax, durationFaster, fontSizeBase300, lineHeightBase300, spacingHorizontalM, spacingHorizontalXS, spacingHorizontalXXL, spacingHorizontalXXS, spacingVerticalNone, spacingVerticalS, spacingVerticalXXL, spacingVerticalXXS, spacingVerticalXXXL, } from '../theme/design-tokens.js';
|
|
3
|
+
import { display } from '../utils/display.js';
|
|
4
|
+
export const styles = css `
|
|
5
|
+
${display('block')}
|
|
6
|
+
|
|
7
|
+
:host {
|
|
8
|
+
outline: none;
|
|
9
|
+
font-size: ${fontSizeBase300};
|
|
10
|
+
line-height: ${lineHeightBase300};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:host(:focus-visible) .positioning-region {
|
|
14
|
+
box-shadow: ${spacingVerticalNone} ${spacingVerticalNone} ${spacingVerticalNone} ${spacingVerticalXXS}
|
|
15
|
+
${colorStrokeFocus2} inset;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Default variants:
|
|
20
|
+
* Size - medium
|
|
21
|
+
* Appearance - subtle
|
|
22
|
+
*/
|
|
23
|
+
.positioning-region {
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
justify-content: space-between;
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
height: ${spacingVerticalXXXL};
|
|
29
|
+
padding-inline-start: calc(var(--indent) * ${spacingHorizontalXXL});
|
|
30
|
+
padding-inline-end: ${spacingVerticalS};
|
|
31
|
+
border-radius: ${borderRadiusMedium};
|
|
32
|
+
background-color: ${colorSubtleBackground};
|
|
33
|
+
color: ${colorNeutralForeground2};
|
|
34
|
+
gap: ${spacingHorizontalXS};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@media (prefers-contrast: more) {
|
|
38
|
+
:host(:focus-visible) .positioning-region {
|
|
39
|
+
outline: 1px solid ${colorStrokeFocus2};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.content {
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
gap: ${spacingHorizontalXS};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.chevron {
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
flex-shrink: 0;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
width: ${spacingHorizontalXXL};
|
|
55
|
+
height: ${spacingVerticalXXL};
|
|
56
|
+
transition: transform ${durationFaster} ${curveEasyEaseMax};
|
|
57
|
+
transform: rotate(0deg);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.chevron:dir(rtl) {
|
|
61
|
+
transform: rotate(180deg);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.aside {
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.positioning-region:hover {
|
|
70
|
+
background-color: ${colorSubtleBackgroundHover};
|
|
71
|
+
color: ${colorNeutralForeground2Hover};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.positioning-region:active {
|
|
75
|
+
background-color: ${colorSubtleBackgroundPressed};
|
|
76
|
+
color: ${colorNeutralForeground2Pressed};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
::slotted([slot='start']),
|
|
80
|
+
::slotted([slot='end']),
|
|
81
|
+
::slotted(:not([slot])) {
|
|
82
|
+
display: flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
min-width: 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
::slotted([slot='start']) {
|
|
88
|
+
flex-shrink: 0;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
::slotted(:not([slot])) {
|
|
92
|
+
padding-inline: ${spacingHorizontalXXS};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.items {
|
|
96
|
+
display: none;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
:host([expanded]) .items {
|
|
100
|
+
display: block;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
:host([empty]) .chevron,
|
|
104
|
+
:host([empty]) .items {
|
|
105
|
+
visibility: hidden;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
:host([selected]) .positioning-region {
|
|
109
|
+
background-color: ${colorSubtleBackgroundSelected};
|
|
110
|
+
color: ${colorNeutralForeground2Selected};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
:host([selected]) .content,
|
|
114
|
+
:host([selected]) .chevron {
|
|
115
|
+
color: ${colorNeutralForeground3Selected};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
:host([size='small']) .positioning-region {
|
|
119
|
+
height: ${spacingVerticalXXL};
|
|
120
|
+
padding-inline-start: calc(var(--indent) * ${spacingHorizontalM});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
:host([appearance='subtle-alpha']) .positioning-region:hover {
|
|
124
|
+
background-color: ${colorSubtleBackgroundLightAlphaHover};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
:host([appearance='subtle-alpha']) .positioning-region:active {
|
|
128
|
+
background-color: ${colorSubtleBackgroundLightAlphaPressed};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
:host([appearance='subtle-alpha'][selected]) .positioning-region {
|
|
132
|
+
background-color: ${colorSubtleBackgroundLightAlphaSelected};
|
|
133
|
+
color: ${colorNeutralForeground2Selected};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
:host([appearance='transparent']) .positioning-region {
|
|
137
|
+
background-color: ${colorTransparentBackground};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
:host([appearance='transparent']) .positioning-region:hover {
|
|
141
|
+
background-color: ${colorTransparentBackgroundHover};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
:host([appearance='transparent']) .positioning-region:active {
|
|
145
|
+
background-color: ${colorTransparentBackgroundPressed};
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
:host([appearance='transparent'][selected]) .positioning-region {
|
|
149
|
+
background-color: ${colorTransparentBackgroundSelected};
|
|
150
|
+
color: ${colorNeutralForeground2Selected};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
:host([expanded]) .chevron {
|
|
154
|
+
transform: rotate(90deg);
|
|
155
|
+
}
|
|
156
|
+
`;
|
|
157
|
+
//# sourceMappingURL=tree-item.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-item.styles.js","sourceRoot":"","sources":["../../../src/tree-item/tree-item.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,4BAA4B,EAC5B,8BAA8B,EAC9B,+BAA+B,EAI/B,+BAA+B,EAC/B,iBAAiB,EACjB,qBAAqB,EACrB,0BAA0B,EAC1B,oCAAoC,EACpC,sCAAsC,EACtC,uCAAuC,EACvC,4BAA4B,EAC5B,6BAA6B,EAC7B,0BAA0B,EAC1B,+BAA+B,EAC/B,iCAAiC,EACjC,kCAAkC,EAClC,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;IACrB,OAAO,CAAC,OAAO,CAAC;;;;iBAIH,eAAe;mBACb,iBAAiB;;;;kBAIlB,mBAAmB,IAAI,mBAAmB,IAAI,mBAAmB,IAAI,kBAAkB;QACjG,iBAAiB;;;;;;;;;;;;;cAaX,mBAAmB;iDACgB,oBAAoB;0BAC3C,gBAAgB;qBACrB,kBAAkB;wBACf,qBAAqB;aAChC,uBAAuB;WACzB,mBAAmB;;;;;2BAKH,iBAAiB;;;;;;;WAOjC,mBAAmB;;;;;;;;aAQjB,oBAAoB;cACnB,kBAAkB;4BACJ,cAAc,IAAI,gBAAgB;;;;;;;;;;;;;;wBActC,0BAA0B;aACrC,4BAA4B;;;;wBAIjB,4BAA4B;aACvC,8BAA8B;;;;;;;;;;;;;;;;sBAgBrB,oBAAoB;;;;;;;;;;;;;;;;;wBAiBlB,6BAA6B;aACxC,+BAA+B;;;;;aAK/B,+BAA+B;;;;cAI9B,kBAAkB;iDACiB,kBAAkB;;;;wBAI3C,oCAAoC;;;;wBAIpC,sCAAsC;;;;wBAItC,uCAAuC;aAClD,+BAA+B;;;;wBAIpB,0BAA0B;;;;wBAI1B,+BAA+B;;;;wBAI/B,iCAAiC;;;;wBAIjC,kCAAkC;aAC7C,+BAA+B;;;;;;CAM3C,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { children, html } from '@microsoft/fast-element';
|
|
2
|
+
import { isTreeItem } from './tree-item.options';
|
|
3
|
+
const chevronIcon = html `
|
|
4
|
+
<svg width="12" height="12" xmlns="http://www.w3.org/2000/svg" fill="currentColor">
|
|
5
|
+
<path
|
|
6
|
+
d="M4.65 2.15a.5.5 0 000 .7L7.79 6 4.65 9.15a.5.5 0 10.7.7l3.5-3.5a.5.5 0 000-.7l-3.5-3.5a.5.5 0 00-.7 0z"
|
|
7
|
+
></path>
|
|
8
|
+
</svg>
|
|
9
|
+
`;
|
|
10
|
+
export const template = html `
|
|
11
|
+
<template
|
|
12
|
+
tabindex="-1"
|
|
13
|
+
slot="${x => (x.isNestedItem ? 'item' : void 0)}"
|
|
14
|
+
@focusin="${(x, c) => x.focusHandler(c.event)}"
|
|
15
|
+
@focusout="${(x, c) => x.blurHandler(c.event)}"
|
|
16
|
+
${children({
|
|
17
|
+
property: 'childTreeItems',
|
|
18
|
+
filter: node => isTreeItem(node),
|
|
19
|
+
})}
|
|
20
|
+
>
|
|
21
|
+
<div class="positioning-region" part="positioning-region">
|
|
22
|
+
<div class="content" part="content">
|
|
23
|
+
<span class="chevron" part="chevron">
|
|
24
|
+
<slot name="chevron">${chevronIcon}</slot>
|
|
25
|
+
</span>
|
|
26
|
+
<slot name="start"></slot>
|
|
27
|
+
<slot></slot>
|
|
28
|
+
<slot name="end"></slot>
|
|
29
|
+
</div>
|
|
30
|
+
<div class="aside" part="aside">
|
|
31
|
+
<slot name="aside"></slot>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
<div role="group" class="items" part="items">
|
|
35
|
+
<slot name="item"></slot>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
`;
|
|
39
|
+
//# sourceMappingURL=tree-item.template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-item.template.js","sourceRoot":"","sources":["../../../src/tree-item/tree-item.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAY,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,MAAM,WAAW,GAAG,IAAI,CAAA;;;;;;CAMvB,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAU;;;YAG1B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;gBACnC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,KAAmB,CAAC;iBAC9C,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAmB,CAAC;MACzD,QAAQ,CAAC;IACT,QAAQ,EAAE,gBAAgB;IAC1B,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC;CACjC,CAAC;;;;;iCAK2B,WAAW;;;;;;;;;;;;;;CAc3C,CAAC"}
|
package/dist/web-components.d.ts
CHANGED
|
@@ -3261,6 +3261,105 @@ export declare class BaseTextInput extends FASTElement {
|
|
|
3261
3261
|
setValidity(flags?: Partial<ValidityState>, message?: string, anchor?: HTMLElement): void;
|
|
3262
3262
|
}
|
|
3263
3263
|
|
|
3264
|
+
declare class BaseTreeItem extends FASTElement {
|
|
3265
|
+
/**
|
|
3266
|
+
* The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
|
|
3267
|
+
*
|
|
3268
|
+
* @internal
|
|
3269
|
+
*/
|
|
3270
|
+
elementInternals: ElementInternals;
|
|
3271
|
+
constructor();
|
|
3272
|
+
/**
|
|
3273
|
+
* When true, the control will be appear expanded by user interaction.
|
|
3274
|
+
* @public
|
|
3275
|
+
* HTML Attribute: `expanded`
|
|
3276
|
+
*/
|
|
3277
|
+
expanded: boolean;
|
|
3278
|
+
/**
|
|
3279
|
+
* Handles changes to the expanded attribute
|
|
3280
|
+
* @param prev - the previous state
|
|
3281
|
+
* @param next - the next state
|
|
3282
|
+
*
|
|
3283
|
+
* @public
|
|
3284
|
+
*/
|
|
3285
|
+
expandedChanged(prev: boolean, next: boolean): void;
|
|
3286
|
+
/**
|
|
3287
|
+
* When true, the control will appear selected by user interaction.
|
|
3288
|
+
* @public
|
|
3289
|
+
* @remarks
|
|
3290
|
+
* HTML Attribute: selected
|
|
3291
|
+
*/
|
|
3292
|
+
selected: boolean;
|
|
3293
|
+
/**
|
|
3294
|
+
* Handles changes to the selected attribute
|
|
3295
|
+
* @param prev - the previous state
|
|
3296
|
+
* @param next - the next state
|
|
3297
|
+
*
|
|
3298
|
+
* @internal
|
|
3299
|
+
*/
|
|
3300
|
+
protected selectedChanged(prev: boolean, next: boolean): void;
|
|
3301
|
+
/**
|
|
3302
|
+
* When true, the control has no child tree items
|
|
3303
|
+
* @public
|
|
3304
|
+
* HTML Attribute: empty
|
|
3305
|
+
*/
|
|
3306
|
+
empty: boolean;
|
|
3307
|
+
private styles;
|
|
3308
|
+
/**
|
|
3309
|
+
* The indent of the tree item element.
|
|
3310
|
+
* This is not needed once css attr() is supported (--indent: attr(data-indent type(<number>)));
|
|
3311
|
+
* @public
|
|
3312
|
+
*/
|
|
3313
|
+
dataIndent: number | undefined;
|
|
3314
|
+
private dataIndentChanged;
|
|
3315
|
+
childTreeItems: BaseTreeItem[] | undefined;
|
|
3316
|
+
/**
|
|
3317
|
+
* Handles changes to the child tree items
|
|
3318
|
+
*
|
|
3319
|
+
* @public
|
|
3320
|
+
*/
|
|
3321
|
+
childTreeItemsChanged(): void;
|
|
3322
|
+
/**
|
|
3323
|
+
* Updates the childrens indent
|
|
3324
|
+
*
|
|
3325
|
+
* @public
|
|
3326
|
+
*/
|
|
3327
|
+
updateChildTreeItems(): void;
|
|
3328
|
+
/**
|
|
3329
|
+
* Sets the indent for each item
|
|
3330
|
+
*/
|
|
3331
|
+
private setIndent;
|
|
3332
|
+
/**
|
|
3333
|
+
* Handle focus events
|
|
3334
|
+
*
|
|
3335
|
+
* @public
|
|
3336
|
+
*/
|
|
3337
|
+
focusHandler(e: FocusEvent): void;
|
|
3338
|
+
/**
|
|
3339
|
+
* Handle blur events
|
|
3340
|
+
*
|
|
3341
|
+
* @public
|
|
3342
|
+
*/
|
|
3343
|
+
blurHandler(e: FocusEvent): void;
|
|
3344
|
+
/**
|
|
3345
|
+
* Toggle the expansion state of the tree item
|
|
3346
|
+
*
|
|
3347
|
+
* @public
|
|
3348
|
+
*/
|
|
3349
|
+
toggleExpansion(): void;
|
|
3350
|
+
/**
|
|
3351
|
+
* Toggle the single selection state of the tree item
|
|
3352
|
+
*
|
|
3353
|
+
* @public
|
|
3354
|
+
*/
|
|
3355
|
+
toggleSelection(): void;
|
|
3356
|
+
/**
|
|
3357
|
+
* Whether the tree is nested
|
|
3358
|
+
* @internal
|
|
3359
|
+
*/
|
|
3360
|
+
get isNestedItem(): boolean;
|
|
3361
|
+
}
|
|
3362
|
+
|
|
3264
3363
|
/**
|
|
3265
3364
|
* CSS custom property value for the {@link @fluentui/tokens#borderRadiusCircular | `borderRadiusCircular`} design token.
|
|
3266
3365
|
* @public
|
|
@@ -7371,6 +7470,16 @@ export declare function isDropdownOption(value: Node | null, tagName?: string):
|
|
|
7371
7470
|
*/
|
|
7372
7471
|
export declare function isListbox(element?: Node | null, tagName?: string): element is Listbox;
|
|
7373
7472
|
|
|
7473
|
+
/**
|
|
7474
|
+
* Predicate function that determines if the element should be considered an tree-item.
|
|
7475
|
+
*
|
|
7476
|
+
* @param element - The element to check.
|
|
7477
|
+
* @param tagName - The tag name to check.
|
|
7478
|
+
* @returns true if the element is a dropdown.
|
|
7479
|
+
* @public
|
|
7480
|
+
*/
|
|
7481
|
+
export declare function isTreeItem(element?: Node | null, tagName?: string): element is BaseTreeItem;
|
|
7482
|
+
|
|
7374
7483
|
/**
|
|
7375
7484
|
* The base class used for constructing a fluent-label custom element
|
|
7376
7485
|
* @public
|
|
@@ -11149,6 +11258,70 @@ export declare const TooltipStyles: ElementStyles;
|
|
|
11149
11258
|
*/
|
|
11150
11259
|
export declare const TooltipTemplate: ViewTemplate<Tooltip, any>;
|
|
11151
11260
|
|
|
11261
|
+
export declare class TreeItem extends BaseTreeItem {
|
|
11262
|
+
/**
|
|
11263
|
+
* The size of the tree item element
|
|
11264
|
+
* @public
|
|
11265
|
+
*/
|
|
11266
|
+
size: TreeItemSize;
|
|
11267
|
+
/**
|
|
11268
|
+
* Handles changes to the size attribute
|
|
11269
|
+
* we update the child tree items' size based on the size
|
|
11270
|
+
* @internal
|
|
11271
|
+
*/
|
|
11272
|
+
private sizeChanged;
|
|
11273
|
+
/**
|
|
11274
|
+
* The size of the tree item element
|
|
11275
|
+
* @public
|
|
11276
|
+
*/
|
|
11277
|
+
appearance: TreeItemAppearance;
|
|
11278
|
+
/**
|
|
11279
|
+
* Handles changes to the appearance attribute
|
|
11280
|
+
*
|
|
11281
|
+
* @internal
|
|
11282
|
+
*/
|
|
11283
|
+
private appearanceChanged;
|
|
11284
|
+
/**
|
|
11285
|
+
* child tree items supered change event
|
|
11286
|
+
* @internal
|
|
11287
|
+
*/
|
|
11288
|
+
childTreeItemsChanged(): void;
|
|
11289
|
+
/**
|
|
11290
|
+
* 1. Update the child items' size based on the tree's size
|
|
11291
|
+
* 2. Update the child items' appearance based on the tree's appearance
|
|
11292
|
+
*
|
|
11293
|
+
* @public
|
|
11294
|
+
*/
|
|
11295
|
+
updateSizeAndAppearance(): void;
|
|
11296
|
+
}
|
|
11297
|
+
|
|
11298
|
+
export declare const TreeItemAppearance: {
|
|
11299
|
+
readonly subtle: "subtle";
|
|
11300
|
+
readonly subtleAlpha: "subtle-alpha";
|
|
11301
|
+
readonly transparent: "transparent";
|
|
11302
|
+
};
|
|
11303
|
+
|
|
11304
|
+
export declare type TreeItemAppearance = ValuesOf<typeof TreeItemAppearance>;
|
|
11305
|
+
|
|
11306
|
+
/**
|
|
11307
|
+
*
|
|
11308
|
+
* @public
|
|
11309
|
+
* @remarks
|
|
11310
|
+
* HTML Element: \<fluent-tree-item\>
|
|
11311
|
+
*/
|
|
11312
|
+
export declare const TreeItemDefinition: FASTElementDefinition<typeof TreeItem>;
|
|
11313
|
+
|
|
11314
|
+
export declare const TreeItemSize: {
|
|
11315
|
+
readonly small: "small";
|
|
11316
|
+
readonly medium: "medium";
|
|
11317
|
+
};
|
|
11318
|
+
|
|
11319
|
+
export declare type TreeItemSize = ValuesOf<typeof TreeItemSize>;
|
|
11320
|
+
|
|
11321
|
+
export declare const TreeItemStyles: ElementStyles;
|
|
11322
|
+
|
|
11323
|
+
export declare const TreeItemTemplate: ViewTemplate<TreeItem, any>;
|
|
11324
|
+
|
|
11152
11325
|
export declare const typographyBody1StrongerStyles: CSSDirective;
|
|
11153
11326
|
|
|
11154
11327
|
export declare const typographyBody1StrongStyles: CSSDirective;
|