@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);
@@ -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;
@@ -1230,35 +1230,43 @@ class SkyDynamicComponentService {
1230
1230
  providers: options.providers || [],
1231
1231
  parent: options.parentInjector || __classPrivateFieldGet(this, _SkyDynamicComponentService_injector, "f"),
1232
1232
  });
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;
1233
+ let componentRef;
1234
+ if (options.viewContainerRef) {
1235
+ componentRef = options.viewContainerRef.createComponent(componentType, {
1236
+ injector: injector,
1237
+ });
1238
+ }
1239
+ else {
1240
+ componentRef = createComponent(componentType, {
1241
+ environmentInjector: __classPrivateFieldGet(this, _SkyDynamicComponentService_applicationRef, "f").injector,
1242
+ elementInjector: injector,
1243
+ });
1244
+ __classPrivateFieldGet(this, _SkyDynamicComponentService_applicationRef, "f").attachView(componentRef.hostView);
1245
+ const el = __classPrivateFieldGet(this, _SkyDynamicComponentService_instances, "m", _SkyDynamicComponentService_getRootNode).call(this, componentRef);
1246
+ const bodyEl = __classPrivateFieldGet(this, _SkyDynamicComponentService_windowRef, "f").nativeWindow.document.body;
1247
+ switch (options.location) {
1248
+ case SkyDynamicComponentLocation.BeforeElement:
1249
+ if (!options.referenceEl) {
1250
+ throw new Error('[SkyDynamicComponentService] Could not create a component at location `SkyDynamicComponentLocation.BeforeElement` because a reference element was not provided.');
1251
+ }
1252
+ __classPrivateFieldGet(this, _SkyDynamicComponentService_renderer, "f").insertBefore(options.referenceEl.parentElement, el, options.referenceEl);
1253
+ break;
1254
+ case SkyDynamicComponentLocation.ElementTop:
1255
+ if (!options.referenceEl) {
1256
+ throw new Error('[SkyDynamicComponentService] Could not create a component at location `SkyDynamicComponentLocation.ElementTop` because a reference element was not provided.');
1257
+ }
1258
+ __classPrivateFieldGet(this, _SkyDynamicComponentService_renderer, "f").insertBefore(options.referenceEl, el, options.referenceEl.firstChild);
1259
+ break;
1260
+ case SkyDynamicComponentLocation.ElementBottom:
1261
+ __classPrivateFieldGet(this, _SkyDynamicComponentService_renderer, "f").appendChild(options.referenceEl, el);
1262
+ break;
1263
+ case SkyDynamicComponentLocation.BodyTop:
1264
+ __classPrivateFieldGet(this, _SkyDynamicComponentService_renderer, "f").insertBefore(bodyEl, el, bodyEl.firstChild);
1265
+ break;
1266
+ default:
1267
+ __classPrivateFieldGet(this, _SkyDynamicComponentService_renderer, "f").appendChild(bodyEl, el);
1268
+ break;
1269
+ }
1262
1270
  }
1263
1271
  return componentRef;
1264
1272
  }
@@ -1332,7 +1340,7 @@ class SkyDockService {
1332
1340
  /**
1333
1341
  * Sets options for the positioning and styling of the dock component. Since the dock service is a
1334
1342
  * 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
1343
+ * order to create a separate dock with different options, consumers should provide a different
1336
1344
  * instance of the dock service.
1337
1345
  * @param options The options for positioning and styling
1338
1346
  */
@@ -1558,7 +1566,7 @@ class SkyLogService {
1558
1566
  }
1559
1567
  /**
1560
1568
  * Logs console information if the application's log level is `SkyLogLevel.Info` or above.
1561
- * @param message The infomational message
1569
+ * @param message The informational message
1562
1570
  * @param params Optional parameters for the informational message.
1563
1571
  */
1564
1572
  info(message, params) {
@@ -3023,7 +3031,7 @@ class SkyTrimDirective {
3023
3031
  __classPrivateFieldSet(this, _SkyTrimDirective_elRef, elRef, "f");
3024
3032
  __classPrivateFieldSet(this, _SkyTrimDirective_obs, mutationObs.create((mutations) => {
3025
3033
  const nodes = [];
3026
- // Only trim white space inside direct descendents of the current element.
3034
+ // Only trim white space inside direct descendants of the current element.
3027
3035
  for (const mutation of mutations) {
3028
3036
  if (mutation.target.parentNode === elRef.nativeElement) {
3029
3037
  nodes.push(mutation.target);