You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
7.5 KiB
1 lines
7.5 KiB
{"version":3,"file":"datepicker-input-base.d.ts","sources":["datepicker-input-base.d.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA;AACA;AACA;AACA;AACA;AACA","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 */\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport { ElementRef, EventEmitter, OnDestroy, AfterViewInit, OnChanges, SimpleChanges } from '@angular/core';\nimport { AbstractControl, ControlValueAccessor, ValidationErrors, Validator, ValidatorFn } from '@angular/forms';\nimport { DateAdapter, MatDateFormats } from '@angular/material/core';\nimport { Subject } from 'rxjs';\nimport { ExtractDateTypeFromSelection, MatDateSelectionModel, DateSelectionModelChange } from './date-selection-model';\n/**\n * An event used for datepicker input and change events. We don't always have access to a native\n * input or change event because the event may have been triggered by the user clicking on the\n * calendar popup. For consistency, we always use MatDatepickerInputEvent instead.\n */\nexport declare class MatDatepickerInputEvent<D, S = unknown> {\n /** Reference to the datepicker input component that emitted the event. */\n target: MatDatepickerInputBase<S, D>;\n /** Reference to the native input element associated with the datepicker input. */\n targetElement: HTMLElement;\n /** The new value for the target datepicker input. */\n value: D | null;\n constructor(\n /** Reference to the datepicker input component that emitted the event. */\n target: MatDatepickerInputBase<S, D>, \n /** Reference to the native input element associated with the datepicker input. */\n targetElement: HTMLElement);\n}\n/** Function that can be used to filter out dates from a calendar. */\nexport declare type DateFilterFn<D> = (date: D | null) => boolean;\n/** Base class for datepicker inputs. */\nexport declare abstract class MatDatepickerInputBase<S, D = ExtractDateTypeFromSelection<S>> implements ControlValueAccessor, AfterViewInit, OnChanges, OnDestroy, Validator {\n protected _elementRef: ElementRef<HTMLInputElement>;\n _dateAdapter: DateAdapter<D>;\n private _dateFormats;\n /** Whether the component has been initialized. */\n private _isInitialized;\n /** The value of the input. */\n get value(): D | null;\n set value(value: D | null);\n protected _model: MatDateSelectionModel<S, D> | undefined;\n /** Whether the datepicker-input is disabled. */\n get disabled(): boolean;\n set disabled(value: boolean);\n private _disabled;\n /** Emits when a `change` event is fired on this `<input>`. */\n readonly dateChange: EventEmitter<MatDatepickerInputEvent<D, S>>;\n /** Emits when an `input` event is fired on this `<input>`. */\n readonly dateInput: EventEmitter<MatDatepickerInputEvent<D, S>>;\n /** Emits when the internal state has changed */\n readonly stateChanges: Subject<void>;\n _onTouched: () => void;\n _validatorOnChange: () => void;\n private _cvaOnChange;\n private _valueChangesSubscription;\n private _localeSubscription;\n /**\n * Since the value is kept on the model which is assigned in an Input,\n * we might get a value before we have a model. This property keeps track\n * of the value until we have somewhere to assign it.\n */\n private _pendingValue;\n /** The form control validator for whether the input parses. */\n private _parseValidator;\n /** The form control validator for the date filter. */\n private _filterValidator;\n /** The form control validator for the min date. */\n private _minValidator;\n /** The form control validator for the max date. */\n private _maxValidator;\n /** Gets the base validator functions. */\n protected _getValidators(): ValidatorFn[];\n /** Gets the minimum date for the input. Used for validation. */\n abstract _getMinDate(): D | null;\n /** Gets the maximum date for the input. Used for validation. */\n abstract _getMaxDate(): D | null;\n /** Gets the date filter function. Used for validation. */\n protected abstract _getDateFilter(): DateFilterFn<D> | undefined;\n /** Registers a date selection model with the input. */\n _registerModel(model: MatDateSelectionModel<S, D>): void;\n /** Opens the popup associated with the input. */\n protected abstract _openPopup(): void;\n /** Assigns a value to the input's model. */\n protected abstract _assignValueToModel(model: D | null): void;\n /** Converts a value from the model into a native value for the input. */\n protected abstract _getValueFromModel(modelValue: S): D | null;\n /** Combined form control validator for this input. */\n protected abstract _validator: ValidatorFn | null;\n /** Predicate that determines whether the input should handle a particular change event. */\n protected abstract _shouldHandleChangeEvent(event: DateSelectionModelChange<S>): boolean;\n /** Whether the last value set on the input was valid. */\n protected _lastValueValid: boolean;\n constructor(_elementRef: ElementRef<HTMLInputElement>, _dateAdapter: DateAdapter<D>, _dateFormats: MatDateFormats);\n ngAfterViewInit(): void;\n ngOnChanges(changes: SimpleChanges): void;\n ngOnDestroy(): void;\n /** @docs-private */\n registerOnValidatorChange(fn: () => void): void;\n /** @docs-private */\n validate(c: AbstractControl): ValidationErrors | null;\n writeValue(value: D): void;\n registerOnChange(fn: (value: any) => void): void;\n registerOnTouched(fn: () => void): void;\n setDisabledState(isDisabled: boolean): void;\n _onKeydown(event: KeyboardEvent): void;\n _onInput(value: string): void;\n _onChange(): void;\n /** Handles blur events on the input. */\n _onBlur(): void;\n /** Formats a value and sets it on the input element. */\n protected _formatValue(value: D | null): void;\n /** Assigns a value to the model. */\n private _assignValue;\n /** Whether a value is considered valid. */\n private _isValidValue;\n /**\n * Checks whether a parent control is disabled. This is in place so that it can be overridden\n * by inputs extending this one which can be placed inside of a group that can be disabled.\n */\n protected _parentDisabled(): boolean;\n /** Programmatically assigns a value to the input. */\n protected _assignValueProgrammatically(value: D | null): void;\n /** Gets whether a value matches the current date filter. */\n _matchesFilter(value: D | null): boolean;\n static ngAcceptInputType_value: any;\n static ngAcceptInputType_disabled: BooleanInput;\n}\n/**\n * Checks whether the `SimpleChanges` object from an `ngOnChanges`\n * callback has any changes, accounting for date objects.\n */\nexport declare function dateInputsHaveChanged(changes: SimpleChanges, adapter: DateAdapter<unknown>): boolean;\n"]}
|