@angular/material 12.0.0-rc.0 → 12.0.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/bundles/material-chips.umd.js.map +1 -1
- package/bundles/material-core.umd.js +27 -30
- package/bundles/material-core.umd.js.map +1 -1
- package/bundles/material-datepicker-testing.umd.js +5 -5
- package/bundles/material-datepicker-testing.umd.js.map +1 -1
- package/bundles/material-datepicker.umd.js +57 -7
- package/bundles/material-datepicker.umd.js.map +1 -1
- package/bundles/material-form-field-testing.umd.js +16 -8
- package/bundles/material-form-field-testing.umd.js.map +1 -1
- package/bundles/material-menu.umd.js.map +1 -1
- package/bundles/material-paginator.umd.js +1 -0
- package/bundles/material-paginator.umd.js.map +1 -1
- package/bundles/material-table-testing.umd.js +103 -143
- package/bundles/material-table-testing.umd.js.map +1 -1
- package/bundles/material-tabs.umd.js +8 -1
- package/bundles/material-tabs.umd.js.map +1 -1
- package/bundles/material-tree.umd.js +1 -3
- package/bundles/material-tree.umd.js.map +1 -1
- package/chips/chip.d.ts +2 -1
- package/chips/index.metadata.json +1 -1
- package/core/common-behaviors/color.d.ts +3 -3
- package/core/common-behaviors/constructor.d.ts +1 -3
- package/core/common-behaviors/disable-ripple.d.ts +2 -2
- package/core/common-behaviors/disabled.d.ts +3 -3
- package/core/common-behaviors/error-state.d.ts +3 -3
- package/core/common-behaviors/tabindex.d.ts +1 -1
- package/core/index.metadata.json +1 -1
- package/core/ripple/ripple-renderer.d.ts +2 -0
- package/core/ripple/ripple.d.ts +2 -0
- package/datepicker/date-range-input-parts.d.ts +2 -0
- package/datepicker/date-range-input.d.ts +6 -1
- package/datepicker/date-selection-model.d.ts +2 -0
- package/datepicker/datepicker-base.d.ts +1 -0
- package/datepicker/datepicker-input.d.ts +4 -2
- package/datepicker/index.metadata.json +1 -1
- package/datepicker/testing/datepicker-input-harness-base.d.ts +3 -2
- package/esm2015/chips/chip.js +1 -1
- package/esm2015/core/common-behaviors/color.js +1 -2
- package/esm2015/core/common-behaviors/common-module.js +1 -1
- package/esm2015/core/common-behaviors/constructor.js +1 -1
- package/esm2015/core/common-behaviors/disable-ripple.js +3 -8
- package/esm2015/core/common-behaviors/disabled.js +1 -2
- package/esm2015/core/common-behaviors/error-state.js +1 -5
- package/esm2015/core/common-behaviors/tabindex.js +3 -10
- package/esm2015/core/ripple/ripple-renderer.js +9 -1
- package/esm2015/core/ripple/ripple.js +8 -1
- package/esm2015/core/version.js +1 -1
- package/esm2015/datepicker/date-range-input-parts.js +23 -1
- package/esm2015/datepicker/date-range-input.js +18 -3
- package/esm2015/datepicker/date-selection-model.js +3 -2
- package/esm2015/datepicker/datepicker-base.js +8 -3
- package/esm2015/datepicker/datepicker-input.js +8 -1
- package/esm2015/datepicker/datepicker-toggle.js +1 -1
- package/esm2015/datepicker/testing/datepicker-input-harness-base.js +4 -3
- package/esm2015/form-field/testing/form-field-harness.js +12 -3
- package/esm2015/menu/menu-trigger.js +1 -1
- package/esm2015/menu/menu.js +1 -1
- package/esm2015/paginator/paginator.js +2 -1
- package/esm2015/table/testing/cell-harness.js +9 -9
- package/esm2015/table/testing/row-harness.js +38 -70
- package/esm2015/table/testing/table-harness.js +23 -15
- package/esm2015/tabs/paginated-tab-header.js +2 -2
- package/esm2015/tabs/tab-group.js +8 -1
- package/esm2015/tree/data-source/nested-data-source.js +2 -4
- package/fesm2015/chips.js.map +1 -1
- package/fesm2015/core.js +21 -24
- package/fesm2015/core.js.map +1 -1
- package/fesm2015/datepicker/testing.js +2 -1
- package/fesm2015/datepicker/testing.js.map +1 -1
- package/fesm2015/datepicker.js +55 -5
- package/fesm2015/datepicker.js.map +1 -1
- package/fesm2015/form-field/testing.js +11 -2
- package/fesm2015/form-field/testing.js.map +1 -1
- package/fesm2015/menu.js.map +1 -1
- package/fesm2015/paginator.js +1 -0
- package/fesm2015/paginator.js.map +1 -1
- package/fesm2015/table/testing.js +66 -90
- package/fesm2015/table/testing.js.map +1 -1
- package/fesm2015/tabs.js +8 -1
- package/fesm2015/tabs.js.map +1 -1
- package/fesm2015/tree.js +1 -3
- package/fesm2015/tree.js.map +1 -1
- package/form-field/testing/form-field-harness.d.ts +6 -1
- package/package.json +6 -6
- package/paginator/index.metadata.json +1 -1
- package/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.css +1 -1
- package/schematics/collection.json +0 -6
- package/schematics/ng-add/index.js +2 -2
- package/schematics/ng-update/index.js +3 -1
- package/schematics/{ng-generate/theming-api → ng-update/migrations/theming-api-v12}/config.d.ts +6 -0
- package/schematics/ng-update/migrations/theming-api-v12/config.js +206 -0
- package/schematics/{ng-generate/theming-api → ng-update/migrations/theming-api-v12}/migration.d.ts +0 -0
- package/schematics/ng-update/migrations/theming-api-v12/migration.js +234 -0
- package/schematics/ng-update/migrations/theming-api-v12/theming-api-migration.d.ts +18 -0
- package/schematics/ng-update/migrations/theming-api-v12/theming-api-migration.js +45 -0
- package/table/testing/cell-harness.d.ts +2 -1
- package/table/testing/row-harness.d.ts +21 -22
- package/table/testing/table-harness.d.ts +32 -13
- package/tabs/_tabs-theme.scss +5 -2
- package/tabs/index.metadata.json +1 -1
- package/schematics/ng-generate/theming-api/config.js +0 -183
- package/schematics/ng-generate/theming-api/index.d.ts +0 -10
- package/schematics/ng-generate/theming-api/index.js +0 -26
- package/schematics/ng-generate/theming-api/migration.js +0 -223
- package/schematics/ng-generate/theming-api/schema.d.ts +0 -9
- package/schematics/ng-generate/theming-api/schema.js +0 -10
- package/schematics/ng-generate/theming-api/schema.json +0 -7
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { __awaiter } from 'tslib';
|
|
2
2
|
import { HarnessPredicate, ComponentHarness, parallel, TestKey } from '@angular/cdk/testing';
|
|
3
|
+
import { MatFormFieldControlHarness } from '@angular/material/form-field/testing/control';
|
|
3
4
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -28,7 +29,7 @@ function getInputPredicate(type, options) {
|
|
|
28
29
|
});
|
|
29
30
|
}
|
|
30
31
|
/** Base class for datepicker input harnesses. */
|
|
31
|
-
class MatDatepickerInputHarnessBase extends
|
|
32
|
+
class MatDatepickerInputHarnessBase extends MatFormFieldControlHarness {
|
|
32
33
|
/** Whether the input is disabled. */
|
|
33
34
|
isDisabled() {
|
|
34
35
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datepicker__testing.js","sources":["../../../../../../src/material/datepicker/testing/datepicker-harness-filters.ts","../../../../../../src/material/datepicker/testing/datepicker-input-harness-base.ts","../../../../../../src/material/datepicker/testing/calendar-cell-harness.ts","../../../../../../src/material/datepicker/testing/calendar-harness.ts","../../../../../../src/material/datepicker/testing/datepicker-trigger-harness-base.ts","../../../../../../src/material/datepicker/testing/datepicker-input-harness.ts","../../../../../../src/material/datepicker/testing/datepicker-toggle-harness.ts","../../../../../../src/material/datepicker/testing/date-range-input-harness.ts","../../../../../../src/material/datepicker/testing/public-api.ts","../../../../../../src/material/datepicker/testing/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BaseHarnessFilters} from '@angular/cdk/testing';\n\n/** A set of criteria that can be used to filter a list of datepicker input instances. */\nexport interface DatepickerInputHarnessFilters extends BaseHarnessFilters {\n /** Filters based on the value of the input. */\n value?: string | RegExp;\n /** Filters based on the placeholder text of the input. */\n placeholder?: string | RegExp;\n}\n\n/** A set of criteria that can be used to filter a list of datepicker toggle instances. */\nexport interface DatepickerToggleHarnessFilters extends BaseHarnessFilters {}\n\n/** A set of criteria that can be used to filter a list of calendar instances. */\nexport interface CalendarHarnessFilters extends BaseHarnessFilters {}\n\n/** A set of criteria that can be used to filter a list of calendar cell instances. */\nexport interface CalendarCellHarnessFilters extends BaseHarnessFilters {\n /** Filters based on the text of the cell. */\n text?: string | RegExp;\n /** Filters based on whether the cell is selected. */\n selected?: boolean;\n /** Filters based on whether the cell is activated using keyboard navigation */\n active?: boolean;\n /** Filters based on whether the cell is disabled. */\n disabled?: boolean;\n /** Filters based on whether the cell represents today's date. */\n today?: boolean;\n /** Filters based on whether the cell is inside of the main range. */\n inRange?: boolean;\n /** Filters based on whether the cell is inside of the comparison range. */\n inComparisonRange?: boolean;\n /** Filters based on whether the cell is inside of the preview range. */\n inPreviewRange?: boolean;\n}\n\n/** A set of criteria that can be used to filter a list of date range input instances. */\nexport interface DateRangeInputHarnessFilters extends BaseHarnessFilters {\n /** Filters based on the value of the input. */\n value?: string | RegExp;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n ComponentHarnessConstructor,\n HarnessPredicate,\n ComponentHarness,\n} from '@angular/cdk/testing';\nimport {DatepickerInputHarnessFilters} from './datepicker-harness-filters';\n\n/** Sets up the filter predicates for a datepicker input harness. */\nexport function getInputPredicate<T extends MatDatepickerInputHarnessBase>(\n type: ComponentHarnessConstructor<T>,\n options: DatepickerInputHarnessFilters): HarnessPredicate<T> {\n\n return new HarnessPredicate(type, options)\n .addOption('value', options.value, (harness, value) => {\n return HarnessPredicate.stringMatches(harness.getValue(), value);\n })\n .addOption('placeholder', options.placeholder, (harness, placeholder) => {\n return HarnessPredicate.stringMatches(harness.getPlaceholder(), placeholder);\n });\n}\n\n/** Base class for datepicker input harnesses. */\nexport abstract class MatDatepickerInputHarnessBase extends ComponentHarness {\n /** Whether the input is disabled. */\n async isDisabled(): Promise<boolean> {\n return (await this.host()).getProperty('disabled')!;\n }\n\n /** Whether the input is required. */\n async isRequired(): Promise<boolean> {\n return (await this.host()).getProperty('required')!;\n }\n\n /** Gets the value of the input. */\n async getValue(): Promise<string> {\n // The \"value\" property of the native input is always defined.\n return (await (await this.host()).getProperty('value'))!;\n }\n\n /**\n * Sets the value of the input. The value will be set by simulating\n * keypresses that correspond to the given value.\n */\n async setValue(newValue: string): Promise<void> {\n const inputEl = await this.host();\n await inputEl.clear();\n\n // We don't want to send keys for the value if the value is an empty\n // string in order to clear the value. Sending keys with an empty string\n // still results in unnecessary focus events.\n if (newValue) {\n await inputEl.sendKeys(newValue);\n }\n\n await inputEl.dispatchEvent('change');\n }\n\n /** Gets the placeholder of the input. */\n async getPlaceholder(): Promise<string> {\n return (await (await this.host()).getProperty('placeholder'));\n }\n\n /**\n * Focuses the input and returns a promise that indicates when the\n * action is complete.\n */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /**\n * Blurs the input and returns a promise that indicates when the\n * action is complete.\n */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n\n /** Whether the input is focused. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n\n /** Gets the formatted minimum date for the input's value. */\n async getMin(): Promise<string | null> {\n return (await this.host()).getAttribute('min');\n }\n\n /** Gets the formatted maximum date for the input's value. */\n async getMax(): Promise<string | null> {\n return (await this.host()).getAttribute('max');\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HarnessPredicate, ComponentHarness} from '@angular/cdk/testing';\nimport {CalendarCellHarnessFilters} from './datepicker-harness-filters';\n\n/** Harness for interacting with a standard Material calendar cell in tests. */\nexport class MatCalendarCellHarness extends ComponentHarness {\n static hostSelector = '.mat-calendar-body-cell';\n\n /** Reference to the inner content element inside the cell. */\n private _content = this.locatorFor('.mat-calendar-body-cell-content');\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatCalendarCellHarness`\n * that meets certain criteria.\n * @param options Options for filtering which cell instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: CalendarCellHarnessFilters = {}): HarnessPredicate<MatCalendarCellHarness> {\n return new HarnessPredicate(MatCalendarCellHarness, options)\n .addOption('text', options.text, (harness, text) => {\n return HarnessPredicate.stringMatches(harness.getText(), text);\n })\n .addOption('selected', options.selected, async (harness, selected) => {\n return (await harness.isSelected()) === selected;\n })\n .addOption('active', options.active, async (harness, active) => {\n return (await harness.isActive()) === active;\n })\n .addOption('disabled', options.disabled, async (harness, disabled) => {\n return (await harness.isDisabled()) === disabled;\n })\n .addOption('today', options.today, async (harness, today) => {\n return (await harness.isToday()) === today;\n })\n .addOption('inRange', options.inRange, async (harness, inRange) => {\n return (await harness.isInRange()) === inRange;\n })\n .addOption('inComparisonRange', options.inComparisonRange,\n async (harness, inComparisonRange) => {\n return (await harness.isInComparisonRange()) === inComparisonRange;\n })\n .addOption('inPreviewRange', options.inPreviewRange, async (harness, inPreviewRange) => {\n return (await harness.isInPreviewRange()) === inPreviewRange;\n });\n }\n\n /** Gets the text of the calendar cell. */\n async getText(): Promise<string> {\n return (await this._content()).text();\n }\n\n /** Gets the aria-label of the calendar cell. */\n async getAriaLabel(): Promise<string> {\n // We're guaranteed for the `aria-label` to be defined\n // since this is a private element that we control.\n return (await this.host()).getAttribute('aria-label') as Promise<string>;\n }\n\n /** Whether the cell is selected. */\n async isSelected(): Promise<boolean> {\n const host = await this.host();\n return (await host.getAttribute('aria-selected')) === 'true';\n }\n\n /** Whether the cell is disabled. */\n async isDisabled(): Promise<boolean> {\n return this._hasState('disabled');\n }\n\n /** Whether the cell is currently activated using keyboard navigation. */\n async isActive(): Promise<boolean> {\n return this._hasState('active');\n }\n\n /** Whether the cell represents today's date. */\n async isToday(): Promise<boolean> {\n return (await this._content()).hasClass('mat-calendar-body-today');\n }\n\n /** Selects the calendar cell. Won't do anything if the cell is disabled. */\n async select(): Promise<void> {\n return (await this.host()).click();\n }\n\n /** Hovers over the calendar cell. */\n async hover(): Promise<void> {\n return (await this.host()).hover();\n }\n\n /** Moves the mouse away from the calendar cell. */\n async mouseAway(): Promise<void> {\n return (await this.host()).mouseAway();\n }\n\n /** Focuses the calendar cell. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Removes focus from the calendar cell. */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n\n /** Whether the cell is the start of the main range. */\n async isRangeStart(): Promise<boolean> {\n return this._hasState('range-start');\n }\n\n /** Whether the cell is the end of the main range. */\n async isRangeEnd(): Promise<boolean> {\n return this._hasState('range-end');\n }\n\n /** Whether the cell is part of the main range. */\n async isInRange(): Promise<boolean> {\n return this._hasState('in-range');\n }\n\n /** Whether the cell is the start of the comparison range. */\n async isComparisonRangeStart(): Promise<boolean> {\n return this._hasState('comparison-start');\n }\n\n /** Whether the cell is the end of the comparison range. */\n async isComparisonRangeEnd(): Promise<boolean> {\n return this._hasState('comparison-end');\n }\n\n /** Whether the cell is inside of the comparison range. */\n async isInComparisonRange(): Promise<boolean> {\n return this._hasState('in-comparison-range');\n }\n\n /** Whether the cell is the start of the preview range. */\n async isPreviewRangeStart(): Promise<boolean> {\n return this._hasState('preview-start');\n }\n\n /** Whether the cell is the end of the preview range. */\n async isPreviewRangeEnd(): Promise<boolean> {\n return this._hasState('preview-end');\n }\n\n /** Whether the cell is inside of the preview range. */\n async isInPreviewRange(): Promise<boolean> {\n return this._hasState('in-preview');\n }\n\n /** Returns whether the cell has a particular CSS class-based state. */\n private async _hasState(name: string): Promise<boolean> {\n return (await this.host()).hasClass(`mat-calendar-body-${name}`);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HarnessPredicate, ComponentHarness} from '@angular/cdk/testing';\nimport {CalendarHarnessFilters, CalendarCellHarnessFilters} from './datepicker-harness-filters';\nimport {MatCalendarCellHarness} from './calendar-cell-harness';\n\n/** Possible views of a `MatCalendarHarness`. */\nexport const enum CalendarView {MONTH, YEAR, MULTI_YEAR}\n\n/** Harness for interacting with a standard Material calendar in tests. */\nexport class MatCalendarHarness extends ComponentHarness {\n static hostSelector = '.mat-calendar';\n\n /** Queries for the calendar's period toggle button. */\n private _periodButton = this.locatorFor('.mat-calendar-period-button');\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatCalendarHarness`\n * that meets certain criteria.\n * @param options Options for filtering which calendar instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: CalendarHarnessFilters = {}): HarnessPredicate<MatCalendarHarness> {\n return new HarnessPredicate(MatCalendarHarness, options);\n }\n\n /**\n * Gets a list of cells inside the calendar.\n * @param filter Optionally filters which cells are included.\n */\n async getCells(filter: CalendarCellHarnessFilters = {}): Promise<MatCalendarCellHarness[]> {\n return this.locatorForAll(MatCalendarCellHarness.with(filter))();\n }\n\n /** Gets the current view that is being shown inside the calendar. */\n async getCurrentView(): Promise<CalendarView> {\n if (await this.locatorForOptional('mat-multi-year-view')()) {\n return CalendarView.MULTI_YEAR;\n }\n\n if (await this.locatorForOptional('mat-year-view')()) {\n return CalendarView.YEAR;\n }\n\n return CalendarView.MONTH;\n }\n\n /** Gets the label of the current calendar view. */\n async getCurrentViewLabel(): Promise<string> {\n return (await this._periodButton()).text();\n }\n\n /** Changes the calendar view by clicking on the view toggle button. */\n async changeView(): Promise<void> {\n return (await this._periodButton()).click();\n }\n\n /** Goes to the next page of the current view (e.g. next month when inside the month view). */\n async next(): Promise<void> {\n return (await this.locatorFor('.mat-calendar-next-button')()).click();\n }\n\n /**\n * Goes to the previous page of the current view\n * (e.g. previous month when inside the month view).\n */\n async previous(): Promise<void> {\n return (await this.locatorFor('.mat-calendar-previous-button')()).click();\n }\n\n /**\n * Selects a cell in the current calendar view.\n * @param filter An optional filter to apply to the cells. The first cell matching the filter\n * will be selected.\n */\n async selectCell(filter: CalendarCellHarnessFilters = {}): Promise<void> {\n const cells = await this.getCells(filter);\n if (!cells.length) {\n throw Error(`Cannot find calendar cell matching filter ${JSON.stringify(filter)}`);\n }\n await cells[0].select();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ComponentHarness, LocatorFactory, parallel, TestElement} from '@angular/cdk/testing';\nimport {CalendarHarnessFilters} from './datepicker-harness-filters';\nimport {MatCalendarHarness} from './calendar-harness';\n\n/** Interface for a test harness that can open and close a calendar. */\nexport interface DatepickerTrigger {\n isCalendarOpen(): Promise<boolean>;\n openCalendar(): Promise<void>;\n closeCalendar(): Promise<void>;\n hasCalendar(): Promise<boolean>;\n getCalendar(filter?: CalendarHarnessFilters): Promise<MatCalendarHarness>;\n}\n\n/** Base class for harnesses that can trigger a calendar. */\nexport abstract class DatepickerTriggerHarnessBase extends ComponentHarness implements\n DatepickerTrigger {\n /** Whether the trigger is disabled. */\n abstract isDisabled(): Promise<boolean>;\n\n /** Whether the calendar associated with the trigger is open. */\n abstract isCalendarOpen(): Promise<boolean>;\n\n /** Opens the calendar associated with the trigger. */\n protected abstract _openCalendar(): Promise<void>;\n\n /** Opens the calendar if the trigger is enabled and it has a calendar. */\n async openCalendar(): Promise<void> {\n const [isDisabled, hasCalendar] = await parallel(() => [this.isDisabled(), this.hasCalendar()]);\n\n if (!isDisabled && hasCalendar) {\n return this._openCalendar();\n }\n }\n\n /** Closes the calendar if it is open. */\n async closeCalendar(): Promise<void> {\n if (await this.isCalendarOpen()) {\n await closeCalendar(getCalendarId(this.host()), this.documentRootLocatorFactory());\n // This is necessary so that we wait for the closing animation to finish in touch UI mode.\n await this.forceStabilize();\n }\n }\n\n /** Gets whether there is a calendar associated with the trigger. */\n async hasCalendar(): Promise<boolean> {\n return (await getCalendarId(this.host())) != null;\n }\n\n /**\n * Gets the `MatCalendarHarness` that is associated with the trigger.\n * @param filter Optionally filters which calendar is included.\n */\n async getCalendar(filter: CalendarHarnessFilters = {}): Promise<MatCalendarHarness> {\n return getCalendar(filter, this.host(), this.documentRootLocatorFactory());\n }\n}\n\n/** Gets the ID of the calendar that a particular test element can trigger. */\nexport async function getCalendarId(host: Promise<TestElement>): Promise<string | null> {\n return (await host).getAttribute('data-mat-calendar');\n}\n\n/** Closes the calendar with a specific ID. */\nexport async function closeCalendar(\n calendarId: Promise<string | null>,\n documentLocator: LocatorFactory) {\n // We close the calendar by clicking on the backdrop, even though all datepicker variants\n // have the ability to close by pressing escape. The backdrop is preferrable, because the\n // escape key has multiple functions inside a range picker (either cancel the current range\n // or close the calendar). Since we don't have access to set the ID on the backdrop in all\n // cases, we set a unique class instead which is the same as the calendar's ID and suffixed\n // with `-backdrop`.\n const backdropSelector = `.${await calendarId}-backdrop`;\n return (await documentLocator.locatorFor(backdropSelector)()).click();\n}\n\n/** Gets the test harness for a calendar associated with a particular host. */\nexport async function getCalendar(\n filter: CalendarHarnessFilters,\n host: Promise<TestElement>,\n documentLocator: LocatorFactory): Promise<MatCalendarHarness> {\n const calendarId = await getCalendarId(host);\n\n if (!calendarId) {\n throw Error(`Element is not associated with a calendar`);\n }\n\n return documentLocator.locatorFor(MatCalendarHarness.with({\n ...filter,\n selector: `#${calendarId}`\n }))();\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HarnessPredicate, parallel, TestKey} from '@angular/cdk/testing';\nimport {DatepickerInputHarnessFilters, CalendarHarnessFilters} from './datepicker-harness-filters';\nimport {MatDatepickerInputHarnessBase, getInputPredicate} from './datepicker-input-harness-base';\nimport {MatCalendarHarness} from './calendar-harness';\nimport {\n DatepickerTrigger,\n closeCalendar,\n getCalendarId,\n getCalendar,\n} from './datepicker-trigger-harness-base';\n\n/** Harness for interacting with a standard Material datepicker inputs in tests. */\nexport class MatDatepickerInputHarness extends MatDatepickerInputHarnessBase implements\n DatepickerTrigger {\n static hostSelector = '.mat-datepicker-input';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatDatepickerInputHarness`\n * that meets certain criteria.\n * @param options Options for filtering which input instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: DatepickerInputHarnessFilters = {}):\n HarnessPredicate<MatDatepickerInputHarness> {\n return getInputPredicate(MatDatepickerInputHarness, options);\n }\n\n /** Gets whether the calendar associated with the input is open. */\n async isCalendarOpen(): Promise<boolean> {\n // `aria-owns` is set only if there's an open datepicker so we can use it as an indicator.\n const host = await this.host();\n return (await host.getAttribute('aria-owns')) != null;\n }\n\n /** Opens the calendar associated with the input. */\n async openCalendar(): Promise<void> {\n const [isDisabled, hasCalendar] = await parallel(() => [this.isDisabled(), this.hasCalendar()]);\n\n if (!isDisabled && hasCalendar) {\n // Alt + down arrow is the combination for opening the calendar with the keyboard.\n const host = await this.host();\n return host.sendKeys({alt: true}, TestKey.DOWN_ARROW);\n }\n }\n\n /** Closes the calendar associated with the input. */\n async closeCalendar(): Promise<void> {\n if (await this.isCalendarOpen()) {\n await closeCalendar(getCalendarId(this.host()), this.documentRootLocatorFactory());\n // This is necessary so that we wait for the closing animation to finish in touch UI mode.\n await this.forceStabilize();\n }\n }\n\n /** Whether a calendar is associated with the input. */\n async hasCalendar(): Promise<boolean> {\n return (await getCalendarId(this.host())) != null;\n }\n\n /**\n * Gets the `MatCalendarHarness` that is associated with the trigger.\n * @param filter Optionally filters which calendar is included.\n */\n async getCalendar(filter: CalendarHarnessFilters = {}): Promise<MatCalendarHarness> {\n return getCalendar(filter, this.host(), this.documentRootLocatorFactory());\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HarnessPredicate} from '@angular/cdk/testing';\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {DatepickerToggleHarnessFilters} from './datepicker-harness-filters';\nimport {DatepickerTriggerHarnessBase} from './datepicker-trigger-harness-base';\n\n\n/** Harness for interacting with a standard Material datepicker toggle in tests. */\nexport class MatDatepickerToggleHarness extends DatepickerTriggerHarnessBase {\n static hostSelector = '.mat-datepicker-toggle';\n\n /** The clickable button inside the toggle. */\n private _button = this.locatorFor('button');\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatDatepickerToggleHarness` that\n * meets certain criteria.\n * @param options Options for filtering which datepicker toggle instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: DatepickerToggleHarnessFilters = {}):\n HarnessPredicate<MatDatepickerToggleHarness> {\n return new HarnessPredicate(MatDatepickerToggleHarness, options);\n }\n\n /** Gets whether the calendar associated with the toggle is open. */\n async isCalendarOpen(): Promise<boolean> {\n return (await this.host()).hasClass('mat-datepicker-toggle-active');\n }\n\n /** Whether the toggle is disabled. */\n async isDisabled(): Promise<boolean> {\n const button = await this._button();\n return coerceBooleanProperty(await button.getAttribute('disabled'));\n }\n\n protected async _openCalendar(): Promise<void> {\n return (await this._button()).click();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HarnessPredicate, parallel, TestKey} from '@angular/cdk/testing';\nimport {MatDatepickerInputHarnessBase, getInputPredicate} from './datepicker-input-harness-base';\nimport {DatepickerTriggerHarnessBase} from './datepicker-trigger-harness-base';\nimport {\n DatepickerInputHarnessFilters,\n DateRangeInputHarnessFilters,\n} from './datepicker-harness-filters';\n\n/** Harness for interacting with a standard Material date range start input in tests. */\nexport class MatStartDateHarness extends MatDatepickerInputHarnessBase {\n static hostSelector = '.mat-start-date';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatStartDateHarness`\n * that meets certain criteria.\n * @param options Options for filtering which input instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: DatepickerInputHarnessFilters = {}):\n HarnessPredicate<MatStartDateHarness> {\n return getInputPredicate(MatStartDateHarness, options);\n }\n}\n\n/** Harness for interacting with a standard Material date range end input in tests. */\nexport class MatEndDateHarness extends MatDatepickerInputHarnessBase {\n static hostSelector = '.mat-end-date';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatEndDateHarness`\n * that meets certain criteria.\n * @param options Options for filtering which input instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: DatepickerInputHarnessFilters = {}):\n HarnessPredicate<MatEndDateHarness> {\n return getInputPredicate(MatEndDateHarness, options);\n }\n}\n\n\n/** Harness for interacting with a standard Material date range input in tests. */\nexport class MatDateRangeInputHarness extends DatepickerTriggerHarnessBase {\n static hostSelector = '.mat-date-range-input';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatDateRangeInputHarness`\n * that meets certain criteria.\n * @param options Options for filtering which input instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: DateRangeInputHarnessFilters = {}):\n HarnessPredicate<MatDateRangeInputHarness> {\n return new HarnessPredicate(MatDateRangeInputHarness, options)\n .addOption('value', options.value,\n (harness, value) => HarnessPredicate.stringMatches(harness.getValue(), value));\n }\n\n /** Gets the combined value of the start and end inputs, including the separator. */\n async getValue(): Promise<string> {\n const [start, end, separator] = await parallel(() => [\n this.getStartInput().then(input => input.getValue()),\n this.getEndInput().then(input => input.getValue()),\n this.getSeparator()\n ]);\n\n return start + `${end ? ` ${separator} ${end}` : ''}`;\n }\n\n /** Gets the inner start date input inside the range input. */\n async getStartInput(): Promise<MatStartDateHarness> {\n // Don't pass in filters here since the start input is required and there can only be one.\n return this.locatorFor(MatStartDateHarness)();\n }\n\n /** Gets the inner start date input inside the range input. */\n async getEndInput(): Promise<MatEndDateHarness> {\n // Don't pass in filters here since the end input is required and there can only be one.\n return this.locatorFor(MatEndDateHarness)();\n }\n\n /** Gets the separator text between the values of the two inputs. */\n async getSeparator(): Promise<string> {\n return (await this.locatorFor('.mat-date-range-input-separator')()).text();\n }\n\n /** Gets whether the range input is disabled. */\n async isDisabled(): Promise<boolean> {\n // We consider the input as disabled if both of the sub-inputs are disabled.\n const [startDisabled, endDisabled] = await parallel(() => [\n this.getStartInput().then(input => input.isDisabled()),\n this.getEndInput().then(input => input.isDisabled())\n ]);\n\n return startDisabled && endDisabled;\n }\n\n /** Gets whether the range input is required. */\n async isRequired(): Promise<boolean> {\n return (await this.host()).hasClass('mat-date-range-input-required');\n }\n\n /** Opens the calendar associated with the input. */\n async isCalendarOpen(): Promise<boolean> {\n // `aria-owns` is set on both inputs only if there's an\n // open range picker so we can use it as an indicator.\n const startHost = await (await this.getStartInput()).host();\n return (await startHost.getAttribute('aria-owns')) != null;\n }\n\n protected async _openCalendar(): Promise<void> {\n // Alt + down arrow is the combination for opening the calendar with the keyboard.\n const startHost = await (await this.getStartInput()).host();\n return startHost.sendKeys({alt: true}, TestKey.DOWN_ARROW);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './datepicker-harness-filters';\nexport * from './datepicker-input-harness';\nexport * from './datepicker-toggle-harness';\nexport * from './date-range-input-harness';\nexport * from './calendar-harness';\nexport * from './calendar-cell-harness';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAAA;;;;;;;;ACAA;;;;;;;AAeA;SACgB,iBAAiB,CAC/B,IAAoC,EACpC,OAAsC;IAEtC,OAAO,IAAI,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC;SACvC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,KAAK;QAChD,OAAO,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,CAAC;KAClE,CAAC;SACD,SAAS,CAAC,aAAa,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,OAAO,EAA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,"file":"datepicker__testing.js","sources":["../../../../../../src/material/datepicker/testing/datepicker-harness-filters.ts","../../../../../../src/material/datepicker/testing/datepicker-input-harness-base.ts","../../../../../../src/material/datepicker/testing/calendar-cell-harness.ts","../../../../../../src/material/datepicker/testing/calendar-harness.ts","../../../../../../src/material/datepicker/testing/datepicker-trigger-harness-base.ts","../../../../../../src/material/datepicker/testing/datepicker-input-harness.ts","../../../../../../src/material/datepicker/testing/datepicker-toggle-harness.ts","../../../../../../src/material/datepicker/testing/date-range-input-harness.ts","../../../../../../src/material/datepicker/testing/public-api.ts","../../../../../../src/material/datepicker/testing/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BaseHarnessFilters} from '@angular/cdk/testing';\n\n/** A set of criteria that can be used to filter a list of datepicker input instances. */\nexport interface DatepickerInputHarnessFilters extends BaseHarnessFilters {\n /** Filters based on the value of the input. */\n value?: string | RegExp;\n /** Filters based on the placeholder text of the input. */\n placeholder?: string | RegExp;\n}\n\n/** A set of criteria that can be used to filter a list of datepicker toggle instances. */\nexport interface DatepickerToggleHarnessFilters extends BaseHarnessFilters {}\n\n/** A set of criteria that can be used to filter a list of calendar instances. */\nexport interface CalendarHarnessFilters extends BaseHarnessFilters {}\n\n/** A set of criteria that can be used to filter a list of calendar cell instances. */\nexport interface CalendarCellHarnessFilters extends BaseHarnessFilters {\n /** Filters based on the text of the cell. */\n text?: string | RegExp;\n /** Filters based on whether the cell is selected. */\n selected?: boolean;\n /** Filters based on whether the cell is activated using keyboard navigation */\n active?: boolean;\n /** Filters based on whether the cell is disabled. */\n disabled?: boolean;\n /** Filters based on whether the cell represents today's date. */\n today?: boolean;\n /** Filters based on whether the cell is inside of the main range. */\n inRange?: boolean;\n /** Filters based on whether the cell is inside of the comparison range. */\n inComparisonRange?: boolean;\n /** Filters based on whether the cell is inside of the preview range. */\n inPreviewRange?: boolean;\n}\n\n/** A set of criteria that can be used to filter a list of date range input instances. */\nexport interface DateRangeInputHarnessFilters extends BaseHarnessFilters {\n /** Filters based on the value of the input. */\n value?: string | RegExp;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n ComponentHarnessConstructor,\n HarnessPredicate,\n} from '@angular/cdk/testing';\nimport {MatFormFieldControlHarness} from '@angular/material/form-field/testing/control';\nimport {DatepickerInputHarnessFilters} from './datepicker-harness-filters';\n\n/** Sets up the filter predicates for a datepicker input harness. */\nexport function getInputPredicate<T extends MatDatepickerInputHarnessBase>(\n type: ComponentHarnessConstructor<T>,\n options: DatepickerInputHarnessFilters): HarnessPredicate<T> {\n\n return new HarnessPredicate(type, options)\n .addOption('value', options.value, (harness, value) => {\n return HarnessPredicate.stringMatches(harness.getValue(), value);\n })\n .addOption('placeholder', options.placeholder, (harness, placeholder) => {\n return HarnessPredicate.stringMatches(harness.getPlaceholder(), placeholder);\n });\n}\n\n/** Base class for datepicker input harnesses. */\nexport abstract class MatDatepickerInputHarnessBase extends MatFormFieldControlHarness {\n /** Whether the input is disabled. */\n async isDisabled(): Promise<boolean> {\n return (await this.host()).getProperty('disabled')!;\n }\n\n /** Whether the input is required. */\n async isRequired(): Promise<boolean> {\n return (await this.host()).getProperty('required')!;\n }\n\n /** Gets the value of the input. */\n async getValue(): Promise<string> {\n // The \"value\" property of the native input is always defined.\n return (await (await this.host()).getProperty('value'))!;\n }\n\n /**\n * Sets the value of the input. The value will be set by simulating\n * keypresses that correspond to the given value.\n */\n async setValue(newValue: string): Promise<void> {\n const inputEl = await this.host();\n await inputEl.clear();\n\n // We don't want to send keys for the value if the value is an empty\n // string in order to clear the value. Sending keys with an empty string\n // still results in unnecessary focus events.\n if (newValue) {\n await inputEl.sendKeys(newValue);\n }\n\n await inputEl.dispatchEvent('change');\n }\n\n /** Gets the placeholder of the input. */\n async getPlaceholder(): Promise<string> {\n return (await (await this.host()).getProperty('placeholder'));\n }\n\n /**\n * Focuses the input and returns a promise that indicates when the\n * action is complete.\n */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /**\n * Blurs the input and returns a promise that indicates when the\n * action is complete.\n */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n\n /** Whether the input is focused. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n\n /** Gets the formatted minimum date for the input's value. */\n async getMin(): Promise<string | null> {\n return (await this.host()).getAttribute('min');\n }\n\n /** Gets the formatted maximum date for the input's value. */\n async getMax(): Promise<string | null> {\n return (await this.host()).getAttribute('max');\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HarnessPredicate, ComponentHarness} from '@angular/cdk/testing';\nimport {CalendarCellHarnessFilters} from './datepicker-harness-filters';\n\n/** Harness for interacting with a standard Material calendar cell in tests. */\nexport class MatCalendarCellHarness extends ComponentHarness {\n static hostSelector = '.mat-calendar-body-cell';\n\n /** Reference to the inner content element inside the cell. */\n private _content = this.locatorFor('.mat-calendar-body-cell-content');\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatCalendarCellHarness`\n * that meets certain criteria.\n * @param options Options for filtering which cell instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: CalendarCellHarnessFilters = {}): HarnessPredicate<MatCalendarCellHarness> {\n return new HarnessPredicate(MatCalendarCellHarness, options)\n .addOption('text', options.text, (harness, text) => {\n return HarnessPredicate.stringMatches(harness.getText(), text);\n })\n .addOption('selected', options.selected, async (harness, selected) => {\n return (await harness.isSelected()) === selected;\n })\n .addOption('active', options.active, async (harness, active) => {\n return (await harness.isActive()) === active;\n })\n .addOption('disabled', options.disabled, async (harness, disabled) => {\n return (await harness.isDisabled()) === disabled;\n })\n .addOption('today', options.today, async (harness, today) => {\n return (await harness.isToday()) === today;\n })\n .addOption('inRange', options.inRange, async (harness, inRange) => {\n return (await harness.isInRange()) === inRange;\n })\n .addOption('inComparisonRange', options.inComparisonRange,\n async (harness, inComparisonRange) => {\n return (await harness.isInComparisonRange()) === inComparisonRange;\n })\n .addOption('inPreviewRange', options.inPreviewRange, async (harness, inPreviewRange) => {\n return (await harness.isInPreviewRange()) === inPreviewRange;\n });\n }\n\n /** Gets the text of the calendar cell. */\n async getText(): Promise<string> {\n return (await this._content()).text();\n }\n\n /** Gets the aria-label of the calendar cell. */\n async getAriaLabel(): Promise<string> {\n // We're guaranteed for the `aria-label` to be defined\n // since this is a private element that we control.\n return (await this.host()).getAttribute('aria-label') as Promise<string>;\n }\n\n /** Whether the cell is selected. */\n async isSelected(): Promise<boolean> {\n const host = await this.host();\n return (await host.getAttribute('aria-selected')) === 'true';\n }\n\n /** Whether the cell is disabled. */\n async isDisabled(): Promise<boolean> {\n return this._hasState('disabled');\n }\n\n /** Whether the cell is currently activated using keyboard navigation. */\n async isActive(): Promise<boolean> {\n return this._hasState('active');\n }\n\n /** Whether the cell represents today's date. */\n async isToday(): Promise<boolean> {\n return (await this._content()).hasClass('mat-calendar-body-today');\n }\n\n /** Selects the calendar cell. Won't do anything if the cell is disabled. */\n async select(): Promise<void> {\n return (await this.host()).click();\n }\n\n /** Hovers over the calendar cell. */\n async hover(): Promise<void> {\n return (await this.host()).hover();\n }\n\n /** Moves the mouse away from the calendar cell. */\n async mouseAway(): Promise<void> {\n return (await this.host()).mouseAway();\n }\n\n /** Focuses the calendar cell. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Removes focus from the calendar cell. */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n\n /** Whether the cell is the start of the main range. */\n async isRangeStart(): Promise<boolean> {\n return this._hasState('range-start');\n }\n\n /** Whether the cell is the end of the main range. */\n async isRangeEnd(): Promise<boolean> {\n return this._hasState('range-end');\n }\n\n /** Whether the cell is part of the main range. */\n async isInRange(): Promise<boolean> {\n return this._hasState('in-range');\n }\n\n /** Whether the cell is the start of the comparison range. */\n async isComparisonRangeStart(): Promise<boolean> {\n return this._hasState('comparison-start');\n }\n\n /** Whether the cell is the end of the comparison range. */\n async isComparisonRangeEnd(): Promise<boolean> {\n return this._hasState('comparison-end');\n }\n\n /** Whether the cell is inside of the comparison range. */\n async isInComparisonRange(): Promise<boolean> {\n return this._hasState('in-comparison-range');\n }\n\n /** Whether the cell is the start of the preview range. */\n async isPreviewRangeStart(): Promise<boolean> {\n return this._hasState('preview-start');\n }\n\n /** Whether the cell is the end of the preview range. */\n async isPreviewRangeEnd(): Promise<boolean> {\n return this._hasState('preview-end');\n }\n\n /** Whether the cell is inside of the preview range. */\n async isInPreviewRange(): Promise<boolean> {\n return this._hasState('in-preview');\n }\n\n /** Returns whether the cell has a particular CSS class-based state. */\n private async _hasState(name: string): Promise<boolean> {\n return (await this.host()).hasClass(`mat-calendar-body-${name}`);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HarnessPredicate, ComponentHarness} from '@angular/cdk/testing';\nimport {CalendarHarnessFilters, CalendarCellHarnessFilters} from './datepicker-harness-filters';\nimport {MatCalendarCellHarness} from './calendar-cell-harness';\n\n/** Possible views of a `MatCalendarHarness`. */\nexport const enum CalendarView {MONTH, YEAR, MULTI_YEAR}\n\n/** Harness for interacting with a standard Material calendar in tests. */\nexport class MatCalendarHarness extends ComponentHarness {\n static hostSelector = '.mat-calendar';\n\n /** Queries for the calendar's period toggle button. */\n private _periodButton = this.locatorFor('.mat-calendar-period-button');\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatCalendarHarness`\n * that meets certain criteria.\n * @param options Options for filtering which calendar instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: CalendarHarnessFilters = {}): HarnessPredicate<MatCalendarHarness> {\n return new HarnessPredicate(MatCalendarHarness, options);\n }\n\n /**\n * Gets a list of cells inside the calendar.\n * @param filter Optionally filters which cells are included.\n */\n async getCells(filter: CalendarCellHarnessFilters = {}): Promise<MatCalendarCellHarness[]> {\n return this.locatorForAll(MatCalendarCellHarness.with(filter))();\n }\n\n /** Gets the current view that is being shown inside the calendar. */\n async getCurrentView(): Promise<CalendarView> {\n if (await this.locatorForOptional('mat-multi-year-view')()) {\n return CalendarView.MULTI_YEAR;\n }\n\n if (await this.locatorForOptional('mat-year-view')()) {\n return CalendarView.YEAR;\n }\n\n return CalendarView.MONTH;\n }\n\n /** Gets the label of the current calendar view. */\n async getCurrentViewLabel(): Promise<string> {\n return (await this._periodButton()).text();\n }\n\n /** Changes the calendar view by clicking on the view toggle button. */\n async changeView(): Promise<void> {\n return (await this._periodButton()).click();\n }\n\n /** Goes to the next page of the current view (e.g. next month when inside the month view). */\n async next(): Promise<void> {\n return (await this.locatorFor('.mat-calendar-next-button')()).click();\n }\n\n /**\n * Goes to the previous page of the current view\n * (e.g. previous month when inside the month view).\n */\n async previous(): Promise<void> {\n return (await this.locatorFor('.mat-calendar-previous-button')()).click();\n }\n\n /**\n * Selects a cell in the current calendar view.\n * @param filter An optional filter to apply to the cells. The first cell matching the filter\n * will be selected.\n */\n async selectCell(filter: CalendarCellHarnessFilters = {}): Promise<void> {\n const cells = await this.getCells(filter);\n if (!cells.length) {\n throw Error(`Cannot find calendar cell matching filter ${JSON.stringify(filter)}`);\n }\n await cells[0].select();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ComponentHarness, LocatorFactory, parallel, TestElement} from '@angular/cdk/testing';\nimport {CalendarHarnessFilters} from './datepicker-harness-filters';\nimport {MatCalendarHarness} from './calendar-harness';\n\n/** Interface for a test harness that can open and close a calendar. */\nexport interface DatepickerTrigger {\n isCalendarOpen(): Promise<boolean>;\n openCalendar(): Promise<void>;\n closeCalendar(): Promise<void>;\n hasCalendar(): Promise<boolean>;\n getCalendar(filter?: CalendarHarnessFilters): Promise<MatCalendarHarness>;\n}\n\n/** Base class for harnesses that can trigger a calendar. */\nexport abstract class DatepickerTriggerHarnessBase extends ComponentHarness implements\n DatepickerTrigger {\n /** Whether the trigger is disabled. */\n abstract isDisabled(): Promise<boolean>;\n\n /** Whether the calendar associated with the trigger is open. */\n abstract isCalendarOpen(): Promise<boolean>;\n\n /** Opens the calendar associated with the trigger. */\n protected abstract _openCalendar(): Promise<void>;\n\n /** Opens the calendar if the trigger is enabled and it has a calendar. */\n async openCalendar(): Promise<void> {\n const [isDisabled, hasCalendar] = await parallel(() => [this.isDisabled(), this.hasCalendar()]);\n\n if (!isDisabled && hasCalendar) {\n return this._openCalendar();\n }\n }\n\n /** Closes the calendar if it is open. */\n async closeCalendar(): Promise<void> {\n if (await this.isCalendarOpen()) {\n await closeCalendar(getCalendarId(this.host()), this.documentRootLocatorFactory());\n // This is necessary so that we wait for the closing animation to finish in touch UI mode.\n await this.forceStabilize();\n }\n }\n\n /** Gets whether there is a calendar associated with the trigger. */\n async hasCalendar(): Promise<boolean> {\n return (await getCalendarId(this.host())) != null;\n }\n\n /**\n * Gets the `MatCalendarHarness` that is associated with the trigger.\n * @param filter Optionally filters which calendar is included.\n */\n async getCalendar(filter: CalendarHarnessFilters = {}): Promise<MatCalendarHarness> {\n return getCalendar(filter, this.host(), this.documentRootLocatorFactory());\n }\n}\n\n/** Gets the ID of the calendar that a particular test element can trigger. */\nexport async function getCalendarId(host: Promise<TestElement>): Promise<string | null> {\n return (await host).getAttribute('data-mat-calendar');\n}\n\n/** Closes the calendar with a specific ID. */\nexport async function closeCalendar(\n calendarId: Promise<string | null>,\n documentLocator: LocatorFactory) {\n // We close the calendar by clicking on the backdrop, even though all datepicker variants\n // have the ability to close by pressing escape. The backdrop is preferrable, because the\n // escape key has multiple functions inside a range picker (either cancel the current range\n // or close the calendar). Since we don't have access to set the ID on the backdrop in all\n // cases, we set a unique class instead which is the same as the calendar's ID and suffixed\n // with `-backdrop`.\n const backdropSelector = `.${await calendarId}-backdrop`;\n return (await documentLocator.locatorFor(backdropSelector)()).click();\n}\n\n/** Gets the test harness for a calendar associated with a particular host. */\nexport async function getCalendar(\n filter: CalendarHarnessFilters,\n host: Promise<TestElement>,\n documentLocator: LocatorFactory): Promise<MatCalendarHarness> {\n const calendarId = await getCalendarId(host);\n\n if (!calendarId) {\n throw Error(`Element is not associated with a calendar`);\n }\n\n return documentLocator.locatorFor(MatCalendarHarness.with({\n ...filter,\n selector: `#${calendarId}`\n }))();\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HarnessPredicate, parallel, TestKey} from '@angular/cdk/testing';\nimport {DatepickerInputHarnessFilters, CalendarHarnessFilters} from './datepicker-harness-filters';\nimport {MatDatepickerInputHarnessBase, getInputPredicate} from './datepicker-input-harness-base';\nimport {MatCalendarHarness} from './calendar-harness';\nimport {\n DatepickerTrigger,\n closeCalendar,\n getCalendarId,\n getCalendar,\n} from './datepicker-trigger-harness-base';\n\n/** Harness for interacting with a standard Material datepicker inputs in tests. */\nexport class MatDatepickerInputHarness extends MatDatepickerInputHarnessBase implements\n DatepickerTrigger {\n static hostSelector = '.mat-datepicker-input';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatDatepickerInputHarness`\n * that meets certain criteria.\n * @param options Options for filtering which input instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: DatepickerInputHarnessFilters = {}):\n HarnessPredicate<MatDatepickerInputHarness> {\n return getInputPredicate(MatDatepickerInputHarness, options);\n }\n\n /** Gets whether the calendar associated with the input is open. */\n async isCalendarOpen(): Promise<boolean> {\n // `aria-owns` is set only if there's an open datepicker so we can use it as an indicator.\n const host = await this.host();\n return (await host.getAttribute('aria-owns')) != null;\n }\n\n /** Opens the calendar associated with the input. */\n async openCalendar(): Promise<void> {\n const [isDisabled, hasCalendar] = await parallel(() => [this.isDisabled(), this.hasCalendar()]);\n\n if (!isDisabled && hasCalendar) {\n // Alt + down arrow is the combination for opening the calendar with the keyboard.\n const host = await this.host();\n return host.sendKeys({alt: true}, TestKey.DOWN_ARROW);\n }\n }\n\n /** Closes the calendar associated with the input. */\n async closeCalendar(): Promise<void> {\n if (await this.isCalendarOpen()) {\n await closeCalendar(getCalendarId(this.host()), this.documentRootLocatorFactory());\n // This is necessary so that we wait for the closing animation to finish in touch UI mode.\n await this.forceStabilize();\n }\n }\n\n /** Whether a calendar is associated with the input. */\n async hasCalendar(): Promise<boolean> {\n return (await getCalendarId(this.host())) != null;\n }\n\n /**\n * Gets the `MatCalendarHarness` that is associated with the trigger.\n * @param filter Optionally filters which calendar is included.\n */\n async getCalendar(filter: CalendarHarnessFilters = {}): Promise<MatCalendarHarness> {\n return getCalendar(filter, this.host(), this.documentRootLocatorFactory());\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HarnessPredicate} from '@angular/cdk/testing';\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {DatepickerToggleHarnessFilters} from './datepicker-harness-filters';\nimport {DatepickerTriggerHarnessBase} from './datepicker-trigger-harness-base';\n\n\n/** Harness for interacting with a standard Material datepicker toggle in tests. */\nexport class MatDatepickerToggleHarness extends DatepickerTriggerHarnessBase {\n static hostSelector = '.mat-datepicker-toggle';\n\n /** The clickable button inside the toggle. */\n private _button = this.locatorFor('button');\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatDatepickerToggleHarness` that\n * meets certain criteria.\n * @param options Options for filtering which datepicker toggle instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: DatepickerToggleHarnessFilters = {}):\n HarnessPredicate<MatDatepickerToggleHarness> {\n return new HarnessPredicate(MatDatepickerToggleHarness, options);\n }\n\n /** Gets whether the calendar associated with the toggle is open. */\n async isCalendarOpen(): Promise<boolean> {\n return (await this.host()).hasClass('mat-datepicker-toggle-active');\n }\n\n /** Whether the toggle is disabled. */\n async isDisabled(): Promise<boolean> {\n const button = await this._button();\n return coerceBooleanProperty(await button.getAttribute('disabled'));\n }\n\n protected async _openCalendar(): Promise<void> {\n return (await this._button()).click();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {HarnessPredicate, parallel, TestKey} from '@angular/cdk/testing';\nimport {MatDatepickerInputHarnessBase, getInputPredicate} from './datepicker-input-harness-base';\nimport {DatepickerTriggerHarnessBase} from './datepicker-trigger-harness-base';\nimport {\n DatepickerInputHarnessFilters,\n DateRangeInputHarnessFilters,\n} from './datepicker-harness-filters';\n\n/** Harness for interacting with a standard Material date range start input in tests. */\nexport class MatStartDateHarness extends MatDatepickerInputHarnessBase {\n static hostSelector = '.mat-start-date';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatStartDateHarness`\n * that meets certain criteria.\n * @param options Options for filtering which input instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: DatepickerInputHarnessFilters = {}):\n HarnessPredicate<MatStartDateHarness> {\n return getInputPredicate(MatStartDateHarness, options);\n }\n}\n\n/** Harness for interacting with a standard Material date range end input in tests. */\nexport class MatEndDateHarness extends MatDatepickerInputHarnessBase {\n static hostSelector = '.mat-end-date';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatEndDateHarness`\n * that meets certain criteria.\n * @param options Options for filtering which input instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: DatepickerInputHarnessFilters = {}):\n HarnessPredicate<MatEndDateHarness> {\n return getInputPredicate(MatEndDateHarness, options);\n }\n}\n\n\n/** Harness for interacting with a standard Material date range input in tests. */\nexport class MatDateRangeInputHarness extends DatepickerTriggerHarnessBase {\n static hostSelector = '.mat-date-range-input';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatDateRangeInputHarness`\n * that meets certain criteria.\n * @param options Options for filtering which input instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: DateRangeInputHarnessFilters = {}):\n HarnessPredicate<MatDateRangeInputHarness> {\n return new HarnessPredicate(MatDateRangeInputHarness, options)\n .addOption('value', options.value,\n (harness, value) => HarnessPredicate.stringMatches(harness.getValue(), value));\n }\n\n /** Gets the combined value of the start and end inputs, including the separator. */\n async getValue(): Promise<string> {\n const [start, end, separator] = await parallel(() => [\n this.getStartInput().then(input => input.getValue()),\n this.getEndInput().then(input => input.getValue()),\n this.getSeparator()\n ]);\n\n return start + `${end ? ` ${separator} ${end}` : ''}`;\n }\n\n /** Gets the inner start date input inside the range input. */\n async getStartInput(): Promise<MatStartDateHarness> {\n // Don't pass in filters here since the start input is required and there can only be one.\n return this.locatorFor(MatStartDateHarness)();\n }\n\n /** Gets the inner start date input inside the range input. */\n async getEndInput(): Promise<MatEndDateHarness> {\n // Don't pass in filters here since the end input is required and there can only be one.\n return this.locatorFor(MatEndDateHarness)();\n }\n\n /** Gets the separator text between the values of the two inputs. */\n async getSeparator(): Promise<string> {\n return (await this.locatorFor('.mat-date-range-input-separator')()).text();\n }\n\n /** Gets whether the range input is disabled. */\n async isDisabled(): Promise<boolean> {\n // We consider the input as disabled if both of the sub-inputs are disabled.\n const [startDisabled, endDisabled] = await parallel(() => [\n this.getStartInput().then(input => input.isDisabled()),\n this.getEndInput().then(input => input.isDisabled())\n ]);\n\n return startDisabled && endDisabled;\n }\n\n /** Gets whether the range input is required. */\n async isRequired(): Promise<boolean> {\n return (await this.host()).hasClass('mat-date-range-input-required');\n }\n\n /** Opens the calendar associated with the input. */\n async isCalendarOpen(): Promise<boolean> {\n // `aria-owns` is set on both inputs only if there's an\n // open range picker so we can use it as an indicator.\n const startHost = await (await this.getStartInput()).host();\n return (await startHost.getAttribute('aria-owns')) != null;\n }\n\n protected async _openCalendar(): Promise<void> {\n // Alt + down arrow is the combination for opening the calendar with the keyboard.\n const startHost = await (await this.getStartInput()).host();\n return startHost.sendKeys({alt: true}, TestKey.DOWN_ARROW);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './datepicker-harness-filters';\nexport * from './datepicker-input-harness';\nexport * from './datepicker-toggle-harness';\nexport * from './date-range-input-harness';\nexport * from './calendar-harness';\nexport * from './calendar-cell-harness';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;;;ACAA;;;;;;;AAeA;SACgB,iBAAiB,CAC/B,IAAoC,EACpC,OAAsC;IAEtC,OAAO,IAAI,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC;SACvC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,KAAK;QAChD,OAAO,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,CAAC;KAClE,CAAC;SACD,SAAS,CAAC,aAAa,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,OAAO,EAAE,WAAW;QAClE,OAAO,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,WAAW,CAAC,CAAC;KAC9E,CAAC,CAAC;AACP,CAAC;AAED;MACsB,6BAA8B,SAAQ,0BAA0B;;IAE9E,UAAU;;YACd,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,WAAW,CAAC,UAAU,CAAE,CAAC;SACrD;KAAA;;IAGK,UAAU;;YACd,OAAO,CAAC,MAAM,IAAI,CAAC,IA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AAC,GAAG,MAAM,QAAQ,CAAC,MAAM;gBACxD,IAAI,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;gBACtD,IAAI,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;aACrD,CAAC,CAAC;YAEH,OAAO,aAAa,IAAI,WAAW,CAAC;SACrC;KAAA;;IAGK,UAAU;;YACd,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,QAAQ,CAAC,+BAA+B,CAAC,CAAC;SACtE;KAAA;;IAGK,cAAc;;;;YAGlB,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,CAAC;YAC5D,OAAO,CAAC,MAAM,SAAS,CAAC,YAAY,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;SAC5D;KAAA;IAEe,aAAa;;;YAE3B,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,CAAC;YAC5D,OAAO,SAAS,CAAC,QAAQ,CAAC,EAAC,GAAG,EAAE,IAAI,EAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;SAC5D;KAAA;;AAvEM,qCAAY,GAAG,uBAAuB;;ACnD/C;;;;;;;;ACAA;;;;;;;;;;"}
|
package/fesm2015/datepicker.js
CHANGED
|
@@ -409,8 +409,9 @@ class MatDateSelectionModel {
|
|
|
409
409
|
* @param source Object that triggered the selection change.
|
|
410
410
|
*/
|
|
411
411
|
updateSelection(value, source) {
|
|
412
|
+
const oldValue = this.selection;
|
|
412
413
|
this.selection = value;
|
|
413
|
-
this._selectionChanged.next({ selection: value, source });
|
|
414
|
+
this._selectionChanged.next({ selection: value, source, oldValue });
|
|
414
415
|
}
|
|
415
416
|
ngOnDestroy() {
|
|
416
417
|
this._selectionChanged.complete();
|
|
@@ -2191,6 +2192,7 @@ class MatDatepickerBase {
|
|
|
2191
2192
|
_openOverlay() {
|
|
2192
2193
|
this._destroyOverlay();
|
|
2193
2194
|
const isDialog = this.touchUi;
|
|
2195
|
+
const labelId = this.datepickerInput.getOverlayLabelId();
|
|
2194
2196
|
const portal = new ComponentPortal(MatDatepickerContent, this._viewContainerRef);
|
|
2195
2197
|
const overlayRef = this._overlayRef = this._overlay.create(new OverlayConfig({
|
|
2196
2198
|
positionStrategy: isDialog ? this._getDialogStrategy() : this._getDropdownStrategy(),
|
|
@@ -2203,9 +2205,13 @@ class MatDatepickerBase {
|
|
|
2203
2205
|
scrollStrategy: isDialog ? this._overlay.scrollStrategies.block() : this._scrollStrategy(),
|
|
2204
2206
|
panelClass: `mat-datepicker-${isDialog ? 'dialog' : 'popup'}`,
|
|
2205
2207
|
}));
|
|
2206
|
-
overlayRef.overlayElement
|
|
2208
|
+
const overlayElement = overlayRef.overlayElement;
|
|
2209
|
+
overlayElement.setAttribute('role', 'dialog');
|
|
2210
|
+
if (labelId) {
|
|
2211
|
+
overlayElement.setAttribute('aria-labelledby', labelId);
|
|
2212
|
+
}
|
|
2207
2213
|
if (isDialog) {
|
|
2208
|
-
|
|
2214
|
+
overlayElement.setAttribute('aria-modal', 'true');
|
|
2209
2215
|
}
|
|
2210
2216
|
this._getCloseStream(overlayRef).subscribe(event => {
|
|
2211
2217
|
if (event) {
|
|
@@ -2697,6 +2703,13 @@ class MatDatepickerInput extends MatDatepickerInputBase {
|
|
|
2697
2703
|
getConnectedOverlayOrigin() {
|
|
2698
2704
|
return this._formField ? this._formField.getConnectedOverlayOrigin() : this._elementRef;
|
|
2699
2705
|
}
|
|
2706
|
+
/** Gets the ID of an element that should be used a description for the calendar overlay. */
|
|
2707
|
+
getOverlayLabelId() {
|
|
2708
|
+
if (this._formField) {
|
|
2709
|
+
return this._formField.getLabelId();
|
|
2710
|
+
}
|
|
2711
|
+
return this._elementRef.nativeElement.getAttribute('aria-labelledby');
|
|
2712
|
+
}
|
|
2700
2713
|
/** Returns the palette used by the input's form field, if any. */
|
|
2701
2714
|
getThemePalette() {
|
|
2702
2715
|
return this._formField ? this._formField.color : undefined;
|
|
@@ -3021,6 +3034,17 @@ class MatStartDate extends _MatDateRangeInputBase {
|
|
|
3021
3034
|
_getValueFromModel(modelValue) {
|
|
3022
3035
|
return modelValue.start;
|
|
3023
3036
|
}
|
|
3037
|
+
_shouldHandleChangeEvent(change) {
|
|
3038
|
+
var _a;
|
|
3039
|
+
if (!super._shouldHandleChangeEvent(change)) {
|
|
3040
|
+
return false;
|
|
3041
|
+
}
|
|
3042
|
+
else {
|
|
3043
|
+
return !((_a = change.oldValue) === null || _a === void 0 ? void 0 : _a.start) ? !!change.selection.start :
|
|
3044
|
+
!change.selection.start ||
|
|
3045
|
+
!!this._dateAdapter.compareDate(change.oldValue.start, change.selection.start);
|
|
3046
|
+
}
|
|
3047
|
+
}
|
|
3024
3048
|
_assignValueToModel(value) {
|
|
3025
3049
|
if (this._model) {
|
|
3026
3050
|
const range = new DateRange(value, this._model.selection.end);
|
|
@@ -3114,6 +3138,17 @@ class MatEndDate extends _MatDateRangeInputBase {
|
|
|
3114
3138
|
_getValueFromModel(modelValue) {
|
|
3115
3139
|
return modelValue.end;
|
|
3116
3140
|
}
|
|
3141
|
+
_shouldHandleChangeEvent(change) {
|
|
3142
|
+
var _a;
|
|
3143
|
+
if (!super._shouldHandleChangeEvent(change)) {
|
|
3144
|
+
return false;
|
|
3145
|
+
}
|
|
3146
|
+
else {
|
|
3147
|
+
return !((_a = change.oldValue) === null || _a === void 0 ? void 0 : _a.end) ? !!change.selection.end :
|
|
3148
|
+
!change.selection.end ||
|
|
3149
|
+
!!this._dateAdapter.compareDate(change.oldValue.end, change.selection.end);
|
|
3150
|
+
}
|
|
3151
|
+
}
|
|
3117
3152
|
_assignValueToModel(value) {
|
|
3118
3153
|
if (this._model) {
|
|
3119
3154
|
const range = new DateRange(this._model.selection.start, value);
|
|
@@ -3200,6 +3235,11 @@ class MatDateRangeInput {
|
|
|
3200
3235
|
if (!_dateAdapter && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
3201
3236
|
throw createMissingDateImplError('DateAdapter');
|
|
3202
3237
|
}
|
|
3238
|
+
// The datepicker module can be used both with MDC and non-MDC form fields. We have
|
|
3239
|
+
// to conditionally add the MDC input class so that the range picker looks correctly.
|
|
3240
|
+
if (_formField === null || _formField === void 0 ? void 0 : _formField._elementRef.nativeElement.classList.contains('mat-mdc-form-field')) {
|
|
3241
|
+
_elementRef.nativeElement.classList.add('mat-mdc-input-element');
|
|
3242
|
+
}
|
|
3203
3243
|
// TODO(crisbeto): remove `as any` after #18206 lands.
|
|
3204
3244
|
this.ngControl = control;
|
|
3205
3245
|
}
|
|
@@ -3361,6 +3401,10 @@ class MatDateRangeInput {
|
|
|
3361
3401
|
getConnectedOverlayOrigin() {
|
|
3362
3402
|
return this._formField ? this._formField.getConnectedOverlayOrigin() : this._elementRef;
|
|
3363
3403
|
}
|
|
3404
|
+
/** Gets the ID of an element that should be used a description for the calendar overlay. */
|
|
3405
|
+
getOverlayLabelId() {
|
|
3406
|
+
return this._formField ? this._formField.getLabelId() : null;
|
|
3407
|
+
}
|
|
3364
3408
|
/** Gets the value that is used to mirror the state input. */
|
|
3365
3409
|
_getInputMirrorValue() {
|
|
3366
3410
|
return this._startInput ? this._startInput.getMirrorValue() : '';
|
|
@@ -3382,13 +3426,19 @@ class MatDateRangeInput {
|
|
|
3382
3426
|
}
|
|
3383
3427
|
/** Whether the separate text should be hidden. */
|
|
3384
3428
|
_shouldHideSeparator() {
|
|
3385
|
-
return (!this._formField || this._formField.
|
|
3429
|
+
return (!this._formField || (this._formField.getLabelId() &&
|
|
3430
|
+
!this._formField._shouldLabelFloat())) && this.empty;
|
|
3386
3431
|
}
|
|
3387
3432
|
/** Gets the value for the `aria-labelledby` attribute of the inputs. */
|
|
3388
3433
|
_getAriaLabelledby() {
|
|
3389
3434
|
const formField = this._formField;
|
|
3390
3435
|
return formField && formField._hasFloatingLabel() ? formField._labelId : null;
|
|
3391
3436
|
}
|
|
3437
|
+
/** Updates the focused state of the range input. */
|
|
3438
|
+
_updateFocus(origin) {
|
|
3439
|
+
this.focused = origin !== null;
|
|
3440
|
+
this.stateChanges.next();
|
|
3441
|
+
}
|
|
3392
3442
|
/** Re-runs the validators on the start/end inputs. */
|
|
3393
3443
|
_revalidate() {
|
|
3394
3444
|
if (this._startInput) {
|
|
@@ -3411,7 +3461,7 @@ class MatDateRangeInput {
|
|
|
3411
3461
|
MatDateRangeInput.decorators = [
|
|
3412
3462
|
{ type: Component, args: [{
|
|
3413
3463
|
selector: 'mat-date-range-input',
|
|
3414
|
-
template: "<div\n class=\"mat-date-range-input-container\"\n cdkMonitorSubtreeFocus\n (cdkFocusChange)=\"
|
|
3464
|
+
template: "<div\n class=\"mat-date-range-input-container\"\n cdkMonitorSubtreeFocus\n (cdkFocusChange)=\"_updateFocus($event)\">\n <div class=\"mat-date-range-input-start-wrapper\">\n <ng-content select=\"input[matStartDate]\"></ng-content>\n <span\n class=\"mat-date-range-input-mirror\"\n aria-hidden=\"true\">{{_getInputMirrorValue()}}</span>\n </div>\n\n <span\n class=\"mat-date-range-input-separator\"\n [class.mat-date-range-input-separator-hidden]=\"_shouldHideSeparator()\">{{separator}}</span>\n\n <div class=\"mat-date-range-input-end-wrapper\">\n <ng-content select=\"input[matEndDate]\"></ng-content>\n </div>\n</div>\n\n",
|
|
3415
3465
|
exportAs: 'matDateRangeInput',
|
|
3416
3466
|
host: {
|
|
3417
3467
|
'class': 'mat-date-range-input',
|