@ni/ok-components 0.2.4 → 0.2.6
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.
|
@@ -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
|
|
@@ -26282,7 +26284,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
26282
26284
|
// closing an expanded item without opening another
|
|
26283
26285
|
if (this.expandedItem !== null
|
|
26284
26286
|
&& changedItem === this.expandedItem
|
|
26285
|
-
&& changedItem.expanded
|
|
26287
|
+
&& !changedItem.expanded) {
|
|
26286
26288
|
this.expandedItem = null;
|
|
26287
26289
|
return;
|
|
26288
26290
|
}
|
|
@@ -26311,7 +26313,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
26311
26313
|
this.menuItems = newItems;
|
|
26312
26314
|
const menuItems = this.menuItems.filter(this.isMenuItemElement);
|
|
26313
26315
|
// if our focus index is not -1 we have items
|
|
26314
|
-
if (menuItems.length) {
|
|
26316
|
+
if (menuItems.length > 0) {
|
|
26315
26317
|
this.focusIndex = 0;
|
|
26316
26318
|
}
|
|
26317
26319
|
function elementIndent(el) {
|
|
@@ -26354,7 +26356,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
26354
26356
|
return;
|
|
26355
26357
|
}
|
|
26356
26358
|
if (changedMenuItem.role === 'menuitemradio'
|
|
26357
|
-
&& changedMenuItem.checked
|
|
26359
|
+
&& changedMenuItem.checked) {
|
|
26358
26360
|
for (let i = changeItemIndex - 1; i >= 0; --i) {
|
|
26359
26361
|
const item = this.menuItems[i];
|
|
26360
26362
|
const role = item.getAttribute('role');
|
|
@@ -26820,7 +26822,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
26820
26822
|
// Get the menu that is slotted within the menu-button, taking into account
|
|
26821
26823
|
// that it may be nested within multiple 'slot' elements, such as when used
|
|
26822
26824
|
// within a table.
|
|
26823
|
-
if (!this.slottedMenus
|
|
26825
|
+
if (!this.slottedMenus || this.slottedMenus.length === 0) {
|
|
26824
26826
|
return undefined;
|
|
26825
26827
|
}
|
|
26826
26828
|
let currentItem = this.slottedMenus[0];
|
|
@@ -26851,7 +26853,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
26851
26853
|
}
|
|
26852
26854
|
focusLastMenuItem() {
|
|
26853
26855
|
const menuItems = this.getMenu()?.querySelectorAll('[role=menuitem]');
|
|
26854
|
-
if (menuItems
|
|
26856
|
+
if (menuItems && menuItems.length > 0) {
|
|
26855
26857
|
const lastMenuItem = menuItems[menuItems.length - 1];
|
|
26856
26858
|
lastMenuItem.focus();
|
|
26857
26859
|
}
|
|
@@ -27228,7 +27230,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
27228
27230
|
const labelTemplate$4 = createRequiredVisibleLabelTemplate(html `<label
|
|
27229
27231
|
part="label"
|
|
27230
27232
|
for="control"
|
|
27231
|
-
class="${x => (x.defaultSlottedNodes?.length ? 'label' : 'label label__hidden')}"
|
|
27233
|
+
class="${x => (x.defaultSlottedNodes?.length > 0 ? 'label' : 'label label__hidden')}"
|
|
27232
27234
|
>
|
|
27233
27235
|
<slot ${slotted('defaultSlottedNodes')}></slot>
|
|
27234
27236
|
</label>`);
|
|
@@ -27293,7 +27295,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
27293
27295
|
@click="${x => x.stepUp()}"
|
|
27294
27296
|
>
|
|
27295
27297
|
<slot name="step-up-glyph">
|
|
27296
|
-
${definition.stepUpGlyph
|
|
27298
|
+
${definition.stepUpGlyph ?? ''}
|
|
27297
27299
|
</slot>
|
|
27298
27300
|
</div>
|
|
27299
27301
|
<div
|
|
@@ -27302,7 +27304,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
27302
27304
|
@click="${x => x.stepDown()}"
|
|
27303
27305
|
>
|
|
27304
27306
|
<slot name="step-down-glyph">
|
|
27305
|
-
${definition.stepDownGlyph
|
|
27307
|
+
${definition.stepDownGlyph ?? ''}
|
|
27306
27308
|
</slot>
|
|
27307
27309
|
</div>
|
|
27308
27310
|
</div>
|
|
@@ -46952,7 +46954,7 @@ ${renderedContent}
|
|
|
46952
46954
|
*/
|
|
46953
46955
|
get options() {
|
|
46954
46956
|
Observable.track(this, 'options');
|
|
46955
|
-
return this.filteredOptions?.length ? this.filteredOptions : [];
|
|
46957
|
+
return this.filteredOptions?.length > 0 ? this.filteredOptions : [];
|
|
46956
46958
|
}
|
|
46957
46959
|
set options(value) {
|
|
46958
46960
|
this._options = value;
|
|
@@ -47022,7 +47024,7 @@ ${renderedContent}
|
|
|
47022
47024
|
this._options.forEach(o => {
|
|
47023
47025
|
o.hidden = !this.filteredOptions.includes(o);
|
|
47024
47026
|
});
|
|
47025
|
-
if (this.filteredOptions.length) {
|
|
47027
|
+
if (this.filteredOptions.length > 0) {
|
|
47026
47028
|
this.selectedOptions = [this.filteredOptions[0]];
|
|
47027
47029
|
this.selectedIndex = this.options.indexOf(this.firstSelectedOption);
|
|
47028
47030
|
}
|
|
@@ -47112,7 +47114,7 @@ ${renderedContent}
|
|
|
47112
47114
|
* Overrides: `Listbox.focusAndScrollOptionIntoView`
|
|
47113
47115
|
*/
|
|
47114
47116
|
focusAndScrollOptionIntoView() {
|
|
47115
|
-
if (this.open && this.firstSelectedOption) {
|
|
47117
|
+
if (this.open && this.firstSelectedOption !== null) {
|
|
47116
47118
|
requestAnimationFrame(() => {
|
|
47117
47119
|
this.firstSelectedOption?.scrollIntoView({ block: 'nearest' });
|
|
47118
47120
|
});
|
|
@@ -56910,7 +56912,7 @@ ${renderedContent}
|
|
|
56910
56912
|
* https://github.com/ProseMirror/prosemirror-markdown/blob/b7c1fd2fb74c7564bfe5428c7c8141ded7ebdd9f/src/to_markdown.ts#L94C2-L101C7
|
|
56911
56913
|
*/
|
|
56912
56914
|
const orderedListNode = function orderedList(state, node) {
|
|
56913
|
-
const start = node.attrs.start
|
|
56915
|
+
const start = node.attrs.start ?? 1;
|
|
56914
56916
|
const maxW = String(start + node.childCount - 1).length;
|
|
56915
56917
|
const space = state.repeat(' ', maxW + 2);
|
|
56916
56918
|
state.renderList(node, space, i => {
|
|
@@ -57281,7 +57283,7 @@ ${renderedContent}
|
|
|
57281
57283
|
};
|
|
57282
57284
|
}
|
|
57283
57285
|
isValid() {
|
|
57284
|
-
return Object.values(this.getValidity()).every(x => x
|
|
57286
|
+
return Object.values(this.getValidity()).every(x => !x);
|
|
57285
57287
|
}
|
|
57286
57288
|
validate(mentions) {
|
|
57287
57289
|
this.validateDuplicateMentionConfigurations(mentions);
|
|
@@ -63024,7 +63026,7 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
63024
63026
|
const updatedNodes = [];
|
|
63025
63027
|
fragment.forEach(node => {
|
|
63026
63028
|
if (node.isText && node.marks.length > 0) {
|
|
63027
|
-
const linkMark = node.marks.find(mark => mark.type.name === 'link'
|
|
63029
|
+
const linkMark = node.marks.find(mark => mark.type.name === 'link');
|
|
63028
63030
|
if (linkMark) {
|
|
63029
63031
|
// Checks if the link is valid link or not
|
|
63030
63032
|
// Needing to separately validate the link on paste is a workaround for a tiptap issue
|
|
@@ -63149,7 +63151,7 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
63149
63151
|
if (node.type.name.startsWith(mentionPluginPrefix)) {
|
|
63150
63152
|
hasMention = true;
|
|
63151
63153
|
}
|
|
63152
|
-
const continueDescent = hasMention
|
|
63154
|
+
const continueDescent = !hasMention;
|
|
63153
63155
|
return continueDescent;
|
|
63154
63156
|
});
|
|
63155
63157
|
return !hasMention;
|
|
@@ -64213,7 +64215,7 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
64213
64215
|
`)}
|
|
64214
64216
|
<div aria-hidden="true" class="indicator" part="indicator">
|
|
64215
64217
|
<slot name="indicator">
|
|
64216
|
-
${definition.indicator
|
|
64218
|
+
${definition.indicator ?? ''}
|
|
64217
64219
|
</slot>
|
|
64218
64220
|
</div>
|
|
64219
64221
|
</slot>
|
|
@@ -64405,7 +64407,7 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
64405
64407
|
set value(next) {
|
|
64406
64408
|
const prev = this._value;
|
|
64407
64409
|
let newValue = next;
|
|
64408
|
-
if (this.options
|
|
64410
|
+
if (this.options !== undefined && this.options.length > 0) {
|
|
64409
64411
|
const newValueIndex = this.options.findIndex(el => el.value === newValue);
|
|
64410
64412
|
const prevSelectedValue = this.options[this.selectedIndex]?.value ?? null;
|
|
64411
64413
|
const nextSelectedValue = this.options[newValueIndex]?.value ?? null;
|
|
@@ -64434,7 +64436,7 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
64434
64436
|
* @internal
|
|
64435
64437
|
*/
|
|
64436
64438
|
anchoredRegionChanged(_prev, _next) {
|
|
64437
|
-
if (this.anchoredRegion && this.control) {
|
|
64439
|
+
if (this.anchoredRegion !== undefined && this.control !== undefined) {
|
|
64438
64440
|
this.anchoredRegion.anchorElement = this.control;
|
|
64439
64441
|
}
|
|
64440
64442
|
}
|
|
@@ -64442,7 +64444,7 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
64442
64444
|
* @internal
|
|
64443
64445
|
*/
|
|
64444
64446
|
controlChanged(_prev, _next) {
|
|
64445
|
-
if (this.anchoredRegion && this.control) {
|
|
64447
|
+
if (this.anchoredRegion !== undefined && this.control !== undefined) {
|
|
64446
64448
|
this.anchoredRegion.anchorElement = this.control;
|
|
64447
64449
|
}
|
|
64448
64450
|
}
|
|
@@ -64599,9 +64601,7 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
64599
64601
|
*/
|
|
64600
64602
|
multipleChanged(prev, next) {
|
|
64601
64603
|
super.multipleChanged(prev, next);
|
|
64602
|
-
|
|
64603
|
-
this.proxy.multiple = next;
|
|
64604
|
-
}
|
|
64604
|
+
this.proxy.multiple = next;
|
|
64605
64605
|
}
|
|
64606
64606
|
/**
|
|
64607
64607
|
* @internal
|
|
@@ -64658,7 +64658,7 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
64658
64658
|
if (this.filterMode !== FilterMode.none) {
|
|
64659
64659
|
this.emitFilterInputEvent();
|
|
64660
64660
|
}
|
|
64661
|
-
if (e.inputType.includes('deleteContent') ||
|
|
64661
|
+
if (e.inputType.includes('deleteContent') || this.filter.length === 0) {
|
|
64662
64662
|
return true;
|
|
64663
64663
|
}
|
|
64664
64664
|
e.stopPropagation();
|
|
@@ -64827,7 +64827,7 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
64827
64827
|
typeaheadBufferChanged(_, __) {
|
|
64828
64828
|
if (this.$fastController.isConnected) {
|
|
64829
64829
|
const typeaheadMatches = this.getTypeaheadMatches();
|
|
64830
|
-
if (typeaheadMatches.length) {
|
|
64830
|
+
if (typeaheadMatches.length > 0) {
|
|
64831
64831
|
const activeOptionIndex = this.options.indexOf(typeaheadMatches[0]);
|
|
64832
64832
|
if (!(this.open && this.filterMode !== FilterMode.none)) {
|
|
64833
64833
|
this.setActiveOption(activeOptionIndex);
|
|
@@ -64960,9 +64960,7 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
64960
64960
|
*/
|
|
64961
64961
|
sizeChanged(prev, next) {
|
|
64962
64962
|
super.sizeChanged(prev, next);
|
|
64963
|
-
|
|
64964
|
-
this.proxy.size = next;
|
|
64965
|
-
}
|
|
64963
|
+
this.proxy.size = next;
|
|
64966
64964
|
}
|
|
64967
64965
|
openChanged() {
|
|
64968
64966
|
if (!this.collapsible) {
|
|
@@ -65267,14 +65265,14 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
65267
65265
|
* @internal
|
|
65268
65266
|
*/
|
|
65269
65267
|
setProxyOptions() {
|
|
65270
|
-
if (this.proxy instanceof HTMLSelectElement && this.options) {
|
|
65268
|
+
if (this.proxy instanceof HTMLSelectElement && this.options !== null) {
|
|
65271
65269
|
this.proxy.options.length = 0;
|
|
65272
65270
|
this.options.forEach(option => {
|
|
65273
65271
|
const proxyOption = option.proxy
|
|
65274
|
-
|
|
65272
|
+
?? (option instanceof HTMLOptionElement
|
|
65275
65273
|
? option.cloneNode()
|
|
65276
65274
|
: null);
|
|
65277
|
-
if (proxyOption) {
|
|
65275
|
+
if (proxyOption !== null) {
|
|
65278
65276
|
this.proxy.options.add(proxyOption);
|
|
65279
65277
|
}
|
|
65280
65278
|
});
|
|
@@ -65302,7 +65300,7 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
65302
65300
|
return;
|
|
65303
65301
|
}
|
|
65304
65302
|
const selectedOption = this.firstSelectedOption;
|
|
65305
|
-
if (selectedOption) {
|
|
65303
|
+
if (selectedOption !== null) {
|
|
65306
65304
|
this.selectedOptionObserver?.observe(selectedOption, {
|
|
65307
65305
|
characterData: true,
|
|
65308
65306
|
subtree: true,
|
|
@@ -65441,7 +65439,9 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
65441
65439
|
flex-direction: column;
|
|
65442
65440
|
cursor: pointer;
|
|
65443
65441
|
--ni-private-switch-height: 24px;
|
|
65444
|
-
--ni-private-switch-indicator-size:
|
|
65442
|
+
--ni-private-switch-indicator-size: 24px;
|
|
65443
|
+
--ni-private-switch-indicator-inner-size: 18px;
|
|
65444
|
+
--ni-private-switch-indicator-margin: -2px;
|
|
65445
65445
|
padding-bottom: calc(
|
|
65446
65446
|
${controlHeight} - var(--ni-private-switch-height)
|
|
65447
65447
|
);
|
|
@@ -65479,20 +65479,36 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
65479
65479
|
display: flex;
|
|
65480
65480
|
height: var(--ni-private-switch-height);
|
|
65481
65481
|
width: calc(var(--ni-private-switch-height) * 2);
|
|
65482
|
-
background-color:
|
|
65482
|
+
background-color: var(--ni-private-switch-background-color);
|
|
65483
65483
|
border-radius: calc(var(--ni-private-switch-height) / 2);
|
|
65484
65484
|
align-items: center;
|
|
65485
|
-
border: calc(${borderWidth}
|
|
65485
|
+
border: calc(${borderWidth}) solid transparent;
|
|
65486
65486
|
}
|
|
65487
65487
|
|
|
65488
|
-
:host([
|
|
65489
|
-
background-color: var(--ni-private-switch-background-
|
|
65488
|
+
:host([aria-checked='true']) .switch {
|
|
65489
|
+
background-color: var(--ni-private-switch-background-selected-color);
|
|
65490
|
+
}
|
|
65491
|
+
|
|
65492
|
+
:host([aria-checked='true']:hover) .switch {
|
|
65493
|
+
background-color: var(--ni-private-switch-background-selected-rollover-color);
|
|
65490
65494
|
}
|
|
65491
65495
|
|
|
65492
65496
|
:host(${focusVisible}) .switch {
|
|
65493
65497
|
border-color: ${borderHoverColor};
|
|
65494
65498
|
}
|
|
65495
65499
|
|
|
65500
|
+
:host(${focusVisible}[aria-checked='true']) .switch {
|
|
65501
|
+
background-color: var(--ni-private-switch-background-selected-rollover-color);
|
|
65502
|
+
}
|
|
65503
|
+
|
|
65504
|
+
:host([disabled]) .switch {
|
|
65505
|
+
background-color: var(--ni-private-switch-background-disabled-color);
|
|
65506
|
+
}
|
|
65507
|
+
|
|
65508
|
+
:host([disabled]:hover) .switch {
|
|
65509
|
+
background-color: var(--ni-private-switch-background-disabled-color);
|
|
65510
|
+
}
|
|
65511
|
+
|
|
65496
65512
|
.checked-indicator-spacer {
|
|
65497
65513
|
flex-grow: 0;
|
|
65498
65514
|
transition: flex-grow ${smallDelay} ease-in-out;
|
|
@@ -65510,51 +65526,81 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
65510
65526
|
width: var(--ni-private-switch-indicator-size);
|
|
65511
65527
|
height: var(--ni-private-switch-indicator-size);
|
|
65512
65528
|
border-radius: calc(var(--ni-private-switch-indicator-size) / 2);
|
|
65513
|
-
margin:
|
|
65514
|
-
calc(
|
|
65515
|
-
var(--ni-private-switch-height) - var(
|
|
65516
|
-
--ni-private-switch-indicator-size
|
|
65517
|
-
)
|
|
65518
|
-
) /
|
|
65519
|
-
2
|
|
65520
|
-
);
|
|
65529
|
+
margin: var(--ni-private-switch-indicator-margin);
|
|
65521
65530
|
border: ${borderWidth} solid
|
|
65522
65531
|
var(--ni-private-switch-indicator-border-color);
|
|
65523
65532
|
}
|
|
65524
65533
|
|
|
65534
|
+
:host([aria-checked='true']) .checked-indicator {
|
|
65535
|
+
border-color: var(--ni-private-switch-indicator-border-selected-color);
|
|
65536
|
+
}
|
|
65537
|
+
|
|
65525
65538
|
:host(:hover) .checked-indicator {
|
|
65526
65539
|
border: calc(${borderWidth} * 2) solid ${borderHoverColor};
|
|
65527
65540
|
}
|
|
65528
65541
|
|
|
65542
|
+
:host(${focusVisible}) .checked-indicator {
|
|
65543
|
+
border: calc(${borderWidth} * 2) solid ${borderHoverColor};
|
|
65544
|
+
}
|
|
65545
|
+
|
|
65529
65546
|
:host([disabled]) .checked-indicator {
|
|
65530
|
-
background-color:
|
|
65531
|
-
--ni-private-switch-indicator-background-disabled-color
|
|
65532
|
-
);
|
|
65547
|
+
background-color: transparent;
|
|
65533
65548
|
border: ${borderWidth} solid
|
|
65534
65549
|
var(--ni-private-switch-indicator-border-disabled-color);
|
|
65535
65550
|
}
|
|
65536
65551
|
|
|
65537
|
-
:host(
|
|
65538
|
-
|
|
65552
|
+
:host([disabled]:hover) .checked-indicator {
|
|
65553
|
+
background-color: transparent;
|
|
65554
|
+
border: ${borderWidth} solid
|
|
65555
|
+
var(--ni-private-switch-indicator-border-disabled-color);
|
|
65539
65556
|
}
|
|
65540
65557
|
|
|
65541
|
-
.checked-indicator
|
|
65542
|
-
|
|
65543
|
-
|
|
65544
|
-
|
|
65545
|
-
|
|
65558
|
+
:host([disabled]${focusVisible}) .checked-indicator {
|
|
65559
|
+
background-color: transparent;
|
|
65560
|
+
border: ${borderWidth} solid
|
|
65561
|
+
var(--ni-private-switch-indicator-border-disabled-color);
|
|
65562
|
+
}
|
|
65563
|
+
|
|
65564
|
+
:host([disabled]:active) .checked-indicator-inner {
|
|
65565
|
+
background-color: var(
|
|
65566
|
+
--ni-private-switch-indicator-border-disabled-color
|
|
65567
|
+
);
|
|
65546
65568
|
opacity: 0;
|
|
65547
|
-
transition: opacity ${smallDelay} ease-in-out;
|
|
65548
65569
|
}
|
|
65549
65570
|
|
|
65550
|
-
:host([disabled]) .checked-indicator-inner {
|
|
65571
|
+
:host([disabled]${focusVisible}) .checked-indicator-inner {
|
|
65551
65572
|
background-color: var(
|
|
65552
65573
|
--ni-private-switch-indicator-border-disabled-color
|
|
65553
65574
|
);
|
|
65575
|
+
opacity: 0;
|
|
65576
|
+
}
|
|
65577
|
+
|
|
65578
|
+
.checked-indicator-inner {
|
|
65579
|
+
width: var(--ni-private-switch-indicator-inner-size);
|
|
65580
|
+
height: var(--ni-private-switch-indicator-inner-size);
|
|
65581
|
+
border-radius: calc(var(--ni-private-switch-indicator-inner-size) / 2);
|
|
65582
|
+
opacity: 0;
|
|
65554
65583
|
}
|
|
65555
65584
|
|
|
65556
65585
|
:host([aria-checked='true']) .checked-indicator-inner {
|
|
65586
|
+
opacity: 0;
|
|
65587
|
+
}
|
|
65588
|
+
|
|
65589
|
+
:host(${focusVisible}) .checked-indicator-inner {
|
|
65590
|
+
opacity: 1;
|
|
65591
|
+
background-color: var(--ni-private-switch-indicator-background-color);
|
|
65592
|
+
border: 1px solid var(--ni-private-switch-indicator-border-selected-color);
|
|
65593
|
+
}
|
|
65594
|
+
|
|
65595
|
+
:host(:active) .checked-indicator-inner {
|
|
65557
65596
|
opacity: 1;
|
|
65597
|
+
background-color: var(--ni-private-switch-indicator-background-active-color);
|
|
65598
|
+
}
|
|
65599
|
+
|
|
65600
|
+
:host([disabled]) .checked-indicator-inner {
|
|
65601
|
+
background-color: var(
|
|
65602
|
+
--ni-private-switch-indicator-border-disabled-color
|
|
65603
|
+
);
|
|
65558
65604
|
}
|
|
65559
65605
|
|
|
65560
65606
|
slot[name='checked-message']::slotted(*) {
|
|
@@ -65569,26 +65615,43 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
65569
65615
|
}
|
|
65570
65616
|
`.withBehaviors(themeBehavior(Theme.light, css `
|
|
65571
65617
|
:host {
|
|
65618
|
+
--ni-private-switch-background-color: ${hexToRgbaCssColor(Black91, 0.1)};
|
|
65572
65619
|
--ni-private-switch-background-disabled-color: ${hexToRgbaCssColor(Black91, 0.07)};
|
|
65620
|
+
--ni-private-switch-background-selected-color: ${hexToRgbaCssColor(DigitalGreenLight, 0.6)};
|
|
65621
|
+
--ni-private-switch-background-selected-rollover-color: ${hexToRgbaCssColor(DigitalGreenLight, 0.3)};
|
|
65573
65622
|
--ni-private-switch-indicator-background-color: ${White};
|
|
65574
|
-
--ni-private-switch-indicator-background-disabled-color: ${hexToRgbaCssColor(
|
|
65575
|
-
--ni-private-switch-indicator-
|
|
65576
|
-
|
|
65623
|
+
--ni-private-switch-indicator-background-disabled-color: ${hexToRgbaCssColor(Black91, 0.15)};
|
|
65624
|
+
--ni-private-switch-indicator-background-active-color: ${hexToRgbaCssColor(DigitalGreenLight, 0.3)};
|
|
65625
|
+
|
|
65626
|
+
--ni-private-switch-indicator-border-color: ${hexToRgbaCssColor(Black91, 0.3)};
|
|
65627
|
+
--ni-private-switch-indicator-border-selected-color: ${DigitalGreenLight};
|
|
65628
|
+
--ni-private-switch-indicator-border-disabled-color: ${hexToRgbaCssColor(Black91, 0.15)};
|
|
65629
|
+
|
|
65577
65630
|
}
|
|
65578
65631
|
`), themeBehavior(Theme.dark, css `
|
|
65579
65632
|
:host {
|
|
65633
|
+
--ni-private-switch-background-color: ${hexToRgbaCssColor(Black15, 0.1)};
|
|
65580
65634
|
--ni-private-switch-background-disabled-color: ${hexToRgbaCssColor(Black15, 0.07)};
|
|
65581
|
-
--ni-private-switch-
|
|
65582
|
-
--ni-private-switch-
|
|
65583
|
-
--ni-private-switch-indicator-
|
|
65584
|
-
--ni-private-switch-indicator-
|
|
65635
|
+
--ni-private-switch-background-selected-color: ${hexToRgbaCssColor(PowerGreen, 0.6)};
|
|
65636
|
+
--ni-private-switch-background-selected-rollover-color: ${hexToRgbaCssColor(PowerGreen, 0.3)};
|
|
65637
|
+
--ni-private-switch-indicator-background-color: ${Black75};
|
|
65638
|
+
--ni-private-switch-indicator-background-disabled-color: ${hexToRgbaCssColor(Black15, 0.1)};
|
|
65639
|
+
--ni-private-switch-indicator-background-active-color: ${hexToRgbaCssColor(PowerGreen, 0.3)};
|
|
65640
|
+
--ni-private-switch-indicator-border-color: ${hexToRgbaCssColor(Black15, 0.3)};
|
|
65641
|
+
--ni-private-switch-indicator-border-selected-color: ${PowerGreen};
|
|
65642
|
+
--ni-private-switch-indicator-border-disabled-color: ${hexToRgbaCssColor(Black15, 0.15)};
|
|
65585
65643
|
}
|
|
65586
65644
|
`), themeBehavior(Theme.color, css `
|
|
65587
65645
|
:host {
|
|
65646
|
+
--ni-private-switch-background-color: ${hexToRgbaCssColor(White, 0.1)};
|
|
65588
65647
|
--ni-private-switch-background-disabled-color: ${hexToRgbaCssColor(White, 0.07)};
|
|
65589
|
-
--ni-private-switch-
|
|
65648
|
+
--ni-private-switch-background-selected-color: ${hexToRgbaCssColor(White, 0.6)};
|
|
65649
|
+
--ni-private-switch-background-selected-rollover-color: ${hexToRgbaCssColor(White, 0.3)};
|
|
65650
|
+
--ni-private-switch-indicator-background-color: ${hexToRgbaCssColor(White, 0.3)};
|
|
65590
65651
|
--ni-private-switch-indicator-background-disabled-color: ${hexToRgbaCssColor(White, 0.1)};
|
|
65591
|
-
--ni-private-switch-indicator-
|
|
65652
|
+
--ni-private-switch-indicator-background-active-color: ${hexToRgbaCssColor(White, 0.3)};
|
|
65653
|
+
--ni-private-switch-indicator-border-color: ${hexToRgbaCssColor(White, 0.3)};
|
|
65654
|
+
--ni-private-switch-indicator-border-selected-color: ${White} ;
|
|
65592
65655
|
--ni-private-switch-indicator-border-disabled-color: ${hexToRgbaCssColor(White, 0.3)};
|
|
65593
65656
|
}
|
|
65594
65657
|
`));
|
|
@@ -65606,7 +65669,7 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
65606
65669
|
>
|
|
65607
65670
|
<label
|
|
65608
65671
|
part="label"
|
|
65609
|
-
class="${x => (x.defaultSlottedNodes?.length ? 'label' : 'label label__hidden')}"
|
|
65672
|
+
class="${x => (x.defaultSlottedNodes?.length > 0 ? 'label' : 'label label__hidden')}"
|
|
65610
65673
|
>
|
|
65611
65674
|
<slot ${slotted('defaultSlottedNodes')}></slot>
|
|
65612
65675
|
</label>
|
|
@@ -69408,7 +69471,7 @@ ${nextLine.slice(indentLevel + 2)}`;
|
|
|
69408
69471
|
};
|
|
69409
69472
|
}
|
|
69410
69473
|
isValid() {
|
|
69411
|
-
return Object.values(this.getValidity()).every(x => x
|
|
69474
|
+
return Object.values(this.getValidity()).every(x => !x);
|
|
69412
69475
|
}
|
|
69413
69476
|
areRecordIdsValid() {
|
|
69414
69477
|
const validity = this.getValidity();
|
|
@@ -72135,7 +72198,7 @@ focus outline in that case.
|
|
|
72135
72198
|
return this.getVisibleColumns()
|
|
72136
72199
|
.map(column => {
|
|
72137
72200
|
const { minPixelWidth, currentPixelWidth, currentFractionalWidth } = column.columnInternals;
|
|
72138
|
-
if (currentPixelWidth) {
|
|
72201
|
+
if (currentPixelWidth !== undefined) {
|
|
72139
72202
|
const coercedPixelWidth = Math.max(minPixelWidth, currentPixelWidth);
|
|
72140
72203
|
return `${coercedPixelWidth}px`;
|
|
72141
72204
|
}
|
|
@@ -72597,7 +72660,7 @@ focus outline in that case.
|
|
|
72597
72660
|
const allRows = [];
|
|
72598
72661
|
for (const row of topLevelRows) {
|
|
72599
72662
|
allRows.push(row);
|
|
72600
|
-
if (row.subRows?.length) {
|
|
72663
|
+
if (row.subRows?.length > 0) {
|
|
72601
72664
|
allRows.push(...this.getOrderedRows(row.subRows));
|
|
72602
72665
|
}
|
|
72603
72666
|
}
|
|
@@ -72852,10 +72915,8 @@ focus outline in that case.
|
|
|
72852
72915
|
originalIndex: undefined
|
|
72853
72916
|
};
|
|
72854
72917
|
}
|
|
72855
|
-
//
|
|
72856
|
-
|
|
72857
|
-
orphanIds.delete(itemId);
|
|
72858
|
-
}
|
|
72918
|
+
// delete this item from the orphan set if it is in it
|
|
72919
|
+
orphanIds.delete(itemId);
|
|
72859
72920
|
// add the current item's data to the item in the lookup table
|
|
72860
72921
|
lookup[itemId].clientRecord = item;
|
|
72861
72922
|
const treeItem = lookup[itemId];
|
|
@@ -72875,16 +72936,14 @@ focus outline in that case.
|
|
|
72875
72936
|
clientRecord: undefined,
|
|
72876
72937
|
originalIndex: undefined
|
|
72877
72938
|
};
|
|
72878
|
-
//
|
|
72879
|
-
|
|
72880
|
-
orphanIds.add(parentId);
|
|
72881
|
-
}
|
|
72939
|
+
// add the generated parent to the orphan list
|
|
72940
|
+
orphanIds.add(parentId);
|
|
72882
72941
|
}
|
|
72883
72942
|
// add the current item to the parent
|
|
72884
72943
|
lookup[parentId].subRows.push(treeItem);
|
|
72885
72944
|
}
|
|
72886
72945
|
}
|
|
72887
|
-
if (orphanIds
|
|
72946
|
+
if (orphanIds.size > 0) {
|
|
72888
72947
|
const orphans = Array.from(orphanIds.values()).join(',');
|
|
72889
72948
|
throw new Error(`The items array contains orphans that point to the following parentIds: [${orphans}]. These parentIds do not exist in the items array.`);
|
|
72890
72949
|
}
|
|
@@ -72899,7 +72958,7 @@ focus outline in that case.
|
|
|
72899
72958
|
* @returns Number of nodes in the tree
|
|
72900
72959
|
*/
|
|
72901
72960
|
function countNodes(tree) {
|
|
72902
|
-
return tree.reduce((sum, n) => sum + 1 + (n.subRows
|
|
72961
|
+
return tree.reduce((sum, n) => sum + 1 + (n.subRows ? countNodes(n.subRows) : 0), 0);
|
|
72903
72962
|
}
|
|
72904
72963
|
|
|
72905
72964
|
/**
|
|
@@ -74965,7 +75024,7 @@ focus outline in that case.
|
|
|
74965
75024
|
calculateTanStackSortState() {
|
|
74966
75025
|
const sortedColumns = this.getColumnsParticipatingInSorting().sort((x, y) => x.columnInternals.currentSortIndex
|
|
74967
75026
|
- y.columnInternals.currentSortIndex);
|
|
74968
|
-
this.firstSortedColumn = sortedColumns.length
|
|
75027
|
+
this.firstSortedColumn = sortedColumns.length > 0
|
|
74969
75028
|
? sortedColumns[0]
|
|
74970
75029
|
: undefined;
|
|
74971
75030
|
return sortedColumns.map(column => {
|
|
@@ -76169,13 +76228,13 @@ focus outline in that case.
|
|
|
76169
76228
|
}
|
|
76170
76229
|
const hours = Math.floor((milliseconds / millisecondsPerHour) % 24);
|
|
76171
76230
|
remainingTime -= hours * millisecondsPerHour;
|
|
76172
|
-
if (hours) {
|
|
76231
|
+
if (hours !== 0) {
|
|
76173
76232
|
const formattedHours = this.hoursFormatter.format(hours);
|
|
76174
76233
|
result.push(formattedHours);
|
|
76175
76234
|
}
|
|
76176
76235
|
const minutes = Math.floor((milliseconds / millisecondsPerMinute) % 60);
|
|
76177
76236
|
remainingTime -= minutes * millisecondsPerMinute;
|
|
76178
|
-
if (minutes) {
|
|
76237
|
+
if (minutes !== 0) {
|
|
76179
76238
|
const formattedMinutes = this.minutesFormatter.format(minutes);
|
|
76180
76239
|
result.push(formattedMinutes);
|
|
76181
76240
|
}
|
|
@@ -78025,7 +78084,7 @@ focus outline in that case.
|
|
|
78025
78084
|
<label
|
|
78026
78085
|
part="label"
|
|
78027
78086
|
for="control"
|
|
78028
|
-
class="${x => (x.defaultSlottedNodes?.length ? 'label' : 'label label__hidden')}"
|
|
78087
|
+
class="${x => (x.defaultSlottedNodes?.length > 0 ? 'label' : 'label label__hidden')}"
|
|
78029
78088
|
>
|
|
78030
78089
|
<slot ${slotted('defaultSlottedNodes')}></slot>
|
|
78031
78090
|
</label>
|
|
@@ -78460,7 +78519,7 @@ focus outline in that case.
|
|
|
78460
78519
|
const labelTemplate = createRequiredVisibleLabelTemplate(html `<label
|
|
78461
78520
|
part="label"
|
|
78462
78521
|
for="control"
|
|
78463
|
-
class="${x => (x.defaultSlottedNodes?.length ? 'label' : 'label label__hidden')}"
|
|
78522
|
+
class="${x => (x.defaultSlottedNodes?.length > 0 ? 'label' : 'label label__hidden')}"
|
|
78464
78523
|
>
|
|
78465
78524
|
<slot
|
|
78466
78525
|
${slotted({
|
|
@@ -95177,7 +95236,7 @@ focus outline in that case.
|
|
|
95177
95236
|
}
|
|
95178
95237
|
const dieWidth = this.wafermap.dataManager.dieDimensions.width;
|
|
95179
95238
|
const dieHeight = this.wafermap.dataManager.dieDimensions.height;
|
|
95180
|
-
const dieSize = dieWidth * dieHeight * (this.wafermap.transform.k
|
|
95239
|
+
const dieSize = dieWidth * dieHeight * (this.wafermap.transform.k !== 0 ? this.wafermap.transform.k : 1);
|
|
95181
95240
|
if (dieSize >= this.minDieDim) {
|
|
95182
95241
|
const fontsize = this.wafermap.dataManager.labelsFontSize;
|
|
95183
95242
|
const context = this.wafermap.canvasContext;
|
|
@@ -95371,7 +95430,7 @@ focus outline in that case.
|
|
|
95371
95430
|
};
|
|
95372
95431
|
}
|
|
95373
95432
|
isValid() {
|
|
95374
|
-
return Object.values(this.getValidity()).every(x => x
|
|
95433
|
+
return Object.values(this.getValidity()).every(x => !x);
|
|
95375
95434
|
}
|
|
95376
95435
|
validateGridDimensions() {
|
|
95377
95436
|
this.invalidGridDimensions = false;
|
|
@@ -95766,7 +95825,7 @@ focus outline in that case.
|
|
|
95766
95825
|
.join("-");
|
|
95767
95826
|
}
|
|
95768
95827
|
|
|
95769
|
-
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";
|
|
95828
|
+
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";
|
|
95770
95829
|
|
|
95771
95830
|
let url;
|
|
95772
95831
|
/**
|
|
@@ -95827,10 +95886,9 @@ focus outline in that case.
|
|
|
95827
95886
|
});
|
|
95828
95887
|
await this.matrixRenderer.drawWafer();
|
|
95829
95888
|
if (!snapshot.dieLabelsHidden
|
|
95830
|
-
&& snapshot.dieDimensions
|
|
95831
95889
|
&& snapshot.dieDimensions.width
|
|
95832
95890
|
* snapshot.dieDimensions.height
|
|
95833
|
-
* (snapshot.transform.k
|
|
95891
|
+
* (snapshot.transform.k !== 0 ? snapshot.transform.k : 1)
|
|
95834
95892
|
>= this.minDieDim) {
|
|
95835
95893
|
await this.matrixRenderer.drawText();
|
|
95836
95894
|
}
|
|
@@ -96788,7 +96846,7 @@ focus outline in that case.
|
|
|
96788
96846
|
this.inputEmpty = true;
|
|
96789
96847
|
}
|
|
96790
96848
|
slottedInputElementsChanged(_prev, next) {
|
|
96791
|
-
this.inputEmpty =
|
|
96849
|
+
this.inputEmpty = next === undefined || next.length === 0;
|
|
96792
96850
|
}
|
|
96793
96851
|
}
|
|
96794
96852
|
__decorate([
|
|
@@ -97128,7 +97186,7 @@ focus outline in that case.
|
|
|
97128
97186
|
this.footerActionsIsEmpty = true;
|
|
97129
97187
|
}
|
|
97130
97188
|
slottedFooterActionsElementsChanged(_prev, next) {
|
|
97131
|
-
this.footerActionsIsEmpty =
|
|
97189
|
+
this.footerActionsIsEmpty = next === undefined || next.length === 0;
|
|
97132
97190
|
}
|
|
97133
97191
|
}
|
|
97134
97192
|
__decorate([
|
|
@@ -97232,7 +97290,7 @@ focus outline in that case.
|
|
|
97232
97290
|
this.footerActionsIsEmpty = true;
|
|
97233
97291
|
}
|
|
97234
97292
|
slottedFooterActionsElementsChanged(_prev, next) {
|
|
97235
|
-
this.footerActionsIsEmpty =
|
|
97293
|
+
this.footerActionsIsEmpty = next === undefined || next.length === 0;
|
|
97236
97294
|
}
|
|
97237
97295
|
}
|
|
97238
97296
|
__decorate([
|