@angular/material 13.2.0-next.0 → 13.2.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/core/focus-indicators/_focus-indicators.scss +4 -0
- package/core/option/index.d.ts +1 -1
- package/core/selection/index.d.ts +8 -8
- package/core/selection/pseudo-checkbox/pseudo-checkbox-module.d.ts +8 -0
- package/esm2020/core/common-behaviors/common-module.mjs +1 -1
- package/esm2020/core/selection/index.mjs +2 -18
- package/esm2020/core/selection/pseudo-checkbox/pseudo-checkbox-module.mjs +25 -0
- package/esm2020/core/version.mjs +1 -1
- package/esm2020/datepicker/calendar-body.mjs +3 -3
- package/esm2020/menu/menu-content.mjs +2 -4
- package/esm2020/menu/menu-item.mjs +4 -17
- package/esm2020/menu/menu-trigger.mjs +3 -6
- package/esm2020/stepper/step-header.mjs +2 -2
- package/esm2020/table/table.mjs +2 -2
- package/esm2020/tabs/public-api.mjs +2 -2
- package/esm2020/tabs/tab-nav-bar/tab-nav-bar.mjs +89 -7
- package/esm2020/tabs/tabs-module.mjs +6 -2
- package/esm2020/tabs/testing/tab-harness-filters.mjs +1 -1
- package/esm2020/tabs/testing/tab-nav-bar-harness.mjs +13 -1
- package/esm2020/tabs/testing/tab-nav-panel-harness.mjs +27 -0
- package/fesm2015/core.mjs +10 -2
- package/fesm2015/core.mjs.map +1 -1
- package/fesm2015/datepicker.mjs +2 -2
- package/fesm2015/datepicker.mjs.map +1 -1
- package/fesm2015/menu.mjs +7 -23
- package/fesm2015/menu.mjs.map +1 -1
- package/fesm2015/stepper.mjs +2 -2
- package/fesm2015/table.mjs +2 -2
- package/fesm2015/tabs/testing.mjs +34 -0
- package/fesm2015/tabs/testing.mjs.map +1 -1
- package/fesm2015/tabs.mjs +93 -7
- package/fesm2015/tabs.mjs.map +1 -1
- package/fesm2020/core.mjs +10 -2
- package/fesm2020/core.mjs.map +1 -1
- package/fesm2020/datepicker.mjs +2 -2
- package/fesm2020/datepicker.mjs.map +1 -1
- package/fesm2020/menu.mjs +5 -23
- package/fesm2020/menu.mjs.map +1 -1
- package/fesm2020/stepper.mjs +2 -2
- package/fesm2020/table.mjs +2 -2
- package/fesm2020/tabs/testing.mjs +37 -0
- package/fesm2020/tabs/testing.mjs.map +1 -1
- package/fesm2020/tabs.mjs +92 -7
- package/fesm2020/tabs.mjs.map +1 -1
- package/menu/menu-content.d.ts +5 -1
- package/menu/menu-item.d.ts +3 -12
- package/menu/menu-trigger.d.ts +6 -2
- package/package.json +3 -2
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-update/migrations/hammer-gestures-v9/import-manager.js +1 -2
- package/schematics/ng-update/migrations/hammer-gestures-v9/import-manager.mjs +1 -2
- package/table/_table-flex-styles.scss +0 -9
- package/tabs/public-api.d.ts +1 -1
- package/tabs/tab-nav-bar/tab-nav-bar.d.ts +29 -2
- package/tabs/tabs-module.d.ts +1 -1
- package/tabs/testing/tab-harness-filters.d.ts +3 -0
- package/tabs/testing/tab-nav-bar-harness.d.ts +3 -0
- package/tabs/testing/tab-nav-panel-harness.d.ts +23 -0
|
@@ -159,6 +159,32 @@ class MatTabLinkHarness extends ComponentHarness {
|
|
|
159
159
|
/** The selector for the host element of a `MatTabLink` instance. */
|
|
160
160
|
MatTabLinkHarness.hostSelector = '.mat-tab-link';
|
|
161
161
|
|
|
162
|
+
/**
|
|
163
|
+
* @license
|
|
164
|
+
* Copyright Google LLC All Rights Reserved.
|
|
165
|
+
*
|
|
166
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
167
|
+
* found in the LICENSE file at https://angular.io/license
|
|
168
|
+
*/
|
|
169
|
+
/** Harness for interacting with a standard mat-tab-nav-panel in tests. */
|
|
170
|
+
class MatTabNavPanelHarness extends ContentContainerComponentHarness {
|
|
171
|
+
/**
|
|
172
|
+
* Gets a `HarnessPredicate` that can be used to search for a `MatTabNavPanel` that meets
|
|
173
|
+
* certain criteria.
|
|
174
|
+
* @param options Options for filtering which tab nav panel instances are considered a match.
|
|
175
|
+
* @return a `HarnessPredicate` configured with the given options.
|
|
176
|
+
*/
|
|
177
|
+
static with(options = {}) {
|
|
178
|
+
return new HarnessPredicate(MatTabNavPanelHarness, options);
|
|
179
|
+
}
|
|
180
|
+
/** Gets the tab panel text content. */
|
|
181
|
+
async getTextContent() {
|
|
182
|
+
return (await this.host()).text();
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/** The selector for the host element of a `MatTabNavPanel` instance. */
|
|
186
|
+
MatTabNavPanelHarness.hostSelector = '.mat-tab-nav-panel';
|
|
187
|
+
|
|
162
188
|
/**
|
|
163
189
|
* @license
|
|
164
190
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -207,6 +233,17 @@ class MatTabNavBarHarness extends ComponentHarness {
|
|
|
207
233
|
}
|
|
208
234
|
await tabs[0].click();
|
|
209
235
|
}
|
|
236
|
+
/** Gets the panel associated with the nav bar. */
|
|
237
|
+
async getPanel() {
|
|
238
|
+
const link = await this.getActiveLink();
|
|
239
|
+
const host = await link.host();
|
|
240
|
+
const panelId = await host.getAttribute('aria-controls');
|
|
241
|
+
if (!panelId) {
|
|
242
|
+
throw Error('No panel is controlled by the nav bar.');
|
|
243
|
+
}
|
|
244
|
+
const filter = { selector: `#${panelId}` };
|
|
245
|
+
return await this.documentRootLocatorFactory().locatorFor(MatTabNavPanelHarness.with(filter))();
|
|
246
|
+
}
|
|
210
247
|
}
|
|
211
248
|
/** The selector for the host element of a `MatTabNavBar` instance. */
|
|
212
249
|
MatTabNavBarHarness.hostSelector = '.mat-tab-nav-bar';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.mjs","sources":["../../../../../../../src/material/tabs/testing/tab-harness.ts","../../../../../../../src/material/tabs/testing/tab-group-harness.ts","../../../../../../../src/material/tabs/testing/tab-link-harness.ts","../../../../../../../src/material/tabs/testing/tab-nav-bar-harness.ts","../../../../../../../src/material/tabs/testing/public-api.ts","../../../../../../../src/material/tabs/testing/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n ContentContainerComponentHarness,\n HarnessLoader,\n HarnessPredicate,\n} from '@angular/cdk/testing';\nimport {TabHarnessFilters} from './tab-harness-filters';\n\n/** Harness for interacting with a standard Angular Material tab-label in tests. */\nexport class MatTabHarness extends ContentContainerComponentHarness<string> {\n /** The selector for the host element of a `MatTab` instance. */\n static hostSelector = '.mat-tab-label';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatTabHarness` that meets\n * certain criteria.\n * @param options Options for filtering which tab instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: TabHarnessFilters = {}): HarnessPredicate<MatTabHarness> {\n return new HarnessPredicate(MatTabHarness, options).addOption(\n 'label',\n options.label,\n (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label),\n );\n }\n\n /** Gets the label of the tab. */\n async getLabel(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** Gets the aria-label of the tab. */\n async getAriaLabel(): Promise<string | null> {\n return (await this.host()).getAttribute('aria-label');\n }\n\n /** Gets the value of the \"aria-labelledby\" attribute. */\n async getAriaLabelledby(): Promise<string | null> {\n return (await this.host()).getAttribute('aria-labelledby');\n }\n\n /** Whether the tab is selected. */\n async isSelected(): Promise<boolean> {\n const hostEl = await this.host();\n return (await hostEl.getAttribute('aria-selected')) === 'true';\n }\n\n /** Whether the tab is disabled. */\n async isDisabled(): Promise<boolean> {\n const hostEl = await this.host();\n return (await hostEl.getAttribute('aria-disabled')) === 'true';\n }\n\n /** Selects the given tab by clicking on the label. Tab cannot be selected if disabled. */\n async select(): Promise<void> {\n await (await this.host()).click();\n }\n\n /** Gets the text content of the tab. */\n async getTextContent(): Promise<string> {\n const contentId = await this._getContentId();\n const contentEl = await this.documentRootLocatorFactory().locatorFor(`#${contentId}`)();\n return contentEl.text();\n }\n\n protected override async getRootHarnessLoader(): Promise<HarnessLoader> {\n const contentId = await this._getContentId();\n return this.documentRootLocatorFactory().harnessLoaderFor(`#${contentId}`);\n }\n\n /** Gets the element id for the content of the current tab. */\n private async _getContentId(): Promise<string> {\n const hostEl = await this.host();\n // Tabs never have an empty \"aria-controls\" attribute.\n return (await hostEl.getAttribute('aria-controls'))!;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ComponentHarness, HarnessPredicate, parallel} from '@angular/cdk/testing';\nimport {TabGroupHarnessFilters, TabHarnessFilters} from './tab-harness-filters';\nimport {MatTabHarness} from './tab-harness';\n\n/** Harness for interacting with a standard mat-tab-group in tests. */\nexport class MatTabGroupHarness extends ComponentHarness {\n /** The selector for the host element of a `MatTabGroup` instance. */\n static hostSelector = '.mat-tab-group';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatTabGroupHarness` that meets\n * certain criteria.\n * @param options Options for filtering which tab group instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: TabGroupHarnessFilters = {}): HarnessPredicate<MatTabGroupHarness> {\n return new HarnessPredicate(MatTabGroupHarness, options).addOption(\n 'selectedTabLabel',\n options.selectedTabLabel,\n async (harness, label) => {\n const selectedTab = await harness.getSelectedTab();\n return HarnessPredicate.stringMatches(await selectedTab.getLabel(), label);\n },\n );\n }\n\n /**\n * Gets the list of tabs in the tab group.\n * @param filter Optionally filters which tabs are included.\n */\n async getTabs(filter: TabHarnessFilters = {}): Promise<MatTabHarness[]> {\n return this.locatorForAll(MatTabHarness.with(filter))();\n }\n\n /** Gets the selected tab of the tab group. */\n async getSelectedTab(): Promise<MatTabHarness> {\n const tabs = await this.getTabs();\n const isSelected = await parallel(() => tabs.map(t => t.isSelected()));\n for (let i = 0; i < tabs.length; i++) {\n if (isSelected[i]) {\n return tabs[i];\n }\n }\n throw new Error('No selected tab could be found.');\n }\n\n /**\n * Selects a tab in this tab group.\n * @param filter An optional filter to apply to the child tabs. The first tab matching the filter\n * will be selected.\n */\n async selectTab(filter: TabHarnessFilters = {}): Promise<void> {\n const tabs = await this.getTabs(filter);\n if (!tabs.length) {\n throw Error(`Cannot find mat-tab matching filter ${JSON.stringify(filter)}`);\n }\n await tabs[0].select();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';\nimport {TabLinkHarnessFilters} from './tab-harness-filters';\n\n/** Harness for interacting with a standard Angular Material tab link in tests. */\nexport class MatTabLinkHarness extends ComponentHarness {\n /** The selector for the host element of a `MatTabLink` instance. */\n static hostSelector = '.mat-tab-link';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatTabLinkHarness` that meets\n * certain criteria.\n * @param options Options for filtering which tab link instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: TabLinkHarnessFilters = {}): HarnessPredicate<MatTabLinkHarness> {\n return new HarnessPredicate(MatTabLinkHarness, options).addOption(\n 'label',\n options.label,\n (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label),\n );\n }\n\n /** Gets the label of the link. */\n async getLabel(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** Whether the link is active. */\n async isActive(): Promise<boolean> {\n const host = await this.host();\n return host.hasClass('mat-tab-label-active');\n }\n\n /** Whether the link is disabled. */\n async isDisabled(): Promise<boolean> {\n const host = await this.host();\n return host.hasClass('mat-tab-disabled');\n }\n\n /** Clicks on the link. */\n async click(): Promise<void> {\n await (await this.host()).click();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ComponentHarness, HarnessPredicate, parallel} from '@angular/cdk/testing';\nimport {TabNavBarHarnessFilters, TabLinkHarnessFilters} from './tab-harness-filters';\nimport {MatTabLinkHarness} from './tab-link-harness';\n\n/** Harness for interacting with a standard mat-tab-nav-bar in tests. */\nexport class MatTabNavBarHarness extends ComponentHarness {\n /** The selector for the host element of a `MatTabNavBar` instance. */\n static hostSelector = '.mat-tab-nav-bar';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatTabNavBar` that meets\n * certain criteria.\n * @param options Options for filtering which tab nav bar instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: TabNavBarHarnessFilters = {}): HarnessPredicate<MatTabNavBarHarness> {\n return new HarnessPredicate(MatTabNavBarHarness, options);\n }\n\n /**\n * Gets the list of links in the nav bar.\n * @param filter Optionally filters which links are included.\n */\n async getLinks(filter: TabLinkHarnessFilters = {}): Promise<MatTabLinkHarness[]> {\n return this.locatorForAll(MatTabLinkHarness.with(filter))();\n }\n\n /** Gets the active link in the nav bar. */\n async getActiveLink(): Promise<MatTabLinkHarness> {\n const links = await this.getLinks();\n const isActive = await parallel(() => links.map(t => t.isActive()));\n for (let i = 0; i < links.length; i++) {\n if (isActive[i]) {\n return links[i];\n }\n }\n throw new Error('No active link could be found.');\n }\n\n /**\n * Clicks a link inside the nav bar.\n * @param filter An optional filter to apply to the child link. The first link matching the filter\n * will be clicked.\n */\n async clickLink(filter: TabLinkHarnessFilters = {}): Promise<void> {\n const tabs = await this.getLinks(filter);\n if (!tabs.length) {\n throw Error(`Cannot find mat-tab-link matching filter ${JSON.stringify(filter)}`);\n }\n await tabs[0].click();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './tab-group-harness';\nexport * from './tab-harness';\nexport * from './tab-harness-filters';\nexport * from './tab-nav-bar-harness';\nexport * from './tab-link-harness';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;;;AAeA;MACa,aAAc,SAAQ,gCAAwC;;;;;;;IAUzE,OAAO,IAAI,CAAC,UAA6B,EAAE;QACzC,OAAO,IAAI,gBAAgB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS,CAC3D,OAAO,EACP,OAAO,CAAC,KAAK,EACb,CAAC,OAAO,EAAE,KAAK,KAAK,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,CAC9E,CAAC;KACH;;IAGD,MAAM,QAAQ;QACZ,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC;KACnC;;IAGD,MAAM,YAAY;QAChB,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC;KACvD;;IAGD,MAAM,iBAAiB;QACrB,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,iBAAiB,CAAC,CAAC;KAC5D;;IAGD,MAAM,UAAU;QACd,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QACjC,OAAO,CAAC,MAAM,MAAM,CAAC,YAAY,CAAC,eAAe,CAAC,MAAM,MAAM,CAAC;KAChE;;IAGD,MAAM,UAAU;QACd,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QACjC,OAAO,CAAC,MAAM,MAAM,CAAC,YAAY,CAAC,eAAe,CAAC,MAAM,MAAM,CAAC;KAChE;;IAGD,MAAM,MAAM;QACV,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC;KACnC;;IAGD,MAAM,cAAc;QAClB,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,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K,CAAC,4CAA4C,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;SACnF;QACD,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;KACvB;;AA5CD;AACO,gCAAY,GAAG,kBAAkB;;ACf1C;;;;;;;;ACAA;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"testing.mjs","sources":["../../../../../../../src/material/tabs/testing/tab-harness.ts","../../../../../../../src/material/tabs/testing/tab-group-harness.ts","../../../../../../../src/material/tabs/testing/tab-link-harness.ts","../../../../../../../src/material/tabs/testing/tab-nav-panel-harness.ts","../../../../../../../src/material/tabs/testing/tab-nav-bar-harness.ts","../../../../../../../src/material/tabs/testing/public-api.ts","../../../../../../../src/material/tabs/testing/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n ContentContainerComponentHarness,\n HarnessLoader,\n HarnessPredicate,\n} from '@angular/cdk/testing';\nimport {TabHarnessFilters} from './tab-harness-filters';\n\n/** Harness for interacting with a standard Angular Material tab-label in tests. */\nexport class MatTabHarness extends ContentContainerComponentHarness<string> {\n /** The selector for the host element of a `MatTab` instance. */\n static hostSelector = '.mat-tab-label';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatTabHarness` that meets\n * certain criteria.\n * @param options Options for filtering which tab instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: TabHarnessFilters = {}): HarnessPredicate<MatTabHarness> {\n return new HarnessPredicate(MatTabHarness, options).addOption(\n 'label',\n options.label,\n (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label),\n );\n }\n\n /** Gets the label of the tab. */\n async getLabel(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** Gets the aria-label of the tab. */\n async getAriaLabel(): Promise<string | null> {\n return (await this.host()).getAttribute('aria-label');\n }\n\n /** Gets the value of the \"aria-labelledby\" attribute. */\n async getAriaLabelledby(): Promise<string | null> {\n return (await this.host()).getAttribute('aria-labelledby');\n }\n\n /** Whether the tab is selected. */\n async isSelected(): Promise<boolean> {\n const hostEl = await this.host();\n return (await hostEl.getAttribute('aria-selected')) === 'true';\n }\n\n /** Whether the tab is disabled. */\n async isDisabled(): Promise<boolean> {\n const hostEl = await this.host();\n return (await hostEl.getAttribute('aria-disabled')) === 'true';\n }\n\n /** Selects the given tab by clicking on the label. Tab cannot be selected if disabled. */\n async select(): Promise<void> {\n await (await this.host()).click();\n }\n\n /** Gets the text content of the tab. */\n async getTextContent(): Promise<string> {\n const contentId = await this._getContentId();\n const contentEl = await this.documentRootLocatorFactory().locatorFor(`#${contentId}`)();\n return contentEl.text();\n }\n\n protected override async getRootHarnessLoader(): Promise<HarnessLoader> {\n const contentId = await this._getContentId();\n return this.documentRootLocatorFactory().harnessLoaderFor(`#${contentId}`);\n }\n\n /** Gets the element id for the content of the current tab. */\n private async _getContentId(): Promise<string> {\n const hostEl = await this.host();\n // Tabs never have an empty \"aria-controls\" attribute.\n return (await hostEl.getAttribute('aria-controls'))!;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ComponentHarness, HarnessPredicate, parallel} from '@angular/cdk/testing';\nimport {TabGroupHarnessFilters, TabHarnessFilters} from './tab-harness-filters';\nimport {MatTabHarness} from './tab-harness';\n\n/** Harness for interacting with a standard mat-tab-group in tests. */\nexport class MatTabGroupHarness extends ComponentHarness {\n /** The selector for the host element of a `MatTabGroup` instance. */\n static hostSelector = '.mat-tab-group';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatTabGroupHarness` that meets\n * certain criteria.\n * @param options Options for filtering which tab group instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: TabGroupHarnessFilters = {}): HarnessPredicate<MatTabGroupHarness> {\n return new HarnessPredicate(MatTabGroupHarness, options).addOption(\n 'selectedTabLabel',\n options.selectedTabLabel,\n async (harness, label) => {\n const selectedTab = await harness.getSelectedTab();\n return HarnessPredicate.stringMatches(await selectedTab.getLabel(), label);\n },\n );\n }\n\n /**\n * Gets the list of tabs in the tab group.\n * @param filter Optionally filters which tabs are included.\n */\n async getTabs(filter: TabHarnessFilters = {}): Promise<MatTabHarness[]> {\n return this.locatorForAll(MatTabHarness.with(filter))();\n }\n\n /** Gets the selected tab of the tab group. */\n async getSelectedTab(): Promise<MatTabHarness> {\n const tabs = await this.getTabs();\n const isSelected = await parallel(() => tabs.map(t => t.isSelected()));\n for (let i = 0; i < tabs.length; i++) {\n if (isSelected[i]) {\n return tabs[i];\n }\n }\n throw new Error('No selected tab could be found.');\n }\n\n /**\n * Selects a tab in this tab group.\n * @param filter An optional filter to apply to the child tabs. The first tab matching the filter\n * will be selected.\n */\n async selectTab(filter: TabHarnessFilters = {}): Promise<void> {\n const tabs = await this.getTabs(filter);\n if (!tabs.length) {\n throw Error(`Cannot find mat-tab matching filter ${JSON.stringify(filter)}`);\n }\n await tabs[0].select();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';\nimport {TabLinkHarnessFilters} from './tab-harness-filters';\n\n/** Harness for interacting with a standard Angular Material tab link in tests. */\nexport class MatTabLinkHarness extends ComponentHarness {\n /** The selector for the host element of a `MatTabLink` instance. */\n static hostSelector = '.mat-tab-link';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatTabLinkHarness` that meets\n * certain criteria.\n * @param options Options for filtering which tab link instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: TabLinkHarnessFilters = {}): HarnessPredicate<MatTabLinkHarness> {\n return new HarnessPredicate(MatTabLinkHarness, options).addOption(\n 'label',\n options.label,\n (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label),\n );\n }\n\n /** Gets the label of the link. */\n async getLabel(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** Whether the link is active. */\n async isActive(): Promise<boolean> {\n const host = await this.host();\n return host.hasClass('mat-tab-label-active');\n }\n\n /** Whether the link is disabled. */\n async isDisabled(): Promise<boolean> {\n const host = await this.host();\n return host.hasClass('mat-tab-disabled');\n }\n\n /** Clicks on the link. */\n async click(): Promise<void> {\n await (await this.host()).click();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ContentContainerComponentHarness, HarnessPredicate} from '@angular/cdk/testing';\nimport {TabNavPanelHarnessFilters} from './tab-harness-filters';\n\n/** Harness for interacting with a standard mat-tab-nav-panel in tests. */\nexport class MatTabNavPanelHarness extends ContentContainerComponentHarness {\n /** The selector for the host element of a `MatTabNavPanel` instance. */\n static hostSelector = '.mat-tab-nav-panel';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatTabNavPanel` that meets\n * certain criteria.\n * @param options Options for filtering which tab nav panel instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: TabNavPanelHarnessFilters = {}): HarnessPredicate<MatTabNavPanelHarness> {\n return new HarnessPredicate(MatTabNavPanelHarness, options);\n }\n\n /** Gets the tab panel text content. */\n async getTextContent(): Promise<string> {\n return (await this.host()).text();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ComponentHarness, HarnessPredicate, parallel} from '@angular/cdk/testing';\nimport {\n TabNavBarHarnessFilters,\n TabNavPanelHarnessFilters,\n TabLinkHarnessFilters,\n} from './tab-harness-filters';\nimport {MatTabLinkHarness} from './tab-link-harness';\nimport {MatTabNavPanelHarness} from './tab-nav-panel-harness';\n\n/** Harness for interacting with a standard mat-tab-nav-bar in tests. */\nexport class MatTabNavBarHarness extends ComponentHarness {\n /** The selector for the host element of a `MatTabNavBar` instance. */\n static hostSelector = '.mat-tab-nav-bar';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatTabNavBar` that meets\n * certain criteria.\n * @param options Options for filtering which tab nav bar instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: TabNavBarHarnessFilters = {}): HarnessPredicate<MatTabNavBarHarness> {\n return new HarnessPredicate(MatTabNavBarHarness, options);\n }\n\n /**\n * Gets the list of links in the nav bar.\n * @param filter Optionally filters which links are included.\n */\n async getLinks(filter: TabLinkHarnessFilters = {}): Promise<MatTabLinkHarness[]> {\n return this.locatorForAll(MatTabLinkHarness.with(filter))();\n }\n\n /** Gets the active link in the nav bar. */\n async getActiveLink(): Promise<MatTabLinkHarness> {\n const links = await this.getLinks();\n const isActive = await parallel(() => links.map(t => t.isActive()));\n for (let i = 0; i < links.length; i++) {\n if (isActive[i]) {\n return links[i];\n }\n }\n throw new Error('No active link could be found.');\n }\n\n /**\n * Clicks a link inside the nav bar.\n * @param filter An optional filter to apply to the child link. The first link matching the filter\n * will be clicked.\n */\n async clickLink(filter: TabLinkHarnessFilters = {}): Promise<void> {\n const tabs = await this.getLinks(filter);\n if (!tabs.length) {\n throw Error(`Cannot find mat-tab-link matching filter ${JSON.stringify(filter)}`);\n }\n await tabs[0].click();\n }\n\n /** Gets the panel associated with the nav bar. */\n async getPanel(): Promise<MatTabNavPanelHarness> {\n const link = await this.getActiveLink();\n const host = await link.host();\n const panelId = await host.getAttribute('aria-controls');\n if (!panelId) {\n throw Error('No panel is controlled by the nav bar.');\n }\n\n const filter: TabNavPanelHarnessFilters = {selector: `#${panelId}`};\n return await this.documentRootLocatorFactory().locatorFor(MatTabNavPanelHarness.with(filter))();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './tab-group-harness';\nexport * from './tab-harness';\nexport * from './tab-harness-filters';\nexport * from './tab-nav-bar-harness';\nexport * from './tab-link-harness';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;;;AAeA;MACa,aAAc,SAAQ,gCAAwC;;;;;;;IAUzE,OAAO,IAAI,CAAC,UAA6B,EAAE;QACzC,OAAO,IAAI,gBAAgB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS,CAC3D,OAAO,EACP,OAAO,CAAC,KAAK,EACb,CAAC,OAAO,EAAE,KAAK,KAAK,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,CAC9E,CAAC;KACH;;IAGD,MAAM,QAAQ;QACZ,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC;KACnC;;IAGD,MAAM,YAAY;QAChB,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC;KACvD;;IAGD,MAAM,iBAAiB;QACrB,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,iBAAiB,CAAC,CAAC;KAC5D;;IAGD,MAAM,UAAU;QACd,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QACjC,OAAO,CAAC,MAAM,MAAM,CAAC,YAAY,CAAC,eAAe,CAAC,MAAM,MAAM,CAAC;KAChE;;IAGD,MAAM,UAAU;QACd,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QACjC,OAAO,CAAC,MAAM,MAAM,CAAC,YAAY,CAAC,eAAe,CAAC,MAAM,MAAM,CAAC;KAChE;;IAGD,M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etadata({ minVersion: "12.0.0", version: "13.1.0", ngImpor
|
|
|
1537
1537
|
* Use of this source code is governed by an MIT-style license that can be
|
|
1538
1538
|
* found in the LICENSE file at https://angular.io/license
|
|
1539
1539
|
*/
|
|
1540
|
+
// Increasing integer for generating unique ids for tab nav components.
|
|
1541
|
+
let nextUniqueId = 0;
|
|
1540
1542
|
/**
|
|
1541
1543
|
* Base class with all of the `MatTabNav` functionality.
|
|
1542
1544
|
* @docs-private
|
|
@@ -1588,6 +1590,9 @@ class _MatTabNavBase extends MatPaginatedTabHeader {
|
|
|
1588
1590
|
if (items[i].active) {
|
|
1589
1591
|
this.selectedIndex = i;
|
|
1590
1592
|
this._changeDetectorRef.markForCheck();
|
|
1593
|
+
if (this.tabPanel) {
|
|
1594
|
+
this.tabPanel._activeTabId = items[i].id;
|
|
1595
|
+
}
|
|
1591
1596
|
return;
|
|
1592
1597
|
}
|
|
1593
1598
|
}
|
|
@@ -1595,9 +1600,12 @@ class _MatTabNavBase extends MatPaginatedTabHeader {
|
|
|
1595
1600
|
this.selectedIndex = -1;
|
|
1596
1601
|
this._inkBar.hide();
|
|
1597
1602
|
}
|
|
1603
|
+
_getRole() {
|
|
1604
|
+
return this.tabPanel ? 'tablist' : this._elementRef.nativeElement.getAttribute('role');
|
|
1605
|
+
}
|
|
1598
1606
|
}
|
|
1599
1607
|
_MatTabNavBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: _MatTabNavBase, deps: [{ token: i0.ElementRef }, { token: i1.Directionality, optional: true }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }, { token: i1$1.ViewportRuler }, { token: i3.Platform }, { token: ANIMATION_MODULE_TYPE, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1600
|
-
_MatTabNavBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.0", type: _MatTabNavBase, inputs: { backgroundColor: "backgroundColor", disableRipple: "disableRipple", color: "color" }, usesInheritance: true, ngImport: i0 });
|
|
1608
|
+
_MatTabNavBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.0", type: _MatTabNavBase, inputs: { backgroundColor: "backgroundColor", disableRipple: "disableRipple", color: "color", tabPanel: "tabPanel" }, usesInheritance: true, ngImport: i0 });
|
|
1601
1609
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: _MatTabNavBase, decorators: [{
|
|
1602
1610
|
type: Directive
|
|
1603
1611
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.Directionality, decorators: [{
|
|
@@ -1613,6 +1621,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImpor
|
|
|
1613
1621
|
type: Input
|
|
1614
1622
|
}], color: [{
|
|
1615
1623
|
type: Input
|
|
1624
|
+
}], tabPanel: [{
|
|
1625
|
+
type: Input
|
|
1616
1626
|
}] } });
|
|
1617
1627
|
/**
|
|
1618
1628
|
* Navigation component matching the styles of the tab group header.
|
|
@@ -1624,10 +1634,11 @@ class MatTabNav extends _MatTabNavBase {
|
|
|
1624
1634
|
}
|
|
1625
1635
|
}
|
|
1626
1636
|
MatTabNav.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: MatTabNav, deps: [{ token: i0.ElementRef }, { token: i1.Directionality, optional: true }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }, { token: i1$1.ViewportRuler }, { token: i3.Platform }, { token: ANIMATION_MODULE_TYPE, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
1627
|
-
MatTabNav.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.0", type: MatTabNav, selector: "[mat-tab-nav-bar]", inputs: { color: "color" }, host: { properties: { "class.mat-tab-header-pagination-controls-enabled": "_showPaginationControls", "class.mat-tab-header-rtl": "_getLayoutDirection() == 'rtl'", "class.mat-primary": "color !== \"warn\" && color !== \"accent\"", "class.mat-accent": "color === \"accent\"", "class.mat-warn": "color === \"warn\"" }, classAttribute: "mat-tab-nav-bar mat-tab-header" }, queries: [{ propertyName: "_items", predicate: i0.forwardRef(function () { return MatTabLink; }), descendants: true }], viewQueries: [{ propertyName: "_inkBar", first: true, predicate: MatInkBar, descendants: true, static: true }, { propertyName: "_tabListContainer", first: true, predicate: ["tabListContainer"], descendants: true, static: true }, { propertyName: "_tabList", first: true, predicate: ["tabList"], descendants: true, static: true }, { propertyName: "_tabListInner", first: true, predicate: ["tabListInner"], descendants: true, static: true }, { propertyName: "_nextPaginator", first: true, predicate: ["nextPaginator"], descendants: true }, { propertyName: "_previousPaginator", first: true, predicate: ["previousPaginator"], descendants: true }], exportAs: ["matTabNavBar", "matTabNav"], usesInheritance: true, ngImport: i0, template: "<div class=\"mat-tab-header-pagination mat-tab-header-pagination-before mat-elevation-z4\"\n #previousPaginator\n aria-hidden=\"true\"\n mat-ripple [matRippleDisabled]=\"_disableScrollBefore || disableRipple\"\n [class.mat-tab-header-pagination-disabled]=\"_disableScrollBefore\"\n (click)=\"_handlePaginatorClick('before')\"\n (mousedown)=\"_handlePaginatorPress('before', $event)\"\n (touchend)=\"_stopInterval()\">\n <div class=\"mat-tab-header-pagination-chevron\"></div>\n</div>\n\n<div class=\"mat-tab-link-container\" #tabListContainer (keydown)=\"_handleKeydown($event)\">\n <div\n class=\"mat-tab-list\"\n [class._mat-animation-noopable]=\"_animationMode === 'NoopAnimations'\"\n #tabList\n (cdkObserveContent)=\"_onContentChanges()\">\n <div class=\"mat-tab-links\" #tabListInner>\n <ng-content></ng-content>\n </div>\n <mat-ink-bar></mat-ink-bar>\n </div>\n</div>\n\n<div class=\"mat-tab-header-pagination mat-tab-header-pagination-after mat-elevation-z4\"\n #nextPaginator\n aria-hidden=\"true\"\n mat-ripple [matRippleDisabled]=\"_disableScrollAfter || disableRipple\"\n [class.mat-tab-header-pagination-disabled]=\"_disableScrollAfter\"\n (mousedown)=\"_handlePaginatorPress('after', $event)\"\n (click)=\"_handlePaginatorClick('after')\"\n (touchend)=\"_stopInterval()\">\n <div class=\"mat-tab-header-pagination-chevron\"></div>\n</div>\n", styles: [".mat-tab-header{display:flex;overflow:hidden;position:relative;flex-shrink:0}.mat-tab-header-pagination{-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative;display:none;justify-content:center;align-items:center;min-width:32px;cursor:pointer;z-index:2;-webkit-tap-highlight-color:transparent;touch-action:none}.mat-tab-header-pagination-controls-enabled .mat-tab-header-pagination{display:flex}.mat-tab-header-pagination-before,.mat-tab-header-rtl .mat-tab-header-pagination-after{padding-left:4px}.mat-tab-header-pagination-before .mat-tab-header-pagination-chevron,.mat-tab-header-rtl .mat-tab-header-pagination-after .mat-tab-header-pagination-chevron{transform:rotate(-135deg)}.mat-tab-header-rtl .mat-tab-header-pagination-before,.mat-tab-header-pagination-after{padding-right:4px}.mat-tab-header-rtl .mat-tab-header-pagination-before .mat-tab-header-pagination-chevron,.mat-tab-header-pagination-after .mat-tab-header-pagination-chevron{transform:rotate(45deg)}.mat-tab-header-pagination-chevron{border-style:solid;border-width:2px 2px 0 0;height:8px;width:8px}.mat-tab-header-pagination-disabled{box-shadow:none;cursor:default}.mat-tab-list{flex-grow:1;position:relative;transition:transform 500ms cubic-bezier(0.35, 0, 0.25, 1)}.mat-tab-links{display:flex}[mat-align-tabs=center]>.mat-tab-link-container .mat-tab-links{justify-content:center}[mat-align-tabs=end]>.mat-tab-link-container .mat-tab-links{justify-content:flex-end}.mat-ink-bar{position:absolute;bottom:0;height:2px;transition:500ms cubic-bezier(0.35, 0, 0.25, 1)}._mat-animation-noopable.mat-ink-bar{transition:none;animation:none}.mat-tab-group-inverted-header .mat-ink-bar{bottom:auto;top:0}.cdk-high-contrast-active .mat-ink-bar{outline:solid 2px;height:0}.mat-tab-link-container{display:flex;flex-grow:1;overflow:hidden;z-index:1}.mat-tab-link{height:48px;padding:0 24px;cursor:pointer;box-sizing:border-box;opacity:.6;min-width:160px;text-align:center;display:inline-flex;justify-content:center;align-items:center;white-space:nowrap;vertical-align:top;text-decoration:none;position:relative;overflow:hidden;-webkit-tap-highlight-color:transparent}.mat-tab-link:focus{outline:none}.mat-tab-link:focus:not(.mat-tab-disabled){opacity:1}.cdk-high-contrast-active .mat-tab-link:focus{outline:dotted 2px;outline-offset:-2px}.mat-tab-link.mat-tab-disabled{cursor:default}.cdk-high-contrast-active .mat-tab-link.mat-tab-disabled{opacity:.5}.mat-tab-link .mat-tab-label-content{display:inline-flex;justify-content:center;align-items:center;white-space:nowrap}.cdk-high-contrast-active .mat-tab-link{opacity:1}[mat-stretch-tabs] .mat-tab-link{flex-basis:0;flex-grow:1}.mat-tab-link.mat-tab-disabled{pointer-events:none}@media(max-width: 599px){.mat-tab-link{min-width:72px}}\n"], directives: [{ type: i4.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }, { type: i5.CdkObserveContent, selector: "[cdkObserveContent]", inputs: ["cdkObserveContentDisabled", "debounce"], outputs: ["cdkObserveContent"], exportAs: ["cdkObserveContent"] }, { type: MatInkBar, selector: "mat-ink-bar" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None });
|
|
1637
|
+
MatTabNav.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.0", type: MatTabNav, selector: "[mat-tab-nav-bar]", inputs: { color: "color" }, host: { properties: { "attr.role": "_getRole()", "class.mat-tab-header-pagination-controls-enabled": "_showPaginationControls", "class.mat-tab-header-rtl": "_getLayoutDirection() == 'rtl'", "class.mat-primary": "color !== \"warn\" && color !== \"accent\"", "class.mat-accent": "color === \"accent\"", "class.mat-warn": "color === \"warn\"" }, classAttribute: "mat-tab-nav-bar mat-tab-header" }, queries: [{ propertyName: "_items", predicate: i0.forwardRef(function () { return MatTabLink; }), descendants: true }], viewQueries: [{ propertyName: "_inkBar", first: true, predicate: MatInkBar, descendants: true, static: true }, { propertyName: "_tabListContainer", first: true, predicate: ["tabListContainer"], descendants: true, static: true }, { propertyName: "_tabList", first: true, predicate: ["tabList"], descendants: true, static: true }, { propertyName: "_tabListInner", first: true, predicate: ["tabListInner"], descendants: true, static: true }, { propertyName: "_nextPaginator", first: true, predicate: ["nextPaginator"], descendants: true }, { propertyName: "_previousPaginator", first: true, predicate: ["previousPaginator"], descendants: true }], exportAs: ["matTabNavBar", "matTabNav"], usesInheritance: true, ngImport: i0, template: "<div class=\"mat-tab-header-pagination mat-tab-header-pagination-before mat-elevation-z4\"\n #previousPaginator\n aria-hidden=\"true\"\n mat-ripple [matRippleDisabled]=\"_disableScrollBefore || disableRipple\"\n [class.mat-tab-header-pagination-disabled]=\"_disableScrollBefore\"\n (click)=\"_handlePaginatorClick('before')\"\n (mousedown)=\"_handlePaginatorPress('before', $event)\"\n (touchend)=\"_stopInterval()\">\n <div class=\"mat-tab-header-pagination-chevron\"></div>\n</div>\n\n<div class=\"mat-tab-link-container\" #tabListContainer (keydown)=\"_handleKeydown($event)\">\n <div\n class=\"mat-tab-list\"\n [class._mat-animation-noopable]=\"_animationMode === 'NoopAnimations'\"\n #tabList\n (cdkObserveContent)=\"_onContentChanges()\">\n <div class=\"mat-tab-links\" #tabListInner>\n <ng-content></ng-content>\n </div>\n <mat-ink-bar></mat-ink-bar>\n </div>\n</div>\n\n<div class=\"mat-tab-header-pagination mat-tab-header-pagination-after mat-elevation-z4\"\n #nextPaginator\n aria-hidden=\"true\"\n mat-ripple [matRippleDisabled]=\"_disableScrollAfter || disableRipple\"\n [class.mat-tab-header-pagination-disabled]=\"_disableScrollAfter\"\n (mousedown)=\"_handlePaginatorPress('after', $event)\"\n (click)=\"_handlePaginatorClick('after')\"\n (touchend)=\"_stopInterval()\">\n <div class=\"mat-tab-header-pagination-chevron\"></div>\n</div>\n", styles: [".mat-tab-header{display:flex;overflow:hidden;position:relative;flex-shrink:0}.mat-tab-header-pagination{-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative;display:none;justify-content:center;align-items:center;min-width:32px;cursor:pointer;z-index:2;-webkit-tap-highlight-color:transparent;touch-action:none}.mat-tab-header-pagination-controls-enabled .mat-tab-header-pagination{display:flex}.mat-tab-header-pagination-before,.mat-tab-header-rtl .mat-tab-header-pagination-after{padding-left:4px}.mat-tab-header-pagination-before .mat-tab-header-pagination-chevron,.mat-tab-header-rtl .mat-tab-header-pagination-after .mat-tab-header-pagination-chevron{transform:rotate(-135deg)}.mat-tab-header-rtl .mat-tab-header-pagination-before,.mat-tab-header-pagination-after{padding-right:4px}.mat-tab-header-rtl .mat-tab-header-pagination-before .mat-tab-header-pagination-chevron,.mat-tab-header-pagination-after .mat-tab-header-pagination-chevron{transform:rotate(45deg)}.mat-tab-header-pagination-chevron{border-style:solid;border-width:2px 2px 0 0;height:8px;width:8px}.mat-tab-header-pagination-disabled{box-shadow:none;cursor:default}.mat-tab-list{flex-grow:1;position:relative;transition:transform 500ms cubic-bezier(0.35, 0, 0.25, 1)}.mat-tab-links{display:flex}[mat-align-tabs=center]>.mat-tab-link-container .mat-tab-links{justify-content:center}[mat-align-tabs=end]>.mat-tab-link-container .mat-tab-links{justify-content:flex-end}.mat-ink-bar{position:absolute;bottom:0;height:2px;transition:500ms cubic-bezier(0.35, 0, 0.25, 1)}._mat-animation-noopable.mat-ink-bar{transition:none;animation:none}.mat-tab-group-inverted-header .mat-ink-bar{bottom:auto;top:0}.cdk-high-contrast-active .mat-ink-bar{outline:solid 2px;height:0}.mat-tab-link-container{display:flex;flex-grow:1;overflow:hidden;z-index:1}.mat-tab-link{height:48px;padding:0 24px;cursor:pointer;box-sizing:border-box;opacity:.6;min-width:160px;text-align:center;display:inline-flex;justify-content:center;align-items:center;white-space:nowrap;vertical-align:top;text-decoration:none;position:relative;overflow:hidden;-webkit-tap-highlight-color:transparent}.mat-tab-link:focus{outline:none}.mat-tab-link:focus:not(.mat-tab-disabled){opacity:1}.cdk-high-contrast-active .mat-tab-link:focus{outline:dotted 2px;outline-offset:-2px}.mat-tab-link.mat-tab-disabled{cursor:default}.cdk-high-contrast-active .mat-tab-link.mat-tab-disabled{opacity:.5}.mat-tab-link .mat-tab-label-content{display:inline-flex;justify-content:center;align-items:center;white-space:nowrap}.cdk-high-contrast-active .mat-tab-link{opacity:1}[mat-stretch-tabs] .mat-tab-link{flex-basis:0;flex-grow:1}.mat-tab-link.mat-tab-disabled{pointer-events:none}@media(max-width: 599px){.mat-tab-link{min-width:72px}}\n"], directives: [{ type: i4.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }, { type: i5.CdkObserveContent, selector: "[cdkObserveContent]", inputs: ["cdkObserveContentDisabled", "debounce"], outputs: ["cdkObserveContent"], exportAs: ["cdkObserveContent"] }, { type: MatInkBar, selector: "mat-ink-bar" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None });
|
|
1628
1638
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: MatTabNav, decorators: [{
|
|
1629
1639
|
type: Component,
|
|
1630
1640
|
args: [{ selector: '[mat-tab-nav-bar]', exportAs: 'matTabNavBar, matTabNav', inputs: ['color'], host: {
|
|
1641
|
+
'[attr.role]': '_getRole()',
|
|
1631
1642
|
'class': 'mat-tab-nav-bar mat-tab-header',
|
|
1632
1643
|
'[class.mat-tab-header-pagination-controls-enabled]': '_showPaginationControls',
|
|
1633
1644
|
'[class.mat-tab-header-rtl]': "_getLayoutDirection() == 'rtl'",
|
|
@@ -1677,6 +1688,8 @@ class _MatTabLinkBase extends _MatTabLinkMixinBase {
|
|
|
1677
1688
|
this._focusMonitor = _focusMonitor;
|
|
1678
1689
|
/** Whether the tab link is active or not. */
|
|
1679
1690
|
this._isActive = false;
|
|
1691
|
+
/** Unique id for the tab. */
|
|
1692
|
+
this.id = `mat-tab-link-${nextUniqueId++}`;
|
|
1680
1693
|
this.rippleConfig = globalRippleOptions || {};
|
|
1681
1694
|
this.tabIndex = parseInt(tabIndex) || 0;
|
|
1682
1695
|
if (animationMode === 'NoopAnimations') {
|
|
@@ -1719,9 +1732,41 @@ class _MatTabLinkBase extends _MatTabLinkMixinBase {
|
|
|
1719
1732
|
// have to update the focused index whenever the link receives focus.
|
|
1720
1733
|
this._tabNavBar.focusIndex = this._tabNavBar._items.toArray().indexOf(this);
|
|
1721
1734
|
}
|
|
1735
|
+
_handleKeydown(event) {
|
|
1736
|
+
if (this._tabNavBar.tabPanel && event.keyCode === SPACE) {
|
|
1737
|
+
this.elementRef.nativeElement.click();
|
|
1738
|
+
}
|
|
1739
|
+
}
|
|
1740
|
+
_getAriaControls() {
|
|
1741
|
+
return this._tabNavBar.tabPanel
|
|
1742
|
+
? this._tabNavBar.tabPanel?.id
|
|
1743
|
+
: this.elementRef.nativeElement.getAttribute('aria-controls');
|
|
1744
|
+
}
|
|
1745
|
+
_getAriaSelected() {
|
|
1746
|
+
if (this._tabNavBar.tabPanel) {
|
|
1747
|
+
return this.active ? 'true' : 'false';
|
|
1748
|
+
}
|
|
1749
|
+
else {
|
|
1750
|
+
return this.elementRef.nativeElement.getAttribute('aria-selected');
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
_getAriaCurrent() {
|
|
1754
|
+
return this.active && !this._tabNavBar.tabPanel ? 'page' : null;
|
|
1755
|
+
}
|
|
1756
|
+
_getRole() {
|
|
1757
|
+
return this._tabNavBar.tabPanel ? 'tab' : this.elementRef.nativeElement.getAttribute('role');
|
|
1758
|
+
}
|
|
1759
|
+
_getTabIndex() {
|
|
1760
|
+
if (this._tabNavBar.tabPanel) {
|
|
1761
|
+
return this._isActive ? 0 : -1;
|
|
1762
|
+
}
|
|
1763
|
+
else {
|
|
1764
|
+
return this.tabIndex;
|
|
1765
|
+
}
|
|
1766
|
+
}
|
|
1722
1767
|
}
|
|
1723
1768
|
_MatTabLinkBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: _MatTabLinkBase, deps: [{ token: _MatTabNavBase }, { token: i0.ElementRef }, { token: MAT_RIPPLE_GLOBAL_OPTIONS, optional: true }, { token: 'tabindex', attribute: true }, { token: i7.FocusMonitor }, { token: ANIMATION_MODULE_TYPE, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1724
|
-
_MatTabLinkBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.0", type: _MatTabLinkBase, inputs: { active: "active" }, usesInheritance: true, ngImport: i0 });
|
|
1769
|
+
_MatTabLinkBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.0", type: _MatTabLinkBase, inputs: { active: "active", id: "id" }, usesInheritance: true, ngImport: i0 });
|
|
1725
1770
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: _MatTabLinkBase, decorators: [{
|
|
1726
1771
|
type: Directive
|
|
1727
1772
|
}], ctorParameters: function () { return [{ type: _MatTabNavBase }, { type: i0.ElementRef }, { type: undefined, decorators: [{
|
|
@@ -1739,6 +1784,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImpor
|
|
|
1739
1784
|
args: [ANIMATION_MODULE_TYPE]
|
|
1740
1785
|
}] }]; }, propDecorators: { active: [{
|
|
1741
1786
|
type: Input
|
|
1787
|
+
}], id: [{
|
|
1788
|
+
type: Input
|
|
1742
1789
|
}] } });
|
|
1743
1790
|
/**
|
|
1744
1791
|
* Link inside of a `mat-tab-nav-bar`.
|
|
@@ -1755,7 +1802,7 @@ class MatTabLink extends _MatTabLinkBase {
|
|
|
1755
1802
|
}
|
|
1756
1803
|
}
|
|
1757
1804
|
MatTabLink.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: MatTabLink, deps: [{ token: MatTabNav }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i3.Platform }, { token: MAT_RIPPLE_GLOBAL_OPTIONS, optional: true }, { token: 'tabindex', attribute: true }, { token: i7.FocusMonitor }, { token: ANIMATION_MODULE_TYPE, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1758
|
-
MatTabLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.0", type: MatTabLink, selector: "[mat-tab-link], [matTabLink]", inputs: { disabled: "disabled", disableRipple: "disableRipple", tabIndex: "tabIndex" }, host: { listeners: { "focus": "_handleFocus()" }, properties: { "attr.aria-
|
|
1805
|
+
MatTabLink.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.0", type: MatTabLink, selector: "[mat-tab-link], [matTabLink]", inputs: { disabled: "disabled", disableRipple: "disableRipple", tabIndex: "tabIndex" }, host: { listeners: { "focus": "_handleFocus()", "keydown": "_handleKeydown($event)" }, properties: { "attr.aria-controls": "_getAriaControls()", "attr.aria-current": "_getAriaCurrent()", "attr.aria-disabled": "disabled", "attr.aria-selected": "_getAriaSelected()", "attr.id": "id", "attr.tabIndex": "_getTabIndex()", "attr.role": "_getRole()", "class.mat-tab-disabled": "disabled", "class.mat-tab-label-active": "active" }, classAttribute: "mat-tab-link mat-focus-indicator" }, exportAs: ["matTabLink"], usesInheritance: true, ngImport: i0 });
|
|
1759
1806
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: MatTabLink, decorators: [{
|
|
1760
1807
|
type: Directive,
|
|
1761
1808
|
args: [{
|
|
@@ -1764,12 +1811,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImpor
|
|
|
1764
1811
|
inputs: ['disabled', 'disableRipple', 'tabIndex'],
|
|
1765
1812
|
host: {
|
|
1766
1813
|
'class': 'mat-tab-link mat-focus-indicator',
|
|
1767
|
-
'[attr.aria-
|
|
1814
|
+
'[attr.aria-controls]': '_getAriaControls()',
|
|
1815
|
+
'[attr.aria-current]': '_getAriaCurrent()',
|
|
1768
1816
|
'[attr.aria-disabled]': 'disabled',
|
|
1769
|
-
'[attr.
|
|
1817
|
+
'[attr.aria-selected]': '_getAriaSelected()',
|
|
1818
|
+
'[attr.id]': 'id',
|
|
1819
|
+
'[attr.tabIndex]': '_getTabIndex()',
|
|
1820
|
+
'[attr.role]': '_getRole()',
|
|
1770
1821
|
'[class.mat-tab-disabled]': 'disabled',
|
|
1771
1822
|
'[class.mat-tab-label-active]': 'active',
|
|
1772
1823
|
'(focus)': '_handleFocus()',
|
|
1824
|
+
'(keydown)': '_handleKeydown($event)',
|
|
1773
1825
|
},
|
|
1774
1826
|
}]
|
|
1775
1827
|
}], ctorParameters: function () { return [{ type: MatTabNav }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: i3.Platform }, { type: undefined, decorators: [{
|
|
@@ -1786,6 +1838,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImpor
|
|
|
1786
1838
|
type: Inject,
|
|
1787
1839
|
args: [ANIMATION_MODULE_TYPE]
|
|
1788
1840
|
}] }]; } });
|
|
1841
|
+
/**
|
|
1842
|
+
* Tab panel component associated with MatTabNav.
|
|
1843
|
+
*/
|
|
1844
|
+
class MatTabNavPanel {
|
|
1845
|
+
constructor() {
|
|
1846
|
+
/** Unique id for the tab panel. */
|
|
1847
|
+
this.id = `mat-tab-nav-panel-${nextUniqueId++}`;
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1850
|
+
MatTabNavPanel.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: MatTabNavPanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1851
|
+
MatTabNavPanel.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.0", type: MatTabNavPanel, selector: "mat-tab-nav-panel", inputs: { id: "id" }, host: { attributes: { "role": "tabpanel" }, properties: { "attr.aria-labelledby": "_activeTabId", "attr.id": "id" }, classAttribute: "mat-tab-nav-panel" }, exportAs: ["matTabNavPanel"], ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1852
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: MatTabNavPanel, decorators: [{
|
|
1853
|
+
type: Component,
|
|
1854
|
+
args: [{
|
|
1855
|
+
selector: 'mat-tab-nav-panel',
|
|
1856
|
+
exportAs: 'matTabNavPanel',
|
|
1857
|
+
template: '<ng-content></ng-content>',
|
|
1858
|
+
host: {
|
|
1859
|
+
'[attr.aria-labelledby]': '_activeTabId',
|
|
1860
|
+
'[attr.id]': 'id',
|
|
1861
|
+
'class': 'mat-tab-nav-panel',
|
|
1862
|
+
'role': 'tabpanel',
|
|
1863
|
+
},
|
|
1864
|
+
encapsulation: ViewEncapsulation.None,
|
|
1865
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1866
|
+
}]
|
|
1867
|
+
}], propDecorators: { id: [{
|
|
1868
|
+
type: Input
|
|
1869
|
+
}] } });
|
|
1789
1870
|
|
|
1790
1871
|
/**
|
|
1791
1872
|
* @license
|
|
@@ -1803,6 +1884,7 @@ MatTabsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version:
|
|
|
1803
1884
|
MatInkBar,
|
|
1804
1885
|
MatTabLabelWrapper,
|
|
1805
1886
|
MatTabNav,
|
|
1887
|
+
MatTabNavPanel,
|
|
1806
1888
|
MatTabLink,
|
|
1807
1889
|
MatTabBody,
|
|
1808
1890
|
MatTabBodyPortal,
|
|
@@ -1817,6 +1899,7 @@ MatTabsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version:
|
|
|
1817
1899
|
MatTabLabel,
|
|
1818
1900
|
MatTab,
|
|
1819
1901
|
MatTabNav,
|
|
1902
|
+
MatTabNavPanel,
|
|
1820
1903
|
MatTabLink,
|
|
1821
1904
|
MatTabContent] });
|
|
1822
1905
|
MatTabsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: MatTabsModule, imports: [[
|
|
@@ -1845,6 +1928,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImpor
|
|
|
1845
1928
|
MatTabLabel,
|
|
1846
1929
|
MatTab,
|
|
1847
1930
|
MatTabNav,
|
|
1931
|
+
MatTabNavPanel,
|
|
1848
1932
|
MatTabLink,
|
|
1849
1933
|
MatTabContent,
|
|
1850
1934
|
],
|
|
@@ -1855,6 +1939,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImpor
|
|
|
1855
1939
|
MatInkBar,
|
|
1856
1940
|
MatTabLabelWrapper,
|
|
1857
1941
|
MatTabNav,
|
|
1942
|
+
MatTabNavPanel,
|
|
1858
1943
|
MatTabLink,
|
|
1859
1944
|
MatTabBody,
|
|
1860
1945
|
MatTabBodyPortal,
|
|
@@ -1892,5 +1977,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImpor
|
|
|
1892
1977
|
* Generated bundle index. Do not edit.
|
|
1893
1978
|
*/
|
|
1894
1979
|
|
|
1895
|
-
export { MAT_TAB, MAT_TABS_CONFIG, MAT_TAB_GROUP, MatInkBar, MatTab, MatTabBody, MatTabBodyPortal, MatTabChangeEvent, MatTabContent, MatTabGroup, MatTabHeader, MatTabLabel, MatTabLabelWrapper, MatTabLink, MatTabNav, MatTabsModule, _MAT_INK_BAR_POSITIONER, _MatTabBodyBase, _MatTabGroupBase, _MatTabHeaderBase, _MatTabLinkBase, _MatTabNavBase, matTabsAnimations };
|
|
1980
|
+
export { MAT_TAB, MAT_TABS_CONFIG, MAT_TAB_GROUP, MatInkBar, MatTab, MatTabBody, MatTabBodyPortal, MatTabChangeEvent, MatTabContent, MatTabGroup, MatTabHeader, MatTabLabel, MatTabLabelWrapper, MatTabLink, MatTabNav, MatTabNavPanel, MatTabsModule, _MAT_INK_BAR_POSITIONER, _MatTabBodyBase, _MatTabGroupBase, _MatTabHeaderBase, _MatTabLinkBase, _MatTabNavBase, matTabsAnimations };
|
|
1896
1981
|
//# sourceMappingURL=tabs.mjs.map
|