@angular/material 11.2.8 → 11.2.12
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/_theming.scss +4 -0
- package/bundles/material-autocomplete.umd.js +1 -1
- package/bundles/material-autocomplete.umd.js.map +1 -1
- package/bundles/material-autocomplete.umd.min.js +1 -1
- package/bundles/material-autocomplete.umd.min.js.map +1 -1
- package/bundles/material-core.umd.js +17 -2
- package/bundles/material-core.umd.js.map +1 -1
- package/bundles/material-core.umd.min.js +4 -4
- package/bundles/material-core.umd.min.js.map +1 -1
- package/bundles/material-datepicker.umd.js +39 -5
- package/bundles/material-datepicker.umd.js.map +1 -1
- package/bundles/material-datepicker.umd.min.js +8 -8
- package/bundles/material-datepicker.umd.min.js.map +1 -1
- package/bundles/material-form-field.umd.js +0 -2
- package/bundles/material-form-field.umd.js.map +1 -1
- package/bundles/material-form-field.umd.min.js +1 -1
- package/bundles/material-form-field.umd.min.js.map +1 -1
- package/bundles/material-list.umd.js +3 -1
- package/bundles/material-list.umd.js.map +1 -1
- package/bundles/material-list.umd.min.js +1 -1
- package/bundles/material-list.umd.min.js.map +1 -1
- package/bundles/material-paginator.umd.js +1 -0
- package/bundles/material-paginator.umd.js.map +1 -1
- package/bundles/material-paginator.umd.min.js +1 -1
- package/bundles/material-paginator.umd.min.js.map +1 -1
- package/bundles/material-snack-bar.umd.js +2 -1
- package/bundles/material-snack-bar.umd.js.map +1 -1
- package/bundles/material-snack-bar.umd.min.js +1 -1
- package/bundles/material-snack-bar.umd.min.js.map +1 -1
- package/bundles/material-tabs.umd.js +11 -2
- package/bundles/material-tabs.umd.js.map +1 -1
- package/bundles/material-tabs.umd.min.js +7 -7
- package/bundles/material-tabs.umd.min.js.map +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 +4 -1
- package/datepicker/date-selection-model.d.ts +2 -0
- package/datepicker/index.metadata.json +1 -1
- package/esm2015/autocomplete/autocomplete-trigger.js +2 -2
- package/esm2015/core/common-behaviors/common-module.js +1 -1
- 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 +14 -3
- package/esm2015/datepicker/date-selection-model.js +3 -2
- package/esm2015/form-field/form-field.js +1 -3
- package/esm2015/list/selection-list.js +4 -2
- package/esm2015/paginator/paginator.js +2 -1
- package/esm2015/snack-bar/snack-bar-ref.js +2 -1
- package/esm2015/snack-bar/snack-bar.js +2 -2
- package/esm2015/tabs/paginated-tab-header.js +5 -3
- package/esm2015/tabs/tab-group.js +8 -1
- package/fesm2015/autocomplete.js +1 -1
- package/fesm2015/autocomplete.js.map +1 -1
- package/fesm2015/core.js +17 -2
- package/fesm2015/core.js.map +1 -1
- package/fesm2015/datepicker.js +37 -3
- package/fesm2015/datepicker.js.map +1 -1
- package/fesm2015/form-field.js +0 -2
- package/fesm2015/form-field.js.map +1 -1
- package/fesm2015/list.js +3 -1
- package/fesm2015/list.js.map +1 -1
- package/fesm2015/paginator.js +1 -0
- package/fesm2015/paginator.js.map +1 -1
- package/fesm2015/snack-bar.js +2 -1
- package/fesm2015/snack-bar.js.map +1 -1
- package/fesm2015/tabs.js +11 -2
- package/fesm2015/tabs.js.map +1 -1
- package/form-field/index.metadata.json +1 -1
- package/list/index.metadata.json +1 -1
- package/package.json +2 -2
- 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/ng-add/index.js +1 -1
- package/snack-bar/snack-bar.d.ts +1 -1
- package/tabs/index.metadata.json +1 -1
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();
|
|
@@ -3059,6 +3060,17 @@ class MatStartDate extends _MatDateRangeInputBase {
|
|
|
3059
3060
|
_getValueFromModel(modelValue) {
|
|
3060
3061
|
return modelValue.start;
|
|
3061
3062
|
}
|
|
3063
|
+
_shouldHandleChangeEvent(change) {
|
|
3064
|
+
var _a;
|
|
3065
|
+
if (!super._shouldHandleChangeEvent(change)) {
|
|
3066
|
+
return false;
|
|
3067
|
+
}
|
|
3068
|
+
else {
|
|
3069
|
+
return !((_a = change.oldValue) === null || _a === void 0 ? void 0 : _a.start) ? !!change.selection.start :
|
|
3070
|
+
!change.selection.start ||
|
|
3071
|
+
!!this._dateAdapter.compareDate(change.oldValue.start, change.selection.start);
|
|
3072
|
+
}
|
|
3073
|
+
}
|
|
3062
3074
|
_assignValueToModel(value) {
|
|
3063
3075
|
if (this._model) {
|
|
3064
3076
|
const range = new DateRange(value, this._model.selection.end);
|
|
@@ -3152,6 +3164,17 @@ class MatEndDate extends _MatDateRangeInputBase {
|
|
|
3152
3164
|
_getValueFromModel(modelValue) {
|
|
3153
3165
|
return modelValue.end;
|
|
3154
3166
|
}
|
|
3167
|
+
_shouldHandleChangeEvent(change) {
|
|
3168
|
+
var _a;
|
|
3169
|
+
if (!super._shouldHandleChangeEvent(change)) {
|
|
3170
|
+
return false;
|
|
3171
|
+
}
|
|
3172
|
+
else {
|
|
3173
|
+
return !((_a = change.oldValue) === null || _a === void 0 ? void 0 : _a.end) ? !!change.selection.end :
|
|
3174
|
+
!change.selection.end ||
|
|
3175
|
+
!!this._dateAdapter.compareDate(change.oldValue.end, change.selection.end);
|
|
3176
|
+
}
|
|
3177
|
+
}
|
|
3155
3178
|
_assignValueToModel(value) {
|
|
3156
3179
|
if (this._model) {
|
|
3157
3180
|
const range = new DateRange(this._model.selection.start, value);
|
|
@@ -3238,6 +3261,11 @@ class MatDateRangeInput {
|
|
|
3238
3261
|
if (!_dateAdapter && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
3239
3262
|
throw createMissingDateImplError('DateAdapter');
|
|
3240
3263
|
}
|
|
3264
|
+
// The datepicker module can be used both with MDC and non-MDC form fields. We have
|
|
3265
|
+
// to conditionally add the MDC input class so that the range picker looks correctly.
|
|
3266
|
+
if (_formField === null || _formField === void 0 ? void 0 : _formField._elementRef.nativeElement.classList.contains('mat-mdc-form-field')) {
|
|
3267
|
+
_elementRef.nativeElement.classList.add('mat-mdc-input-element');
|
|
3268
|
+
}
|
|
3241
3269
|
// TODO(crisbeto): remove `as any` after #18206 lands.
|
|
3242
3270
|
this.ngControl = control;
|
|
3243
3271
|
}
|
|
@@ -3420,13 +3448,19 @@ class MatDateRangeInput {
|
|
|
3420
3448
|
}
|
|
3421
3449
|
/** Whether the separate text should be hidden. */
|
|
3422
3450
|
_shouldHideSeparator() {
|
|
3423
|
-
return (!this._formField || this._formField.
|
|
3451
|
+
return (!this._formField || (this._formField.getLabelId() &&
|
|
3452
|
+
!this._formField._shouldLabelFloat())) && this.empty;
|
|
3424
3453
|
}
|
|
3425
3454
|
/** Gets the value for the `aria-labelledby` attribute of the inputs. */
|
|
3426
3455
|
_getAriaLabelledby() {
|
|
3427
3456
|
const formField = this._formField;
|
|
3428
3457
|
return formField && formField._hasFloatingLabel() ? formField._labelId : null;
|
|
3429
3458
|
}
|
|
3459
|
+
/** Updates the focused state of the range input. */
|
|
3460
|
+
_updateFocus(origin) {
|
|
3461
|
+
this.focused = origin !== null;
|
|
3462
|
+
this.stateChanges.next();
|
|
3463
|
+
}
|
|
3430
3464
|
/** Re-runs the validators on the start/end inputs. */
|
|
3431
3465
|
_revalidate() {
|
|
3432
3466
|
if (this._startInput) {
|
|
@@ -3449,7 +3483,7 @@ class MatDateRangeInput {
|
|
|
3449
3483
|
MatDateRangeInput.decorators = [
|
|
3450
3484
|
{ type: Component, args: [{
|
|
3451
3485
|
selector: 'mat-date-range-input',
|
|
3452
|
-
template: "<div\n class=\"mat-date-range-input-container\"\n cdkMonitorSubtreeFocus\n (cdkFocusChange)=\"
|
|
3486
|
+
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",
|
|
3453
3487
|
exportAs: 'matDateRangeInput',
|
|
3454
3488
|
host: {
|
|
3455
3489
|
'class': 'mat-date-range-input',
|