@ni/fast-foundation 10.1.0 → 10.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -160,6 +160,7 @@ export declare class NumberField extends FormAssociatedNumberField {
|
|
|
160
160
|
valueChanged(previous: string, next: string): void;
|
|
161
161
|
/** {@inheritDoc (FormAssociated:interface).validate} */
|
|
162
162
|
validate(): void;
|
|
163
|
+
private limitPrecision;
|
|
163
164
|
/**
|
|
164
165
|
* Sets the internal value to a valid number between the min and max properties
|
|
165
166
|
* @param value - user input
|
|
@@ -119,6 +119,9 @@ export class NumberField extends FormAssociatedNumberField {
|
|
|
119
119
|
validate() {
|
|
120
120
|
super.validate(this.control);
|
|
121
121
|
}
|
|
122
|
+
limitPrecision(value) {
|
|
123
|
+
return parseFloat(value.toPrecision(15));
|
|
124
|
+
}
|
|
122
125
|
/**
|
|
123
126
|
* Sets the internal value to a valid number between the min and max properties
|
|
124
127
|
* @param value - user input
|
|
@@ -126,16 +129,17 @@ export class NumberField extends FormAssociatedNumberField {
|
|
|
126
129
|
* @internal
|
|
127
130
|
*/
|
|
128
131
|
getValidValue(value) {
|
|
129
|
-
|
|
130
|
-
let validValue = parseFloat(parseFloat(value).toPrecision(12));
|
|
132
|
+
let validValue = this.limitPrecision(parseFloat(value));
|
|
131
133
|
if (isNaN(validValue)) {
|
|
132
|
-
|
|
134
|
+
return "";
|
|
135
|
+
}
|
|
136
|
+
if (this.max !== undefined) {
|
|
137
|
+
validValue = Math.min(validValue, this.limitPrecision(this.max));
|
|
133
138
|
}
|
|
134
|
-
|
|
135
|
-
validValue = Math.
|
|
136
|
-
validValue = Math.max(validValue, (_b = this.min) !== null && _b !== void 0 ? _b : validValue).toString();
|
|
139
|
+
if (this.min !== undefined) {
|
|
140
|
+
validValue = Math.max(validValue, this.limitPrecision(this.min));
|
|
137
141
|
}
|
|
138
|
-
return validValue;
|
|
142
|
+
return validValue.toString();
|
|
139
143
|
}
|
|
140
144
|
/**
|
|
141
145
|
* Increments the value using the step value
|
|
@@ -6096,6 +6096,7 @@ export declare class NumberField extends FormAssociatedNumberField {
|
|
|
6096
6096
|
valueChanged(previous: string, next: string): void;
|
|
6097
6097
|
/** {@inheritDoc (FormAssociated:interface).validate} */
|
|
6098
6098
|
validate(): void;
|
|
6099
|
+
private limitPrecision;
|
|
6099
6100
|
/**
|
|
6100
6101
|
* Sets the internal value to a valid number between the min and max properties
|
|
6101
6102
|
* @param value - user input
|
package/dist/fast-foundation.js
CHANGED
|
@@ -5513,7 +5513,7 @@ function isHTMLElement(...args) {
|
|
|
5513
5513
|
* Returns all displayed elements inside of a root node that match a provided selector
|
|
5514
5514
|
*/
|
|
5515
5515
|
function getDisplayedNodes(rootNode, selector) {
|
|
5516
|
-
if (!rootNode ||
|
|
5516
|
+
if (!rootNode || !selector || !isHTMLElement(rootNode)) {
|
|
5517
5517
|
return;
|
|
5518
5518
|
}
|
|
5519
5519
|
const nodes = Array.from(rootNode.querySelectorAll(selector));
|
|
@@ -16129,6 +16129,9 @@ class NumberField extends FormAssociatedNumberField {
|
|
|
16129
16129
|
validate() {
|
|
16130
16130
|
super.validate(this.control);
|
|
16131
16131
|
}
|
|
16132
|
+
limitPrecision(value) {
|
|
16133
|
+
return parseFloat(value.toPrecision(15));
|
|
16134
|
+
}
|
|
16132
16135
|
/**
|
|
16133
16136
|
* Sets the internal value to a valid number between the min and max properties
|
|
16134
16137
|
* @param value - user input
|
|
@@ -16136,16 +16139,17 @@ class NumberField extends FormAssociatedNumberField {
|
|
|
16136
16139
|
* @internal
|
|
16137
16140
|
*/
|
|
16138
16141
|
getValidValue(value) {
|
|
16139
|
-
|
|
16140
|
-
let validValue = parseFloat(parseFloat(value).toPrecision(12));
|
|
16142
|
+
let validValue = this.limitPrecision(parseFloat(value));
|
|
16141
16143
|
if (isNaN(validValue)) {
|
|
16142
|
-
|
|
16144
|
+
return "";
|
|
16143
16145
|
}
|
|
16144
|
-
|
|
16145
|
-
validValue = Math.min(validValue, (
|
|
16146
|
-
|
|
16146
|
+
if (this.max !== undefined) {
|
|
16147
|
+
validValue = Math.min(validValue, this.limitPrecision(this.max));
|
|
16148
|
+
}
|
|
16149
|
+
if (this.min !== undefined) {
|
|
16150
|
+
validValue = Math.max(validValue, this.limitPrecision(this.min));
|
|
16147
16151
|
}
|
|
16148
|
-
return validValue;
|
|
16152
|
+
return validValue.toString();
|
|
16149
16153
|
}
|
|
16150
16154
|
/**
|
|
16151
16155
|
* Increments the value using the step value
|
|
@@ -848,7 +848,7 @@ const t=function(){if("undefined"!=typeof globalThis)return globalThis;if("undef
|
|
|
848
848
|
${Jt(0,e)}
|
|
849
849
|
</div>
|
|
850
850
|
</template>
|
|
851
|
-
`;class On extends ei{}class Sn extends(hs(On)){constructor(){super(...arguments),this.proxy=document.createElement("input")}}const Rn={email:"email",password:"password",tel:"tel",text:"text",url:"url"};class An extends Sn{constructor(){super(...arguments),this.type=Rn.text}readOnlyChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.readOnly=this.readOnly,this.validate())}autofocusChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.autofocus=this.autofocus,this.validate())}placeholderChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.placeholder=this.placeholder)}typeChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.type=this.type,this.validate())}listChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.setAttribute("list",this.list),this.validate())}maxlengthChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.maxLength=this.maxlength,this.validate())}minlengthChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.minLength=this.minlength,this.validate())}patternChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.pattern=this.pattern,this.validate())}sizeChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.size=this.size)}spellcheckChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.spellcheck=this.spellcheck)}connectedCallback(){super.connectedCallback(),this.proxy.setAttribute("type",this.type),this.validate(),this.autofocus&&c.queueUpdate((()=>{this.focus()}))}select(){this.control.select(),this.$emit("select")}handleTextInput(){this.value=this.control.value}handleChange(){this.$emit("change")}validate(){super.validate(this.control)}}oe([lt({attribute:"readonly",mode:"boolean"})],An.prototype,"readOnly",void 0),oe([lt({mode:"boolean"})],An.prototype,"autofocus",void 0),oe([lt],An.prototype,"placeholder",void 0),oe([lt],An.prototype,"type",void 0),oe([lt],An.prototype,"list",void 0),oe([lt({converter:rt})],An.prototype,"maxlength",void 0),oe([lt({converter:rt})],An.prototype,"minlength",void 0),oe([lt],An.prototype,"pattern",void 0),oe([lt({converter:rt})],An.prototype,"size",void 0),oe([lt({mode:"boolean"})],An.prototype,"spellcheck",void 0),oe([v],An.prototype,"defaultSlottedNodes",void 0);class Dn{}oi(Dn,Vi),oi(An,Zt,Dn);class Fn extends ei{}class Ln extends(hs(Fn)){constructor(){super(...arguments),this.proxy=document.createElement("input")}}class Pn extends Ln{constructor(){super(...arguments),this.hideStep=!1,this.step=1,this.isUserInput=!1}maxChanged(t,e){var i;this.max=Math.max(e,null!==(i=this.min)&&void 0!==i?i:e);const s=Math.min(this.min,this.max);void 0!==this.min&&this.min!==s&&(this.min=s),this.value=this.getValidValue(this.value)}minChanged(t,e){var i;this.min=Math.min(e,null!==(i=this.max)&&void 0!==i?i:e);const s=Math.max(this.min,this.max);void 0!==this.max&&this.max!==s&&(this.max=s),this.value=this.getValidValue(this.value)}get valueAsNumber(){return parseFloat(super.value)}set valueAsNumber(t){this.value=t.toString()}valueChanged(t,e){this.value=this.getValidValue(e),e===this.value&&(this.control&&!this.isUserInput&&this.syncValueToInnerControl(),super.valueChanged(t,this.value),void 0===t||this.isUserInput||(this.$emit("input"),this.$emit("change")),this.isUserInput=!1)}validate(){super.validate(this.control)}getValidValue(t){
|
|
851
|
+
`;class On extends ei{}class Sn extends(hs(On)){constructor(){super(...arguments),this.proxy=document.createElement("input")}}const Rn={email:"email",password:"password",tel:"tel",text:"text",url:"url"};class An extends Sn{constructor(){super(...arguments),this.type=Rn.text}readOnlyChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.readOnly=this.readOnly,this.validate())}autofocusChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.autofocus=this.autofocus,this.validate())}placeholderChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.placeholder=this.placeholder)}typeChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.type=this.type,this.validate())}listChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.setAttribute("list",this.list),this.validate())}maxlengthChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.maxLength=this.maxlength,this.validate())}minlengthChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.minLength=this.minlength,this.validate())}patternChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.pattern=this.pattern,this.validate())}sizeChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.size=this.size)}spellcheckChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.spellcheck=this.spellcheck)}connectedCallback(){super.connectedCallback(),this.proxy.setAttribute("type",this.type),this.validate(),this.autofocus&&c.queueUpdate((()=>{this.focus()}))}select(){this.control.select(),this.$emit("select")}handleTextInput(){this.value=this.control.value}handleChange(){this.$emit("change")}validate(){super.validate(this.control)}}oe([lt({attribute:"readonly",mode:"boolean"})],An.prototype,"readOnly",void 0),oe([lt({mode:"boolean"})],An.prototype,"autofocus",void 0),oe([lt],An.prototype,"placeholder",void 0),oe([lt],An.prototype,"type",void 0),oe([lt],An.prototype,"list",void 0),oe([lt({converter:rt})],An.prototype,"maxlength",void 0),oe([lt({converter:rt})],An.prototype,"minlength",void 0),oe([lt],An.prototype,"pattern",void 0),oe([lt({converter:rt})],An.prototype,"size",void 0),oe([lt({mode:"boolean"})],An.prototype,"spellcheck",void 0),oe([v],An.prototype,"defaultSlottedNodes",void 0);class Dn{}oi(Dn,Vi),oi(An,Zt,Dn);class Fn extends ei{}class Ln extends(hs(Fn)){constructor(){super(...arguments),this.proxy=document.createElement("input")}}class Pn extends Ln{constructor(){super(...arguments),this.hideStep=!1,this.step=1,this.isUserInput=!1}maxChanged(t,e){var i;this.max=Math.max(e,null!==(i=this.min)&&void 0!==i?i:e);const s=Math.min(this.min,this.max);void 0!==this.min&&this.min!==s&&(this.min=s),this.value=this.getValidValue(this.value)}minChanged(t,e){var i;this.min=Math.min(e,null!==(i=this.max)&&void 0!==i?i:e);const s=Math.max(this.min,this.max);void 0!==this.max&&this.max!==s&&(this.max=s),this.value=this.getValidValue(this.value)}get valueAsNumber(){return parseFloat(super.value)}set valueAsNumber(t){this.value=t.toString()}valueChanged(t,e){this.value=this.getValidValue(e),e===this.value&&(this.control&&!this.isUserInput&&this.syncValueToInnerControl(),super.valueChanged(t,this.value),void 0===t||this.isUserInput||(this.$emit("input"),this.$emit("change")),this.isUserInput=!1)}validate(){super.validate(this.control)}limitPrecision(t){return parseFloat(t.toPrecision(15))}getValidValue(t){let e=this.limitPrecision(parseFloat(t));return isNaN(e)?"":(void 0!==this.max&&(e=Math.min(e,this.limitPrecision(this.max))),void 0!==this.min&&(e=Math.max(e,this.limitPrecision(this.min))),e.toString())}stepUp(){const t=parseFloat(this.value),e=isNaN(t)?this.min>0?this.min:this.max<0?this.max:this.min?0:this.step:t+this.step;this.value=e.toString()}stepDown(){const t=parseFloat(this.value),e=isNaN(t)?this.min>0?this.min:this.max<0?this.max:this.min?0:0-this.step:t-this.step;this.value=e.toString()}connectedCallback(){super.connectedCallback(),this.proxy.setAttribute("type","number"),this.validate(),this.syncValueToInnerControl(),this.autofocus&&c.queueUpdate((()=>{this.focus()}))}select(){this.control.select(),this.$emit("select")}handleTextInput(){this.control.value=this.sanitizeInput(this.control.value),this.isUserInput=!0,this.syncValueFromInnerControl()}handleChange(){this.$emit("change")}handleKeyDown(t){switch(t.key){case xi:return this.stepUp(),!1;case bi:return this.stepDown(),!1}return!0}handleBlur(){this.syncValueToInnerControl()}sanitizeInput(t){return t.replace(/[^0-9\-+e.]/g,"")}syncValueFromInnerControl(){this.value=this.control.value}syncValueToInnerControl(){this.control.value=this.value}}oe([lt({attribute:"readonly",mode:"boolean"})],Pn.prototype,"readOnly",void 0),oe([lt({mode:"boolean"})],Pn.prototype,"autofocus",void 0),oe([lt({attribute:"hide-step",mode:"boolean"})],Pn.prototype,"hideStep",void 0),oe([lt],Pn.prototype,"placeholder",void 0),oe([lt],Pn.prototype,"list",void 0),oe([lt({converter:rt})],Pn.prototype,"maxlength",void 0),oe([lt({converter:rt})],Pn.prototype,"minlength",void 0),oe([lt({converter:rt})],Pn.prototype,"size",void 0),oe([lt({converter:rt})],Pn.prototype,"step",void 0),oe([lt({converter:rt})],Pn.prototype,"max",void 0),oe([lt({converter:rt})],Pn.prototype,"min",void 0),oe([v],Pn.prototype,"defaultSlottedNodes",void 0),oi(Pn,Zt,Dn);const Mn=(t,e)=>K`
|
|
852
852
|
<template
|
|
853
853
|
role="progressbar"
|
|
854
854
|
aria-valuenow="${t=>t.value}"
|
|
@@ -1465,4 +1465,4 @@ const t=function(){if("undefined"!=typeof globalThis)return globalThis;if("undef
|
|
|
1465
1465
|
>
|
|
1466
1466
|
<slot ${Xt("slottedTreeItems")}></slot>
|
|
1467
1467
|
</template>
|
|
1468
|
-
`;class Ur extends ei{constructor(){super(...arguments),this.currentFocused=null,this.handleFocus=t=>{if(!(this.slottedTreeItems.length<1))return t.target===this?(null===this.currentFocused&&(this.currentFocused=this.getValidFocusableItem()),void(null!==this.currentFocused&&Br.focusItem(this.currentFocused))):void(this.contains(t.target)&&(this.setAttribute("tabindex","-1"),this.currentFocused=t.target))},this.handleBlur=t=>{t.target instanceof HTMLElement&&(null===t.relatedTarget||!this.contains(t.relatedTarget))&&this.setAttribute("tabindex","0")},this.handleKeyDown=t=>{if(t.defaultPrevented)return;if(this.slottedTreeItems.length<1)return!0;const e=this.getVisibleNodes();switch(t.key){case Ii:return void(e.length&&Br.focusItem(e[0]));case ki:return void(e.length&&Br.focusItem(e[e.length-1]));case yi:if(t.target&&this.isFocusableElement(t.target)){const e=t.target;e instanceof Br&&e.childItemLength()>0&&e.expanded?e.expanded=!1:e instanceof Br&&e.parentElement instanceof Br&&Br.focusItem(e.parentElement)}return!1;case Ci:if(t.target&&this.isFocusableElement(t.target)){const e=t.target;e instanceof Br&&e.childItemLength()>0&&!e.expanded?e.expanded=!0:e instanceof Br&&e.childItemLength()>0&&this.focusNextNode(1,t.target)}return;case bi:return void(t.target&&this.isFocusableElement(t.target)&&this.focusNextNode(1,t.target));case xi:return void(t.target&&this.isFocusableElement(t.target)&&this.focusNextNode(-1,t.target));case wi:return void this.handleClick(t)}return!0},this.handleSelectedChange=t=>{if(t.defaultPrevented)return;if(!(t.target instanceof Element&&Nr(t.target)))return!0;const e=t.target;e.selected?(this.currentSelected&&this.currentSelected!==e&&(this.currentSelected.selected=!1),this.currentSelected=e):e.selected||this.currentSelected!==e||(this.currentSelected=null)},this.setItems=()=>{const t=this.treeView.querySelector("[aria-selected='true']");this.currentSelected=t,null!==this.currentFocused&&this.contains(this.currentFocused)||(this.currentFocused=this.getValidFocusableItem()),this.nested=this.checkForNestedItems();this.getVisibleNodes().forEach((t=>{Nr(t)&&(t.nested=this.nested)}))},this.isFocusableElement=t=>Nr(t),this.isSelectedElement=t=>t.selected}slottedTreeItemsChanged(){this.$fastController.isConnected&&this.setItems()}connectedCallback(){super.connectedCallback(),this.setAttribute("tabindex","0"),c.queueUpdate((()=>{this.setItems()}))}handleClick(t){if(t.defaultPrevented)return;if(!(t.target instanceof Element&&Nr(t.target)))return!0;const e=t.target;e.disabled||(e.selected=!e.selected)}focusNextNode(t,e){const i=this.getVisibleNodes();if(!i)return;const s=i[i.indexOf(e)+t];hi(s)&&Br.focusItem(s)}getValidFocusableItem(){const t=this.getVisibleNodes();let e=t.findIndex(this.isSelectedElement);return-1===e&&(e=t.findIndex(this.isFocusableElement)),-1!==e?t[e]:null}checkForNestedItems(){return this.slottedTreeItems.some((t=>Nr(t)&&t.querySelector("[role='treeitem']")))}getVisibleNodes(){return function(t,e){if(!t||!hi(t))return;return Array.from(t.querySelectorAll(e)).filter((t=>null!==t.offsetParent))}(this,"[role='treeitem']")||[]}}oe([lt({attribute:"render-collapsed-nodes"})],Ur.prototype,"renderCollapsedNodes",void 0),oe([v],Ur.prototype,"currentSelected",void 0),oe([v],Ur.prototype,"slottedTreeItems",void 0);class jr{constructor(t){this.listenerCache=new WeakMap,this.query=t}bind(t){const{query:e}=this,i=this.constructListener(t);i.bind(e)(),e.addListener(i),this.listenerCache.set(t,i)}unbind(t){const e=this.listenerCache.get(t);e&&(this.query.removeListener(e),this.listenerCache.delete(t))}}class _r extends jr{constructor(t,e){super(t),this.styles=e}static with(t){return e=>new _r(t,e)}constructListener(t){let e=!1;const i=this.styles;return function(){const{matches:s}=this;s&&!e?(t.$fastController.addStyles(i),e=s):!s&&e&&(t.$fastController.removeStyles(i),e=s)}}unbind(t){super.unbind(t),t.$fastController.removeStyles(this.styles)}}const Wr=_r.with(window.matchMedia("(forced-colors)")),Kr=_r.with(window.matchMedia("(prefers-color-scheme: dark)")),Yr=_r.with(window.matchMedia("(prefers-color-scheme: light)"));class Xr{constructor(t,e,i){this.propertyName=t,this.value=e,this.styles=i}bind(t){m.getNotifier(t).subscribe(this,this.propertyName),this.handleChange(t,this.propertyName)}unbind(t){m.getNotifier(t).unsubscribe(this,this.propertyName),t.$fastController.removeStyles(this.styles)}handleChange(t,e){t[e]===this.value?t.$fastController.addStyles(this.styles):t.$fastController.removeStyles(this.styles)}}const Gr="not-allowed",Qr=":host([hidden]){display:none}";function Zr(t){return`${Qr}:host{display:${t}}`}const Jr=function(){if("boolean"==typeof di)return di;if("undefined"==typeof window||!window.document||!window.document.createElement)return di=!1,di;const t=document.createElement("style"),e=function(){const t=document.querySelector('meta[property="csp-nonce"]');return t?t.getAttribute("content"):null}();null!==e&&t.setAttribute("nonce",e),document.head.appendChild(t);try{t.sheet.insertRule("foo:focus-visible {color:inherit}",0),di=!0}catch(t){di=!1}finally{document.head.removeChild(t)}return di}()?"focus-visible":"focus";export{t as $global,Vi as ARIAGlobalStatesAndProperties,Pi as Accordion,Li as AccordionExpandMode,ni as AccordionItem,Hi as Anchor,qi as AnchoredRegion,w as AttachedBehaviorHTMLDirective,ot as AttributeConfiguration,at as AttributeDefinition,Qi as Avatar,Ji as Badge,Vn as BaseProgress,L as BindingBehavior,ss as Breadcrumb,es as BreadcrumbItem,ps as Button,Ct as CSSDirective,fs as Calendar,Os as CalendarTitleTemplate,Ms as Card,ds as CheckableFormAssociated,Ns as Checkbox,Gt as ChildrenBehavior,Gs as Combobox,Xs as ComboboxAutocomplete,Je as ComponentPresentation,me as Container,he as ContainerConfiguration,Ne as ContainerImpl,ft as Controller,pe as DI,c as DOM,ws as DataGrid,ks as DataGridCell,bs as DataGridCellTypes,Cs as DataGridRow,ys as DataGridRowTypes,vs as DateFormatter,ti as DefaultComponentPresentation,le as DefaultResolver,ms as DelegatesARIAButton,Qs as DelegatesARIACombobox,zi as DelegatesARIALink,_s as DelegatesARIAListbox,Us as DelegatesARIAListboxOption,Zn as DelegatesARIASearch,ir as DelegatesARIASelect,Dn as DelegatesARIATextbox,Pr as DelegatesARIAToolbar,Io as DesignSystem,bo as DesignToken,Uo as Dialog,Xo as Disclosure,Zo as Divider,Qo as DividerRole,yo as ElementDisambiguation,Y as ElementStyles,b as ExecutionContext,i as FAST,bt as FASTElement,ut as FASTElementDefinition,Fe as FactoryImpl,en as Flipper,Jo as FlipperDirection,_i as FlyoutPosBottom,Yi as FlyoutPosBottomFill,Wi as FlyoutPosTallest,Xi as FlyoutPosTallestFill,ji as FlyoutPosTop,Ki as FlyoutPosTopFill,hs as FormAssociated,ei as FoundationElement,si as FoundationElementRegistry,gs as GenerateHeaderOptions,F as HTMLBindingDirective,C as HTMLDirective,j as HTMLView,_n as HorizontalScroll,js as Listbox,on as ListboxElement,qs as ListboxOption,jr as MatchMediaBehavior,_r as MatchMediaStyleSheetBehavior,En as Menu,$n as MenuItem,xn as MenuItemRole,Pn as NumberField,m as Observable,fn as Picker,hn as PickerList,cn as PickerListItem,rn as PickerMenu,ln as PickerMenuOption,p as PropertyChangeNotifier,Xr as PropertyStyleSheetBehavior,jn as Radio,Nn as RadioGroup,Lt as RefBehavior,Ue as Registration,Ut as RepeatBehavior,jt as RepeatDirective,re as ResolverBuilder,Re as ResolverImpl,Qn as Search,er as Select,Ws as SelectPosition,ve as ServiceLocator,nr as Skeleton,mr as Slider,hr as SliderLabel,pr as SliderMode,Yt as SlottedBehavior,Zt as StartEnd,u as SubscriberSet,br as Switch,wr as Tab,Cr as TabPanel,kr as Tabs,Ir as TabsOrientation,x as TargetedHTMLDirective,Sr as TextArea,Or as TextAreaResize,An as TextField,Rn as TextFieldType,Lr as Toolbar,Hr as Tooltip,Vr as TooltipPosition,Br as TreeItem,Ur as TreeView,_ as ViewTemplate,se as accordionItemTemplate,ri as accordionTemplate,we as all,Mi as anchorTemplate,Ni as anchoredRegionTemplate,oi as applyMixins,lt as attr,Gi as avatarTemplate,Zi as badgeTemplate,nt as booleanConverter,ts as breadcrumbItemTemplate,is as breadcrumbTemplate,os as buttonTemplate,Rs as calendarCellTemplate,As as calendarRowTemplate,Ls as calendarTemplate,Ss as calendarWeekdayTemplate,Ps as cardTemplate,Vs as checkboxTemplate,Qt as children,Zs as comboboxTemplate,q as compileTemplate,to as composedContains,Js as composedParent,o as createMetadataLocator,wt as css,It as cssPartial,yt as customElement,Kr as darkModeStylesheetBehavior,Ts as dataGridCellTemplate,Es as dataGridRowTemplate,xs as dataGridTemplate,y as defaultExecutionContext,To as dialogTemplate,Gr as disabledCursor,Yo as disclosureTemplate,Zr as display,Go as dividerTemplate,Wt as elements,s as emptyArray,Ft as enableArrayObservation,Jt as endSlotTemplate,ee as endTemplate,tn as flipperTemplate,Jr as focusVisible,Wr as forcedColorsStylesheetBehavior,Bi as getDirection,Qr as hidden,Wn as horizontalScrollTemplate,K as html,Ee as ignore,ge as inject,Ds as interactiveCalendarGridTemplate,Bs as isListboxOption,Nr as isTreeItemElement,Ie as lazy,Yr as lightModeStylesheetBehavior,sn as listboxOptionTemplate,nn as listboxTemplate,In as menuItemTemplate,kn as menuTemplate,Te as newInstanceForScope,Oe as newInstanceOf,Fs as noninteractiveCalendarTemplate,rt as nullableNumberConverter,Tn as numberFieldTemplate,v as observable,ke as optional,Cn as pickerListItemTemplate,yn as pickerListTemplate,bn as pickerMenuOptionTemplate,gn as pickerMenuTemplate,un as pickerTemplate,Q as prependToAdoptedStyleSheetsSymbol,Mn as progressRingTemplate,Hn as progressTemplate,zn as radioGroupTemplate,Bn as radioTemplate,Pt as ref,Ko as reflectAttributes,_t as repeat,wn as roleForMenuItem,Yn as searchTemplate,sr as selectTemplate,xe as singleton,or as skeletonTemplate,rr as sliderLabelTemplate,dr as sliderTemplate,Xt as slotted,te as startSlotTemplate,ie as startTemplate,as as supportsElementInternals,vr as switchTemplate,yr as tabPanelTemplate,xr as tabTemplate,$r as tabsTemplate,Rr as textAreaTemplate,Ar as textFieldTemplate,Dr as toolbarTemplate,Mr as tooltipTemplate,ye as transient,zr as treeItemTemplate,qr as treeViewTemplate,je as validateKey,f as volatile,zt as when,Kn as whitespaceFilter};
|
|
1468
|
+
`;class Ur extends ei{constructor(){super(...arguments),this.currentFocused=null,this.handleFocus=t=>{if(!(this.slottedTreeItems.length<1))return t.target===this?(null===this.currentFocused&&(this.currentFocused=this.getValidFocusableItem()),void(null!==this.currentFocused&&Br.focusItem(this.currentFocused))):void(this.contains(t.target)&&(this.setAttribute("tabindex","-1"),this.currentFocused=t.target))},this.handleBlur=t=>{t.target instanceof HTMLElement&&(null===t.relatedTarget||!this.contains(t.relatedTarget))&&this.setAttribute("tabindex","0")},this.handleKeyDown=t=>{if(t.defaultPrevented)return;if(this.slottedTreeItems.length<1)return!0;const e=this.getVisibleNodes();switch(t.key){case Ii:return void(e.length&&Br.focusItem(e[0]));case ki:return void(e.length&&Br.focusItem(e[e.length-1]));case yi:if(t.target&&this.isFocusableElement(t.target)){const e=t.target;e instanceof Br&&e.childItemLength()>0&&e.expanded?e.expanded=!1:e instanceof Br&&e.parentElement instanceof Br&&Br.focusItem(e.parentElement)}return!1;case Ci:if(t.target&&this.isFocusableElement(t.target)){const e=t.target;e instanceof Br&&e.childItemLength()>0&&!e.expanded?e.expanded=!0:e instanceof Br&&e.childItemLength()>0&&this.focusNextNode(1,t.target)}return;case bi:return void(t.target&&this.isFocusableElement(t.target)&&this.focusNextNode(1,t.target));case xi:return void(t.target&&this.isFocusableElement(t.target)&&this.focusNextNode(-1,t.target));case wi:return void this.handleClick(t)}return!0},this.handleSelectedChange=t=>{if(t.defaultPrevented)return;if(!(t.target instanceof Element&&Nr(t.target)))return!0;const e=t.target;e.selected?(this.currentSelected&&this.currentSelected!==e&&(this.currentSelected.selected=!1),this.currentSelected=e):e.selected||this.currentSelected!==e||(this.currentSelected=null)},this.setItems=()=>{const t=this.treeView.querySelector("[aria-selected='true']");this.currentSelected=t,null!==this.currentFocused&&this.contains(this.currentFocused)||(this.currentFocused=this.getValidFocusableItem()),this.nested=this.checkForNestedItems();this.getVisibleNodes().forEach((t=>{Nr(t)&&(t.nested=this.nested)}))},this.isFocusableElement=t=>Nr(t),this.isSelectedElement=t=>t.selected}slottedTreeItemsChanged(){this.$fastController.isConnected&&this.setItems()}connectedCallback(){super.connectedCallback(),this.setAttribute("tabindex","0"),c.queueUpdate((()=>{this.setItems()}))}handleClick(t){if(t.defaultPrevented)return;if(!(t.target instanceof Element&&Nr(t.target)))return!0;const e=t.target;e.disabled||(e.selected=!e.selected)}focusNextNode(t,e){const i=this.getVisibleNodes();if(!i)return;const s=i[i.indexOf(e)+t];hi(s)&&Br.focusItem(s)}getValidFocusableItem(){const t=this.getVisibleNodes();let e=t.findIndex(this.isSelectedElement);return-1===e&&(e=t.findIndex(this.isFocusableElement)),-1!==e?t[e]:null}checkForNestedItems(){return this.slottedTreeItems.some((t=>Nr(t)&&t.querySelector("[role='treeitem']")))}getVisibleNodes(){return function(t,e){if(!t||!e||!hi(t))return;return Array.from(t.querySelectorAll(e)).filter((t=>null!==t.offsetParent))}(this,"[role='treeitem']")||[]}}oe([lt({attribute:"render-collapsed-nodes"})],Ur.prototype,"renderCollapsedNodes",void 0),oe([v],Ur.prototype,"currentSelected",void 0),oe([v],Ur.prototype,"slottedTreeItems",void 0);class jr{constructor(t){this.listenerCache=new WeakMap,this.query=t}bind(t){const{query:e}=this,i=this.constructListener(t);i.bind(e)(),e.addListener(i),this.listenerCache.set(t,i)}unbind(t){const e=this.listenerCache.get(t);e&&(this.query.removeListener(e),this.listenerCache.delete(t))}}class _r extends jr{constructor(t,e){super(t),this.styles=e}static with(t){return e=>new _r(t,e)}constructListener(t){let e=!1;const i=this.styles;return function(){const{matches:s}=this;s&&!e?(t.$fastController.addStyles(i),e=s):!s&&e&&(t.$fastController.removeStyles(i),e=s)}}unbind(t){super.unbind(t),t.$fastController.removeStyles(this.styles)}}const Wr=_r.with(window.matchMedia("(forced-colors)")),Kr=_r.with(window.matchMedia("(prefers-color-scheme: dark)")),Yr=_r.with(window.matchMedia("(prefers-color-scheme: light)"));class Xr{constructor(t,e,i){this.propertyName=t,this.value=e,this.styles=i}bind(t){m.getNotifier(t).subscribe(this,this.propertyName),this.handleChange(t,this.propertyName)}unbind(t){m.getNotifier(t).unsubscribe(this,this.propertyName),t.$fastController.removeStyles(this.styles)}handleChange(t,e){t[e]===this.value?t.$fastController.addStyles(this.styles):t.$fastController.removeStyles(this.styles)}}const Gr="not-allowed",Qr=":host([hidden]){display:none}";function Zr(t){return`${Qr}:host{display:${t}}`}const Jr=function(){if("boolean"==typeof di)return di;if("undefined"==typeof window||!window.document||!window.document.createElement)return di=!1,di;const t=document.createElement("style"),e=function(){const t=document.querySelector('meta[property="csp-nonce"]');return t?t.getAttribute("content"):null}();null!==e&&t.setAttribute("nonce",e),document.head.appendChild(t);try{t.sheet.insertRule("foo:focus-visible {color:inherit}",0),di=!0}catch(t){di=!1}finally{document.head.removeChild(t)}return di}()?"focus-visible":"focus";export{t as $global,Vi as ARIAGlobalStatesAndProperties,Pi as Accordion,Li as AccordionExpandMode,ni as AccordionItem,Hi as Anchor,qi as AnchoredRegion,w as AttachedBehaviorHTMLDirective,ot as AttributeConfiguration,at as AttributeDefinition,Qi as Avatar,Ji as Badge,Vn as BaseProgress,L as BindingBehavior,ss as Breadcrumb,es as BreadcrumbItem,ps as Button,Ct as CSSDirective,fs as Calendar,Os as CalendarTitleTemplate,Ms as Card,ds as CheckableFormAssociated,Ns as Checkbox,Gt as ChildrenBehavior,Gs as Combobox,Xs as ComboboxAutocomplete,Je as ComponentPresentation,me as Container,he as ContainerConfiguration,Ne as ContainerImpl,ft as Controller,pe as DI,c as DOM,ws as DataGrid,ks as DataGridCell,bs as DataGridCellTypes,Cs as DataGridRow,ys as DataGridRowTypes,vs as DateFormatter,ti as DefaultComponentPresentation,le as DefaultResolver,ms as DelegatesARIAButton,Qs as DelegatesARIACombobox,zi as DelegatesARIALink,_s as DelegatesARIAListbox,Us as DelegatesARIAListboxOption,Zn as DelegatesARIASearch,ir as DelegatesARIASelect,Dn as DelegatesARIATextbox,Pr as DelegatesARIAToolbar,Io as DesignSystem,bo as DesignToken,Uo as Dialog,Xo as Disclosure,Zo as Divider,Qo as DividerRole,yo as ElementDisambiguation,Y as ElementStyles,b as ExecutionContext,i as FAST,bt as FASTElement,ut as FASTElementDefinition,Fe as FactoryImpl,en as Flipper,Jo as FlipperDirection,_i as FlyoutPosBottom,Yi as FlyoutPosBottomFill,Wi as FlyoutPosTallest,Xi as FlyoutPosTallestFill,ji as FlyoutPosTop,Ki as FlyoutPosTopFill,hs as FormAssociated,ei as FoundationElement,si as FoundationElementRegistry,gs as GenerateHeaderOptions,F as HTMLBindingDirective,C as HTMLDirective,j as HTMLView,_n as HorizontalScroll,js as Listbox,on as ListboxElement,qs as ListboxOption,jr as MatchMediaBehavior,_r as MatchMediaStyleSheetBehavior,En as Menu,$n as MenuItem,xn as MenuItemRole,Pn as NumberField,m as Observable,fn as Picker,hn as PickerList,cn as PickerListItem,rn as PickerMenu,ln as PickerMenuOption,p as PropertyChangeNotifier,Xr as PropertyStyleSheetBehavior,jn as Radio,Nn as RadioGroup,Lt as RefBehavior,Ue as Registration,Ut as RepeatBehavior,jt as RepeatDirective,re as ResolverBuilder,Re as ResolverImpl,Qn as Search,er as Select,Ws as SelectPosition,ve as ServiceLocator,nr as Skeleton,mr as Slider,hr as SliderLabel,pr as SliderMode,Yt as SlottedBehavior,Zt as StartEnd,u as SubscriberSet,br as Switch,wr as Tab,Cr as TabPanel,kr as Tabs,Ir as TabsOrientation,x as TargetedHTMLDirective,Sr as TextArea,Or as TextAreaResize,An as TextField,Rn as TextFieldType,Lr as Toolbar,Hr as Tooltip,Vr as TooltipPosition,Br as TreeItem,Ur as TreeView,_ as ViewTemplate,se as accordionItemTemplate,ri as accordionTemplate,we as all,Mi as anchorTemplate,Ni as anchoredRegionTemplate,oi as applyMixins,lt as attr,Gi as avatarTemplate,Zi as badgeTemplate,nt as booleanConverter,ts as breadcrumbItemTemplate,is as breadcrumbTemplate,os as buttonTemplate,Rs as calendarCellTemplate,As as calendarRowTemplate,Ls as calendarTemplate,Ss as calendarWeekdayTemplate,Ps as cardTemplate,Vs as checkboxTemplate,Qt as children,Zs as comboboxTemplate,q as compileTemplate,to as composedContains,Js as composedParent,o as createMetadataLocator,wt as css,It as cssPartial,yt as customElement,Kr as darkModeStylesheetBehavior,Ts as dataGridCellTemplate,Es as dataGridRowTemplate,xs as dataGridTemplate,y as defaultExecutionContext,To as dialogTemplate,Gr as disabledCursor,Yo as disclosureTemplate,Zr as display,Go as dividerTemplate,Wt as elements,s as emptyArray,Ft as enableArrayObservation,Jt as endSlotTemplate,ee as endTemplate,tn as flipperTemplate,Jr as focusVisible,Wr as forcedColorsStylesheetBehavior,Bi as getDirection,Qr as hidden,Wn as horizontalScrollTemplate,K as html,Ee as ignore,ge as inject,Ds as interactiveCalendarGridTemplate,Bs as isListboxOption,Nr as isTreeItemElement,Ie as lazy,Yr as lightModeStylesheetBehavior,sn as listboxOptionTemplate,nn as listboxTemplate,In as menuItemTemplate,kn as menuTemplate,Te as newInstanceForScope,Oe as newInstanceOf,Fs as noninteractiveCalendarTemplate,rt as nullableNumberConverter,Tn as numberFieldTemplate,v as observable,ke as optional,Cn as pickerListItemTemplate,yn as pickerListTemplate,bn as pickerMenuOptionTemplate,gn as pickerMenuTemplate,un as pickerTemplate,Q as prependToAdoptedStyleSheetsSymbol,Mn as progressRingTemplate,Hn as progressTemplate,zn as radioGroupTemplate,Bn as radioTemplate,Pt as ref,Ko as reflectAttributes,_t as repeat,wn as roleForMenuItem,Yn as searchTemplate,sr as selectTemplate,xe as singleton,or as skeletonTemplate,rr as sliderLabelTemplate,dr as sliderTemplate,Xt as slotted,te as startSlotTemplate,ie as startTemplate,as as supportsElementInternals,vr as switchTemplate,yr as tabPanelTemplate,xr as tabTemplate,$r as tabsTemplate,Rr as textAreaTemplate,Ar as textFieldTemplate,Dr as toolbarTemplate,Mr as tooltipTemplate,ye as transient,zr as treeItemTemplate,qr as treeViewTemplate,je as validateKey,f as volatile,zt as when,Kn as whitespaceFilter};
|