@fluentui/web-components 3.0.0-rc.12 → 3.0.0-rc.13
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 +964 -161
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/menu-list/index.d.ts +1 -0
- package/dist/esm/menu-list/index.js +1 -0
- package/dist/esm/menu-list/index.js.map +1 -1
- package/dist/esm/menu-list/menu-list.base.d.ts +76 -0
- package/dist/esm/menu-list/menu-list.base.js +251 -0
- package/dist/esm/menu-list/menu-list.base.js.map +1 -0
- package/dist/esm/menu-list/menu-list.d.ts +3 -70
- package/dist/esm/menu-list/menu-list.js +3 -244
- package/dist/esm/menu-list/menu-list.js.map +1 -1
- package/dist/esm/radio-group/index.d.ts +1 -0
- package/dist/esm/radio-group/index.js +1 -0
- package/dist/esm/radio-group/index.js.map +1 -1
- package/dist/esm/radio-group/radio-group.base.d.ts +285 -0
- package/dist/esm/radio-group/radio-group.base.js +497 -0
- package/dist/esm/radio-group/radio-group.base.js.map +1 -0
- package/dist/esm/radio-group/radio-group.d.ts +4 -280
- package/dist/esm/radio-group/radio-group.js +4 -491
- package/dist/esm/radio-group/radio-group.js.map +1 -1
- package/dist/web-components.d.ts +1845 -1827
- package/dist/web-components.js +20 -16
- package/dist/web-components.min.js +34 -34
- package/package.json +1 -1
|
@@ -445,20 +445,20 @@ const p=Object.freeze({prefix:"fluent",shadowRootMode:"open",registry:customElem
|
|
|
445
445
|
${w("grid")}
|
|
446
446
|
|
|
447
447
|
:host{--indent:0;align-items:center;background:${S};border-radius:${C};color:${Pe};contain:layout;cursor:pointer;flex-shrink:0;font:${E} ${O} / ${M} ${v};grid-gap:4px;grid-template-columns:20px 20px auto 20px;height:32px;overflow:visible;padding:0 10px}:host(:hover){background:${cr};color:${Et}}:host(:active){background-color:${dn};color:${At}}:host(:active) ::slotted([slot='start']){color:${Rl}}:host(${fe}){background-color:${et};color:${_}}:host(${fe}) ::slotted([slot='start']),:host(${fe}) ::slotted([slot='end']){color:${_}}:host(:focus-visible){border-radius:${C};outline:2px solid ${ue}}.content{white-space:nowrap;flex-grow:1;grid-column:auto / span 2;padding:0 2px}:host(:not(${y})) .indicator,:host(:not(${y})) ::slotted([slot='indicator']),:host(:not(${Or})) .submenu-glyph,:host(:not(${Or})) ::slotted([slot='submenu-glyph']){display:none}::slotted([slot='end']){color:${Z};font:${E} ${F} / ${q} ${v};white-space:nowrap}:host([data-indent='1']){--indent:1}:host([data-indent='2']){--indent:2;grid-template-columns:20px 20px auto auto}:host(${Or}){grid-template-columns:20px auto auto 20px}:host([data-indent='2']${Or}){grid-template-columns:20px 20px auto auto 20px}.indicator,::slotted([slot='indicator']){grid-column:1 / span 1;width:20px}::slotted([slot='start']){display:inline-flex;grid-column:calc(var(--indent)) / span 1}.content{grid-column:calc(var(--indent) + 1) / span 1}::slotted([slot='end']){grid-column:calc(var(--indent) + 2) / span 1;justify-self:end}.submenu-glyph,::slotted([slot='submenu-glyph']){grid-column:-2 / span 1;justify-self:end}@layer popover{:host{anchor-name:--menu-trigger;position:relative}::slotted([popover]){margin:0;max-height:var(--menu-max-height,auto);position:absolute;position-anchor:--menu-trigger;position-area:inline-end span-block-end;position-try-fallbacks:flip-inline,block-start,block-end;z-index:1}::slotted([popover]:not(:popover-open)){display:none}::slotted([popover]:popover-open){inset:unset}@supports not (anchor-name:--menu-trigger){::slotted([popover]){align-self:start}}}`.withBehaviors(X(u`
|
|
448
|
-
:host(${fe}),:host(${fe}) ::slotted([slot='start']),:host(${fe}) ::slotted([slot='end']){color:GrayText}`)),rb=g.partial('<svg class="indicator" fill="currentColor" 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>'),ib=g.partial('<svg class="submenu-glyph" fill="currentColor" 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>');function sb(o={}){return g`<template @keydown="${(e,t)=>e.handleMenuItemKeyDown(t.event)}" @click="${(e,t)=>e.handleMenuItemClick(t.event)}" @mouseover="${(e,t)=>e.handleMouseOver(t.event)}" @mouseout="${(e,t)=>e.handleMouseOut(t.event)}" @toggle="${(e,t)=>e.toggleHandler(t.event)}"><slot name="indicator">${de(o.indicator)}</slot>${Ge(o)}<div part="content" class="content"><slot></slot></div>${pt(o)}<slot name="submenu-glyph">${de(o.submenuGlyph)}</slot><slot name="submenu" ${U({property:"slottedSubmenu"})}></slot></template>`}const nb=sb({indicator:rb,submenuGlyph:ib}),ab=Ke.compose({name:`${p.prefix}-menu-item`,template:nb,styles:ob});ab.define(p.registry);var lb=Object.defineProperty,cb=Object.getOwnPropertyDescriptor,db=(o,e,t,r)=>{for(var i=r>1?void 0:r?cb(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&lb(e,t,i),i};const Vi=class rs extends x{constructor(){super(),this.elementInternals=this.attachInternals(),this.focusIndex=-1,this.isNestedMenu=()=>this.parentElement!==null&&di(this.parentElement)&&this.parentElement.getAttribute("role")==="menuitem",this.handleFocusOut=e=>{if(!this.contains(e.relatedTarget)&&this.menuItems!==void 0){const t=this.menuItems.findIndex(this.isFocusableElement);this.menuItems[this.focusIndex].setAttribute("tabindex","-1"),this.menuItems[t].setAttribute("tabindex","0"),this.focusIndex=t}},this.handleItemFocus=e=>{const t=e.target;this.menuItems!==void 0&&t!==this.menuItems[this.focusIndex]&&(this.menuItems[this.focusIndex].setAttribute("tabindex","-1"),this.focusIndex=this.menuItems.indexOf(t),t.setAttribute("tabindex","0"))},this.changedMenuItemHandler=e=>{if(this.menuItems===void 0)return;const t=e.target,r=this.menuItems.indexOf(t);if(r!==-1&&t.role==="menuitemradio"&&t.checked===!0){for(let s=r-1;s>=0;--s){const n=this.menuItems[s],c=n.role;if(c===J.menuitemradio&&(n.checked=!1),c==="separator")break}const i=this.menuItems.length-1;for(let s=r+1;s<=i;++s){const n=this.menuItems[s],c=n.role;if(c===J.menuitemradio&&(n.checked=!1),c==="separator")break}}},this.isMenuItemElement=e=>Jp(e)||di(e)&&!!e.role&&e.role in rs.focusableElementRoles,this.isFocusableElement=e=>this.isMenuItemElement(e),this.elementInternals.role="menu"}itemsChanged(e,t){this.$fastController.isConnected&&this.menuItems!==void 0&&this.setItems()}connectedCallback(){super.connectedCallback(),A.enqueue(()=>{this.setItems()}),this.addEventListener("change",this.changedMenuItemHandler)}disconnectedCallback(){super.disconnectedCallback(),this.removeItemListeners(),this.menuItems=void 0,this.removeEventListener("change",this.changedMenuItemHandler)}focus(){this.setFocus(0,1)}handleMenuKeyDown(e){if(!(e.defaultPrevented||this.menuItems===void 0))switch(e.key){case Ko:this.setFocus(this.focusIndex+1,1);return;case Zo:this.setFocus(this.focusIndex-1,-1);return;case Jo:this.setFocus(this.menuItems.length-1,-1);return;case er:this.setFocus(0,1);return;default:return!0}}removeItemListeners(e=this.items){e.forEach(t=>{t.removeEventListener("focus",this.handleItemFocus),m.getNotifier(t).unsubscribe(this,"hidden")})}static elementIndent(e){const t=e.role,r=e.querySelector("[slot=start]");return t&&t!==J.menuitem?r?2:1:r?1:0}setItems(){const e=Array.from(this.children);this.removeItemListeners(e),e.forEach(n=>m.getNotifier(n).subscribe(this,"hidden"));const t=e.filter(n=>!n.hasAttribute("hidden"));this.menuItems=t;const r=this.menuItems.filter(this.isMenuItemElement);r.length&&(this.focusIndex=0),r.forEach((n,c)=>{n.setAttribute("tabindex",c===0?"0":"-1"),n.addEventListener("focus",this.handleItemFocus)});const i=this.menuItems?.filter(this.isMenuItemElement),s=i?.reduce((n,c)=>{const h=rs.elementIndent(c);return Math.max(n,h)},0);i?.forEach(n=>{n.dataset.indent=`${s}`})}handleChange(e,t){t==="hidden"&&this.setItems()}setFocus(e,t){if(this.menuItems!==void 0)for(;e>=0&&e<this.menuItems.length;){const r=this.menuItems[e];if(this.isFocusableElement(r)){this.focusIndex>-1&&this.menuItems.length>=this.focusIndex-1&&this.menuItems[this.focusIndex].setAttribute("tabindex","-1"),this.focusIndex=e,r.setAttribute("tabindex","0"),r.focus();break}e+=t}}};Vi.focusableElementRoles=J,db([b],Vi.prototype,"items",2);let hb=Vi;const
|
|
448
|
+
:host(${fe}),:host(${fe}) ::slotted([slot='start']),:host(${fe}) ::slotted([slot='end']){color:GrayText}`)),rb=g.partial('<svg class="indicator" fill="currentColor" 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>'),ib=g.partial('<svg class="submenu-glyph" fill="currentColor" 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>');function sb(o={}){return g`<template @keydown="${(e,t)=>e.handleMenuItemKeyDown(t.event)}" @click="${(e,t)=>e.handleMenuItemClick(t.event)}" @mouseover="${(e,t)=>e.handleMouseOver(t.event)}" @mouseout="${(e,t)=>e.handleMouseOut(t.event)}" @toggle="${(e,t)=>e.toggleHandler(t.event)}"><slot name="indicator">${de(o.indicator)}</slot>${Ge(o)}<div part="content" class="content"><slot></slot></div>${pt(o)}<slot name="submenu-glyph">${de(o.submenuGlyph)}</slot><slot name="submenu" ${U({property:"slottedSubmenu"})}></slot></template>`}const nb=sb({indicator:rb,submenuGlyph:ib}),ab=Ke.compose({name:`${p.prefix}-menu-item`,template:nb,styles:ob});ab.define(p.registry);var lb=Object.defineProperty,cb=Object.getOwnPropertyDescriptor,db=(o,e,t,r)=>{for(var i=r>1?void 0:r?cb(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&lb(e,t,i),i};const Vi=class rs extends x{constructor(){super(),this.elementInternals=this.attachInternals(),this.focusIndex=-1,this.isNestedMenu=()=>this.parentElement!==null&&di(this.parentElement)&&this.parentElement.getAttribute("role")==="menuitem",this.handleFocusOut=e=>{if(!this.contains(e.relatedTarget)&&this.menuItems!==void 0){const t=this.menuItems.findIndex(this.isFocusableElement);this.menuItems[this.focusIndex].setAttribute("tabindex","-1"),this.menuItems[t].setAttribute("tabindex","0"),this.focusIndex=t}},this.handleItemFocus=e=>{const t=e.target;this.menuItems!==void 0&&t!==this.menuItems[this.focusIndex]&&(this.menuItems[this.focusIndex].setAttribute("tabindex","-1"),this.focusIndex=this.menuItems.indexOf(t),t.setAttribute("tabindex","0"))},this.changedMenuItemHandler=e=>{if(this.menuItems===void 0)return;const t=e.target,r=this.menuItems.indexOf(t);if(r!==-1&&t.role==="menuitemradio"&&t.checked===!0){for(let s=r-1;s>=0;--s){const n=this.menuItems[s],c=n.role;if(c===J.menuitemradio&&(n.checked=!1),c==="separator")break}const i=this.menuItems.length-1;for(let s=r+1;s<=i;++s){const n=this.menuItems[s],c=n.role;if(c===J.menuitemradio&&(n.checked=!1),c==="separator")break}}},this.isMenuItemElement=e=>Jp(e)||di(e)&&!!e.role&&e.role in rs.focusableElementRoles,this.isFocusableElement=e=>this.isMenuItemElement(e),this.elementInternals.role="menu"}itemsChanged(e,t){this.$fastController.isConnected&&this.menuItems!==void 0&&this.setItems()}connectedCallback(){super.connectedCallback(),A.enqueue(()=>{this.setItems()}),this.addEventListener("change",this.changedMenuItemHandler)}disconnectedCallback(){super.disconnectedCallback(),this.removeItemListeners(),this.menuItems=void 0,this.removeEventListener("change",this.changedMenuItemHandler)}focus(){this.setFocus(0,1)}handleMenuKeyDown(e){if(!(e.defaultPrevented||this.menuItems===void 0))switch(e.key){case Ko:this.setFocus(this.focusIndex+1,1);return;case Zo:this.setFocus(this.focusIndex-1,-1);return;case Jo:this.setFocus(this.menuItems.length-1,-1);return;case er:this.setFocus(0,1);return;default:return!0}}removeItemListeners(e=this.items){e.forEach(t=>{t.removeEventListener("focus",this.handleItemFocus),m.getNotifier(t).unsubscribe(this,"hidden")})}static elementIndent(e){const t=e.role,r=e.querySelector("[slot=start]");return t&&t!==J.menuitem?r?2:1:r?1:0}setItems(){const e=Array.from(this.children);this.removeItemListeners(e),e.forEach(n=>m.getNotifier(n).subscribe(this,"hidden"));const t=e.filter(n=>!n.hasAttribute("hidden"));this.menuItems=t;const r=this.menuItems.filter(this.isMenuItemElement);r.length&&(this.focusIndex=0),r.forEach((n,c)=>{n.setAttribute("tabindex",c===0?"0":"-1"),n.addEventListener("focus",this.handleItemFocus)});const i=this.menuItems?.filter(this.isMenuItemElement),s=i?.reduce((n,c)=>{const h=rs.elementIndent(c);return Math.max(n,h)},0);i?.forEach(n=>{n.dataset.indent=`${s}`})}handleChange(e,t){t==="hidden"&&this.setItems()}setFocus(e,t){if(this.menuItems!==void 0)for(;e>=0&&e<this.menuItems.length;){const r=this.menuItems[e];if(this.isFocusableElement(r)){this.focusIndex>-1&&this.menuItems.length>=this.focusIndex-1&&this.menuItems[this.focusIndex].setAttribute("tabindex","-1"),this.focusIndex=e,r.setAttribute("tabindex","0"),r.focus();break}e+=t}}};Vi.focusableElementRoles=J,db([b],Vi.prototype,"items",2);let hb=Vi;class ub extends hb{}const pb=u`
|
|
449
449
|
${w("flex")}
|
|
450
450
|
|
|
451
|
-
:host{flex-direction:column;height:fit-content;max-width:300px;min-width:160px;width:auto;background-color:${S};border:1px solid ${K};border-radius:${C};box-shadow:${yi};padding:4px;row-gap:2px}`;function
|
|
451
|
+
:host{flex-direction:column;height:fit-content;max-width:300px;min-width:160px;width:auto;background-color:${S};border:1px solid ${K};border-radius:${C};box-shadow:${yi};padding:4px;row-gap:2px}`;function bb(){return g`<template slot="${o=>o.slot?o.slot:o.isNestedMenu()?"submenu":void 0}" @keydown="${(o,e)=>o.handleMenuKeyDown(e.event)}" @focusout="${(o,e)=>o.handleFocusOut(e.event)}"><slot ${U("items")}></slot></template>`}const gb=bb(),fb=ub.compose({name:`${p.prefix}-menu-list`,template:gb,styles:pb});fb.define(p.registry);var mb=Object.defineProperty,vb=Object.getOwnPropertyDescriptor,nt=(o,e,t,r)=>{for(var i=r>1?void 0:r?vb(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&mb(e,t,i),i};class Ye extends x{constructor(){super(...arguments),this._open=!1,this.toggleMenu=()=>{this._menuList?.togglePopover(!this._open)},this.closeMenu=e=>{e?.target instanceof Ke&&(e.target.getAttribute("role")===J.menuitemcheckbox||e.target.getAttribute("role")===J.menuitemradio)||(this._menuList?.togglePopover(!1),this.closeOnScroll&&document.removeEventListener("scroll",this.closeMenu))},this.openMenu=e=>{this._menuList?.togglePopover(!0),e&&this.openOnContext&&e.preventDefault(),this.closeOnScroll&&document.addEventListener("scroll",this.closeMenu)},this.toggleHandler=e=>{if(e.type==="toggle"&&e.newState){const t=e.newState==="open";this._trigger?.setAttribute("aria-expanded",`${t}`),this._open=t,this._open&&this.focusMenuList()}},this.triggerKeydownHandler=e=>{if(e.defaultPrevented)return;switch(e.key){case tr:case lo:e.preventDefault(),this.toggleMenu();break;default:return!0}},this.documentClickHandler=e=>{e.composedPath().some(t=>t===this._trigger||t===this._menuList)||this.closeMenu()}}slottedMenuListChanged(e,t){this.setComponent()}connectedCallback(){super.connectedCallback(),this.setComponent()}disconnectedCallback(){super.disconnectedCallback(),this.removeListeners()}setComponent(){Vt(this,()=>{const e=this.slottedTriggers?.[0],t=this.slottedMenuList?.[0];if(!e||!t){this.removeListeners();return}this._trigger=e,this._menuList=t,this._trigger.setAttribute("aria-haspopup","true"),this._trigger.setAttribute("aria-expanded",`${this._open}`),this._menuList.setAttribute("popover",this.openOnContext?"manual":""),this.removeListeners(),this.addListeners()},{shallow:!0})}focusMenuList(){A.enqueue(()=>{this._menuList.focus()})}focusTrigger(){A.enqueue(()=>{this._trigger.focus()})}openOnHoverChanged(e,t){t?this._trigger?.addEventListener("mouseover",this.openMenu):this._trigger?.removeEventListener("mouseover",this.openMenu)}persistOnItemClickChanged(e,t){t?this._menuList?.removeEventListener("change",this.closeMenu):this._menuList?.addEventListener("change",this.closeMenu)}openOnContextChanged(e,t){t?this._trigger?.addEventListener("contextmenu",this.openMenu):this._trigger?.removeEventListener("contextmenu",this.openMenu)}closeOnScrollChanged(e,t){t?document.addEventListener("scroll",this.closeMenu):document.removeEventListener("scroll",this.closeMenu)}addListeners(){this._menuList?.addEventListener("toggle",this.toggleHandler),this._trigger?.addEventListener("keydown",this.triggerKeydownHandler),this.persistOnItemClick||this._menuList?.addEventListener("change",this.closeMenu),this.openOnHover?this._trigger?.addEventListener("mouseover",this.openMenu):this.openOnContext?(this._trigger?.addEventListener("contextmenu",this.openMenu),document.addEventListener("click",this.documentClickHandler)):this._trigger?.addEventListener("click",this.toggleMenu)}removeListeners(){this._menuList?.removeEventListener("toggle",this.toggleHandler),this._trigger?.removeEventListener("keydown",this.triggerKeydownHandler),this.persistOnItemClick||this._menuList?.removeEventListener("change",this.closeMenu),this.openOnHover&&this._trigger?.removeEventListener("mouseover",this.openMenu),this.openOnContext?(this._trigger?.removeEventListener("contextmenu",this.openMenu),document.removeEventListener("click",this.documentClickHandler)):this._trigger?.removeEventListener("click",this.toggleMenu)}menuKeydownHandler(e){if(e.defaultPrevented)return;switch(e.key){case $l:e.preventDefault(),this._open&&(this.closeMenu(),this.focusTrigger());break;case yl:if(this._open&&this.closeMenu(),e.shiftKey&&e.composedPath()[0]!==this._trigger&&e.composedPath()[0].assignedSlot!==this.primaryAction)this.focusTrigger();else if(e.shiftKey)return!0;default:return!0}}}nt([a({attribute:"open-on-hover",mode:"boolean"})],Ye.prototype,"openOnHover",2),nt([a({attribute:"open-on-context",mode:"boolean"})],Ye.prototype,"openOnContext",2),nt([a({attribute:"close-on-scroll",mode:"boolean"})],Ye.prototype,"closeOnScroll",2),nt([a({attribute:"persist-on-item-click",mode:"boolean"})],Ye.prototype,"persistOnItemClick",2),nt([a({mode:"boolean"})],Ye.prototype,"split",2),nt([b],Ye.prototype,"slottedMenuList",2),nt([b],Ye.prototype,"slottedTriggers",2),nt([b],Ye.prototype,"primaryAction",2);const $b=u`
|
|
452
452
|
${w("inline-block")}
|
|
453
453
|
|
|
454
|
-
::slotted([slot='trigger']){anchor-name:--menu-trigger}::slotted([popover]){margin:0;max-height:var(--menu-max-height,auto);position-anchor:--menu-trigger;position-area:block-end span-inline-end;position-try-fallbacks:flip-block;position:absolute;z-index:1}:host([split]) ::slotted([popover]){position-area:block-end span-inline-start}::slotted([popover]:popover-open){inset:unset}::slotted([popover]:not(:popover-open)){display:none}:host([split]){display:inline-flex}:host([split]) ::slotted([slot='primary-action']){border-inline-end:${I} solid ${De};border-start-end-radius:0;border-end-end-radius:0}:host([split]) ::slotted([slot='primary-action']:focus-visible){z-index:1}:host([split]) ::slotted([slot='primary-action'][appearance='primary']){border-inline-end:${I} solid white}:host([split]) ::slotted([slot='trigger']){border-inline-start:0;border-start-start-radius:0;border-end-start-radius:0}`;function
|
|
454
|
+
::slotted([slot='trigger']){anchor-name:--menu-trigger}::slotted([popover]){margin:0;max-height:var(--menu-max-height,auto);position-anchor:--menu-trigger;position-area:block-end span-inline-end;position-try-fallbacks:flip-block;position:absolute;z-index:1}:host([split]) ::slotted([popover]){position-area:block-end span-inline-start}::slotted([popover]:popover-open){inset:unset}::slotted([popover]:not(:popover-open)){display:none}:host([split]){display:inline-flex}:host([split]) ::slotted([slot='primary-action']){border-inline-end:${I} solid ${De};border-start-end-radius:0;border-end-end-radius:0}:host([split]) ::slotted([slot='primary-action']:focus-visible){z-index:1}:host([split]) ::slotted([slot='primary-action'][appearance='primary']){border-inline-end:${I} solid white}:host([split]) ::slotted([slot='trigger']){border-inline-start:0;border-start-start-radius:0;border-end-start-radius:0}`;function yb(){return g`<template ?open-on-hover="${o=>o.openOnHover}" ?open-on-context="${o=>o.openOnContext}" ?close-on-scroll="${o=>o.closeOnScroll}" ?persist-on-item-click="${o=>o.persistOnItemClick}" @keydown="${(o,e)=>o.menuKeydownHandler(e.event)}"><slot name="primary-action" ${z("primaryAction")}></slot><slot name="trigger" ${U({property:"slottedTriggers",filter:no()})}></slot><slot ${U({property:"slottedMenuList",filter:no()})}></slot></template>`}const xb=yb(),kb=Ye.compose({name:`${p.prefix}-menu`,template:xb,styles:$b});kb.define(p.registry);var wb=Object.defineProperty,Cb=Object.getOwnPropertyDescriptor,Hi=(o,e,t,r)=>{for(var i=r>1?void 0:r?Cb(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&wb(e,t,i),i};class Mr extends x{constructor(){super(),this.elementInternals=this.attachInternals(),this.dismissMessageBar=()=>{this.$emit("dismiss",{})},this.elementInternals.role="status"}}Hi([a],Mr.prototype,"shape",2),Hi([a],Mr.prototype,"layout",2),Hi([a],Mr.prototype,"intent",2);const Sb=u`
|
|
455
455
|
:host{display:grid;box-sizing:border-box;font-family:${v};font-size:${F};line-height:${q};width:100%;background:${po};border:1px solid ${De};padding-inline:${ae};border-radius:${C};min-height:36px;align-items:center;grid-template:'icon body actions dismiss' / auto 1fr auto auto;contain:layout style paint}:host([shape='square']){border-radius:0}:host([intent='success']){background-color:${Pn};border-color:${ac}}:host([intent='warning']){background-color:${Bn};border-color:${_n}}:host([intent='error']){background-color:${wn};border-color:${Sn}}:host([layout='multiline']){grid-template-areas:'icon body dismiss'
|
|
456
|
-
'actions actions actions';grid-template-columns:auto 1fr auto;grid-template-rows:auto auto 1fr;padding-block:${xr};padding-inline:${ae}}.content{grid-area:body;max-width:520px;padding-block:${xr};padding-inline:0}:host([layout='multiline']) .content{padding:0}::slotted([slot='icon']){display:flex;grid-area:icon;flex-direction:column;align-items:center;color:${Z};margin-inline-end:${Be}}:host([layout='multiline']) ::slotted([slot='icon']){align-items:start;height:100%}::slotted([slot='dismiss']){grid-area:dismiss}.actions{grid-area:actions;display:flex;justify-self:end;margin-inline-end:${Be};gap:${Be}}:host([layout='multiline']) .actions{margin-block-start:${xr};margin-inline-end:0}:host([layout='multiline']) ::slotted([slot='dismiss']){align-items:start;height:100%;padding-block-start:${se}}::slotted(*){font-size:inherit}`;function
|
|
456
|
+
'actions actions actions';grid-template-columns:auto 1fr auto;grid-template-rows:auto auto 1fr;padding-block:${xr};padding-inline:${ae}}.content{grid-area:body;max-width:520px;padding-block:${xr};padding-inline:0}:host([layout='multiline']) .content{padding:0}::slotted([slot='icon']){display:flex;grid-area:icon;flex-direction:column;align-items:center;color:${Z};margin-inline-end:${Be}}:host([layout='multiline']) ::slotted([slot='icon']){align-items:start;height:100%}::slotted([slot='dismiss']){grid-area:dismiss}.actions{grid-area:actions;display:flex;justify-self:end;margin-inline-end:${Be};gap:${Be}}:host([layout='multiline']) .actions{margin-block-start:${xr};margin-inline-end:0}:host([layout='multiline']) ::slotted([slot='dismiss']){align-items:start;height:100%;padding-block-start:${se}}::slotted(*){font-size:inherit}`;function Ib(){return g`<slot name="icon"></slot><div class="content"><slot></slot></div><div class="actions"><slot name="actions"></slot></div><slot name="dismiss"></slot>`}const Pb=Ib(),zb=Mr.compose({name:`${p.prefix}-message-bar`,template:Pb,styles:Sb,shadowOptions:{mode:p.shadowRootMode}});zb.define(p.registry);var Bb=Object.defineProperty,Tb=Object.getOwnPropertyDescriptor,me=(o,e,t,r)=>{for(var i=r>1?void 0:r?Tb(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&Bb(e,t,i),i};class ne extends x{constructor(){super(),this.active=!1,this.id=Xt("option-"),this.initialValue="",this.multiple=!1,this.elementInternals=this.attachInternals(),this._value=this.initialValue,this.elementInternals.role="option"}activeChanged(e,t){$(this.elementInternals,"active",t)}currentSelectedChanged(e,t){this.selected=!!t}defaultSelectedChanged(e,t){this.selected=!!t}descriptionSlotChanged(e,t){$(this.elementInternals,"description",!!t?.length)}disabledChanged(e,t){this.elementInternals.ariaDisabled=this.disabled?"true":"false",$(this.elementInternals,"disabled",this.disabled),this.setFormValue(!this.disabled&&this.selected?this.value:null)}disabledAttributeChanged(e,t){this.disabled=!!t}initialValueChanged(e,t){this._value=t}multipleChanged(e,t){$(this.elementInternals,"multiple",t),this.selected=!1}get form(){return this.elementInternals.form}get labels(){return Object.freeze(Array.from(this.elementInternals.labels))}get selected(){return m.track(this,"selected"),!!this.currentSelected}set selected(e){this.currentSelected=e,A.enqueue(()=>{this.elementInternals&&(this.setFormValue(e?this.value:null),this.elementInternals.ariaSelected=e?"true":"false",$(this.elementInternals,"selected",e))}),m.notify(this,"selected")}get text(){return this.freeform?this.value.replace(/\s+/g," ").trim():(this.textAttribute??this.textContent)?.replace(/\s+/g," ").trim()??""}get value(){return m.track(this,"value"),this._value??this.text}set value(e){this._value=e,this.$fastController.isConnected&&(this.setFormValue(this.selected?e:null),this.freeformOutputs?.forEach(t=>{t.value=e}),m.notify(this,"value"))}connectedCallback(){super.connectedCallback(),this.freeform&&(this.value="",this.hidden=!0,this.selected=!1)}setFormValue(e,t){if(this.disabled){this.elementInternals.setFormValue(null);return}this.elementInternals.setFormValue(e,e??t)}toggleSelected(e=!this.selected){this.selected=e}}ne.formAssociated=!0,me([b],ne.prototype,"active",2),me([a({attribute:"current-selected",mode:"boolean"})],ne.prototype,"currentSelected",2),me([a({attribute:"selected",mode:"boolean"})],ne.prototype,"defaultSelected",2),me([b],ne.prototype,"descriptionSlot",2),me([b],ne.prototype,"disabled",2),me([a({attribute:"disabled",mode:"boolean"})],ne.prototype,"disabledAttribute",2),me([a({attribute:"form"})],ne.prototype,"formAttribute",2),me([a({mode:"boolean"})],ne.prototype,"freeform",2),me([a({attribute:"id"})],ne.prototype,"id",2),me([a({attribute:"value",mode:"fromView"})],ne.prototype,"initialValue",2),me([b],ne.prototype,"multiple",2),me([a],ne.prototype,"name",2),me([b],ne.prototype,"start",2),me([a({attribute:"text",mode:"fromView"})],ne.prototype,"textAttribute",2);const _b=u`
|
|
457
457
|
${w("inline-grid")}
|
|
458
458
|
|
|
459
459
|
:host{-webkit-tap-highlight-color:transparent;${na}
|
|
460
460
|
align-items:center;background-color:${S};border-radius:${C};box-sizing:border-box;color:${Pe};column-gap:${ie};cursor:pointer;grid-template-areas:'indicator start content';grid-template-columns:auto auto 1fr;min-height:32px;padding:${ge};text-align:start}.content{grid-area:content;line-height:1}::slotted([slot='start']){grid-area:start}:host(:hover){background-color:${cr};color:${Et}}:host(:active){background-color:${pi};color:${At}}:host(:disabled){background-color:${S};color:${_};cursor:default}.checkmark-16-filled{fill:currentColor;width:16px}slot[name='checked-indicator'] > *,::slotted([slot='checked-indicator']){aspect-ratio:1;flex:0 0 auto;grid-area:indicator;visibility:hidden}:host(${Ai}) :is(slot[name='checked-indicator'] > *,::slotted([slot='checked-indicator'])){visibility:visible}:host(${Wt}) .checkmark-16-filled,:host(:not(${Wt})) .checkmark-12-regular{display:none}:host(${Wt}) .checkmark-12-regular{background-color:${S};border-radius:${ze};border:${I} solid ${Me};box-sizing:border-box;cursor:pointer;fill:transparent;position:relative;visibility:visible;width:16px}:host(${Wt}${Ai}) .checkmark-12-regular{background-color:${gt};border-color:${vt};fill:${bt}}:host(:disabled${Wt}) .checkmark-12-regular{border-color:${ye}}:host(:disabled${Wt}${Ai}) .checkmark-12-regular{background-color:${et}}:host(${Gh}){border:${be} solid ${ue}}@supports (selector(:host(:has(*)))){:host(:has([slot='start']:not([size='16']))){column-gap:${ge}}}:host(${Kh}){column-gap:${ge};grid-template-areas:'indicator start content'
|
|
461
|
-
'indicator start description'}::slotted([slot='description']){color:${Z};grid-area:description;${aa}}@media (forced-colors:active){:host(:disabled){color:GrayText}}`,
|
|
461
|
+
'indicator start description'}::slotted([slot='description']){color:${Z};grid-area:description;${aa}}@media (forced-colors:active){:host(:disabled){color:GrayText}}`,Ob=g.partial(`
|
|
462
462
|
<svg aria-hidden="true" class="checkmark-16-filled" viewBox="0 0 16 16">
|
|
463
463
|
<path
|
|
464
464
|
d="M14.046 3.486a.75.75 0 0 1-.032 1.06l-7.93 7.474a.85.85 0 0 1-1.188-.022l-2.68-2.72a.75.75 0 1 1 1.068-1.053l2.234 2.267l7.468-7.038a.75.75 0 0 1 1.06.032"
|
|
@@ -469,22 +469,22 @@ const p=Object.freeze({prefix:"fluent",shadowRootMode:"open",registry:customElem
|
|
|
469
469
|
d="M9.854 3.146a.5.5 0 0 1 0 .708l-4.5 4.5a.5.5 0 0 1-.708 0l-2-2a.5.5 0 1 1 .708-.708L5 7.293l4.146-4.147a.5.5 0 0 1 .708 0"
|
|
470
470
|
/>
|
|
471
471
|
</svg>
|
|
472
|
-
`);function
|
|
472
|
+
`);function Eb(o={}){return g`<slot name="checked-indicator">${de(o.checkedIndicator)}</slot>${Ge(o)}<div class="content" part="content"><slot ${U({property:"freeformOutputs",filter:no("output")})}></slot></div><div class="description" part="description"><slot name="description" ${U("descriptionSlot")}></slot></div>`}const Ab=Eb({checkedIndicator:Ob}),Nb=ne.compose({name:`${p.prefix}-option`,template:Ab,styles:_b});Nb.define(p.registry);const Fb={success:"success",warning:"warning",error:"error"};var Mb=Object.defineProperty,Db=Object.getOwnPropertyDescriptor,zo=(o,e,t,r)=>{for(var i=r>1?void 0:r?Db(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&Mb(e,t,i),i};class Zt extends x{constructor(){super(),this.elementInternals=this.attachInternals(),this.validationState=null,this.elementInternals.role="progressbar"}indicatorChanged(){this.setIndicatorWidth()}validationStateChanged(e,t){kt(this.elementInternals,e,t,Fb)}valueChanged(e,t){this.elementInternals&&(this.elementInternals.ariaValueNow=typeof t=="number"?`${t}`:null),this.setIndicatorWidth()}minChanged(e,t){this.elementInternals&&(this.elementInternals.ariaValueMin=typeof t=="number"?`${t}`:null),this.setIndicatorWidth()}maxChanged(e,t){this.elementInternals&&(this.elementInternals.ariaValueMax=typeof t=="number"?`${t}`:null),this.setIndicatorWidth()}setIndicatorWidth(){CSS.supports("width: attr(value type(<number>))")||A.enqueue(()=>{if(typeof this.value!="number"){this.indicator?.style.removeProperty("width");return}const e=this.min??0,t=this.max??100,r=this.value??0,i=t-e,s=i===0?0:Math.fround((r-e)/i*100);this.indicator?.style.setProperty("width",`${s}%`)})}}zo([b],Zt.prototype,"indicator",2),zo([a({attribute:"validation-state"})],Zt.prototype,"validationState",2),zo([a({converter:re})],Zt.prototype,"value",2),zo([a({converter:re})],Zt.prototype,"min",2),zo([a({converter:re})],Zt.prototype,"max",2);var Lb=Object.defineProperty,Vb=Object.getOwnPropertyDescriptor,ma=(o,e,t,r)=>{for(var i=r>1?void 0:r?Vb(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&Lb(e,t,i),i};class ji extends Zt{}ma([a],ji.prototype,"thickness",2),ma([a],ji.prototype,"shape",2);const Hb=u`
|
|
473
473
|
${w("block")}
|
|
474
474
|
|
|
475
475
|
:host{width:100%;height:2px;overflow-x:hidden;background-color:${bo};border-radius:${C};contain:content;@supports (width:attr(value type(<number>))){--max:attr(max type(<number>),100);--min:attr(min type(<number>),0);--value:attr(value type(<number>),0);--indicator-width:clamp(0%,calc((var(--value) - var(--min)) / (var(--max) - var(--min)) * 100%),100%)}}:host([thickness='large']){height:4px}:host([shape='square']){border-radius:${br}}.indicator{background-color:${gt};border-radius:inherit;height:100%}:host([value]) .indicator{transition:all 0.2s ease-in-out;@supports (width:attr(value type(<number>))){width:var(--indicator-width)}}:host(:not([value])) .indicator{position:relative;width:33%;background-image:linear-gradient(
|
|
476
476
|
to right,${bo} 0%,${he} 50%,${bo} 100%
|
|
477
477
|
);animation-name:indeterminate;animation-duration:3s;animation-timing-function:linear;animation-iteration-count:infinite}:host([validation-state='error']) .indicator{background-color:${Cn}}:host([validation-state='warning']) .indicator{background-color:${Tn}}:host([validation-state='success']) .indicator{background-color:${zn}}@layer animations{@media (prefers-reduced-motion:no-preference){:host([value]){transition:none}:host(:not([value])) .indicator{animation-duration:0.01ms;animation-iteration-count:1}}}@keyframes indeterminate{0%{inset-inline-start:-33%}100%{inset-inline-start:100%}}`.withBehaviors(X(u`
|
|
478
|
-
:host{background-color:CanvasText}.indicator,:host(:is([validation-state='success'],[validation-state='warning'],[validation-state='error'])) .indicator{background-color:Highlight}`));function
|
|
478
|
+
:host{background-color:CanvasText}.indicator,:host(:is([validation-state='success'],[validation-state='warning'],[validation-state='error'])) .indicator{background-color:Highlight}`));function jb(){return g`<div class="indicator" part="indicator" ${z("indicator")}></div>`}const Rb=jb(),qb=ji.compose({name:`${p.prefix}-progress-bar`,template:Rb,styles:Hb});qb.define(p.registry);function Wb(o,e="-radio"){return nn(e)(o)}function va(o){const e=o.getRootNode();return e instanceof ShadowRoot?e.activeElement:document.activeElement}const $a=$e;var Gb=Object.defineProperty,Ub=Object.getOwnPropertyDescriptor,at=(o,e,t,r)=>{for(var i=r>1?void 0:r?Ub(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&Gb(e,t,i),i};class Re extends x{constructor(){super(),this.dirtyState=!1,this.elementInternals=this.attachInternals(),this.elementInternals.role="radiogroup",this.elementInternals.ariaOrientation=this.orientation??$a.horizontal}checkedIndexChanged(e,t){this.enabledRadios&&this.checkRadio(t)}disabledChanged(e,t){this.radios&&(this.checkedIndex=-1,this.radios?.forEach(r=>{r.disabled=!!r.disabledAttribute||!!this.disabled}),this.restrictFocus())}initialValueChanged(e,t){this.value=t??""}nameChanged(e,t){this.isConnected&&t&&this.radios?.forEach(r=>{r.name=this.name})}orientationChanged(e,t){this.elementInternals.ariaOrientation=this.orientation??$a.horizontal}radiosChanged(e,t){const r=t?.length;if(!r)return;!this.name&&t.every(n=>n.name===t[0].name)&&(this.name=t[0].name);const i=vl(this.enabledRadios,n=>n.initialChecked);t.forEach((n,c)=>{n.ariaPosInSet=`${c+1}`,n.ariaSetSize=`${r}`,this.initialValue&&!this.dirtyState?n.checked=n.value===this.initialValue:n.checked=c===i,n.name=this.name??n.name,n.disabled=!!this.disabled||!!n.disabledAttribute}),!this.dirtyState&&this.initialValue&&(this.value=this.initialValue),(!this.value||this.value&&typeof this.checkedIndex!="number"&&i>=0)&&(this.checkedIndex=i);const s=t.map(n=>n.id).join(" ").trim();s&&this.setAttribute("aria-owns",s),A.enqueue(()=>{this.restrictFocus()})}requiredChanged(e,t){this.elementInternals.ariaRequired=t?"true":null,this.setValidity()}slottedRadiosChanged(e,t){this.radios=[...this.querySelectorAll("*")].filter(r=>Wb(r))}get enabledRadios(){return this.disabled?[]:this.radios?.filter(e=>!e.disabled)??[]}get validationMessage(){if(this.elementInternals.validationMessage)return this.elementInternals.validationMessage;if(this.enabledRadios?.[0]?.validationMessage)return this.enabledRadios[0].validationMessage;if(!this._validationFallbackMessage){const e=document.createElement("input");e.type="radio",e.required=!0,e.checked=!1,this._validationFallbackMessage=e.validationMessage}return this._validationFallbackMessage}get validity(){return this.elementInternals.validity}get value(){return m.notify(this,"value"),this.enabledRadios.find(e=>e.checked)?.value??null}set value(e){const t=this.enabledRadios.findIndex(r=>r.value===e);this.checkedIndex=t,this.$fastController.isConnected&&(this.setFormValue(e),this.setValidity()),m.track(this,"value")}changeHandler(e){if(this===e.target)return!0;this.dirtyState=!0;const t=this.enabledRadios.indexOf(e.target);return this.checkRadio(t),this.radios?.filter(r=>r.disabled)?.forEach(r=>{r.checked=!1}),!0}checkRadio(e=this.checkedIndex,t=!1){let r=this.checkedIndex;this.enabledRadios.forEach((i,s)=>{const n=s===e;i.checked=n,n&&(r=s,t&&i.$emit("change"))}),this.checkedIndex=r,this.setFormValue(this.value),this.setValidity()}checkValidity(){return this.elementInternals.checkValidity()}clickHandler(e){return this===e.target&&this.enabledRadios[Math.max(0,this.checkedIndex)]?.focus(),!0}focus(){this.enabledRadios[Math.max(0,this.checkedIndex)]?.focus()}focusinHandler(e){return this.disabled||this.enabledRadios.forEach(t=>{t.tabIndex=0}),!0}focusoutHandler(e){return this.radios?.includes(e.relatedTarget)&&this.radios?.some(t=>t.checked)&&this.restrictFocus(),!0}formResetCallback(){this.dirtyState=!1,this.checkedIndex=-1,this.setFormValue(this.value),this.setValidity()}getEnabledIndexInBounds(e,t=this.enabledRadios.length){return t===0?-1:(e+t)%t}keydownHandler(e){const t=or(this)==="rtl",r=this.enabledRadios.findIndex(n=>n===va(this))??this.checkedIndex;let i=0;switch(e.key){case"ArrowLeft":{i=t?1:-1;break}case"ArrowUp":{i=-1;break}case"ArrowRight":{i=t?-1:1;break}case"ArrowDown":{i=1;break}case"Tab":{this.restrictFocus();break}case" ":{this.checkRadio();break}}if(!i)return!0;const s=r+i;this.checkRadio(this.getEnabledIndexInBounds(s),!0),this.enabledRadios[this.checkedIndex]?.focus()}disabledRadioHandler(e){e.detail===!0&&e.target.checked&&(this.checkedIndex=-1)}reportValidity(){return this.elementInternals.reportValidity()}restrictFocus(){let e=Math.max(this.checkedIndex,0);const t=this.enabledRadios.indexOf(va(this));t!==-1&&(e=t),e=this.getEnabledIndexInBounds(e),this.enabledRadios.forEach((r,i)=>{r.tabIndex=i===e?0:-1})}setFormValue(e,t){this.elementInternals.setFormValue(e,e??t)}setValidity(e,t,r){if(this.$fastController.isConnected){if(!(this.required&&!this.value&&!this.disabled)){this.enabledRadios?.forEach(c=>{c.elementInternals.setValidity({})});return}const s={valueMissing:!0,...e},n=t??this.validationMessage;this.enabledRadios?.forEach((c,h)=>{h===0?c.elementInternals.setValidity(s,n,c):c.elementInternals.setValidity({})})}}}Re.formAssociated=!0,at([b],Re.prototype,"checkedIndex",2),at([a({attribute:"disabled",mode:"boolean"})],Re.prototype,"disabled",2),at([a({attribute:"value",mode:"fromView"})],Re.prototype,"initialValue",2),at([a],Re.prototype,"name",2),at([a],Re.prototype,"orientation",2),at([b],Re.prototype,"radios",2),at([a({mode:"boolean"})],Re.prototype,"required",2),at([b],Re.prototype,"slottedRadios",2);class Xb extends Re{}const Kb=u`
|
|
479
479
|
${w("flex")}
|
|
480
480
|
|
|
481
|
-
:host{-webkit-tap-highlight-color:transparent;cursor:pointer;gap:${Ci}}:host([orientation='vertical']){flex-direction:column;justify-content:flex-start}:host([orientation='horizontal']){flex-direction:row}::slotted(*){color:${Z}}::slotted(:hover){color:${Pe}}::slotted(:active){color:${B}}::slotted(${fe}){color:${_}}::slotted(${y}){color:${B}}:host([slot='input']){margin:${se} ${Be}}`;function
|
|
481
|
+
:host{-webkit-tap-highlight-color:transparent;cursor:pointer;gap:${Ci}}:host([orientation='vertical']){flex-direction:column;justify-content:flex-start}:host([orientation='horizontal']){flex-direction:row}::slotted(*){color:${Z}}::slotted(:hover){color:${Pe}}::slotted(:active){color:${B}}::slotted(${fe}){color:${_}}::slotted(${y}){color:${B}}:host([slot='input']){margin:${se} ${Be}}`;function Yb(){return g`<template @disabled="${(o,e)=>o.disabledRadioHandler(e.event)}" @change="${(o,e)=>o.changeHandler(e.event)}" @click="${(o,e)=>o.clickHandler(e.event)}" @focusin="${(o,e)=>o.focusinHandler(e.event)}" @focusout="${(o,e)=>o.focusoutHandler(e.event)}" @keydown="${(o,e)=>o.keydownHandler(e.event)}"><slot ${U("slottedRadios")}></slot></template>`}const Qb=Yb(),Zb=Xb.compose({name:`${p.prefix}-radio-group`,template:Qb,styles:Kb});Zb.define(p.registry);class Jb extends Ce{constructor(){super(),this.elementInternals.role="radio"}disabledChanged(e,t){super.disabledChanged(e,t),this.$emit("disabled",t,{bubbles:!0})}requiredChanged(){}setFormValue(){}setValidity(){this.elementInternals.setValidity({})}toggleChecked(e=!0){super.toggleChecked(e)}}const eg=u`
|
|
482
482
|
${w("inline-flex")}
|
|
483
483
|
|
|
484
484
|
:host{--size:16px;aspect-ratio:1;background-color:${S};border:${I} solid ${Me};border-radius:${xe};box-sizing:border-box;position:relative;width:var(--size)}:host([size='large']){--size:20px}.checked-indicator{aspect-ratio:1;border-radius:${xe};color:${bt};inset:0;margin:auto;position:absolute;width:calc(var(--size) * 0.625)}:host(:not([slot='input']))::after{content:'' / '';position:absolute;display:block;inset:-8px;box-sizing:border-box;outline:none;border:${be} solid ${K};border-radius:${C}}:host(:not([slot='input']):focus-visible)::after{border-color:${ue}}:host(:hover){border-color:${ft}}:host(${y}){border-color:${vt}}:host(${y}) .checked-indicator{background-color:${gt}}:host(${y}:hover) .checked-indicator{background-color:${Nt}}:host(:active){border-color:${mt}}:host(${y}:active) .checked-indicator{background-color:${Ft}}:host(:focus-visible){outline:none}:host(${fe}){background-color:${et};border-color:${ye}}:host(${y}${fe}) .checked-indicator{background-color:${ye}}`.withBehaviors(X(u`
|
|
485
|
-
:host{border-color:FieldText}:host(:not([slot='input']:focus-visible))::after{border-color:Canvas}:host(:not(${fe}):hover),:host(:not([slot='input']):focus-visible)::after{border-color:Highlight}.checked-indicator{color:HighlightText}:host(${y}) .checked-indicator{background-color:FieldText}:host(${y}:not(${fe}):hover) .checked-indicator{background-color:Highlight}:host(${fe}){border-color:GrayText;color:GrayText}:host(${fe}${y}) .checked-indicator{background-color:GrayText}`)),
|
|
485
|
+
:host{border-color:FieldText}:host(:not([slot='input']:focus-visible))::after{border-color:Canvas}:host(:not(${fe}):hover),:host(:not([slot='input']):focus-visible)::after{border-color:Highlight}.checked-indicator{color:HighlightText}:host(${y}) .checked-indicator{background-color:FieldText}:host(${y}:not(${fe}):hover) .checked-indicator{background-color:Highlight}:host(${fe}){border-color:GrayText;color:GrayText}:host(${fe}${y}) .checked-indicator{background-color:GrayText}`)),tg=g.partial(`
|
|
486
486
|
<span part="checked-indicator" class="checked-indicator" role="presentation"></span>
|
|
487
|
-
`);function
|
|
487
|
+
`);function og(o={}){return g`<template @click="${(e,t)=>e.clickHandler(t.event)}" @keydown="${(e,t)=>e.keydownHandler(t.event)}" @keyup="${(e,t)=>e.keyupHandler(t.event)}"><slot name="checked-indicator">${de(o.checkedIndicator)}</slot></template>`}const rg=og({checkedIndicator:tg}),ig=Jb.compose({name:`${p.prefix}-radio`,template:rg,styles:eg});ig.define(p.registry);var sg=Object.defineProperty,ng=Object.getOwnPropertyDescriptor,Bo=(o,e,t,r)=>{for(var i=r>1?void 0:r?ng(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&sg(e,t,i),i};const ag=CSS.supports("width: attr(value type(<number>))"),Jt={max:"--_attr-max",value:"--_attr-value",maskImageFilled:"--_mask-image-filled",maskImageOutlined:"--_mask-image-outlined"};function Dr(o){return o?["data:image/svg+xml",encodeURIComponent(o.replace(/\n/g,"").replace(/\s+/g," "))].join(","):""}class eo extends x{constructor(){super(),this.elementInternals=this.attachInternals(),this.defaultCustomIconViewBox="0 0 20 20",this.elementInternals.role="img",this.numberFormatter=new Intl.NumberFormat}iconSlotChanged(){this.handleSlotChange()}maxChanged(){this.setCustomPropertyValue("max")}valueChanged(){this.setCustomPropertyValue("value")}connectedCallback(){super.connectedCallback(),this.setCustomPropertyValue("value"),this.setCustomPropertyValue("max")}get formattedCount(){return this.count?this.numberFormatter.format(this.count):""}handleSlotChange(){const e=this.iconSlot.assignedElements()?.find(t=>t.nodeName.toLowerCase()==="svg");this.renderSlottedIcon(e??null)}renderSlottedIcon(e){if(!e){this.display.style.removeProperty(Jt.maskImageFilled),this.display.style.removeProperty(Jt.maskImageOutlined);return}const t=e.innerHTML,r=e.getAttribute("viewBox")??this.iconViewBox??this.defaultCustomIconViewBox,i=`
|
|
488
488
|
<svg
|
|
489
489
|
viewBox="${r}"
|
|
490
490
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -495,22 +495,22 @@ const p=Object.freeze({prefix:"fluent",shadowRootMode:"open",registry:customElem
|
|
|
495
495
|
fill="none"
|
|
496
496
|
stroke="black"
|
|
497
497
|
stroke-width="2"
|
|
498
|
-
>${t}</svg>`;this.display.style.setProperty(Jt.maskImageFilled,`url(${Dr(i)})`),this.display.style.setProperty(Jt.maskImageOutlined,`url(${Dr(s)})`)}setCustomPropertyValue(e){requestAnimationFrame(()=>{if(!this.display||
|
|
498
|
+
>${t}</svg>`;this.display.style.setProperty(Jt.maskImageFilled,`url(${Dr(i)})`),this.display.style.setProperty(Jt.maskImageOutlined,`url(${Dr(s)})`)}setCustomPropertyValue(e){requestAnimationFrame(()=>{if(!this.display||ag)return;const t=this[e];typeof t!="number"||Number.isNaN(t)?this.display.style.removeProperty(Jt[e]):this.display.style.setProperty(Jt[e],`${t}`)})}}Bo([b],eo.prototype,"iconSlot",2),Bo([a({converter:re})],eo.prototype,"count",2),Bo([a({attribute:"icon-view-box"})],eo.prototype,"iconViewBox",2),Bo([a({converter:re})],eo.prototype,"max",2),Bo([a({converter:re})],eo.prototype,"value",2);var lg=Object.defineProperty,cg=Object.getOwnPropertyDescriptor,Ri=(o,e,t,r)=>{for(var i=r>1?void 0:r?cg(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&lg(e,t,i),i};class Lr extends eo{constructor(){super(...arguments),this.compact=!1}}Ri([a],Lr.prototype,"color",2),Ri([a],Lr.prototype,"size",2),Ri([a({mode:"boolean"})],Lr.prototype,"compact",2);const ya='<path d="M5.28347 1.54605C5.57692 0.951448 6.42479 0.951449 6.71825 1.54605L7.82997 3.79866L10.3159 4.15988C10.9721 4.25523 11.2341 5.0616 10.7592 5.52443L8.96043 7.27785L9.38507 9.7537C9.49716 10.4072 8.81122 10.9056 8.22431 10.597L6.00086 9.4281L3.7774 10.597C3.19049 10.9056 2.50455 10.4072 2.61664 9.7537L3.04128 7.27784L1.24246 5.52443C0.767651 5.0616 1.02966 4.25523 1.68584 4.15988L4.17174 3.79865L5.28347 1.54605Z" />',dg=`
|
|
499
499
|
<svg viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg">${ya}</svg>
|
|
500
|
-
`,
|
|
500
|
+
`,hg=`
|
|
501
501
|
<svg viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"
|
|
502
502
|
fill="none" stroke="black" stroke-width="2"
|
|
503
503
|
>${ya}</svg>
|
|
504
|
-
`;function
|
|
504
|
+
`;function ug(){return g`<div ${z("display")} class="display" aria-hidden="true"></div><slot name="icon" ${z("iconSlot")} @slotchange="${o=>o.handleSlotChange()}"></slot><slot name="value"><span class="value-label" aria-hidden="true">${o=>o.value}</span></slot><slot name="count"><span class="count-label" aria-hidden="true">${o=>o.formattedCount}</span></slot>`}const pg=ug(),bg=u`
|
|
505
505
|
${w("inline-flex")}
|
|
506
506
|
|
|
507
|
-
:host{--_icon-size:16px;--_icon-gradient-degree:90deg;--_icon-color-value:${fc};--_icon-color-empty:${En};--_default-value:0;--_default-max:5;--_mask-image-filled:url(${Dr(
|
|
507
|
+
:host{--_icon-size:16px;--_icon-gradient-degree:90deg;--_icon-color-value:${fc};--_icon-color-empty:${En};--_default-value:0;--_default-max:5;--_mask-image-filled:url(${Dr(dg)});--_mask-image-outlined:url(${Dr(hg)});--_mask-position-x:left;align-items:center;color:${B};font-family:${v};font-size:${F};line-height:${q};contain:layout style;user-select:none}:host(:dir(rtl)){--_icon-gradient-degree:-90deg;--_mask-position-x:right}:host([size='small']){--_icon-size:12px}:host([size='large']){--_icon-size:20px;font-size:${O};line-height:${M}}::slotted([slot='icon']){display:none}:host([color='neutral']){--_icon-color-value:${B};--_icon-color-empty:${bo}}:host([color='brand']){--_icon-color-value:${lr};--_icon-color-empty:${$n}}@supports (width:attr(value type(<number>))){:host{--_attr-value:attr(value type(<number>));--_attr-max:attr(max type(<number>))}}:host([compact]) .display{--_max:1}.display{--_value:max(0,round(var(--_attr-value,var(--_default-value)) * 2) / 2);--_max:max(1,var(--_attr-max,var(--_default-max)));--_mask-inline-size:calc(var(--_icon-size) + ${V});--_icon-gradient-stop-visual-adjustment:0px;--_icon-gradient-stop:calc(
|
|
508
508
|
var(--_mask-inline-size) * var(--_value) - var(--_icon-gradient-stop-visual-adjustment)
|
|
509
509
|
);background-image:linear-gradient(
|
|
510
510
|
var(--_icon-gradient-degree),var(--_icon-color-value) var(--_icon-gradient-stop),var(--_icon-color-empty) calc(var(--_icon-gradient-stop) + 0.5px)
|
|
511
511
|
);block-size:var(--_icon-size);display:grid;inline-size:calc(var(--_max) * var(--_mask-inline-size) - ${V} / 2);mask-image:var(--_mask-image-filled);mask-repeat:repeat no-repeat;mask-size:var(--_mask-inline-size) var(--_icon-size);mask-position:var(--_mask-position-x) center}.value-label,::slotted([slot='value']){display:block;margin-inline-start:${ie};font-weight:${L}}:host([size='small']) .value-label,:host([size='small']) ::slotted([slot='value']){margin-inline-start:${V}}:host([size='large']) .value-label,:host([size='large']) ::slotted([slot='value']){margin-inline-start:${ge}}:host(:not([count])) .count-label{display:none}.count-label::before,::slotted([slot='count'])::before{content:'·';margin-inline:${ie}}:host([size='small']) .count-label::before,:host([size='small']) ::slotted([slot='count'])::before{margin-inline:${V}}:host([size='large']) .count-label::before,:host([size='large']) ::slotted([slot='count'])::before{margin-inline:${ge}}`.withBehaviors(X(u`
|
|
512
|
-
.display{--_icon-color-value:CanvasText;--_icon-color-empty:Canvas;--_icon-gradient-stop-visual-adjustment:0.5px;forced-color-adjust:none}.display::before{background-color:var(--_icon-color-value);content:'';grid-area:1 / 1 / -1 / -1;mask:inherit;mask-image:var(--_mask-image-outlined)}`)),
|
|
513
|
-
:host{--step-rate:${e}%}`,this.$fastController.addStyles(this.stepStyles)}else this.stepStyles!==void 0&&this.$fastController.removeStyles(this.stepStyles)}initialValueChanged(e,t){this.$fastController.isConnected?this.value=t:this._value=t}get validity(){return this.elementInternals.validity}get validationMessage(){return this.elementInternals.validationMessage}get willValidate(){return this.elementInternals.willValidate}checkValidity(){return this.elementInternals.checkValidity()}reportValidity(){return this.elementInternals.reportValidity()}setCustomValidity(e){this.setValidity({customError:!!e},e)}setValidity(e,t,r){if(this.$fastController.isConnected){if(this.isDisabled){this.elementInternals.setValidity({});return}this.elementInternals.setValidity({customError:!!t,...e},t??this.validationMessage,r)}}get value(){return m.track(this,"value"),this._value?.toString()??""}set value(e){if(!this.$fastController.isConnected){this._value=e.toString();return}const t=parseFloat(e),r=sn(this.minAsNumber,this.maxAsNumber,this.convertToConstrainedValue(t)).toString();if(r!==e){this.value=r;return}this._value=e.toString(),this.elementInternals.ariaValueNow=this._value,this.elementInternals.ariaValueText=this.valueTextFormatter(this._value),this.setSliderPosition(),this.$emit("change"),this.setFormValue(e),m.notify(this,"value")}formResetCallback(){this.value=this.initialValue??this.midpoint}formDisabledCallback(e){this.setDisabledSideEffect(e)}setFormValue(e,t){this.elementInternals.setFormValue(e,e??t)}directionChanged(){this.setSliderPosition()}get valueAsNumber(){return parseFloat(this.value)}set valueAsNumber(e){this.value=e.toString()}valueTextFormatterChanged(){typeof this.valueTextFormatter=="function"?this.elementInternals.ariaValueText=this.valueTextFormatter(this._value):this.elementInternals.ariaValueText=""}disabledChanged(){this.setDisabledSideEffect(this.disabled)}get isDisabled(){return this.disabled||this.elementInternals?.ariaDisabled==="true"||this.isConnected&&this.matches(":disabled")}minChanged(){this.elementInternals.ariaValueMin=`${this.minAsNumber}`,this.$fastController.isConnected&&this.minAsNumber>this.valueAsNumber&&(this.value=this.min)}get minAsNumber(){if(this.min!==void 0){const e=parseFloat(this.min);if(!Number.isNaN(e))return e}return 0}maxChanged(){this.elementInternals.ariaValueMax=`${this.maxAsNumber}`,this.$fastController.isConnected&&this.maxAsNumber<this.valueAsNumber&&(this.value=this.max)}get maxAsNumber(){if(this.max!==void 0){const e=parseFloat(this.max);if(!Number.isNaN(e))return e}return 100}stepChanged(){this.updateStepMultiplier(),this.$fastController.isConnected&&(this.value=this._value)}get stepAsNumber(){if(this.step!==void 0){const e=parseFloat(this.step);if(!Number.isNaN(e)&&e>0)return e}return 1}orientationChanged(e,t){this.elementInternals.ariaOrientation=t??$e.horizontal,this.$fastController.isConnected&&this.setSliderPosition()}connectedCallback(){super.connectedCallback(),requestAnimationFrame(()=>{if(!this.$fastController.isConnected)return;this.direction=or(this),this.setDisabledSideEffect(this.disabled),this.updateStepMultiplier(),this.setupTrackConstraints(),this.setupDefaultValue(),this.setSliderPosition(),this.handleStepStyles();const e=m.getNotifier(this);e.subscribe(this,"max"),e.subscribe(this,"min"),e.subscribe(this,"step")})}disconnectedCallback(){super.disconnectedCallback();const e=m.getNotifier(this);e.unsubscribe(this,"max"),e.unsubscribe(this,"min"),e.unsubscribe(this,"step")}increment(){const e=this.direction!==Fe.rtl?Number(this.value)+this.stepAsNumber:Number(this.value)-this.stepAsNumber,t=this.convertToConstrainedValue(e),r=t<this.maxAsNumber?`${t}`:`${this.maxAsNumber}`;this.value=r}decrement(){const e=this.direction!==Fe.rtl?Number(this.value)-Number(this.stepAsNumber):Number(this.value)+Number(this.stepAsNumber),t=this.convertToConstrainedValue(e),r=t>this.minAsNumber?`${t}`:`${this.minAsNumber}`;this.value=r}handleKeydown(e){if(this.isDisabled)return!0;switch(e.key){case er:e.preventDefault(),this.value=this.direction!==Fe.rtl&&this.orientation!==$e.vertical?`${this.minAsNumber}`:`${this.maxAsNumber}`;break;case Jo:e.preventDefault(),this.value=this.direction!==Fe.rtl&&this.orientation!==$e.vertical?`${this.maxAsNumber}`:`${this.minAsNumber}`;break;case Qo:case Zo:e.shiftKey||(e.preventDefault(),this.increment());break;case Yo:case Ko:e.shiftKey||(e.preventDefault(),this.decrement());break}return!0}setSliderPosition(){const t=xa(parseFloat(this.value),this.minAsNumber,this.maxAsNumber,this.orientation===$e.vertical?void 0:this.direction)*100;this.position=`--slider-thumb: ${t}%; --slider-progress: ${t}%`}updateStepMultiplier(){const e=this.stepAsNumber+"",t=this.stepAsNumber%1?e.length-e.indexOf(".")-1:0;this.stepMultiplier=Math.pow(10,t)}get midpoint(){return`${this.convertToConstrainedValue((this.maxAsNumber+this.minAsNumber)/2)}`}setupDefaultValue(){this._value||(this.value=this.initialValue??this.midpoint),!Number.isNaN(this.valueAsNumber)&&(this.valueAsNumber<this.minAsNumber||this.valueAsNumber>this.maxAsNumber)&&(this.value=this.midpoint),this.elementInternals.ariaValueNow=this.value}calculateNewValue(e){this.setupTrackConstraints();const t=xa(e,this.orientation===$e.vertical?this.trackMinHeight:this.trackMinWidth,this.orientation===$e.vertical?this.trackHeight:this.trackWidth,this.orientation===$e.vertical?void 0:this.direction),r=(this.maxAsNumber-this.minAsNumber)*t+this.minAsNumber;return this.convertToConstrainedValue(r)}convertToConstrainedValue(e){isNaN(e)&&(e=this.minAsNumber);let t=e-this.minAsNumber;const r=Math.round(t/this.stepAsNumber),i=t-r*(this.stepMultiplier*this.stepAsNumber)/this.stepMultiplier;return t=i>=Number(this.stepAsNumber)/2?t-i+Number(this.stepAsNumber):t-i,t+this.minAsNumber}setDisabledSideEffect(e=this.isDisabled){A.enqueue(()=>{this.elementInternals.ariaDisabled=e.toString(),this.tabIndex=e?-1:0})}}W.formAssociated=!0,ee([a],W.prototype,"size",2),ee([a({attribute:"value",mode:"fromView"})],W.prototype,"initialValue",2),ee([b],W.prototype,"direction",2),ee([b],W.prototype,"isDragging",2),ee([b],W.prototype,"position",2),ee([b],W.prototype,"trackWidth",2),ee([b],W.prototype,"trackMinWidth",2),ee([b],W.prototype,"trackHeight",2),ee([b],W.prototype,"trackLeft",2),ee([b],W.prototype,"trackMinHeight",2),ee([b],W.prototype,"valueTextFormatter",2),ee([a({mode:"boolean"})],W.prototype,"disabled",2),ee([a({converter:ci})],W.prototype,"min",2),ee([a({converter:ci})],W.prototype,"max",2),ee([a({converter:ci})],W.prototype,"step",2),ee([a],W.prototype,"orientation",2),ee([a],W.prototype,"mode",2);const
|
|
512
|
+
.display{--_icon-color-value:CanvasText;--_icon-color-empty:Canvas;--_icon-gradient-stop-visual-adjustment:0.5px;forced-color-adjust:none}.display::before{background-color:var(--_icon-color-value);content:'';grid-area:1 / 1 / -1 / -1;mask:inherit;mask-image:var(--_mask-image-outlined)}`)),gg=Lr.compose({name:`${p.prefix}-rating-display`,template:pg,styles:bg});gg.define(p.registry);function xa(o,e,t,r){let i=sn(0,1,(o-e)/(t-e));return r===Fe.rtl&&(i=1-i),i}const fg=$e,mg={singleValue:"single-value"};var vg=Object.defineProperty,$g=Object.getOwnPropertyDescriptor,ee=(o,e,t,r)=>{for(var i=r>1?void 0:r?$g(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&vg(e,t,i),i};class W extends x{constructor(){super(),this.elementInternals=this.attachInternals(),this.direction=Fe.ltr,this.isDragging=!1,this.trackWidth=0,this.trackMinWidth=0,this.trackHeight=0,this.trackLeft=0,this.trackMinHeight=0,this.valueTextFormatter=()=>"",this.disabled=!1,this.min="",this.max="",this.step="",this.mode=mg.singleValue,this.setupTrackConstraints=()=>{const e=this.track.getBoundingClientRect();this.trackWidth=this.track.clientWidth,this.trackMinWidth=this.track.clientLeft,this.trackHeight=e.top,this.trackMinHeight=e.bottom,this.trackLeft=this.getBoundingClientRect().left,this.trackWidth===0&&(this.trackWidth=1)},this.handleThumbPointerDown=e=>{if(this.isDisabled)return!0;const t=e!==null?window.addEventListener:window.removeEventListener;return t("pointerup",this.handleWindowPointerUp),t("pointermove",this.handlePointerMove,{passive:!0}),t("touchmove",this.handlePointerMove,{passive:!0}),t("touchend",this.handleWindowPointerUp),this.isDragging=e!==null,!0},this.handlePointerMove=e=>{if(this.isDisabled||e.defaultPrevented)return;const t=window.TouchEvent&&e instanceof TouchEvent?e.touches[0]:e,r=this.thumb.getBoundingClientRect().width,i=this.orientation===$e.vertical?t.pageY-document.documentElement.scrollTop:t.pageX-document.documentElement.scrollLeft-this.trackLeft-r/2;this.value=`${this.calculateNewValue(i)}`},this.handleWindowPointerUp=()=>{this.stopDragging()},this.stopDragging=()=>{this.isDragging=!1,this.handlePointerDown(null),this.handleThumbPointerDown(null)},this.handlePointerDown=e=>{if(e===null||!this.isDisabled){const t=e!==null?window.addEventListener:window.removeEventListener,r=e!==null?document.addEventListener:document.removeEventListener;t("pointerup",this.handleWindowPointerUp),r("mouseleave",this.handleWindowPointerUp),t("pointermove",this.handlePointerMove);const i=this.thumb.getBoundingClientRect().width;if(e){this.setupTrackConstraints();const s=this.orientation===$e.vertical?e.pageY-document.documentElement.scrollTop:e.pageX-document.documentElement.scrollLeft-this.trackLeft-i/2;this.value=`${this.calculateNewValue(s)}`}}return!0},this.elementInternals.role="slider",this.elementInternals.ariaOrientation=this.orientation??fg.horizontal}get labels(){return Object.freeze(Array.from(this.elementInternals.labels))}handleChange(e,t){switch(t){case"min":case"max":this.setSliderPosition();case"step":this.handleStepStyles();break}}handleStepStyles(){if(this.step){const e=100/Math.floor((this.maxAsNumber-this.minAsNumber)/this.stepAsNumber);this.stepStyles!==void 0&&this.$fastController.removeStyles(this.stepStyles),this.stepStyles=u`
|
|
513
|
+
:host{--step-rate:${e}%}`,this.$fastController.addStyles(this.stepStyles)}else this.stepStyles!==void 0&&this.$fastController.removeStyles(this.stepStyles)}initialValueChanged(e,t){this.$fastController.isConnected?this.value=t:this._value=t}get validity(){return this.elementInternals.validity}get validationMessage(){return this.elementInternals.validationMessage}get willValidate(){return this.elementInternals.willValidate}checkValidity(){return this.elementInternals.checkValidity()}reportValidity(){return this.elementInternals.reportValidity()}setCustomValidity(e){this.setValidity({customError:!!e},e)}setValidity(e,t,r){if(this.$fastController.isConnected){if(this.isDisabled){this.elementInternals.setValidity({});return}this.elementInternals.setValidity({customError:!!t,...e},t??this.validationMessage,r)}}get value(){return m.track(this,"value"),this._value?.toString()??""}set value(e){if(!this.$fastController.isConnected){this._value=e.toString();return}const t=parseFloat(e),r=sn(this.minAsNumber,this.maxAsNumber,this.convertToConstrainedValue(t)).toString();if(r!==e){this.value=r;return}this._value=e.toString(),this.elementInternals.ariaValueNow=this._value,this.elementInternals.ariaValueText=this.valueTextFormatter(this._value),this.setSliderPosition(),this.$emit("change"),this.setFormValue(e),m.notify(this,"value")}formResetCallback(){this.value=this.initialValue??this.midpoint}formDisabledCallback(e){this.setDisabledSideEffect(e)}setFormValue(e,t){this.elementInternals.setFormValue(e,e??t)}directionChanged(){this.setSliderPosition()}get valueAsNumber(){return parseFloat(this.value)}set valueAsNumber(e){this.value=e.toString()}valueTextFormatterChanged(){typeof this.valueTextFormatter=="function"?this.elementInternals.ariaValueText=this.valueTextFormatter(this._value):this.elementInternals.ariaValueText=""}disabledChanged(){this.setDisabledSideEffect(this.disabled)}get isDisabled(){return this.disabled||this.elementInternals?.ariaDisabled==="true"||this.isConnected&&this.matches(":disabled")}minChanged(){this.elementInternals.ariaValueMin=`${this.minAsNumber}`,this.$fastController.isConnected&&this.minAsNumber>this.valueAsNumber&&(this.value=this.min)}get minAsNumber(){if(this.min!==void 0){const e=parseFloat(this.min);if(!Number.isNaN(e))return e}return 0}maxChanged(){this.elementInternals.ariaValueMax=`${this.maxAsNumber}`,this.$fastController.isConnected&&this.maxAsNumber<this.valueAsNumber&&(this.value=this.max)}get maxAsNumber(){if(this.max!==void 0){const e=parseFloat(this.max);if(!Number.isNaN(e))return e}return 100}stepChanged(){this.updateStepMultiplier(),this.$fastController.isConnected&&(this.value=this._value)}get stepAsNumber(){if(this.step!==void 0){const e=parseFloat(this.step);if(!Number.isNaN(e)&&e>0)return e}return 1}orientationChanged(e,t){this.elementInternals.ariaOrientation=t??$e.horizontal,this.$fastController.isConnected&&this.setSliderPosition()}connectedCallback(){super.connectedCallback(),requestAnimationFrame(()=>{if(!this.$fastController.isConnected)return;this.direction=or(this),this.setDisabledSideEffect(this.disabled),this.updateStepMultiplier(),this.setupTrackConstraints(),this.setupDefaultValue(),this.setSliderPosition(),this.handleStepStyles();const e=m.getNotifier(this);e.subscribe(this,"max"),e.subscribe(this,"min"),e.subscribe(this,"step")})}disconnectedCallback(){super.disconnectedCallback();const e=m.getNotifier(this);e.unsubscribe(this,"max"),e.unsubscribe(this,"min"),e.unsubscribe(this,"step")}increment(){const e=this.direction!==Fe.rtl?Number(this.value)+this.stepAsNumber:Number(this.value)-this.stepAsNumber,t=this.convertToConstrainedValue(e),r=t<this.maxAsNumber?`${t}`:`${this.maxAsNumber}`;this.value=r}decrement(){const e=this.direction!==Fe.rtl?Number(this.value)-Number(this.stepAsNumber):Number(this.value)+Number(this.stepAsNumber),t=this.convertToConstrainedValue(e),r=t>this.minAsNumber?`${t}`:`${this.minAsNumber}`;this.value=r}handleKeydown(e){if(this.isDisabled)return!0;switch(e.key){case er:e.preventDefault(),this.value=this.direction!==Fe.rtl&&this.orientation!==$e.vertical?`${this.minAsNumber}`:`${this.maxAsNumber}`;break;case Jo:e.preventDefault(),this.value=this.direction!==Fe.rtl&&this.orientation!==$e.vertical?`${this.maxAsNumber}`:`${this.minAsNumber}`;break;case Qo:case Zo:e.shiftKey||(e.preventDefault(),this.increment());break;case Yo:case Ko:e.shiftKey||(e.preventDefault(),this.decrement());break}return!0}setSliderPosition(){const t=xa(parseFloat(this.value),this.minAsNumber,this.maxAsNumber,this.orientation===$e.vertical?void 0:this.direction)*100;this.position=`--slider-thumb: ${t}%; --slider-progress: ${t}%`}updateStepMultiplier(){const e=this.stepAsNumber+"",t=this.stepAsNumber%1?e.length-e.indexOf(".")-1:0;this.stepMultiplier=Math.pow(10,t)}get midpoint(){return`${this.convertToConstrainedValue((this.maxAsNumber+this.minAsNumber)/2)}`}setupDefaultValue(){this._value||(this.value=this.initialValue??this.midpoint),!Number.isNaN(this.valueAsNumber)&&(this.valueAsNumber<this.minAsNumber||this.valueAsNumber>this.maxAsNumber)&&(this.value=this.midpoint),this.elementInternals.ariaValueNow=this.value}calculateNewValue(e){this.setupTrackConstraints();const t=xa(e,this.orientation===$e.vertical?this.trackMinHeight:this.trackMinWidth,this.orientation===$e.vertical?this.trackHeight:this.trackWidth,this.orientation===$e.vertical?void 0:this.direction),r=(this.maxAsNumber-this.minAsNumber)*t+this.minAsNumber;return this.convertToConstrainedValue(r)}convertToConstrainedValue(e){isNaN(e)&&(e=this.minAsNumber);let t=e-this.minAsNumber;const r=Math.round(t/this.stepAsNumber),i=t-r*(this.stepMultiplier*this.stepAsNumber)/this.stepMultiplier;return t=i>=Number(this.stepAsNumber)/2?t-i+Number(this.stepAsNumber):t-i,t+this.minAsNumber}setDisabledSideEffect(e=this.isDisabled){A.enqueue(()=>{this.elementInternals.ariaDisabled=e.toString(),this.tabIndex=e?-1:0})}}W.formAssociated=!0,ee([a],W.prototype,"size",2),ee([a({attribute:"value",mode:"fromView"})],W.prototype,"initialValue",2),ee([b],W.prototype,"direction",2),ee([b],W.prototype,"isDragging",2),ee([b],W.prototype,"position",2),ee([b],W.prototype,"trackWidth",2),ee([b],W.prototype,"trackMinWidth",2),ee([b],W.prototype,"trackHeight",2),ee([b],W.prototype,"trackLeft",2),ee([b],W.prototype,"trackMinHeight",2),ee([b],W.prototype,"valueTextFormatter",2),ee([a({mode:"boolean"})],W.prototype,"disabled",2),ee([a({converter:ci})],W.prototype,"min",2),ee([a({converter:ci})],W.prototype,"max",2),ee([a({converter:ci})],W.prototype,"step",2),ee([a],W.prototype,"orientation",2),ee([a],W.prototype,"mode",2);const yg=u`
|
|
514
514
|
${w("inline-grid")}
|
|
515
515
|
|
|
516
516
|
:host{--thumb-size:20px;--track-margin-inline:calc(var(--thumb-size) / 2);--track-size:4px;--track-overhang:calc(var(--track-size) / -2);--rail-color:${gt};--track-color:${Me};--slider-direction:90deg;--border-radius:${C};--step-marker-inset:var(--track-overhang) -1px;position:relative;align-items:center;justify-content:center;box-sizing:border-box;outline:none;user-select:none;touch-action:none;min-width:120px;min-height:32px;grid-template-rows:1fr var(--thumb-size) 1fr;grid-template-columns:var(--track-margin-inline) 1fr var(--track-margin-inline)}:host(:hover){--rail-color:${Nt}}:host(:active){--rail-color:${Ft}}:host(:disabled){--rail-color:${_};--track-color:${et}}:host(:not(:disabled)){cursor:pointer}:host(:dir(rtl)){--slider-direction:-90deg}:host([size='small']){--thumb-size:16px;--track-overhang:-1px;--track-size:2px;--border-radius:${ze}}:host([orientation='vertical']){--slider-direction:0deg;--step-marker-inset:-1px var(--track-overhang);min-height:120px;grid-template-rows:var(--track-margin-inline) 1fr var(--track-margin-inline);grid-template-columns:1fr var(--thumb-size) 1fr;width:unset;min-width:32px;justify-items:center}:host(:not([slot='input']):focus-visible){box-shadow:0 0 0 2pt ${ue};outline:1px solid ${pr}}:host:after,.track{height:var(--track-size);width:100%}:host:after{background-image:linear-gradient(
|
|
@@ -518,39 +518,39 @@ const p=Object.freeze({prefix:"fluent",shadowRootMode:"open",registry:customElem
|
|
|
518
518
|
);border-radius:var(--border-radius);content:'';grid-row:1 / -1;grid-column:1 / -1}.track{position:relative;background-color:var(--track-color);grid-row:2 / 2;grid-column:2 / 2;forced-color-adjust:none;overflow:hidden}:host([orientation='vertical'])::after,:host([orientation='vertical']) .track{height:100%;width:var(--track-size)}.track::before{content:'';position:absolute;height:100%;border-radius:inherit;inset-inline-start:0;width:var(--slider-progress)}:host(:dir(rtl)) .track::before{width:calc(100% - var(--slider-progress))}:host([orientation='vertical']) .track::before{width:100%;bottom:0;height:var(--slider-progress)}:host([step]) .track::after{content:'';position:absolute;border-radius:inherit;inset:var(--step-marker-inset);background-image:repeating-linear-gradient(
|
|
519
519
|
var(--slider-direction),#0000 0%,#0000 calc(var(--step-rate) - 1px),${S} calc(var(--step-rate) - 1px),${S} var(--step-rate)
|
|
520
520
|
)}.thumb-container{position:absolute;grid-row:2 / 2;grid-column:2 / 2;transform:translateX(-50%);left:var(--slider-thumb)}:host([orientation='vertical']) .thumb-container{transform:translateY(50%);left:unset;bottom:var(--slider-thumb)}:host(:not(:active)) :is(.thumb-container,.track::before){transition:all 0.2s ease}.thumb{width:var(--thumb-size);height:var(--thumb-size);border-radius:${xe};box-shadow:0 0 0 calc(var(--thumb-size) * 0.2) ${S} inset;border:calc(var(--thumb-size) * 0.05) solid ${De};box-sizing:border-box}.thumb,.track::before{background-color:var(--rail-color)}`.withBehaviors(X(u`
|
|
521
|
-
.track:hover,.track:active,.track{background:WindowText}.thumb:hover,.thumb:active,.thumb{background:ButtonText}:host(:hover) .track::before,:host(:active) .track::before,.track::before{background:Highlight}`));function
|
|
521
|
+
.track:hover,.track:active,.track{background:WindowText}.thumb:hover,.thumb:active,.thumb{background:ButtonText}:host(:hover) .track::before,:host(:active) .track::before,.track::before{background:Highlight}`));function xg(o={}){return g`<template @pointerdown="${(e,t)=>e.handlePointerDown(t.event)}" @keydown="${(e,t)=>e.handleKeydown(t.event)}"><div ${z("track")} part="track-container" class="track" style="${e=>e.position}"></div><div ${z("thumb")} part="thumb-container" class="thumb-container" style="${e=>e.position}" @pointerdown="${(e,t)=>e.handleThumbPointerDown(t.event)}"><slot name="thumb">${de(o.thumb)}</slot></div></template>`}const kg=xg({thumb:'<div class="thumb"></div>'}),wg=W.compose({name:`${p.prefix}-slider`,template:kg,styles:yg});wg.define(p.registry);class Cg extends x{constructor(){super(),this.elementInternals=this.attachInternals(),this.elementInternals.role="progressbar"}}var Sg=Object.defineProperty,Ig=Object.getOwnPropertyDescriptor,ka=(o,e,t,r)=>{for(var i=r>1?void 0:r?Ig(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&Sg(e,t,i),i};class qi extends Cg{}ka([a],qi.prototype,"size",2),ka([a],qi.prototype,"appearance",2);const Pg=u`
|
|
522
522
|
${w("inline-flex")}
|
|
523
523
|
|
|
524
524
|
:host{--duration:1.5s;--indicatorSize:${Le};--size:32px;height:var(--size);width:var(--size);contain:strict;content-visibility:auto}:host([size='tiny']){--indicatorSize:${be};--size:20px}:host([size='extra-small']){--indicatorSize:${be};--size:24px}:host([size='small']){--indicatorSize:${be};--size:28px}:host([size='large']){--indicatorSize:${Le};--size:36px}:host([size='extra-large']){--indicatorSize:${Le};--size:40px}:host([size='huge']){--indicatorSize:${xi};--size:44px}.progress,.background,.spinner,.start,.end,.indicator{position:absolute;inset:0}.progress,.spinner,.indicator{animation:none var(--duration) infinite ${Sr}}.progress{animation-timing-function:linear;animation-name:spin-linear}.background{border:var(--indicatorSize) solid ${xn};border-radius:50%}:host([appearance='inverted']) .background{border-color:rgba(255,255,255,0.2)}.spinner{animation-name:spin-swing}.start{overflow:hidden;right:50%}.end{overflow:hidden;left:50%}.indicator{color:${yn};box-sizing:border-box;border-radius:50%;border:var(--indicatorSize) solid transparent;border-block-start-color:currentcolor;border-right-color:currentcolor}:host([appearance='inverted']) .indicator{color:${tc}}.start .indicator{rotate:135deg;inset:0 -100% 0 0;animation-name:spin-start}.end .indicator{rotate:135deg;inset:0 0 0 -100%;animation-name:spin-end}@keyframes spin-linear{100%{transform:rotate(360deg)}}@keyframes spin-swing{0%{transform:rotate(-135deg)}50%{transform:rotate(0deg)}100%{transform:rotate(225deg)}}@keyframes spin-start{0%,100%{transform:rotate(0deg)}50%{transform:rotate(-80deg)}}@keyframes spin-end{0%,100%{transform:rotate(0deg)}50%{transform:rotate(70deg)}}`.withBehaviors(X(u`
|
|
525
|
-
.background{display:none}.indicator{border-color:Canvas;border-block-start-color:Highlight;border-right-color:Highlight}`)),
|
|
525
|
+
.background{display:none}.indicator{border-color:Canvas;border-block-start-color:Highlight;border-right-color:Highlight}`)),zg=g`<slot name="indicator"><div class="background"></div><div class="progress"><div class="spinner"><div class="start"><div class="indicator"></div></div><div class="end"><div class="indicator"></div></div></div></div></slot>`,Bg=qi.compose({name:`${p.prefix}-spinner`,template:zg,styles:Pg});Bg.define(p.registry);class Tg extends Ce{constructor(){super(),this.elementInternals.role="switch"}}function _g(o={}){return g`<template @click="${(e,t)=>e.clickHandler(t.event)}" @input="${(e,t)=>e.inputHandler(t.event)}" @keydown="${(e,t)=>e.keydownHandler(t.event)}" @keyup="${(e,t)=>e.keyupHandler(t.event)}"><slot name="switch">${de(o.switch)}</slot></template>`}const Og=_g({switch:'<span class="checked-indicator" part="checked-indicator"></span>'}),Eg=u`
|
|
526
526
|
${w("inline-flex")}
|
|
527
527
|
|
|
528
528
|
:host{box-sizing:border-box;align-items:center;flex-direction:row;outline:none;user-select:none;contain:content;padding:0 ${V};width:40px;height:20px;background-color:${he};border:1px solid ${Me};border-radius:${xe}}:host(:enabled){cursor:pointer}:host(:hover){background:none;border-color:${ft}}:host(:active){border-color:${mt}}:host(:disabled),:host([readonly]){border:1px solid ${ye};background-color:none;pointer:default}:host(${y}){background:${gt};border-color:${gt}}:host(${y}:hover){background:${Nt};border-color:${Nt}}:host(${y}:active){background:${Ft};border-color:${Ft}}:host(${y}:disabled){background:${et};border-color:${ye}}.checked-indicator{height:14px;width:14px;border-radius:50%;margin-inline-start:0;background-color:${Z};transition-duration:${wr};transition-timing-function:${Sr};transition-property:margin-inline-start}:host(${y}) .checked-indicator{background-color:${bt};margin-inline-start:calc(100% - 14px)}:host(${y}:hover) .checked-indicator{background:${ql}}:host(${y}:active) .checked-indicator{background:${Wl}}:host(:hover) .checked-indicator{background-color:${El}}:host(:active) .checked-indicator{background-color:${Al}}:host(:disabled) .checked-indicator,:host([readonly]) .checked-indicator{background:${_}}:host(${y}:disabled) .checked-indicator{background:${_}}:host(:focus-visible){outline:none}:host(:not([slot='input']):focus-visible){border-color:${K};outline:${be} solid ${K};outline-offset:1px;box-shadow:${$r},0 0 0 2px ${ue}}`.withBehaviors(X(u`
|
|
529
|
-
:host{border-color:InactiveBorder}:host(${y}),:host(${y}:active),:host(${y}:hover){background:Highlight;border-color:Highlight}.checked-indicator,:host(:hover) .checked-indicator,:host(:active) .checked-indicator{background-color:ActiveCaption}:host(${y}) .checked-indicator,:host(${y}:hover) .checked-indicator,:host(${y}:active) .checked-indicator{background-color:ButtonFace}:host(:disabled) .checked-indicator,:host(${y}:disabled) .checked-indicator{background-color:GrayText}`)),
|
|
530
|
-
:host{--textContent:'${this.textContent}'}`,this.$fastController.addStyles(this.styles)}}
|
|
529
|
+
:host{border-color:InactiveBorder}:host(${y}),:host(${y}:active),:host(${y}:hover){background:Highlight;border-color:Highlight}.checked-indicator,:host(:hover) .checked-indicator,:host(:active) .checked-indicator{background-color:ActiveCaption}:host(${y}) .checked-indicator,:host(${y}:hover) .checked-indicator,:host(${y}:active) .checked-indicator{background-color:ButtonFace}:host(:disabled) .checked-indicator,:host(${y}:disabled) .checked-indicator{background-color:GrayText}`)),Ag=Tg.compose({name:`${p.prefix}-switch`,template:Og,styles:Eg});Ag.define(p.registry);var Ng=Object.defineProperty,Fg=Object.getOwnPropertyDescriptor,Mg=(o,e,t,r)=>{for(var i=r>1?void 0:r?Fg(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&Ng(e,t,i),i};class Wi extends x{constructor(){super(),this.elementInternals=this.attachInternals(),this.elementInternals.role="tab"}connectedCallback(){super.connectedCallback(),this.slot||(this.slot="tab"),this.disabled&&this.setAttribute("aria-disabled","true"),this.styles&&this.$fastController.removeStyles(this.styles),this.styles=u`
|
|
530
|
+
:host{--textContent:'${this.textContent}'}`,this.$fastController.addStyles(this.styles)}}Mg([a({mode:"boolean"})],Wi.prototype,"disabled",2),Je(Wi,Ze);function Dg(o={}){return g`<template slot="tab" role="tab" aria-disabled="${e=>e.disabled}">${Ge(o)}<span class="tab-content"><slot></slot></span>${pt(o)}</template>`}const Lg=Dg({}),Vg=u`
|
|
531
531
|
${w("inline-flex")}
|
|
532
532
|
|
|
533
533
|
:host{position:relative;flex-direction:row;align-items:center;cursor:pointer;box-sizing:border-box;justify-content:center;line-height:${M};font-family:${v};font-size:${O};color:${Pe};fill:currentcolor;grid-row:1;padding:${ae} ${Ve};border-radius:${C};gap:4px}:host .tab-content{display:inline-flex;flex-direction:column;padding:0 2px}:host([aria-selected='true']){color:${B};font-weight:${L}}:host .tab-content::after{content:var(--textContent);visibility:hidden;height:0;line-height:${M};font-weight:${L}}:host([aria-selected='true'])::after{background-color:${vt};border-radius:${xe};content:'';inset:0;position:absolute;z-index:2}:host([aria-selected='false']:hover)::after{background-color:${Mt};border-radius:${xe};content:'';inset:0;position:absolute;z-index:1}:host([aria-selected='true'][disabled])::after{background-color:${_}}::slotted([slot='start']),::slotted([slot='end']){display:flex}:host([disabled]){cursor:not-allowed;fill:${_};color:${_}}:host([disabled]:hover)::after{background-color:unset}:host(:focus){outline:none}:host(:focus-visible){border-radius:${ze};box-shadow:0 0 0 3px ${ue};outline:1px solid ${pr}}:host([data-hasIndent]){display:grid;grid-template-columns:20px 1fr auto}:host([data-hasIndent]) .tab-content{grid-column:2}`.withBehaviors(X(u`
|
|
534
|
-
:host([aria-selected='true'])::after{background-color:Highlight}`)),
|
|
534
|
+
:host([aria-selected='true'])::after{background-color:Highlight}`)),Hg=Wi.compose({name:`${p.prefix}-tab`,template:Lg,styles:Vg});Hg.define(p.registry);function jg(o,e="-tab"){return o?.nodeType!==Node.ELEMENT_NODE?!1:o.tagName.toLowerCase().endsWith(e)}const Rg=o=>o.getAttribute("aria-disabled")==="true"||o.elementInternals?.ariaDisabled==="true",qg=o=>o.hasAttribute("hidden"),Vr=o=>!Rg(o)&&!qg(o),Wg={subtle:"subtle",transparent:"transparent"},lt=$e;var Gg=Object.defineProperty,Ug=Object.getOwnPropertyDescriptor,To=(o,e,t,r)=>{for(var i=r>1?void 0:r?Ug(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&Gg(e,t,i),i};class to extends x{constructor(){super(),this.elementInternals=this.attachInternals(),this.disabled=!1,this.orientation=lt.horizontal,this.prevActiveTabIndex=0,this.activeTabIndex=0,this.tabPanelMap=new WeakMap,this.change=()=>{this.$emit("change",this.activetab)},this.handleTabClick=e=>{const t=e.currentTarget;t.disabled||this.disabled||t.nodeType===Node.ELEMENT_NODE&&Vr(t)&&(this.prevActiveTabIndex=this.activeTabIndex,this.activeTabIndex=this.tabs.indexOf(t),this.setComponent())},this.handleTabKeyDown=e=>{if(this.disabled)return;const t=or(this);switch(e.key){case Yo:if(!this.isHorizontal())return;e.preventDefault(),this.adjust(t==="ltr"?-1:1);break;case Qo:if(!this.isHorizontal())return;e.preventDefault(),this.adjust(t==="ltr"?1:-1);break;case Zo:if(this.isHorizontal())return;e.preventDefault(),this.adjust(-1);break;case Ko:if(this.isHorizontal())return;e.preventDefault(),this.adjust(1);break;case er:e.preventDefault(),this.adjust(-this.activeTabIndex);break;case Jo:e.preventDefault(),this.adjust(this.tabs.filter(r=>Vr(r)).length-this.activeTabIndex-1);break}},this.elementInternals.role="tablist",this.elementInternals.ariaOrientation=this.orientation??lt.horizontal}disabledChanged(e,t){$(this.elementInternals,"disabled",t),this.setTabs()}orientationChanged(e,t){this.elementInternals&&(this.elementInternals.ariaOrientation=t??lt.horizontal,kt(this.elementInternals,e,t,lt)),this.setTabs()}activeidChanged(e,t){if(this.tabs?.length>0){if(this.prevActiveTabIndex=this.tabs.findIndex(r=>r.id===e),this.setTabs(),e){const r=this.tabs[this.prevActiveTabIndex],i=this.tabPanelMap.get(r);i&&(i.hidden=!0)}if(t&&this.activetab){const r=this.tabPanelMap.get(this.activetab);r&&(r.hidden=!1)}e!==t&&this.change()}}slottedTabsChanged(e,t){this.tabs=t?.filter(r=>jg(r))??[]}tabsChanged(e,t){if(e?.length&&e.forEach(r=>{r.removeEventListener("click",this.handleTabClick),r.removeEventListener("keydown",this.handleTabKeyDown)}),this.tabs.length>0){this.tabIds=this.getTabIds(),this.setTabs();for(const r of this.tabs){const i=r.getAttribute("aria-controls")??"",n=this.getRootNode().getElementById(i);i&&n&&(n.role??(n.role="tabpanel"),n.hidden=this.activeid!==r.id,this.tabPanelMap.set(r,n))}}}getActiveIndex(){return this.activeid!==void 0?this.tabIds.indexOf(this.activeid)===-1?0:this.tabIds.indexOf(this.activeid):0}setTabs(){this.activeTabIndex=this.getActiveIndex();const e=this.tabs?.some(t=>!!t.querySelector("[slot='start']"));this.tabs?.forEach((t,r)=>{if(t.slot==="tab"){const i=this.activeTabIndex===r&&Vr(t),s=this.tabIds[r];t.disabled||(this.disabled?t.setAttribute("aria-disabled","true"):t.removeAttribute("aria-disabled")),t.setAttribute("id",s),t.setAttribute("aria-selected",i?"true":"false"),t.addEventListener("click",this.handleTabClick),t.addEventListener("keydown",this.handleTabKeyDown),t.setAttribute("tabindex",i&&!this.disabled?"0":"-1"),i&&(this.activetab=t,this.activeid=s),e&&this.orientation===lt.vertical&&t.setAttribute("data-hasIndent","")}})}getTabIds(){return this.tabs.map(e=>e.getAttribute("id")??`tab-${co()}`)}setComponent(){this.activeTabIndex!==this.prevActiveTabIndex&&(this.activeid=this.tabIds[this.activeTabIndex],this.focusTab())}isHorizontal(){return this.orientation===lt.horizontal}adjust(e){const t=this.tabs.filter(n=>Vr(n)),r=t.indexOf(this.activetab),i=xl(0,t.length-1,r+e),s=this.tabs.indexOf(t[i]);s>-1&&this.activateTabByIndex(this.tabs,s)}activateTabByIndex(e,t){const r=e[t];this.activetab=r,this.prevActiveTabIndex=this.activeTabIndex,this.activeTabIndex=t,r.focus(),this.setComponent()}focusTab(){this.tabs[this.activeTabIndex].focus()}connectedCallback(){super.connectedCallback(),Vt(this,()=>{this.tabIds=this.getTabIds(),this.setTabs()})}}To([a({mode:"boolean"})],to.prototype,"disabled",2),To([a],to.prototype,"orientation",2),To([a],to.prototype,"activeid",2),To([b],to.prototype,"slottedTabs",2),To([b],to.prototype,"tabs",2);var Xg=Object.defineProperty,Kg=Object.getOwnPropertyDescriptor,wa=(o,e,t,r)=>{for(var i=r>1?void 0:r?Kg(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&Xg(e,t,i),i};class Gi extends to{constructor(){super(...arguments),this.activeTabData={x:0,y:0,height:0,width:0},this.previousActiveTabData={x:0,y:0,height:0,width:0},this.activeTabOffset=0,this.activeTabScale=1,this.appearance=Wg.transparent}calculateAnimationProperties(e){this.activeTabOffset=this.getTabPosition(e),this.activeTabScale=this.getTabScale(e)}getTabPosition(e){return this.orientation===lt.horizontal?this.previousActiveTabData.x-(e.getBoundingClientRect().x-this.getBoundingClientRect().x):this.previousActiveTabData.y-(e.getBoundingClientRect().y-this.getBoundingClientRect().y)}getTabScale(e){return this.orientation===lt.horizontal?this.previousActiveTabData.width/e.getBoundingClientRect().width:this.previousActiveTabData.height/e.getBoundingClientRect().height}applyUpdatedCSSValues(e){this.calculateAnimationProperties(e),this.setAnimationVars()}animationLoop(e){e.setAttribute("data-animate","false"),this.applyUpdatedCSSValues(e),this.previousActiveTabData=this.activeTabData,this.applyUpdatedCSSValues(e),e.setAttribute("data-animate","true")}setTabData(){if(this.tabs&&this.tabs.length>0){const e=this.tabs,r=(this.activetab||e[0])?.getBoundingClientRect(),i=this.getBoundingClientRect();this.activeTabData={x:r.x-i.x,y:r.y-i.y,height:r.height,width:r.width},this.previousActiveTabData?.x!==this.activeTabData?.x&&this.previousActiveTabData?.y!==this.activeTabData?.y&&(this.previousActiveTabData=this.activeTabData)}}setAnimationVars(){this.style.setProperty("--tabIndicatorOffset",`${this.activeTabOffset}px`),this.style.setProperty("--tabIndicatorScale",`${this.activeTabScale}`)}activeidChanged(e,t){super.activeidChanged(e,t),this.setTabData(),this.activetab&&this.animationLoop(this.activetab)}tabsChanged(e,t){super.tabsChanged(e,t),this.setTabData(),this.activetab&&this.animationLoop(this.activetab)}}wa([a],Gi.prototype,"appearance",2),wa([a],Gi.prototype,"size",2);const Yg=g`<template role="tablist"><slot name="tab" ${U("slottedTabs")}></slot></template>`,Qg=u`
|
|
535
535
|
${w("flex")}
|
|
536
536
|
|
|
537
|
-
:host{--tabPaddingInline:inherit;--tabPaddingBlock:inherit;--tabIndicatorInsetInline:0;--tabIndicatorInsetBlock:0;box-sizing:border-box;color:${Pe};flex-direction:row}:host([orientation='vertical']){flex-direction:column}:host([orientation='vertical']) ::slotted([role='tab']){justify-content:flex-start}:host ::slotted([slot='tab'][data-animate='true'])::after{transition-property:transform;transition-duration:${Bd};transition-timing-function:${Un}}:host ::slotted([slot='tab'])::after{height:${Le};margin-block-start:auto;transform-origin:left;transform:translateX(var(--tabIndicatorOffset)) scaleX(var(--tabIndicatorScale))}:host([orientation='vertical']) ::slotted([slot='tab'])::after{width:${Le};height:unset;margin-block-start:unset;transform-origin:top;transform:translateY(var(--tabIndicatorOffset)) scaleY(var(--tabIndicatorScale))}:host ::slotted([slot='tab'])::before{height:${Le};border-radius:${xe};content:'';inset-inline:var(--tabIndicatorInsetInline);inset-block:var(--tabIndicatorInsetBlock);position:absolute;margin-top:auto}:host ::slotted([slot='tab'])::before{inset-inline:var(--tabIndicatorInsetInline);inset-block:var(--tabIndicatorInsetBlock)}:host ::slotted([slot='tab'][aria-selected='true'])::before{background-color:${_}}:host ::slotted([slot='tab'][aria-selected='false']:hover)::after{height:${Le};margin-block-start:auto;transform-origin:left}:host([orientation='vertical']) ::slotted([slot='tab'])::before,:host([orientation='vertical']) ::slotted([slot='tab'][aria-selected='false']:hover)::after{height:unset;width:${Le};margin-inline-end:auto;transform-origin:top}:host(:where([size='small'],[size='large'])) ::slotted([slot='tab']){padding-inline:var(--tabPaddingInline);padding-block:var(--tabPaddingBlock)}:host([size='small']) ::slotted([slot='tab']){--tabPaddingBlock:${$o};--tabPaddingInline:${ge};font-size:${O};line-height:${M}}:host([size='large']) ::slotted([slot='tab']){--tabPaddingBlock:${Ci};--tabPaddingInline:${Ve};font-size:${pe};line-height:${ke}}:host ::slotted([slot='tab'])::after,:host ::slotted([slot='tab'])::before,:host ::slotted([slot='tab']:hover)::after{inset-inline:var(--tabIndicatorInsetInline)}:host ::slotted([slot='tab']){--tabIndicatorInsetInline:${Ve}}:host([size='small']) ::slotted([slot='tab']){--tabIndicatorInsetInline:${ge}}:host([size='large']) ::slotted([slot='tab']){--tabIndicatorInsetInline:${Ve}}:host([orientation='vertical']) ::slotted([slot='tab']){padding-block:var(--tabPaddingBlock)}:host([orientation='vertical']) ::slotted([slot='tab']){--tabPaddingBlock:${se}}:host([orientation='vertical'][size='small']) ::slotted([slot='tab']){--tabPaddingBlock:${yr}}:host([orientation='vertical'][size='large']) ::slotted([slot='tab']){--tabPaddingBlock:${se}}:host([orientation='vertical']) ::slotted([slot='tab'])::after,:host([orientation='vertical']) ::slotted([slot='tab'])::before,:host([orientation='vertical']) ::slotted([slot='tab']:hover)::after{inset-inline:0;inset-block:var(--tabIndicatorInsetBlock)}:host([orientation='vertical']){--tabIndicatorInsetBlock:${se}}:host([orientation='vertical'][size='small']){--tabIndicatorInsetBlock:${$o}}:host([orientation='vertical'][size='large']){--tabIndicatorInsetBlock:${xr}}:host([disabled]){cursor:not-allowed;color:${_}}:host([disabled]) ::slotted([slot='tab']){pointer-events:none;cursor:not-allowed;color:${_}}:host([disabled]) ::slotted([slot='tab']:after){background-color:${_}}:host([disabled]) ::slotted([slot='tab'][aria-selected='true'])::after{background-color:${_}}:host([disabled]) ::slotted([slot='tab']:hover):before{content:unset}:host([appearance='subtle']) ::slotted([slot='tab']:hover){background-color:${dr};color:${ln};fill:${jl}}:host([appearance='subtle']) ::slotted([slot='tab']:active){background-color:${go};fill:${go};color:${B}}`,Yg=Gi.compose({name:`${p.prefix}-tablist`,template:Xg,styles:Kg});Yg.define(p.registry);const Qg={outline:"outline",filledLighter:"filled-lighter",filledDarker:"filled-darker"},Hr={none:"none",both:"both",horizontal:"horizontal",vertical:"vertical"};var Zg=Object.defineProperty,Jg=Object.getOwnPropertyDescriptor,te=(o,e,t,r)=>{for(var i=r>1?void 0:r?Jg(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&Zg(e,t,i),i};class G extends x{constructor(){super(),this.elementInternals=this.attachInternals(),this.filteredLabelSlottedNodes=[],this.labelSlottedNodes=[],this.userInteracted=!1,this.preConnectControlEl=document.createElement("textarea"),this.autoResize=!1,this.disabled=!1,this.displayShadow=!1,this.readOnly=!1,this.required=!1,this.resize=Hr.none,this.spellcheck=!1}controlElChanged(){this.controlElAttrObserver=new MutationObserver(()=>{this.setValidity()}),this.controlElAttrObserver.observe(this.controlEl,{attributes:!0,attributeFilter:["disabled","required","readonly","maxlength","minlength"]}),this.controlEl.addEventListener("input",()=>this.userInteracted=!0,{once:!0})}defaultSlottedNodesChanged(){const e=this.getContent();this.defaultValue=e,this.value=e}labelSlottedNodesChanged(){this.filteredLabelSlottedNodes=this.labelSlottedNodes.filter(wl),this.labelEl&&(this.labelEl.hidden=!this.filteredLabelSlottedNodes.length),this.filteredLabelSlottedNodes.forEach(e=>{e.disabled=this.disabled,e.required=this.required})}autoResizeChanged(){this.maybeCreateAutoSizerEl(),$(this.elementInternals,"auto-resize",this.autoResize)}disabledChanged(){this.setDisabledSideEffect(this.disabled)}get form(){return this.elementInternals.form}get labels(){return this.elementInternals.labels}readOnlyChanged(){this.elementInternals.ariaReadOnly=`${!!this.readOnly}`,this.$fastController.isConnected&&this.setValidity()}requiredChanged(){this.elementInternals.ariaRequired=`${!!this.required}`,this.filteredLabelSlottedNodes?.length&&this.filteredLabelSlottedNodes.forEach(e=>e.required=this.required)}resizeChanged(e,t){kt(this.elementInternals,e,t,Hr,"resize-"),$(this.elementInternals,"resize",Qn(Hr,t)&&t!==Hr.none)}get textLength(){return this.controlEl.textLength}get type(){return"textarea"}get validity(){return this.elementInternals.validity}get validationMessage(){return this.elementInternals.validationMessage||this.controlEl.validationMessage}get willValidate(){return this.elementInternals.willValidate}get defaultValue(){return this.controlEl?.defaultValue??this.preConnectControlEl.defaultValue}set defaultValue(e){const t=this.controlEl??this.preConnectControlEl;t.defaultValue=e,this.controlEl&&!this.userInteracted&&(this.controlEl.value=e)}get value(){return this.controlEl?.value??this.preConnectControlEl.value}set value(e){const t=this.controlEl??this.preConnectControlEl;t.value=e,this.setFormValue(e),this.setValidity()}connectedCallback(){super.connectedCallback(),requestAnimationFrame(()=>{if(!this.$fastController.isConnected)return;const e=this.preConnectControlEl,t=this.getContent();this.defaultValue=t||e?.defaultValue||"",this.value=e?.value||this.defaultValue,this.setFormValue(this.value),this.setValidity(),this.preConnectControlEl=null,this.maybeCreateAutoSizerEl()})}disconnectedCallback(){super.disconnectedCallback(),this.autoSizerObserver?.disconnect(),this.controlElAttrObserver?.disconnect()}formResetCallback(){this.value=this.defaultValue}formDisabledCallback(e){this.setDisabledSideEffect(e),this.setValidity()}setFormValue(e,t){this.elementInternals.setFormValue(e,e??t)}checkValidity(){return this.elementInternals.checkValidity()}reportValidity(){return this.elementInternals.reportValidity()}setCustomValidity(e){this.elementInternals.setValidity({customError:!!e},e?e.toString():void 0),this.reportValidity()}setValidity(e,t,r){this.$fastController.isConnected&&(this.disabled||this.readOnly?this.elementInternals.setValidity({}):this.elementInternals.setValidity(e??this.controlEl.validity,t??this.controlEl.validationMessage,r??this.controlEl),this.userInteracted&&this.toggleUserValidityState())}select(){this.controlEl.select()}getContent(){return this.defaultSlottedNodes.map(e=>{switch(e.nodeType){case Node.ELEMENT_NODE:return e.outerHTML;case Node.TEXT_NODE:return e.textContent.trim();default:return""}}).join("")||""}setDisabledSideEffect(e){this.elementInternals.ariaDisabled=`${e}`,this.controlEl&&(this.controlEl.disabled=e),this.filteredLabelSlottedNodes?.length&&this.filteredLabelSlottedNodes.forEach(t=>t.disabled=this.disabled)}toggleUserValidityState(){$(this.elementInternals,"user-invalid",!this.validity.valid),$(this.elementInternals,"user-valid",this.validity.valid)}maybeCreateAutoSizerEl(){if(!CSS.supports("field-sizing: content")){if(!this.autoResize){this.autoSizerEl?.remove(),this.autoSizerObserver?.disconnect();return}this.autoSizerEl||(this.autoSizerEl=document.createElement("div"),this.autoSizerEl.classList.add("auto-sizer"),this.autoSizerEl.ariaHidden="true"),this.rootEl?.prepend(this.autoSizerEl),this.autoSizerObserver||(this.autoSizerObserver=new ResizeObserver((e,t)=>{const r=window.getComputedStyle(this).writingMode.startsWith("horizontal")?"height":"width";this.style.getPropertyValue(r)!==""&&(this.autoSizerEl?.remove(),t.disconnect())})),this.autoSizerObserver.observe(this)}}handleControlInput(){this.autoResize&&this.autoSizerEl&&(this.autoSizerEl.textContent=this.value+" "),this.setFormValue(this.value),this.setValidity()}handleControlChange(){this.toggleUserValidityState(),this.$emit("change")}handleControlSelect(){this.$emit("select")}}G.formAssociated=!0,te([b],G.prototype,"controlEl",2),te([b],G.prototype,"defaultSlottedNodes",2),te([b],G.prototype,"labelSlottedNodes",2),te([a],G.prototype,"autocomplete",2),te([a({attribute:"auto-resize",mode:"boolean"})],G.prototype,"autoResize",2),te([a({attribute:"dirname"})],G.prototype,"dirName",2),te([a({mode:"boolean"})],G.prototype,"disabled",2),te([a({attribute:"display-shadow",mode:"boolean"})],G.prototype,"displayShadow",2),te([a({attribute:"form"})],G.prototype,"initialForm",2),te([a({attribute:"maxlength",converter:re})],G.prototype,"maxLength",2),te([a({attribute:"minlength",converter:re})],G.prototype,"minLength",2),te([a],G.prototype,"name",2),te([a],G.prototype,"placeholder",2),te([a({attribute:"readonly",mode:"boolean"})],G.prototype,"readOnly",2),te([a({mode:"boolean"})],G.prototype,"required",2),te([a({mode:"fromView"})],G.prototype,"resize",2),te([a({mode:"boolean"})],G.prototype,"spellcheck",2);var ef=Object.defineProperty,tf=Object.getOwnPropertyDescriptor,Ui=(o,e,t,r)=>{for(var i=r>1?void 0:r?tf(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&ef(e,t,i),i};class jr extends G{constructor(){super(...arguments),this.appearance=Qg.outline,this.block=!1}labelSlottedNodesChanged(){super.labelSlottedNodesChanged(),this.labelSlottedNodes.forEach(e=>{e.size=this.size})}handleChange(e,t){switch(t){case"size":this.labelSlottedNodes.forEach(r=>{r.size=this.size});break}}connectedCallback(){super.connectedCallback(),m.getNotifier(this).subscribe(this,"size")}disconnectedCallback(){super.disconnectedCallback(),m.getNotifier(this).unsubscribe(this,"size")}}Ui([a({mode:"fromView"})],jr.prototype,"appearance",2),Ui([a({mode:"boolean"})],jr.prototype,"block",2),Ui([a],jr.prototype,"size",2);const of=u`
|
|
537
|
+
:host{--tabPaddingInline:inherit;--tabPaddingBlock:inherit;--tabIndicatorInsetInline:0;--tabIndicatorInsetBlock:0;box-sizing:border-box;color:${Pe};flex-direction:row}:host([orientation='vertical']){flex-direction:column}:host([orientation='vertical']) ::slotted([role='tab']){justify-content:flex-start}:host ::slotted([slot='tab'][data-animate='true'])::after{transition-property:transform;transition-duration:${Bd};transition-timing-function:${Un}}:host ::slotted([slot='tab'])::after{height:${Le};margin-block-start:auto;transform-origin:left;transform:translateX(var(--tabIndicatorOffset)) scaleX(var(--tabIndicatorScale))}:host([orientation='vertical']) ::slotted([slot='tab'])::after{width:${Le};height:unset;margin-block-start:unset;transform-origin:top;transform:translateY(var(--tabIndicatorOffset)) scaleY(var(--tabIndicatorScale))}:host ::slotted([slot='tab'])::before{height:${Le};border-radius:${xe};content:'';inset-inline:var(--tabIndicatorInsetInline);inset-block:var(--tabIndicatorInsetBlock);position:absolute;margin-top:auto}:host ::slotted([slot='tab'])::before{inset-inline:var(--tabIndicatorInsetInline);inset-block:var(--tabIndicatorInsetBlock)}:host ::slotted([slot='tab'][aria-selected='true'])::before{background-color:${_}}:host ::slotted([slot='tab'][aria-selected='false']:hover)::after{height:${Le};margin-block-start:auto;transform-origin:left}:host([orientation='vertical']) ::slotted([slot='tab'])::before,:host([orientation='vertical']) ::slotted([slot='tab'][aria-selected='false']:hover)::after{height:unset;width:${Le};margin-inline-end:auto;transform-origin:top}:host(:where([size='small'],[size='large'])) ::slotted([slot='tab']){padding-inline:var(--tabPaddingInline);padding-block:var(--tabPaddingBlock)}:host([size='small']) ::slotted([slot='tab']){--tabPaddingBlock:${$o};--tabPaddingInline:${ge};font-size:${O};line-height:${M}}:host([size='large']) ::slotted([slot='tab']){--tabPaddingBlock:${Ci};--tabPaddingInline:${Ve};font-size:${pe};line-height:${ke}}:host ::slotted([slot='tab'])::after,:host ::slotted([slot='tab'])::before,:host ::slotted([slot='tab']:hover)::after{inset-inline:var(--tabIndicatorInsetInline)}:host ::slotted([slot='tab']){--tabIndicatorInsetInline:${Ve}}:host([size='small']) ::slotted([slot='tab']){--tabIndicatorInsetInline:${ge}}:host([size='large']) ::slotted([slot='tab']){--tabIndicatorInsetInline:${Ve}}:host([orientation='vertical']) ::slotted([slot='tab']){padding-block:var(--tabPaddingBlock)}:host([orientation='vertical']) ::slotted([slot='tab']){--tabPaddingBlock:${se}}:host([orientation='vertical'][size='small']) ::slotted([slot='tab']){--tabPaddingBlock:${yr}}:host([orientation='vertical'][size='large']) ::slotted([slot='tab']){--tabPaddingBlock:${se}}:host([orientation='vertical']) ::slotted([slot='tab'])::after,:host([orientation='vertical']) ::slotted([slot='tab'])::before,:host([orientation='vertical']) ::slotted([slot='tab']:hover)::after{inset-inline:0;inset-block:var(--tabIndicatorInsetBlock)}:host([orientation='vertical']){--tabIndicatorInsetBlock:${se}}:host([orientation='vertical'][size='small']){--tabIndicatorInsetBlock:${$o}}:host([orientation='vertical'][size='large']){--tabIndicatorInsetBlock:${xr}}:host([disabled]){cursor:not-allowed;color:${_}}:host([disabled]) ::slotted([slot='tab']){pointer-events:none;cursor:not-allowed;color:${_}}:host([disabled]) ::slotted([slot='tab']:after){background-color:${_}}:host([disabled]) ::slotted([slot='tab'][aria-selected='true'])::after{background-color:${_}}:host([disabled]) ::slotted([slot='tab']:hover):before{content:unset}:host([appearance='subtle']) ::slotted([slot='tab']:hover){background-color:${dr};color:${ln};fill:${jl}}:host([appearance='subtle']) ::slotted([slot='tab']:active){background-color:${go};fill:${go};color:${B}}`,Zg=Gi.compose({name:`${p.prefix}-tablist`,template:Yg,styles:Qg});Zg.define(p.registry);const Jg={outline:"outline",filledLighter:"filled-lighter",filledDarker:"filled-darker"},Hr={none:"none",both:"both",horizontal:"horizontal",vertical:"vertical"};var ef=Object.defineProperty,tf=Object.getOwnPropertyDescriptor,te=(o,e,t,r)=>{for(var i=r>1?void 0:r?tf(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&ef(e,t,i),i};class G extends x{constructor(){super(),this.elementInternals=this.attachInternals(),this.filteredLabelSlottedNodes=[],this.labelSlottedNodes=[],this.userInteracted=!1,this.preConnectControlEl=document.createElement("textarea"),this.autoResize=!1,this.disabled=!1,this.displayShadow=!1,this.readOnly=!1,this.required=!1,this.resize=Hr.none,this.spellcheck=!1}controlElChanged(){this.controlElAttrObserver=new MutationObserver(()=>{this.setValidity()}),this.controlElAttrObserver.observe(this.controlEl,{attributes:!0,attributeFilter:["disabled","required","readonly","maxlength","minlength"]}),this.controlEl.addEventListener("input",()=>this.userInteracted=!0,{once:!0})}defaultSlottedNodesChanged(){const e=this.getContent();this.defaultValue=e,this.value=e}labelSlottedNodesChanged(){this.filteredLabelSlottedNodes=this.labelSlottedNodes.filter(wl),this.labelEl&&(this.labelEl.hidden=!this.filteredLabelSlottedNodes.length),this.filteredLabelSlottedNodes.forEach(e=>{e.disabled=this.disabled,e.required=this.required})}autoResizeChanged(){this.maybeCreateAutoSizerEl(),$(this.elementInternals,"auto-resize",this.autoResize)}disabledChanged(){this.setDisabledSideEffect(this.disabled)}get form(){return this.elementInternals.form}get labels(){return this.elementInternals.labels}readOnlyChanged(){this.elementInternals.ariaReadOnly=`${!!this.readOnly}`,this.$fastController.isConnected&&this.setValidity()}requiredChanged(){this.elementInternals.ariaRequired=`${!!this.required}`,this.filteredLabelSlottedNodes?.length&&this.filteredLabelSlottedNodes.forEach(e=>e.required=this.required)}resizeChanged(e,t){kt(this.elementInternals,e,t,Hr,"resize-"),$(this.elementInternals,"resize",Qn(Hr,t)&&t!==Hr.none)}get textLength(){return this.controlEl.textLength}get type(){return"textarea"}get validity(){return this.elementInternals.validity}get validationMessage(){return this.elementInternals.validationMessage||this.controlEl.validationMessage}get willValidate(){return this.elementInternals.willValidate}get defaultValue(){return this.controlEl?.defaultValue??this.preConnectControlEl.defaultValue}set defaultValue(e){const t=this.controlEl??this.preConnectControlEl;t.defaultValue=e,this.controlEl&&!this.userInteracted&&(this.controlEl.value=e)}get value(){return this.controlEl?.value??this.preConnectControlEl.value}set value(e){const t=this.controlEl??this.preConnectControlEl;t.value=e,this.setFormValue(e),this.setValidity()}connectedCallback(){super.connectedCallback(),requestAnimationFrame(()=>{if(!this.$fastController.isConnected)return;const e=this.preConnectControlEl,t=this.getContent();this.defaultValue=t||e?.defaultValue||"",this.value=e?.value||this.defaultValue,this.setFormValue(this.value),this.setValidity(),this.preConnectControlEl=null,this.maybeCreateAutoSizerEl()})}disconnectedCallback(){super.disconnectedCallback(),this.autoSizerObserver?.disconnect(),this.controlElAttrObserver?.disconnect()}formResetCallback(){this.value=this.defaultValue}formDisabledCallback(e){this.setDisabledSideEffect(e),this.setValidity()}setFormValue(e,t){this.elementInternals.setFormValue(e,e??t)}checkValidity(){return this.elementInternals.checkValidity()}reportValidity(){return this.elementInternals.reportValidity()}setCustomValidity(e){this.elementInternals.setValidity({customError:!!e},e?e.toString():void 0),this.reportValidity()}setValidity(e,t,r){this.$fastController.isConnected&&(this.disabled||this.readOnly?this.elementInternals.setValidity({}):this.elementInternals.setValidity(e??this.controlEl.validity,t??this.controlEl.validationMessage,r??this.controlEl),this.userInteracted&&this.toggleUserValidityState())}select(){this.controlEl.select()}getContent(){return this.defaultSlottedNodes.map(e=>{switch(e.nodeType){case Node.ELEMENT_NODE:return e.outerHTML;case Node.TEXT_NODE:return e.textContent.trim();default:return""}}).join("")||""}setDisabledSideEffect(e){this.elementInternals.ariaDisabled=`${e}`,this.controlEl&&(this.controlEl.disabled=e),this.filteredLabelSlottedNodes?.length&&this.filteredLabelSlottedNodes.forEach(t=>t.disabled=this.disabled)}toggleUserValidityState(){$(this.elementInternals,"user-invalid",!this.validity.valid),$(this.elementInternals,"user-valid",this.validity.valid)}maybeCreateAutoSizerEl(){if(!CSS.supports("field-sizing: content")){if(!this.autoResize){this.autoSizerEl?.remove(),this.autoSizerObserver?.disconnect();return}this.autoSizerEl||(this.autoSizerEl=document.createElement("div"),this.autoSizerEl.classList.add("auto-sizer"),this.autoSizerEl.ariaHidden="true"),this.rootEl?.prepend(this.autoSizerEl),this.autoSizerObserver||(this.autoSizerObserver=new ResizeObserver((e,t)=>{const r=window.getComputedStyle(this).writingMode.startsWith("horizontal")?"height":"width";this.style.getPropertyValue(r)!==""&&(this.autoSizerEl?.remove(),t.disconnect())})),this.autoSizerObserver.observe(this)}}handleControlInput(){this.autoResize&&this.autoSizerEl&&(this.autoSizerEl.textContent=this.value+" "),this.setFormValue(this.value),this.setValidity()}handleControlChange(){this.toggleUserValidityState(),this.$emit("change")}handleControlSelect(){this.$emit("select")}}G.formAssociated=!0,te([b],G.prototype,"controlEl",2),te([b],G.prototype,"defaultSlottedNodes",2),te([b],G.prototype,"labelSlottedNodes",2),te([a],G.prototype,"autocomplete",2),te([a({attribute:"auto-resize",mode:"boolean"})],G.prototype,"autoResize",2),te([a({attribute:"dirname"})],G.prototype,"dirName",2),te([a({mode:"boolean"})],G.prototype,"disabled",2),te([a({attribute:"display-shadow",mode:"boolean"})],G.prototype,"displayShadow",2),te([a({attribute:"form"})],G.prototype,"initialForm",2),te([a({attribute:"maxlength",converter:re})],G.prototype,"maxLength",2),te([a({attribute:"minlength",converter:re})],G.prototype,"minLength",2),te([a],G.prototype,"name",2),te([a],G.prototype,"placeholder",2),te([a({attribute:"readonly",mode:"boolean"})],G.prototype,"readOnly",2),te([a({mode:"boolean"})],G.prototype,"required",2),te([a({mode:"fromView"})],G.prototype,"resize",2),te([a({mode:"boolean"})],G.prototype,"spellcheck",2);var of=Object.defineProperty,rf=Object.getOwnPropertyDescriptor,Ui=(o,e,t,r)=>{for(var i=r>1?void 0:r?rf(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&of(e,t,i),i};class jr extends G{constructor(){super(...arguments),this.appearance=Jg.outline,this.block=!1}labelSlottedNodesChanged(){super.labelSlottedNodesChanged(),this.labelSlottedNodes.forEach(e=>{e.size=this.size})}handleChange(e,t){switch(t){case"size":this.labelSlottedNodes.forEach(r=>{r.size=this.size});break}}connectedCallback(){super.connectedCallback(),m.getNotifier(this).subscribe(this,"size")}disconnectedCallback(){super.disconnectedCallback(),m.getNotifier(this).unsubscribe(this,"size")}}Ui([a({mode:"fromView"})],jr.prototype,"appearance",2),Ui([a({mode:"boolean"})],jr.prototype,"block",2),Ui([a],jr.prototype,"size",2);const sf=u`
|
|
538
538
|
${w("inline-block")}
|
|
539
539
|
|
|
540
540
|
:host{--font-size:${O};--line-height:${M};--padding-inline:${Ve};--padding-block:${$o};--min-block-size:52px;--block-size:var(--min-block-size);--inline-size:18rem;--border-width:${I};--control-padding-inline:${V};--color:${B};--background-color:${S};--border-color:${De};--border-block-end-color:${Me};--placeholder-color:${ui};--focus-indicator-color:${vt};--box-shadow:none;--contain-size:size;--resize:none;color:var(--color);font-family:${v};font-size:var(--font-size);font-weight:${E};line-height:var(--line-height);position:relative}:host(:hover){--border-color:${Mt};--border-block-end-color:${ft}}:host(:active){--border-color:${fo};--border-block-end-color:${mt}}:host(:focus-within){outline:none}:host([block]:not([hidden])){display:block}:host([size='small']){--font-size:${F};--line-height:${q};--min-block-size:40px;--padding-block:${Lt};--padding-inline:${ge};--control-padding-inline:${V}}:host([size='large']){--font-size:${pe};--line-height:${ke};--min-block-size:64px;--padding-block:${se};--padding-inline:${ae};--control-padding-inline:${ge}}:host([resize='both']:not(:disabled)){--resize:both}:host([resize='horizontal']:not(:disabled)){--resize:horizontal}:host([resize='vertical']:not(:disabled)){--resize:vertical}:host([auto-resize]){--block-size:auto;--contain-size:inline-size}:host([appearance='filled-darker']){--background-color:${po};--border-color:var(--background-color);--border-block-end-color:var(--border-color)}:host([appearance='filled-lighter']){--border-color:var(--background-color);--border-block-end-color:var(--border-color)}:host([appearance='filled-darker'][display-shadow]),:host([appearance='filled-lighter'][display-shadow]){--box-shadow:${$i}}:host(${lu}){--border-color:${fi};--border-block-end-color:${fi}}:host(:disabled){--color:${_};--background-color:${he};--border-color:${ye};--border-block-end-color:var(--border-color);--box-shadow:none;--placeholder-color:${_};cursor:no-drop;user-select:none}.root{background-color:var(--background-color);border:var(--border-width) solid var(--border-color);border-block-end-color:var(--border-block-end-color);border-radius:${C};box-sizing:border-box;box-shadow:var(--box-shadow);contain:paint layout style var(--contain-size);display:grid;grid-template:1fr / 1fr;inline-size:var(--inline-size);min-block-size:var(--min-block-size);block-size:var(--block-size);overflow:hidden;padding:var(--padding-block) var(--padding-inline);position:relative;resize:var(--resize)}:host([block]) .root{inline-size:auto}.root::after{border-bottom:2px solid var(--focus-indicator-color);border-radius:0 0 ${C} ${C};box-sizing:border-box;clip-path:inset(calc(100% - 2px) 1px 0px);content:'';height:max(2px,${C});inset:auto -1px 0;position:absolute;transform:scaleX(0);transition-delay:${yt};transition-duration:${Si};transition-property:transform}:host(:focus-within) .root::after{transform:scaleX(1);transition-property:transform;transition-duration:${wr};transition-delay:${xt}}:host([readonly]) .root::after,:host(:disabled) .root::after{content:none}label{color:var(--color);display:flex;inline-size:fit-content;padding-block-end:${Lt};padding-inline-end:${ie}}:host(:empty) label,label[hidden]{display:none}.auto-sizer,.control{box-sizing:border-box;font:inherit;grid-column:1 / -1;grid-row:1 / -1;letter-space:inherit;padding:0 var(--control-padding-inline)}.auto-sizer{display:none;padding-block-end:2px;pointer-events:none;visibility:hidden;white-space:pre-wrap}:host([auto-resize]) .auto-sizer{display:block}.control{appearance:none;background-color:transparent;border:0;color:inherit;field-sizing:content;max-block-size:100%;outline:0;resize:none;text-align:inherit}.control:disabled{cursor:inherit}.control::placeholder{color:var(--placeholder-color)}::selection{color:${bt};background-color:${hn}}`.withBehaviors(X(u`
|
|
541
|
-
:host{--border-color:FieldText;--border-block-end-color:FieldText;--focus-indicator-color:Highlight;--placeholder-color:FieldText}:host(:hover),:host(:active),:host(:focus-within){--border-color:Highlight;--border-block-end-color:Highlight}:host(:disabled){--color:GrayText;--border-color:GrayText;--border-block-end-color:GrayText;--placeholder-color:GrayText}`));function
|
|
541
|
+
:host{--border-color:FieldText;--border-block-end-color:FieldText;--focus-indicator-color:Highlight;--placeholder-color:FieldText}:host(:hover),:host(:active),:host(:focus-within){--border-color:Highlight;--border-block-end-color:Highlight}:host(:disabled){--color:GrayText;--border-color:GrayText;--border-block-end-color:GrayText;--placeholder-color:GrayText}`));function nf(){return g`<template><label ${z("labelEl")} for="control" part="label"><slot name="label" ${U("labelSlottedNodes")}></slot></label><div class="root" part="root" ${z("rootEl")}><textarea ${z("controlEl")} id="control" class="control" part="control" ?required="${o=>o.required}" ?disabled="${o=>o.disabled}" ?readonly="${o=>o.readOnly}" ?spellcheck="${o=>o.spellcheck}" autocomplete="${o=>o.autocomplete}" maxlength="${o=>o.maxLength}" minlength="${o=>o.minLength}" placeholder="${o=>o.placeholder}" @change="${o=>o.handleControlChange()}" @select="${o=>o.handleControlSelect()}" @input="${o=>o.handleControlInput()}"></textarea></div><div hidden><slot ${U("defaultSlottedNodes")}></slot></div></template>`}const af=nf(),lf=jr.compose({name:`${p.prefix}-textarea`,template:af,styles:sf,shadowOptions:{delegatesFocus:!0}});lf.define(p.registry);const cf={email:"email",password:"password",tel:"tel",text:"text",url:"url"},df=["date","datetime-local","email","month","number","password","search","tel","text","time","url","week"];var hf=Object.defineProperty,uf=Object.getOwnPropertyDescriptor,N=(o,e,t,r)=>{for(var i=r>1?void 0:r?uf(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&hf(e,t,i),i};class T extends x{constructor(){super(...arguments),this.type=cf.text,this.dirtyValue=!1,this.elementInternals=this.attachInternals()}currentValueChanged(e,t){this.value=t}defaultSlottedNodesChanged(e,t){A.enqueue(()=>{this.controlLabel&&(this.controlLabel.hidden=!t?.some(r=>r.nodeType===Node.ELEMENT_NODE||r.nodeType===Node.TEXT_NODE&&!!r.textContent?.trim()))})}initialValueChanged(){this.dirtyValue||(this.value=this.initialValue)}readOnlyChanged(){this.$fastController.isConnected&&(this.elementInternals.ariaReadOnly=`${!!this.readOnly}`)}requiredChanged(e,t){this.$fastController.isConnected&&(this.elementInternals.ariaRequired=`${!!t}`)}controlChanged(e,t){A.enqueue(()=>{this.$fastController.isConnected&&this.setValidity()})}get validity(){return this.elementInternals.validity}get validationMessage(){return this.elementInternals.validationMessage||this.control.validationMessage}get value(){return m.track(this,"value"),this.currentValue}set value(e){this.currentValue=e,this.$fastController.isConnected&&(this.control.value=e??"",this.setFormValue(e),this.setValidity(),m.notify(this,"value"))}get willValidate(){return this.elementInternals.willValidate}get form(){return this.elementInternals.form}beforeinputHandler(e){return e.inputType==="insertLineBreak"&&this.implicitSubmit(),!0}changeHandler(e){return this.setValidity(),this.$emit("change",e,{bubbles:!0,composed:!0}),!0}checkValidity(){return this.elementInternals.checkValidity()}clickHandler(e){return e.target===this&&this.control?.click(),!0}connectedCallback(){super.connectedCallback(),this.tabIndex=Number(this.getAttribute("tabindex")??0)<0?-1:0,this.setFormValue(this.value),this.setValidity()}focusinHandler(e){return e.target===this&&this.control?.focus(),!0}formResetCallback(){this.value=this.initialValue,this.dirtyValue=!1}implicitSubmit(){if(!this.elementInternals.form)return;if(this.elementInternals.form.elements.length===1){this.elementInternals.form.requestSubmit();return}const e=[...this.elementInternals.form.elements],t=e.find(i=>i.getAttribute("type")==="submit");if(t){t.click();return}e.filter(i=>df.includes(i.getAttribute("type")??"")).length>1||this.elementInternals.form.requestSubmit()}inputHandler(e){return this.dirtyValue=!0,this.value=this.control.value,!0}keydownHandler(e){return e.key==="Enter"&&this.implicitSubmit(),!0}select(){this.control.select(),this.$emit("select")}setCustomValidity(e){this.elementInternals.setValidity({customError:!0},e),this.reportValidity()}reportValidity(){return this.elementInternals.reportValidity()}setFormValue(e,t){this.elementInternals.setFormValue(e,e??t)}setValidity(e,t,r){if(this.$fastController.isConnected&&this.control){if(this.disabled){this.elementInternals.setValidity({});return}this.elementInternals.setValidity(e??this.control.validity,t??this.validationMessage,r??this.control)}}}T.formAssociated=!0,N([a],T.prototype,"autocomplete",2),N([a({mode:"boolean"})],T.prototype,"autofocus",2),N([a({attribute:"current-value"})],T.prototype,"currentValue",2),N([b],T.prototype,"defaultSlottedNodes",2),N([a],T.prototype,"dirname",2),N([a({mode:"boolean"})],T.prototype,"disabled",2),N([a({attribute:"form"})],T.prototype,"formAttribute",2),N([a({attribute:"value",mode:"fromView"})],T.prototype,"initialValue",2),N([a],T.prototype,"list",2),N([a({converter:re})],T.prototype,"maxlength",2),N([a({converter:re})],T.prototype,"minlength",2),N([a({mode:"boolean"})],T.prototype,"multiple",2),N([a],T.prototype,"name",2),N([a],T.prototype,"pattern",2),N([a],T.prototype,"placeholder",2),N([a({attribute:"readonly",mode:"boolean"})],T.prototype,"readOnly",2),N([a({mode:"boolean"})],T.prototype,"required",2),N([a({converter:re})],T.prototype,"size",2),N([a({converter:{fromView:o=>typeof o=="string"?["true",""].includes(o.trim().toLowerCase()):null,toView:o=>o.toString()}})],T.prototype,"spellcheck",2),N([a],T.prototype,"type",2),N([b],T.prototype,"control",2),N([b],T.prototype,"controlLabel",2);var pf=Object.defineProperty,bf=Object.getOwnPropertyDescriptor,Ca=(o,e,t,r)=>{for(var i=r>1?void 0:r?bf(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&pf(e,t,i),i};class Rr extends T{}Ca([a],Rr.prototype,"appearance",2),Ca([a({attribute:"control-size"})],Rr.prototype,"controlSize",2),Je(Rr,Ze);const gf=u`
|
|
542
542
|
${w("block")}
|
|
543
543
|
|
|
544
|
-
:host{font-family:${v};font-size:${O};font-weight:${E};line-height:${M};max-width:400px}.label{display:flex;color:${B};padding-bottom:${Lt};flex-shrink:0;padding-inline-end:${ie}}.label[hidden],:host(:empty) .label{display:none}.root{align-items:center;background-color:${S};border:${I} solid ${De};border-bottom-color:${Me};border-radius:${C};box-sizing:border-box;height:32px;display:inline-flex;flex-direction:row;gap:${V};padding:0 ${Ve};position:relative;width:100%}:has(.control:user-invalid){border-color:${fi}}.root::after{box-sizing:border-box;content:'';position:absolute;left:-1px;bottom:0px;right:-1px;height:max(2px,${C});border-radius:0 0 ${C} ${C};border-bottom:2px solid ${vt};clip-path:inset(calc(100% - 2px) 1px 0px);transform:scaleX(0);transition-property:transform;transition-duration:${Si};transition-delay:${yt}}.control{width:100%;height:100%;box-sizing:border-box;color:${B};border-radius:${C};background:${he};font-family:${v};font-weight:${E};font-size:${O};border:none;vertical-align:center}.control:focus-visible{outline:0;border:0}.control::placeholder{color:${ui}}:host ::slotted([slot='start']),:host ::slotted([slot='end']){display:flex;align-items:center;justify-content:center;color:${Z};font-size:${Dt}}:host ::slotted([slot='start']){padding-right:${V}}:host ::slotted([slot='end']){padding-left:${V};gap:${ie}}:host(:hover) .root{border-color:${Mt};border-bottom-color:${ft}}:host(:active) .root{border-color:${fo}}:host(:focus-within) .root{outline:transparent solid 2px;border-bottom:0}:host(:focus-within) .root::after{transform:scaleX(1);transition-property:transform;transition-duration:${wr};transition-delay:${xt}}:host(:focus-within:active) .root:after{border-bottom-color:${kn}}:host([appearance='outline']:focus-within) .root{border:${I} solid ${De}}:host(:focus-within) .control{color:${B}}:host([disabled]) .root{background:${he};border:${I} solid ${ye}}:host([disabled]) .control::placeholder,:host([disabled]) ::slotted([slot='start']),:host([disabled]) ::slotted([slot='end']){color:${_}}::selection{color:${bt};background-color:${hn}}:host([control-size='small']) .control{font-size:${F};font-weight:${E};line-height:${q}}:host([control-size='small']) .root{height:24px;gap:${V};padding:0 ${ge}}:host([control-size='small']) ::slotted([slot='start']),:host([control-size='small']) ::slotted([slot='end']){font-size:${pe}}:host([control-size='large']) .control{font-size:${pe};font-weight:${E};line-height:${ke}}:host([control-size='large']) .root{height:40px;gap:${Be};padding:0 ${ae}}:host([control-size='large']) ::slotted([slot='start']),:host([control-size='large']) ::slotted([slot='end']){font-size:${gr}}:host([appearance='underline']) .root{background:${he};border:0;border-radius:0;border-bottom:${I} solid ${Me}}:host([appearance='underline']:hover) .root{border-bottom-color:${ft}}:host([appearance='underline']:active) .root{border-bottom-color:${mt}}:host([appearance='underline']:focus-within) .root{border:0;border-bottom-color:${mt}}:host([appearance='underline'][disabled]) .root{border-bottom-color:${ye}}:host([appearance='filled-lighter']) .root,:host([appearance='filled-darker']) .root{border:${I} solid ${K};box-shadow:${$i}}:host([appearance='filled-lighter']) .root{background:${S}}:host([appearance='filled-darker']) .root{background:${po}}:host([appearance='filled-lighter']:hover) .root,:host([appearance='filled-darker']:hover) .root{border-color:${gi}}:host([appearance='filled-lighter']:active) .root,:host([appearance='filled-darker']:active) .root{border-color:${gi};background:${po}}`;function
|
|
544
|
+
:host{font-family:${v};font-size:${O};font-weight:${E};line-height:${M};max-width:400px}.label{display:flex;color:${B};padding-bottom:${Lt};flex-shrink:0;padding-inline-end:${ie}}.label[hidden],:host(:empty) .label{display:none}.root{align-items:center;background-color:${S};border:${I} solid ${De};border-bottom-color:${Me};border-radius:${C};box-sizing:border-box;height:32px;display:inline-flex;flex-direction:row;gap:${V};padding:0 ${Ve};position:relative;width:100%}:has(.control:user-invalid){border-color:${fi}}.root::after{box-sizing:border-box;content:'';position:absolute;left:-1px;bottom:0px;right:-1px;height:max(2px,${C});border-radius:0 0 ${C} ${C};border-bottom:2px solid ${vt};clip-path:inset(calc(100% - 2px) 1px 0px);transform:scaleX(0);transition-property:transform;transition-duration:${Si};transition-delay:${yt}}.control{width:100%;height:100%;box-sizing:border-box;color:${B};border-radius:${C};background:${he};font-family:${v};font-weight:${E};font-size:${O};border:none;vertical-align:center}.control:focus-visible{outline:0;border:0}.control::placeholder{color:${ui}}:host ::slotted([slot='start']),:host ::slotted([slot='end']){display:flex;align-items:center;justify-content:center;color:${Z};font-size:${Dt}}:host ::slotted([slot='start']){padding-right:${V}}:host ::slotted([slot='end']){padding-left:${V};gap:${ie}}:host(:hover) .root{border-color:${Mt};border-bottom-color:${ft}}:host(:active) .root{border-color:${fo}}:host(:focus-within) .root{outline:transparent solid 2px;border-bottom:0}:host(:focus-within) .root::after{transform:scaleX(1);transition-property:transform;transition-duration:${wr};transition-delay:${xt}}:host(:focus-within:active) .root:after{border-bottom-color:${kn}}:host([appearance='outline']:focus-within) .root{border:${I} solid ${De}}:host(:focus-within) .control{color:${B}}:host([disabled]) .root{background:${he};border:${I} solid ${ye}}:host([disabled]) .control::placeholder,:host([disabled]) ::slotted([slot='start']),:host([disabled]) ::slotted([slot='end']){color:${_}}::selection{color:${bt};background-color:${hn}}:host([control-size='small']) .control{font-size:${F};font-weight:${E};line-height:${q}}:host([control-size='small']) .root{height:24px;gap:${V};padding:0 ${ge}}:host([control-size='small']) ::slotted([slot='start']),:host([control-size='small']) ::slotted([slot='end']){font-size:${pe}}:host([control-size='large']) .control{font-size:${pe};font-weight:${E};line-height:${ke}}:host([control-size='large']) .root{height:40px;gap:${Be};padding:0 ${ae}}:host([control-size='large']) ::slotted([slot='start']),:host([control-size='large']) ::slotted([slot='end']){font-size:${gr}}:host([appearance='underline']) .root{background:${he};border:0;border-radius:0;border-bottom:${I} solid ${Me}}:host([appearance='underline']:hover) .root{border-bottom-color:${ft}}:host([appearance='underline']:active) .root{border-bottom-color:${mt}}:host([appearance='underline']:focus-within) .root{border:0;border-bottom-color:${mt}}:host([appearance='underline'][disabled]) .root{border-bottom-color:${ye}}:host([appearance='filled-lighter']) .root,:host([appearance='filled-darker']) .root{border:${I} solid ${K};box-shadow:${$i}}:host([appearance='filled-lighter']) .root{background:${S}}:host([appearance='filled-darker']) .root{background:${po}}:host([appearance='filled-lighter']:hover) .root,:host([appearance='filled-darker']:hover) .root{border-color:${gi}}:host([appearance='filled-lighter']:active) .root,:host([appearance='filled-darker']:active) .root{border-color:${gi};background:${po}}`;function ff(o={}){return g`<template @beforeinput="${(e,t)=>e.beforeinputHandler(t.event)}" @focusin="${(e,t)=>e.focusinHandler(t.event)}" @keydown="${(e,t)=>e.keydownHandler(t.event)}"><label part="label" for="control" class="label" ${z("controlLabel")}><slot ${U("defaultSlottedNodes")}></slot></label><div class="root" part="root">${Ge(o)}<input class="control" part="control" id="control" @change="${(e,t)=>e.changeHandler(t.event)}" @input="${(e,t)=>e.inputHandler(t.event)}" ?autofocus="${e=>e.autofocus}" autocomplete="${e=>e.autocomplete}" ?disabled="${e=>e.disabled}" list="${e=>e.list}" maxlength="${e=>e.maxlength}" minlength="${e=>e.minlength}" ?multiple="${e=>e.multiple}" name="${e=>e.name}" pattern="${e=>e.pattern}" placeholder="${e=>e.placeholder}" ?readonly="${e=>e.readOnly}" ?required="${e=>e.required}" size="${e=>e.size}" spellcheck="${e=>e.spellcheck}" type="${e=>e.type}" value="${e=>e.initialValue}" ${z("control")} />${pt(o)}</div></template>`}const mf=ff(),vf=Rr.compose({name:`${p.prefix}-text-input`,template:mf,styles:gf,shadowOptions:{delegatesFocus:!0}});vf.define(p.registry);var $f=Object.defineProperty,yf=Object.getOwnPropertyDescriptor,qe=(o,e,t,r)=>{for(var i=r>1?void 0:r?yf(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&$f(e,t,i),i};class Te extends x{constructor(){super(...arguments),this.elementInternals=this.attachInternals(),this.nowrap=!1,this.truncate=!1,this.italic=!1,this.underline=!1,this.strikethrough=!1,this.block=!1}}qe([a({mode:"boolean"})],Te.prototype,"nowrap",2),qe([a({mode:"boolean"})],Te.prototype,"truncate",2),qe([a({mode:"boolean"})],Te.prototype,"italic",2),qe([a({mode:"boolean"})],Te.prototype,"underline",2),qe([a({mode:"boolean"})],Te.prototype,"strikethrough",2),qe([a({mode:"boolean"})],Te.prototype,"block",2),qe([a],Te.prototype,"size",2),qe([a],Te.prototype,"font",2),qe([a],Te.prototype,"weight",2),qe([a],Te.prototype,"align",2);const xf=u`
|
|
545
545
|
${w("inline")}
|
|
546
546
|
|
|
547
|
-
:host{font-family:${v};font-size:${O};line-height:${M};font-weight:${E};text-align:start}:host([nowrap]),:host([nowrap]) ::slotted(*){white-space:nowrap;overflow:hidden}:host([truncate]),:host([truncate]) ::slotted(*){text-overflow:ellipsis}:host([block]){display:block}:host([italic]){font-style:italic}:host([underline]){text-decoration-line:underline}:host([strikethrough]){text-decoration-line:line-through}:host([underline][strikethrough]){text-decoration-line:line-through underline}:host([size='100']){font-size:${vo};line-height:${mr}}:host([size='200']){font-size:${F};line-height:${q}}:host([size='400']){font-size:${pe};line-height:${ke}}:host([size='500']){font-size:${Dt};line-height:${vr}}:host([size='600']){font-size:${gr};line-height:${Vn}}:host([size='700']){font-size:${Fn};line-height:${Hn}}:host([size='800']){font-size:${Mn};line-height:${jn}}:host([size='900']){font-size:${Dn};line-height:${Rn}}:host([size='1000']){font-size:${Ln};line-height:${qn}}:host([font='monospace']){font-family:${yd}}:host([font='numeric']){font-family:${xd}}:host([weight='medium']){font-weight:${kd}}:host([weight='semibold']){font-weight:${L}}:host([weight='bold']){font-weight:${fr}}:host([align='center']){text-align:center}:host([align='end']){text-align:end}:host([align='justify']){text-align:justify}::slotted(*){font:inherit;line-height:inherit;text-decoration-line:inherit;text-align:inherit;text-decoration-line:inherit;margin:0}`,
|
|
547
|
+
:host{font-family:${v};font-size:${O};line-height:${M};font-weight:${E};text-align:start}:host([nowrap]),:host([nowrap]) ::slotted(*){white-space:nowrap;overflow:hidden}:host([truncate]),:host([truncate]) ::slotted(*){text-overflow:ellipsis}:host([block]){display:block}:host([italic]){font-style:italic}:host([underline]){text-decoration-line:underline}:host([strikethrough]){text-decoration-line:line-through}:host([underline][strikethrough]){text-decoration-line:line-through underline}:host([size='100']){font-size:${vo};line-height:${mr}}:host([size='200']){font-size:${F};line-height:${q}}:host([size='400']){font-size:${pe};line-height:${ke}}:host([size='500']){font-size:${Dt};line-height:${vr}}:host([size='600']){font-size:${gr};line-height:${Vn}}:host([size='700']){font-size:${Fn};line-height:${Hn}}:host([size='800']){font-size:${Mn};line-height:${jn}}:host([size='900']){font-size:${Dn};line-height:${Rn}}:host([size='1000']){font-size:${Ln};line-height:${qn}}:host([font='monospace']){font-family:${yd}}:host([font='numeric']){font-family:${xd}}:host([weight='medium']){font-weight:${kd}}:host([weight='semibold']){font-weight:${L}}:host([weight='bold']){font-weight:${fr}}:host([align='center']){text-align:center}:host([align='end']){text-align:end}:host([align='justify']){text-align:justify}::slotted(*){font:inherit;line-height:inherit;text-decoration-line:inherit;text-align:inherit;text-decoration-line:inherit;margin:0}`,kf=g`<slot></slot>`,wf=Te.compose({name:`${p.prefix}-text`,template:kf,styles:xf});wf.define(p.registry);var Cf=Object.defineProperty,Sf=Object.getOwnPropertyDescriptor,Sa=(o,e,t,r)=>{for(var i=r>1?void 0:r?Sf(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&Cf(e,t,i),i};class Xi extends Xe{pressedChanged(){this.setPressedState()}mixedChanged(){this.setPressedState()}press(){this.pressed=!this.pressed}connectedCallback(){super.connectedCallback(),this.setPressedState()}setPressedState(){if(this.$fastController.isConnected){const e=`${this.mixed?"mixed":!!this.pressed}`;this.elementInternals.ariaPressed=e,$(this.elementInternals,"pressed",!!this.pressed||!!this.mixed)}}}Sa([a({mode:"boolean"})],Xi.prototype,"pressed",2),Sa([a({mode:"boolean"})],Xi.prototype,"mixed",2);const If=u`
|
|
548
548
|
${zr}
|
|
549
549
|
|
|
550
550
|
:host(${D}){border-color:${De};background-color:${dn};color:${B};border-width:${I}}:host(${D}:hover){border-color:${Mt};background-color:${cr}}:host(${D}:active){border-color:${fo};background-color:${pi}}:host(${D}[appearance='primary']:not(:focus-visible)){border-color:transparent}:host(${D}[appearance='primary']){background-color:${Jl};color:${Ue}}:host(${D}[appearance='primary']:hover){background-color:${fn}}:host(${D}[appearance='primary']:active){background-color:${mn}}:host(${D}[appearance='subtle']){border-color:transparent;background-color:${pn};color:${sr}}:host(${D}[appearance='subtle']:hover){background-color:${dr};color:${Et}}:host(${D}[appearance='subtle']:active){background-color:${go};color:${At}}:host(${D}[appearance='outline']),:host(${D}[appearance='transparent']){background-color:${bn}}:host(${D}[appearance='outline']:hover),:host(${D}[appearance='transparent']:hover){background-color:${hr}}:host(${D}[appearance='outline']:active),:host(${D}[appearance='transparent']:active){background-color:${ur}}:host(${D}[appearance='transparent']){border-color:transparent;color:${Ol}}:host(${D}[appearance='transparent']:hover){color:${nr}}:host(${D}[appearance='transparent']:active){color:${ar}}`.withBehaviors(X(u`
|
|
551
551
|
:host(${D}),:host(
|
|
552
552
|
${D}:is([appearance='primary'],[appearance='subtle'],[appearance='outline'],[appearance='transparent'])
|
|
553
|
-
){background:SelectedItem;color:SelectedItemText}`)),
|
|
553
|
+
){background:SelectedItem;color:SelectedItemText}`)),Pf=Oi(),zf=Xi.compose({name:`${p.prefix}-toggle-button`,template:Pf,styles:If});zf.define(p.registry);var Bf=Object.defineProperty,Tf=Object.getOwnPropertyDescriptor,qr=(o,e,t,r)=>{for(var i=r>1?void 0:r?Tf(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&Bf(e,t,i),i};class _o extends x{constructor(){super(),this.elementInternals=this.attachInternals(),this.id=co("tooltip-"),this.defaultDelay=250,this.anchor="",this.anchorPositioningStyleElement=null,this.mouseenterAnchorHandler=()=>this.showTooltip(this.delay),this.mouseleaveAnchorHandler=()=>this.hideTooltip(this.delay),this.focusAnchorHandler=()=>this.showTooltip(0),this.blurAnchorHandler=()=>this.hideTooltip(0),this.elementInternals.role="tooltip"}positioningChanged(){rr||this.setFallbackStyles()}get anchorElement(){const e=this.getRootNode();return(e instanceof ShadowRoot?e:document).getElementById(this.anchor??"")}connectedCallback(){if(super.connectedCallback(),!this.anchorElement)return;const e=this.anchorElement.style.anchorName||`--${this.anchor}`,t=this.anchorElement.getAttribute("aria-describedby");if(this.anchorElement.setAttribute("aria-describedby",t?`${t} ${this.id}`:this.id),this.anchorElement.addEventListener("focus",this.focusAnchorHandler),this.anchorElement.addEventListener("blur",this.blurAnchorHandler),this.anchorElement.addEventListener("mouseenter",this.mouseenterAnchorHandler),this.anchorElement.addEventListener("mouseleave",this.mouseleaveAnchorHandler),rr){Il||(this.anchorElement.style.anchorName=e,this.style.positionAnchor=e);return}A.enqueue(()=>this.setFallbackStyles())}disconnectedCallback(){super.disconnectedCallback(),this.anchorElement?.removeEventListener("focus",this.focusAnchorHandler),this.anchorElement?.removeEventListener("blur",this.blurAnchorHandler),this.anchorElement?.removeEventListener("mouseenter",this.mouseenterAnchorHandler),this.anchorElement?.removeEventListener("mouseleave",this.mouseleaveAnchorHandler)}showTooltip(e=this.defaultDelay){setTimeout(()=>{this.setAttribute("aria-hidden","false"),this.showPopover()},e)}hideTooltip(e=this.defaultDelay){setTimeout(()=>{if(this.matches(":hover")||this.anchorElement?.matches(":hover")){this.hideTooltip(e);return}this.setAttribute("aria-hidden","true"),this.hidePopover()},e)}setFallbackStyles(){if(!this.anchorElement)return;const e=this.anchorElement.style.anchorName||`--${this.anchor}`;this.anchorPositioningStyleElement||(this.anchorPositioningStyleElement=document.createElement("style"),document.head.append(this.anchorPositioningStyleElement));let[t,r]=this.positioning?.split("-")??[];r||((t==="above"||t==="below")&&(r="centerX"),(t==="before"||t==="after")&&(r="centerY"));const i={above:"bottom: anchor(top);",below:"top: anchor(bottom);",before:"right: anchor(left);",after:"left: anchor(right);"},s=i[t]??i.above,n={start:"left: anchor(left);",end:"right: anchor(right);",top:"top: anchor(top);",bottom:"bottom: anchor(bottom);",centerX:"left: anchor(center); translate: -50% 0;",centerY:"top: anchor(center); translate: 0 -50%;"},c=n[r]??n.centerX;this.anchorPositioningStyleElement.textContent=`
|
|
554
554
|
#${this.anchor} {
|
|
555
555
|
anchor-name: ${e};
|
|
556
556
|
}
|
|
@@ -561,29 +561,29 @@ const p=Object.freeze({prefix:"fluent",shadowRootMode:"open",registry:customElem
|
|
|
561
561
|
${s}
|
|
562
562
|
${c}
|
|
563
563
|
}
|
|
564
|
-
`,window.CSS_ANCHOR_POLYFILL&&window.CSS_ANCHOR_POLYFILL.call({element:this.anchorPositioningStyleElement})}}qr([a],_o.prototype,"id",2),qr([a({converter:re})],_o.prototype,"delay",2),qr([a],_o.prototype,"positioning",2),qr([a],_o.prototype,"anchor",2);const Ie={"above-start":"block-start span-inline-end",above:"block-start","above-end":"block-start span-inline-start","below-start":"block-end span-inline-end",below:"block-end","below-end":"block-end span-inline-start","before-top":"inline-start span-block-end",before:"inline-start","before-bottom":"inline-start span-block-start","after-top":"inline-end span-block-end",after:"inline-end","after-bottom":"inline-end span-block-start"},
|
|
564
|
+
`,window.CSS_ANCHOR_POLYFILL&&window.CSS_ANCHOR_POLYFILL.call({element:this.anchorPositioningStyleElement})}}qr([a],_o.prototype,"id",2),qr([a({converter:re})],_o.prototype,"delay",2),qr([a],_o.prototype,"positioning",2),qr([a],_o.prototype,"anchor",2);const Ie={"above-start":"block-start span-inline-end",above:"block-start","above-end":"block-start span-inline-start","below-start":"block-end span-inline-end",below:"block-end","below-end":"block-end span-inline-start","before-top":"inline-start span-block-end",before:"inline-start","before-bottom":"inline-start span-block-start","after-top":"inline-end span-block-end",after:"inline-end","after-bottom":"inline-end span-block-start"},_f=u`
|
|
565
565
|
${w("inline-flex")}
|
|
566
566
|
|
|
567
|
-
:host(:not(:popover-open)){display:none}:host{--position-area:block-start;--position-try-options:flip-block;--block-offset:${Lt};--inline-offset:${ie};background:${S};border-radius:${C};border:1px solid ${K};box-sizing:border-box;color:${B};display:inline-flex;filter:drop-shadow(0 0 2px ${rc}) drop-shadow(0 4px 8px ${ic});font-family:${v};font-size:${F};inset:unset;line-height:${q};margin:unset;max-width:240px;overflow:visible;padding:4px ${Ve} 6px;position:absolute;position-area:var(--position-area);position-try-options:var(--position-try-options);width:auto;z-index:1}@supports (inset-area:block-start){:host{inset-area:var(--position-area);position-try-fallbacks:var(--position-try-options)}}:host(:is([positioning^='above'],[positioning^='below'],:not([positioning]))){margin-block:var(--block-offset)}:host(:is([positioning^='before'],[positioning^='after'])){margin-inline:var(--inline-offset);--position-try-options:flip-inline}:host([positioning='above-start']){--position-area:${Ie["above-start"]}}:host([positioning='above']){--position-area:${Ie.above}}:host([positioning='above-end']){--position-area:${Ie["above-end"]}}:host([positioning='below-start']){--position-area:${Ie["below-start"]}}:host([positioning='below']){--position-area:${Ie.below}}:host([positioning='below-end']){--position-area:${Ie["below-end"]}}:host([positioning='before-top']){--position-area:${Ie["before-top"]}}:host([positioning='before']){--position-area:${Ie.before}}:host([positioning='before-bottom']){--position-area:${Ie["before-bottom"]}}:host([positioning='after-top']){--position-area:${Ie["after-top"]}}:host([positioning='after']){--position-area:${Ie.after}}:host([positioning='after-bottom']){--position-area:${Ie["after-bottom"]}}`,
|
|
567
|
+
:host(:not(:popover-open)){display:none}:host{--position-area:block-start;--position-try-options:flip-block;--block-offset:${Lt};--inline-offset:${ie};background:${S};border-radius:${C};border:1px solid ${K};box-sizing:border-box;color:${B};display:inline-flex;filter:drop-shadow(0 0 2px ${rc}) drop-shadow(0 4px 8px ${ic});font-family:${v};font-size:${F};inset:unset;line-height:${q};margin:unset;max-width:240px;overflow:visible;padding:4px ${Ve} 6px;position:absolute;position-area:var(--position-area);position-try-options:var(--position-try-options);width:auto;z-index:1}@supports (inset-area:block-start){:host{inset-area:var(--position-area);position-try-fallbacks:var(--position-try-options)}}:host(:is([positioning^='above'],[positioning^='below'],:not([positioning]))){margin-block:var(--block-offset)}:host(:is([positioning^='before'],[positioning^='after'])){margin-inline:var(--inline-offset);--position-try-options:flip-inline}:host([positioning='above-start']){--position-area:${Ie["above-start"]}}:host([positioning='above']){--position-area:${Ie.above}}:host([positioning='above-end']){--position-area:${Ie["above-end"]}}:host([positioning='below-start']){--position-area:${Ie["below-start"]}}:host([positioning='below']){--position-area:${Ie.below}}:host([positioning='below-end']){--position-area:${Ie["below-end"]}}:host([positioning='before-top']){--position-area:${Ie["before-top"]}}:host([positioning='before']){--position-area:${Ie.before}}:host([positioning='before-bottom']){--position-area:${Ie["before-bottom"]}}:host([positioning='after-top']){--position-area:${Ie["after-top"]}}:host([positioning='after']){--position-area:${Ie.after}}:host([positioning='after-bottom']){--position-area:${Ie["after-bottom"]}}`,Of=g`<template popover aria-hidden="true"><slot></slot></template>`,Ef=_o.compose({name:`${p.prefix}-tooltip`,template:Of,styles:_f});Ef.define(p.registry);const Ia={subtle:"subtle",subtleAlpha:"subtle-alpha",transparent:"transparent"},Pa={small:"small",medium:"medium"};function _e(o,e="-tree-item"){return o?.nodeType!==Node.ELEMENT_NODE?!1:o.tagName.toLowerCase().endsWith(e)}var Af=Object.defineProperty,Nf=Object.getOwnPropertyDescriptor,Ki=(o,e,t,r)=>{for(var i=r>1?void 0:r?Nf(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&Af(e,t,i),i};class Wr extends x{constructor(){super(),this.currentSelected=null,this.currentFocused=null,this.elementInternals=this.attachInternals(),this.elementInternals.role="tree"}defaultSlotChanged(){this.handleDefaultSlotChange()}connectedCallback(){super.connectedCallback(),this.tabIndex=Number(this.getAttribute("tabindex")??0)<0?-1:0}childTreeItemsChanged(){this.updateCurrentSelected()}updateCurrentSelected(){const e=this.querySelector("[selected]");this.currentSelected=e,(this.currentFocused===null||!this.contains(this.currentFocused))&&(this.currentFocused=this.getValidFocusableItem())}keydownHandler(e){if(e.defaultPrevented)return;const t=e.target;if(!_e(t)||this.childTreeItems.length<1)return!0;const r=this.getVisibleNodes();switch(e.key){case er:{r.length&&r[0].focus();return}case Jo:{r.length&&r[r.length-1].focus();return}case Yo:{t?.childTreeItems?.length&&t.expanded?t.expanded=!1:_e(t.parentElement)&&t.parentElement.focus();return}case Qo:{t?.childTreeItems?.length&&(t.expanded?this.focusNextNode(1,t):t.expanded=!0);return}case Ko:{this.focusNextNode(1,t);return}case Zo:{this.focusNextNode(-1,t);return}case lo:{this.clickHandler(e);return}case tr:{t.selected=!0;return}}return!0}focusHandler(e){if(!(this.childTreeItems.length<1)){if(e.target===this){this.currentFocused=this.getValidFocusableItem(),this.currentFocused&&this.currentFocused.tabIndex<0&&(this.currentFocused.tabIndex=0),this.currentFocused?.focus();return}this.contains(e.target)&&(this.setAttribute("tabindex","-1"),this.currentFocused=e.target)}}blurHandler(e){e.target instanceof HTMLElement&&(e.relatedTarget===null||!this.contains(e.relatedTarget))&&this.setAttribute("tabindex","0")}clickHandler(e){if(e.defaultPrevented)return;if(!_e(e.target))return!0;const t=e.target;t.toggleExpansion(),t.selected=!0}changeHandler(e){if(e.defaultPrevented)return;if(!_e(e.target))return!0;const t=e.target;t.selected?(this.currentSelected&&this.currentSelected!==t&&_e(this.currentSelected)&&(this.currentSelected.selected=!1),this.currentSelected=t):!t.selected&&this.currentSelected===t&&(this.currentSelected=null)}getValidFocusableItem(){const e=this.getVisibleNodes();let t=e.findIndex(r=>r.selected);return t===-1&&(t=e.findIndex(r=>_e(r))),t!==-1?e[t]:null}getVisibleNodes(){return Array.from(this.querySelectorAll("*")).filter(e=>_e(e)&&e.offsetParent!==null)}focusNextNode(e,t){const r=this.getVisibleNodes();if(!r.length)return;const i=r[r.indexOf(t)+e];di(i)&&i.focus()}handleDefaultSlotChange(){this.childTreeItems=this.defaultSlot.assignedElements().filter(e=>_e(e))}}Ki([b],Wr.prototype,"currentSelected",2),Ki([b],Wr.prototype,"defaultSlot",2),Ki([b],Wr.prototype,"childTreeItems",2);var Ff=Object.defineProperty,Mf=Object.getOwnPropertyDescriptor,za=(o,e,t,r)=>{for(var i=r>1?void 0:r?Mf(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&Ff(e,t,i),i};class Yi extends Wr{constructor(){super(...arguments),this.size=Pa.small,this.appearance=Ia.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})}}za([a],Yi.prototype,"size",2),za([a],Yi.prototype,"appearance",2);const Df=u`
|
|
568
568
|
${w("block")}
|
|
569
569
|
|
|
570
|
-
:host{outline:none}`,
|
|
571
|
-
:host{--indent:${t}}`,this.$fastController.addStyles(this.styles)}childTreeItemsChanged(){this.empty=this.childTreeItems?.length===0,this.updateChildTreeItems()}connectedCallback(){super.connectedCallback(),A.enqueue(()=>{this.updateTabindexBySelected()})}updateChildTreeItems(){this.childTreeItems?.length&&(this.expanded||(this.expanded=Array.from(this.querySelectorAll("[selected]")).some(e=>_e(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 _e(this.parentElement)}updateTabindexBySelected(){this.tabIndex=this.selected?0:-1}handleItemSlotChange(){this.childTreeItems=this.itemSlot.assignedElements().filter(e=>_e(e))}}oo([b],It.prototype,"itemSlot",2),oo([a({mode:"boolean"})],It.prototype,"expanded",2),oo([a({mode:"boolean"})],It.prototype,"selected",2),oo([a({mode:"boolean"})],It.prototype,"empty",2),oo([a({attribute:"data-indent"})],It.prototype,"dataIndent",2),oo([b],It.prototype,"childTreeItems",2);var
|
|
570
|
+
:host{outline:none}`,Lf=g`<template tabindex="0" @click="${(o,e)=>o.clickHandler(e.event)}" @focusin="${(o,e)=>o.focusHandler(e.event)}" @focusout="${(o,e)=>o.blurHandler(e.event)}" @keydown="${(o,e)=>o.keydownHandler(e.event)}" @change="${(o,e)=>o.changeHandler(e.event)}"><slot ${z("defaultSlot")} @slotchange="${o=>o.handleDefaultSlotChange()}"></slot></template>`,Vf=Yi.compose({name:`${p.prefix}-tree`,template:Lf,styles:Df});Vf.define(p.registry);var Hf=Object.defineProperty,jf=Object.getOwnPropertyDescriptor,oo=(o,e,t,r)=>{for(var i=r>1?void 0:r?jf(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&Hf(e,t,i),i};class It extends x{constructor(){super(),this.elementInternals=this.attachInternals(),this.expanded=!1,this.empty=!1,this.childTreeItems=[],this.elementInternals.role="treeitem"}itemSlotChanged(){this.handleItemSlotChange()}expandedChanged(e,t){this.$emit("toggle",{oldState:e?"open":"closed",newState:t?"open":"closed"}),$(this.elementInternals,"expanded",t),this.childTreeItems&&this.childTreeItems.length>0&&(this.elementInternals.ariaExpanded=t?"true":"false")}selectedChanged(e,t){this.updateTabindexBySelected(),this.$emit("change"),$(this.elementInternals,"selected",t),this.elementInternals.ariaSelected=t?"true":"false"}dataIndentChanged(e,t){this.styles!==void 0&&this.$fastController.removeStyles(this.styles),this.styles=u`
|
|
571
|
+
:host{--indent:${t}}`,this.$fastController.addStyles(this.styles)}childTreeItemsChanged(){this.empty=this.childTreeItems?.length===0,this.updateChildTreeItems()}connectedCallback(){super.connectedCallback(),A.enqueue(()=>{this.updateTabindexBySelected()})}updateChildTreeItems(){this.childTreeItems?.length&&(this.expanded||(this.expanded=Array.from(this.querySelectorAll("[selected]")).some(e=>_e(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 _e(this.parentElement)}updateTabindexBySelected(){this.tabIndex=this.selected?0:-1}handleItemSlotChange(){this.childTreeItems=this.itemSlot.assignedElements().filter(e=>_e(e))}}oo([b],It.prototype,"itemSlot",2),oo([a({mode:"boolean"})],It.prototype,"expanded",2),oo([a({mode:"boolean"})],It.prototype,"selected",2),oo([a({mode:"boolean"})],It.prototype,"empty",2),oo([a({attribute:"data-indent"})],It.prototype,"dataIndent",2),oo([b],It.prototype,"childTreeItems",2);var Rf=Object.defineProperty,qf=Object.getOwnPropertyDescriptor,Ba=(o,e,t,r)=>{for(var i=r>1?void 0:r?qf(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&Rf(e,t,i),i};class Qi extends It{constructor(){super(...arguments),this.size=Pa.small,this.appearance=Ia.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})}}Ba([a],Qi.prototype,"size",2),Ba([a],Qi.prototype,"appearance",2);const Wf=u`
|
|
572
572
|
${w("block")}
|
|
573
573
|
|
|
574
574
|
:host{outline:none;font-size:${O};line-height:${M}}:host(:focus-visible) .positioning-region{box-shadow:${wi} ${wi} ${wi} ${yr}
|
|
575
|
-
${ue} inset}.positioning-region{display:flex;align-items:center;justify-content:space-between;cursor:pointer;height:${zd};padding-inline-start:calc(var(--indent) * ${ki});padding-inline-end:${se};border-radius:${C};background-color:${un};color:${Pe};gap:${ie}}@media (prefers-contrast:more){:host(:focus-visible) .positioning-region{outline:1px solid ${ue}}}.content{display:flex;align-items:center;gap:${ie}}.chevron{display:flex;align-items:center;flex-shrink:0;justify-content:center;width:${ki};height:${$t};transition:transform ${kr} ${Xn};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:${dr};color:${Et}}.positioning-region:active{background-color:${go};color:${At}}::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:${pn};color:${sr}}:host([selected]) .content,:host([selected]) .chevron{color:${Nl}}:host([size='small']) .positioning-region{height:${$t};padding-inline-start:calc(var(--indent) * ${ae})}:host([appearance='subtle-alpha']) .positioning-region:hover{background-color:${Yl}}:host([appearance='subtle-alpha']) .positioning-region:active{background-color:${Ql}}:host([appearance='subtle-alpha'][selected]) .positioning-region{background-color:${Zl};color:${sr}}:host([appearance='transparent']) .positioning-region{background-color:${he}}:host([appearance='transparent']) .positioning-region:hover{background-color:${hr}}:host([appearance='transparent']) .positioning-region:active{background-color:${ur}}:host([appearance='transparent'][selected]) .positioning-region{background-color:${bn};color:${sr}}:host([expanded]) .chevron{transform:rotate(90deg)}`,
|
|
575
|
+
${ue} inset}.positioning-region{display:flex;align-items:center;justify-content:space-between;cursor:pointer;height:${zd};padding-inline-start:calc(var(--indent) * ${ki});padding-inline-end:${se};border-radius:${C};background-color:${un};color:${Pe};gap:${ie}}@media (prefers-contrast:more){:host(:focus-visible) .positioning-region{outline:1px solid ${ue}}}.content{display:flex;align-items:center;gap:${ie}}.chevron{display:flex;align-items:center;flex-shrink:0;justify-content:center;width:${ki};height:${$t};transition:transform ${kr} ${Xn};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:${dr};color:${Et}}.positioning-region:active{background-color:${go};color:${At}}::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:${pn};color:${sr}}:host([selected]) .content,:host([selected]) .chevron{color:${Nl}}:host([size='small']) .positioning-region{height:${$t};padding-inline-start:calc(var(--indent) * ${ae})}:host([appearance='subtle-alpha']) .positioning-region:hover{background-color:${Yl}}:host([appearance='subtle-alpha']) .positioning-region:active{background-color:${Ql}}:host([appearance='subtle-alpha'][selected]) .positioning-region{background-color:${Zl};color:${sr}}:host([appearance='transparent']) .positioning-region{background-color:${he}}:host([appearance='transparent']) .positioning-region:hover{background-color:${hr}}:host([appearance='transparent']) .positioning-region:active{background-color:${ur}}:host([appearance='transparent'][selected]) .positioning-region{background-color:${bn};color:${sr}}:host([expanded]) .chevron{transform:rotate(90deg)}`,Gf=g`<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>`,Uf=g`<template slot="${o=>o.isNestedItem?"item":void 0}"><div class="positioning-region" part="positioning-region"><div class="content" part="content"><span class="chevron" part="chevron" aria-hidden="true"><slot name="chevron">${Gf}</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>`,Xf=Qi.compose({name:`${p.prefix}-tree-item`,template:Uf,styles:Wf});Xf.define(p.registry);const Kf="adoptedStyleSheets"in document,Yf="CSSScopeRule"in window,Zi=new Map,Ji=new Map,Oo=new Map,es=new Map,Eo=new CSSStyleSheet;function Qf(o,e=document){if(!(!e||!Zf(e))){if(!Kf||e instanceof HTMLElement&&!e.shadowRoot&&!Yf){const t=e===document?document.documentElement:e;rm(o,t);return}[document,document.documentElement,document.body].includes(e)?Jf(o):em(o,e)}}function ts(o){if(!Zi.has(o)){const e=[];for(const[t,r]of Object.entries(o))e.push(`--${t}:${r.toString()};`);Zi.set(o,e.join(""))}return Zi.get(o)}function Zf(o){return[document,document.documentElement].includes(o)||o instanceof HTMLElement&&!!o.closest("body")}function Jf(o){if(o===null){document.adoptedStyleSheets.includes(Eo)&&Eo.replaceSync("");return}Eo.replaceSync(`
|
|
576
576
|
html {
|
|
577
577
|
${ts(o)}
|
|
578
578
|
}
|
|
579
|
-
`),document.adoptedStyleSheets.includes(Eo)||document.adoptedStyleSheets.push(Eo)}function
|
|
579
|
+
`),document.adoptedStyleSheets.includes(Eo)||document.adoptedStyleSheets.push(Eo)}function em(o,e){if(o===null){e.shadowRoot&&Oo.has(e)?Oo.get(e).replaceSync(""):(delete e.dataset.fluentTheme,Ta(e));return}e.shadowRoot?tm(e).replaceSync(`
|
|
580
580
|
:host {
|
|
581
581
|
${ts(o)}
|
|
582
582
|
}
|
|
583
|
-
`):(e.dataset.fluentTheme=
|
|
583
|
+
`):(e.dataset.fluentTheme=om(o),Ta(e))}function tm(o){if(!Oo.has(o)){const e=new CSSStyleSheet;Oo.set(o,e),o.shadowRoot?.adoptedStyleSheets.push(e)}return Oo.get(o)}function om(o){if(!Ji.has(o)){const e=co("fluent-theme-"),t=new CSSStyleSheet;Ji.set(o,e),t.replaceSync(`
|
|
584
584
|
@scope ([data-fluent-theme="${e}"]) {
|
|
585
585
|
:scope {
|
|
586
586
|
${ts(o)}
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
|
-
`),document.adoptedStyleSheets.push(t)}return Ji.get(o)}function
|
|
589
|
+
`),document.adoptedStyleSheets.push(t)}return Ji.get(o)}function rm(o,e){let t;if(o===null){if(!es.has(e))return;t=es.get(e)}else es.set(e,o),t=o;for(const[r,i]of Object.entries(t))o===null?e.style.removeProperty(`--${r}`):e.style.setProperty(`--${r}`,i.toString())}const{userAgent:im}=navigator,sm=/\bAppleWebKit\/[\d+\.]+\b/.test(im);function Ta(o){if(!sm)return;const e="visibility",t="hidden",r=o.style.getPropertyValue(e);o.style.setProperty(e,t),A.process(),o.style.setProperty(e,r)}export{Qf as setTheme};
|