@colijnit/corecomponents_v12 12.0.20 → 12.0.23
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.
- package/bundles/colijnit-corecomponents_v12.umd.js +1181 -210
- package/bundles/colijnit-corecomponents_v12.umd.js.map +1 -1
- package/colijnit-corecomponents_v12.d.ts +12 -8
- package/colijnit-corecomponents_v12.metadata.json +1 -1
- package/esm2015/colijnit-corecomponents_v12.js +13 -9
- package/esm2015/lib/components/base/base-input.component.js +173 -47
- package/esm2015/lib/components/base/commit-buttons/commit-buttons.component.js +92 -0
- package/esm2015/lib/components/base/commit-buttons/commit-buttons.module.js +19 -0
- package/esm2015/lib/components/button/button.component.js +1 -1
- package/esm2015/lib/components/carousel-3d/carousel-3d.component.js +13 -11
- package/esm2015/lib/components/co-dialog-wizard/co-dialog-wizard.component.js +51 -0
- package/esm2015/lib/components/co-dialog-wizard/co-dialog-wizard.module.js +17 -0
- package/esm2015/lib/components/collapsible/collapsible.component.js +10 -2
- package/esm2015/lib/components/drop-down-list/drop-down-list.component.js +4 -1
- package/esm2015/lib/components/form/form.component.js +23 -18
- package/esm2015/lib/components/grid/base/base-grid.component.js +7 -3
- package/esm2015/lib/components/grid/base/base-inline-edit-grid.component.js +48 -3
- package/esm2015/lib/components/grid/base/base-selection-grid.component.js +12 -2
- package/esm2015/lib/components/grid/co-grid.component.js +35 -32
- package/esm2015/lib/components/grid/co-grid.module.js +4 -2
- package/esm2015/lib/components/grid-toolbar/grid-toolbar.component.js +41 -0
- package/esm2015/lib/components/grid-toolbar/grid-toolbar.module.js +23 -0
- package/esm2015/lib/components/input-checkbox/input-checkbox.component.js +4 -1
- package/esm2015/lib/components/input-checkbox-multi-select/input-checkbox-multi-select.component.js +4 -1
- package/esm2015/lib/components/input-combo-box/input-combo-box.component.js +5 -4
- package/esm2015/lib/components/input-date-picker/input-date-picker.component.js +4 -1
- package/esm2015/lib/components/input-listbox/input-listbox.component.js +4 -1
- package/esm2015/lib/components/input-number-picker/input-number-picker.component.js +22 -24
- package/esm2015/lib/components/input-radio-button/input-radio-button.component.js +4 -1
- package/esm2015/lib/components/input-text/input-text.component.js +11 -1
- package/esm2015/lib/components/input-text/input-text.module.js +4 -2
- package/esm2015/lib/components/input-textarea/input-textarea.component.js +4 -1
- package/esm2015/lib/components/multi-select-list/multi-select-list.component.js +4 -1
- package/esm2015/lib/components/simple-grid/base-simple-grid.component.js +86 -0
- package/esm2015/lib/components/simple-grid/simple-grid-cell.component.js +163 -0
- package/esm2015/lib/components/simple-grid/simple-grid-column.directive.js +43 -4
- package/esm2015/lib/components/simple-grid/simple-grid.component.js +257 -59
- package/esm2015/lib/components/simple-grid/simple-grid.module.js +11 -2
- package/esm2015/lib/components/validation-error/validation-error.module.js +1 -1
- package/esm2015/lib/core/constant/number-inputs-key-down-white-list.js +2 -1
- package/esm2015/public-api.js +5 -1
- package/fesm2015/colijnit-corecomponents_v12.js +1179 -234
- package/fesm2015/colijnit-corecomponents_v12.js.map +1 -1
- package/lib/components/base/base-input.component.d.ts +22 -6
- package/lib/components/base/commit-buttons/commit-buttons.component.d.ts +19 -0
- package/lib/components/base/commit-buttons/commit-buttons.module.d.ts +2 -0
- package/lib/components/base/commit-buttons/style/_layout.scss +127 -0
- package/lib/components/base/commit-buttons/style/_material-definition.scss +5 -0
- package/lib/components/base/commit-buttons/style/_theme.scss +34 -0
- package/lib/components/base/commit-buttons/style/material.scss +4 -0
- package/lib/components/co-dialog/style/_layout.scss +3 -0
- package/lib/components/co-dialog-wizard/co-dialog-wizard.component.d.ts +9 -0
- package/lib/components/co-dialog-wizard/co-dialog-wizard.module.d.ts +2 -0
- package/lib/components/co-dialog-wizard/style/_layout.scss +51 -0
- package/lib/components/co-dialog-wizard/style/_material-definition.scss +25 -0
- package/lib/components/co-dialog-wizard/style/_theme.scss +16 -0
- package/lib/components/co-dialog-wizard/style/material.scss +5 -0
- package/lib/components/collapsible/style/_layout.scss +1 -1
- package/lib/components/collapsible/style/_material-definition.scss +1 -0
- package/lib/components/form/form.component.d.ts +1 -1
- package/lib/components/grid/base/base-grid.component.d.ts +3 -0
- package/lib/components/grid/base/base-inline-edit-grid.component.d.ts +11 -2
- package/lib/components/grid/base/base-selection-grid.component.d.ts +4 -0
- package/lib/components/grid-toolbar/grid-toolbar.component.d.ts +13 -0
- package/lib/components/grid-toolbar/grid-toolbar.module.d.ts +2 -0
- package/lib/components/grid-toolbar/style/_layout.scss +10 -0
- package/lib/components/grid-toolbar/style/_material-definition.scss +0 -0
- package/lib/components/grid-toolbar/style/_theme.scss +5 -0
- package/lib/components/grid-toolbar/style/material.scss +5 -0
- package/lib/components/input-checkbox/style/_material-definition.scss +1 -2
- package/lib/components/input-checkbox/style/material.scss +2 -0
- package/lib/components/input-combo-box/input-combo-box.component.d.ts +0 -1
- package/lib/components/input-number-picker/input-number-picker.component.d.ts +1 -6
- package/lib/components/input-radio-button/style/_material-definition.scss +1 -1
- package/lib/components/input-text/style/material.scss +1 -0
- package/lib/components/simple-grid/base-simple-grid.component.d.ts +31 -0
- package/lib/components/simple-grid/simple-grid-cell.component.d.ts +28 -0
- package/lib/components/simple-grid/simple-grid-column.directive.d.ts +15 -2
- package/lib/components/simple-grid/simple-grid.component.d.ts +39 -22
- package/lib/components/simple-grid/style/_layout.scss +23 -0
- package/lib/components/simple-grid/style/_material-definition.scss +13 -4
- package/lib/components/simple-grid/style/_theme.scss +17 -0
- package/lib/components/simple-grid/style/material.scss +1 -0
- package/lib/style/_input.mixins.scss +2 -2
- package/lib/style/_variables.scss +32 -1
- package/package.json +1 -1
- 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
|
},] }
|
|
@@ -3140,10 +3197,13 @@
|
|
|
3140
3197
|
this.formUserChangeListener = formUserChangeListener;
|
|
3141
3198
|
this.ngZoneWrapper = ngZoneWrapper;
|
|
3142
3199
|
this.elementRef = elementRef;
|
|
3200
|
+
this.showSaveCancel = false;
|
|
3143
3201
|
this.noValidation = false;
|
|
3144
3202
|
this.forceRequired = false; // a force outside of [cfgName]'s influence
|
|
3145
3203
|
// Goal: ability to emulate the red background of input fields (form-submitted invalid state)
|
|
3146
3204
|
this.redErrorBackground = false;
|
|
3205
|
+
// @Output()
|
|
3206
|
+
// public commit: EventEmitter<any> = new EventEmitter<any>();
|
|
3147
3207
|
this.nativeBlur = new core.EventEmitter();
|
|
3148
3208
|
this.blur = new core.EventEmitter();
|
|
3149
3209
|
// emits when the enter button on keyboard was pressed while this form input had focussed
|
|
@@ -3162,12 +3222,23 @@
|
|
|
3162
3222
|
this.fullWidth = false;
|
|
3163
3223
|
this.excludeUserModelChange = false;
|
|
3164
3224
|
this.noFormGroupControl = false;
|
|
3225
|
+
this.keepFocus = false;
|
|
3226
|
+
this.canSaveOrCancel = false;
|
|
3227
|
+
this.committing = false;
|
|
3228
|
+
this.commitFinished = true;
|
|
3165
3229
|
this._markedAsUserTouched = false;
|
|
3166
3230
|
this._destroyed = false;
|
|
3167
3231
|
this._hasOnPushCdStrategy = false;
|
|
3232
|
+
this._initialModelSet = false;
|
|
3168
3233
|
this._forceReadonly = undefined;
|
|
3169
3234
|
this._validators = [];
|
|
3170
3235
|
this._asyncValidators = [];
|
|
3236
|
+
// descendents should override this
|
|
3237
|
+
this.commit = function (model) { return __awaiter(_this, void 0, void 0, function () {
|
|
3238
|
+
return __generator(this, function (_a) {
|
|
3239
|
+
return [2 /*return*/, Promise.resolve(true)];
|
|
3240
|
+
});
|
|
3241
|
+
}); };
|
|
3171
3242
|
BaseInputComponent.BaseFormInputComponentIndex++;
|
|
3172
3243
|
this.name = BaseInputComponent.BaseFormInputComponentIndex.toString();
|
|
3173
3244
|
if (this.formUserChangeListener) {
|
|
@@ -3193,7 +3264,12 @@
|
|
|
3193
3264
|
return this._model;
|
|
3194
3265
|
},
|
|
3195
3266
|
set: function (value) {
|
|
3267
|
+
if (!this._initialModelSet) {
|
|
3268
|
+
this._initialModel = this._model;
|
|
3269
|
+
this._initialModelSet = true;
|
|
3270
|
+
}
|
|
3196
3271
|
this._model = value;
|
|
3272
|
+
this.canSaveOrCancel = this._model !== this._initialModel;
|
|
3197
3273
|
this._clearErrorComponent();
|
|
3198
3274
|
},
|
|
3199
3275
|
enumerable: false,
|
|
@@ -3414,6 +3490,30 @@
|
|
|
3414
3490
|
enumerable: false,
|
|
3415
3491
|
configurable: true
|
|
3416
3492
|
});
|
|
3493
|
+
BaseInputComponent.prototype.onClick = function (event) {
|
|
3494
|
+
if (this.canChange && !this.noClickFocus) {
|
|
3495
|
+
this.requestFocus();
|
|
3496
|
+
if (!this.excludeUserModelChange) {
|
|
3497
|
+
this.markAsUserTouched();
|
|
3498
|
+
}
|
|
3499
|
+
}
|
|
3500
|
+
};
|
|
3501
|
+
BaseInputComponent.prototype.onFocusIn = function () {
|
|
3502
|
+
if (!this.excludeUserModelChange) {
|
|
3503
|
+
this.markAsUserTouched();
|
|
3504
|
+
}
|
|
3505
|
+
};
|
|
3506
|
+
BaseInputComponent.prototype.handleDocumentScroll = function () {
|
|
3507
|
+
this._positionValidationError();
|
|
3508
|
+
};
|
|
3509
|
+
BaseInputComponent.prototype.handleWindowResize = function () {
|
|
3510
|
+
this._positionValidationError();
|
|
3511
|
+
};
|
|
3512
|
+
BaseInputComponent.prototype.handleKeyDown = function (event) {
|
|
3513
|
+
if (this.showSaveCancel && this.canSaveOrCancel) {
|
|
3514
|
+
this._handleKeyDown(event);
|
|
3515
|
+
}
|
|
3516
|
+
};
|
|
3417
3517
|
Object.defineProperty(BaseInputComponent.prototype, "canChange", {
|
|
3418
3518
|
get: function () {
|
|
3419
3519
|
return !this.readonly && !this.disabled;
|
|
@@ -3447,18 +3547,6 @@
|
|
|
3447
3547
|
this._modelChangeSub = this.modelChange.subscribe(function (val) {
|
|
3448
3548
|
_this.model = val;
|
|
3449
3549
|
});
|
|
3450
|
-
var iOptions = {
|
|
3451
|
-
trackVisibility: true,
|
|
3452
|
-
// 🆕 Set a minimum delay between notifications
|
|
3453
|
-
delay: 100,
|
|
3454
|
-
// root: document,
|
|
3455
|
-
// rootMargin: "1px",
|
|
3456
|
-
threshold: 1
|
|
3457
|
-
};
|
|
3458
|
-
this.intersectionObserver = new IntersectionObserver(function (entries, observer) { return _this._handleElementPositionChange(entries, observer); }, iOptions);
|
|
3459
|
-
// if (this.speechInput) {
|
|
3460
|
-
// this._subscribeToSpeechInput();
|
|
3461
|
-
// }
|
|
3462
3550
|
};
|
|
3463
3551
|
BaseInputComponent.prototype.ngAfterViewInit = function () {
|
|
3464
3552
|
var _this = this;
|
|
@@ -3478,8 +3566,8 @@
|
|
|
3478
3566
|
BaseInputComponent.prototype.ngOnDestroy = function () {
|
|
3479
3567
|
var _this = this;
|
|
3480
3568
|
if (this.input) {
|
|
3481
|
-
this.input.removeEventListener('blur', function () { return _this.doBlur(); });
|
|
3482
|
-
this.input.removeEventListener('focus', function () { return _this.doFocus(); });
|
|
3569
|
+
this.input.removeEventListener('blur', function (event) { return _this.doBlur(event); });
|
|
3570
|
+
this.input.removeEventListener('focus', function (event) { return _this.doFocus(event); });
|
|
3483
3571
|
}
|
|
3484
3572
|
this._destroyed = true;
|
|
3485
3573
|
this._clearErrorComponent();
|
|
@@ -3506,18 +3594,49 @@
|
|
|
3506
3594
|
this.changeDetector = undefined;
|
|
3507
3595
|
this.input = undefined;
|
|
3508
3596
|
};
|
|
3597
|
+
BaseInputComponent.prototype.commitClick = function (event) {
|
|
3598
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3599
|
+
var success;
|
|
3600
|
+
return __generator(this, function (_a) {
|
|
3601
|
+
switch (_a.label) {
|
|
3602
|
+
case 0:
|
|
3603
|
+
this.keepFocus = true;
|
|
3604
|
+
this.commitFinished = false;
|
|
3605
|
+
this.committing = true;
|
|
3606
|
+
return [4 /*yield*/, this.commit(this.model)];
|
|
3607
|
+
case 1:
|
|
3608
|
+
success = _a.sent();
|
|
3609
|
+
this.keepFocus = false;
|
|
3610
|
+
return [4 /*yield*/, this._commitFinished()];
|
|
3611
|
+
case 2:
|
|
3612
|
+
_a.sent();
|
|
3613
|
+
if (success) {
|
|
3614
|
+
this.doBlur(event);
|
|
3615
|
+
}
|
|
3616
|
+
return [2 /*return*/, success];
|
|
3617
|
+
}
|
|
3618
|
+
});
|
|
3619
|
+
});
|
|
3620
|
+
};
|
|
3621
|
+
BaseInputComponent.prototype.cancelClick = function (event) {
|
|
3622
|
+
this.keepFocus = true;
|
|
3623
|
+
if (this._initialModelSet) {
|
|
3624
|
+
this.model = this._initialModel;
|
|
3625
|
+
}
|
|
3626
|
+
this.keepFocus = false;
|
|
3627
|
+
};
|
|
3509
3628
|
BaseInputComponent.prototype.showValidationError = function (error) {
|
|
3510
3629
|
if (this.validationErrorContainer) {
|
|
3511
3630
|
if (this._errorValidationComponent) {
|
|
3512
3631
|
this._clearErrorComponent();
|
|
3513
3632
|
}
|
|
3514
|
-
var clientRect = this.elementRef.nativeElement.getBoundingClientRect();
|
|
3515
3633
|
var componentFactory = this.componentFactoryResolver.resolveComponentFactory(ValidationErrorComponent);
|
|
3516
3634
|
this._errorValidationComponent = this.validationErrorContainer.createComponent(componentFactory);
|
|
3517
|
-
this._errorValidationComponent.instance.top = clientRect.bottom;
|
|
3518
|
-
this._errorValidationComponent.instance.left = clientRect.left;
|
|
3519
3635
|
this._errorValidationComponent.instance.error = error;
|
|
3520
|
-
|
|
3636
|
+
if (this._hasOnPushCdStrategy) {
|
|
3637
|
+
this.changeDetector.markForCheck();
|
|
3638
|
+
}
|
|
3639
|
+
this._positionValidationError();
|
|
3521
3640
|
}
|
|
3522
3641
|
};
|
|
3523
3642
|
/**
|
|
@@ -3535,32 +3654,45 @@
|
|
|
3535
3654
|
this.detectChanges();
|
|
3536
3655
|
}
|
|
3537
3656
|
};
|
|
3538
|
-
BaseInputComponent.prototype.onClick = function (event) {
|
|
3539
|
-
if (this.canChange && !this.noClickFocus) {
|
|
3540
|
-
this.requestFocus();
|
|
3541
|
-
if (!this.excludeUserModelChange) {
|
|
3542
|
-
this.markAsUserTouched();
|
|
3543
|
-
}
|
|
3544
|
-
}
|
|
3545
|
-
};
|
|
3546
|
-
BaseInputComponent.prototype.onFocusIn = function () {
|
|
3547
|
-
if (!this.excludeUserModelChange) {
|
|
3548
|
-
this.markAsUserTouched();
|
|
3549
|
-
}
|
|
3550
|
-
};
|
|
3551
3657
|
BaseInputComponent.prototype.requestFocus = function () {
|
|
3552
3658
|
if (this.canChange && this.input) {
|
|
3553
3659
|
this.input.focus();
|
|
3554
3660
|
this.focused = true;
|
|
3661
|
+
if (this._hasOnPushCdStrategy) {
|
|
3662
|
+
this.markForCheck();
|
|
3663
|
+
}
|
|
3555
3664
|
}
|
|
3556
3665
|
};
|
|
3557
|
-
BaseInputComponent.prototype.doFocus = function () {
|
|
3666
|
+
BaseInputComponent.prototype.doFocus = function (event) {
|
|
3667
|
+
if (this.disabled) {
|
|
3668
|
+
return;
|
|
3669
|
+
}
|
|
3670
|
+
this._initialModelSet = false;
|
|
3558
3671
|
this.focused = true;
|
|
3672
|
+
this.canSaveOrCancel = false;
|
|
3673
|
+
if (this._hasOnPushCdStrategy) {
|
|
3674
|
+
this.markForCheck();
|
|
3675
|
+
}
|
|
3559
3676
|
this.focus.next();
|
|
3560
3677
|
};
|
|
3561
|
-
BaseInputComponent.prototype.doBlur = function () {
|
|
3562
|
-
|
|
3563
|
-
|
|
3678
|
+
BaseInputComponent.prototype.doBlur = function (event) {
|
|
3679
|
+
var _this = this;
|
|
3680
|
+
setTimeout(function () {
|
|
3681
|
+
if (_this.keepFocus) {
|
|
3682
|
+
if (event) {
|
|
3683
|
+
event.preventDefault;
|
|
3684
|
+
}
|
|
3685
|
+
return false;
|
|
3686
|
+
}
|
|
3687
|
+
_this.focused = false;
|
|
3688
|
+
if (_this._hasOnPushCdStrategy) {
|
|
3689
|
+
_this.markForCheck();
|
|
3690
|
+
}
|
|
3691
|
+
if (_this.input) {
|
|
3692
|
+
_this.input.blur();
|
|
3693
|
+
}
|
|
3694
|
+
_this.blur.next();
|
|
3695
|
+
}, 200);
|
|
3564
3696
|
};
|
|
3565
3697
|
BaseInputComponent.prototype.detectChanges = function () {
|
|
3566
3698
|
if (!this._destroyed) {
|
|
@@ -3671,6 +3803,16 @@
|
|
|
3671
3803
|
this.control.updateValueAndValidity();
|
|
3672
3804
|
}
|
|
3673
3805
|
};
|
|
3806
|
+
BaseInputComponent.prototype._commitFinished = function () {
|
|
3807
|
+
var _this = this;
|
|
3808
|
+
return new Promise(function (resolve) {
|
|
3809
|
+
_this.commitFinished = true;
|
|
3810
|
+
setTimeout(function () {
|
|
3811
|
+
_this.committing = false;
|
|
3812
|
+
resolve();
|
|
3813
|
+
}, 800);
|
|
3814
|
+
});
|
|
3815
|
+
};
|
|
3674
3816
|
BaseInputComponent.prototype._clearErrorComponent = function () {
|
|
3675
3817
|
if (this.validationErrorContainer) {
|
|
3676
3818
|
this.validationErrorContainer.clear();
|
|
@@ -3678,9 +3820,6 @@
|
|
|
3678
3820
|
this._errorValidationComponent.destroy();
|
|
3679
3821
|
this._errorValidationComponent = undefined;
|
|
3680
3822
|
}
|
|
3681
|
-
if (this.elementRef && this.elementRef.nativeElement) {
|
|
3682
|
-
this.intersectionObserver.unobserve(this.elementRef.nativeElement);
|
|
3683
|
-
}
|
|
3684
3823
|
}
|
|
3685
3824
|
};
|
|
3686
3825
|
// whether this.ngModel.control has safe access
|
|
@@ -3748,8 +3887,8 @@
|
|
|
3748
3887
|
//try to find input element
|
|
3749
3888
|
this.input = this._findInputNode(this.elementRef.nativeElement.children);
|
|
3750
3889
|
if (this.input) {
|
|
3751
|
-
this.input.addEventListener('blur', function () { return _this.doBlur(); });
|
|
3752
|
-
this.input.addEventListener('focus', function () { return _this.doFocus(); });
|
|
3890
|
+
this.input.addEventListener('blur', function (event) { return _this.doBlur(event); });
|
|
3891
|
+
this.input.addEventListener('focus', function (event) { return _this.doFocus(event); });
|
|
3753
3892
|
}
|
|
3754
3893
|
}
|
|
3755
3894
|
};
|
|
@@ -3764,10 +3903,80 @@
|
|
|
3764
3903
|
}
|
|
3765
3904
|
}
|
|
3766
3905
|
};
|
|
3767
|
-
BaseInputComponent.prototype.
|
|
3768
|
-
if (this.
|
|
3769
|
-
|
|
3770
|
-
this._errorValidationComponent.instance.
|
|
3906
|
+
BaseInputComponent.prototype._positionValidationError = function () {
|
|
3907
|
+
if (this.elementRef && this.elementRef.nativeElement && this._errorValidationComponent) {
|
|
3908
|
+
var clientRect = this.elementRef.nativeElement.getBoundingClientRect();
|
|
3909
|
+
this._errorValidationComponent.instance.top = clientRect.bottom;
|
|
3910
|
+
this._errorValidationComponent.instance.left = clientRect.left;
|
|
3911
|
+
}
|
|
3912
|
+
};
|
|
3913
|
+
BaseInputComponent.prototype._handleKeyDown = function (event) {
|
|
3914
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3915
|
+
var _a, nextSiblingToFocus, success;
|
|
3916
|
+
return __generator(this, function (_b) {
|
|
3917
|
+
switch (_b.label) {
|
|
3918
|
+
case 0:
|
|
3919
|
+
_a = event.code;
|
|
3920
|
+
switch (_a) {
|
|
3921
|
+
case 'Enter': return [3 /*break*/, 1];
|
|
3922
|
+
case 'Tab': return [3 /*break*/, 3];
|
|
3923
|
+
case 'Escape': return [3 /*break*/, 5];
|
|
3924
|
+
}
|
|
3925
|
+
return [3 /*break*/, 6];
|
|
3926
|
+
case 1:
|
|
3927
|
+
event.preventDefault();
|
|
3928
|
+
return [4 /*yield*/, this.commitClick()];
|
|
3929
|
+
case 2:
|
|
3930
|
+
_b.sent();
|
|
3931
|
+
return [2 /*return*/, false];
|
|
3932
|
+
case 3:
|
|
3933
|
+
nextSiblingToFocus = event.shiftKey ? event.currentTarget.previousSibling : event.currentTarget.nextSibling;
|
|
3934
|
+
event.preventDefault();
|
|
3935
|
+
return [4 /*yield*/, this.commitClick()];
|
|
3936
|
+
case 4:
|
|
3937
|
+
success = _b.sent();
|
|
3938
|
+
if (success) {
|
|
3939
|
+
if (nextSiblingToFocus) {
|
|
3940
|
+
try {
|
|
3941
|
+
this._setFocusOnNextPossibleInput(nextSiblingToFocus, event.shiftKey);
|
|
3942
|
+
}
|
|
3943
|
+
catch (e) {
|
|
3944
|
+
}
|
|
3945
|
+
}
|
|
3946
|
+
}
|
|
3947
|
+
return [2 /*return*/, false];
|
|
3948
|
+
case 5:
|
|
3949
|
+
this.cancelClick();
|
|
3950
|
+
event.preventDefault();
|
|
3951
|
+
return [2 /*return*/, false];
|
|
3952
|
+
case 6: return [2 /*return*/];
|
|
3953
|
+
}
|
|
3954
|
+
});
|
|
3955
|
+
});
|
|
3956
|
+
};
|
|
3957
|
+
BaseInputComponent.prototype._createNewFocusEvent = function (element) {
|
|
3958
|
+
var eventType = "onfocusin" in element ? "focusin" : "focus", bubbles = "onfocusin" in element, focusEvent;
|
|
3959
|
+
if ("createEvent" in document) {
|
|
3960
|
+
focusEvent = document.createEvent("Event");
|
|
3961
|
+
focusEvent.initEvent(eventType, bubbles, true);
|
|
3962
|
+
}
|
|
3963
|
+
else if ("Event" in window) {
|
|
3964
|
+
focusEvent = new Event(eventType, { bubbles: bubbles, cancelable: true });
|
|
3965
|
+
}
|
|
3966
|
+
return focusEvent;
|
|
3967
|
+
};
|
|
3968
|
+
BaseInputComponent.prototype._setFocusOnNextPossibleInput = function (element, previous) {
|
|
3969
|
+
var elementColl = element.getElementsByTagName('input');
|
|
3970
|
+
if (elementColl && elementColl.length > 0) {
|
|
3971
|
+
var inputElement = elementColl[0];
|
|
3972
|
+
if (inputElement.disabled || inputElement.readOnly) {
|
|
3973
|
+
this._setFocusOnNextPossibleInput(previous ? element.previousSibling : element.nextSibling, previous);
|
|
3974
|
+
}
|
|
3975
|
+
else {
|
|
3976
|
+
var focusEvent = this._createNewFocusEvent(element);
|
|
3977
|
+
inputElement.focus();
|
|
3978
|
+
inputElement.dispatchEvent(focusEvent);
|
|
3979
|
+
}
|
|
3771
3980
|
}
|
|
3772
3981
|
};
|
|
3773
3982
|
return BaseInputComponent;
|
|
@@ -3788,6 +3997,7 @@
|
|
|
3788
3997
|
BaseInputComponent.propDecorators = {
|
|
3789
3998
|
validationErrorContainer: [{ type: core.ViewChild, args: ["validationError", { read: core.ViewContainerRef },] }],
|
|
3790
3999
|
_ngModel: [{ type: core.ViewChild, args: [forms.NgModel, { static: true },] }],
|
|
4000
|
+
showSaveCancel: [{ type: core.Input }],
|
|
3791
4001
|
model: [{ type: core.Input }],
|
|
3792
4002
|
label: [{ type: core.Input }],
|
|
3793
4003
|
noValidation: [{ type: core.Input }],
|
|
@@ -3836,7 +4046,10 @@
|
|
|
3836
4046
|
valid: [{ type: core.HostBinding, args: ["class.valid",] }],
|
|
3837
4047
|
validationDisabled: [{ type: core.HostBinding, args: ["class.no-validation",] }],
|
|
3838
4048
|
onClick: [{ type: core.HostListener, args: ["click", ["$event"],] }],
|
|
3839
|
-
onFocusIn: [{ type: core.HostListener, args: ["focusin",] }]
|
|
4049
|
+
onFocusIn: [{ type: core.HostListener, args: ["focusin",] }],
|
|
4050
|
+
handleDocumentScroll: [{ type: core.HostListener, args: ["document:scroll",] }],
|
|
4051
|
+
handleWindowResize: [{ type: core.HostListener, args: ["window:resize",] }],
|
|
4052
|
+
handleKeyDown: [{ type: core.HostListener, args: ["keydown", ["$event"],] }]
|
|
3840
4053
|
};
|
|
3841
4054
|
__decorate([
|
|
3842
4055
|
InputBoolean()
|
|
@@ -3991,6 +4204,7 @@
|
|
|
3991
4204
|
function FormComponent(_formMaster) {
|
|
3992
4205
|
this._formMaster = _formMaster;
|
|
3993
4206
|
this.onChange = new core.EventEmitter();
|
|
4207
|
+
this.showClass = true;
|
|
3994
4208
|
this.submitted = false;
|
|
3995
4209
|
// Emits true after every valid submit.
|
|
3996
4210
|
this.validSubmit = new core.EventEmitter();
|
|
@@ -4075,19 +4289,20 @@
|
|
|
4075
4289
|
FormComponent.prototype.isValid = function () {
|
|
4076
4290
|
return this._init && this.formGroup.valid;
|
|
4077
4291
|
};
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4292
|
+
// @HostListener('keyup.enter', ['$event'])
|
|
4293
|
+
// onEnterKey(event: KeyboardEvent): void {
|
|
4294
|
+
// const target: HTMLElement = <HTMLElement>event.target;
|
|
4295
|
+
// if (['TEXTAREA', 'SELECT'].indexOf(target.tagName) !== -1) {
|
|
4296
|
+
// return;
|
|
4297
|
+
// }
|
|
4298
|
+
// if (target.isContentEditable) {
|
|
4299
|
+
// return;
|
|
4300
|
+
// }
|
|
4301
|
+
// if (target.tagName === 'BUTTON-COLIJN' && target.getAttribute('type') === 'submit') {
|
|
4302
|
+
// return;
|
|
4303
|
+
// }
|
|
4304
|
+
// this.submit();
|
|
4305
|
+
// }
|
|
4091
4306
|
FormComponent.prototype.reset = function () {
|
|
4092
4307
|
this.submitted = false;
|
|
4093
4308
|
this.formGroup.markAsUntouched();
|
|
@@ -4143,7 +4358,8 @@
|
|
|
4143
4358
|
FormComponent.decorators = [
|
|
4144
4359
|
{ type: core.Component, args: [{
|
|
4145
4360
|
selector: "co-form",
|
|
4146
|
-
template: "<ng-content></ng-content
|
|
4361
|
+
template: "\n <ng-content></ng-content>\n ",
|
|
4362
|
+
encapsulation: core.ViewEncapsulation.None
|
|
4147
4363
|
},] }
|
|
4148
4364
|
];
|
|
4149
4365
|
FormComponent.ctorParameters = function () { return [
|
|
@@ -4153,13 +4369,13 @@
|
|
|
4153
4369
|
readonly: [{ type: core.Input }],
|
|
4154
4370
|
keepInView: [{ type: core.Input }],
|
|
4155
4371
|
onChange: [{ type: core.Output }],
|
|
4372
|
+
showClass: [{ type: core.HostBinding, args: ["class.co-form",] }],
|
|
4156
4373
|
submitted: [{ type: core.HostBinding, args: ["class.submitted",] }],
|
|
4157
4374
|
validSubmit: [{ type: core.Output }],
|
|
4158
4375
|
anySubmit: [{ type: core.Output }],
|
|
4159
4376
|
validityChange: [{ type: core.Output }],
|
|
4160
4377
|
readonlyChange: [{ type: core.Output }],
|
|
4161
|
-
invalidSubmit: [{ type: core.Output }]
|
|
4162
|
-
onEnterKey: [{ type: core.HostListener, args: ['keyup.enter', ['$event'],] }]
|
|
4378
|
+
invalidSubmit: [{ type: core.Output }]
|
|
4163
4379
|
};
|
|
4164
4380
|
|
|
4165
4381
|
var DropDownListComponent = /** @class */ (function (_super) {
|
|
@@ -4199,6 +4415,9 @@
|
|
|
4199
4415
|
{
|
|
4200
4416
|
provide: COMPONENT_INTERFACE_NAME,
|
|
4201
4417
|
useExisting: core.forwardRef(function () { return DropDownListComponent; })
|
|
4418
|
+
}, {
|
|
4419
|
+
provide: BaseInputComponent,
|
|
4420
|
+
useExisting: DropDownListComponent
|
|
4202
4421
|
}
|
|
4203
4422
|
],
|
|
4204
4423
|
encapsulation: core.ViewEncapsulation.None
|
|
@@ -4273,7 +4492,8 @@
|
|
|
4273
4492
|
})(GridLines || (GridLines = {}));
|
|
4274
4493
|
|
|
4275
4494
|
var BaseGridComponent = /** @class */ (function () {
|
|
4276
|
-
function BaseGridComponent() {
|
|
4495
|
+
function BaseGridComponent(element) {
|
|
4496
|
+
this.element = element;
|
|
4277
4497
|
this.gridLines = GridLines.None;
|
|
4278
4498
|
this.contextMenuItems = [];
|
|
4279
4499
|
this.sortingEnabled = false;
|
|
@@ -4310,6 +4530,9 @@
|
|
|
4310
4530
|
BaseGridComponent.decorators = [
|
|
4311
4531
|
{ type: core.Directive }
|
|
4312
4532
|
];
|
|
4533
|
+
BaseGridComponent.ctorParameters = function () { return [
|
|
4534
|
+
{ type: core.ElementRef }
|
|
4535
|
+
]; };
|
|
4313
4536
|
BaseGridComponent.propDecorators = {
|
|
4314
4537
|
grid: [{ type: core.ViewChild, args: ['grid', { static: false },] }],
|
|
4315
4538
|
data: [{ type: core.Input }],
|
|
@@ -4448,6 +4671,10 @@
|
|
|
4448
4671
|
function BaseInlineEditGridComponent() {
|
|
4449
4672
|
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
4450
4673
|
_this.rowSaved = new core.EventEmitter();
|
|
4674
|
+
_this.beforeRowDelete = new core.EventEmitter(false);
|
|
4675
|
+
_this.rowDeleted = new core.EventEmitter();
|
|
4676
|
+
_this.actionBeginObservable$ = new rxjs.Observable();
|
|
4677
|
+
_this.actionBeginObservableSub = new rxjs.Subscription();
|
|
4451
4678
|
return _this;
|
|
4452
4679
|
}
|
|
4453
4680
|
Object.defineProperty(BaseInlineEditGridComponent.prototype, "inlineEdit", {
|
|
@@ -4467,13 +4694,61 @@
|
|
|
4467
4694
|
enumerable: false,
|
|
4468
4695
|
configurable: true
|
|
4469
4696
|
});
|
|
4697
|
+
BaseInlineEditGridComponent.prototype.ngAfterViewInit = function () {
|
|
4698
|
+
var _this = this;
|
|
4699
|
+
if (this.grid) {
|
|
4700
|
+
this.actionBeginObservable$ = fromEvent.fromEvent(this.grid, 'actionBegin');
|
|
4701
|
+
this.actionBeginObservableSub = this.actionBeginObservable$.subscribe(function (action) {
|
|
4702
|
+
_this.handleActionBegin(action);
|
|
4703
|
+
});
|
|
4704
|
+
}
|
|
4705
|
+
};
|
|
4706
|
+
BaseInlineEditGridComponent.prototype.ngOnDestroy = function () {
|
|
4707
|
+
this.actionBeginObservableSub.unsubscribe();
|
|
4708
|
+
};
|
|
4709
|
+
BaseInlineEditGridComponent.prototype.handleActionBegin = function (action) {
|
|
4710
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4711
|
+
return __generator(this, function (_a) {
|
|
4712
|
+
switch (_a.label) {
|
|
4713
|
+
case 0:
|
|
4714
|
+
if (!action) return [3 /*break*/, 3];
|
|
4715
|
+
if (!(action.requestType === "delete")) return [3 /*break*/, 2];
|
|
4716
|
+
return [4 /*yield*/, this.waitForBeforeDelete(action)];
|
|
4717
|
+
case 1:
|
|
4718
|
+
_a.sent();
|
|
4719
|
+
_a.label = 2;
|
|
4720
|
+
case 2:
|
|
4721
|
+
if (action.requestType === "save") {
|
|
4722
|
+
this.rowSaved.next(action.data);
|
|
4723
|
+
}
|
|
4724
|
+
_a.label = 3;
|
|
4725
|
+
case 3: return [2 /*return*/];
|
|
4726
|
+
}
|
|
4727
|
+
});
|
|
4728
|
+
});
|
|
4729
|
+
};
|
|
4470
4730
|
BaseInlineEditGridComponent.prototype.handleActionComplete = function (action) {
|
|
4471
4731
|
if (action) {
|
|
4732
|
+
if (action.requestType === "delete") {
|
|
4733
|
+
this.rowDeleted.next(action.data);
|
|
4734
|
+
}
|
|
4472
4735
|
if (action.requestType === "save") {
|
|
4473
4736
|
this.rowSaved.next(action.data);
|
|
4474
4737
|
}
|
|
4475
4738
|
}
|
|
4476
4739
|
};
|
|
4740
|
+
BaseInlineEditGridComponent.prototype.waitForBeforeDelete = function (action) {
|
|
4741
|
+
var _this = this;
|
|
4742
|
+
// @ts-ignore
|
|
4743
|
+
var beforeRowDelete$ = fromEvent.fromEvent(this.element, 'beforeRowDelete');
|
|
4744
|
+
return new Promise(function (resolve) {
|
|
4745
|
+
beforeRowDelete$.subscribe(function (result) {
|
|
4746
|
+
action = result;
|
|
4747
|
+
return resolve(action);
|
|
4748
|
+
}).unsubscribe();
|
|
4749
|
+
_this.beforeRowDelete.next(action);
|
|
4750
|
+
});
|
|
4751
|
+
};
|
|
4477
4752
|
return BaseInlineEditGridComponent;
|
|
4478
4753
|
}(BaseToolbarGridComponent));
|
|
4479
4754
|
BaseInlineEditGridComponent.decorators = [
|
|
@@ -4481,7 +4756,9 @@
|
|
|
4481
4756
|
];
|
|
4482
4757
|
BaseInlineEditGridComponent.propDecorators = {
|
|
4483
4758
|
inlineEdit: [{ type: core.Input }],
|
|
4484
|
-
rowSaved: [{ type: core.Output }]
|
|
4759
|
+
rowSaved: [{ type: core.Output }],
|
|
4760
|
+
beforeRowDelete: [{ type: core.Output }],
|
|
4761
|
+
rowDeleted: [{ type: core.Output }]
|
|
4485
4762
|
};
|
|
4486
4763
|
__decorate([
|
|
4487
4764
|
InputBoolean()
|
|
@@ -4499,6 +4776,8 @@
|
|
|
4499
4776
|
_this.contextMenuItemClick = new core.EventEmitter();
|
|
4500
4777
|
_this.rowDragStartEvent = new core.EventEmitter();
|
|
4501
4778
|
_this.rowDropEvent = new core.EventEmitter();
|
|
4779
|
+
_this.beforeRowsDelete = new core.EventEmitter();
|
|
4780
|
+
_this.rowsDeleted = new core.EventEmitter();
|
|
4502
4781
|
_this.selectionOptions = { type: "Single" };
|
|
4503
4782
|
return _this;
|
|
4504
4783
|
}
|
|
@@ -4550,6 +4829,12 @@
|
|
|
4550
4829
|
BaseSelectionGridComponent.prototype.rowDropClick = function (args) {
|
|
4551
4830
|
this.rowDropEvent.next(args);
|
|
4552
4831
|
};
|
|
4832
|
+
BaseSelectionGridComponent.prototype.handleBeforeBatchDelete = function (args) {
|
|
4833
|
+
this.beforeRowsDelete.next(args);
|
|
4834
|
+
};
|
|
4835
|
+
BaseSelectionGridComponent.prototype.handleBatchDelete = function (rows) {
|
|
4836
|
+
this.rowsDeleted.next(rows);
|
|
4837
|
+
};
|
|
4553
4838
|
return BaseSelectionGridComponent;
|
|
4554
4839
|
}(BaseInlineEditGridComponent));
|
|
4555
4840
|
BaseSelectionGridComponent.decorators = [
|
|
@@ -4564,7 +4849,9 @@
|
|
|
4564
4849
|
detailColumnClick: [{ type: core.Output }],
|
|
4565
4850
|
contextMenuItemClick: [{ type: core.Output }],
|
|
4566
4851
|
rowDragStartEvent: [{ type: core.Output }],
|
|
4567
|
-
rowDropEvent: [{ type: core.Output }]
|
|
4852
|
+
rowDropEvent: [{ type: core.Output }],
|
|
4853
|
+
beforeRowsDelete: [{ type: core.Output }],
|
|
4854
|
+
rowsDeleted: [{ type: core.Output }]
|
|
4568
4855
|
};
|
|
4569
4856
|
__decorate([
|
|
4570
4857
|
InputBoolean()
|
|
@@ -4589,7 +4876,7 @@
|
|
|
4589
4876
|
CoGridComponent.decorators = [
|
|
4590
4877
|
{ type: core.Component, args: [{
|
|
4591
4878
|
selector: 'co-grid',
|
|
4592
|
-
template: "\n
|
|
4879
|
+
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 (beforeBatchDelete)=\"handleBeforeBatchDelete($event)\"\n (batchDelete)=\"handleBatchDelete($event)\"\n >\n </ejs-grid>\n ",
|
|
4593
4880
|
providers: [
|
|
4594
4881
|
ej2AngularGrids.RowDDService
|
|
4595
4882
|
],
|
|
@@ -4600,6 +4887,59 @@
|
|
|
4600
4887
|
showClass: [{ type: core.HostBinding, args: ['class.co-grid',] }]
|
|
4601
4888
|
};
|
|
4602
4889
|
|
|
4890
|
+
var GridToolbarComponent = /** @class */ (function () {
|
|
4891
|
+
function GridToolbarComponent(iconsService) {
|
|
4892
|
+
this.iconsService = iconsService;
|
|
4893
|
+
this.icons = exports.CoreComponentsIcon;
|
|
4894
|
+
this.editClick = new core.EventEmitter();
|
|
4895
|
+
this.cancelClick = new core.EventEmitter();
|
|
4896
|
+
this.saveClick = new core.EventEmitter();
|
|
4897
|
+
this.addClick = new core.EventEmitter();
|
|
4898
|
+
}
|
|
4899
|
+
GridToolbarComponent.prototype.showClass = function () {
|
|
4900
|
+
return true;
|
|
4901
|
+
};
|
|
4902
|
+
return GridToolbarComponent;
|
|
4903
|
+
}());
|
|
4904
|
+
GridToolbarComponent.decorators = [
|
|
4905
|
+
{ type: core.Component, args: [{
|
|
4906
|
+
selector: "co-grid-toolbar",
|
|
4907
|
+
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 ",
|
|
4908
|
+
encapsulation: core.ViewEncapsulation.None
|
|
4909
|
+
},] }
|
|
4910
|
+
];
|
|
4911
|
+
GridToolbarComponent.ctorParameters = function () { return [
|
|
4912
|
+
{ type: IconCacheService }
|
|
4913
|
+
]; };
|
|
4914
|
+
GridToolbarComponent.propDecorators = {
|
|
4915
|
+
editClick: [{ type: core.Output }],
|
|
4916
|
+
cancelClick: [{ type: core.Output }],
|
|
4917
|
+
saveClick: [{ type: core.Output }],
|
|
4918
|
+
addClick: [{ type: core.Output }],
|
|
4919
|
+
showClass: [{ type: core.HostBinding, args: ["class.co-grid-toolbar",] }]
|
|
4920
|
+
};
|
|
4921
|
+
|
|
4922
|
+
ej2Base.enableRipple(true);
|
|
4923
|
+
var GridToolbarModule = /** @class */ (function () {
|
|
4924
|
+
function GridToolbarModule() {
|
|
4925
|
+
}
|
|
4926
|
+
return GridToolbarModule;
|
|
4927
|
+
}());
|
|
4928
|
+
GridToolbarModule.decorators = [
|
|
4929
|
+
{ type: core.NgModule, args: [{
|
|
4930
|
+
imports: [
|
|
4931
|
+
IconModule,
|
|
4932
|
+
ButtonModule
|
|
4933
|
+
],
|
|
4934
|
+
declarations: [
|
|
4935
|
+
GridToolbarComponent
|
|
4936
|
+
],
|
|
4937
|
+
exports: [
|
|
4938
|
+
GridToolbarComponent
|
|
4939
|
+
]
|
|
4940
|
+
},] }
|
|
4941
|
+
];
|
|
4942
|
+
|
|
4603
4943
|
var CoGridModule = /** @class */ (function () {
|
|
4604
4944
|
function CoGridModule() {
|
|
4605
4945
|
}
|
|
@@ -4610,7 +4950,8 @@
|
|
|
4610
4950
|
imports: [
|
|
4611
4951
|
common.CommonModule,
|
|
4612
4952
|
forms.FormsModule,
|
|
4613
|
-
ej2AngularGrids.GridModule
|
|
4953
|
+
ej2AngularGrids.GridModule,
|
|
4954
|
+
GridToolbarModule
|
|
4614
4955
|
],
|
|
4615
4956
|
declarations: [CoGridComponent],
|
|
4616
4957
|
exports: [CoGridComponent],
|
|
@@ -4668,6 +5009,9 @@
|
|
|
4668
5009
|
providers: [{
|
|
4669
5010
|
provide: COMPONENT_INTERFACE_NAME,
|
|
4670
5011
|
useExisting: core.forwardRef(function () { return InputCheckboxComponent; })
|
|
5012
|
+
}, {
|
|
5013
|
+
provide: BaseInputComponent,
|
|
5014
|
+
useExisting: InputCheckboxComponent
|
|
4671
5015
|
}],
|
|
4672
5016
|
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
4673
5017
|
encapsulation: core.ViewEncapsulation.None
|
|
@@ -4769,6 +5113,9 @@
|
|
|
4769
5113
|
providers: [{
|
|
4770
5114
|
provide: COMPONENT_INTERFACE_NAME,
|
|
4771
5115
|
useExisting: core.forwardRef(function () { return InputCheckboxMultiSelectComponent; })
|
|
5116
|
+
}, {
|
|
5117
|
+
provide: BaseInputComponent,
|
|
5118
|
+
useExisting: InputCheckboxMultiSelectComponent
|
|
4772
5119
|
}],
|
|
4773
5120
|
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
4774
5121
|
encapsulation: core.ViewEncapsulation.None
|
|
@@ -4822,7 +5169,6 @@
|
|
|
4822
5169
|
_this.ngZoneWrapper = ngZoneWrapper;
|
|
4823
5170
|
_this.elementRef = elementRef;
|
|
4824
5171
|
_this.shopPopup = true;
|
|
4825
|
-
_this.customHeight = true;
|
|
4826
5172
|
_super.prototype._markAsOnPush.call(_this);
|
|
4827
5173
|
return _this;
|
|
4828
5174
|
}
|
|
@@ -4843,6 +5189,9 @@
|
|
|
4843
5189
|
providers: [{
|
|
4844
5190
|
provide: COMPONENT_INTERFACE_NAME,
|
|
4845
5191
|
useExisting: core.forwardRef(function () { return InputComboBoxComponent; })
|
|
5192
|
+
}, {
|
|
5193
|
+
provide: BaseInputComponent,
|
|
5194
|
+
useExisting: InputComboBoxComponent
|
|
4846
5195
|
}],
|
|
4847
5196
|
encapsulation: core.ViewEncapsulation.None
|
|
4848
5197
|
},] }
|
|
@@ -4862,8 +5211,7 @@
|
|
|
4862
5211
|
selected: [{ type: core.Input }],
|
|
4863
5212
|
placeholder: [{ type: core.Input }],
|
|
4864
5213
|
shopPopup: [{ type: core.Input }],
|
|
4865
|
-
showClass: [{ type: core.HostBinding, args: ["class.co-input-combo-box",] }]
|
|
4866
|
-
customHeight: [{ type: core.HostBinding, args: ["class.custom-height",] }]
|
|
5214
|
+
showClass: [{ type: core.HostBinding, args: ["class.co-input-combo-box",] }]
|
|
4867
5215
|
};
|
|
4868
5216
|
|
|
4869
5217
|
var InputComboBoxModule = /** @class */ (function () {
|
|
@@ -4945,6 +5293,9 @@
|
|
|
4945
5293
|
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 ",
|
|
4946
5294
|
providers: [{
|
|
4947
5295
|
provide: COMPONENT_INTERFACE_NAME, useExisting: core.forwardRef(function () { return InputDatePickerComponent; })
|
|
5296
|
+
}, {
|
|
5297
|
+
provide: BaseInputComponent,
|
|
5298
|
+
useExisting: InputDatePickerComponent
|
|
4948
5299
|
}],
|
|
4949
5300
|
encapsulation: core.ViewEncapsulation.None
|
|
4950
5301
|
},] }
|
|
@@ -5287,6 +5638,7 @@
|
|
|
5287
5638
|
KeyboardCode.Down,
|
|
5288
5639
|
KeyboardCode.Up,
|
|
5289
5640
|
KeyboardCode.Tab,
|
|
5641
|
+
KeyboardCode.Enter,
|
|
5290
5642
|
KeyboardCode.Home,
|
|
5291
5643
|
KeyboardCode.End,
|
|
5292
5644
|
KeyboardCode.Delete,
|
|
@@ -5322,73 +5674,22 @@
|
|
|
5322
5674
|
KeyboardCode.NumpadNine
|
|
5323
5675
|
];
|
|
5324
5676
|
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
|
|
5677
|
+
// Input values for 'buttonShowMode' of NumberPickerComponent.
|
|
5678
|
+
var InputNumberPickerButtonShowMode;
|
|
5679
|
+
(function (InputNumberPickerButtonShowMode) {
|
|
5680
|
+
InputNumberPickerButtonShowMode["Always"] = "always";
|
|
5681
|
+
InputNumberPickerButtonShowMode["OnFocusOnly"] = "onFocusOnly";
|
|
5682
|
+
InputNumberPickerButtonShowMode["Never"] = "never";
|
|
5683
|
+
})(InputNumberPickerButtonShowMode || (InputNumberPickerButtonShowMode = {}));
|
|
5684
|
+
|
|
5685
|
+
// A component that lets users pick a number by increasing and decreasing it with buttons, or by typing.
|
|
5686
|
+
var InputNumberPickerComponent = /** @class */ (function (_super) {
|
|
5687
|
+
__extends(InputNumberPickerComponent, _super);
|
|
5688
|
+
function InputNumberPickerComponent(formComponent, iconCacheService, _ngZone, componentFactoryResolver, changeDetector, formUserChangeListener) {
|
|
5689
|
+
var _this = _super.call(this, changeDetector, componentFactoryResolver, formUserChangeListener) || this;
|
|
5329
5690
|
_this.formComponent = formComponent;
|
|
5330
|
-
_this.
|
|
5331
|
-
_this.
|
|
5332
|
-
_this.formUserChangeListener = formUserChangeListener;
|
|
5333
|
-
_this.ngZoneWrapper = ngZoneWrapper;
|
|
5334
|
-
_this.elementRef = elementRef;
|
|
5335
|
-
_this.Icons = exports.CoreComponentsIcon;
|
|
5336
|
-
_this.placeholder = "";
|
|
5337
|
-
_this.type = "text";
|
|
5338
|
-
_this.showClearButton = undefined;
|
|
5339
|
-
_this.hasOwnLabel = true;
|
|
5340
|
-
_super.prototype._markAsOnPush.call(_this);
|
|
5341
|
-
return _this;
|
|
5342
|
-
}
|
|
5343
|
-
InputTextComponent.prototype.showClass = function () {
|
|
5344
|
-
return true;
|
|
5345
|
-
};
|
|
5346
|
-
return InputTextComponent;
|
|
5347
|
-
}(BaseInputComponent));
|
|
5348
|
-
InputTextComponent.decorators = [
|
|
5349
|
-
{ type: core.Component, args: [{
|
|
5350
|
-
selector: "co-input-text",
|
|
5351
|
-
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 class=\"required-indicator\"></div>\n <ng-template #validationError></ng-template>\n ",
|
|
5352
|
-
providers: [{
|
|
5353
|
-
provide: COMPONENT_INTERFACE_NAME,
|
|
5354
|
-
useExisting: core.forwardRef(function () { return InputTextComponent; })
|
|
5355
|
-
}],
|
|
5356
|
-
encapsulation: core.ViewEncapsulation.None
|
|
5357
|
-
},] }
|
|
5358
|
-
];
|
|
5359
|
-
InputTextComponent.ctorParameters = function () { return [
|
|
5360
|
-
{ type: FormComponent, decorators: [{ type: core.Optional }] },
|
|
5361
|
-
{ type: core.ChangeDetectorRef },
|
|
5362
|
-
{ type: core.ComponentFactoryResolver },
|
|
5363
|
-
{ type: FormInputUserModelChangeListenerService },
|
|
5364
|
-
{ type: NgZoneWrapperService },
|
|
5365
|
-
{ type: core.ElementRef }
|
|
5366
|
-
]; };
|
|
5367
|
-
InputTextComponent.propDecorators = {
|
|
5368
|
-
placeholder: [{ type: core.Input }],
|
|
5369
|
-
type: [{ type: core.Input }],
|
|
5370
|
-
showClearButton: [{ type: core.Input }],
|
|
5371
|
-
keyDownWhiteList: [{ type: core.Input }],
|
|
5372
|
-
showClass: [{ type: core.HostBinding, args: ["class.co-input-text",] }],
|
|
5373
|
-
hasOwnLabel: [{ type: core.HostBinding, args: ["class.has-own-label",] }]
|
|
5374
|
-
};
|
|
5375
|
-
|
|
5376
|
-
// Input values for 'buttonShowMode' of NumberPickerComponent.
|
|
5377
|
-
var InputNumberPickerButtonShowMode;
|
|
5378
|
-
(function (InputNumberPickerButtonShowMode) {
|
|
5379
|
-
InputNumberPickerButtonShowMode["Always"] = "always";
|
|
5380
|
-
InputNumberPickerButtonShowMode["OnFocusOnly"] = "onFocusOnly";
|
|
5381
|
-
InputNumberPickerButtonShowMode["Never"] = "never";
|
|
5382
|
-
})(InputNumberPickerButtonShowMode || (InputNumberPickerButtonShowMode = {}));
|
|
5383
|
-
|
|
5384
|
-
// A component that lets users pick a number by increasing and decreasing it with buttons, or by typing.
|
|
5385
|
-
var InputNumberPickerComponent = /** @class */ (function (_super) {
|
|
5386
|
-
__extends(InputNumberPickerComponent, _super);
|
|
5387
|
-
function InputNumberPickerComponent(formComponent, iconCacheService, _ngZone, componentFactoryResolver, changeDetector, formUserChangeListener) {
|
|
5388
|
-
var _this = _super.call(this, changeDetector, componentFactoryResolver, formUserChangeListener) || this;
|
|
5389
|
-
_this.formComponent = formComponent;
|
|
5390
|
-
_this.iconCacheService = iconCacheService;
|
|
5391
|
-
_this._ngZone = _ngZone;
|
|
5691
|
+
_this.iconCacheService = iconCacheService;
|
|
5692
|
+
_this._ngZone = _ngZone;
|
|
5392
5693
|
_this.componentFactoryResolver = componentFactoryResolver;
|
|
5393
5694
|
_this.minusIcon = exports.CoreComponentsIcon.MinusSimple;
|
|
5394
5695
|
_this.plusIcon = exports.CoreComponentsIcon.PlusSimple;
|
|
@@ -5414,8 +5715,8 @@
|
|
|
5414
5715
|
_this._stepFactor = _this._stepFactors[0];
|
|
5415
5716
|
_this._mayAutoCount = false;
|
|
5416
5717
|
_this._numberLogicValueChangeSub = _this.numberLogic.valueChange.subscribe(function (value) {
|
|
5417
|
-
_this.inputTextComp.model = "" + value; // faster than this.detectChanges() just for that input
|
|
5418
5718
|
if (!_this._mayAutoCount) {
|
|
5719
|
+
_this.model = value;
|
|
5419
5720
|
_this.modelChange.emit(value);
|
|
5420
5721
|
// custom form user chagne listener .next because we don't user super.updateModel() which normally does that for us
|
|
5421
5722
|
if (_this._markedAsUserTouched) {
|
|
@@ -5426,18 +5727,17 @@
|
|
|
5426
5727
|
});
|
|
5427
5728
|
return _this;
|
|
5428
5729
|
}
|
|
5429
|
-
Object.defineProperty(InputNumberPickerComponent.prototype, "model", {
|
|
5430
|
-
get: function () {
|
|
5431
|
-
return this.numberLogic.value;
|
|
5432
|
-
},
|
|
5433
|
-
// @override
|
|
5434
|
-
set: function (model) {
|
|
5435
|
-
this.numberLogic.value = model;
|
|
5436
|
-
},
|
|
5437
|
-
enumerable: false,
|
|
5438
|
-
configurable: true
|
|
5439
|
-
});
|
|
5440
5730
|
Object.defineProperty(InputNumberPickerComponent.prototype, "min", {
|
|
5731
|
+
// @override
|
|
5732
|
+
// @Input()
|
|
5733
|
+
// public set model(model: number) {
|
|
5734
|
+
// super.model = model;
|
|
5735
|
+
// this.numberLogic.value = model;
|
|
5736
|
+
// }
|
|
5737
|
+
//
|
|
5738
|
+
// public get model(): number {
|
|
5739
|
+
// return this.numberLogic.value;
|
|
5740
|
+
// }
|
|
5441
5741
|
set: function (min) {
|
|
5442
5742
|
this.numberLogic.min = min;
|
|
5443
5743
|
},
|
|
@@ -5511,6 +5811,11 @@
|
|
|
5511
5811
|
if (this.myKeyDownWhiteList.find(function (k) { return k === event.keyCode; }) === undefined) {
|
|
5512
5812
|
return false;
|
|
5513
5813
|
}
|
|
5814
|
+
_super.prototype.handleKeyDown.call(this, event);
|
|
5815
|
+
};
|
|
5816
|
+
InputNumberPickerComponent.prototype.handleChangeModel = function (value) {
|
|
5817
|
+
console.log(value);
|
|
5818
|
+
this.numberLogic.setValue(value);
|
|
5514
5819
|
};
|
|
5515
5820
|
// Note: recursive through setTimeout().
|
|
5516
5821
|
InputNumberPickerComponent.prototype.doDecrementAuto = function () {
|
|
@@ -5585,17 +5890,6 @@
|
|
|
5585
5890
|
}
|
|
5586
5891
|
}, this._delayBeforeStartAutoCountMs);
|
|
5587
5892
|
};
|
|
5588
|
-
// Possibly show buttons.
|
|
5589
|
-
InputNumberPickerComponent.prototype.onNumberInputFocus = function () {
|
|
5590
|
-
this._numberInputHasFocus = true;
|
|
5591
|
-
this._updateButtonsShowState();
|
|
5592
|
-
};
|
|
5593
|
-
// Value correction point.
|
|
5594
|
-
InputNumberPickerComponent.prototype.onNumberInputBlur = function () {
|
|
5595
|
-
this._numberInputHasFocus = false;
|
|
5596
|
-
this.numberLogic.setValueByUserInputText(this.inputTextComp.model);
|
|
5597
|
-
this._updateButtonsShowState();
|
|
5598
|
-
};
|
|
5599
5893
|
// Note: recursive.
|
|
5600
5894
|
InputNumberPickerComponent.prototype._doIncreaseStepFactor = function () {
|
|
5601
5895
|
var _this = this;
|
|
@@ -5633,9 +5927,12 @@
|
|
|
5633
5927
|
InputNumberPickerComponent.decorators = [
|
|
5634
5928
|
{ type: core.Component, args: [{
|
|
5635
5929
|
selector: 'co-input-number-picker',
|
|
5636
|
-
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]=\"
|
|
5930
|
+
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]=\"model\"\n [readonly]=\"readonly\"\n [disabled]=\"disabled\"\n [required]=\"required\"\n (ngModelChange)=\"handleChangeModel($event)\"\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 ",
|
|
5637
5931
|
providers: [{
|
|
5638
5932
|
provide: COMPONENT_INTERFACE_NAME, useExisting: core.forwardRef(function () { return InputNumberPickerComponent; })
|
|
5933
|
+
}, {
|
|
5934
|
+
provide: BaseInputComponent,
|
|
5935
|
+
useExisting: InputNumberPickerComponent
|
|
5639
5936
|
}],
|
|
5640
5937
|
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
5641
5938
|
encapsulation: core.ViewEncapsulation.None
|
|
@@ -5650,7 +5947,6 @@
|
|
|
5650
5947
|
{ type: FormInputUserModelChangeListenerService }
|
|
5651
5948
|
]; };
|
|
5652
5949
|
InputNumberPickerComponent.propDecorators = {
|
|
5653
|
-
model: [{ type: core.Input }],
|
|
5654
5950
|
min: [{ type: core.Input }],
|
|
5655
5951
|
step: [{ type: core.Input }],
|
|
5656
5952
|
max: [{ type: core.Input }],
|
|
@@ -5661,7 +5957,6 @@
|
|
|
5661
5957
|
noValidation: [{ type: core.Input }],
|
|
5662
5958
|
decimals: [{ type: core.Input }],
|
|
5663
5959
|
modelChange: [{ type: core.Output }],
|
|
5664
|
-
inputTextComp: [{ type: core.ViewChild, args: [InputTextComponent, { static: true },] }],
|
|
5665
5960
|
showButtonsOnFocusOnly: [{ type: core.HostBinding, args: ["class.show-buttons-on-focus-only",] }],
|
|
5666
5961
|
hasLabel: [{ type: core.HostBinding, args: ["class.has-label",] }],
|
|
5667
5962
|
showClass: [{ type: core.HostBinding, args: ['class.co-input-number-picker',] }]
|
|
@@ -5670,6 +5965,60 @@
|
|
|
5670
5965
|
InputBoolean()
|
|
5671
5966
|
], InputNumberPickerComponent.prototype, "noValidation", void 0);
|
|
5672
5967
|
|
|
5968
|
+
var InputTextComponent = /** @class */ (function (_super) {
|
|
5969
|
+
__extends(InputTextComponent, _super);
|
|
5970
|
+
function InputTextComponent(formComponent, changeDetector, componentFactoryResolver, formUserChangeListener, ngZoneWrapper, elementRef) {
|
|
5971
|
+
var _this = _super.call(this, changeDetector, componentFactoryResolver, formUserChangeListener, ngZoneWrapper, elementRef) || this;
|
|
5972
|
+
_this.formComponent = formComponent;
|
|
5973
|
+
_this.changeDetector = changeDetector;
|
|
5974
|
+
_this.componentFactoryResolver = componentFactoryResolver;
|
|
5975
|
+
_this.formUserChangeListener = formUserChangeListener;
|
|
5976
|
+
_this.ngZoneWrapper = ngZoneWrapper;
|
|
5977
|
+
_this.elementRef = elementRef;
|
|
5978
|
+
_this.Icons = exports.CoreComponentsIcon;
|
|
5979
|
+
_this.placeholder = "";
|
|
5980
|
+
_this.type = "text";
|
|
5981
|
+
_this.showClearButton = undefined;
|
|
5982
|
+
_this.hasOwnLabel = true;
|
|
5983
|
+
_super.prototype._markAsOnPush.call(_this);
|
|
5984
|
+
return _this;
|
|
5985
|
+
}
|
|
5986
|
+
InputTextComponent.prototype.showClass = function () {
|
|
5987
|
+
return true;
|
|
5988
|
+
};
|
|
5989
|
+
return InputTextComponent;
|
|
5990
|
+
}(BaseInputComponent));
|
|
5991
|
+
InputTextComponent.decorators = [
|
|
5992
|
+
{ type: core.Component, args: [{
|
|
5993
|
+
selector: "co-input-text",
|
|
5994
|
+
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 <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 ",
|
|
5995
|
+
providers: [{
|
|
5996
|
+
provide: COMPONENT_INTERFACE_NAME,
|
|
5997
|
+
useExisting: core.forwardRef(function () { return InputTextComponent; })
|
|
5998
|
+
}, {
|
|
5999
|
+
provide: BaseInputComponent,
|
|
6000
|
+
useExisting: InputTextComponent
|
|
6001
|
+
}],
|
|
6002
|
+
encapsulation: core.ViewEncapsulation.None
|
|
6003
|
+
},] }
|
|
6004
|
+
];
|
|
6005
|
+
InputTextComponent.ctorParameters = function () { return [
|
|
6006
|
+
{ type: FormComponent, decorators: [{ type: core.Optional }] },
|
|
6007
|
+
{ type: core.ChangeDetectorRef },
|
|
6008
|
+
{ type: core.ComponentFactoryResolver },
|
|
6009
|
+
{ type: FormInputUserModelChangeListenerService },
|
|
6010
|
+
{ type: NgZoneWrapperService },
|
|
6011
|
+
{ type: core.ElementRef }
|
|
6012
|
+
]; };
|
|
6013
|
+
InputTextComponent.propDecorators = {
|
|
6014
|
+
placeholder: [{ type: core.Input }],
|
|
6015
|
+
type: [{ type: core.Input }],
|
|
6016
|
+
showClearButton: [{ type: core.Input }],
|
|
6017
|
+
keyDownWhiteList: [{ type: core.Input }],
|
|
6018
|
+
showClass: [{ type: core.HostBinding, args: ["class.co-input-text",] }],
|
|
6019
|
+
hasOwnLabel: [{ type: core.HostBinding, args: ["class.has-own-label",] }]
|
|
6020
|
+
};
|
|
6021
|
+
|
|
5673
6022
|
var ValidationErrorModule = /** @class */ (function () {
|
|
5674
6023
|
function ValidationErrorModule() {
|
|
5675
6024
|
}
|
|
@@ -5690,6 +6039,115 @@
|
|
|
5690
6039
|
},] }
|
|
5691
6040
|
];
|
|
5692
6041
|
|
|
6042
|
+
var CommitButtonsComponent = /** @class */ (function () {
|
|
6043
|
+
function CommitButtonsComponent(_renderer) {
|
|
6044
|
+
var _this = this;
|
|
6045
|
+
this._renderer = _renderer;
|
|
6046
|
+
this.cancelClick = new core.EventEmitter();
|
|
6047
|
+
this.commitClick = new core.EventEmitter();
|
|
6048
|
+
this._committing = false;
|
|
6049
|
+
this._commitFinished = false;
|
|
6050
|
+
this._handleAnimationIteration = function (event) {
|
|
6051
|
+
_this._renderer.removeClass(event.currentTarget, 'animate');
|
|
6052
|
+
event.currentTarget.removeEventListener('animationiteration', _this._handleAnimationIteration);
|
|
6053
|
+
// elem.removeEventListener('webkitAnimationIteration', () => this._handleAnimationIteration(elem));
|
|
6054
|
+
};
|
|
6055
|
+
}
|
|
6056
|
+
Object.defineProperty(CommitButtonsComponent.prototype, "content", {
|
|
6057
|
+
set: function (children) {
|
|
6058
|
+
this.animateDivs = children.toArray();
|
|
6059
|
+
this._checkAnimation();
|
|
6060
|
+
},
|
|
6061
|
+
enumerable: false,
|
|
6062
|
+
configurable: true
|
|
6063
|
+
});
|
|
6064
|
+
Object.defineProperty(CommitButtonsComponent.prototype, "committing", {
|
|
6065
|
+
get: function () {
|
|
6066
|
+
return this._committing;
|
|
6067
|
+
},
|
|
6068
|
+
set: function (value) {
|
|
6069
|
+
this._committing = value;
|
|
6070
|
+
this._checkAnimation();
|
|
6071
|
+
},
|
|
6072
|
+
enumerable: false,
|
|
6073
|
+
configurable: true
|
|
6074
|
+
});
|
|
6075
|
+
Object.defineProperty(CommitButtonsComponent.prototype, "commitFinished", {
|
|
6076
|
+
get: function () {
|
|
6077
|
+
return this._commitFinished;
|
|
6078
|
+
},
|
|
6079
|
+
set: function (value) {
|
|
6080
|
+
this._commitFinished = value;
|
|
6081
|
+
this._checkAnimationFinished();
|
|
6082
|
+
},
|
|
6083
|
+
enumerable: false,
|
|
6084
|
+
configurable: true
|
|
6085
|
+
});
|
|
6086
|
+
CommitButtonsComponent.prototype.showClass = function () {
|
|
6087
|
+
return true;
|
|
6088
|
+
};
|
|
6089
|
+
CommitButtonsComponent.prototype._checkAnimation = function () {
|
|
6090
|
+
var _this = this;
|
|
6091
|
+
if (this.committing && this.animateDivs) {
|
|
6092
|
+
this.animateDivs.forEach(function (a) { return _this._renderer.addClass(a.nativeElement, 'animate'); });
|
|
6093
|
+
}
|
|
6094
|
+
};
|
|
6095
|
+
CommitButtonsComponent.prototype._checkAnimationFinished = function () {
|
|
6096
|
+
var _this = this;
|
|
6097
|
+
if (this.commitFinished && this.animateDivs) {
|
|
6098
|
+
this.animateDivs.forEach(function (a) {
|
|
6099
|
+
a.nativeElement.addEventListener('animationiteration', _this._handleAnimationIteration);
|
|
6100
|
+
// a.nativeElement.addEventListener('webkitAnimationIteration', (event) => this._handleAnimationIteration(event));
|
|
6101
|
+
});
|
|
6102
|
+
}
|
|
6103
|
+
};
|
|
6104
|
+
return CommitButtonsComponent;
|
|
6105
|
+
}());
|
|
6106
|
+
CommitButtonsComponent.decorators = [
|
|
6107
|
+
{ type: core.Component, args: [{
|
|
6108
|
+
selector: "co-commit-buttons",
|
|
6109
|
+
template: "\n <div class=\"commit-buttons-wrapper\" @showHideSaveCancel>\n <div class=\"commit-buttons-button save\" [class.finished]=\"commitFinished\"\n (click)=\"commitClick.emit($event)\">\n <div class=\"save-button-spinner\" *ngIf=\"committing || commitFinished\">\n <div #animatediv></div>\n <div #animatediv></div>\n <div #animatediv></div>\n <div #animatediv></div>\n </div>\n <div class=\"spinner-checkmark\" *ngIf=\"!committing || commitFinished\"></div>\n </div>\n <div class=\"commit-buttons-button cancel\" (click)=\"cancelClick.emit($event)\">\n <div class=\"cancel-button\"></div>\n </div>\n </div>\n ",
|
|
6110
|
+
animations: [
|
|
6111
|
+
animations.trigger('showHideSaveCancel', [
|
|
6112
|
+
animations.state('*', animations.style({ transform: 'scaleY(1)', opacity: 1 })),
|
|
6113
|
+
animations.state('void', animations.style({ transform: 'scaleY(0)', opacity: 0 })),
|
|
6114
|
+
animations.transition('void <=> *', animations.animate(200))
|
|
6115
|
+
]),
|
|
6116
|
+
],
|
|
6117
|
+
encapsulation: core.ViewEncapsulation.None
|
|
6118
|
+
},] }
|
|
6119
|
+
];
|
|
6120
|
+
CommitButtonsComponent.ctorParameters = function () { return [
|
|
6121
|
+
{ type: core.Renderer2 }
|
|
6122
|
+
]; };
|
|
6123
|
+
CommitButtonsComponent.propDecorators = {
|
|
6124
|
+
content: [{ type: core.ViewChildren, args: ['animatediv', { read: core.ElementRef },] }],
|
|
6125
|
+
committing: [{ type: core.Input }],
|
|
6126
|
+
commitFinished: [{ type: core.Input }],
|
|
6127
|
+
cancelClick: [{ type: core.Output }],
|
|
6128
|
+
commitClick: [{ type: core.Output }],
|
|
6129
|
+
showClass: [{ type: core.HostBinding, args: ["class.co-commit-buttons",] }]
|
|
6130
|
+
};
|
|
6131
|
+
|
|
6132
|
+
var CommitButtonsModule = /** @class */ (function () {
|
|
6133
|
+
function CommitButtonsModule() {
|
|
6134
|
+
}
|
|
6135
|
+
return CommitButtonsModule;
|
|
6136
|
+
}());
|
|
6137
|
+
CommitButtonsModule.decorators = [
|
|
6138
|
+
{ type: core.NgModule, args: [{
|
|
6139
|
+
imports: [
|
|
6140
|
+
common.CommonModule
|
|
6141
|
+
],
|
|
6142
|
+
declarations: [
|
|
6143
|
+
CommitButtonsComponent
|
|
6144
|
+
],
|
|
6145
|
+
exports: [
|
|
6146
|
+
CommitButtonsComponent
|
|
6147
|
+
]
|
|
6148
|
+
},] }
|
|
6149
|
+
];
|
|
6150
|
+
|
|
5693
6151
|
var InputTextModule = /** @class */ (function () {
|
|
5694
6152
|
function InputTextModule() {
|
|
5695
6153
|
}
|
|
@@ -5705,7 +6163,8 @@
|
|
|
5705
6163
|
AppendPipeModule,
|
|
5706
6164
|
ej2AngularInputs.TextBoxAllModule,
|
|
5707
6165
|
ej2AngularInputs.NumericTextBoxModule,
|
|
5708
|
-
ValidationErrorModule
|
|
6166
|
+
ValidationErrorModule,
|
|
6167
|
+
CommitButtonsModule
|
|
5709
6168
|
],
|
|
5710
6169
|
declarations: [
|
|
5711
6170
|
InputTextComponent
|
|
@@ -5762,6 +6221,9 @@
|
|
|
5762
6221
|
template: "\n <ejs-radiobutton\n [label]=\"label\"\n [name]=\"name\"\n [value]=\"value\"\n [checked]=\"checked\"\n (change)=\"handleModelChange($event)\"\n ></ejs-radiobutton>\n ",
|
|
5763
6222
|
providers: [{
|
|
5764
6223
|
provide: COMPONENT_INTERFACE_NAME, useExisting: core.forwardRef(function () { return InputRadioButtonComponent; })
|
|
6224
|
+
}, {
|
|
6225
|
+
provide: BaseInputComponent,
|
|
6226
|
+
useExisting: InputRadioButtonComponent
|
|
5765
6227
|
}],
|
|
5766
6228
|
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
5767
6229
|
encapsulation: core.ViewEncapsulation.None
|
|
@@ -5830,6 +6292,9 @@
|
|
|
5830
6292
|
providers: [{
|
|
5831
6293
|
provide: COMPONENT_INTERFACE_NAME,
|
|
5832
6294
|
useExisting: core.forwardRef(function () { return InputTextareaComponent; })
|
|
6295
|
+
}, {
|
|
6296
|
+
provide: BaseInputComponent,
|
|
6297
|
+
useExisting: InputTextareaComponent
|
|
5833
6298
|
}],
|
|
5834
6299
|
encapsulation: core.ViewEncapsulation.None
|
|
5835
6300
|
},] }
|
|
@@ -5921,6 +6386,9 @@
|
|
|
5921
6386
|
{
|
|
5922
6387
|
provide: COMPONENT_INTERFACE_NAME,
|
|
5923
6388
|
useExisting: core.forwardRef(function () { return MultiSelectListComponent; })
|
|
6389
|
+
}, {
|
|
6390
|
+
provide: BaseInputComponent,
|
|
6391
|
+
useExisting: MultiSelectListComponent
|
|
5924
6392
|
}
|
|
5925
6393
|
],
|
|
5926
6394
|
encapsulation: core.ViewEncapsulation.None
|
|
@@ -7505,6 +7973,9 @@
|
|
|
7505
7973
|
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 ",
|
|
7506
7974
|
providers: [{
|
|
7507
7975
|
provide: COMPONENT_INTERFACE_NAME, useExisting: core.forwardRef(function () { return InputListboxComponent; })
|
|
7976
|
+
}, {
|
|
7977
|
+
provide: BaseInputComponent,
|
|
7978
|
+
useExisting: InputListboxComponent
|
|
7508
7979
|
}],
|
|
7509
7980
|
encapsulation: core.ViewEncapsulation.None
|
|
7510
7981
|
},] }
|
|
@@ -7560,6 +8031,10 @@
|
|
|
7560
8031
|
var SimpleGridColumnDirective = /** @class */ (function () {
|
|
7561
8032
|
function SimpleGridColumnDirective() {
|
|
7562
8033
|
this.resizable = true;
|
|
8034
|
+
this.required = false;
|
|
8035
|
+
this.readonly = false;
|
|
8036
|
+
this.order = 0;
|
|
8037
|
+
this.singleColumn = false;
|
|
7563
8038
|
}
|
|
7564
8039
|
Object.defineProperty(SimpleGridColumnDirective.prototype, "template", {
|
|
7565
8040
|
get: function () {
|
|
@@ -7573,6 +8048,38 @@
|
|
|
7573
8048
|
enumerable: false,
|
|
7574
8049
|
configurable: true
|
|
7575
8050
|
});
|
|
8051
|
+
Object.defineProperty(SimpleGridColumnDirective.prototype, "editTemplate", {
|
|
8052
|
+
get: function () {
|
|
8053
|
+
return this._editTemplate;
|
|
8054
|
+
},
|
|
8055
|
+
set: function (template) {
|
|
8056
|
+
if (template) {
|
|
8057
|
+
this._editTemplate = template;
|
|
8058
|
+
}
|
|
8059
|
+
},
|
|
8060
|
+
enumerable: false,
|
|
8061
|
+
configurable: true
|
|
8062
|
+
});
|
|
8063
|
+
SimpleGridColumnDirective.prototype.ngOnInit = function () {
|
|
8064
|
+
this._setSingleColumnProps();
|
|
8065
|
+
};
|
|
8066
|
+
SimpleGridColumnDirective.prototype.getFieldValue = function (value) {
|
|
8067
|
+
var _this = this;
|
|
8068
|
+
if (this.collection && this.displayField) {
|
|
8069
|
+
var result = this.collection.find(function (c) { return c[_this.codeField] === value; });
|
|
8070
|
+
if (result) {
|
|
8071
|
+
return result[this.displayField];
|
|
8072
|
+
}
|
|
8073
|
+
}
|
|
8074
|
+
return value;
|
|
8075
|
+
};
|
|
8076
|
+
SimpleGridColumnDirective.prototype._setSingleColumnProps = function () {
|
|
8077
|
+
if (this.singleColumn) {
|
|
8078
|
+
this.resizable = false;
|
|
8079
|
+
this.readonly = true;
|
|
8080
|
+
this.width = 0;
|
|
8081
|
+
}
|
|
8082
|
+
};
|
|
7576
8083
|
return SimpleGridColumnDirective;
|
|
7577
8084
|
}());
|
|
7578
8085
|
SimpleGridColumnDirective._MinManualResizeWidthPx = 50;
|
|
@@ -7582,39 +8089,55 @@
|
|
|
7582
8089
|
},] }
|
|
7583
8090
|
];
|
|
7584
8091
|
SimpleGridColumnDirective.propDecorators = {
|
|
7585
|
-
template: [{ type: core.ContentChild, args: [
|
|
8092
|
+
template: [{ type: core.ContentChild, args: ['template',] }],
|
|
8093
|
+
editTemplate: [{ type: core.ContentChild, args: ['editTemplate',] }],
|
|
7586
8094
|
headerText: [{ type: core.Input }],
|
|
7587
8095
|
field: [{ type: core.Input }],
|
|
8096
|
+
codeField: [{ type: core.Input }],
|
|
8097
|
+
displayField: [{ type: core.Input }],
|
|
7588
8098
|
textAlign: [{ type: core.Input }],
|
|
7589
8099
|
format: [{ type: core.Input }],
|
|
7590
8100
|
resizable: [{ type: core.Input }],
|
|
7591
|
-
|
|
8101
|
+
required: [{ type: core.Input }],
|
|
8102
|
+
width: [{ type: core.Input }],
|
|
8103
|
+
readonly: [{ type: core.Input }],
|
|
8104
|
+
collection: [{ type: core.Input }],
|
|
8105
|
+
order: [{ type: core.Input }],
|
|
8106
|
+
singleColumn: [{ type: core.Input }]
|
|
7592
8107
|
};
|
|
7593
8108
|
|
|
7594
|
-
var
|
|
7595
|
-
function
|
|
7596
|
-
this.defaultTextAlign = exports.ColumnAlign.Left;
|
|
8109
|
+
var BaseSimpleGridComponent = /** @class */ (function () {
|
|
8110
|
+
function BaseSimpleGridComponent() {
|
|
7597
8111
|
this.data = [];
|
|
7598
8112
|
this.dragDropEnabled = false;
|
|
8113
|
+
this.inlineEdit = false;
|
|
8114
|
+
this.showToolbar = false;
|
|
7599
8115
|
/**
|
|
7600
8116
|
* Should component emit drag and drop actions instead of handle
|
|
7601
8117
|
* (update collection) by itself
|
|
7602
8118
|
*/
|
|
7603
8119
|
this.emitDragDrop = false;
|
|
7604
8120
|
this.onDrop = new core.EventEmitter();
|
|
8121
|
+
this.selectRow = new core.EventEmitter();
|
|
8122
|
+
this.dblClickRow = new core.EventEmitter();
|
|
8123
|
+
this.saveRow = new core.EventEmitter();
|
|
7605
8124
|
this.columns = [];
|
|
7606
8125
|
}
|
|
7607
|
-
Object.defineProperty(
|
|
8126
|
+
Object.defineProperty(BaseSimpleGridComponent.prototype, "content", {
|
|
7608
8127
|
set: function (columnComponents) {
|
|
7609
|
-
this.
|
|
8128
|
+
this._setColumns(columnComponents.toArray());
|
|
7610
8129
|
},
|
|
7611
8130
|
enumerable: false,
|
|
7612
8131
|
configurable: true
|
|
7613
8132
|
});
|
|
7614
|
-
|
|
7615
|
-
|
|
7616
|
-
|
|
7617
|
-
|
|
8133
|
+
Object.defineProperty(BaseSimpleGridComponent.prototype, "extraColumns", {
|
|
8134
|
+
set: function (value) {
|
|
8135
|
+
this._setColumns(value);
|
|
8136
|
+
},
|
|
8137
|
+
enumerable: false,
|
|
8138
|
+
configurable: true
|
|
8139
|
+
});
|
|
8140
|
+
BaseSimpleGridComponent.prototype.handleMouseMove = function (event) {
|
|
7618
8141
|
if (event.buttons === 1 && this._columnForResize) {
|
|
7619
8142
|
if (!this._columnForResize.width) {
|
|
7620
8143
|
var rect = event.target.parentElement.getBoundingClientRect();
|
|
@@ -7623,16 +8146,16 @@
|
|
|
7623
8146
|
this._columnForResize.width += event.movementX;
|
|
7624
8147
|
}
|
|
7625
8148
|
};
|
|
7626
|
-
|
|
8149
|
+
BaseSimpleGridComponent.prototype.handleMouseUp = function (event) {
|
|
7627
8150
|
this._columnForResize = undefined;
|
|
7628
8151
|
};
|
|
7629
|
-
|
|
8152
|
+
BaseSimpleGridComponent.prototype.handleSizerMouseDown = function (event, column) {
|
|
7630
8153
|
this._columnForResize = column;
|
|
7631
8154
|
};
|
|
7632
|
-
|
|
8155
|
+
BaseSimpleGridComponent.prototype.handleCanDragDrop = function (drag, drop) {
|
|
7633
8156
|
return true;
|
|
7634
8157
|
};
|
|
7635
|
-
|
|
8158
|
+
BaseSimpleGridComponent.prototype.handleDrop = function (event) {
|
|
7636
8159
|
try {
|
|
7637
8160
|
var from = event.previousIndex;
|
|
7638
8161
|
var to = event.currentIndex;
|
|
@@ -7650,25 +8173,457 @@
|
|
|
7650
8173
|
console.error(e);
|
|
7651
8174
|
}
|
|
7652
8175
|
};
|
|
7653
|
-
|
|
8176
|
+
BaseSimpleGridComponent.prototype._setColumns = function (columns) {
|
|
8177
|
+
var _a;
|
|
8178
|
+
(_a = this.columns).push.apply(_a, __spreadArray([], __read(columns)));
|
|
8179
|
+
this.columns.sort(function (a, b) { return a.order < b.order ? -1 : 1; });
|
|
8180
|
+
};
|
|
8181
|
+
return BaseSimpleGridComponent;
|
|
7654
8182
|
}());
|
|
8183
|
+
BaseSimpleGridComponent.decorators = [
|
|
8184
|
+
{ type: core.Directive }
|
|
8185
|
+
];
|
|
8186
|
+
BaseSimpleGridComponent.propDecorators = {
|
|
8187
|
+
content: [{ type: core.ContentChildren, args: [SimpleGridColumnDirective,] }],
|
|
8188
|
+
data: [{ type: core.Input }],
|
|
8189
|
+
dragDropEnabled: [{ type: core.Input }],
|
|
8190
|
+
inlineEdit: [{ type: core.Input }],
|
|
8191
|
+
showToolbar: [{ type: core.Input }],
|
|
8192
|
+
emitDragDrop: [{ type: core.Input }],
|
|
8193
|
+
extraColumns: [{ type: core.Input }],
|
|
8194
|
+
onDrop: [{ type: core.Output }],
|
|
8195
|
+
selectRow: [{ type: core.Output }],
|
|
8196
|
+
dblClickRow: [{ type: core.Output }],
|
|
8197
|
+
saveRow: [{ type: core.Output }],
|
|
8198
|
+
handleMouseMove: [{ type: core.HostListener, args: ['document:mousemove', ['$event'],] }],
|
|
8199
|
+
handleMouseUp: [{ type: core.HostListener, args: ['document:mouseup', ['$event'],] }]
|
|
8200
|
+
};
|
|
8201
|
+
|
|
8202
|
+
var SimpleGridComponent = /** @class */ (function (_super) {
|
|
8203
|
+
__extends(SimpleGridComponent, _super);
|
|
8204
|
+
function SimpleGridComponent(_changeDetection, _formMaster) {
|
|
8205
|
+
var _this = _super.call(this) || this;
|
|
8206
|
+
_this._changeDetection = _changeDetection;
|
|
8207
|
+
_this._formMaster = _formMaster;
|
|
8208
|
+
_this.defaultTextAlign = exports.ColumnAlign.Left;
|
|
8209
|
+
_this.editting = false;
|
|
8210
|
+
_this.editRowIndex = -1;
|
|
8211
|
+
_this.editCellIndex = -1;
|
|
8212
|
+
_this.selectedRowIndex = -1;
|
|
8213
|
+
_this._doubleClicked = false;
|
|
8214
|
+
_this._newRow = false;
|
|
8215
|
+
return _this;
|
|
8216
|
+
}
|
|
8217
|
+
SimpleGridComponent.prototype.showClass = function () {
|
|
8218
|
+
return true;
|
|
8219
|
+
};
|
|
8220
|
+
SimpleGridComponent.prototype.handleKeyDown = function (event) {
|
|
8221
|
+
var _this = this;
|
|
8222
|
+
if (!this.inlineEdit) {
|
|
8223
|
+
return;
|
|
8224
|
+
}
|
|
8225
|
+
if (event.code === 'Tab') {
|
|
8226
|
+
event.preventDefault();
|
|
8227
|
+
this._nextAvailableCellToEdit(!event.shiftKey, this.editCellIndex)
|
|
8228
|
+
.then(function (index) {
|
|
8229
|
+
_this.editCellIndex = index;
|
|
8230
|
+
_this._changeDetection.markForCheck();
|
|
8231
|
+
});
|
|
8232
|
+
this._detectChanges();
|
|
8233
|
+
}
|
|
8234
|
+
if (event.code === 'Escape') {
|
|
8235
|
+
this.cancelEditRow();
|
|
8236
|
+
}
|
|
8237
|
+
if (event.code === 'Enter') {
|
|
8238
|
+
this.validateAndSave();
|
|
8239
|
+
}
|
|
8240
|
+
};
|
|
8241
|
+
SimpleGridComponent.prototype.isSingleColumn = function (column) {
|
|
8242
|
+
return column.singleColumn;
|
|
8243
|
+
};
|
|
8244
|
+
SimpleGridComponent.prototype.rowContainsSingleColumn = function (row, columns) {
|
|
8245
|
+
var _this = this;
|
|
8246
|
+
var singleColumn = columns.find(function (column) { return _this.isSingleColumn(column) && !!row[column.field]; });
|
|
8247
|
+
return !!singleColumn;
|
|
8248
|
+
};
|
|
8249
|
+
SimpleGridComponent.prototype.addRow = function () {
|
|
8250
|
+
var _this = this;
|
|
8251
|
+
var valid = this.validateAndSave();
|
|
8252
|
+
this._detectChanges();
|
|
8253
|
+
if (valid) {
|
|
8254
|
+
this.data.unshift({});
|
|
8255
|
+
this._newRow = true;
|
|
8256
|
+
this.editRowIndex = 0;
|
|
8257
|
+
this._nextAvailableCellToEdit(true).then(function (index) {
|
|
8258
|
+
_this.editCellIndex = index;
|
|
8259
|
+
});
|
|
8260
|
+
this.editting = true;
|
|
8261
|
+
this.rowToEdit = this.data[0];
|
|
8262
|
+
this._detectChanges();
|
|
8263
|
+
}
|
|
8264
|
+
};
|
|
8265
|
+
SimpleGridComponent.prototype.validateAndSave = function (stopEditting) {
|
|
8266
|
+
if (stopEditting === void 0) { stopEditting = true; }
|
|
8267
|
+
if (!this.editting) {
|
|
8268
|
+
return true;
|
|
8269
|
+
}
|
|
8270
|
+
var valid = this._formMaster.submitSlaves();
|
|
8271
|
+
this._detectChanges();
|
|
8272
|
+
if (valid) {
|
|
8273
|
+
this._saveRow(stopEditting);
|
|
8274
|
+
return true;
|
|
8275
|
+
}
|
|
8276
|
+
};
|
|
8277
|
+
SimpleGridComponent.prototype.cancelEditRow = function () {
|
|
8278
|
+
if (!this.editting) {
|
|
8279
|
+
return;
|
|
8280
|
+
}
|
|
8281
|
+
if (this._newRow) {
|
|
8282
|
+
this.data.shift();
|
|
8283
|
+
}
|
|
8284
|
+
else {
|
|
8285
|
+
this.data[this.editRowIndex] = this.rowToEdit;
|
|
8286
|
+
}
|
|
8287
|
+
this._newRow = false;
|
|
8288
|
+
this.editting = false;
|
|
8289
|
+
this._detectChanges();
|
|
8290
|
+
};
|
|
8291
|
+
SimpleGridComponent.prototype.handleClickRow = function (event, index) {
|
|
8292
|
+
var _this = this;
|
|
8293
|
+
setTimeout(function () {
|
|
8294
|
+
if (_this._doubleClicked) {
|
|
8295
|
+
return;
|
|
8296
|
+
}
|
|
8297
|
+
_this.selectTheRow(index);
|
|
8298
|
+
}, 200);
|
|
8299
|
+
};
|
|
8300
|
+
SimpleGridComponent.prototype.selectTheRow = function (index, emit) {
|
|
8301
|
+
if (emit === void 0) { emit = true; }
|
|
8302
|
+
if (this.selectedRowIndex !== index && ((this.editting && this.validateAndSave()) || !this.editting)) {
|
|
8303
|
+
this.selectedRowIndex = index;
|
|
8304
|
+
if (emit) {
|
|
8305
|
+
this.selectRow.next(this.data[this.selectedRowIndex]);
|
|
8306
|
+
}
|
|
8307
|
+
}
|
|
8308
|
+
this._detectChanges();
|
|
8309
|
+
};
|
|
8310
|
+
SimpleGridComponent.prototype.handleDblClickRow = function (event, index) {
|
|
8311
|
+
this._doubleClicked = true;
|
|
8312
|
+
this.dblClickRow.next(this.data[index]);
|
|
8313
|
+
this.selectTheRow(index, false);
|
|
8314
|
+
if (this.inlineEdit) {
|
|
8315
|
+
this.editRow(event);
|
|
8316
|
+
}
|
|
8317
|
+
this._resetDblClick();
|
|
8318
|
+
};
|
|
8319
|
+
SimpleGridComponent.prototype.editRow = function (event) {
|
|
8320
|
+
var _this = this;
|
|
8321
|
+
this.editRowIndex = this.selectedRowIndex;
|
|
8322
|
+
this.rowToEdit = this.data[this.editRowIndex];
|
|
8323
|
+
this.editting = true;
|
|
8324
|
+
this._nextAvailableCellToEdit(true).then(function (index) {
|
|
8325
|
+
_this.editCellIndex = index;
|
|
8326
|
+
});
|
|
8327
|
+
this._detectChanges();
|
|
8328
|
+
};
|
|
8329
|
+
SimpleGridComponent.prototype.handleCellClick = function (index) {
|
|
8330
|
+
this.editCellIndex = index;
|
|
8331
|
+
this._detectChanges();
|
|
8332
|
+
};
|
|
8333
|
+
SimpleGridComponent.prototype._resetDblClick = function () {
|
|
8334
|
+
var _this = this;
|
|
8335
|
+
setTimeout(function () {
|
|
8336
|
+
_this._doubleClicked = false;
|
|
8337
|
+
}, 500);
|
|
8338
|
+
};
|
|
8339
|
+
/**
|
|
8340
|
+
*
|
|
8341
|
+
* @param next; Move to next or previous cell
|
|
8342
|
+
* @param start; Start from cellindex
|
|
8343
|
+
* @private
|
|
8344
|
+
*/
|
|
8345
|
+
SimpleGridComponent.prototype._nextAvailableCellToEdit = function (next, start) {
|
|
8346
|
+
var _this = this;
|
|
8347
|
+
if (start === void 0) { start = -1; }
|
|
8348
|
+
return new Promise(function (resolve, reject) {
|
|
8349
|
+
var numEditableColumns = _this.columns.filter(function (c) { return !c.readonly; }).length;
|
|
8350
|
+
var wantedIndex = start + (next ? 1 : -1);
|
|
8351
|
+
if (wantedIndex >= numEditableColumns) {
|
|
8352
|
+
_this._getNextEditRowIndex()
|
|
8353
|
+
.then(function (index) {
|
|
8354
|
+
_this.editRowIndex = index;
|
|
8355
|
+
resolve(_this._getNextEditCellIndex(0));
|
|
8356
|
+
})
|
|
8357
|
+
.catch(function (e) {
|
|
8358
|
+
reject();
|
|
8359
|
+
});
|
|
8360
|
+
}
|
|
8361
|
+
else if (wantedIndex < 0) {
|
|
8362
|
+
_this._getPreviousEditRowIndex()
|
|
8363
|
+
.then(function (index) {
|
|
8364
|
+
_this.editRowIndex = index;
|
|
8365
|
+
resolve(_this._getPreviousEditCellIndex(_this.columns.length - 1));
|
|
8366
|
+
})
|
|
8367
|
+
.catch(function (e) {
|
|
8368
|
+
reject();
|
|
8369
|
+
});
|
|
8370
|
+
}
|
|
8371
|
+
else {
|
|
8372
|
+
resolve(next ? _this._getNextEditCellIndex(start + 1) : _this._getPreviousEditCellIndex(start - 1));
|
|
8373
|
+
}
|
|
8374
|
+
});
|
|
8375
|
+
};
|
|
8376
|
+
SimpleGridComponent.prototype._getNextEditCellIndex = function (start) {
|
|
8377
|
+
for (var i = start; i < this.columns.length; i++) {
|
|
8378
|
+
if (!this.columns[i].readonly) {
|
|
8379
|
+
return i;
|
|
8380
|
+
}
|
|
8381
|
+
}
|
|
8382
|
+
};
|
|
8383
|
+
SimpleGridComponent.prototype._getPreviousEditCellIndex = function (start) {
|
|
8384
|
+
for (var i = start; i >= 0; i--) {
|
|
8385
|
+
if (!this.columns[i].readonly) {
|
|
8386
|
+
return i;
|
|
8387
|
+
}
|
|
8388
|
+
}
|
|
8389
|
+
};
|
|
8390
|
+
SimpleGridComponent.prototype._getNextEditRowIndex = function () {
|
|
8391
|
+
var _this = this;
|
|
8392
|
+
return new Promise(function (resolve, reject) {
|
|
8393
|
+
var newRowIndex = 0;
|
|
8394
|
+
if (_this.editRowIndex + 1 >= _this.data.length) {
|
|
8395
|
+
newRowIndex = 0;
|
|
8396
|
+
}
|
|
8397
|
+
else {
|
|
8398
|
+
newRowIndex = _this.editRowIndex + 1;
|
|
8399
|
+
}
|
|
8400
|
+
if (newRowIndex !== _this.editRowIndex) { // go to different row validate current one first
|
|
8401
|
+
if (_this.validateAndSave(false)) {
|
|
8402
|
+
_this.rowToEdit = _this.data[newRowIndex];
|
|
8403
|
+
resolve(newRowIndex);
|
|
8404
|
+
}
|
|
8405
|
+
else {
|
|
8406
|
+
reject();
|
|
8407
|
+
}
|
|
8408
|
+
}
|
|
8409
|
+
else {
|
|
8410
|
+
resolve(newRowIndex);
|
|
8411
|
+
}
|
|
8412
|
+
});
|
|
8413
|
+
};
|
|
8414
|
+
SimpleGridComponent.prototype._getPreviousEditRowIndex = function () {
|
|
8415
|
+
var _this = this;
|
|
8416
|
+
return new Promise(function (resolve, reject) {
|
|
8417
|
+
var newRowIndex = 0;
|
|
8418
|
+
if (_this.editRowIndex - 1 < 0) {
|
|
8419
|
+
newRowIndex = _this.data.length - 1;
|
|
8420
|
+
}
|
|
8421
|
+
else {
|
|
8422
|
+
newRowIndex = _this.editRowIndex - 1;
|
|
8423
|
+
}
|
|
8424
|
+
if (newRowIndex !== _this.editRowIndex) { // go to different row validate current one first
|
|
8425
|
+
if (_this.validateAndSave(false)) {
|
|
8426
|
+
_this.rowToEdit = _this.data[newRowIndex];
|
|
8427
|
+
resolve(newRowIndex);
|
|
8428
|
+
}
|
|
8429
|
+
else {
|
|
8430
|
+
reject();
|
|
8431
|
+
}
|
|
8432
|
+
}
|
|
8433
|
+
else {
|
|
8434
|
+
resolve(newRowIndex);
|
|
8435
|
+
}
|
|
8436
|
+
});
|
|
8437
|
+
};
|
|
8438
|
+
SimpleGridComponent.prototype._saveRow = function (stopEditting) {
|
|
8439
|
+
if (stopEditting === void 0) { stopEditting = true; }
|
|
8440
|
+
// emit saveEvent
|
|
8441
|
+
if (this.rowToEdit) {
|
|
8442
|
+
this.saveRow.next(this.rowToEdit);
|
|
8443
|
+
}
|
|
8444
|
+
this._newRow = false;
|
|
8445
|
+
if (stopEditting) {
|
|
8446
|
+
this.editRowIndex = -1;
|
|
8447
|
+
this.editCellIndex = -1;
|
|
8448
|
+
this.editting = false;
|
|
8449
|
+
this.rowToEdit = undefined;
|
|
8450
|
+
}
|
|
8451
|
+
this._detectChanges();
|
|
8452
|
+
};
|
|
8453
|
+
SimpleGridComponent.prototype._detectChanges = function () {
|
|
8454
|
+
this._changeDetection.detectChanges();
|
|
8455
|
+
};
|
|
8456
|
+
return SimpleGridComponent;
|
|
8457
|
+
}(BaseSimpleGridComponent));
|
|
7655
8458
|
SimpleGridComponent.decorators = [
|
|
7656
8459
|
{ type: core.Component, args: [{
|
|
7657
8460
|
selector: "co-simple-grid",
|
|
7658
|
-
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
|
|
8461
|
+
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\" [style.padding-right.px]=\"isSingleColumn(column) ? 0 : 5\">\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\"\n [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]=\"isSingleColumn(column) ? 'fit-content' : column.width\" [style.max-width.px]=\"column.width\"\n [style.padding-right.px]=\"isSingleColumn(column) ? 0 : 5\" >\n <co-simple-grid-cell\n [column]=\"column\"\n [row]=\"row\"\n [editMode]=\"inlineEdit && editting && rowIndex === editRowIndex && !isSingleColumn(column) && !rowContainsSingleColumn(row, columns)\"\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 ",
|
|
8462
|
+
providers: [
|
|
8463
|
+
FormMasterService
|
|
8464
|
+
],
|
|
7659
8465
|
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
7660
8466
|
encapsulation: core.ViewEncapsulation.None
|
|
7661
8467
|
},] }
|
|
7662
8468
|
];
|
|
8469
|
+
SimpleGridComponent.ctorParameters = function () { return [
|
|
8470
|
+
{ type: core.ChangeDetectorRef },
|
|
8471
|
+
{ type: FormMasterService }
|
|
8472
|
+
]; };
|
|
7663
8473
|
SimpleGridComponent.propDecorators = {
|
|
7664
|
-
content: [{ type: core.ContentChildren, args: [SimpleGridColumnDirective,] }],
|
|
7665
|
-
data: [{ type: core.Input }],
|
|
7666
|
-
dragDropEnabled: [{ type: core.Input }],
|
|
7667
|
-
emitDragDrop: [{ type: core.Input }],
|
|
7668
|
-
onDrop: [{ type: core.Output }],
|
|
7669
8474
|
showClass: [{ type: core.HostBinding, args: ["class.co-simple-grid",] }],
|
|
7670
|
-
|
|
7671
|
-
|
|
8475
|
+
handleKeyDown: [{ type: core.HostListener, args: ['keydown', ['$event'],] }]
|
|
8476
|
+
};
|
|
8477
|
+
|
|
8478
|
+
var SimpleGridCellComponent = /** @class */ (function () {
|
|
8479
|
+
function SimpleGridCellComponent(_changeDetector) {
|
|
8480
|
+
this._changeDetector = _changeDetector;
|
|
8481
|
+
this.defaultTextAlign = exports.ColumnAlign.Left;
|
|
8482
|
+
this.editMode = false;
|
|
8483
|
+
this.cellClick = new core.EventEmitter();
|
|
8484
|
+
this._fieldEditMode = false;
|
|
8485
|
+
this._focused = false;
|
|
8486
|
+
}
|
|
8487
|
+
Object.defineProperty(SimpleGridCellComponent.prototype, "editTemplateContent", {
|
|
8488
|
+
set: function (template) {
|
|
8489
|
+
if (template) {
|
|
8490
|
+
this._editTemplate = template;
|
|
8491
|
+
this._setFocusComponent();
|
|
8492
|
+
}
|
|
8493
|
+
},
|
|
8494
|
+
enumerable: false,
|
|
8495
|
+
configurable: true
|
|
8496
|
+
});
|
|
8497
|
+
Object.defineProperty(SimpleGridCellComponent.prototype, "noEditTemplateContent", {
|
|
8498
|
+
set: function (template) {
|
|
8499
|
+
if (template) {
|
|
8500
|
+
this._template = template;
|
|
8501
|
+
this._setFocusComponent();
|
|
8502
|
+
}
|
|
8503
|
+
},
|
|
8504
|
+
enumerable: false,
|
|
8505
|
+
configurable: true
|
|
8506
|
+
});
|
|
8507
|
+
Object.defineProperty(SimpleGridCellComponent.prototype, "noTemplateContent", {
|
|
8508
|
+
set: function (template) {
|
|
8509
|
+
if (template) {
|
|
8510
|
+
this._inputTemplate = template;
|
|
8511
|
+
this._setFocusComponent();
|
|
8512
|
+
}
|
|
8513
|
+
},
|
|
8514
|
+
enumerable: false,
|
|
8515
|
+
configurable: true
|
|
8516
|
+
});
|
|
8517
|
+
Object.defineProperty(SimpleGridCellComponent.prototype, "fieldEditMode", {
|
|
8518
|
+
get: function () {
|
|
8519
|
+
return this._fieldEditMode;
|
|
8520
|
+
},
|
|
8521
|
+
set: function (value) {
|
|
8522
|
+
this._fieldEditMode = value;
|
|
8523
|
+
this._setFocusComponent();
|
|
8524
|
+
},
|
|
8525
|
+
enumerable: false,
|
|
8526
|
+
configurable: true
|
|
8527
|
+
});
|
|
8528
|
+
SimpleGridCellComponent.prototype.showClass = function () {
|
|
8529
|
+
return true;
|
|
8530
|
+
};
|
|
8531
|
+
SimpleGridCellComponent.prototype.handleClick = function (event) {
|
|
8532
|
+
if (this.column && !this.column.readonly) {
|
|
8533
|
+
this.cellClick.next();
|
|
8534
|
+
}
|
|
8535
|
+
};
|
|
8536
|
+
SimpleGridCellComponent.prototype._setFocusComponent = function () {
|
|
8537
|
+
if (this.editMode && this.fieldEditMode) {
|
|
8538
|
+
var element = this._getElement();
|
|
8539
|
+
if (element) {
|
|
8540
|
+
var focusEvent = this._createNewEvent(element, 'focus');
|
|
8541
|
+
element.focus();
|
|
8542
|
+
element.dispatchEvent(focusEvent);
|
|
8543
|
+
this._focused = true;
|
|
8544
|
+
}
|
|
8545
|
+
}
|
|
8546
|
+
else {
|
|
8547
|
+
if (this._focused) {
|
|
8548
|
+
var element = this._getElement();
|
|
8549
|
+
if (element) {
|
|
8550
|
+
var blurEvent = this._createNewEvent(element, 'blur');
|
|
8551
|
+
element.blur();
|
|
8552
|
+
element.dispatchEvent(blurEvent);
|
|
8553
|
+
}
|
|
8554
|
+
this._focused = false;
|
|
8555
|
+
}
|
|
8556
|
+
}
|
|
8557
|
+
this._detectChanges();
|
|
8558
|
+
};
|
|
8559
|
+
SimpleGridCellComponent.prototype._getFirstFormInput = function (parent) {
|
|
8560
|
+
if (parent) {
|
|
8561
|
+
var collection_1 = Array.from(parent.getElementsByTagName('input'));
|
|
8562
|
+
var otherCollection = Array.from(parent.getElementsByTagName('textarea'));
|
|
8563
|
+
otherCollection.map(function (o) { return collection_1.push(o); });
|
|
8564
|
+
if (collection_1.length > 0) {
|
|
8565
|
+
return collection_1[0];
|
|
8566
|
+
}
|
|
8567
|
+
}
|
|
8568
|
+
};
|
|
8569
|
+
SimpleGridCellComponent.prototype._createNewEvent = function (element, eventType) {
|
|
8570
|
+
var event;
|
|
8571
|
+
if ("createEvent" in document) {
|
|
8572
|
+
event = document.createEvent("Event");
|
|
8573
|
+
event.initEvent(eventType, true, true);
|
|
8574
|
+
}
|
|
8575
|
+
else if ("Event" in window) {
|
|
8576
|
+
event = new Event(eventType, { bubbles: true, cancelable: true });
|
|
8577
|
+
}
|
|
8578
|
+
return event;
|
|
8579
|
+
};
|
|
8580
|
+
SimpleGridCellComponent.prototype._getElement = function () {
|
|
8581
|
+
var templ;
|
|
8582
|
+
if (this._editTemplate) {
|
|
8583
|
+
templ = this._editTemplate;
|
|
8584
|
+
}
|
|
8585
|
+
else if (this._template) {
|
|
8586
|
+
templ = this._template;
|
|
8587
|
+
}
|
|
8588
|
+
else {
|
|
8589
|
+
templ = this._inputTemplate;
|
|
8590
|
+
}
|
|
8591
|
+
if (templ) {
|
|
8592
|
+
if (templ && templ.elementRef) {
|
|
8593
|
+
var inputElement = this._getFirstFormInput(templ.elementRef.nativeElement.parentElement);
|
|
8594
|
+
if (inputElement) {
|
|
8595
|
+
return inputElement;
|
|
8596
|
+
}
|
|
8597
|
+
}
|
|
8598
|
+
}
|
|
8599
|
+
};
|
|
8600
|
+
SimpleGridCellComponent.prototype._detectChanges = function () {
|
|
8601
|
+
this._changeDetector.detectChanges();
|
|
8602
|
+
};
|
|
8603
|
+
return SimpleGridCellComponent;
|
|
8604
|
+
}());
|
|
8605
|
+
SimpleGridCellComponent.decorators = [
|
|
8606
|
+
{ type: core.Component, args: [{
|
|
8607
|
+
selector: "co-simple-grid-cell",
|
|
8608
|
+
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\"\n [ngTemplateOutlet]=\"column.editTemplate\"\n [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\"\n [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\"\n [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 ",
|
|
8609
|
+
encapsulation: core.ViewEncapsulation.None,
|
|
8610
|
+
changeDetection: core.ChangeDetectionStrategy.OnPush
|
|
8611
|
+
},] }
|
|
8612
|
+
];
|
|
8613
|
+
SimpleGridCellComponent.ctorParameters = function () { return [
|
|
8614
|
+
{ type: core.ChangeDetectorRef }
|
|
8615
|
+
]; };
|
|
8616
|
+
SimpleGridCellComponent.propDecorators = {
|
|
8617
|
+
editTemplateContent: [{ type: core.ViewChild, args: ["editTemplate", { read: BaseInputComponent },] }],
|
|
8618
|
+
noEditTemplateContent: [{ type: core.ViewChild, args: ["noEditTemplate",] }],
|
|
8619
|
+
noTemplateContent: [{ type: core.ViewChild, args: ["noTemplate",] }],
|
|
8620
|
+
column: [{ type: core.Input }],
|
|
8621
|
+
row: [{ type: core.Input }],
|
|
8622
|
+
editMode: [{ type: core.Input }],
|
|
8623
|
+
fieldEditMode: [{ type: core.Input }],
|
|
8624
|
+
cellClick: [{ type: core.Output }],
|
|
8625
|
+
showClass: [{ type: core.HostBinding, args: ["class.co-simple-grid-cell",] }],
|
|
8626
|
+
handleClick: [{ type: core.HostListener, args: ['click', ['$event'],] }]
|
|
7672
8627
|
};
|
|
7673
8628
|
|
|
7674
8629
|
var SimpleGridModule = /** @class */ (function () {
|
|
@@ -7680,14 +8635,19 @@
|
|
|
7680
8635
|
{ type: core.NgModule, args: [{
|
|
7681
8636
|
imports: [
|
|
7682
8637
|
common.CommonModule,
|
|
7683
|
-
dragDrop.DragDropModule
|
|
8638
|
+
dragDrop.DragDropModule,
|
|
8639
|
+
GridToolbarModule,
|
|
8640
|
+
InputTextModule,
|
|
8641
|
+
FormModule
|
|
7684
8642
|
],
|
|
7685
8643
|
declarations: [
|
|
7686
8644
|
SimpleGridComponent,
|
|
8645
|
+
SimpleGridCellComponent,
|
|
7687
8646
|
SimpleGridColumnDirective
|
|
7688
8647
|
],
|
|
7689
8648
|
exports: [
|
|
7690
8649
|
SimpleGridComponent,
|
|
8650
|
+
SimpleGridCellComponent,
|
|
7691
8651
|
SimpleGridColumnDirective
|
|
7692
8652
|
]
|
|
7693
8653
|
},] }
|
|
@@ -7807,6 +8767,7 @@
|
|
|
7807
8767
|
this._createTiles();
|
|
7808
8768
|
}
|
|
7809
8769
|
this._checkNavigationButtons();
|
|
8770
|
+
this._resizeCanvasToDisplaySize();
|
|
7810
8771
|
};
|
|
7811
8772
|
Carousel3dComponent.prototype._init = function () {
|
|
7812
8773
|
var _this = this;
|
|
@@ -7950,11 +8911,7 @@
|
|
|
7950
8911
|
boundingBox.getSize(size);
|
|
7951
8912
|
// get the max side of the bounding box (fits to width OR height as needed )
|
|
7952
8913
|
var maxDim = Math.max(size.x, size.y, size.z);
|
|
7953
|
-
|
|
7954
|
-
// let cameraZ = Math.abs(maxDim / 4 * Math.tan(fov * 200));
|
|
7955
|
-
var cameraZ = Math.abs((maxDim / 2) / Math.tan(fov / 2));
|
|
7956
|
-
// cameraZ *= offset; // zoom out a little so that objects don't fill the screen
|
|
7957
|
-
this._camera.position.z = cameraZ;
|
|
8914
|
+
this._camera.position.z = Math.abs((maxDim / 2) * Math.atan(this._camera.fov / 2));
|
|
7958
8915
|
this._camera.lookAt(center);
|
|
7959
8916
|
};
|
|
7960
8917
|
Carousel3dComponent.prototype._checkNavigationButtons = function () {
|
|
@@ -8013,11 +8970,17 @@
|
|
|
8013
8970
|
this._rotate(800);
|
|
8014
8971
|
};
|
|
8015
8972
|
Carousel3dComponent.prototype._resizeCanvasToDisplaySize = function () {
|
|
8016
|
-
|
|
8017
|
-
|
|
8018
|
-
|
|
8019
|
-
|
|
8020
|
-
|
|
8973
|
+
var _this = this;
|
|
8974
|
+
setTimeout(function () {
|
|
8975
|
+
if (!_this.canvasContainer || !_this.canvasContainer.nativeElement) {
|
|
8976
|
+
return;
|
|
8977
|
+
}
|
|
8978
|
+
_this._camera.aspect = _this.canvasContainer.nativeElement.clientWidth / _this.canvasContainer.nativeElement.clientHeight;
|
|
8979
|
+
_this._camera.updateProjectionMatrix();
|
|
8980
|
+
_this._rendererCss.setSize(_this.canvasContainer.nativeElement.clientWidth, _this.canvasContainer.nativeElement.clientHeight);
|
|
8981
|
+
_this._renderer.setSize(_this.canvasContainer.nativeElement.clientWidth, _this.canvasContainer.nativeElement.clientHeight);
|
|
8982
|
+
_this._render();
|
|
8983
|
+
});
|
|
8021
8984
|
};
|
|
8022
8985
|
Carousel3dComponent.prototype._render = function () {
|
|
8023
8986
|
this._rendererCss.render(this._sceneCss, this._camera);
|
|
@@ -8085,6 +9048,8 @@
|
|
|
8085
9048
|
exports.CoDialogModule = CoDialogModule;
|
|
8086
9049
|
exports.CoDialogPromptComponent = CoDialogPromptComponent;
|
|
8087
9050
|
exports.CoDialogPromptModule = CoDialogPromptModule;
|
|
9051
|
+
exports.CoDialogWizardComponent = CoDialogWizardComponent;
|
|
9052
|
+
exports.CoDialogWizardModule = CoDialogWizardModule;
|
|
8088
9053
|
exports.CoGridComponent = CoGridComponent;
|
|
8089
9054
|
exports.CoGridModule = CoGridModule;
|
|
8090
9055
|
exports.CoKanbanComponent = CoKanbanComponent;
|
|
@@ -8137,6 +9102,8 @@
|
|
|
8137
9102
|
exports.PopupMessageDisplayComponent = PopupMessageDisplayComponent;
|
|
8138
9103
|
exports.PopupModule = PopupModule;
|
|
8139
9104
|
exports.PopupWindowShellComponent = PopupWindowShellComponent;
|
|
9105
|
+
exports.PriceDisplayPipe = PriceDisplayPipe;
|
|
9106
|
+
exports.PriceDisplayPipeModule = PriceDisplayPipeModule;
|
|
8140
9107
|
exports.PromptService = PromptService;
|
|
8141
9108
|
exports.SimpleGridColumnDirective = SimpleGridColumnDirective;
|
|
8142
9109
|
exports.SimpleGridComponent = SimpleGridComponent;
|
|
@@ -8146,19 +9113,21 @@
|
|
|
8146
9113
|
exports.TileModule = TileModule;
|
|
8147
9114
|
exports["ɵa"] = RippleModule;
|
|
8148
9115
|
exports["ɵb"] = MD_RIPPLE_GLOBAL_OPTIONS;
|
|
9116
|
+
exports["ɵba"] = BaseSimpleGridComponent;
|
|
9117
|
+
exports["ɵbb"] = SimpleGridCellComponent;
|
|
8149
9118
|
exports["ɵc"] = CoRippleDirective;
|
|
8150
9119
|
exports["ɵd"] = CoViewportRulerService;
|
|
8151
9120
|
exports["ɵe"] = CoScrollDispatcherService;
|
|
8152
9121
|
exports["ɵf"] = CoScrollableDirective;
|
|
8153
9122
|
exports["ɵg"] = StopClickModule;
|
|
8154
9123
|
exports["ɵh"] = StopClickDirective;
|
|
8155
|
-
exports["ɵi"] =
|
|
8156
|
-
exports["ɵj"] =
|
|
8157
|
-
exports["ɵk"] =
|
|
8158
|
-
exports["ɵl"] =
|
|
8159
|
-
exports["ɵm"] =
|
|
8160
|
-
exports["ɵn"] =
|
|
8161
|
-
exports["ɵo"] =
|
|
9124
|
+
exports["ɵi"] = InputBoolean;
|
|
9125
|
+
exports["ɵj"] = BaseModule;
|
|
9126
|
+
exports["ɵk"] = FormInputUserModelChangeListenerService;
|
|
9127
|
+
exports["ɵl"] = NgZoneWrapperService;
|
|
9128
|
+
exports["ɵm"] = BaseInputComponent;
|
|
9129
|
+
exports["ɵn"] = GridToolbarModule;
|
|
9130
|
+
exports["ɵo"] = GridToolbarComponent;
|
|
8162
9131
|
exports["ɵp"] = BaseSelectionGridComponent;
|
|
8163
9132
|
exports["ɵq"] = BaseInlineEditGridComponent;
|
|
8164
9133
|
exports["ɵr"] = BaseToolbarGridComponent;
|
|
@@ -8167,7 +9136,9 @@
|
|
|
8167
9136
|
exports["ɵu"] = AppendPipe;
|
|
8168
9137
|
exports["ɵv"] = ValidationErrorModule;
|
|
8169
9138
|
exports["ɵw"] = ValidationErrorComponent;
|
|
8170
|
-
exports["ɵx"] =
|
|
9139
|
+
exports["ɵx"] = CommitButtonsModule;
|
|
9140
|
+
exports["ɵy"] = CommitButtonsComponent;
|
|
9141
|
+
exports["ɵz"] = PopupShowerService;
|
|
8171
9142
|
|
|
8172
9143
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
8173
9144
|
|