@skyux/tabs 8.7.2 → 8.8.1

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.
@@ -1,12 +1,12 @@
1
1
  import * as i4 from '@angular/common';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { NgModule, Injectable, Component, ChangeDetectionStrategy, Optional, Input, ViewChild, HostListener, ContentChildren, EventEmitter, Output, ViewEncapsulation, HostBinding, Pipe, inject } from '@angular/core';
4
+ import { NgModule, Injectable, Component, ChangeDetectionStrategy, Optional, Input, ViewChild, HostListener, ContentChildren, EventEmitter, Output, ViewEncapsulation, inject, HostBinding, Pipe } from '@angular/core';
5
5
  import { SkyCheckboxModule } from '@skyux/forms';
6
6
  import * as i7 from '@skyux/theme';
7
7
  import { SkyThemeModule } from '@skyux/theme';
8
8
  import * as i1 from '@skyux/core';
9
- import { SkyMediaBreakpoints, SkyMediaQueryService, SkyIdModule, SkyLayoutHostService } from '@skyux/core';
9
+ import { SkyMediaBreakpoints, SkyMediaQueryService, SkyIdModule, SkyResizeObserverMediaQueryService, SkyLayoutHostService } from '@skyux/core';
10
10
  import * as i6 from '@skyux/indicators';
11
11
  import { SkyIconModule, SkyExpansionIndicatorModule, SkyStatusIndicatorModule } from '@skyux/indicators';
12
12
  import * as i3 from '@skyux/i18n';
@@ -1666,7 +1666,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1666
1666
  type: Injectable
1667
1667
  }], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute }, { type: i4.Location }, { type: i1$1.Router }]; } });
1668
1668
 
1669
- var _SkyTabComponent_instances, _SkyTabComponent__active, _SkyTabComponent_activeChange, _SkyTabComponent__permalinkValue, _SkyTabComponent_stateChange, _SkyTabComponent__tabHeading, _SkyTabComponent__tabIndex, _SkyTabComponent__layout, _SkyTabComponent_tabIndexChange, _SkyTabComponent_changeDetector, _SkyTabComponent_permalinkService, _SkyTabComponent_tabsetService, _SkyTabComponent_setPermalinkValueOrDefault;
1669
+ var _SkyTabComponent_instances, _SkyTabComponent__active, _SkyTabComponent_activeChange, _SkyTabComponent__permalinkValue, _SkyTabComponent_stateChange, _SkyTabComponent__tabHeading, _SkyTabComponent__tabIndex, _SkyTabComponent__layout, _SkyTabComponent__tabElement, _SkyTabComponent_tabIndexChange, _SkyTabComponent_observingTab, _SkyTabComponent_changeDetector, _SkyTabComponent_permalinkService, _SkyTabComponent_tabsetService, _SkyTabComponent_mediaQueryService, _SkyTabComponent_setPermalinkValueOrDefault, _SkyTabComponent_observeTabResize;
1670
1670
  const LAYOUT_CLASS_PREFIX = 'sky-layout-host-';
1671
1671
  const LAYOUT_DEFAULT = 'none';
1672
1672
  let nextId = 0;
@@ -1735,16 +1735,17 @@ class SkyTabComponent {
1735
1735
  return __classPrivateFieldGet(this, _SkyTabComponent__tabIndex, "f");
1736
1736
  }
1737
1737
  /**
1738
- * The page layout that corresponds with the top-level component type
1739
- * used on the page. For laying out custom content, use `auto` to allow
1740
- * the page contents to expand beyond the bottom of the browser window
1741
- * or `fit` to constrain the page contents to the available viewport.
1742
- * @default "auto"
1738
+ * The tab layout that applies spacing to the tab container element. Use the layout
1739
+ * that corresponds with the top-level component type used within the tab, or use `fit` to
1740
+ * constrain the tab contents to the available viewport.
1741
+ * Use `none` for custom content that does not adhere to predefined spacing or constraints.
1742
+ * @default "none"
1743
1743
  */
1744
1744
  set layout(value) {
1745
1745
  const layout = value || LAYOUT_DEFAULT;
1746
1746
  __classPrivateFieldSet(this, _SkyTabComponent__layout, layout, "f");
1747
1747
  this.cssClass = `${LAYOUT_CLASS_PREFIX}${layout}`;
1748
+ __classPrivateFieldGet(this, _SkyTabComponent_instances, "m", _SkyTabComponent_observeTabResize).call(this);
1748
1749
  if (this.active) {
1749
1750
  __classPrivateFieldGet(this, _SkyTabComponent_tabsetService, "f").updateActiveTabLayout(layout);
1750
1751
  }
@@ -1761,6 +1762,13 @@ class SkyTabComponent {
1761
1762
  get tabIndexChange() {
1762
1763
  return __classPrivateFieldGet(this, _SkyTabComponent_tabIndexChange, "f");
1763
1764
  }
1765
+ set tabContentWrapper(tabContentWrapper) {
1766
+ __classPrivateFieldSet(this, _SkyTabComponent__tabElement, tabContentWrapper, "f");
1767
+ __classPrivateFieldGet(this, _SkyTabComponent_instances, "m", _SkyTabComponent_observeTabResize).call(this);
1768
+ }
1769
+ get tabContentWrapper() {
1770
+ return __classPrivateFieldGet(this, _SkyTabComponent__tabElement, "f");
1771
+ }
1764
1772
  constructor(changeDetector, permalinkService, tabsetService) {
1765
1773
  _SkyTabComponent_instances.add(this);
1766
1774
  this.cssClass = `${LAYOUT_CLASS_PREFIX}${LAYOUT_DEFAULT}`;
@@ -1779,10 +1787,13 @@ class SkyTabComponent {
1779
1787
  _SkyTabComponent__tabHeading.set(this, void 0);
1780
1788
  _SkyTabComponent__tabIndex.set(this, void 0);
1781
1789
  _SkyTabComponent__layout.set(this, LAYOUT_DEFAULT);
1790
+ _SkyTabComponent__tabElement.set(this, void 0);
1782
1791
  _SkyTabComponent_tabIndexChange.set(this, void 0);
1792
+ _SkyTabComponent_observingTab.set(this, false);
1783
1793
  _SkyTabComponent_changeDetector.set(this, void 0);
1784
1794
  _SkyTabComponent_permalinkService.set(this, void 0);
1785
1795
  _SkyTabComponent_tabsetService.set(this, void 0);
1796
+ _SkyTabComponent_mediaQueryService.set(this, inject(SkyResizeObserverMediaQueryService));
1786
1797
  __classPrivateFieldSet(this, _SkyTabComponent_changeDetector, changeDetector, "f");
1787
1798
  __classPrivateFieldSet(this, _SkyTabComponent_permalinkService, permalinkService, "f");
1788
1799
  __classPrivateFieldSet(this, _SkyTabComponent_tabsetService, tabsetService, "f");
@@ -1801,6 +1812,9 @@ class SkyTabComponent {
1801
1812
  (changes['permalinkValue'] && !changes['permalinkValue'].firstChange)) {
1802
1813
  __classPrivateFieldGet(this, _SkyTabComponent_stateChange, "f").next();
1803
1814
  }
1815
+ if (changes['layout'] && changes['layout'].currentValue === 'none') {
1816
+ __classPrivateFieldGet(this, _SkyTabComponent_mediaQueryService, "f").unobserve();
1817
+ }
1804
1818
  }
1805
1819
  ngOnDestroy() {
1806
1820
  __classPrivateFieldGet(this, _SkyTabComponent_activeChange, "f").complete();
@@ -1809,6 +1823,8 @@ class SkyTabComponent {
1809
1823
  if (this.tabIndex !== undefined) {
1810
1824
  __classPrivateFieldGet(this, _SkyTabComponent_tabsetService, "f").unregisterTab(this.tabIndex);
1811
1825
  }
1826
+ __classPrivateFieldGet(this, _SkyTabComponent_mediaQueryService, "f").unobserve();
1827
+ __classPrivateFieldSet(this, _SkyTabComponent_observingTab, false, "f");
1812
1828
  }
1813
1829
  init() {
1814
1830
  __classPrivateFieldSet(this, _SkyTabComponent__tabIndex, __classPrivateFieldGet(this, _SkyTabComponent_tabsetService, "f").registerTab(this.tabIndex), "f");
@@ -1827,16 +1843,41 @@ class SkyTabComponent {
1827
1843
  return this.close.observers.length > 0;
1828
1844
  }
1829
1845
  }
1830
- _SkyTabComponent__active = new WeakMap(), _SkyTabComponent_activeChange = new WeakMap(), _SkyTabComponent__permalinkValue = new WeakMap(), _SkyTabComponent_stateChange = new WeakMap(), _SkyTabComponent__tabHeading = new WeakMap(), _SkyTabComponent__tabIndex = new WeakMap(), _SkyTabComponent__layout = new WeakMap(), _SkyTabComponent_tabIndexChange = new WeakMap(), _SkyTabComponent_changeDetector = new WeakMap(), _SkyTabComponent_permalinkService = new WeakMap(), _SkyTabComponent_tabsetService = new WeakMap(), _SkyTabComponent_instances = new WeakSet(), _SkyTabComponent_setPermalinkValueOrDefault = function _SkyTabComponent_setPermalinkValueOrDefault() {
1846
+ _SkyTabComponent__active = new WeakMap(), _SkyTabComponent_activeChange = new WeakMap(), _SkyTabComponent__permalinkValue = new WeakMap(), _SkyTabComponent_stateChange = new WeakMap(), _SkyTabComponent__tabHeading = new WeakMap(), _SkyTabComponent__tabIndex = new WeakMap(), _SkyTabComponent__layout = new WeakMap(), _SkyTabComponent__tabElement = new WeakMap(), _SkyTabComponent_tabIndexChange = new WeakMap(), _SkyTabComponent_observingTab = new WeakMap(), _SkyTabComponent_changeDetector = new WeakMap(), _SkyTabComponent_permalinkService = new WeakMap(), _SkyTabComponent_tabsetService = new WeakMap(), _SkyTabComponent_mediaQueryService = new WeakMap(), _SkyTabComponent_instances = new WeakSet(), _SkyTabComponent_setPermalinkValueOrDefault = function _SkyTabComponent_setPermalinkValueOrDefault() {
1831
1847
  this.permalinkValueOrDefault =
1832
1848
  __classPrivateFieldGet(this, _SkyTabComponent_permalinkService, "f").urlify(this.permalinkValue) ||
1833
1849
  __classPrivateFieldGet(this, _SkyTabComponent_permalinkService, "f").urlify(this.tabHeading);
1850
+ }, _SkyTabComponent_observeTabResize = function _SkyTabComponent_observeTabResize() {
1851
+ if (this.tabContentWrapper) {
1852
+ if (this.layout !== 'none' && !__classPrivateFieldGet(this, _SkyTabComponent_observingTab, "f")) {
1853
+ __classPrivateFieldSet(this, _SkyTabComponent_observingTab, true, "f");
1854
+ __classPrivateFieldGet(this, _SkyTabComponent_mediaQueryService, "f").observe(this.tabContentWrapper, {
1855
+ updateResponsiveClasses: true,
1856
+ });
1857
+ }
1858
+ else if (this.layout === 'none' && __classPrivateFieldGet(this, _SkyTabComponent_observingTab, "f")) {
1859
+ __classPrivateFieldSet(this, _SkyTabComponent_observingTab, false, "f");
1860
+ __classPrivateFieldGet(this, _SkyTabComponent_mediaQueryService, "f").unobserve();
1861
+ }
1862
+ }
1834
1863
  };
1835
1864
  SkyTabComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyTabComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: SkyTabsetPermalinkService }, { token: SkyTabsetService }], target: i0.ɵɵFactoryTarget.Component });
1836
- SkyTabComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: SkyTabComponent, selector: "sky-tab", inputs: { active: "active", disabled: "disabled", permalinkValue: "permalinkValue", tabHeaderCount: "tabHeaderCount", tabHeading: "tabHeading", tabIndex: "tabIndex", layout: "layout" }, outputs: { close: "close" }, host: { properties: { "class": "this.cssClass" } }, usesOnChanges: true, ngImport: i0, template: "<div\n class=\"sky-tab\"\n role=\"tabpanel\"\n [attr.aria-labelledby]=\"tabButtonId\"\n [hidden]=\"!showContent\"\n [id]=\"tabPanelId\"\n>\n <ng-content></ng-content>\n</div>\n", styles: [":host.sky-layout-host-fit{display:flex;flex-grow:1;position:static}:host.sky-layout-host-fit .sky-tab{flex-grow:1;position:relative}.sky-tab{flex-grow:var(--sky-layout-host-content-flex-grow, 0);overflow:var(--sky-layout-host-content-overflow, visible);padding:var(--sky-layout-host-content-spacing, 0);position:var(--sky-layout-host-content-position, static)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1865
+ SkyTabComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: SkyTabComponent, selector: "sky-tab", inputs: { active: "active", disabled: "disabled", permalinkValue: "permalinkValue", tabHeaderCount: "tabHeaderCount", tabHeading: "tabHeading", tabIndex: "tabIndex", layout: "layout" }, outputs: { close: "close" }, host: { properties: { "class": "this.cssClass" } }, providers: [
1866
+ SkyResizeObserverMediaQueryService,
1867
+ {
1868
+ provide: SkyMediaQueryService,
1869
+ useExisting: SkyResizeObserverMediaQueryService,
1870
+ },
1871
+ ], viewQueries: [{ propertyName: "tabContentWrapper", first: true, predicate: ["tabContentWrapper"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"sky-tab\"\n role=\"tabpanel\"\n [attr.aria-labelledby]=\"tabButtonId\"\n [hidden]=\"!showContent\"\n [id]=\"tabPanelId\"\n #tabContentWrapper\n>\n <ng-content></ng-content>\n</div>\n", styles: [":host.sky-layout-host-fit{display:flex;flex-grow:1;position:static}:host.sky-layout-host-fit .sky-tab{flex-grow:1;position:relative}.sky-tab{flex-grow:var(--sky-layout-host-content-flex-grow, 0);overflow:var(--sky-layout-host-content-overflow, visible);padding:var(--sky-layout-host-content-spacing, 0);position:var(--sky-layout-host-content-position, static)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1837
1872
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyTabComponent, decorators: [{
1838
1873
  type: Component,
1839
- args: [{ selector: 'sky-tab', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"sky-tab\"\n role=\"tabpanel\"\n [attr.aria-labelledby]=\"tabButtonId\"\n [hidden]=\"!showContent\"\n [id]=\"tabPanelId\"\n>\n <ng-content></ng-content>\n</div>\n", styles: [":host.sky-layout-host-fit{display:flex;flex-grow:1;position:static}:host.sky-layout-host-fit .sky-tab{flex-grow:1;position:relative}.sky-tab{flex-grow:var(--sky-layout-host-content-flex-grow, 0);overflow:var(--sky-layout-host-content-overflow, visible);padding:var(--sky-layout-host-content-spacing, 0);position:var(--sky-layout-host-content-position, static)}\n"] }]
1874
+ args: [{ selector: 'sky-tab', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
1875
+ SkyResizeObserverMediaQueryService,
1876
+ {
1877
+ provide: SkyMediaQueryService,
1878
+ useExisting: SkyResizeObserverMediaQueryService,
1879
+ },
1880
+ ], template: "<div\n class=\"sky-tab\"\n role=\"tabpanel\"\n [attr.aria-labelledby]=\"tabButtonId\"\n [hidden]=\"!showContent\"\n [id]=\"tabPanelId\"\n #tabContentWrapper\n>\n <ng-content></ng-content>\n</div>\n", styles: [":host.sky-layout-host-fit{display:flex;flex-grow:1;position:static}:host.sky-layout-host-fit .sky-tab{flex-grow:1;position:relative}.sky-tab{flex-grow:var(--sky-layout-host-content-flex-grow, 0);overflow:var(--sky-layout-host-content-overflow, visible);padding:var(--sky-layout-host-content-spacing, 0);position:var(--sky-layout-host-content-position, static)}\n"] }]
1840
1881
  }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: SkyTabsetPermalinkService }, { type: SkyTabsetService }]; }, propDecorators: { active: [{
1841
1882
  type: Input
1842
1883
  }], disabled: [{
@@ -1856,6 +1897,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1856
1897
  args: ['class']
1857
1898
  }], close: [{
1858
1899
  type: Output
1900
+ }], tabContentWrapper: [{
1901
+ type: ViewChild,
1902
+ args: ['tabContentWrapper']
1859
1903
  }] } });
1860
1904
 
1861
1905
  class SkyTabsetNavButtonDisabledPipe {