@skyux/tabs 4.6.9

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 (152) hide show
  1. package/CHANGELOG.md +218 -0
  2. package/README.md +5 -0
  3. package/bundles/skyux-tabs-testing.umd.js +395 -0
  4. package/bundles/skyux-tabs-testing.umd.js.map +1 -0
  5. package/bundles/skyux-tabs-testing.umd.min.js +16 -0
  6. package/bundles/skyux-tabs-testing.umd.min.js.map +1 -0
  7. package/bundles/skyux-tabs.umd.js +2414 -0
  8. package/bundles/skyux-tabs.umd.js.map +1 -0
  9. package/bundles/skyux-tabs.umd.min.js +16 -0
  10. package/bundles/skyux-tabs.umd.min.js.map +1 -0
  11. package/esm2015/modules/sectioned-form/sectioned-form-section.component.js +74 -0
  12. package/esm2015/modules/sectioned-form/sectioned-form.component.js +105 -0
  13. package/esm2015/modules/sectioned-form/sectioned-form.module.js +28 -0
  14. package/esm2015/modules/sectioned-form/sectioned-form.service.js +34 -0
  15. package/esm2015/modules/shared/tabs-resources.module.js +17 -0
  16. package/esm2015/modules/tabs/tab-button.component.js +71 -0
  17. package/esm2015/modules/tabs/tab-index.js +1 -0
  18. package/esm2015/modules/tabs/tab.component.js +144 -0
  19. package/esm2015/modules/tabs/tabs.module.js +41 -0
  20. package/esm2015/modules/tabs/tabset-active-tab-unregistered-args.js +1 -0
  21. package/esm2015/modules/tabs/tabset-adapter.service.js +53 -0
  22. package/esm2015/modules/tabs/tabset-buttons-display-mode.js +1 -0
  23. package/esm2015/modules/tabs/tabset-nav-button.component.js +122 -0
  24. package/esm2015/modules/tabs/tabset-permalink.service.js +123 -0
  25. package/esm2015/modules/tabs/tabset-style.js +1 -0
  26. package/esm2015/modules/tabs/tabset-tab-indexes-change.js +1 -0
  27. package/esm2015/modules/tabs/tabset.component.js +403 -0
  28. package/esm2015/modules/tabs/tabset.service.js +109 -0
  29. package/esm2015/modules/vertical-tabset/vertical-tab-media-query.service.js +71 -0
  30. package/esm2015/modules/vertical-tabset/vertical-tab.component.js +195 -0
  31. package/esm2015/modules/vertical-tabset/vertical-tabset-adapter.service.js +50 -0
  32. package/esm2015/modules/vertical-tabset/vertical-tabset-group.component.js +113 -0
  33. package/esm2015/modules/vertical-tabset/vertical-tabset.component.js +139 -0
  34. package/esm2015/modules/vertical-tabset/vertical-tabset.module.js +43 -0
  35. package/esm2015/modules/vertical-tabset/vertical-tabset.service.js +167 -0
  36. package/esm2015/plugin-resources/tabs-resources-provider.js +16 -0
  37. package/esm2015/public_api.js +10 -0
  38. package/esm2015/skyux-tabs.js +21 -0
  39. package/esm2015/testing/public_api.js +2 -0
  40. package/esm2015/testing/skyux-tabs-testing.js +5 -0
  41. package/esm2015/testing/tabs/tab-fixture-tab.js +1 -0
  42. package/esm2015/testing/tabs/tabset-fixture.js +141 -0
  43. package/esm5/modules/sectioned-form/sectioned-form-section.component.js +84 -0
  44. package/esm5/modules/sectioned-form/sectioned-form.component.js +111 -0
  45. package/esm5/modules/sectioned-form/sectioned-form.module.js +31 -0
  46. package/esm5/modules/sectioned-form/sectioned-form.service.js +35 -0
  47. package/esm5/modules/shared/tabs-resources.module.js +20 -0
  48. package/esm5/modules/tabs/tab-button.component.js +72 -0
  49. package/esm5/modules/tabs/tab-index.js +1 -0
  50. package/esm5/modules/tabs/tab.component.js +173 -0
  51. package/esm5/modules/tabs/tabs.module.js +44 -0
  52. package/esm5/modules/tabs/tabset-active-tab-unregistered-args.js +1 -0
  53. package/esm5/modules/tabs/tabset-adapter.service.js +58 -0
  54. package/esm5/modules/tabs/tabset-buttons-display-mode.js +1 -0
  55. package/esm5/modules/tabs/tabset-nav-button.component.js +145 -0
  56. package/esm5/modules/tabs/tabset-permalink.service.js +129 -0
  57. package/esm5/modules/tabs/tabset-style.js +1 -0
  58. package/esm5/modules/tabs/tabset-tab-indexes-change.js +1 -0
  59. package/esm5/modules/tabs/tabset.component.js +434 -0
  60. package/esm5/modules/tabs/tabset.service.js +122 -0
  61. package/esm5/modules/vertical-tabset/vertical-tab-media-query.service.js +76 -0
  62. package/esm5/modules/vertical-tabset/vertical-tab.component.js +214 -0
  63. package/esm5/modules/vertical-tabset/vertical-tabset-adapter.service.js +51 -0
  64. package/esm5/modules/vertical-tabset/vertical-tabset-group.component.js +119 -0
  65. package/esm5/modules/vertical-tabset/vertical-tabset.component.js +145 -0
  66. package/esm5/modules/vertical-tabset/vertical-tabset.module.js +46 -0
  67. package/esm5/modules/vertical-tabset/vertical-tabset.service.js +176 -0
  68. package/esm5/plugin-resources/tabs-resources-provider.js +17 -0
  69. package/esm5/public_api.js +10 -0
  70. package/esm5/skyux-tabs.js +21 -0
  71. package/esm5/testing/public_api.js +2 -0
  72. package/esm5/testing/skyux-tabs-testing.js +5 -0
  73. package/esm5/testing/tabs/tab-fixture-tab.js +1 -0
  74. package/esm5/testing/tabs/tabset-fixture.js +168 -0
  75. package/fesm2015/skyux-tabs-testing.js +148 -0
  76. package/fesm2015/skyux-tabs-testing.js.map +1 -0
  77. package/fesm2015/skyux-tabs.js +1998 -0
  78. package/fesm2015/skyux-tabs.js.map +1 -0
  79. package/fesm5/skyux-tabs-testing.js +174 -0
  80. package/fesm5/skyux-tabs-testing.js.map +1 -0
  81. package/fesm5/skyux-tabs.js +2182 -0
  82. package/fesm5/skyux-tabs.js.map +1 -0
  83. package/modules/sectioned-form/sectioned-form-section.component.d.ts +39 -0
  84. package/modules/sectioned-form/sectioned-form.component.d.ts +30 -0
  85. package/modules/sectioned-form/sectioned-form.module.d.ts +2 -0
  86. package/modules/sectioned-form/sectioned-form.service.d.ts +21 -0
  87. package/modules/shared/tabs-resources.module.d.ts +2 -0
  88. package/modules/tabs/tab-button.component.d.ts +21 -0
  89. package/modules/tabs/tab-index.d.ts +1 -0
  90. package/modules/tabs/tab.component.d.ts +77 -0
  91. package/modules/tabs/tabs.module.d.ts +2 -0
  92. package/modules/tabs/tabset-active-tab-unregistered-args.d.ts +10 -0
  93. package/modules/tabs/tabset-adapter.service.d.ts +21 -0
  94. package/modules/tabs/tabset-buttons-display-mode.d.ts +1 -0
  95. package/modules/tabs/tabset-nav-button.component.d.ts +24 -0
  96. package/modules/tabs/tabset-permalink.service.d.ts +43 -0
  97. package/modules/tabs/tabset-style.d.ts +1 -0
  98. package/modules/tabs/tabset-tab-indexes-change.d.ts +7 -0
  99. package/modules/tabs/tabset.component.d.ts +142 -0
  100. package/modules/tabs/tabset.service.d.ts +51 -0
  101. package/modules/vertical-tabset/vertical-tab-media-query.service.d.ts +15 -0
  102. package/modules/vertical-tabset/vertical-tab.component.d.ts +86 -0
  103. package/modules/vertical-tabset/vertical-tabset-adapter.service.d.ts +10 -0
  104. package/modules/vertical-tabset/vertical-tabset-group.component.d.ts +33 -0
  105. package/modules/vertical-tabset/vertical-tabset.component.d.ts +45 -0
  106. package/modules/vertical-tabset/vertical-tabset.module.d.ts +2 -0
  107. package/modules/vertical-tabset/vertical-tabset.service.d.ts +41 -0
  108. package/package.json +41 -0
  109. package/plugin-resources/tabs-resources-provider.d.ts +5 -0
  110. package/public_api.d.ts +9 -0
  111. package/skyux-tabs.d.ts +20 -0
  112. package/skyux-tabs.metadata.json +1 -0
  113. package/src/assets/img/guidelines/tabs/tabs-anatomy.png +0 -0
  114. package/src/assets/img/guidelines/tabs/tabs-behavior-1.png +0 -0
  115. package/src/assets/img/guidelines/tabs/tabs-layout-1.png +0 -0
  116. package/src/assets/img/guidelines/tabs/tabs-layout-2.png +0 -0
  117. package/src/assets/img/guidelines/tabs/tabs-layout-3.png +0 -0
  118. package/src/assets/img/guidelines/tabs/tabs-layout-4.png +0 -0
  119. package/src/assets/img/guidelines/tabs/tabs-options-1.png +0 -0
  120. package/src/assets/img/guidelines/tabs/tabs-options-2.png +0 -0
  121. package/src/assets/img/guidelines/tabs/tabs-state-collapsed-closed.png +0 -0
  122. package/src/assets/img/guidelines/tabs/tabs-state-collapsed-open.png +0 -0
  123. package/src/assets/img/guidelines/tabs/tabs-state-hover.png +0 -0
  124. package/src/assets/img/guidelines/tabs/tabs-state-selected.png +0 -0
  125. package/src/assets/img/guidelines/tabs/tabs-state-unselected.png +0 -0
  126. package/src/assets/img/guidelines/tabs/tabs-usage-1.png +0 -0
  127. package/src/assets/img/guidelines/tabs/tabs-usage-2.png +0 -0
  128. package/src/assets/img/guidelines/tabs/tabs-usage-3.png +0 -0
  129. package/src/assets/img/guidelines/tabs/tabs-usage-4.png +0 -0
  130. package/src/assets/img/guidelines/tabs/tabs-usage-5.png +0 -0
  131. package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-anatomy-1.png +0 -0
  132. package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-anatomy-2.png +0 -0
  133. package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-layout-1.png +0 -0
  134. package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-state-hover.png +0 -0
  135. package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-state-selected-group.png +0 -0
  136. package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-state-selected.png +0 -0
  137. package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-state-unselected-group.png +0 -0
  138. package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-state-unselected.png +0 -0
  139. package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-usage-1.png +0 -0
  140. package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-usage-2.png +0 -0
  141. package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-usage-3.png +0 -0
  142. package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-usage-4.png +0 -0
  143. package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-usage-5.png +0 -0
  144. package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-usage-6.png +0 -0
  145. package/src/assets/img/guidelines/vertical-tabs/vertical-tabs-usage-7.png +0 -0
  146. package/src/assets/locales/resources_en_US.json +26 -0
  147. package/testing/package.json +13 -0
  148. package/testing/public_api.d.ts +2 -0
  149. package/testing/skyux-tabs-testing.d.ts +4 -0
  150. package/testing/skyux-tabs-testing.metadata.json +1 -0
  151. package/testing/tabs/tab-fixture-tab.d.ts +25 -0
  152. package/testing/tabs/tabset-fixture.d.ts +50 -0
@@ -0,0 +1,17 @@
1
+ import { __decorate } from "tslib";
2
+ import { Injectable } from '@angular/core';
3
+ import { getStringForLocale } from '@skyux/i18n';
4
+ var SkyTabsResourcesProvider = /** @class */ (function () {
5
+ function SkyTabsResourcesProvider() {
6
+ this.resources = { "EN-US": { "skyux_tab_add": "Add tab", "skyux_tab_close": "Close {0} tab", "skyux_tabs_navigator_next": "Next", "skyux_tabs_navigator_previous": "Previous", "skyux_tab_open": "Open tab", "skyux_vertical_tabs_show_tabs_text": "Tab list" } };
7
+ }
8
+ SkyTabsResourcesProvider.prototype.getString = function (localeInfo, name) {
9
+ return getStringForLocale(this.resources, localeInfo.locale, name);
10
+ };
11
+ SkyTabsResourcesProvider = __decorate([
12
+ Injectable()
13
+ ], SkyTabsResourcesProvider);
14
+ return SkyTabsResourcesProvider;
15
+ }());
16
+ export { SkyTabsResourcesProvider };
17
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFicy1yZXNvdXJjZXMtcHJvdmlkZXIuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Ac2t5dXgvdGFicy8iLCJzb3VyY2VzIjpbInBsdWdpbi1yZXNvdXJjZXMvdGFicy1yZXNvdXJjZXMtcHJvdmlkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUNBLE9BQU8sRUFDTCxVQUFVLEVBQ1gsTUFBTSxlQUFlLENBQUM7QUFFdkIsT0FBTyxFQUNMLGtCQUFrQixFQUduQixNQUFNLGFBQWEsQ0FBQztBQUdyQjtJQUFBO1FBQ1UsY0FBUyxHQUFRLEVBQUMsT0FBTyxFQUFDLEVBQUMsZUFBZSxFQUFDLFNBQVMsRUFBQyxpQkFBaUIsRUFBQyxlQUFlLEVBQUMsMkJBQTJCLEVBQUMsTU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XCJza3l1eF92ZXJ0aWNhbF90YWJzX3Nob3dfdGFic190ZXh0XCI6XCJUYWIgbGlzdFwifX07XG5cbiAgcHVibGljIGdldFN0cmluZyhsb2NhbGVJbmZvOiBTa3lBcHBMb2NhbGVJbmZvLCBuYW1lOiBzdHJpbmcpOiBzdHJpbmcge1xuICAgIHJldHVybiBnZXRTdHJpbmdGb3JMb2NhbGUodGhpcy5yZXNvdXJjZXMsIGxvY2FsZUluZm8ubG9jYWxlLCBuYW1lKTtcbiAgfVxufVxuIl19
@@ -0,0 +1,10 @@
1
+ export * from './modules/sectioned-form/sectioned-form.module';
2
+ export * from './modules/sectioned-form/sectioned-form.service';
3
+ export * from './modules/tabs/tabs.module';
4
+ export * from './modules/vertical-tabset/vertical-tabset.module';
5
+ // The following export is needed because our docs use it as a prescribed pattern.
6
+ // Ideally, this functionality would live in a standard `Input` or `Output`.
7
+ // https://developer.blackbaud.com/skyux/components/sectioned-form#code
8
+ // TODO: Try to remove in a major release.
9
+ export * from './modules/sectioned-form/sectioned-form.component';
10
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0Bza3l1eC90YWJzLyIsInNvdXJjZXMiOlsicHVibGljX2FwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLGdEQUFnRCxDQUFDO0FBQy9ELGNBQWMsaURBQWlELENBQUM7QUFNaEUsY0FBYyw0QkFBNEIsQ0FBQztBQUUzQyxjQUFjLGtEQUFrRCxDQUFDO0FBRWpFLGtGQUFrRjtBQUNsRiw0RUFBNEU7QUFDNUUsdUVBQXVFO0FBQ3ZFLDBDQUEwQztBQUMxQyxjQUFjLG1EQUFtRCxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9tb2R1bGVzL3NlY3Rpb25lZC1mb3JtL3NlY3Rpb25lZC1mb3JtL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
+ export { SkySectionedFormSectionComponent as ɵd } from './modules/sectioned-form/sectioned-form-section.component';
6
+ export { SkyTabsResourcesModule as ɵj } from './modules/shared/tabs-resources.module';
7
+ export { SkyTabButtonComponent as ɵl } from './modules/tabs/tab-button.component';
8
+ export { SkyTabComponent as ɵm } from './modules/tabs/tab.component';
9
+ export { SkyTabsetAdapterService as ɵq } from './modules/tabs/tabset-adapter.service';
10
+ export { SkyTabsetNavButtonComponent as ɵr } from './modules/tabs/tabset-nav-button.component';
11
+ export { SkyTabsetPermalinkService as ɵn } from './modules/tabs/tabset-permalink.service';
12
+ export { SkyTabsetComponent as ɵp } from './modules/tabs/tabset.component';
13
+ export { SkyTabsetService as ɵo } from './modules/tabs/tabset.service';
14
+ export { SkyVerticalTabMediaQueryService as ɵf } from './modules/vertical-tabset/vertical-tab-media-query.service';
15
+ export { SkyVerticalTabComponent as ɵe } from './modules/vertical-tabset/vertical-tab.component';
16
+ export { SkyVerticalTabsetAdapterService as ɵg } from './modules/vertical-tabset/vertical-tabset-adapter.service';
17
+ export { SkyVerticalTabsetGroupComponent as ɵi } from './modules/vertical-tabset/vertical-tabset-group.component';
18
+ export { SkyVerticalTabsetComponent as ɵh } from './modules/vertical-tabset/vertical-tabset.component';
19
+ export { HIDDEN_STATE as ɵb, SkyVerticalTabsetService as ɵc, VISIBLE_STATE as ɵa } from './modules/vertical-tabset/vertical-tabset.service';
20
+ export { SkyTabsResourcesProvider as ɵk } from './plugin-resources/tabs-resources-provider';
21
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2t5dXgtdGFicy5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0Bza3l1eC90YWJzLyIsInNvdXJjZXMiOlsic2t5dXgtdGFicy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsY0FBYyxDQUFDO0FBRTdCLE9BQU8sRUFBQyxnQ0FBZ0MsSUFBSSxFQUFF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ZlcnRpY2FsLXRhYnNldC92ZXJ0aWNhbC10YWJzZXQuc2VydmljZSc7XG5leHBvcnQge1NreVRhYnNSZXNvdXJjZXNQcm92aWRlciBhcyDJtWt9IGZyb20gJy4vcGx1Z2luLXJlc291cmNlcy90YWJzLXJlc291cmNlcy1wcm92aWRlcic7Il19
@@ -0,0 +1,2 @@
1
+ export * from './tabs/tabset-fixture';
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0Bza3l1eC90YWJzL3Rlc3RpbmcvIiwic291cmNlcyI6WyJwdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLGNBQWMsdUJBQXVCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL3RhYnMvdGFiLWZpeHR1cmUtdGFiJztcbmV4cG9ydCAqIGZyb20gJy4vdGFicy90YWJzZXQtZml4dHVyZSc7XG4iXX0=
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './public_api';
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2t5dXgtdGFicy10ZXN0aW5nLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQHNreXV4L3RhYnMvdGVzdGluZy8iLCJzb3VyY2VzIjpbInNreXV4LXRhYnMtdGVzdGluZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsY0FBYyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3B1YmxpY19hcGknO1xuIl19
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFiLWZpeHR1cmUtdGFiLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQHNreXV4L3RhYnMvdGVzdGluZy8iLCJzb3VyY2VzIjpbInRhYnMvdGFiLWZpeHR1cmUtdGFiLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIFByb3BlcnRpZXMgb2YgYSBTS1kgVVggdGFiLlxuICovXG5leHBvcnQgaW50ZXJmYWNlIFNreVRhYnNldEZpeHR1cmVUYWIge1xuXG4gIC8qKlxuICAgKiBJbmRpY2F0ZXMgd2hldGhlciB0aGUgdGFiIGlzIHRoZSBjdXJyZW50bHkgc2VsZWN0ZWQgdGFiLlxuICAgKi9cbiAgYWN0aXZlOiBib29sZWFuO1xuXG4gIC8qKlxuICAgKiBJbmRpY2F0ZXMgd2hldGhlciB0aGUgdGFiIGlzIGRpc2FibGVkLlxuICAgKi9cbiAgZGlzYWJsZWQ6IGJvb2xlYW47XG5cbiAgLyoqXG4gICAqIFRoZSBwZXJtYWxpbmsgdmFsdWUgc3BlY2lmaWVkIGZvciB0aGUgdGFiLlxuICAgKi9cbiAgcGVybWFsaW5rVmFsdWU6IHN0cmluZztcblxuICAvKipcbiAgICogVGhlIGNvdW50IGRpc3BsYXllZCBpbiB0aGUgdGFiIGhlYWRlci5cbiAgICovXG4gIHRhYkhlYWRlckNvdW50OiBzdHJpbmc7XG5cbiAgLyoqXG4gICAqIFRoZSB0ZXh0IGRpc3BsYXllZCBpbiB0aGUgdGFiIGhlYWRlci5cbiAgICovXG4gIHRhYkhlYWRpbmc6IHN0cmluZztcblxufVxuIl19
@@ -0,0 +1,168 @@
1
+ import { __awaiter, __generator } from "tslib";
2
+ import { By } from '@angular/platform-browser';
3
+ import { SkyAppTestUtility } from '@skyux-sdk/testing';
4
+ /**
5
+ * Allows interaction with a SKY UX tabset component.
6
+ */
7
+ var SkyTabsetFixture = /** @class */ (function () {
8
+ function SkyTabsetFixture(fixture, skyTestId) {
9
+ this.fixture = fixture;
10
+ this.debugEl = SkyAppTestUtility.getDebugElementByTestId(fixture, skyTestId, 'sky-tabset');
11
+ }
12
+ Object.defineProperty(SkyTabsetFixture.prototype, "ariaLabel", {
13
+ /**
14
+ * The tabset component's ARIA label.
15
+ */
16
+ get: function () {
17
+ var tabsetEl = this.getTabsetEl();
18
+ return tabsetEl.getAttribute('aria-label') || undefined;
19
+ },
20
+ enumerable: true,
21
+ configurable: true
22
+ });
23
+ Object.defineProperty(SkyTabsetFixture.prototype, "ariaLabelledBy", {
24
+ /**
25
+ * The tabset component's ARIA labelled by attribute.
26
+ */
27
+ get: function () {
28
+ var tabsetEl = this.getTabsetEl();
29
+ return tabsetEl.getAttribute('aria-labelledby') || undefined;
30
+ },
31
+ enumerable: true,
32
+ configurable: true
33
+ });
34
+ Object.defineProperty(SkyTabsetFixture.prototype, "activeTabIndex", {
35
+ /**
36
+ * The index of the currently selected tab.
37
+ */
38
+ get: function () {
39
+ var tabLinkEls = this.getTabLinkEls();
40
+ for (var i = 0, n = tabLinkEls.length; i < n; i++) {
41
+ if (tabLinkEls.item(i).classList.contains('sky-btn-tab-selected')) {
42
+ return i;
43
+ }
44
+ }
45
+ return -1;
46
+ },
47
+ enumerable: true,
48
+ configurable: true
49
+ });
50
+ /**
51
+ * Retrieves information about the tab at the specified index.
52
+ * @param tabIndex The index of the tab.
53
+ */
54
+ SkyTabsetFixture.prototype.getTab = function (tabIndex) {
55
+ var tabLinkEl = this.getTabLinkEl(tabIndex);
56
+ var active = this.activeTabIndex === tabIndex;
57
+ var disabled = tabLinkEl.classList.contains('sky-btn-tab-disabled');
58
+ var tabHeading = this.getTextContent(tabLinkEl.querySelector('.sky-tab-heading').childNodes[0]);
59
+ var tabHeaderCount = this.getTextContent(tabLinkEl.querySelector('.sky-tab-header-count'));
60
+ var permalinkValue;
61
+ if (tabLinkEl.href) {
62
+ var permalink = tabLinkEl.href.split('?')[1];
63
+ if (permalink) {
64
+ var permalinkParts = permalink.split('=');
65
+ permalinkValue = decodeURIComponent(permalinkParts[1]);
66
+ }
67
+ }
68
+ return {
69
+ active: active,
70
+ disabled: disabled,
71
+ permalinkValue: permalinkValue,
72
+ tabHeaderCount: tabHeaderCount,
73
+ tabHeading: tabHeading
74
+ };
75
+ };
76
+ /**
77
+ * Clicks the tabset's "new" button.
78
+ */
79
+ SkyTabsetFixture.prototype.clickNewButton = function () {
80
+ return __awaiter(this, void 0, void 0, function () {
81
+ return __generator(this, function (_a) {
82
+ return [2 /*return*/, this.clickButton('sky-tabset-btn-new')];
83
+ });
84
+ });
85
+ };
86
+ /**
87
+ * Clicks the tabset's "open" button.
88
+ */
89
+ SkyTabsetFixture.prototype.clickOpenButton = function () {
90
+ return __awaiter(this, void 0, void 0, function () {
91
+ return __generator(this, function (_a) {
92
+ return [2 /*return*/, this.clickButton('sky-tabset-btn-open')];
93
+ });
94
+ });
95
+ };
96
+ /**
97
+ * Clicks the tab button at the specified index.
98
+ * @param tabIndex The index of the tab.
99
+ */
100
+ SkyTabsetFixture.prototype.clickTab = function (tabIndex) {
101
+ return __awaiter(this, void 0, void 0, function () {
102
+ var tabLinkEl;
103
+ return __generator(this, function (_a) {
104
+ tabLinkEl = this.getTabLinkEl(tabIndex);
105
+ if (!tabLinkEl) {
106
+ throw new Error("There is no tab at index " + tabIndex + ".");
107
+ }
108
+ tabLinkEl.click();
109
+ this.fixture.detectChanges();
110
+ return [2 /*return*/, this.fixture.whenStable()];
111
+ });
112
+ });
113
+ };
114
+ /**
115
+ * Click's the tab's close button at the specified index.
116
+ * @param tabIndex The index of the tab.
117
+ */
118
+ SkyTabsetFixture.prototype.clickTabClose = function (tabIndex) {
119
+ return __awaiter(this, void 0, void 0, function () {
120
+ var tabWrapperEl, closeBtnEl;
121
+ return __generator(this, function (_a) {
122
+ tabWrapperEl = this.getTabsetEl().querySelectorAll(".sky-tabset-tabs .sky-btn-tab-wrapper")[tabIndex];
123
+ if (!tabWrapperEl) {
124
+ throw new Error("There is no tab at index " + tabIndex + ".");
125
+ }
126
+ closeBtnEl = tabWrapperEl.querySelector('.sky-btn-tab-close');
127
+ if (!closeBtnEl) {
128
+ throw new Error('The specified tab does not have a close button.');
129
+ }
130
+ closeBtnEl.click();
131
+ this.fixture.detectChanges();
132
+ return [2 /*return*/, this.fixture.whenStable()];
133
+ });
134
+ });
135
+ };
136
+ SkyTabsetFixture.prototype.clickButton = function (buttonCls) {
137
+ return __awaiter(this, void 0, void 0, function () {
138
+ var tabsetEl, newButtonEl;
139
+ return __generator(this, function (_a) {
140
+ tabsetEl = this.getTabsetEl();
141
+ newButtonEl = tabsetEl.querySelector(".sky-tabset-btns ." + buttonCls);
142
+ newButtonEl.click();
143
+ this.fixture.detectChanges();
144
+ return [2 /*return*/, this.fixture.whenStable()];
145
+ });
146
+ });
147
+ };
148
+ SkyTabsetFixture.prototype.getTabsetEl = function () {
149
+ var tabsetEl = this.debugEl.query(By.css('.sky-tabset')).nativeElement;
150
+ return tabsetEl;
151
+ };
152
+ SkyTabsetFixture.prototype.getTabLinkEls = function () {
153
+ return this.getTabsetEl().querySelectorAll(".sky-tabset-tabs .sky-btn-tab");
154
+ };
155
+ SkyTabsetFixture.prototype.getTabLinkEl = function (tabIndex) {
156
+ var tabLinkEl = this.getTabLinkEls().item(tabIndex);
157
+ if (!tabLinkEl) {
158
+ throw new Error("There is no tab at index " + tabIndex + ".");
159
+ }
160
+ return tabLinkEl;
161
+ };
162
+ SkyTabsetFixture.prototype.getTextContent = function (el) {
163
+ return (el && el.textContent.trim()) || undefined;
164
+ };
165
+ return SkyTabsetFixture;
166
+ }());
167
+ export { SkyTabsetFixture };
168
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFic2V0LWZpeHR1cmUuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Ac2t5dXgvdGFicy90ZXN0aW5nLyIsInNvdXJjZXMiOls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pbmtFbHMoKTogTm9kZUxpc3RPZjxIVE1MQW5jaG9yRWxlbWVudD4ge1xuICAgIHJldHVybiB0aGlzLmdldFRhYnNldEVsKCkucXVlcnlTZWxlY3RvckFsbChcbiAgICAgIGAuc2t5LXRhYnNldC10YWJzIC5za3ktYnRuLXRhYmBcbiAgICApO1xuICB9XG5cbiAgcHJpdmF0ZSBnZXRUYWJMaW5rRWwodGFiSW5kZXg6IG51bWJlcik6IEhUTUxBbmNob3JFbGVtZW50IHtcbiAgICBjb25zdCB0YWJMaW5rRWwgPSB0aGlzLmdldFRhYkxpbmtFbHMoKS5pdGVtKHRhYkluZGV4KTtcblxuICAgIGlmICghdGFiTGlua0VsKSB7XG4gICAgICB0aHJvdyBuZXcgRXJyb3IoYFRoZXJlIGlzIG5vIHRhYiBhdCBpbmRleCAke3RhYkluZGV4fS5gKTtcbiAgICB9XG5cbiAgICByZXR1cm4gdGFiTGlua0VsO1xuICB9XG5cbiAgcHJpdmF0ZSBnZXRUZXh0Q29udGVudChlbDogRWxlbWVudCB8IE5vZGUpOiBzdHJpbmcge1xuICAgIHJldHVybiAoZWwgJiYgZWwudGV4dENvbnRlbnQudHJpbSgpKSB8fCB1bmRlZmluZWQ7XG4gIH1cblxufVxuIl19
@@ -0,0 +1,148 @@
1
+ import { __awaiter } from 'tslib';
2
+ import { By } from '@angular/platform-browser';
3
+ import { SkyAppTestUtility } from '@skyux-sdk/testing';
4
+
5
+ /**
6
+ * Allows interaction with a SKY UX tabset component.
7
+ */
8
+ class SkyTabsetFixture {
9
+ constructor(fixture, skyTestId) {
10
+ this.fixture = fixture;
11
+ this.debugEl = SkyAppTestUtility.getDebugElementByTestId(fixture, skyTestId, 'sky-tabset');
12
+ }
13
+ /**
14
+ * The tabset component's ARIA label.
15
+ */
16
+ get ariaLabel() {
17
+ const tabsetEl = this.getTabsetEl();
18
+ return tabsetEl.getAttribute('aria-label') || undefined;
19
+ }
20
+ /**
21
+ * The tabset component's ARIA labelled by attribute.
22
+ */
23
+ get ariaLabelledBy() {
24
+ const tabsetEl = this.getTabsetEl();
25
+ return tabsetEl.getAttribute('aria-labelledby') || undefined;
26
+ }
27
+ /**
28
+ * The index of the currently selected tab.
29
+ */
30
+ get activeTabIndex() {
31
+ const tabLinkEls = this.getTabLinkEls();
32
+ for (let i = 0, n = tabLinkEls.length; i < n; i++) {
33
+ if (tabLinkEls.item(i).classList.contains('sky-btn-tab-selected')) {
34
+ return i;
35
+ }
36
+ }
37
+ return -1;
38
+ }
39
+ /**
40
+ * Retrieves information about the tab at the specified index.
41
+ * @param tabIndex The index of the tab.
42
+ */
43
+ getTab(tabIndex) {
44
+ const tabLinkEl = this.getTabLinkEl(tabIndex);
45
+ const active = this.activeTabIndex === tabIndex;
46
+ const disabled = tabLinkEl.classList.contains('sky-btn-tab-disabled');
47
+ const tabHeading = this.getTextContent(tabLinkEl.querySelector('.sky-tab-heading').childNodes[0]);
48
+ const tabHeaderCount = this.getTextContent(tabLinkEl.querySelector('.sky-tab-header-count'));
49
+ let permalinkValue;
50
+ if (tabLinkEl.href) {
51
+ const permalink = tabLinkEl.href.split('?')[1];
52
+ if (permalink) {
53
+ const permalinkParts = permalink.split('=');
54
+ permalinkValue = decodeURIComponent(permalinkParts[1]);
55
+ }
56
+ }
57
+ return {
58
+ active,
59
+ disabled,
60
+ permalinkValue,
61
+ tabHeaderCount,
62
+ tabHeading
63
+ };
64
+ }
65
+ /**
66
+ * Clicks the tabset's "new" button.
67
+ */
68
+ clickNewButton() {
69
+ return __awaiter(this, void 0, void 0, function* () {
70
+ return this.clickButton('sky-tabset-btn-new');
71
+ });
72
+ }
73
+ /**
74
+ * Clicks the tabset's "open" button.
75
+ */
76
+ clickOpenButton() {
77
+ return __awaiter(this, void 0, void 0, function* () {
78
+ return this.clickButton('sky-tabset-btn-open');
79
+ });
80
+ }
81
+ /**
82
+ * Clicks the tab button at the specified index.
83
+ * @param tabIndex The index of the tab.
84
+ */
85
+ clickTab(tabIndex) {
86
+ return __awaiter(this, void 0, void 0, function* () {
87
+ const tabLinkEl = this.getTabLinkEl(tabIndex);
88
+ if (!tabLinkEl) {
89
+ throw new Error(`There is no tab at index ${tabIndex}.`);
90
+ }
91
+ tabLinkEl.click();
92
+ this.fixture.detectChanges();
93
+ return this.fixture.whenStable();
94
+ });
95
+ }
96
+ /**
97
+ * Click's the tab's close button at the specified index.
98
+ * @param tabIndex The index of the tab.
99
+ */
100
+ clickTabClose(tabIndex) {
101
+ return __awaiter(this, void 0, void 0, function* () {
102
+ const tabWrapperEl = this.getTabsetEl().querySelectorAll(`.sky-tabset-tabs .sky-btn-tab-wrapper`)[tabIndex];
103
+ if (!tabWrapperEl) {
104
+ throw new Error(`There is no tab at index ${tabIndex}.`);
105
+ }
106
+ const closeBtnEl = tabWrapperEl.querySelector('.sky-btn-tab-close');
107
+ if (!closeBtnEl) {
108
+ throw new Error('The specified tab does not have a close button.');
109
+ }
110
+ closeBtnEl.click();
111
+ this.fixture.detectChanges();
112
+ return this.fixture.whenStable();
113
+ });
114
+ }
115
+ clickButton(buttonCls) {
116
+ return __awaiter(this, void 0, void 0, function* () {
117
+ const tabsetEl = this.getTabsetEl();
118
+ const newButtonEl = tabsetEl.querySelector(`.sky-tabset-btns .${buttonCls}`);
119
+ newButtonEl.click();
120
+ this.fixture.detectChanges();
121
+ return this.fixture.whenStable();
122
+ });
123
+ }
124
+ getTabsetEl() {
125
+ const tabsetEl = this.debugEl.query(By.css('.sky-tabset')).nativeElement;
126
+ return tabsetEl;
127
+ }
128
+ getTabLinkEls() {
129
+ return this.getTabsetEl().querySelectorAll(`.sky-tabset-tabs .sky-btn-tab`);
130
+ }
131
+ getTabLinkEl(tabIndex) {
132
+ const tabLinkEl = this.getTabLinkEls().item(tabIndex);
133
+ if (!tabLinkEl) {
134
+ throw new Error(`There is no tab at index ${tabIndex}.`);
135
+ }
136
+ return tabLinkEl;
137
+ }
138
+ getTextContent(el) {
139
+ return (el && el.textContent.trim()) || undefined;
140
+ }
141
+ }
142
+
143
+ /**
144
+ * Generated bundle index. Do not edit.
145
+ */
146
+
147
+ export { SkyTabsetFixture };
148
+ //# sourceMappingURL=skyux-tabs-testing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skyux-tabs-testing.js","sources":["ng://@skyux/tabs/testing/tabs/tabset-fixture.ts","ng://@skyux/tabs/testing/skyux-tabs-testing.ts"],"sourcesContent":["import {\n ComponentFixture\n} from '@angular/core/testing';\n\nimport {\n DebugElement\n} from '@angular/core';\n\nimport {\n By\n} from '@angular/platform-browser';\n\nimport {\n SkyAppTestUtility\n} from '@skyux-sdk/testing';\n\nimport {\n SkyTabsetFixtureTab\n} from './tab-fixture-tab';\n\n/**\n * Allows interaction with a SKY UX tabset component.\n */\nexport class SkyTabsetFixture {\n\n /**\n * The tabset component's ARIA label.\n */\n public get ariaLabel(): string {\n const tabsetEl = this.getTabsetEl();\n return tabsetEl.getAttribute('aria-label') || undefined;\n }\n\n /**\n * The tabset component's ARIA labelled by attribute.\n */\n public get ariaLabelledBy(): string {\n const tabsetEl = this.getTabsetEl();\n return tabsetEl.getAttribute('aria-labelledby') || undefined;\n }\n\n /**\n * The index of the currently selected tab.\n */\n public get activeTabIndex(): number {\n const tabLinkEls = this.getTabLinkEls();\n\n for (let i = 0, n = tabLinkEls.length; i < n; i++) {\n if (tabLinkEls.item(i).classList.contains('sky-btn-tab-selected')) {\n return i;\n }\n }\n\n return -1;\n }\n\n private debugEl: DebugElement;\n\n constructor(\n private fixture: ComponentFixture<any>,\n skyTestId: string\n ) {\n this.debugEl = SkyAppTestUtility.getDebugElementByTestId(fixture, skyTestId, 'sky-tabset');\n }\n\n /**\n * Retrieves information about the tab at the specified index.\n * @param tabIndex The index of the tab.\n */\n public getTab(tabIndex: number): SkyTabsetFixtureTab {\n const tabLinkEl = this.getTabLinkEl(tabIndex);\n\n const active = this.activeTabIndex === tabIndex;\n const disabled = tabLinkEl.classList.contains('sky-btn-tab-disabled');\n const tabHeading = this.getTextContent(\n tabLinkEl.querySelector('.sky-tab-heading').childNodes[0]\n );\n const tabHeaderCount = this.getTextContent(tabLinkEl.querySelector('.sky-tab-header-count'));\n\n let permalinkValue: string;\n\n if (tabLinkEl.href) {\n const permalink = tabLinkEl.href.split('?')[1];\n if (permalink) {\n const permalinkParts = permalink.split('=');\n\n permalinkValue = decodeURIComponent(permalinkParts[1]);\n }\n }\n\n return {\n active,\n disabled,\n permalinkValue,\n tabHeaderCount,\n tabHeading\n };\n }\n\n /**\n * Clicks the tabset's \"new\" button.\n */\n public async clickNewButton(): Promise<any> {\n return this.clickButton('sky-tabset-btn-new');\n }\n\n /**\n * Clicks the tabset's \"open\" button.\n */\n public async clickOpenButton(): Promise<any> {\n return this.clickButton('sky-tabset-btn-open');\n }\n\n /**\n * Clicks the tab button at the specified index.\n * @param tabIndex The index of the tab.\n */\n public async clickTab(tabIndex: number): Promise<any> {\n const tabLinkEl = this.getTabLinkEl(tabIndex);\n\n if (!tabLinkEl) {\n throw new Error(`There is no tab at index ${tabIndex}.`);\n }\n\n tabLinkEl.click();\n\n this.fixture.detectChanges();\n return this.fixture.whenStable();\n }\n\n /**\n * Click's the tab's close button at the specified index.\n * @param tabIndex The index of the tab.\n */\n public async clickTabClose(tabIndex: number): Promise<any> {\n const tabWrapperEl = this.getTabsetEl().querySelectorAll(\n `.sky-tabset-tabs .sky-btn-tab-wrapper`\n )[tabIndex];\n\n if (!tabWrapperEl) {\n throw new Error(`There is no tab at index ${tabIndex}.`);\n }\n\n const closeBtnEl = tabWrapperEl.querySelector('.sky-btn-tab-close') as HTMLButtonElement;\n\n if (!closeBtnEl) {\n throw new Error('The specified tab does not have a close button.');\n }\n\n closeBtnEl.click();\n\n this.fixture.detectChanges();\n return this.fixture.whenStable();\n }\n\n private async clickButton(buttonCls: string): Promise<any> {\n const tabsetEl = this.getTabsetEl();\n\n const newButtonEl =\n tabsetEl.querySelector(`.sky-tabset-btns .${buttonCls}`) as HTMLButtonElement;\n\n newButtonEl.click();\n\n this.fixture.detectChanges();\n return this.fixture.whenStable();\n }\n\n private getTabsetEl(): HTMLDivElement {\n const tabsetEl = this.debugEl.query(By.css('.sky-tabset')).nativeElement;\n\n return tabsetEl;\n }\n\n private getTabLinkEls(): NodeListOf<HTMLAnchorElement> {\n return this.getTabsetEl().querySelectorAll(\n `.sky-tabset-tabs .sky-btn-tab`\n );\n }\n\n private getTabLinkEl(tabIndex: number): HTMLAnchorElement {\n const tabLinkEl = this.getTabLinkEls().item(tabIndex);\n\n if (!tabLinkEl) {\n throw new Error(`There is no tab at index ${tabIndex}.`);\n }\n\n return tabLinkEl;\n }\n\n private getTextContent(el: Element | Node): string {\n return (el && el.textContent.trim()) || undefined;\n }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;AAoBA;;;MAGa,gBAAgB;IAmC3B,YACU,OAA8B,EACtC,SAAiB;QADT,YAAO,GAAP,OAAO,CAAuB;QAGtC,IAAI,CAAC,OAAO,GAAG,iBAAiB,CAAC,uBAAuB,CAAC,OAAO,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;KAC5F;;;;IAnCD,IAAW,SAAS;QAClB,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACpC,OAAO,QAAQ,CAAC,YAAY,CAAC,YAAY,CAAC,IAAI,SAAS,CAAC;KACzD;;;;IAKD,IAAW,cAAc;QACvB,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACpC,OAAO,QAAQ,CAAC,YAAY,CAAC,iBAAiB,CAAC,IAAI,SAAS,CAAC;KAC9D;;;;IAKD,IAAW,cAAc;QACvB,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;QAExC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;YACjD,IAAI,UAAU,CAAC,IAAI,CAAC,CAA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O,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC;QAEzE,OAAO,QAAQ,CAAC;KACjB;IAEO,aAAa;QACnB,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,gBAAgB,CACxC,+BAA+B,CAChC,CAAC;KACH;IAEO,YAAY,CAAC,QAAgB;QACnC,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAEtD,IAAI,CAAC,SAAS,EAAE;YACd,MAAM,IAAI,KAAK,CAAC,4BAA4B,QAAQ,GAAG,CAAC,CAAC;SAC1D;QAED,OAAO,SAAS,CAAC;KAClB;IAEO,cAAc,CAAC,EAAkB;QACvC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,SAAS,CAAC;KACnD;;;AC/LH;;;;;;"}
@@ -0,0 +1,1998 @@
1
+ import { __decorate } from 'tslib';
2
+ import { Injectable, EventEmitter, ChangeDetectorRef, Input, Output, ViewChild, Component, ChangeDetectionStrategy, RendererFactory2, HostListener, NgModule, ContentChildren, ViewEncapsulation, ElementRef } from '@angular/core';
3
+ import { CommonModule, Location } from '@angular/common';
4
+ import { trigger, transition, style, animate } from '@angular/animations';
5
+ import { BehaviorSubject, Subject, forkJoin, combineLatest, race } from 'rxjs';
6
+ import { takeUntil, take, distinctUntilChanged } from 'rxjs/operators';
7
+ import { SkyMediaBreakpoints, SkyMediaQueryService, SkyMediaQueryModule } from '@skyux/core';
8
+ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
9
+ import { SkyChevronModule, SkyIconModule, SkyStatusIndicatorModule } from '@skyux/indicators';
10
+ import { SkyThemeModule } from '@skyux/theme';
11
+ import { getStringForLocale, SKY_LIB_RESOURCES_PROVIDERS, SkyLibResourcesService, SkyI18nModule } from '@skyux/i18n';
12
+ import { SkyCheckboxModule } from '@skyux/forms';
13
+ import { ActivatedRoute, Router, RouterModule } from '@angular/router';
14
+ import { SkyDropdownModule } from '@skyux/popovers';
15
+
16
+ const VISIBLE_STATE = 'shown';
17
+ const HIDDEN_STATE = 'void';
18
+ /**
19
+ * @internal
20
+ */
21
+ let SkyVerticalTabsetService = class SkyVerticalTabsetService {
22
+ constructor(mediaQueryService) {
23
+ this.mediaQueryService = mediaQueryService;
24
+ this.activeIndex = undefined;
25
+ this.hidingTabs = new BehaviorSubject(false);
26
+ this.indexChanged = new BehaviorSubject(undefined);
27
+ this.maintainTabContent = false;
28
+ this.showingTabs = new BehaviorSubject(false);
29
+ this.switchingMobile = new Subject();
30
+ this.tabs = [];
31
+ this.tabAdded = new Subject();
32
+ this.tabClicked = new BehaviorSubject(undefined);
33
+ this._contentAdded = false;
34
+ this._tabsVisible = false;
35
+ this._isMobile = false;
36
+ this.mediaQueryService.subscribe(breakpoint => {
37
+ const nowMobile = breakpoint === SkyMediaBreakpoints.xs;
38
+ if (nowMobile && !this._isMobile) {
39
+ // switching to mobile
40
+ this.switchingMobile.next(true);
41
+ if (!this._tabsVisible) {
42
+ this.hidingTabs.next(true);
43
+ }
44
+ }
45
+ else if (!nowMobile && this._isMobile) {
46
+ // switching to widescreen
47
+ this.switchingMobile.next(false);
48
+ if (!this._tabsVisible) {
49
+ this.showingTabs.next(true);
50
+ }
51
+ }
52
+ this._isMobile = nowMobile;
53
+ });
54
+ }
55
+ set content(value) {
56
+ this._content = value;
57
+ }
58
+ addTab(tab) {
59
+ const index = this.tabs.length;
60
+ tab.index = index;
61
+ this.tabs.push(tab);
62
+ if (tab.active) {
63
+ this.activateTab(tab);
64
+ }
65
+ this.tabAdded.next(tab);
66
+ }
67
+ destroyTab(tab) {
68
+ let tabIndex = this.tabs.indexOf(tab);
69
+ if (tabIndex === -1) {
70
+ return;
71
+ }
72
+ if (this.maintainTabContent && tab.contentRendered && this._content) {
73
+ if (this._content.nativeElement.contains(tab.tabContent.nativeElement)) {
74
+ this._content.nativeElement.removeChild(tab.tabContent.nativeElement);
75
+ }
76
+ }
77
+ this.tabs.splice(tabIndex, 1);
78
+ // update tab indices
79
+ this.tabs.forEach((tabItem, index) => tabItem.index = index);
80
+ if (tab.active) {
81
+ if (!this.maintainTabContent) {
82
+ this.destroyContent();
83
+ }
84
+ // Try selecting the next tab first, and if there's no next tab then
85
+ // try selecting the previous one.
86
+ let newActiveTab = this.tabs[tabIndex] || this.tabs[tabIndex - 1];
87
+ /*istanbul ignore else */
88
+ if (newActiveTab) {
89
+ newActiveTab.activateTab();
90
+ }
91
+ }
92
+ }
93
+ activateTab(tab) {
94
+ // unactivate active tab
95
+ let activeTab = this.tabs.find(t => t.index === this.activeIndex);
96
+ if (activeTab && activeTab.index !== tab.index) {
97
+ activeTab.active = false;
98
+ activeTab.tabDeactivated();
99
+ }
100
+ this.activeIndex = tab.index;
101
+ this.tabClicked.next(true);
102
+ this.updateTabClicked();
103
+ }
104
+ activeTab() {
105
+ return this.tabs.find(t => t.index === this.activeIndex);
106
+ }
107
+ isMobile() {
108
+ return this._isMobile;
109
+ }
110
+ updateContent() {
111
+ if (!this.maintainTabContent) {
112
+ if (!this._contentAdded && this.contentVisible()) {
113
+ // content needs to be moved
114
+ this.moveContent();
115
+ }
116
+ else if (this._contentAdded && !this.contentVisible()) {
117
+ // content hidden
118
+ this._contentAdded = false;
119
+ }
120
+ }
121
+ else {
122
+ this.tabs.forEach((tab) => {
123
+ if (!tab.contentRendered) {
124
+ this._content.nativeElement.appendChild(tab.tabContent.nativeElement);
125
+ tab.contentRendered = true;
126
+ }
127
+ });
128
+ }
129
+ }
130
+ tabsVisible() {
131
+ return !this.isMobile() || this._tabsVisible;
132
+ }
133
+ contentVisible() {
134
+ return !this.isMobile() || !this._tabsVisible;
135
+ }
136
+ showTabs() {
137
+ this._tabsVisible = true;
138
+ this._contentAdded = false;
139
+ this.animationTabsVisibleState = VISIBLE_STATE;
140
+ this.animationContentVisibleState = HIDDEN_STATE;
141
+ this.showingTabs.next(true);
142
+ }
143
+ destroyContent() {
144
+ if (this._content) {
145
+ this._content.nativeElement.innerHTML = '';
146
+ }
147
+ this.content = undefined;
148
+ }
149
+ moveContent() {
150
+ if (this._content && !this._contentAdded) {
151
+ let activeTab = this.activeTab();
152
+ let activeContent = activeTab ? activeTab.tabContent : undefined;
153
+ if (activeContent && activeContent.nativeElement) {
154
+ this._content.nativeElement.appendChild(activeContent.nativeElement);
155
+ activeTab.contentRendered = true;
156
+ this._contentAdded = true;
157
+ }
158
+ }
159
+ }
160
+ updateTabClicked() {
161
+ this._contentAdded = false;
162
+ if (this.isMobile()) {
163
+ this._tabsVisible = false;
164
+ this.animationContentVisibleState = VISIBLE_STATE;
165
+ this.animationTabsVisibleState = HIDDEN_STATE;
166
+ this.hidingTabs.next(true);
167
+ }
168
+ this.indexChanged.next(this.activeIndex);
169
+ }
170
+ };
171
+ SkyVerticalTabsetService.ctorParameters = () => [
172
+ { type: SkyMediaQueryService }
173
+ ];
174
+ SkyVerticalTabsetService = __decorate([
175
+ Injectable()
176
+ ], SkyVerticalTabsetService);
177
+
178
+ /**
179
+ * Creates a container for the sectioned forms.
180
+ */
181
+ let SkySectionedFormComponent = class SkySectionedFormComponent {
182
+ constructor(tabService, changeRef) {
183
+ this.tabService = tabService;
184
+ this.changeRef = changeRef;
185
+ /**
186
+ * Indicates whether the sectioned form loads section content during initialization so that it
187
+ * displays content without moving around elements in the content container.
188
+ * @default false
189
+ */
190
+ this.maintainSectionContent = false;
191
+ /**
192
+ * Fires when the active tab changes and emits the index of the active
193
+ * section. The index is based on the section's position when the form loads.
194
+ */
195
+ this.indexChanged = new EventEmitter();
196
+ this.isMobile = false;
197
+ this._ngUnsubscribe = new Subject();
198
+ }
199
+ get ariaRole() {
200
+ return this.isMobile ? undefined : 'tablist';
201
+ }
202
+ ngOnInit() {
203
+ this.tabService.maintainTabContent = this.maintainSectionContent;
204
+ this.tabService.indexChanged
205
+ .pipe(takeUntil(this._ngUnsubscribe))
206
+ .subscribe(index => {
207
+ this.indexChanged.emit(index);
208
+ this.changeRef.markForCheck();
209
+ });
210
+ this.tabService.switchingMobile
211
+ .pipe(takeUntil(this._ngUnsubscribe))
212
+ .subscribe((mobile) => {
213
+ this.isMobile = mobile;
214
+ this.changeRef.markForCheck();
215
+ });
216
+ if (this.tabService.isMobile()) {
217
+ this.isMobile = true;
218
+ this.tabService.animationContentVisibleState = VISIBLE_STATE;
219
+ this.changeRef.markForCheck();
220
+ }
221
+ }
222
+ ngAfterViewChecked() {
223
+ this.tabService.content = this.content;
224
+ this.tabService.updateContent();
225
+ }
226
+ ngOnDestroy() {
227
+ this._ngUnsubscribe.next();
228
+ this._ngUnsubscribe.complete();
229
+ }
230
+ tabsVisible() {
231
+ this.changeRef.markForCheck();
232
+ return this.tabService.tabsVisible();
233
+ }
234
+ showTabs() {
235
+ this.tabService.showTabs();
236
+ this.changeRef.markForCheck();
237
+ }
238
+ };
239
+ SkySectionedFormComponent.ctorParameters = () => [
240
+ { type: SkyVerticalTabsetService },
241
+ { type: ChangeDetectorRef }
242
+ ];
243
+ __decorate([
244
+ Input()
245
+ ], SkySectionedFormComponent.prototype, "maintainSectionContent", void 0);
246
+ __decorate([
247
+ Output()
248
+ ], SkySectionedFormComponent.prototype, "indexChanged", void 0);
249
+ __decorate([
250
+ ViewChild('skySectionSideContent')
251
+ ], SkySectionedFormComponent.prototype, "content", void 0);
252
+ SkySectionedFormComponent = __decorate([
253
+ Component({
254
+ selector: 'sky-sectioned-form',
255
+ template: "<div\n aria-orientation=\"vertical\"\n class=\"sky-sectioned-form\"\n [attr.role]=\"ariaRole\"\n (window:resize)=\"tabService.updateContent()\"\n>\n <div\n *ngIf=\"maintainSectionContent || tabsVisible()\"\n class=\"sky-sectioned-form-tabs\"\n [ngClass]=\"{'sky-sectioned-form-tabs-hidden': !tabsVisible()}\"\n [@tabEnter]=\"tabService.animationTabsVisibleState\"\n >\n <ng-content></ng-content>\n </div>\n <div\n *ngIf=\"maintainSectionContent || tabService.contentVisible()\"\n class=\"sky-sectioned-form-content sky-padding-even-large\"\n [ngClass]=\"{'sky-sectioned-form-content-hidden': !tabService.contentVisible()}\"\n [@contentEnter]=\"tabService.animationContentVisibleState\"\n #skySectionSideContent\n >\n </div>\n</div>\n\n",
256
+ providers: [SkyVerticalTabsetService],
257
+ changeDetection: ChangeDetectionStrategy.OnPush,
258
+ animations: [
259
+ trigger('tabEnter', [
260
+ transition(`${HIDDEN_STATE} => ${VISIBLE_STATE}`, [
261
+ style({ transform: 'translate(-100%)' }),
262
+ animate('150ms ease-in')
263
+ ])
264
+ ]),
265
+ trigger('contentEnter', [
266
+ transition(`${HIDDEN_STATE} => ${VISIBLE_STATE}`, [
267
+ style({ transform: 'translate(100%)' }),
268
+ animate('150ms ease-in')
269
+ ])
270
+ ])
271
+ ],
272
+ styles: [":host .sky-sectioned-form{display:block;max-height:none}:host .sky-sectioned-form-content{flex-basis:auto;overflow-y:visible}:host .sky-sectioned-form-tabs{flex-basis:auto;overflow-y:visible;border-right:1px solid #e2e3e4}:host-context(.sky-responsive-container-lg) .sky-sectioned-form,:host-context(.sky-responsive-container-md) .sky-sectioned-form,:host-context(.sky-responsive-container-sm) .sky-sectioned-form,:host-context(.sky-responsive-container-xs) .sky-sectioned-form{display:block;max-height:none}:host-context(.sky-responsive-container-lg) .sky-sectioned-form-content,:host-context(.sky-responsive-container-md) .sky-sectioned-form-content,:host-context(.sky-responsive-container-sm) .sky-sectioned-form-content,:host-context(.sky-responsive-container-xs) .sky-sectioned-form-content{flex-basis:auto;overflow-y:visible}:host-context(.sky-responsive-container-lg) .sky-sectioned-form-tabs,:host-context(.sky-responsive-container-md) .sky-sectioned-form-tabs,:host-context(.sky-responsive-container-sm) .sky-sectioned-form-tabs,:host-context(.sky-responsive-container-xs) .sky-sectioned-form-tabs{flex-basis:auto;overflow-y:visible;border-right:1px solid #e2e3e4}@media (min-width:768px){:host .sky-sectioned-form{display:flex;max-height:100%}:host .sky-sectioned-form-content{flex-basis:70%;overflow-y:auto}:host .sky-sectioned-form-tabs{flex-basis:30%;overflow-y:auto}}:host-context(.sky-responsive-container-lg) .sky-sectioned-form,:host-context(.sky-responsive-container-md) .sky-sectioned-form,:host-context(.sky-responsive-container-sm) .sky-sectioned-form{display:flex;max-height:100%}:host-context(.sky-responsive-container-lg) .sky-sectioned-form-content,:host-context(.sky-responsive-container-md) .sky-sectioned-form-content,:host-context(.sky-responsive-container-sm) .sky-sectioned-form-content{flex-basis:70%;overflow-y:auto}:host-context(.sky-responsive-container-lg) .sky-sectioned-form-tabs,:host-context(.sky-responsive-container-md) .sky-sectioned-form-tabs,:host-context(.sky-responsive-container-sm) .sky-sectioned-form-tabs{flex-basis:30%;overflow-y:auto}.sky-sectioned-form-content-hidden,.sky-sectioned-form-tabs-hidden{display:none}"]
273
+ })
274
+ ], SkySectionedFormComponent);
275
+
276
+ /**
277
+ * @internal
278
+ */
279
+ let SkyVerticalTabMediaQueryService = class SkyVerticalTabMediaQueryService {
280
+ constructor() {
281
+ this.currentSubject = new BehaviorSubject(this.current);
282
+ this._current = SkyMediaBreakpoints.xs;
283
+ this.currentSubject.next(this._current);
284
+ }
285
+ get current() {
286
+ return this._current;
287
+ }
288
+ subscribe(listener) {
289
+ return this.currentSubject.subscribe({
290
+ next: (breakpoints) => {
291
+ listener(breakpoints);
292
+ }
293
+ });
294
+ }
295
+ setBreakpointForWidth(width) {
296
+ let breakpoint;
297
+ if (this.isWidthWithinBreakpiont(width, SkyMediaBreakpoints.xs)) {
298
+ breakpoint = SkyMediaBreakpoints.xs;
299
+ }
300
+ else if (this.isWidthWithinBreakpiont(width, SkyMediaBreakpoints.sm)) {
301
+ breakpoint = SkyMediaBreakpoints.sm;
302
+ }
303
+ else if (this.isWidthWithinBreakpiont(width, SkyMediaBreakpoints.md)) {
304
+ breakpoint = SkyMediaBreakpoints.md;
305
+ }
306
+ else {
307
+ breakpoint = SkyMediaBreakpoints.lg;
308
+ }
309
+ this._current = breakpoint;
310
+ this.currentSubject.next(this._current);
311
+ }
312
+ isWidthWithinBreakpiont(width, breakpoint) {
313
+ const xsBreakpointMaxPixels = 767;
314
+ const smBreakpointMinPixels = 768;
315
+ const smBreakpointMaxPixels = 991;
316
+ const mdBreakpointMinPixels = 992;
317
+ const mdBreakpointMaxPixels = 1199;
318
+ const lgBreakpointMinPixels = 1200;
319
+ switch (breakpoint) {
320
+ case SkyMediaBreakpoints.xs: {
321
+ return (width <= xsBreakpointMaxPixels);
322
+ }
323
+ case SkyMediaBreakpoints.sm: {
324
+ return (width >= smBreakpointMinPixels && width <= smBreakpointMaxPixels);
325
+ }
326
+ case SkyMediaBreakpoints.md: {
327
+ return (width >= mdBreakpointMinPixels && width <= mdBreakpointMaxPixels);
328
+ }
329
+ default: {
330
+ return (width >= lgBreakpointMinPixels);
331
+ }
332
+ }
333
+ }
334
+ destroy() {
335
+ this.currentSubject.complete();
336
+ }
337
+ };
338
+ SkyVerticalTabMediaQueryService = __decorate([
339
+ Injectable()
340
+ ], SkyVerticalTabMediaQueryService);
341
+
342
+ let SkyVerticalTabsetAdapterService = class SkyVerticalTabsetAdapterService {
343
+ constructor(rendererFactory) {
344
+ this.rendererFactory = rendererFactory;
345
+ this.renderer = this.rendererFactory.createRenderer(undefined, undefined);
346
+ }
347
+ getWidth(elementRef) {
348
+ return elementRef.nativeElement.clientWidth;
349
+ }
350
+ scrollToContentTop(element) {
351
+ element.nativeElement.scrollTop = 0;
352
+ }
353
+ setResponsiveClass(element, breakpoint) {
354
+ const nativeEl = element.nativeElement;
355
+ this.renderer.removeClass(nativeEl, 'sky-responsive-container-xs');
356
+ this.renderer.removeClass(nativeEl, 'sky-responsive-container-sm');
357
+ this.renderer.removeClass(nativeEl, 'sky-responsive-container-md');
358
+ this.renderer.removeClass(nativeEl, 'sky-responsive-container-lg');
359
+ let newClass;
360
+ switch (breakpoint) {
361
+ case SkyMediaBreakpoints.xs: {
362
+ newClass = 'sky-responsive-container-xs';
363
+ break;
364
+ }
365
+ case SkyMediaBreakpoints.sm: {
366
+ newClass = 'sky-responsive-container-sm';
367
+ break;
368
+ }
369
+ case SkyMediaBreakpoints.md: {
370
+ newClass = 'sky-responsive-container-md';
371
+ break;
372
+ }
373
+ default: {
374
+ newClass = 'sky-responsive-container-lg';
375
+ break;
376
+ }
377
+ }
378
+ this.renderer.addClass(nativeEl, newClass);
379
+ }
380
+ };
381
+ SkyVerticalTabsetAdapterService.ctorParameters = () => [
382
+ { type: RendererFactory2 }
383
+ ];
384
+ SkyVerticalTabsetAdapterService = __decorate([
385
+ Injectable()
386
+ ], SkyVerticalTabsetAdapterService);
387
+
388
+ let SkyVerticalTabComponent = class SkyVerticalTabComponent {
389
+ constructor(adapterService, changeRef, tabsetService, verticalTabMediaQueryService) {
390
+ this.adapterService = adapterService;
391
+ this.changeRef = changeRef;
392
+ this.tabsetService = tabsetService;
393
+ this.verticalTabMediaQueryService = verticalTabMediaQueryService;
394
+ /**
395
+ * Indicates whether the tab is active when the tabset loads.
396
+ */
397
+ this.active = false;
398
+ /**
399
+ * Indicates whether to disable the tab.
400
+ */
401
+ this.disabled = false;
402
+ /**
403
+ * Indicates whether to indicate that the tab has an error.
404
+ * @internal This is used for sectioned forms and is not currently a supported design for pure vertical tabs.
405
+ */
406
+ this.errorIndicator = false;
407
+ this.isMobile = false;
408
+ this._contentRendered = false;
409
+ this._mobileSubscription = new Subject();
410
+ this._ngUnsubscribe = new Subject();
411
+ this._showTabRightArrow = false;
412
+ }
413
+ /**
414
+ * Specifies the HTML element ID (without the leading `#`) of the element that contains
415
+ * the content that the vertical tab displays, which corresponds to the `tabId`. This property
416
+ * [supports accessibility rules for disclosures](https://www.w3.org/TR/wai-aria-practices-1.1/#disclosure).
417
+ */
418
+ get ariaControls() {
419
+ return this.isMobile ? undefined : this._ariaControls;
420
+ }
421
+ set ariaControls(value) {
422
+ this._ariaControls = value;
423
+ }
424
+ /**
425
+ * Specifies an ARIA role for the vertical tab
426
+ * [to support accessibility](https://developer.blackbaud.com/skyux/learn/accessibility)
427
+ * by indicating how the tab functions and what it controls. For information about how
428
+ * an ARIA role indicates what an item represents on a web page, see the
429
+ * [WAI-ARIA roles model](https://www.w3.org/WAI/PF/aria/roles).
430
+ * @default "tab"
431
+ */
432
+ get ariaRole() {
433
+ if (this.isMobile) {
434
+ return undefined;
435
+ }
436
+ return this._ariaRole || 'tab';
437
+ }
438
+ set ariaRole(value) {
439
+ this._ariaRole = value;
440
+ }
441
+ /**
442
+ * Indicates whether to display a chevron-right icon in the righthand side of the tab.
443
+ * @internal
444
+ */
445
+ get showTabRightArrow() {
446
+ return this._showTabRightArrow && this.tabsetService.isMobile();
447
+ }
448
+ set showTabRightArrow(value) {
449
+ this._showTabRightArrow = value;
450
+ }
451
+ set contentRendered(value) {
452
+ this._contentRendered = value;
453
+ if (this._contentRendered) {
454
+ // NOTE: Wrapped in a setTimeout here to ensure that everything has completed rendering.
455
+ setTimeout(() => {
456
+ this.updateBreakpointAndResponsiveClass(this.adapterService.getWidth(this.tabContent));
457
+ });
458
+ }
459
+ }
460
+ get contentRendered() {
461
+ return this._contentRendered;
462
+ }
463
+ ngOnInit() {
464
+ this.isMobile = this.tabsetService.isMobile();
465
+ this.changeRef.markForCheck();
466
+ this.tabsetService.switchingMobile
467
+ .subscribe((mobile) => {
468
+ this.isMobile = mobile;
469
+ this.changeRef.markForCheck();
470
+ });
471
+ // Update the breakpoint and responsive class here just as a sanity check since we can not
472
+ // watch for element resizing.
473
+ this.tabsetService.indexChanged
474
+ .pipe(takeUntil(this._ngUnsubscribe))
475
+ .subscribe((index) => {
476
+ if (this.index === index && this.contentRendered) {
477
+ this.updateBreakpointAndResponsiveClass(this.adapterService.getWidth(this.tabContent));
478
+ }
479
+ });
480
+ this.tabsetService.addTab(this);
481
+ }
482
+ ngOnDestroy() {
483
+ this._mobileSubscription.unsubscribe();
484
+ this._ngUnsubscribe.next();
485
+ this._ngUnsubscribe.complete();
486
+ this.tabsetService.destroyTab(this);
487
+ }
488
+ tabIndex() {
489
+ if (!this.disabled) {
490
+ return 0;
491
+ }
492
+ else {
493
+ return -1;
494
+ }
495
+ }
496
+ activateTab() {
497
+ if (!this.disabled) {
498
+ this.active = true;
499
+ this.tabsetService.activateTab(this);
500
+ this.changeRef.markForCheck();
501
+ }
502
+ }
503
+ onWindowResize() {
504
+ this.updateBreakpointAndResponsiveClass(this.adapterService.getWidth(this.tabContent));
505
+ }
506
+ tabDeactivated() {
507
+ this.changeRef.markForCheck();
508
+ }
509
+ updateBreakpointAndResponsiveClass(width) {
510
+ this.verticalTabMediaQueryService.setBreakpointForWidth(width);
511
+ const newBreakpiont = this.verticalTabMediaQueryService.current;
512
+ this.adapterService.setResponsiveClass(this.tabContent, newBreakpiont);
513
+ this.changeRef.markForCheck();
514
+ }
515
+ };
516
+ SkyVerticalTabComponent.ctorParameters = () => [
517
+ { type: SkyVerticalTabsetAdapterService },
518
+ { type: ChangeDetectorRef },
519
+ { type: SkyVerticalTabsetService },
520
+ { type: SkyVerticalTabMediaQueryService }
521
+ ];
522
+ __decorate([
523
+ Input()
524
+ ], SkyVerticalTabComponent.prototype, "active", void 0);
525
+ __decorate([
526
+ Input()
527
+ ], SkyVerticalTabComponent.prototype, "ariaControls", null);
528
+ __decorate([
529
+ Input()
530
+ ], SkyVerticalTabComponent.prototype, "ariaInvalid", void 0);
531
+ __decorate([
532
+ Input()
533
+ ], SkyVerticalTabComponent.prototype, "ariaRequired", void 0);
534
+ __decorate([
535
+ Input()
536
+ ], SkyVerticalTabComponent.prototype, "ariaRole", null);
537
+ __decorate([
538
+ Input()
539
+ ], SkyVerticalTabComponent.prototype, "disabled", void 0);
540
+ __decorate([
541
+ Input()
542
+ ], SkyVerticalTabComponent.prototype, "errorIndicator", void 0);
543
+ __decorate([
544
+ Input()
545
+ ], SkyVerticalTabComponent.prototype, "tabHeaderCount", void 0);
546
+ __decorate([
547
+ Input()
548
+ ], SkyVerticalTabComponent.prototype, "tabHeading", void 0);
549
+ __decorate([
550
+ Input()
551
+ ], SkyVerticalTabComponent.prototype, "showTabRightArrow", null);
552
+ __decorate([
553
+ Input()
554
+ ], SkyVerticalTabComponent.prototype, "tabId", void 0);
555
+ __decorate([
556
+ ViewChild('tabContentWrapper')
557
+ ], SkyVerticalTabComponent.prototype, "tabContent", void 0);
558
+ __decorate([
559
+ HostListener('window:resize')
560
+ ], SkyVerticalTabComponent.prototype, "onWindowResize", null);
561
+ SkyVerticalTabComponent = __decorate([
562
+ Component({
563
+ selector: 'sky-vertical-tab',
564
+ template: "<a\n class=\"sky-vertical-tab\"\n [attr.aria-controls]=\"ariaControls\"\n [attr.aria-invalid]=\"ariaInvalid\"\n [attr.aria-required]=\"ariaRequired ? ariaRequired : null\"\n [attr.aria-selected]=\"active\"\n [attr.id]=\"tabId\"\n [attr.role]=\"ariaRole\"\n [ngClass]=\"{\n 'sky-vertical-tab-active': active,\n 'sky-vertical-tab-disabled': disabled,\n 'sky-deemphasized': disabled\n }\"\n [tabIndex]=\"tabIndex()\"\n (click)=\"activateTab()\"\n (keyup.enter)=\"activateTab()\">\n <div class=\"sky-vertical-tab-display\">\n <div class=\"sky-vertical-tab-heading\">\n <span class=\"sky-vertical-tab-heading-value\">{{ tabHeading }}</span>\n <span\n class=\"sky-vertical-tab-count\"\n *ngIf=\"tabHeaderCount || tabHeaderCount === 0\">\n ({{ tabHeaderCount }})\n </span>\n </div>\n <sky-status-indicator *ngIf=\"errorIndicator\"\n class=\"sky-vertical-tab-heading-error\"\n descriptionType=\"error\"\n indicatorType=\"danger\"\n ></sky-status-indicator>\n\n <sky-icon\n *ngIf=\"showTabRightArrow\"\n class=\"sky-vertical-tab-right-arrow\"\n icon=\"chevron-right\"\n >\n </sky-icon>\n </div>\n</a>\n\n<div\n #tabContentWrapper\n>\n <div\n class=\"sky-vertical-tab-content-pane\"\n [ngClass]=\"{'sky-vertical-tab-hidden': !active}\"\n >\n\n <ng-content></ng-content>\n\n <div>\n\n</div>\n\n",
565
+ providers: [
566
+ SkyVerticalTabMediaQueryService,
567
+ { provide: SkyMediaQueryService, useExisting: SkyVerticalTabMediaQueryService }
568
+ ],
569
+ changeDetection: ChangeDetectionStrategy.OnPush,
570
+ styles: [".sky-vertical-tab{cursor:pointer;padding:7px 0 7px 10px;margin:5px 0 5px 10px;display:flex;text-decoration:none}.sky-vertical-tab:not(.sky-deemphasized){color:#212327}.sky-vertical-tab:hover{background-color:#eeeeef}.sky-vertical-tab:focus{outline:dotted thin;outline:-webkit-focus-ring-color auto 5px}.sky-vertical-tab:hover .sky-vertical-tab-right-arrow{color:#979ba2}.sky-vertical-tab-active{background-color:#eeeeef;color:#212327;padding-left:6px;border-left:4px solid #00b4f1}.sky-vertical-tab-hidden{display:none}.sky-vertical-tab-display{display:flex;flex-grow:1}.sky-vertical-tab-heading-error{padding-left:5px}.sky-vertical-tab-count{margin-left:5px}.sky-vertical-tab-disabled{cursor:not-allowed;pointer-events:none;font-style:normal}.sky-vertical-tab-right-arrow{padding:3px 10px 0 0;color:#cdcfd2}.sky-theme-modern .sky-vertical-tab,:host-context(.sky-theme-modern) .sky-vertical-tab{cursor:pointer;padding:10px 0 10px 10px;margin:10px 0 20px 10px}.sky-theme-modern .sky-vertical-tab:not(.sky-vertical-tab-active):not(:active):hover,:host-context(.sky-theme-modern) .sky-vertical-tab:not(.sky-vertical-tab-active):not(:active):hover{color:#212327;background-color:transparent;padding-left:9px;border-left:1px solid #00b4f1}.sky-theme-modern .sky-vertical-tab:not(:active):focus,:host-context(.sky-theme-modern) .sky-vertical-tab:not(:active):focus{outline:#1870b8 solid 2px;outline-offset:-2px;box-shadow:0 1px 8px 0 rgba(0,0,0,.3)}.sky-theme-modern .sky-vertical-tab:focus:active:hover,:host-context(.sky-theme-modern) .sky-vertical-tab:focus:active:hover{outline:0;background:0 0}.sky-theme-modern .sky-vertical-tab:active,:host-context(.sky-theme-modern) .sky-vertical-tab:active{border-left:3px solid #00b4f1;padding-left:7px}.sky-theme-modern .sky-vertical-tab .sky-vertical-tab-heading-error,:host-context(.sky-theme-modern) .sky-vertical-tab .sky-vertical-tab-heading-error{padding-left:10px}.sky-theme-modern .sky-vertical-tab-active,:host-context(.sky-theme-modern) .sky-vertical-tab-active{background:0 0;padding-left:7px;border-left:3px solid #1870b8}"]
571
+ })
572
+ ], SkyVerticalTabComponent);
573
+
574
+ let SkySectionedFormService = class SkySectionedFormService {
575
+ constructor() {
576
+ /**
577
+ * @internal
578
+ */
579
+ this.invalidChange = new BehaviorSubject(undefined);
580
+ /**
581
+ * @internal
582
+ */
583
+ this.requiredChange = new BehaviorSubject(undefined);
584
+ }
585
+ /**
586
+ * Sets the current section's invalid state based on the `isInvalid` parameter.
587
+ * This method is used within a `sky-sectioned-form-section` element.
588
+ */
589
+ invalidFieldChanged(isInvalid) {
590
+ this.invalidChange.next(isInvalid);
591
+ }
592
+ /**
593
+ * Sets the current section's required state based on the `isRequired` parameter.
594
+ * This method is used within a `sky-sectioned-form-section` element.
595
+ */
596
+ requiredFieldChanged(isRequired) {
597
+ this.requiredChange.next(isRequired);
598
+ }
599
+ };
600
+ SkySectionedFormService = __decorate([
601
+ Injectable()
602
+ ], SkySectionedFormService);
603
+
604
+ let nextId = 0;
605
+ /**
606
+ * Creates an individual form to display as a section within the sectioned form.
607
+ */
608
+ let SkySectionedFormSectionComponent = class SkySectionedFormSectionComponent {
609
+ constructor(sectionedFormService, tabsetService, changeRef) {
610
+ this.sectionedFormService = sectionedFormService;
611
+ this.tabsetService = tabsetService;
612
+ this.changeRef = changeRef;
613
+ this.sectionTabId = `sky-sectioned-form-tab-${++nextId}`;
614
+ this.sectionContentId = `sky-sectioned-form-section-${++nextId}`;
615
+ this.isMobile = false;
616
+ this._ngUnsubscribe = new Subject();
617
+ }
618
+ get ariaRole() {
619
+ return this.isMobile ? undefined : 'tabpanel';
620
+ }
621
+ get ariaLabelledby() {
622
+ return this.isMobile ? undefined : this.sectionTabId;
623
+ }
624
+ ngOnInit() {
625
+ this.isMobile = this.tabsetService.isMobile();
626
+ this.changeRef.detectChanges();
627
+ this.tabsetService.switchingMobile
628
+ .subscribe((mobile) => {
629
+ this.isMobile = mobile;
630
+ this.changeRef.detectChanges();
631
+ });
632
+ this.sectionedFormService.requiredChange
633
+ .pipe(takeUntil(this._ngUnsubscribe))
634
+ .subscribe((required) => this.fieldRequired = required);
635
+ this.sectionedFormService.invalidChange
636
+ .pipe(takeUntil(this._ngUnsubscribe))
637
+ .subscribe((invalid) => this.fieldInvalid = invalid);
638
+ }
639
+ ngOnDestroy() {
640
+ this._ngUnsubscribe.next();
641
+ this._ngUnsubscribe.complete();
642
+ }
643
+ };
644
+ SkySectionedFormSectionComponent.ctorParameters = () => [
645
+ { type: SkySectionedFormService },
646
+ { type: SkyVerticalTabsetService },
647
+ { type: ChangeDetectorRef }
648
+ ];
649
+ __decorate([
650
+ Input()
651
+ ], SkySectionedFormSectionComponent.prototype, "heading", void 0);
652
+ __decorate([
653
+ Input()
654
+ ], SkySectionedFormSectionComponent.prototype, "itemCount", void 0);
655
+ __decorate([
656
+ Input()
657
+ ], SkySectionedFormSectionComponent.prototype, "active", void 0);
658
+ __decorate([
659
+ ViewChild(SkyVerticalTabComponent)
660
+ ], SkySectionedFormSectionComponent.prototype, "tab", void 0);
661
+ SkySectionedFormSectionComponent = __decorate([
662
+ Component({
663
+ selector: 'sky-sectioned-form-section',
664
+ template: "<sky-vertical-tab\n [active]=\"active\"\n [ariaControls]=\"sectionContentId\"\n [ariaInvalid]=\"fieldInvalid\"\n [ariaRequired]=\"fieldRequired\"\n [errorIndicator]=\"fieldInvalid\"\n [ngClass]=\"{\n 'sky-tab-field-required': fieldRequired\n }\"\n [showTabRightArrow]=\"true\"\n [tabHeaderCount]=\"itemCount\"\n [tabHeading]=\"heading\"\n [tabId]=\"sectionTabId\">\n <div\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.role]=\"ariaRole\"\n [id]=\"sectionContentId\"\n #tabContent>\n <ng-content></ng-content>\n </div>\n</sky-vertical-tab>\n",
665
+ providers: [SkySectionedFormService],
666
+ styles: [":host .sky-tab-field-required ::ng-deep .sky-vertical-tab-heading:after{content:\"*\";color:#ef4044;padding-left:5px}"]
667
+ })
668
+ ], SkySectionedFormSectionComponent);
669
+
670
+ let SkyTabsResourcesProvider = class SkyTabsResourcesProvider {
671
+ constructor() {
672
+ this.resources = { "EN-US": { "skyux_tab_add": "Add tab", "skyux_tab_close": "Close {0} tab", "skyux_tabs_navigator_next": "Next", "skyux_tabs_navigator_previous": "Previous", "skyux_tab_open": "Open tab", "skyux_vertical_tabs_show_tabs_text": "Tab list" } };
673
+ }
674
+ getString(localeInfo, name) {
675
+ return getStringForLocale(this.resources, localeInfo.locale, name);
676
+ }
677
+ };
678
+ SkyTabsResourcesProvider = __decorate([
679
+ Injectable()
680
+ ], SkyTabsResourcesProvider);
681
+
682
+ let SkyTabsResourcesModule = class SkyTabsResourcesModule {
683
+ };
684
+ SkyTabsResourcesModule = __decorate([
685
+ NgModule({
686
+ providers: [{
687
+ provide: SKY_LIB_RESOURCES_PROVIDERS,
688
+ useClass: SkyTabsResourcesProvider,
689
+ multi: true
690
+ }]
691
+ })
692
+ ], SkyTabsResourcesModule);
693
+
694
+ let SkyVerticalTabsetComponent = class SkyVerticalTabsetComponent {
695
+ constructor(adapterService, tabService, resources, changeRef) {
696
+ this.adapterService = adapterService;
697
+ this.tabService = tabService;
698
+ this.resources = resources;
699
+ this.changeRef = changeRef;
700
+ /**
701
+ * Indicates whether the vertical tabset loads tab content during initialization so that it
702
+ * displays content without moving around elements in the content container.
703
+ * @default 'false'
704
+ */
705
+ this.maintainTabContent = false;
706
+ /**
707
+ * Fires when the active tab changes. Emits the index of the active tab. The
708
+ * index is based on the tab's position when it loads.
709
+ */
710
+ this.activeChange = new EventEmitter();
711
+ this.isMobile = false;
712
+ this._ngUnsubscribe = new Subject();
713
+ }
714
+ /**
715
+ * Specifies an ARIA role for the vertical tabset
716
+ * [to support accessibility](https://developer.blackbaud.com/skyux/learn/accessibility)
717
+ * by indicating how the tabset functions and what it controls. For information about how
718
+ * an ARIA role indicates what an item represents on a web page, see the
719
+ * [WAI-ARIA roles model](https://www.w3.org/WAI/PF/aria/roles).
720
+ * @default "tablist"
721
+ */
722
+ get ariaRole() {
723
+ if (this.isMobile) {
724
+ return undefined;
725
+ }
726
+ return this._ariaRole || 'tablist';
727
+ }
728
+ set ariaRole(value) {
729
+ this._ariaRole = value;
730
+ }
731
+ ngOnInit() {
732
+ this.tabService.maintainTabContent = this.maintainTabContent;
733
+ this.tabService.indexChanged
734
+ .pipe(takeUntil(this._ngUnsubscribe))
735
+ .subscribe((index) => {
736
+ this.activeChange.emit(index);
737
+ if (this.contentWrapper) {
738
+ this.adapterService.scrollToContentTop(this.contentWrapper);
739
+ }
740
+ this.changeRef.markForCheck();
741
+ });
742
+ this.tabService.switchingMobile
743
+ .pipe(takeUntil(this._ngUnsubscribe))
744
+ .subscribe((mobile) => {
745
+ this.isMobile = mobile;
746
+ this.changeRef.markForCheck();
747
+ });
748
+ if (this.tabService.isMobile()) {
749
+ this.isMobile = true;
750
+ this.tabService.animationContentVisibleState = VISIBLE_STATE;
751
+ this.changeRef.markForCheck();
752
+ }
753
+ if (!this.showTabsText) {
754
+ this.resources.getString('skyux_vertical_tabs_show_tabs_text')
755
+ .pipe(take(1))
756
+ .subscribe(resource => {
757
+ /* sanity check */
758
+ if (!this.showTabsText) {
759
+ this.showTabsText = resource;
760
+ }
761
+ });
762
+ }
763
+ }
764
+ ngAfterViewChecked() {
765
+ this.tabService.content = this.content;
766
+ this.tabService.updateContent();
767
+ }
768
+ ngOnDestroy() {
769
+ this._ngUnsubscribe.next();
770
+ this._ngUnsubscribe.complete();
771
+ }
772
+ };
773
+ SkyVerticalTabsetComponent.ctorParameters = () => [
774
+ { type: SkyVerticalTabsetAdapterService },
775
+ { type: SkyVerticalTabsetService },
776
+ { type: SkyLibResourcesService },
777
+ { type: ChangeDetectorRef }
778
+ ];
779
+ __decorate([
780
+ Input()
781
+ ], SkyVerticalTabsetComponent.prototype, "showTabsText", void 0);
782
+ __decorate([
783
+ Input()
784
+ ], SkyVerticalTabsetComponent.prototype, "ariaRole", null);
785
+ __decorate([
786
+ Input()
787
+ ], SkyVerticalTabsetComponent.prototype, "maintainTabContent", void 0);
788
+ __decorate([
789
+ Output()
790
+ ], SkyVerticalTabsetComponent.prototype, "activeChange", void 0);
791
+ __decorate([
792
+ ViewChild('groupContainerWrapper')
793
+ ], SkyVerticalTabsetComponent.prototype, "tabGroups", void 0);
794
+ __decorate([
795
+ ViewChild('skySideContent')
796
+ ], SkyVerticalTabsetComponent.prototype, "content", void 0);
797
+ __decorate([
798
+ ViewChild('contentContainerWrapper')
799
+ ], SkyVerticalTabsetComponent.prototype, "contentWrapper", void 0);
800
+ SkyVerticalTabsetComponent = __decorate([
801
+ Component({
802
+ selector: 'sky-vertical-tabset',
803
+ template: " <div class=\"sky-vertical-tabset\" (window:resize)=\"tabService.updateContent()\">\n <div\n *ngIf=\"maintainTabContent || tabService.tabsVisible()\"\n #groupContainerWrapper\n class=\"sky-vertical-tabset-group-container\"\n [ngClass]=\"{'sky-vertical-tabset-hidden': !tabService.tabsVisible()}\"\n [attr.role]=\"ariaRole\"\n [@tabGroupEnter]=\"tabService.animationTabsVisibleState\"\n >\n <ng-content></ng-content>\n </div>\n <div\n *ngIf=\"maintainTabContent || tabService.contentVisible()\"\n class=\"sky-vertical-tabset-content\"\n [ngClass]=\"{'sky-vertical-tabset-content-hidden': !tabService.contentVisible()}\"\n [@contentEnter]=\"tabService.animationContentVisibleState\"\n #contentContainerWrapper\n >\n <div #skySideContent></div>\n <button\n *ngIf=\"!tabService.tabsVisible()\"\n (click)=\"tabService.showTabs()\"\n class=\"sky-btn sky-btn-primary sky-vertical-tabset-show-tabs-btn\"\n >\n <sky-icon icon=\"chevron-left\"></sky-icon>\n {{ showTabsText }}\n </button>\n </div>\n</div>\n",
804
+ providers: [SkyVerticalTabsetService],
805
+ changeDetection: ChangeDetectionStrategy.OnPush,
806
+ animations: [
807
+ trigger('tabGroupEnter', [
808
+ transition(`${HIDDEN_STATE} => ${VISIBLE_STATE}`, [
809
+ style({ transform: 'translate(-100%)' }),
810
+ animate('150ms ease-in')
811
+ ])
812
+ ]),
813
+ trigger('contentEnter', [
814
+ transition(`${HIDDEN_STATE} => ${VISIBLE_STATE}`, [
815
+ style({ transform: 'translate(100%)' }),
816
+ animate('150ms ease-in')
817
+ ])
818
+ ])
819
+ ],
820
+ styles: [":host .sky-vertical-tabset{display:block;height:auto}:host .sky-vertical-tabset-group-container{border-right:none}:host-context(.sky-responsive-container-lg) .sky-vertical-tabset,:host-context(.sky-responsive-container-md) .sky-vertical-tabset,:host-context(.sky-responsive-container-sm) .sky-vertical-tabset,:host-context(.sky-responsive-container-xs) .sky-vertical-tabset{display:block;height:auto}:host-context(.sky-responsive-container-lg) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-md) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-sm) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-xs) .sky-vertical-tabset-group-container{border-right:none}@media (min-width:768px){:host .sky-vertical-tabset{display:flex;height:100%}:host .sky-vertical-tabset-group-container{border-right:1px solid #cdcfd2}}:host-context(.sky-responsive-container-lg) .sky-vertical-tabset,:host-context(.sky-responsive-container-md) .sky-vertical-tabset,:host-context(.sky-responsive-container-sm) .sky-vertical-tabset{display:flex;height:100%}:host-context(.sky-responsive-container-lg) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-md) .sky-vertical-tabset-group-container,:host-context(.sky-responsive-container-sm) .sky-vertical-tabset-group-container{border-right:1px solid #cdcfd2}.sky-vertical-tabset-hidden{display:none}.sky-vertical-tabset-content{margin:10px 0 0 10px;flex-basis:75%;overflow-y:auto}.sky-vertical-tabset-content-hidden{display:none}.sky-vertical-tabset-show-tabs-btn{margin-top:10px}.sky-vertical-tabset-group-container{flex-basis:25%;overflow-y:auto}:host-context(sky-modal-content>) .sky-vertical-tabset{margin:-15px}"]
821
+ })
822
+ ], SkyVerticalTabsetComponent);
823
+
824
+ let SkyVerticalTabsetGroupComponent = class SkyVerticalTabsetGroupComponent {
825
+ constructor(tabService, changeRef) {
826
+ this.tabService = tabService;
827
+ this.changeRef = changeRef;
828
+ this.ngUnsubscribe = new Subject();
829
+ this.openBeforeTabsHidden = false;
830
+ this._open = false;
831
+ this.tabClicked = () => {
832
+ this.changeRef.markForCheck();
833
+ };
834
+ this.tabsHidden = () => {
835
+ // this fixes an animation bug with ngIf when the parent component goes from visible to hidden
836
+ this.openBeforeTabsHidden = this.open;
837
+ this.open = false;
838
+ this.changeRef.markForCheck();
839
+ };
840
+ this.tabsShown = () => {
841
+ this.open = this.openBeforeTabsHidden;
842
+ this.changeRef.markForCheck();
843
+ };
844
+ }
845
+ /**
846
+ * Indicates whether the collapsible group is expanded.
847
+ * @default "false"
848
+ */
849
+ set open(value) {
850
+ this._open = value;
851
+ }
852
+ get open() {
853
+ return !this.disabled && this._open;
854
+ }
855
+ ngOnInit() {
856
+ this.tabService.hidingTabs
857
+ .pipe(takeUntil(this.ngUnsubscribe))
858
+ .subscribe(this.tabsHidden);
859
+ this.tabService.showingTabs
860
+ .pipe(takeUntil(this.ngUnsubscribe))
861
+ .subscribe(this.tabsShown);
862
+ this.tabService.tabClicked
863
+ .pipe(takeUntil(this.ngUnsubscribe))
864
+ .subscribe(this.tabClicked);
865
+ }
866
+ ngOnDestroy() {
867
+ this.ngUnsubscribe.next();
868
+ this.ngUnsubscribe.complete();
869
+ }
870
+ toggleMenuOpen() {
871
+ if (!this.disabled) {
872
+ this.open = !this.open;
873
+ }
874
+ this.changeRef.markForCheck();
875
+ }
876
+ subMenuOpen() {
877
+ return this.tabs && (this.tabs.find(t => t.active) !== undefined);
878
+ }
879
+ };
880
+ SkyVerticalTabsetGroupComponent.ctorParameters = () => [
881
+ { type: SkyVerticalTabsetService },
882
+ { type: ChangeDetectorRef }
883
+ ];
884
+ __decorate([
885
+ Input()
886
+ ], SkyVerticalTabsetGroupComponent.prototype, "disabled", void 0);
887
+ __decorate([
888
+ Input()
889
+ ], SkyVerticalTabsetGroupComponent.prototype, "groupHeading", void 0);
890
+ __decorate([
891
+ Input()
892
+ ], SkyVerticalTabsetGroupComponent.prototype, "open", null);
893
+ __decorate([
894
+ ContentChildren(SkyVerticalTabComponent)
895
+ ], SkyVerticalTabsetGroupComponent.prototype, "tabs", void 0);
896
+ SkyVerticalTabsetGroupComponent = __decorate([
897
+ Component({
898
+ selector: 'sky-vertical-tabset-group',
899
+ template: "<div class=\"sky-vertical-tabset-group\">\n <div\n class=\"sky-vertical-tabset-group-header sky-padding-even-default\"\n [ngClass]=\"{\n 'sky-vertical-tabset-group-header-sub-open sky-emphasized': subMenuOpen(),\n 'sky-deemphasized': disabled,\n 'sky-vertical-tabset-disabled': disabled\n }\"\n (click)=\"toggleMenuOpen()\"\n (keyup.enter)=\"toggleMenuOpen()\"\n [tabIndex]=\"-1\"\n >\n {{ groupHeading }}\n <sky-chevron *skyThemeIf=\"'default'\"\n class=\"sky-vertical-tabset-group-header-chevron\"\n [direction]=\"open ? 'up' : 'down'\"\n [disabled]=\"disabled\"\n (directionChange)=\"toggleMenuOpen()\"\n (keyup.enter)=\"$event.stopPropagation()\"\n >\n </sky-chevron>\n <ng-container *skyThemeIf=\"'modern'\">\n <button *ngIf=\"!open\"\n class=\"sky-btn sky-btn-icon-borderless sky-vertical-tabset-group-header-chevron\"\n type=\"button\"\n >\n <sky-icon\n icon=\"chevron-right\"\n iconType=\"skyux\"\n >\n </sky-icon>\n </button>\n <button *ngIf=\"open\"\n class=\"sky-btn sky-btn-icon-borderless sky-vertical-tabset-group-header-chevron\"\n type=\"button\"\n >\n <sky-icon\n icon=\"chevron-down\"\n iconType=\"skyux\"\n >\n </sky-icon>\n </button>\n </ng-container>\n </div>\n <div\n class=\"sky-vertical-tabset-group-content\"\n *ngIf=\"open\"\n [@tabSlide]\n >\n <ng-content></ng-content>\n </div>\n</div>\n",
900
+ changeDetection: ChangeDetectionStrategy.OnPush,
901
+ animations: [
902
+ trigger('tabSlide', [
903
+ transition(':enter', [
904
+ style({
905
+ height: '0',
906
+ visibility: 'hidden'
907
+ }),
908
+ animate('150ms ease-in', style({
909
+ height: '*',
910
+ visibility: 'visible'
911
+ }))
912
+ ]),
913
+ transition(':leave', [
914
+ style({
915
+ height: '*',
916
+ visibility: 'visible'
917
+ }),
918
+ animate('150ms ease-in', style({
919
+ height: '0',
920
+ visibility: 'hidden'
921
+ }))
922
+ ])
923
+ ])
924
+ ],
925
+ styles: [".sky-vertical-tabset-group{border-bottom:1px solid #e2e3e4;margin:5px 0 5px 5px}.sky-vertical-tabset-group-header{cursor:pointer;display:flex;justify-content:space-between}.sky-vertical-tabset-group-header:focus{outline:dotted thin;outline:-webkit-focus-ring-color auto 5px}.sky-vertical-tabset-group-content{overflow:hidden;border-top:1px solid #e2e3e4}:host ::ng-deep .sky-vertical-tabset-group-header-chevron>button{font-size:14px!important}.sky-vertical-tabset-disabled{cursor:not-allowed;pointer-events:none;font-style:normal}.sky-theme-modern .sky-vertical-tabset-group,:host-context(.sky-theme-modern) .sky-vertical-tabset-group{border:none}.sky-theme-modern .sky-vertical-tabset-group-content,:host-context(.sky-theme-modern) .sky-vertical-tabset-group-content{border:none;padding-left:25px}.sky-theme-modern .sky-vertical-tabset-group-header,:host-context(.sky-theme-modern) .sky-vertical-tabset-group-header{position:relative}.sky-theme-modern .sky-vertical-tabset-group-header-chevron,:host-context(.sky-theme-modern) .sky-vertical-tabset-group-header-chevron{position:absolute;top:6px;right:5px}"]
926
+ })
927
+ ], SkyVerticalTabsetGroupComponent);
928
+
929
+ let SkyVerticalTabsetModule = class SkyVerticalTabsetModule {
930
+ };
931
+ SkyVerticalTabsetModule = __decorate([
932
+ NgModule({
933
+ declarations: [
934
+ SkyVerticalTabsetComponent,
935
+ SkyVerticalTabsetGroupComponent,
936
+ SkyVerticalTabComponent
937
+ ],
938
+ imports: [
939
+ CommonModule,
940
+ BrowserAnimationsModule,
941
+ SkyChevronModule,
942
+ SkyIconModule,
943
+ SkyMediaQueryModule,
944
+ SkyStatusIndicatorModule,
945
+ SkyTabsResourcesModule,
946
+ SkyThemeModule
947
+ ],
948
+ providers: [
949
+ SkyVerticalTabsetAdapterService
950
+ ],
951
+ exports: [
952
+ SkyVerticalTabsetComponent,
953
+ SkyVerticalTabsetGroupComponent,
954
+ SkyVerticalTabComponent
955
+ ]
956
+ })
957
+ ], SkyVerticalTabsetModule);
958
+
959
+ let SkySectionedFormModule = class SkySectionedFormModule {
960
+ };
961
+ SkySectionedFormModule = __decorate([
962
+ NgModule({
963
+ declarations: [
964
+ SkySectionedFormComponent,
965
+ SkySectionedFormSectionComponent
966
+ ],
967
+ imports: [
968
+ CommonModule,
969
+ SkyCheckboxModule,
970
+ SkyVerticalTabsetModule
971
+ ],
972
+ exports: [
973
+ SkySectionedFormComponent,
974
+ SkySectionedFormSectionComponent
975
+ ]
976
+ })
977
+ ], SkySectionedFormModule);
978
+
979
+ /**
980
+ * @internal
981
+ */
982
+ let SkyTabButtonComponent = class SkyTabButtonComponent {
983
+ constructor() {
984
+ this.buttonClick = new EventEmitter();
985
+ this.closeClick = new EventEmitter();
986
+ }
987
+ onButtonClick(event) {
988
+ if (!this.disabled) {
989
+ this.buttonClick.emit();
990
+ event.preventDefault();
991
+ }
992
+ }
993
+ onButtonEnterKeyDown(event) {
994
+ this.onButtonClick(event);
995
+ }
996
+ onCloseClick(event) {
997
+ this.closeClick.emit();
998
+ // Prevent the click event from bubbling up to the anchor tag;
999
+ // otherwise it will trigger a page refresh.
1000
+ event.stopPropagation();
1001
+ event.preventDefault();
1002
+ }
1003
+ };
1004
+ __decorate([
1005
+ Input()
1006
+ ], SkyTabButtonComponent.prototype, "active", void 0);
1007
+ __decorate([
1008
+ Input()
1009
+ ], SkyTabButtonComponent.prototype, "ariaControls", void 0);
1010
+ __decorate([
1011
+ Input()
1012
+ ], SkyTabButtonComponent.prototype, "buttonHref", void 0);
1013
+ __decorate([
1014
+ Input()
1015
+ ], SkyTabButtonComponent.prototype, "buttonId", void 0);
1016
+ __decorate([
1017
+ Input()
1018
+ ], SkyTabButtonComponent.prototype, "buttonText", void 0);
1019
+ __decorate([
1020
+ Input()
1021
+ ], SkyTabButtonComponent.prototype, "buttonTextCount", void 0);
1022
+ __decorate([
1023
+ Input()
1024
+ ], SkyTabButtonComponent.prototype, "closeable", void 0);
1025
+ __decorate([
1026
+ Input()
1027
+ ], SkyTabButtonComponent.prototype, "disabled", void 0);
1028
+ __decorate([
1029
+ Input()
1030
+ ], SkyTabButtonComponent.prototype, "tabStyle", void 0);
1031
+ __decorate([
1032
+ Output()
1033
+ ], SkyTabButtonComponent.prototype, "buttonClick", void 0);
1034
+ __decorate([
1035
+ Output()
1036
+ ], SkyTabButtonComponent.prototype, "closeClick", void 0);
1037
+ SkyTabButtonComponent = __decorate([
1038
+ Component({
1039
+ selector: 'sky-tab-button',
1040
+ template: "<div\n class=\"sky-btn-tab-wrapper\"\n [ngClass]=\"{\n 'sky-btn-tab-wrapper-selected': active,\n 'sky-btn-tab-wrapper-disabled': disabled\n }\"\n>\n <a\n class=\"sky-btn-tab\"\n role=\"tab\"\n [attr.aria-controls]=\"ariaControls\"\n [attr.aria-disabled]=\"disabled\"\n [attr.aria-selected]=\"active\"\n [attr.href]=\"buttonHref\"\n [id]=\"buttonId\"\n [ngClass]=\"{\n 'sky-btn-tab-wizard': tabStyle === 'wizard',\n 'sky-btn-tab-selected': active,\n 'sky-btn-tab-disabled': disabled,\n 'sky-tab-btn-closeable': closeable\n }\"\n [tabindex]=\"disabled ? '-1' : '0'\"\n (click)=\"onButtonClick($event)\"\n (keydown.enter)=\"onButtonEnterKeyDown($event)\"\n >\n <span\n class=\"sky-tab-heading\"\n >\n {{ buttonText }}\n <span *ngIf=\"buttonTextCount !== undefined\"\n class=\"sky-tab-header-count\"\n >\n {{ buttonTextCount }}\n </span>\n </span>\n </a>\n\n <button *ngIf=\"closeable\"\n class=\"sky-btn-tab-close\"\n type=\"button\"\n [attr.aria-label]=\"'skyux_tab_close' | skyLibResources:buttonText\"\n [disabled]=\"disabled\"\n [ngClass]=\"{\n 'sky-btn-tab-close-disabled': disabled\n }\"\n (click)=\"onCloseClick($event)\"\n >\n <sky-icon\n icon=\"remove\"\n ></sky-icon>\n </button>\n</div>\n",
1041
+ changeDetection: ChangeDetectionStrategy.OnPush,
1042
+ encapsulation: ViewEncapsulation.None,
1043
+ styles: [".sky-btn-tab-wrapper{display:inline-block;position:relative;margin-right:5px}.sky-btn-tab-wrapper .sky-btn-tab-close{position:absolute;top:10px;right:10px;color:#686c73}.sky-btn-tab-wrapper .sky-btn-tab-close:hover{color:#212327;transition:color 150ms}.sky-btn-tab-wrapper.sky-btn-tab-wrapper-selected:not(.sky-btn-tab-wrapper-disabled) .sky-btn-tab-close{color:#fff}.sky-tab-btn-closeable{padding-right:43px}.sky-theme-modern .sky-btn-tab-wrapper,:host-context(.sky-theme-modern) .sky-btn-tab-wrapper{margin-right:10px}.sky-theme-modern .sky-btn-tab-wrapper .sky-btn-tab-close,:host-context(.sky-theme-modern) .sky-btn-tab-wrapper .sky-btn-tab-close{top:12px;right:10px}.sky-theme-modern .sky-btn-tab-wrapper.sky-btn-tab-wrapper-selected:not(.sky-btn-tab-wrapper-disabled) .sky-btn-tab-close,:host-context(.sky-theme-modern) .sky-btn-tab-wrapper.sky-btn-tab-wrapper-selected:not(.sky-btn-tab-wrapper-disabled) .sky-btn-tab-close{color:#686c73}.sky-theme-modern .sky-tab-btn-closeable,:host-context(.sky-theme-modern) .sky-tab-btn-closeable{padding-right:44px}.sky-theme-modern.sky-theme-mode-dark .sky-btn-tab-wrapper .sky-btn-tab-close,:host-context(.sky-theme-modern.sky-theme-mode-dark) .sky-btn-tab-wrapper .sky-btn-tab-close{color:#eeeeef}.sky-theme-modern.sky-theme-mode-dark .sky-btn-tab-wrapper.sky-btn-tab-wrapper-selected:not(.sky-btn-tab-wrapper-disabled) .sky-btn-tab-close,:host-context(.sky-theme-modern.sky-theme-mode-dark) .sky-btn-tab-wrapper.sky-btn-tab-wrapper-selected:not(.sky-btn-tab-wrapper-disabled) .sky-btn-tab-close{color:#eeeeef}"]
1044
+ })
1045
+ ], SkyTabButtonComponent);
1046
+
1047
+ /**
1048
+ * @internal
1049
+ */
1050
+ let SkyTabsetPermalinkService = class SkyTabsetPermalinkService {
1051
+ constructor(activatedRoute, location, router) {
1052
+ this.activatedRoute = activatedRoute;
1053
+ this.location = location;
1054
+ this.router = router;
1055
+ this._popStateChange = new Subject();
1056
+ }
1057
+ get popStateChange() {
1058
+ return this._popStateChange.asObservable();
1059
+ }
1060
+ ngOnDestroy() {
1061
+ if (this.subscription) {
1062
+ this.subscription.unsubscribe();
1063
+ }
1064
+ }
1065
+ init() {
1066
+ this.subscription = this.location.subscribe(() => {
1067
+ this._popStateChange.next();
1068
+ });
1069
+ }
1070
+ /**
1071
+ * Returns the value of a URL query param.
1072
+ */
1073
+ getParam(name) {
1074
+ return this.getParams()[name];
1075
+ }
1076
+ /**
1077
+ * Sets the value of a URL query param.
1078
+ */
1079
+ setParam(name, value) {
1080
+ const params = this.getParams();
1081
+ if (value === null) {
1082
+ delete params[name];
1083
+ }
1084
+ else {
1085
+ params[name] = value;
1086
+ }
1087
+ // Update the URL without triggering a navigation state change.
1088
+ // See: https://stackoverflow.com/a/46486677
1089
+ const url = this.router.createUrlTree(['.'], {
1090
+ relativeTo: this.activatedRoute,
1091
+ queryParams: params,
1092
+ queryParamsHandling: 'merge'
1093
+ }).toString();
1094
+ // Abort redirect if the current URL is equal to the new URL.
1095
+ if (this.location.isCurrentPathEqualTo(url)) {
1096
+ return;
1097
+ }
1098
+ this.location.go(url);
1099
+ }
1100
+ /**
1101
+ * Removes the provided query param from the URL.
1102
+ */
1103
+ clearParam(name) {
1104
+ /*tslint:disable-next-line:no-null-keyword*/
1105
+ this.setParam(name, null);
1106
+ }
1107
+ /**
1108
+ * Returns a relative URL that includes the provided query parameter. The value is inteded to be
1109
+ * used by an HTML anchor element.
1110
+ */
1111
+ getParamHref(name, value) {
1112
+ if (!name) {
1113
+ /*tslint:disable-next-line:no-null-keyword*/
1114
+ return null;
1115
+ }
1116
+ const params = this.getParams();
1117
+ params[name] = value;
1118
+ const baseUrl = this.location.path().split('?')[0];
1119
+ const paramString = Object.keys(params).map(k => `${k}=${params[k]}`).join('&');
1120
+ return this.location.prepareExternalUrl(`${baseUrl}?${paramString}`);
1121
+ }
1122
+ /**
1123
+ * Converts the provided string into a value that can be safely used in a URL.
1124
+ */
1125
+ urlify(value) {
1126
+ if (!value) {
1127
+ return '';
1128
+ }
1129
+ const sanitized = value.toLowerCase()
1130
+ // Remove special characters.
1131
+ .replace(/[\_\~\`\@\!\#\$\%\^\&\*\(\)\[\]\{\}\;\:\'\/\\\<\>\,\.\?\=\+\|"]/g, '')
1132
+ // Replace space characters with a dash.
1133
+ .replace(/\s/g, '-')
1134
+ // Remove any double-dashes.
1135
+ .replace(/--/g, '-');
1136
+ return sanitized;
1137
+ }
1138
+ /**
1139
+ * Returns all query params that exist in the current URL.
1140
+ */
1141
+ getParams() {
1142
+ const params = {};
1143
+ const path = this.location.path();
1144
+ if (path.indexOf('?') === -1) {
1145
+ return params;
1146
+ }
1147
+ const existingParamPairs = path.split('?')[1].split('&');
1148
+ existingParamPairs.forEach((pair) => {
1149
+ const fragments = pair.split('=');
1150
+ params[fragments[0]] = decodeURIComponent(fragments[1]);
1151
+ });
1152
+ return params;
1153
+ }
1154
+ };
1155
+ SkyTabsetPermalinkService.ctorParameters = () => [
1156
+ { type: ActivatedRoute },
1157
+ { type: Location },
1158
+ { type: Router }
1159
+ ];
1160
+ SkyTabsetPermalinkService = __decorate([
1161
+ Injectable()
1162
+ ], SkyTabsetPermalinkService);
1163
+
1164
+ /**
1165
+ * @internal
1166
+ */
1167
+ let SkyTabsetService = class SkyTabsetService {
1168
+ constructor() {
1169
+ this.currentActiveTabIndex = 0;
1170
+ this._activeTabIndex = new BehaviorSubject(0);
1171
+ this._activeTabUnregistered = new Subject();
1172
+ this.tabs = [];
1173
+ this.tabCounter = 0;
1174
+ }
1175
+ get activeTabUnregistered() {
1176
+ return this._activeTabUnregistered.asObservable();
1177
+ }
1178
+ get activeTabIndex() {
1179
+ return this._activeTabIndex.asObservable();
1180
+ }
1181
+ /**
1182
+ * Sets the active tab by its unique `tabIndex` property.
1183
+ */
1184
+ setActiveTabIndex(value, config = {
1185
+ emitChange: true
1186
+ }) {
1187
+ if (value !== undefined &&
1188
+ !this.tabIndexesEqual(value, this.currentActiveTabIndex)) {
1189
+ this.currentActiveTabIndex = value;
1190
+ if (config.emitChange) {
1191
+ this._activeTabIndex.next(value);
1192
+ }
1193
+ }
1194
+ }
1195
+ /**
1196
+ * Registers a tab component.
1197
+ */
1198
+ registerTab(tabIndex) {
1199
+ if (tabIndex === undefined) {
1200
+ tabIndex = this.tabCounter;
1201
+ this.tabCounter++;
1202
+ }
1203
+ this.tabs.push({ tabIndex });
1204
+ return tabIndex;
1205
+ }
1206
+ updateTabIndex(currentTabIndex, newTabIndex) {
1207
+ const found = this.tabs.find(tab => this.tabIndexesEqual(tab.tabIndex, currentTabIndex));
1208
+ found.tabIndex = newTabIndex;
1209
+ }
1210
+ /**
1211
+ * Unregisters a tab component.
1212
+ */
1213
+ unregisterTab(tabIndex) {
1214
+ const index = this.tabs.findIndex(tab => this.tabIndexesEqual(tab.tabIndex, tabIndex));
1215
+ // Notify the tabset component when an active tab is unregistered.
1216
+ if (this.isTabIndexActive(this.tabs[index].tabIndex)) {
1217
+ this._activeTabUnregistered.next({
1218
+ arrayIndex: index
1219
+ });
1220
+ }
1221
+ this.tabs.splice(index, 1);
1222
+ }
1223
+ /**
1224
+ * Unregisters all tab components at once.
1225
+ */
1226
+ unregisterAll() {
1227
+ this.tabs = [];
1228
+ }
1229
+ /**
1230
+ * Compares two tab indexes and returns `true` if they are equal.
1231
+ */
1232
+ tabIndexesEqual(tabIndex1, tabIndex2) {
1233
+ return (tabIndex1 === tabIndex2 ||
1234
+ +tabIndex1 === +tabIndex2);
1235
+ }
1236
+ /**
1237
+ * Verifies if a provided tab index is registered.
1238
+ */
1239
+ isValidTabIndex(tabIndex) {
1240
+ return this.tabs.some(tab => this.tabIndexesEqual(tab.tabIndex, tabIndex));
1241
+ }
1242
+ /**
1243
+ * Activates the first registered tab.
1244
+ */
1245
+ activateFirstTab() {
1246
+ const firstTabIndex = this.tabs[0] && this.tabs[0].tabIndex;
1247
+ if (firstTabIndex !== undefined) {
1248
+ this.setActiveTabIndex(firstTabIndex);
1249
+ return firstTabIndex;
1250
+ }
1251
+ }
1252
+ /**
1253
+ * Activates the next registered tab, or the previous one based on a provided array index.
1254
+ */
1255
+ activateNearestTab(arrayIndex) {
1256
+ const newActiveTab = this.tabs[arrayIndex] || this.tabs[arrayIndex - 1];
1257
+ if (newActiveTab) {
1258
+ this.currentActiveTabIndex = newActiveTab.tabIndex;
1259
+ }
1260
+ }
1261
+ isTabIndexActive(tabIndex) {
1262
+ return this.tabIndexesEqual(tabIndex, this.currentActiveTabIndex);
1263
+ }
1264
+ };
1265
+ SkyTabsetService = __decorate([
1266
+ Injectable()
1267
+ ], SkyTabsetService);
1268
+
1269
+ let nextId$1 = 0;
1270
+ let SkyTabComponent = class SkyTabComponent {
1271
+ constructor(changeDetector, permalinkService, tabsetService) {
1272
+ this.changeDetector = changeDetector;
1273
+ this.permalinkService = permalinkService;
1274
+ this.tabsetService = tabsetService;
1275
+ /**
1276
+ * Fires when users click the button to close the tab.
1277
+ * The close button is added to the tab when you specify a listener for this event.
1278
+ */
1279
+ this.close = new EventEmitter();
1280
+ this.showContent = false;
1281
+ this._activeChange = new BehaviorSubject(undefined);
1282
+ this._stateChange = new BehaviorSubject(undefined);
1283
+ this._tabIndexChange = new BehaviorSubject(undefined);
1284
+ const id = nextId$1++;
1285
+ this.tabPanelId = `sky-tab-${id}`;
1286
+ this.tabButtonId = `${this.tabPanelId}-nav-btn`;
1287
+ }
1288
+ /**
1289
+ * Indicates whether the tab is active when the tabset loads. After initialization, the `active`
1290
+ * property on the tabset component should be used to set the active tab.
1291
+ * @default false
1292
+ */
1293
+ set active(value) {
1294
+ if (value !== undefined &&
1295
+ value !== this._active) {
1296
+ this._active = value;
1297
+ this._activeChange.next();
1298
+ }
1299
+ }
1300
+ get active() {
1301
+ return this._active || false;
1302
+ }
1303
+ get activeChange() {
1304
+ return this._activeChange.asObservable();
1305
+ }
1306
+ /**
1307
+ * Specifies a custom query parameter value for the tab.
1308
+ * This works in conjunction with the tabset's `permalinkId` to distinguish
1309
+ * the tab's unique state in the URL by generating a query parameter that is
1310
+ * written as `?<queryParam>-active-tab=<sanitized-tab-heading`.
1311
+ * By default, the query parameter's value is parsed automatically from the tab's heading text.
1312
+ */
1313
+ set permalinkValue(value) {
1314
+ this._permalinkValue = this.permalinkService.urlify(value);
1315
+ }
1316
+ get permalinkValue() {
1317
+ return this._permalinkValue || this.permalinkService.urlify(this.tabHeading);
1318
+ }
1319
+ /**
1320
+ * Specifies a unique identifier for the tab.
1321
+ * If not defined, the identifier is set to the position of the tab on load, starting with `0`.
1322
+ */
1323
+ set tabIndex(value) {
1324
+ if (value !== this._tabIndex &&
1325
+ value !== undefined &&
1326
+ this._tabIndex !== undefined) {
1327
+ this.tabsetService.updateTabIndex(this._tabIndex, value);
1328
+ this._tabIndexChange.next(value);
1329
+ }
1330
+ this._tabIndex = value;
1331
+ }
1332
+ get tabIndex() {
1333
+ return this._tabIndex;
1334
+ }
1335
+ get closeable() {
1336
+ return this.close.observers.length > 0;
1337
+ }
1338
+ /**
1339
+ * Alerts the tabset component when this component has changes that need to be reflected in the UI.
1340
+ */
1341
+ get stateChange() {
1342
+ return this._stateChange.asObservable();
1343
+ }
1344
+ get tabIndexChange() {
1345
+ return this._tabIndexChange.asObservable();
1346
+ }
1347
+ ngOnChanges(changes) {
1348
+ if (changes.disabled && !changes.disabled.firstChange ||
1349
+ changes.tabHeading && !changes.tabHeading.firstChange ||
1350
+ changes.tabHeaderCount && !changes.tabHeaderCount.firstChange ||
1351
+ changes.permalinkValue && !changes.permalinkValue.firstChange) {
1352
+ this._stateChange.next();
1353
+ }
1354
+ }
1355
+ ngOnDestroy() {
1356
+ this._stateChange.complete();
1357
+ this.tabsetService.unregisterTab(this.tabIndex);
1358
+ }
1359
+ init() {
1360
+ this._tabIndex = this.tabsetService.registerTab(this.tabIndex);
1361
+ }
1362
+ activate() {
1363
+ this._active = true;
1364
+ this.showContent = true;
1365
+ this.changeDetector.markForCheck();
1366
+ }
1367
+ deactivate() {
1368
+ this._active = false;
1369
+ this.showContent = false;
1370
+ this.changeDetector.markForCheck();
1371
+ }
1372
+ };
1373
+ SkyTabComponent.ctorParameters = () => [
1374
+ { type: ChangeDetectorRef },
1375
+ { type: SkyTabsetPermalinkService },
1376
+ { type: SkyTabsetService }
1377
+ ];
1378
+ __decorate([
1379
+ Input()
1380
+ ], SkyTabComponent.prototype, "active", null);
1381
+ __decorate([
1382
+ Input()
1383
+ ], SkyTabComponent.prototype, "disabled", void 0);
1384
+ __decorate([
1385
+ Input()
1386
+ ], SkyTabComponent.prototype, "permalinkValue", null);
1387
+ __decorate([
1388
+ Input()
1389
+ ], SkyTabComponent.prototype, "tabHeaderCount", void 0);
1390
+ __decorate([
1391
+ Input()
1392
+ ], SkyTabComponent.prototype, "tabHeading", void 0);
1393
+ __decorate([
1394
+ Input()
1395
+ ], SkyTabComponent.prototype, "tabIndex", null);
1396
+ __decorate([
1397
+ Output()
1398
+ ], SkyTabComponent.prototype, "close", void 0);
1399
+ SkyTabComponent = __decorate([
1400
+ Component({
1401
+ selector: 'sky-tab',
1402
+ 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",
1403
+ changeDetection: ChangeDetectionStrategy.OnPush
1404
+ })
1405
+ ], SkyTabComponent);
1406
+
1407
+ const buttonTypeNext = 'next';
1408
+ const buttonTypePrevious = 'previous';
1409
+ /**
1410
+ * @internal
1411
+ */
1412
+ let SkyTabsetNavButtonComponent = class SkyTabsetNavButtonComponent {
1413
+ constructor(resourceService, changeDetector) {
1414
+ this.resourceService = resourceService;
1415
+ this.changeDetector = changeDetector;
1416
+ }
1417
+ set buttonText(value) {
1418
+ this._buttonText = value;
1419
+ }
1420
+ get buttonText() {
1421
+ if (this._buttonText) {
1422
+ return this._buttonText;
1423
+ }
1424
+ switch (this.buttonType) {
1425
+ case buttonTypePrevious:
1426
+ return this.previousButtonText;
1427
+ case buttonTypeNext:
1428
+ return this.nextButtonText;
1429
+ /* istanbul ignore next */
1430
+ default:
1431
+ return '';
1432
+ }
1433
+ }
1434
+ get disabled() {
1435
+ let tabToSelect;
1436
+ switch (this.buttonType) {
1437
+ case buttonTypePrevious:
1438
+ tabToSelect = this.previousTab;
1439
+ break;
1440
+ case buttonTypeNext:
1441
+ tabToSelect = this.nextTab;
1442
+ break;
1443
+ /* istanbul ignore next */
1444
+ default:
1445
+ break;
1446
+ }
1447
+ return !tabToSelect || tabToSelect.disabled;
1448
+ }
1449
+ get selectedTab() {
1450
+ let selectedTab;
1451
+ if (this.tabset && this.tabset.tabs) {
1452
+ selectedTab = this.tabset.tabs.find((tab) => tab.tabIndex === this.tabset.lastActiveTabIndex);
1453
+ }
1454
+ return selectedTab;
1455
+ }
1456
+ get nextTab() {
1457
+ let selectedTab = this.selectedTab;
1458
+ if (selectedTab) {
1459
+ let tabs = this.tabset.tabs.toArray();
1460
+ return tabs[tabs.indexOf(selectedTab) + 1];
1461
+ }
1462
+ return undefined;
1463
+ }
1464
+ get previousTab() {
1465
+ let selectedTab = this.selectedTab;
1466
+ if (selectedTab) {
1467
+ let tabs = this.tabset.tabs.toArray();
1468
+ return tabs[tabs.indexOf(selectedTab) - 1];
1469
+ }
1470
+ return undefined;
1471
+ }
1472
+ ngAfterViewInit() {
1473
+ forkJoin([
1474
+ this.resourceService.getString('skyux_tabs_navigator_previous'),
1475
+ this.resourceService.getString('skyux_tabs_navigator_next')
1476
+ ])
1477
+ .pipe(take(1))
1478
+ .subscribe(resources => {
1479
+ this.previousButtonText = resources[0];
1480
+ this.nextButtonText = resources[1];
1481
+ this.changeDetector.detectChanges();
1482
+ });
1483
+ }
1484
+ buttonClick() {
1485
+ let tabToSelect;
1486
+ switch (this.buttonType) {
1487
+ case buttonTypePrevious:
1488
+ tabToSelect = this.previousTab;
1489
+ break;
1490
+ case buttonTypeNext:
1491
+ tabToSelect = this.nextTab;
1492
+ break;
1493
+ /* istanbul ignore next */
1494
+ default:
1495
+ break;
1496
+ }
1497
+ /* istanbul ignore else */
1498
+ if (tabToSelect && !tabToSelect.disabled) {
1499
+ this.tabset.active = tabToSelect.tabIndex;
1500
+ }
1501
+ }
1502
+ };
1503
+ SkyTabsetNavButtonComponent.ctorParameters = () => [
1504
+ { type: SkyLibResourcesService },
1505
+ { type: ChangeDetectorRef }
1506
+ ];
1507
+ __decorate([
1508
+ Input()
1509
+ ], SkyTabsetNavButtonComponent.prototype, "tabset", void 0);
1510
+ __decorate([
1511
+ Input()
1512
+ ], SkyTabsetNavButtonComponent.prototype, "buttonType", void 0);
1513
+ __decorate([
1514
+ Input()
1515
+ ], SkyTabsetNavButtonComponent.prototype, "buttonText", null);
1516
+ SkyTabsetNavButtonComponent = __decorate([
1517
+ Component({
1518
+ selector: 'sky-tabset-nav-button',
1519
+ template: "<button\n class=\"sky-btn sky-btn-default\"\n type=\"button\"\n [disabled]=\"disabled\"\n (click)=\"buttonClick()\"\n>\n {{ buttonText }}\n</button>\n"
1520
+ })
1521
+ ], SkyTabsetNavButtonComponent);
1522
+
1523
+ /**
1524
+ * @internal
1525
+ */
1526
+ let SkyTabsetAdapterService = class SkyTabsetAdapterService {
1527
+ constructor() {
1528
+ this._overflowChange = new BehaviorSubject(false);
1529
+ }
1530
+ get overflowChange() {
1531
+ return this._overflowChange.asObservable();
1532
+ }
1533
+ registerTabset(tabsetRef) {
1534
+ this.tabsetRef = tabsetRef;
1535
+ this.tabsOffsetLeft = this.getTabsOffsetLeft(tabsetRef.nativeElement);
1536
+ }
1537
+ /**
1538
+ * Detects if the tab buttons are wider than the tabset container.
1539
+ */
1540
+ detectOverflow() {
1541
+ const nativeElement = this.tabsetRef.nativeElement;
1542
+ const tabsetRect = nativeElement
1543
+ .querySelector('.sky-tabset')
1544
+ .getBoundingClientRect();
1545
+ const tabButtonsRect = nativeElement
1546
+ .querySelector('.sky-tabset-tabs')
1547
+ .getBoundingClientRect();
1548
+ const tabExtraButtonsRect = nativeElement
1549
+ .querySelector('.sky-tabset-btns')
1550
+ .getBoundingClientRect();
1551
+ const tabButtonsWidth = tabButtonsRect.width + tabExtraButtonsRect.width + this.tabsOffsetLeft;
1552
+ const newOverflow = (tabButtonsWidth > tabsetRect.width);
1553
+ if (this.currentOverflow !== newOverflow) {
1554
+ this.currentOverflow = newOverflow;
1555
+ this._overflowChange.next(this.currentOverflow);
1556
+ }
1557
+ }
1558
+ /**
1559
+ * Returns the number of pixels to the left of the first tab.
1560
+ */
1561
+ getTabsOffsetLeft(tabsetEl) {
1562
+ const tabsetRect = tabsetEl.getBoundingClientRect();
1563
+ // The dropdown element is the first "tab" and always exists in the DOM, even when hidden.
1564
+ const firstTabRect = tabsetEl.querySelector('.sky-tabset-dropdown').getBoundingClientRect();
1565
+ return firstTabRect.left - tabsetRect.left;
1566
+ }
1567
+ };
1568
+ SkyTabsetAdapterService = __decorate([
1569
+ Injectable()
1570
+ ], SkyTabsetAdapterService);
1571
+
1572
+ let SkyTabsetComponent = class SkyTabsetComponent {
1573
+ constructor(changeDetector, elementRef, adapterService, permalinkService, tabsetService) {
1574
+ this.changeDetector = changeDetector;
1575
+ this.elementRef = elementRef;
1576
+ this.adapterService = adapterService;
1577
+ this.permalinkService = permalinkService;
1578
+ this.tabsetService = tabsetService;
1579
+ /**
1580
+ * Fires when the active tab changes. This event emits the index of the active tab.
1581
+ */
1582
+ this.activeChange = new EventEmitter();
1583
+ /**
1584
+ * Fires when users click the button to add a new tab.
1585
+ * The new tab button is added to the tab area when you specify a listener for this event.
1586
+ */
1587
+ this.newTab = new EventEmitter();
1588
+ /**
1589
+ * Fires when users click the button to open a tab.
1590
+ * The open tab button is added to the tab area when you specify a listener for this event.
1591
+ */
1592
+ this.openTab = new EventEmitter();
1593
+ /**
1594
+ * Fires when any tab's `tabIndex` value changes.
1595
+ */
1596
+ this.tabIndexesChange = new EventEmitter();
1597
+ this.tabButtons = [];
1598
+ this.ngUnsubscribe = new Subject();
1599
+ this.tabComponentsStateChangeUnsubscribe = new Subject();
1600
+ }
1601
+ /**
1602
+ * Activates a tab by its `tabIndex` property.
1603
+ */
1604
+ set active(value) {
1605
+ if (value === undefined ||
1606
+ this.tabsetService.tabIndexesEqual(value, this._active)) {
1607
+ return;
1608
+ }
1609
+ this._active = value;
1610
+ if (this.tabs) {
1611
+ this.tabsetService.setActiveTabIndex(value);
1612
+ }
1613
+ else {
1614
+ // On init, wait for children tabs to render before broadcasting the active tab index.
1615
+ setTimeout(() => {
1616
+ if (this.tabsetService.isValidTabIndex(value)) {
1617
+ // On init, yield to the permalink ID, if it exists.
1618
+ if (this.getActiveTabIndexByPermalinkId() === undefined) {
1619
+ this.tabsetService.setActiveTabIndex(value);
1620
+ }
1621
+ }
1622
+ else {
1623
+ // Activate the first tab if the new tab index is invalid.
1624
+ this._active = this.tabsetService.activateFirstTab();
1625
+ }
1626
+ });
1627
+ }
1628
+ }
1629
+ get active() {
1630
+ return this._active;
1631
+ }
1632
+ /**
1633
+ * Distinguishes a tabset's unique state in the URL by generating a query parameter
1634
+ * that is written as `?<queryParam>-active-tab=<sanitized-tab-heading>`.
1635
+ * The query parameter's value is parsed automatically from the selected tab's heading text,
1636
+ * but you can supply a custom query parameter value for each tab with its `permalinkValue`.
1637
+ */
1638
+ set permalinkId(value) {
1639
+ if (!value) {
1640
+ return;
1641
+ }
1642
+ const sanitized = this.permalinkService.urlify(value);
1643
+ this._permalinkId = `${sanitized}-active-tab`;
1644
+ }
1645
+ get permalinkId() {
1646
+ return this._permalinkId || '';
1647
+ }
1648
+ /**
1649
+ * Specifies the behavior for a series of tabs.
1650
+ * @deprecated The property was designed to create wizards by setting tabStyle="wizard" on tabsets in modals,
1651
+ * but this wizard implementation was replaced by the
1652
+ * [progress indicator component](https://developer.blackbaud.com/skyux/components/progress-indicator).
1653
+ * @default 'tabs'
1654
+ */
1655
+ set tabStyle(value) {
1656
+ /*istanbul ignore else*/
1657
+ if (value && value.toLowerCase() === 'wizard') {
1658
+ console.warn('The tabset wizard is deprecated. Please implement the new approach using ' +
1659
+ 'progress indicator as documented here: https://developer.blackbaud.com/skyux/components/wizard.');
1660
+ }
1661
+ this._tabStyle = value;
1662
+ }
1663
+ get tabStyle() {
1664
+ return this._tabStyle || 'tabs';
1665
+ }
1666
+ set tabDisplayMode(value) {
1667
+ this._tabDisplayMode = value;
1668
+ this.changeDetector.markForCheck();
1669
+ }
1670
+ get tabDisplayMode() {
1671
+ return this._tabDisplayMode || 'tabs';
1672
+ }
1673
+ ngAfterViewInit() {
1674
+ this.initTabComponents();
1675
+ this.listenTabComponentsStructuralChange();
1676
+ const initialTabIndex = this.getInitialTabIndex();
1677
+ this.tabsetService.setActiveTabIndex(initialTabIndex);
1678
+ this.listenTabButtonsOverflowChange();
1679
+ this.listenLocationPopStateChange();
1680
+ // If the currently active tab is getting unregistered, activate the next one.
1681
+ this.tabsetService.activeTabUnregistered
1682
+ .pipe(takeUntil(this.ngUnsubscribe))
1683
+ .subscribe(tab => {
1684
+ // Wait for the new tabs to render before activating.
1685
+ setTimeout(() => {
1686
+ this.tabsetService.activateNearestTab(tab.arrayIndex);
1687
+ });
1688
+ });
1689
+ // Let the tabset render the initial active index before listening for changes.
1690
+ setTimeout(() => {
1691
+ this.listenTabComponentsStateChange();
1692
+ this.listenActiveIndexChange();
1693
+ this.permalinkService.init();
1694
+ });
1695
+ }
1696
+ ngOnDestroy() {
1697
+ this.ngUnsubscribe.next();
1698
+ this.ngUnsubscribe.complete();
1699
+ this.unsubscribeTabComponentsStateChange();
1700
+ this.permalinkService.clearParam(this.permalinkId);
1701
+ }
1702
+ onWindowResize() {
1703
+ this.adapterService.detectOverflow();
1704
+ }
1705
+ onTabCloseClick(tabButton) {
1706
+ const tabComponent = this.tabs.find(tab => this.tabsetService.tabIndexesEqual(tab.tabIndex, tabButton.tabIndex));
1707
+ tabComponent.close.emit();
1708
+ }
1709
+ onTabButtonClick(tabButton) {
1710
+ this.tabsetService.setActiveTabIndex(tabButton.tabIndex);
1711
+ }
1712
+ onNewTabClick() {
1713
+ this.newTab.emit();
1714
+ }
1715
+ onOpenTabClick() {
1716
+ this.openTab.emit();
1717
+ }
1718
+ /**
1719
+ * Sets the initial active tab index based on the following criteria.
1720
+ * 1. Does the URL include a query param that reflects this tabset's active tab?
1721
+ * 2. Does one of the tab components have their `active` property set to `true`?
1722
+ * 3. Is the tabset component's `active` property set to a specific tab index?
1723
+ */
1724
+ getInitialTabIndex() {
1725
+ var _a;
1726
+ let activeIndex = this.getActiveTabIndexByPermalinkId();
1727
+ if (activeIndex === undefined) {
1728
+ activeIndex = (_a = this.getActiveTabComponent()) === null || _a === void 0 ? void 0 : _a.tabIndex;
1729
+ if (activeIndex === undefined) {
1730
+ activeIndex = this.active;
1731
+ }
1732
+ }
1733
+ return activeIndex;
1734
+ }
1735
+ listenActiveIndexChange() {
1736
+ this.tabsetService.activeTabIndex
1737
+ .pipe(distinctUntilChanged(), takeUntil(this.ngUnsubscribe))
1738
+ .subscribe(activeIndex => {
1739
+ this.updateTabsetComponent(activeIndex);
1740
+ });
1741
+ }
1742
+ listenTabComponentsStructuralChange() {
1743
+ this.tabs.changes
1744
+ .pipe(takeUntil(this.ngUnsubscribe))
1745
+ .subscribe(() => {
1746
+ this.resetTabComponents();
1747
+ });
1748
+ }
1749
+ listenTabComponentsStateChange() {
1750
+ combineLatest(this.tabs.map(tab => tab.activeChange))
1751
+ .pipe(takeUntil(race(this.tabComponentsStateChangeUnsubscribe, this.ngUnsubscribe)))
1752
+ .subscribe(() => {
1753
+ // Wait for the tab components to render changes before finding the active one.
1754
+ setTimeout(() => {
1755
+ var _a;
1756
+ const tabIndex = (_a = this.getActiveTabComponent()) === null || _a === void 0 ? void 0 : _a.tabIndex;
1757
+ this.tabsetService.setActiveTabIndex(tabIndex);
1758
+ });
1759
+ });
1760
+ combineLatest(this.tabs.map(tab => tab.tabIndexChange))
1761
+ .pipe(takeUntil(race(this.tabComponentsStateChangeUnsubscribe, this.ngUnsubscribe)))
1762
+ .subscribe(() => {
1763
+ // Don't emit the first change.
1764
+ if (this.lastActiveTabIndex !== undefined) {
1765
+ // Wait for the tab components to render changes before updating the view.
1766
+ setTimeout(() => {
1767
+ this.updateTabsetComponent(this.tabsetService.currentActiveTabIndex, true);
1768
+ this.emitTabIndexChange();
1769
+ });
1770
+ }
1771
+ });
1772
+ combineLatest(this.tabs.map(tab => tab.stateChange))
1773
+ .pipe(takeUntil(race(this.tabComponentsStateChangeUnsubscribe, this.ngUnsubscribe)))
1774
+ .subscribe(() => {
1775
+ // Wait for the tab components to render changes before finding the active one.
1776
+ setTimeout(() => {
1777
+ this.updateTabsetComponent(this.tabsetService.currentActiveTabIndex, true);
1778
+ });
1779
+ });
1780
+ }
1781
+ initTabComponents() {
1782
+ this.tabs.forEach(tab => tab.init());
1783
+ }
1784
+ resetTabComponents() {
1785
+ var _a;
1786
+ this.unsubscribeTabComponentsStateChange();
1787
+ this.tabsetService.unregisterAll();
1788
+ // If there are no tab components, do a hard reset of the view.
1789
+ if (this.tabs.length === 0) {
1790
+ this.updateTabsetComponent(0, true);
1791
+ return;
1792
+ }
1793
+ this.initTabComponents();
1794
+ const activeIndex = (_a = this.getActiveTabComponent()) === null || _a === void 0 ? void 0 : _a.tabIndex;
1795
+ this.tabsetService.setActiveTabIndex(activeIndex, {
1796
+ emitChange: false
1797
+ });
1798
+ this.listenTabComponentsStateChange();
1799
+ }
1800
+ emitTabIndexChange() {
1801
+ this.tabIndexesChange.emit({
1802
+ tabs: this.tabs.map(tab => ({
1803
+ tabHeading: tab.tabHeading,
1804
+ tabIndex: tab.tabIndex
1805
+ }))
1806
+ });
1807
+ }
1808
+ unsubscribeTabComponentsStateChange() {
1809
+ this.tabComponentsStateChangeUnsubscribe.next();
1810
+ this.tabComponentsStateChangeUnsubscribe.complete();
1811
+ this.tabComponentsStateChangeUnsubscribe = new Subject();
1812
+ }
1813
+ listenTabButtonsOverflowChange() {
1814
+ this.adapterService.registerTabset(this.elementRef);
1815
+ this.adapterService.overflowChange
1816
+ .pipe(takeUntil(this.ngUnsubscribe))
1817
+ .subscribe(isOverflowing => {
1818
+ this.tabDisplayMode = (isOverflowing) ? 'dropdown' : 'tabs';
1819
+ this.changeDetector.markForCheck();
1820
+ });
1821
+ }
1822
+ /**
1823
+ * Listen for back/forward history button presses to detect query param changes in the URL.
1824
+ */
1825
+ listenLocationPopStateChange() {
1826
+ this.permalinkService.popStateChange
1827
+ .pipe(takeUntil(this.ngUnsubscribe))
1828
+ .subscribe(() => {
1829
+ this.setActiveTabIndexByPermalinkId();
1830
+ });
1831
+ }
1832
+ setActiveTabIndexByPermalinkId() {
1833
+ const activeIndex = this.getActiveTabIndexByPermalinkId();
1834
+ this.tabsetService.setActiveTabIndex(activeIndex);
1835
+ }
1836
+ getActiveTabIndexByPermalinkId() {
1837
+ var _a;
1838
+ if (this.permalinkId) {
1839
+ const paramValue = this.permalinkService.getParam(this.permalinkId);
1840
+ if (paramValue) {
1841
+ return (_a = this.tabs.find(tab => tab.permalinkValue === paramValue)) === null || _a === void 0 ? void 0 : _a.tabIndex;
1842
+ }
1843
+ }
1844
+ }
1845
+ getActiveTabComponent() {
1846
+ return this.tabs.toArray().reverse().find(tab => tab.active === true);
1847
+ }
1848
+ createTabButtons(activeIndex) {
1849
+ return this.tabs.map(tab => ({
1850
+ active: this.tabsetService.tabIndexesEqual(tab.tabIndex, activeIndex),
1851
+ closeable: tab.closeable,
1852
+ ariaControls: tab.tabPanelId,
1853
+ disabled: tab.disabled,
1854
+ /*tslint:disable-next-line:no-null-keyword*/
1855
+ buttonHref: (tab.disabled) ? null : this.permalinkService.getParamHref(this.permalinkId, tab.permalinkValue),
1856
+ buttonId: tab.tabButtonId,
1857
+ buttonTextCount: tab.tabHeaderCount,
1858
+ buttonText: tab.tabHeading,
1859
+ tabIndex: tab.tabIndex
1860
+ }));
1861
+ }
1862
+ updateTabButtons(activeIndex) {
1863
+ this.tabButtons.forEach(button => {
1864
+ button.active = this.tabsetService.tabIndexesEqual(button.tabIndex, activeIndex);
1865
+ });
1866
+ }
1867
+ /**
1868
+ * Updates the UI and state of the tabset component after the tab index or
1869
+ * tab components have changed.
1870
+ * @param activeIndex The currently active tab index.
1871
+ * @param regenerateTabButtons Indicates if tab button view models should be regenerated.
1872
+ * Setting this value to `false` will simply update the existing tab buttons. Setting this value
1873
+ * to `true` is only necessary when the underlying tab components have changed and the tab
1874
+ * buttons must reflect those changes.
1875
+ */
1876
+ updateTabsetComponent(activeIndex, regenerateTabButtons = false) {
1877
+ var _a;
1878
+ // Activate/deactivate tab components.
1879
+ this.tabs.forEach(tab => {
1880
+ this.tabsetService.tabIndexesEqual(tab.tabIndex, activeIndex)
1881
+ ? tab.activate()
1882
+ : tab.deactivate();
1883
+ });
1884
+ // Update the tab button models.
1885
+ if (regenerateTabButtons || !this.tabButtons.length) {
1886
+ this.tabButtons = this.createTabButtons(activeIndex);
1887
+ }
1888
+ else {
1889
+ this.updateTabButtons(activeIndex);
1890
+ }
1891
+ // Update the dropdown trigger button text.
1892
+ this.dropdownTriggerButtonText = (_a = this.tabButtons.find(b => {
1893
+ return this.tabsetService.tabIndexesEqual(b.tabIndex, activeIndex);
1894
+ })) === null || _a === void 0 ? void 0 : _a.buttonText;
1895
+ // Set the query params based on active tab.
1896
+ if (this.permalinkId) {
1897
+ const activeTabComponent = this.tabs.find(tab => {
1898
+ return this.tabsetService.tabIndexesEqual(tab.tabIndex, activeIndex);
1899
+ });
1900
+ this.permalinkService.setParam(this.permalinkId, activeTabComponent.permalinkValue);
1901
+ }
1902
+ // Wait for tab button view models to render before gauging dimensions.
1903
+ setTimeout(() => {
1904
+ this.adapterService.detectOverflow();
1905
+ });
1906
+ this.changeDetector.markForCheck();
1907
+ // Emit the new active index value to consumers.
1908
+ if (this.lastActiveTabIndex !== activeIndex) {
1909
+ this.lastActiveTabIndex = activeIndex;
1910
+ this.activeChange.emit(activeIndex);
1911
+ }
1912
+ }
1913
+ };
1914
+ SkyTabsetComponent.ctorParameters = () => [
1915
+ { type: ChangeDetectorRef },
1916
+ { type: ElementRef },
1917
+ { type: SkyTabsetAdapterService },
1918
+ { type: SkyTabsetPermalinkService },
1919
+ { type: SkyTabsetService }
1920
+ ];
1921
+ __decorate([
1922
+ Input()
1923
+ ], SkyTabsetComponent.prototype, "active", null);
1924
+ __decorate([
1925
+ Input()
1926
+ ], SkyTabsetComponent.prototype, "ariaLabel", void 0);
1927
+ __decorate([
1928
+ Input()
1929
+ ], SkyTabsetComponent.prototype, "ariaLabelledBy", void 0);
1930
+ __decorate([
1931
+ Input()
1932
+ ], SkyTabsetComponent.prototype, "permalinkId", null);
1933
+ __decorate([
1934
+ Input()
1935
+ ], SkyTabsetComponent.prototype, "tabStyle", null);
1936
+ __decorate([
1937
+ Output()
1938
+ ], SkyTabsetComponent.prototype, "activeChange", void 0);
1939
+ __decorate([
1940
+ Output()
1941
+ ], SkyTabsetComponent.prototype, "newTab", void 0);
1942
+ __decorate([
1943
+ Output()
1944
+ ], SkyTabsetComponent.prototype, "openTab", void 0);
1945
+ __decorate([
1946
+ Output()
1947
+ ], SkyTabsetComponent.prototype, "tabIndexesChange", void 0);
1948
+ __decorate([
1949
+ ContentChildren(SkyTabComponent)
1950
+ ], SkyTabsetComponent.prototype, "tabs", void 0);
1951
+ SkyTabsetComponent = __decorate([
1952
+ Component({
1953
+ selector: 'sky-tabset',
1954
+ template: "<div\n class=\"sky-tabset\"\n role=\"tablist\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [ngClass]=\"'sky-tabset-mode-' + tabDisplayMode + ' sky-tabset-style-' + tabStyle\"\n (window:resize)=\"onWindowResize()\"\n>\n <span class=\"sky-tabset-dropdown\">\n <sky-dropdown *ngIf=\"tabDisplayMode === 'dropdown'\"\n buttonType=\"tab\"\n >\n <sky-dropdown-button>\n {{ dropdownTriggerButtonText }}\n </sky-dropdown-button>\n <sky-dropdown-menu>\n <sky-dropdown-item *ngFor=\"let tabButton of tabButtons\"\n class=\"sky-tab-dropdown-menu-item\"\n >\n <div\n class=\"sky-tab-dropdown-item\"\n [ngClass]=\"{\n 'sky-tab-dropdown-item-selected': tabButton.active\n }\"\n >\n <ng-container *ngTemplateOutlet=\"tabButtonTemplate; context: {\n $implicit: tabButton\n }\"></ng-container>\n </div>\n </sky-dropdown-item>\n </sky-dropdown-menu>\n </sky-dropdown>\n </span>\n <span\n class=\"sky-tabset-tabs\"\n >\n <ng-container *ngFor=\"let tabButton of tabButtons\">\n <ng-container *ngTemplateOutlet=\"tabButtonTemplate; context: {\n $implicit: tabButton\n }\"></ng-container>\n </ng-container>\n </span>\n <span\n class=\"sky-tabset-btns\"\n >\n <button *ngIf=\"newTab.observers.length > 0\"\n class=\"sky-btn sky-btn-icon sky-tabset-btn-new sky-margin-inline-compact\"\n type=\"button\"\n [attr.aria-label]=\"'skyux_tab_add' | skyLibResources\"\n [skyThemeClass]=\"{\n 'sky-margin-inline-sm': 'modern'\n }\"\n (click)=\"onNewTabClick()\"\n >\n <sky-icon\n icon=\"plus-circle\"\n size=\"lg\"\n >\n </sky-icon>\n </button>\n <button *ngIf=\"openTab.observers.length > 0\"\n class=\"sky-btn sky-btn-icon sky-tabset-btn-open sky-margin-inline-compact\"\n type=\"button\"\n [attr.aria-label]=\"'skyux_tab_open' | skyLibResources\"\n [skyThemeClass]=\"{\n 'sky-margin-inline-sm': 'modern'\n }\"\n (click)=\"onOpenTabClick()\"\n >\n <sky-icon\n icon=\"folder-open-o\"\n size=\"lg\"\n >\n </sky-icon>\n </button>\n </span>\n</div>\n<ng-content></ng-content>\n\n<ng-template\n let-tabButton\n #tabButtonTemplate\n>\n <sky-tab-button\n [active]=\"tabButton.active\"\n [ariaControls]=\"tabButton.ariaControls\"\n [buttonHref]=\"tabButton.buttonHref\"\n [buttonId]=\"tabButton.buttonId\"\n [buttonText]=\"tabButton.buttonText\"\n [buttonTextCount]=\"tabButton.buttonTextCount\"\n [closeable]=\"tabButton.closeable\"\n [disabled]=\"tabButton.disabled\"\n [tabStyle]=\"tabStyle\"\n (buttonClick)=\"onTabButtonClick(tabButton)\"\n (closeClick)=\"onTabCloseClick(tabButton)\"\n ></sky-tab-button>\n</ng-template>\n",
1955
+ providers: [
1956
+ SkyTabsetAdapterService,
1957
+ SkyTabsetPermalinkService,
1958
+ SkyTabsetService
1959
+ ],
1960
+ changeDetection: ChangeDetectionStrategy.OnPush,
1961
+ encapsulation: ViewEncapsulation.None,
1962
+ styles: [".sky-tabset{align-items:center;border-bottom:2px solid #0974a1;display:flex;list-style-type:none;margin:0;overflow:hidden;padding:0 0 0 15px;white-space:nowrap}.sky-tabset.sky-tabset-style-wizard{border-bottom:none;padding-bottom:10px;padding-left:0}.sky-tabset-btns{order:1;padding-left:10px}.sky-tabset-dropdown{order:0;max-width:100%}.sky-tabset-mode-dropdown{line-height:0}.sky-tabset-mode-dropdown .sky-tabset-tabs{visibility:hidden;order:2}.sky-tab-dropdown-menu-item sky-tab-button{display:flex;min-width:300px}.sky-tab-dropdown-menu-item .sky-dropdown-item{margin:0}.sky-tab-dropdown-menu-item .sky-btn-tab-wrapper{width:100%;margin-right:0}.sky-tab-dropdown-menu-item .sky-btn-tab{margin:0;border-radius:0;width:100%;display:flex}.sky-tab-dropdown-menu-item .sky-btn-tab>.sky-tab-heading{flex:1 1 auto}.sky-tab-dropdown-menu-item .sky-btn-tab>.sky-btn-tab-close{flex:0 1 auto}.sky-tabset-tabs{order:0;white-space:nowrap}.sky-tabset-btn-new,.sky-tabset-btn-open{color:#0974a1}.sky-theme-modern .sky-tabset{border-bottom:1px solid #d2d2d2;overflow:visible}.sky-theme-modern .sky-tab-dropdown-menu-item .sky-btn-tab-wrapper{margin-right:0}"]
1963
+ })
1964
+ ], SkyTabsetComponent);
1965
+
1966
+ let SkyTabsModule = class SkyTabsModule {
1967
+ };
1968
+ SkyTabsModule = __decorate([
1969
+ NgModule({
1970
+ declarations: [
1971
+ SkyTabButtonComponent,
1972
+ SkyTabComponent,
1973
+ SkyTabsetComponent,
1974
+ SkyTabsetNavButtonComponent
1975
+ ],
1976
+ imports: [
1977
+ CommonModule,
1978
+ RouterModule,
1979
+ SkyDropdownModule,
1980
+ SkyI18nModule,
1981
+ SkyIconModule,
1982
+ SkyTabsResourcesModule,
1983
+ SkyThemeModule
1984
+ ],
1985
+ exports: [
1986
+ SkyTabComponent,
1987
+ SkyTabsetComponent,
1988
+ SkyTabsetNavButtonComponent
1989
+ ]
1990
+ })
1991
+ ], SkyTabsModule);
1992
+
1993
+ /**
1994
+ * Generated bundle index. Do not edit.
1995
+ */
1996
+
1997
+ export { SkySectionedFormComponent, SkySectionedFormModule, SkySectionedFormService, SkyTabsModule, SkyVerticalTabsetModule, VISIBLE_STATE as ɵa, HIDDEN_STATE as ɵb, SkyVerticalTabsetService as ɵc, SkySectionedFormSectionComponent as ɵd, SkyVerticalTabComponent as ɵe, SkyVerticalTabMediaQueryService as ɵf, SkyVerticalTabsetAdapterService as ɵg, SkyVerticalTabsetComponent as ɵh, SkyVerticalTabsetGroupComponent as ɵi, SkyTabsResourcesModule as ɵj, SkyTabsResourcesProvider as ɵk, SkyTabButtonComponent as ɵl, SkyTabComponent as ɵm, SkyTabsetPermalinkService as ɵn, SkyTabsetService as ɵo, SkyTabsetComponent as ɵp, SkyTabsetAdapterService as ɵq, SkyTabsetNavButtonComponent as ɵr };
1998
+ //# sourceMappingURL=skyux-tabs.js.map