@colijnit/corecomponents_v12 12.0.59 → 12.0.61

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.
@@ -2188,7 +2188,7 @@
2188
2188
  },] }
2189
2189
  ];
2190
2190
 
2191
- /*! *****************************************************************************
2191
+ /******************************************************************************
2192
2192
  Copyright (c) Microsoft Corporation.
2193
2193
 
2194
2194
  Permission to use, copy, modify, and/or distribute this software for any
@@ -2350,7 +2350,11 @@
2350
2350
  var __createBinding = Object.create ? (function (o, m, k, k2) {
2351
2351
  if (k2 === undefined)
2352
2352
  k2 = k;
2353
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
2353
+ var desc = Object.getOwnPropertyDescriptor(m, k);
2354
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
2355
+ desc = { enumerable: true, get: function () { return m[k]; } };
2356
+ }
2357
+ Object.defineProperty(o, k2, desc);
2354
2358
  }) : (function (o, m, k, k2) {
2355
2359
  if (k2 === undefined)
2356
2360
  k2 = k;
@@ -2504,6 +2508,11 @@
2504
2508
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
2505
2509
  throw new TypeError("Cannot write private member to an object whose class did not declare it");
2506
2510
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
2511
+ }
2512
+ function __classPrivateFieldIn(state, receiver) {
2513
+ if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
2514
+ throw new TypeError("Cannot use 'in' operator on non-object");
2515
+ return typeof state === "function" ? receiver === state : state.has(receiver);
2507
2516
  }
2508
2517
 
2509
2518
  /** AUTO GENERATED FILE. DO NOT CHANGE.. OR YOU WILL SUFFER THE CONSEQUENCES OF YOUR ACTIONS **/
@@ -3480,33 +3489,70 @@
3480
3489
  },] }
3481
3490
  ];
3482
3491
 
3492
+ function showHideDialogAnimation(name) {
3493
+ return window.innerWidth > 700 ?
3494
+ animations.trigger(name, [
3495
+ animations.state('*', animations.style({ opacity: 1 })),
3496
+ animations.state('void', animations.style({ opacity: 0 })),
3497
+ animations.transition('void => *', animations.animate('200ms 200ms')),
3498
+ animations.transition('* => void', animations.animate(200))
3499
+ ]) :
3500
+ animations.trigger(name, [
3501
+ animations.state('*', animations.style({ bottom: 0 })),
3502
+ animations.state('void', animations.style({ bottom: '-100%' })),
3503
+ animations.transition('void => *', animations.animate('200ms 200ms')),
3504
+ animations.transition('* => void', animations.animate(200))
3505
+ ]);
3506
+ }
3483
3507
  var CoDialogComponent = /** @class */ (function () {
3484
3508
  function CoDialogComponent() {
3485
3509
  this.icons = exports.CoreComponentsIcon;
3486
3510
  this.showCloseIcon = true;
3487
3511
  this.modal = false;
3488
3512
  this.borderless = false;
3489
- this.animation = true;
3490
3513
  this.closeClick = new core.EventEmitter();
3491
3514
  this.overlayClick = new core.EventEmitter();
3515
+ this.isTouch = false;
3516
+ this.mobile = false;
3517
+ this.show = false;
3492
3518
  }
3493
3519
  CoDialogComponent.prototype.showClass = function () {
3494
3520
  return true;
3495
3521
  };
3522
+ CoDialogComponent.prototype.handleKeyDown = function (event) {
3523
+ switch (event.code) {
3524
+ case 'Escape':
3525
+ this.handleCloseDialog();
3526
+ }
3527
+ };
3528
+ CoDialogComponent.prototype.ngOnInit = function () {
3529
+ this._checkDevice();
3530
+ this.show = true;
3531
+ };
3496
3532
  CoDialogComponent.prototype.handleCloseDialog = function (event) {
3497
- this.closeClick.emit(event);
3533
+ var _this = this;
3534
+ this.show = false;
3535
+ setTimeout(function () {
3536
+ _this.closeClick.emit(event);
3537
+ }, 400);
3498
3538
  };
3499
3539
  CoDialogComponent.prototype.handleOverlayClick = function (event) {
3500
3540
  if (!this.modal) {
3501
3541
  this.overlayClick.emit(event);
3502
3542
  }
3503
3543
  };
3544
+ CoDialogComponent.prototype._checkDevice = function () {
3545
+ this.isTouch = ('ontouchstart' in window) ||
3546
+ (navigator.maxTouchPoints > 0) ||
3547
+ (navigator.msMaxTouchPoints > 0);
3548
+ this.mobile = window.innerWidth < 700;
3549
+ };
3504
3550
  return CoDialogComponent;
3505
3551
  }());
3506
3552
  CoDialogComponent.decorators = [
3507
3553
  { type: core.Component, args: [{
3508
3554
  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 ",
3555
+ 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
3556
  animations: [
3511
3557
  animations.trigger('showHideOverlay', [
3512
3558
  animations.state('*', animations.style({ opacity: 1 })),
@@ -3514,24 +3560,23 @@
3514
3560
  animations.transition('void => *', animations.animate(200)),
3515
3561
  animations.transition('* => void', animations.animate('200ms 200ms'))
3516
3562
  ]),
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
- ])
3563
+ showHideDialogAnimation('showHideDialog')
3523
3564
  ],
3524
3565
  encapsulation: core.ViewEncapsulation.None
3525
3566
  },] }
3526
3567
  ];
3527
3568
  CoDialogComponent.propDecorators = {
3569
+ headerTemplate: [{ type: core.Input }],
3570
+ footerTemplate: [{ type: core.Input }],
3528
3571
  showCloseIcon: [{ type: core.Input }],
3529
3572
  modal: [{ type: core.Input }],
3530
3573
  borderless: [{ type: core.HostBinding, args: ['class.borderless',] }, { type: core.Input }],
3531
- animation: [{ type: core.Input }],
3532
3574
  closeClick: [{ type: core.Output }],
3533
3575
  overlayClick: [{ type: core.Output }],
3534
- showClass: [{ type: core.HostBinding, args: ["class.co-dialog",] }]
3576
+ showClass: [{ type: core.HostBinding, args: ['class.co-dialog',] }],
3577
+ handleKeyDown: [{ type: core.HostListener, args: ['window:keydown', ['$event'],] }],
3578
+ isTouch: [{ type: core.HostBinding, args: ['class.is-touch',] }],
3579
+ mobile: [{ type: core.HostBinding, args: ['class.is-mobile',] }]
3535
3580
  };
3536
3581
 
3537
3582
  var CoDialogModule = /** @class */ (function () {
@@ -4920,21 +4965,23 @@
4920
4965
  _a = event.code;
4921
4966
  switch (_a) {
4922
4967
  case 'Enter': return [3 /*break*/, 1];
4923
- case 'Tab': return [3 /*break*/, 3];
4924
- case 'Escape': return [3 /*break*/, 5];
4968
+ case 'Tab': return [3 /*break*/, 4];
4969
+ case 'Escape': return [3 /*break*/, 6];
4925
4970
  }
4926
- return [3 /*break*/, 6];
4971
+ return [3 /*break*/, 7];
4927
4972
  case 1:
4973
+ if (!!event.shiftKey) return [3 /*break*/, 3];
4928
4974
  event.preventDefault();
4929
4975
  return [4 /*yield*/, this.commitClick()];
4930
4976
  case 2:
4931
4977
  _b.sent();
4932
4978
  return [2 /*return*/, false];
4933
- case 3:
4979
+ case 3: return [2 /*return*/, true];
4980
+ case 4:
4934
4981
  nextSiblingToFocus = event.shiftKey ? event.currentTarget.previousSibling : event.currentTarget.nextSibling;
4935
4982
  event.preventDefault();
4936
4983
  return [4 /*yield*/, this.commitClick()];
4937
- case 4:
4984
+ case 5:
4938
4985
  success = _b.sent();
4939
4986
  if (success) {
4940
4987
  if (nextSiblingToFocus) {
@@ -4946,11 +4993,11 @@
4946
4993
  }
4947
4994
  }
4948
4995
  return [2 /*return*/, false];
4949
- case 5:
4996
+ case 6:
4950
4997
  this.cancelClick();
4951
4998
  event.preventDefault();
4952
4999
  return [2 /*return*/, false];
4953
- case 6: return [2 /*return*/];
5000
+ case 7: return [2 /*return*/];
4954
5001
  }
4955
5002
  });
4956
5003
  });
@@ -4968,6 +5015,9 @@
4968
5015
  };
4969
5016
  BaseInputComponent.prototype._setFocusOnNextPossibleInput = function (element, previous) {
4970
5017
  var elementColl = element.getElementsByTagName('input');
5018
+ if (!elementColl || elementColl.length < 1) {
5019
+ elementColl = element.getElementsByTagName('textarea');
5020
+ }
4971
5021
  if (elementColl && elementColl.length > 0) {
4972
5022
  var inputElement = elementColl[0];
4973
5023
  if (inputElement.disabled || inputElement.readOnly) {
@@ -6729,7 +6779,6 @@
6729
6779
  _this.collection = [];
6730
6780
  _this.customHeight = true;
6731
6781
  _this.selectionSettings = { mode: 'Multiple' };
6732
- _super.prototype._markAsOnPush.call(_this);
6733
6782
  return _this;
6734
6783
  }
6735
6784
  Object.defineProperty(InputListboxComponent.prototype, "singleSelect", {
@@ -6767,7 +6816,7 @@
6767
6816
  InputListboxComponent.decorators = [
6768
6817
  { type: core.Component, args: [{
6769
6818
  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 ",
6819
+ 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
6820
  providers: [{
6772
6821
  provide: COMPONENT_INTERFACE_NAME, useExisting: core.forwardRef(function () { return InputListboxComponent; })
6773
6822
  }, {
@@ -7685,6 +7734,7 @@
7685
7734
  _this.useLeftIcon = false;
7686
7735
  _this.useRightIcon = false;
7687
7736
  _this.noIcon = false;
7737
+ _this.isSmall = false;
7688
7738
  return _this;
7689
7739
  }
7690
7740
  InputSearchComponent.prototype.showClass = function () {
@@ -7714,6 +7764,7 @@
7714
7764
  useLeftIcon: [{ type: core.Input }],
7715
7765
  useRightIcon: [{ type: core.Input }],
7716
7766
  noIcon: [{ type: core.HostBinding, args: ['class.no-icon',] }, { type: core.Input }],
7767
+ isSmall: [{ type: core.HostBinding, args: ['class.is-small',] }, { type: core.Input }],
7717
7768
  showClass: [{ type: core.HostBinding, args: ['class.co-input-search',] }]
7718
7769
  };
7719
7770
  __decorate([
@@ -7765,7 +7816,7 @@
7765
7816
  InputTextareaComponent.decorators = [
7766
7817
  { type: core.Component, args: [{
7767
7818
  selector: "co-input-textarea",
7768
- 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 ",
7819
+ 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 ",
7769
7820
  providers: [{
7770
7821
  provide: COMPONENT_INTERFACE_NAME,
7771
7822
  useExisting: core.forwardRef(function () { return InputTextareaComponent; })
@@ -7801,7 +7852,8 @@
7801
7852
  imports: [
7802
7853
  common.CommonModule,
7803
7854
  forms.FormsModule,
7804
- ValidationErrorModule
7855
+ ValidationErrorModule,
7856
+ CommitButtonsModule
7805
7857
  ],
7806
7858
  declarations: [
7807
7859
  InputTextareaComponent
@@ -11265,6 +11317,7 @@
11265
11317
  exports.TextInputPopupComponent = TextInputPopupComponent;
11266
11318
  exports.TileComponent = TileComponent;
11267
11319
  exports.TileModule = TileModule;
11320
+ exports.showHideDialogAnimation = showHideDialogAnimation;
11268
11321
  exports["ɵa"] = RippleModule;
11269
11322
  exports["ɵb"] = MD_RIPPLE_GLOBAL_OPTIONS;
11270
11323
  exports["ɵba"] = PaginationService;