@skyux/core 6.0.0 → 6.0.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.
@@ -1809,7 +1809,7 @@ class SkyNumericService {
1809
1809
  return this._locale || 'en-US';
1810
1810
  }
1811
1811
  /**
1812
- * Shortens with or without symbol (K/M/B/T) depending on value of number.
1812
+ * Formats a number based on the provided options.
1813
1813
  * @param value The number to format.
1814
1814
  * @param options Format options.
1815
1815
  */
@@ -1974,10 +1974,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
1974
1974
  * M for millions, B for billions, and T for trillions. The pipe also formats for currency.
1975
1975
  * Be sure you have a space after the two curly brackets opening the pipe and
1976
1976
  * a space before the two curly brackets closing the pipe or it will not work.
1977
- * Usage:
1978
- * ```
1979
- * {{ value | skyNumeric(config) }}
1980
- * ```
1981
1977
  */
1982
1978
  class SkyNumericPipe {
1983
1979
  constructor(localeProvider, numericService, changeDetector) {
@@ -1998,6 +1994,9 @@ class SkyNumericPipe {
1998
1994
  this.ngUnsubscribe.next();
1999
1995
  this.ngUnsubscribe.complete();
2000
1996
  }
1997
+ /**
1998
+ * Formats a number based on the provided options.
1999
+ */
2001
2000
  transform(value, config) {
2002
2001
  const newCacheKey = (config ? JSON.stringify(config, Object.keys(config).sort()) : '') +
2003
2002
  `${value}_${config?.locale || this.providerLocale}`;
@@ -2555,7 +2554,7 @@ class SkyResizeObserverMediaQueryService {
2555
2554
  this.resizeObserverService = resizeObserverService;
2556
2555
  this._breakpoints = [
2557
2556
  {
2558
- check: (width) => width <= 767,
2557
+ check: (width) => width > 0 && width <= 767,
2559
2558
  name: SkyMediaBreakpoints.xs,
2560
2559
  },
2561
2560
  {
@@ -2608,11 +2607,7 @@ class SkyResizeObserverMediaQueryService {
2608
2607
  this._stopListening.next();
2609
2608
  }
2610
2609
  this._target = element;
2611
- const width = element.nativeElement.offsetWidth;
2612
- if (width) {
2613
- const breakpoint = this.checkBreakpoint(width);
2614
- this.updateBreakpoint(breakpoint);
2615
- }
2610
+ this.checkWidth(element);
2616
2611
  this.resizeObserverService
2617
2612
  .observe(element)
2618
2613
  .pipe(takeUntil(this._stopListening))
@@ -2637,7 +2632,9 @@ class SkyResizeObserverMediaQueryService {
2637
2632
  subscribe(listener) {
2638
2633
  return this._currentBreakpointObservable
2639
2634
  .pipe(takeUntil(this._stopListening))
2640
- .subscribe(listener);
2635
+ .subscribe((value) => {
2636
+ listener(value);
2637
+ });
2641
2638
  }
2642
2639
  updateBreakpoint(breakpoint) {
2643
2640
  this._currentBreakpoint = breakpoint;
@@ -2647,6 +2644,14 @@ class SkyResizeObserverMediaQueryService {
2647
2644
  return this._breakpoints.find((breakpoint) => breakpoint.check(width))
2648
2645
  ?.name;
2649
2646
  }
2647
+ checkWidth(element) {
2648
+ const width = element.nativeElement.offsetWidth || 0;
2649
+ const breakpoint = this.checkBreakpoint(width);
2650
+ /* istanbul ignore else */
2651
+ if (breakpoint !== this._currentBreakpoint) {
2652
+ this.updateBreakpoint(breakpoint);
2653
+ }
2654
+ }
2650
2655
  }
2651
2656
  SkyResizeObserverMediaQueryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyResizeObserverMediaQueryService, deps: [{ token: SkyResizeObserverService }], target: i0.ɵɵFactoryTarget.Injectable });
2652
2657
  SkyResizeObserverMediaQueryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyResizeObserverMediaQueryService, providedIn: 'any' });