@angular/material 21.0.0-next.9 → 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 -344
- 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 +120 -213
- 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/timepicker.d.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-field-testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/form-field/testing/error-harness.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/form-field/testing/form-field-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 BaseHarnessFilters,\n ComponentHarness,\n ComponentHarnessConstructor,\n HarnessPredicate,\n} from '@angular/cdk/testing';\n\n/** A set of criteria that can be used to filter a list of error harness instances. */\nexport interface ErrorHarnessFilters extends BaseHarnessFilters {\n /** Only find instances whose text matches the given value. */\n text?: string | RegExp;\n}\n\n/** Harness for interacting with a `mat-error` in tests. */\nexport class MatErrorHarness extends ComponentHarness {\n static hostSelector = '.mat-mdc-form-field-error';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for an error with specific\n * attributes.\n * @param options Options for filtering which error instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends MatErrorHarness>(\n this: ComponentHarnessConstructor<T>,\n options: ErrorHarnessFilters = {},\n ): HarnessPredicate<T> {\n return MatErrorHarness._getErrorPredicate(this, options);\n }\n\n protected static _getErrorPredicate<T extends MatErrorHarness>(\n type: ComponentHarnessConstructor<T>,\n options: ErrorHarnessFilters,\n ): HarnessPredicate<T> {\n return new HarnessPredicate(type, options).addOption('text', options.text, (harness, text) =>\n HarnessPredicate.stringMatches(harness.getText(), text),\n );\n }\n\n /** Gets a promise for the error's label text. */\n async getText(): 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.dev/license\n */\n\nimport {\n ComponentHarness,\n ComponentHarnessConstructor,\n HarnessPredicate,\n HarnessQuery,\n parallel,\n} from '@angular/cdk/testing';\nimport {ErrorHarnessFilters, MatErrorHarness} from './error-harness';\nimport {MatInputHarness} from '../../input/testing';\nimport {MatFormFieldControlHarness} from './control';\nimport {MatSelectHarness} from '../../select/testing';\nimport {MatDatepickerInputHarness, MatDateRangeInputHarness} from '../../datepicker/testing';\nimport {FormFieldHarnessFilters} from './form-field-harness-filters';\n\n/** Possible harnesses of controls which can be bound to a form-field. */\nexport type FormFieldControlHarness =\n | MatInputHarness\n | MatSelectHarness\n | MatDatepickerInputHarness\n | MatDateRangeInputHarness;\n\nexport class MatFormFieldHarness extends ComponentHarness {\n private _prefixContainer = this.locatorForOptional('.mat-mdc-form-field-text-prefix');\n private _suffixContainer = this.locatorForOptional('.mat-mdc-form-field-text-suffix');\n private _label = this.locatorForOptional('.mdc-floating-label');\n private _hints = this.locatorForAll('.mat-mdc-form-field-hint');\n private _inputControl = this.locatorForOptional(MatInputHarness);\n private _selectControl = this.locatorForOptional(MatSelectHarness);\n private _datepickerInputControl = this.locatorForOptional(MatDatepickerInputHarness);\n private _dateRangeInputControl = this.locatorForOptional(MatDateRangeInputHarness);\n private _textField = this.locatorFor('.mat-mdc-text-field-wrapper');\n private _errorHarness = MatErrorHarness;\n\n static hostSelector = '.mat-mdc-form-field';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a form field with specific\n * attributes.\n * @param options Options for filtering which form field instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends MatFormFieldHarness>(\n this: ComponentHarnessConstructor<T>,\n options: FormFieldHarnessFilters = {},\n ): HarnessPredicate<T> {\n return new HarnessPredicate(this, options)\n .addOption('floatingLabelText', options.floatingLabelText, async (harness, text) =>\n HarnessPredicate.stringMatches(await harness.getLabel(), text),\n )\n .addOption(\n 'hasErrors',\n options.hasErrors,\n async (harness, hasErrors) => (await harness.hasErrors()) === hasErrors,\n )\n .addOption(\n 'isValid',\n options.isValid,\n async (harness, isValid) => (await harness.isControlValid()) === isValid,\n );\n }\n\n /** Gets the appearance of the form-field. */\n async getAppearance(): Promise<'fill' | 'outline'> {\n const textFieldEl = await this._textField();\n if (await textFieldEl.hasClass('mdc-text-field--outlined')) {\n return 'outline';\n }\n return 'fill';\n }\n\n /** Whether the form-field has a label. */\n async hasLabel(): Promise<boolean> {\n return (await this._label()) !== null;\n }\n\n /** Whether the label is currently floating. */\n async isLabelFloating(): Promise<boolean> {\n const labelEl = await this._label();\n return labelEl !== null ? await labelEl.hasClass('mdc-floating-label--float-above') : false;\n }\n\n /** Gets the label of the form-field. */\n async getLabel(): Promise<string | null> {\n const labelEl = await this._label();\n return labelEl ? labelEl.text() : null;\n }\n\n /** Whether the form-field has errors. */\n async hasErrors(): Promise<boolean> {\n return (await this.getTextErrors()).length > 0;\n }\n\n /** Whether the form-field is disabled. */\n async isDisabled(): Promise<boolean> {\n return (await this.host()).hasClass('mat-form-field-disabled');\n }\n\n /** Whether the form-field is currently autofilled. */\n async isAutofilled(): Promise<boolean> {\n return (await this.host()).hasClass('mat-form-field-autofilled');\n }\n\n /**\n * Gets the harness of the control that is bound to the form-field. Only\n * default controls such as \"MatInputHarness\" and \"MatSelectHarness\" are\n * supported.\n */\n async getControl(): Promise<FormFieldControlHarness | null>;\n\n /**\n * Gets the harness of the control that is bound to the form-field. Searches\n * for a control that matches the specified harness type.\n */\n async getControl<X extends MatFormFieldControlHarness>(\n type: ComponentHarnessConstructor<X>,\n ): Promise<X | null>;\n\n /**\n * Gets the harness of the control that is bound to the form-field. Searches\n * for a control that matches the specified harness predicate.\n */\n async getControl<X extends MatFormFieldControlHarness>(\n type: HarnessPredicate<X>,\n ): Promise<X | null>;\n\n // Implementation of the \"getControl\" method overload signatures.\n async getControl<X extends MatFormFieldControlHarness>(type?: HarnessQuery<X>) {\n if (type) {\n return this.locatorForOptional(type)();\n }\n const [select, input, datepickerInput, dateRangeInput] = await parallel(() => [\n this._selectControl(),\n this._inputControl(),\n this._datepickerInputControl(),\n this._dateRangeInputControl(),\n ]);\n\n // Match the datepicker inputs first since they can also have a `MatInput`.\n return datepickerInput || dateRangeInput || select || input;\n }\n\n /** Gets the theme color of the form-field. */\n async getThemeColor(): Promise<'primary' | 'accent' | 'warn'> {\n const hostEl = await this.host();\n const [isAccent, isWarn] = await parallel(() => {\n return [hostEl.hasClass('mat-accent'), hostEl.hasClass('mat-warn')];\n });\n if (isAccent) {\n return 'accent';\n } else if (isWarn) {\n return 'warn';\n }\n return 'primary';\n }\n\n /** Gets error messages which are currently displayed in the form-field. */\n async getTextErrors(): Promise<string[]> {\n const errors = await this.getErrors();\n return parallel(() => errors.map(e => e.getText()));\n }\n\n /** Gets all of the error harnesses in the form field. */\n async getErrors(filter: ErrorHarnessFilters = {}): Promise<MatErrorHarness[]> {\n return this.locatorForAll(this._errorHarness.with(filter))();\n }\n\n /** Gets hint messages which are currently displayed in the form-field. */\n async getTextHints(): Promise<string[]> {\n const hints = await this._hints();\n return parallel(() => hints.map(e => e.text()));\n }\n\n /** Gets the text inside the prefix element. */\n async getPrefixText(): Promise<string> {\n const prefix = await this._prefixContainer();\n return prefix ? prefix.text() : '';\n }\n\n /** Gets the text inside the suffix element. */\n async getSuffixText(): Promise<string> {\n const suffix = await this._suffixContainer();\n return suffix ? suffix.text() : '';\n }\n\n /**\n * Whether the form control has been touched. Returns \"null\"\n * if no form control is set up.\n */\n async isControlTouched(): Promise<boolean | null> {\n if (!(await this._hasFormControl())) {\n return null;\n }\n return (await this.host()).hasClass('ng-touched');\n }\n\n /**\n * Whether the form control is dirty. Returns \"null\"\n * if no form control is set up.\n */\n async isControlDirty(): Promise<boolean | null> {\n if (!(await this._hasFormControl())) {\n return null;\n }\n return (await this.host()).hasClass('ng-dirty');\n }\n\n /**\n * Whether the form control is valid. Returns \"null\"\n * if no form control is set up.\n */\n async isControlValid(): Promise<boolean | null> {\n if (!(await this._hasFormControl())) {\n return null;\n }\n return (await this.host()).hasClass('ng-valid');\n }\n\n /**\n * Whether the form control is pending validation. Returns \"null\"\n * if no form control is set up.\n */\n async isControlPending(): Promise<boolean | null> {\n if (!(await this._hasFormControl())) {\n return null;\n }\n return (await this.host()).hasClass('ng-pending');\n }\n\n /** Checks whether the form-field control has set up a form control. */\n private async _hasFormControl(): Promise<boolean> {\n const hostEl = await this.host();\n // If no form \"NgControl\" is bound to the form-field control, the form-field\n // is not able to forward any control status classes. Therefore if either the\n // \"ng-touched\" or \"ng-untouched\" class is set, we know that it has a form control\n const [isTouched, isUntouched] = await parallel(() => [\n hostEl.hasClass('ng-touched'),\n hostEl.hasClass('ng-untouched'),\n ]);\n return isTouched || isUntouched;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;AAqBA;AACM,MAAO,eAAgB,SAAQ,gBAAgB,CAAA;AACnD,IAAA,OAAO,YAAY,GAAG,2BAA2B;AAEjD;;;;;AAKG;AACH,IAAA,OAAO,IAAI,CAET,OAAA,GAA+B,EAAE,EAAA;QAEjC,OAAO,eAAe,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC;;AAGhD,IAAA,OAAO,kBAAkB,CACjC,IAAoC,EACpC,OAA4B,EAAA;AAE5B,QAAA,OAAO,IAAI,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,IAAI,KACvF,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,CACxD;;;AAIH,IAAA,MAAM,OAAO,GAAA;QACX,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE;;;;ACpB/B,MAAO,mBAAoB,SAAQ,gBAAgB,CAAA;AAC/C,IAAA,gBA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AE;;;;QAIhC,MAAM,CAAC,SAAS,EAAE,WAAW,CAAC,GAAG,MAAM,QAAQ,CAAC,MAAM;AACpD,YAAA,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC;AAC7B,YAAA,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC;AAChC,SAAA,CAAC;QACF,OAAO,SAAS,IAAI,WAAW;;;;;;"}
|
|
1
|
+
{"version":3,"file":"form-field-testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/form-field/testing/form-field-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 ComponentHarness,\n ComponentHarnessConstructor,\n HarnessPredicate,\n HarnessQuery,\n parallel,\n} from '@angular/cdk/testing';\nimport {ErrorHarnessFilters, MatErrorHarness} from './error-harness';\nimport {MatInputHarness} from '../../input/testing';\nimport {MatFormFieldControlHarness} from './control';\nimport {MatSelectHarness} from '../../select/testing';\nimport {MatDatepickerInputHarness, MatDateRangeInputHarness} from '../../datepicker/testing';\nimport {FormFieldHarnessFilters} from './form-field-harness-filters';\n\n/** Possible harnesses of controls which can be bound to a form-field. */\nexport type FormFieldControlHarness =\n | MatInputHarness\n | MatSelectHarness\n | MatDatepickerInputHarness\n | MatDateRangeInputHarness;\n\nexport class MatFormFieldHarness extends ComponentHarness {\n private _prefixContainer = this.locatorForOptional('.mat-mdc-form-field-text-prefix');\n private _suffixContainer = this.locatorForOptional('.mat-mdc-form-field-text-suffix');\n private _label = this.locatorForOptional('.mdc-floating-label');\n private _hints = this.locatorForAll('.mat-mdc-form-field-hint');\n private _inputControl = this.locatorForOptional(MatInputHarness);\n private _selectControl = this.locatorForOptional(MatSelectHarness);\n private _datepickerInputControl = this.locatorForOptional(MatDatepickerInputHarness);\n private _dateRangeInputControl = this.locatorForOptional(MatDateRangeInputHarness);\n private _textField = this.locatorFor('.mat-mdc-text-field-wrapper');\n private _errorHarness = MatErrorHarness;\n\n static hostSelector = '.mat-mdc-form-field';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a form field with specific\n * attributes.\n * @param options Options for filtering which form field instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends MatFormFieldHarness>(\n this: ComponentHarnessConstructor<T>,\n options: FormFieldHarnessFilters = {},\n ): HarnessPredicate<T> {\n return new HarnessPredicate(this, options)\n .addOption('floatingLabelText', options.floatingLabelText, async (harness, text) =>\n HarnessPredicate.stringMatches(await harness.getLabel(), text),\n )\n .addOption(\n 'hasErrors',\n options.hasErrors,\n async (harness, hasErrors) => (await harness.hasErrors()) === hasErrors,\n )\n .addOption(\n 'isValid',\n options.isValid,\n async (harness, isValid) => (await harness.isControlValid()) === isValid,\n );\n }\n\n /** Gets the appearance of the form-field. */\n async getAppearance(): Promise<'fill' | 'outline'> {\n const textFieldEl = await this._textField();\n if (await textFieldEl.hasClass('mdc-text-field--outlined')) {\n return 'outline';\n }\n return 'fill';\n }\n\n /** Whether the form-field has a label. */\n async hasLabel(): Promise<boolean> {\n return (await this._label()) !== null;\n }\n\n /** Whether the label is currently floating. */\n async isLabelFloating(): Promise<boolean> {\n const labelEl = await this._label();\n return labelEl !== null ? await labelEl.hasClass('mdc-floating-label--float-above') : false;\n }\n\n /** Gets the label of the form-field. */\n async getLabel(): Promise<string | null> {\n const labelEl = await this._label();\n return labelEl ? labelEl.text() : null;\n }\n\n /** Whether the form-field has errors. */\n async hasErrors(): Promise<boolean> {\n return (await this.getTextErrors()).length > 0;\n }\n\n /** Whether the form-field is disabled. */\n async isDisabled(): Promise<boolean> {\n return (await this.host()).hasClass('mat-form-field-disabled');\n }\n\n /** Whether the form-field is currently autofilled. */\n async isAutofilled(): Promise<boolean> {\n return (await this.host()).hasClass('mat-form-field-autofilled');\n }\n\n /**\n * Gets the harness of the control that is bound to the form-field. Only\n * default controls such as \"MatInputHarness\" and \"MatSelectHarness\" are\n * supported.\n */\n async getControl(): Promise<FormFieldControlHarness | null>;\n\n /**\n * Gets the harness of the control that is bound to the form-field. Searches\n * for a control that matches the specified harness type.\n */\n async getControl<X extends MatFormFieldControlHarness>(\n type: ComponentHarnessConstructor<X>,\n ): Promise<X | null>;\n\n /**\n * Gets the harness of the control that is bound to the form-field. Searches\n * for a control that matches the specified harness predicate.\n */\n async getControl<X extends MatFormFieldControlHarness>(\n type: HarnessPredicate<X>,\n ): Promise<X | null>;\n\n // Implementation of the \"getControl\" method overload signatures.\n async getControl<X extends MatFormFieldControlHarness>(type?: HarnessQuery<X>) {\n if (type) {\n return this.locatorForOptional(type)();\n }\n const [select, input, datepickerInput, dateRangeInput] = await parallel(() => [\n this._selectControl(),\n this._inputControl(),\n this._datepickerInputControl(),\n this._dateRangeInputControl(),\n ]);\n\n // Match the datepicker inputs first since they can also have a `MatInput`.\n return datepickerInput || dateRangeInput || select || input;\n }\n\n /** Gets the theme color of the form-field. */\n async getThemeColor(): Promise<'primary' | 'accent' | 'warn'> {\n const hostEl = await this.host();\n const [isAccent, isWarn] = await parallel(() => {\n return [hostEl.hasClass('mat-accent'), hostEl.hasClass('mat-warn')];\n });\n if (isAccent) {\n return 'accent';\n } else if (isWarn) {\n return 'warn';\n }\n return 'primary';\n }\n\n /** Gets error messages which are currently displayed in the form-field. */\n async getTextErrors(): Promise<string[]> {\n const errors = await this.getErrors();\n return parallel(() => errors.map(e => e.getText()));\n }\n\n /** Gets all of the error harnesses in the form field. */\n async getErrors(filter: ErrorHarnessFilters = {}): Promise<MatErrorHarness[]> {\n return this.locatorForAll(this._errorHarness.with(filter))();\n }\n\n /** Gets hint messages which are currently displayed in the form-field. */\n async getTextHints(): Promise<string[]> {\n const hints = await this._hints();\n return parallel(() => hints.map(e => e.text()));\n }\n\n /** Gets the text inside the prefix element. */\n async getPrefixText(): Promise<string> {\n const prefix = await this._prefixContainer();\n return prefix ? prefix.text() : '';\n }\n\n /** Gets the text inside the suffix element. */\n async getSuffixText(): Promise<string> {\n const suffix = await this._suffixContainer();\n return suffix ? suffix.text() : '';\n }\n\n /**\n * Whether the form control has been touched. Returns \"null\"\n * if no form control is set up.\n */\n async isControlTouched(): Promise<boolean | null> {\n if (!(await this._hasFormControl())) {\n return null;\n }\n return (await this.host()).hasClass('ng-touched');\n }\n\n /**\n * Whether the form control is dirty. Returns \"null\"\n * if no form control is set up.\n */\n async isControlDirty(): Promise<boolean | null> {\n if (!(await this._hasFormControl())) {\n return null;\n }\n return (await this.host()).hasClass('ng-dirty');\n }\n\n /**\n * Whether the form control is valid. Returns \"null\"\n * if no form control is set up.\n */\n async isControlValid(): Promise<boolean | null> {\n if (!(await this._hasFormControl())) {\n return null;\n }\n return (await this.host()).hasClass('ng-valid');\n }\n\n /**\n * Whether the form control is pending validation. Returns \"null\"\n * if no form control is set up.\n */\n async isControlPending(): Promise<boolean | null> {\n if (!(await this._hasFormControl())) {\n return null;\n }\n return (await this.host()).hasClass('ng-pending');\n }\n\n /** Checks whether the form-field control has set up a form control. */\n private async _hasFormControl(): Promise<boolean> {\n const hostEl = await this.host();\n // If no form \"NgControl\" is bound to the form-field control, the form-field\n // is not able to forward any control status classes. Therefore if either the\n // \"ng-touched\" or \"ng-untouched\" class is set, we know that it has a form control\n const [isTouched, isUntouched] = await parallel(() => [\n hostEl.hasClass('ng-touched'),\n hostEl.hasClass('ng-untouched'),\n ]);\n return isTouched || isUntouched;\n }\n}\n"],"names":["_prefixContainer","locatorForOptional","_suffixContainer","_hints","locatorForAll","MatDatepickerInputHarness","_dateRangeInputControl","MatDateRangeInputHarness","_textField","locatorFor","_errorHarness","hostSelector","with","options","HarnessPredicate","getAppearance","textFieldEl","hasClass","_label","isLabelFloating","labelEl","getLabel","hasErrors","getTextErrors","length","isDisabled","host","isAutofilled","getControl","type","select","datepickerInput","dateRangeInput","parallel","_selectControl","_inputControl","_datepickerInputControl","input","getThemeColor","isAccent","isWarn","hostEl","errors","getErrors","map","e","getText","filter","getTextHints"],"m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|
17
17
|
class MatFormFieldModule {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
19
|
+
minVersion: "12.0.0",
|
|
20
|
+
version: "20.2.0-next.2",
|
|
21
|
+
ngImport: i0,
|
|
22
|
+
type: MatFormFieldModule,
|
|
23
|
+
deps: [],
|
|
24
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
25
|
+
});
|
|
26
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({
|
|
27
|
+
minVersion: "14.0.0",
|
|
28
|
+
version: "20.2.0-next.2",
|
|
29
|
+
ngImport: i0,
|
|
30
|
+
type: MatFormFieldModule,
|
|
31
|
+
imports: [ObserversModule, MatFormField, MatLabel, MatError, MatHint, MatPrefix, MatSuffix],
|
|
32
|
+
exports: [MatFormField, MatLabel, MatHint, MatError, MatPrefix, MatSuffix, BidiModule]
|
|
33
|
+
});
|
|
34
|
+
static ɵinj = i0.ɵɵngDeclareInjector({
|
|
35
|
+
minVersion: "12.0.0",
|
|
36
|
+
version: "20.2.0-next.2",
|
|
37
|
+
ngImport: i0,
|
|
38
|
+
type: MatFormFieldModule,
|
|
39
|
+
imports: [ObserversModule, MatFormField, BidiModule]
|
|
40
|
+
});
|
|
21
41
|
}
|
|
22
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
42
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
43
|
+
minVersion: "12.0.0",
|
|
44
|
+
version: "20.2.0-next.2",
|
|
45
|
+
ngImport: i0,
|
|
46
|
+
type: MatFormFieldModule,
|
|
47
|
+
decorators: [{
|
|
48
|
+
type: NgModule,
|
|
49
|
+
args: [{
|
|
50
|
+
imports: [ObserversModule, MatFormField, MatLabel, MatError, MatHint, MatPrefix, MatSuffix],
|
|
51
|
+
exports: [MatFormField, MatLabel, MatHint, MatError, MatPrefix, MatSuffix, BidiModule]
|
|
52
|
+
}]
|
|
53
|
+
}]
|
|
54
|
+
});
|
|
29
55
|
|
|
30
56
|
export { MatError, MatFormField, MatFormFieldModule, MatHint, MatLabel, MatPrefix, MatSuffix };
|
|
31
57
|
//# sourceMappingURL=form-field.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-field.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/form-field/form-field-module.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 {BidiModule} from '@angular/cdk/bidi';\nimport {ObserversModule} from '@angular/cdk/observers';\nimport {NgModule} from '@angular/core';\nimport {MatError} from './directives/error';\nimport {MatHint} from './directives/hint';\nimport {MatLabel} from './directives/label';\nimport {MatPrefix} from './directives/prefix';\nimport {MatSuffix} from './directives/suffix';\nimport {MatFormField} from './form-field';\n\n@NgModule({\n imports: [ObserversModule, MatFormField, MatLabel, MatError, MatHint, MatPrefix, MatSuffix],\n exports: [MatFormField, MatLabel, MatHint, MatError, MatPrefix, MatSuffix, BidiModule],\n})\nexport class MatFormFieldModule {}\n"],"names":[
|
|
1
|
+
{"version":3,"file":"form-field.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/form-field/form-field-module.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 {BidiModule} from '@angular/cdk/bidi';\nimport {ObserversModule} from '@angular/cdk/observers';\nimport {NgModule} from '@angular/core';\nimport {MatError} from './directives/error';\nimport {MatHint} from './directives/hint';\nimport {MatLabel} from './directives/label';\nimport {MatPrefix} from './directives/prefix';\nimport {MatSuffix} from './directives/suffix';\nimport {MatFormField} from './form-field';\n\n@NgModule({\n imports: [ObserversModule, MatFormField, MatLabel, MatError, MatHint, MatPrefix, MatSuffix],\n exports: [MatFormField, MatLabel, MatHint, MatError, MatPrefix, MatSuffix, BidiModule],\n})\nexport class MatFormFieldModule {}\n"],"names":["ɵmod","i0","ɵɵngDeclareNgModule","minVersion","version","ngImport","type","MatFormFieldModule","imports","ObserversModule","MatFormField","MatLabel","MatError","MatHint","MatPrefix","MatSuffix","exports","BidiModule","decorators"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAsBa,EAAA,OAAAA,IAAA,GAAAC,EAAA,CAAAC,mBAAA,CAAA;IAAAC,UAAA,EAAA,QAAA;IAAAC,OAAA,EAAA,eAAA;AAAAC,IAAAA,QAAA,EAAAJ,EAAA;AAAAK,IAAAA,IAAA,EAAAC,kBAAA;AAAAC,IAAAA,OAAA,EAAAC,CAAAA,eAAA,EAAAC,YAAA,EAAAC,QAAA,EAAAC,QAAA,EAAAC,OAAA,EAAAC,SAAA,EAAAC,SAAA,CAAA;AAAAC,IAAAA,OAAA,EAAAN,CAAAA,YAAA,EAAAC,QAAA,EAAAE,OAAA,EAAAD,QAAA,EAAAE,SAAA,EAAAC,SAAA,EAAAE,UAAA;AAAA,GAAA,CAAA;;;;;;;;;2BAJJ,CAAA;AAAAd,EAAAA,UAAA,EAAA,QAAA;EAAAC,OAAA,EAAA,eAAA;AAAAC,EAAAA,QAAA,EAAAJ,EAAA;AAAAK,EAAAA,IAAA,EAAAC,kBAAA;EAAAW,UAAA,EAAA,CAAA;;;;;;;;;;;"}
|
|
@@ -1,127 +1,79 @@
|
|
|
1
1
|
import { ContentContainerComponentHarness, HarnessPredicate, ComponentHarness, parallel } from '@angular/cdk/testing';
|
|
2
2
|
import { ɵTileCoordinator as _TileCoordinator } from './_public-api-chunk.mjs';
|
|
3
3
|
|
|
4
|
-
/** Selectors for the various `mat-grid-tile` sections that may contain user content. */
|
|
5
4
|
var MatGridTileSection;
|
|
6
5
|
(function (MatGridTileSection) {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
MatGridTileSection["HEADER"] = ".mat-grid-tile-header";
|
|
7
|
+
MatGridTileSection["FOOTER"] = ".mat-grid-tile-footer";
|
|
9
8
|
})(MatGridTileSection || (MatGridTileSection = {}));
|
|
10
|
-
/** Harness for interacting with a standard `MatGridTitle` in tests. */
|
|
11
9
|
class MatGridTileHarness extends ContentContainerComponentHarness {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return (await this._footer()) !== null;
|
|
43
|
-
}
|
|
44
|
-
/** Whether the grid-tile has an avatar. */
|
|
45
|
-
async hasAvatar() {
|
|
46
|
-
return (await this._avatar()) !== null;
|
|
47
|
-
}
|
|
48
|
-
/** Gets the text of the header if present. */
|
|
49
|
-
async getHeaderText() {
|
|
50
|
-
// For performance reasons, we do not use "hasHeader" as
|
|
51
|
-
// we would then need to query twice for the header.
|
|
52
|
-
const headerEl = await this._header();
|
|
53
|
-
return headerEl ? headerEl.text() : null;
|
|
54
|
-
}
|
|
55
|
-
/** Gets the text of the footer if present. */
|
|
56
|
-
async getFooterText() {
|
|
57
|
-
// For performance reasons, we do not use "hasFooter" as
|
|
58
|
-
// we would then need to query twice for the footer.
|
|
59
|
-
const headerEl = await this._footer();
|
|
60
|
-
return headerEl ? headerEl.text() : null;
|
|
61
|
-
}
|
|
10
|
+
static hostSelector = '.mat-grid-tile';
|
|
11
|
+
static with(options = {}) {
|
|
12
|
+
return new HarnessPredicate(MatGridTileHarness, options).addOption('headerText', options.headerText, (harness, pattern) => HarnessPredicate.stringMatches(harness.getHeaderText(), pattern)).addOption('footerText', options.footerText, (harness, pattern) => HarnessPredicate.stringMatches(harness.getFooterText(), pattern));
|
|
13
|
+
}
|
|
14
|
+
_header = this.locatorForOptional(MatGridTileSection.HEADER);
|
|
15
|
+
_footer = this.locatorForOptional(MatGridTileSection.FOOTER);
|
|
16
|
+
_avatar = this.locatorForOptional('.mat-grid-avatar');
|
|
17
|
+
async getRowspan() {
|
|
18
|
+
return Number(await (await this.host()).getAttribute('rowspan'));
|
|
19
|
+
}
|
|
20
|
+
async getColspan() {
|
|
21
|
+
return Number(await (await this.host()).getAttribute('colspan'));
|
|
22
|
+
}
|
|
23
|
+
async hasHeader() {
|
|
24
|
+
return (await this._header()) !== null;
|
|
25
|
+
}
|
|
26
|
+
async hasFooter() {
|
|
27
|
+
return (await this._footer()) !== null;
|
|
28
|
+
}
|
|
29
|
+
async hasAvatar() {
|
|
30
|
+
return (await this._avatar()) !== null;
|
|
31
|
+
}
|
|
32
|
+
async getHeaderText() {
|
|
33
|
+
const headerEl = await this._header();
|
|
34
|
+
return headerEl ? headerEl.text() : null;
|
|
35
|
+
}
|
|
36
|
+
async getFooterText() {
|
|
37
|
+
const headerEl = await this._footer();
|
|
38
|
+
return headerEl ? headerEl.text() : null;
|
|
39
|
+
}
|
|
62
40
|
}
|
|
63
41
|
|
|
64
|
-
/** Harness for interacting with a standard `MatGridList` in tests. */
|
|
65
42
|
class MatGridListHarness extends ComponentHarness {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
const [tileHarnesses, columns] = await parallel(() => [this.getTiles(), this.getColumns()]);
|
|
98
|
-
const tileSpans = tileHarnesses.map(t => parallel(() => [t.getColspan(), t.getRowspan()]));
|
|
99
|
-
const tiles = (await parallel(() => tileSpans)).map(([colspan, rowspan]) => ({
|
|
100
|
-
colspan,
|
|
101
|
-
rowspan,
|
|
102
|
-
}));
|
|
103
|
-
// Update the tile coordinator to reflect the current column amount and
|
|
104
|
-
// rendered tiles. We update upon every call of this method since we do not
|
|
105
|
-
// know if tiles have been added, removed or updated (in terms of rowspan/colspan).
|
|
106
|
-
this._tileCoordinator.update(columns, tiles);
|
|
107
|
-
// The tile coordinator respects the colspan and rowspan for calculating the positions
|
|
108
|
-
// of tiles, but it does not create multiple position entries if a tile spans over multiple
|
|
109
|
-
// columns or rows. We want to provide an API where developers can retrieve a tile based on
|
|
110
|
-
// any position that lies within the visual tile boundaries. For example: If a tile spans
|
|
111
|
-
// over two columns, then the same tile should be returned for either column indices.
|
|
112
|
-
for (let i = 0; i < this._tileCoordinator.positions.length; i++) {
|
|
113
|
-
const position = this._tileCoordinator.positions[i];
|
|
114
|
-
const { rowspan, colspan } = tiles[i];
|
|
115
|
-
// Return the tile harness if the given position visually resolves to the tile.
|
|
116
|
-
if (column >= position.col &&
|
|
117
|
-
column <= position.col + colspan - 1 &&
|
|
118
|
-
row >= position.row &&
|
|
119
|
-
row <= position.row + rowspan - 1) {
|
|
120
|
-
return tileHarnesses[i];
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
throw Error('Could not find tile at given position.');
|
|
43
|
+
static hostSelector = '.mat-grid-list';
|
|
44
|
+
static with(options = {}) {
|
|
45
|
+
return new HarnessPredicate(MatGridListHarness, options);
|
|
46
|
+
}
|
|
47
|
+
_tileCoordinator = new _TileCoordinator();
|
|
48
|
+
async getTiles(filters = {}) {
|
|
49
|
+
return await this.locatorForAll(MatGridTileHarness.with(filters))();
|
|
50
|
+
}
|
|
51
|
+
async getColumns() {
|
|
52
|
+
return Number(await (await this.host()).getAttribute('cols'));
|
|
53
|
+
}
|
|
54
|
+
async getTileAtPosition({
|
|
55
|
+
row,
|
|
56
|
+
column
|
|
57
|
+
}) {
|
|
58
|
+
const [tileHarnesses, columns] = await parallel(() => [this.getTiles(), this.getColumns()]);
|
|
59
|
+
const tileSpans = tileHarnesses.map(t => parallel(() => [t.getColspan(), t.getRowspan()]));
|
|
60
|
+
const tiles = (await parallel(() => tileSpans)).map(([colspan, rowspan]) => ({
|
|
61
|
+
colspan,
|
|
62
|
+
rowspan
|
|
63
|
+
}));
|
|
64
|
+
this._tileCoordinator.update(columns, tiles);
|
|
65
|
+
for (let i = 0; i < this._tileCoordinator.positions.length; i++) {
|
|
66
|
+
const position = this._tileCoordinator.positions[i];
|
|
67
|
+
const {
|
|
68
|
+
rowspan,
|
|
69
|
+
colspan
|
|
70
|
+
} = tiles[i];
|
|
71
|
+
if (column >= position.col && column <= position.col + colspan - 1 && row >= position.row && row <= position.row + rowspan - 1) {
|
|
72
|
+
return tileHarnesses[i];
|
|
73
|
+
}
|
|
124
74
|
}
|
|
75
|
+
throw Error('Could not find tile at given position.');
|
|
76
|
+
}
|
|
125
77
|
}
|
|
126
78
|
|
|
127
79
|
export { MatGridListHarness, MatGridTileHarness, MatGridTileSection };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid-list-testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/grid-list/testing/grid-tile-harness.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/grid-list/testing/grid-list-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 {ContentContainerComponentHarness, HarnessPredicate} from '@angular/cdk/testing';\nimport {GridTileHarnessFilters} from './grid-list-harness-filters';\n\n/** Selectors for the various `mat-grid-tile` sections that may contain user content. */\nexport enum MatGridTileSection {\n HEADER = '.mat-grid-tile-header',\n FOOTER = '.mat-grid-tile-footer',\n}\n\n/** Harness for interacting with a standard `MatGridTitle` in tests. */\nexport class MatGridTileHarness extends ContentContainerComponentHarness<MatGridTileSection> {\n /** The selector for the host element of a `MatGridTile` instance. */\n static hostSelector = '.mat-grid-tile';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatGridTileHarness`\n * that meets certain criteria.\n * @param options Options for filtering which dialog instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: GridTileHarnessFilters = {}): HarnessPredicate<MatGridTileHarness> {\n return new HarnessPredicate(MatGridTileHarness, options)\n .addOption('headerText', options.headerText, (harness, pattern) =>\n HarnessPredicate.stringMatches(harness.getHeaderText(), pattern),\n )\n .addOption('footerText', options.footerText, (harness, pattern) =>\n HarnessPredicate.stringMatches(harness.getFooterText(), pattern),\n );\n }\n\n private _header = this.locatorForOptional(MatGridTileSection.HEADER);\n private _footer = this.locatorForOptional(MatGridTileSection.FOOTER);\n private _avatar = this.locatorForOptional('.mat-grid-avatar');\n\n /** Gets the amount of rows that the grid-tile takes up. */\n async getRowspan(): Promise<number> {\n return Number(await (await this.host()).getAttribute('rowspan'));\n }\n\n /** Gets the amount of columns that the grid-tile takes up. */\n async getColspan(): Promise<number> {\n return Number(await (await this.host()).getAttribute('colspan'));\n }\n\n /** Whether the grid-tile has a header. */\n async hasHeader(): Promise<boolean> {\n return (await this._header()) !== null;\n }\n\n /** Whether the grid-tile has a footer. */\n async hasFooter(): Promise<boolean> {\n return (await this._footer()) !== null;\n }\n\n /** Whether the grid-tile has an avatar. */\n async hasAvatar(): Promise<boolean> {\n return (await this._avatar()) !== null;\n }\n\n /** Gets the text of the header if present. */\n async getHeaderText(): Promise<string | null> {\n // For performance reasons, we do not use \"hasHeader\" as\n // we would then need to query twice for the header.\n const headerEl = await this._header();\n return headerEl ? headerEl.text() : null;\n }\n\n /** Gets the text of the footer if present. */\n async getFooterText(): Promise<string | null> {\n // For performance reasons, we do not use \"hasFooter\" as\n // we would then need to query twice for the footer.\n const headerEl = await this._footer();\n return headerEl ? headerEl.text() : null;\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 {ComponentHarness, HarnessPredicate, parallel} from '@angular/cdk/testing';\nimport {ɵTileCoordinator as TileCoordinator} from '../../grid-list';\nimport {GridListHarnessFilters, GridTileHarnessFilters} from './grid-list-harness-filters';\nimport {MatGridTileHarness} from './grid-tile-harness';\n\n/** Harness for interacting with a standard `MatGridList` in tests. */\nexport class MatGridListHarness extends ComponentHarness {\n /** The selector for the host element of a `MatGridList` instance. */\n static hostSelector = '.mat-grid-list';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatGridListHarness`\n * that meets certain criteria.\n * @param options Options for filtering which dialog instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: GridListHarnessFilters = {}): HarnessPredicate<MatGridListHarness> {\n return new HarnessPredicate(MatGridListHarness, options);\n }\n\n /**\n * Tile coordinator that is used by the \"MatGridList\" for computing\n * positions of tiles. We leverage the coordinator to provide an API\n * for retrieving tiles based on visual tile positions.\n */\n private _tileCoordinator = new TileCoordinator();\n\n /** Gets all tiles of the grid-list. */\n async getTiles(filters: GridTileHarnessFilters = {}): Promise<MatGridTileHarness[]> {\n return await this.locatorForAll(MatGridTileHarness.with(filters))();\n }\n\n /** Gets the amount of columns of the grid-list. */\n async getColumns(): Promise<number> {\n return Number(await (await this.host()).getAttribute('cols'));\n }\n\n /**\n * Gets a tile of the grid-list that is located at the given location.\n * @param row Zero-based row index.\n * @param column Zero-based column index.\n */\n async getTileAtPosition({\n row,\n column,\n }: {\n row: number;\n column: number;\n }): Promise<MatGridTileHarness> {\n const [tileHarnesses, columns] = await parallel(() => [this.getTiles(), this.getColumns()]);\n const tileSpans = tileHarnesses.map(t => parallel(() => [t.getColspan(), t.getRowspan()]));\n const tiles = (await parallel(() => tileSpans)).map(([colspan, rowspan]) => ({\n colspan,\n rowspan,\n }));\n // Update the tile coordinator to reflect the current column amount and\n // rendered tiles. We update upon every call of this method since we do not\n // know if tiles have been added, removed or updated (in terms of rowspan/colspan).\n this._tileCoordinator.update(columns, tiles);\n // The tile coordinator respects the colspan and rowspan for calculating the positions\n // of tiles, but it does not create multiple position entries if a tile spans over multiple\n // columns or rows. We want to provide an API where developers can retrieve a tile based on\n // any position that lies within the visual tile boundaries. For example: If a tile spans\n // over two columns, then the same tile should be returned for either column indices.\n for (let i = 0; i < this._tileCoordinator.positions.length; i++) {\n const position = this._tileCoordinator.positions[i];\n const {rowspan, colspan} = tiles[i];\n // Return the tile harness if the given position visually resolves to the tile.\n if (\n column >= position.col &&\n column <= position.col + colspan - 1 &&\n row >= position.row &&\n row <= position.row + rowspan - 1\n ) {\n return tileHarnesses[i];\n }\n }\n throw Error('Could not find tile at given position.');\n }\n}\n"],"names":["TileCoordinator"],"mappings":";;;AAWA;IACY;AAAZ,CAAA,UAAY,kBAAkB,EAAA;AAC5B,IAAA,kBAAA,CAAA,QAAA,CAAA,GAAA,uBAAgC;AAChC,IAAA,kBAAA,CAAA,QAAA,CAAA,GAAA,uBAAgC;AAClC,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,GAG7B,EAAA,CAAA,CAAA;AAED;AACM,MAAO,kBAAmB,SAAQ,gCAAoD,CAAA;;AAE1F,IAAA,OAAO,YAAY,GAAG,gBAAgB;AAEtC;;;;;AAKG;AACH,IAAA,OAAO,IAAI,CAAC,OAAA,GAAkC,EAAE,EAAA;AAC9C,QAAA,OAAO,IAAI,gBAAgB,CAAC,kBAAkB,EAAE,OAAO;aACpD,SAAS,CAAC,YAAY,EAAE,OAAO,CAAC,UAAU,EAAE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,OAAO,CAAC,MAAM;YAC3E,OAAO;YACP,OAAO;AACR,SAAA,CAAC,CAAC;;;;QAIH,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC;;;;;;AAM5C,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC/D,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC;YACnD,MAAM,EAAC,OAAO,EAAE,OAAO,EAAC,GAAG,KAAK,CAAC,CAAC,CAAC;;AAEnC,YAAA,IACE,MAAM,IAAI,QAAQ,CAAC,GAAG;AACtB,gBAAA,MAAM,IAAI,QAAQ,CAAC,GAAG,GAAG,OAAO,GAAG,CAAC;gBACpC,GAAG,IAAI,QAAQ,CAAC,GAAG;gBACnB,GAAG,IAAI,QAAQ,CAAC,GAAG,GAAG,OAAO,GAAG,CAAC,EACjC;AACA,gBAAA,OAAO,aAAa,CAAC,CAAC,CAAC;;;AAG3B,QAAA,MAAM,KAAK,CAAC,wCAAwC,CAAC;;;;;;"}
|
|
1
|
+
{"version":3,"file":"grid-list-testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/grid-list/testing/grid-tile-harness.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/grid-list/testing/grid-list-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 {ContentContainerComponentHarness, HarnessPredicate} from '@angular/cdk/testing';\nimport {GridTileHarnessFilters} from './grid-list-harness-filters';\n\n/** Selectors for the various `mat-grid-tile` sections that may contain user content. */\nexport enum MatGridTileSection {\n HEADER = '.mat-grid-tile-header',\n FOOTER = '.mat-grid-tile-footer',\n}\n\n/** Harness for interacting with a standard `MatGridTitle` in tests. */\nexport class MatGridTileHarness extends ContentContainerComponentHarness<MatGridTileSection> {\n /** The selector for the host element of a `MatGridTile` instance. */\n static hostSelector = '.mat-grid-tile';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatGridTileHarness`\n * that meets certain criteria.\n * @param options Options for filtering which dialog instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: GridTileHarnessFilters = {}): HarnessPredicate<MatGridTileHarness> {\n return new HarnessPredicate(MatGridTileHarness, options)\n .addOption('headerText', options.headerText, (harness, pattern) =>\n HarnessPredicate.stringMatches(harness.getHeaderText(), pattern),\n )\n .addOption('footerText', options.footerText, (harness, pattern) =>\n HarnessPredicate.stringMatches(harness.getFooterText(), pattern),\n );\n }\n\n private _header = this.locatorForOptional(MatGridTileSection.HEADER);\n private _footer = this.locatorForOptional(MatGridTileSection.FOOTER);\n private _avatar = this.locatorForOptional('.mat-grid-avatar');\n\n /** Gets the amount of rows that the grid-tile takes up. */\n async getRowspan(): Promise<number> {\n return Number(await (await this.host()).getAttribute('rowspan'));\n }\n\n /** Gets the amount of columns that the grid-tile takes up. */\n async getColspan(): Promise<number> {\n return Number(await (await this.host()).getAttribute('colspan'));\n }\n\n /** Whether the grid-tile has a header. */\n async hasHeader(): Promise<boolean> {\n return (await this._header()) !== null;\n }\n\n /** Whether the grid-tile has a footer. */\n async hasFooter(): Promise<boolean> {\n return (await this._footer()) !== null;\n }\n\n /** Whether the grid-tile has an avatar. */\n async hasAvatar(): Promise<boolean> {\n return (await this._avatar()) !== null;\n }\n\n /** Gets the text of the header if present. */\n async getHeaderText(): Promise<string | null> {\n // For performance reasons, we do not use \"hasHeader\" as\n // we would then need to query twice for the header.\n const headerEl = await this._header();\n return headerEl ? headerEl.text() : null;\n }\n\n /** Gets the text of the footer if present. */\n async getFooterText(): Promise<string | null> {\n // For performance reasons, we do not use \"hasFooter\" as\n // we would then need to query twice for the footer.\n const headerEl = await this._footer();\n return headerEl ? headerEl.text() : null;\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 {ComponentHarness, HarnessPredicate, parallel} from '@angular/cdk/testing';\nimport {ɵTileCoordinator as TileCoordinator} from '../../grid-list';\nimport {GridListHarnessFilters, GridTileHarnessFilters} from './grid-list-harness-filters';\nimport {MatGridTileHarness} from './grid-tile-harness';\n\n/** Harness for interacting with a standard `MatGridList` in tests. */\nexport class MatGridListHarness extends ComponentHarness {\n /** The selector for the host element of a `MatGridList` instance. */\n static hostSelector = '.mat-grid-list';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatGridListHarness`\n * that meets certain criteria.\n * @param options Options for filtering which dialog instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: GridListHarnessFilters = {}): HarnessPredicate<MatGridListHarness> {\n return new HarnessPredicate(MatGridListHarness, options);\n }\n\n /**\n * Tile coordinator that is used by the \"MatGridList\" for computing\n * positions of tiles. We leverage the coordinator to provide an API\n * for retrieving tiles based on visual tile positions.\n */\n private _tileCoordinator = new TileCoordinator();\n\n /** Gets all tiles of the grid-list. */\n async getTiles(filters: GridTileHarnessFilters = {}): Promise<MatGridTileHarness[]> {\n return await this.locatorForAll(MatGridTileHarness.with(filters))();\n }\n\n /** Gets the amount of columns of the grid-list. */\n async getColumns(): Promise<number> {\n return Number(await (await this.host()).getAttribute('cols'));\n }\n\n /**\n * Gets a tile of the grid-list that is located at the given location.\n * @param row Zero-based row index.\n * @param column Zero-based column index.\n */\n async getTileAtPosition({\n row,\n column,\n }: {\n row: number;\n column: number;\n }): Promise<MatGridTileHarness> {\n const [tileHarnesses, columns] = await parallel(() => [this.getTiles(), this.getColumns()]);\n const tileSpans = tileHarnesses.map(t => parallel(() => [t.getColspan(), t.getRowspan()]));\n const tiles = (await parallel(() => tileSpans)).map(([colspan, rowspan]) => ({\n colspan,\n rowspan,\n }));\n // Update the tile coordinator to reflect the current column amount and\n // rendered tiles. We update upon every call of this method since we do not\n // know if tiles have been added, removed or updated (in terms of rowspan/colspan).\n this._tileCoordinator.update(columns, tiles);\n // The tile coordinator respects the colspan and rowspan for calculating the positions\n // of tiles, but it does not create multiple position entries if a tile spans over multiple\n // columns or rows. We want to provide an API where developers can retrieve a tile based on\n // any position that lies within the visual tile boundaries. For example: If a tile spans\n // over two columns, then the same tile should be returned for either column indices.\n for (let i = 0; i < this._tileCoordinator.positions.length; i++) {\n const position = this._tileCoordinator.positions[i];\n const {rowspan, colspan} = tiles[i];\n // Return the tile harness if the given position visually resolves to the tile.\n if (\n column >= position.col &&\n column <= position.col + colspan - 1 &&\n row >= position.row &&\n row <= position.row + rowspan - 1\n ) {\n return tileHarnesses[i];\n }\n }\n throw Error('Could not find tile at given position.');\n }\n}\n"],"names":["MatGridTileSection","MatGridTileHarness","ContentContainerComponentHarness","locatorForOptional","FOOTER","getRowspan","Number","host","getAttribute","getColspan","hasHeader","hasFooter","_footer","hasAvatar","hostSelector","with","options","TileCoordinator","getTiles","filters","getTileAtPosition","row","column","_tileCoordinator","update","columns","tiles"],"mappings":";;;;;;;AAYYA,CAAAA,EAAAA,kBAAA,KAAAA,kBAAA,GAAA,EAAA,CAAA,CAAA;AAUVC,MAAAA,kBAAA,SAAAC,gCAAA,CAAA;;qBAWc,GAAa,EAAA,EAAA;;;;AAWzB,EAAA,OAAA,GAAA,IAAA,CAAAC,kBAAA,CAAAH,kBAAA,CAAAI,MAAA,CAAA;SACF,GAAA,IAAA,CAAAD,kBAAA,CAAA,kBAAA,CAAA;AAGAE,EAAAA,MAAAA,UAAAA,GAAgB;WAI0BC,MAAA,CAAA,MAAA,CAAA,MAAA,IAAA,CAAAC,IAAA,EAAAC,EAAAA,YAAA,CAAA,SAAA,CAAA,CAAA;;AAOjC,EAAA,MAAAC,UAAWA,GAAA;AACpB,IAAA,OAAAH,MAAA,CAAA,MAAA,CAAA,MAAA,IAAA,CAAAC,IAAA,IAAAC,YAAA,CAAA,SAAA,CAAA,CAAA;AAGA;AAEAE,EAAAA,MAAAA,SAAAA,GAAA;;;AAMEC,EAAAA,MAAAA,SAAAA;AACA,IAAA,OAAA,CAAA,MAAA,IAAA,CAAAC,OAAA,EAAA,MAAA,IAAA;;iBAKwDC,GAAA;;AAGxD;;;;;;;;;;;;AChEF,EAAA,OAAAC,YAAA,GAAA,gBAAA;EAYA,OAAAC,IAAAA,CAAAC,OAAA,GAAA,EAAA,EAAA;;;AAUA,EAAA,gBAAA,GAAA,IAAAC,gBAAA,EAAA;AAIE,EAAA,MAAAC,SAAAC,OAAA,GAAA,EAAA,EAAA;;;;;AAQF;yBAayEC,CAAA;IAAAC,GAAA;AAAAC,IAAAA;AAAA,GAAA,EAAA;;;;;;;AAmBnE,IAAA,IAAA,CAAAC,gBAAoB,CAAAC,MAAA,CAAAC,OAAG,EAAAC,KAAA,CAAA;;;;;;;;;;;;;;;;;"}
|