@skyux/core 6.0.0-beta.9 → 6.0.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.
- package/documentation.json +625 -362
- package/esm2020/lib/modules/numeric/numeric.options.mjs +3 -29
- package/esm2020/lib/modules/numeric/numeric.pipe.mjs +4 -5
- package/esm2020/lib/modules/numeric/numeric.service.mjs +2 -2
- package/esm2020/lib/modules/resize-observer/resize-observer-media-query.service.mjs +14 -8
- package/fesm2015/skyux-core.mjs +19 -40
- package/fesm2015/skyux-core.mjs.map +1 -1
- package/fesm2020/skyux-core.mjs +19 -40
- package/fesm2020/skyux-core.mjs.map +1 -1
- package/lib/modules/numeric/numeric.options.d.ts +17 -11
- package/lib/modules/numeric/numeric.pipe.d.ts +5 -6
- package/lib/modules/numeric/numeric.service.d.ts +3 -3
- package/lib/modules/resize-observer/resize-observer-media-query.service.d.ts +1 -0
- package/package.json +2 -2
package/fesm2020/skyux-core.mjs
CHANGED
@@ -1708,42 +1708,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
1708
1708
|
|
1709
1709
|
/**
|
1710
1710
|
* Provides arguments for the number to format.
|
1711
|
+
* @deprecated Use the `SkyNumericOptions` interface instead.
|
1711
1712
|
*/
|
1712
1713
|
class NumericOptions {
|
1713
1714
|
constructor() {
|
1714
|
-
/**
|
1715
|
-
* Specifies the maximum number of digits after the decimal separator.
|
1716
|
-
* @default 1
|
1717
|
-
*/
|
1718
1715
|
this.digits = 1;
|
1719
|
-
/**
|
1720
|
-
* Specifies how to format the number. Options are `currency` or `number`.
|
1721
|
-
* @default "number"
|
1722
|
-
*/
|
1723
1716
|
this.format = 'number';
|
1724
|
-
/**
|
1725
|
-
* Specifies the format of the currency.
|
1726
|
-
* @default "standard"
|
1727
|
-
*/
|
1728
1717
|
this.currencySign = 'standard';
|
1729
|
-
/**
|
1730
|
-
* Specifies the ISO4217 currency code to use for currency formatting. If you do not specify a
|
1731
|
-
* currency code, the component uses the browser's culture to determine the currency unless your
|
1732
|
-
* SPA provides a different culture with `SkyAppLocaleProvider`.
|
1733
|
-
* @default "USD"
|
1734
|
-
*/
|
1735
1718
|
this.iso = 'USD';
|
1736
|
-
/**
|
1737
|
-
* Indicates whether to shorten numbers to rounded numbers and abbreviation characters
|
1738
|
-
* such as K for thousands, M for millions, B for billions, and T for trillions.
|
1739
|
-
*/
|
1740
1719
|
this.truncate = true;
|
1741
|
-
|
1742
|
-
* Specifies the starting point after which numbers are shortened to rounded numbers
|
1743
|
-
* and abbreviation characters.
|
1744
|
-
* @default 0
|
1745
|
-
*/
|
1746
|
-
this.truncateAfter = 0;
|
1720
|
+
this.truncateAfter = 1000;
|
1747
1721
|
}
|
1748
1722
|
}
|
1749
1723
|
|
@@ -1835,7 +1809,7 @@ class SkyNumericService {
|
|
1835
1809
|
return this._locale || 'en-US';
|
1836
1810
|
}
|
1837
1811
|
/**
|
1838
|
-
*
|
1812
|
+
* Formats a number based on the provided options.
|
1839
1813
|
* @param value The number to format.
|
1840
1814
|
* @param options Format options.
|
1841
1815
|
*/
|
@@ -2000,10 +1974,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
2000
1974
|
* M for millions, B for billions, and T for trillions. The pipe also formats for currency.
|
2001
1975
|
* Be sure you have a space after the two curly brackets opening the pipe and
|
2002
1976
|
* a space before the two curly brackets closing the pipe or it will not work.
|
2003
|
-
* Usage:
|
2004
|
-
* ```
|
2005
|
-
* {{ value | skyNumeric(config) }}
|
2006
|
-
* ```
|
2007
1977
|
*/
|
2008
1978
|
class SkyNumericPipe {
|
2009
1979
|
constructor(localeProvider, numericService, changeDetector) {
|
@@ -2024,6 +1994,9 @@ class SkyNumericPipe {
|
|
2024
1994
|
this.ngUnsubscribe.next();
|
2025
1995
|
this.ngUnsubscribe.complete();
|
2026
1996
|
}
|
1997
|
+
/**
|
1998
|
+
* Formats a number based on the provided options.
|
1999
|
+
*/
|
2027
2000
|
transform(value, config) {
|
2028
2001
|
const newCacheKey = (config ? JSON.stringify(config, Object.keys(config).sort()) : '') +
|
2029
2002
|
`${value}_${config?.locale || this.providerLocale}`;
|
@@ -2581,7 +2554,7 @@ class SkyResizeObserverMediaQueryService {
|
|
2581
2554
|
this.resizeObserverService = resizeObserverService;
|
2582
2555
|
this._breakpoints = [
|
2583
2556
|
{
|
2584
|
-
check: (width) => width <= 767,
|
2557
|
+
check: (width) => width > 0 && width <= 767,
|
2585
2558
|
name: SkyMediaBreakpoints.xs,
|
2586
2559
|
},
|
2587
2560
|
{
|
@@ -2634,11 +2607,7 @@ class SkyResizeObserverMediaQueryService {
|
|
2634
2607
|
this._stopListening.next();
|
2635
2608
|
}
|
2636
2609
|
this._target = element;
|
2637
|
-
|
2638
|
-
if (width) {
|
2639
|
-
const breakpoint = this.checkBreakpoint(width);
|
2640
|
-
this.updateBreakpoint(breakpoint);
|
2641
|
-
}
|
2610
|
+
this.checkWidth(element);
|
2642
2611
|
this.resizeObserverService
|
2643
2612
|
.observe(element)
|
2644
2613
|
.pipe(takeUntil(this._stopListening))
|
@@ -2663,7 +2632,9 @@ class SkyResizeObserverMediaQueryService {
|
|
2663
2632
|
subscribe(listener) {
|
2664
2633
|
return this._currentBreakpointObservable
|
2665
2634
|
.pipe(takeUntil(this._stopListening))
|
2666
|
-
.subscribe(
|
2635
|
+
.subscribe((value) => {
|
2636
|
+
listener(value);
|
2637
|
+
});
|
2667
2638
|
}
|
2668
2639
|
updateBreakpoint(breakpoint) {
|
2669
2640
|
this._currentBreakpoint = breakpoint;
|
@@ -2673,6 +2644,14 @@ class SkyResizeObserverMediaQueryService {
|
|
2673
2644
|
return this._breakpoints.find((breakpoint) => breakpoint.check(width))
|
2674
2645
|
?.name;
|
2675
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
|
+
}
|
2676
2655
|
}
|
2677
2656
|
SkyResizeObserverMediaQueryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyResizeObserverMediaQueryService, deps: [{ token: SkyResizeObserverService }], target: i0.ɵɵFactoryTarget.Injectable });
|
2678
2657
|
SkyResizeObserverMediaQueryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyResizeObserverMediaQueryService, providedIn: 'any' });
|