@skyux/core 7.4.2 → 7.5.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.
@@ -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);
@@ -610,7 +610,7 @@ _SkyAffixer_affixedElement = new WeakMap(), _SkyAffixer_baseElement = new WeakMa
610
610
  const affixedRect = __classPrivateFieldGet(this, _SkyAffixer_affixedElement, "f").getBoundingClientRect();
611
611
  const baseRect = baseElement.getBoundingClientRect();
612
612
  // A pixel value representing the leeway between the edge of the overflow parent and the edge
613
- // of the base element before it dissapears from view.
613
+ // of the base element before it disappears from view.
614
614
  // If the visible portion of the base element is less than this pixel value, the auto-fit
615
615
  // functionality attempts to find another placement.
616
616
  const defaultPixelTolerance = 40;
@@ -1228,35 +1228,43 @@ class SkyDynamicComponentService {
1228
1228
  providers: options.providers || [],
1229
1229
  parent: options.parentInjector || __classPrivateFieldGet(this, _SkyDynamicComponentService_injector, "f"),
1230
1230
  });
1231
- const componentRef = createComponent(componentType, {
1232
- environmentInjector: __classPrivateFieldGet(this, _SkyDynamicComponentService_applicationRef, "f").injector,
1233
- elementInjector: injector,
1234
- });
1235
- __classPrivateFieldGet(this, _SkyDynamicComponentService_applicationRef, "f").attachView(componentRef.hostView);
1236
- const el = __classPrivateFieldGet(this, _SkyDynamicComponentService_instances, "m", _SkyDynamicComponentService_getRootNode).call(this, componentRef);
1237
- const bodyEl = __classPrivateFieldGet(this, _SkyDynamicComponentService_windowRef, "f").nativeWindow.document.body;
1238
- switch (options.location) {
1239
- case SkyDynamicComponentLocation.BeforeElement:
1240
- if (!options.referenceEl) {
1241
- throw new Error('[SkyDynamicComponentService] Could not create a component at location `SkyDynamicComponentLocation.BeforeElement` because a reference element was not provided.');
1242
- }
1243
- __classPrivateFieldGet(this, _SkyDynamicComponentService_renderer, "f").insertBefore(options.referenceEl.parentElement, el, options.referenceEl);
1244
- break;
1245
- case SkyDynamicComponentLocation.ElementTop:
1246
- if (!options.referenceEl) {
1247
- throw new Error('[SkyDynamicComponentService] Could not create a component at location `SkyDynamicComponentLocation.ElementTop` because a reference element was not provided.');
1248
- }
1249
- __classPrivateFieldGet(this, _SkyDynamicComponentService_renderer, "f").insertBefore(options.referenceEl, el, options.referenceEl.firstChild);
1250
- break;
1251
- case SkyDynamicComponentLocation.ElementBottom:
1252
- __classPrivateFieldGet(this, _SkyDynamicComponentService_renderer, "f").appendChild(options.referenceEl, el);
1253
- break;
1254
- case SkyDynamicComponentLocation.BodyTop:
1255
- __classPrivateFieldGet(this, _SkyDynamicComponentService_renderer, "f").insertBefore(bodyEl, el, bodyEl.firstChild);
1256
- break;
1257
- default:
1258
- __classPrivateFieldGet(this, _SkyDynamicComponentService_renderer, "f").appendChild(bodyEl, el);
1259
- break;
1231
+ let componentRef;
1232
+ if (options.viewContainerRef) {
1233
+ componentRef = options.viewContainerRef.createComponent(componentType, {
1234
+ injector: injector,
1235
+ });
1236
+ }
1237
+ else {
1238
+ componentRef = createComponent(componentType, {
1239
+ environmentInjector: __classPrivateFieldGet(this, _SkyDynamicComponentService_applicationRef, "f").injector,
1240
+ elementInjector: injector,
1241
+ });
1242
+ __classPrivateFieldGet(this, _SkyDynamicComponentService_applicationRef, "f").attachView(componentRef.hostView);
1243
+ const el = __classPrivateFieldGet(this, _SkyDynamicComponentService_instances, "m", _SkyDynamicComponentService_getRootNode).call(this, componentRef);
1244
+ const bodyEl = __classPrivateFieldGet(this, _SkyDynamicComponentService_windowRef, "f").nativeWindow.document.body;
1245
+ switch (options.location) {
1246
+ case SkyDynamicComponentLocation.BeforeElement:
1247
+ if (!options.referenceEl) {
1248
+ throw new Error('[SkyDynamicComponentService] Could not create a component at location `SkyDynamicComponentLocation.BeforeElement` because a reference element was not provided.');
1249
+ }
1250
+ __classPrivateFieldGet(this, _SkyDynamicComponentService_renderer, "f").insertBefore(options.referenceEl.parentElement, el, options.referenceEl);
1251
+ break;
1252
+ case SkyDynamicComponentLocation.ElementTop:
1253
+ if (!options.referenceEl) {
1254
+ throw new Error('[SkyDynamicComponentService] Could not create a component at location `SkyDynamicComponentLocation.ElementTop` because a reference element was not provided.');
1255
+ }
1256
+ __classPrivateFieldGet(this, _SkyDynamicComponentService_renderer, "f").insertBefore(options.referenceEl, el, options.referenceEl.firstChild);
1257
+ break;
1258
+ case SkyDynamicComponentLocation.ElementBottom:
1259
+ __classPrivateFieldGet(this, _SkyDynamicComponentService_renderer, "f").appendChild(options.referenceEl, el);
1260
+ break;
1261
+ case SkyDynamicComponentLocation.BodyTop:
1262
+ __classPrivateFieldGet(this, _SkyDynamicComponentService_renderer, "f").insertBefore(bodyEl, el, bodyEl.firstChild);
1263
+ break;
1264
+ default:
1265
+ __classPrivateFieldGet(this, _SkyDynamicComponentService_renderer, "f").appendChild(bodyEl, el);
1266
+ break;
1267
+ }
1260
1268
  }
1261
1269
  return componentRef;
1262
1270
  }
@@ -1330,7 +1338,7 @@ class SkyDockService {
1330
1338
  /**
1331
1339
  * Sets options for the positioning and styling of the dock component. Since the dock service is a
1332
1340
  * singleton instance, these options will be applied to all components inserted into the dock. In
1333
- * order to create a seperate dock with different options, consumers should provide a different
1341
+ * order to create a separate dock with different options, consumers should provide a different
1334
1342
  * instance of the dock service.
1335
1343
  * @param options The options for positioning and styling
1336
1344
  */
@@ -1559,7 +1567,7 @@ class SkyLogService {
1559
1567
  }
1560
1568
  /**
1561
1569
  * Logs console information if the application's log level is `SkyLogLevel.Info` or above.
1562
- * @param message The infomational message
1570
+ * @param message The informational message
1563
1571
  * @param params Optional parameters for the informational message.
1564
1572
  */
1565
1573
  info(message, params) {
@@ -3029,7 +3037,7 @@ class SkyTrimDirective {
3029
3037
  __classPrivateFieldSet(this, _SkyTrimDirective_elRef, elRef, "f");
3030
3038
  __classPrivateFieldSet(this, _SkyTrimDirective_obs, mutationObs.create((mutations) => {
3031
3039
  const nodes = [];
3032
- // Only trim white space inside direct descendents of the current element.
3040
+ // Only trim white space inside direct descendants of the current element.
3033
3041
  for (const mutation of mutations) {
3034
3042
  if (mutation.target.parentNode === elRef.nativeElement) {
3035
3043
  nodes.push(mutation.target);