@ni/ok-components 1.18.2 → 1.18.4

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.
@@ -6573,7 +6573,7 @@
6573
6573
  */
6574
6574
  this.stopAutoUpdateEventListeners = () => {
6575
6575
  window.removeEventListener(eventResize, this.update);
6576
- window.removeEventListener(eventScroll, this.update);
6576
+ window.removeEventListener(eventScroll, this.update, { capture: true });
6577
6577
  if (this.resizeDetector !== null && this.viewportElement !== null) {
6578
6578
  this.resizeDetector.unobserve(this.viewportElement);
6579
6579
  }
@@ -28306,10 +28306,16 @@ so this becomes the fallback color for the slot */ ''}
28306
28306
  this.toggleButton.focus();
28307
28307
  };
28308
28308
  }
28309
+ connectedCallback() {
28310
+ super.connectedCallback();
28311
+ if (this.region) {
28312
+ this.region.addEventListener(eventChange, this.menuChangeHandler, { capture: true });
28313
+ }
28314
+ }
28309
28315
  disconnectedCallback() {
28310
28316
  super.disconnectedCallback();
28311
28317
  if (this.region) {
28312
- this.region.removeEventListener(eventChange, this.menuChangeHandler);
28318
+ this.region.removeEventListener(eventChange, this.menuChangeHandler, { capture: true });
28313
28319
  }
28314
28320
  }
28315
28321
  toggleButtonChanged(_prev, _next) {
@@ -28319,7 +28325,9 @@ so this becomes the fallback color for the slot */ ''}
28319
28325
  }
28320
28326
  regionChanged(prev, _next) {
28321
28327
  if (prev) {
28322
- prev.removeEventListener(eventChange, this.menuChangeHandler);
28328
+ prev.removeEventListener(eventChange, this.menuChangeHandler, {
28329
+ capture: true
28330
+ });
28323
28331
  }
28324
28332
  if (this.region) {
28325
28333
  if (this.toggleButton) {
@@ -111271,8 +111279,13 @@ focus outline in that case.
111271
111279
  return '';
111272
111280
  }
111273
111281
  if (type !== 'date') {
111274
- const time = text.slice(length + 1);
111275
- const milliseconds = maskitoParseTime(time, timeFormat(locale, mode));
111282
+ // maskitoParseTime matches the day period case-sensitively, so compare in lower case.
111283
+ const timeParams = timeFormat(locale, mode);
111284
+ const [am, pm] = timeParams.dayPeriod;
111285
+ const milliseconds = maskitoParseTime(text.slice(length + 1).toLocaleLowerCase(locale), {
111286
+ ...timeParams,
111287
+ dayPeriod: [am.toLocaleLowerCase(locale), pm.toLocaleLowerCase(locale)]
111288
+ });
111276
111289
  if (!Number.isFinite(milliseconds)) {
111277
111290
  return '';
111278
111291
  }
@@ -111663,7 +111676,7 @@ focus outline in that case.
111663
111676
  </div>
111664
111677
  ${when(x => !x.open, entryErrorTemplate)}
111665
111678
  ${when(x => x.open, html `
111666
- <${anchoredRegionTag} ${ref('region')} auto-update-mode="auto"
111679
+ <${anchoredRegionTag} ${ref('region')} auto-update-mode="auto" fixed-placement
111667
111680
  @loaded="${x => x.focusDay(true)}"
111668
111681
  vertical-default-position="bottom" vertical-positioning-mode="dynamic"
111669
111682
  horizontal-inset
@@ -114984,7 +114997,7 @@ focus outline in that case.
114984
114997
  /** @internal */
114985
114998
  regionChanged(prev, _next) {
114986
114999
  if (prev) {
114987
- prev.removeEventListener('change', this.menuChangeHandler);
115000
+ prev.removeEventListener('change', this.menuChangeHandler, { capture: true });
114988
115001
  }
114989
115002
  if (this.region) {
114990
115003
  this.region.anchorElement = this.toggleButton ?? this;
@@ -115182,7 +115195,7 @@ focus outline in that case.
115182
115195
  /** @internal */
115183
115196
  regionChanged(prev, _next) {
115184
115197
  if (prev) {
115185
- prev.removeEventListener('change', this.menuChangeHandler);
115198
+ prev.removeEventListener('change', this.menuChangeHandler, { capture: true });
115186
115199
  }
115187
115200
  if (this.region) {
115188
115201
  this.region.anchorElement = this.toggleButton ?? this;