@dhutaryan/ngx-mat-timepicker 12.4.0 → 12.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -60,6 +60,10 @@
60
60
  this.openTimepickerLabel = 'Open timepicker';
61
61
  /** Label for the button used to close the timepicker popup (used by screen readers). */
62
62
  this.closeTimepickerLabel = 'Close timepicker';
63
+ /** A label for OK button to apply time. */
64
+ this.okButton = 'OK';
65
+ /** A label for cancel button to close timepicker. */
66
+ this.cancelButton = 'Cancel';
63
67
  }
64
68
  return MatTimepickerIntl;
65
69
  }());
@@ -1462,6 +1466,18 @@
1462
1466
  var newValue = isMeridiem && value === 0 ? 12 : value;
1463
1467
  return withZeroPrefix(newValue);
1464
1468
  }
1469
+ var DIGIT_KEYS = [
1470
+ 'Digit0',
1471
+ 'Digit1',
1472
+ 'Digit2',
1473
+ 'Digit3',
1474
+ 'Digit4',
1475
+ 'Digit5',
1476
+ 'Digit6',
1477
+ 'Digit7',
1478
+ 'Digit8',
1479
+ 'Digit9',
1480
+ ];
1465
1481
  var MatTimeInputBase = /** @class */ (function () {
1466
1482
  function MatTimeInputBase(element, _cdr, _document) {
1467
1483
  this.element = element;
@@ -1483,6 +1499,11 @@
1483
1499
  enumerable: false,
1484
1500
  configurable: true
1485
1501
  });
1502
+ MatTimeInputBase.prototype._keydown = function (event) {
1503
+ if (!DIGIT_KEYS.includes(event.code)) {
1504
+ event.preventDefault();
1505
+ }
1506
+ };
1486
1507
  Object.defineProperty(MatTimeInputBase.prototype, "inputElement", {
1487
1508
  get: function () {
1488
1509
  return this.element.nativeElement;
@@ -1524,7 +1545,7 @@
1524
1545
  return MatTimeInputBase;
1525
1546
  }());
1526
1547
  MatTimeInputBase.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MatTimeInputBase, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }, { token: i7.DOCUMENT }], target: i0__namespace.ɵɵFactoryTarget.Directive });
1527
- MatTimeInputBase.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: MatTimeInputBase, inputs: { value: "value" }, outputs: { timeChanged: "timeChanged" }, ngImport: i0__namespace });
1548
+ MatTimeInputBase.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: MatTimeInputBase, inputs: { value: "value" }, outputs: { timeChanged: "timeChanged" }, host: { listeners: { "keydown": "_keydown($event)" } }, ngImport: i0__namespace });
1528
1549
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MatTimeInputBase, decorators: [{
1529
1550
  type: i0.Directive
1530
1551
  }], ctorParameters: function () {
@@ -1536,6 +1557,9 @@
1536
1557
  type: i0.Input
1537
1558
  }], timeChanged: [{
1538
1559
  type: i0.Output
1560
+ }], _keydown: [{
1561
+ type: i0.HostListener,
1562
+ args: ['keydown', ['$event']]
1539
1563
  }] } });
1540
1564
 
1541
1565
  var visible = { transform: 'scale(1)', opacity: 1, visibility: 'visible' };
@@ -3053,9 +3077,10 @@
3053
3077
  */
3054
3078
  var MatTimepickerDefaultActions = /** @class */ (function (_super) {
3055
3079
  __extends(MatTimepickerDefaultActions, _super);
3056
- function MatTimepickerDefaultActions(elementRef, _timepicker) {
3080
+ function MatTimepickerDefaultActions(elementRef, _timepicker, _intl) {
3057
3081
  var _this = _super.call(this, elementRef) || this;
3058
3082
  _this._timepicker = _timepicker;
3083
+ _this._intl = _intl;
3059
3084
  return _this;
3060
3085
  }
3061
3086
  MatTimepickerDefaultActions.prototype.ngOnInit = function () {
@@ -3063,21 +3088,21 @@
3063
3088
  };
3064
3089
  return MatTimepickerDefaultActions;
3065
3090
  }(_MatTimepickerDefaultActions));
3066
- MatTimepickerDefaultActions.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MatTimepickerDefaultActions, deps: [{ token: i0__namespace.ElementRef }, { token: MatTimepickerBase }], target: i0__namespace.ɵɵFactoryTarget.Component });
3067
- MatTimepickerDefaultActions.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: MatTimepickerDefaultActions, selector: "mat-timepicker-default-actions", host: { classAttribute: "mat-timepicker-actions-container" }, usesInheritance: true, ngImport: i0__namespace, template: "\n <div class=\"mat-timepicker-actions\">\n <ng-content></ng-content>\n <button [color]=\"color\" mat-button matTimepickerCancel>Cancel</button>\n <button [color]=\"color\" mat-button matTimepickerApply>OK</button>\n </div>\n ", isInline: true, styles: [".mat-timepicker-actions-container{margin-left:auto}.mat-timepicker-actions{display:flex;grid-gap:.5rem;gap:.5rem;align-items:center;margin-top:.5rem}\n"], components: [{ type: i1__namespace.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: MatTimepickerCancel, selector: "[matTimepickerCancel]" }, { type: MatTimepickerApply, selector: "[matTimepickerApply]" }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
3091
+ MatTimepickerDefaultActions.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MatTimepickerDefaultActions, deps: [{ token: i0__namespace.ElementRef }, { token: MatTimepickerBase }, { token: MatTimepickerIntl }], target: i0__namespace.ɵɵFactoryTarget.Component });
3092
+ MatTimepickerDefaultActions.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: MatTimepickerDefaultActions, selector: "mat-timepicker-default-actions", host: { classAttribute: "mat-timepicker-actions-container" }, usesInheritance: true, ngImport: i0__namespace, template: "\n <div class=\"mat-timepicker-actions\">\n <ng-content></ng-content>\n <button [color]=\"color\" mat-button matTimepickerCancel>\n {{ _intl.cancelButton }}\n </button>\n <button [color]=\"color\" mat-button matTimepickerApply>\n {{ _intl.okButton }}\n </button>\n </div>\n ", isInline: true, styles: [".mat-timepicker-actions-container{margin-left:auto}.mat-timepicker-actions{display:flex;grid-gap:.5rem;gap:.5rem;align-items:center;margin-top:.5rem}\n"], components: [{ type: i1__namespace.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: MatTimepickerCancel, selector: "[matTimepickerCancel]" }, { type: MatTimepickerApply, selector: "[matTimepickerApply]" }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush, encapsulation: i0__namespace.ViewEncapsulation.None });
3068
3093
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MatTimepickerDefaultActions, decorators: [{
3069
3094
  type: i0.Component,
3070
3095
  args: [{
3071
3096
  selector: 'mat-timepicker-default-actions',
3072
3097
  styleUrls: ['timepicker-actions.scss'],
3073
- template: "\n <div class=\"mat-timepicker-actions\">\n <ng-content></ng-content>\n <button [color]=\"color\" mat-button matTimepickerCancel>Cancel</button>\n <button [color]=\"color\" mat-button matTimepickerApply>OK</button>\n </div>\n ",
3098
+ template: "\n <div class=\"mat-timepicker-actions\">\n <ng-content></ng-content>\n <button [color]=\"color\" mat-button matTimepickerCancel>\n {{ _intl.cancelButton }}\n </button>\n <button [color]=\"color\" mat-button matTimepickerApply>\n {{ _intl.okButton }}\n </button>\n </div>\n ",
3074
3099
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
3075
3100
  encapsulation: i0.ViewEncapsulation.None,
3076
3101
  host: {
3077
3102
  class: 'mat-timepicker-actions-container',
3078
3103
  },
3079
3104
  }]
3080
- }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: MatTimepickerBase }]; } });
3105
+ }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: MatTimepickerBase }, { type: MatTimepickerIntl }]; } });
3081
3106
 
3082
3107
  var MatTimepickerModule = /** @class */ (function () {
3083
3108
  function MatTimepickerModule() {