@colijnit/corecomponents_v12 12.0.60 → 12.0.62

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.
@@ -3480,33 +3480,70 @@
3480
3480
  },] }
3481
3481
  ];
3482
3482
 
3483
+ function showHideDialogAnimation(name) {
3484
+ return window.innerWidth > 700 ?
3485
+ animations.trigger(name, [
3486
+ animations.state('*', animations.style({ opacity: 1 })),
3487
+ animations.state('void', animations.style({ opacity: 0 })),
3488
+ animations.transition('void => *', animations.animate('200ms 200ms')),
3489
+ animations.transition('* => void', animations.animate(200))
3490
+ ]) :
3491
+ animations.trigger(name, [
3492
+ animations.state('*', animations.style({ bottom: 0 })),
3493
+ animations.state('void', animations.style({ bottom: '-100%' })),
3494
+ animations.transition('void => *', animations.animate('200ms 200ms')),
3495
+ animations.transition('* => void', animations.animate(200))
3496
+ ]);
3497
+ }
3483
3498
  var CoDialogComponent = /** @class */ (function () {
3484
3499
  function CoDialogComponent() {
3485
3500
  this.icons = exports.CoreComponentsIcon;
3486
3501
  this.showCloseIcon = true;
3487
3502
  this.modal = false;
3488
3503
  this.borderless = false;
3489
- this.animation = true;
3490
3504
  this.closeClick = new core.EventEmitter();
3491
3505
  this.overlayClick = new core.EventEmitter();
3506
+ this.isTouch = false;
3507
+ this.mobile = false;
3508
+ this.show = false;
3492
3509
  }
3493
3510
  CoDialogComponent.prototype.showClass = function () {
3494
3511
  return true;
3495
3512
  };
3513
+ CoDialogComponent.prototype.handleKeyDown = function (event) {
3514
+ switch (event.code) {
3515
+ case 'Escape':
3516
+ this.handleCloseDialog();
3517
+ }
3518
+ };
3519
+ CoDialogComponent.prototype.ngOnInit = function () {
3520
+ this._checkDevice();
3521
+ this.show = true;
3522
+ };
3496
3523
  CoDialogComponent.prototype.handleCloseDialog = function (event) {
3497
- this.closeClick.emit(event);
3524
+ var _this = this;
3525
+ this.show = false;
3526
+ setTimeout(function () {
3527
+ _this.closeClick.emit(event);
3528
+ }, 400);
3498
3529
  };
3499
3530
  CoDialogComponent.prototype.handleOverlayClick = function (event) {
3500
3531
  if (!this.modal) {
3501
3532
  this.overlayClick.emit(event);
3502
3533
  }
3503
3534
  };
3535
+ CoDialogComponent.prototype._checkDevice = function () {
3536
+ this.isTouch = ('ontouchstart' in window) ||
3537
+ (navigator.maxTouchPoints > 0) ||
3538
+ (navigator.msMaxTouchPoints > 0);
3539
+ this.mobile = window.innerWidth < 700;
3540
+ };
3504
3541
  return CoDialogComponent;
3505
3542
  }());
3506
3543
  CoDialogComponent.decorators = [
3507
3544
  { type: core.Component, args: [{
3508
3545
  selector: 'co-dialog',
3509
- template: "\n <div class=\"co-dialog-overlay\" (click)=\"handleOverlayClick($event)\" [@showHideOverlay]=\"animation\"></div>\n <div class=\"co-dialog-wrapper\" [@showHideDialog]=\"animation\">\n <div class=\"dialog-header\" *ngIf=\"!borderless\">\n <div class=\"dialog-header-caption\">\n <ng-content select=\"[header]\"></ng-content>\n </div>\n <div class=\"dialog-close-button\" *ngIf=\"showCloseIcon\" (click)=\"handleCloseDialog($event)\">\n <co-icon [icon]=\"icons.Cancel\"></co-icon>\n </div>\n </div>\n <div class=\"dialog-content\">\n <ng-content></ng-content>\n </div>\n <div class=\"dialog-footer\">\n <ng-content select=\"[footer]\"></ng-content>\n </div>\n </div>\n ",
3546
+ template: "\n <div class=\"co-dialog-overlay\" *ngIf=\"show\" (click)=\"handleOverlayClick($event)\" @showHideOverlay></div>\n <div class=\"co-dialog-wrapper\" *ngIf=\"show\" @showHideDialog>\n <div class=\"dialog-header\" *ngIf=\"!borderless\">\n <div class=\"dialog-header-caption\" *ngIf=\"headerTemplate\">\n <ng-container [ngTemplateOutlet]=\"headerTemplate\"></ng-container>\n </div>\n <div class=\"dialog-close-button\" *ngIf=\"showCloseIcon\" (click)=\"handleCloseDialog($event)\">\n <co-icon [icon]=\"icons.Cancel\"></co-icon>\n </div>\n </div>\n <div class=\"dialog-content\">\n <ng-content></ng-content>\n </div>\n <div class=\"dialog-footer\" *ngIf=\"footerTemplate\">\n <ng-container [ngTemplateOutlet]=\"footerTemplate\"></ng-container>\n </div>\n </div>\n ",
3510
3547
  animations: [
3511
3548
  animations.trigger('showHideOverlay', [
3512
3549
  animations.state('*', animations.style({ opacity: 1 })),
@@ -3514,24 +3551,23 @@
3514
3551
  animations.transition('void => *', animations.animate(200)),
3515
3552
  animations.transition('* => void', animations.animate('200ms 200ms'))
3516
3553
  ]),
3517
- animations.trigger('showHideDialog', [
3518
- animations.state('*', animations.style({ opacity: 1 })),
3519
- animations.state('void', animations.style({ opacity: 0 })),
3520
- animations.transition('void => *', animations.animate('200ms 200ms')),
3521
- animations.transition('* => void', animations.animate(200))
3522
- ])
3554
+ showHideDialogAnimation('showHideDialog')
3523
3555
  ],
3524
3556
  encapsulation: core.ViewEncapsulation.None
3525
3557
  },] }
3526
3558
  ];
3527
3559
  CoDialogComponent.propDecorators = {
3560
+ headerTemplate: [{ type: core.Input }],
3561
+ footerTemplate: [{ type: core.Input }],
3528
3562
  showCloseIcon: [{ type: core.Input }],
3529
3563
  modal: [{ type: core.Input }],
3530
3564
  borderless: [{ type: core.HostBinding, args: ['class.borderless',] }, { type: core.Input }],
3531
- animation: [{ type: core.Input }],
3532
3565
  closeClick: [{ type: core.Output }],
3533
3566
  overlayClick: [{ type: core.Output }],
3534
- showClass: [{ type: core.HostBinding, args: ["class.co-dialog",] }]
3567
+ showClass: [{ type: core.HostBinding, args: ['class.co-dialog',] }],
3568
+ handleKeyDown: [{ type: core.HostListener, args: ['window:keydown', ['$event'],] }],
3569
+ isTouch: [{ type: core.HostBinding, args: ['class.is-touch',] }],
3570
+ mobile: [{ type: core.HostBinding, args: ['class.is-mobile',] }]
3535
3571
  };
3536
3572
 
3537
3573
  var CoDialogModule = /** @class */ (function () {
@@ -4920,21 +4956,23 @@
4920
4956
  _a = event.code;
4921
4957
  switch (_a) {
4922
4958
  case 'Enter': return [3 /*break*/, 1];
4923
- case 'Tab': return [3 /*break*/, 3];
4924
- case 'Escape': return [3 /*break*/, 5];
4959
+ case 'Tab': return [3 /*break*/, 4];
4960
+ case 'Escape': return [3 /*break*/, 6];
4925
4961
  }
4926
- return [3 /*break*/, 6];
4962
+ return [3 /*break*/, 7];
4927
4963
  case 1:
4964
+ if (!!event.shiftKey) return [3 /*break*/, 3];
4928
4965
  event.preventDefault();
4929
4966
  return [4 /*yield*/, this.commitClick()];
4930
4967
  case 2:
4931
4968
  _b.sent();
4932
4969
  return [2 /*return*/, false];
4933
- case 3:
4970
+ case 3: return [2 /*return*/, true];
4971
+ case 4:
4934
4972
  nextSiblingToFocus = event.shiftKey ? event.currentTarget.previousSibling : event.currentTarget.nextSibling;
4935
4973
  event.preventDefault();
4936
4974
  return [4 /*yield*/, this.commitClick()];
4937
- case 4:
4975
+ case 5:
4938
4976
  success = _b.sent();
4939
4977
  if (success) {
4940
4978
  if (nextSiblingToFocus) {
@@ -4946,11 +4984,11 @@
4946
4984
  }
4947
4985
  }
4948
4986
  return [2 /*return*/, false];
4949
- case 5:
4987
+ case 6:
4950
4988
  this.cancelClick();
4951
4989
  event.preventDefault();
4952
4990
  return [2 /*return*/, false];
4953
- case 6: return [2 /*return*/];
4991
+ case 7: return [2 /*return*/];
4954
4992
  }
4955
4993
  });
4956
4994
  });
@@ -4968,6 +5006,9 @@
4968
5006
  };
4969
5007
  BaseInputComponent.prototype._setFocusOnNextPossibleInput = function (element, previous) {
4970
5008
  var elementColl = element.getElementsByTagName('input');
5009
+ if (!elementColl || elementColl.length < 1) {
5010
+ elementColl = element.getElementsByTagName('textarea');
5011
+ }
4971
5012
  if (elementColl && elementColl.length > 0) {
4972
5013
  var inputElement = elementColl[0];
4973
5014
  if (inputElement.disabled || inputElement.readOnly) {
@@ -6194,7 +6235,7 @@
6194
6235
  InputCheckboxComponent.decorators = [
6195
6236
  { type: core.Component, args: [{
6196
6237
  selector: "co-input-checkbox",
6197
- template: "\n <ejs-checkbox [label]=\"label\"\n [name]=\"name\"\n [cssClass]=\"cssClass\"\n [ngModel]=\"model\"\n [disabled]=\"disabled\"\n (ngModelChange)=\"handleModelChange($event)\"\n ></ejs-checkbox>\n ",
6238
+ template: "\n <ejs-checkbox [label]=\"label\"\n [name]=\"name\"\n [cssClass]=\"cssClass\"\n [ngModel]=\"model\"\n [disabled]=\"disabled\"\n [style.pointer-events]=\"(readonly == true) ? 'none' : 'auto'\"\n (click)=\"!readonly\"\n (ngModelChange)=\"handleModelChange($event)\"\n ></ejs-checkbox>\n ",
6198
6239
  providers: [{
6199
6240
  provide: COMPONENT_INTERFACE_NAME,
6200
6241
  useExisting: core.forwardRef(function () { return InputCheckboxComponent; })
@@ -6729,7 +6770,6 @@
6729
6770
  _this.collection = [];
6730
6771
  _this.customHeight = true;
6731
6772
  _this.selectionSettings = { mode: 'Multiple' };
6732
- _super.prototype._markAsOnPush.call(_this);
6733
6773
  return _this;
6734
6774
  }
6735
6775
  Object.defineProperty(InputListboxComponent.prototype, "singleSelect", {
@@ -6767,7 +6807,7 @@
6767
6807
  InputListboxComponent.decorators = [
6768
6808
  { type: core.Component, args: [{
6769
6809
  selector: 'co-input-listbox',
6770
- template: "\n <div class=\"co-input-listbox-header\" [textContent]=\"placeholder\"></div>\n <div class=\"co-input-listbox-content\">\n <ejs-listbox\n [ngModel]=\"value\"\n [dataSource]=\"collection\"\n [fields]=\"fields\"\n [selectionSettings]=\"selectionSettings\"\n (ngModelChange)=\"modelChange.emit($event)\"\n ></ejs-listbox>\n </div>\n <div class=\"required-indicator\"></div>\n <ng-template #validationError></ng-template>\n ",
6810
+ template: "\n <div class=\"co-input-listbox-header\" [textContent]=\"placeholder\"></div>\n <div class=\"co-input-listbox-content\">\n <ejs-listbox\n [ngModel]=\"value\"\n [dataSource]=\"collection\"\n [fields]=\"fields\"\n [disabled]=\"readonly\"\n [selectionSettings]=\"selectionSettings\"\n (ngModelChange)=\"modelChange.emit($event)\"\n ></ejs-listbox>\n </div>\n <div class=\"required-indicator\"></div>\n <ng-template #validationError></ng-template>\n ",
6771
6811
  providers: [{
6772
6812
  provide: COMPONENT_INTERFACE_NAME, useExisting: core.forwardRef(function () { return InputListboxComponent; })
6773
6813
  }, {
@@ -7767,7 +7807,7 @@
7767
7807
  InputTextareaComponent.decorators = [
7768
7808
  { type: core.Component, args: [{
7769
7809
  selector: "co-input-textarea",
7770
- template: "\n <label [textContent]=\"placeholder\"></label>\n <textarea\n #input\n type=\"textarea\"\n [ngModel]=\"model\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n (ngModelChange)=\"modelChange.emit($event)\"\n ></textarea>\n <div class=\"required-indicator\"></div>\n <ng-template #validationError></ng-template>\n ",
7810
+ template: "\n <label [textContent]=\"placeholder\"></label>\n <textarea\n #input\n type=\"textarea\"\n [ngModel]=\"model\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n (ngModelChange)=\"modelChange.emit($event)\"\n ></textarea>\n <co-commit-buttons *ngIf=\"showSaveCancel && focused && canSaveOrCancel\"\n [committing]=\"committing\"\n [commitFinished]=\"commitFinished\"\n (commitClick)=\"commitClick($event)\"\n (cancelClick)=\"cancelClick($event)\"\n >\n </co-commit-buttons>\n <div class=\"required-indicator\"></div>\n <ng-template #validationError></ng-template>\n ",
7771
7811
  providers: [{
7772
7812
  provide: COMPONENT_INTERFACE_NAME,
7773
7813
  useExisting: core.forwardRef(function () { return InputTextareaComponent; })
@@ -7803,7 +7843,8 @@
7803
7843
  imports: [
7804
7844
  common.CommonModule,
7805
7845
  forms.FormsModule,
7806
- ValidationErrorModule
7846
+ ValidationErrorModule,
7847
+ CommitButtonsModule
7807
7848
  ],
7808
7849
  declarations: [
7809
7850
  InputTextareaComponent
@@ -11267,6 +11308,7 @@
11267
11308
  exports.TextInputPopupComponent = TextInputPopupComponent;
11268
11309
  exports.TileComponent = TileComponent;
11269
11310
  exports.TileModule = TileModule;
11311
+ exports.showHideDialogAnimation = showHideDialogAnimation;
11270
11312
  exports["ɵa"] = RippleModule;
11271
11313
  exports["ɵb"] = MD_RIPPLE_GLOBAL_OPTIONS;
11272
11314
  exports["ɵba"] = PaginationService;