@ni/nimble-components 35.2.0 → 35.2.1
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 +68 -75
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +55 -55
- 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/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
|
@@ -16696,12 +16696,12 @@
|
|
|
16696
16696
|
Whitespace intentionally avoided between tags for inline styles */ ''}<span
|
|
16697
16697
|
part="start"
|
|
16698
16698
|
${ref('startContainer')}
|
|
16699
|
-
class="${_x => (definition.start ? 'start' : null)}"
|
|
16699
|
+
class="${_x => (definition.start !== undefined ? 'start' : null)}"
|
|
16700
16700
|
><slot
|
|
16701
16701
|
name="start"
|
|
16702
16702
|
${ref('start')}
|
|
16703
16703
|
@slotchange="${x => x.handleStartContentChange()}">
|
|
16704
|
-
${definition.start
|
|
16704
|
+
${definition.start ?? ''}
|
|
16705
16705
|
</slot
|
|
16706
16706
|
></span
|
|
16707
16707
|
><span
|
|
@@ -16714,12 +16714,12 @@
|
|
|
16714
16714
|
><span
|
|
16715
16715
|
part="end"
|
|
16716
16716
|
${ref('endContainer')}
|
|
16717
|
-
class=${_x => (definition.end ? 'end' : null)}
|
|
16717
|
+
class=${_x => (definition.end !== undefined ? 'end' : null)}
|
|
16718
16718
|
><slot
|
|
16719
16719
|
name="end"
|
|
16720
16720
|
${ref('end')}
|
|
16721
16721
|
@slotchange="${x => x.handleEndContentChange()}">
|
|
16722
|
-
${definition.end
|
|
16722
|
+
${definition.end ?? ''}
|
|
16723
16723
|
</slot
|
|
16724
16724
|
></span></a></div>`;
|
|
16725
16725
|
|
|
@@ -19012,6 +19012,8 @@
|
|
|
19012
19012
|
tab.style[gridHorizontalProperty] = `${index + 1}`;
|
|
19013
19013
|
});
|
|
19014
19014
|
if (firstFocusableTab
|
|
19015
|
+
// False positive. See: https://github.com/typescript-eslint/typescript-eslint/issues/12036
|
|
19016
|
+
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
19015
19017
|
&& (!this.activetab || !this.isFocusableElement(this.activetab))) {
|
|
19016
19018
|
firstFocusableTab.setAttribute('tabindex', '0');
|
|
19017
19019
|
}
|
|
@@ -20592,15 +20594,15 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
20592
20594
|
<div part="container" class="container">
|
|
20593
20595
|
<div part="control" class="control">
|
|
20594
20596
|
<slot name="checked-indicator">
|
|
20595
|
-
${definition.checkedIndicator
|
|
20597
|
+
${definition.checkedIndicator ?? ''}
|
|
20596
20598
|
</slot>
|
|
20597
20599
|
<slot name="indeterminate-indicator">
|
|
20598
|
-
${definition.indeterminateIndicator
|
|
20600
|
+
${definition.indeterminateIndicator ?? ''}
|
|
20599
20601
|
</slot>
|
|
20600
20602
|
</div>
|
|
20601
20603
|
<label
|
|
20602
20604
|
part="label"
|
|
20603
|
-
class="${x => (x.defaultSlottedNodes?.length
|
|
20605
|
+
class="${x => (x.defaultSlottedNodes?.length > 0
|
|
20604
20606
|
? 'label'
|
|
20605
20607
|
: 'label label__hidden')}"
|
|
20606
20608
|
>
|
|
@@ -21322,7 +21324,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
21322
21324
|
/>
|
|
21323
21325
|
<div class="indicator" part="indicator" aria-hidden="true">
|
|
21324
21326
|
<slot name="indicator">
|
|
21325
|
-
${definition.indicator
|
|
21327
|
+
${definition.indicator ?? ''}
|
|
21326
21328
|
</slot>
|
|
21327
21329
|
</div>
|
|
21328
21330
|
</slot>
|
|
@@ -21455,7 +21457,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
21455
21457
|
set value(next) {
|
|
21456
21458
|
const prev = this._value;
|
|
21457
21459
|
let updatedValue = next;
|
|
21458
|
-
if (this.$fastController.isConnected
|
|
21460
|
+
if (this.$fastController.isConnected) {
|
|
21459
21461
|
const selectedIndex = this.findIndexOfValidOption(next);
|
|
21460
21462
|
const prevSelectedValue = this.options[this.selectedIndex]?.text;
|
|
21461
21463
|
const nextSelectedValue = this.options[selectedIndex]?.text;
|
|
@@ -21481,7 +21483,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
21481
21483
|
*/
|
|
21482
21484
|
get options() {
|
|
21483
21485
|
Observable.track(this, 'options');
|
|
21484
|
-
return this.
|
|
21486
|
+
return this.filter
|
|
21485
21487
|
? this.filteredOptions
|
|
21486
21488
|
: this._options;
|
|
21487
21489
|
}
|
|
@@ -21595,12 +21597,12 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
21595
21597
|
if (!this.isAutocompleteInline) {
|
|
21596
21598
|
this.selectedIndex = this.findIndexOfValidOption(this.control.value);
|
|
21597
21599
|
}
|
|
21598
|
-
if (!e.inputType.includes('deleteContent') && this.filter.length) {
|
|
21600
|
+
if (!e.inputType.includes('deleteContent') && this.filter.length > 0) {
|
|
21599
21601
|
if (this.isAutocompleteList && !this.open) {
|
|
21600
21602
|
this.open = true;
|
|
21601
21603
|
}
|
|
21602
21604
|
if (this.isAutocompleteInline) {
|
|
21603
|
-
if (this.filteredOptions.length) {
|
|
21605
|
+
if (this.filteredOptions.length > 0) {
|
|
21604
21606
|
this.selectedOptions = [this.filteredOptions[0]];
|
|
21605
21607
|
this.selectedIndex = this.options.indexOf(this.firstSelectedOption);
|
|
21606
21608
|
this.setInlineSelection();
|
|
@@ -21739,11 +21741,11 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
21739
21741
|
* Overrides `Listbox.setDefaultSelectedOption`
|
|
21740
21742
|
*/
|
|
21741
21743
|
setDefaultSelectedOption() {
|
|
21742
|
-
if (this.$fastController.isConnected
|
|
21744
|
+
if (this.$fastController.isConnected) {
|
|
21743
21745
|
const selectedIndex = this.options.findIndex(el => !el.disabled
|
|
21744
21746
|
&& (el.getAttribute('selected') !== null || el.selected));
|
|
21745
21747
|
this.selectedIndex = selectedIndex;
|
|
21746
|
-
if (!this.dirtyValue && this.firstSelectedOption) {
|
|
21748
|
+
if (!this.dirtyValue && this.firstSelectedOption !== null) {
|
|
21747
21749
|
this.value = this.firstSelectedOption.text;
|
|
21748
21750
|
}
|
|
21749
21751
|
this.setSelectedOptions();
|
|
@@ -21860,7 +21862,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
21860
21862
|
if (this.open) {
|
|
21861
21863
|
if (this.contains(document.activeElement)) {
|
|
21862
21864
|
this.control.focus();
|
|
21863
|
-
if (this.firstSelectedOption) {
|
|
21865
|
+
if (this.firstSelectedOption !== null) {
|
|
21864
21866
|
requestAnimationFrame(() => {
|
|
21865
21867
|
this.firstSelectedOption?.scrollIntoView({
|
|
21866
21868
|
block: 'nearest'
|
|
@@ -21921,12 +21923,12 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
21921
21923
|
this.setPositioning();
|
|
21922
21924
|
}
|
|
21923
21925
|
regionChanged(_prev, _next) {
|
|
21924
|
-
if (this.region
|
|
21926
|
+
if (this.region) {
|
|
21925
21927
|
this.region.anchorElement = this.controlWrapper;
|
|
21926
21928
|
}
|
|
21927
21929
|
}
|
|
21928
21930
|
controlWrapperChanged(_prev, _next) {
|
|
21929
|
-
if (this.region
|
|
21931
|
+
if (this.region) {
|
|
21930
21932
|
this.region.anchorElement = this.controlWrapper;
|
|
21931
21933
|
}
|
|
21932
21934
|
}
|
|
@@ -21950,7 +21952,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
21950
21952
|
* Focus and set the content of the control based on the first selected option.
|
|
21951
21953
|
*/
|
|
21952
21954
|
setInputToSelection() {
|
|
21953
|
-
if (this.firstSelectedOption) {
|
|
21955
|
+
if (this.firstSelectedOption !== null) {
|
|
21954
21956
|
this.control.value = this.firstSelectedOption.text;
|
|
21955
21957
|
this.control.focus();
|
|
21956
21958
|
}
|
|
@@ -21959,7 +21961,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
21959
21961
|
* Focus, set and select the content of the control based on the first selected option.
|
|
21960
21962
|
*/
|
|
21961
21963
|
setInlineSelection() {
|
|
21962
|
-
if (this.firstSelectedOption) {
|
|
21964
|
+
if (this.firstSelectedOption !== null) {
|
|
21963
21965
|
this.setInputToSelection();
|
|
21964
21966
|
this.control.setSelectionRange(this.filter.length, this.control.value.length, 'backward');
|
|
21965
21967
|
}
|
|
@@ -22287,7 +22289,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
22287
22289
|
this.doResolveShow(reason);
|
|
22288
22290
|
}
|
|
22289
22291
|
slottedFooterElementsChanged(_prev, next) {
|
|
22290
|
-
this.footerIsEmpty =
|
|
22292
|
+
this.footerIsEmpty = next === undefined || next.length === 0;
|
|
22291
22293
|
}
|
|
22292
22294
|
/**
|
|
22293
22295
|
* @internal
|
|
@@ -26281,7 +26283,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
26281
26283
|
// closing an expanded item without opening another
|
|
26282
26284
|
if (this.expandedItem !== null
|
|
26283
26285
|
&& changedItem === this.expandedItem
|
|
26284
|
-
&& changedItem.expanded
|
|
26286
|
+
&& !changedItem.expanded) {
|
|
26285
26287
|
this.expandedItem = null;
|
|
26286
26288
|
return;
|
|
26287
26289
|
}
|
|
@@ -26310,7 +26312,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
26310
26312
|
this.menuItems = newItems;
|
|
26311
26313
|
const menuItems = this.menuItems.filter(this.isMenuItemElement);
|
|
26312
26314
|
// if our focus index is not -1 we have items
|
|
26313
|
-
if (menuItems.length) {
|
|
26315
|
+
if (menuItems.length > 0) {
|
|
26314
26316
|
this.focusIndex = 0;
|
|
26315
26317
|
}
|
|
26316
26318
|
function elementIndent(el) {
|
|
@@ -26353,7 +26355,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
26353
26355
|
return;
|
|
26354
26356
|
}
|
|
26355
26357
|
if (changedMenuItem.role === 'menuitemradio'
|
|
26356
|
-
&& changedMenuItem.checked
|
|
26358
|
+
&& changedMenuItem.checked) {
|
|
26357
26359
|
for (let i = changeItemIndex - 1; i >= 0; --i) {
|
|
26358
26360
|
const item = this.menuItems[i];
|
|
26359
26361
|
const role = item.getAttribute('role');
|
|
@@ -26819,7 +26821,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
26819
26821
|
// Get the menu that is slotted within the menu-button, taking into account
|
|
26820
26822
|
// that it may be nested within multiple 'slot' elements, such as when used
|
|
26821
26823
|
// within a table.
|
|
26822
|
-
if (!this.slottedMenus
|
|
26824
|
+
if (!this.slottedMenus || this.slottedMenus.length === 0) {
|
|
26823
26825
|
return undefined;
|
|
26824
26826
|
}
|
|
26825
26827
|
let currentItem = this.slottedMenus[0];
|
|
@@ -26850,7 +26852,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
26850
26852
|
}
|
|
26851
26853
|
focusLastMenuItem() {
|
|
26852
26854
|
const menuItems = this.getMenu()?.querySelectorAll('[role=menuitem]');
|
|
26853
|
-
if (menuItems
|
|
26855
|
+
if (menuItems && menuItems.length > 0) {
|
|
26854
26856
|
const lastMenuItem = menuItems[menuItems.length - 1];
|
|
26855
26857
|
lastMenuItem.focus();
|
|
26856
26858
|
}
|
|
@@ -27227,7 +27229,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
27227
27229
|
const labelTemplate$4 = createRequiredVisibleLabelTemplate(html `<label
|
|
27228
27230
|
part="label"
|
|
27229
27231
|
for="control"
|
|
27230
|
-
class="${x => (x.defaultSlottedNodes?.length ? 'label' : 'label label__hidden')}"
|
|
27232
|
+
class="${x => (x.defaultSlottedNodes?.length > 0 ? 'label' : 'label label__hidden')}"
|
|
27231
27233
|
>
|
|
27232
27234
|
<slot ${slotted('defaultSlottedNodes')}></slot>
|
|
27233
27235
|
</label>`);
|
|
@@ -27292,7 +27294,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
27292
27294
|
@click="${x => x.stepUp()}"
|
|
27293
27295
|
>
|
|
27294
27296
|
<slot name="step-up-glyph">
|
|
27295
|
-
${definition.stepUpGlyph
|
|
27297
|
+
${definition.stepUpGlyph ?? ''}
|
|
27296
27298
|
</slot>
|
|
27297
27299
|
</div>
|
|
27298
27300
|
<div
|
|
@@ -27301,7 +27303,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
27301
27303
|
@click="${x => x.stepDown()}"
|
|
27302
27304
|
>
|
|
27303
27305
|
<slot name="step-down-glyph">
|
|
27304
|
-
${definition.stepDownGlyph
|
|
27306
|
+
${definition.stepDownGlyph ?? ''}
|
|
27305
27307
|
</slot>
|
|
27306
27308
|
</div>
|
|
27307
27309
|
</div>
|
|
@@ -46951,7 +46953,7 @@ ${renderedContent}
|
|
|
46951
46953
|
*/
|
|
46952
46954
|
get options() {
|
|
46953
46955
|
Observable.track(this, 'options');
|
|
46954
|
-
return this.filteredOptions?.length ? this.filteredOptions : [];
|
|
46956
|
+
return this.filteredOptions?.length > 0 ? this.filteredOptions : [];
|
|
46955
46957
|
}
|
|
46956
46958
|
set options(value) {
|
|
46957
46959
|
this._options = value;
|
|
@@ -47021,7 +47023,7 @@ ${renderedContent}
|
|
|
47021
47023
|
this._options.forEach(o => {
|
|
47022
47024
|
o.hidden = !this.filteredOptions.includes(o);
|
|
47023
47025
|
});
|
|
47024
|
-
if (this.filteredOptions.length) {
|
|
47026
|
+
if (this.filteredOptions.length > 0) {
|
|
47025
47027
|
this.selectedOptions = [this.filteredOptions[0]];
|
|
47026
47028
|
this.selectedIndex = this.options.indexOf(this.firstSelectedOption);
|
|
47027
47029
|
}
|
|
@@ -47111,7 +47113,7 @@ ${renderedContent}
|
|
|
47111
47113
|
* Overrides: `Listbox.focusAndScrollOptionIntoView`
|
|
47112
47114
|
*/
|
|
47113
47115
|
focusAndScrollOptionIntoView() {
|
|
47114
|
-
if (this.open && this.firstSelectedOption) {
|
|
47116
|
+
if (this.open && this.firstSelectedOption !== null) {
|
|
47115
47117
|
requestAnimationFrame(() => {
|
|
47116
47118
|
this.firstSelectedOption?.scrollIntoView({ block: 'nearest' });
|
|
47117
47119
|
});
|
|
@@ -56909,7 +56911,7 @@ ${renderedContent}
|
|
|
56909
56911
|
* https://github.com/ProseMirror/prosemirror-markdown/blob/b7c1fd2fb74c7564bfe5428c7c8141ded7ebdd9f/src/to_markdown.ts#L94C2-L101C7
|
|
56910
56912
|
*/
|
|
56911
56913
|
const orderedListNode = function orderedList(state, node) {
|
|
56912
|
-
const start = node.attrs.start
|
|
56914
|
+
const start = node.attrs.start ?? 1;
|
|
56913
56915
|
const maxW = String(start + node.childCount - 1).length;
|
|
56914
56916
|
const space = state.repeat(' ', maxW + 2);
|
|
56915
56917
|
state.renderList(node, space, i => {
|
|
@@ -57280,7 +57282,7 @@ ${renderedContent}
|
|
|
57280
57282
|
};
|
|
57281
57283
|
}
|
|
57282
57284
|
isValid() {
|
|
57283
|
-
return Object.values(this.getValidity()).every(x => x
|
|
57285
|
+
return Object.values(this.getValidity()).every(x => !x);
|
|
57284
57286
|
}
|
|
57285
57287
|
validate(mentions) {
|
|
57286
57288
|
this.validateDuplicateMentionConfigurations(mentions);
|
|
@@ -63023,7 +63025,7 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
63023
63025
|
const updatedNodes = [];
|
|
63024
63026
|
fragment.forEach(node => {
|
|
63025
63027
|
if (node.isText && node.marks.length > 0) {
|
|
63026
|
-
const linkMark = node.marks.find(mark => mark.type.name === 'link'
|
|
63028
|
+
const linkMark = node.marks.find(mark => mark.type.name === 'link');
|
|
63027
63029
|
if (linkMark) {
|
|
63028
63030
|
// Checks if the link is valid link or not
|
|
63029
63031
|
// Needing to separately validate the link on paste is a workaround for a tiptap issue
|
|
@@ -63148,7 +63150,7 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
63148
63150
|
if (node.type.name.startsWith(mentionPluginPrefix)) {
|
|
63149
63151
|
hasMention = true;
|
|
63150
63152
|
}
|
|
63151
|
-
const continueDescent = hasMention
|
|
63153
|
+
const continueDescent = !hasMention;
|
|
63152
63154
|
return continueDescent;
|
|
63153
63155
|
});
|
|
63154
63156
|
return !hasMention;
|
|
@@ -64212,7 +64214,7 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
64212
64214
|
`)}
|
|
64213
64215
|
<div aria-hidden="true" class="indicator" part="indicator">
|
|
64214
64216
|
<slot name="indicator">
|
|
64215
|
-
${definition.indicator
|
|
64217
|
+
${definition.indicator ?? ''}
|
|
64216
64218
|
</slot>
|
|
64217
64219
|
</div>
|
|
64218
64220
|
</slot>
|
|
@@ -64404,7 +64406,7 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
64404
64406
|
set value(next) {
|
|
64405
64407
|
const prev = this._value;
|
|
64406
64408
|
let newValue = next;
|
|
64407
|
-
if (this.options
|
|
64409
|
+
if (this.options !== undefined && this.options.length > 0) {
|
|
64408
64410
|
const newValueIndex = this.options.findIndex(el => el.value === newValue);
|
|
64409
64411
|
const prevSelectedValue = this.options[this.selectedIndex]?.value ?? null;
|
|
64410
64412
|
const nextSelectedValue = this.options[newValueIndex]?.value ?? null;
|
|
@@ -64433,7 +64435,7 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
64433
64435
|
* @internal
|
|
64434
64436
|
*/
|
|
64435
64437
|
anchoredRegionChanged(_prev, _next) {
|
|
64436
|
-
if (this.anchoredRegion && this.control) {
|
|
64438
|
+
if (this.anchoredRegion !== undefined && this.control !== undefined) {
|
|
64437
64439
|
this.anchoredRegion.anchorElement = this.control;
|
|
64438
64440
|
}
|
|
64439
64441
|
}
|
|
@@ -64441,7 +64443,7 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
64441
64443
|
* @internal
|
|
64442
64444
|
*/
|
|
64443
64445
|
controlChanged(_prev, _next) {
|
|
64444
|
-
if (this.anchoredRegion && this.control) {
|
|
64446
|
+
if (this.anchoredRegion !== undefined && this.control !== undefined) {
|
|
64445
64447
|
this.anchoredRegion.anchorElement = this.control;
|
|
64446
64448
|
}
|
|
64447
64449
|
}
|
|
@@ -64598,9 +64600,7 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
64598
64600
|
*/
|
|
64599
64601
|
multipleChanged(prev, next) {
|
|
64600
64602
|
super.multipleChanged(prev, next);
|
|
64601
|
-
|
|
64602
|
-
this.proxy.multiple = next;
|
|
64603
|
-
}
|
|
64603
|
+
this.proxy.multiple = next;
|
|
64604
64604
|
}
|
|
64605
64605
|
/**
|
|
64606
64606
|
* @internal
|
|
@@ -64657,7 +64657,7 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
64657
64657
|
if (this.filterMode !== FilterMode.none) {
|
|
64658
64658
|
this.emitFilterInputEvent();
|
|
64659
64659
|
}
|
|
64660
|
-
if (e.inputType.includes('deleteContent') ||
|
|
64660
|
+
if (e.inputType.includes('deleteContent') || this.filter.length === 0) {
|
|
64661
64661
|
return true;
|
|
64662
64662
|
}
|
|
64663
64663
|
e.stopPropagation();
|
|
@@ -64826,7 +64826,7 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
64826
64826
|
typeaheadBufferChanged(_, __) {
|
|
64827
64827
|
if (this.$fastController.isConnected) {
|
|
64828
64828
|
const typeaheadMatches = this.getTypeaheadMatches();
|
|
64829
|
-
if (typeaheadMatches.length) {
|
|
64829
|
+
if (typeaheadMatches.length > 0) {
|
|
64830
64830
|
const activeOptionIndex = this.options.indexOf(typeaheadMatches[0]);
|
|
64831
64831
|
if (!(this.open && this.filterMode !== FilterMode.none)) {
|
|
64832
64832
|
this.setActiveOption(activeOptionIndex);
|
|
@@ -64959,9 +64959,7 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
64959
64959
|
*/
|
|
64960
64960
|
sizeChanged(prev, next) {
|
|
64961
64961
|
super.sizeChanged(prev, next);
|
|
64962
|
-
|
|
64963
|
-
this.proxy.size = next;
|
|
64964
|
-
}
|
|
64962
|
+
this.proxy.size = next;
|
|
64965
64963
|
}
|
|
64966
64964
|
openChanged() {
|
|
64967
64965
|
if (!this.collapsible) {
|
|
@@ -65266,14 +65264,14 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
65266
65264
|
* @internal
|
|
65267
65265
|
*/
|
|
65268
65266
|
setProxyOptions() {
|
|
65269
|
-
if (this.proxy instanceof HTMLSelectElement && this.options) {
|
|
65267
|
+
if (this.proxy instanceof HTMLSelectElement && this.options !== null) {
|
|
65270
65268
|
this.proxy.options.length = 0;
|
|
65271
65269
|
this.options.forEach(option => {
|
|
65272
65270
|
const proxyOption = option.proxy
|
|
65273
|
-
|
|
65271
|
+
?? (option instanceof HTMLOptionElement
|
|
65274
65272
|
? option.cloneNode()
|
|
65275
65273
|
: null);
|
|
65276
|
-
if (proxyOption) {
|
|
65274
|
+
if (proxyOption !== null) {
|
|
65277
65275
|
this.proxy.options.add(proxyOption);
|
|
65278
65276
|
}
|
|
65279
65277
|
});
|
|
@@ -65301,7 +65299,7 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
65301
65299
|
return;
|
|
65302
65300
|
}
|
|
65303
65301
|
const selectedOption = this.firstSelectedOption;
|
|
65304
|
-
if (selectedOption) {
|
|
65302
|
+
if (selectedOption !== null) {
|
|
65305
65303
|
this.selectedOptionObserver?.observe(selectedOption, {
|
|
65306
65304
|
characterData: true,
|
|
65307
65305
|
subtree: true,
|
|
@@ -65605,7 +65603,7 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
65605
65603
|
>
|
|
65606
65604
|
<label
|
|
65607
65605
|
part="label"
|
|
65608
|
-
class="${x => (x.defaultSlottedNodes?.length ? 'label' : 'label label__hidden')}"
|
|
65606
|
+
class="${x => (x.defaultSlottedNodes?.length > 0 ? 'label' : 'label label__hidden')}"
|
|
65609
65607
|
>
|
|
65610
65608
|
<slot ${slotted('defaultSlottedNodes')}></slot>
|
|
65611
65609
|
</label>
|
|
@@ -69407,7 +69405,7 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
69407
69405
|
};
|
|
69408
69406
|
}
|
|
69409
69407
|
isValid() {
|
|
69410
|
-
return Object.values(this.getValidity()).every(x => x
|
|
69408
|
+
return Object.values(this.getValidity()).every(x => !x);
|
|
69411
69409
|
}
|
|
69412
69410
|
areRecordIdsValid() {
|
|
69413
69411
|
const validity = this.getValidity();
|
|
@@ -72134,7 +72132,7 @@ focus outline in that case.
|
|
|
72134
72132
|
return this.getVisibleColumns()
|
|
72135
72133
|
.map(column => {
|
|
72136
72134
|
const { minPixelWidth, currentPixelWidth, currentFractionalWidth } = column.columnInternals;
|
|
72137
|
-
if (currentPixelWidth) {
|
|
72135
|
+
if (currentPixelWidth !== undefined) {
|
|
72138
72136
|
const coercedPixelWidth = Math.max(minPixelWidth, currentPixelWidth);
|
|
72139
72137
|
return `${coercedPixelWidth}px`;
|
|
72140
72138
|
}
|
|
@@ -72596,7 +72594,7 @@ focus outline in that case.
|
|
|
72596
72594
|
const allRows = [];
|
|
72597
72595
|
for (const row of topLevelRows) {
|
|
72598
72596
|
allRows.push(row);
|
|
72599
|
-
if (row.subRows?.length) {
|
|
72597
|
+
if (row.subRows?.length > 0) {
|
|
72600
72598
|
allRows.push(...this.getOrderedRows(row.subRows));
|
|
72601
72599
|
}
|
|
72602
72600
|
}
|
|
@@ -72851,10 +72849,8 @@ focus outline in that case.
|
|
|
72851
72849
|
originalIndex: undefined
|
|
72852
72850
|
};
|
|
72853
72851
|
}
|
|
72854
|
-
//
|
|
72855
|
-
|
|
72856
|
-
orphanIds.delete(itemId);
|
|
72857
|
-
}
|
|
72852
|
+
// delete this item from the orphan set if it is in it
|
|
72853
|
+
orphanIds.delete(itemId);
|
|
72858
72854
|
// add the current item's data to the item in the lookup table
|
|
72859
72855
|
lookup[itemId].clientRecord = item;
|
|
72860
72856
|
const treeItem = lookup[itemId];
|
|
@@ -72874,16 +72870,14 @@ focus outline in that case.
|
|
|
72874
72870
|
clientRecord: undefined,
|
|
72875
72871
|
originalIndex: undefined
|
|
72876
72872
|
};
|
|
72877
|
-
//
|
|
72878
|
-
|
|
72879
|
-
orphanIds.add(parentId);
|
|
72880
|
-
}
|
|
72873
|
+
// add the generated parent to the orphan list
|
|
72874
|
+
orphanIds.add(parentId);
|
|
72881
72875
|
}
|
|
72882
72876
|
// add the current item to the parent
|
|
72883
72877
|
lookup[parentId].subRows.push(treeItem);
|
|
72884
72878
|
}
|
|
72885
72879
|
}
|
|
72886
|
-
if (orphanIds
|
|
72880
|
+
if (orphanIds.size > 0) {
|
|
72887
72881
|
const orphans = Array.from(orphanIds.values()).join(',');
|
|
72888
72882
|
throw new Error(`The items array contains orphans that point to the following parentIds: [${orphans}]. These parentIds do not exist in the items array.`);
|
|
72889
72883
|
}
|
|
@@ -72898,7 +72892,7 @@ focus outline in that case.
|
|
|
72898
72892
|
* @returns Number of nodes in the tree
|
|
72899
72893
|
*/
|
|
72900
72894
|
function countNodes(tree) {
|
|
72901
|
-
return tree.reduce((sum, n) => sum + 1 + (n.subRows
|
|
72895
|
+
return tree.reduce((sum, n) => sum + 1 + (n.subRows ? countNodes(n.subRows) : 0), 0);
|
|
72902
72896
|
}
|
|
72903
72897
|
|
|
72904
72898
|
/**
|
|
@@ -74964,7 +74958,7 @@ focus outline in that case.
|
|
|
74964
74958
|
calculateTanStackSortState() {
|
|
74965
74959
|
const sortedColumns = this.getColumnsParticipatingInSorting().sort((x, y) => x.columnInternals.currentSortIndex
|
|
74966
74960
|
- y.columnInternals.currentSortIndex);
|
|
74967
|
-
this.firstSortedColumn = sortedColumns.length
|
|
74961
|
+
this.firstSortedColumn = sortedColumns.length > 0
|
|
74968
74962
|
? sortedColumns[0]
|
|
74969
74963
|
: undefined;
|
|
74970
74964
|
return sortedColumns.map(column => {
|
|
@@ -76168,13 +76162,13 @@ focus outline in that case.
|
|
|
76168
76162
|
}
|
|
76169
76163
|
const hours = Math.floor((milliseconds / millisecondsPerHour) % 24);
|
|
76170
76164
|
remainingTime -= hours * millisecondsPerHour;
|
|
76171
|
-
if (hours) {
|
|
76165
|
+
if (hours !== 0) {
|
|
76172
76166
|
const formattedHours = this.hoursFormatter.format(hours);
|
|
76173
76167
|
result.push(formattedHours);
|
|
76174
76168
|
}
|
|
76175
76169
|
const minutes = Math.floor((milliseconds / millisecondsPerMinute) % 60);
|
|
76176
76170
|
remainingTime -= minutes * millisecondsPerMinute;
|
|
76177
|
-
if (minutes) {
|
|
76171
|
+
if (minutes !== 0) {
|
|
76178
76172
|
const formattedMinutes = this.minutesFormatter.format(minutes);
|
|
76179
76173
|
result.push(formattedMinutes);
|
|
76180
76174
|
}
|
|
@@ -78024,7 +78018,7 @@ focus outline in that case.
|
|
|
78024
78018
|
<label
|
|
78025
78019
|
part="label"
|
|
78026
78020
|
for="control"
|
|
78027
|
-
class="${x => (x.defaultSlottedNodes?.length ? 'label' : 'label label__hidden')}"
|
|
78021
|
+
class="${x => (x.defaultSlottedNodes?.length > 0 ? 'label' : 'label label__hidden')}"
|
|
78028
78022
|
>
|
|
78029
78023
|
<slot ${slotted('defaultSlottedNodes')}></slot>
|
|
78030
78024
|
</label>
|
|
@@ -78459,7 +78453,7 @@ focus outline in that case.
|
|
|
78459
78453
|
const labelTemplate = createRequiredVisibleLabelTemplate(html `<label
|
|
78460
78454
|
part="label"
|
|
78461
78455
|
for="control"
|
|
78462
|
-
class="${x => (x.defaultSlottedNodes?.length ? 'label' : 'label label__hidden')}"
|
|
78456
|
+
class="${x => (x.defaultSlottedNodes?.length > 0 ? 'label' : 'label label__hidden')}"
|
|
78463
78457
|
>
|
|
78464
78458
|
<slot
|
|
78465
78459
|
${slotted({
|
|
@@ -95176,7 +95170,7 @@ focus outline in that case.
|
|
|
95176
95170
|
}
|
|
95177
95171
|
const dieWidth = this.wafermap.dataManager.dieDimensions.width;
|
|
95178
95172
|
const dieHeight = this.wafermap.dataManager.dieDimensions.height;
|
|
95179
|
-
const dieSize = dieWidth * dieHeight * (this.wafermap.transform.k
|
|
95173
|
+
const dieSize = dieWidth * dieHeight * (this.wafermap.transform.k !== 0 ? this.wafermap.transform.k : 1);
|
|
95180
95174
|
if (dieSize >= this.minDieDim) {
|
|
95181
95175
|
const fontsize = this.wafermap.dataManager.labelsFontSize;
|
|
95182
95176
|
const context = this.wafermap.canvasContext;
|
|
@@ -95370,7 +95364,7 @@ focus outline in that case.
|
|
|
95370
95364
|
};
|
|
95371
95365
|
}
|
|
95372
95366
|
isValid() {
|
|
95373
|
-
return Object.values(this.getValidity()).every(x => x
|
|
95367
|
+
return Object.values(this.getValidity()).every(x => !x);
|
|
95374
95368
|
}
|
|
95375
95369
|
validateGridDimensions() {
|
|
95376
95370
|
this.invalidGridDimensions = false;
|
|
@@ -95765,7 +95759,7 @@ focus outline in that case.
|
|
|
95765
95759
|
.join("-");
|
|
95766
95760
|
}
|
|
95767
95761
|
|
|
95768
|
-
const workerCode = "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";
|
|
95762
|
+
const workerCode = "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";
|
|
95769
95763
|
|
|
95770
95764
|
let url;
|
|
95771
95765
|
/**
|
|
@@ -95826,10 +95820,9 @@ focus outline in that case.
|
|
|
95826
95820
|
});
|
|
95827
95821
|
await this.matrixRenderer.drawWafer();
|
|
95828
95822
|
if (!snapshot.dieLabelsHidden
|
|
95829
|
-
&& snapshot.dieDimensions
|
|
95830
95823
|
&& snapshot.dieDimensions.width
|
|
95831
95824
|
* snapshot.dieDimensions.height
|
|
95832
|
-
* (snapshot.transform.k
|
|
95825
|
+
* (snapshot.transform.k !== 0 ? snapshot.transform.k : 1)
|
|
95833
95826
|
>= this.minDieDim) {
|
|
95834
95827
|
await this.matrixRenderer.drawText();
|
|
95835
95828
|
}
|