@fluentui/web-components 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -2
- package/custom-elements.json +16 -16
- package/dist/esm/tree/tree.template.html +0 -1
- package/dist/esm/tree/tree.template.js +1 -2
- package/dist/esm/tree/tree.template.js.map +1 -1
- package/dist/web-components-all.js +1 -1
- package/dist/web-components-all.min.js +1 -1
- package/dist/web-components.js +1 -1
- package/dist/web-components.min.js +1 -1
- package/package.json +1 -1
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 Mon, 13 Jul 2026 04:09:41 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [3.0.2](https://github.com/microsoft/fluentui/tree/@fluentui/web-components_v3.0.2)
|
|
8
|
+
|
|
9
|
+
Mon, 13 Jul 2026 04:09:41 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/web-components_v3.0.1..@fluentui/web-components_v3.0.2)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- fix focusgroup in tree when focusgroup is natively supported ([PR #36379](https://github.com/microsoft/fluentui/pull/36379) by machi@microsoft.com)
|
|
15
|
+
|
|
7
16
|
## [3.0.1](https://github.com/microsoft/fluentui/tree/@fluentui/web-components_v3.0.1)
|
|
8
17
|
|
|
9
|
-
Tue, 07 Jul 2026 04:09:
|
|
18
|
+
Tue, 07 Jul 2026 04:09:49 GMT
|
|
10
19
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/web-components_v3.0.0..@fluentui/web-components_v3.0.1)
|
|
11
20
|
|
|
12
21
|
### Patches
|
package/custom-elements.json
CHANGED
|
@@ -28533,7 +28533,7 @@
|
|
|
28533
28533
|
},
|
|
28534
28534
|
{
|
|
28535
28535
|
"kind": "javascript-module",
|
|
28536
|
-
"path": "src/
|
|
28536
|
+
"path": "src/accordion-item/accordion-item.definition-async.ts",
|
|
28537
28537
|
"declarations": [
|
|
28538
28538
|
{
|
|
28539
28539
|
"kind": "variable",
|
|
@@ -28542,7 +28542,7 @@
|
|
|
28542
28542
|
"text": "PartialFASTElementDefinition"
|
|
28543
28543
|
},
|
|
28544
28544
|
"default": "{ name: tagName, registry: FluentDesignSystem.registry, template: declarativeTemplate(), }",
|
|
28545
|
-
"description": "The async definition configuration for the `<fluent-
|
|
28545
|
+
"description": "The async definition configuration for the `<fluent-accordion-item>` element.",
|
|
28546
28546
|
"privacy": "public"
|
|
28547
28547
|
}
|
|
28548
28548
|
],
|
|
@@ -28552,20 +28552,20 @@
|
|
|
28552
28552
|
"name": "declarativeDefinition",
|
|
28553
28553
|
"declaration": {
|
|
28554
28554
|
"name": "declarativeDefinition",
|
|
28555
|
-
"module": "src/
|
|
28555
|
+
"module": "src/accordion-item/accordion-item.definition-async.ts"
|
|
28556
28556
|
}
|
|
28557
28557
|
}
|
|
28558
28558
|
]
|
|
28559
28559
|
},
|
|
28560
28560
|
{
|
|
28561
28561
|
"kind": "javascript-module",
|
|
28562
|
-
"path": "src/
|
|
28562
|
+
"path": "src/accordion-item/define-async.ts",
|
|
28563
28563
|
"declarations": [],
|
|
28564
28564
|
"exports": []
|
|
28565
28565
|
},
|
|
28566
28566
|
{
|
|
28567
28567
|
"kind": "javascript-module",
|
|
28568
|
-
"path": "src/
|
|
28568
|
+
"path": "src/badge/badge.definition-async.ts",
|
|
28569
28569
|
"declarations": [
|
|
28570
28570
|
{
|
|
28571
28571
|
"kind": "variable",
|
|
@@ -28574,7 +28574,7 @@
|
|
|
28574
28574
|
"text": "PartialFASTElementDefinition"
|
|
28575
28575
|
},
|
|
28576
28576
|
"default": "{ name: tagName, registry: FluentDesignSystem.registry, template: declarativeTemplate(), }",
|
|
28577
|
-
"description": "The async definition configuration for the `<fluent-
|
|
28577
|
+
"description": "The async definition configuration for the `<fluent-badge>` element.",
|
|
28578
28578
|
"privacy": "public"
|
|
28579
28579
|
}
|
|
28580
28580
|
],
|
|
@@ -28584,20 +28584,20 @@
|
|
|
28584
28584
|
"name": "declarativeDefinition",
|
|
28585
28585
|
"declaration": {
|
|
28586
28586
|
"name": "declarativeDefinition",
|
|
28587
|
-
"module": "src/
|
|
28587
|
+
"module": "src/badge/badge.definition-async.ts"
|
|
28588
28588
|
}
|
|
28589
28589
|
}
|
|
28590
28590
|
]
|
|
28591
28591
|
},
|
|
28592
28592
|
{
|
|
28593
28593
|
"kind": "javascript-module",
|
|
28594
|
-
"path": "src/
|
|
28594
|
+
"path": "src/badge/define-async.ts",
|
|
28595
28595
|
"declarations": [],
|
|
28596
28596
|
"exports": []
|
|
28597
28597
|
},
|
|
28598
28598
|
{
|
|
28599
28599
|
"kind": "javascript-module",
|
|
28600
|
-
"path": "src/
|
|
28600
|
+
"path": "src/avatar/avatar.definition-async.ts",
|
|
28601
28601
|
"declarations": [
|
|
28602
28602
|
{
|
|
28603
28603
|
"kind": "variable",
|
|
@@ -28606,7 +28606,7 @@
|
|
|
28606
28606
|
"text": "PartialFASTElementDefinition"
|
|
28607
28607
|
},
|
|
28608
28608
|
"default": "{ name: tagName, registry: FluentDesignSystem.registry, template: declarativeTemplate(), }",
|
|
28609
|
-
"description": "The async definition configuration for the `<fluent-
|
|
28609
|
+
"description": "The async definition configuration for the `<fluent-avatar>` element.",
|
|
28610
28610
|
"privacy": "public"
|
|
28611
28611
|
}
|
|
28612
28612
|
],
|
|
@@ -28616,20 +28616,20 @@
|
|
|
28616
28616
|
"name": "declarativeDefinition",
|
|
28617
28617
|
"declaration": {
|
|
28618
28618
|
"name": "declarativeDefinition",
|
|
28619
|
-
"module": "src/
|
|
28619
|
+
"module": "src/avatar/avatar.definition-async.ts"
|
|
28620
28620
|
}
|
|
28621
28621
|
}
|
|
28622
28622
|
]
|
|
28623
28623
|
},
|
|
28624
28624
|
{
|
|
28625
28625
|
"kind": "javascript-module",
|
|
28626
|
-
"path": "src/
|
|
28626
|
+
"path": "src/avatar/define-async.ts",
|
|
28627
28627
|
"declarations": [],
|
|
28628
28628
|
"exports": []
|
|
28629
28629
|
},
|
|
28630
28630
|
{
|
|
28631
28631
|
"kind": "javascript-module",
|
|
28632
|
-
"path": "src/
|
|
28632
|
+
"path": "src/button/button.definition-async.ts",
|
|
28633
28633
|
"declarations": [
|
|
28634
28634
|
{
|
|
28635
28635
|
"kind": "variable",
|
|
@@ -28638,7 +28638,7 @@
|
|
|
28638
28638
|
"text": "PartialFASTElementDefinition"
|
|
28639
28639
|
},
|
|
28640
28640
|
"default": "{ name: tagName, registry: FluentDesignSystem.registry, template: declarativeTemplate(), }",
|
|
28641
|
-
"description": "The async definition configuration for the `<fluent-
|
|
28641
|
+
"description": "The async definition configuration for the `<fluent-button>` element.",
|
|
28642
28642
|
"privacy": "public"
|
|
28643
28643
|
}
|
|
28644
28644
|
],
|
|
@@ -28648,14 +28648,14 @@
|
|
|
28648
28648
|
"name": "declarativeDefinition",
|
|
28649
28649
|
"declaration": {
|
|
28650
28650
|
"name": "declarativeDefinition",
|
|
28651
|
-
"module": "src/
|
|
28651
|
+
"module": "src/button/button.definition-async.ts"
|
|
28652
28652
|
}
|
|
28653
28653
|
}
|
|
28654
28654
|
]
|
|
28655
28655
|
},
|
|
28656
28656
|
{
|
|
28657
28657
|
"kind": "javascript-module",
|
|
28658
|
-
"path": "src/
|
|
28658
|
+
"path": "src/button/define-async.ts",
|
|
28659
28659
|
"declarations": [],
|
|
28660
28660
|
"exports": []
|
|
28661
28661
|
},
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { html, ref } from '@microsoft/fast-element';
|
|
2
2
|
export const template = html `
|
|
3
3
|
<template
|
|
4
|
-
tabindex="0"
|
|
5
4
|
focusgroup="menu inline block nowrap nomemory"
|
|
6
5
|
@click="${(x, c) => x.clickHandler(c.event)}"
|
|
7
6
|
@keydown="${(x, c) => x.keydownHandler(c.event)}"
|
|
8
7
|
@change="${(x, c) => x.changeHandler(c.event)}"
|
|
9
|
-
@toggle="${
|
|
8
|
+
@toggle="${x => x.itemToggleHandler()}"
|
|
10
9
|
>
|
|
11
10
|
<slot ${ref('defaultSlot')} @slotchange="${x => x.handleDefaultSlotChange()}"></slot>
|
|
12
11
|
</template>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.template.js","sourceRoot":"","sources":["../../../src/tree/tree.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAGpD,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAM
|
|
1
|
+
{"version":3,"file":"tree.template.js","sourceRoot":"","sources":["../../../src/tree/tree.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAGpD,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAM;;;cAGpB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC;gBAC/B,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,KAAsB,CAAC;eACrD,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC;eAClC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,iBAAiB,EAAE;;YAE7B,GAAG,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,uBAAuB,EAAE;;CAE9E,CAAC"}
|
|
@@ -14381,7 +14381,7 @@ const tagName$1 = `${FluentDesignSystem.prefix}-tree`;
|
|
|
14381
14381
|
|
|
14382
14382
|
const styles$1 = css`${display("block")} :host{outline:none}`;
|
|
14383
14383
|
|
|
14384
|
-
const template$1 = html`<template
|
|
14384
|
+
const template$1 = html`<template focusgroup="menu inline block nowrap nomemory" @click=${(x, c) => x.clickHandler(c.event)} @keydown=${(x, c) => x.keydownHandler(c.event)} @change=${(x, c) => x.changeHandler(c.event)} @toggle=${(x) => x.itemToggleHandler()}><slot ${ref("defaultSlot")} @slotchange=${(x) => x.handleDefaultSlotChange()}></slot></template>`;
|
|
14385
14385
|
|
|
14386
14386
|
const definition$1 = {
|
|
14387
14387
|
name: tagName$1,
|
|
@@ -26,7 +26,7 @@ const h=Object.freeze({prefix:"fluent",shadowRootMode:"open",registry:globalThis
|
|
|
26
26
|
${i}
|
|
27
27
|
${l}
|
|
28
28
|
}
|
|
29
|
-
`,window.CSS_ANCHOR_POLYFILL&&(await window.CSS_ANCHOR_POLYFILL({elements:[this.anchorPositioningStyleElement]}),this.anchorPositioningReady=!0)}}kn([a],ko.prototype,"id",2),kn([a({converter:ie})],ko.prototype,"delay",2),kn([a],ko.prototype,"positioning",2),kn([a],ko.prototype,"anchor",2),ko.define(xu);const vx=`${h.prefix}-tree`,wu=p`${x("block")} :host{outline:none}`,Su=b`<template tabindex=0 focusgroup="menu inline block nowrap nomemory" @click=${(o,e)=>o.clickHandler(e.event)} @keydown=${(o,e)=>o.keydownHandler(e.event)} @change=${(o,e)=>o.changeHandler(e.event)} @toggle=${(o,e)=>o.itemToggleHandler()}><slot ${A("defaultSlot")} @slotchange=${o=>o.handleDefaultSlotChange()}></slot></template>`,Cu={name:vx,registry:h.registry,styles:wu,template:Su},Bu={subtle:"subtle",subtleAlpha:"subtle-alpha",transparent:"transparent"},Pu={small:"small",medium:"medium"};function De(o,e="-tree-item"){return o?.nodeType!==Node.ELEMENT_NODE?!1:o.tagName.toLowerCase().endsWith(e)}const yx=`${h.prefix}-tree-item`;var $x=Object.defineProperty,kx=Object.getOwnPropertyDescriptor,ss=(o,e,t,r)=>{for(var n=r>1?void 0:r?kx(e,t):e,i=o.length-1,s;i>=0;i--)(s=o[i])&&(n=(r?s(e,t,n):s(n))||n);return r&&n&&$x(e,t,n),n};class $r extends k{constructor(){super(),this.currentSelected=null,this.elementInternals=this.attachInternals(),this.elementInternals.role="tree"}defaultSlotChanged(){this.handleDefaultSlotChange()}childTreeItemsChanged(){this.updateCurrentSelected()}updateCurrentSelected(){const e=this.querySelector("[selected]");this.currentSelected=e}keydownHandler(e){if(e.defaultPrevented)return;const t=e.target;if(!De(t)||this.childTreeItems.length<1)return!0;switch(e.key){case"ArrowLeft":{t?.childTreeItems?.length&&t.expanded?t.expanded=!1:De(t.parentElement)&&t.parentElement.focus();return}case"ArrowRight":{if(t?.childTreeItems?.length)if(!t.expanded)t.expanded=!0;else return!0;return}case"Enter":{this.clickHandler(e);return}case" ":{t.selected=!0;return}}return!0}clickHandler(e){if(e.defaultPrevented)return;if(!De(e.target))return!0;const t=e.target;t.toggleExpansion(),t.selected=!0}changeHandler(e){if(e.defaultPrevented)return;if(!De(e.target))return!0;const t=e.target;t.selected?(this.currentSelected&&this.currentSelected!==t&&De(this.currentSelected)&&(this.currentSelected.selected=!1),this.currentSelected=t):!t.selected&&this.currentSelected===t&&(this.currentSelected=null)}handleDefaultSlotChange(){this.childTreeItems=this.defaultSlot.assignedElements().filter(e=>De(e))}get descendantTreeItems(){const e=[],t=r=>{if(r)for(const n of r)e.push(n),t(n.childTreeItems)};return t(this.childTreeItems),e}}ss([g],$r.prototype,"currentSelected",2),ss([g],$r.prototype,"defaultSlot",2),ss([g],$r.prototype,"childTreeItems",2);var xx=Object.defineProperty,wx=Object.getOwnPropertyDescriptor,Iu=(o,e,t,r)=>{for(var n=r>1?void 0:r?wx(e,t):e,i=o.length-1,s;i>=0;i--)(s=o[i])&&(n=(r?s(e,t,n):s(n))||n);return r&&n&&xx(e,t,n),n};class xn extends $r{constructor(){super(...arguments),this.size=Pu.small,this.appearance=Bu.subtle}sizeChanged(){this.updateSizeAndAppearance()}appearanceChanged(){this.updateSizeAndAppearance()}childTreeItemsChanged(){super.childTreeItemsChanged(),this.updateSizeAndAppearance(),this.fgItems??(this.fgItems=new un(()=>this.descendantTreeItems.filter(e=>!e.isHidden),()=>this.currentSelected??null)),this.fg?this.fg.update():this.fg=new hn(this,this.fgItems,{definition:{behavior:"menu",axis:void 0,memory:!1}})}disconnectedCallback(){this.fg?.disconnect(),super.disconnectedCallback()}updateSizeAndAppearance(){this.childTreeItems?.length&&this.childTreeItems.forEach(e=>{e.size=this.size,e.appearance=this.appearance})}itemToggleHandler(){this.fg?.update()}}Iu([a],xn.prototype,"size",2),Iu([a],xn.prototype,"appearance",2),xn.define(Cu);const Au=p`${x("block")} :host{outline:none;font-size:${z};line-height:${D}}:host(:focus-visible) .positioning-region{box-shadow:${qr} ${qr} ${qr} ${Uo} ${se} inset}.positioning-region{display:flex;align-items:center;justify-content:space-between;cursor:pointer;height:${ac};padding-inline-start:calc(var(--indent) * ${Xo});padding-inline-end:${te};border-radius:${S};background-color:${Qn};color:${Ae};gap:${Q}}@media (prefers-contrast:more){:host(:focus-visible) .positioning-region{outline:1px solid ${se}}}.content{display:flex;align-items:center;gap:${Q}}.chevron{display:flex;align-items:center;flex-shrink:0;justify-content:center;width:${Xo};height:${bt};transition:transform ${Yo} ${Fi};transform:rotate(0deg)}.chevron:dir(rtl){transform:rotate(180deg)}.chevron svg{inline-size:12px;block-size:12px}.aside{display:flex;align-items:center}.positioning-region:hover{background-color:${Do};color:${_t}}.positioning-region:active{background-color:${ro};color:${Ot}}::slotted([slot='start']),::slotted([slot='end']),::slotted(:not([slot])){display:flex;align-items:center;min-width:0}::slotted([slot='start']){flex-shrink:0}::slotted(:not([slot])){padding-inline:${H}}.items{display:none}:host([expanded]) .items{display:block}:host([empty]) .chevron,:host([empty]) .items{visibility:hidden}:host([selected]) .positioning-region{background-color:${ei};color:${zo}}:host([selected]) .content,:host([selected]) .chevron{color:${ga}}:host([size='small']) .positioning-region{height:${bt};padding-inline-start:calc(var(--indent) * ${ee})}:host([appearance='subtle-alpha']) .positioning-region:hover{background-color:${Aa}}:host([appearance='subtle-alpha']) .positioning-region:active{background-color:${Na}}:host([appearance='subtle-alpha'][selected]) .positioning-region{background-color:${Ta};color:${zo}}:host([appearance='transparent']) .positioning-region{background-color:${ce}}:host([appearance='transparent']) .positioning-region:hover{background-color:${Lo}}:host([appearance='transparent']) .positioning-region:active{background-color:${Mo}}:host([appearance='transparent'][selected]) .positioning-region{background-color:${ti};color:${zo}}:host([expanded]) .chevron{transform:rotate(90deg)}`,Sx=b`<svg viewBox="0 0 12 12" fill=currentColor><path 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"></path></svg>`,Nu=b`<template tabindex=0 ?focusgroupstart=${o=>o.selected}><div class=positioning-region part=positioning-region><div class=content part=content><span class=chevron part=chevron aria-hidden=true><slot name=chevron>${Sx}</slot></span><slot name=start></slot><slot></slot><slot name=end></slot></div><div class=aside part=aside><slot name=aside></slot></div></div><div role=group class=items part=items><slot name=item ${A("itemSlot")} @slotchange=${o=>o.handleItemSlotChange()}></slot></div></template>`,Tu={name:yx,registry:h.registry,styles:Au,template:Nu};var Cx=Object.defineProperty,Bx=Object.getOwnPropertyDescriptor,xo=(o,e,t,r)=>{for(var n=r>1?void 0:r?Bx(e,t):e,i=o.length-1,s;i>=0;i--)(s=o[i])&&(n=(r?s(e,t,n):s(n))||n);return r&&n&&Cx(e,t,n),n};class Zt extends k{constructor(){super(),this.elementInternals=this.attachInternals(),this.expanded=!1,this.empty=!1,this.childTreeItems=[],this.elementInternals.role="treeitem"}itemSlotChanged(){this.handleItemSlotChange()}connectedCallback(){super.connectedCallback(),this.tabIndex=Number(this.getAttribute("tabindex")||"0"),De(this.parentElement)&&(this.slot||(this.slot="item")),at(this)}expandedChanged(e,t){this.$emit("toggle",{oldState:e?"open":"closed",newState:t?"open":"closed"}),y(this.elementInternals,"expanded",t),this.childTreeItems?.length&&(this.elementInternals.ariaExpanded=t?"true":"false",requestAnimationFrame(()=>{const r=document.createTreeWalker(this,NodeFilter.SHOW_ELEMENT,n=>De(n)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP);for(;r.nextNode();){const n=r.currentNode;t?n.removeAttribute("focusgroup"):(n.selected&&(n.selected=!1),n.setAttribute("focusgroup","none"))}}))}selectedChanged(e,t){this.$emit("change"),this.elementInternals&&(y(this.elementInternals,"selected",t),this.elementInternals.ariaSelected=t?"true":"false")}dataIndentChanged(e,t){this.styles!==void 0&&this.$fastController.removeStyles(this.styles),this.styles=p`:host{--indent:${t}}`,this.$fastController.addStyles(this.styles)}childTreeItemsChanged(){this.empty=this.childTreeItems?.length===0,this.updateChildTreeItems()}updateChildTreeItems(){this.childTreeItems?.length&&(this.expanded||(this.expanded=Array.from(this.querySelectorAll("[selected]")).some(e=>De(e))),this.childTreeItems.forEach(e=>{this.setIndent(e)}))}setIndent(e){const t=this.dataIndent??0;e.dataIndent=t+1}toggleExpansion(){this.childTreeItems?.length&&(this.expanded=!this.expanded)}get isNestedItem(){return De(this.parentElement)}get isHidden(){let e=this.parentElement;for(;De(e);){if(!e.expanded)return!0;e=e.parentElement}return!1}handleItemSlotChange(){this.childTreeItems=this.itemSlot.assignedElements().filter(e=>De(e))}}xo([g],Zt.prototype,"itemSlot",2),xo([a({mode:"boolean"})],Zt.prototype,"expanded",2),xo([a({mode:"boolean"})],Zt.prototype,"selected",2),xo([a({mode:"boolean"})],Zt.prototype,"empty",2),xo([a({attribute:"data-indent"})],Zt.prototype,"dataIndent",2),xo([g],Zt.prototype,"childTreeItems",2);var Px=Object.defineProperty,Ix=Object.getOwnPropertyDescriptor,zu=(o,e,t,r)=>{for(var n=r>1?void 0:r?Ix(e,t):e,i=o.length-1,s;i>=0;i--)(s=o[i])&&(n=(r?s(e,t,n):s(n))||n);return r&&n&&Px(e,t,n),n};class wn extends Zt{constructor(){super(...arguments),this.size=Pu.small,this.appearance=Bu.subtle}sizeChanged(){this.updateSizeAndAppearance()}appearanceChanged(){this.updateSizeAndAppearance()}childTreeItemsChanged(){super.childTreeItemsChanged(),this.updateSizeAndAppearance()}updateSizeAndAppearance(){this.childTreeItems?.length&&this.childTreeItems.forEach(e=>{e.size=this.size,e.appearance=this.appearance})}}zu([a],wn.prototype,"size",2),zu([a],wn.prototype,"appearance",2),wn.define(Tu);const Ax="adoptedStyleSheets"in document,Nx="CSSScopeRule"in window,as=new Map,ls=new Map,kr=new Map,cs=new Map,xr=new CSSStyleSheet;function _u(o,e=document){if(!(!e||!Tx(e))){if(!Ax||e instanceof HTMLElement&&!e.shadowRoot&&!Nx){const t=e===document?document.documentElement:e;Ex(o,t);return}[document,document.documentElement,document.body].includes(e)?zx(o):_x(o,e)}}function ds(o){if(!as.has(o)){const e=[];for(const[t,r]of Object.entries(o))e.push(`--${t}:${r.toString()};`);as.set(o,e.join(""))}return as.get(o)}function Tx(o){return[document,document.documentElement].includes(o)||o instanceof HTMLElement&&!!o.closest("body")}function zx(o){if(o===null){document.adoptedStyleSheets.includes(xr)&&xr.replaceSync("");return}xr.replaceSync(`
|
|
29
|
+
`,window.CSS_ANCHOR_POLYFILL&&(await window.CSS_ANCHOR_POLYFILL({elements:[this.anchorPositioningStyleElement]}),this.anchorPositioningReady=!0)}}kn([a],ko.prototype,"id",2),kn([a({converter:ie})],ko.prototype,"delay",2),kn([a],ko.prototype,"positioning",2),kn([a],ko.prototype,"anchor",2),ko.define(xu);const vx=`${h.prefix}-tree`,wu=p`${x("block")} :host{outline:none}`,Su=b`<template focusgroup="menu inline block nowrap nomemory" @click=${(o,e)=>o.clickHandler(e.event)} @keydown=${(o,e)=>o.keydownHandler(e.event)} @change=${(o,e)=>o.changeHandler(e.event)} @toggle=${o=>o.itemToggleHandler()}><slot ${A("defaultSlot")} @slotchange=${o=>o.handleDefaultSlotChange()}></slot></template>`,Cu={name:vx,registry:h.registry,styles:wu,template:Su},Bu={subtle:"subtle",subtleAlpha:"subtle-alpha",transparent:"transparent"},Pu={small:"small",medium:"medium"};function De(o,e="-tree-item"){return o?.nodeType!==Node.ELEMENT_NODE?!1:o.tagName.toLowerCase().endsWith(e)}const yx=`${h.prefix}-tree-item`;var $x=Object.defineProperty,kx=Object.getOwnPropertyDescriptor,ss=(o,e,t,r)=>{for(var n=r>1?void 0:r?kx(e,t):e,i=o.length-1,s;i>=0;i--)(s=o[i])&&(n=(r?s(e,t,n):s(n))||n);return r&&n&&$x(e,t,n),n};class $r extends k{constructor(){super(),this.currentSelected=null,this.elementInternals=this.attachInternals(),this.elementInternals.role="tree"}defaultSlotChanged(){this.handleDefaultSlotChange()}childTreeItemsChanged(){this.updateCurrentSelected()}updateCurrentSelected(){const e=this.querySelector("[selected]");this.currentSelected=e}keydownHandler(e){if(e.defaultPrevented)return;const t=e.target;if(!De(t)||this.childTreeItems.length<1)return!0;switch(e.key){case"ArrowLeft":{t?.childTreeItems?.length&&t.expanded?t.expanded=!1:De(t.parentElement)&&t.parentElement.focus();return}case"ArrowRight":{if(t?.childTreeItems?.length)if(!t.expanded)t.expanded=!0;else return!0;return}case"Enter":{this.clickHandler(e);return}case" ":{t.selected=!0;return}}return!0}clickHandler(e){if(e.defaultPrevented)return;if(!De(e.target))return!0;const t=e.target;t.toggleExpansion(),t.selected=!0}changeHandler(e){if(e.defaultPrevented)return;if(!De(e.target))return!0;const t=e.target;t.selected?(this.currentSelected&&this.currentSelected!==t&&De(this.currentSelected)&&(this.currentSelected.selected=!1),this.currentSelected=t):!t.selected&&this.currentSelected===t&&(this.currentSelected=null)}handleDefaultSlotChange(){this.childTreeItems=this.defaultSlot.assignedElements().filter(e=>De(e))}get descendantTreeItems(){const e=[],t=r=>{if(r)for(const n of r)e.push(n),t(n.childTreeItems)};return t(this.childTreeItems),e}}ss([g],$r.prototype,"currentSelected",2),ss([g],$r.prototype,"defaultSlot",2),ss([g],$r.prototype,"childTreeItems",2);var xx=Object.defineProperty,wx=Object.getOwnPropertyDescriptor,Iu=(o,e,t,r)=>{for(var n=r>1?void 0:r?wx(e,t):e,i=o.length-1,s;i>=0;i--)(s=o[i])&&(n=(r?s(e,t,n):s(n))||n);return r&&n&&xx(e,t,n),n};class xn extends $r{constructor(){super(...arguments),this.size=Pu.small,this.appearance=Bu.subtle}sizeChanged(){this.updateSizeAndAppearance()}appearanceChanged(){this.updateSizeAndAppearance()}childTreeItemsChanged(){super.childTreeItemsChanged(),this.updateSizeAndAppearance(),this.fgItems??(this.fgItems=new un(()=>this.descendantTreeItems.filter(e=>!e.isHidden),()=>this.currentSelected??null)),this.fg?this.fg.update():this.fg=new hn(this,this.fgItems,{definition:{behavior:"menu",axis:void 0,memory:!1}})}disconnectedCallback(){this.fg?.disconnect(),super.disconnectedCallback()}updateSizeAndAppearance(){this.childTreeItems?.length&&this.childTreeItems.forEach(e=>{e.size=this.size,e.appearance=this.appearance})}itemToggleHandler(){this.fg?.update()}}Iu([a],xn.prototype,"size",2),Iu([a],xn.prototype,"appearance",2),xn.define(Cu);const Au=p`${x("block")} :host{outline:none;font-size:${z};line-height:${D}}:host(:focus-visible) .positioning-region{box-shadow:${qr} ${qr} ${qr} ${Uo} ${se} inset}.positioning-region{display:flex;align-items:center;justify-content:space-between;cursor:pointer;height:${ac};padding-inline-start:calc(var(--indent) * ${Xo});padding-inline-end:${te};border-radius:${S};background-color:${Qn};color:${Ae};gap:${Q}}@media (prefers-contrast:more){:host(:focus-visible) .positioning-region{outline:1px solid ${se}}}.content{display:flex;align-items:center;gap:${Q}}.chevron{display:flex;align-items:center;flex-shrink:0;justify-content:center;width:${Xo};height:${bt};transition:transform ${Yo} ${Fi};transform:rotate(0deg)}.chevron:dir(rtl){transform:rotate(180deg)}.chevron svg{inline-size:12px;block-size:12px}.aside{display:flex;align-items:center}.positioning-region:hover{background-color:${Do};color:${_t}}.positioning-region:active{background-color:${ro};color:${Ot}}::slotted([slot='start']),::slotted([slot='end']),::slotted(:not([slot])){display:flex;align-items:center;min-width:0}::slotted([slot='start']){flex-shrink:0}::slotted(:not([slot])){padding-inline:${H}}.items{display:none}:host([expanded]) .items{display:block}:host([empty]) .chevron,:host([empty]) .items{visibility:hidden}:host([selected]) .positioning-region{background-color:${ei};color:${zo}}:host([selected]) .content,:host([selected]) .chevron{color:${ga}}:host([size='small']) .positioning-region{height:${bt};padding-inline-start:calc(var(--indent) * ${ee})}:host([appearance='subtle-alpha']) .positioning-region:hover{background-color:${Aa}}:host([appearance='subtle-alpha']) .positioning-region:active{background-color:${Na}}:host([appearance='subtle-alpha'][selected]) .positioning-region{background-color:${Ta};color:${zo}}:host([appearance='transparent']) .positioning-region{background-color:${ce}}:host([appearance='transparent']) .positioning-region:hover{background-color:${Lo}}:host([appearance='transparent']) .positioning-region:active{background-color:${Mo}}:host([appearance='transparent'][selected]) .positioning-region{background-color:${ti};color:${zo}}:host([expanded]) .chevron{transform:rotate(90deg)}`,Sx=b`<svg viewBox="0 0 12 12" fill=currentColor><path 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"></path></svg>`,Nu=b`<template tabindex=0 ?focusgroupstart=${o=>o.selected}><div class=positioning-region part=positioning-region><div class=content part=content><span class=chevron part=chevron aria-hidden=true><slot name=chevron>${Sx}</slot></span><slot name=start></slot><slot></slot><slot name=end></slot></div><div class=aside part=aside><slot name=aside></slot></div></div><div role=group class=items part=items><slot name=item ${A("itemSlot")} @slotchange=${o=>o.handleItemSlotChange()}></slot></div></template>`,Tu={name:yx,registry:h.registry,styles:Au,template:Nu};var Cx=Object.defineProperty,Bx=Object.getOwnPropertyDescriptor,xo=(o,e,t,r)=>{for(var n=r>1?void 0:r?Bx(e,t):e,i=o.length-1,s;i>=0;i--)(s=o[i])&&(n=(r?s(e,t,n):s(n))||n);return r&&n&&Cx(e,t,n),n};class Zt extends k{constructor(){super(),this.elementInternals=this.attachInternals(),this.expanded=!1,this.empty=!1,this.childTreeItems=[],this.elementInternals.role="treeitem"}itemSlotChanged(){this.handleItemSlotChange()}connectedCallback(){super.connectedCallback(),this.tabIndex=Number(this.getAttribute("tabindex")||"0"),De(this.parentElement)&&(this.slot||(this.slot="item")),at(this)}expandedChanged(e,t){this.$emit("toggle",{oldState:e?"open":"closed",newState:t?"open":"closed"}),y(this.elementInternals,"expanded",t),this.childTreeItems?.length&&(this.elementInternals.ariaExpanded=t?"true":"false",requestAnimationFrame(()=>{const r=document.createTreeWalker(this,NodeFilter.SHOW_ELEMENT,n=>De(n)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP);for(;r.nextNode();){const n=r.currentNode;t?n.removeAttribute("focusgroup"):(n.selected&&(n.selected=!1),n.setAttribute("focusgroup","none"))}}))}selectedChanged(e,t){this.$emit("change"),this.elementInternals&&(y(this.elementInternals,"selected",t),this.elementInternals.ariaSelected=t?"true":"false")}dataIndentChanged(e,t){this.styles!==void 0&&this.$fastController.removeStyles(this.styles),this.styles=p`:host{--indent:${t}}`,this.$fastController.addStyles(this.styles)}childTreeItemsChanged(){this.empty=this.childTreeItems?.length===0,this.updateChildTreeItems()}updateChildTreeItems(){this.childTreeItems?.length&&(this.expanded||(this.expanded=Array.from(this.querySelectorAll("[selected]")).some(e=>De(e))),this.childTreeItems.forEach(e=>{this.setIndent(e)}))}setIndent(e){const t=this.dataIndent??0;e.dataIndent=t+1}toggleExpansion(){this.childTreeItems?.length&&(this.expanded=!this.expanded)}get isNestedItem(){return De(this.parentElement)}get isHidden(){let e=this.parentElement;for(;De(e);){if(!e.expanded)return!0;e=e.parentElement}return!1}handleItemSlotChange(){this.childTreeItems=this.itemSlot.assignedElements().filter(e=>De(e))}}xo([g],Zt.prototype,"itemSlot",2),xo([a({mode:"boolean"})],Zt.prototype,"expanded",2),xo([a({mode:"boolean"})],Zt.prototype,"selected",2),xo([a({mode:"boolean"})],Zt.prototype,"empty",2),xo([a({attribute:"data-indent"})],Zt.prototype,"dataIndent",2),xo([g],Zt.prototype,"childTreeItems",2);var Px=Object.defineProperty,Ix=Object.getOwnPropertyDescriptor,zu=(o,e,t,r)=>{for(var n=r>1?void 0:r?Ix(e,t):e,i=o.length-1,s;i>=0;i--)(s=o[i])&&(n=(r?s(e,t,n):s(n))||n);return r&&n&&Px(e,t,n),n};class wn extends Zt{constructor(){super(...arguments),this.size=Pu.small,this.appearance=Bu.subtle}sizeChanged(){this.updateSizeAndAppearance()}appearanceChanged(){this.updateSizeAndAppearance()}childTreeItemsChanged(){super.childTreeItemsChanged(),this.updateSizeAndAppearance()}updateSizeAndAppearance(){this.childTreeItems?.length&&this.childTreeItems.forEach(e=>{e.size=this.size,e.appearance=this.appearance})}}zu([a],wn.prototype,"size",2),zu([a],wn.prototype,"appearance",2),wn.define(Tu);const Ax="adoptedStyleSheets"in document,Nx="CSSScopeRule"in window,as=new Map,ls=new Map,kr=new Map,cs=new Map,xr=new CSSStyleSheet;function _u(o,e=document){if(!(!e||!Tx(e))){if(!Ax||e instanceof HTMLElement&&!e.shadowRoot&&!Nx){const t=e===document?document.documentElement:e;Ex(o,t);return}[document,document.documentElement,document.body].includes(e)?zx(o):_x(o,e)}}function ds(o){if(!as.has(o)){const e=[];for(const[t,r]of Object.entries(o))e.push(`--${t}:${r.toString()};`);as.set(o,e.join(""))}return as.get(o)}function Tx(o){return[document,document.documentElement].includes(o)||o instanceof HTMLElement&&!!o.closest("body")}function zx(o){if(o===null){document.adoptedStyleSheets.includes(xr)&&xr.replaceSync("");return}xr.replaceSync(`
|
|
30
30
|
html {
|
|
31
31
|
${ds(o)}
|
|
32
32
|
}
|
package/dist/web-components.js
CHANGED
|
@@ -13895,7 +13895,7 @@ const tagName$1 = `${FluentDesignSystem.prefix}-tree`;
|
|
|
13895
13895
|
|
|
13896
13896
|
const styles$1 = css`${display("block")} :host{outline:none}`;
|
|
13897
13897
|
|
|
13898
|
-
const template$1 = html`<template
|
|
13898
|
+
const template$1 = html`<template focusgroup="menu inline block nowrap nomemory" @click=${(x, c) => x.clickHandler(c.event)} @keydown=${(x, c) => x.keydownHandler(c.event)} @change=${(x, c) => x.changeHandler(c.event)} @toggle=${(x) => x.itemToggleHandler()}><slot ${ref("defaultSlot")} @slotchange=${(x) => x.handleDefaultSlotChange()}></slot></template>`;
|
|
13899
13899
|
|
|
13900
13900
|
const definition$1 = {
|
|
13901
13901
|
name: tagName$1,
|
|
@@ -26,7 +26,7 @@ const h=Object.freeze({prefix:"fluent",shadowRootMode:"open",registry:globalThis
|
|
|
26
26
|
${n}
|
|
27
27
|
${l}
|
|
28
28
|
}
|
|
29
|
-
`,window.CSS_ANCHOR_POLYFILL&&(await window.CSS_ANCHOR_POLYFILL({elements:[this.anchorPositioningStyleElement]}),this.anchorPositioningReady=!0)}}Rr([a],Do.prototype,"id",2),Rr([a({converter:te})],Do.prototype,"delay",2),Rr([a],Do.prototype,"positioning",2),Rr([a],Do.prototype,"anchor",2),Do.define(Hm);const jm=`${h.prefix}-tree`,qm=p`${w("block")} :host{outline:none}`,Wm=b`<template tabindex=0 focusgroup="menu inline block nowrap nomemory" @click=${(o,e)=>o.clickHandler(e.event)} @keydown=${(o,e)=>o.keydownHandler(e.event)} @change=${(o,e)=>o.changeHandler(e.event)} @toggle=${(o,e)=>o.itemToggleHandler()}><slot ${z("defaultSlot")} @slotchange=${o=>o.handleDefaultSlotChange()}></slot></template>`,Um={name:jm,registry:h.registry,styles:qm,template:Wm},_a={subtle:"subtle",subtleAlpha:"subtle-alpha",transparent:"transparent"},Oa={small:"small",medium:"medium"};function Te(o,e="-tree-item"){return o?.nodeType!==Node.ELEMENT_NODE?!1:o.tagName.toLowerCase().endsWith(e)}const Gm=`${h.prefix}-tree-item`;var Xm=Object.defineProperty,Km=Object.getOwnPropertyDescriptor,on=(o,e,t,r)=>{for(var i=r>1?void 0:r?Km(e,t):e,n=o.length-1,s;n>=0;n--)(s=o[n])&&(i=(r?s(e,t,i):s(i))||i);return r&&i&&Xm(e,t,i),i};class jr extends x{constructor(){super(),this.currentSelected=null,this.elementInternals=this.attachInternals(),this.elementInternals.role="tree"}defaultSlotChanged(){this.handleDefaultSlotChange()}childTreeItemsChanged(){this.updateCurrentSelected()}updateCurrentSelected(){const e=this.querySelector("[selected]");this.currentSelected=e}keydownHandler(e){if(e.defaultPrevented)return;const t=e.target;if(!Te(t)||this.childTreeItems.length<1)return!0;switch(e.key){case"ArrowLeft":{t?.childTreeItems?.length&&t.expanded?t.expanded=!1:Te(t.parentElement)&&t.parentElement.focus();return}case"ArrowRight":{if(t?.childTreeItems?.length)if(!t.expanded)t.expanded=!0;else return!0;return}case"Enter":{this.clickHandler(e);return}case" ":{t.selected=!0;return}}return!0}clickHandler(e){if(e.defaultPrevented)return;if(!Te(e.target))return!0;const t=e.target;t.toggleExpansion(),t.selected=!0}changeHandler(e){if(e.defaultPrevented)return;if(!Te(e.target))return!0;const t=e.target;t.selected?(this.currentSelected&&this.currentSelected!==t&&Te(this.currentSelected)&&(this.currentSelected.selected=!1),this.currentSelected=t):!t.selected&&this.currentSelected===t&&(this.currentSelected=null)}handleDefaultSlotChange(){this.childTreeItems=this.defaultSlot.assignedElements().filter(e=>Te(e))}get descendantTreeItems(){const e=[],t=r=>{if(r)for(const i of r)e.push(i),t(i.childTreeItems)};return t(this.childTreeItems),e}}on([g],jr.prototype,"currentSelected",2),on([g],jr.prototype,"defaultSlot",2),on([g],jr.prototype,"childTreeItems",2);var Ym=Object.defineProperty,Jm=Object.getOwnPropertyDescriptor,Ta=(o,e,t,r)=>{for(var i=r>1?void 0:r?Jm(e,t):e,n=o.length-1,s;n>=0;n--)(s=o[n])&&(i=(r?s(e,t,i):s(i))||i);return r&&i&&Ym(e,t,i),i};class rn extends jr{constructor(){super(...arguments),this.size=Oa.small,this.appearance=_a.subtle}sizeChanged(){this.updateSizeAndAppearance()}appearanceChanged(){this.updateSizeAndAppearance()}childTreeItemsChanged(){super.childTreeItemsChanged(),this.updateSizeAndAppearance(),this.fgItems??(this.fgItems=new Nr(()=>this.descendantTreeItems.filter(e=>!e.isHidden),()=>this.currentSelected??null)),this.fg?this.fg.update():this.fg=new Er(this,this.fgItems,{definition:{behavior:"menu",axis:void 0,memory:!1}})}disconnectedCallback(){this.fg?.disconnect(),super.disconnectedCallback()}updateSizeAndAppearance(){this.childTreeItems?.length&&this.childTreeItems.forEach(e=>{e.size=this.size,e.appearance=this.appearance})}itemToggleHandler(){this.fg?.update()}}Ta([a],rn.prototype,"size",2),Ta([a],rn.prototype,"appearance",2),rn.define(Um);const Zm=p`${w("block")} :host{outline:none;font-size:${B};line-height:${L}}:host(:focus-visible) .positioning-region{box-shadow:${Ci} ${Ci} ${Ci} ${fr} ${le} inset}.positioning-region{display:flex;align-items:center;justify-content:space-between;cursor:pointer;height:${Vd};padding-inline-start:calc(var(--indent) * ${gr});padding-inline-end:${ie};border-radius:${S};background-color:${ps};color:${Be};gap:${oe}}@media (prefers-contrast:more){:host(:focus-visible) .positioning-region{outline:1px solid ${le}}}.content{display:flex;align-items:center;gap:${oe}}.chevron{display:flex;align-items:center;flex-shrink:0;justify-content:center;width:${gr};height:${zt};transition:transform ${mr} ${Ks};transform:rotate(0deg)}.chevron:dir(rtl){transform:rotate(180deg)}.chevron svg{inline-size:12px;block-size:12px}.aside{display:flex;align-items:center}.positioning-region:hover{background-color:${ir};color:${Dt}}.positioning-region:active{background-color:${vo};color:${Ht}}::slotted([slot='start']),::slotted([slot='end']),::slotted(:not([slot])){display:flex;align-items:center;min-width:0}::slotted([slot='start']){flex-shrink:0}::slotted(:not([slot])){padding-inline:${V}}.items{display:none}:host([expanded]) .items{display:block}:host([empty]) .chevron,:host([empty]) .items{visibility:hidden}:host([selected]) .positioning-region{background-color:${gs};color:${Qo}}:host([selected]) .content,:host([selected]) .chevron{color:${Xl}}:host([size='small']) .positioning-region{height:${zt};padding-inline-start:calc(var(--indent) * ${re})}:host([appearance='subtle-alpha']) .positioning-region:hover{background-color:${cc}}:host([appearance='subtle-alpha']) .positioning-region:active{background-color:${dc}}:host([appearance='subtle-alpha'][selected]) .positioning-region{background-color:${hc};color:${Qo}}:host([appearance='transparent']) .positioning-region{background-color:${he}}:host([appearance='transparent']) .positioning-region:hover{background-color:${nr}}:host([appearance='transparent']) .positioning-region:active{background-color:${sr}}:host([appearance='transparent'][selected]) .positioning-region{background-color:${fs};color:${Qo}}:host([expanded]) .chevron{transform:rotate(90deg)}`,Qm=b`<svg viewBox="0 0 12 12" fill=currentColor><path 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"></path></svg>`,ev=b`<template tabindex=0 ?focusgroupstart=${o=>o.selected}><div class=positioning-region part=positioning-region><div class=content part=content><span class=chevron part=chevron aria-hidden=true><slot name=chevron>${Qm}</slot></span><slot name=start></slot><slot></slot><slot name=end></slot></div><div class=aside part=aside><slot name=aside></slot></div></div><div role=group class=items part=items><slot name=item ${z("itemSlot")} @slotchange=${o=>o.handleItemSlotChange()}></slot></div></template>`,tv={name:Gm,registry:h.registry,styles:Zm,template:ev};var ov=Object.defineProperty,rv=Object.getOwnPropertyDescriptor,no=(o,e,t,r)=>{for(var i=r>1?void 0:r?rv(e,t):e,n=o.length-1,s;n>=0;n--)(s=o[n])&&(i=(r?s(e,t,i):s(i))||i);return r&&i&&ov(e,t,i),i};class Ft extends x{constructor(){super(),this.elementInternals=this.attachInternals(),this.expanded=!1,this.empty=!1,this.childTreeItems=[],this.elementInternals.role="treeitem"}itemSlotChanged(){this.handleItemSlotChange()}connectedCallback(){super.connectedCallback(),this.tabIndex=Number(this.getAttribute("tabindex")||"0"),Te(this.parentElement)&&(this.slot||(this.slot="item")),et(this)}expandedChanged(e,t){this.$emit("toggle",{oldState:e?"open":"closed",newState:t?"open":"closed"}),$(this.elementInternals,"expanded",t),this.childTreeItems?.length&&(this.elementInternals.ariaExpanded=t?"true":"false",requestAnimationFrame(()=>{const r=document.createTreeWalker(this,NodeFilter.SHOW_ELEMENT,i=>Te(i)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP);for(;r.nextNode();){const i=r.currentNode;t?i.removeAttribute("focusgroup"):(i.selected&&(i.selected=!1),i.setAttribute("focusgroup","none"))}}))}selectedChanged(e,t){this.$emit("change"),this.elementInternals&&($(this.elementInternals,"selected",t),this.elementInternals.ariaSelected=t?"true":"false")}dataIndentChanged(e,t){this.styles!==void 0&&this.$fastController.removeStyles(this.styles),this.styles=p`:host{--indent:${t}}`,this.$fastController.addStyles(this.styles)}childTreeItemsChanged(){this.empty=this.childTreeItems?.length===0,this.updateChildTreeItems()}updateChildTreeItems(){this.childTreeItems?.length&&(this.expanded||(this.expanded=Array.from(this.querySelectorAll("[selected]")).some(e=>Te(e))),this.childTreeItems.forEach(e=>{this.setIndent(e)}))}setIndent(e){const t=this.dataIndent??0;e.dataIndent=t+1}toggleExpansion(){this.childTreeItems?.length&&(this.expanded=!this.expanded)}get isNestedItem(){return Te(this.parentElement)}get isHidden(){let e=this.parentElement;for(;Te(e);){if(!e.expanded)return!0;e=e.parentElement}return!1}handleItemSlotChange(){this.childTreeItems=this.itemSlot.assignedElements().filter(e=>Te(e))}}no([g],Ft.prototype,"itemSlot",2),no([a({mode:"boolean"})],Ft.prototype,"expanded",2),no([a({mode:"boolean"})],Ft.prototype,"selected",2),no([a({mode:"boolean"})],Ft.prototype,"empty",2),no([a({attribute:"data-indent"})],Ft.prototype,"dataIndent",2),no([g],Ft.prototype,"childTreeItems",2);var iv=Object.defineProperty,nv=Object.getOwnPropertyDescriptor,Aa=(o,e,t,r)=>{for(var i=r>1?void 0:r?nv(e,t):e,n=o.length-1,s;n>=0;n--)(s=o[n])&&(i=(r?s(e,t,i):s(i))||i);return r&&i&&iv(e,t,i),i};class nn extends Ft{constructor(){super(...arguments),this.size=Oa.small,this.appearance=_a.subtle}sizeChanged(){this.updateSizeAndAppearance()}appearanceChanged(){this.updateSizeAndAppearance()}childTreeItemsChanged(){super.childTreeItemsChanged(),this.updateSizeAndAppearance()}updateSizeAndAppearance(){this.childTreeItems?.length&&this.childTreeItems.forEach(e=>{e.size=this.size,e.appearance=this.appearance})}}Aa([a],nn.prototype,"size",2),Aa([a],nn.prototype,"appearance",2),nn.define(tv);const sv="adoptedStyleSheets"in document,av="CSSScopeRule"in window,sn=new Map,an=new Map,Ho=new Map,ln=new Map,Vo=new CSSStyleSheet;function lv(o,e=document){if(!(!e||!cv(e))){if(!sv||e instanceof HTMLElement&&!e.shadowRoot&&!av){const t=e===document?document.documentElement:e;gv(o,t);return}[document,document.documentElement,document.body].includes(e)?dv(o):hv(o,e)}}function cn(o){if(!sn.has(o)){const e=[];for(const[t,r]of Object.entries(o))e.push(`--${t}:${r.toString()};`);sn.set(o,e.join(""))}return sn.get(o)}function cv(o){return[document,document.documentElement].includes(o)||o instanceof HTMLElement&&!!o.closest("body")}function dv(o){if(o===null){document.adoptedStyleSheets.includes(Vo)&&Vo.replaceSync("");return}Vo.replaceSync(`
|
|
29
|
+
`,window.CSS_ANCHOR_POLYFILL&&(await window.CSS_ANCHOR_POLYFILL({elements:[this.anchorPositioningStyleElement]}),this.anchorPositioningReady=!0)}}Rr([a],Do.prototype,"id",2),Rr([a({converter:te})],Do.prototype,"delay",2),Rr([a],Do.prototype,"positioning",2),Rr([a],Do.prototype,"anchor",2),Do.define(Hm);const jm=`${h.prefix}-tree`,qm=p`${w("block")} :host{outline:none}`,Wm=b`<template focusgroup="menu inline block nowrap nomemory" @click=${(o,e)=>o.clickHandler(e.event)} @keydown=${(o,e)=>o.keydownHandler(e.event)} @change=${(o,e)=>o.changeHandler(e.event)} @toggle=${o=>o.itemToggleHandler()}><slot ${z("defaultSlot")} @slotchange=${o=>o.handleDefaultSlotChange()}></slot></template>`,Um={name:jm,registry:h.registry,styles:qm,template:Wm},_a={subtle:"subtle",subtleAlpha:"subtle-alpha",transparent:"transparent"},Oa={small:"small",medium:"medium"};function Te(o,e="-tree-item"){return o?.nodeType!==Node.ELEMENT_NODE?!1:o.tagName.toLowerCase().endsWith(e)}const Gm=`${h.prefix}-tree-item`;var Xm=Object.defineProperty,Km=Object.getOwnPropertyDescriptor,on=(o,e,t,r)=>{for(var i=r>1?void 0:r?Km(e,t):e,n=o.length-1,s;n>=0;n--)(s=o[n])&&(i=(r?s(e,t,i):s(i))||i);return r&&i&&Xm(e,t,i),i};class jr extends x{constructor(){super(),this.currentSelected=null,this.elementInternals=this.attachInternals(),this.elementInternals.role="tree"}defaultSlotChanged(){this.handleDefaultSlotChange()}childTreeItemsChanged(){this.updateCurrentSelected()}updateCurrentSelected(){const e=this.querySelector("[selected]");this.currentSelected=e}keydownHandler(e){if(e.defaultPrevented)return;const t=e.target;if(!Te(t)||this.childTreeItems.length<1)return!0;switch(e.key){case"ArrowLeft":{t?.childTreeItems?.length&&t.expanded?t.expanded=!1:Te(t.parentElement)&&t.parentElement.focus();return}case"ArrowRight":{if(t?.childTreeItems?.length)if(!t.expanded)t.expanded=!0;else return!0;return}case"Enter":{this.clickHandler(e);return}case" ":{t.selected=!0;return}}return!0}clickHandler(e){if(e.defaultPrevented)return;if(!Te(e.target))return!0;const t=e.target;t.toggleExpansion(),t.selected=!0}changeHandler(e){if(e.defaultPrevented)return;if(!Te(e.target))return!0;const t=e.target;t.selected?(this.currentSelected&&this.currentSelected!==t&&Te(this.currentSelected)&&(this.currentSelected.selected=!1),this.currentSelected=t):!t.selected&&this.currentSelected===t&&(this.currentSelected=null)}handleDefaultSlotChange(){this.childTreeItems=this.defaultSlot.assignedElements().filter(e=>Te(e))}get descendantTreeItems(){const e=[],t=r=>{if(r)for(const i of r)e.push(i),t(i.childTreeItems)};return t(this.childTreeItems),e}}on([g],jr.prototype,"currentSelected",2),on([g],jr.prototype,"defaultSlot",2),on([g],jr.prototype,"childTreeItems",2);var Ym=Object.defineProperty,Jm=Object.getOwnPropertyDescriptor,Ta=(o,e,t,r)=>{for(var i=r>1?void 0:r?Jm(e,t):e,n=o.length-1,s;n>=0;n--)(s=o[n])&&(i=(r?s(e,t,i):s(i))||i);return r&&i&&Ym(e,t,i),i};class rn extends jr{constructor(){super(...arguments),this.size=Oa.small,this.appearance=_a.subtle}sizeChanged(){this.updateSizeAndAppearance()}appearanceChanged(){this.updateSizeAndAppearance()}childTreeItemsChanged(){super.childTreeItemsChanged(),this.updateSizeAndAppearance(),this.fgItems??(this.fgItems=new Nr(()=>this.descendantTreeItems.filter(e=>!e.isHidden),()=>this.currentSelected??null)),this.fg?this.fg.update():this.fg=new Er(this,this.fgItems,{definition:{behavior:"menu",axis:void 0,memory:!1}})}disconnectedCallback(){this.fg?.disconnect(),super.disconnectedCallback()}updateSizeAndAppearance(){this.childTreeItems?.length&&this.childTreeItems.forEach(e=>{e.size=this.size,e.appearance=this.appearance})}itemToggleHandler(){this.fg?.update()}}Ta([a],rn.prototype,"size",2),Ta([a],rn.prototype,"appearance",2),rn.define(Um);const Zm=p`${w("block")} :host{outline:none;font-size:${B};line-height:${L}}:host(:focus-visible) .positioning-region{box-shadow:${Ci} ${Ci} ${Ci} ${fr} ${le} inset}.positioning-region{display:flex;align-items:center;justify-content:space-between;cursor:pointer;height:${Vd};padding-inline-start:calc(var(--indent) * ${gr});padding-inline-end:${ie};border-radius:${S};background-color:${ps};color:${Be};gap:${oe}}@media (prefers-contrast:more){:host(:focus-visible) .positioning-region{outline:1px solid ${le}}}.content{display:flex;align-items:center;gap:${oe}}.chevron{display:flex;align-items:center;flex-shrink:0;justify-content:center;width:${gr};height:${zt};transition:transform ${mr} ${Ks};transform:rotate(0deg)}.chevron:dir(rtl){transform:rotate(180deg)}.chevron svg{inline-size:12px;block-size:12px}.aside{display:flex;align-items:center}.positioning-region:hover{background-color:${ir};color:${Dt}}.positioning-region:active{background-color:${vo};color:${Ht}}::slotted([slot='start']),::slotted([slot='end']),::slotted(:not([slot])){display:flex;align-items:center;min-width:0}::slotted([slot='start']){flex-shrink:0}::slotted(:not([slot])){padding-inline:${V}}.items{display:none}:host([expanded]) .items{display:block}:host([empty]) .chevron,:host([empty]) .items{visibility:hidden}:host([selected]) .positioning-region{background-color:${gs};color:${Qo}}:host([selected]) .content,:host([selected]) .chevron{color:${Xl}}:host([size='small']) .positioning-region{height:${zt};padding-inline-start:calc(var(--indent) * ${re})}:host([appearance='subtle-alpha']) .positioning-region:hover{background-color:${cc}}:host([appearance='subtle-alpha']) .positioning-region:active{background-color:${dc}}:host([appearance='subtle-alpha'][selected]) .positioning-region{background-color:${hc};color:${Qo}}:host([appearance='transparent']) .positioning-region{background-color:${he}}:host([appearance='transparent']) .positioning-region:hover{background-color:${nr}}:host([appearance='transparent']) .positioning-region:active{background-color:${sr}}:host([appearance='transparent'][selected]) .positioning-region{background-color:${fs};color:${Qo}}:host([expanded]) .chevron{transform:rotate(90deg)}`,Qm=b`<svg viewBox="0 0 12 12" fill=currentColor><path 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"></path></svg>`,ev=b`<template tabindex=0 ?focusgroupstart=${o=>o.selected}><div class=positioning-region part=positioning-region><div class=content part=content><span class=chevron part=chevron aria-hidden=true><slot name=chevron>${Qm}</slot></span><slot name=start></slot><slot></slot><slot name=end></slot></div><div class=aside part=aside><slot name=aside></slot></div></div><div role=group class=items part=items><slot name=item ${z("itemSlot")} @slotchange=${o=>o.handleItemSlotChange()}></slot></div></template>`,tv={name:Gm,registry:h.registry,styles:Zm,template:ev};var ov=Object.defineProperty,rv=Object.getOwnPropertyDescriptor,no=(o,e,t,r)=>{for(var i=r>1?void 0:r?rv(e,t):e,n=o.length-1,s;n>=0;n--)(s=o[n])&&(i=(r?s(e,t,i):s(i))||i);return r&&i&&ov(e,t,i),i};class Ft extends x{constructor(){super(),this.elementInternals=this.attachInternals(),this.expanded=!1,this.empty=!1,this.childTreeItems=[],this.elementInternals.role="treeitem"}itemSlotChanged(){this.handleItemSlotChange()}connectedCallback(){super.connectedCallback(),this.tabIndex=Number(this.getAttribute("tabindex")||"0"),Te(this.parentElement)&&(this.slot||(this.slot="item")),et(this)}expandedChanged(e,t){this.$emit("toggle",{oldState:e?"open":"closed",newState:t?"open":"closed"}),$(this.elementInternals,"expanded",t),this.childTreeItems?.length&&(this.elementInternals.ariaExpanded=t?"true":"false",requestAnimationFrame(()=>{const r=document.createTreeWalker(this,NodeFilter.SHOW_ELEMENT,i=>Te(i)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP);for(;r.nextNode();){const i=r.currentNode;t?i.removeAttribute("focusgroup"):(i.selected&&(i.selected=!1),i.setAttribute("focusgroup","none"))}}))}selectedChanged(e,t){this.$emit("change"),this.elementInternals&&($(this.elementInternals,"selected",t),this.elementInternals.ariaSelected=t?"true":"false")}dataIndentChanged(e,t){this.styles!==void 0&&this.$fastController.removeStyles(this.styles),this.styles=p`:host{--indent:${t}}`,this.$fastController.addStyles(this.styles)}childTreeItemsChanged(){this.empty=this.childTreeItems?.length===0,this.updateChildTreeItems()}updateChildTreeItems(){this.childTreeItems?.length&&(this.expanded||(this.expanded=Array.from(this.querySelectorAll("[selected]")).some(e=>Te(e))),this.childTreeItems.forEach(e=>{this.setIndent(e)}))}setIndent(e){const t=this.dataIndent??0;e.dataIndent=t+1}toggleExpansion(){this.childTreeItems?.length&&(this.expanded=!this.expanded)}get isNestedItem(){return Te(this.parentElement)}get isHidden(){let e=this.parentElement;for(;Te(e);){if(!e.expanded)return!0;e=e.parentElement}return!1}handleItemSlotChange(){this.childTreeItems=this.itemSlot.assignedElements().filter(e=>Te(e))}}no([g],Ft.prototype,"itemSlot",2),no([a({mode:"boolean"})],Ft.prototype,"expanded",2),no([a({mode:"boolean"})],Ft.prototype,"selected",2),no([a({mode:"boolean"})],Ft.prototype,"empty",2),no([a({attribute:"data-indent"})],Ft.prototype,"dataIndent",2),no([g],Ft.prototype,"childTreeItems",2);var iv=Object.defineProperty,nv=Object.getOwnPropertyDescriptor,Aa=(o,e,t,r)=>{for(var i=r>1?void 0:r?nv(e,t):e,n=o.length-1,s;n>=0;n--)(s=o[n])&&(i=(r?s(e,t,i):s(i))||i);return r&&i&&iv(e,t,i),i};class nn extends Ft{constructor(){super(...arguments),this.size=Oa.small,this.appearance=_a.subtle}sizeChanged(){this.updateSizeAndAppearance()}appearanceChanged(){this.updateSizeAndAppearance()}childTreeItemsChanged(){super.childTreeItemsChanged(),this.updateSizeAndAppearance()}updateSizeAndAppearance(){this.childTreeItems?.length&&this.childTreeItems.forEach(e=>{e.size=this.size,e.appearance=this.appearance})}}Aa([a],nn.prototype,"size",2),Aa([a],nn.prototype,"appearance",2),nn.define(tv);const sv="adoptedStyleSheets"in document,av="CSSScopeRule"in window,sn=new Map,an=new Map,Ho=new Map,ln=new Map,Vo=new CSSStyleSheet;function lv(o,e=document){if(!(!e||!cv(e))){if(!sv||e instanceof HTMLElement&&!e.shadowRoot&&!av){const t=e===document?document.documentElement:e;gv(o,t);return}[document,document.documentElement,document.body].includes(e)?dv(o):hv(o,e)}}function cn(o){if(!sn.has(o)){const e=[];for(const[t,r]of Object.entries(o))e.push(`--${t}:${r.toString()};`);sn.set(o,e.join(""))}return sn.get(o)}function cv(o){return[document,document.documentElement].includes(o)||o instanceof HTMLElement&&!!o.closest("body")}function dv(o){if(o===null){document.adoptedStyleSheets.includes(Vo)&&Vo.replaceSync("");return}Vo.replaceSync(`
|
|
30
30
|
html {
|
|
31
31
|
${cn(o)}
|
|
32
32
|
}
|