@ni/nimble-components 35.2.0 → 35.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-components-bundle.js +167 -109
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +154 -89
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/anchor/template.js +4 -4
- package/dist/esm/anchor/template.js.map +1 -1
- package/dist/esm/anchor-tabs/index.js +2 -0
- package/dist/esm/anchor-tabs/index.js.map +1 -1
- package/dist/esm/checkbox/template.js +3 -3
- package/dist/esm/checkbox/template.js.map +1 -1
- package/dist/esm/chip/testing/chip.pageobject.js +1 -1
- package/dist/esm/chip/testing/chip.pageobject.js.map +1 -1
- package/dist/esm/combobox/index.js +11 -11
- package/dist/esm/combobox/index.js.map +1 -1
- package/dist/esm/combobox/template.js +1 -1
- package/dist/esm/combobox/template.js.map +1 -1
- package/dist/esm/dialog/index.js +1 -1
- package/dist/esm/dialog/index.js.map +1 -1
- package/dist/esm/menu/menu.foundation.js +3 -3
- package/dist/esm/menu/menu.foundation.js.map +1 -1
- package/dist/esm/menu-button/index.js +2 -2
- package/dist/esm/menu-button/index.js.map +1 -1
- package/dist/esm/number-field/template.js +3 -3
- package/dist/esm/number-field/template.js.map +1 -1
- package/dist/esm/rich-text/editor/index.js +1 -1
- package/dist/esm/rich-text/editor/index.js.map +1 -1
- package/dist/esm/rich-text/editor/models/create-tiptap-editor.js +1 -1
- package/dist/esm/rich-text/editor/models/create-tiptap-editor.js.map +1 -1
- package/dist/esm/rich-text/editor/testing/rich-text-editor.pageobject.js +1 -3
- package/dist/esm/rich-text/editor/testing/rich-text-editor.pageobject.js.map +1 -1
- package/dist/esm/rich-text/mention-listbox/index.d.ts +1 -1
- package/dist/esm/rich-text/mention-listbox/index.js +3 -3
- package/dist/esm/rich-text/mention-listbox/index.js.map +1 -1
- package/dist/esm/rich-text/models/markdown-serializer.js +1 -1
- package/dist/esm/rich-text/models/markdown-serializer.js.map +1 -1
- package/dist/esm/rich-text/models/rich-text-validator.js +1 -1
- package/dist/esm/rich-text/models/rich-text-validator.js.map +1 -1
- package/dist/esm/select/index.js +11 -15
- package/dist/esm/select/index.js.map +1 -1
- package/dist/esm/select/template.js +1 -1
- package/dist/esm/select/template.js.map +1 -1
- package/dist/esm/switch/styles.js +101 -36
- package/dist/esm/switch/styles.js.map +1 -1
- package/dist/esm/switch/template.js +1 -1
- package/dist/esm/switch/template.js.map +1 -1
- package/dist/esm/table/index.js +1 -1
- package/dist/esm/table/index.js.map +1 -1
- package/dist/esm/table/models/array-to-tree.js +6 -10
- package/dist/esm/table/models/array-to-tree.js.map +1 -1
- package/dist/esm/table/models/keyboard-navigation-manager.js.map +1 -1
- package/dist/esm/table/models/selection-managers/selection-manager-base.js +1 -1
- package/dist/esm/table/models/selection-managers/selection-manager-base.js.map +1 -1
- package/dist/esm/table/models/table-layout-manager.js +1 -1
- package/dist/esm/table/models/table-layout-manager.js.map +1 -1
- package/dist/esm/table/models/table-validator.js +1 -1
- package/dist/esm/table/models/table-validator.js.map +1 -1
- package/dist/esm/table-column/duration-text/models/duration-formatter.js +2 -2
- package/dist/esm/table-column/duration-text/models/duration-formatter.js.map +1 -1
- package/dist/esm/text-area/template.js +1 -1
- package/dist/esm/text-area/template.js.map +1 -1
- package/dist/esm/text-field/template.js +1 -1
- package/dist/esm/text-field/template.js.map +1 -1
- package/dist/esm/utilities/models/tracker.js.map +1 -1
- package/dist/esm/wafer-map/experimental/worker-renderer.js +1 -2
- package/dist/esm/wafer-map/experimental/worker-renderer.js.map +1 -1
- package/dist/esm/wafer-map/modules/rendering.js +1 -1
- package/dist/esm/wafer-map/modules/rendering.js.map +1 -1
- package/dist/esm/wafer-map/modules/wafer-map-validator.js +1 -1
- package/dist/esm/wafer-map/modules/wafer-map-validator.js.map +1 -1
- package/dist/esm/wafer-map/workers/worker-code.d.ts +1 -1
- package/dist/esm/wafer-map/workers/worker-code.js +1 -1
- package/dist/esm/wafer-map/workers/worker-code.js.map +1 -1
- package/package.json +1 -1
|
@@ -1197,12 +1197,12 @@ const sd=od.compose({baseName:"anchor",baseClass:xn,template:(t,e)=>Q`${""}<div
|
|
|
1197
1197
|
>${""}<span
|
|
1198
1198
|
part="start"
|
|
1199
1199
|
${Pt("startContainer")}
|
|
1200
|
-
class="${t=>e.start?"start":null}"
|
|
1200
|
+
class="${t=>void 0!==e.start?"start":null}"
|
|
1201
1201
|
><slot
|
|
1202
1202
|
name="start"
|
|
1203
1203
|
${Pt("start")}
|
|
1204
1204
|
@slotchange="${t=>t.handleStartContentChange()}">
|
|
1205
|
-
${e.start
|
|
1205
|
+
${e.start??""}
|
|
1206
1206
|
</slot
|
|
1207
1207
|
></span
|
|
1208
1208
|
><span
|
|
@@ -1215,12 +1215,12 @@ const sd=od.compose({baseName:"anchor",baseClass:xn,template:(t,e)=>Q`${""}<div
|
|
|
1215
1215
|
><span
|
|
1216
1216
|
part="end"
|
|
1217
1217
|
${Pt("endContainer")}
|
|
1218
|
-
class=${t=>e.end?"end":null}
|
|
1218
|
+
class=${t=>void 0!==e.end?"end":null}
|
|
1219
1219
|
><slot
|
|
1220
1220
|
name="end"
|
|
1221
1221
|
${Pt("end")}
|
|
1222
1222
|
@slotchange="${t=>t.handleEndContentChange()}">
|
|
1223
|
-
${e.end
|
|
1223
|
+
${e.end??""}
|
|
1224
1224
|
</slot
|
|
1225
1225
|
></span></a></div>`,styles:id,shadowOptions:{delegatesFocus:!0}})
|
|
1226
1226
|
Ii.getOrCreate().withPrefix("nimble").register(sd())
|
|
@@ -3006,15 +3006,15 @@ const gg=mg.compose({baseName:"checkbox",baseClass:Vn,template:(t,e)=>Q`
|
|
|
3006
3006
|
<div part="container" class="container">
|
|
3007
3007
|
<div part="control" class="control">
|
|
3008
3008
|
<slot name="checked-indicator">
|
|
3009
|
-
${e.checkedIndicator
|
|
3009
|
+
${e.checkedIndicator??""}
|
|
3010
3010
|
</slot>
|
|
3011
3011
|
<slot name="indeterminate-indicator">
|
|
3012
|
-
${e.indeterminateIndicator
|
|
3012
|
+
${e.indeterminateIndicator??""}
|
|
3013
3013
|
</slot>
|
|
3014
3014
|
</div>
|
|
3015
3015
|
<label
|
|
3016
3016
|
part="label"
|
|
3017
|
-
class="${t=>t.defaultSlottedNodes?.length?"label":"label label__hidden"}"
|
|
3017
|
+
class="${t=>t.defaultSlottedNodes?.length>0?"label":"label label__hidden"}"
|
|
3018
3018
|
>
|
|
3019
3019
|
<slot ${Qt("defaultSlottedNodes")}></slot>
|
|
3020
3020
|
</label>
|
|
@@ -3527,15 +3527,15 @@ function Og(t){return Q`
|
|
|
3527
3527
|
let Fg=class extends Bi{}
|
|
3528
3528
|
class Ng extends(Dn(Fg)){constructor(){super(...arguments),this.proxy=document.createElement("input")}}function Lg(t){class e extends t{constructor(){super(...arguments),this.requiredVisible=!1}}return ft({attribute:"required-visible",mode:"boolean"})(e.prototype,"requiredVisible"),e}class Bg extends(fg(Lg(Ng))){constructor(){super(...arguments),this.appearance=Sg,this.appearanceReadOnly=!1,this.fullBleed=!1,this.open=!1,this.filteredOptions=[],this.hasOverflow=!1,this.listboxId=yn("listbox-"),this.availableViewportHeight=0,this.valueUpdatedByInput=!1,this._value="",this.filter="",this.forcedPosition=!1}get value(){return x.track(this,"value"),this._value}set value(t){const e=this._value
|
|
3529
3529
|
let n=t
|
|
3530
|
-
if(this.$fastController.isConnected
|
|
3531
|
-
i!==o&&(this.selectedIndex=e),n=this.firstSelectedOption?.text||n}e!==n&&(this._value=n,super.valueChanged(e,n),x.notify(this,"value")),this.filter=t,this.filterOptions(),this.selectedIndex=this.findIndexOfValidOption(this.value)}get options(){return x.track(this,"options"),this.
|
|
3530
|
+
if(this.$fastController.isConnected){const e=this.findIndexOfValidOption(t),i=this.options[this.selectedIndex]?.text,o=this.options[e]?.text
|
|
3531
|
+
i!==o&&(this.selectedIndex=e),n=this.firstSelectedOption?.text||n}e!==n&&(this._value=n,super.valueChanged(e,n),x.notify(this,"value")),this.filter=t,this.filterOptions(),this.selectedIndex=this.findIndexOfValidOption(this.value)}get options(){return x.track(this,"options"),this.filter?this.filteredOptions:this._options}set options(t){this._options=t,x.notify(this,"options")}get isAutocompleteInline(){return this.autocomplete===Xn||this.isAutocompleteBoth}get isAutocompleteList(){return this.autocomplete===Jn||this.isAutocompleteBoth}get isAutocompleteBoth(){return this.autocomplete===Qn}slottedOptionsChanged(t,e){const n=this.value
|
|
3532
3532
|
super.slottedOptionsChanged(t,e),this.updateValue(),n&&(this.value=n)}connectedCallback(){super.connectedCallback(),this.forcedPosition=!!this.positionAttribute,this.value&&(this.initialValue=this.value),this.setPositioning(),this.updateInputAriaLabel()}clickHandler(t){if(this.disabled)return!1
|
|
3533
3533
|
if(this.open){const e=t.target.closest("option,[role=option]")
|
|
3534
3534
|
if(!e||e.disabled)return!1
|
|
3535
3535
|
this.selectedOptions=[e],this.control.value=e.text,this.clearSelectionRange(),this.updateValue(!0)}return this.open=!this.open,this.open&&this.control.focus(),!0}toggleButtonClickHandler(t){t.stopImmediatePropagation()}toggleButtonChangeHandler(t){this.open=this.dropdownButton.checked,t.stopImmediatePropagation()}toggleButtonKeyDownHandler(t){switch(t.key){case sn:case en:case un:case rn:return this.open=!0,this.stopPropagation(t),!1
|
|
3536
3536
|
default:return!0}}filterOptions(){this.autocomplete&&this.autocomplete!==ti||(this.filter="")
|
|
3537
3537
|
const t=this.filter.toLowerCase()
|
|
3538
|
-
this.filteredOptions=this._options.filter((e=>e.text.toLowerCase().startsWith(t)&&!e.hidden)),this.isAutocompleteList&&this._options.forEach((t=>{t.visuallyHidden=!this.filteredOptions.includes(t)}))}inputHandler(t){return this.filter=this.control.value,this.filterOptions(),this.isAutocompleteInline||(this.selectedIndex=this.findIndexOfValidOption(this.control.value)),!t.inputType.includes("deleteContent")&&this.filter.length&&(this.isAutocompleteList&&!this.open&&(this.open=!0),this.isAutocompleteInline&&(this.filteredOptions.length?(this.selectedOptions=[this.filteredOptions[0]],this.selectedIndex=this.options.indexOf(this.firstSelectedOption),this.setInlineSelection()):this.selectedIndex=-1)),this.valueUpdatedByInput||(this.valueBeforeTextUpdate=this.value),this.valueUpdatedByInput=!0,this.value!==this.control.value&&this.focusAndScrollOptionIntoView(),this.value=this.control.value,!0}keydownHandler(t){if(t.ctrlKey||t.altKey)return!0
|
|
3538
|
+
this.filteredOptions=this._options.filter((e=>e.text.toLowerCase().startsWith(t)&&!e.hidden)),this.isAutocompleteList&&this._options.forEach((t=>{t.visuallyHidden=!this.filteredOptions.includes(t)}))}inputHandler(t){return this.filter=this.control.value,this.filterOptions(),this.isAutocompleteInline||(this.selectedIndex=this.findIndexOfValidOption(this.control.value)),!t.inputType.includes("deleteContent")&&this.filter.length>0&&(this.isAutocompleteList&&!this.open&&(this.open=!0),this.isAutocompleteInline&&(this.filteredOptions.length>0?(this.selectedOptions=[this.filteredOptions[0]],this.selectedIndex=this.options.indexOf(this.firstSelectedOption),this.setInlineSelection()):this.selectedIndex=-1)),this.valueUpdatedByInput||(this.valueBeforeTextUpdate=this.value),this.valueUpdatedByInput=!0,this.value!==this.control.value&&this.focusAndScrollOptionIntoView(),this.value=this.control.value,!0}keydownHandler(t){if(t.ctrlKey||t.altKey)return!0
|
|
3539
3539
|
switch(t.key){case rn:this.syncValue(),this.isAutocompleteInline&&(this.filter=this.value),this.open=!1,this.clearSelectionRange(),this.emitChangeIfValueUpdated()
|
|
3540
3540
|
break
|
|
3541
3541
|
case an:if(this.isAutocompleteInline||(this.selectedIndex=-1),this.open){this.open=!1
|
|
@@ -3548,8 +3548,8 @@ case en:case sn:if(this.filterOptions(),!this.open){this.open=!0
|
|
|
3548
3548
|
break}this.filteredOptions.length>0&&super.keydownHandler(t),this.isAutocompleteInline&&this.setInlineSelection(),this.open&&this.valueUpdatedByInput&&(this.valueUpdatedByInput=!1)
|
|
3549
3549
|
break
|
|
3550
3550
|
default:return!0}return!0}keyupHandler(t){switch(t.key){case"ArrowLeft":case"ArrowRight":case"Backspace":case"Delete":case"Home":case"End":this.filter=this.control.value,this.selectedIndex=-1,this.filterOptions()}return!0}focusoutHandler(t){if(this.syncValue(),this.open){const e=t.relatedTarget
|
|
3551
|
-
this.isSameNode(e)&&this.focus()}return this.open=!1,this.emitChangeIfValueUpdated(),!0}formResetCallback(){super.formResetCallback(),this.setDefaultSelectedOption(),this.updateValue()}validate(){super.validate(this.control)}setDefaultSelectedOption(){if(this.$fastController.isConnected
|
|
3552
|
-
this.selectedIndex=t
|
|
3551
|
+
this.isSameNode(e)&&this.focus()}return this.open=!1,this.emitChangeIfValueUpdated(),!0}formResetCallback(){super.formResetCallback(),this.setDefaultSelectedOption(),this.updateValue()}validate(){super.validate(this.control)}setDefaultSelectedOption(){if(this.$fastController.isConnected){const t=this.options.findIndex((t=>!t.disabled&&(null!==t.getAttribute("selected")||t.selected)))
|
|
3552
|
+
this.selectedIndex=t,this.dirtyValue||null===this.firstSelectedOption||(this.value=this.firstSelectedOption.text),this.setSelectedOptions()}}selectedIndexChanged(t,e){if(this.$fastController.isConnected){let n=gn(-1,this.options.length-1,e)
|
|
3553
3553
|
if(this.options[n]?.disabled&&(n=-1),n!==this.selectedIndex)return void(this.selectedIndex=n)
|
|
3554
3554
|
super.selectedIndexChanged(t,n),this.setSelectedOptions()}}disabledChanged(t,e){super.disabledChanged&&super.disabledChanged(t,e),this.ariaDisabled=this.disabled?"true":"false"}selectNextOption(){if(!this.disabled){let t=this.selectedIndex
|
|
3555
3555
|
do{if(t+1>=this.options.length)return
|
|
@@ -3558,7 +3558,7 @@ this.selectedIndex=t}}selectPreviousOption(){if(!this.disabled){let t=this.selec
|
|
|
3558
3558
|
do{if(t-=1,t<0)break}while(this.options[t].disabled)
|
|
3559
3559
|
this.selectedIndex=t}}setPositioning(){if(!this.$fastController.isConnected)return
|
|
3560
3560
|
const t=this.getBoundingClientRect(),e=window.innerHeight-t.bottom
|
|
3561
|
-
this.forcedPosition?this.position=this.positionAttribute:t.top>e?this.position=Gn:this.position=Zn,this.positionAttribute=this.forcedPosition?this.positionAttribute:this.position,this.availableViewportHeight=this.position===Gn?Math.trunc(t.top):Math.trunc(e)}focusAndScrollOptionIntoView(){this.open&&this.contains(document.activeElement)&&(this.control.focus(),this.firstSelectedOption&&requestAnimationFrame((()=>{this.firstSelectedOption?.scrollIntoView({block:"nearest"})})))}openChanged(){this.open?(this.ariaControls=this.listboxId,this.ariaExpanded="true",this.setPositioning(),this.focusAndScrollOptionIntoView(),b.queueUpdate((()=>this.focus()))):(this.ariaControls="",this.ariaExpanded="false"),this.dropdownButton&&(this.dropdownButton.checked=this.open)}placeholderChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.placeholder=this.placeholder??"")}setSelectedOptions(){this.selectedOptions=this.selectedIndex>-1?[this.options[this.selectedIndex]]:[],this.ariaActiveDescendant=this.firstSelectedOption?.id??"",this.focusAndScrollOptionIntoView()}selectedOptionsChanged(t,e){this.$fastController.isConnected&&this._options.forEach((t=>{t.selected=e.includes(t)}))}positionChanged(t,e){this.positionAttribute=e,this.setPositioning()}regionChanged(t,e){this.region&&
|
|
3561
|
+
this.forcedPosition?this.position=this.positionAttribute:t.top>e?this.position=Gn:this.position=Zn,this.positionAttribute=this.forcedPosition?this.positionAttribute:this.position,this.availableViewportHeight=this.position===Gn?Math.trunc(t.top):Math.trunc(e)}focusAndScrollOptionIntoView(){this.open&&this.contains(document.activeElement)&&(this.control.focus(),null!==this.firstSelectedOption&&requestAnimationFrame((()=>{this.firstSelectedOption?.scrollIntoView({block:"nearest"})})))}openChanged(){this.open?(this.ariaControls=this.listboxId,this.ariaExpanded="true",this.setPositioning(),this.focusAndScrollOptionIntoView(),b.queueUpdate((()=>this.focus()))):(this.ariaControls="",this.ariaExpanded="false"),this.dropdownButton&&(this.dropdownButton.checked=this.open)}placeholderChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.placeholder=this.placeholder??"")}setSelectedOptions(){this.selectedOptions=this.selectedIndex>-1?[this.options[this.selectedIndex]]:[],this.ariaActiveDescendant=this.firstSelectedOption?.id??"",this.focusAndScrollOptionIntoView()}selectedOptionsChanged(t,e){this.$fastController.isConnected&&this._options.forEach((t=>{t.selected=e.includes(t)}))}positionChanged(t,e){this.positionAttribute=e,this.setPositioning()}regionChanged(t,e){this.region&&(this.region.anchorElement=this.controlWrapper)}controlWrapperChanged(t,e){this.region&&(this.region.anchorElement=this.controlWrapper)}ariaLabelChanged(t,e){this.updateInputAriaLabel()}updateValue(t){this.$fastController.isConnected&&(this.value=this.firstSelectedOption?.text||this.control.value,this.control.value=this.value),t&&this.$emit("change")}setInputToSelection(){null!==this.firstSelectedOption&&(this.control.value=this.firstSelectedOption.text,this.control.focus())}setInlineSelection(){null!==this.firstSelectedOption&&(this.setInputToSelection(),this.control.setSelectionRange(this.filter.length,this.control.value.length,"backward"))}clearSelectionRange(){const t=this.control.value.length
|
|
3562
3562
|
this.control.setSelectionRange(t,t)}syncValue(){const t=this.selectedIndex>-1?this.firstSelectedOption?.text:this.control.value
|
|
3563
3563
|
this.updateValue(this.value!==t)}updateInputAriaLabel(){const t=this.shadowRoot?.querySelector(".selected-value")
|
|
3564
3564
|
this.ariaLabel?t?.setAttribute("aria-label",this.ariaLabel):t?.removeAttribute("aria-label")}emitChangeIfValueUpdated(){this.valueUpdatedByInput&&(this.value!==this.valueBeforeTextUpdate&&this.$emit("change"),this.valueUpdatedByInput=!1)}findIndexOfValidOption(t){return this.options.findIndex((e=>!e.disabled&&e.text===t))}}t([ft],Bg.prototype,"appearance",void 0),t([ft({attribute:"appearance-readonly",mode:"boolean"})],Bg.prototype,"appearanceReadOnly",void 0),t([ft({attribute:"full-bleed",mode:"boolean"})],Bg.prototype,"fullBleed",void 0),t([ft({attribute:"autocomplete",mode:"fromView"})],Bg.prototype,"autocomplete",void 0),t([ft({attribute:"position"})],Bg.prototype,"positionAttribute",void 0),t([ft({attribute:"open",mode:"boolean"})],Bg.prototype,"open",void 0),t([ft],Bg.prototype,"placeholder",void 0),t([C],Bg.prototype,"position",void 0),t([C],Bg.prototype,"region",void 0),t([C],Bg.prototype,"controlWrapper",void 0),t([C],Bg.prototype,"control",void 0),t([C],Bg.prototype,"listbox",void 0),t([C],Bg.prototype,"dropdownButton",void 0),t([C],Bg.prototype,"filteredOptions",void 0),t([C],Bg.prototype,"hasOverflow",void 0),t([C],Bg.prototype,"availableViewportHeight",void 0)
|
|
@@ -3600,7 +3600,7 @@ const Pg=Bg.compose({baseName:"combobox",baseClass:Ng,template:(t,e)=>Q`
|
|
|
3600
3600
|
/>
|
|
3601
3601
|
<div class="indicator" part="indicator" aria-hidden="true">
|
|
3602
3602
|
<slot name="indicator">
|
|
3603
|
-
${e.indicator
|
|
3603
|
+
${e.indicator??""}
|
|
3604
3604
|
</slot>
|
|
3605
3605
|
</div>
|
|
3606
3606
|
</slot>
|
|
@@ -3789,7 +3789,7 @@ const zg=Symbol("user dismissed"),Vg=It`
|
|
|
3789
3789
|
`
|
|
3790
3790
|
class Ug extends Ve{constructor(){super(...arguments),this.preventDismiss=!1,this.headerHidden=!1,this.footerHidden=!1,this.footerIsEmpty=!0}get open(){return void 0!==this.resolveShow}async show(){if(this.open)throw new Error("Dialog is already open")
|
|
3791
3791
|
return this.dialogElement.showModal(),await new Promise(((t,e)=>{this.resolveShow=t}))}close(t){if(!this.open)throw new Error("Dialog is not open")
|
|
3792
|
-
this.dialogElement.close(),this.doResolveShow(t)}slottedFooterElementsChanged(t,e){this.footerIsEmpty
|
|
3792
|
+
this.dialogElement.close(),this.doResolveShow(t)}slottedFooterElementsChanged(t,e){this.footerIsEmpty=void 0===e||0===e.length}cancelHandler(t){return this.preventDismiss?t.preventDefault():this.doResolveShow(zg),!0}closeHandler(t){t.target===this.dialogElement&&this.resolveShow&&this.doResolveShow(zg)}doResolveShow(t){if(!this.resolveShow)throw new Error("Do not call doResolveShow unless there is a promise to resolve")
|
|
3793
3793
|
this.resolveShow(t),this.resolveShow=void 0}}Ug.UserDismissed=zg,t([ft({attribute:"prevent-dismiss",mode:"boolean"})],Ug.prototype,"preventDismiss",void 0),t([ft({attribute:"header-hidden",mode:"boolean"})],Ug.prototype,"headerHidden",void 0),t([ft({attribute:"footer-hidden",mode:"boolean"})],Ug.prototype,"footerHidden",void 0),t([C],Ug.prototype,"footerIsEmpty",void 0),t([C],Ug.prototype,"slottedFooterElements",void 0),qe(Ug,wn)
|
|
3794
3794
|
const qg=Ug.compose({baseName:"dialog",template:Hg,styles:Vg,baseClass:Ug})
|
|
3795
3795
|
Ii.getOrCreate().withPrefix("nimble").register(qg())
|
|
@@ -4412,16 +4412,16 @@ this.menuItems[this.focusIndex]?.setAttribute("tabindex","-1"),this.menuItems[t]
|
|
|
4412
4412
|
void 0!==this.menuItems&&e!==this.menuItems[this.focusIndex]&&(this.menuItems[this.focusIndex]?.setAttribute("tabindex","-1"),this.focusIndex=this.menuItems.indexOf(e),e.setAttribute("tabindex","0"))},this.handleExpandedChanged=t=>{if(t.defaultPrevented||null===t.target||!this.menuItems?.includes(t.target))return
|
|
4413
4413
|
t.preventDefault()
|
|
4414
4414
|
const e=t.target
|
|
4415
|
-
null===this.expandedItem||e!==this.expandedItem
|
|
4415
|
+
null===this.expandedItem||e!==this.expandedItem||e.expanded?e.expanded&&(null!==this.expandedItem&&this.expandedItem!==e&&(this.expandedItem.expanded=!1),this.menuItems[this.focusIndex]?.setAttribute("tabindex","-1"),this.expandedItem=e,this.focusIndex=this.menuItems.indexOf(e),e.setAttribute("tabindex","0")):this.expandedItem=null},this.removeItemListeners=()=>{void 0!==this.menuItems&&this.menuItems.forEach((t=>{t.removeEventListener("expanded-change",this.handleExpandedChanged),t.removeEventListener("focus",this.handleItemFocus)}))},this.setItems=()=>{const t=this.domChildren()
|
|
4416
4416
|
this.removeItemListeners(),this.menuItems=t
|
|
4417
4417
|
const e=this.menuItems.filter(this.isMenuItemElement)
|
|
4418
|
-
e.length&&(this.focusIndex=0)
|
|
4418
|
+
e.length>0&&(this.focusIndex=0)
|
|
4419
4419
|
const n=e.reduce(((t,e)=>{const n=function(t){const e=t.getAttribute("role"),n=t.querySelector("[slot=start]")
|
|
4420
4420
|
return e!==Pi&&null===n||e===Pi&&null!==n?1:e!==Pi&&null!==n?2:0}(e)
|
|
4421
4421
|
return t>n?t:n}),0)
|
|
4422
4422
|
e.forEach(((t,e)=>{t.setAttribute("tabindex",0===e?"0":"-1"),t.addEventListener("expanded-change",this.handleExpandedChanged),t.addEventListener("focus",this.handleItemFocus),(t instanceof Ui||"startColumnCount"in t)&&(t.startColumnCount=n)}))},this.changeHandler=t=>{if(void 0===this.menuItems)return
|
|
4423
4423
|
const e=t.target,n=this.menuItems.indexOf(e)
|
|
4424
|
-
if(-1!==n&&"menuitemradio"===e.role
|
|
4424
|
+
if(-1!==n&&"menuitemradio"===e.role&&e.checked){for(let t=n-1;t>=0;--t){const e=this.menuItems[t],n=e.getAttribute("role")
|
|
4425
4425
|
if(n===Vi&&(e.checked=!1),"separator"===n)break}const t=this.menuItems.length-1
|
|
4426
4426
|
for(let e=n+1;e<=t;++e){const t=this.menuItems[e],n=t.getAttribute("role")
|
|
4427
4427
|
if(n===Vi&&(t.checked=!1),"separator"===n)break}}},this.isMenuItemElement=e=>Ze(e)&&Object.prototype.hasOwnProperty.call(t.focusableElementRoles,e.getAttribute("role")),this.isFocusableElement=t=>this.isMenuItemElement(t)}connectedCallback(){super.connectedCallback(),b.queueUpdate((()=>{this.setItems()})),this.addEventListener("change",this.changeHandler)}disconnectedCallback(){super.disconnectedCallback(),this.removeItemListeners(),this.menuItems=void 0,this.removeEventListener("change",this.changeHandler)}focus(){this.setFocus(0,1)}collapseExpandedItem(){null!==this.expandedItem&&(this.expandedItem.expanded=!1,this.expandedItem=null)}handleMenuKeyDown(t){if(t.defaultPrevented||void 0===this.menuItems)return!1
|
|
@@ -4568,13 +4568,13 @@ return!(!this.contains(e)&&!this.getMenu()?.contains(e))||(this.setOpen(!1),!1)}
|
|
|
4568
4568
|
case en:return this.setOpen(!0),!1
|
|
4569
4569
|
default:return!0}}menuKeyDownHandler(t){return t.key!==an||(this.setOpen(!1),this.toggleButton.focus(),!1)}setOpen(t){if(this.open===t)return
|
|
4570
4570
|
const e={oldState:this.open,newState:t}
|
|
4571
|
-
this.$emit("beforetoggle",e),this.open=t}getMenu(){if(!this.slottedMenus
|
|
4571
|
+
this.$emit("beforetoggle",e),this.open=t}getMenu(){if(!this.slottedMenus||0===this.slottedMenus.length)return
|
|
4572
4572
|
let t=this.slottedMenus[0]
|
|
4573
4573
|
for(;t;){if("menu"===t.getAttribute("role"))return t
|
|
4574
4574
|
if(!this.isSlotElement(t))return
|
|
4575
4575
|
{const e=t.assignedNodes()[0]
|
|
4576
4576
|
t=e instanceof HTMLElement?e:void 0}}}isSlotElement(t){return"SLOT"===t?.nodeName}focusMenu(){this.getMenu()?.focus()}focusLastMenuItem(){const t=this.getMenu()?.querySelectorAll("[role=menuitem]")
|
|
4577
|
-
if(t
|
|
4577
|
+
if(t&&t.length>0){t[t.length-1].focus()}}}t([ft],xb.prototype,"appearance",void 0),t([ft({attribute:"appearance-variant"})],xb.prototype,"appearanceVariant",void 0),t([ft({mode:"boolean"})],xb.prototype,"disabled",void 0),t([ft({attribute:"content-hidden",mode:"boolean"})],xb.prototype,"contentHidden",void 0),t([ft({attribute:"tabindex",converter:ut})],xb.prototype,"tabIndex",void 0),t([ft({mode:"boolean"})],xb.prototype,"open",void 0),t([ft({attribute:"position"})],xb.prototype,"position",void 0),t([C],xb.prototype,"toggleButton",void 0),t([C],xb.prototype,"region",void 0),t([C],xb.prototype,"slottedMenus",void 0)
|
|
4578
4578
|
const Cb=xb.compose({baseName:"menu-button",template:wb,styles:yb,shadowOptions:{delegatesFocus:!0}})
|
|
4579
4579
|
Ii.getOrCreate().withPrefix("nimble").register(Cb())
|
|
4580
4580
|
const kb="nimble-menu-button",Sb=It`
|
|
@@ -4938,7 +4938,7 @@ const Mb="underline",Ib="outline",$b="block",Eb="frameless",Ab=It`
|
|
|
4938
4938
|
`)),Tb=Og(Q`<label
|
|
4939
4939
|
part="label"
|
|
4940
4940
|
for="control"
|
|
4941
|
-
class="${t=>t.defaultSlottedNodes?.length?"label":"label label__hidden"}"
|
|
4941
|
+
class="${t=>t.defaultSlottedNodes?.length>0?"label":"label label__hidden"}"
|
|
4942
4942
|
>
|
|
4943
4943
|
<slot ${Qt("defaultSlottedNodes")}></slot>
|
|
4944
4944
|
</label>`)
|
|
@@ -5001,7 +5001,7 @@ const Ob=Db.compose({baseName:"number-field",baseClass:Xi,template:(t,e)=>Q`
|
|
|
5001
5001
|
@click="${t=>t.stepUp()}"
|
|
5002
5002
|
>
|
|
5003
5003
|
<slot name="step-up-glyph">
|
|
5004
|
-
${e.stepUpGlyph
|
|
5004
|
+
${e.stepUpGlyph??""}
|
|
5005
5005
|
</slot>
|
|
5006
5006
|
</div>
|
|
5007
5007
|
<div
|
|
@@ -5010,7 +5010,7 @@ const Ob=Db.compose({baseName:"number-field",baseClass:Xi,template:(t,e)=>Q`
|
|
|
5010
5010
|
@click="${t=>t.stepDown()}"
|
|
5011
5011
|
>
|
|
5012
5012
|
<slot name="step-down-glyph">
|
|
5013
|
-
${e.stepDownGlyph
|
|
5013
|
+
${e.stepDownGlyph??""}
|
|
5014
5014
|
</slot>
|
|
5015
5015
|
</div>
|
|
5016
5016
|
</div>
|
|
@@ -7883,17 +7883,17 @@ const r$="nimble-toolbar",a$="Bold",l$="Italics",c$="Bulleted List",d$="Numbered
|
|
|
7883
7883
|
</${Pm}>
|
|
7884
7884
|
</template>
|
|
7885
7885
|
`,v$=t=>t.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()
|
|
7886
|
-
class b$ extends Bi{constructor(){super(...arguments),this.availableViewportHeight=0,this.filter="",this.filteredOptions=[],this.anchorElementIntersectionObserver=new IntersectionObserver((t=>{t[0]?.isIntersecting||this.setOpen(!1)}),{threshold:1,root:document})}close(){this.setOpen(!1)}get options(){return x.track(this,"options"),this.filteredOptions?.length?this.filteredOptions:[]}set options(t){this._options=t,x.notify(this,"options")}show(t){const e=t.anchorNode.getBoundingClientRect().bottom
|
|
7886
|
+
class b$ extends Bi{constructor(){super(...arguments),this.availableViewportHeight=0,this.filter="",this.filteredOptions=[],this.anchorElementIntersectionObserver=new IntersectionObserver((t=>{t[0]?.isIntersecting||this.setOpen(!1)}),{threshold:1,root:document})}close(){this.setOpen(!1)}get options(){return x.track(this,"options"),this.filteredOptions?.length>0?this.filteredOptions:[]}set options(t){this._options=t,x.notify(this,"options")}show(t){const e=t.anchorNode.getBoundingClientRect().bottom
|
|
7887
7887
|
this.availableViewportHeight=Math.trunc(window.innerHeight-e),this.filter=t.filter,this.anchorElement=t.anchorNode,this.setOpen(!0),this.filterOptions()}keydownHandler(t){if(!this.open)return!1
|
|
7888
7888
|
switch(t.key){case pn:case rn:{if(!this.hasSelectableOptions)return!1
|
|
7889
7889
|
const t={href:this.firstSelectedOption.value,displayName:this.firstSelectedOption.text}
|
|
7890
7890
|
return this.$emit("mention-selected",t),this.setOpen(!1),!0}case an:return this.setOpen(!1),!1
|
|
7891
7891
|
default:return super.keydownHandler(t),!1}}filterOptions(){if(this.filter){const t=v$(this.filter)
|
|
7892
7892
|
this.filteredOptions=this._options.filter((e=>v$(e.text).includes(t)))}else this.filteredOptions=this._options
|
|
7893
|
-
this._options.forEach((t=>{t.hidden=!this.filteredOptions.includes(t)})),this.filteredOptions.length?(this.selectedOptions=[this.filteredOptions[0]],this.selectedIndex=this.options.indexOf(this.firstSelectedOption)):(this.selectedOptions=[],this.selectedIndex=-1)}slottedOptionsChanged(t,e){super.slottedOptionsChanged(t,e),this.filterOptions()}clickHandler(t){const e=t.target.closest("option,[role=option]")
|
|
7893
|
+
this._options.forEach((t=>{t.hidden=!this.filteredOptions.includes(t)})),this.filteredOptions.length>0?(this.selectedOptions=[this.filteredOptions[0]],this.selectedIndex=this.options.indexOf(this.firstSelectedOption)):(this.selectedOptions=[],this.selectedIndex=-1)}slottedOptionsChanged(t,e){super.slottedOptionsChanged(t,e),this.filterOptions()}clickHandler(t){const e=t.target.closest("option,[role=option]")
|
|
7894
7894
|
if(!e||e.disabled)return!1
|
|
7895
7895
|
const n={href:e.value,displayName:e.text}
|
|
7896
|
-
return this.$emit("mention-selected",n),this.setOpen(!1),!0}anchorElementChanged(t,e){t&&this.anchorElementIntersectionObserver.unobserve(t),this.region&&this.anchorElement&&(this.region.anchorElement=this.anchorElement,this.region.update(),this.anchorElementIntersectionObserver.observe(e))}regionChanged(){this.regionNotifier&&this.regionNotifier.unsubscribe(this),this.regionNotifier=x.getNotifier(this.region),this.regionNotifier.subscribe(this)}handleChange(t,e){super.handleChange(t,e),"initialLayoutComplete"===e&&this.focusAndScrollOptionIntoView()}focusAndScrollOptionIntoView(){this.open&&this.firstSelectedOption&&requestAnimationFrame((()=>{this.firstSelectedOption?.scrollIntoView({block:"nearest"})}))}setOpen(t){this.open=t}}t([C],b$.prototype,"open",void 0),t([C],b$.prototype,"region",void 0),t([C],b$.prototype,"availableViewportHeight",void 0),t([C],b$.prototype,"filteredOptions",void 0),t([C],b$.prototype,"anchorElement",void 0)
|
|
7896
|
+
return this.$emit("mention-selected",n),this.setOpen(!1),!0}anchorElementChanged(t,e){t&&this.anchorElementIntersectionObserver.unobserve(t),this.region&&this.anchorElement&&(this.region.anchorElement=this.anchorElement,this.region.update(),this.anchorElementIntersectionObserver.observe(e))}regionChanged(){this.regionNotifier&&this.regionNotifier.unsubscribe(this),this.regionNotifier=x.getNotifier(this.region),this.regionNotifier.subscribe(this)}handleChange(t,e){super.handleChange(t,e),"initialLayoutComplete"===e&&this.focusAndScrollOptionIntoView()}focusAndScrollOptionIntoView(){this.open&&null!==this.firstSelectedOption&&requestAnimationFrame((()=>{this.firstSelectedOption?.scrollIntoView({block:"nearest"})}))}setOpen(t){this.open=t}}t([C],b$.prototype,"open",void 0),t([C],b$.prototype,"region",void 0),t([C],b$.prototype,"availableViewportHeight",void 0),t([C],b$.prototype,"filteredOptions",void 0),t([C],b$.prototype,"anchorElement",void 0)
|
|
7897
7897
|
const y$=b$.compose({baseName:"rich-text-mention-listbox",template:g$,styles:m$})
|
|
7898
7898
|
Ii.getOrCreate().withPrefix("nimble").register(y$())
|
|
7899
7899
|
const w$="nimble-rich-text-mention-listbox",x$=Q`
|
|
@@ -9153,7 +9153,7 @@ return null===n?{fragment:document.createDocumentFragment(),mentionedHrefs:Array
|
|
|
9153
9153
|
return t.normalizeLinkText=t=>t,new xT(this.updatedSchema,t,kT.tokens)}static getCustomSchemaConfiguration(){return new Dy({nodes:mT.spec.nodes,marks:{link:{attrs:{href:{},rel:{default:"noopener noreferrer"},class:{default:""}},inclusive:!1,excludes:"_",toDOM(t){const e=t.attrs.href,n=ET.mentionConfigs?.find((t=>t.isValidMentionHref(e))),i=n?.getDisplayName(e)
|
|
9154
9154
|
return n&&i?(ET.mentionedHrefs.add(e),[n.viewElement,{"mention-href":e,"mention-label":i}]):[rd,{href:ET.startsWithHttpOrHttps(e)?e:null,rel:t.attrs.rel,class:e,"underline-hidden":!ET.startsWithHttpOrHttps(e)||null}]}},em:mT.spec.marks.get("em"),strong:mT.spec.marks.get("strong")}})}static setup(t){ET.mentionConfigs=t,ET.mentionedHrefs.clear()}static cleanup(){ET.mentionConfigs=void 0,ET.mentionedHrefs.clear()}static startsWithHttpOrHttps(t){return/^https?:\/\//i.test(t)}}ET=AT,AT.mentionedHrefs=new Set,AT.updatedSchema=ET.getCustomSchemaConfiguration(),AT.markdownParser=ET.initializeMarkdownParser(),AT.domSerializer=qy.fromSchema(ET.updatedSchema)
|
|
9155
9155
|
class TT{constructor(t){this.markdownSerializer=this.initializeMarkdownSerializerForTipTap(t)}serializeDOMToMarkdown(t){return this.markdownSerializer.serialize(t)}initializeMarkdownSerializerForTipTap(t){const e=function(t,e){const n=e.attrs.href
|
|
9156
|
-
t.write(`<${n}>`)},n={bulletList:MT.nodes.bullet_list,listItem:MT.nodes.list_item,orderedList:function(t,e){const n=e.attrs.start
|
|
9156
|
+
t.write(`<${n}>`)},n={bulletList:MT.nodes.bullet_list,listItem:MT.nodes.list_item,orderedList:function(t,e){const n=e.attrs.start??1,i=String(n+e.childCount-1).length,o=t.repeat(" ",i+2)
|
|
9157
9157
|
t.renderList(e,o,(e=>{const o=String(n+e)
|
|
9158
9158
|
return`${t.repeat(" ",i-o.length)+o}. `}))},doc:MT.nodes.doc,paragraph:MT.nodes.paragraph,text:MT.nodes.text,hardBreak:MT.nodes.hard_break}
|
|
9159
9159
|
t.forEach((t=>{n[t]=e}))
|
|
@@ -9174,7 +9174,7 @@ class PT extends LT{constructor(t){super(BT),this.richText=t,this.updateQueued=!
|
|
|
9174
9174
|
break
|
|
9175
9175
|
case"pattern":this.track("pattern")
|
|
9176
9176
|
break
|
|
9177
|
-
case"buttonLabel":this.track("buttonLabel")}this.queueUpdate()}trackMentionElementsInstancesChanged(){this.track("pattern"),this.track("mappingConfigs"),this.track("buttonLabel"),this.queueUpdate()}queueUpdate(){this.richText.$fastController.isConnected&&(this.updateQueued||(this.updateQueued=!0,b.queueUpdate((()=>{this.richText.createConfig(),this.untrackAll(),this.updateQueued=!1}))))}}class zT{constructor(){this.invalidMentionConfiguration=!1,this.duplicateMentionConfiguration=!1}getValidity(){return{invalidMentionConfiguration:this.invalidMentionConfiguration,duplicateMentionConfiguration:this.duplicateMentionConfiguration}}isValid(){return Object.values(this.getValidity()).every((t=>!
|
|
9177
|
+
case"buttonLabel":this.track("buttonLabel")}this.queueUpdate()}trackMentionElementsInstancesChanged(){this.track("pattern"),this.track("mappingConfigs"),this.track("buttonLabel"),this.queueUpdate()}queueUpdate(){this.richText.$fastController.isConnected&&(this.updateQueued||(this.updateQueued=!0,b.queueUpdate((()=>{this.richText.createConfig(),this.untrackAll(),this.updateQueued=!1}))))}}class zT{constructor(){this.invalidMentionConfiguration=!1,this.duplicateMentionConfiguration=!1}getValidity(){return{invalidMentionConfiguration:this.invalidMentionConfiguration,duplicateMentionConfiguration:this.duplicateMentionConfiguration}}isValid(){return Object.values(this.getValidity()).every((t=>!t))}validate(t){this.validateDuplicateMentionConfigurations(t),this.validateMentionConfigurations(t)}validateMentionConfigurations(t){return this.invalidMentionConfiguration=t.some((t=>!t.mentionInternals.validator.isValid())),!this.invalidMentionConfiguration}validateDuplicateMentionConfigurations(t){const e=t.map((t=>t.mentionInternals.character))
|
|
9178
9178
|
return this.duplicateMentionConfiguration=e.length!==new Set(e).size,!this.duplicateMentionConfiguration}}async function VT(t){const e=t.map((async t=>{t.matches(":not(:defined)")&&await customElements.whenDefined(t.localName)}))
|
|
9179
9179
|
await Promise.all(e)}class HT extends Ve{constructor(){super(...arguments),this.mentionInternalsNotifiers=[],this.childItems=[],this.richTextUpdateTracker=new PT(this),this.richTextValidator=new zT}get validity(){return this.richTextValidator.getValidity()}checkValidity(){return this.richTextValidator.isValid()}handleChange(t,e){t instanceof DT&&"string"==typeof e&&this.richTextUpdateTracker.trackMentionInternalsPropertyChanged(e)}createConfig(){this.validate(),this.richTextValidator.isValid()?(this.richTextUpdateTracker.updateMappingConfigs||this.richTextUpdateTracker.updatePattern)&&(this.configuration=new FT(this.mentionElements)):this.configuration=void 0}validate(){this.richTextValidator.validate(this.mentionElements)}childItemsChanged(t,e){void 0!==t&&this.updateMentionElementsFromChildItems()}async updateMentionElementsFromChildItems(){await VT(this.childItems),this.mentionElements=this.childItems.filter((t=>t instanceof OT)),this.observeMentionInternals(),this.richTextUpdateTracker.trackMentionElementsInstancesChanged()}observeMentionInternals(){this.removeMentionInternalsObservers()
|
|
9180
9180
|
for(const t of this.mentionElements){const e=x.getNotifier(t.mentionInternals)
|
|
@@ -9730,7 +9730,7 @@ function yF(t,e,n,i,o,s){const r=nR.extend({excludes:"_",inclusive:!1,parseHTML:
|
|
|
9730
9730
|
return{onStart:s=>{null!==s.decorationNode&&(o=!0,t.mentionUpdateEmitter(s.query),e(s.text.slice(0,1)),n(s.command),i?.show({filter:s.query,anchorNode:s.decorationNode}))},onUpdate:e=>{o&&(t.mentionUpdateEmitter(e.query),n(e.command),i?.show({filter:e.query,anchorNode:e.decorationNode}))},onKeyDown:t=>!!o&&(t.event.key===an&&(o=!1),i?.keydownHandler(t.event)??!1),onExit:()=>{e(""),n(void 0),i?.close()}}}}})}(n,t,e,o))),l=new HI({element:n,enableInputRules:[rR,SR],enablePasteRules:!1,editorProps:{transformPasted:function(t){const e=wF(l,t.content)
|
|
9731
9731
|
return new Kb(e,t.openStart,t.openEnd)}},extensions:[XT,LR,BR,rR,SR,aR,KT,iD,vF,mF.configure({placeholder:s,showOnlyWhenEditable:!1}),i$,r,...a]})
|
|
9732
9732
|
return l}function wF(t,e){const n=[]
|
|
9733
|
-
return e.forEach((e=>{if(e.isText&&e.marks.length>0){const i=e.marks.find((t=>"link"===t.type.name
|
|
9733
|
+
return e.forEach((e=>{if(e.isText&&e.marks.length>0){const i=e.marks.find((t=>"link"===t.type.name))
|
|
9734
9734
|
i?bF.test(i.attrs.href)?n.push(t.schema.text(i.attrs.href,e.marks)):n.push(t.schema.text(e.textContent,i.removeFromSet(e.marks))):n.push(e)}else if(e.type.name.startsWith(_$))n.push(t.schema.text(e.attrs.label))
|
|
9735
9735
|
else{const i=wF(t,e.content)
|
|
9736
9736
|
n.push(e.copy(i))}})),Ub.fromArray(n)}class xF{constructor(t){xF.instance+=1
|
|
@@ -9738,7 +9738,7 @@ const e=`${_$}${xF.instance}`
|
|
|
9738
9738
|
this.name=e,this.key=e,this.viewElement=t.viewElement,this.character=t.character,this.mappingConfigs=t.mappingConfigs,this.iconTemplate=t.iconTemplate,this.buttonLabel=t.buttonLabel??"",this.mentionUpdateEmitter=t.mentionUpdateEmitter}}xF.instance=0
|
|
9739
9739
|
class CF extends FT{constructor(t){super(t),this.mentionExtensionConfig=this.isValid?t.map((t=>new xF(t.mentionInternals))):[]}}class kF extends(fg(HT)){constructor(){super(...arguments),this.editorDiv=this.createEditor(),this.tiptapEditor=yF((()=>{}),(()=>{}),this.editorDiv,[],this.mentionListbox,this.placeholder),this.xmlSerializer=new XMLSerializer,this.richTextMarkdownSerializer=new TT([]),this.disabled=!1,this.footerHidden=!1,this.scrollbarWidth=-1,this.activeMentionCharacter="",this.updateScrollbarWidthQueued=!1}get empty(){if(""===this.tiptapEditor.state.doc.textContent.trim()){let t=!1
|
|
9740
9740
|
return this.tiptapEditor.state.doc.descendants((e=>{e.type.name.startsWith(_$)&&(t=!0)
|
|
9741
|
-
return!
|
|
9741
|
+
return!t})),!t}return!1}connectedCallback(){super.connectedCallback(),this.editorDiv.isConnected||this.editorContainer.append(this.editorDiv),this.bindEditorTransactionEvent(),this.bindEditorUpdateEvent(),this.stopNativeInputEventPropagation(),this.resizeObserver=new ResizeObserver((()=>this.onResize())),this.resizeObserver.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this.unbindEditorTransactionEvent(),this.unbindEditorUpdateEvent(),this.unbindNativeInputEvent(),this.resizeObserver?.disconnect()}disabledChanged(){this.disableEditor(),this.disableMentionViewElement()}placeholderChanged(t,e){const n=this.getMarkdown(),{from:i,to:o}=this.tiptapEditor.view.state.selection
|
|
9742
9742
|
this.initializeEditor(),this.setMarkdown(n),this.tiptapEditor.commands.setTextSelection({from:i,to:o})}ariaLabelChanged(t,e){null!==this.ariaLabel&&void 0!==this.ariaLabel?this.editorDiv.setAttribute("aria-label",this.ariaLabel):this.editorDiv.removeAttribute("aria-label")}configurationChanged(t,e){const n=this.getButtonsState(this.tiptapEditor),{from:i,to:o}=this.tiptapEditor.view.state.selection
|
|
9743
9743
|
if(this.isMentionExtensionConfigUnchanged(t,e))this.setMarkdown(this.getMarkdown())
|
|
9744
9744
|
else{const t=this.getMentionExtensionConfig(),e=this.getMarkdown()
|
|
@@ -10150,7 +10150,7 @@ let PF=class extends Bi{}
|
|
|
10150
10150
|
class zF extends(Dn(PF)){constructor(){super(...arguments),this.proxy=document.createElement("select")}}const VF=t=>!t.visuallyHidden&&!t.disabled&&!t.hidden,HF=t=>!t.visuallyHidden&&!t.hidden
|
|
10151
10151
|
class UF extends(fg(Lg(zF))){constructor(){super(...arguments),this.appearance=Sg,this.appearanceReadOnly=!1,this.fullBleed=!1,this.filterMode=Ag.none,this.clearable=!1,this.loadingVisible=!1,this.displayPlaceholder=!1,this.open=!1,this.listboxId=yn("listbox-"),this.hasOverflow=!1,this.filteredOptions=[],this.filter="",this.availableViewportHeight=0,this._value="",this.forcedPosition=!1,this.selectedOptionObserver=new MutationObserver((()=>{this.updateDisplayValue()}))}get collapsible(){return!(this.multiple||"number"==typeof this.size)}get labelContent(){return this.$fastController.isConnected?Kv(this.labelSlot):""}connectedCallback(){super.connectedCallback(),this.forcedPosition=!!this.positionAttribute,this.open&&this.initializeOpenState(),this.observeSelectedOptionTextContent()}disconnectedCallback(){super.disconnectedCallback(),this.selectedOptionObserver?.disconnect()}get value(){return x.track(this,"value"),this._value}set value(t){const e=this._value
|
|
10152
10152
|
let n=t
|
|
10153
|
-
if(this.options
|
|
10153
|
+
if(void 0!==this.options&&this.options.length>0){const t=this.options.findIndex((t=>t.value===n)),e=this.options[this.selectedIndex]?.value??null,i=this.options[t]?.value??null;-1!==t&&e===i||(n="",this.selectedIndex=t),n=this.firstSelectedOption?.value??n}e!==n&&(this._value=n,super.valueChanged(e,n),x.notify(this,"value"),this.updateDisplayValue())}get displayValue(){return x.track(this,"displayValue"),this.firstSelectedOption?.text??""}anchoredRegionChanged(t,e){void 0!==this.anchoredRegion&&void 0!==this.control&&(this.anchoredRegion.anchorElement=this.control)}controlChanged(t,e){void 0!==this.anchoredRegion&&void 0!==this.control&&(this.anchoredRegion.anchorElement=this.control)}slottedOptionsChanged(t,e){const n=this.value
|
|
10154
10154
|
this.options.forEach((t=>{const e=x.getNotifier(t)
|
|
10155
10155
|
e.unsubscribe(this,"value"),e.unsubscribe(this,"hidden"),e.unsubscribe(this,"disabled")})),t?.filter(LF).forEach((t=>{const e=x.getNotifier(t)
|
|
10156
10156
|
e.unsubscribe(this,"hidden"),e.unsubscribe(this,"visuallyHidden"),e.unsubscribe(this,"listOptions")}))
|
|
@@ -10173,11 +10173,11 @@ case"visuallyHidden":(LF(n)||NF(n))&&this.updateAdjacentSeparatorState(n)
|
|
|
10173
10173
|
break
|
|
10174
10174
|
case"disabled":this.updateDisplayValue()
|
|
10175
10175
|
break
|
|
10176
|
-
case"listOptions":this.slottedOptionsChanged(this.slottedOptions,this.slottedOptions)}}mousedownHandler(t){return t.offsetX>=0&&t.offsetX<=this.listbox?.scrollWidth?super.mousedownHandler(t):this.collapsible}regionLoadedHandler(){this.focusAndScrollOptionIntoView()}multipleChanged(t,e){super.multipleChanged(t,e),this.proxy
|
|
10176
|
+
case"listOptions":this.slottedOptionsChanged(this.slottedOptions,this.slottedOptions)}}mousedownHandler(t){return t.offsetX>=0&&t.offsetX<=this.listbox?.scrollWidth?super.mousedownHandler(t):this.collapsible}regionLoadedHandler(){this.focusAndScrollOptionIntoView()}multipleChanged(t,e){super.multipleChanged(t,e),this.proxy.multiple=e}ignoreClickHandler(t){t.stopPropagation()}clearClickHandler(t){this.open=!1,this.clearSelect(),this.updateValue(!0),t.stopPropagation()}updateDisplayValue(){const t=this.getPlaceholderOption()
|
|
10177
10177
|
t&&this.firstSelectedOption===t?this.displayPlaceholder=!0:this.displayPlaceholder=!1,x.notify(this,"displayValue")}inputHandler(t){if(this.filter=this.filterInput?.value??"",this.filterMode===Ag.standard){this.filterOptions()
|
|
10178
10178
|
const t=this.filteredOptions.filter((t=>!t.disabled))
|
|
10179
10179
|
let e=""!==this.filter?this.openActiveIndex??this.selectedIndex:this.selectedIndex
|
|
10180
|
-
t.length>0&&!t.find((t=>t===this.options[e]))?e=this.options.indexOf(t[0]):0===t.length&&(e=-1),this.setActiveOption(e)}return this.filterMode!==Ag.none&&this.emitFilterInputEvent(),t.inputType.includes("deleteContent")
|
|
10180
|
+
t.length>0&&!t.find((t=>t===this.options[e]))?e=this.options.indexOf(t[0]):0===t.length&&(e=-1),this.setActiveOption(e)}return this.filterMode!==Ag.none&&this.emitFilterInputEvent(),t.inputType.includes("deleteContent")||0===this.filter.length||t.stopPropagation(),!0}focusoutHandler(t){if(super.focusoutHandler(t),!this.open)return!0
|
|
10181
10181
|
this.open=!1
|
|
10182
10182
|
const e=t.relatedTarget
|
|
10183
10183
|
return!this.isSameNode(e)||(this.focus(),!0)}keydownHandler(t){const e=this.selectedIndex,n=t.key
|
|
@@ -10198,14 +10198,14 @@ this.open?o=!0:this.open=!0,o&&this.focus()
|
|
|
10198
10198
|
break
|
|
10199
10199
|
case an:if(!this.open){if(this.clearable)return this.clearSelect(),this.updateValue(!0),!0
|
|
10200
10200
|
break}this.collapsible&&this.open&&(t.preventDefault(),this.open=!1),i=this.selectedIndex,this.focus()}return this.open&&!o||(this.selectedIndex!==i&&(this.selectedIndex=i),e!==this.selectedIndex&&this.updateValue(!0)),o&&(this.open=!1),!(n===en||n===sn)}selectedIndexChanged(t,e){this.setSelectedOptions(),this.open&&this.setActiveOption(this.selectedIndex),this.updateValue()}typeaheadBufferChanged(t,e){if(this.$fastController.isConnected){const t=this.getTypeaheadMatches()
|
|
10201
|
-
if(t.length){const e=this.options.indexOf(t[0])
|
|
10201
|
+
if(t.length>0){const e=this.options.indexOf(t[0])
|
|
10202
10202
|
this.open&&this.filterMode!==Ag.none||this.setActiveOption(e)}this.typeaheadExpired=!1}}disabledChanged(t,e){super.disabledChanged&&super.disabledChanged(t,e),this.ariaDisabled=this.disabled?"true":"false"}formResetCallback(){this.setProxyOptions(),super.setDefaultSelectedOption(),-1===this.selectedIndex&&(this.selectedIndex=0)}selectNextOption(){for(let t=(this.openActiveIndex??this.selectedIndex)+1;t<this.options.length;t++){const e=this.options[t]
|
|
10203
10203
|
if(NF(e)&&VF(e)){this.setActiveOption(t)
|
|
10204
10204
|
break}}}selectPreviousOption(){for(let t=(this.openActiveIndex??this.selectedIndex)-1;t>=0;t--){const e=this.options[t]
|
|
10205
10205
|
if(NF(e)&&VF(e)){this.setActiveOption(t)
|
|
10206
10206
|
break}}}selectFirstOption(){const t=this.options.findIndex((t=>NF(t)&&VF(t)))
|
|
10207
10207
|
this.setActiveOption(t)}selectLastOption(){const t=Ge(this.options,(t=>NF(t)&&VF(t)))
|
|
10208
|
-
this.setActiveOption(t)}registerOption(t){this.options.includes(t)||this.options.push(t)}setSelectedOptions(){this.open&&-1===this.selectedIndex||super.setSelectedOptions()}focusAndScrollOptionIntoView(){this.open&&(super.focusAndScrollOptionIntoView(),window.requestAnimationFrame((()=>{this.filterInput?.focus()})))}getTypeaheadMatches(){return super.getTypeaheadMatches().filter((t=>!t.hidden&&!t.disabled))}positionChanged(t,e){this.positionAttribute=e,this.setPositioning()}sizeChanged(t,e){super.sizeChanged(t,e),this.proxy
|
|
10208
|
+
this.setActiveOption(t)}registerOption(t){this.options.includes(t)||this.options.push(t)}setSelectedOptions(){this.open&&-1===this.selectedIndex||super.setSelectedOptions()}focusAndScrollOptionIntoView(){this.open&&(super.focusAndScrollOptionIntoView(),window.requestAnimationFrame((()=>{this.filterInput?.focus()})))}getTypeaheadMatches(){return super.getTypeaheadMatches().filter((t=>!t.hidden&&!t.disabled))}positionChanged(t,e){this.positionAttribute=e,this.setPositioning()}sizeChanged(t,e){super.sizeChanged(t,e),this.proxy.size=e}openChanged(){if(!this.collapsible)return
|
|
10209
10209
|
if(this.open)return void this.initializeOpenState()
|
|
10210
10210
|
const t=this.options[this.openActiveIndex??this.selectedIndex]
|
|
10211
10211
|
NF(t)&&(t.activeOption=!1),this.openActiveIndex=void 0,this.filter="",this.filterInput&&(this.filterInput.value=""),this.filterMode!==Ag.none&&this.emitFilterInputEvent(),this.ariaControls="",this.ariaExpanded="false"}selectedOptionsChanged(t,e){this.options?.forEach(((t,n)=>{const i=x.getNotifier(t)
|
|
@@ -10242,11 +10242,11 @@ for(const e of this.slottedOptions)if(LF(e)){if(e.hidden)continue
|
|
|
10242
10242
|
const n=this.getGroupOptions(e),i=this.filterMatchesText(e.labelContent)
|
|
10243
10243
|
n.forEach((e=>{e.visuallyHidden=!i&&this.isOptionHiddenOrFilteredOut(e),e.visuallyHidden||t.push(e)}))}else NF(e)&&(e.visuallyHidden=this.isOptionHiddenOrFilteredOut(e),e.visuallyHidden||t.push(e))
|
|
10244
10244
|
this.filteredOptions=t}getGroupOptions(t){return Array.from(t.children).filter((t=>NF(t))).map((e=>(t.hidden&&NF(e)&&(e.visuallyHidden=!0),e)))}updateValue(t){this.$fastController.isConnected&&(this.value=this.firstSelectedOption?.value??"",this.observeSelectedOptionTextContent()),t&&(this.$emit("input"),this.$emit("change",this,{bubbles:!0,composed:void 0}))}clearSelect(){const t=this.getPlaceholderOption()
|
|
10245
|
-
this.selectedIndex=t?this.options.indexOf(t):-1}setProxyOptions(){this.proxy instanceof HTMLSelectElement&&this.options&&(this.proxy.options.length=0,this.options.forEach((t=>{const e=t.proxy
|
|
10246
|
-
e&&this.proxy.options.add(e)})))}filterChanged(){this.filterOptions()}emitFilterInputEvent(){const t={filterText:this.filter}
|
|
10245
|
+
this.selectedIndex=t?this.options.indexOf(t):-1}setProxyOptions(){this.proxy instanceof HTMLSelectElement&&null!==this.options&&(this.proxy.options.length=0,this.options.forEach((t=>{const e=t.proxy??(t instanceof HTMLOptionElement?t.cloneNode():null)
|
|
10246
|
+
null!==e&&this.proxy.options.add(e)})))}filterChanged(){this.filterOptions()}emitFilterInputEvent(){const t={filterText:this.filter}
|
|
10247
10247
|
this.$emit("filter-input",t,{bubbles:!0})}initializeOpenState(){this.setActiveOption(this.selectedIndex),this.ariaControls=this.listboxId,this.ariaExpanded="true",this.setPositioning(),this.focusAndScrollOptionIntoView()}observeSelectedOptionTextContent(){if(this.selectedOptionObserver?.disconnect(),-1===this.selectedIndex)return
|
|
10248
10248
|
const t=this.firstSelectedOption
|
|
10249
|
-
t&&this.selectedOptionObserver?.observe(t,{characterData:!0,subtree:!0,childList:!0})}}t([ft],UF.prototype,"appearance",void 0),t([ft({attribute:"appearance-readonly",mode:"boolean"})],UF.prototype,"appearanceReadOnly",void 0),t([ft({attribute:"full-bleed",mode:"boolean"})],UF.prototype,"fullBleed",void 0),t([ft({attribute:"position"})],UF.prototype,"positionAttribute",void 0),t([ft({attribute:"filter-mode"})],UF.prototype,"filterMode",void 0),t([ft({attribute:"clearable",mode:"boolean"})],UF.prototype,"clearable",void 0),t([ft({attribute:"loading-visible",mode:"boolean"})],UF.prototype,"loadingVisible",void 0),t([C],UF.prototype,"displayPlaceholder",void 0),t([ft({attribute:"open",mode:"boolean"})],UF.prototype,"open",void 0),t([C],UF.prototype,"position",void 0),t([C],UF.prototype,"control",void 0),t([C],UF.prototype,"scrollableRegion",void 0),t([C],UF.prototype,"filterInput",void 0),t([C],UF.prototype,"anchoredRegion",void 0),t([C],UF.prototype,"hasOverflow",void 0),t([C],UF.prototype,"filteredOptions",void 0),t([C],UF.prototype,"filter",void 0),t([C],UF.prototype,"availableViewportHeight",void 0),t([k],UF.prototype,"collapsible",null),t([k],UF.prototype,"labelContent",null),t([k],UF.prototype,"displayValue",null)
|
|
10249
|
+
null!==t&&this.selectedOptionObserver?.observe(t,{characterData:!0,subtree:!0,childList:!0})}}t([ft],UF.prototype,"appearance",void 0),t([ft({attribute:"appearance-readonly",mode:"boolean"})],UF.prototype,"appearanceReadOnly",void 0),t([ft({attribute:"full-bleed",mode:"boolean"})],UF.prototype,"fullBleed",void 0),t([ft({attribute:"position"})],UF.prototype,"positionAttribute",void 0),t([ft({attribute:"filter-mode"})],UF.prototype,"filterMode",void 0),t([ft({attribute:"clearable",mode:"boolean"})],UF.prototype,"clearable",void 0),t([ft({attribute:"loading-visible",mode:"boolean"})],UF.prototype,"loadingVisible",void 0),t([C],UF.prototype,"displayPlaceholder",void 0),t([ft({attribute:"open",mode:"boolean"})],UF.prototype,"open",void 0),t([C],UF.prototype,"position",void 0),t([C],UF.prototype,"control",void 0),t([C],UF.prototype,"scrollableRegion",void 0),t([C],UF.prototype,"filterInput",void 0),t([C],UF.prototype,"anchoredRegion",void 0),t([C],UF.prototype,"hasOverflow",void 0),t([C],UF.prototype,"filteredOptions",void 0),t([C],UF.prototype,"filter",void 0),t([C],UF.prototype,"availableViewportHeight",void 0),t([k],UF.prototype,"collapsible",null),t([k],UF.prototype,"labelContent",null),t([k],UF.prototype,"displayValue",null)
|
|
10250
10250
|
const qF=UF.compose({baseName:"select",baseClass:oo,template:(t,e)=>Q`
|
|
10251
10251
|
<template
|
|
10252
10252
|
class="${t=>[t.collapsible&&"collapsible",t.collapsible&&t.open&&"open",t.disabled&&"disabled",t.collapsible&&t.position].filter(Boolean).join(" ")}"
|
|
@@ -10294,7 +10294,7 @@ const qF=UF.compose({baseName:"select",baseClass:oo,template:(t,e)=>Q`
|
|
|
10294
10294
|
`)}
|
|
10295
10295
|
<div aria-hidden="true" class="indicator" part="indicator">
|
|
10296
10296
|
<slot name="indicator">
|
|
10297
|
-
${e.indicator
|
|
10297
|
+
${e.indicator??""}
|
|
10298
10298
|
</slot>
|
|
10299
10299
|
</div>
|
|
10300
10300
|
</slot>
|
|
@@ -10399,7 +10399,9 @@ const XF=It`
|
|
|
10399
10399
|
flex-direction: column;
|
|
10400
10400
|
cursor: pointer;
|
|
10401
10401
|
--ni-private-switch-height: 24px;
|
|
10402
|
-
--ni-private-switch-indicator-size:
|
|
10402
|
+
--ni-private-switch-indicator-size: 24px;
|
|
10403
|
+
--ni-private-switch-indicator-inner-size: 18px;
|
|
10404
|
+
--ni-private-switch-indicator-margin: -2px;
|
|
10403
10405
|
padding-bottom: calc(
|
|
10404
10406
|
${Nl} - var(--ni-private-switch-height)
|
|
10405
10407
|
);
|
|
@@ -10437,20 +10439,36 @@ const XF=It`
|
|
|
10437
10439
|
display: flex;
|
|
10438
10440
|
height: var(--ni-private-switch-height);
|
|
10439
10441
|
width: calc(var(--ni-private-switch-height) * 2);
|
|
10440
|
-
background-color:
|
|
10442
|
+
background-color: var(--ni-private-switch-background-color);
|
|
10441
10443
|
border-radius: calc(var(--ni-private-switch-height) / 2);
|
|
10442
10444
|
align-items: center;
|
|
10443
|
-
border: calc(${Hl}
|
|
10445
|
+
border: calc(${Hl}) solid transparent;
|
|
10444
10446
|
}
|
|
10445
10447
|
|
|
10446
|
-
:host([
|
|
10447
|
-
background-color: var(--ni-private-switch-background-
|
|
10448
|
+
:host([aria-checked='true']) .switch {
|
|
10449
|
+
background-color: var(--ni-private-switch-background-selected-color);
|
|
10450
|
+
}
|
|
10451
|
+
|
|
10452
|
+
:host([aria-checked='true']:hover) .switch {
|
|
10453
|
+
background-color: var(--ni-private-switch-background-selected-rollover-color);
|
|
10448
10454
|
}
|
|
10449
10455
|
|
|
10450
10456
|
:host(${Ho}) .switch {
|
|
10451
10457
|
border-color: ${Sl};
|
|
10452
10458
|
}
|
|
10453
10459
|
|
|
10460
|
+
:host(${Ho}[aria-checked='true']) .switch {
|
|
10461
|
+
background-color: var(--ni-private-switch-background-selected-rollover-color);
|
|
10462
|
+
}
|
|
10463
|
+
|
|
10464
|
+
:host([disabled]) .switch {
|
|
10465
|
+
background-color: var(--ni-private-switch-background-disabled-color);
|
|
10466
|
+
}
|
|
10467
|
+
|
|
10468
|
+
:host([disabled]:hover) .switch {
|
|
10469
|
+
background-color: var(--ni-private-switch-background-disabled-color);
|
|
10470
|
+
}
|
|
10471
|
+
|
|
10454
10472
|
.checked-indicator-spacer {
|
|
10455
10473
|
flex-grow: 0;
|
|
10456
10474
|
transition: flex-grow ${Xc} ease-in-out;
|
|
@@ -10468,51 +10486,81 @@ const XF=It`
|
|
|
10468
10486
|
width: var(--ni-private-switch-indicator-size);
|
|
10469
10487
|
height: var(--ni-private-switch-indicator-size);
|
|
10470
10488
|
border-radius: calc(var(--ni-private-switch-indicator-size) / 2);
|
|
10471
|
-
margin:
|
|
10472
|
-
calc(
|
|
10473
|
-
var(--ni-private-switch-height) - var(
|
|
10474
|
-
--ni-private-switch-indicator-size
|
|
10475
|
-
)
|
|
10476
|
-
) /
|
|
10477
|
-
2
|
|
10478
|
-
);
|
|
10489
|
+
margin: var(--ni-private-switch-indicator-margin);
|
|
10479
10490
|
border: ${Hl} solid
|
|
10480
10491
|
var(--ni-private-switch-indicator-border-color);
|
|
10481
10492
|
}
|
|
10482
10493
|
|
|
10494
|
+
:host([aria-checked='true']) .checked-indicator {
|
|
10495
|
+
border-color: var(--ni-private-switch-indicator-border-selected-color);
|
|
10496
|
+
}
|
|
10497
|
+
|
|
10483
10498
|
:host(:hover) .checked-indicator {
|
|
10484
10499
|
border: calc(${Hl} * 2) solid ${Sl};
|
|
10485
10500
|
}
|
|
10486
10501
|
|
|
10502
|
+
:host(${Ho}) .checked-indicator {
|
|
10503
|
+
border: calc(${Hl} * 2) solid ${Sl};
|
|
10504
|
+
}
|
|
10505
|
+
|
|
10487
10506
|
:host([disabled]) .checked-indicator {
|
|
10488
|
-
background-color:
|
|
10489
|
-
--ni-private-switch-indicator-background-disabled-color
|
|
10490
|
-
);
|
|
10507
|
+
background-color: transparent;
|
|
10491
10508
|
border: ${Hl} solid
|
|
10492
10509
|
var(--ni-private-switch-indicator-border-disabled-color);
|
|
10493
10510
|
}
|
|
10494
10511
|
|
|
10495
|
-
:host(
|
|
10496
|
-
|
|
10512
|
+
:host([disabled]:hover) .checked-indicator {
|
|
10513
|
+
background-color: transparent;
|
|
10514
|
+
border: ${Hl} solid
|
|
10515
|
+
var(--ni-private-switch-indicator-border-disabled-color);
|
|
10497
10516
|
}
|
|
10498
10517
|
|
|
10499
|
-
.checked-indicator
|
|
10500
|
-
|
|
10501
|
-
|
|
10502
|
-
|
|
10503
|
-
|
|
10518
|
+
:host([disabled]${Ho}) .checked-indicator {
|
|
10519
|
+
background-color: transparent;
|
|
10520
|
+
border: ${Hl} solid
|
|
10521
|
+
var(--ni-private-switch-indicator-border-disabled-color);
|
|
10522
|
+
}
|
|
10523
|
+
|
|
10524
|
+
:host([disabled]:active) .checked-indicator-inner {
|
|
10525
|
+
background-color: var(
|
|
10526
|
+
--ni-private-switch-indicator-border-disabled-color
|
|
10527
|
+
);
|
|
10504
10528
|
opacity: 0;
|
|
10505
|
-
transition: opacity ${Xc} ease-in-out;
|
|
10506
10529
|
}
|
|
10507
10530
|
|
|
10508
|
-
:host([disabled]) .checked-indicator-inner {
|
|
10531
|
+
:host([disabled]${Ho}) .checked-indicator-inner {
|
|
10509
10532
|
background-color: var(
|
|
10510
10533
|
--ni-private-switch-indicator-border-disabled-color
|
|
10511
10534
|
);
|
|
10535
|
+
opacity: 0;
|
|
10536
|
+
}
|
|
10537
|
+
|
|
10538
|
+
.checked-indicator-inner {
|
|
10539
|
+
width: var(--ni-private-switch-indicator-inner-size);
|
|
10540
|
+
height: var(--ni-private-switch-indicator-inner-size);
|
|
10541
|
+
border-radius: calc(var(--ni-private-switch-indicator-inner-size) / 2);
|
|
10542
|
+
opacity: 0;
|
|
10512
10543
|
}
|
|
10513
10544
|
|
|
10514
10545
|
:host([aria-checked='true']) .checked-indicator-inner {
|
|
10546
|
+
opacity: 0;
|
|
10547
|
+
}
|
|
10548
|
+
|
|
10549
|
+
:host(${Ho}) .checked-indicator-inner {
|
|
10550
|
+
opacity: 1;
|
|
10551
|
+
background-color: var(--ni-private-switch-indicator-background-color);
|
|
10552
|
+
border: 1px solid var(--ni-private-switch-indicator-border-selected-color);
|
|
10553
|
+
}
|
|
10554
|
+
|
|
10555
|
+
:host(:active) .checked-indicator-inner {
|
|
10515
10556
|
opacity: 1;
|
|
10557
|
+
background-color: var(--ni-private-switch-indicator-background-active-color);
|
|
10558
|
+
}
|
|
10559
|
+
|
|
10560
|
+
:host([disabled]) .checked-indicator-inner {
|
|
10561
|
+
background-color: var(
|
|
10562
|
+
--ni-private-switch-indicator-border-disabled-color
|
|
10563
|
+
);
|
|
10516
10564
|
}
|
|
10517
10565
|
|
|
10518
10566
|
slot[name='checked-message']::slotted(*) {
|
|
@@ -10527,26 +10575,43 @@ const XF=It`
|
|
|
10527
10575
|
}
|
|
10528
10576
|
`.withBehaviors(Hm(Uo,It`
|
|
10529
10577
|
:host {
|
|
10578
|
+
--ni-private-switch-background-color: ${ol(Fa,.1)};
|
|
10530
10579
|
--ni-private-switch-background-disabled-color: ${ol(Fa,.07)};
|
|
10580
|
+
--ni-private-switch-background-selected-color: ${ol(La,.6)};
|
|
10581
|
+
--ni-private-switch-background-selected-rollover-color: ${ol(La,.3)};
|
|
10531
10582
|
--ni-private-switch-indicator-background-color: ${Aa};
|
|
10532
|
-
--ni-private-switch-indicator-background-disabled-color: ${ol(
|
|
10533
|
-
--ni-private-switch-indicator-
|
|
10534
|
-
|
|
10583
|
+
--ni-private-switch-indicator-background-disabled-color: ${ol(Fa,.15)};
|
|
10584
|
+
--ni-private-switch-indicator-background-active-color: ${ol(La,.3)};
|
|
10585
|
+
|
|
10586
|
+
--ni-private-switch-indicator-border-color: ${ol(Fa,.3)};
|
|
10587
|
+
--ni-private-switch-indicator-border-selected-color: ${La};
|
|
10588
|
+
--ni-private-switch-indicator-border-disabled-color: ${ol(Fa,.15)};
|
|
10589
|
+
|
|
10535
10590
|
}
|
|
10536
10591
|
`),Hm(qo,It`
|
|
10537
10592
|
:host {
|
|
10593
|
+
--ni-private-switch-background-color: ${ol($a,.1)};
|
|
10538
10594
|
--ni-private-switch-background-disabled-color: ${ol($a,.07)};
|
|
10539
|
-
--ni-private-switch-
|
|
10540
|
-
--ni-private-switch-
|
|
10541
|
-
--ni-private-switch-indicator-
|
|
10542
|
-
--ni-private-switch-indicator-
|
|
10595
|
+
--ni-private-switch-background-selected-color: ${ol(Ua,.6)};
|
|
10596
|
+
--ni-private-switch-background-selected-rollover-color: ${ol(Ua,.3)};
|
|
10597
|
+
--ni-private-switch-indicator-background-color: ${Ia};
|
|
10598
|
+
--ni-private-switch-indicator-background-disabled-color: ${ol($a,.1)};
|
|
10599
|
+
--ni-private-switch-indicator-background-active-color: ${ol(Ua,.3)};
|
|
10600
|
+
--ni-private-switch-indicator-border-color: ${ol($a,.3)};
|
|
10601
|
+
--ni-private-switch-indicator-border-selected-color: ${Ua};
|
|
10602
|
+
--ni-private-switch-indicator-border-disabled-color: ${ol($a,.15)};
|
|
10543
10603
|
}
|
|
10544
10604
|
`),Hm(jo,It`
|
|
10545
10605
|
:host {
|
|
10606
|
+
--ni-private-switch-background-color: ${ol(Aa,.1)};
|
|
10546
10607
|
--ni-private-switch-background-disabled-color: ${ol(Aa,.07)};
|
|
10547
|
-
--ni-private-switch-
|
|
10608
|
+
--ni-private-switch-background-selected-color: ${ol(Aa,.6)};
|
|
10609
|
+
--ni-private-switch-background-selected-rollover-color: ${ol(Aa,.3)};
|
|
10610
|
+
--ni-private-switch-indicator-background-color: ${ol(Aa,.3)};
|
|
10548
10611
|
--ni-private-switch-indicator-background-disabled-color: ${ol(Aa,.1)};
|
|
10549
|
-
--ni-private-switch-indicator-
|
|
10612
|
+
--ni-private-switch-indicator-background-active-color: ${ol(Aa,.3)};
|
|
10613
|
+
--ni-private-switch-indicator-border-color: ${ol(Aa,.3)};
|
|
10614
|
+
--ni-private-switch-indicator-border-selected-color: ${Aa} ;
|
|
10550
10615
|
--ni-private-switch-indicator-border-disabled-color: ${ol(Aa,.3)};
|
|
10551
10616
|
}
|
|
10552
10617
|
`)),JF=Q`
|
|
@@ -10562,7 +10627,7 @@ const XF=It`
|
|
|
10562
10627
|
>
|
|
10563
10628
|
<label
|
|
10564
10629
|
part="label"
|
|
10565
|
-
class="${t=>t.defaultSlottedNodes?.length?"label":"label label__hidden"}"
|
|
10630
|
+
class="${t=>t.defaultSlottedNodes?.length>0?"label":"label label__hidden"}"
|
|
10566
10631
|
>
|
|
10567
10632
|
<slot ${Qt("defaultSlottedNodes")}></slot>
|
|
10568
10633
|
</label>
|
|
@@ -11109,7 +11174,7 @@ try{e=document.createElement(t)}catch(t){}if(!(e instanceof ML))throw new Error(
|
|
|
11109
11174
|
class AL{constructor(t){this.uniqueId=yn("table-column-slot"),this.sortOperation=CL,this.dataRecordFieldNames=[],this.groupingDisabled=!0,this.fractionalWidth=1,this.minPixelWidth=117,this.resizingDisabled=!1,this.hideHeaderIndicators=!1,this.headerAlignment=uL,this.currentFractionalWidth=1,this.sortingDisabled=!0,this.currentSortDirection=aL.none,this.cellRecordFieldNames=t.cellRecordFieldNames,this.cellViewTemplate=EL(t.cellViewTag),t.groupHeaderViewTag&&(this.groupHeaderViewTemplate=_L(t.groupHeaderViewTag)),this.delegatedEvents=t.delegatedEvents,this.slotNames=t.slotNames??[],this.sortOperation=t.sortOperation??CL,this.validator=t.validator}fractionalWidthChanged(){this.currentFractionalWidth=this.fractionalWidth}pixelWidthChanged(){this.currentPixelWidth=this.pixelWidth}}function TL(t,...e){for(const n of e)if(t===n)return!0
|
|
11110
11175
|
return!1}t([C],AL.prototype,"columnConfig",void 0),t([C],AL.prototype,"operandDataRecordFieldName",void 0),t([C],AL.prototype,"sortOperation",void 0),t([C],AL.prototype,"dataRecordFieldNames",void 0),t([C],AL.prototype,"groupingDisabled",void 0),t([C],AL.prototype,"groupIndex",void 0),t([C],AL.prototype,"pixelWidth",void 0),t([C],AL.prototype,"fractionalWidth",void 0),t([C],AL.prototype,"minPixelWidth",void 0),t([C],AL.prototype,"resizingDisabled",void 0),t([C],AL.prototype,"hideHeaderIndicators",void 0),t([C],AL.prototype,"headerAlignment",void 0),t([C],AL.prototype,"currentFractionalWidth",void 0),t([C],AL.prototype,"currentPixelWidth",void 0),t([C],AL.prototype,"sortingDisabled",void 0),t([C],AL.prototype,"currentSortIndex",void 0),t([C],AL.prototype,"currentSortDirection",void 0)
|
|
11111
11176
|
class DL extends Ve{constructor(){super(...arguments),this.columnInternals=new AL(this.getColumnInternalsOptions()),this.columnHidden=!1,this.hasOverflow=!1}checkValidity(){return this.columnInternals.validator.isColumnValid}get validity(){return this.columnInternals.validator.getValidity()}get headerTextContent(){return Kv(this.contentSlot)}connectedCallback(){super.connectedCallback(),this.setAttribute("slot",this.columnInternals.uniqueId)}}t([ft({attribute:"column-id"})],DL.prototype,"columnId",void 0),t([ft({attribute:"action-menu-slot"})],DL.prototype,"actionMenuSlot",void 0),t([ft({attribute:"action-menu-label"})],DL.prototype,"actionMenuLabel",void 0),t([ft({attribute:"column-hidden",mode:"boolean"})],DL.prototype,"columnHidden",void 0),t([C],DL.prototype,"hasOverflow",void 0)
|
|
11112
|
-
class OL{constructor(){this.duplicateRecordId=!1,this.missingRecordId=!1,this.invalidRecordId=!1,this.duplicateColumnId=!1,this.missingColumnId=!1,this.duplicateSortIndex=!1,this.duplicateGroupIndex=!1,this.idFieldNameNotConfigured=!1,this.invalidColumnConfiguration=!1,this.invalidParentIdConfiguration=!1,this.recordIds=new Set}getValidity(){return{duplicateRecordId:this.duplicateRecordId,missingRecordId:this.missingRecordId,invalidRecordId:this.invalidRecordId,duplicateColumnId:this.duplicateColumnId,missingColumnId:this.missingColumnId,duplicateSortIndex:this.duplicateSortIndex,duplicateGroupIndex:this.duplicateGroupIndex,idFieldNameNotConfigured:this.idFieldNameNotConfigured,invalidColumnConfiguration:this.invalidColumnConfiguration,invalidParentIdConfiguration:this.invalidParentIdConfiguration}}isValid(){return Object.values(this.getValidity()).every((t=>!
|
|
11177
|
+
class OL{constructor(){this.duplicateRecordId=!1,this.missingRecordId=!1,this.invalidRecordId=!1,this.duplicateColumnId=!1,this.missingColumnId=!1,this.duplicateSortIndex=!1,this.duplicateGroupIndex=!1,this.idFieldNameNotConfigured=!1,this.invalidColumnConfiguration=!1,this.invalidParentIdConfiguration=!1,this.recordIds=new Set}getValidity(){return{duplicateRecordId:this.duplicateRecordId,missingRecordId:this.missingRecordId,invalidRecordId:this.invalidRecordId,duplicateColumnId:this.duplicateColumnId,missingColumnId:this.missingColumnId,duplicateSortIndex:this.duplicateSortIndex,duplicateGroupIndex:this.duplicateGroupIndex,idFieldNameNotConfigured:this.idFieldNameNotConfigured,invalidColumnConfiguration:this.invalidColumnConfiguration,invalidParentIdConfiguration:this.invalidParentIdConfiguration}}isValid(){return Object.values(this.getValidity()).every((t=>!t))}areRecordIdsValid(){const t=this.getValidity()
|
|
11113
11178
|
return!t.duplicateRecordId&&!t.missingRecordId&&!t.invalidRecordId}validateIdFieldConfiguration(t,e,n){const i=t!==lL.none||"string"==typeof n
|
|
11114
11179
|
return this.idFieldNameNotConfigured=!!i&&"string"!=typeof e,!this.idFieldNameNotConfigured}validateRecordIds(t,e){if(this.duplicateRecordId=!1,this.missingRecordId=!1,this.invalidRecordId=!1,this.recordIds.clear(),"string"!=typeof e)return!0
|
|
11115
11180
|
for(const n of t){if(!Object.prototype.hasOwnProperty.call(n,e)){this.missingRecordId=!0
|
|
@@ -12218,7 +12283,7 @@ class xB{constructor(t){this.table=t,this.isColumnBeingSized=!1,this.visibleColu
|
|
|
12218
12283
|
this.currentTotalDelta=this.getAllowedSizeDelta(t.clientX-this.dragStart),this.performCascadeSizeLeft(this.leftColumnIndex,this.currentTotalDelta),this.performCascadeSizeRight(this.rightColumnIndex,this.currentTotalDelta)
|
|
12219
12284
|
const e=this.getTotalColumnFixedWidth()-this.initialColumnTotalWidth
|
|
12220
12285
|
this.table.tableScrollableMinWidth=e>0?this.initialTableScrollableWidth+e:this.initialTableScrollableMinWidth},this.onDividerPointerUp=()=>{this.activeColumnDividerElement.removeEventListener("pointermove",this.onDividerPointerMove),this.activeColumnDividerElement.removeEventListener("pointerup",this.onDividerPointerUp),this.resetGridSizedColumns(),this.isColumnBeingSized=!1,this.activeColumnIndex=void 0,this.activeColumnDivider=void 0,this.activeColumnDividerElement=void 0,this.visibleColumns=[]}}getGridTemplateColumns(){return this.getVisibleColumns().map((t=>{const{minPixelWidth:e,currentPixelWidth:n,currentFractionalWidth:i}=t.columnInternals
|
|
12221
|
-
if(n){return`${Math.max(e,n)}px`}return`minmax(${e}px, ${i}fr)`})).join(" ")}beginColumnInteractiveSize(t,e,n,i){this.activeColumnDivider=i,this.activeColumnDividerElement=t,this.leftColumnIndex=this.getLeftColumnIndexFromDivider(this.activeColumnDivider),this.rightColumnIndex=this.leftColumnIndex+1,this.activeColumnIndex=this.leftColumnIndex+this.activeColumnDivider%2,this.dragStart=n,this.currentTotalDelta=0,this.visibleColumns=this.getVisibleColumns(),this.setColumnsToFixedSize(),this.initialTableScrollableWidth=this.table.viewport.scrollWidth,this.initialTableScrollableMinWidth=this.table.tableScrollableMinWidth,this.initialColumnTotalWidth=this.getTotalColumnFixedWidth(),this.isColumnBeingSized=!0,-1!==e&&t.setPointerCapture(e),t.addEventListener("pointermove",this.onDividerPointerMove),t.addEventListener("pointerup",this.onDividerPointerUp)}hasResizableColumnToLeft(t){return-1!==this.getFirstLeftResizableColumnIndex(t)}hasResizableColumnToRight(t){return-1!==this.getFirstRightResizableColumnIndex(t)}getTotalColumnFixedWidth(){let t=0
|
|
12286
|
+
if(void 0!==n){return`${Math.max(e,n)}px`}return`minmax(${e}px, ${i}fr)`})).join(" ")}beginColumnInteractiveSize(t,e,n,i){this.activeColumnDivider=i,this.activeColumnDividerElement=t,this.leftColumnIndex=this.getLeftColumnIndexFromDivider(this.activeColumnDivider),this.rightColumnIndex=this.leftColumnIndex+1,this.activeColumnIndex=this.leftColumnIndex+this.activeColumnDivider%2,this.dragStart=n,this.currentTotalDelta=0,this.visibleColumns=this.getVisibleColumns(),this.setColumnsToFixedSize(),this.initialTableScrollableWidth=this.table.viewport.scrollWidth,this.initialTableScrollableMinWidth=this.table.tableScrollableMinWidth,this.initialColumnTotalWidth=this.getTotalColumnFixedWidth(),this.isColumnBeingSized=!0,-1!==e&&t.setPointerCapture(e),t.addEventListener("pointermove",this.onDividerPointerMove),t.addEventListener("pointerup",this.onDividerPointerUp)}hasResizableColumnToLeft(t){return-1!==this.getFirstLeftResizableColumnIndex(t)}hasResizableColumnToRight(t){return-1!==this.getFirstRightResizableColumnIndex(t)}getTotalColumnFixedWidth(){let t=0
|
|
12222
12287
|
for(const e of this.visibleColumns)t+=e.columnInternals.currentPixelWidth??0
|
|
12223
12288
|
return t}setColumnsToFixedSize(){this.cacheGridSizedColumns()
|
|
12224
12289
|
const t=this.table.getHeaderContainerElements()
|
|
@@ -12262,7 +12327,7 @@ for(const t of n)delete i[t]
|
|
|
12262
12327
|
this.tanStackTable.setRowSelection(i)}getAllLeafRowIds(t){const e=this.tanStackTable.getRowModel().flatRows.find((e=>e.id===t))
|
|
12263
12328
|
return e?.getIsGrouped()?e.getLeafRows().filter((t=>!t.getIsGrouped())).map((t=>t.id)):[]}getAllOrderedRows(){const t=this.tanStackTable.getPreExpandedRowModel().rows
|
|
12264
12329
|
return this.getOrderedRows(t)}getOrderedRows(t){const e=[]
|
|
12265
|
-
for(const n of t)e.push(n),n.subRows?.length&&e.push(...this.getOrderedRows(n.subRows))
|
|
12330
|
+
for(const n of t)e.push(n),n.subRows?.length>0&&e.push(...this.getOrderedRows(n.subRows))
|
|
12266
12331
|
return e}}class MB extends _B{handleRowSelectionToggle(t,e,n){return!1}handleRowClick(t,e,n){return!1}handleActionMenuOpening(t){return!1}}class IB extends _B{handleRowSelectionToggle(t,e,n){return n&&this.tryUpdateRangeSelection(t.id,!0)||(this.shiftSelectStartRowId=e?t.id:void 0,this.previousShiftSelectRowEndId=void 0,this.toggleIsRowSelected(t,e)),!0}handleRowClick(t,e,n){if(e){const e=n
|
|
12267
12332
|
if(this.tryUpdateRangeSelection(t.id,e))return!0}if(n){const e=t.selectionState!==dL
|
|
12268
12333
|
return this.shiftSelectStartRowId=e?t.id:void 0,this.previousShiftSelectRowEndId=void 0,this.toggleIsRowSelected(t),!0}return this.shiftSelectStartRowId=t.id,this.previousShiftSelectRowEndId=void 0,this.selectSingleRow(t)}handleActionMenuOpening(t){return!this.actionMenusPreserveSelection&&(t.selectionState!==dL&&this.selectSingleRow(t))}reset(){this.shiftSelectStartRowId=void 0,this.previousShiftSelectRowEndId=void 0}tryUpdateRangeSelection(t,e){if(void 0===this.shiftSelectStartRowId)return!1
|
|
@@ -12283,11 +12348,11 @@ case lL.single:return new $B(this.tanStackTable,e)
|
|
|
12283
12348
|
case lL.none:return new MB(this.tanStackTable,e)
|
|
12284
12349
|
default:throw new Error("unknown selection mode found")}}}function AB(t,e){const n=e,i=[],o={},s=new Set
|
|
12285
12350
|
for(let e=0;e<t.length;e++){const r=t[e],a=r[n.id],l=r[n.parentId]
|
|
12286
|
-
Object.prototype.hasOwnProperty.call(o,a)||(o[a]={subRows:[],clientRecord:void 0,originalIndex:void 0}),s
|
|
12351
|
+
Object.prototype.hasOwnProperty.call(o,a)||(o[a]={subRows:[],clientRecord:void 0,originalIndex:void 0}),s.delete(a),o[a].clientRecord=r
|
|
12287
12352
|
const c=o[a]
|
|
12288
|
-
c.originalIndex=e,null==l?i.push(c):(Object.prototype.hasOwnProperty.call(o,l)||(o[l]={subRows:[],clientRecord:void 0,originalIndex:void 0},s
|
|
12353
|
+
c.originalIndex=e,null==l?i.push(c):(Object.prototype.hasOwnProperty.call(o,l)||(o[l]={subRows:[],clientRecord:void 0,originalIndex:void 0},s.add(l)),o[l].subRows.push(c))}if(s.size>0){const t=Array.from(s.values()).join(",")
|
|
12289
12354
|
throw new Error(`The items array contains orphans that point to the following parentIds: [${t}]. These parentIds do not exist in the items array.`)}if(TB(i)<Object.keys(o).length)throw new Error("The items array contains nodes with a circular parent/child relationship.")
|
|
12290
|
-
return i}function TB(t){return t.reduce(((t,e)=>t+1+(e.subRows
|
|
12355
|
+
return i}function TB(t){return t.reduce(((t,e)=>t+1+(e.subRows?TB(e.subRows):0)),0)}class DB{constructor(t,e,n){if(this.isDataFlat=!1,"string"==typeof e&&"string"==typeof n)try{this._hierarchicalData=AB(t,{id:e,parentId:n}),this.isDataFlat=!1,this._parentIdConfigurationValid=!0}catch{this.isDataFlat=!0,this._hierarchicalData=t.map(((t,e)=>({clientRecord:t,originalIndex:e}))),this._parentIdConfigurationValid=!1}else this.isDataFlat=!0,this._hierarchicalData=t.map(((t,e)=>({clientRecord:t,originalIndex:e}))),this._parentIdConfigurationValid=!0}get hierarchicalData(){return this._hierarchicalData}get parentIdConfigurationValid(){return this._parentIdConfigurationValid}getAllRecords(t=!1){const e=[]
|
|
12291
12356
|
return this.getAllNodes(this._hierarchicalData,e),this.isDataFlat||!t?e.map((t=>t.clientRecord)):e.sort(((t,e)=>t.originalIndex-e.originalIndex)).map((t=>t.clientRecord))}getAllNodes(t,e){for(const n of t)e.push(n),n.subRows&&this.getAllNodes(n.subRows,e)}}class OB{constructor(t){this.tanStackTable=t,this.explicitExpansionStates=new Map,this.hierarchyOptions=new Map,this.isHierarchyEnabled=!1,this.parentRowsWithChildren=new Set}isRowExpanded(t){if(!this.isRowExpandable(t))return!1
|
|
12292
12357
|
return this.explicitExpansionStates.get(t.id)??this.getDefaultExpansionState(t)}toggleRowExpansion(t){if(!this.isRowExpandable(t))return
|
|
12293
12358
|
const e=this.isRowExpanded(t)
|
|
@@ -12514,7 +12579,7 @@ return n?dL:cL}getGroupRowColumn(t){const e=t.groupingColumnId
|
|
|
12514
12579
|
if(void 0!==e)return this.columns.find((t=>t.columnInternals.uniqueId===e))}updateTableOptions(t){if(this.options={...this.options,...t,state:{...this.options.state,...t.state}},this.table.setOptions(this.options),t.data&&this.tableValidator.areRecordIdsValid()){const t=this.table.getRowModel().flatRows
|
|
12515
12580
|
this.expansionManager.processDataUpdate(t)}this.refreshRows()}toggleRowExpanded(t){const e=this.table.getRowModel().rows[t]
|
|
12516
12581
|
this.expansionManager.toggleRowExpansion(e)}calculateTanStackSortState(){const t=this.getColumnsParticipatingInSorting().sort(((t,e)=>t.columnInternals.currentSortIndex-e.columnInternals.currentSortIndex))
|
|
12517
|
-
return this.firstSortedColumn=t.length?t[0]:void 0,t.map((t=>({id:t.columnInternals.uniqueId,desc:t.columnInternals.currentSortDirection===aL.descending})))}calculateTanStackGroupingState(){return this.getColumnsParticipatingInGrouping().sort(((t,e)=>t.columnInternals.groupIndex-e.columnInternals.groupIndex)).map((t=>t.columnInternals.uniqueId))}calculateTanStackRowIdFunction(){return null===this.idFieldName||void 0===this.idFieldName?void 0:t=>t.clientRecord[this.idFieldName]}calculateTanStackColumns(){return this.columns.map((t=>({id:t.columnInternals.uniqueId,accessorFn:e=>{const n=t.columnInternals.operandDataRecordFieldName
|
|
12582
|
+
return this.firstSortedColumn=t.length>0?t[0]:void 0,t.map((t=>({id:t.columnInternals.uniqueId,desc:t.columnInternals.currentSortDirection===aL.descending})))}calculateTanStackGroupingState(){return this.getColumnsParticipatingInGrouping().sort(((t,e)=>t.columnInternals.groupIndex-e.columnInternals.groupIndex)).map((t=>t.columnInternals.uniqueId))}calculateTanStackRowIdFunction(){return null===this.idFieldName||void 0===this.idFieldName?void 0:t=>t.clientRecord[this.idFieldName]}calculateTanStackColumns(){return this.columns.map((t=>({id:t.columnInternals.uniqueId,accessorFn:e=>{const n=t.columnInternals.operandDataRecordFieldName
|
|
12518
12583
|
if("string"==typeof n)return e.clientRecord[n]},sortingFn:bB(t.columnInternals.sortOperation),sortUndefined:!1})))}calculateTanStackSelectionState(t){if(this.selectionMode===lL.none)return{}
|
|
12519
12584
|
const e={},n=this.tableValidator.getPresentRecordIds(t)
|
|
12520
12585
|
for(const t of n)if(e[t]=!0,this.selectionMode===lL.single)break
|
|
@@ -12695,9 +12760,9 @@ const l=Math.floor(r)
|
|
|
12695
12760
|
if(l<=999&&l>0){const t=this.daysFormatter.format(l)
|
|
12696
12761
|
e.push(t),a-=l*s}else if(l>999)return this.scientificSecondsFormatter.format(t/n)
|
|
12697
12762
|
const c=Math.floor(t/o%24)
|
|
12698
|
-
if(a-=c*o,c){const t=this.hoursFormatter.format(c)
|
|
12763
|
+
if(a-=c*o,0!==c){const t=this.hoursFormatter.format(c)
|
|
12699
12764
|
e.push(t)}const d=Math.floor(t/i%60)
|
|
12700
|
-
if(a-=d*i,d){const t=this.minutesFormatter.format(d)
|
|
12765
|
+
if(a-=d*i,0!==d){const t=this.minutesFormatter.format(d)
|
|
12701
12766
|
e.push(t)}const h=a/n,u=0===h?0:h%60
|
|
12702
12767
|
if(t<1&&0!==h)return this.scientificSecondsFormatter.format(h)
|
|
12703
12768
|
if(u>=5e-4||0===u&&0===e.length){const t=this.secondsFormatter.format(u)
|
|
@@ -13191,7 +13256,7 @@ const Fz="outline",Nz="block",Lz=It`
|
|
|
13191
13256
|
<label
|
|
13192
13257
|
part="label"
|
|
13193
13258
|
for="control"
|
|
13194
|
-
class="${t=>t.defaultSlottedNodes?.length?"label":"label label__hidden"}"
|
|
13259
|
+
class="${t=>t.defaultSlottedNodes?.length>0?"label":"label label__hidden"}"
|
|
13195
13260
|
>
|
|
13196
13261
|
<slot ${Qt("defaultSlottedNodes")}></slot>
|
|
13197
13262
|
</label>
|
|
@@ -13510,7 +13575,7 @@ const Vz="underline",Hz="outline",Uz="block",qz="frameless",jz=It`
|
|
|
13510
13575
|
`)),Wz=Og(Q`<label
|
|
13511
13576
|
part="label"
|
|
13512
13577
|
for="control"
|
|
13513
|
-
class="${t=>t.defaultSlottedNodes?.length?"label":"label label__hidden"}"
|
|
13578
|
+
class="${t=>t.defaultSlottedNodes?.length>0?"label":"label label__hidden"}"
|
|
13514
13579
|
>
|
|
13515
13580
|
<slot
|
|
13516
13581
|
${Qt({property:"defaultSlottedNodes",filter:function(t,e,n){return t.nodeType!==Node.TEXT_NODE||"string"==typeof t.nodeValue&&!!t.nodeValue.trim().length}})}
|
|
@@ -15554,12 +15619,12 @@ return`translate(${n[0]}, ${n[1]})`}return""}renderDies(){const t=this.wafermap.
|
|
|
15554
15619
|
i[0]-=e,i[1]-=n
|
|
15555
15620
|
for(const s of this.dies)this.isDieVisible(s,i,o)&&(t.fillStyle=s.fillStyle,t.fillRect(s.x,s.y,e,n))}renderText(){if(this.wafermap.dieLabelsHidden)return
|
|
15556
15621
|
const t=this.wafermap.dataManager.dieDimensions.width,e=this.wafermap.dataManager.dieDimensions.height
|
|
15557
|
-
if(t*e*(this.wafermap.transform.k
|
|
15622
|
+
if(t*e*(0!==this.wafermap.transform.k?this.wafermap.transform.k:1)>=this.minDieDim){const n=this.wafermap.dataManager.labelsFontSize,i=this.wafermap.canvasContext
|
|
15558
15623
|
i.font=`${n.toString()}px sans-serif`,i.fillStyle="#ffffff",i.textAlign="center",i.lineCap="butt"
|
|
15559
15624
|
const o=i.measureText("M"),s=this.wafermap.transform.invert([0,0]),r=this.wafermap.transform.invert([this.wafermap.canvas.width,this.wafermap.canvas.height])
|
|
15560
15625
|
s[0]-=t,s[1]-=e
|
|
15561
15626
|
for(const n of this.dies)this.isDieVisible(n,s,r)&&i.fillText(n.text,n.x+t/2,n.y+e/2+o.width/2,t-t/100*20)}}clearCanvas(){this.wafermap.canvasContext.clearRect(0,0,this.wafermap.canvas.width,this.wafermap.canvas.height)}scaleCanvas(){this.wafermap.canvasContext.translate(this.wafermap.transform.x,this.wafermap.transform.y),this.wafermap.canvasContext.scale(this.wafermap.transform.k,this.wafermap.transform.k)}isDieVisible(t,e,n){return t.x>=e[0]&&t.x<n[0]&&t.y>=e[1]&&t.y<n[1]}}const KJ=["highlightedTags","canvasWidth","canvasHeight","originLocation","gridMinX","gridMaxX","gridMinY","gridMaxY","dies","maxCharacters","colorScale","colorScaleMode","dieLabelsHidden","dieLabelsSuffix","transform","hoverDie"]
|
|
15562
|
-
class YJ extends LT{constructor(t){super(KJ),this.wafermap=t,this.updateQueued=!1}get requiresEventsUpdate(){return this.isTracked("canvasWidth")||this.isTracked("canvasHeight")||this.isTracked("originLocation")||this.isTracked("gridMinX")||this.isTracked("gridMaxX")||this.isTracked("gridMinY")||this.isTracked("gridMaxY")||this.isTracked("dies")||this.isTracked("maxCharacters")||this.isTracked("highlightedTags")||this.isTracked("colorScale")||this.isTracked("colorScaleMode")||this.isTracked("dieLabelsHidden")||this.isTracked("dieLabelsSuffix")||this.isTracked("transform")}get requiresWorkerWaferSetup(){return this.isTracked("canvasWidth")||this.isTracked("canvasHeight")||this.isTracked("originLocation")||this.isTracked("gridMinX")||this.isTracked("gridMaxX")||this.isTracked("gridMinY")||this.isTracked("gridMaxY")||this.isTracked("dies")||this.isTracked("maxCharacters")||this.isTracked("highlightedTags")||this.isTracked("colorScale")||this.isTracked("colorScaleMode")||this.isTracked("dieLabelsHidden")||this.isTracked("dieLabelsSuffix")}get requiresContainerDimensionsUpdate(){return this.isTracked("canvasWidth")||this.isTracked("canvasHeight")}get requiresComponentResizeUpdate(){return this.isTracked("canvasWidth")||this.isTracked("canvasHeight")}get requiresScalesUpdate(){return this.isTracked("originLocation")||this.isTracked("gridMinX")||this.isTracked("gridMaxX")||this.isTracked("gridMinY")||this.isTracked("gridMaxY")||this.isTracked("dies")}get requiresInputDataUpdate(){return this.isTracked("originLocation")||this.isTracked("gridMinX")||this.isTracked("gridMaxX")||this.isTracked("gridMinY")||this.isTracked("gridMaxY")||this.isTracked("dies")}get requiresLabelsFontSizeUpdate(){return this.isTracked("maxCharacters")}get requiresDiesRenderInfoUpdate(){return this.isTracked("highlightedTags")||this.isTracked("colorScale")||this.isTracked("colorScaleMode")||this.isTracked("dieLabelsHidden")||this.isTracked("dieLabelsSuffix")}get requiresColorAndTextUpdate(){return this.isTracked("maxCharacters")||this.isTracked("highlightedTags")||this.isTracked("colorScale")||this.isTracked("colorScaleMode")||this.isTracked("dieLabelsHidden")||this.isTracked("dieLabelsSuffix")}get requiresDrawnWaferUpdate(){return this.isTracked("transform")}get requiresRenderHoverUpdate(){return this.isTracked("hoverDie")}queueUpdate(){this.wafermap.$fastController.isConnected&&!this.updateQueued&&(this.updateQueued=!0,void 0===this.wafermap.currentTask?b.queueUpdate((()=>{this.wafermap.update(),this.untrackAll(),this.updateQueued=!1})):(async()=>{await this.wafermap.currentTask,b.queueUpdate((()=>{this.wafermap.update(),this.untrackAll(),this.updateQueued=!1,this.wafermap.currentTask=void 0}))})())}}class XJ{constructor(t){this.wafermap=t,this.invalidGridDimensions=!1,this.invalidDiesTableSchema=!1}getValidity(){return{invalidGridDimensions:this.invalidGridDimensions,invalidDiesTableSchema:this.invalidDiesTableSchema}}isValid(){return Object.values(this.getValidity()).every((t=>!
|
|
15627
|
+
class YJ extends LT{constructor(t){super(KJ),this.wafermap=t,this.updateQueued=!1}get requiresEventsUpdate(){return this.isTracked("canvasWidth")||this.isTracked("canvasHeight")||this.isTracked("originLocation")||this.isTracked("gridMinX")||this.isTracked("gridMaxX")||this.isTracked("gridMinY")||this.isTracked("gridMaxY")||this.isTracked("dies")||this.isTracked("maxCharacters")||this.isTracked("highlightedTags")||this.isTracked("colorScale")||this.isTracked("colorScaleMode")||this.isTracked("dieLabelsHidden")||this.isTracked("dieLabelsSuffix")||this.isTracked("transform")}get requiresWorkerWaferSetup(){return this.isTracked("canvasWidth")||this.isTracked("canvasHeight")||this.isTracked("originLocation")||this.isTracked("gridMinX")||this.isTracked("gridMaxX")||this.isTracked("gridMinY")||this.isTracked("gridMaxY")||this.isTracked("dies")||this.isTracked("maxCharacters")||this.isTracked("highlightedTags")||this.isTracked("colorScale")||this.isTracked("colorScaleMode")||this.isTracked("dieLabelsHidden")||this.isTracked("dieLabelsSuffix")}get requiresContainerDimensionsUpdate(){return this.isTracked("canvasWidth")||this.isTracked("canvasHeight")}get requiresComponentResizeUpdate(){return this.isTracked("canvasWidth")||this.isTracked("canvasHeight")}get requiresScalesUpdate(){return this.isTracked("originLocation")||this.isTracked("gridMinX")||this.isTracked("gridMaxX")||this.isTracked("gridMinY")||this.isTracked("gridMaxY")||this.isTracked("dies")}get requiresInputDataUpdate(){return this.isTracked("originLocation")||this.isTracked("gridMinX")||this.isTracked("gridMaxX")||this.isTracked("gridMinY")||this.isTracked("gridMaxY")||this.isTracked("dies")}get requiresLabelsFontSizeUpdate(){return this.isTracked("maxCharacters")}get requiresDiesRenderInfoUpdate(){return this.isTracked("highlightedTags")||this.isTracked("colorScale")||this.isTracked("colorScaleMode")||this.isTracked("dieLabelsHidden")||this.isTracked("dieLabelsSuffix")}get requiresColorAndTextUpdate(){return this.isTracked("maxCharacters")||this.isTracked("highlightedTags")||this.isTracked("colorScale")||this.isTracked("colorScaleMode")||this.isTracked("dieLabelsHidden")||this.isTracked("dieLabelsSuffix")}get requiresDrawnWaferUpdate(){return this.isTracked("transform")}get requiresRenderHoverUpdate(){return this.isTracked("hoverDie")}queueUpdate(){this.wafermap.$fastController.isConnected&&!this.updateQueued&&(this.updateQueued=!0,void 0===this.wafermap.currentTask?b.queueUpdate((()=>{this.wafermap.update(),this.untrackAll(),this.updateQueued=!1})):(async()=>{await this.wafermap.currentTask,b.queueUpdate((()=>{this.wafermap.update(),this.untrackAll(),this.updateQueued=!1,this.wafermap.currentTask=void 0}))})())}}class XJ{constructor(t){this.wafermap=t,this.invalidGridDimensions=!1,this.invalidDiesTableSchema=!1}getValidity(){return{invalidGridDimensions:this.invalidGridDimensions,invalidDiesTableSchema:this.invalidDiesTableSchema}}isValid(){return Object.values(this.getValidity()).every((t=>!t))}validateGridDimensions(){return this.invalidGridDimensions=!1,void 0===this.wafermap.gridMinX&&void 0===this.wafermap.gridMaxX&&void 0===this.wafermap.gridMinY&&void 0===this.wafermap.gridMaxY?this.invalidGridDimensions=!1:("number"!=typeof this.wafermap.gridMinX||"number"!=typeof this.wafermap.gridMaxX||"number"!=typeof this.wafermap.gridMinY||"number"!=typeof this.wafermap.gridMaxY||this.wafermap.gridMaxX<this.wafermap.gridMinX||this.wafermap.gridMaxY<this.wafermap.gridMinY)&&(this.invalidGridDimensions=!0),!this.invalidGridDimensions}validateDiesTableSchema(){if(this.invalidDiesTableSchema=!1,void 0===this.wafermap.diesTable)this.invalidDiesTableSchema=!1
|
|
15563
15628
|
else{const t=this.wafermap.diesTable.schema.fields,e=t.find((t=>"colIndex"===t.name)),n=t.find((t=>"rowIndex"===t.name)),i=t.find((t=>"value"===t.name))
|
|
15564
15629
|
e&&n&&i&&pG.isInt(e.type)&&32===e.type.bitWidth&&pG.isInt(n.type)&&32===n.type.bitWidth&&pG.isFloat(i.type)&&i.type.precision===Lj.DOUBLE||(this.invalidDiesTableSchema=!0)}return!this.invalidDiesTableSchema}}
|
|
15565
15630
|
/**
|
|
@@ -15618,13 +15683,13 @@ function mQ(t,e){return fQ.set(t,e),t}function gQ(t){for(const[e,n]of oQ)if(n.ca
|
|
|
15618
15683
|
return[{type:"HANDLER",name:e,value:i},o]}return[{type:"RAW",value:t},fQ.get(t)||[]]}function vQ(t){switch(t.type){case"HANDLER":return oQ.get(t.name).deserialize(t.value)
|
|
15619
15684
|
case"RAW":return t.value}}function bQ(t,e,n,i){return new Promise((o=>{const s=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-")
|
|
15620
15685
|
e.set(s,o),t.start&&t.start(),t.postMessage(Object.assign({id:s},n),i)}))}let yQ
|
|
15621
|
-
class wQ{constructor(t){this.wafermap=t,this.minDieDim=100}async setupWafer(t){if(void 0===this.matrixRenderer){const{matrixRenderer:t}=await(async()=>{if(void 0===yQ){const t=new Blob(['var MatrixRenderer = (function (exports) {\n \'use strict\';\n\n /**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n const proxyMarker = Symbol("Comlink.proxy");\n const createEndpoint = Symbol("Comlink.endpoint");\n const releaseProxy = Symbol("Comlink.releaseProxy");\n const finalizer = Symbol("Comlink.finalizer");\n const throwMarker = Symbol("Comlink.thrown");\n const isObject = (val) => (typeof val === "object" && val !== null) || typeof val === "function";\n /**\n * Internal transfer handle to handle objects marked to proxy.\n */\n const proxyTransferHandler = {\n canHandle: (val) => isObject(val) && val[proxyMarker],\n serialize(obj) {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port1);\n return [port2, [port2]];\n },\n deserialize(port) {\n port.start();\n return wrap(port);\n },\n };\n /**\n * Internal transfer handler to handle thrown exceptions.\n */\n const throwTransferHandler = {\n canHandle: (value) => isObject(value) && throwMarker in value,\n serialize({ value }) {\n let serialized;\n if (value instanceof Error) {\n serialized = {\n isError: true,\n value: {\n message: value.message,\n name: value.name,\n stack: value.stack,\n },\n };\n }\n else {\n serialized = { isError: false, value };\n }\n return [serialized, []];\n },\n deserialize(serialized) {\n if (serialized.isError) {\n throw Object.assign(new Error(serialized.value.message), serialized.value);\n }\n throw serialized.value;\n },\n };\n /**\n * Allows customizing the serialization of certain values.\n */\n const transferHandlers = new Map([\n ["proxy", proxyTransferHandler],\n ["throw", throwTransferHandler],\n ]);\n function isAllowedOrigin(allowedOrigins, origin) {\n for (const allowedOrigin of allowedOrigins) {\n if (origin === allowedOrigin || allowedOrigin === "*") {\n return true;\n }\n if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {\n return true;\n }\n }\n return false;\n }\n function expose(obj, ep = globalThis, allowedOrigins = ["*"]) {\n ep.addEventListener("message", function callback(ev) {\n if (!ev || !ev.data) {\n return;\n }\n if (!isAllowedOrigin(allowedOrigins, ev.origin)) {\n console.warn(`Invalid origin \'${ev.origin}\' for comlink proxy`);\n return;\n }\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\n let returnValue;\n try {\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\n switch (type) {\n case "GET" /* MessageType.GET */:\n {\n returnValue = rawValue;\n }\n break;\n case "SET" /* MessageType.SET */:\n {\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\n returnValue = true;\n }\n break;\n case "APPLY" /* MessageType.APPLY */:\n {\n returnValue = rawValue.apply(parent, argumentList);\n }\n break;\n case "CONSTRUCT" /* MessageType.CONSTRUCT */:\n {\n const value = new rawValue(...argumentList);\n returnValue = proxy(value);\n }\n break;\n case "ENDPOINT" /* MessageType.ENDPOINT */:\n {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port2);\n returnValue = transfer(port1, [port1]);\n }\n break;\n case "RELEASE" /* MessageType.RELEASE */:\n {\n returnValue = undefined;\n }\n break;\n default:\n return;\n }\n }\n catch (value) {\n returnValue = { value, [throwMarker]: 0 };\n }\n Promise.resolve(returnValue)\n .catch((value) => {\n return { value, [throwMarker]: 0 };\n })\n .then((returnValue) => {\n const [wireValue, transferables] = toWireValue(returnValue);\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n if (type === "RELEASE" /* MessageType.RELEASE */) {\n // detach and deactive after sending release response above.\n ep.removeEventListener("message", callback);\n closeEndPoint(ep);\n if (finalizer in obj && typeof obj[finalizer] === "function") {\n obj[finalizer]();\n }\n }\n })\n .catch((error) => {\n // Send Serialization Error To Caller\n const [wireValue, transferables] = toWireValue({\n value: new TypeError("Unserializable return value"),\n [throwMarker]: 0,\n });\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n });\n });\n if (ep.start) {\n ep.start();\n }\n }\n function isMessagePort(endpoint) {\n return endpoint.constructor.name === "MessagePort";\n }\n function closeEndPoint(endpoint) {\n if (isMessagePort(endpoint))\n endpoint.close();\n }\n function wrap(ep, target) {\n const pendingListeners = new Map();\n ep.addEventListener("message", function handleMessage(ev) {\n const { data } = ev;\n if (!data || !data.id) {\n return;\n }\n const resolver = pendingListeners.get(data.id);\n if (!resolver) {\n return;\n }\n try {\n resolver(data);\n }\n finally {\n pendingListeners.delete(data.id);\n }\n });\n return createProxy(ep, pendingListeners, [], target);\n }\n function throwIfProxyReleased(isReleased) {\n if (isReleased) {\n throw new Error("Proxy has been released and is not useable");\n }\n }\n function releaseEndpoint(ep) {\n return requestResponseMessage(ep, new Map(), {\n type: "RELEASE" /* MessageType.RELEASE */,\n }).then(() => {\n closeEndPoint(ep);\n });\n }\n const proxyCounter = new WeakMap();\n const proxyFinalizers = "FinalizationRegistry" in globalThis &&\n new FinalizationRegistry((ep) => {\n const newCount = (proxyCounter.get(ep) || 0) - 1;\n proxyCounter.set(ep, newCount);\n if (newCount === 0) {\n releaseEndpoint(ep);\n }\n });\n function registerProxy(proxy, ep) {\n const newCount = (proxyCounter.get(ep) || 0) + 1;\n proxyCounter.set(ep, newCount);\n if (proxyFinalizers) {\n proxyFinalizers.register(proxy, ep, proxy);\n }\n }\n function unregisterProxy(proxy) {\n if (proxyFinalizers) {\n proxyFinalizers.unregister(proxy);\n }\n }\n function createProxy(ep, pendingListeners, path = [], target = function () { }) {\n let isProxyReleased = false;\n const proxy = new Proxy(target, {\n get(_target, prop) {\n throwIfProxyReleased(isProxyReleased);\n if (prop === releaseProxy) {\n return () => {\n unregisterProxy(proxy);\n releaseEndpoint(ep);\n pendingListeners.clear();\n isProxyReleased = true;\n };\n }\n if (prop === "then") {\n if (path.length === 0) {\n return { then: () => proxy };\n }\n const r = requestResponseMessage(ep, pendingListeners, {\n type: "GET" /* MessageType.GET */,\n path: path.map((p) => p.toString()),\n }).then(fromWireValue);\n return r.then.bind(r);\n }\n return createProxy(ep, pendingListeners, [...path, prop]);\n },\n set(_target, prop, rawValue) {\n throwIfProxyReleased(isProxyReleased);\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\n const [value, transferables] = toWireValue(rawValue);\n return requestResponseMessage(ep, pendingListeners, {\n type: "SET" /* MessageType.SET */,\n path: [...path, prop].map((p) => p.toString()),\n value,\n }, transferables).then(fromWireValue);\n },\n apply(_target, _thisArg, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const last = path[path.length - 1];\n if (last === createEndpoint) {\n return requestResponseMessage(ep, pendingListeners, {\n type: "ENDPOINT" /* MessageType.ENDPOINT */,\n }).then(fromWireValue);\n }\n // We just pretend that `bind()` didn’t happen.\n if (last === "bind") {\n return createProxy(ep, pendingListeners, path.slice(0, -1));\n }\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: "APPLY" /* MessageType.APPLY */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n construct(_target, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: "CONSTRUCT" /* MessageType.CONSTRUCT */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n });\n registerProxy(proxy, ep);\n return proxy;\n }\n function myFlat(arr) {\n return Array.prototype.concat.apply([], arr);\n }\n function processArguments(argumentList) {\n const processed = argumentList.map(toWireValue);\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\n }\n const transferCache = new WeakMap();\n function transfer(obj, transfers) {\n transferCache.set(obj, transfers);\n return obj;\n }\n function proxy(obj) {\n return Object.assign(obj, { [proxyMarker]: true });\n }\n function toWireValue(value) {\n for (const [name, handler] of transferHandlers) {\n if (handler.canHandle(value)) {\n const [serializedValue, transferables] = handler.serialize(value);\n return [\n {\n type: "HANDLER" /* WireValueType.HANDLER */,\n name,\n value: serializedValue,\n },\n transferables,\n ];\n }\n }\n return [\n {\n type: "RAW" /* WireValueType.RAW */,\n value,\n },\n transferCache.get(value) || [],\n ];\n }\n function fromWireValue(value) {\n switch (value.type) {\n case "HANDLER" /* WireValueType.HANDLER */:\n return transferHandlers.get(value.name).deserialize(value.value);\n case "RAW" /* WireValueType.RAW */:\n return value.value;\n }\n }\n function requestResponseMessage(ep, pendingListeners, msg, transfers) {\n return new Promise((resolve) => {\n const id = generateUUID();\n pendingListeners.set(id, resolve);\n if (ep.start) {\n ep.start();\n }\n ep.postMessage(Object.assign({ id }, msg), transfers);\n });\n }\n function generateUUID() {\n return new Array(4)\n .fill(0)\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\n .join("-");\n }\n\n /**\n * MatrixRenderer class is meant to be used within a Web Worker context,\n * using Comlink to facilitate communication between the main thread and the worker.\n * The MatrixRenderer class manages a matrix of dies, once an instance of MatrixRenderer is created,\n * it is exposed to the main thread using Comlink\'s `expose` method.\n * This setup is used in the wafer-map component to perform heavy computational duties\n */\n class MatrixRenderer {\n constructor() {\n this.values = Float64Array.from([]);\n this.scaledColumnIndices = Float64Array.from([]);\n this.scaledRowIndices = Float64Array.from([]);\n this.columnIndicesPositions = Int32Array.from([]);\n this.colorIndices = Int32Array.from([]);\n this.colors = [];\n this.colorValues = Float64Array.from([]);\n this.outsideRangeDieColor = \'rgba(218,223,236,1)\';\n this.fontSizeFactor = 0.8;\n this.renderConfig = {\n dieDimensions: {\n width: 0,\n height: 0\n },\n margin: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n },\n verticalCoefficient: 1,\n horizontalCoefficient: 1,\n horizontalConstant: 0,\n verticalConstant: 0,\n gridMinX: 0,\n gridMaxX: 0,\n gridMinY: 0,\n gridMaxY: 0,\n labelsFontSize: 0,\n colorScale: [],\n dieLabelsSuffix: \'\',\n maxCharacters: 0\n };\n this.transformConfig = {\n transform: {\n k: 1,\n x: 0,\n y: 0\n },\n topLeftCanvasCorner: {\n x: 0,\n y: 0\n },\n bottomRightCanvasCorner: {\n x: 0,\n y: 0\n }\n };\n }\n setMatrixData(columnIndices, rowIndices, valuesBuffer) {\n const scaledColumnIndex = [];\n const columnPositions = [];\n const scaledRowIndices = [];\n const values = [];\n const colorIndices = [];\n let prevXIndex;\n let dieCount = 0;\n for (let i = 0; i < columnIndices.length; i++) {\n const xIndex = columnIndices[i];\n const yIndex = rowIndices[i];\n if (this.isDieInGrid(xIndex, yIndex)) {\n if (xIndex !== prevXIndex) {\n scaledColumnIndex.push(this.calculateHorizontalScaledIndices(xIndex));\n columnPositions.push(dieCount);\n prevXIndex = xIndex;\n }\n scaledRowIndices.push(this.calculateVerticalScaledIndices(yIndex));\n const value = valuesBuffer[i];\n values.push(value);\n colorIndices.push(this.findColorIndex(value));\n dieCount += 1;\n }\n }\n this.scaledColumnIndices = Float64Array.from(scaledColumnIndex);\n this.columnIndicesPositions = Int32Array.from(columnPositions);\n this.scaledRowIndices = Float64Array.from(scaledRowIndices);\n this.values = Float64Array.from(values);\n this.colorIndices = Int32Array.from(colorIndices);\n }\n setRenderConfig(renderConfig) {\n this.renderConfig = renderConfig;\n this.colors = renderConfig.colorScale.map(marker => marker.color);\n this.colorValues = Float64Array.from(renderConfig.colorScale.map(marker => marker.value));\n }\n setTransformConfig(transformData) {\n this.transformConfig = transformData;\n }\n setCanvas(canvas) {\n this.canvas = canvas;\n this.context = canvas.getContext(\'2d\');\n }\n scaleCanvas() {\n this.context.translate(this.transformConfig.transform.x, this.transformConfig.transform.y);\n this.context.scale(this.transformConfig.transform.k, this.transformConfig.transform.k);\n }\n setCanvasDimensions(data) {\n this.canvas.width = data.width;\n this.canvas.height = data.height;\n }\n getCanvasDimensions() {\n return {\n width: this.canvas.width,\n height: this.canvas.height\n };\n }\n clearCanvas() {\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }\n drawWafer() {\n this.context.restore();\n this.context.save();\n this.clearCanvas();\n this.scaleCanvas();\n for (let i = 0; i < this.scaledColumnIndices.length; i++) {\n const scaledX = this.scaledColumnIndices[i];\n if (!(scaledX >= this.transformConfig.topLeftCanvasCorner.x\n && scaledX < this.transformConfig.bottomRightCanvasCorner.x)) {\n continue;\n }\n // columnIndexPositions is used to get chunks to determine the start and end index of the column, it looks something like [0, 1, 4, 9, 12]\n // This means that the first column has a start index of 0 and an end index of 1, the second column has a start index of 1 and an end index of 4, and so on\n // scaledRowIndices is used when we reach the end of the columnIndexPositions, when columnIndexPositions is [0, 1, 4, 9, 12], scaledRowIndices is 13\n const columnEndIndex = this.columnIndicesPositions[i + 1] !== undefined\n ? this.columnIndicesPositions[i + 1]\n : this.scaledRowIndices.length;\n for (let columnStartIndex = this.columnIndicesPositions[i]; columnStartIndex < columnEndIndex; columnStartIndex++) {\n const scaledY = this.scaledRowIndices[columnStartIndex];\n if (!(scaledY >= this.transformConfig.topLeftCanvasCorner.y\n && scaledY < this.transformConfig.bottomRightCanvasCorner.y)) {\n continue;\n }\n // Fill style is temporary green for all dies, will be replaced with a color based on the value of the die in a future implementation\n this.context.fillStyle = this.colors[this.colorIndices[columnStartIndex]]\n ?? this.outsideRangeDieColor;\n this.context.fillRect(scaledX, scaledY, this.renderConfig.dieDimensions.width, this.renderConfig.dieDimensions.height);\n }\n }\n }\n drawText() {\n this.context.font = `${this.renderConfig.labelsFontSize.toString()}px sans-serif`;\n this.context.fillStyle = \'#ffffff\';\n this.context.textAlign = \'center\';\n this.context.lineCap = \'butt\';\n const approximateTextHeight = this.context.measureText(\'M\');\n for (let i = 0; i < this.scaledColumnIndices.length; i++) {\n const scaledX = this.scaledColumnIndices[i];\n if (!(scaledX >= this.transformConfig.topLeftCanvasCorner.x\n && scaledX < this.transformConfig.bottomRightCanvasCorner.x)) {\n continue;\n }\n // columnIndexPositions is used to get chunks to determine the start and end index of the column, it looks something like [0, 1, 4, 9, 12]\n // This means that the first column has a start index of 0 and an end index of 1, the second column has a start index of 1 and an end index of 4, and so on\n // scaledRowIndices is used when we reach the end of the columnIndexPositions, when columnIndexPositions is [0, 1, 4, 9, 12], scaledRowIndices is 13\n const columnEndIndex = this.columnIndicesPositions[i + 1] !== undefined\n ? this.columnIndicesPositions[i + 1]\n : this.scaledRowIndices.length;\n for (let columnStartIndex = this.columnIndicesPositions[i]; columnStartIndex < columnEndIndex; columnStartIndex++) {\n const scaledY = this.scaledRowIndices[columnStartIndex];\n if (!(scaledY >= this.transformConfig.topLeftCanvasCorner.y\n && scaledY < this.transformConfig.bottomRightCanvasCorner.y)) {\n continue;\n }\n let label = `${this.values[columnStartIndex] || \'NaN\'}${this.renderConfig.dieLabelsSuffix}`;\n if (label.length >= this.renderConfig.maxCharacters) {\n label = `${label.substring(0, this.renderConfig.maxCharacters)}…`;\n }\n this.context.fillText(label, scaledX + this.renderConfig.dieDimensions.width / 2, scaledY\n + this.renderConfig.dieDimensions.height / 2\n + approximateTextHeight.width / 2, this.renderConfig.dieDimensions.width * this.fontSizeFactor);\n }\n }\n }\n isDieInGrid(x, y) {\n return (x >= this.renderConfig.gridMinX\n && x <= this.renderConfig.gridMaxX\n && y >= this.renderConfig.gridMinY\n && y <= this.renderConfig.gridMaxY);\n }\n calculateHorizontalScaledIndices(columnIndex) {\n return (this.renderConfig.horizontalCoefficient * columnIndex\n + this.renderConfig.horizontalConstant\n + this.renderConfig.margin.left);\n }\n calculateVerticalScaledIndices(rowIndex) {\n return (this.renderConfig.verticalCoefficient * rowIndex\n + this.renderConfig.verticalConstant\n + this.renderConfig.margin.top);\n }\n findColorIndex(value) {\n let index = -1;\n if (this.colorValues.length === 0 || this.colorValues[0] >= value) {\n return index;\n }\n for (let i = 0; i < this.colorValues.length; i++) {\n if (value <= this.colorValues[i]) {\n index = i;\n break;\n }\n }\n return index;\n }\n }\n expose(MatrixRenderer);\n\n exports.MatrixRenderer = MatrixRenderer;\n\n return exports;\n\n})({});\n'],{type:"text/javascript"})
|
|
15686
|
+
class wQ{constructor(t){this.wafermap=t,this.minDieDim=100}async setupWafer(t){if(void 0===this.matrixRenderer){const{matrixRenderer:t}=await(async()=>{if(void 0===yQ){const t=new Blob(['var MatrixRenderer = (function (exports) {\n \'use strict\';\n\n /**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n const proxyMarker = Symbol("Comlink.proxy");\n const createEndpoint = Symbol("Comlink.endpoint");\n const releaseProxy = Symbol("Comlink.releaseProxy");\n const finalizer = Symbol("Comlink.finalizer");\n const throwMarker = Symbol("Comlink.thrown");\n const isObject = (val) => (typeof val === "object" && val !== null) || typeof val === "function";\n /**\n * Internal transfer handle to handle objects marked to proxy.\n */\n const proxyTransferHandler = {\n canHandle: (val) => isObject(val) && val[proxyMarker],\n serialize(obj) {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port1);\n return [port2, [port2]];\n },\n deserialize(port) {\n port.start();\n return wrap(port);\n },\n };\n /**\n * Internal transfer handler to handle thrown exceptions.\n */\n const throwTransferHandler = {\n canHandle: (value) => isObject(value) && throwMarker in value,\n serialize({ value }) {\n let serialized;\n if (value instanceof Error) {\n serialized = {\n isError: true,\n value: {\n message: value.message,\n name: value.name,\n stack: value.stack,\n },\n };\n }\n else {\n serialized = { isError: false, value };\n }\n return [serialized, []];\n },\n deserialize(serialized) {\n if (serialized.isError) {\n throw Object.assign(new Error(serialized.value.message), serialized.value);\n }\n throw serialized.value;\n },\n };\n /**\n * Allows customizing the serialization of certain values.\n */\n const transferHandlers = new Map([\n ["proxy", proxyTransferHandler],\n ["throw", throwTransferHandler],\n ]);\n function isAllowedOrigin(allowedOrigins, origin) {\n for (const allowedOrigin of allowedOrigins) {\n if (origin === allowedOrigin || allowedOrigin === "*") {\n return true;\n }\n if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {\n return true;\n }\n }\n return false;\n }\n function expose(obj, ep = globalThis, allowedOrigins = ["*"]) {\n ep.addEventListener("message", function callback(ev) {\n if (!ev || !ev.data) {\n return;\n }\n if (!isAllowedOrigin(allowedOrigins, ev.origin)) {\n console.warn(`Invalid origin \'${ev.origin}\' for comlink proxy`);\n return;\n }\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\n let returnValue;\n try {\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\n switch (type) {\n case "GET" /* MessageType.GET */:\n {\n returnValue = rawValue;\n }\n break;\n case "SET" /* MessageType.SET */:\n {\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\n returnValue = true;\n }\n break;\n case "APPLY" /* MessageType.APPLY */:\n {\n returnValue = rawValue.apply(parent, argumentList);\n }\n break;\n case "CONSTRUCT" /* MessageType.CONSTRUCT */:\n {\n const value = new rawValue(...argumentList);\n returnValue = proxy(value);\n }\n break;\n case "ENDPOINT" /* MessageType.ENDPOINT */:\n {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port2);\n returnValue = transfer(port1, [port1]);\n }\n break;\n case "RELEASE" /* MessageType.RELEASE */:\n {\n returnValue = undefined;\n }\n break;\n default:\n return;\n }\n }\n catch (value) {\n returnValue = { value, [throwMarker]: 0 };\n }\n Promise.resolve(returnValue)\n .catch((value) => {\n return { value, [throwMarker]: 0 };\n })\n .then((returnValue) => {\n const [wireValue, transferables] = toWireValue(returnValue);\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n if (type === "RELEASE" /* MessageType.RELEASE */) {\n // detach and deactive after sending release response above.\n ep.removeEventListener("message", callback);\n closeEndPoint(ep);\n if (finalizer in obj && typeof obj[finalizer] === "function") {\n obj[finalizer]();\n }\n }\n })\n .catch((error) => {\n // Send Serialization Error To Caller\n const [wireValue, transferables] = toWireValue({\n value: new TypeError("Unserializable return value"),\n [throwMarker]: 0,\n });\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n });\n });\n if (ep.start) {\n ep.start();\n }\n }\n function isMessagePort(endpoint) {\n return endpoint.constructor.name === "MessagePort";\n }\n function closeEndPoint(endpoint) {\n if (isMessagePort(endpoint))\n endpoint.close();\n }\n function wrap(ep, target) {\n const pendingListeners = new Map();\n ep.addEventListener("message", function handleMessage(ev) {\n const { data } = ev;\n if (!data || !data.id) {\n return;\n }\n const resolver = pendingListeners.get(data.id);\n if (!resolver) {\n return;\n }\n try {\n resolver(data);\n }\n finally {\n pendingListeners.delete(data.id);\n }\n });\n return createProxy(ep, pendingListeners, [], target);\n }\n function throwIfProxyReleased(isReleased) {\n if (isReleased) {\n throw new Error("Proxy has been released and is not useable");\n }\n }\n function releaseEndpoint(ep) {\n return requestResponseMessage(ep, new Map(), {\n type: "RELEASE" /* MessageType.RELEASE */,\n }).then(() => {\n closeEndPoint(ep);\n });\n }\n const proxyCounter = new WeakMap();\n const proxyFinalizers = "FinalizationRegistry" in globalThis &&\n new FinalizationRegistry((ep) => {\n const newCount = (proxyCounter.get(ep) || 0) - 1;\n proxyCounter.set(ep, newCount);\n if (newCount === 0) {\n releaseEndpoint(ep);\n }\n });\n function registerProxy(proxy, ep) {\n const newCount = (proxyCounter.get(ep) || 0) + 1;\n proxyCounter.set(ep, newCount);\n if (proxyFinalizers) {\n proxyFinalizers.register(proxy, ep, proxy);\n }\n }\n function unregisterProxy(proxy) {\n if (proxyFinalizers) {\n proxyFinalizers.unregister(proxy);\n }\n }\n function createProxy(ep, pendingListeners, path = [], target = function () { }) {\n let isProxyReleased = false;\n const proxy = new Proxy(target, {\n get(_target, prop) {\n throwIfProxyReleased(isProxyReleased);\n if (prop === releaseProxy) {\n return () => {\n unregisterProxy(proxy);\n releaseEndpoint(ep);\n pendingListeners.clear();\n isProxyReleased = true;\n };\n }\n if (prop === "then") {\n if (path.length === 0) {\n return { then: () => proxy };\n }\n const r = requestResponseMessage(ep, pendingListeners, {\n type: "GET" /* MessageType.GET */,\n path: path.map((p) => p.toString()),\n }).then(fromWireValue);\n return r.then.bind(r);\n }\n return createProxy(ep, pendingListeners, [...path, prop]);\n },\n set(_target, prop, rawValue) {\n throwIfProxyReleased(isProxyReleased);\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\n const [value, transferables] = toWireValue(rawValue);\n return requestResponseMessage(ep, pendingListeners, {\n type: "SET" /* MessageType.SET */,\n path: [...path, prop].map((p) => p.toString()),\n value,\n }, transferables).then(fromWireValue);\n },\n apply(_target, _thisArg, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const last = path[path.length - 1];\n if (last === createEndpoint) {\n return requestResponseMessage(ep, pendingListeners, {\n type: "ENDPOINT" /* MessageType.ENDPOINT */,\n }).then(fromWireValue);\n }\n // We just pretend that `bind()` didn’t happen.\n if (last === "bind") {\n return createProxy(ep, pendingListeners, path.slice(0, -1));\n }\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: "APPLY" /* MessageType.APPLY */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n construct(_target, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, pendingListeners, {\n type: "CONSTRUCT" /* MessageType.CONSTRUCT */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n });\n registerProxy(proxy, ep);\n return proxy;\n }\n function myFlat(arr) {\n return Array.prototype.concat.apply([], arr);\n }\n function processArguments(argumentList) {\n const processed = argumentList.map(toWireValue);\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\n }\n const transferCache = new WeakMap();\n function transfer(obj, transfers) {\n transferCache.set(obj, transfers);\n return obj;\n }\n function proxy(obj) {\n return Object.assign(obj, { [proxyMarker]: true });\n }\n function toWireValue(value) {\n for (const [name, handler] of transferHandlers) {\n if (handler.canHandle(value)) {\n const [serializedValue, transferables] = handler.serialize(value);\n return [\n {\n type: "HANDLER" /* WireValueType.HANDLER */,\n name,\n value: serializedValue,\n },\n transferables,\n ];\n }\n }\n return [\n {\n type: "RAW" /* WireValueType.RAW */,\n value,\n },\n transferCache.get(value) || [],\n ];\n }\n function fromWireValue(value) {\n switch (value.type) {\n case "HANDLER" /* WireValueType.HANDLER */:\n return transferHandlers.get(value.name).deserialize(value.value);\n case "RAW" /* WireValueType.RAW */:\n return value.value;\n }\n }\n function requestResponseMessage(ep, pendingListeners, msg, transfers) {\n return new Promise((resolve) => {\n const id = generateUUID();\n pendingListeners.set(id, resolve);\n if (ep.start) {\n ep.start();\n }\n ep.postMessage(Object.assign({ id }, msg), transfers);\n });\n }\n function generateUUID() {\n return new Array(4)\n .fill(0)\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\n .join("-");\n }\n\n /**\n * MatrixRenderer class is meant to be used within a Web Worker context,\n * using Comlink to facilitate communication between the main thread and the worker.\n * The MatrixRenderer class manages a matrix of dies, once an instance of MatrixRenderer is created,\n * it is exposed to the main thread using Comlink\'s `expose` method.\n * This setup is used in the wafer-map component to perform heavy computational duties\n */\n class MatrixRenderer {\n constructor() {\n this.values = Float64Array.from([]);\n this.scaledColumnIndices = Float64Array.from([]);\n this.scaledRowIndices = Float64Array.from([]);\n this.columnIndicesPositions = Int32Array.from([]);\n this.colorIndices = Int32Array.from([]);\n this.colors = [];\n this.colorValues = Float64Array.from([]);\n this.outsideRangeDieColor = \'rgba(218,223,236,1)\';\n this.fontSizeFactor = 0.8;\n this.renderConfig = {\n dieDimensions: {\n width: 0,\n height: 0\n },\n margin: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n },\n verticalCoefficient: 1,\n horizontalCoefficient: 1,\n horizontalConstant: 0,\n verticalConstant: 0,\n gridMinX: 0,\n gridMaxX: 0,\n gridMinY: 0,\n gridMaxY: 0,\n labelsFontSize: 0,\n colorScale: [],\n dieLabelsSuffix: \'\',\n maxCharacters: 0\n };\n this.transformConfig = {\n transform: {\n k: 1,\n x: 0,\n y: 0\n },\n topLeftCanvasCorner: {\n x: 0,\n y: 0\n },\n bottomRightCanvasCorner: {\n x: 0,\n y: 0\n }\n };\n }\n setMatrixData(columnIndices, rowIndices, valuesBuffer) {\n const scaledColumnIndex = [];\n const columnPositions = [];\n const scaledRowIndices = [];\n const values = [];\n const colorIndices = [];\n let prevXIndex;\n let dieCount = 0;\n for (let i = 0; i < columnIndices.length; i++) {\n const xIndex = columnIndices[i];\n const yIndex = rowIndices[i];\n if (this.isDieInGrid(xIndex, yIndex)) {\n if (xIndex !== prevXIndex) {\n scaledColumnIndex.push(this.calculateHorizontalScaledIndices(xIndex));\n columnPositions.push(dieCount);\n prevXIndex = xIndex;\n }\n scaledRowIndices.push(this.calculateVerticalScaledIndices(yIndex));\n const value = valuesBuffer[i];\n values.push(value);\n colorIndices.push(this.findColorIndex(value));\n dieCount += 1;\n }\n }\n this.scaledColumnIndices = Float64Array.from(scaledColumnIndex);\n this.columnIndicesPositions = Int32Array.from(columnPositions);\n this.scaledRowIndices = Float64Array.from(scaledRowIndices);\n this.values = Float64Array.from(values);\n this.colorIndices = Int32Array.from(colorIndices);\n }\n setRenderConfig(renderConfig) {\n this.renderConfig = renderConfig;\n this.colors = renderConfig.colorScale.map(marker => marker.color);\n this.colorValues = Float64Array.from(renderConfig.colorScale.map(marker => marker.value));\n }\n setTransformConfig(transformData) {\n this.transformConfig = transformData;\n }\n setCanvas(canvas) {\n this.canvas = canvas;\n this.context = canvas.getContext(\'2d\');\n }\n scaleCanvas() {\n this.context.translate(this.transformConfig.transform.x, this.transformConfig.transform.y);\n this.context.scale(this.transformConfig.transform.k, this.transformConfig.transform.k);\n }\n setCanvasDimensions(data) {\n this.canvas.width = data.width;\n this.canvas.height = data.height;\n }\n getCanvasDimensions() {\n return {\n width: this.canvas.width,\n height: this.canvas.height\n };\n }\n clearCanvas() {\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }\n drawWafer() {\n this.context.restore();\n this.context.save();\n this.clearCanvas();\n this.scaleCanvas();\n for (let i = 0; i < this.scaledColumnIndices.length; i++) {\n const scaledX = this.scaledColumnIndices[i];\n if (!(scaledX >= this.transformConfig.topLeftCanvasCorner.x\n && scaledX < this.transformConfig.bottomRightCanvasCorner.x)) {\n continue;\n }\n // columnIndexPositions is used to get chunks to determine the start and end index of the column, it looks something like [0, 1, 4, 9, 12]\n // This means that the first column has a start index of 0 and an end index of 1, the second column has a start index of 1 and an end index of 4, and so on\n // scaledRowIndices is used when we reach the end of the columnIndexPositions, when columnIndexPositions is [0, 1, 4, 9, 12], scaledRowIndices is 13\n const columnEndIndex = this.columnIndicesPositions[i + 1] !== undefined\n ? this.columnIndicesPositions[i + 1]\n : this.scaledRowIndices.length;\n for (let columnStartIndex = this.columnIndicesPositions[i]; columnStartIndex < columnEndIndex; columnStartIndex++) {\n const scaledY = this.scaledRowIndices[columnStartIndex];\n if (!(scaledY >= this.transformConfig.topLeftCanvasCorner.y\n && scaledY < this.transformConfig.bottomRightCanvasCorner.y)) {\n continue;\n }\n // Fill style is temporary green for all dies, will be replaced with a color based on the value of the die in a future implementation\n this.context.fillStyle = this.colors[this.colorIndices[columnStartIndex]]\n ?? this.outsideRangeDieColor;\n this.context.fillRect(scaledX, scaledY, this.renderConfig.dieDimensions.width, this.renderConfig.dieDimensions.height);\n }\n }\n }\n drawText() {\n this.context.font = `${this.renderConfig.labelsFontSize.toString()}px sans-serif`;\n this.context.fillStyle = \'#ffffff\';\n this.context.textAlign = \'center\';\n this.context.lineCap = \'butt\';\n const approximateTextHeight = this.context.measureText(\'M\');\n for (let i = 0; i < this.scaledColumnIndices.length; i++) {\n const scaledX = this.scaledColumnIndices[i];\n if (!(scaledX >= this.transformConfig.topLeftCanvasCorner.x\n && scaledX < this.transformConfig.bottomRightCanvasCorner.x)) {\n continue;\n }\n // columnIndexPositions is used to get chunks to determine the start and end index of the column, it looks something like [0, 1, 4, 9, 12]\n // This means that the first column has a start index of 0 and an end index of 1, the second column has a start index of 1 and an end index of 4, and so on\n // scaledRowIndices is used when we reach the end of the columnIndexPositions, when columnIndexPositions is [0, 1, 4, 9, 12], scaledRowIndices is 13\n const columnEndIndex = this.columnIndicesPositions[i + 1] !== undefined\n ? this.columnIndicesPositions[i + 1]\n : this.scaledRowIndices.length;\n for (let columnStartIndex = this.columnIndicesPositions[i]; columnStartIndex < columnEndIndex; columnStartIndex++) {\n const scaledY = this.scaledRowIndices[columnStartIndex];\n if (!(scaledY >= this.transformConfig.topLeftCanvasCorner.y\n && scaledY < this.transformConfig.bottomRightCanvasCorner.y)) {\n continue;\n }\n let label = `${this.values[columnStartIndex] ?? \'NaN\'}${this.renderConfig.dieLabelsSuffix}`;\n if (label.length >= this.renderConfig.maxCharacters) {\n label = `${label.substring(0, this.renderConfig.maxCharacters)}…`;\n }\n this.context.fillText(label, scaledX + this.renderConfig.dieDimensions.width / 2, scaledY\n + this.renderConfig.dieDimensions.height / 2\n + approximateTextHeight.width / 2, this.renderConfig.dieDimensions.width * this.fontSizeFactor);\n }\n }\n }\n isDieInGrid(x, y) {\n return (x >= this.renderConfig.gridMinX\n && x <= this.renderConfig.gridMaxX\n && y >= this.renderConfig.gridMinY\n && y <= this.renderConfig.gridMaxY);\n }\n calculateHorizontalScaledIndices(columnIndex) {\n return (this.renderConfig.horizontalCoefficient * columnIndex\n + this.renderConfig.horizontalConstant\n + this.renderConfig.margin.left);\n }\n calculateVerticalScaledIndices(rowIndex) {\n return (this.renderConfig.verticalCoefficient * rowIndex\n + this.renderConfig.verticalConstant\n + this.renderConfig.margin.top);\n }\n findColorIndex(value) {\n let index = -1;\n if (this.colorValues.length === 0 || this.colorValues[0] >= value) {\n return index;\n }\n for (let i = 0; i < this.colorValues.length; i++) {\n if (value <= this.colorValues[i]) {\n index = i;\n break;\n }\n }\n return index;\n }\n }\n expose(MatrixRenderer);\n\n exports.MatrixRenderer = MatrixRenderer;\n\n return exports;\n\n})({});\n'],{type:"text/javascript"})
|
|
15622
15687
|
yQ=URL.createObjectURL(t)}const t=new Worker(yQ),e=aQ(t)
|
|
15623
15688
|
return{matrixRenderer:await new e,terminate:()=>t.terminate()}})()
|
|
15624
15689
|
this.matrixRenderer=t
|
|
15625
15690
|
const e=this.wafermap.workerCanvas.transferControlToOffscreen()
|
|
15626
15691
|
await this.matrixRenderer.setCanvas(mQ(e,[e]))}await this.matrixRenderer.setCanvasDimensions(t.canvasDimensions),await this.matrixRenderer.setRenderConfig(t.renderConfig),await this.matrixRenderer.setMatrixData(t.columnIndices,t.rowIndices,t.values)}async drawWafer(t){const e=t.transform.invert([0,0]),n=t.transform.invert([t.canvasDimensions.width,t.canvasDimensions.height])
|
|
15627
|
-
await this.matrixRenderer.setTransformConfig({transform:t.transform,topLeftCanvasCorner:{x:e[0]-t.dieDimensions.width,y:e[1]-t.dieDimensions.height},bottomRightCanvasCorner:{x:n[0],y:n[1]}}),await this.matrixRenderer.drawWafer(),!t.dieLabelsHidden&&t.dieDimensions
|
|
15692
|
+
await this.matrixRenderer.setTransformConfig({transform:t.transform,topLeftCanvasCorner:{x:e[0]-t.dieDimensions.width,y:e[1]-t.dieDimensions.height},bottomRightCanvasCorner:{x:n[0],y:n[1]}}),await this.matrixRenderer.drawWafer(),!t.dieLabelsHidden&&t.dieDimensions.width*t.dieDimensions.height*(0!==t.transform.k?t.transform.k:1)>=this.minDieDim&&await this.matrixRenderer.drawText()}renderHover(){void 0!==this.wafermap.computations.dieDimensions&&void 0!==this.wafermap.transform&&(this.wafermap.hoverWidth=this.wafermap.computations.dieDimensions.width*this.wafermap.transform.k,this.wafermap.hoverHeight=this.wafermap.computations.dieDimensions.height*this.wafermap.transform.k,this.wafermap.hoverOpacity=void 0===this.wafermap.hoverDie?HJ:VJ,this.wafermap.hoverTransform=this.calculateHoverTransform())}calculateHoverTransform(){if(void 0!==this.wafermap.hoverDie){const t=this.wafermap.computations.horizontalScale(this.wafermap.hoverDie.x)
|
|
15628
15693
|
if(void 0===t)return""
|
|
15629
15694
|
const e=this.wafermap.computations.verticalScale(this.wafermap.hoverDie.y)
|
|
15630
15695
|
if(void 0===e)return""
|