@skyux/core 7.4.2 → 7.6.0

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.
Files changed (35) hide show
  1. package/documentation.json +418 -677
  2. package/esm2020/lib/modules/adapter-service/adapter.service.mjs +4 -4
  3. package/esm2020/lib/modules/affix/affix-config.mjs +1 -1
  4. package/esm2020/lib/modules/affix/affixer.mjs +2 -2
  5. package/esm2020/lib/modules/dock/dock.service.mjs +2 -2
  6. package/esm2020/lib/modules/dynamic-component/dynamic-component-options.mjs +1 -1
  7. package/esm2020/lib/modules/dynamic-component/dynamic-component.service.mjs +47 -36
  8. package/esm2020/lib/modules/log/log.service.mjs +2 -2
  9. package/esm2020/lib/modules/log/types/log-deprecation-args.mjs +1 -1
  10. package/esm2020/lib/modules/media-query/media-breakpoints.mjs +5 -5
  11. package/esm2020/lib/modules/media-query/media-query-listener.mjs +1 -1
  12. package/esm2020/lib/modules/numeric/numeric.service.mjs +2 -2
  13. package/esm2020/lib/modules/overlay/overlay-config.mjs +1 -1
  14. package/esm2020/lib/modules/overlay/overlay-context.mjs +2 -2
  15. package/esm2020/lib/modules/trim/trim.directive.mjs +2 -2
  16. package/esm2020/lib/modules/viewkeeper/viewkeeper-options.mjs +1 -1
  17. package/esm2020/lib/modules/window/window-ref.mjs +2 -2
  18. package/fesm2015/skyux-core.mjs +60 -49
  19. package/fesm2015/skyux-core.mjs.map +1 -1
  20. package/fesm2020/skyux-core.mjs +60 -49
  21. package/fesm2020/skyux-core.mjs.map +1 -1
  22. package/lib/modules/adapter-service/adapter.service.d.ts +3 -3
  23. package/lib/modules/affix/affix-config.d.ts +5 -5
  24. package/lib/modules/dock/dock.service.d.ts +1 -1
  25. package/lib/modules/dynamic-component/dynamic-component-options.d.ts +5 -1
  26. package/lib/modules/dynamic-component/dynamic-component.service.d.ts +3 -2
  27. package/lib/modules/log/log.service.d.ts +1 -1
  28. package/lib/modules/log/types/log-deprecation-args.d.ts +1 -1
  29. package/lib/modules/media-query/media-breakpoints.d.ts +4 -4
  30. package/lib/modules/media-query/media-query-listener.d.ts +1 -1
  31. package/lib/modules/overlay/overlay-config.d.ts +6 -6
  32. package/lib/modules/overlay/overlay-context.d.ts +1 -1
  33. package/lib/modules/viewkeeper/viewkeeper-options.d.ts +3 -3
  34. package/lib/modules/window/window-ref.d.ts +1 -1
  35. package/package.json +2 -2
@@ -28,19 +28,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImpo
28
28
  var SkyMediaBreakpoints;
29
29
  (function (SkyMediaBreakpoints) {
30
30
  /**
31
- * Indicates screen widths of 767px or less.
31
+ * Screen widths of 767px or less.
32
32
  */
33
33
  SkyMediaBreakpoints[SkyMediaBreakpoints["xs"] = 1] = "xs";
34
34
  /**
35
- * Indicates screen widths of 768px to 991px.
35
+ * Screen widths of 768px to 991px.
36
36
  */
37
37
  SkyMediaBreakpoints[SkyMediaBreakpoints["sm"] = 2] = "sm";
38
38
  /**
39
- * Indicates screen widths of 992px to 1199px.
39
+ * Screen widths of 992px to 1199px.
40
40
  */
41
41
  SkyMediaBreakpoints[SkyMediaBreakpoints["md"] = 3] = "md";
42
42
  /**
43
- * Indicates screen widths of 1200px or greater.
43
+ * Screen widths of 1200px or greater.
44
44
  */
45
45
  SkyMediaBreakpoints[SkyMediaBreakpoints["lg"] = 4] = "lg";
46
46
  })(SkyMediaBreakpoints || (SkyMediaBreakpoints = {}));
@@ -68,7 +68,7 @@ class SkyCoreAdapterService {
68
68
  /**
69
69
  * Set the responsive container CSS class for a given element.
70
70
  *
71
- * @param elementRef - The element that will recieve the new CSS class.
71
+ * @param elementRef - The element that will receive the new CSS class.
72
72
  * @param breakpoint - The SkyMediaBreakpoint will determine which class
73
73
  * gets set. For example a SkyMediaBreakpoint of `xs` will set a CSS class of `sky-responsive-container-xs`.
74
74
  */
@@ -138,9 +138,9 @@ class SkyCoreAdapterService {
138
138
  *
139
139
  * @param elementRef - The element to search within.
140
140
  * @param containerSelector - A CSS selector indicating the container that should
141
- * recieve focus if no focusable children are found.
141
+ * receive focus if no focusable children are found.
142
142
  * @param focusOnContainerIfNoChildrenFound - It set to `true`, the container will
143
- * recieve focus if no focusable children are found.
143
+ * receive focus if no focusable children are found.
144
144
  */
145
145
  getFocusableChildrenAndApplyFocus(elementRef, containerSelector, focusOnContainerIfNoChildrenFound = false) {
146
146
  const containerElement = elementRef.nativeElement.querySelector(containerSelector);
@@ -613,7 +613,7 @@ _SkyAffixer_affixedElement = new WeakMap(), _SkyAffixer_baseElement = new WeakMa
613
613
  const affixedRect = __classPrivateFieldGet(this, _SkyAffixer_affixedElement, "f").getBoundingClientRect();
614
614
  const baseRect = baseElement.getBoundingClientRect();
615
615
  // A pixel value representing the leeway between the edge of the overflow parent and the edge
616
- // of the base element before it dissapears from view.
616
+ // of the base element before it disappears from view.
617
617
  // If the visible portion of the base element is less than this pixel value, the auto-fit
618
618
  // functionality attempts to find another placement.
619
619
  const defaultPixelTolerance = 40;
@@ -1183,7 +1183,7 @@ function getWindow() {
1183
1183
  */
1184
1184
  class SkyAppWindowRef {
1185
1185
  /**
1186
- * References the global `window` variable.
1186
+ * The global `window` variable.
1187
1187
  */
1188
1188
  get nativeWindow() {
1189
1189
  return getWindow();
@@ -1198,20 +1198,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImpo
1198
1198
  }]
1199
1199
  }] });
1200
1200
 
1201
- var _SkyDynamicComponentService_instances, _SkyDynamicComponentService_applicationRef, _SkyDynamicComponentService_injector, _SkyDynamicComponentService_renderer, _SkyDynamicComponentService_windowRef, _SkyDynamicComponentService_getRootNode;
1201
+ var _SkyDynamicComponentService_instances, _SkyDynamicComponentService_applicationRef, _SkyDynamicComponentService_environmentInjector, _SkyDynamicComponentService_injector, _SkyDynamicComponentService_renderer, _SkyDynamicComponentService_windowRef, _SkyDynamicComponentService_getRootNode;
1202
1202
  /**
1203
1203
  * Angular service for creating and rendering a dynamic component.
1204
+ * @internal
1204
1205
  */
1205
1206
  class SkyDynamicComponentService {
1206
- constructor(applicationRef, injector, windowRef, rendererFactory) {
1207
+ constructor(applicationRef, injector, windowRef, rendererFactory, environmentInjector) {
1207
1208
  _SkyDynamicComponentService_instances.add(this);
1208
1209
  _SkyDynamicComponentService_applicationRef.set(this, void 0);
1210
+ _SkyDynamicComponentService_environmentInjector.set(this, void 0);
1209
1211
  _SkyDynamicComponentService_injector.set(this, void 0);
1210
1212
  _SkyDynamicComponentService_renderer.set(this, void 0);
1211
1213
  _SkyDynamicComponentService_windowRef.set(this, void 0);
1212
1214
  __classPrivateFieldSet(this, _SkyDynamicComponentService_applicationRef, applicationRef, "f");
1213
1215
  __classPrivateFieldSet(this, _SkyDynamicComponentService_injector, injector, "f");
1214
1216
  __classPrivateFieldSet(this, _SkyDynamicComponentService_windowRef, windowRef, "f");
1217
+ __classPrivateFieldSet(this, _SkyDynamicComponentService_environmentInjector, environmentInjector, "f");
1215
1218
  // Based on suggestions from https://github.com/angular/angular/issues/17824
1216
1219
  // for accessing an instance of Renderer2 in a service since Renderer2 can't
1217
1220
  // be injected into a service. Passing undefined for both parameters results
@@ -1230,35 +1233,43 @@ class SkyDynamicComponentService {
1230
1233
  providers: options.providers || [],
1231
1234
  parent: options.parentInjector || __classPrivateFieldGet(this, _SkyDynamicComponentService_injector, "f"),
1232
1235
  });
1233
- const componentRef = createComponent(componentType, {
1234
- environmentInjector: __classPrivateFieldGet(this, _SkyDynamicComponentService_applicationRef, "f").injector,
1235
- elementInjector: injector,
1236
- });
1237
- __classPrivateFieldGet(this, _SkyDynamicComponentService_applicationRef, "f").attachView(componentRef.hostView);
1238
- const el = __classPrivateFieldGet(this, _SkyDynamicComponentService_instances, "m", _SkyDynamicComponentService_getRootNode).call(this, componentRef);
1239
- const bodyEl = __classPrivateFieldGet(this, _SkyDynamicComponentService_windowRef, "f").nativeWindow.document.body;
1240
- switch (options.location) {
1241
- case SkyDynamicComponentLocation.BeforeElement:
1242
- if (!options.referenceEl) {
1243
- throw new Error('[SkyDynamicComponentService] Could not create a component at location `SkyDynamicComponentLocation.BeforeElement` because a reference element was not provided.');
1244
- }
1245
- __classPrivateFieldGet(this, _SkyDynamicComponentService_renderer, "f").insertBefore(options.referenceEl.parentElement, el, options.referenceEl);
1246
- break;
1247
- case SkyDynamicComponentLocation.ElementTop:
1248
- if (!options.referenceEl) {
1249
- throw new Error('[SkyDynamicComponentService] Could not create a component at location `SkyDynamicComponentLocation.ElementTop` because a reference element was not provided.');
1250
- }
1251
- __classPrivateFieldGet(this, _SkyDynamicComponentService_renderer, "f").insertBefore(options.referenceEl, el, options.referenceEl.firstChild);
1252
- break;
1253
- case SkyDynamicComponentLocation.ElementBottom:
1254
- __classPrivateFieldGet(this, _SkyDynamicComponentService_renderer, "f").appendChild(options.referenceEl, el);
1255
- break;
1256
- case SkyDynamicComponentLocation.BodyTop:
1257
- __classPrivateFieldGet(this, _SkyDynamicComponentService_renderer, "f").insertBefore(bodyEl, el, bodyEl.firstChild);
1258
- break;
1259
- default:
1260
- __classPrivateFieldGet(this, _SkyDynamicComponentService_renderer, "f").appendChild(bodyEl, el);
1261
- break;
1236
+ let componentRef;
1237
+ if (options.viewContainerRef) {
1238
+ componentRef = options.viewContainerRef.createComponent(componentType, {
1239
+ injector,
1240
+ });
1241
+ }
1242
+ else {
1243
+ componentRef = createComponent(componentType, {
1244
+ environmentInjector: __classPrivateFieldGet(this, _SkyDynamicComponentService_environmentInjector, "f"),
1245
+ elementInjector: injector,
1246
+ });
1247
+ __classPrivateFieldGet(this, _SkyDynamicComponentService_applicationRef, "f").attachView(componentRef.hostView);
1248
+ const el = __classPrivateFieldGet(this, _SkyDynamicComponentService_instances, "m", _SkyDynamicComponentService_getRootNode).call(this, componentRef);
1249
+ const bodyEl = __classPrivateFieldGet(this, _SkyDynamicComponentService_windowRef, "f").nativeWindow.document.body;
1250
+ switch (options.location) {
1251
+ case SkyDynamicComponentLocation.BeforeElement:
1252
+ if (!options.referenceEl) {
1253
+ throw new Error('[SkyDynamicComponentService] Could not create a component at location `SkyDynamicComponentLocation.BeforeElement` because a reference element was not provided.');
1254
+ }
1255
+ __classPrivateFieldGet(this, _SkyDynamicComponentService_renderer, "f").insertBefore(options.referenceEl.parentElement, el, options.referenceEl);
1256
+ break;
1257
+ case SkyDynamicComponentLocation.ElementTop:
1258
+ if (!options.referenceEl) {
1259
+ throw new Error('[SkyDynamicComponentService] Could not create a component at location `SkyDynamicComponentLocation.ElementTop` because a reference element was not provided.');
1260
+ }
1261
+ __classPrivateFieldGet(this, _SkyDynamicComponentService_renderer, "f").insertBefore(options.referenceEl, el, options.referenceEl.firstChild);
1262
+ break;
1263
+ case SkyDynamicComponentLocation.ElementBottom:
1264
+ __classPrivateFieldGet(this, _SkyDynamicComponentService_renderer, "f").appendChild(options.referenceEl, el);
1265
+ break;
1266
+ case SkyDynamicComponentLocation.BodyTop:
1267
+ __classPrivateFieldGet(this, _SkyDynamicComponentService_renderer, "f").insertBefore(bodyEl, el, bodyEl.firstChild);
1268
+ break;
1269
+ default:
1270
+ __classPrivateFieldGet(this, _SkyDynamicComponentService_renderer, "f").appendChild(bodyEl, el);
1271
+ break;
1272
+ }
1262
1273
  }
1263
1274
  return componentRef;
1264
1275
  }
@@ -1274,22 +1285,22 @@ class SkyDynamicComponentService {
1274
1285
  componentRef.destroy();
1275
1286
  }
1276
1287
  }
1277
- _SkyDynamicComponentService_applicationRef = new WeakMap(), _SkyDynamicComponentService_injector = new WeakMap(), _SkyDynamicComponentService_renderer = new WeakMap(), _SkyDynamicComponentService_windowRef = new WeakMap(), _SkyDynamicComponentService_instances = new WeakSet(), _SkyDynamicComponentService_getRootNode = function _SkyDynamicComponentService_getRootNode(componentRef) {
1288
+ _SkyDynamicComponentService_applicationRef = new WeakMap(), _SkyDynamicComponentService_environmentInjector = new WeakMap(), _SkyDynamicComponentService_injector = new WeakMap(), _SkyDynamicComponentService_renderer = new WeakMap(), _SkyDynamicComponentService_windowRef = new WeakMap(), _SkyDynamicComponentService_instances = new WeakSet(), _SkyDynamicComponentService_getRootNode = function _SkyDynamicComponentService_getRootNode(componentRef) {
1278
1289
  // Technique for retrieving the component's root node taken from here:
1279
1290
  // https://malcoded.com/posts/angular-dynamic-components
1280
1291
  return componentRef.hostView.rootNodes[0];
1281
1292
  };
1282
- SkyDynamicComponentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: SkyDynamicComponentService, deps: [{ token: i0.ApplicationRef }, { token: i0.Injector }, { token: SkyAppWindowRef }, { token: i0.RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable });
1293
+ SkyDynamicComponentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: SkyDynamicComponentService, deps: [{ token: i0.ApplicationRef }, { token: i0.Injector }, { token: SkyAppWindowRef }, { token: i0.RendererFactory2 }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable });
1283
1294
  SkyDynamicComponentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: SkyDynamicComponentService, providedIn: 'any' });
1284
1295
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: SkyDynamicComponentService, decorators: [{
1285
1296
  type: Injectable,
1286
1297
  args: [{
1287
1298
  // Must be 'any' so that the component is created in the context of its module's injector.
1288
1299
  // If set to 'root', the component's dependency injections would only be derived from the root
1289
- // injector and may loose context if the component is created within a lazy-loaded module.
1300
+ // injector and may lose context if the component is created within a lazy-loaded module.
1290
1301
  providedIn: 'any',
1291
1302
  }]
1292
- }], ctorParameters: function () { return [{ type: i0.ApplicationRef }, { type: i0.Injector }, { type: SkyAppWindowRef }, { type: i0.RendererFactory2 }]; } });
1303
+ }], ctorParameters: function () { return [{ type: i0.ApplicationRef }, { type: i0.Injector }, { type: SkyAppWindowRef }, { type: i0.RendererFactory2 }, { type: i0.EnvironmentInjector }]; } });
1293
1304
 
1294
1305
  var _SkyDockService_instances, _SkyDockService_dynamicComponentSvc, _SkyDockService_options, _SkyDockService_createDock, _SkyDockService_destroyDock;
1295
1306
  /**
@@ -1332,7 +1343,7 @@ class SkyDockService {
1332
1343
  /**
1333
1344
  * Sets options for the positioning and styling of the dock component. Since the dock service is a
1334
1345
  * singleton instance, these options will be applied to all components inserted into the dock. In
1335
- * order to create a seperate dock with different options, consumers should provide a different
1346
+ * order to create a separate dock with different options, consumers should provide a different
1336
1347
  * instance of the dock service.
1337
1348
  * @param options The options for positioning and styling
1338
1349
  */
@@ -1558,7 +1569,7 @@ class SkyLogService {
1558
1569
  }
1559
1570
  /**
1560
1571
  * Logs console information if the application's log level is `SkyLogLevel.Info` or above.
1561
- * @param message The infomational message
1572
+ * @param message The informational message
1562
1573
  * @param params Optional parameters for the informational message.
1563
1574
  */
1564
1575
  info(message, params) {
@@ -1926,7 +1937,7 @@ class SkyNumericService {
1926
1937
  for (let i = 0; i < __classPrivateFieldGet(this, _SkyNumericService_symbolIndex, "f").length; i++) {
1927
1938
  let symbol = __classPrivateFieldGet(this, _SkyNumericService_symbolIndex, "f")[i];
1928
1939
  if (options.truncate &&
1929
- options.truncateAfter &&
1940
+ options.truncateAfter !== undefined &&
1930
1941
  roundedNumberAbs >= options.truncateAfter &&
1931
1942
  roundedNumberAbs >= symbol.value) {
1932
1943
  roundedNumber = __classPrivateFieldGet(this, _SkyNumericService_instances, "m", _SkyNumericService_roundNumber).call(this, value / symbol.value, digits);
@@ -2203,7 +2214,7 @@ class SkyOverlayInstance {
2203
2214
  _SkyOverlayInstance_backdropClick = new WeakMap(), _SkyOverlayInstance_backdropClickObs = new WeakMap(), _SkyOverlayInstance_closed = new WeakMap(), _SkyOverlayInstance_closedObs = new WeakMap();
2204
2215
 
2205
2216
  /**
2206
- * Provides contextual information to each overlay created.
2217
+ * Contextual information for each overlay.
2207
2218
  * @internal
2208
2219
  */
2209
2220
  class SkyOverlayContext {
@@ -3023,7 +3034,7 @@ class SkyTrimDirective {
3023
3034
  __classPrivateFieldSet(this, _SkyTrimDirective_elRef, elRef, "f");
3024
3035
  __classPrivateFieldSet(this, _SkyTrimDirective_obs, mutationObs.create((mutations) => {
3025
3036
  const nodes = [];
3026
- // Only trim white space inside direct descendents of the current element.
3037
+ // Only trim white space inside direct descendants of the current element.
3027
3038
  for (const mutation of mutations) {
3028
3039
  if (mutation.target.parentNode === elRef.nativeElement) {
3029
3040
  nodes.push(mutation.target);