@angular/material 21.0.0-next.6 → 21.0.0-next.8
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/fesm2022/_animation-chunk.mjs.map +1 -1
- package/fesm2022/_date-formats-chunk.mjs.map +1 -1
- package/fesm2022/_date-range-input-harness-chunk.mjs.map +1 -1
- package/fesm2022/_error-options-chunk.mjs.map +1 -1
- package/fesm2022/_error-state-chunk.mjs.map +1 -1
- package/fesm2022/_form-field-chunk.mjs.map +1 -1
- package/fesm2022/_icon-button-chunk.mjs.map +1 -1
- package/fesm2022/_icon-registry-chunk.mjs.map +1 -1
- package/fesm2022/_input-harness-chunk.mjs.map +1 -1
- package/fesm2022/_input-value-accessor-chunk.mjs.map +1 -1
- package/fesm2022/_internal-form-field-chunk.mjs.map +1 -1
- package/fesm2022/_line-chunk.mjs.map +1 -1
- package/fesm2022/_option-chunk.mjs.map +1 -1
- package/fesm2022/_option-harness-chunk.mjs.map +1 -1
- package/fesm2022/_option-module-chunk.mjs.map +1 -1
- package/fesm2022/_pseudo-checkbox-chunk.mjs.map +1 -1
- package/fesm2022/_pseudo-checkbox-module-chunk.mjs.map +1 -1
- package/fesm2022/_public-api-chunk.mjs.map +1 -1
- package/fesm2022/_ripple-chunk.mjs.map +1 -1
- package/fesm2022/_ripple-loader-chunk.mjs.map +1 -1
- package/fesm2022/_ripple-module-chunk.mjs.map +1 -1
- package/fesm2022/_structural-styles-chunk.mjs.map +1 -1
- package/fesm2022/_tooltip-chunk.mjs.map +1 -1
- package/fesm2022/autocomplete-testing.mjs.map +1 -1
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/badge-testing.mjs.map +1 -1
- package/fesm2022/badge.mjs.map +1 -1
- package/fesm2022/bottom-sheet-testing.mjs.map +1 -1
- package/fesm2022/bottom-sheet.mjs +5 -0
- package/fesm2022/bottom-sheet.mjs.map +1 -1
- package/fesm2022/button-testing.mjs.map +1 -1
- package/fesm2022/button-toggle-testing.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/card-testing.mjs.map +1 -1
- package/fesm2022/card.mjs.map +1 -1
- package/fesm2022/checkbox-testing.mjs.map +1 -1
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/chips-testing.mjs.map +1 -1
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/core-testing.mjs.map +1 -1
- package/fesm2022/core.mjs +1 -1
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker-testing.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +71 -72
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog-testing.mjs.map +1 -1
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/divider-testing.mjs.map +1 -1
- package/fesm2022/divider.mjs.map +1 -1
- package/fesm2022/expansion-testing.mjs.map +1 -1
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/form-field-testing-control.mjs.map +1 -1
- package/fesm2022/form-field-testing.mjs.map +1 -1
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/grid-list-testing.mjs.map +1 -1
- package/fesm2022/grid-list.mjs.map +1 -1
- package/fesm2022/icon-testing.mjs.map +1 -1
- package/fesm2022/icon.mjs.map +1 -1
- package/fesm2022/input-testing.mjs.map +1 -1
- package/fesm2022/input.mjs.map +1 -1
- package/fesm2022/list-testing.mjs.map +1 -1
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/material.mjs.map +1 -1
- package/fesm2022/menu-testing.mjs.map +1 -1
- package/fesm2022/menu.mjs +2 -2
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/paginator-testing.mjs.map +1 -1
- package/fesm2022/paginator.mjs.map +1 -1
- package/fesm2022/progress-bar-testing.mjs.map +1 -1
- package/fesm2022/progress-bar.mjs.map +1 -1
- package/fesm2022/progress-spinner-testing.mjs.map +1 -1
- package/fesm2022/progress-spinner.mjs.map +1 -1
- package/fesm2022/radio-testing.mjs.map +1 -1
- package/fesm2022/radio.mjs.map +1 -1
- package/fesm2022/select-testing.mjs.map +1 -1
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sidenav-testing.mjs.map +1 -1
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle-testing.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/slider-testing.mjs.map +1 -1
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/snack-bar-testing.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/fesm2022/sort-testing.mjs.map +1 -1
- package/fesm2022/sort.mjs.map +1 -1
- package/fesm2022/stepper-testing.mjs.map +1 -1
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/table-testing.mjs.map +1 -1
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/tabs-testing.mjs.map +1 -1
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/timepicker-testing.mjs.map +1 -1
- package/fesm2022/timepicker.mjs +15 -9
- package/fesm2022/timepicker.mjs.map +1 -1
- package/fesm2022/toolbar-testing.mjs.map +1 -1
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tooltip-testing.mjs.map +1 -1
- package/fesm2022/tooltip.mjs.map +1 -1
- package/fesm2022/tree-testing.mjs.map +1 -1
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +3 -2
- package/schematics/ng-add/index.js +1 -1
- package/types/bottom-sheet.d.ts +6 -1
- package/types/datepicker.d.ts +34 -34
- package/types/timepicker.d.ts +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-testing.mjs","sources":["../../../../../
|
|
1
|
+
{"version":3,"file":"core-testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/core/testing/optgroup-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} from '@angular/cdk/testing';\nimport {OptgroupHarnessFilters} from './optgroup-harness-filters';\nimport {MatOptionHarness} from './option-harness';\nimport {OptionHarnessFilters} from './option-harness-filters';\n\n/** Harness for interacting with a `mat-optgroup` in tests. */\nexport class MatOptgroupHarness extends ComponentHarness {\n /** Selector used to locate option group instances. */\n static hostSelector = '.mat-mdc-optgroup';\n private _label = this.locatorFor('.mat-mdc-optgroup-label');\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a option group with specific\n * attributes.\n * @param options Options for filtering which option instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends MatOptgroupHarness>(\n this: ComponentHarnessConstructor<T>,\n options: OptgroupHarnessFilters = {},\n ): HarnessPredicate<T> {\n return new HarnessPredicate(this, options).addOption(\n 'labelText',\n options.labelText,\n async (harness, title) => HarnessPredicate.stringMatches(await harness.getLabelText(), title),\n );\n }\n\n /** Gets the option group's label text. */\n async getLabelText(): Promise<string> {\n return (await this._label()).text();\n }\n\n /** Gets whether the option group is disabled. */\n async isDisabled(): Promise<boolean> {\n return (await (await this.host()).getAttribute('aria-disabled')) === 'true';\n }\n\n /**\n * Gets the options that are inside the group.\n * @param filter Optionally filters which options are included.\n */\n async getOptions(filter: OptionHarnessFilters = {}): Promise<MatOptionHarness[]> {\n return this.locatorForAll(MatOptionHarness.with(filter))();\n }\n}\n"],"names":[],"mappings":";;;AAiBA;AACM,MAAO,kBAAmB,SAAQ,gBAAgB,CAAA;;AAEtD,IAAA,OAAO,YAAY,GAAG,mBAAmB;AACjC,IAAA,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,yBAAyB,CAAC;AAE3D;;;;;AAKG;AACH,IAAA,OAAO,IAAI,CAET,OAAA,GAAkC,EAAE,EAAA;AAEpC,QAAA,OAAO,IAAI,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,SAAS,CAClD,WAAW,EACX,OAAO,CAAC,SAAS,EACjB,OAAO,OAAO,EAAE,KAAK,KAAK,gBAAgB,CAAC,aAAa,CAAC,MAAM,OAAO,CAAC,YAAY,EAAE,EAAE,KAAK,CAAC,CAC9F;;;AAIH,IAAA,MAAM,YAAY,GAAA;QAChB,OAAO,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE;;;AAIrC,IAAA,MAAM,UAAU,GAAA;AACd,QAAA,OAAO,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,eAAe,CAAC,MAAM,MAAM;;AAG7E;;;AAGG;AACH,IAAA,MAAM,UAAU,CAAC,MAAA,GAA+B,EAAE,EAAA;AAChD,QAAA,OAAO,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE;;;;;;"}
|
package/fesm2022/core.mjs
CHANGED
|
@@ -25,7 +25,7 @@ import '@angular/cdk/platform';
|
|
|
25
25
|
import '@angular/cdk/coercion';
|
|
26
26
|
|
|
27
27
|
/** Current version of Angular Material. */
|
|
28
|
-
const VERSION = new Version('21.0.0-next.
|
|
28
|
+
const VERSION = new Version('21.0.0-next.8');
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* Matches strings that have the form of a valid RFC 3339 string
|
package/fesm2022/core.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/material/core/version.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/material/core/datetime/native-date-adapter.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/material/core/datetime/native-date-formats.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/material/core/datetime/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.dev/license\n */\n\nimport {Version} from '@angular/core';\n\n/** Current version of Angular Material. */\nexport const VERSION = new Version('21.0.0-next.6');\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 {inject, Injectable} from '@angular/core';\nimport {DateAdapter, MAT_DATE_LOCALE} from './date-adapter';\n\n/**\n * Matches strings that have the form of a valid RFC 3339 string\n * (https://tools.ietf.org/html/rfc3339). Note that the string may not actually be a valid date\n * because the regex will match strings with an out of bounds month, date, etc.\n */\nconst ISO_8601_REGEX =\n /^\\d{4}-\\d{2}-\\d{2}(?:T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|(?:(?:\\+|-)\\d{2}:\\d{2}))?)?$/;\n\n/**\n * Matches a time string. Supported formats:\n * - {{hours}}:{{minutes}}\n * - {{hours}}:{{minutes}}:{{seconds}}\n * - {{hours}}:{{minutes}} AM/PM\n * - {{hours}}:{{minutes}}:{{seconds}} AM/PM\n * - {{hours}}.{{minutes}}\n * - {{hours}}.{{minutes}}.{{seconds}}\n * - {{hours}}.{{minutes}} AM/PM\n * - {{hours}}.{{minutes}}.{{seconds}} AM/PM\n */\nconst TIME_REGEX = /^(\\d?\\d)[:.](\\d?\\d)(?:[:.](\\d?\\d))?\\s*(AM|PM)?$/i;\n\n/** Creates an array and fills it with values. */\nfunction range<T>(length: number, valueFunction: (index: number) => T): T[] {\n const valuesArray = Array(length);\n for (let i = 0; i < length; i++) {\n valuesArray[i] = valueFunction(i);\n }\n return valuesArray;\n}\n\n/** Adapts the native JS Date for use with cdk-based components that work with dates. */\n@Injectable()\nexport class NativeDateAdapter extends DateAdapter<Date> {\n /** The injected locale. */\n private readonly _matDateLocale = inject(MAT_DATE_LOCALE, {optional: true});\n\n constructor(...args: unknown[]);\n\n constructor() {\n super();\n\n const matDateLocale = inject(MAT_DATE_LOCALE, {optional: true});\n\n if (matDateLocale !== undefined) {\n this._matDateLocale = matDateLocale;\n }\n\n super.setLocale(this._matDateLocale);\n }\n\n getYear(date: Date): number {\n return date.getFullYear();\n }\n\n getMonth(date: Date): number {\n return date.getMonth();\n }\n\n getDate(date: Date): number {\n return date.getDate();\n }\n\n getDayOfWeek(date: Date): number {\n return date.getDay();\n }\n\n getMonthNames(style: 'long' | 'short' | 'narrow'): string[] {\n const dtf = new Intl.DateTimeFormat(this.locale, {month: style, timeZone: 'utc'});\n return range(12, i => this._format(dtf, new Date(2017, i, 1)));\n }\n\n getDateNames(): string[] {\n const dtf = new Intl.DateTimeFormat(this.locale, {day: 'numeric', timeZone: 'utc'});\n return range(31, i => this._format(dtf, new Date(2017, 0, i + 1)));\n }\n\n getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[] {\n const dtf = new Intl.DateTimeFormat(this.locale, {weekday: style, timeZone: 'utc'});\n return range(7, i => this._format(dtf, new Date(2017, 0, i + 1)));\n }\n\n getYearName(date: Date): string {\n const dtf = new Intl.DateTimeFormat(this.locale, {year: 'numeric', timeZone: 'utc'});\n return this._format(dtf, date);\n }\n\n getFirstDayOfWeek(): number {\n // At the time of writing `Intl.Locale` isn't available\n // in the internal types so we need to cast to `any`.\n if (typeof Intl !== 'undefined' && (Intl as any).Locale) {\n const locale = new (Intl as any).Locale(this.locale) as {\n getWeekInfo?: () => {firstDay: number};\n weekInfo?: {firstDay: number};\n };\n\n // Some browsers implement a `getWeekInfo` method while others have a `weekInfo` getter.\n // Note that this isn't supported in all browsers so we need to null check it.\n const firstDay = (locale.getWeekInfo?.() || locale.weekInfo)?.firstDay ?? 0;\n\n // `weekInfo.firstDay` is a number between 1 and 7 where, starting from Monday,\n // whereas our representation is 0 to 6 where 0 is Sunday so we need to normalize it.\n return firstDay === 7 ? 0 : firstDay;\n }\n\n // Default to Sunday if the browser doesn't provide the week information.\n return 0;\n }\n\n getNumDaysInMonth(date: Date): number {\n return this.getDate(\n this._createDateWithOverflow(this.getYear(date), this.getMonth(date) + 1, 0),\n );\n }\n\n clone(date: Date): Date {\n return new Date(date.getTime());\n }\n\n createDate(year: number, month: number, date: number): Date {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n // Check for invalid month and date (except upper bound on date which we have to check after\n // creating the Date).\n if (month < 0 || month > 11) {\n throw Error(`Invalid month index \"${month}\". Month index has to be between 0 and 11.`);\n }\n\n if (date < 1) {\n throw Error(`Invalid date \"${date}\". Date has to be greater than 0.`);\n }\n }\n\n let result = this._createDateWithOverflow(year, month, date);\n // Check that the date wasn't above the upper bound for the month, causing the month to overflow\n if (result.getMonth() != month && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error(`Invalid date \"${date}\" for month with index \"${month}\".`);\n }\n\n return result;\n }\n\n today(): Date {\n return new Date();\n }\n\n parse(value: any, parseFormat?: any): Date | null {\n // We have no way using the native JS Date to set the parse format or locale, so we ignore these\n // parameters.\n if (typeof value == 'number') {\n return new Date(value);\n }\n return value ? new Date(Date.parse(value)) : null;\n }\n\n format(date: Date, displayFormat: Object): string {\n if (!this.isValid(date)) {\n throw Error('NativeDateAdapter: Cannot format invalid date.');\n }\n\n const dtf = new Intl.DateTimeFormat(this.locale, {...displayFormat, timeZone: 'utc'});\n return this._format(dtf, date);\n }\n\n addCalendarYears(date: Date, years: number): Date {\n return this.addCalendarMonths(date, years * 12);\n }\n\n addCalendarMonths(date: Date, months: number): Date {\n let newDate = this._createDateWithOverflow(\n this.getYear(date),\n this.getMonth(date) + months,\n this.getDate(date),\n );\n\n // It's possible to wind up in the wrong month if the original month has more days than the new\n // month. In this case we want to go to the last day of the desired month.\n // Note: the additional + 12 % 12 ensures we end up with a positive number, since JS % doesn't\n // guarantee this.\n if (this.getMonth(newDate) != (((this.getMonth(date) + months) % 12) + 12) % 12) {\n newDate = this._createDateWithOverflow(this.getYear(newDate), this.getMonth(newDate), 0);\n }\n\n return newDate;\n }\n\n addCalendarDays(date: Date, days: number): Date {\n return this._createDateWithOverflow(\n this.getYear(date),\n this.getMonth(date),\n this.getDate(date) + days,\n );\n }\n\n toIso8601(date: Date): string {\n return [\n date.getUTCFullYear(),\n this._2digit(date.getUTCMonth() + 1),\n this._2digit(date.getUTCDate()),\n ].join('-');\n }\n\n /**\n * Returns the given value if given a valid Date or null. Deserializes valid ISO 8601 strings\n * (https://www.ietf.org/rfc/rfc3339.txt) into valid Dates and empty string into null. Returns an\n * invalid date for all other values.\n */\n override deserialize(value: any): Date | null {\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n // The `Date` constructor accepts formats other than ISO 8601, so we need to make sure the\n // string is the right format first.\n if (ISO_8601_REGEX.test(value)) {\n let date = new Date(value);\n if (this.isValid(date)) {\n return date;\n }\n }\n }\n return super.deserialize(value);\n }\n\n isDateInstance(obj: any) {\n return obj instanceof Date;\n }\n\n isValid(date: Date) {\n return !isNaN(date.getTime());\n }\n\n invalid(): Date {\n return new Date(NaN);\n }\n\n override setTime(target: Date, hours: number, minutes: number, seconds: number): Date {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!inRange(hours, 0, 23)) {\n throw Error(`Invalid hours \"${hours}\". Hours value must be between 0 and 23.`);\n }\n\n if (!inRange(minutes, 0, 59)) {\n throw Error(`Invalid minutes \"${minutes}\". Minutes value must be between 0 and 59.`);\n }\n\n if (!inRange(seconds, 0, 59)) {\n throw Error(`Invalid seconds \"${seconds}\". Seconds value must be between 0 and 59.`);\n }\n }\n\n const clone = this.clone(target);\n clone.setHours(hours, minutes, seconds, 0);\n return clone;\n }\n\n override getHours(date: Date): number {\n return date.getHours();\n }\n\n override getMinutes(date: Date): number {\n return date.getMinutes();\n }\n\n override getSeconds(date: Date): number {\n return date.getSeconds();\n }\n\n override parseTime(userValue: any, parseFormat?: any): Date | null {\n if (typeof userValue !== 'string') {\n return userValue instanceof Date ? new Date(userValue.getTime()) : null;\n }\n\n const value = userValue.trim();\n\n if (value.length === 0) {\n return null;\n }\n\n // Attempt to parse the value directly.\n let result = this._parseTimeString(value);\n\n // Some locales add extra characters around the time, but are otherwise parseable\n // (e.g. `00:05 ч.` in bg-BG). Try replacing all non-number and non-colon characters.\n if (result === null) {\n const withoutExtras = value.replace(/[^0-9:(AM|PM)]/gi, '').trim();\n\n if (withoutExtras.length > 0) {\n result = this._parseTimeString(withoutExtras);\n }\n }\n\n return result || this.invalid();\n }\n\n override addSeconds(date: Date, amount: number): Date {\n return new Date(date.getTime() + amount * 1000);\n }\n\n /** Creates a date but allows the month and date to overflow. */\n private _createDateWithOverflow(year: number, month: number, date: number) {\n // Passing the year to the constructor causes year numbers <100 to be converted to 19xx.\n // To work around this we use `setFullYear` and `setHours` instead.\n const d = new Date();\n d.setFullYear(year, month, date);\n d.setHours(0, 0, 0, 0);\n return d;\n }\n\n /**\n * Pads a number to make it two digits.\n * @param n The number to pad.\n * @returns The padded number.\n */\n private _2digit(n: number) {\n return ('00' + n).slice(-2);\n }\n\n /**\n * When converting Date object to string, javascript built-in functions may return wrong\n * results because it applies its internal DST rules. The DST rules around the world change\n * very frequently, and the current valid rule is not always valid in previous years though.\n * We work around this problem building a new Date object which has its internal UTC\n * representation with the local date and time.\n * @param dtf Intl.DateTimeFormat object, containing the desired string format. It must have\n * timeZone set to 'utc' to work fine.\n * @param date Date from which we want to get the string representation according to dtf\n * @returns A Date object with its UTC representation based on the passed in date info\n */\n private _format(dtf: Intl.DateTimeFormat, date: Date) {\n // Passing the year to the constructor causes year numbers <100 to be converted to 19xx.\n // To work around this we use `setUTCFullYear` and `setUTCHours` instead.\n const d = new Date();\n d.setUTCFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n d.setUTCHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n return dtf.format(d);\n }\n\n /**\n * Attempts to parse a time string into a date object. Returns null if it cannot be parsed.\n * @param value Time string to parse.\n */\n private _parseTimeString(value: string): Date | null {\n // Note: we can technically rely on the browser for the time parsing by generating\n // an ISO string and appending the string to the end of it. We don't do it, because\n // browsers aren't consistent in what they support. Some examples:\n // - Safari doesn't support AM/PM.\n // - Firefox produces a valid date object if the time string has overflows (e.g. 12:75) while\n // other browsers produce an invalid date.\n // - Safari doesn't allow padded numbers.\n const parsed = value.toUpperCase().match(TIME_REGEX);\n\n if (parsed) {\n let hours = parseInt(parsed[1]);\n const minutes = parseInt(parsed[2]);\n let seconds: number | undefined = parsed[3] == null ? undefined : parseInt(parsed[3]);\n const amPm = parsed[4] as 'AM' | 'PM' | undefined;\n\n if (hours === 12) {\n hours = amPm === 'AM' ? 0 : hours;\n } else if (amPm === 'PM') {\n hours += 12;\n }\n\n if (\n inRange(hours, 0, 23) &&\n inRange(minutes, 0, 59) &&\n (seconds == null || inRange(seconds, 0, 59))\n ) {\n return this.setTime(this.today(), hours, minutes, seconds || 0);\n }\n }\n\n return null;\n }\n}\n\n/** Checks whether a number is within a certain range. */\nfunction inRange(value: number, min: number, max: number): boolean {\n return !isNaN(value) && value >= min && value <= max;\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 {MatDateFormats} from './date-formats';\n\nexport const MAT_NATIVE_DATE_FORMATS: MatDateFormats = {\n parse: {\n dateInput: null,\n timeInput: null,\n },\n display: {\n dateInput: {year: 'numeric', month: 'numeric', day: 'numeric'},\n timeInput: {hour: 'numeric', minute: 'numeric'},\n monthYearLabel: {year: 'numeric', month: 'short'},\n dateA11yLabel: {year: 'numeric', month: 'long', day: 'numeric'},\n monthYearA11yLabel: {year: 'numeric', month: 'long'},\n timeOptionLabel: {hour: 'numeric', minute: 'numeric'},\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 {NgModule, Provider} from '@angular/core';\nimport {DateAdapter} from './date-adapter';\nimport {MAT_DATE_FORMATS, MatDateFormats} from './date-formats';\nimport {NativeDateAdapter} from './native-date-adapter';\nimport {MAT_NATIVE_DATE_FORMATS} from './native-date-formats';\n\nexport * from './date-adapter';\nexport * from './date-formats';\nexport * from './native-date-adapter';\nexport * from './native-date-formats';\n\n@NgModule({\n providers: [{provide: DateAdapter, useClass: NativeDateAdapter}],\n})\nexport class NativeDateModule {}\n\n@NgModule({\n providers: [provideNativeDateAdapter()],\n})\nexport class MatNativeDateModule {}\n\nexport function provideNativeDateAdapter(\n formats: MatDateFormats = MAT_NATIVE_DATE_FORMATS,\n): Provider[] {\n return [\n {provide: DateAdapter, useClass: NativeDateAdapter},\n {provide: MAT_DATE_FORMATS, useValue: formats},\n ];\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAUA;MACa,OAAO,GAAG,IAAI,OAAO,CAAC,mBAAmB;;ACAtD;;;;AAIG;AACH,MAAM,cAAc,GAClB,oFAAoF;AAEtF;;;;;;;;;;AAUG;AACH,MAAM,UAAU,GAAG,kDAAkD;AAErE;AACA,SAAS,KAAK,CAAI,MAAc,EAAE,aAAmC,EAAA;AACnE,IAAA,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC;AACjC,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC/B,WAAW,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC;;AAEnC,IAAA,OAAO,WAAW;AACpB;AAEA;AAEM,MAAO,iBAAkB,SAAQ,WAAiB,CAAA;;IAErC,cAAc,GAAG,MAAM,CAAC,eAAe,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;AAI3E,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;AAEP,QAAA,MAAM,aAAa,GAAG,MAAM,CAAC,eAAe,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;AAE/D,QAAA,IAAI,aAAa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AAA,EAAA,eAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,EAFnB,SAAA,EAAA,CAAC,wBAAwB,EAAE,CAAC,EAAA,CAAA;;kGAE5B,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAH/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE,CAAC,wBAAwB,EAAE,CAAC;AACxC,iBAAA;;AAGe,SAAA,wBAAwB,CACtC,OAAA,GAA0B,uBAAuB,EAAA;IAEjD,OAAO;AACL,QAAA,EAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,iBAAiB,EAAC;AACnD,QAAA,EAAC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,OAAO,EAAC;KAC/C;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"core.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/core/version.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/core/datetime/native-date-adapter.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/core/datetime/native-date-formats.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/core/datetime/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.dev/license\n */\n\nimport {Version} from '@angular/core';\n\n/** Current version of Angular Material. */\nexport const VERSION = new Version('21.0.0-next.8');\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 {inject, Injectable} from '@angular/core';\nimport {DateAdapter, MAT_DATE_LOCALE} from './date-adapter';\n\n/**\n * Matches strings that have the form of a valid RFC 3339 string\n * (https://tools.ietf.org/html/rfc3339). Note that the string may not actually be a valid date\n * because the regex will match strings with an out of bounds month, date, etc.\n */\nconst ISO_8601_REGEX =\n /^\\d{4}-\\d{2}-\\d{2}(?:T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|(?:(?:\\+|-)\\d{2}:\\d{2}))?)?$/;\n\n/**\n * Matches a time string. Supported formats:\n * - {{hours}}:{{minutes}}\n * - {{hours}}:{{minutes}}:{{seconds}}\n * - {{hours}}:{{minutes}} AM/PM\n * - {{hours}}:{{minutes}}:{{seconds}} AM/PM\n * - {{hours}}.{{minutes}}\n * - {{hours}}.{{minutes}}.{{seconds}}\n * - {{hours}}.{{minutes}} AM/PM\n * - {{hours}}.{{minutes}}.{{seconds}} AM/PM\n */\nconst TIME_REGEX = /^(\\d?\\d)[:.](\\d?\\d)(?:[:.](\\d?\\d))?\\s*(AM|PM)?$/i;\n\n/** Creates an array and fills it with values. */\nfunction range<T>(length: number, valueFunction: (index: number) => T): T[] {\n const valuesArray = Array(length);\n for (let i = 0; i < length; i++) {\n valuesArray[i] = valueFunction(i);\n }\n return valuesArray;\n}\n\n/** Adapts the native JS Date for use with cdk-based components that work with dates. */\n@Injectable()\nexport class NativeDateAdapter extends DateAdapter<Date> {\n /** The injected locale. */\n private readonly _matDateLocale = inject(MAT_DATE_LOCALE, {optional: true});\n\n constructor(...args: unknown[]);\n\n constructor() {\n super();\n\n const matDateLocale = inject(MAT_DATE_LOCALE, {optional: true});\n\n if (matDateLocale !== undefined) {\n this._matDateLocale = matDateLocale;\n }\n\n super.setLocale(this._matDateLocale);\n }\n\n getYear(date: Date): number {\n return date.getFullYear();\n }\n\n getMonth(date: Date): number {\n return date.getMonth();\n }\n\n getDate(date: Date): number {\n return date.getDate();\n }\n\n getDayOfWeek(date: Date): number {\n return date.getDay();\n }\n\n getMonthNames(style: 'long' | 'short' | 'narrow'): string[] {\n const dtf = new Intl.DateTimeFormat(this.locale, {month: style, timeZone: 'utc'});\n return range(12, i => this._format(dtf, new Date(2017, i, 1)));\n }\n\n getDateNames(): string[] {\n const dtf = new Intl.DateTimeFormat(this.locale, {day: 'numeric', timeZone: 'utc'});\n return range(31, i => this._format(dtf, new Date(2017, 0, i + 1)));\n }\n\n getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[] {\n const dtf = new Intl.DateTimeFormat(this.locale, {weekday: style, timeZone: 'utc'});\n return range(7, i => this._format(dtf, new Date(2017, 0, i + 1)));\n }\n\n getYearName(date: Date): string {\n const dtf = new Intl.DateTimeFormat(this.locale, {year: 'numeric', timeZone: 'utc'});\n return this._format(dtf, date);\n }\n\n getFirstDayOfWeek(): number {\n // At the time of writing `Intl.Locale` isn't available\n // in the internal types so we need to cast to `any`.\n if (typeof Intl !== 'undefined' && (Intl as any).Locale) {\n const locale = new (Intl as any).Locale(this.locale) as {\n getWeekInfo?: () => {firstDay: number};\n weekInfo?: {firstDay: number};\n };\n\n // Some browsers implement a `getWeekInfo` method while others have a `weekInfo` getter.\n // Note that this isn't supported in all browsers so we need to null check it.\n const firstDay = (locale.getWeekInfo?.() || locale.weekInfo)?.firstDay ?? 0;\n\n // `weekInfo.firstDay` is a number between 1 and 7 where, starting from Monday,\n // whereas our representation is 0 to 6 where 0 is Sunday so we need to normalize it.\n return firstDay === 7 ? 0 : firstDay;\n }\n\n // Default to Sunday if the browser doesn't provide the week information.\n return 0;\n }\n\n getNumDaysInMonth(date: Date): number {\n return this.getDate(\n this._createDateWithOverflow(this.getYear(date), this.getMonth(date) + 1, 0),\n );\n }\n\n clone(date: Date): Date {\n return new Date(date.getTime());\n }\n\n createDate(year: number, month: number, date: number): Date {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n // Check for invalid month and date (except upper bound on date which we have to check after\n // creating the Date).\n if (month < 0 || month > 11) {\n throw Error(`Invalid month index \"${month}\". Month index has to be between 0 and 11.`);\n }\n\n if (date < 1) {\n throw Error(`Invalid date \"${date}\". Date has to be greater than 0.`);\n }\n }\n\n let result = this._createDateWithOverflow(year, month, date);\n // Check that the date wasn't above the upper bound for the month, causing the month to overflow\n if (result.getMonth() != month && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error(`Invalid date \"${date}\" for month with index \"${month}\".`);\n }\n\n return result;\n }\n\n today(): Date {\n return new Date();\n }\n\n parse(value: any, parseFormat?: any): Date | null {\n // We have no way using the native JS Date to set the parse format or locale, so we ignore these\n // parameters.\n if (typeof value == 'number') {\n return new Date(value);\n }\n return value ? new Date(Date.parse(value)) : null;\n }\n\n format(date: Date, displayFormat: Object): string {\n if (!this.isValid(date)) {\n throw Error('NativeDateAdapter: Cannot format invalid date.');\n }\n\n const dtf = new Intl.DateTimeFormat(this.locale, {...displayFormat, timeZone: 'utc'});\n return this._format(dtf, date);\n }\n\n addCalendarYears(date: Date, years: number): Date {\n return this.addCalendarMonths(date, years * 12);\n }\n\n addCalendarMonths(date: Date, months: number): Date {\n let newDate = this._createDateWithOverflow(\n this.getYear(date),\n this.getMonth(date) + months,\n this.getDate(date),\n );\n\n // It's possible to wind up in the wrong month if the original month has more days than the new\n // month. In this case we want to go to the last day of the desired month.\n // Note: the additional + 12 % 12 ensures we end up with a positive number, since JS % doesn't\n // guarantee this.\n if (this.getMonth(newDate) != (((this.getMonth(date) + months) % 12) + 12) % 12) {\n newDate = this._createDateWithOverflow(this.getYear(newDate), this.getMonth(newDate), 0);\n }\n\n return newDate;\n }\n\n addCalendarDays(date: Date, days: number): Date {\n return this._createDateWithOverflow(\n this.getYear(date),\n this.getMonth(date),\n this.getDate(date) + days,\n );\n }\n\n toIso8601(date: Date): string {\n return [\n date.getUTCFullYear(),\n this._2digit(date.getUTCMonth() + 1),\n this._2digit(date.getUTCDate()),\n ].join('-');\n }\n\n /**\n * Returns the given value if given a valid Date or null. Deserializes valid ISO 8601 strings\n * (https://www.ietf.org/rfc/rfc3339.txt) into valid Dates and empty string into null. Returns an\n * invalid date for all other values.\n */\n override deserialize(value: any): Date | null {\n if (typeof value === 'string') {\n if (!value) {\n return null;\n }\n // The `Date` constructor accepts formats other than ISO 8601, so we need to make sure the\n // string is the right format first.\n if (ISO_8601_REGEX.test(value)) {\n let date = new Date(value);\n if (this.isValid(date)) {\n return date;\n }\n }\n }\n return super.deserialize(value);\n }\n\n isDateInstance(obj: any) {\n return obj instanceof Date;\n }\n\n isValid(date: Date) {\n return !isNaN(date.getTime());\n }\n\n invalid(): Date {\n return new Date(NaN);\n }\n\n override setTime(target: Date, hours: number, minutes: number, seconds: number): Date {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (!inRange(hours, 0, 23)) {\n throw Error(`Invalid hours \"${hours}\". Hours value must be between 0 and 23.`);\n }\n\n if (!inRange(minutes, 0, 59)) {\n throw Error(`Invalid minutes \"${minutes}\". Minutes value must be between 0 and 59.`);\n }\n\n if (!inRange(seconds, 0, 59)) {\n throw Error(`Invalid seconds \"${seconds}\". Seconds value must be between 0 and 59.`);\n }\n }\n\n const clone = this.clone(target);\n clone.setHours(hours, minutes, seconds, 0);\n return clone;\n }\n\n override getHours(date: Date): number {\n return date.getHours();\n }\n\n override getMinutes(date: Date): number {\n return date.getMinutes();\n }\n\n override getSeconds(date: Date): number {\n return date.getSeconds();\n }\n\n override parseTime(userValue: any, parseFormat?: any): Date | null {\n if (typeof userValue !== 'string') {\n return userValue instanceof Date ? new Date(userValue.getTime()) : null;\n }\n\n const value = userValue.trim();\n\n if (value.length === 0) {\n return null;\n }\n\n // Attempt to parse the value directly.\n let result = this._parseTimeString(value);\n\n // Some locales add extra characters around the time, but are otherwise parseable\n // (e.g. `00:05 ч.` in bg-BG). Try replacing all non-number and non-colon characters.\n if (result === null) {\n const withoutExtras = value.replace(/[^0-9:(AM|PM)]/gi, '').trim();\n\n if (withoutExtras.length > 0) {\n result = this._parseTimeString(withoutExtras);\n }\n }\n\n return result || this.invalid();\n }\n\n override addSeconds(date: Date, amount: number): Date {\n return new Date(date.getTime() + amount * 1000);\n }\n\n /** Creates a date but allows the month and date to overflow. */\n private _createDateWithOverflow(year: number, month: number, date: number) {\n // Passing the year to the constructor causes year numbers <100 to be converted to 19xx.\n // To work around this we use `setFullYear` and `setHours` instead.\n const d = new Date();\n d.setFullYear(year, month, date);\n d.setHours(0, 0, 0, 0);\n return d;\n }\n\n /**\n * Pads a number to make it two digits.\n * @param n The number to pad.\n * @returns The padded number.\n */\n private _2digit(n: number) {\n return ('00' + n).slice(-2);\n }\n\n /**\n * When converting Date object to string, javascript built-in functions may return wrong\n * results because it applies its internal DST rules. The DST rules around the world change\n * very frequently, and the current valid rule is not always valid in previous years though.\n * We work around this problem building a new Date object which has its internal UTC\n * representation with the local date and time.\n * @param dtf Intl.DateTimeFormat object, containing the desired string format. It must have\n * timeZone set to 'utc' to work fine.\n * @param date Date from which we want to get the string representation according to dtf\n * @returns A Date object with its UTC representation based on the passed in date info\n */\n private _format(dtf: Intl.DateTimeFormat, date: Date) {\n // Passing the year to the constructor causes year numbers <100 to be converted to 19xx.\n // To work around this we use `setUTCFullYear` and `setUTCHours` instead.\n const d = new Date();\n d.setUTCFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n d.setUTCHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n return dtf.format(d);\n }\n\n /**\n * Attempts to parse a time string into a date object. Returns null if it cannot be parsed.\n * @param value Time string to parse.\n */\n private _parseTimeString(value: string): Date | null {\n // Note: we can technically rely on the browser for the time parsing by generating\n // an ISO string and appending the string to the end of it. We don't do it, because\n // browsers aren't consistent in what they support. Some examples:\n // - Safari doesn't support AM/PM.\n // - Firefox produces a valid date object if the time string has overflows (e.g. 12:75) while\n // other browsers produce an invalid date.\n // - Safari doesn't allow padded numbers.\n const parsed = value.toUpperCase().match(TIME_REGEX);\n\n if (parsed) {\n let hours = parseInt(parsed[1]);\n const minutes = parseInt(parsed[2]);\n let seconds: number | undefined = parsed[3] == null ? undefined : parseInt(parsed[3]);\n const amPm = parsed[4] as 'AM' | 'PM' | undefined;\n\n if (hours === 12) {\n hours = amPm === 'AM' ? 0 : hours;\n } else if (amPm === 'PM') {\n hours += 12;\n }\n\n if (\n inRange(hours, 0, 23) &&\n inRange(minutes, 0, 59) &&\n (seconds == null || inRange(seconds, 0, 59))\n ) {\n return this.setTime(this.today(), hours, minutes, seconds || 0);\n }\n }\n\n return null;\n }\n}\n\n/** Checks whether a number is within a certain range. */\nfunction inRange(value: number, min: number, max: number): boolean {\n return !isNaN(value) && value >= min && value <= max;\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 {MatDateFormats} from './date-formats';\n\nexport const MAT_NATIVE_DATE_FORMATS: MatDateFormats = {\n parse: {\n dateInput: null,\n timeInput: null,\n },\n display: {\n dateInput: {year: 'numeric', month: 'numeric', day: 'numeric'},\n timeInput: {hour: 'numeric', minute: 'numeric'},\n monthYearLabel: {year: 'numeric', month: 'short'},\n dateA11yLabel: {year: 'numeric', month: 'long', day: 'numeric'},\n monthYearA11yLabel: {year: 'numeric', month: 'long'},\n timeOptionLabel: {hour: 'numeric', minute: 'numeric'},\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 {NgModule, Provider} from '@angular/core';\nimport {DateAdapter} from './date-adapter';\nimport {MAT_DATE_FORMATS, MatDateFormats} from './date-formats';\nimport {NativeDateAdapter} from './native-date-adapter';\nimport {MAT_NATIVE_DATE_FORMATS} from './native-date-formats';\n\nexport * from './date-adapter';\nexport * from './date-formats';\nexport * from './native-date-adapter';\nexport * from './native-date-formats';\n\n@NgModule({\n providers: [{provide: DateAdapter, useClass: NativeDateAdapter}],\n})\nexport class NativeDateModule {}\n\n@NgModule({\n providers: [provideNativeDateAdapter()],\n})\nexport class MatNativeDateModule {}\n\nexport function provideNativeDateAdapter(\n formats: MatDateFormats = MAT_NATIVE_DATE_FORMATS,\n): Provider[] {\n return [\n {provide: DateAdapter, useClass: NativeDateAdapter},\n {provide: MAT_D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,QAAA,EAAC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,OAAO,EAAC;KAC/C;AACH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datepicker-testing.mjs","sources":["../../../../../
|
|
1
|
+
{"version":3,"file":"datepicker-testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/datepicker/testing/datepicker-toggle-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 {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/** 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(\n 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"],"names":[],"mappings":";;;;;;AAaA;AACM,MAAO,0BAA2B,SAAQ,4BAA4B,CAAA;AAC1E,IAAA,OAAO,YAAY,GAAG,wBAAwB;;AAGtC,IAAA,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;AAE3C;;;;;AAKG;AACH,IAAA,OAAO,IAAI,CACT,OAAA,GAA0C,EAAE,EAAA;AAE5C,QAAA,OAAO,IAAI,gBAAgB,CAAC,0BAA0B,EAAE,OAAO,CAAC;;;AAIlE,IAAA,MAAM,cAAc,GAAA;AAClB,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,QAAQ,CAAC,8BAA8B,CAAC;;;AAIrE,IAAA,MAAM,UAAU,GAAA;AACd,QAAA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE;QACnC,OAAO,qBAAqB,CAAC,MAAM,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;;AAG3D,IAAA,MAAM,aAAa,GAAA;QAC3B,OAAO,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE;;;;;;"}
|
package/fesm2022/datepicker.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, inject, ElementRef, NgZone, EventEmitter, Injector, Renderer2, afterNextRender, Component, ViewEncapsulation, ChangeDetectionStrategy, Input, Output, InjectionToken, ChangeDetectorRef, ViewChild, ViewContainerRef, DOCUMENT, booleanAttribute, Directive, forwardRef,
|
|
2
|
+
import { Injectable, inject, ElementRef, NgZone, EventEmitter, Injector, Renderer2, afterNextRender, Component, ViewEncapsulation, ChangeDetectionStrategy, Input, Output, InjectionToken, ChangeDetectorRef, signal, ViewChild, ViewContainerRef, DOCUMENT, booleanAttribute, Directive, forwardRef, HostAttributeToken, ContentChild, TemplateRef, NgModule } from '@angular/core';
|
|
3
3
|
import { Subject, Subscription, merge, of } from 'rxjs';
|
|
4
4
|
import { DateAdapter, MAT_DATE_FORMATS } from './_date-formats-chunk.mjs';
|
|
5
5
|
import { _IdGenerator, CdkMonitorFocus, CdkTrapFocus, A11yModule } from '@angular/cdk/a11y';
|
|
@@ -546,7 +546,9 @@ class MatCalendarBody {
|
|
|
546
546
|
const row = cell.getAttribute('data-mat-row');
|
|
547
547
|
const col = cell.getAttribute('data-mat-col');
|
|
548
548
|
if (row && col) {
|
|
549
|
-
|
|
549
|
+
// We need the optional read here, because this can
|
|
550
|
+
// fire too late when the user is navigating quickly.
|
|
551
|
+
return this.rows[parseInt(row)]?.[parseInt(col)] || null;
|
|
550
552
|
}
|
|
551
553
|
}
|
|
552
554
|
return null;
|
|
@@ -998,29 +1000,29 @@ class MatMonthView {
|
|
|
998
1000
|
/** The body of calendar table */
|
|
999
1001
|
_matCalendarBody;
|
|
1000
1002
|
/** The label for this month (e.g. "January 2017"). */
|
|
1001
|
-
_monthLabel;
|
|
1003
|
+
_monthLabel = signal('', ...(ngDevMode ? [{ debugName: "_monthLabel" }] : []));
|
|
1002
1004
|
/** Grid of calendar cells representing the dates of the month. */
|
|
1003
|
-
_weeks;
|
|
1005
|
+
_weeks = signal([], ...(ngDevMode ? [{ debugName: "_weeks" }] : []));
|
|
1004
1006
|
/** The number of blank cells in the first row before the 1st of the month. */
|
|
1005
|
-
_firstWeekOffset;
|
|
1007
|
+
_firstWeekOffset = signal(0, ...(ngDevMode ? [{ debugName: "_firstWeekOffset" }] : []));
|
|
1006
1008
|
/** Start value of the currently-shown date range. */
|
|
1007
|
-
_rangeStart;
|
|
1009
|
+
_rangeStart = signal(null, ...(ngDevMode ? [{ debugName: "_rangeStart" }] : []));
|
|
1008
1010
|
/** End value of the currently-shown date range. */
|
|
1009
|
-
_rangeEnd;
|
|
1011
|
+
_rangeEnd = signal(null, ...(ngDevMode ? [{ debugName: "_rangeEnd" }] : []));
|
|
1010
1012
|
/** Start value of the currently-shown comparison date range. */
|
|
1011
|
-
_comparisonRangeStart;
|
|
1013
|
+
_comparisonRangeStart = signal(null, ...(ngDevMode ? [{ debugName: "_comparisonRangeStart" }] : []));
|
|
1012
1014
|
/** End value of the currently-shown comparison date range. */
|
|
1013
|
-
_comparisonRangeEnd;
|
|
1015
|
+
_comparisonRangeEnd = signal(null, ...(ngDevMode ? [{ debugName: "_comparisonRangeEnd" }] : []));
|
|
1014
1016
|
/** Start of the preview range. */
|
|
1015
|
-
_previewStart;
|
|
1017
|
+
_previewStart = signal(null, ...(ngDevMode ? [{ debugName: "_previewStart" }] : []));
|
|
1016
1018
|
/** End of the preview range. */
|
|
1017
|
-
_previewEnd;
|
|
1019
|
+
_previewEnd = signal(null, ...(ngDevMode ? [{ debugName: "_previewEnd" }] : []));
|
|
1018
1020
|
/** Whether the user is currently selecting a range of dates. */
|
|
1019
|
-
_isRange;
|
|
1021
|
+
_isRange = signal(false, ...(ngDevMode ? [{ debugName: "_isRange" }] : []));
|
|
1020
1022
|
/** The date of the month that today falls on. Null if today is in another month. */
|
|
1021
|
-
_todayDate;
|
|
1023
|
+
_todayDate = signal(null, ...(ngDevMode ? [{ debugName: "_todayDate" }] : []));
|
|
1022
1024
|
/** The names of the weekdays. */
|
|
1023
|
-
_weekdays;
|
|
1025
|
+
_weekdays = signal([], ...(ngDevMode ? [{ debugName: "_weekdays" }] : []));
|
|
1024
1026
|
constructor() {
|
|
1025
1027
|
inject(_CdkPrivateStyleLoader).load(_VisuallyHiddenLoader);
|
|
1026
1028
|
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
@@ -1139,7 +1141,7 @@ class MatMonthView {
|
|
|
1139
1141
|
return;
|
|
1140
1142
|
case ESCAPE:
|
|
1141
1143
|
// Abort the current range selection if the user presses escape mid-selection.
|
|
1142
|
-
if (this._previewEnd != null && !hasModifierKey(event)) {
|
|
1144
|
+
if (this._previewEnd() != null && !hasModifierKey(event)) {
|
|
1143
1145
|
this._clearPreview();
|
|
1144
1146
|
// If a drag is in progress, cancel the drag without changing the
|
|
1145
1147
|
// current selection.
|
|
@@ -1177,17 +1179,16 @@ class MatMonthView {
|
|
|
1177
1179
|
/** Initializes this month view. */
|
|
1178
1180
|
_init() {
|
|
1179
1181
|
this._setRanges(this.selected);
|
|
1180
|
-
this._todayDate
|
|
1181
|
-
this._monthLabel
|
|
1182
|
+
this._todayDate.set(this._getCellCompareValue(this._dateAdapter.today()));
|
|
1183
|
+
this._monthLabel.set(this._dateFormats.display.monthLabel
|
|
1182
1184
|
? this._dateAdapter.format(this.activeDate, this._dateFormats.display.monthLabel)
|
|
1183
1185
|
: this._dateAdapter
|
|
1184
|
-
.getMonthNames('short')[this._dateAdapter.getMonth(this.activeDate)].toLocaleUpperCase();
|
|
1186
|
+
.getMonthNames('short')[this._dateAdapter.getMonth(this.activeDate)].toLocaleUpperCase());
|
|
1185
1187
|
let firstOfMonth = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), this._dateAdapter.getMonth(this.activeDate), 1);
|
|
1186
|
-
this._firstWeekOffset
|
|
1187
|
-
(
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
DAYS_PER_WEEK;
|
|
1188
|
+
this._firstWeekOffset.set((DAYS_PER_WEEK +
|
|
1189
|
+
this._dateAdapter.getDayOfWeek(firstOfMonth) -
|
|
1190
|
+
this._dateAdapter.getFirstDayOfWeek()) %
|
|
1191
|
+
DAYS_PER_WEEK);
|
|
1191
1192
|
this._initWeekdays();
|
|
1192
1193
|
this._createWeekCells();
|
|
1193
1194
|
this._changeDetectorRef.markForCheck();
|
|
@@ -1207,20 +1208,15 @@ class MatMonthView {
|
|
|
1207
1208
|
// events aren't fired for single date selections.
|
|
1208
1209
|
const value = cell ? cell.rawValue : null;
|
|
1209
1210
|
const previewRange = this._rangeStrategy.createPreview(value, this.selected, event);
|
|
1210
|
-
this._previewStart
|
|
1211
|
-
this._previewEnd
|
|
1211
|
+
this._previewStart.set(this._getCellCompareValue(previewRange.start));
|
|
1212
|
+
this._previewEnd.set(this._getCellCompareValue(previewRange.end));
|
|
1212
1213
|
if (this.activeDrag && value) {
|
|
1213
1214
|
const dragRange = this._rangeStrategy.createDrag?.(this.activeDrag.value, this.selected, value, event);
|
|
1214
1215
|
if (dragRange) {
|
|
1215
|
-
this._previewStart
|
|
1216
|
-
this._previewEnd
|
|
1216
|
+
this._previewStart.set(this._getCellCompareValue(dragRange.start));
|
|
1217
|
+
this._previewEnd.set(this._getCellCompareValue(dragRange.end));
|
|
1217
1218
|
}
|
|
1218
1219
|
}
|
|
1219
|
-
// Note that here we need to use `detectChanges`, rather than `markForCheck`, because
|
|
1220
|
-
// the way `_focusActiveCell` is set up at the moment makes it fire at the wrong time
|
|
1221
|
-
// when navigating one month back using the keyboard which will cause this handler
|
|
1222
|
-
// to throw a "changed after checked" error when updating the preview state.
|
|
1223
|
-
this._changeDetectorRef.detectChanges();
|
|
1224
1220
|
}
|
|
1225
1221
|
}
|
|
1226
1222
|
/**
|
|
@@ -1252,27 +1248,28 @@ class MatMonthView {
|
|
|
1252
1248
|
const narrowWeekdays = this._dateAdapter.getDayOfWeekNames('narrow');
|
|
1253
1249
|
const longWeekdays = this._dateAdapter.getDayOfWeekNames('long');
|
|
1254
1250
|
// Rotate the labels for days of the week based on the configured first day of the week.
|
|
1255
|
-
|
|
1251
|
+
const weekdays = longWeekdays.map((long, i) => {
|
|
1256
1252
|
return { long, narrow: narrowWeekdays[i], id: uniqueIdCounter++ };
|
|
1257
1253
|
});
|
|
1258
|
-
this._weekdays
|
|
1254
|
+
this._weekdays.set(weekdays.slice(firstDayOfWeek).concat(weekdays.slice(0, firstDayOfWeek)));
|
|
1259
1255
|
}
|
|
1260
1256
|
/** Creates MatCalendarCells for the dates in this month. */
|
|
1261
1257
|
_createWeekCells() {
|
|
1262
1258
|
const daysInMonth = this._dateAdapter.getNumDaysInMonth(this.activeDate);
|
|
1263
1259
|
const dateNames = this._dateAdapter.getDateNames();
|
|
1264
|
-
|
|
1265
|
-
for (let i = 0, cell = this._firstWeekOffset; i < daysInMonth; i++, cell++) {
|
|
1260
|
+
const weeks = [[]];
|
|
1261
|
+
for (let i = 0, cell = this._firstWeekOffset(); i < daysInMonth; i++, cell++) {
|
|
1266
1262
|
if (cell == DAYS_PER_WEEK) {
|
|
1267
|
-
|
|
1263
|
+
weeks.push([]);
|
|
1268
1264
|
cell = 0;
|
|
1269
1265
|
}
|
|
1270
1266
|
const date = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), this._dateAdapter.getMonth(this.activeDate), i + 1);
|
|
1271
1267
|
const enabled = this._shouldEnableDate(date);
|
|
1272
1268
|
const ariaLabel = this._dateAdapter.format(date, this._dateFormats.display.dateA11yLabel);
|
|
1273
1269
|
const cellClasses = this.dateClass ? this.dateClass(date, 'month') : undefined;
|
|
1274
|
-
|
|
1270
|
+
weeks[weeks.length - 1].push(new MatCalendarCell(i + 1, dateNames[i], ariaLabel, enabled, cellClasses, this._getCellCompareValue(date), date));
|
|
1275
1271
|
}
|
|
1272
|
+
this._weeks.set(weeks);
|
|
1276
1273
|
}
|
|
1277
1274
|
/** Date filter for the month */
|
|
1278
1275
|
_shouldEnableDate(date) {
|
|
@@ -1316,16 +1313,17 @@ class MatMonthView {
|
|
|
1316
1313
|
/** Sets the current range based on a model value. */
|
|
1317
1314
|
_setRanges(selectedValue) {
|
|
1318
1315
|
if (selectedValue instanceof DateRange) {
|
|
1319
|
-
this._rangeStart
|
|
1320
|
-
this._rangeEnd
|
|
1321
|
-
this._isRange
|
|
1316
|
+
this._rangeStart.set(this._getCellCompareValue(selectedValue.start));
|
|
1317
|
+
this._rangeEnd.set(this._getCellCompareValue(selectedValue.end));
|
|
1318
|
+
this._isRange.set(true);
|
|
1322
1319
|
}
|
|
1323
1320
|
else {
|
|
1324
|
-
this._rangeStart
|
|
1325
|
-
this.
|
|
1321
|
+
this._rangeStart.set(this._getCellCompareValue(selectedValue));
|
|
1322
|
+
this._rangeEnd.set(this._rangeStart());
|
|
1323
|
+
this._isRange.set(false);
|
|
1326
1324
|
}
|
|
1327
|
-
this._comparisonRangeStart
|
|
1328
|
-
this._comparisonRangeEnd
|
|
1325
|
+
this._comparisonRangeStart.set(this._getCellCompareValue(this.comparisonStart));
|
|
1326
|
+
this._comparisonRangeEnd.set(this._getCellCompareValue(this.comparisonEnd));
|
|
1329
1327
|
}
|
|
1330
1328
|
/** Gets whether a date can be selected in the month view. */
|
|
1331
1329
|
_canSelect(date) {
|
|
@@ -1333,14 +1331,15 @@ class MatMonthView {
|
|
|
1333
1331
|
}
|
|
1334
1332
|
/** Clears out preview state. */
|
|
1335
1333
|
_clearPreview() {
|
|
1336
|
-
this._previewStart
|
|
1334
|
+
this._previewStart.set(null);
|
|
1335
|
+
this._previewEnd.set(null);
|
|
1337
1336
|
}
|
|
1338
1337
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatMonthView, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1339
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.0-next.2", type: MatMonthView, isStandalone: true, selector: "mat-month-view", inputs: { activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate", dateFilter: "dateFilter", dateClass: "dateClass", comparisonStart: "comparisonStart", comparisonEnd: "comparisonEnd", startDateAccessibleName: "startDateAccessibleName", endDateAccessibleName: "endDateAccessibleName", activeDrag: "activeDrag" }, outputs: { selectedChange: "selectedChange", _userSelection: "_userSelection", dragStarted: "dragStarted", dragEnded: "dragEnded", activeDateChange: "activeDateChange" }, viewQueries: [{ propertyName: "_matCalendarBody", first: true, predicate: MatCalendarBody, descendants: true }], exportAs: ["matMonthView"], usesOnChanges: true, ngImport: i0, template: "<table class=\"mat-calendar-table\" role=\"grid\">\n <thead class=\"mat-calendar-table-header\">\n <tr>\n @for (day of _weekdays; track day.id) {\n <th scope=\"col\">\n <span class=\"cdk-visually-hidden\">{{day.long}}</span>\n <span aria-hidden=\"true\">{{day.narrow}}</span>\n </th>\n }\n </tr>\n <tr aria-hidden=\"true\"><th class=\"mat-calendar-table-header-divider\" colspan=\"7\"></th></tr>\n </thead>\n <tbody mat-calendar-body\n [label]=\"_monthLabel\"\n [rows]=\"_weeks\"\n [todayValue]=\"_todayDate!\"\n [startValue]=\"_rangeStart!\"\n [endValue]=\"_rangeEnd!\"\n [comparisonStart]=\"_comparisonRangeStart\"\n [comparisonEnd]=\"_comparisonRangeEnd\"\n [previewStart]=\"_previewStart\"\n [previewEnd]=\"_previewEnd\"\n [isRange]=\"_isRange\"\n [labelMinRequiredCells]=\"3\"\n [activeCell]=\"_dateAdapter.getDate(activeDate) - 1\"\n [startDateAccessibleName]=\"startDateAccessibleName\"\n [endDateAccessibleName]=\"endDateAccessibleName\"\n (selectedValueChange)=\"_dateSelected($event)\"\n (activeDateChange)=\"_updateActiveDate($event)\"\n (previewChange)=\"_previewChanged($event)\"\n (dragStarted)=\"dragStarted.emit($event)\"\n (dragEnded)=\"_dragEnded($event)\"\n (keyup)=\"_handleCalendarBodyKeyup($event)\"\n (keydown)=\"_handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n", dependencies: [{ kind: "component", type: MatCalendarBody, selector: "[mat-calendar-body]", inputs: ["label", "rows", "todayValue", "startValue", "endValue", "labelMinRequiredCells", "numCols", "activeCell", "isRange", "cellAspectRatio", "comparisonStart", "comparisonEnd", "previewStart", "previewEnd", "startDateAccessibleName", "endDateAccessibleName"], outputs: ["selectedValueChange", "previewChange", "activeDateChange", "dragStarted", "dragEnded"], exportAs: ["matCalendarBody"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1338
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.0-next.2", type: MatMonthView, isStandalone: true, selector: "mat-month-view", inputs: { activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate", dateFilter: "dateFilter", dateClass: "dateClass", comparisonStart: "comparisonStart", comparisonEnd: "comparisonEnd", startDateAccessibleName: "startDateAccessibleName", endDateAccessibleName: "endDateAccessibleName", activeDrag: "activeDrag" }, outputs: { selectedChange: "selectedChange", _userSelection: "_userSelection", dragStarted: "dragStarted", dragEnded: "dragEnded", activeDateChange: "activeDateChange" }, viewQueries: [{ propertyName: "_matCalendarBody", first: true, predicate: MatCalendarBody, descendants: true }], exportAs: ["matMonthView"], usesOnChanges: true, ngImport: i0, template: "<table class=\"mat-calendar-table\" role=\"grid\">\n <thead class=\"mat-calendar-table-header\">\n <tr>\n @for (day of _weekdays(); track day.id) {\n <th scope=\"col\">\n <span class=\"cdk-visually-hidden\">{{day.long}}</span>\n <span aria-hidden=\"true\">{{day.narrow}}</span>\n </th>\n }\n </tr>\n <tr aria-hidden=\"true\"><th class=\"mat-calendar-table-header-divider\" colspan=\"7\"></th></tr>\n </thead>\n <tbody mat-calendar-body\n [label]=\"_monthLabel()\"\n [rows]=\"_weeks()\"\n [todayValue]=\"_todayDate()!\"\n [startValue]=\"_rangeStart()!\"\n [endValue]=\"_rangeEnd()!\"\n [comparisonStart]=\"_comparisonRangeStart()\"\n [comparisonEnd]=\"_comparisonRangeEnd()\"\n [previewStart]=\"_previewStart()\"\n [previewEnd]=\"_previewEnd()\"\n [isRange]=\"_isRange()\"\n [labelMinRequiredCells]=\"3\"\n [activeCell]=\"_dateAdapter.getDate(activeDate) - 1\"\n [startDateAccessibleName]=\"startDateAccessibleName\"\n [endDateAccessibleName]=\"endDateAccessibleName\"\n (selectedValueChange)=\"_dateSelected($event)\"\n (activeDateChange)=\"_updateActiveDate($event)\"\n (previewChange)=\"_previewChanged($event)\"\n (dragStarted)=\"dragStarted.emit($event)\"\n (dragEnded)=\"_dragEnded($event)\"\n (keyup)=\"_handleCalendarBodyKeyup($event)\"\n (keydown)=\"_handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n", dependencies: [{ kind: "component", type: MatCalendarBody, selector: "[mat-calendar-body]", inputs: ["label", "rows", "todayValue", "startValue", "endValue", "labelMinRequiredCells", "numCols", "activeCell", "isRange", "cellAspectRatio", "comparisonStart", "comparisonEnd", "previewStart", "previewEnd", "startDateAccessibleName", "endDateAccessibleName"], outputs: ["selectedValueChange", "previewChange", "activeDateChange", "dragStarted", "dragEnded"], exportAs: ["matCalendarBody"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1340
1339
|
}
|
|
1341
1340
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatMonthView, decorators: [{
|
|
1342
1341
|
type: Component,
|
|
1343
|
-
args: [{ selector: 'mat-month-view', exportAs: 'matMonthView', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatCalendarBody], template: "<table class=\"mat-calendar-table\" role=\"grid\">\n <thead class=\"mat-calendar-table-header\">\n <tr>\n @for (day of _weekdays; track day.id) {\n <th scope=\"col\">\n <span class=\"cdk-visually-hidden\">{{day.long}}</span>\n <span aria-hidden=\"true\">{{day.narrow}}</span>\n </th>\n }\n </tr>\n <tr aria-hidden=\"true\"><th class=\"mat-calendar-table-header-divider\" colspan=\"7\"></th></tr>\n </thead>\n <tbody mat-calendar-body\n [label]=\"_monthLabel\"\n [rows]=\"_weeks\"\n [todayValue]=\"_todayDate!\"\n [startValue]=\"_rangeStart!\"\n [endValue]=\"_rangeEnd!\"\n [comparisonStart]=\"_comparisonRangeStart\"\n [comparisonEnd]=\"_comparisonRangeEnd\"\n [previewStart]=\"_previewStart\"\n [previewEnd]=\"_previewEnd\"\n [isRange]=\"_isRange\"\n [labelMinRequiredCells]=\"3\"\n [activeCell]=\"_dateAdapter.getDate(activeDate) - 1\"\n [startDateAccessibleName]=\"startDateAccessibleName\"\n [endDateAccessibleName]=\"endDateAccessibleName\"\n (selectedValueChange)=\"_dateSelected($event)\"\n (activeDateChange)=\"_updateActiveDate($event)\"\n (previewChange)=\"_previewChanged($event)\"\n (dragStarted)=\"dragStarted.emit($event)\"\n (dragEnded)=\"_dragEnded($event)\"\n (keyup)=\"_handleCalendarBodyKeyup($event)\"\n (keydown)=\"_handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n" }]
|
|
1342
|
+
args: [{ selector: 'mat-month-view', exportAs: 'matMonthView', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatCalendarBody], template: "<table class=\"mat-calendar-table\" role=\"grid\">\n <thead class=\"mat-calendar-table-header\">\n <tr>\n @for (day of _weekdays(); track day.id) {\n <th scope=\"col\">\n <span class=\"cdk-visually-hidden\">{{day.long}}</span>\n <span aria-hidden=\"true\">{{day.narrow}}</span>\n </th>\n }\n </tr>\n <tr aria-hidden=\"true\"><th class=\"mat-calendar-table-header-divider\" colspan=\"7\"></th></tr>\n </thead>\n <tbody mat-calendar-body\n [label]=\"_monthLabel()\"\n [rows]=\"_weeks()\"\n [todayValue]=\"_todayDate()!\"\n [startValue]=\"_rangeStart()!\"\n [endValue]=\"_rangeEnd()!\"\n [comparisonStart]=\"_comparisonRangeStart()\"\n [comparisonEnd]=\"_comparisonRangeEnd()\"\n [previewStart]=\"_previewStart()\"\n [previewEnd]=\"_previewEnd()\"\n [isRange]=\"_isRange()\"\n [labelMinRequiredCells]=\"3\"\n [activeCell]=\"_dateAdapter.getDate(activeDate) - 1\"\n [startDateAccessibleName]=\"startDateAccessibleName\"\n [endDateAccessibleName]=\"endDateAccessibleName\"\n (selectedValueChange)=\"_dateSelected($event)\"\n (activeDateChange)=\"_updateActiveDate($event)\"\n (previewChange)=\"_previewChanged($event)\"\n (dragStarted)=\"dragStarted.emit($event)\"\n (dragEnded)=\"_dragEnded($event)\"\n (keyup)=\"_handleCalendarBodyKeyup($event)\"\n (keydown)=\"_handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n" }]
|
|
1344
1343
|
}], ctorParameters: () => [], propDecorators: { activeDate: [{
|
|
1345
1344
|
type: Input
|
|
1346
1345
|
}], selected: [{
|
|
@@ -1448,11 +1447,11 @@ class MatMultiYearView {
|
|
|
1448
1447
|
/** The body of calendar table */
|
|
1449
1448
|
_matCalendarBody;
|
|
1450
1449
|
/** Grid of calendar cells representing the currently displayed years. */
|
|
1451
|
-
_years;
|
|
1450
|
+
_years = signal([], ...(ngDevMode ? [{ debugName: "_years" }] : []));
|
|
1452
1451
|
/** The year that today falls on. */
|
|
1453
|
-
_todayYear;
|
|
1452
|
+
_todayYear = signal(0, ...(ngDevMode ? [{ debugName: "_todayYear" }] : []));
|
|
1454
1453
|
/** The year of the selected date. Null if the selected date is null. */
|
|
1455
|
-
_selectedYear;
|
|
1454
|
+
_selectedYear = signal(null, ...(ngDevMode ? [{ debugName: "_selectedYear" }] : []));
|
|
1456
1455
|
constructor() {
|
|
1457
1456
|
if (!this._dateAdapter && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
1458
1457
|
throw createMissingDateImplError('DateAdapter');
|
|
@@ -1469,7 +1468,7 @@ class MatMultiYearView {
|
|
|
1469
1468
|
}
|
|
1470
1469
|
/** Initializes this multi-year view. */
|
|
1471
1470
|
_init() {
|
|
1472
|
-
this._todayYear
|
|
1471
|
+
this._todayYear.set(this._dateAdapter.getYear(this._dateAdapter.today()));
|
|
1473
1472
|
// We want a range years such that we maximize the number of
|
|
1474
1473
|
// enabled dates visible at once. This prevents issues where the minimum year
|
|
1475
1474
|
// is the last item of a page OR the maximum year is the first item of a page.
|
|
@@ -1477,14 +1476,15 @@ class MatMultiYearView {
|
|
|
1477
1476
|
// *actual* first rendered year in the multi-year view.
|
|
1478
1477
|
const activeYear = this._dateAdapter.getYear(this._activeDate);
|
|
1479
1478
|
const minYearOfPage = activeYear - getActiveOffset(this._dateAdapter, this.activeDate, this.minDate, this.maxDate);
|
|
1480
|
-
|
|
1479
|
+
const years = [];
|
|
1481
1480
|
for (let i = 0, row = []; i < yearsPerPage; i++) {
|
|
1482
1481
|
row.push(minYearOfPage + i);
|
|
1483
1482
|
if (row.length == yearsPerRow) {
|
|
1484
|
-
|
|
1483
|
+
years.push(row.map(year => this._createCellForYear(year)));
|
|
1485
1484
|
row = [];
|
|
1486
1485
|
}
|
|
1487
1486
|
}
|
|
1487
|
+
this._years.set(years);
|
|
1488
1488
|
this._changeDetectorRef.markForCheck();
|
|
1489
1489
|
}
|
|
1490
1490
|
/** Handles when a new year is selected. */
|
|
@@ -1628,23 +1628,23 @@ class MatMultiYearView {
|
|
|
1628
1628
|
}
|
|
1629
1629
|
/** Sets the currently-highlighted year based on a model value. */
|
|
1630
1630
|
_setSelectedYear(value) {
|
|
1631
|
-
this._selectedYear
|
|
1631
|
+
this._selectedYear.set(null);
|
|
1632
1632
|
if (value instanceof DateRange) {
|
|
1633
1633
|
const displayValue = value.start || value.end;
|
|
1634
1634
|
if (displayValue) {
|
|
1635
|
-
this._selectedYear
|
|
1635
|
+
this._selectedYear.set(this._dateAdapter.getYear(displayValue));
|
|
1636
1636
|
}
|
|
1637
1637
|
}
|
|
1638
1638
|
else if (value) {
|
|
1639
|
-
this._selectedYear
|
|
1639
|
+
this._selectedYear.set(this._dateAdapter.getYear(value));
|
|
1640
1640
|
}
|
|
1641
1641
|
}
|
|
1642
1642
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatMultiYearView, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1643
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.0-next.2", type: MatMultiYearView, isStandalone: true, selector: "mat-multi-year-view", inputs: { activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate", dateFilter: "dateFilter", dateClass: "dateClass" }, outputs: { selectedChange: "selectedChange", yearSelected: "yearSelected", activeDateChange: "activeDateChange" }, viewQueries: [{ propertyName: "_matCalendarBody", first: true, predicate: MatCalendarBody, descendants: true }], exportAs: ["matMultiYearView"], ngImport: i0, template: "<table class=\"mat-calendar-table\" role=\"grid\">\n <thead aria-hidden=\"true\" class=\"mat-calendar-table-header\">\n <tr><th class=\"mat-calendar-table-header-divider\" colspan=\"4\"></th></tr>\n </thead>\n <tbody mat-calendar-body\n [rows]=\"_years\"\n [todayValue]=\"_todayYear\"\n [startValue]=\"_selectedYear!\"\n [endValue]=\"_selectedYear!\"\n [numCols]=\"4\"\n [cellAspectRatio]=\"4 / 7\"\n [activeCell]=\"_getActiveCell()\"\n (selectedValueChange)=\"_yearSelected($event)\"\n (activeDateChange)=\"_updateActiveDate($event)\"\n (keyup)=\"_handleCalendarBodyKeyup($event)\"\n (keydown)=\"_handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n", dependencies: [{ kind: "component", type: MatCalendarBody, selector: "[mat-calendar-body]", inputs: ["label", "rows", "todayValue", "startValue", "endValue", "labelMinRequiredCells", "numCols", "activeCell", "isRange", "cellAspectRatio", "comparisonStart", "comparisonEnd", "previewStart", "previewEnd", "startDateAccessibleName", "endDateAccessibleName"], outputs: ["selectedValueChange", "previewChange", "activeDateChange", "dragStarted", "dragEnded"], exportAs: ["matCalendarBody"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1643
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.0-next.2", type: MatMultiYearView, isStandalone: true, selector: "mat-multi-year-view", inputs: { activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate", dateFilter: "dateFilter", dateClass: "dateClass" }, outputs: { selectedChange: "selectedChange", yearSelected: "yearSelected", activeDateChange: "activeDateChange" }, viewQueries: [{ propertyName: "_matCalendarBody", first: true, predicate: MatCalendarBody, descendants: true }], exportAs: ["matMultiYearView"], ngImport: i0, template: "<table class=\"mat-calendar-table\" role=\"grid\">\n <thead aria-hidden=\"true\" class=\"mat-calendar-table-header\">\n <tr><th class=\"mat-calendar-table-header-divider\" colspan=\"4\"></th></tr>\n </thead>\n <tbody mat-calendar-body\n [rows]=\"_years()\"\n [todayValue]=\"_todayYear()\"\n [startValue]=\"_selectedYear()!\"\n [endValue]=\"_selectedYear()!\"\n [numCols]=\"4\"\n [cellAspectRatio]=\"4 / 7\"\n [activeCell]=\"_getActiveCell()\"\n (selectedValueChange)=\"_yearSelected($event)\"\n (activeDateChange)=\"_updateActiveDate($event)\"\n (keyup)=\"_handleCalendarBodyKeyup($event)\"\n (keydown)=\"_handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n", dependencies: [{ kind: "component", type: MatCalendarBody, selector: "[mat-calendar-body]", inputs: ["label", "rows", "todayValue", "startValue", "endValue", "labelMinRequiredCells", "numCols", "activeCell", "isRange", "cellAspectRatio", "comparisonStart", "comparisonEnd", "previewStart", "previewEnd", "startDateAccessibleName", "endDateAccessibleName"], outputs: ["selectedValueChange", "previewChange", "activeDateChange", "dragStarted", "dragEnded"], exportAs: ["matCalendarBody"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1644
1644
|
}
|
|
1645
1645
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatMultiYearView, decorators: [{
|
|
1646
1646
|
type: Component,
|
|
1647
|
-
args: [{ selector: 'mat-multi-year-view', exportAs: 'matMultiYearView', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatCalendarBody], template: "<table class=\"mat-calendar-table\" role=\"grid\">\n <thead aria-hidden=\"true\" class=\"mat-calendar-table-header\">\n <tr><th class=\"mat-calendar-table-header-divider\" colspan=\"4\"></th></tr>\n </thead>\n <tbody mat-calendar-body\n [rows]=\"_years\"\n [todayValue]=\"_todayYear\"\n [startValue]=\"_selectedYear!\"\n [endValue]=\"_selectedYear!\"\n [numCols]=\"4\"\n [cellAspectRatio]=\"4 / 7\"\n [activeCell]=\"_getActiveCell()\"\n (selectedValueChange)=\"_yearSelected($event)\"\n (activeDateChange)=\"_updateActiveDate($event)\"\n (keyup)=\"_handleCalendarBodyKeyup($event)\"\n (keydown)=\"_handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n" }]
|
|
1647
|
+
args: [{ selector: 'mat-multi-year-view', exportAs: 'matMultiYearView', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatCalendarBody], template: "<table class=\"mat-calendar-table\" role=\"grid\">\n <thead aria-hidden=\"true\" class=\"mat-calendar-table-header\">\n <tr><th class=\"mat-calendar-table-header-divider\" colspan=\"4\"></th></tr>\n </thead>\n <tbody mat-calendar-body\n [rows]=\"_years()\"\n [todayValue]=\"_todayYear()\"\n [startValue]=\"_selectedYear()!\"\n [endValue]=\"_selectedYear()!\"\n [numCols]=\"4\"\n [cellAspectRatio]=\"4 / 7\"\n [activeCell]=\"_getActiveCell()\"\n (selectedValueChange)=\"_yearSelected($event)\"\n (activeDateChange)=\"_updateActiveDate($event)\"\n (keyup)=\"_handleCalendarBodyKeyup($event)\"\n (keydown)=\"_handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n" }]
|
|
1648
1648
|
}], ctorParameters: () => [], propDecorators: { activeDate: [{
|
|
1649
1649
|
type: Input
|
|
1650
1650
|
}], selected: [{
|
|
@@ -1772,16 +1772,16 @@ class MatYearView {
|
|
|
1772
1772
|
/** The body of calendar table */
|
|
1773
1773
|
_matCalendarBody;
|
|
1774
1774
|
/** Grid of calendar cells representing the months of the year. */
|
|
1775
|
-
_months;
|
|
1775
|
+
_months = signal([], ...(ngDevMode ? [{ debugName: "_months" }] : []));
|
|
1776
1776
|
/** The label for this year (e.g. "2017"). */
|
|
1777
|
-
_yearLabel;
|
|
1777
|
+
_yearLabel = signal('', ...(ngDevMode ? [{ debugName: "_yearLabel" }] : []));
|
|
1778
1778
|
/** The month in this year that today falls on. Null if today is in a different year. */
|
|
1779
|
-
_todayMonth;
|
|
1779
|
+
_todayMonth = signal(null, ...(ngDevMode ? [{ debugName: "_todayMonth" }] : []));
|
|
1780
1780
|
/**
|
|
1781
1781
|
* The month in this year that the selected Date falls on.
|
|
1782
1782
|
* Null if the selected Date is in a different year.
|
|
1783
1783
|
*/
|
|
1784
|
-
_selectedMonth;
|
|
1784
|
+
_selectedMonth = signal(null, ...(ngDevMode ? [{ debugName: "_selectedMonth" }] : []));
|
|
1785
1785
|
constructor() {
|
|
1786
1786
|
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
1787
1787
|
if (!this._dateAdapter) {
|
|
@@ -1890,15 +1890,15 @@ class MatYearView {
|
|
|
1890
1890
|
/** Initializes this year view. */
|
|
1891
1891
|
_init() {
|
|
1892
1892
|
this._setSelectedMonth(this.selected);
|
|
1893
|
-
this._todayMonth
|
|
1894
|
-
this._yearLabel
|
|
1893
|
+
this._todayMonth.set(this._getMonthInCurrentYear(this._dateAdapter.today()));
|
|
1894
|
+
this._yearLabel.set(this._dateAdapter.getYearName(this.activeDate));
|
|
1895
1895
|
let monthNames = this._dateAdapter.getMonthNames('short');
|
|
1896
1896
|
// First row of months only contains 5 elements so we can fit the year label on the same row.
|
|
1897
|
-
this._months
|
|
1897
|
+
this._months.set([
|
|
1898
1898
|
[0, 1, 2, 3],
|
|
1899
1899
|
[4, 5, 6, 7],
|
|
1900
1900
|
[8, 9, 10, 11],
|
|
1901
|
-
].map(row => row.map(month => this._createCellForMonth(month, monthNames[month])));
|
|
1901
|
+
].map(row => row.map(month => this._createCellForMonth(month, monthNames[month]))));
|
|
1902
1902
|
this._changeDetectorRef.markForCheck();
|
|
1903
1903
|
}
|
|
1904
1904
|
/** Focuses the active cell after the microtask queue is empty. */
|
|
@@ -1986,19 +1986,18 @@ class MatYearView {
|
|
|
1986
1986
|
/** Sets the currently-selected month based on a model value. */
|
|
1987
1987
|
_setSelectedMonth(value) {
|
|
1988
1988
|
if (value instanceof DateRange) {
|
|
1989
|
-
this._selectedMonth
|
|
1990
|
-
this._getMonthInCurrentYear(value.start) || this._getMonthInCurrentYear(value.end);
|
|
1989
|
+
this._selectedMonth.set(this._getMonthInCurrentYear(value.start) || this._getMonthInCurrentYear(value.end));
|
|
1991
1990
|
}
|
|
1992
1991
|
else {
|
|
1993
|
-
this._selectedMonth
|
|
1992
|
+
this._selectedMonth.set(this._getMonthInCurrentYear(value));
|
|
1994
1993
|
}
|
|
1995
1994
|
}
|
|
1996
1995
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatYearView, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1997
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.0-next.2", type: MatYearView, isStandalone: true, selector: "mat-year-view", inputs: { activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate", dateFilter: "dateFilter", dateClass: "dateClass" }, outputs: { selectedChange: "selectedChange", monthSelected: "monthSelected", activeDateChange: "activeDateChange" }, viewQueries: [{ propertyName: "_matCalendarBody", first: true, predicate: MatCalendarBody, descendants: true }], exportAs: ["matYearView"], ngImport: i0, template: "<table class=\"mat-calendar-table\" role=\"grid\">\n <thead aria-hidden=\"true\" class=\"mat-calendar-table-header\">\n <tr><th class=\"mat-calendar-table-header-divider\" colspan=\"4\"></th></tr>\n </thead>\n <tbody mat-calendar-body\n [label]=\"_yearLabel\"\n [rows]=\"_months\"\n [todayValue]=\"_todayMonth!\"\n [startValue]=\"_selectedMonth!\"\n [endValue]=\"_selectedMonth!\"\n [labelMinRequiredCells]=\"2\"\n [numCols]=\"4\"\n [cellAspectRatio]=\"4 / 7\"\n [activeCell]=\"_dateAdapter.getMonth(activeDate)\"\n (selectedValueChange)=\"_monthSelected($event)\"\n (activeDateChange)=\"_updateActiveDate($event)\"\n (keyup)=\"_handleCalendarBodyKeyup($event)\"\n (keydown)=\"_handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n", dependencies: [{ kind: "component", type: MatCalendarBody, selector: "[mat-calendar-body]", inputs: ["label", "rows", "todayValue", "startValue", "endValue", "labelMinRequiredCells", "numCols", "activeCell", "isRange", "cellAspectRatio", "comparisonStart", "comparisonEnd", "previewStart", "previewEnd", "startDateAccessibleName", "endDateAccessibleName"], outputs: ["selectedValueChange", "previewChange", "activeDateChange", "dragStarted", "dragEnded"], exportAs: ["matCalendarBody"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1996
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.0-next.2", type: MatYearView, isStandalone: true, selector: "mat-year-view", inputs: { activeDate: "activeDate", selected: "selected", minDate: "minDate", maxDate: "maxDate", dateFilter: "dateFilter", dateClass: "dateClass" }, outputs: { selectedChange: "selectedChange", monthSelected: "monthSelected", activeDateChange: "activeDateChange" }, viewQueries: [{ propertyName: "_matCalendarBody", first: true, predicate: MatCalendarBody, descendants: true }], exportAs: ["matYearView"], ngImport: i0, template: "<table class=\"mat-calendar-table\" role=\"grid\">\n <thead aria-hidden=\"true\" class=\"mat-calendar-table-header\">\n <tr><th class=\"mat-calendar-table-header-divider\" colspan=\"4\"></th></tr>\n </thead>\n <tbody mat-calendar-body\n [label]=\"_yearLabel()\"\n [rows]=\"_months()\"\n [todayValue]=\"_todayMonth()!\"\n [startValue]=\"_selectedMonth()!\"\n [endValue]=\"_selectedMonth()!\"\n [labelMinRequiredCells]=\"2\"\n [numCols]=\"4\"\n [cellAspectRatio]=\"4 / 7\"\n [activeCell]=\"_dateAdapter.getMonth(activeDate)\"\n (selectedValueChange)=\"_monthSelected($event)\"\n (activeDateChange)=\"_updateActiveDate($event)\"\n (keyup)=\"_handleCalendarBodyKeyup($event)\"\n (keydown)=\"_handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n", dependencies: [{ kind: "component", type: MatCalendarBody, selector: "[mat-calendar-body]", inputs: ["label", "rows", "todayValue", "startValue", "endValue", "labelMinRequiredCells", "numCols", "activeCell", "isRange", "cellAspectRatio", "comparisonStart", "comparisonEnd", "previewStart", "previewEnd", "startDateAccessibleName", "endDateAccessibleName"], outputs: ["selectedValueChange", "previewChange", "activeDateChange", "dragStarted", "dragEnded"], exportAs: ["matCalendarBody"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1998
1997
|
}
|
|
1999
1998
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: MatYearView, decorators: [{
|
|
2000
1999
|
type: Component,
|
|
2001
|
-
args: [{ selector: 'mat-year-view', exportAs: 'matYearView', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatCalendarBody], template: "<table class=\"mat-calendar-table\" role=\"grid\">\n <thead aria-hidden=\"true\" class=\"mat-calendar-table-header\">\n <tr><th class=\"mat-calendar-table-header-divider\" colspan=\"4\"></th></tr>\n </thead>\n <tbody mat-calendar-body\n [label]=\"_yearLabel\"\n [rows]=\"_months\"\n [todayValue]=\"_todayMonth!\"\n [startValue]=\"_selectedMonth!\"\n [endValue]=\"_selectedMonth!\"\n [labelMinRequiredCells]=\"2\"\n [numCols]=\"4\"\n [cellAspectRatio]=\"4 / 7\"\n [activeCell]=\"_dateAdapter.getMonth(activeDate)\"\n (selectedValueChange)=\"_monthSelected($event)\"\n (activeDateChange)=\"_updateActiveDate($event)\"\n (keyup)=\"_handleCalendarBodyKeyup($event)\"\n (keydown)=\"_handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n" }]
|
|
2000
|
+
args: [{ selector: 'mat-year-view', exportAs: 'matYearView', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatCalendarBody], template: "<table class=\"mat-calendar-table\" role=\"grid\">\n <thead aria-hidden=\"true\" class=\"mat-calendar-table-header\">\n <tr><th class=\"mat-calendar-table-header-divider\" colspan=\"4\"></th></tr>\n </thead>\n <tbody mat-calendar-body\n [label]=\"_yearLabel()\"\n [rows]=\"_months()\"\n [todayValue]=\"_todayMonth()!\"\n [startValue]=\"_selectedMonth()!\"\n [endValue]=\"_selectedMonth()!\"\n [labelMinRequiredCells]=\"2\"\n [numCols]=\"4\"\n [cellAspectRatio]=\"4 / 7\"\n [activeCell]=\"_dateAdapter.getMonth(activeDate)\"\n (selectedValueChange)=\"_monthSelected($event)\"\n (activeDateChange)=\"_updateActiveDate($event)\"\n (keyup)=\"_handleCalendarBodyKeyup($event)\"\n (keydown)=\"_handleCalendarBodyKeydown($event)\">\n </tbody>\n</table>\n" }]
|
|
2002
2001
|
}], ctorParameters: () => [], propDecorators: { activeDate: [{
|
|
2003
2002
|
type: Input
|
|
2004
2003
|
}], selected: [{
|