@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.
Files changed (82) hide show
  1. package/_theming.scss +4 -0
  2. package/bundles/material-autocomplete.umd.js +1 -1
  3. package/bundles/material-autocomplete.umd.js.map +1 -1
  4. package/bundles/material-autocomplete.umd.min.js +1 -1
  5. package/bundles/material-autocomplete.umd.min.js.map +1 -1
  6. package/bundles/material-core.umd.js +17 -2
  7. package/bundles/material-core.umd.js.map +1 -1
  8. package/bundles/material-core.umd.min.js +4 -4
  9. package/bundles/material-core.umd.min.js.map +1 -1
  10. package/bundles/material-datepicker.umd.js +39 -5
  11. package/bundles/material-datepicker.umd.js.map +1 -1
  12. package/bundles/material-datepicker.umd.min.js +8 -8
  13. package/bundles/material-datepicker.umd.min.js.map +1 -1
  14. package/bundles/material-form-field.umd.js +0 -2
  15. package/bundles/material-form-field.umd.js.map +1 -1
  16. package/bundles/material-form-field.umd.min.js +1 -1
  17. package/bundles/material-form-field.umd.min.js.map +1 -1
  18. package/bundles/material-list.umd.js +3 -1
  19. package/bundles/material-list.umd.js.map +1 -1
  20. package/bundles/material-list.umd.min.js +1 -1
  21. package/bundles/material-list.umd.min.js.map +1 -1
  22. package/bundles/material-paginator.umd.js +1 -0
  23. package/bundles/material-paginator.umd.js.map +1 -1
  24. package/bundles/material-paginator.umd.min.js +1 -1
  25. package/bundles/material-paginator.umd.min.js.map +1 -1
  26. package/bundles/material-snack-bar.umd.js +2 -1
  27. package/bundles/material-snack-bar.umd.js.map +1 -1
  28. package/bundles/material-snack-bar.umd.min.js +1 -1
  29. package/bundles/material-snack-bar.umd.min.js.map +1 -1
  30. package/bundles/material-tabs.umd.js +11 -2
  31. package/bundles/material-tabs.umd.js.map +1 -1
  32. package/bundles/material-tabs.umd.min.js +7 -7
  33. package/bundles/material-tabs.umd.min.js.map +1 -1
  34. package/core/index.metadata.json +1 -1
  35. package/core/ripple/ripple-renderer.d.ts +2 -0
  36. package/core/ripple/ripple.d.ts +2 -0
  37. package/datepicker/date-range-input-parts.d.ts +2 -0
  38. package/datepicker/date-range-input.d.ts +4 -1
  39. package/datepicker/date-selection-model.d.ts +2 -0
  40. package/datepicker/index.metadata.json +1 -1
  41. package/esm2015/autocomplete/autocomplete-trigger.js +2 -2
  42. package/esm2015/core/common-behaviors/common-module.js +1 -1
  43. package/esm2015/core/ripple/ripple-renderer.js +9 -1
  44. package/esm2015/core/ripple/ripple.js +8 -1
  45. package/esm2015/core/version.js +1 -1
  46. package/esm2015/datepicker/date-range-input-parts.js +23 -1
  47. package/esm2015/datepicker/date-range-input.js +14 -3
  48. package/esm2015/datepicker/date-selection-model.js +3 -2
  49. package/esm2015/form-field/form-field.js +1 -3
  50. package/esm2015/list/selection-list.js +4 -2
  51. package/esm2015/paginator/paginator.js +2 -1
  52. package/esm2015/snack-bar/snack-bar-ref.js +2 -1
  53. package/esm2015/snack-bar/snack-bar.js +2 -2
  54. package/esm2015/tabs/paginated-tab-header.js +5 -3
  55. package/esm2015/tabs/tab-group.js +8 -1
  56. package/fesm2015/autocomplete.js +1 -1
  57. package/fesm2015/autocomplete.js.map +1 -1
  58. package/fesm2015/core.js +17 -2
  59. package/fesm2015/core.js.map +1 -1
  60. package/fesm2015/datepicker.js +37 -3
  61. package/fesm2015/datepicker.js.map +1 -1
  62. package/fesm2015/form-field.js +0 -2
  63. package/fesm2015/form-field.js.map +1 -1
  64. package/fesm2015/list.js +3 -1
  65. package/fesm2015/list.js.map +1 -1
  66. package/fesm2015/paginator.js +1 -0
  67. package/fesm2015/paginator.js.map +1 -1
  68. package/fesm2015/snack-bar.js +2 -1
  69. package/fesm2015/snack-bar.js.map +1 -1
  70. package/fesm2015/tabs.js +11 -2
  71. package/fesm2015/tabs.js.map +1 -1
  72. package/form-field/index.metadata.json +1 -1
  73. package/list/index.metadata.json +1 -1
  74. package/package.json +2 -2
  75. package/paginator/index.metadata.json +1 -1
  76. package/prebuilt-themes/deeppurple-amber.css +1 -1
  77. package/prebuilt-themes/indigo-pink.css +1 -1
  78. package/prebuilt-themes/pink-bluegrey.css +1 -1
  79. package/prebuilt-themes/purple-green.css +1 -1
  80. package/schematics/ng-add/index.js +1 -1
  81. package/snack-bar/snack-bar.d.ts +1 -1
  82. package/tabs/index.metadata.json +1 -1
@@ -707,8 +707,9 @@
707
707
  * @param source Object that triggered the selection change.
708
708
  */
709
709
  MatDateSelectionModel.prototype.updateSelection = function (value, source) {
710
+ var oldValue = this.selection;
710
711
  this.selection = value;
711
- this._selectionChanged.next({ selection: value, source: source });
712
+ this._selectionChanged.next({ selection: value, source: source, oldValue: oldValue });
712
713
  };
713
714
  MatDateSelectionModel.prototype.ngOnDestroy = function () {
714
715
  this._selectionChanged.complete();
@@ -3462,8 +3463,8 @@
3462
3463
  MatDateRangeInputPartBase.prototype._parentDisabled = function () {
3463
3464
  return this._rangeInput._groupDisabled;
3464
3465
  };
3465
- MatDateRangeInputPartBase.prototype._shouldHandleChangeEvent = function (_a) {
3466
- var source = _a.source;
3466
+ MatDateRangeInputPartBase.prototype._shouldHandleChangeEvent = function (_b) {
3467
+ var source = _b.source;
3467
3468
  return source !== this._rangeInput._startInput && source !== this._rangeInput._endInput;
3468
3469
  };
3469
3470
  MatDateRangeInputPartBase.prototype._assignValueProgrammatically = function (value) {
@@ -3531,6 +3532,17 @@
3531
3532
  MatStartDate.prototype._getValueFromModel = function (modelValue) {
3532
3533
  return modelValue.start;
3533
3534
  };
3535
+ MatStartDate.prototype._shouldHandleChangeEvent = function (change) {
3536
+ var _a;
3537
+ if (!_super.prototype._shouldHandleChangeEvent.call(this, change)) {
3538
+ return false;
3539
+ }
3540
+ else {
3541
+ return !((_a = change.oldValue) === null || _a === void 0 ? void 0 : _a.start) ? !!change.selection.start :
3542
+ !change.selection.start ||
3543
+ !!this._dateAdapter.compareDate(change.oldValue.start, change.selection.start);
3544
+ }
3545
+ };
3534
3546
  MatStartDate.prototype._assignValueToModel = function (value) {
3535
3547
  if (this._model) {
3536
3548
  var range = new DateRange(value, this._model.selection.end);
@@ -3628,6 +3640,17 @@
3628
3640
  MatEndDate.prototype._getValueFromModel = function (modelValue) {
3629
3641
  return modelValue.end;
3630
3642
  };
3643
+ MatEndDate.prototype._shouldHandleChangeEvent = function (change) {
3644
+ var _a;
3645
+ if (!_super.prototype._shouldHandleChangeEvent.call(this, change)) {
3646
+ return false;
3647
+ }
3648
+ else {
3649
+ return !((_a = change.oldValue) === null || _a === void 0 ? void 0 : _a.end) ? !!change.selection.end :
3650
+ !change.selection.end ||
3651
+ !!this._dateAdapter.compareDate(change.oldValue.end, change.selection.end);
3652
+ }
3653
+ };
3631
3654
  MatEndDate.prototype._assignValueToModel = function (value) {
3632
3655
  if (this._model) {
3633
3656
  var range = new DateRange(this._model.selection.start, value);
@@ -3715,6 +3738,11 @@
3715
3738
  if (!_dateAdapter && (typeof ngDevMode === 'undefined' || ngDevMode)) {
3716
3739
  throw createMissingDateImplError('DateAdapter');
3717
3740
  }
3741
+ // The datepicker module can be used both with MDC and non-MDC form fields. We have
3742
+ // to conditionally add the MDC input class so that the range picker looks correctly.
3743
+ if (_formField === null || _formField === void 0 ? void 0 : _formField._elementRef.nativeElement.classList.contains('mat-mdc-form-field')) {
3744
+ _elementRef.nativeElement.classList.add('mat-mdc-input-element');
3745
+ }
3718
3746
  // TODO(crisbeto): remove `as any` after #18206 lands.
3719
3747
  this.ngControl = control;
3720
3748
  }
@@ -3943,13 +3971,19 @@
3943
3971
  };
3944
3972
  /** Whether the separate text should be hidden. */
3945
3973
  MatDateRangeInput.prototype._shouldHideSeparator = function () {
3946
- return (!this._formField || this._formField._hideControlPlaceholder()) && this.empty;
3974
+ return (!this._formField || (this._formField.getLabelId() &&
3975
+ !this._formField._shouldLabelFloat())) && this.empty;
3947
3976
  };
3948
3977
  /** Gets the value for the `aria-labelledby` attribute of the inputs. */
3949
3978
  MatDateRangeInput.prototype._getAriaLabelledby = function () {
3950
3979
  var formField = this._formField;
3951
3980
  return formField && formField._hasFloatingLabel() ? formField._labelId : null;
3952
3981
  };
3982
+ /** Updates the focused state of the range input. */
3983
+ MatDateRangeInput.prototype._updateFocus = function (origin) {
3984
+ this.focused = origin !== null;
3985
+ this.stateChanges.next();
3986
+ };
3953
3987
  /** Re-runs the validators on the start/end inputs. */
3954
3988
  MatDateRangeInput.prototype._revalidate = function () {
3955
3989
  if (this._startInput) {
@@ -3973,7 +4007,7 @@
3973
4007
  MatDateRangeInput.decorators = [
3974
4008
  { type: i0.Component, args: [{
3975
4009
  selector: 'mat-date-range-input',
3976
- template: "<div\n class=\"mat-date-range-input-container\"\n cdkMonitorSubtreeFocus\n (cdkFocusChange)=\"focused = $event !== null\">\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",
4010
+ 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",
3977
4011
  exportAs: 'matDateRangeInput',
3978
4012
  host: {
3979
4013
  'class': 'mat-date-range-input',