@skyux/core 5.9.3 → 5.9.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.
@@ -2187,7 +2187,7 @@
2187
2187
  configurable: true
2188
2188
  });
2189
2189
  /**
2190
- * Shortens with or without symbol (K/M/B/T) depending on value of number.
2190
+ * Formats a number based on the provided options.
2191
2191
  * @param value The number to format.
2192
2192
  * @param options Format options.
2193
2193
  */
@@ -2357,10 +2357,6 @@
2357
2357
  * M for millions, B for billions, and T for trillions. The pipe also formats for currency.
2358
2358
  * Be sure you have a space after the two curly brackets opening the pipe and
2359
2359
  * a space before the two curly brackets closing the pipe or it will not work.
2360
- * Usage:
2361
- * ```
2362
- * {{ value | skyNumeric(config) }}
2363
- * ```
2364
2360
  */
2365
2361
  var SkyNumericPipe = /** @class */ (function () {
2366
2362
  function SkyNumericPipe(localeProvider, numericService, changeDetector) {
@@ -2382,6 +2378,9 @@
2382
2378
  this.ngUnsubscribe.next();
2383
2379
  this.ngUnsubscribe.complete();
2384
2380
  };
2381
+ /**
2382
+ * Formats a number based on the provided options.
2383
+ */
2385
2384
  SkyNumericPipe.prototype.transform = function (value, config) {
2386
2385
  var _a;
2387
2386
  var newCacheKey = (config ? JSON.stringify(config, Object.keys(config).sort()) : '') +
@@ -2994,7 +2993,7 @@
2994
2993
  this.resizeObserverService = resizeObserverService;
2995
2994
  this._breakpoints = [
2996
2995
  {
2997
- check: function (width) { return width <= 767; },
2996
+ check: function (width) { return width > 0 && width <= 767; },
2998
2997
  name: exports.SkyMediaBreakpoints.xs,
2999
2998
  },
3000
2999
  {
@@ -3052,12 +3051,8 @@
3052
3051
  this._stopListening.next();
3053
3052
  }
3054
3053
  this._target = element;
3055
- var width = element.nativeElement.offsetWidth;
3056
- if (width) {
3057
- var breakpoint = this.checkBreakpoint(width);
3058
- this.updateBreakpoint(breakpoint);
3059
- }
3060
- this._resizeSubscription = this.resizeObserverService
3054
+ this.checkWidth(element);
3055
+ this.resizeObserverService
3061
3056
  .observe(element)
3062
3057
  .pipe(operators.takeUntil(this._stopListening))
3063
3058
  .subscribe(function (value) {
@@ -3081,7 +3076,9 @@
3081
3076
  SkyResizeObserverMediaQueryService.prototype.subscribe = function (listener) {
3082
3077
  return this._currentBreakpointObservable
3083
3078
  .pipe(operators.takeUntil(this._stopListening))
3084
- .subscribe(listener);
3079
+ .subscribe(function (value) {
3080
+ listener(value);
3081
+ });
3085
3082
  };
3086
3083
  SkyResizeObserverMediaQueryService.prototype.updateBreakpoint = function (breakpoint) {
3087
3084
  this._currentBreakpoint = breakpoint;
@@ -3091,6 +3088,14 @@
3091
3088
  var _a;
3092
3089
  return (_a = this._breakpoints.find(function (breakpoint) { return breakpoint.check(width); })) === null || _a === void 0 ? void 0 : _a.name;
3093
3090
  };
3091
+ SkyResizeObserverMediaQueryService.prototype.checkWidth = function (element) {
3092
+ var width = element.nativeElement.offsetWidth || 0;
3093
+ var breakpoint = this.checkBreakpoint(width);
3094
+ /* istanbul ignore else */
3095
+ if (breakpoint !== this._currentBreakpoint) {
3096
+ this.updateBreakpoint(breakpoint);
3097
+ }
3098
+ };
3094
3099
  return SkyResizeObserverMediaQueryService;
3095
3100
  }());
3096
3101
  SkyResizeObserverMediaQueryService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: SkyResizeObserverMediaQueryService, deps: [{ token: SkyResizeObserverService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });