@skyux/core 8.0.0-alpha.1 → 8.0.0-alpha.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 +613 -613
- package/esm2020/index.mjs +3 -1
- package/esm2020/lib/modules/log/log.service.mjs +33 -28
- package/esm2020/lib/modules/overlay/overlay.component.mjs +14 -3
- package/esm2020/lib/modules/shared/number-format/number-format-utility.mjs +2 -1
- package/esm2020/lib/modules/stacking-context/stacking-context-token.mjs +6 -0
- package/esm2020/lib/modules/stacking-context/stacking-context.mjs +2 -0
- package/fesm2015/skyux-core.mjs +50 -30
- package/fesm2015/skyux-core.mjs.map +1 -1
- package/fesm2020/skyux-core.mjs +50 -30
- package/fesm2020/skyux-core.mjs.map +1 -1
- package/index.d.ts +2 -0
- package/lib/modules/stacking-context/stacking-context-token.d.ts +6 -0
- package/lib/modules/stacking-context/stacking-context.d.ts +7 -0
- package/package.json +2 -2
package/fesm2020/skyux-core.mjs
CHANGED
@@ -1506,7 +1506,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
1506
1506
|
*/
|
1507
1507
|
const SKY_LOG_LEVEL = new InjectionToken('SkyLogLevel');
|
1508
1508
|
|
1509
|
-
var _SkyLogService_instances, _SkyLogService_applicationLogLevel, _SkyLogService_formatter, _SkyLogService_convertStringToCode, _SkyLogService_canLog, _SkyLogService_logBasedOnLevel;
|
1509
|
+
var _SkyLogService_instances, _SkyLogService_applicationLogLevel, _SkyLogService_formatter, _SkyLogService_previousWarnings, _SkyLogService_convertStringToCode, _SkyLogService_canLog, _SkyLogService_logBasedOnLevel, _SkyLogService_logWithParams, _SkyLogService_buildMessageKey;
|
1510
1510
|
/**
|
1511
1511
|
* Logs information to the console based on the application's log level as provided by the `SKY_LOG_LEVEL` injection token. If no token is provided, only `error` logs will be shown.
|
1512
1512
|
* @internal
|
@@ -1516,6 +1516,7 @@ class SkyLogService {
|
|
1516
1516
|
_SkyLogService_instances.add(this);
|
1517
1517
|
_SkyLogService_applicationLogLevel.set(this, void 0);
|
1518
1518
|
_SkyLogService_formatter.set(this, void 0);
|
1519
|
+
_SkyLogService_previousWarnings.set(this, new Set());
|
1519
1520
|
__classPrivateFieldSet(this, _SkyLogService_formatter, formatter, "f");
|
1520
1521
|
__classPrivateFieldSet(this, _SkyLogService_applicationLogLevel, applicationLogLevel ?? 3 /* SkyLogLevel.Error */, "f");
|
1521
1522
|
}
|
@@ -1529,26 +1530,26 @@ class SkyLogService {
|
|
1529
1530
|
const logLevel = args?.logLevel ?? 2 /* SkyLogLevel.Warn */;
|
1530
1531
|
name = __classPrivateFieldGet(this, _SkyLogService_instances, "m", _SkyLogService_convertStringToCode).call(this, name);
|
1531
1532
|
if (__classPrivateFieldGet(this, _SkyLogService_instances, "m", _SkyLogService_canLog).call(this, logLevel)) {
|
1532
|
-
const
|
1533
|
+
const messageParts = [];
|
1533
1534
|
if (args?.deprecationMajorVersion) {
|
1534
|
-
|
1535
|
+
messageParts.push(__classPrivateFieldGet(this, _SkyLogService_formatter, "f").formatText('{0} is deprecated starting in SKY UX {1}.', name, args.deprecationMajorVersion.toLocaleString()));
|
1535
1536
|
}
|
1536
1537
|
else {
|
1537
|
-
|
1538
|
+
messageParts.push(__classPrivateFieldGet(this, _SkyLogService_formatter, "f").formatText('{0} is deprecated.', name));
|
1538
1539
|
}
|
1539
1540
|
if (args?.removalMajorVersion) {
|
1540
|
-
|
1541
|
+
messageParts.push(__classPrivateFieldGet(this, _SkyLogService_formatter, "f").formatText('We will remove it in version {0}.', args.removalMajorVersion.toLocaleString()));
|
1541
1542
|
}
|
1542
1543
|
else {
|
1543
|
-
|
1544
|
+
messageParts.push('We will remove it in a future major version.');
|
1544
1545
|
}
|
1545
1546
|
if (args?.replacementRecommendation) {
|
1546
|
-
|
1547
|
+
messageParts.push(args.replacementRecommendation);
|
1547
1548
|
}
|
1548
1549
|
if (args?.moreInfoUrl) {
|
1549
|
-
|
1550
|
+
messageParts.push(__classPrivateFieldGet(this, _SkyLogService_formatter, "f").formatText('For more information, see {0}.', args.moreInfoUrl));
|
1550
1551
|
}
|
1551
|
-
__classPrivateFieldGet(this, _SkyLogService_instances, "m", _SkyLogService_logBasedOnLevel).call(this, logLevel,
|
1552
|
+
__classPrivateFieldGet(this, _SkyLogService_instances, "m", _SkyLogService_logBasedOnLevel).call(this, logLevel, messageParts.join(' '));
|
1552
1553
|
}
|
1553
1554
|
return Promise.resolve();
|
1554
1555
|
}
|
@@ -1559,12 +1560,7 @@ class SkyLogService {
|
|
1559
1560
|
*/
|
1560
1561
|
error(message, params) {
|
1561
1562
|
if (__classPrivateFieldGet(this, _SkyLogService_instances, "m", _SkyLogService_canLog).call(this, 3 /* SkyLogLevel.Error */)) {
|
1562
|
-
|
1563
|
-
console.error(message, ...params);
|
1564
|
-
}
|
1565
|
-
else {
|
1566
|
-
console.error(message);
|
1567
|
-
}
|
1563
|
+
__classPrivateFieldGet(this, _SkyLogService_instances, "m", _SkyLogService_logWithParams).call(this, 'error', message, params);
|
1568
1564
|
}
|
1569
1565
|
}
|
1570
1566
|
/**
|
@@ -1574,12 +1570,7 @@ class SkyLogService {
|
|
1574
1570
|
*/
|
1575
1571
|
info(message, params) {
|
1576
1572
|
if (__classPrivateFieldGet(this, _SkyLogService_instances, "m", _SkyLogService_canLog).call(this, 1 /* SkyLogLevel.Info */)) {
|
1577
|
-
|
1578
|
-
console.log(message, ...params);
|
1579
|
-
}
|
1580
|
-
else {
|
1581
|
-
console.log(message);
|
1582
|
-
}
|
1573
|
+
__classPrivateFieldGet(this, _SkyLogService_instances, "m", _SkyLogService_logWithParams).call(this, 'log', message, params);
|
1583
1574
|
}
|
1584
1575
|
}
|
1585
1576
|
/**
|
@@ -1589,16 +1580,17 @@ class SkyLogService {
|
|
1589
1580
|
*/
|
1590
1581
|
warn(message, params) {
|
1591
1582
|
if (__classPrivateFieldGet(this, _SkyLogService_instances, "m", _SkyLogService_canLog).call(this, 2 /* SkyLogLevel.Warn */)) {
|
1592
|
-
|
1593
|
-
|
1594
|
-
|
1595
|
-
|
1596
|
-
|
1583
|
+
const messageKey = __classPrivateFieldGet(this, _SkyLogService_instances, "m", _SkyLogService_buildMessageKey).call(this, message, params);
|
1584
|
+
// Only log each warning once per application instance to avoid drowning out other
|
1585
|
+
// important messages in the console.
|
1586
|
+
if (!__classPrivateFieldGet(this, _SkyLogService_previousWarnings, "f").has(message)) {
|
1587
|
+
__classPrivateFieldGet(this, _SkyLogService_instances, "m", _SkyLogService_logWithParams).call(this, 'warn', message, params);
|
1588
|
+
__classPrivateFieldGet(this, _SkyLogService_previousWarnings, "f").add(messageKey);
|
1597
1589
|
}
|
1598
1590
|
}
|
1599
1591
|
}
|
1600
1592
|
}
|
1601
|
-
_SkyLogService_applicationLogLevel = new WeakMap(), _SkyLogService_formatter = new WeakMap(), _SkyLogService_instances = new WeakSet(), _SkyLogService_convertStringToCode = function _SkyLogService_convertStringToCode(typeString) {
|
1593
|
+
_SkyLogService_applicationLogLevel = new WeakMap(), _SkyLogService_formatter = new WeakMap(), _SkyLogService_previousWarnings = new WeakMap(), _SkyLogService_instances = new WeakSet(), _SkyLogService_convertStringToCode = function _SkyLogService_convertStringToCode(typeString) {
|
1602
1594
|
if (typeString.charAt(0) !== '`' && typeString.charAt(-1) !== '`') {
|
1603
1595
|
typeString = '`' + typeString + '`';
|
1604
1596
|
}
|
@@ -1617,6 +1609,19 @@ _SkyLogService_applicationLogLevel = new WeakMap(), _SkyLogService_formatter = n
|
|
1617
1609
|
this.error(message, params);
|
1618
1610
|
break;
|
1619
1611
|
}
|
1612
|
+
}, _SkyLogService_logWithParams = function _SkyLogService_logWithParams(logMethod, message, params) {
|
1613
|
+
if (params) {
|
1614
|
+
console[logMethod](message, ...params);
|
1615
|
+
}
|
1616
|
+
else {
|
1617
|
+
console[logMethod](message);
|
1618
|
+
}
|
1619
|
+
}, _SkyLogService_buildMessageKey = function _SkyLogService_buildMessageKey(message, params) {
|
1620
|
+
let key = message;
|
1621
|
+
if (params?.length) {
|
1622
|
+
key = `${key} ${params.join(' ')}`;
|
1623
|
+
}
|
1624
|
+
return key;
|
1620
1625
|
};
|
1621
1626
|
SkyLogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: SkyLogService, deps: [{ token: SkyAppFormat }, { token: SKY_LOG_LEVEL, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
1622
1627
|
SkyLogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.4", ngImport: i0, type: SkyLogService, providedIn: 'root' });
|
@@ -1827,7 +1832,7 @@ class NumericOptions {
|
|
1827
1832
|
}
|
1828
1833
|
}
|
1829
1834
|
|
1830
|
-
|
1835
|
+
/* eslint-disable eqeqeq */
|
1831
1836
|
function isNumeric(value) {
|
1832
1837
|
return !isNaN(value - parseFloat(value));
|
1833
1838
|
}
|
@@ -2213,6 +2218,11 @@ class SkyOverlayInstance {
|
|
2213
2218
|
}
|
2214
2219
|
_SkyOverlayInstance_backdropClick = new WeakMap(), _SkyOverlayInstance_backdropClickObs = new WeakMap(), _SkyOverlayInstance_closed = new WeakMap(), _SkyOverlayInstance_closedObs = new WeakMap();
|
2215
2220
|
|
2221
|
+
/**
|
2222
|
+
* @internal
|
2223
|
+
*/
|
2224
|
+
const SKY_STACKING_CONTEXT = new InjectionToken('SkyStackingContext');
|
2225
|
+
|
2216
2226
|
/**
|
2217
2227
|
* Contextual information for each overlay.
|
2218
2228
|
* @internal
|
@@ -2301,7 +2311,17 @@ class SkyOverlayComponent {
|
|
2301
2311
|
}
|
2302
2312
|
this.targetRef.clear();
|
2303
2313
|
const injector = Injector.create({
|
2304
|
-
providers
|
2314
|
+
providers: [
|
2315
|
+
{
|
2316
|
+
provide: SKY_STACKING_CONTEXT,
|
2317
|
+
useValue: {
|
2318
|
+
zIndex: new BehaviorSubject(parseInt(this.zIndex, 10))
|
2319
|
+
.asObservable()
|
2320
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyOverlayComponent_ngUnsubscribe, "f"))),
|
2321
|
+
},
|
2322
|
+
},
|
2323
|
+
...providers,
|
2324
|
+
],
|
2305
2325
|
parent: __classPrivateFieldGet(this, _SkyOverlayComponent_injector, "f"),
|
2306
2326
|
});
|
2307
2327
|
const componentRef = this.targetRef.createComponent(component, {
|
@@ -3611,5 +3631,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.4", ngImpor
|
|
3611
3631
|
* Generated bundle index. Do not edit.
|
3612
3632
|
*/
|
3613
3633
|
|
3614
|
-
export { NumericOptions, SKY_LOG_LEVEL, SkyAffixAutoFitContext, SkyAffixModule, SkyAffixService, SkyAffixer, SkyAppFormat, SkyAppTitleService, SkyAppWindowRef, SkyCoreAdapterModule, SkyCoreAdapterService, SkyDockItem, SkyDockLocation, SkyDockModule, SkyDockService, SkyDynamicComponentLocation, SkyDynamicComponentModule, SkyDynamicComponentService, SkyIdModule, SkyIdService, SkyLogModule, SkyLogService, SkyMediaBreakpoints, SkyMediaQueryModule, SkyMediaQueryService, SkyMutationObserverService, SkyNumericModule, SkyNumericPipe, SkyNumericService, SkyOverlayInstance, SkyOverlayModule, SkyOverlayService, SkyPercentPipe, SkyPercentPipeModule, SkyResizeObserverMediaQueryService, SkyResizeObserverService, SkyScrollableHostService, SkyTrimModule, SkyUIConfigService, SkyViewkeeperHostOptions, SkyViewkeeperModule, SkyViewkeeperService, getWindow, SkyAffixDirective as λ1, SkyIdDirective as λ2, SkyViewkeeperDirective as λ3, SkyTrimDirective as λ4 };
|
3634
|
+
export { NumericOptions, SKY_LOG_LEVEL, SKY_STACKING_CONTEXT, SkyAffixAutoFitContext, SkyAffixModule, SkyAffixService, SkyAffixer, SkyAppFormat, SkyAppTitleService, SkyAppWindowRef, SkyCoreAdapterModule, SkyCoreAdapterService, SkyDockItem, SkyDockLocation, SkyDockModule, SkyDockService, SkyDynamicComponentLocation, SkyDynamicComponentModule, SkyDynamicComponentService, SkyIdModule, SkyIdService, SkyLogModule, SkyLogService, SkyMediaBreakpoints, SkyMediaQueryModule, SkyMediaQueryService, SkyMutationObserverService, SkyNumericModule, SkyNumericPipe, SkyNumericService, SkyOverlayInstance, SkyOverlayModule, SkyOverlayService, SkyPercentPipe, SkyPercentPipeModule, SkyResizeObserverMediaQueryService, SkyResizeObserverService, SkyScrollableHostService, SkyTrimModule, SkyUIConfigService, SkyViewkeeperHostOptions, SkyViewkeeperModule, SkyViewkeeperService, getWindow, SkyAffixDirective as λ1, SkyIdDirective as λ2, SkyViewkeeperDirective as λ3, SkyTrimDirective as λ4 };
|
3615
3635
|
//# sourceMappingURL=skyux-core.mjs.map
|