@colijnit/corecomponents_v12 12.0.19 → 12.0.22

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 (97) hide show
  1. package/bundles/colijnit-corecomponents_v12.umd.js +984 -110
  2. package/bundles/colijnit-corecomponents_v12.umd.js.map +1 -1
  3. package/colijnit-corecomponents_v12.d.ts +9 -7
  4. package/colijnit-corecomponents_v12.metadata.json +1 -1
  5. package/esm2015/colijnit-corecomponents_v12.js +10 -8
  6. package/esm2015/lib/components/base/base-input.component.js +183 -36
  7. package/esm2015/lib/components/button/button.component.js +1 -1
  8. package/esm2015/lib/components/carousel-3d/carousel-3d.component.js +13 -11
  9. package/esm2015/lib/components/co-dialog-wizard/co-dialog-wizard.component.js +51 -0
  10. package/esm2015/lib/components/co-dialog-wizard/co-dialog-wizard.module.js +17 -0
  11. package/esm2015/lib/components/collapsible/collapsible.component.js +10 -2
  12. package/esm2015/lib/components/drop-down-list/drop-down-list.component.js +4 -1
  13. package/esm2015/lib/components/form/form.component.js +23 -18
  14. package/esm2015/lib/components/grid/base/base-grid.component.js +7 -3
  15. package/esm2015/lib/components/grid/base/base-inline-edit-grid.component.js +48 -3
  16. package/esm2015/lib/components/grid/base/base-selection-grid.component.js +12 -2
  17. package/esm2015/lib/components/grid/co-grid.component.js +36 -32
  18. package/esm2015/lib/components/grid/co-grid.module.js +4 -2
  19. package/esm2015/lib/components/grid-toolbar/grid-toolbar.component.js +41 -0
  20. package/esm2015/lib/components/grid-toolbar/grid-toolbar.module.js +23 -0
  21. package/esm2015/lib/components/input-checkbox/input-checkbox.component.js +4 -1
  22. package/esm2015/lib/components/input-checkbox-multi-select/input-checkbox-multi-select.component.js +4 -1
  23. package/esm2015/lib/components/input-combo-box/input-combo-box.component.js +5 -4
  24. package/esm2015/lib/components/input-date-picker/input-date-picker.component.js +4 -1
  25. package/esm2015/lib/components/input-listbox/input-listbox.component.js +4 -1
  26. package/esm2015/lib/components/input-number-picker/input-number-picker.component.js +4 -1
  27. package/esm2015/lib/components/input-radio-button/input-radio-button.component.js +4 -1
  28. package/esm2015/lib/components/input-text/input-text.component.js +18 -4
  29. package/esm2015/lib/components/input-textarea/input-textarea.component.js +11 -8
  30. package/esm2015/lib/components/multi-select-list/multi-select-list.component.js +4 -1
  31. package/esm2015/lib/components/simple-grid/base-simple-grid.component.js +78 -0
  32. package/esm2015/lib/components/simple-grid/simple-grid-cell.component.js +162 -0
  33. package/esm2015/lib/components/simple-grid/simple-grid-column.directive.js +29 -4
  34. package/esm2015/lib/components/simple-grid/simple-grid.component.js +252 -59
  35. package/esm2015/lib/components/simple-grid/simple-grid.module.js +11 -2
  36. package/esm2015/lib/components/validation-error/validation-error.component.js +13 -1
  37. package/esm2015/lib/components/validation-error/validation-error.module.js +4 -2
  38. package/esm2015/public-api.js +5 -1
  39. package/fesm2015/colijnit-corecomponents_v12.js +988 -139
  40. package/fesm2015/colijnit-corecomponents_v12.js.map +1 -1
  41. package/lib/components/base/base-input.component.d.ts +23 -5
  42. package/lib/components/co-dialog/style/_layout.scss +3 -0
  43. package/lib/components/co-dialog-wizard/co-dialog-wizard.component.d.ts +9 -0
  44. package/lib/components/co-dialog-wizard/co-dialog-wizard.module.d.ts +2 -0
  45. package/lib/components/co-dialog-wizard/style/_layout.scss +51 -0
  46. package/lib/components/co-dialog-wizard/style/_material-definition.scss +25 -0
  47. package/lib/components/co-dialog-wizard/style/_theme.scss +16 -0
  48. package/lib/components/co-dialog-wizard/style/material.scss +5 -0
  49. package/lib/components/co-kanban/style/_layout.scss +4 -0
  50. package/lib/components/co-kanban/style/_material-definition.scss +2 -0
  51. package/lib/components/collapsible/style/_layout.scss +1 -1
  52. package/lib/components/collapsible/style/_material-definition.scss +1 -0
  53. package/lib/components/drop-down-list/style/_layout.scss +2 -1
  54. package/lib/components/drop-down-list/style/_material-definition.scss +2 -0
  55. package/lib/components/form/form.component.d.ts +1 -1
  56. package/lib/components/grid/base/base-grid.component.d.ts +3 -0
  57. package/lib/components/grid/base/base-inline-edit-grid.component.d.ts +11 -2
  58. package/lib/components/grid/base/base-selection-grid.component.d.ts +4 -0
  59. package/lib/components/grid-toolbar/grid-toolbar.component.d.ts +13 -0
  60. package/lib/components/grid-toolbar/grid-toolbar.module.d.ts +2 -0
  61. package/lib/components/grid-toolbar/style/_layout.scss +10 -0
  62. package/lib/components/grid-toolbar/style/_material-definition.scss +0 -0
  63. package/lib/components/grid-toolbar/style/_theme.scss +5 -0
  64. package/lib/components/grid-toolbar/style/material.scss +5 -0
  65. package/lib/components/input-checkbox/style/_material-definition.scss +1 -2
  66. package/lib/components/input-checkbox/style/material.scss +2 -0
  67. package/lib/components/input-checkbox-multi-select/style/_layout.scss +5 -1
  68. package/lib/components/input-checkbox-multi-select/style/_material-definition.scss +2 -0
  69. package/lib/components/input-combo-box/input-combo-box.component.d.ts +0 -1
  70. package/lib/components/input-combo-box/style/_layout.scss +4 -2
  71. package/lib/components/input-combo-box/style/_material-definition.scss +2 -0
  72. package/lib/components/input-date-picker/style/_layout.scss +2 -1
  73. package/lib/components/input-date-picker/style/_material-definition.scss +4 -0
  74. package/lib/components/input-listbox/style/_layout.scss +0 -1
  75. package/lib/components/input-listbox/style/_material-definition.scss +2 -2
  76. package/lib/components/input-radio-button/style/_material-definition.scss +1 -1
  77. package/lib/components/input-text/style/_layout.scss +39 -0
  78. package/lib/components/input-text/style/_material-definition.scss +4 -0
  79. package/lib/components/input-text/style/_theme.scss +21 -1
  80. package/lib/components/input-textarea/style/_theme.scss +1 -0
  81. package/lib/components/multi-select-list/style/_layout.scss +2 -1
  82. package/lib/components/multi-select-list/style/_material-definition.scss +2 -0
  83. package/lib/components/multi-select-list/style/_theme.scss +5 -1
  84. package/lib/components/simple-grid/base-simple-grid.component.d.ts +29 -0
  85. package/lib/components/simple-grid/simple-grid-cell.component.d.ts +28 -0
  86. package/lib/components/simple-grid/simple-grid-column.directive.d.ts +9 -0
  87. package/lib/components/simple-grid/simple-grid.component.d.ts +37 -22
  88. package/lib/components/simple-grid/style/_layout.scss +23 -0
  89. package/lib/components/simple-grid/style/_material-definition.scss +13 -4
  90. package/lib/components/simple-grid/style/_theme.scss +17 -0
  91. package/lib/components/simple-grid/style/material.scss +1 -0
  92. package/lib/components/validation-error/style/_layout.scss +10 -2
  93. package/lib/components/validation-error/validation-error.component.d.ts +6 -0
  94. package/lib/style/_input.mixins.scss +4 -3
  95. package/lib/style/_variables.scss +46 -2
  96. package/package.json +1 -1
  97. package/public-api.d.ts +4 -0
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/common/http'), require('@angular/platform-browser'), require('rxjs'), require('rxjs/operators'), require('@syncfusion/ej2-angular-splitbuttons'), require('@angular/animations'), require('@syncfusion/ej2-angular-popups'), require('@syncfusion/ej2-angular-kanban'), require('@syncfusion/ej2-angular-schedule'), require('@syncfusion/ej2-angular-navigations'), require('@syncfusion/ej2-angular-buttons'), require('@angular/forms'), require('@syncfusion/ej2-angular-dropdowns'), require('@syncfusion/ej2-angular-grids'), require('@syncfusion/ej2-base'), require('@syncfusion/ej2-angular-calendars'), require('@syncfusion/ej2-angular-inputs'), require('@syncfusion/ej2-angular-pivotview'), require('@angular/cdk/overlay'), require('@angular/cdk/portal'), require('@syncfusion/ej2-angular-richtexteditor'), require('@angular/cdk/drag-drop'), require('three'), require('three/examples/jsm/renderers/CSS3DRenderer'), require('@tweenjs/tween.js')) :
3
- typeof define === 'function' && define.amd ? define('@colijnit/corecomponents_v12', ['exports', '@angular/core', '@angular/common', '@angular/common/http', '@angular/platform-browser', 'rxjs', 'rxjs/operators', '@syncfusion/ej2-angular-splitbuttons', '@angular/animations', '@syncfusion/ej2-angular-popups', '@syncfusion/ej2-angular-kanban', '@syncfusion/ej2-angular-schedule', '@syncfusion/ej2-angular-navigations', '@syncfusion/ej2-angular-buttons', '@angular/forms', '@syncfusion/ej2-angular-dropdowns', '@syncfusion/ej2-angular-grids', '@syncfusion/ej2-base', '@syncfusion/ej2-angular-calendars', '@syncfusion/ej2-angular-inputs', '@syncfusion/ej2-angular-pivotview', '@angular/cdk/overlay', '@angular/cdk/portal', '@syncfusion/ej2-angular-richtexteditor', '@angular/cdk/drag-drop', 'three', 'three/examples/jsm/renderers/CSS3DRenderer', '@tweenjs/tween.js'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.colijnit = global.colijnit || {}, global.colijnit.corecomponents_v12 = {}), global.ng.core, global.ng.common, global.ng.common.http, global.ng.platformBrowser, global.rxjs, global.rxjs.operators, global.ej2AngularSplitbuttons, global.ng.animations, global.ej2AngularPopups, global.ej2AngularKanban, global.ej2AngularSchedule, global.ej2AngularNavigations, global.ej2AngularButtons, global.ng.forms, global.ej2AngularDropdowns, global.ej2AngularGrids, global.ej2Base, global.ej2AngularCalendars, global.ej2AngularInputs, global.ej2AngularPivotview, global.ng.cdk.overlay, global.ng.cdk.portal, global.ej2AngularRichtexteditor, global.ng.cdk.dragDrop, global.three, global.CSS3DRenderer, global.TWEEN));
5
- })(this, (function (exports, core, common, http, platformBrowser, rxjs, operators, ej2AngularSplitbuttons, animations, ej2AngularPopups, ej2AngularKanban, ej2AngularSchedule, ej2AngularNavigations, ej2AngularButtons, forms, ej2AngularDropdowns, ej2AngularGrids, ej2Base, ej2AngularCalendars, ej2AngularInputs, ej2AngularPivotview, overlay, portal, ej2AngularRichtexteditor, dragDrop, three, CSS3DRenderer, TWEEN) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/common/http'), require('@angular/platform-browser'), require('rxjs'), require('rxjs/operators'), require('@syncfusion/ej2-angular-splitbuttons'), require('@angular/animations'), require('@syncfusion/ej2-angular-popups'), require('@syncfusion/ej2-angular-kanban'), require('@syncfusion/ej2-angular-schedule'), require('@syncfusion/ej2-angular-navigations'), require('@syncfusion/ej2-angular-buttons'), require('@angular/forms'), require('@syncfusion/ej2-angular-dropdowns'), require('@syncfusion/ej2-angular-grids'), require('rxjs/internal/observable/fromEvent'), require('@syncfusion/ej2-base'), require('@syncfusion/ej2-angular-calendars'), require('@syncfusion/ej2-angular-inputs'), require('@syncfusion/ej2-angular-pivotview'), require('@angular/cdk/overlay'), require('@angular/cdk/portal'), require('@syncfusion/ej2-angular-richtexteditor'), require('@angular/cdk/drag-drop'), require('three'), require('three/examples/jsm/renderers/CSS3DRenderer'), require('@tweenjs/tween.js')) :
3
+ typeof define === 'function' && define.amd ? define('@colijnit/corecomponents_v12', ['exports', '@angular/core', '@angular/common', '@angular/common/http', '@angular/platform-browser', 'rxjs', 'rxjs/operators', '@syncfusion/ej2-angular-splitbuttons', '@angular/animations', '@syncfusion/ej2-angular-popups', '@syncfusion/ej2-angular-kanban', '@syncfusion/ej2-angular-schedule', '@syncfusion/ej2-angular-navigations', '@syncfusion/ej2-angular-buttons', '@angular/forms', '@syncfusion/ej2-angular-dropdowns', '@syncfusion/ej2-angular-grids', 'rxjs/internal/observable/fromEvent', '@syncfusion/ej2-base', '@syncfusion/ej2-angular-calendars', '@syncfusion/ej2-angular-inputs', '@syncfusion/ej2-angular-pivotview', '@angular/cdk/overlay', '@angular/cdk/portal', '@syncfusion/ej2-angular-richtexteditor', '@angular/cdk/drag-drop', 'three', 'three/examples/jsm/renderers/CSS3DRenderer', '@tweenjs/tween.js'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.colijnit = global.colijnit || {}, global.colijnit.corecomponents_v12 = {}), global.ng.core, global.ng.common, global.ng.common.http, global.ng.platformBrowser, global.rxjs, global.rxjs.operators, global.ej2AngularSplitbuttons, global.ng.animations, global.ej2AngularPopups, global.ej2AngularKanban, global.ej2AngularSchedule, global.ej2AngularNavigations, global.ej2AngularButtons, global.ng.forms, global.ej2AngularDropdowns, global.ej2AngularGrids, global.rxjs["internal/observable/fromEvent"], global.ej2Base, global.ej2AngularCalendars, global.ej2AngularInputs, global.ej2AngularPivotview, global.ng.cdk.overlay, global.ng.cdk.portal, global.ej2AngularRichtexteditor, global.ng.cdk.dragDrop, global.three, global.CSS3DRenderer, global.TWEEN));
5
+ })(this, (function (exports, core, common, http, platformBrowser, rxjs, operators, ej2AngularSplitbuttons, animations, ej2AngularPopups, ej2AngularKanban, ej2AngularSchedule, ej2AngularNavigations, ej2AngularButtons, forms, ej2AngularDropdowns, ej2AngularGrids, fromEvent, ej2Base, ej2AngularCalendars, ej2AngularInputs, ej2AngularPivotview, overlay, portal, ej2AngularRichtexteditor, dragDrop, three, CSS3DRenderer, TWEEN) { 'use strict';
6
6
 
7
7
  function _interopNamespace(e) {
8
8
  if (e && e.__esModule) return e;
@@ -2677,6 +2677,56 @@
2677
2677
  },] }
2678
2678
  ];
2679
2679
 
2680
+ var CoDialogWizardComponent = /** @class */ (function () {
2681
+ function CoDialogWizardComponent() {
2682
+ this.icons = exports.CoreComponentsIcon;
2683
+ this.showCloseIcon = true;
2684
+ this.animation = true;
2685
+ this.closeClick = new core.EventEmitter();
2686
+ }
2687
+ CoDialogWizardComponent.prototype.showClass = function () {
2688
+ return true;
2689
+ };
2690
+ return CoDialogWizardComponent;
2691
+ }());
2692
+ CoDialogWizardComponent.decorators = [
2693
+ { type: core.Component, args: [{
2694
+ selector: 'co-dialog-wizard',
2695
+ template: "\n <div class=\"co-dialog-wizard-wrapper\" [@showHideDialog]=\"animation\">\n <div class=\"dialog-header\">\n <ng-content select=\"[header]\"></ng-content>\n <div class=\"dialog-close-button\" *ngIf=\"showCloseIcon\" (click)=\"closeClick.emit($event)\">\n <co-icon [icon]=\"icons.Cancel\"></co-icon>\n </div>\n </div>\n\n <hr class=\"co-dialog-wizard-divider\">\n\n <div class=\"dialog-content\">\n <ng-content></ng-content>\n </div>\n </div>\n ",
2696
+ animations: [
2697
+ animations.trigger('showHideDialog', [
2698
+ animations.state('*', animations.style({ opacity: 1 })),
2699
+ animations.state('void', animations.style({ opacity: 0 })),
2700
+ animations.transition('void => *', animations.animate('200ms 200ms')),
2701
+ animations.transition('* => void', animations.animate(200))
2702
+ ])
2703
+ ],
2704
+ encapsulation: core.ViewEncapsulation.None
2705
+ },] }
2706
+ ];
2707
+ CoDialogWizardComponent.propDecorators = {
2708
+ showCloseIcon: [{ type: core.Input }],
2709
+ animation: [{ type: core.Input }],
2710
+ closeClick: [{ type: core.Output }],
2711
+ showClass: [{ type: core.HostBinding, args: ["class.co-dialog-wizard",] }]
2712
+ };
2713
+
2714
+ var CoDialogWizardModule = /** @class */ (function () {
2715
+ function CoDialogWizardModule() {
2716
+ }
2717
+ return CoDialogWizardModule;
2718
+ }());
2719
+ CoDialogWizardModule.decorators = [
2720
+ { type: core.NgModule, args: [{
2721
+ imports: [
2722
+ common.CommonModule,
2723
+ IconModule
2724
+ ],
2725
+ declarations: [CoDialogWizardComponent],
2726
+ exports: [CoDialogWizardComponent]
2727
+ },] }
2728
+ ];
2729
+
2680
2730
  var CoKanbanComponent = /** @class */ (function () {
2681
2731
  function CoKanbanComponent() {
2682
2732
  this.allowDragAndDrop = true;
@@ -2972,7 +3022,14 @@
2972
3022
  CollapsibleComponent.decorators = [
2973
3023
  { type: core.Component, args: [{
2974
3024
  selector: "co-collapsible",
2975
- template: "\n <div class=\"collapsible-header\" [class.end]=\"expandButtonLast\" (click)=\"changeExpanded()\">\n <div class=\"expand-icon-wrapper\" [class.expanded]=\"expanded\" *ngIf=\"!expandButtonLast\">\n <co-icon class=\"expand-icon\" [iconData]=\"iconData\"></co-icon>\n </div>\n <div class=\"collapsible-title\" [textContent]=\"headerTitle\"></div>\n <div class=\"expand-icon-wrapper\" [class.expanded]=\"expanded\" *ngIf=\"expandButtonLast\">\n <co-icon class=\"expand-icon\" [iconData]=\"iconData\"></co-icon>\n </div>\n </div>\n <div class=\"collapsible-content\" *ngIf=\"expanded\">\n <ng-content></ng-content>\n </div>\n ",
3025
+ template: "\n <div class=\"collapsible-header\" [class.end]=\"expandButtonLast\" (click)=\"changeExpanded()\">\n <div class=\"expand-icon-wrapper\" [class.expanded]=\"expanded\" *ngIf=\"!expandButtonLast\">\n <co-icon class=\"expand-icon\" [iconData]=\"iconData\"></co-icon>\n </div>\n <div class=\"collapsible-title\" [textContent]=\"headerTitle\"></div>\n <div class=\"expand-icon-wrapper\" [class.expanded]=\"expanded\" *ngIf=\"expandButtonLast\">\n <co-icon class=\"expand-icon\" [iconData]=\"iconData\"></co-icon>\n </div>\n </div>\n <div class=\"collapsible-content\" *ngIf=\"expanded\" @showHideContent>\n <ng-content></ng-content>\n </div>\n ",
3026
+ animations: [
3027
+ animations.trigger('showHideContent', [
3028
+ animations.state('*', animations.style({ height: '*' })),
3029
+ animations.state('void', animations.style({ height: 0 })),
3030
+ animations.transition('void <=> *', animations.animate(200))
3031
+ ]),
3032
+ ],
2976
3033
  changeDetection: core.ChangeDetectionStrategy.OnPush,
2977
3034
  encapsulation: core.ViewEncapsulation.None
2978
3035
  },] }
@@ -3101,7 +3158,9 @@
3101
3158
  }
3102
3159
 
3103
3160
  var ValidationErrorComponent = /** @class */ (function () {
3104
- function ValidationErrorComponent() {
3161
+ function ValidationErrorComponent(icons) {
3162
+ this.icons = icons;
3163
+ this.Icons = exports.CoreComponentsIcon;
3105
3164
  }
3106
3165
  ValidationErrorComponent.prototype.showClass = function () {
3107
3166
  return true;
@@ -3111,13 +3170,18 @@
3111
3170
  ValidationErrorComponent.decorators = [
3112
3171
  { type: core.Component, args: [{
3113
3172
  selector: "co-validation-error",
3114
- template: "\n <div class=\"validation-error-content\">\n <div class=\"validation-error-message\" [textContent]=\"error\"></div>\n </div>\n ",
3173
+ template: "\n <div class=\"validation-error-content\">\n <co-icon [iconData]=\"icons.getIcon(Icons.InformationRoundOpen)\"></co-icon>\n <div class=\"validation-error-message\" [textContent]=\"error\"></div>\n </div>\n ",
3115
3174
  animations: [],
3116
3175
  encapsulation: core.ViewEncapsulation.None
3117
3176
  },] }
3118
3177
  ];
3178
+ ValidationErrorComponent.ctorParameters = function () { return [
3179
+ { type: IconCacheService }
3180
+ ]; };
3119
3181
  ValidationErrorComponent.propDecorators = {
3120
3182
  error: [{ type: core.Input }],
3183
+ top: [{ type: core.HostBinding, args: ['style.top.px',] }, { type: core.Input }],
3184
+ left: [{ type: core.HostBinding, args: ['style.left.px',] }, { type: core.Input }],
3121
3185
  showClass: [{ type: core.HostBinding, args: ['class.co-validation-error',] }]
3122
3186
  };
3123
3187
 
@@ -3133,10 +3197,13 @@
3133
3197
  this.formUserChangeListener = formUserChangeListener;
3134
3198
  this.ngZoneWrapper = ngZoneWrapper;
3135
3199
  this.elementRef = elementRef;
3200
+ this.showSaveCancel = false;
3136
3201
  this.noValidation = false;
3137
3202
  this.forceRequired = false; // a force outside of [cfgName]'s influence
3138
3203
  // Goal: ability to emulate the red background of input fields (form-submitted invalid state)
3139
3204
  this.redErrorBackground = false;
3205
+ // @Output()
3206
+ // public commit: EventEmitter<any> = new EventEmitter<any>();
3140
3207
  this.nativeBlur = new core.EventEmitter();
3141
3208
  this.blur = new core.EventEmitter();
3142
3209
  // emits when the enter button on keyboard was pressed while this form input had focussed
@@ -3155,12 +3222,21 @@
3155
3222
  this.fullWidth = false;
3156
3223
  this.excludeUserModelChange = false;
3157
3224
  this.noFormGroupControl = false;
3225
+ this.keepFocus = false;
3226
+ this.canSaveOrCancel = false;
3158
3227
  this._markedAsUserTouched = false;
3159
3228
  this._destroyed = false;
3160
3229
  this._hasOnPushCdStrategy = false;
3230
+ this._initialModelSet = false;
3161
3231
  this._forceReadonly = undefined;
3162
3232
  this._validators = [];
3163
3233
  this._asyncValidators = [];
3234
+ // descendents should override this
3235
+ this.commit = function (model) { return __awaiter(_this, void 0, void 0, function () {
3236
+ return __generator(this, function (_a) {
3237
+ return [2 /*return*/, Promise.resolve(true)];
3238
+ });
3239
+ }); };
3164
3240
  BaseInputComponent.BaseFormInputComponentIndex++;
3165
3241
  this.name = BaseInputComponent.BaseFormInputComponentIndex.toString();
3166
3242
  if (this.formUserChangeListener) {
@@ -3186,7 +3262,12 @@
3186
3262
  return this._model;
3187
3263
  },
3188
3264
  set: function (value) {
3265
+ if (!this._initialModelSet) {
3266
+ this._initialModel = this._model;
3267
+ this._initialModelSet = true;
3268
+ }
3189
3269
  this._model = value;
3270
+ this.canSaveOrCancel = this._model !== this._initialModel;
3190
3271
  this._clearErrorComponent();
3191
3272
  },
3192
3273
  enumerable: false,
@@ -3407,6 +3488,30 @@
3407
3488
  enumerable: false,
3408
3489
  configurable: true
3409
3490
  });
3491
+ BaseInputComponent.prototype.onClick = function (event) {
3492
+ if (this.canChange && !this.noClickFocus) {
3493
+ this.requestFocus();
3494
+ if (!this.excludeUserModelChange) {
3495
+ this.markAsUserTouched();
3496
+ }
3497
+ }
3498
+ };
3499
+ BaseInputComponent.prototype.onFocusIn = function () {
3500
+ if (!this.excludeUserModelChange) {
3501
+ this.markAsUserTouched();
3502
+ }
3503
+ };
3504
+ BaseInputComponent.prototype.handleDocumentScroll = function () {
3505
+ this._positionValidationError();
3506
+ };
3507
+ BaseInputComponent.prototype.handleWindowResize = function () {
3508
+ this._positionValidationError();
3509
+ };
3510
+ BaseInputComponent.prototype.handleKeyDown = function (event) {
3511
+ if (this.showSaveCancel && this.canSaveOrCancel) {
3512
+ this._handleKeyDown(event);
3513
+ }
3514
+ };
3410
3515
  Object.defineProperty(BaseInputComponent.prototype, "canChange", {
3411
3516
  get: function () {
3412
3517
  return !this.readonly && !this.disabled;
@@ -3435,27 +3540,15 @@
3435
3540
  enumerable: false,
3436
3541
  configurable: true
3437
3542
  });
3438
- BaseInputComponent.prototype.showValidationError = function (error) {
3439
- if (this.validationErrorContainer) {
3440
- if (this._errorValidationComponent) {
3441
- this._clearErrorComponent();
3442
- }
3443
- var componentFactory = this.componentFactoryResolver.resolveComponentFactory(ValidationErrorComponent);
3444
- this._errorValidationComponent = this.validationErrorContainer.createComponent(componentFactory);
3445
- this._errorValidationComponent.instance.error = error;
3446
- }
3447
- };
3448
3543
  BaseInputComponent.prototype.ngOnInit = function () {
3449
3544
  var _this = this;
3450
3545
  this._modelChangeSub = this.modelChange.subscribe(function (val) {
3451
3546
  _this.model = val;
3452
3547
  });
3453
- // if (this.speechInput) {
3454
- // this._subscribeToSpeechInput();
3455
- // }
3456
3548
  };
3457
3549
  BaseInputComponent.prototype.ngAfterViewInit = function () {
3458
3550
  var _this = this;
3551
+ this._prepareInput();
3459
3552
  this._updateControlValidatorsAndOwnFlags();
3460
3553
  this._addOrRemoveSelfFromForm();
3461
3554
  if (this.formComponent) {
@@ -3469,6 +3562,11 @@
3469
3562
  }
3470
3563
  };
3471
3564
  BaseInputComponent.prototype.ngOnDestroy = function () {
3565
+ var _this = this;
3566
+ if (this.input) {
3567
+ this.input.removeEventListener('blur', function (event) { return _this.doBlur(event); });
3568
+ this.input.removeEventListener('focus', function (event) { return _this.doFocus(event); });
3569
+ }
3472
3570
  this._destroyed = true;
3473
3571
  this._clearErrorComponent();
3474
3572
  // if (this.tooltipManager && this.elementRef) {
@@ -3492,7 +3590,41 @@
3492
3590
  // this._removeSelfFromForm();
3493
3591
  this.elementRef = undefined;
3494
3592
  this.changeDetector = undefined;
3495
- // this.input = undefined;
3593
+ this.input = undefined;
3594
+ };
3595
+ BaseInputComponent.prototype.commitClick = function (event) {
3596
+ return __awaiter(this, void 0, void 0, function () {
3597
+ return __generator(this, function (_a) {
3598
+ switch (_a.label) {
3599
+ case 0:
3600
+ this.keepFocus = true;
3601
+ return [4 /*yield*/, this.commit(this.model)];
3602
+ case 1:
3603
+ _a.sent();
3604
+ this.keepFocus = false;
3605
+ this.doBlur(event);
3606
+ return [2 /*return*/];
3607
+ }
3608
+ });
3609
+ });
3610
+ };
3611
+ BaseInputComponent.prototype.cancelClick = function (event) {
3612
+ this.keepFocus = true;
3613
+ if (this._initialModelSet) {
3614
+ this.model = this._initialModel;
3615
+ }
3616
+ this.keepFocus = false;
3617
+ };
3618
+ BaseInputComponent.prototype.showValidationError = function (error) {
3619
+ if (this.validationErrorContainer) {
3620
+ if (this._errorValidationComponent) {
3621
+ this._clearErrorComponent();
3622
+ }
3623
+ var componentFactory = this.componentFactoryResolver.resolveComponentFactory(ValidationErrorComponent);
3624
+ this._errorValidationComponent = this.validationErrorContainer.createComponent(componentFactory);
3625
+ this._errorValidationComponent.instance.error = error;
3626
+ this._positionValidationError();
3627
+ }
3496
3628
  };
3497
3629
  /**
3498
3630
  * Emits a modelChange event with given value, indicating that the model of this form input
@@ -3509,28 +3641,36 @@
3509
3641
  this.detectChanges();
3510
3642
  }
3511
3643
  };
3512
- BaseInputComponent.prototype.onClick = function (event) {
3513
- if (this.canChange && !this.noClickFocus) {
3514
- this.requestFocus();
3515
- if (!this.excludeUserModelChange) {
3516
- this.markAsUserTouched();
3517
- }
3518
- }
3519
- };
3520
- BaseInputComponent.prototype.onFocusIn = function () {
3521
- if (!this.excludeUserModelChange) {
3522
- this.markAsUserTouched();
3523
- }
3524
- };
3525
3644
  BaseInputComponent.prototype.requestFocus = function () {
3526
3645
  if (this.canChange && this.input) {
3527
3646
  this.input.focus();
3528
3647
  this.focused = true;
3529
3648
  }
3530
3649
  };
3531
- BaseInputComponent.prototype.doBlur = function () {
3532
- this.input.blur();
3533
- this.focused = false;
3650
+ BaseInputComponent.prototype.doFocus = function (event) {
3651
+ if (this.disabled) {
3652
+ return;
3653
+ }
3654
+ this._initialModelSet = false;
3655
+ this.focused = true;
3656
+ this.canSaveOrCancel = false;
3657
+ this.focus.next();
3658
+ };
3659
+ BaseInputComponent.prototype.doBlur = function (event) {
3660
+ var _this = this;
3661
+ setTimeout(function () {
3662
+ if (_this.keepFocus) {
3663
+ if (event) {
3664
+ event.preventDefault;
3665
+ }
3666
+ return false;
3667
+ }
3668
+ _this.focused = false;
3669
+ if (_this.input) {
3670
+ _this.input.blur();
3671
+ }
3672
+ _this.blur.next();
3673
+ }, 200);
3534
3674
  };
3535
3675
  BaseInputComponent.prototype.detectChanges = function () {
3536
3676
  if (!this._destroyed) {
@@ -3583,7 +3723,7 @@
3583
3723
  if (notNill(this.forcedMaxLength) || maxLength === this._maxLength) {
3584
3724
  return;
3585
3725
  }
3586
- if (maxLength > 0) { // not maxLength is 0
3726
+ if (!isNaN(maxLength)) {
3587
3727
  this._maxLength = maxLength;
3588
3728
  this._updateControlValidatorsAndOwnFlags();
3589
3729
  }
@@ -3663,7 +3803,7 @@
3663
3803
  }
3664
3804
  };
3665
3805
  BaseInputComponent.prototype._setNativeMaxLength = function (maxlength) {
3666
- if (this.input) {
3806
+ if (this.input && !isNaN(maxlength)) {
3667
3807
  this.input.maxLength = maxlength;
3668
3808
  }
3669
3809
  };
@@ -3709,6 +3849,102 @@
3709
3849
  this.formComponent.addFormInput(this.myFormInputInstance ? this.myFormInputInstance : this);
3710
3850
  }
3711
3851
  };
3852
+ BaseInputComponent.prototype._prepareInput = function () {
3853
+ var _this = this;
3854
+ if (this.elementRef && this.elementRef.nativeElement) {
3855
+ //try to find input element
3856
+ this.input = this._findInputNode(this.elementRef.nativeElement.children);
3857
+ if (this.input) {
3858
+ this.input.addEventListener('blur', function (event) { return _this.doBlur(event); });
3859
+ this.input.addEventListener('focus', function (event) { return _this.doFocus(event); });
3860
+ }
3861
+ }
3862
+ };
3863
+ BaseInputComponent.prototype._findInputNode = function (nodes) {
3864
+ for (var i = 0; i < nodes.length; i++) {
3865
+ var node = nodes[i];
3866
+ if (node instanceof HTMLInputElement || node instanceof HTMLTextAreaElement) {
3867
+ return node;
3868
+ }
3869
+ else if (node.children.length > 0) {
3870
+ return this._findInputNode(node.children);
3871
+ }
3872
+ }
3873
+ };
3874
+ BaseInputComponent.prototype._positionValidationError = function () {
3875
+ if (this.elementRef && this.elementRef.nativeElement && this._errorValidationComponent) {
3876
+ var clientRect = this.elementRef.nativeElement.getBoundingClientRect();
3877
+ this._errorValidationComponent.instance.top = clientRect.bottom;
3878
+ this._errorValidationComponent.instance.left = clientRect.left;
3879
+ }
3880
+ };
3881
+ BaseInputComponent.prototype._handleKeyDown = function (event) {
3882
+ return __awaiter(this, void 0, void 0, function () {
3883
+ var _a, nextSiblingToFocus;
3884
+ return __generator(this, function (_b) {
3885
+ switch (_b.label) {
3886
+ case 0:
3887
+ _a = event.code;
3888
+ switch (_a) {
3889
+ case 'Enter': return [3 /*break*/, 1];
3890
+ case 'Tab': return [3 /*break*/, 3];
3891
+ case 'Escape': return [3 /*break*/, 5];
3892
+ }
3893
+ return [3 /*break*/, 6];
3894
+ case 1:
3895
+ event.preventDefault();
3896
+ return [4 /*yield*/, this.commitClick()];
3897
+ case 2:
3898
+ _b.sent();
3899
+ return [2 /*return*/, false];
3900
+ case 3:
3901
+ nextSiblingToFocus = event.shiftKey ? event.currentTarget.previousSibling : event.currentTarget.nextSibling;
3902
+ event.preventDefault();
3903
+ return [4 /*yield*/, this.commitClick()];
3904
+ case 4:
3905
+ _b.sent();
3906
+ if (nextSiblingToFocus) {
3907
+ try {
3908
+ this._setFocusOnNextPossibleInput(nextSiblingToFocus, event.shiftKey);
3909
+ }
3910
+ catch (e) {
3911
+ }
3912
+ }
3913
+ return [2 /*return*/, false];
3914
+ case 5:
3915
+ this.cancelClick();
3916
+ event.preventDefault();
3917
+ return [2 /*return*/, false];
3918
+ case 6: return [2 /*return*/];
3919
+ }
3920
+ });
3921
+ });
3922
+ };
3923
+ BaseInputComponent.prototype._createNewFocusEvent = function (element) {
3924
+ var eventType = "onfocusin" in element ? "focusin" : "focus", bubbles = "onfocusin" in element, focusEvent;
3925
+ if ("createEvent" in document) {
3926
+ focusEvent = document.createEvent("Event");
3927
+ focusEvent.initEvent(eventType, bubbles, true);
3928
+ }
3929
+ else if ("Event" in window) {
3930
+ focusEvent = new Event(eventType, { bubbles: bubbles, cancelable: true });
3931
+ }
3932
+ return focusEvent;
3933
+ };
3934
+ BaseInputComponent.prototype._setFocusOnNextPossibleInput = function (element, previous) {
3935
+ var elementColl = element.getElementsByTagName('input');
3936
+ if (elementColl && elementColl.length > 0) {
3937
+ var inputElement = elementColl[0];
3938
+ if (inputElement.disabled || inputElement.readOnly) {
3939
+ this._setFocusOnNextPossibleInput(previous ? element.previousSibling : element.nextSibling, previous);
3940
+ }
3941
+ else {
3942
+ var focusEvent = this._createNewFocusEvent(element);
3943
+ inputElement.focus();
3944
+ inputElement.dispatchEvent(focusEvent);
3945
+ }
3946
+ }
3947
+ };
3712
3948
  return BaseInputComponent;
3713
3949
  }());
3714
3950
  BaseInputComponent.BaseFormInputComponentIndex = 0;
@@ -3726,6 +3962,8 @@
3726
3962
  ]; };
3727
3963
  BaseInputComponent.propDecorators = {
3728
3964
  validationErrorContainer: [{ type: core.ViewChild, args: ["validationError", { read: core.ViewContainerRef },] }],
3965
+ _ngModel: [{ type: core.ViewChild, args: [forms.NgModel, { static: true },] }],
3966
+ showSaveCancel: [{ type: core.Input }],
3729
3967
  model: [{ type: core.Input }],
3730
3968
  label: [{ type: core.Input }],
3731
3969
  noValidation: [{ type: core.Input }],
@@ -3755,7 +3993,6 @@
3755
3993
  modelChange: [{ type: core.Output }],
3756
3994
  userModelChange: [{ type: core.Output }],
3757
3995
  hiddenChange: [{ type: core.Output }],
3758
- _ngModel: [{ type: core.ViewChild, args: [forms.NgModel, { static: true },] }],
3759
3996
  focused: [{ type: core.HostBinding, args: ["class.cc-input-focused",] }],
3760
3997
  formInput: [{ type: core.HostBinding, args: ["class.form-input",] }],
3761
3998
  customWidth: [{ type: core.Input }, { type: core.HostBinding, args: ["class.custom-width",] }],
@@ -3775,7 +4012,10 @@
3775
4012
  valid: [{ type: core.HostBinding, args: ["class.valid",] }],
3776
4013
  validationDisabled: [{ type: core.HostBinding, args: ["class.no-validation",] }],
3777
4014
  onClick: [{ type: core.HostListener, args: ["click", ["$event"],] }],
3778
- onFocusIn: [{ type: core.HostListener, args: ["focusin",] }]
4015
+ onFocusIn: [{ type: core.HostListener, args: ["focusin",] }],
4016
+ handleDocumentScroll: [{ type: core.HostListener, args: ["document:scroll",] }],
4017
+ handleWindowResize: [{ type: core.HostListener, args: ["window:resize",] }],
4018
+ handleKeyDown: [{ type: core.HostListener, args: ["keydown", ["$event"],] }]
3779
4019
  };
3780
4020
  __decorate([
3781
4021
  InputBoolean()
@@ -3930,6 +4170,7 @@
3930
4170
  function FormComponent(_formMaster) {
3931
4171
  this._formMaster = _formMaster;
3932
4172
  this.onChange = new core.EventEmitter();
4173
+ this.showClass = true;
3933
4174
  this.submitted = false;
3934
4175
  // Emits true after every valid submit.
3935
4176
  this.validSubmit = new core.EventEmitter();
@@ -4014,19 +4255,20 @@
4014
4255
  FormComponent.prototype.isValid = function () {
4015
4256
  return this._init && this.formGroup.valid;
4016
4257
  };
4017
- FormComponent.prototype.onEnterKey = function (event) {
4018
- var target = event.target;
4019
- if (['TEXTAREA', 'SELECT'].indexOf(target.tagName) !== -1) {
4020
- return;
4021
- }
4022
- if (target.isContentEditable) {
4023
- return;
4024
- }
4025
- if (target.tagName === 'BUTTON-COLIJN' && target.getAttribute('type') === 'submit') {
4026
- return;
4027
- }
4028
- this.submit();
4029
- };
4258
+ // @HostListener('keyup.enter', ['$event'])
4259
+ // onEnterKey(event: KeyboardEvent): void {
4260
+ // const target: HTMLElement = <HTMLElement>event.target;
4261
+ // if (['TEXTAREA', 'SELECT'].indexOf(target.tagName) !== -1) {
4262
+ // return;
4263
+ // }
4264
+ // if (target.isContentEditable) {
4265
+ // return;
4266
+ // }
4267
+ // if (target.tagName === 'BUTTON-COLIJN' && target.getAttribute('type') === 'submit') {
4268
+ // return;
4269
+ // }
4270
+ // this.submit();
4271
+ // }
4030
4272
  FormComponent.prototype.reset = function () {
4031
4273
  this.submitted = false;
4032
4274
  this.formGroup.markAsUntouched();
@@ -4082,7 +4324,8 @@
4082
4324
  FormComponent.decorators = [
4083
4325
  { type: core.Component, args: [{
4084
4326
  selector: "co-form",
4085
- template: "<ng-content></ng-content>"
4327
+ template: "\n <ng-content></ng-content>\n ",
4328
+ encapsulation: core.ViewEncapsulation.None
4086
4329
  },] }
4087
4330
  ];
4088
4331
  FormComponent.ctorParameters = function () { return [
@@ -4092,13 +4335,13 @@
4092
4335
  readonly: [{ type: core.Input }],
4093
4336
  keepInView: [{ type: core.Input }],
4094
4337
  onChange: [{ type: core.Output }],
4338
+ showClass: [{ type: core.HostBinding, args: ["class.co-form",] }],
4095
4339
  submitted: [{ type: core.HostBinding, args: ["class.submitted",] }],
4096
4340
  validSubmit: [{ type: core.Output }],
4097
4341
  anySubmit: [{ type: core.Output }],
4098
4342
  validityChange: [{ type: core.Output }],
4099
4343
  readonlyChange: [{ type: core.Output }],
4100
- invalidSubmit: [{ type: core.Output }],
4101
- onEnterKey: [{ type: core.HostListener, args: ['keyup.enter', ['$event'],] }]
4344
+ invalidSubmit: [{ type: core.Output }]
4102
4345
  };
4103
4346
 
4104
4347
  var DropDownListComponent = /** @class */ (function (_super) {
@@ -4138,6 +4381,9 @@
4138
4381
  {
4139
4382
  provide: COMPONENT_INTERFACE_NAME,
4140
4383
  useExisting: core.forwardRef(function () { return DropDownListComponent; })
4384
+ }, {
4385
+ provide: BaseInputComponent,
4386
+ useExisting: DropDownListComponent
4141
4387
  }
4142
4388
  ],
4143
4389
  encapsulation: core.ViewEncapsulation.None
@@ -4212,7 +4458,8 @@
4212
4458
  })(GridLines || (GridLines = {}));
4213
4459
 
4214
4460
  var BaseGridComponent = /** @class */ (function () {
4215
- function BaseGridComponent() {
4461
+ function BaseGridComponent(element) {
4462
+ this.element = element;
4216
4463
  this.gridLines = GridLines.None;
4217
4464
  this.contextMenuItems = [];
4218
4465
  this.sortingEnabled = false;
@@ -4249,6 +4496,9 @@
4249
4496
  BaseGridComponent.decorators = [
4250
4497
  { type: core.Directive }
4251
4498
  ];
4499
+ BaseGridComponent.ctorParameters = function () { return [
4500
+ { type: core.ElementRef }
4501
+ ]; };
4252
4502
  BaseGridComponent.propDecorators = {
4253
4503
  grid: [{ type: core.ViewChild, args: ['grid', { static: false },] }],
4254
4504
  data: [{ type: core.Input }],
@@ -4387,6 +4637,10 @@
4387
4637
  function BaseInlineEditGridComponent() {
4388
4638
  var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
4389
4639
  _this.rowSaved = new core.EventEmitter();
4640
+ _this.beforeRowDelete = new core.EventEmitter(false);
4641
+ _this.rowDeleted = new core.EventEmitter();
4642
+ _this.actionBeginObservable$ = new rxjs.Observable();
4643
+ _this.actionBeginObservableSub = new rxjs.Subscription();
4390
4644
  return _this;
4391
4645
  }
4392
4646
  Object.defineProperty(BaseInlineEditGridComponent.prototype, "inlineEdit", {
@@ -4406,13 +4660,61 @@
4406
4660
  enumerable: false,
4407
4661
  configurable: true
4408
4662
  });
4663
+ BaseInlineEditGridComponent.prototype.ngAfterViewInit = function () {
4664
+ var _this = this;
4665
+ if (this.grid) {
4666
+ this.actionBeginObservable$ = fromEvent.fromEvent(this.grid, 'actionBegin');
4667
+ this.actionBeginObservableSub = this.actionBeginObservable$.subscribe(function (action) {
4668
+ _this.handleActionBegin(action);
4669
+ });
4670
+ }
4671
+ };
4672
+ BaseInlineEditGridComponent.prototype.ngOnDestroy = function () {
4673
+ this.actionBeginObservableSub.unsubscribe();
4674
+ };
4675
+ BaseInlineEditGridComponent.prototype.handleActionBegin = function (action) {
4676
+ return __awaiter(this, void 0, void 0, function () {
4677
+ return __generator(this, function (_a) {
4678
+ switch (_a.label) {
4679
+ case 0:
4680
+ if (!action) return [3 /*break*/, 3];
4681
+ if (!(action.requestType === "delete")) return [3 /*break*/, 2];
4682
+ return [4 /*yield*/, this.waitForBeforeDelete(action)];
4683
+ case 1:
4684
+ _a.sent();
4685
+ _a.label = 2;
4686
+ case 2:
4687
+ if (action.requestType === "save") {
4688
+ this.rowSaved.next(action.data);
4689
+ }
4690
+ _a.label = 3;
4691
+ case 3: return [2 /*return*/];
4692
+ }
4693
+ });
4694
+ });
4695
+ };
4409
4696
  BaseInlineEditGridComponent.prototype.handleActionComplete = function (action) {
4410
4697
  if (action) {
4698
+ if (action.requestType === "delete") {
4699
+ this.rowDeleted.next(action.data);
4700
+ }
4411
4701
  if (action.requestType === "save") {
4412
4702
  this.rowSaved.next(action.data);
4413
4703
  }
4414
4704
  }
4415
4705
  };
4706
+ BaseInlineEditGridComponent.prototype.waitForBeforeDelete = function (action) {
4707
+ var _this = this;
4708
+ // @ts-ignore
4709
+ var beforeRowDelete$ = fromEvent.fromEvent(this.element, 'beforeRowDelete');
4710
+ return new Promise(function (resolve) {
4711
+ beforeRowDelete$.subscribe(function (result) {
4712
+ action = result;
4713
+ return resolve(action);
4714
+ }).unsubscribe();
4715
+ _this.beforeRowDelete.next(action);
4716
+ });
4717
+ };
4416
4718
  return BaseInlineEditGridComponent;
4417
4719
  }(BaseToolbarGridComponent));
4418
4720
  BaseInlineEditGridComponent.decorators = [
@@ -4420,7 +4722,9 @@
4420
4722
  ];
4421
4723
  BaseInlineEditGridComponent.propDecorators = {
4422
4724
  inlineEdit: [{ type: core.Input }],
4423
- rowSaved: [{ type: core.Output }]
4725
+ rowSaved: [{ type: core.Output }],
4726
+ beforeRowDelete: [{ type: core.Output }],
4727
+ rowDeleted: [{ type: core.Output }]
4424
4728
  };
4425
4729
  __decorate([
4426
4730
  InputBoolean()
@@ -4438,6 +4742,8 @@
4438
4742
  _this.contextMenuItemClick = new core.EventEmitter();
4439
4743
  _this.rowDragStartEvent = new core.EventEmitter();
4440
4744
  _this.rowDropEvent = new core.EventEmitter();
4745
+ _this.beforeRowsDelete = new core.EventEmitter();
4746
+ _this.rowsDeleted = new core.EventEmitter();
4441
4747
  _this.selectionOptions = { type: "Single" };
4442
4748
  return _this;
4443
4749
  }
@@ -4489,6 +4795,12 @@
4489
4795
  BaseSelectionGridComponent.prototype.rowDropClick = function (args) {
4490
4796
  this.rowDropEvent.next(args);
4491
4797
  };
4798
+ BaseSelectionGridComponent.prototype.handleBeforeBatchDelete = function (args) {
4799
+ this.beforeRowsDelete.next(args);
4800
+ };
4801
+ BaseSelectionGridComponent.prototype.handleBatchDelete = function (rows) {
4802
+ this.rowsDeleted.next(rows);
4803
+ };
4492
4804
  return BaseSelectionGridComponent;
4493
4805
  }(BaseInlineEditGridComponent));
4494
4806
  BaseSelectionGridComponent.decorators = [
@@ -4503,7 +4815,9 @@
4503
4815
  detailColumnClick: [{ type: core.Output }],
4504
4816
  contextMenuItemClick: [{ type: core.Output }],
4505
4817
  rowDragStartEvent: [{ type: core.Output }],
4506
- rowDropEvent: [{ type: core.Output }]
4818
+ rowDropEvent: [{ type: core.Output }],
4819
+ beforeRowsDelete: [{ type: core.Output }],
4820
+ rowsDeleted: [{ type: core.Output }]
4507
4821
  };
4508
4822
  __decorate([
4509
4823
  InputBoolean()
@@ -4528,7 +4842,7 @@
4528
4842
  CoGridComponent.decorators = [
4529
4843
  { type: core.Component, args: [{
4530
4844
  selector: 'co-grid',
4531
- template: "\n <ejs-grid #grid id=\"grid\"\n [dataSource]=\"data\"\n [columns]=\"columns\"\n [contextMenuItems]=\"contextMenuItems\"\n [pageSettings]=\"pageSettings\"\n [toolbar]=\"toolbarOptions\"\n [gridLines]=\"gridLines\"\n [frozenColumns]=\"frozenColumns\"\n [frozenRows]=\"frozenRows\"\n [selectionSettings]=\"selectionOptions\"\n [editSettings]=\"editSettings\"\n [allowPaging]=\"pagingEnabled\"\n [allowSorting]=\"sortingEnabled\"\n [allowFiltering]=\"filteringEnabled\"\n [allowGrouping]=\"groupingEnabled\"\n [allowReordering]=\"reorderingEnabled\"\n [allowResizing]=\"resizingEnabled\"\n [allowRowDragAndDrop]=\"rowDragAndDropEnabled\"\n [showColumnMenu]=\"showColumnMenu\"\n [showColumnChooser]=\"showColumnChooser\"\n [allowExcelExport]=\"exportExcelEnabled\"\n [allowPdfExport]=\"exportPdfEnabled\"\n (toolbarClick)=\"toolbarClick($event)\"\n (rowSelected)=\"handleRowSelected($event)\"\n (recordDoubleClick)=\"handleDoubleClick($event)\"\n (recordClick)=\"handleRecordClick($event)\"\n (actionComplete)=\"handleActionComplete($event)\"\n (contextMenuClick)=\"contextMenuClick($event)\"\n (rowDragStart)=\"rowDragStartClick($event)\"\n (rowDrop)=\"rowDropClick($event)\">\n </ejs-grid>\n ",
4845
+ template: "\n <co-grid-toolbar></co-grid-toolbar>\n <ejs-grid #grid id=\"grid\"\n [dataSource]=\"data\"\n [columns]=\"columns\"\n [contextMenuItems]=\"contextMenuItems\"\n [pageSettings]=\"pageSettings\"\n [toolbar]=\"toolbarOptions\"\n [gridLines]=\"gridLines\"\n [frozenColumns]=\"frozenColumns\"\n [frozenRows]=\"frozenRows\"\n [selectionSettings]=\"selectionOptions\"\n [editSettings]=\"editSettings\"\n [allowPaging]=\"pagingEnabled\"\n [allowSorting]=\"sortingEnabled\"\n [allowFiltering]=\"filteringEnabled\"\n [allowGrouping]=\"groupingEnabled\"\n [allowReordering]=\"reorderingEnabled\"\n [allowResizing]=\"resizingEnabled\"\n [allowRowDragAndDrop]=\"rowDragAndDropEnabled\"\n [showColumnMenu]=\"showColumnMenu\"\n [showColumnChooser]=\"showColumnChooser\"\n [allowExcelExport]=\"exportExcelEnabled\"\n [allowPdfExport]=\"exportPdfEnabled\"\n (toolbarClick)=\"toolbarClick($event)\"\n (rowSelected)=\"handleRowSelected($event)\"\n (recordDoubleClick)=\"handleDoubleClick($event)\"\n (recordClick)=\"handleRecordClick($event)\"\n (actionComplete)=\"handleActionComplete($event)\"\n (contextMenuClick)=\"contextMenuClick($event)\"\n (rowDragStart)=\"rowDragStartClick($event)\"\n (rowDrop)=\"rowDropClick($event)\"\n (beforeBatchDelete)=\"handleBeforeBatchDelete($event)\"\n (batchDelete)=\"handleBatchDelete($event)\"\n >\n </ejs-grid>\n ",
4532
4846
  providers: [
4533
4847
  ej2AngularGrids.RowDDService
4534
4848
  ],
@@ -4539,6 +4853,59 @@
4539
4853
  showClass: [{ type: core.HostBinding, args: ['class.co-grid',] }]
4540
4854
  };
4541
4855
 
4856
+ var GridToolbarComponent = /** @class */ (function () {
4857
+ function GridToolbarComponent(iconsService) {
4858
+ this.iconsService = iconsService;
4859
+ this.icons = exports.CoreComponentsIcon;
4860
+ this.editClick = new core.EventEmitter();
4861
+ this.cancelClick = new core.EventEmitter();
4862
+ this.saveClick = new core.EventEmitter();
4863
+ this.addClick = new core.EventEmitter();
4864
+ }
4865
+ GridToolbarComponent.prototype.showClass = function () {
4866
+ return true;
4867
+ };
4868
+ return GridToolbarComponent;
4869
+ }());
4870
+ GridToolbarComponent.decorators = [
4871
+ { type: core.Component, args: [{
4872
+ selector: "co-grid-toolbar",
4873
+ template: "\n <div class=\"grid-toolbar-wrapper\">\n <co-button [iconData]=\"iconsService.getIcon(icons.AddToCartDrop)\" [label]=\"'edit'\" (click)=\"editClick.emit($event)\"></co-button>\n <co-button [iconData]=\"iconsService.getIcon(icons.AddToCartDrop)\" [label]=\"'cancel'\" (click)=\"cancelClick.emit()\"></co-button>\n <co-button [iconData]=\"iconsService.getIcon(icons.AddToCartDrop)\" [label]=\"'save'\" (click)=\"saveClick.emit()\"></co-button>\n <co-button [iconData]=\"iconsService.getIcon(icons.AddToCartDrop)\" [label]=\"'add'\" (click)=\"addClick.emit()\"></co-button>\n </div>\n ",
4874
+ encapsulation: core.ViewEncapsulation.None
4875
+ },] }
4876
+ ];
4877
+ GridToolbarComponent.ctorParameters = function () { return [
4878
+ { type: IconCacheService }
4879
+ ]; };
4880
+ GridToolbarComponent.propDecorators = {
4881
+ editClick: [{ type: core.Output }],
4882
+ cancelClick: [{ type: core.Output }],
4883
+ saveClick: [{ type: core.Output }],
4884
+ addClick: [{ type: core.Output }],
4885
+ showClass: [{ type: core.HostBinding, args: ["class.co-grid-toolbar",] }]
4886
+ };
4887
+
4888
+ ej2Base.enableRipple(true);
4889
+ var GridToolbarModule = /** @class */ (function () {
4890
+ function GridToolbarModule() {
4891
+ }
4892
+ return GridToolbarModule;
4893
+ }());
4894
+ GridToolbarModule.decorators = [
4895
+ { type: core.NgModule, args: [{
4896
+ imports: [
4897
+ IconModule,
4898
+ ButtonModule
4899
+ ],
4900
+ declarations: [
4901
+ GridToolbarComponent
4902
+ ],
4903
+ exports: [
4904
+ GridToolbarComponent
4905
+ ]
4906
+ },] }
4907
+ ];
4908
+
4542
4909
  var CoGridModule = /** @class */ (function () {
4543
4910
  function CoGridModule() {
4544
4911
  }
@@ -4549,7 +4916,8 @@
4549
4916
  imports: [
4550
4917
  common.CommonModule,
4551
4918
  forms.FormsModule,
4552
- ej2AngularGrids.GridModule
4919
+ ej2AngularGrids.GridModule,
4920
+ GridToolbarModule
4553
4921
  ],
4554
4922
  declarations: [CoGridComponent],
4555
4923
  exports: [CoGridComponent],
@@ -4607,6 +4975,9 @@
4607
4975
  providers: [{
4608
4976
  provide: COMPONENT_INTERFACE_NAME,
4609
4977
  useExisting: core.forwardRef(function () { return InputCheckboxComponent; })
4978
+ }, {
4979
+ provide: BaseInputComponent,
4980
+ useExisting: InputCheckboxComponent
4610
4981
  }],
4611
4982
  changeDetection: core.ChangeDetectionStrategy.OnPush,
4612
4983
  encapsulation: core.ViewEncapsulation.None
@@ -4708,6 +5079,9 @@
4708
5079
  providers: [{
4709
5080
  provide: COMPONENT_INTERFACE_NAME,
4710
5081
  useExisting: core.forwardRef(function () { return InputCheckboxMultiSelectComponent; })
5082
+ }, {
5083
+ provide: BaseInputComponent,
5084
+ useExisting: InputCheckboxMultiSelectComponent
4711
5085
  }],
4712
5086
  changeDetection: core.ChangeDetectionStrategy.OnPush,
4713
5087
  encapsulation: core.ViewEncapsulation.None
@@ -4761,7 +5135,6 @@
4761
5135
  _this.ngZoneWrapper = ngZoneWrapper;
4762
5136
  _this.elementRef = elementRef;
4763
5137
  _this.shopPopup = true;
4764
- _this.customHeight = true;
4765
5138
  _super.prototype._markAsOnPush.call(_this);
4766
5139
  return _this;
4767
5140
  }
@@ -4782,6 +5155,9 @@
4782
5155
  providers: [{
4783
5156
  provide: COMPONENT_INTERFACE_NAME,
4784
5157
  useExisting: core.forwardRef(function () { return InputComboBoxComponent; })
5158
+ }, {
5159
+ provide: BaseInputComponent,
5160
+ useExisting: InputComboBoxComponent
4785
5161
  }],
4786
5162
  encapsulation: core.ViewEncapsulation.None
4787
5163
  },] }
@@ -4801,8 +5177,7 @@
4801
5177
  selected: [{ type: core.Input }],
4802
5178
  placeholder: [{ type: core.Input }],
4803
5179
  shopPopup: [{ type: core.Input }],
4804
- showClass: [{ type: core.HostBinding, args: ["class.co-input-combo-box",] }],
4805
- customHeight: [{ type: core.HostBinding, args: ["class.custom-height",] }]
5180
+ showClass: [{ type: core.HostBinding, args: ["class.co-input-combo-box",] }]
4806
5181
  };
4807
5182
 
4808
5183
  var InputComboBoxModule = /** @class */ (function () {
@@ -4884,6 +5259,9 @@
4884
5259
  template: "\n <ejs-datepicker #ejsDatePicker\n floatLabelType=\"Auto\"\n [format]=\"dateFormat\"\n [placeholder]=\"placeholder\"\n [ngModel]=\"model\"\n (ngModelChange)=\"modelChange.emit($event)\"\n ></ejs-datepicker>\n <div class=\"required-indicator\"></div>\n <ng-template #validationError></ng-template>\n ",
4885
5260
  providers: [{
4886
5261
  provide: COMPONENT_INTERFACE_NAME, useExisting: core.forwardRef(function () { return InputDatePickerComponent; })
5262
+ }, {
5263
+ provide: BaseInputComponent,
5264
+ useExisting: InputDatePickerComponent
4887
5265
  }],
4888
5266
  encapsulation: core.ViewEncapsulation.None
4889
5267
  },] }
@@ -5287,11 +5665,21 @@
5287
5665
  InputTextComponent.decorators = [
5288
5666
  { type: core.Component, args: [{
5289
5667
  selector: "co-input-text",
5290
- template: "\n <label [textContent]=\"placeholder\"></label>\n <input [type]=\"type\"\n [ngModel]=\"model\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n (ngModelChange)=\"modelChange.emit($event)\"\n (focus)=\"focused = true\"\n (blur)=\"focused = false\"\n >\n <div class=\"required-indicator\"></div>\n <ng-template #validationError></ng-template>\n ",
5668
+ template: "\n <label [textContent]=\"placeholder\"></label>\n <input #input\n [type]=\"type\"\n [ngModel]=\"model\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n (ngModelChange)=\"modelChange.emit($event)\"\n >\n <div *ngIf=\"showSaveCancel && focused && canSaveOrCancel\" class=\"input-save-cancel-button-wrapper\" @showHideSaveCancel>\n <div class=\"input-save-cancel-button save\" (click)=\"commitClick($event)\"></div>\n <div class=\"input-save-cancel-button cancel\" (click)=\"cancelClick($event)\"></div>\n </div>\n <div class=\"required-indicator\"></div>\n <ng-template #validationError></ng-template>\n ",
5291
5669
  providers: [{
5292
5670
  provide: COMPONENT_INTERFACE_NAME,
5293
5671
  useExisting: core.forwardRef(function () { return InputTextComponent; })
5672
+ }, {
5673
+ provide: BaseInputComponent,
5674
+ useExisting: InputTextComponent
5294
5675
  }],
5676
+ animations: [
5677
+ animations.trigger('showHideSaveCancel', [
5678
+ animations.state('*', animations.style({ transform: 'scaleY(1)', opacity: 1 })),
5679
+ animations.state('void', animations.style({ transform: 'scaleY(0)', opacity: 0 })),
5680
+ animations.transition('void <=> *', animations.animate(200))
5681
+ ]),
5682
+ ],
5295
5683
  encapsulation: core.ViewEncapsulation.None
5296
5684
  },] }
5297
5685
  ];
@@ -5575,6 +5963,9 @@
5575
5963
  template: "\n <div class=\"button-wrapper\">\n <co-button *ngIf=\"showButtons\" class=\"minus-operator circle\" [class.select]=\"minSelected\"\n [disabled]=\"readonly\"\n [iconData]=\"iconCacheService.getIcon(minusIcon)\"\n (mousedown)=\"onMinusMouseDown($event)\"\n (mouseup)=\"stopAutoCounting()\" (mouseleave)=\"stopAutoCounting()\"></co-button>\n </div>\n <input type=\"text\"\n [ngModel]=\"numberLogic.valueAsSting\"\n [readonly]=\"readonly\"\n [disabled]=\"disabled\"\n [required]=\"required\"\n (keydown)=\"handleKeyDown($event)\"/>\n <div class=\"button-wrapper\">\n <co-button *ngIf=\"showButtons\" class=\"plus-operator circle\" [class.select]=\"plusSelected\"\n [disabled]=\"readonly\"\n [iconData]=\"iconCacheService.getIcon(plusIcon)\"\n (mousedown)=\"onPlusMouseDown($event)\"\n (mouseup)=\"stopAutoCounting()\" (mouseleave)=\"stopAutoCounting()\"></co-button>\n </div>\n ",
5576
5964
  providers: [{
5577
5965
  provide: COMPONENT_INTERFACE_NAME, useExisting: core.forwardRef(function () { return InputNumberPickerComponent; })
5966
+ }, {
5967
+ provide: BaseInputComponent,
5968
+ useExisting: InputNumberPickerComponent
5578
5969
  }],
5579
5970
  changeDetection: core.ChangeDetectionStrategy.OnPush,
5580
5971
  encapsulation: core.ViewEncapsulation.None
@@ -5617,7 +6008,8 @@
5617
6008
  ValidationErrorModule.decorators = [
5618
6009
  { type: core.NgModule, args: [{
5619
6010
  imports: [
5620
- common.CommonModule
6011
+ common.CommonModule,
6012
+ IconModule
5621
6013
  ],
5622
6014
  declarations: [
5623
6015
  ValidationErrorComponent
@@ -5700,6 +6092,9 @@
5700
6092
  template: "\n <ejs-radiobutton\n [label]=\"label\"\n [name]=\"name\"\n [value]=\"value\"\n [checked]=\"checked\"\n (change)=\"handleModelChange($event)\"\n ></ejs-radiobutton>\n ",
5701
6093
  providers: [{
5702
6094
  provide: COMPONENT_INTERFACE_NAME, useExisting: core.forwardRef(function () { return InputRadioButtonComponent; })
6095
+ }, {
6096
+ provide: BaseInputComponent,
6097
+ useExisting: InputRadioButtonComponent
5703
6098
  }],
5704
6099
  changeDetection: core.ChangeDetectionStrategy.OnPush,
5705
6100
  encapsulation: core.ViewEncapsulation.None
@@ -5764,10 +6159,13 @@
5764
6159
  InputTextareaComponent.decorators = [
5765
6160
  { type: core.Component, args: [{
5766
6161
  selector: "co-input-textarea",
5767
- template: "\n <label [textContent]=\"placeholder\"></label>\n <textarea type=\"textarea\"\n [ngModel]=\"model\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n (ngModelChange)=\"modelChange.emit($event)\"\n (focus)=\"focused = true\"\n (blur)=\"focused = false\"\n ></textarea>\n <div class=\"required-indicator\"></div>\n <ng-template #validationError></ng-template>\n ",
6162
+ 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 ",
5768
6163
  providers: [{
5769
6164
  provide: COMPONENT_INTERFACE_NAME,
5770
6165
  useExisting: core.forwardRef(function () { return InputTextareaComponent; })
6166
+ }, {
6167
+ provide: BaseInputComponent,
6168
+ useExisting: InputTextareaComponent
5771
6169
  }],
5772
6170
  encapsulation: core.ViewEncapsulation.None
5773
6171
  },] }
@@ -5859,6 +6257,9 @@
5859
6257
  {
5860
6258
  provide: COMPONENT_INTERFACE_NAME,
5861
6259
  useExisting: core.forwardRef(function () { return MultiSelectListComponent; })
6260
+ }, {
6261
+ provide: BaseInputComponent,
6262
+ useExisting: MultiSelectListComponent
5862
6263
  }
5863
6264
  ],
5864
6265
  encapsulation: core.ViewEncapsulation.None
@@ -7443,6 +7844,9 @@
7443
7844
  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 ",
7444
7845
  providers: [{
7445
7846
  provide: COMPONENT_INTERFACE_NAME, useExisting: core.forwardRef(function () { return InputListboxComponent; })
7847
+ }, {
7848
+ provide: BaseInputComponent,
7849
+ useExisting: InputListboxComponent
7446
7850
  }],
7447
7851
  encapsulation: core.ViewEncapsulation.None
7448
7852
  },] }
@@ -7498,6 +7902,8 @@
7498
7902
  var SimpleGridColumnDirective = /** @class */ (function () {
7499
7903
  function SimpleGridColumnDirective() {
7500
7904
  this.resizable = true;
7905
+ this.required = false;
7906
+ this.readonly = false;
7501
7907
  }
7502
7908
  Object.defineProperty(SimpleGridColumnDirective.prototype, "template", {
7503
7909
  get: function () {
@@ -7511,6 +7917,28 @@
7511
7917
  enumerable: false,
7512
7918
  configurable: true
7513
7919
  });
7920
+ Object.defineProperty(SimpleGridColumnDirective.prototype, "editTemplate", {
7921
+ get: function () {
7922
+ return this._editTemplate;
7923
+ },
7924
+ set: function (template) {
7925
+ if (template) {
7926
+ this._editTemplate = template;
7927
+ }
7928
+ },
7929
+ enumerable: false,
7930
+ configurable: true
7931
+ });
7932
+ SimpleGridColumnDirective.prototype.getFieldValue = function (value) {
7933
+ var _this = this;
7934
+ if (this.collection && this.displayField) {
7935
+ var result = this.collection.find(function (c) { return c[_this.codeField] === value; });
7936
+ if (result) {
7937
+ return result[this.displayField];
7938
+ }
7939
+ }
7940
+ return value;
7941
+ };
7514
7942
  return SimpleGridColumnDirective;
7515
7943
  }());
7516
7944
  SimpleGridColumnDirective._MinManualResizeWidthPx = 50;
@@ -7520,39 +7948,46 @@
7520
7948
  },] }
7521
7949
  ];
7522
7950
  SimpleGridColumnDirective.propDecorators = {
7523
- template: [{ type: core.ContentChild, args: [core.TemplateRef,] }],
7951
+ template: [{ type: core.ContentChild, args: ['template',] }],
7952
+ editTemplate: [{ type: core.ContentChild, args: ['editTemplate',] }],
7524
7953
  headerText: [{ type: core.Input }],
7525
7954
  field: [{ type: core.Input }],
7955
+ codeField: [{ type: core.Input }],
7956
+ displayField: [{ type: core.Input }],
7526
7957
  textAlign: [{ type: core.Input }],
7527
7958
  format: [{ type: core.Input }],
7528
7959
  resizable: [{ type: core.Input }],
7529
- width: [{ type: core.Input }]
7960
+ required: [{ type: core.Input }],
7961
+ width: [{ type: core.Input }],
7962
+ readonly: [{ type: core.Input }],
7963
+ collection: [{ type: core.Input }]
7530
7964
  };
7531
7965
 
7532
- var SimpleGridComponent = /** @class */ (function () {
7533
- function SimpleGridComponent() {
7534
- this.defaultTextAlign = exports.ColumnAlign.Left;
7966
+ var BaseSimpleGridComponent = /** @class */ (function () {
7967
+ function BaseSimpleGridComponent() {
7535
7968
  this.data = [];
7536
7969
  this.dragDropEnabled = false;
7970
+ this.inlineEdit = false;
7971
+ this.showToolbar = false;
7537
7972
  /**
7538
7973
  * Should component emit drag and drop actions instead of handle
7539
7974
  * (update collection) by itself
7540
7975
  */
7541
7976
  this.emitDragDrop = false;
7542
7977
  this.onDrop = new core.EventEmitter();
7978
+ this.selectRow = new core.EventEmitter();
7979
+ this.dblClickRow = new core.EventEmitter();
7980
+ this.saveRow = new core.EventEmitter();
7543
7981
  this.columns = [];
7544
7982
  }
7545
- Object.defineProperty(SimpleGridComponent.prototype, "content", {
7983
+ Object.defineProperty(BaseSimpleGridComponent.prototype, "content", {
7546
7984
  set: function (columnComponents) {
7547
7985
  this.columns = columnComponents.toArray();
7548
7986
  },
7549
7987
  enumerable: false,
7550
7988
  configurable: true
7551
7989
  });
7552
- SimpleGridComponent.prototype.showClass = function () {
7553
- return true;
7554
- };
7555
- SimpleGridComponent.prototype.handleMouseMove = function (event) {
7990
+ BaseSimpleGridComponent.prototype.handleMouseMove = function (event) {
7556
7991
  if (event.buttons === 1 && this._columnForResize) {
7557
7992
  if (!this._columnForResize.width) {
7558
7993
  var rect = event.target.parentElement.getBoundingClientRect();
@@ -7561,16 +7996,16 @@
7561
7996
  this._columnForResize.width += event.movementX;
7562
7997
  }
7563
7998
  };
7564
- SimpleGridComponent.prototype.handleMouseUp = function (event) {
7999
+ BaseSimpleGridComponent.prototype.handleMouseUp = function (event) {
7565
8000
  this._columnForResize = undefined;
7566
8001
  };
7567
- SimpleGridComponent.prototype.handleSizerMouseDown = function (event, column) {
8002
+ BaseSimpleGridComponent.prototype.handleSizerMouseDown = function (event, column) {
7568
8003
  this._columnForResize = column;
7569
8004
  };
7570
- SimpleGridComponent.prototype.handleCanDragDrop = function (drag, drop) {
8005
+ BaseSimpleGridComponent.prototype.handleCanDragDrop = function (drag, drop) {
7571
8006
  return true;
7572
8007
  };
7573
- SimpleGridComponent.prototype.handleDrop = function (event) {
8008
+ BaseSimpleGridComponent.prototype.handleDrop = function (event) {
7574
8009
  try {
7575
8010
  var from = event.previousIndex;
7576
8011
  var to = event.currentIndex;
@@ -7588,27 +8023,452 @@
7588
8023
  console.error(e);
7589
8024
  }
7590
8025
  };
7591
- return SimpleGridComponent;
8026
+ return BaseSimpleGridComponent;
7592
8027
  }());
7593
- SimpleGridComponent.decorators = [
7594
- { type: core.Component, args: [{
7595
- selector: "co-simple-grid",
7596
- template: "\n <div class=\"simple-grid-column-header-wrapper\">\n <div class=\"simple-grid-column-header\" *ngFor=\"let column of columns; let index = index\"\n [style.min-width.px]=\"column.width\" [style.max-width.px]=\"column.width\">\n <div class=\"simple-grid-column-header-label\" [ngClass]=\"column.textAlign ? column.textAlign : defaultTextAlign\"\n [textContent]=\"column.headerText\"\n ></div>\n <div *ngIf=\"column.resizable\" class=\"simple-grid-column-sizer\"\n (mousedown)=\"handleSizerMouseDown($event, column)\"\n ></div>\n </div>\n </div>\n <div cdkDropListGroup class=\"drop-list-group\">\n <div #dropList cdkDropList cdkDropListOrientation=\"vertical\"\n class=\"simple-grid-drag-drop-list\"\n [cdkDropListDisabled]=\"!dragDropEnabled\"\n [cdkDropListData]=\"data\"\n [cdkDropListEnterPredicate]=\"handleCanDragDrop\"\n (cdkDropListDropped)=\"handleDrop($event)\"\n >\n <div class=\"simple-grid-row\" *ngFor=\"let row of data\" cdkDrag>\n <div class=\"simple-grid-column-cell\" *ngFor=\"let column of columns\"\n [style.min-width.px]=\"column.width\" [style.max-width.px]=\"column.width\">\n <div class=\"simple-grid-column-cell-value\" [ngClass]=\"column.textAlign ? column.textAlign : defaultTextAlign\">\n <ng-container *ngIf=\"column.template\">\n <ng-container [ngTemplateOutlet]=\"column.template\" [ngTemplateOutletContext]=\"{value: row[column.field], row: row}\"></ng-container>\n </ng-container>\n <div *ngIf=\"!column.template\" [textContent]=\"row[column.field]\"></div>\n </div>\n <div *ngIf=\"column.resizable\" class=\"simple-grid-column-sizer-placeholder\"></div>\n </div>\n </div>\n </div>\n </div>\n ",
7597
- changeDetection: core.ChangeDetectionStrategy.OnPush,
7598
- encapsulation: core.ViewEncapsulation.None
7599
- },] }
8028
+ BaseSimpleGridComponent.decorators = [
8029
+ { type: core.Directive }
7600
8030
  ];
7601
- SimpleGridComponent.propDecorators = {
8031
+ BaseSimpleGridComponent.propDecorators = {
7602
8032
  content: [{ type: core.ContentChildren, args: [SimpleGridColumnDirective,] }],
7603
8033
  data: [{ type: core.Input }],
7604
8034
  dragDropEnabled: [{ type: core.Input }],
8035
+ inlineEdit: [{ type: core.Input }],
8036
+ showToolbar: [{ type: core.Input }],
7605
8037
  emitDragDrop: [{ type: core.Input }],
7606
8038
  onDrop: [{ type: core.Output }],
7607
- showClass: [{ type: core.HostBinding, args: ["class.co-simple-grid",] }],
8039
+ selectRow: [{ type: core.Output }],
8040
+ dblClickRow: [{ type: core.Output }],
8041
+ saveRow: [{ type: core.Output }],
7608
8042
  handleMouseMove: [{ type: core.HostListener, args: ['document:mousemove', ['$event'],] }],
7609
8043
  handleMouseUp: [{ type: core.HostListener, args: ['document:mouseup', ['$event'],] }]
7610
8044
  };
7611
8045
 
8046
+ var SimpleGridComponent = /** @class */ (function (_super) {
8047
+ __extends(SimpleGridComponent, _super);
8048
+ function SimpleGridComponent(_changeDetection, _formMaster) {
8049
+ var _this = _super.call(this) || this;
8050
+ _this._changeDetection = _changeDetection;
8051
+ _this._formMaster = _formMaster;
8052
+ _this.defaultTextAlign = exports.ColumnAlign.Left;
8053
+ _this.editting = false;
8054
+ _this.editRowIndex = -1;
8055
+ _this.editCellIndex = -1;
8056
+ _this.selectedRowIndex = -1;
8057
+ _this._doubleClicked = false;
8058
+ _this._newRow = false;
8059
+ return _this;
8060
+ }
8061
+ SimpleGridComponent.prototype.showClass = function () {
8062
+ return true;
8063
+ };
8064
+ SimpleGridComponent.prototype.handleKeyDown = function (event) {
8065
+ var _this = this;
8066
+ if (!this.inlineEdit) {
8067
+ return;
8068
+ }
8069
+ if (event.code === 'Tab') {
8070
+ event.preventDefault();
8071
+ this._nextAvailableCellToEdit(!event.shiftKey, this.editCellIndex)
8072
+ .then(function (index) {
8073
+ _this.editCellIndex = index;
8074
+ });
8075
+ this._detectChanges();
8076
+ }
8077
+ if (event.code === 'Escape') {
8078
+ this.cancelEditRow();
8079
+ }
8080
+ if (event.code === 'Enter') {
8081
+ this.validateAndSave();
8082
+ }
8083
+ };
8084
+ SimpleGridComponent.prototype.addRow = function () {
8085
+ var _this = this;
8086
+ var valid = this.validateAndSave();
8087
+ this._detectChanges();
8088
+ if (valid) {
8089
+ this.data.unshift({});
8090
+ this._newRow = true;
8091
+ this.editRowIndex = 0;
8092
+ this._nextAvailableCellToEdit(true).then(function (index) {
8093
+ _this.editCellIndex = index;
8094
+ });
8095
+ this.editting = true;
8096
+ this.rowToEdit = this.data[0];
8097
+ this._detectChanges();
8098
+ }
8099
+ };
8100
+ SimpleGridComponent.prototype.validateAndSave = function (stopEditting) {
8101
+ if (stopEditting === void 0) { stopEditting = true; }
8102
+ if (!this.editting) {
8103
+ return true;
8104
+ }
8105
+ var valid = this._formMaster.submitSlaves();
8106
+ this._detectChanges();
8107
+ if (valid) {
8108
+ this._saveRow(stopEditting);
8109
+ return true;
8110
+ }
8111
+ };
8112
+ SimpleGridComponent.prototype.cancelEditRow = function () {
8113
+ if (!this.editting) {
8114
+ return;
8115
+ }
8116
+ if (this._newRow) {
8117
+ this.data.shift();
8118
+ }
8119
+ else {
8120
+ this.data[this.editRowIndex] = this.rowToEdit;
8121
+ }
8122
+ this._newRow = false;
8123
+ this.editting = false;
8124
+ this._detectChanges();
8125
+ };
8126
+ SimpleGridComponent.prototype.handleClickRow = function (event, index) {
8127
+ var _this = this;
8128
+ setTimeout(function () {
8129
+ if (_this._doubleClicked) {
8130
+ return;
8131
+ }
8132
+ _this.selectTheRow(index);
8133
+ }, 200);
8134
+ };
8135
+ SimpleGridComponent.prototype.selectTheRow = function (index, emit) {
8136
+ if (emit === void 0) { emit = true; }
8137
+ if (this.selectedRowIndex !== index && ((this.editting && this.validateAndSave()) || !this.editting)) {
8138
+ this.selectedRowIndex = index;
8139
+ if (emit) {
8140
+ this.selectRow.next(this.data[this.selectedRowIndex]);
8141
+ }
8142
+ }
8143
+ this._detectChanges();
8144
+ };
8145
+ SimpleGridComponent.prototype.handleDblClickRow = function (event, index) {
8146
+ this._doubleClicked = true;
8147
+ this.dblClickRow.next(this.data[index]);
8148
+ this.selectTheRow(index, false);
8149
+ if (this.inlineEdit) {
8150
+ this.editRow(event);
8151
+ }
8152
+ this._resetDblClick();
8153
+ };
8154
+ SimpleGridComponent.prototype.editRow = function (event) {
8155
+ var _this = this;
8156
+ this.editRowIndex = this.selectedRowIndex;
8157
+ this.rowToEdit = this.data[this.editRowIndex];
8158
+ this.editting = true;
8159
+ this._nextAvailableCellToEdit(true).then(function (index) {
8160
+ _this.editCellIndex = index;
8161
+ });
8162
+ this._detectChanges();
8163
+ };
8164
+ SimpleGridComponent.prototype.handleCellClick = function (index) {
8165
+ this.editCellIndex = index;
8166
+ this._detectChanges();
8167
+ };
8168
+ SimpleGridComponent.prototype._resetDblClick = function () {
8169
+ var _this = this;
8170
+ setTimeout(function () {
8171
+ _this._doubleClicked = false;
8172
+ }, 500);
8173
+ };
8174
+ /**
8175
+ *
8176
+ * @param next; Move to next or previous cell
8177
+ * @param start; Start from cellindex
8178
+ * @private
8179
+ */
8180
+ SimpleGridComponent.prototype._nextAvailableCellToEdit = function (next, start) {
8181
+ var _this = this;
8182
+ if (start === void 0) { start = -1; }
8183
+ return new Promise(function (resolve, reject) {
8184
+ var numEditableColumns = _this.columns.filter(function (c) { return !c.readonly; }).length;
8185
+ var wantedIndex = start + (next ? 1 : -1);
8186
+ if (wantedIndex >= numEditableColumns) {
8187
+ _this._getNextEditRowIndex()
8188
+ .then(function (index) {
8189
+ _this.editRowIndex = index;
8190
+ resolve(_this._getNextEditCellIndex(0));
8191
+ })
8192
+ .catch(function (e) {
8193
+ reject();
8194
+ });
8195
+ }
8196
+ else if (wantedIndex < 0) {
8197
+ _this._getPreviousEditRowIndex()
8198
+ .then(function (index) {
8199
+ _this.editRowIndex = index;
8200
+ resolve(_this._getPreviousEditCellIndex(_this.columns.length - 1));
8201
+ })
8202
+ .catch(function (e) {
8203
+ reject();
8204
+ });
8205
+ }
8206
+ else {
8207
+ resolve(next ? _this._getNextEditCellIndex(start + 1) : _this._getPreviousEditCellIndex(start - 1));
8208
+ }
8209
+ });
8210
+ };
8211
+ SimpleGridComponent.prototype._getNextEditCellIndex = function (start) {
8212
+ for (var i = start; i < this.columns.length; i++) {
8213
+ if (!this.columns[i].readonly) {
8214
+ return i;
8215
+ }
8216
+ }
8217
+ };
8218
+ SimpleGridComponent.prototype._getPreviousEditCellIndex = function (start) {
8219
+ for (var i = start; i >= 0; i--) {
8220
+ if (!this.columns[i].readonly) {
8221
+ return i;
8222
+ }
8223
+ }
8224
+ };
8225
+ SimpleGridComponent.prototype._getNextEditRowIndex = function () {
8226
+ var _this = this;
8227
+ return new Promise(function (resolve, reject) {
8228
+ var newRowIndex = 0;
8229
+ if (_this.editRowIndex + 1 >= _this.data.length) {
8230
+ newRowIndex = 0;
8231
+ }
8232
+ else {
8233
+ newRowIndex = _this.editRowIndex + 1;
8234
+ }
8235
+ if (newRowIndex !== _this.editRowIndex) { // go to different row validate current one first
8236
+ if (_this.validateAndSave(false)) {
8237
+ _this.rowToEdit = _this.data[newRowIndex];
8238
+ resolve(newRowIndex);
8239
+ }
8240
+ else {
8241
+ reject();
8242
+ }
8243
+ }
8244
+ else {
8245
+ resolve(newRowIndex);
8246
+ }
8247
+ });
8248
+ };
8249
+ SimpleGridComponent.prototype._getPreviousEditRowIndex = function () {
8250
+ var _this = this;
8251
+ return new Promise(function (resolve, reject) {
8252
+ var newRowIndex = 0;
8253
+ if (_this.editRowIndex - 1 < 0) {
8254
+ newRowIndex = _this.data.length - 1;
8255
+ }
8256
+ else {
8257
+ newRowIndex = _this.editRowIndex - 1;
8258
+ }
8259
+ if (newRowIndex !== _this.editRowIndex) { // go to different row validate current one first
8260
+ if (_this.validateAndSave(false)) {
8261
+ _this.rowToEdit = _this.data[newRowIndex];
8262
+ resolve(newRowIndex);
8263
+ }
8264
+ else {
8265
+ reject();
8266
+ }
8267
+ }
8268
+ else {
8269
+ resolve(newRowIndex);
8270
+ }
8271
+ });
8272
+ };
8273
+ SimpleGridComponent.prototype._saveRow = function (stopEditting) {
8274
+ if (stopEditting === void 0) { stopEditting = true; }
8275
+ // emit saveEvent
8276
+ if (this.rowToEdit) {
8277
+ this.saveRow.next(this.rowToEdit);
8278
+ }
8279
+ this._newRow = false;
8280
+ if (stopEditting) {
8281
+ this.editRowIndex = -1;
8282
+ this.editCellIndex = -1;
8283
+ this.editting = false;
8284
+ this.rowToEdit = undefined;
8285
+ }
8286
+ this._detectChanges();
8287
+ };
8288
+ SimpleGridComponent.prototype._detectChanges = function () {
8289
+ // setTimeout(() => {
8290
+ // this._changeDetection.markForCheck();
8291
+ // this._changeDetection.reattach();
8292
+ this._changeDetection.detectChanges();
8293
+ // this._changeDetection.detach();
8294
+ // });
8295
+ };
8296
+ return SimpleGridComponent;
8297
+ }(BaseSimpleGridComponent));
8298
+ SimpleGridComponent.decorators = [
8299
+ { type: core.Component, args: [{
8300
+ selector: "co-simple-grid",
8301
+ template: "\n <co-grid-toolbar *ngIf=\"inlineEdit && showToolbar\"\n (addClick)=\"addRow()\"\n (editClick)=\"editRow($event)\"\n (saveClick)=\"validateAndSave()\"\n (cancelClick)=\"cancelEditRow()\"\n ></co-grid-toolbar>\n <div class=\"simple-grid-column-header-wrapper\">\n <div class=\"simple-grid-column-header\" *ngFor=\"let column of columns; let index = index\"\n [style.min-width.px]=\"column.width\" [style.max-width.px]=\"column.width\">\n <div class=\"simple-grid-column-header-label\" [ngClass]=\"column.textAlign ? column.textAlign : defaultTextAlign\"\n [textContent]=\"column.headerText\"\n ></div>\n <div *ngIf=\"column.resizable\" class=\"simple-grid-column-sizer\"\n (mousedown)=\"handleSizerMouseDown($event, column)\"\n ></div>\n </div>\n </div>\n <div cdkDropListGroup class=\"drop-list-group\">\n <div #dropList cdkDropList cdkDropListOrientation=\"vertical\"\n class=\"simple-grid-drag-drop-list\"\n [cdkDropListDisabled]=\"!dragDropEnabled\"\n [cdkDropListData]=\"data\"\n [cdkDropListEnterPredicate]=\"handleCanDragDrop\"\n (cdkDropListDropped)=\"handleDrop($event)\"\n >\n <div class=\"simple-grid-row\" [class.selected]=\"rowIndex === selectedRowIndex\" [class.editting]=\"rowIndex === editRowIndex\" *ngFor=\"let row of data; let rowIndex = index\" cdkDrag\n (click)=\"handleClickRow($event, rowIndex)\" (dblclick)=\"handleDblClickRow($event, rowIndex)\">\n <co-form class=\"simple-grid-row-form\">\n <div class=\"simple-grid-column-cell\" *ngFor=\"let column of columns; let columnIndex = index\"\n [style.min-width.px]=\"column.width\" [style.max-width.px]=\"column.width\">\n <co-simple-grid-cell\n [column]=\"column\"\n [row]=\"row\"\n [editMode]=\"inlineEdit && editting && rowIndex === editRowIndex\"\n [fieldEditMode]=\"editCellIndex === columnIndex\"\n (cellClick)=\"handleCellClick(columnIndex)\"\n ></co-simple-grid-cell>\n <div *ngIf=\"column.resizable\" class=\"simple-grid-column-sizer-placeholder\"></div>\n </div>\n </co-form>\n </div>\n </div>\n </div>\n ",
8302
+ providers: [
8303
+ FormMasterService
8304
+ ],
8305
+ // changeDetection: ChangeDetectionStrategy.OnPush,
8306
+ encapsulation: core.ViewEncapsulation.None
8307
+ },] }
8308
+ ];
8309
+ SimpleGridComponent.ctorParameters = function () { return [
8310
+ { type: core.ChangeDetectorRef },
8311
+ { type: FormMasterService }
8312
+ ]; };
8313
+ SimpleGridComponent.propDecorators = {
8314
+ showClass: [{ type: core.HostBinding, args: ["class.co-simple-grid",] }],
8315
+ handleKeyDown: [{ type: core.HostListener, args: ['keydown', ['$event'],] }]
8316
+ };
8317
+
8318
+ var SimpleGridCellComponent = /** @class */ (function () {
8319
+ function SimpleGridCellComponent(_changeDetector) {
8320
+ this._changeDetector = _changeDetector;
8321
+ this.defaultTextAlign = exports.ColumnAlign.Left;
8322
+ this.editMode = false;
8323
+ this.cellClick = new core.EventEmitter();
8324
+ this._fieldEditMode = false;
8325
+ this._focused = false;
8326
+ }
8327
+ Object.defineProperty(SimpleGridCellComponent.prototype, "editTemplateContent", {
8328
+ set: function (template) {
8329
+ if (template) {
8330
+ this._editTemplate = template;
8331
+ this._setFocusComponent();
8332
+ }
8333
+ },
8334
+ enumerable: false,
8335
+ configurable: true
8336
+ });
8337
+ Object.defineProperty(SimpleGridCellComponent.prototype, "noEditTemplateContent", {
8338
+ set: function (template) {
8339
+ if (template) {
8340
+ this._template = template;
8341
+ this._setFocusComponent();
8342
+ }
8343
+ },
8344
+ enumerable: false,
8345
+ configurable: true
8346
+ });
8347
+ Object.defineProperty(SimpleGridCellComponent.prototype, "noTemplateContent", {
8348
+ set: function (template) {
8349
+ if (template) {
8350
+ this._inputTemplate = template;
8351
+ this._setFocusComponent();
8352
+ }
8353
+ },
8354
+ enumerable: false,
8355
+ configurable: true
8356
+ });
8357
+ Object.defineProperty(SimpleGridCellComponent.prototype, "fieldEditMode", {
8358
+ get: function () {
8359
+ return this._fieldEditMode;
8360
+ },
8361
+ set: function (value) {
8362
+ this._fieldEditMode = value;
8363
+ this._setFocusComponent();
8364
+ },
8365
+ enumerable: false,
8366
+ configurable: true
8367
+ });
8368
+ SimpleGridCellComponent.prototype.showClass = function () {
8369
+ return true;
8370
+ };
8371
+ SimpleGridCellComponent.prototype.handleClick = function (event) {
8372
+ if (this.column && !this.column.readonly) {
8373
+ this.cellClick.next();
8374
+ }
8375
+ };
8376
+ SimpleGridCellComponent.prototype._setFocusComponent = function () {
8377
+ if (this.editMode && this.fieldEditMode) {
8378
+ var element = this._getElement();
8379
+ if (element) {
8380
+ var focusEvent = this._createNewEvent(element, 'focus');
8381
+ element.focus();
8382
+ element.dispatchEvent(focusEvent);
8383
+ this._focused = true;
8384
+ }
8385
+ }
8386
+ else {
8387
+ if (this._focused) {
8388
+ var element = this._getElement();
8389
+ if (element) {
8390
+ var blurEvent = this._createNewEvent(element, 'blur');
8391
+ element.blur();
8392
+ element.dispatchEvent(blurEvent);
8393
+ }
8394
+ this._focused = false;
8395
+ }
8396
+ }
8397
+ this._detectChanges();
8398
+ };
8399
+ SimpleGridCellComponent.prototype._getFirstFormInput = function (parent) {
8400
+ if (parent) {
8401
+ var collection_1 = Array.from(parent.getElementsByTagName('input'));
8402
+ var otherCollection = Array.from(parent.getElementsByTagName('textarea'));
8403
+ otherCollection.map(function (o) { return collection_1.push(o); });
8404
+ if (collection_1.length > 0) {
8405
+ return collection_1[0];
8406
+ }
8407
+ }
8408
+ };
8409
+ SimpleGridCellComponent.prototype._createNewEvent = function (element, eventType) {
8410
+ var event;
8411
+ if ("createEvent" in document) {
8412
+ event = document.createEvent("Event");
8413
+ event.initEvent(eventType, true, true);
8414
+ }
8415
+ else if ("Event" in window) {
8416
+ event = new Event(eventType, { bubbles: true, cancelable: true });
8417
+ }
8418
+ return event;
8419
+ };
8420
+ SimpleGridCellComponent.prototype._getElement = function () {
8421
+ var templ;
8422
+ if (this._editTemplate) {
8423
+ templ = this._editTemplate;
8424
+ }
8425
+ else if (this._template) {
8426
+ templ = this._template;
8427
+ }
8428
+ else {
8429
+ templ = this._inputTemplate;
8430
+ }
8431
+ if (templ) {
8432
+ if (templ && templ.elementRef) {
8433
+ var inputElement = this._getFirstFormInput(templ.elementRef.nativeElement.parentElement);
8434
+ if (inputElement) {
8435
+ return inputElement;
8436
+ }
8437
+ }
8438
+ }
8439
+ };
8440
+ SimpleGridCellComponent.prototype._detectChanges = function () {
8441
+ // setTimeout(() => {
8442
+ this._changeDetector.markForCheck();
8443
+ // this._changeDetector.detectChanges();
8444
+ // });
8445
+ };
8446
+ return SimpleGridCellComponent;
8447
+ }());
8448
+ SimpleGridCellComponent.decorators = [
8449
+ { type: core.Component, args: [{
8450
+ selector: "co-simple-grid-cell",
8451
+ template: "\n <div class=\"simple-grid-column-cell-value\" [ngClass]=\"column.textAlign ? column.textAlign : defaultTextAlign\">\n <ng-container *ngIf=\"editMode; else noInlineEdit\">\n <ng-container #editTemplate *ngIf=\"column.editTemplate; else noEditTemplate\" [ngTemplateOutlet]=\"column.editTemplate\" [ngTemplateOutletContext]=\"{value: row[column.field], row: row}\"></ng-container>\n <ng-template #noEditTemplate>\n <ng-container *ngIf=\"column.template; else noTemplate\">\n <ng-container [ngTemplateOutlet]=\"column.template\" [ngTemplateOutletContext]=\"{value: row[column.field], row: row}\"></ng-container>\n </ng-container>\n <ng-template #noTemplate>\n <co-input-text [(model)]=\"row[column.field]\" [required]=\"column.required\"></co-input-text>\n </ng-template>\n </ng-template>\n </ng-container>\n <ng-template #noInlineEdit>\n <ng-container *ngIf=\"column.template; else noTemplate\">\n <ng-container [ngTemplateOutlet]=\"column.template\" [ngTemplateOutletContext]=\"{value: row[column.field], row: row}\"></ng-container>\n </ng-container>\n <ng-template #noTemplate>\n <div [textContent]=\"column.getFieldValue(row[column.field])\"></div>\n </ng-template>\n </ng-template>\n </div>\n ",
8452
+ encapsulation: core.ViewEncapsulation.None //,
8453
+ // changeDetection: ChangeDetectionStrategy.OnPush
8454
+ },] }
8455
+ ];
8456
+ SimpleGridCellComponent.ctorParameters = function () { return [
8457
+ { type: core.ChangeDetectorRef }
8458
+ ]; };
8459
+ SimpleGridCellComponent.propDecorators = {
8460
+ editTemplateContent: [{ type: core.ViewChild, args: ["editTemplate", { read: BaseInputComponent },] }],
8461
+ noEditTemplateContent: [{ type: core.ViewChild, args: ["noEditTemplate",] }],
8462
+ noTemplateContent: [{ type: core.ViewChild, args: ["noTemplate",] }],
8463
+ column: [{ type: core.Input }],
8464
+ row: [{ type: core.Input }],
8465
+ editMode: [{ type: core.Input }],
8466
+ fieldEditMode: [{ type: core.Input }],
8467
+ cellClick: [{ type: core.Output }],
8468
+ showClass: [{ type: core.HostBinding, args: ["class.co-simple-grid-cell",] }],
8469
+ handleClick: [{ type: core.HostListener, args: ['click', ['$event'],] }]
8470
+ };
8471
+
7612
8472
  var SimpleGridModule = /** @class */ (function () {
7613
8473
  function SimpleGridModule() {
7614
8474
  }
@@ -7618,14 +8478,19 @@
7618
8478
  { type: core.NgModule, args: [{
7619
8479
  imports: [
7620
8480
  common.CommonModule,
7621
- dragDrop.DragDropModule
8481
+ dragDrop.DragDropModule,
8482
+ GridToolbarModule,
8483
+ InputTextModule,
8484
+ FormModule
7622
8485
  ],
7623
8486
  declarations: [
7624
8487
  SimpleGridComponent,
8488
+ SimpleGridCellComponent,
7625
8489
  SimpleGridColumnDirective
7626
8490
  ],
7627
8491
  exports: [
7628
8492
  SimpleGridComponent,
8493
+ SimpleGridCellComponent,
7629
8494
  SimpleGridColumnDirective
7630
8495
  ]
7631
8496
  },] }
@@ -7745,6 +8610,7 @@
7745
8610
  this._createTiles();
7746
8611
  }
7747
8612
  this._checkNavigationButtons();
8613
+ this._resizeCanvasToDisplaySize();
7748
8614
  };
7749
8615
  Carousel3dComponent.prototype._init = function () {
7750
8616
  var _this = this;
@@ -7888,11 +8754,7 @@
7888
8754
  boundingBox.getSize(size);
7889
8755
  // get the max side of the bounding box (fits to width OR height as needed )
7890
8756
  var maxDim = Math.max(size.x, size.y, size.z);
7891
- var fov = this._camera.fov * (Math.PI / 180);
7892
- // let cameraZ = Math.abs(maxDim / 4 * Math.tan(fov * 200));
7893
- var cameraZ = Math.abs((maxDim / 2) / Math.tan(fov / 2));
7894
- // cameraZ *= offset; // zoom out a little so that objects don't fill the screen
7895
- this._camera.position.z = cameraZ;
8757
+ this._camera.position.z = Math.abs((maxDim / 2) * Math.atan(this._camera.fov / 2));
7896
8758
  this._camera.lookAt(center);
7897
8759
  };
7898
8760
  Carousel3dComponent.prototype._checkNavigationButtons = function () {
@@ -7951,11 +8813,17 @@
7951
8813
  this._rotate(800);
7952
8814
  };
7953
8815
  Carousel3dComponent.prototype._resizeCanvasToDisplaySize = function () {
7954
- this._camera.aspect = this.canvasContainer.nativeElement.clientWidth / this.canvasContainer.nativeElement.clientHeight;
7955
- this._camera.updateProjectionMatrix();
7956
- this._rendererCss.setSize(this.canvasContainer.nativeElement.clientWidth, this.canvasContainer.nativeElement.clientHeight);
7957
- this._renderer.setSize(this.canvasContainer.nativeElement.clientWidth, this.canvasContainer.nativeElement.clientHeight);
7958
- this._render();
8816
+ var _this = this;
8817
+ setTimeout(function () {
8818
+ if (!_this.canvasContainer || !_this.canvasContainer.nativeElement) {
8819
+ return;
8820
+ }
8821
+ _this._camera.aspect = _this.canvasContainer.nativeElement.clientWidth / _this.canvasContainer.nativeElement.clientHeight;
8822
+ _this._camera.updateProjectionMatrix();
8823
+ _this._rendererCss.setSize(_this.canvasContainer.nativeElement.clientWidth, _this.canvasContainer.nativeElement.clientHeight);
8824
+ _this._renderer.setSize(_this.canvasContainer.nativeElement.clientWidth, _this.canvasContainer.nativeElement.clientHeight);
8825
+ _this._render();
8826
+ });
7959
8827
  };
7960
8828
  Carousel3dComponent.prototype._render = function () {
7961
8829
  this._rendererCss.render(this._sceneCss, this._camera);
@@ -8023,6 +8891,8 @@
8023
8891
  exports.CoDialogModule = CoDialogModule;
8024
8892
  exports.CoDialogPromptComponent = CoDialogPromptComponent;
8025
8893
  exports.CoDialogPromptModule = CoDialogPromptModule;
8894
+ exports.CoDialogWizardComponent = CoDialogWizardComponent;
8895
+ exports.CoDialogWizardModule = CoDialogWizardModule;
8026
8896
  exports.CoGridComponent = CoGridComponent;
8027
8897
  exports.CoGridModule = CoGridModule;
8028
8898
  exports.CoKanbanComponent = CoKanbanComponent;
@@ -8075,6 +8945,8 @@
8075
8945
  exports.PopupMessageDisplayComponent = PopupMessageDisplayComponent;
8076
8946
  exports.PopupModule = PopupModule;
8077
8947
  exports.PopupWindowShellComponent = PopupWindowShellComponent;
8948
+ exports.PriceDisplayPipe = PriceDisplayPipe;
8949
+ exports.PriceDisplayPipeModule = PriceDisplayPipeModule;
8078
8950
  exports.PromptService = PromptService;
8079
8951
  exports.SimpleGridColumnDirective = SimpleGridColumnDirective;
8080
8952
  exports.SimpleGridComponent = SimpleGridComponent;
@@ -8090,13 +8962,13 @@
8090
8962
  exports["ɵf"] = CoScrollableDirective;
8091
8963
  exports["ɵg"] = StopClickModule;
8092
8964
  exports["ɵh"] = StopClickDirective;
8093
- exports["ɵi"] = PriceDisplayPipeModule;
8094
- exports["ɵj"] = PriceDisplayPipe;
8095
- exports["ɵk"] = InputBoolean;
8096
- exports["ɵl"] = BaseModule;
8097
- exports["ɵm"] = FormInputUserModelChangeListenerService;
8098
- exports["ɵn"] = NgZoneWrapperService;
8099
- exports["ɵo"] = BaseInputComponent;
8965
+ exports["ɵi"] = InputBoolean;
8966
+ exports["ɵj"] = BaseModule;
8967
+ exports["ɵk"] = FormInputUserModelChangeListenerService;
8968
+ exports["ɵl"] = NgZoneWrapperService;
8969
+ exports["ɵm"] = BaseInputComponent;
8970
+ exports["ɵn"] = GridToolbarModule;
8971
+ exports["ɵo"] = GridToolbarComponent;
8100
8972
  exports["ɵp"] = BaseSelectionGridComponent;
8101
8973
  exports["ɵq"] = BaseInlineEditGridComponent;
8102
8974
  exports["ɵr"] = BaseToolbarGridComponent;
@@ -8106,6 +8978,8 @@
8106
8978
  exports["ɵv"] = ValidationErrorModule;
8107
8979
  exports["ɵw"] = ValidationErrorComponent;
8108
8980
  exports["ɵx"] = PopupShowerService;
8981
+ exports["ɵy"] = BaseSimpleGridComponent;
8982
+ exports["ɵz"] = SimpleGridCellComponent;
8109
8983
 
8110
8984
  Object.defineProperty(exports, '__esModule', { value: true });
8111
8985