@skyux/core 6.0.0-beta.7 → 6.0.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.
@@ -116,6 +116,9 @@ class SkyCoreAdapterService {
116
116
  * @return Returns `true` if a child element with autofocus is found.
117
117
  */
118
118
  applyAutoFocus(elementRef) {
119
+ if (!elementRef) {
120
+ return false;
121
+ }
119
122
  const elementWithAutoFocus = elementRef.nativeElement.querySelector('[autofocus]');
120
123
  // Child was found with the autofocus property. Set focus and return true.
121
124
  if (elementWithAutoFocus) {
@@ -138,11 +141,13 @@ class SkyCoreAdapterService {
138
141
  */
139
142
  getFocusableChildrenAndApplyFocus(elementRef, containerSelector, focusOnContainerIfNoChildrenFound = false) {
140
143
  const containerElement = elementRef.nativeElement.querySelector(containerSelector);
141
- const focusableChildren = this.getFocusableChildren(containerElement);
142
- // Focus first focusable child if available. Otherwise, set focus on container.
143
- if (!this.focusFirstElement(focusableChildren) &&
144
- focusOnContainerIfNoChildrenFound) {
145
- containerElement.focus();
144
+ if (containerElement) {
145
+ const focusableChildren = this.getFocusableChildren(containerElement);
146
+ // Focus first focusable child if available. Otherwise, set focus on container.
147
+ if (!this.focusFirstElement(focusableChildren) &&
148
+ focusOnContainerIfNoChildrenFound) {
149
+ containerElement.focus();
150
+ }
146
151
  }
147
152
  }
148
153
  /**
@@ -152,6 +157,9 @@ class SkyCoreAdapterService {
152
157
  * @param options - Options for getting focusable children.
153
158
  */
154
159
  getFocusableChildren(element, options) {
160
+ if (!element) {
161
+ return [];
162
+ }
155
163
  let elements = Array.prototype.slice.call(element.querySelectorAll(SKY_TABBABLE_SELECTOR));
156
164
  // Unless ignoreTabIndex = true, filter out elements with tabindex = -1.
157
165
  if (!options || !options.ignoreTabIndex) {
@@ -1700,42 +1708,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
1700
1708
 
1701
1709
  /**
1702
1710
  * Provides arguments for the number to format.
1711
+ * @deprecated Use the `SkyNumericOptions` interface instead.
1703
1712
  */
1704
1713
  class NumericOptions {
1705
1714
  constructor() {
1706
- /**
1707
- * Specifies the maximum number of digits after the decimal separator.
1708
- * @default 1
1709
- */
1710
1715
  this.digits = 1;
1711
- /**
1712
- * Specifies how to format the number. Options are `currency` or `number`.
1713
- * @default "number"
1714
- */
1715
1716
  this.format = 'number';
1716
- /**
1717
- * Specifies the format of the currency.
1718
- * @default "standard"
1719
- */
1720
1717
  this.currencySign = 'standard';
1721
- /**
1722
- * Specifies the ISO4217 currency code to use for currency formatting. If you do not specify a
1723
- * currency code, the component uses the browser's culture to determine the currency unless your
1724
- * SPA provides a different culture with `SkyAppLocaleProvider`.
1725
- * @default "USD"
1726
- */
1727
1718
  this.iso = 'USD';
1728
- /**
1729
- * Indicates whether to shorten numbers to rounded numbers and abbreviation characters
1730
- * such as K for thousands, M for millions, B for billions, and T for trillions.
1731
- */
1732
1719
  this.truncate = true;
1733
- /**
1734
- * Specifies the starting point after which numbers are shortened to rounded numbers
1735
- * and abbreviation characters.
1736
- * @default 0
1737
- */
1738
- this.truncateAfter = 0;
1720
+ this.truncateAfter = 1000;
1739
1721
  }
1740
1722
  }
1741
1723
 
@@ -2719,7 +2701,7 @@ class SkyScrollableHostService {
2719
2701
  });
2720
2702
  this.observeForScrollableHostChanges(scrollableHost, parentMutationObserver);
2721
2703
  documentHiddenElementMutationObserver = this.mutationObserverSvc.create(() => {
2722
- if (!elementRef.nativeElement.offsetParent) {
2704
+ if (scrollableHost && !elementRef.nativeElement.offsetParent) {
2723
2705
  scrollableHost = undefined;
2724
2706
  this.observeForScrollableHostChanges(scrollableHost, parentMutationObserver);
2725
2707
  notifySubscribers(subscribers, scrollableHost);