@ni/nimble-components 20.16.0 → 20.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16274,7 +16274,7 @@
16274
16274
 
16275
16275
  /**
16276
16276
  * Do not edit directly
16277
- * Generated on Mon, 11 Dec 2023 17:20:37 GMT
16277
+ * Generated on Wed, 13 Dec 2023 13:12:27 GMT
16278
16278
  */
16279
16279
 
16280
16280
  const Information100DarkUi = "#a46eff";
@@ -17009,6 +17009,10 @@
17009
17009
  font: ${linkFont};
17010
17010
  }
17011
17011
 
17012
+ .top-container {
17013
+ display: contents;
17014
+ }
17015
+
17012
17016
  [part='start'] {
17013
17017
  display: none;
17014
17018
  }
@@ -17084,7 +17088,13 @@
17084
17088
  `;
17085
17089
 
17086
17090
  // prettier-ignore
17087
- const template$C = (_context, definition) => html `<a
17091
+ const template$C = (_context, definition) => html `${
17092
+ /* top-container div is necessary because setting contenteditable directly on the native anchor instead
17093
+ leaves it focusable, unlike the behavior you get when the anchor is _within_ a contenteditable element.
17094
+ */ ''}<div
17095
+ class="top-container"
17096
+ contenteditable="${x => x.contentEditable}"
17097
+ ><a
17088
17098
  class="control"
17089
17099
  part="control"
17090
17100
  download="${x => x.download}"
@@ -17148,7 +17158,7 @@
17148
17158
  @slotchange="${x => x.handleEndContentChange()}">
17149
17159
  ${definition.end || ''}
17150
17160
  </slot
17151
- ></span></a>`;
17161
+ ></span></a></div>`;
17152
17162
 
17153
17163
  /**
17154
17164
  * A nimble-styled anchor
@@ -17170,6 +17180,9 @@
17170
17180
  __decorate$1([
17171
17181
  attr
17172
17182
  ], Anchor.prototype, "appearance", void 0);
17183
+ __decorate$1([
17184
+ attr({ attribute: 'contenteditable' })
17185
+ ], Anchor.prototype, "contentEditable", void 0);
17173
17186
  // FoundationAnchor already applies the StartEnd mixin, so we don't need to do it here.
17174
17187
  const nimbleAnchor = Anchor.compose({
17175
17188
  baseName: 'anchor',
@@ -76578,31 +76591,23 @@ img.ProseMirror-separator {
76578
76591
  }
76579
76592
  updateDiesRenderInfo() {
76580
76593
  this.d3ColorScale = this.createD3ColorScale(this.wafermap.colorScale, this.wafermap.colorScaleMode);
76594
+ this._diesRenderInfo = this.wafermap.dies
76595
+ .map(die => this.computeDieRenderInfo(die))
76596
+ .filter(info => info !== null);
76597
+ }
76598
+ computeDieRenderInfo(die) {
76581
76599
  const margin = this.dataManager.margin;
76582
- const horizontalScale = this.dataManager.horizontalScale;
76583
- const verticalScale = this.dataManager.verticalScale;
76584
- const colorScaleMode = this.wafermap.colorScaleMode;
76585
- const highlightedValues = this.wafermap.highlightedValues;
76586
- const maxCharacters = this.wafermap.maxCharacters;
76587
- const dieLabelsHidden = this.wafermap.dieLabelsHidden;
76588
- const dieLabelsSuffix = this.wafermap.dieLabelsSuffix;
76589
- this._diesRenderInfo = [];
76590
- for (const die of this.wafermap.dies) {
76591
- const scaledX = horizontalScale(die.x);
76592
- if (scaledX === undefined) {
76593
- continue;
76594
- }
76595
- const scaledY = verticalScale(die.y);
76596
- if (scaledY === undefined) {
76597
- continue;
76598
- }
76599
- this._diesRenderInfo.push({
76600
- x: scaledX + margin.right,
76601
- y: scaledY + margin.top,
76602
- fillStyle: this.calculateFillStyle(die.value, colorScaleMode, highlightedValues),
76603
- text: this.buildLabel(die.value, maxCharacters, dieLabelsHidden, dieLabelsSuffix)
76604
- });
76600
+ const scaledX = this.dataManager.horizontalScale(die.x);
76601
+ const scaledY = this.dataManager.verticalScale(die.y);
76602
+ if (scaledX === undefined || scaledY === undefined) {
76603
+ return null;
76605
76604
  }
76605
+ return {
76606
+ x: scaledX + margin.right,
76607
+ y: scaledY + margin.top,
76608
+ fillStyle: this.calculateFillStyle(die.value, this.wafermap.colorScaleMode, this.wafermap.highlightedTags, die.tags),
76609
+ text: this.buildLabel(die.value, this.wafermap.maxCharacters, this.wafermap.dieLabelsHidden, this.wafermap.dieLabelsSuffix)
76610
+ };
76606
76611
  }
76607
76612
  calculateLabelsFontSize(dieDimensions, maxCharacters) {
76608
76613
  return Math.min(dieDimensions.height, (dieDimensions.width / (Math.max(2, maxCharacters) * 0.5))
@@ -76631,11 +76636,15 @@ img.ProseMirror-separator {
76631
76636
  }
76632
76637
  return label;
76633
76638
  }
76634
- calculateOpacity(selectedValue, highlightedValues) {
76635
- return highlightedValues.length > 0
76636
- && !highlightedValues.some(dieValue => dieValue === selectedValue)
76637
- ? this.nonHighlightedOpacity
76638
- : 1;
76639
+ calculateOpacity(dieTags, highlightedTags) {
76640
+ if (!highlightedTags || highlightedTags.length === 0) {
76641
+ return 1;
76642
+ }
76643
+ const highlightedSet = new Set(highlightedTags);
76644
+ if (dieTags?.some(dieTag => highlightedSet.has(dieTag))) {
76645
+ return 1;
76646
+ }
76647
+ return this.nonHighlightedOpacity;
76639
76648
  }
76640
76649
  isColorScaleLinear(colorScaleMode) {
76641
76650
  return colorScaleMode === WaferMapColorScaleMode.linear;
@@ -76643,7 +76652,7 @@ img.ProseMirror-separator {
76643
76652
  isColorScaleOrdinal(colorScaleMode) {
76644
76653
  return colorScaleMode === WaferMapColorScaleMode.ordinal;
76645
76654
  }
76646
- calculateFillStyle(value, colorScaleMode, highlightedValues) {
76655
+ calculateFillStyle(value, colorScaleMode, highlightedTags, dieTags) {
76647
76656
  let colorValue = this.emptyDieColor;
76648
76657
  if (this.dieHasData(value)) {
76649
76658
  if (isNaN(+value)) {
@@ -76663,7 +76672,7 @@ img.ProseMirror-separator {
76663
76672
  if (rgbColor === null) {
76664
76673
  return this.emptyDieColor;
76665
76674
  }
76666
- rgbColor = new ColorRGBA64(rgbColor.r, rgbColor.g, rgbColor.b, this.calculateOpacity(value, highlightedValues));
76675
+ rgbColor = new ColorRGBA64(rgbColor.r, rgbColor.g, rgbColor.b, this.calculateOpacity(dieTags, highlightedTags));
76667
76676
  return rgbColor.toStringWebRGBA();
76668
76677
  }
76669
76678
  }
@@ -76999,6 +77008,7 @@ img.ProseMirror-separator {
76999
77008
  }
77000
77009
 
77001
77010
  const trackedItems = [
77011
+ 'highlightedTags',
77002
77012
  'canvasWidth',
77003
77013
  'canvasHeight',
77004
77014
  'originLocation',
@@ -77010,7 +77020,6 @@ img.ProseMirror-separator {
77010
77020
  'maxCharacters',
77011
77021
  'colorScale',
77012
77022
  'colorScaleMode',
77013
- 'highlightedValues',
77014
77023
  'dieLabelsHidden',
77015
77024
  'dieLabelsSuffix',
77016
77025
  'transform',
@@ -77027,7 +77036,8 @@ img.ProseMirror-separator {
77027
77036
  this.updateQueued = false;
77028
77037
  }
77029
77038
  get requiresEventsUpdate() {
77030
- return (this.isTracked('canvasWidth')
77039
+ return (this.isTracked('highlightedTags')
77040
+ || this.isTracked('canvasWidth')
77031
77041
  || this.isTracked('canvasHeight')
77032
77042
  || this.isTracked('originLocation')
77033
77043
  || this.isTracked('gridMinX')
@@ -77038,7 +77048,6 @@ img.ProseMirror-separator {
77038
77048
  || this.isTracked('maxCharacters')
77039
77049
  || this.isTracked('colorScale')
77040
77050
  || this.isTracked('colorScaleMode')
77041
- || this.isTracked('highlightedValues')
77042
77051
  || this.isTracked('dieLabelsHidden')
77043
77052
  || this.isTracked('dieLabelsSuffix')
77044
77053
  || this.isTracked('transform'));
@@ -77058,9 +77067,9 @@ img.ProseMirror-separator {
77058
77067
  return this.isTracked('maxCharacters');
77059
77068
  }
77060
77069
  get requiresDiesRenderInfoUpdate() {
77061
- return (this.isTracked('colorScale')
77070
+ return (this.isTracked('highlightedTags')
77071
+ || this.isTracked('colorScale')
77062
77072
  || this.isTracked('colorScaleMode')
77063
- || this.isTracked('highlightedValues')
77064
77073
  || this.isTracked('dieLabelsHidden')
77065
77074
  || this.isTracked('dieLabelsSuffix'));
77066
77075
  }
@@ -77179,7 +77188,7 @@ img.ProseMirror-separator {
77179
77188
  * @internal
77180
77189
  */
77181
77190
  this.hoverHeight = 0;
77182
- this.highlightedValues = [];
77191
+ this.highlightedTags = [];
77183
77192
  this.dies = [];
77184
77193
  this.colorScale = {
77185
77194
  colors: [],
@@ -77293,8 +77302,8 @@ img.ProseMirror-separator {
77293
77302
  this.waferMapUpdateTracker.track('colorScaleMode');
77294
77303
  this.waferMapUpdateTracker.queueUpdate();
77295
77304
  }
77296
- highlightedValuesChanged() {
77297
- this.waferMapUpdateTracker.track('highlightedValues');
77305
+ highlightedTagsChanged() {
77306
+ this.waferMapUpdateTracker.track('highlightedTags');
77298
77307
  this.waferMapUpdateTracker.queueUpdate();
77299
77308
  }
77300
77309
  diesChanged() {
@@ -77379,7 +77388,7 @@ img.ProseMirror-separator {
77379
77388
  ], WaferMap.prototype, "hoverDie", void 0);
77380
77389
  __decorate$1([
77381
77390
  observable
77382
- ], WaferMap.prototype, "highlightedValues", void 0);
77391
+ ], WaferMap.prototype, "highlightedTags", void 0);
77383
77392
  __decorate$1([
77384
77393
  observable
77385
77394
  ], WaferMap.prototype, "dies", void 0);