@angular/material 21.0.0-next.8 → 21.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/tokens/_classes.scss +1 -1
- package/core/tokens/m2/_md-sys-color.scss +17 -17
- package/fesm2022/_animation-chunk.mjs +10 -16
- package/fesm2022/_animation-chunk.mjs.map +1 -1
- package/fesm2022/_date-formats-chunk.mjs +68 -164
- package/fesm2022/_date-formats-chunk.mjs.map +1 -1
- package/fesm2022/_date-range-input-harness-chunk.mjs +284 -463
- package/fesm2022/_date-range-input-harness-chunk.mjs.map +1 -1
- package/fesm2022/_error-options-chunk.mjs +56 -19
- package/fesm2022/_error-options-chunk.mjs.map +1 -1
- package/fesm2022/_error-state-chunk.mjs +24 -31
- package/fesm2022/_error-state-chunk.mjs.map +1 -1
- package/fesm2022/_form-field-chunk.mjs +1224 -1017
- package/fesm2022/_form-field-chunk.mjs.map +1 -1
- package/fesm2022/_icon-button-chunk.mjs +243 -187
- package/fesm2022/_icon-button-chunk.mjs.map +1 -1
- package/fesm2022/_icon-registry-chunk.mjs +350 -575
- package/fesm2022/_icon-registry-chunk.mjs.map +1 -1
- package/fesm2022/_input-harness-chunk.mjs +56 -107
- package/fesm2022/_input-harness-chunk.mjs.map +1 -1
- package/fesm2022/_input-value-accessor-chunk.mjs +0 -6
- package/fesm2022/_input-value-accessor-chunk.mjs.map +1 -1
- package/fesm2022/_internal-form-field-chunk.mjs +59 -19
- package/fesm2022/_internal-form-field-chunk.mjs.map +1 -1
- package/fesm2022/_line-chunk.mjs +83 -43
- package/fesm2022/_line-chunk.mjs.map +1 -1
- package/fesm2022/_option-chunk.mjs +348 -311
- package/fesm2022/_option-chunk.mjs.map +1 -1
- package/fesm2022/_option-harness-chunk.mjs +23 -39
- package/fesm2022/_option-harness-chunk.mjs.map +1 -1
- package/fesm2022/_option-module-chunk.mjs +36 -10
- package/fesm2022/_option-module-chunk.mjs.map +1 -1
- package/fesm2022/_pseudo-checkbox-chunk.mjs +79 -44
- package/fesm2022/_pseudo-checkbox-chunk.mjs.map +1 -1
- package/fesm2022/_pseudo-checkbox-module-chunk.mjs +36 -10
- package/fesm2022/_pseudo-checkbox-module-chunk.mjs.map +1 -1
- package/fesm2022/_public-api-chunk.mjs +71 -134
- package/fesm2022/_public-api-chunk.mjs.map +1 -1
- package/fesm2022/_ripple-chunk.mjs +504 -600
- package/fesm2022/_ripple-chunk.mjs.map +1 -1
- package/fesm2022/_ripple-loader-chunk.mjs +120 -138
- package/fesm2022/_ripple-loader-chunk.mjs.map +1 -1
- package/fesm2022/_ripple-module-chunk.mjs +36 -10
- package/fesm2022/_ripple-module-chunk.mjs.map +1 -1
- package/fesm2022/_structural-styles-chunk.mjs +37 -10
- package/fesm2022/_structural-styles-chunk.mjs.map +1 -1
- package/fesm2022/_tooltip-chunk.mjs +810 -888
- package/fesm2022/_tooltip-chunk.mjs.map +1 -1
- package/fesm2022/autocomplete-testing.mjs +62 -86
- package/fesm2022/autocomplete-testing.mjs.map +1 -1
- package/fesm2022/autocomplete.mjs +965 -1126
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/badge-testing.mjs +38 -54
- package/fesm2022/badge-testing.mjs.map +1 -1
- package/fesm2022/badge.mjs +321 -272
- package/fesm2022/badge.mjs.map +1 -1
- package/fesm2022/bottom-sheet-testing.mjs +10 -24
- package/fesm2022/bottom-sheet-testing.mjs.map +1 -1
- package/fesm2022/bottom-sheet.mjs +349 -344
- package/fesm2022/bottom-sheet.mjs.map +1 -1
- package/fesm2022/button-testing.mjs +60 -94
- package/fesm2022/button-testing.mjs.map +1 -1
- package/fesm2022/button-toggle-testing.mjs +76 -125
- package/fesm2022/button-toggle-testing.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs +752 -662
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +263 -158
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/card-testing.mjs +19 -33
- package/fesm2022/card-testing.mjs.map +1 -1
- package/fesm2022/card.mjs +576 -272
- package/fesm2022/card.mjs.map +1 -1
- package/fesm2022/checkbox-testing.mjs +71 -123
- package/fesm2022/checkbox-testing.mjs.map +1 -1
- package/fesm2022/checkbox.mjs +515 -477
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/chips-testing.mjs +201 -350
- package/fesm2022/chips-testing.mjs.map +1 -1
- package/fesm2022/chips.mjs +2552 -2289
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/core-testing.mjs +14 -28
- package/fesm2022/core-testing.mjs.map +1 -1
- package/fesm2022/core.mjs +357 -328
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker-testing.mjs +15 -25
- package/fesm2022/datepicker-testing.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +4826 -4563
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog-testing.mjs +93 -129
- package/fesm2022/dialog-testing.mjs.map +1 -1
- package/fesm2022/dialog.mjs +810 -829
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/divider-testing.mjs +10 -11
- package/fesm2022/divider-testing.mjs.map +1 -1
- package/fesm2022/divider.mjs +119 -43
- package/fesm2022/divider.mjs.map +1 -1
- package/fesm2022/expansion-testing.mjs +74 -130
- package/fesm2022/expansion-testing.mjs.map +1 -1
- package/fesm2022/expansion.mjs +703 -515
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/form-field-testing-control.mjs +16 -33
- package/fesm2022/form-field-testing-control.mjs.map +1 -1
- package/fesm2022/form-field-testing.mjs +118 -179
- package/fesm2022/form-field-testing.mjs.map +1 -1
- package/fesm2022/form-field.mjs +36 -10
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/grid-list-testing.mjs +65 -113
- package/fesm2022/grid-list-testing.mjs.map +1 -1
- package/fesm2022/grid-list.mjs +559 -494
- package/fesm2022/grid-list.mjs.map +1 -1
- package/fesm2022/icon-testing.mjs +148 -127
- package/fesm2022/icon-testing.mjs.map +1 -1
- package/fesm2022/icon.mjs +325 -351
- package/fesm2022/icon.mjs.map +1 -1
- package/fesm2022/input-testing.mjs +59 -99
- package/fesm2022/input-testing.mjs.map +1 -1
- package/fesm2022/input.mjs +457 -520
- package/fesm2022/input.mjs.map +1 -1
- package/fesm2022/list-testing.mjs +251 -434
- package/fesm2022/list-testing.mjs.map +1 -1
- package/fesm2022/list.mjs +1522 -1204
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/material.mjs +0 -5
- package/fesm2022/material.mjs.map +1 -1
- package/fesm2022/menu-testing.mjs +159 -228
- package/fesm2022/menu-testing.mjs.map +1 -1
- package/fesm2022/menu.mjs +1338 -1343
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/paginator-testing.mjs +55 -79
- package/fesm2022/paginator-testing.mjs.map +1 -1
- package/fesm2022/paginator.mjs +381 -309
- package/fesm2022/paginator.mjs.map +1 -1
- package/fesm2022/progress-bar-testing.mjs +12 -21
- package/fesm2022/progress-bar-testing.mjs.map +1 -1
- package/fesm2022/progress-bar.mjs +224 -169
- package/fesm2022/progress-bar.mjs.map +1 -1
- package/fesm2022/progress-spinner-testing.mjs +13 -23
- package/fesm2022/progress-spinner-testing.mjs.map +1 -1
- package/fesm2022/progress-spinner.mjs +235 -160
- package/fesm2022/progress-spinner.mjs.map +1 -1
- package/fesm2022/radio-testing.mjs +133 -208
- package/fesm2022/radio-testing.mjs.map +1 -1
- package/fesm2022/radio.mjs +712 -679
- package/fesm2022/radio.mjs.map +1 -1
- package/fesm2022/select-testing.mjs +83 -117
- package/fesm2022/select-testing.mjs.map +1 -1
- package/fesm2022/select.mjs +1116 -1246
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sidenav-testing.mjs +54 -120
- package/fesm2022/sidenav-testing.mjs.map +1 -1
- package/fesm2022/sidenav.mjs +1078 -995
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle-testing.mjs +57 -92
- package/fesm2022/slide-toggle-testing.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +369 -279
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/slider-testing.mjs +90 -138
- package/fesm2022/slider-testing.mjs.map +1 -1
- package/fesm2022/slider.mjs +1651 -1716
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/snack-bar-testing.mjs +40 -87
- package/fesm2022/snack-bar-testing.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +763 -714
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/fesm2022/sort-testing.mjs +45 -66
- package/fesm2022/sort-testing.mjs.map +1 -1
- package/fesm2022/sort.mjs +419 -344
- package/fesm2022/sort.mjs.map +1 -1
- package/fesm2022/stepper-testing.mjs +78 -154
- package/fesm2022/stepper-testing.mjs.map +1 -1
- package/fesm2022/stepper.mjs +790 -498
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/table-testing.mjs +125 -186
- package/fesm2022/table-testing.mjs.map +1 -1
- package/fesm2022/table.mjs +1026 -684
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/tabs-testing.mjs +125 -197
- package/fesm2022/tabs-testing.mjs.map +1 -1
- package/fesm2022/tabs.mjs +2351 -2028
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/timepicker-testing.mjs +113 -172
- package/fesm2022/timepicker-testing.mjs.map +1 -1
- package/fesm2022/timepicker.mjs +1019 -826
- package/fesm2022/timepicker.mjs.map +1 -1
- package/fesm2022/toolbar-testing.mjs +16 -27
- package/fesm2022/toolbar-testing.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +163 -78
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tooltip-testing.mjs +41 -52
- package/fesm2022/tooltip-testing.mjs.map +1 -1
- package/fesm2022/tooltip.mjs +36 -10
- package/fesm2022/tooltip.mjs.map +1 -1
- package/fesm2022/tree-testing.mjs +86 -162
- package/fesm2022/tree-testing.mjs.map +1 -1
- package/fesm2022/tree.mjs +638 -466
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +2 -2
- package/schematics/ng-add/index.js +1 -1
- package/types/expansion.d.ts +4 -2
- package/types/menu-testing.d.ts +2 -0
- package/types/select.d.ts +1 -1
- package/types/sort.d.ts +1 -1
- package/types/table-testing.d.ts +27 -1
- package/types/timepicker.d.ts +148 -128
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/table/testing/cell-harness.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/table/testing/row-harness.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/table/testing/table-harness.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.dev/license\n */\n\nimport {\n ComponentHarnessConstructor,\n ContentContainerComponentHarness,\n HarnessPredicate,\n} from '@angular/cdk/testing';\nimport {CellHarnessFilters} from './table-harness-filters';\n\nexport abstract class _MatCellHarnessBase extends ContentContainerComponentHarness {\n /** Gets the cell's text. */\n async getText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** Gets the name of the column that the cell belongs to. */\n async getColumnName(): Promise<string> {\n const host = await this.host();\n const classAttribute = await host.getAttribute('class');\n\n if (classAttribute) {\n const prefix = 'mat-column-';\n const name = classAttribute\n .split(' ')\n .map(c => c.trim())\n .find(c => c.startsWith(prefix));\n\n if (name) {\n return name.split(prefix)[1];\n }\n }\n\n throw Error('Could not determine column name of cell.');\n }\n\n protected static _getCellPredicate<T extends MatCellHarness>(\n type: ComponentHarnessConstructor<T>,\n options: CellHarnessFilters,\n ): HarnessPredicate<T> {\n return new HarnessPredicate(type, options)\n .addOption('text', options.text, (harness, text) =>\n HarnessPredicate.stringMatches(harness.getText(), text),\n )\n .addOption('columnName', options.columnName, (harness, name) =>\n HarnessPredicate.stringMatches(harness.getColumnName(), name),\n );\n }\n}\n\n/** Harness for interacting with an Angular Material table cell. */\nexport class MatCellHarness extends _MatCellHarnessBase {\n /** The selector for the host element of a `MatCellHarness` instance. */\n static hostSelector = '.mat-mdc-cell:not(.mat-no-data-cell)';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a table cell with specific attributes.\n * @param options Options for narrowing the search\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: CellHarnessFilters = {}): HarnessPredicate<MatCellHarness> {\n return _MatCellHarnessBase._getCellPredicate(this, options);\n }\n}\n\n/** Harness for interacting with an Angular Material table header cell. */\nexport class MatHeaderCellHarness extends _MatCellHarnessBase {\n /** The selector for the host element of a `MatHeaderCellHarness` instance. */\n static hostSelector = '.mat-mdc-header-cell';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a table header cell with specific\n * attributes.\n * @param options Options for narrowing the search\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: CellHarnessFilters = {}): HarnessPredicate<MatHeaderCellHarness> {\n return _MatCellHarnessBase._getCellPredicate(this, options);\n }\n}\n\n/** Harness for interacting with an Angular Material table footer cell. */\nexport class MatFooterCellHarness extends _MatCellHarnessBase {\n /** The selector for the host element of a `MatFooterCellHarness` instance. */\n static hostSelector = '.mat-mdc-footer-cell';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a table footer cell with specific\n * attributes.\n * @param options Options for narrowing the search\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: CellHarnessFilters = {}): HarnessPredicate<MatFooterCellHarness> {\n return _MatCellHarnessBase._getCellPredicate(this, options);\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.dev/license\n */\n\nimport {\n ComponentHarness,\n ComponentHarnessConstructor,\n HarnessPredicate,\n parallel,\n} from '@angular/cdk/testing';\nimport {\n _MatCellHarnessBase,\n MatCellHarness,\n MatFooterCellHarness,\n MatHeaderCellHarness,\n} from './cell-harness';\nimport {CellHarnessFilters, RowHarnessFilters} from './table-harness-filters';\n\n/** Text extracted from a table row organized by columns. */\nexport interface MatRowHarnessColumnsText {\n [columnName: string]: string;\n}\n\nexport abstract class _MatRowHarnessBase<\n CellType extends ComponentHarnessConstructor<Cell> & {\n with: (options?: CellHarnessFilters) => HarnessPredicate<Cell>;\n },\n Cell extends _MatCellHarnessBase,\n> extends ComponentHarness {\n protected abstract _cellHarness: CellType;\n\n /** Gets a list of `MatCellHarness` for all cells in the row. */\n async getCells(filter: CellHarnessFilters = {}): Promise<Cell[]> {\n return this.locatorForAll(this._cellHarness.with(filter))();\n }\n\n /** Gets the text of the cells in the row. */\n async getCellTextByIndex(filter: CellHarnessFilters = {}): Promise<string[]> {\n const cells = await this.getCells(filter);\n return parallel(() => cells.map(cell => cell.getText()));\n }\n\n /** Gets the text inside the row organized by columns. */\n async getCellTextByColumnName(): Promise<MatRowHarnessColumnsText> {\n const output: MatRowHarnessColumnsText = {};\n const cells = await this.getCells();\n const cellsData = await parallel(() =>\n cells.map(cell => {\n return parallel(() => [cell.getColumnName(), cell.getText()]);\n }),\n );\n cellsData.forEach(([columnName, text]) => (output[columnName] = text));\n return output;\n }\n}\n\n/** Harness for interacting with an Angular Material table row. */\nexport class MatRowHarness extends _MatRowHarnessBase<typeof MatCellHarness, MatCellHarness> {\n /** The selector for the host element of a `MatRowHarness` instance. */\n static hostSelector = '.mat-mdc-row:not(.mat-mdc-no-data-row)';\n protected _cellHarness = MatCellHarness;\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a table row with specific attributes.\n * @param options Options for narrowing the search\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends MatRowHarness>(\n this: ComponentHarnessConstructor<T>,\n options: RowHarnessFilters = {},\n ): HarnessPredicate<T> {\n return new HarnessPredicate(this, options);\n }\n}\n\n/** Harness for interacting with an Angular Material table header row. */\nexport class MatHeaderRowHarness extends _MatRowHarnessBase<\n typeof MatHeaderCellHarness,\n MatHeaderCellHarness\n> {\n /** The selector for the host element of a `MatHeaderRowHarness` instance. */\n static hostSelector = '.mat-mdc-header-row';\n protected _cellHarness = MatHeaderCellHarness;\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a table header row with specific\n * attributes.\n * @param options Options for narrowing the search\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends MatHeaderRowHarness>(\n this: ComponentHarnessConstructor<T>,\n options: RowHarnessFilters = {},\n ): HarnessPredicate<T> {\n return new HarnessPredicate(this, options);\n }\n}\n\n/** Harness for interacting with an Angular Material table footer row. */\nexport class MatFooterRowHarness extends _MatRowHarnessBase<\n typeof MatFooterCellHarness,\n MatFooterCellHarness\n> {\n /** The selector for the host element of a `MatFooterRowHarness` instance. */\n static hostSelector = '.mat-mdc-footer-row';\n protected _cellHarness = MatFooterCellHarness;\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a table footer row cell with specific\n * attributes.\n * @param options Options for narrowing the search\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends MatFooterRowHarness>(\n this: ComponentHarnessConstructor<T>,\n options: RowHarnessFilters = {},\n ): HarnessPredicate<T> {\n return new HarnessPredicate(this, options);\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.dev/license\n */\n\nimport {\n ComponentHarnessConstructor,\n ContentContainerComponentHarness,\n HarnessPredicate,\n parallel,\n} from '@angular/cdk/testing';\nimport {\n MatFooterRowHarness,\n MatHeaderRowHarness,\n MatRowHarness,\n MatRowHarnessColumnsText,\n} from './row-harness';\nimport {RowHarnessFilters, TableHarnessFilters} from './table-harness-filters';\n\n/** Text extracted from a table organized by columns. */\nexport interface MatTableHarnessColumnsText {\n [columnName: string]: {\n text: string[];\n headerText: string[];\n footerText: string[];\n };\n}\n\n/** Harness for interacting with a mat-table in tests. */\nexport class MatTableHarness extends ContentContainerComponentHarness<string> {\n /** The selector for the host element of a `MatTableHarness` instance. */\n static hostSelector = '.mat-mdc-table';\n _headerRowHarness = MatHeaderRowHarness;\n _rowHarness = MatRowHarness;\n private _footerRowHarness = MatFooterRowHarness;\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a table with specific attributes.\n * @param options Options for narrowing the search\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends MatTableHarness>(\n this: ComponentHarnessConstructor<T>,\n options: TableHarnessFilters = {},\n ): HarnessPredicate<T> {\n return new HarnessPredicate(this, options);\n }\n\n /** Gets all the header rows in a table. */\n async getHeaderRows(filter: RowHarnessFilters = {}): Promise<MatHeaderRowHarness[]> {\n return this.locatorForAll(this._headerRowHarness.with(filter))();\n }\n\n /** Gets all the regular data rows in a table. */\n async getRows(filter: RowHarnessFilters = {}): Promise<MatRowHarness[]> {\n return this.locatorForAll(this._rowHarness.with(filter))();\n }\n\n /** Gets all the footer rows in a table. */\n async getFooterRows(filter: RowHarnessFilters = {}): Promise<MatFooterRowHarness[]> {\n return this.locatorForAll(this._footerRowHarness.with(filter))();\n }\n\n /** Gets the text inside the entire table organized by rows. */\n async getCellTextByIndex(): Promise<string[][]> {\n const rows = await this.getRows();\n return parallel(() => rows.map(row => row.getCellTextByIndex()));\n }\n\n /** Gets the text inside the entire table organized by columns. */\n async getCellTextByColumnName(): Promise<MatTableHarnessColumnsText> {\n const [headerRows, footerRows, dataRows] = await parallel(() => [\n this.getHeaderRows(),\n this.getFooterRows(),\n this.getRows(),\n ]);\n\n const text: MatTableHarnessColumnsText = {};\n const [headerData, footerData, rowsData] = await parallel(() => [\n parallel(() => headerRows.map(row => row.getCellTextByColumnName())),\n parallel(() => footerRows.map(row => row.getCellTextByColumnName())),\n parallel(() => dataRows.map(row => row.getCellTextByColumnName())),\n ]);\n\n rowsData.forEach(data => {\n Object.keys(data).forEach(columnName => {\n const cellText = data[columnName];\n\n if (!text[columnName]) {\n text[columnName] = {\n headerText: getCellTextsByColumn(headerData, columnName),\n footerText: getCellTextsByColumn(footerData, columnName),\n text: [],\n };\n }\n\n text[columnName].text.push(cellText);\n });\n });\n\n return text;\n }\n}\n\n/** Extracts the text of cells only under a particular column. */\nfunction getCellTextsByColumn(rowsData: MatRowHarnessColumnsText[], column: string): string[] {\n const columnTexts: string[] = [];\n\n rowsData.forEach(data => {\n Object.keys(data).forEach(columnName => {\n if (columnName === column) {\n columnTexts.push(data[columnName]);\n }\n });\n });\n\n return columnTexts;\n}\n"],"names":[],"mappings":";;AAeM,MAAgB,mBAAoB,SAAQ,gCAAgC,CAAA;;AAEhF,IAAA,MAAM,OAAO,GAAA;QACX,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE;;;AAInC,IAAA,MAAM,aAAa,GAAA;AACjB,QAAA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE;QAC9B,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC;QAEvD,IAAI,cAAc,EAAE;YAClB,MAAM,MAAM,GAAG,aAAa;YAC5B,MAAM,IAAI,GAAG;iBACV,KAAK,CAAC,GAAG;iBACT,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE;AACjB,iBAAA,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YAElC,IAAI,IAAI,EAAE;gBACR,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;;;AAIhC,QAAA,MAAM,KAAK,CAAC,0CAA0C,CAAC;;AAG/C,IAAA,OAAO,iBAAiB,CAChC,IAAoC,EACpC,OAA2B,EAAA;AAE3B,QAAA,OAAO,IAAI,gBAAgB,CAAC,IAAI,EAAE,OAAO;aACtC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,IAAI,KAC7C,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,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a,EAAE;AAEhC,IAAA,QAAQ,CAAC,OAAO,CAAC,IAAI,IAAG;QACtB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,UAAU,IAAG;AACrC,YAAA,IAAI,UAAU,KAAK,MAAM,EAAE;gBACzB,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;;AAEtC,SAAC,CAAC;AACJ,KAAC,CAAC;AAEF,IAAA,OAAO,WAAW;AACpB;;;;"}
|
|
1
|
+
{"version":3,"file":"table-testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/table/testing/cell-harness.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/table/testing/row-harness.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/table/testing/table-harness.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.dev/license\n */\n\nimport {\n ComponentHarnessConstructor,\n ContentContainerComponentHarness,\n HarnessPredicate,\n} from '@angular/cdk/testing';\nimport {CellHarnessFilters} from './table-harness-filters';\n\nexport abstract class _MatCellHarnessBase extends ContentContainerComponentHarness {\n /** Gets the cell's text. */\n async getText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** Gets the name of the column that the cell belongs to. */\n async getColumnName(): Promise<string> {\n const host = await this.host();\n const classAttribute = await host.getAttribute('class');\n\n if (classAttribute) {\n const prefix = 'mat-column-';\n const name = classAttribute\n .split(' ')\n .map(c => c.trim())\n .find(c => c.startsWith(prefix));\n\n if (name) {\n return name.split(prefix)[1];\n }\n }\n\n throw Error('Could not determine column name of cell.');\n }\n\n protected static _getCellPredicate<T extends MatCellHarness>(\n type: ComponentHarnessConstructor<T>,\n options: CellHarnessFilters,\n ): HarnessPredicate<T> {\n return new HarnessPredicate(type, options)\n .addOption('text', options.text, (harness, text) =>\n HarnessPredicate.stringMatches(harness.getText(), text),\n )\n .addOption('columnName', options.columnName, (harness, name) =>\n HarnessPredicate.stringMatches(harness.getColumnName(), name),\n );\n }\n}\n\n/** Harness for interacting with an Angular Material table cell. */\nexport class MatCellHarness extends _MatCellHarnessBase {\n /** The selector for the host element of a `MatCellHarness` instance. */\n static hostSelector = '.mat-mdc-cell:not(.mat-no-data-cell)';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a table cell with specific attributes.\n * @param options Options for narrowing the search\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: CellHarnessFilters = {}): HarnessPredicate<MatCellHarness> {\n return _MatCellHarnessBase._getCellPredicate(this, options);\n }\n}\n\n/** Harness for interacting with an Angular Material table header cell. */\nexport class MatHeaderCellHarness extends _MatCellHarnessBase {\n /** The selector for the host element of a `MatHeaderCellHarness` instance. */\n static hostSelector = '.mat-mdc-header-cell';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a table header cell with specific\n * attributes.\n * @param options Options for narrowing the search\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: CellHarnessFilters = {}): HarnessPredicate<MatHeaderCellHarness> {\n return _MatCellHarnessBase._getCellPredicate(this, options);\n }\n}\n\n/** Harness for interacting with an Angular Material table footer cell. */\nexport class MatFooterCellHarness extends _MatCellHarnessBase {\n /** The selector for the host element of a `MatFooterCellHarness` instance. */\n static hostSelector = '.mat-mdc-footer-cell';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a table footer cell with specific\n * attributes.\n * @param options Options for narrowing the search\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: CellHarnessFilters = {}): HarnessPredicate<MatFooterCellHarness> {\n return _MatCellHarnessBase._getCellPredicate(this, options);\n }\n}\n\n/** Harness for interacting with an Angular Material table cell inside a \"no data\" row. */\nexport class MatNoDataCellHarness extends _MatCellHarnessBase {\n /** The selector for the host element of a `MatNoDataCellHarness` instance. */\n static hostSelector = '.mat-no-data-cell';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a table cell with specific attributes.\n * @param options Options for narrowing the search\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: CellHarnessFilters = {}): HarnessPredicate<MatNoDataCellHarness> {\n return _MatCellHarnessBase._getCellPredicate(this, options);\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.dev/license\n */\n\nimport {\n ComponentHarness,\n ComponentHarnessConstructor,\n HarnessPredicate,\n parallel,\n} from '@angular/cdk/testing';\nimport {\n _MatCellHarnessBase,\n MatCellHarness,\n MatFooterCellHarness,\n MatHeaderCellHarness,\n MatNoDataCellHarness,\n} from './cell-harness';\nimport {CellHarnessFilters, RowHarnessFilters} from './table-harness-filters';\n\n/** Text extracted from a table row organized by columns. */\nexport interface MatRowHarnessColumnsText {\n [columnName: string]: string;\n}\n\nexport abstract class _MatRowHarnessBase<\n CellType extends ComponentHarnessConstructor<Cell> & {\n with: (options?: CellHarnessFilters) => HarnessPredicate<Cell>;\n },\n Cell extends _MatCellHarnessBase,\n> extends ComponentHarness {\n protected abstract _cellHarness: CellType;\n\n /** Gets a list of `MatCellHarness` for all cells in the row. */\n async getCells(filter: CellHarnessFilters = {}): Promise<Cell[]> {\n return this.locatorForAll(this._cellHarness.with(filter))();\n }\n\n /** Gets the text of the cells in the row. */\n async getCellTextByIndex(filter: CellHarnessFilters = {}): Promise<string[]> {\n const cells = await this.getCells(filter);\n return parallel(() => cells.map(cell => cell.getText()));\n }\n\n /** Gets the text inside the row organized by columns. */\n async getCellTextByColumnName(): Promise<MatRowHarnessColumnsText> {\n const output: MatRowHarnessColumnsText = {};\n const cells = await this.getCells();\n const cellsData = await parallel(() =>\n cells.map(cell => {\n return parallel(() => [cell.getColumnName(), cell.getText()]);\n }),\n );\n cellsData.forEach(([columnName, text]) => (output[columnName] = text));\n return output;\n }\n}\n\n/** Harness for interacting with an Angular Material table row. */\nexport class MatRowHarness extends _MatRowHarnessBase<typeof MatCellHarness, MatCellHarness> {\n /** The selector for the host element of a `MatRowHarness` instance. */\n static hostSelector = '.mat-mdc-row:not(.mat-mdc-no-data-row)';\n protected _cellHarness = MatCellHarness;\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a table row with specific attributes.\n * @param options Options for narrowing the search\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends MatRowHarness>(\n this: ComponentHarnessConstructor<T>,\n options: RowHarnessFilters = {},\n ): HarnessPredicate<T> {\n return new HarnessPredicate(this, options);\n }\n}\n\n/** Harness for interacting with an Angular Material table header row. */\nexport class MatHeaderRowHarness extends _MatRowHarnessBase<\n typeof MatHeaderCellHarness,\n MatHeaderCellHarness\n> {\n /** The selector for the host element of a `MatHeaderRowHarness` instance. */\n static hostSelector = '.mat-mdc-header-row';\n protected _cellHarness = MatHeaderCellHarness;\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a table header row with specific\n * attributes.\n * @param options Options for narrowing the search\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends MatHeaderRowHarness>(\n this: ComponentHarnessConstructor<T>,\n options: RowHarnessFilters = {},\n ): HarnessPredicate<T> {\n return new HarnessPredicate(this, options);\n }\n}\n\n/** Harness for interacting with an Angular Material table footer row. */\nexport class MatFooterRowHarness extends _MatRowHarnessBase<\n typeof MatFooterCellHarness,\n MatFooterCellHarness\n> {\n /** The selector for the host element of a `MatFooterRowHarness` instance. */\n static hostSelector = '.mat-mdc-footer-row';\n protected _cellHarness = MatFooterCellHarness;\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a table footer row cell with specific\n * attributes.\n * @param options Options for narrowing the search\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends MatFooterRowHarness>(\n this: ComponentHarnessConstructor<T>,\n options: RowHarnessFilters = {},\n ): HarnessPredicate<T> {\n return new HarnessPredicate(this, options);\n }\n}\n\n/** Harness for interacting with an Angular Material table \"no data\" row. */\nexport class MatNoDataRowHarness extends _MatRowHarnessBase<\n typeof MatHeaderCellHarness,\n MatHeaderCellHarness\n> {\n /** The selector for the host element of a `MatNoDataRowHarness` instance. */\n static hostSelector = '.mat-mdc-no-data-row';\n protected _cellHarness = MatNoDataCellHarness;\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a table header row with specific\n * attributes.\n * @param options Options for narrowing the search\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends MatNoDataRowHarness>(\n this: ComponentHarnessConstructor<T>,\n options: RowHarnessFilters = {},\n ): HarnessPredicate<T> {\n return new HarnessPredicate(this, options);\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.dev/license\n */\n\nimport {\n ComponentHarnessConstructor,\n ContentContainerComponentHarness,\n HarnessPredicate,\n parallel,\n} from '@angular/cdk/testing';\nimport {\n MatFooterRowHarness,\n MatHeaderRowHarness,\n MatNoDataRowHarness,\n MatRowHarness,\n MatRowHarnessColumnsText,\n} from './row-harness';\nimport {RowHarnessFilters, TableHarnessFilters} from './table-harness-filters';\n\n/** Text extracted from a table organized by columns. */\nexport interface MatTableHarnessColumnsText {\n [columnName: string]: {\n text: string[];\n headerText: string[];\n footerText: string[];\n };\n}\n\n/** Harness for interacting with a mat-table in tests. */\nexport class MatTableHarness extends ContentContainerComponentHarness<string> {\n /** The selector for the host element of a `MatTableHarness` instance. */\n static hostSelector = '.mat-mdc-table';\n _headerRowHarness = MatHeaderRowHarness;\n _rowHarness = MatRowHarness;\n private _footerRowHarness = MatFooterRowHarness;\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a table with specific attributes.\n * @param options Options for narrowing the search\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends MatTableHarness>(\n this: ComponentHarnessConstructor<T>,\n options: TableHarnessFilters = {},\n ): HarnessPredicate<T> {\n return new HarnessPredicate(this, options);\n }\n\n /** Gets all the header rows in a table. */\n async getHeaderRows(filter: RowHarnessFilters = {}): Promise<MatHeaderRowHarness[]> {\n return this.locatorForAll(this._headerRowHarness.with(filter))();\n }\n\n /** Gets all the regular data rows in a table. */\n async getRows(filter: RowHarnessFilters = {}): Promise<MatRowHarness[]> {\n return this.locatorForAll(this._rowHarness.with(filter))();\n }\n\n /** Gets all the footer rows in a table. */\n async getFooterRows(filter: RowHarnessFilters = {}): Promise<MatFooterRowHarness[]> {\n return this.locatorForAll(this._footerRowHarness.with(filter))();\n }\n\n /** Gets the \"no data\" row in the table, if any. */\n async getNoDataRow(filter: RowHarnessFilters = {}): Promise<MatNoDataRowHarness | null> {\n return this.locatorForOptional(MatNoDataRowHarness.with(filter))();\n }\n\n /** Gets the text inside the entire table organized by rows. */\n async getCellTextByIndex(): Promise<string[][]> {\n const rows = await this.getRows();\n return parallel(() => rows.map(row => row.getCellTextByIndex()));\n }\n\n /** Gets the text inside the entire table organized by columns. */\n async getCellTextByColumnName(): Promise<MatTableHarnessColumnsText> {\n const [headerRows, footerRows, dataRows] = await parallel(() => [\n this.getHeaderRows(),\n this.getFooterRows(),\n this.getRows(),\n ]);\n\n const text: MatTableHarnessColumnsText = {};\n const [headerData, footerData, rowsData] = await parallel(() => [\n parallel(() => headerRows.map(row => row.getCellTextByColumnName())),\n parallel(() => footerRows.map(row => row.getCellTextByColumnName())),\n parallel(() => dataRows.map(row => row.getCellTextByColumnName())),\n ]);\n\n rowsData.forEach(data => {\n Object.keys(data).forEach(columnName => {\n const cellText = data[columnName];\n\n if (!text[columnName]) {\n text[columnName] = {\n headerText: getCellTextsByColumn(headerData, columnName),\n footerText: getCellTextsByColumn(footerData, columnName),\n text: [],\n };\n }\n\n text[columnName].text.push(cellText);\n });\n });\n\n return text;\n }\n}\n\n/** Extracts the text of cells only under a particular column. */\nfunction getCellTextsByColumn(rowsData: MatRowHarnessColumnsText[], column: string): string[] {\n const columnTexts: string[] = [];\n\n rowsData.forEach(data => {\n Object.keys(data).forEach(columnName => {\n if (columnName === column) {\n columnTexts.push(data[columnName]);\n }\n });\n });\n\n return columnTexts;\n}\n"],"names":["host","getAttribute","prefix","map","c","trim","find","startsWith","name","split","_getCellPredicate","type","options","MatCellHarness","_MatCellHarnessBase","hostSelector","with","getCellTextByIndex","filter","cells","getCells","cellsData","forEach","columnName","text","output","MatRowHarness","_MatRowHarnessBase","HarnessPredicate","_footerRowHarness","MatFooterRowHarness","getRows","locatorForAll","_rowHarness","getFooterRows","parallel","rows","row","getCellTextByColumnName","headerRows","footerRows","dataRows"],"mappings":";;;;;;AAuBI,EAAA;IAQK,MAAKA,IAAA,cAAkBA,IAAA,EAAA;iCAEhBA,IAAA,CAAAC,YAAA,CAAA,OAAA,CAAA;;YAEVC,MAAA,GAAA,aAAA;wCAMMC,GAAAA,CAAAA,CAAAA,GAAA,CAAAC,CAAA,IAAOA,CAAA,CAAAC,IAAA,EAAA,CAAA,CAIfC,UAA2BF,CAAA,CAAAG,UAAA,CAAAL,MAAA,CAAA,CAAA;;AAO7B,QAAA,OAAAM,IAAA,CAAAC,KAAA,CAAAP,MAAA,CAAA,CAAA,CAAA,CAAA;AACD;;eAGK,CAAsB,0CAAA,CAAA;;0BAEnBQ,CAAAC,IAAA,EAAAC,OAAe,EAAA;;;;AAYkD,MAAAC,cAAA,SAExEC,mBAA8E,CAAA;;;AAiB9E,IAAA,OAAAA,mBAAsB,CAAAJ,iBAAA,CAAA,IAAA,EAAAE,OAAsB,CAAA;;;;EAQ5C,OAAAG,YAAO,GAAqC,sBAAA;EAU5C,OAAAC,IAAAA,CAAAJ,OAAA,GAAA,EAAA,EAAA;;;;;;;;;;;;;;;;;;;;;QCxDEK,kBAEIA,CAAAC,MAAA,GAAA,EAAA,EAAA;AAcN,IAAA,MAAAC,KAAA,GAAA,MAAA,IAKA,CAAAC,QAAM,CAAAF,MAAA,CAAA;;AAQiE;;;AASvE,IAAA,MAAAC,KAAA,GAAA,MAAA,IAAA,CAAAC,QAAA,EAAA;;;;IAKGC,SAAA,CAAAC,OAAA,CAAA,CAAA,C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