@skyux/ag-grid 5.9.6 → 5.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/skyux-ag-grid.umd.js +314 -76
- package/documentation.json +526 -335
- package/esm2015/index.js +2 -0
- package/esm2015/index.js.map +1 -1
- package/esm2015/lib/modules/ag-grid/ag-grid.service.js +1 -1
- package/esm2015/lib/modules/ag-grid/ag-grid.service.js.map +1 -1
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-autocomplete/cell-editor-autocomplete.component.js +36 -3
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-autocomplete/cell-editor-autocomplete.component.js.map +1 -1
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-autocomplete/cell-editor-autocomplete.module.js +14 -4
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-autocomplete/cell-editor-autocomplete.module.js.map +1 -1
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-currency/cell-editor-currency.component.js +42 -7
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-currency/cell-editor-currency.component.js.map +1 -1
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-currency/cell-editor-currency.module.js +14 -4
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-currency/cell-editor-currency.module.js.map +1 -1
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-datepicker/cell-editor-datepicker.component.js +60 -13
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-datepicker/cell-editor-datepicker.component.js.map +1 -1
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-datepicker/cell-editor-datepicker.module.js +4 -4
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-datepicker/cell-editor-datepicker.module.js.map +1 -1
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-lookup/cell-editor-lookup.component.js +35 -9
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-lookup/cell-editor-lookup.component.js.map +1 -1
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-number/cell-editor-number.component.js +33 -3
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-number/cell-editor-number.component.js.map +1 -1
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-number/cell-editor-number.module.js +4 -4
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-number/cell-editor-number.module.js.map +1 -1
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-text/cell-editor-text.component.js +32 -3
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-text/cell-editor-text.component.js.map +1 -1
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-text/cell-editor-text.module.js +4 -4
- package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-text/cell-editor-text.module.js.map +1 -1
- package/esm2015/lib/modules/ag-grid/types/cell-editor-initial-action.js +13 -0
- package/esm2015/lib/modules/ag-grid/types/cell-editor-initial-action.js.map +1 -0
- package/esm2015/lib/modules/ag-grid/types/cell-editor-utils.js +31 -0
- package/esm2015/lib/modules/ag-grid/types/cell-editor-utils.js.map +1 -0
- package/fesm2015/skyux-ag-grid.js +296 -58
- package/fesm2015/skyux-ag-grid.js.map +1 -1
- package/index.d.ts +2 -0
- package/lib/modules/ag-grid/cell-editors/cell-editor-autocomplete/cell-editor-autocomplete.component.d.ts +4 -2
- package/lib/modules/ag-grid/cell-editors/cell-editor-autocomplete/cell-editor-autocomplete.module.d.ts +1 -1
- package/lib/modules/ag-grid/cell-editors/cell-editor-currency/cell-editor-currency.component.d.ts +8 -3
- package/lib/modules/ag-grid/cell-editors/cell-editor-currency/cell-editor-currency.module.d.ts +1 -1
- package/lib/modules/ag-grid/cell-editors/cell-editor-datepicker/cell-editor-datepicker.component.d.ts +7 -4
- package/lib/modules/ag-grid/cell-editors/cell-editor-datepicker/cell-editor-datepicker.module.d.ts +1 -1
- package/lib/modules/ag-grid/cell-editors/cell-editor-lookup/cell-editor-lookup.component.d.ts +2 -1
- package/lib/modules/ag-grid/cell-editors/cell-editor-number/cell-editor-number.component.d.ts +4 -2
- package/lib/modules/ag-grid/cell-editors/cell-editor-number/cell-editor-number.module.d.ts +1 -1
- package/lib/modules/ag-grid/cell-editors/cell-editor-text/cell-editor-text.component.d.ts +4 -2
- package/lib/modules/ag-grid/cell-editors/cell-editor-text/cell-editor-text.module.d.ts +1 -1
- package/lib/modules/ag-grid/types/cell-editor-initial-action.d.ts +11 -0
- package/lib/modules/ag-grid/types/cell-editor-utils.d.ts +9 -0
- package/package.json +12 -12
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
var _SkyAgGridCellEditorDatepickerComponent_triggerType;
|
|
2
|
+
import { __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
|
|
3
|
+
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Optional, ViewChild, ViewEncapsulation, } from '@angular/core';
|
|
4
|
+
import { FormControl, FormGroup } from '@angular/forms';
|
|
2
5
|
import { SkyThemeService } from '@skyux/theme';
|
|
3
6
|
import { PopupComponent } from 'ag-grid-community';
|
|
7
|
+
import { fromEvent } from 'rxjs';
|
|
8
|
+
import { first } from 'rxjs/operators';
|
|
9
|
+
import { SkyAgGridCellEditorInitialAction } from '../../types/cell-editor-initial-action';
|
|
10
|
+
import { SkyAgGridCellEditorUtils } from '../../types/cell-editor-utils';
|
|
4
11
|
import * as i0 from "@angular/core";
|
|
5
12
|
import * as i1 from "@skyux/theme";
|
|
6
13
|
import * as i2 from "@skyux/datetime";
|
|
@@ -9,25 +16,48 @@ import * as i3 from "@angular/forms";
|
|
|
9
16
|
* @internal
|
|
10
17
|
*/
|
|
11
18
|
export class SkyAgGridCellEditorDatepickerComponent extends PopupComponent {
|
|
12
|
-
constructor(themeSvc) {
|
|
19
|
+
constructor(changeDetector, themeSvc) {
|
|
13
20
|
super();
|
|
21
|
+
this.changeDetector = changeDetector;
|
|
14
22
|
this.themeSvc = themeSvc;
|
|
23
|
+
this.editorForm = new FormGroup({
|
|
24
|
+
date: new FormControl(),
|
|
25
|
+
});
|
|
15
26
|
this.skyComponentProperties = {};
|
|
27
|
+
_SkyAgGridCellEditorDatepickerComponent_triggerType.set(this, void 0);
|
|
16
28
|
}
|
|
17
29
|
/**
|
|
18
30
|
* agInit is called by agGrid once after the editor is created and provides the editor with the information it needs.
|
|
19
31
|
* @param params The cell editor params that include data about the cell, column, row, and grid.
|
|
20
32
|
*/
|
|
21
33
|
agInit(params) {
|
|
22
|
-
var _a;
|
|
34
|
+
var _a, _b;
|
|
23
35
|
this.params = params;
|
|
24
|
-
this
|
|
36
|
+
__classPrivateFieldSet(this, _SkyAgGridCellEditorDatepickerComponent_triggerType, SkyAgGridCellEditorUtils.getEditorInitialAction(params), "f");
|
|
37
|
+
const control = this.editorForm.get('date');
|
|
38
|
+
switch (__classPrivateFieldGet(this, _SkyAgGridCellEditorDatepickerComponent_triggerType, "f")) {
|
|
39
|
+
case SkyAgGridCellEditorInitialAction.Delete:
|
|
40
|
+
control.setValue(undefined);
|
|
41
|
+
break;
|
|
42
|
+
case SkyAgGridCellEditorInitialAction.Replace:
|
|
43
|
+
control.setValue(params.charPress);
|
|
44
|
+
break;
|
|
45
|
+
case SkyAgGridCellEditorInitialAction.Highlighted:
|
|
46
|
+
case SkyAgGridCellEditorInitialAction.Untouched:
|
|
47
|
+
default:
|
|
48
|
+
control.setValue(params.value);
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
if ((_a = this.params.skyComponentProperties) === null || _a === void 0 ? void 0 : _a.disabled) {
|
|
52
|
+
control.disable();
|
|
53
|
+
}
|
|
54
|
+
this.changeDetector.markForCheck();
|
|
25
55
|
this.skyComponentProperties = this.params.skyComponentProperties || {};
|
|
26
56
|
this.columnWidth = this.params.column.getActualWidth();
|
|
27
57
|
this.columnWidthWithoutBorders = this.columnWidth - 2;
|
|
28
58
|
this.rowHeightWithoutBorders =
|
|
29
59
|
this.params.node && this.params.node.rowHeight - 3;
|
|
30
|
-
(
|
|
60
|
+
(_b = this.themeSvc) === null || _b === void 0 ? void 0 : _b.settingsChange.subscribe((themeSettings) => {
|
|
31
61
|
if (themeSettings.currentSettings.theme.name === 'modern') {
|
|
32
62
|
this.columnWidthWithoutBorders = this.columnWidth;
|
|
33
63
|
this.rowHeightWithoutBorders =
|
|
@@ -44,21 +74,38 @@ export class SkyAgGridCellEditorDatepickerComponent extends PopupComponent {
|
|
|
44
74
|
* afterGuiAttached is called by agGrid after the editor is rendered in the DOM. Once it is attached the editor is ready to be focused on.
|
|
45
75
|
*/
|
|
46
76
|
afterGuiAttached() {
|
|
47
|
-
this.
|
|
77
|
+
const datepickerInputEl = this.datepickerInput
|
|
78
|
+
.nativeElement;
|
|
79
|
+
datepickerInputEl.focus();
|
|
80
|
+
// Programatically set the value of in the input; however, do not do this via the form control so that the value is not formatted when editing starts.
|
|
81
|
+
// Watch for the first blur and fire a 'change' event as programatic changes won't queue a change event, but we need to do this so that formatting happens if the user tabs to the calendar button.
|
|
82
|
+
if (__classPrivateFieldGet(this, _SkyAgGridCellEditorDatepickerComponent_triggerType, "f") === SkyAgGridCellEditorInitialAction.Replace) {
|
|
83
|
+
fromEvent(datepickerInputEl, 'blur')
|
|
84
|
+
.pipe(first())
|
|
85
|
+
.subscribe(() => {
|
|
86
|
+
datepickerInputEl.dispatchEvent(new Event('change'));
|
|
87
|
+
});
|
|
88
|
+
datepickerInputEl.select();
|
|
89
|
+
datepickerInputEl.setRangeText(this.params.charPress);
|
|
90
|
+
// Ensure the cursor is at the end of the text.
|
|
91
|
+
datepickerInputEl.setSelectionRange(this.params.charPress.length, this.params.charPress.length);
|
|
92
|
+
}
|
|
93
|
+
// this.changeDetector.markForCheck();
|
|
94
|
+
if (__classPrivateFieldGet(this, _SkyAgGridCellEditorDatepickerComponent_triggerType, "f") === SkyAgGridCellEditorInitialAction.Highlighted) {
|
|
95
|
+
datepickerInputEl.select();
|
|
96
|
+
}
|
|
48
97
|
}
|
|
49
98
|
/**
|
|
50
99
|
* getValue is called by agGrid when editing is stopped to get the new value of the cell.
|
|
51
100
|
*/
|
|
52
101
|
getValue() {
|
|
53
102
|
this.datepickerInput.nativeElement.blur();
|
|
54
|
-
return this.
|
|
55
|
-
}
|
|
56
|
-
focusOnDatepickerInput() {
|
|
57
|
-
this.datepickerInput.nativeElement.focus();
|
|
103
|
+
return this.editorForm.get('date').value;
|
|
58
104
|
}
|
|
59
105
|
}
|
|
60
|
-
|
|
61
|
-
SkyAgGridCellEditorDatepickerComponent.ɵ
|
|
106
|
+
_SkyAgGridCellEditorDatepickerComponent_triggerType = new WeakMap();
|
|
107
|
+
SkyAgGridCellEditorDatepickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorDatepickerComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.SkyThemeService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
108
|
+
SkyAgGridCellEditorDatepickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyAgGridCellEditorDatepickerComponent, selector: "sky-ag-grid-cell-editor-datepicker", viewQueries: [{ propertyName: "datepickerInput", first: true, predicate: ["skyCellEditorDatepickerInput"], descendants: true, read: ElementRef }], usesInheritance: true, ngImport: i0, template: "<div\n class=\"sky-ag-grid-cell-editor-datepicker\"\n [formGroup]=\"editorForm\"\n [style.width.px]=\"columnWidthWithoutBorders\"\n>\n <sky-datepicker\n data-sky-id=\"cell-datepicker\"\n pickerClass=\"ag-custom-component-popup\"\n >\n <input\n formControlName=\"date\"\n skyDatepickerInput\n [minDate]=\"skyComponentProperties.minDate\"\n [maxDate]=\"skyComponentProperties.maxDate\"\n [dateFormat]=\"skyComponentProperties.dateFormat\"\n [startingDay]=\"skyComponentProperties.startingDay\"\n [skyDatepickerNoValidate]=\"skyComponentProperties.skyDatepickerNoValidate\"\n [style.height.px]=\"rowHeightWithoutBorders\"\n #skyCellEditorDatepickerInput\n />\n </sky-datepicker>\n</div>\n", styles: [".sky-ag-grid-cell-editor-datepicker{position:relative;top:1px;left:1px}.sky-ag-grid-cell-editor-datepicker sky-datepicker input.sky-form-control{box-shadow:none;border-width:1px;border-style:solid;border-color:transparent #cdcfd2 transparent transparent}.sky-ag-grid-cell-editor-datepicker sky-datepicker .sky-input-group-datepicker-btn{border-radius:0}:host-context(.sky-theme-modern) .sky-ag-grid-cell-editor-datepicker{position:static;top:initial;left:initial}:host-context(.sky-theme-modern) .sky-ag-grid-cell-editor-datepicker sky-datepicker input.sky-form-control{border-radius:0;border:1px solid #1870B8}:host-context(.sky-theme-modern) .sky-ag-grid-cell-editor-datepicker sky-datepicker input.sky-form-control:focus{border-width:2px!important}.sky-theme-modern .sky-ag-grid-cell-editor-datepicker{position:static;top:initial;left:initial}.sky-theme-modern .sky-ag-grid-cell-editor-datepicker sky-datepicker input.sky-form-control{border-radius:0;border:1px solid #1870B8}.sky-theme-modern .sky-ag-grid-cell-editor-datepicker sky-datepicker input.sky-form-control:focus{border-width:2px!important}\n"], components: [{ type: i2.λ2, selector: "sky-datepicker", inputs: ["pickerClass"], outputs: ["calendarDateRangeChange"] }], directives: [{ type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i3.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i2.λ3, selector: "[skyDatepickerInput]", inputs: ["dateFormat", "disabled", "maxDate", "minDate", "skyDatepickerInput", "skyDatepickerNoValidate", "startingDay", "strict"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
62
109
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorDatepickerComponent, decorators: [{
|
|
63
110
|
type: Component,
|
|
64
111
|
args: [{
|
|
@@ -68,7 +115,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
68
115
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
69
116
|
encapsulation: ViewEncapsulation.None,
|
|
70
117
|
}]
|
|
71
|
-
}], ctorParameters: function () { return [{ type: i1.SkyThemeService, decorators: [{
|
|
118
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.SkyThemeService, decorators: [{
|
|
72
119
|
type: Optional
|
|
73
120
|
}] }]; }, propDecorators: { datepickerInput: [{
|
|
74
121
|
type: ViewChild,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell-editor-datepicker.component.js","sourceRoot":"","sources":["../../../../../../../../../../libs/components/ag-grid/src/lib/modules/ag-grid/cell-editors/cell-editor-datepicker/cell-editor-datepicker.component.ts","../../../../../../../../../../libs/components/ag-grid/src/lib/modules/ag-grid/cell-editors/cell-editor-datepicker/cell-editor-datepicker.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,UAAU,EACV,QAAQ,EACR,SAAS,EACT,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;;;;;
|
|
1
|
+
{"version":3,"file":"cell-editor-datepicker.component.js","sourceRoot":"","sources":["../../../../../../../../../../libs/components/ag-grid/src/lib/modules/ag-grid/cell-editors/cell-editor-datepicker/cell-editor-datepicker.component.ts","../../../../../../../../../../libs/components/ag-grid/src/lib/modules/ag-grid/cell-editors/cell-editor-datepicker/cell-editor-datepicker.component.html"],"names":[],"mappings":";;AAAA,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,QAAQ,EACR,SAAS,EACT,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGvC,OAAO,EAAE,gCAAgC,EAAE,MAAM,wCAAwC,CAAC;AAC1F,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;;;;;AAGzE;;GAEG;AAQH,MAAM,OAAO,sCACX,SAAQ,cAAc;IAiBtB,YACU,cAAiC,EACrB,QAA0B;QAE9C,KAAK,EAAE,CAAC;QAHA,mBAAc,GAAd,cAAc,CAAmB;QACrB,aAAQ,GAAR,QAAQ,CAAkB;QAdzC,eAAU,GAAG,IAAI,SAAS,CAAC;YAChC,IAAI,EAAE,IAAI,WAAW,EAAE;SACxB,CAAC,CAAC;QAEI,2BAAsB,GAAkC,EAAE,CAAC;QAMlE,sEAA+C;IAO/C,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,MAAqC;;QACjD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,uBAAA,IAAI,uDAAgB,wBAAwB,CAAC,sBAAsB,CAAC,MAAM,CAAC,MAAA,CAAC;QAC5E,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC5C,QAAQ,uBAAA,IA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CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC;IAC3C,CAAC;;;oIA3GU,sCAAsC;wHAAtC,sCAAsC,sLAaE,UAAU,oDC7C/D,8uBAsBA;4FDUa,sCAAsC;kBAPlD,SAAS;mBAAC;oBACT,QAAQ,EAAE,oCAAoC;oBAC9C,WAAW,EAAE,yCAAyC;oBACtD,SAAS,EAAE,CAAC,yCAAyC,CAAC;oBACtD,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,aAAa,EAAE,iBAAiB,CAAC,IAAI;iBACtC;;0BAqBI,QAAQ;4CANH,eAAe;sBADtB,SAAS;uBAAC,8BAA8B,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE","sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n Optional,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { FormControl, FormGroup } from '@angular/forms';\nimport { SkyThemeService } from '@skyux/theme';\n\nimport { ICellEditorAngularComp } from 'ag-grid-angular';\nimport { PopupComponent } from 'ag-grid-community';\nimport { fromEvent } from 'rxjs';\nimport { first } from 'rxjs/operators';\n\nimport { SkyCellEditorDatepickerParams } from '../../types/cell-editor-datepicker-params';\nimport { SkyAgGridCellEditorInitialAction } from '../../types/cell-editor-initial-action';\nimport { SkyAgGridCellEditorUtils } from '../../types/cell-editor-utils';\nimport { SkyAgGridDatepickerProperties } from '../../types/datepicker-properties';\n\n/**\n * @internal\n */\n@Component({\n selector: 'sky-ag-grid-cell-editor-datepicker',\n templateUrl: './cell-editor-datepicker.component.html',\n styleUrls: ['./cell-editor-datepicker.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class SkyAgGridCellEditorDatepickerComponent\n extends PopupComponent\n implements ICellEditorAngularComp\n{\n public columnWidth: number;\n public columnWidthWithoutBorders: number;\n public editorForm = new FormGroup({\n date: new FormControl(),\n });\n public rowHeightWithoutBorders: number;\n public skyComponentProperties: SkyAgGridDatepickerProperties = {};\n private params: SkyCellEditorDatepickerParams;\n\n @ViewChild('skyCellEditorDatepickerInput', { read: ElementRef })\n private datepickerInput: ElementRef;\n\n #triggerType: SkyAgGridCellEditorInitialAction;\n\n constructor(\n private changeDetector: ChangeDetectorRef,\n @Optional() private themeSvc?: SkyThemeService\n ) {\n super();\n }\n\n /**\n * agInit is called by agGrid once after the editor is created and provides the editor with the information it needs.\n * @param params The cell editor params that include data about the cell, column, row, and grid.\n */\n public agInit(params: SkyCellEditorDatepickerParams): void {\n this.params = params;\n\n this.#triggerType = SkyAgGridCellEditorUtils.getEditorInitialAction(params);\n const control = this.editorForm.get('date');\n switch (this.#triggerType) {\n case SkyAgGridCellEditorInitialAction.Delete:\n control.setValue(undefined);\n break;\n case SkyAgGridCellEditorInitialAction.Replace:\n control.setValue(params.charPress);\n break;\n case SkyAgGridCellEditorInitialAction.Highlighted:\n case SkyAgGridCellEditorInitialAction.Untouched:\n default:\n control.setValue(params.value);\n break;\n }\n if (this.params.skyComponentProperties?.disabled) {\n control.disable();\n }\n this.changeDetector.markForCheck();\n\n this.skyComponentProperties = this.params.skyComponentProperties || {};\n this.columnWidth = this.params.column.getActualWidth();\n this.columnWidthWithoutBorders = this.columnWidth - 2;\n this.rowHeightWithoutBorders =\n this.params.node && this.params.node.rowHeight - 3;\n this.themeSvc?.settingsChange.subscribe((themeSettings) => {\n if (themeSettings.currentSettings.theme.name === 'modern') {\n this.columnWidthWithoutBorders = this.columnWidth;\n this.rowHeightWithoutBorders =\n this.params.node && this.params.node.rowHeight;\n } else {\n this.columnWidthWithoutBorders = this.columnWidth - 2;\n this.rowHeightWithoutBorders =\n this.params.node && this.params.node.rowHeight - 3;\n }\n });\n }\n\n /**\n * afterGuiAttached is called by agGrid after the editor is rendered in the DOM. Once it is attached the editor is ready to be focused on.\n */\n public afterGuiAttached(): void {\n const datepickerInputEl = this.datepickerInput\n .nativeElement as HTMLInputElement;\n datepickerInputEl.focus();\n\n // Programatically set the value of in the input; however, do not do this via the form control so that the value is not formatted when editing starts.\n // Watch for the first blur and fire a 'change' event as programatic changes won't queue a change event, but we need to do this so that formatting happens if the user tabs to the calendar button.\n if (this.#triggerType === SkyAgGridCellEditorInitialAction.Replace) {\n fromEvent(datepickerInputEl, 'blur')\n .pipe(first())\n .subscribe(() => {\n datepickerInputEl.dispatchEvent(new Event('change'));\n });\n datepickerInputEl.select();\n datepickerInputEl.setRangeText(this.params.charPress);\n // Ensure the cursor is at the end of the text.\n datepickerInputEl.setSelectionRange(\n this.params.charPress.length,\n this.params.charPress.length\n );\n }\n\n // this.changeDetector.markForCheck();\n if (this.#triggerType === SkyAgGridCellEditorInitialAction.Highlighted) {\n datepickerInputEl.select();\n }\n }\n\n /**\n * getValue is called by agGrid when editing is stopped to get the new value of the cell.\n */\n public getValue(): Date {\n this.datepickerInput.nativeElement.blur();\n return this.editorForm.get('date').value;\n }\n}\n","<div\n class=\"sky-ag-grid-cell-editor-datepicker\"\n [formGroup]=\"editorForm\"\n [style.width.px]=\"columnWidthWithoutBorders\"\n>\n <sky-datepicker\n data-sky-id=\"cell-datepicker\"\n pickerClass=\"ag-custom-component-popup\"\n >\n <input\n formControlName=\"date\"\n skyDatepickerInput\n [minDate]=\"skyComponentProperties.minDate\"\n [maxDate]=\"skyComponentProperties.maxDate\"\n [dateFormat]=\"skyComponentProperties.dateFormat\"\n [startingDay]=\"skyComponentProperties.startingDay\"\n [skyDatepickerNoValidate]=\"skyComponentProperties.skyDatepickerNoValidate\"\n [style.height.px]=\"rowHeightWithoutBorders\"\n #skyCellEditorDatepickerInput\n />\n </sky-datepicker>\n</div>\n"]}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { NgModule } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
3
3
|
import { SkyDatepickerModule } from '@skyux/datetime';
|
|
4
4
|
import { SkyAgGridCellEditorDatepickerComponent } from '../cell-editor-datepicker/cell-editor-datepicker.component';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export class SkyAgGridCellEditorDatepickerModule {
|
|
7
7
|
}
|
|
8
8
|
SkyAgGridCellEditorDatepickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorDatepickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
9
|
-
SkyAgGridCellEditorDatepickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorDatepickerModule, declarations: [SkyAgGridCellEditorDatepickerComponent], imports: [SkyDatepickerModule,
|
|
10
|
-
SkyAgGridCellEditorDatepickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorDatepickerModule, imports: [[SkyDatepickerModule,
|
|
9
|
+
SkyAgGridCellEditorDatepickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorDatepickerModule, declarations: [SkyAgGridCellEditorDatepickerComponent], imports: [SkyDatepickerModule, ReactiveFormsModule], exports: [SkyAgGridCellEditorDatepickerComponent] });
|
|
10
|
+
SkyAgGridCellEditorDatepickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorDatepickerModule, imports: [[SkyDatepickerModule, ReactiveFormsModule]] });
|
|
11
11
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorDatepickerModule, decorators: [{
|
|
12
12
|
type: NgModule,
|
|
13
13
|
args: [{
|
|
14
|
-
imports: [SkyDatepickerModule,
|
|
14
|
+
imports: [SkyDatepickerModule, ReactiveFormsModule],
|
|
15
15
|
declarations: [SkyAgGridCellEditorDatepickerComponent],
|
|
16
16
|
exports: [SkyAgGridCellEditorDatepickerComponent],
|
|
17
17
|
}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell-editor-datepicker.module.js","sourceRoot":"","sources":["../../../../../../../../../../libs/components/ag-grid/src/lib/modules/ag-grid/cell-editors/cell-editor-datepicker/cell-editor-datepicker.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"cell-editor-datepicker.module.js","sourceRoot":"","sources":["../../../../../../../../../../libs/components/ag-grid/src/lib/modules/ag-grid/cell-editors/cell-editor-datepicker/cell-editor-datepicker.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EAAE,sCAAsC,EAAE,MAAM,4DAA4D,CAAC;;AAOpH,MAAM,OAAO,mCAAmC;;iIAAnC,mCAAmC;kIAAnC,mCAAmC,iBAH/B,sCAAsC,aAD3C,mBAAmB,EAAE,mBAAmB,aAExC,sCAAsC;kIAErC,mCAAmC,YAJrC,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;4FAIxC,mCAAmC;kBAL/C,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;oBACnD,YAAY,EAAE,CAAC,sCAAsC,CAAC;oBACtD,OAAO,EAAE,CAAC,sCAAsC,CAAC;iBAClD","sourcesContent":["import { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { SkyDatepickerModule } from '@skyux/datetime';\n\nimport { SkyAgGridCellEditorDatepickerComponent } from '../cell-editor-datepicker/cell-editor-datepicker.component';\n\n@NgModule({\n imports: [SkyDatepickerModule, ReactiveFormsModule],\n declarations: [SkyAgGridCellEditorDatepickerComponent],\n exports: [SkyAgGridCellEditorDatepickerComponent],\n})\nexport class SkyAgGridCellEditorDatepickerModule {}\n"]}
|
package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-lookup/cell-editor-lookup.component.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
var _SkyAgGridCellEditorLookupComponent_triggerType;
|
|
2
|
+
import { __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
|
|
1
3
|
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, HostBinding, } from '@angular/core';
|
|
2
4
|
import { FormControl, FormGroup } from '@angular/forms';
|
|
3
5
|
import { applySkyLookupPropertiesDefaults } from '../../apply-lookup-properties-defaults';
|
|
6
|
+
import { SkyAgGridCellEditorInitialAction } from '../../types/cell-editor-initial-action';
|
|
7
|
+
import { SkyAgGridCellEditorUtils } from '../../types/cell-editor-utils';
|
|
4
8
|
import * as i0 from "@angular/core";
|
|
5
9
|
import * as i1 from "@skyux/forms";
|
|
6
10
|
import * as i2 from "@skyux/lookup";
|
|
@@ -14,21 +18,33 @@ export class SkyAgGridCellEditorLookupComponent {
|
|
|
14
18
|
this.changeDetector = changeDetector;
|
|
15
19
|
this.elementRef = elementRef;
|
|
16
20
|
this.isAlive = false;
|
|
17
|
-
this.
|
|
18
|
-
|
|
21
|
+
this.editorForm = new FormGroup({
|
|
22
|
+
selection: new FormControl({
|
|
19
23
|
value: [],
|
|
20
24
|
disabled: false,
|
|
21
25
|
}),
|
|
22
26
|
});
|
|
23
27
|
this.useAsyncSearch = false;
|
|
28
|
+
_SkyAgGridCellEditorLookupComponent_triggerType.set(this, void 0);
|
|
24
29
|
}
|
|
25
30
|
agInit(params) {
|
|
26
31
|
this.params = params;
|
|
27
32
|
if (!Array.isArray(this.params.value)) {
|
|
28
33
|
throw new Error(`Lookup value must be an array`);
|
|
29
34
|
}
|
|
30
|
-
|
|
31
|
-
control
|
|
35
|
+
__classPrivateFieldSet(this, _SkyAgGridCellEditorLookupComponent_triggerType, SkyAgGridCellEditorUtils.getEditorInitialAction(params), "f");
|
|
36
|
+
const control = this.editorForm.get('selection');
|
|
37
|
+
switch (__classPrivateFieldGet(this, _SkyAgGridCellEditorLookupComponent_triggerType, "f")) {
|
|
38
|
+
case SkyAgGridCellEditorInitialAction.Delete:
|
|
39
|
+
control.setValue([]);
|
|
40
|
+
break;
|
|
41
|
+
case SkyAgGridCellEditorInitialAction.Replace:
|
|
42
|
+
case SkyAgGridCellEditorInitialAction.Highlighted:
|
|
43
|
+
case SkyAgGridCellEditorInitialAction.Untouched:
|
|
44
|
+
default:
|
|
45
|
+
control.setValue(params.value);
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
32
48
|
if (this.params.skyComponentProperties.disabled) {
|
|
33
49
|
control.disable();
|
|
34
50
|
}
|
|
@@ -53,23 +69,33 @@ export class SkyAgGridCellEditorLookupComponent {
|
|
|
53
69
|
return this.elementRef.nativeElement;
|
|
54
70
|
}
|
|
55
71
|
getValue() {
|
|
56
|
-
return this.
|
|
72
|
+
return this.editorForm.get('selection').value;
|
|
57
73
|
}
|
|
58
74
|
isPopup() {
|
|
59
75
|
return true;
|
|
60
76
|
}
|
|
61
|
-
/*istanbul ignore next*/
|
|
62
77
|
afterGuiAttached() {
|
|
63
|
-
|
|
64
|
-
|
|
78
|
+
const lookupInput = this.elementRef.nativeElement.querySelector('.sky-lookup-input');
|
|
79
|
+
lookupInput.focus();
|
|
80
|
+
if (__classPrivateFieldGet(this, _SkyAgGridCellEditorLookupComponent_triggerType, "f") === SkyAgGridCellEditorInitialAction.Replace) {
|
|
81
|
+
lookupInput.select();
|
|
82
|
+
lookupInput.setRangeText(this.params.charPress);
|
|
83
|
+
// Ensure the cursor is at the end of the text.
|
|
84
|
+
lookupInput.setSelectionRange(lookupInput.value.length, lookupInput.value.length);
|
|
85
|
+
lookupInput.dispatchEvent(new Event('input'));
|
|
86
|
+
}
|
|
87
|
+
if (__classPrivateFieldGet(this, _SkyAgGridCellEditorLookupComponent_triggerType, "f") === SkyAgGridCellEditorInitialAction.Highlighted) {
|
|
88
|
+
lookupInput.select();
|
|
89
|
+
}
|
|
65
90
|
}
|
|
66
91
|
updateComponentProperties(params) {
|
|
67
92
|
const skyLookupProperties = params.skyComponentProperties;
|
|
68
93
|
return applySkyLookupPropertiesDefaults(skyLookupProperties);
|
|
69
94
|
}
|
|
70
95
|
}
|
|
96
|
+
_SkyAgGridCellEditorLookupComponent_triggerType = new WeakMap();
|
|
71
97
|
SkyAgGridCellEditorLookupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorLookupComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
72
|
-
SkyAgGridCellEditorLookupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyAgGridCellEditorLookupComponent, selector: "sky-ag-grid-cell-editor-lookup", host: { properties: { "style.width.px": "this.width" } }, ngImport: i0, template: "<sky-input-box\n *ngIf=\"isAlive && useAsyncSearch\"\n [disabled]=\"skyComponentProperties?.disabled\"\n [formGroup]=\"
|
|
98
|
+
SkyAgGridCellEditorLookupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyAgGridCellEditorLookupComponent, selector: "sky-ag-grid-cell-editor-lookup", host: { properties: { "style.width.px": "this.width" } }, ngImport: i0, template: "<sky-input-box\n *ngIf=\"isAlive && useAsyncSearch\"\n [disabled]=\"skyComponentProperties?.disabled\"\n [formGroup]=\"editorForm\"\n>\n <sky-lookup\n [ariaLabel]=\"skyComponentProperties?.ariaLabel\"\n [autocompleteAttribute]=\"skyComponentProperties?.autocompleteAttribute\"\n [data]=\"skyComponentProperties?.data\"\n [debounceTime]=\"skyComponentProperties?.debounceTime\"\n [descriptorProperty]=\"skyComponentProperties?.descriptorProperty\"\n [enableShowMore]=\"skyComponentProperties?.enableShowMore\"\n formControlName=\"selection\"\n [idProperty]=\"skyComponentProperties?.idProperty\"\n [placeholderText]=\"skyComponentProperties?.placeholderText\"\n [propertiesToSearch]=\"skyComponentProperties?.propertiesToSearch\"\n [searchFilters]=\"skyComponentProperties?.searchFilters\"\n [searchResultsLimit]=\"skyComponentProperties?.searchResultsLimit\"\n [searchResultTemplate]=\"skyComponentProperties?.searchResultTemplate\"\n [searchTextMinimumCharacters]=\"\n skyComponentProperties?.searchTextMinimumCharacters\n \"\n (searchAsync)=\"skyComponentProperties.searchAsync($event)\"\n [selectMode]=\"skyComponentProperties?.selectMode\"\n [showAddButton]=\"skyComponentProperties?.showAddButton\"\n [showMoreConfig]=\"skyComponentProperties?.showMoreConfig\"\n [wrapperClass]=\"skyComponentProperties?.wrapperClass\"\n >\n </sky-lookup>\n</sky-input-box>\n<sky-input-box\n *ngIf=\"isAlive && !useAsyncSearch\"\n [disabled]=\"skyComponentProperties?.disabled\"\n [formGroup]=\"editorForm\"\n>\n <sky-lookup\n [ariaLabel]=\"skyComponentProperties?.ariaLabel\"\n [autocompleteAttribute]=\"skyComponentProperties?.autocompleteAttribute\"\n [data]=\"skyComponentProperties?.data\"\n [debounceTime]=\"skyComponentProperties?.debounceTime\"\n [descriptorProperty]=\"skyComponentProperties?.descriptorProperty\"\n [enableShowMore]=\"skyComponentProperties?.enableShowMore\"\n formControlName=\"selection\"\n [idProperty]=\"skyComponentProperties?.idProperty\"\n [placeholderText]=\"skyComponentProperties?.placeholderText\"\n [propertiesToSearch]=\"skyComponentProperties?.propertiesToSearch\"\n [search]=\"skyComponentProperties?.search\"\n [searchFilters]=\"skyComponentProperties?.searchFilters\"\n [searchResultsLimit]=\"skyComponentProperties?.searchResultsLimit\"\n [searchResultTemplate]=\"skyComponentProperties?.searchResultTemplate\"\n [searchTextMinimumCharacters]=\"\n skyComponentProperties?.searchTextMinimumCharacters\n \"\n [selectMode]=\"skyComponentProperties?.selectMode\"\n [showAddButton]=\"skyComponentProperties?.showAddButton\"\n [showMoreConfig]=\"skyComponentProperties?.showMoreConfig\"\n [wrapperClass]=\"skyComponentProperties?.wrapperClass\"\n >\n </sky-lookup>\n</sky-input-box>\n", styles: [":host{display:block}\n"], components: [{ type: i1.λ10, selector: "sky-input-box", inputs: ["hasErrors", "disabled"] }, { type: i2.λ4, selector: "sky-lookup", inputs: ["ariaLabel", "ariaLabelledBy", "autocompleteAttribute", "data", "disabled", "enableShowMore", "placeholderText", "idProperty", "showAddButton", "showMoreConfig", "selectMode", "wrapperClass"], outputs: ["addClick"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
73
99
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorLookupComponent, decorators: [{
|
|
74
100
|
type: Component,
|
|
75
101
|
args: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell-editor-lookup.component.js","sourceRoot":"","sources":["../../../../../../../../../../libs/components/ag-grid/src/lib/modules/ag-grid/cell-editors/cell-editor-lookup/cell-editor-lookup.component.ts","../../../../../../../../../../libs/components/ag-grid/src/lib/modules/ag-grid/cell-editors/cell-editor-lookup/cell-editor-lookup.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,SAA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AClD,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;iIAKQ,KAAK;sBADX,WAAW;uBAAC,gBAAgB","sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n HostBinding,\n} from '@angular/core';\nimport { FormControl, FormGroup } from '@angular/forms';\n\nimport { ICellEditorAngularComp } from 'ag-grid-angular';\nimport { ColumnResizedEvent } from 'ag-grid-community';\nimport { IPopupComponent } from 'ag-grid-community/dist/lib/interfaces/iPopupComponent';\n\nimport { applySkyLookupPropertiesDefaults } from '../../apply-lookup-properties-defaults';\nimport { SkyCellEditorLookupParams } from '../../types/cell-editor-lookup-params';\nimport { SkyAgGridLookupProperties } from '../../types/lookup-properties';\n\n/**\n * @internal\n */\n@Component({\n selector: 'sky-ag-grid-cell-editor-lookup',\n templateUrl: './cell-editor-lookup.component.html',\n styleUrls: ['./cell-editor-lookup.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyAgGridCellEditorLookupComponent\n implements ICellEditorAngularComp, IPopupComponent<any>\n{\n @HostBinding('style.width.px')\n public width: number;\n\n public skyComponentProperties?: SkyAgGridLookupProperties;\n public isAlive = false;\n public lookupForm = new FormGroup({\n currentSelection: new FormControl({\n value: [],\n disabled: false,\n }),\n });\n public useAsyncSearch = false;\n\n private params: SkyCellEditorLookupParams;\n\n constructor(\n private changeDetector: ChangeDetectorRef,\n private elementRef: ElementRef\n ) {}\n\n public agInit(params: SkyCellEditorLookupParams): void {\n this.params = params;\n if (!Array.isArray(this.params.value)) {\n throw new Error(`Lookup value must be an array`);\n }\n const control = this.lookupForm.get('currentSelection');\n control.setValue(this.params.value);\n if (this.params.skyComponentProperties.disabled) {\n control.disable();\n }\n this.skyComponentProperties = this.updateComponentProperties(this.params);\n this.useAsyncSearch =\n typeof this.skyComponentProperties.searchAsync === 'function';\n this.isAlive = true;\n this.width = this.params.column.getActualWidth();\n this.params.column.addEventListener(\n 'uiColumnResized',\n (event: ColumnResizedEvent) => {\n this.width = event.column.getActualWidth();\n this.changeDetector.markForCheck();\n }\n );\n this.changeDetector.markForCheck();\n }\n\n public isCancelAfterEnd(): boolean {\n // Shut down components to commit values before final value syncs to grid.\n this.isAlive = false;\n this.changeDetector.detectChanges();\n return false;\n }\n\n public getGui(): HTMLElement {\n return this.elementRef.nativeElement;\n }\n\n public getValue(): any[] {\n return this.lookupForm.get('currentSelection').value;\n }\n\n public isPopup(): boolean {\n return true;\n }\n\n /*istanbul ignore next*/\n public afterGuiAttached(): void {\n this.elementRef.nativeElement.querySelector('.sky-lookup-input')?.focus();\n }\n\n private updateComponentProperties(\n params: SkyCellEditorLookupParams\n ): SkyAgGridLookupProperties {\n const skyLookupProperties = params.skyComponentProperties;\n return applySkyLookupPropertiesDefaults(skyLookupProperties);\n }\n}\n","<sky-input-box\n *ngIf=\"isAlive && useAsyncSearch\"\n [disabled]=\"skyComponentProperties?.disabled\"\n [formGroup]=\"lookupForm\"\n>\n <sky-lookup\n [ariaLabel]=\"skyComponentProperties?.ariaLabel\"\n [autocompleteAttribute]=\"skyComponentProperties?.autocompleteAttribute\"\n [data]=\"skyComponentProperties?.data\"\n [debounceTime]=\"skyComponentProperties?.debounceTime\"\n [descriptorProperty]=\"skyComponentProperties?.descriptorProperty\"\n [enableShowMore]=\"skyComponentProperties?.enableShowMore\"\n formControlName=\"currentSelection\"\n [idProperty]=\"skyComponentProperties?.idProperty\"\n [placeholderText]=\"skyComponentProperties?.placeholderText\"\n [propertiesToSearch]=\"skyComponentProperties?.propertiesToSearch\"\n [searchFilters]=\"skyComponentProperties?.searchFilters\"\n [searchResultsLimit]=\"skyComponentProperties?.searchResultsLimit\"\n [searchResultTemplate]=\"skyComponentProperties?.searchResultTemplate\"\n [searchTextMinimumCharacters]=\"\n skyComponentProperties?.searchTextMinimumCharacters\n \"\n (searchAsync)=\"skyComponentProperties.searchAsync($event)\"\n [selectMode]=\"skyComponentProperties?.selectMode\"\n [showAddButton]=\"skyComponentProperties?.showAddButton\"\n [showMoreConfig]=\"skyComponentProperties?.showMoreConfig\"\n [wrapperClass]=\"skyComponentProperties?.wrapperClass\"\n >\n </sky-lookup>\n</sky-input-box>\n<sky-input-box\n *ngIf=\"isAlive && !useAsyncSearch\"\n [disabled]=\"skyComponentProperties?.disabled\"\n [formGroup]=\"lookupForm\"\n>\n <sky-lookup\n [ariaLabel]=\"skyComponentProperties?.ariaLabel\"\n [autocompleteAttribute]=\"skyComponentProperties?.autocompleteAttribute\"\n [data]=\"skyComponentProperties?.data\"\n [debounceTime]=\"skyComponentProperties?.debounceTime\"\n [descriptorProperty]=\"skyComponentProperties?.descriptorProperty\"\n [enableShowMore]=\"skyComponentProperties?.enableShowMore\"\n formControlName=\"currentSelection\"\n [idProperty]=\"skyComponentProperties?.idProperty\"\n [placeholderText]=\"skyComponentProperties?.placeholderText\"\n [propertiesToSearch]=\"skyComponentProperties?.propertiesToSearch\"\n [search]=\"skyComponentProperties?.search\"\n [searchFilters]=\"skyComponentProperties?.searchFilters\"\n [searchResultsLimit]=\"skyComponentProperties?.searchResultsLimit\"\n [searchResultTemplate]=\"skyComponentProperties?.searchResultTemplate\"\n [searchTextMinimumCharacters]=\"\n skyComponentProperties?.searchTextMinimumCharacters\n \"\n [selectMode]=\"skyComponentProperties?.selectMode\"\n [showAddButton]=\"skyComponentProperties?.showAddButton\"\n [showMoreConfig]=\"skyComponentProperties?.showMoreConfig\"\n [wrapperClass]=\"skyComponentProperties?.wrapperClass\"\n >\n </sky-lookup>\n</sky-input-box>\n"]}
|
|
1
|
+
{"version":3,"file":"cell-editor-lookup.component.js","sourceRoot":"","sources":["../../../../../../../../../../libs/components/ag-grid/src/lib/modules/ag-grid/cell-editors/cell-editor-lookup/cell-editor-lookup.component.ts","../../../../../../../../../../libs/components/ag-grid/src/lib/modules/ag-grid/cell-editors/cell-editor-lookup/cell-editor-lookup.component.html"],"names":[],"mappings":";;AAAA,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,SAA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QACrB,MAAM,WAAW,GACf,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC;QACnE,WAAW,CAAC,KAAK,EAAE,CAAC;QACpB,IAAI,uBAAA,IAAI,uDAAa,KAAK,gCAAgC,CAAC,OAAO,EAAE;YAClE,WAAW,CAAC,MAAM,EAAE,CAAC;YACrB,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YAChD,+CAA+C;YAC/C,WAAW,CAAC,iBAAiB,CAC3B,WAAW,CAAC,KAAK,CAAC,MAAM,EACxB,WAAW,CAAC,KAAK,CAAC,MAAM,CACzB,CAAC;YACF,WAAW,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;SAC/C;QACD,IAAI,uBAAA,IAAI,uDAAa,KAAK,gCAAgC,CAAC,WAAW,EAAE;YACtE,WAAW,CAAC,MAAM,EAAE,CAAC;SACtB;IACH,CAAC;IAEO,yBAAyB,CAC/B,MAAiC;QAEjC,MAAM,mBAAmB,GAAG,MAAM,CAAC,sBAAsB,CAAC;QAC1D,OAAO,gCAAgC,CAAC,mBAAmB,CAAC,CAAC;IAC/D,CAAC;;;gIAzGU,kCAAkC;oHAAlC,kCAAkC,gIC5B/C,syFA4DA;4FDhCa,kCAAkC;kBAN9C,SAAS;mBAAC;oBACT,QAAQ,EAAE,gCAAgC;oBAC1C,WAAW,EAAE,qCAAqC;oBAClD,SAAS,EAAE,CAAC,qCAAqC,CAAC;oBAClD,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;iIAKQ,KAAK;sBADX,WAAW;uBAAC,gBAAgB","sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n HostBinding,\n} from '@angular/core';\nimport { FormControl, FormGroup } from '@angular/forms';\n\nimport { ICellEditorAngularComp } from 'ag-grid-angular';\nimport { ColumnResizedEvent } from 'ag-grid-community';\nimport { IPopupComponent } from 'ag-grid-community/dist/lib/interfaces/iPopupComponent';\n\nimport { applySkyLookupPropertiesDefaults } from '../../apply-lookup-properties-defaults';\nimport { SkyAgGridCellEditorInitialAction } from '../../types/cell-editor-initial-action';\nimport { SkyCellEditorLookupParams } from '../../types/cell-editor-lookup-params';\nimport { SkyAgGridCellEditorUtils } from '../../types/cell-editor-utils';\nimport { SkyAgGridLookupProperties } from '../../types/lookup-properties';\n\n/**\n * @internal\n */\n@Component({\n selector: 'sky-ag-grid-cell-editor-lookup',\n templateUrl: './cell-editor-lookup.component.html',\n styleUrls: ['./cell-editor-lookup.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyAgGridCellEditorLookupComponent\n implements ICellEditorAngularComp, IPopupComponent<any>\n{\n @HostBinding('style.width.px')\n public width: number;\n\n public skyComponentProperties?: SkyAgGridLookupProperties;\n public isAlive = false;\n public editorForm = new FormGroup({\n selection: new FormControl({\n value: [],\n disabled: false,\n }),\n });\n public useAsyncSearch = false;\n\n private params: SkyCellEditorLookupParams;\n\n #triggerType: SkyAgGridCellEditorInitialAction;\n\n constructor(\n private changeDetector: ChangeDetectorRef,\n private elementRef: ElementRef\n ) {}\n\n public agInit(params: SkyCellEditorLookupParams): void {\n this.params = params;\n if (!Array.isArray(this.params.value)) {\n throw new Error(`Lookup value must be an array`);\n }\n\n this.#triggerType = SkyAgGridCellEditorUtils.getEditorInitialAction(params);\n const control = this.editorForm.get('selection');\n switch (this.#triggerType) {\n case SkyAgGridCellEditorInitialAction.Delete:\n control.setValue([]);\n break;\n case SkyAgGridCellEditorInitialAction.Replace:\n case SkyAgGridCellEditorInitialAction.Highlighted:\n case SkyAgGridCellEditorInitialAction.Untouched:\n default:\n control.setValue(params.value);\n break;\n }\n if (this.params.skyComponentProperties.disabled) {\n control.disable();\n }\n this.skyComponentProperties = this.updateComponentProperties(this.params);\n this.useAsyncSearch =\n typeof this.skyComponentProperties.searchAsync === 'function';\n this.isAlive = true;\n this.width = this.params.column.getActualWidth();\n this.params.column.addEventListener(\n 'uiColumnResized',\n (event: ColumnResizedEvent) => {\n this.width = event.column.getActualWidth();\n this.changeDetector.markForCheck();\n }\n );\n this.changeDetector.markForCheck();\n }\n\n public isCancelAfterEnd(): boolean {\n // Shut down components to commit values before final value syncs to grid.\n this.isAlive = false;\n this.changeDetector.detectChanges();\n return false;\n }\n\n public getGui(): HTMLElement {\n return this.elementRef.nativeElement;\n }\n\n public getValue(): any[] {\n return this.editorForm.get('selection').value;\n }\n\n public isPopup(): boolean {\n return true;\n }\n\n public afterGuiAttached(): void {\n const lookupInput: HTMLTextAreaElement =\n this.elementRef.nativeElement.querySelector('.sky-lookup-input');\n lookupInput.focus();\n if (this.#triggerType === SkyAgGridCellEditorInitialAction.Replace) {\n lookupInput.select();\n lookupInput.setRangeText(this.params.charPress);\n // Ensure the cursor is at the end of the text.\n lookupInput.setSelectionRange(\n lookupInput.value.length,\n lookupInput.value.length\n );\n lookupInput.dispatchEvent(new Event('input'));\n }\n if (this.#triggerType === SkyAgGridCellEditorInitialAction.Highlighted) {\n lookupInput.select();\n }\n }\n\n private updateComponentProperties(\n params: SkyCellEditorLookupParams\n ): SkyAgGridLookupProperties {\n const skyLookupProperties = params.skyComponentProperties;\n return applySkyLookupPropertiesDefaults(skyLookupProperties);\n }\n}\n","<sky-input-box\n *ngIf=\"isAlive && useAsyncSearch\"\n [disabled]=\"skyComponentProperties?.disabled\"\n [formGroup]=\"editorForm\"\n>\n <sky-lookup\n [ariaLabel]=\"skyComponentProperties?.ariaLabel\"\n [autocompleteAttribute]=\"skyComponentProperties?.autocompleteAttribute\"\n [data]=\"skyComponentProperties?.data\"\n [debounceTime]=\"skyComponentProperties?.debounceTime\"\n [descriptorProperty]=\"skyComponentProperties?.descriptorProperty\"\n [enableShowMore]=\"skyComponentProperties?.enableShowMore\"\n formControlName=\"selection\"\n [idProperty]=\"skyComponentProperties?.idProperty\"\n [placeholderText]=\"skyComponentProperties?.placeholderText\"\n [propertiesToSearch]=\"skyComponentProperties?.propertiesToSearch\"\n [searchFilters]=\"skyComponentProperties?.searchFilters\"\n [searchResultsLimit]=\"skyComponentProperties?.searchResultsLimit\"\n [searchResultTemplate]=\"skyComponentProperties?.searchResultTemplate\"\n [searchTextMinimumCharacters]=\"\n skyComponentProperties?.searchTextMinimumCharacters\n \"\n (searchAsync)=\"skyComponentProperties.searchAsync($event)\"\n [selectMode]=\"skyComponentProperties?.selectMode\"\n [showAddButton]=\"skyComponentProperties?.showAddButton\"\n [showMoreConfig]=\"skyComponentProperties?.showMoreConfig\"\n [wrapperClass]=\"skyComponentProperties?.wrapperClass\"\n >\n </sky-lookup>\n</sky-input-box>\n<sky-input-box\n *ngIf=\"isAlive && !useAsyncSearch\"\n [disabled]=\"skyComponentProperties?.disabled\"\n [formGroup]=\"editorForm\"\n>\n <sky-lookup\n [ariaLabel]=\"skyComponentProperties?.ariaLabel\"\n [autocompleteAttribute]=\"skyComponentProperties?.autocompleteAttribute\"\n [data]=\"skyComponentProperties?.data\"\n [debounceTime]=\"skyComponentProperties?.debounceTime\"\n [descriptorProperty]=\"skyComponentProperties?.descriptorProperty\"\n [enableShowMore]=\"skyComponentProperties?.enableShowMore\"\n formControlName=\"selection\"\n [idProperty]=\"skyComponentProperties?.idProperty\"\n [placeholderText]=\"skyComponentProperties?.placeholderText\"\n [propertiesToSearch]=\"skyComponentProperties?.propertiesToSearch\"\n [search]=\"skyComponentProperties?.search\"\n [searchFilters]=\"skyComponentProperties?.searchFilters\"\n [searchResultsLimit]=\"skyComponentProperties?.searchResultsLimit\"\n [searchResultTemplate]=\"skyComponentProperties?.searchResultTemplate\"\n [searchTextMinimumCharacters]=\"\n skyComponentProperties?.searchTextMinimumCharacters\n \"\n [selectMode]=\"skyComponentProperties?.selectMode\"\n [showAddButton]=\"skyComponentProperties?.showAddButton\"\n [showMoreConfig]=\"skyComponentProperties?.showMoreConfig\"\n [wrapperClass]=\"skyComponentProperties?.wrapperClass\"\n >\n </sky-lookup>\n</sky-input-box>\n"]}
|
package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-number/cell-editor-number.component.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
var _SkyAgGridCellEditorNumberComponent_triggerType;
|
|
2
|
+
import { __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
|
|
1
3
|
import { ChangeDetectionStrategy, Component, ElementRef, ViewChild, } from '@angular/core';
|
|
4
|
+
import { FormControl, FormGroup } from '@angular/forms';
|
|
5
|
+
import { SkyAgGridCellEditorInitialAction } from '../../types/cell-editor-initial-action';
|
|
6
|
+
import { SkyAgGridCellEditorUtils } from '../../types/cell-editor-utils';
|
|
2
7
|
import * as i0 from "@angular/core";
|
|
3
8
|
import * as i1 from "@angular/forms";
|
|
4
9
|
import * as i2 from "@skyux/i18n";
|
|
@@ -6,6 +11,12 @@ import * as i2 from "@skyux/i18n";
|
|
|
6
11
|
* @internal
|
|
7
12
|
*/
|
|
8
13
|
export class SkyAgGridCellEditorNumberComponent {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.editorForm = new FormGroup({
|
|
16
|
+
number: new FormControl(),
|
|
17
|
+
});
|
|
18
|
+
_SkyAgGridCellEditorNumberComponent_triggerType.set(this, void 0);
|
|
19
|
+
}
|
|
9
20
|
/**
|
|
10
21
|
* agInit is called by agGrid once after the editor is created and provides the editor with the information it needs.
|
|
11
22
|
* @param params The cell editor params that include data about the cell, column, row, and grid.
|
|
@@ -13,7 +24,21 @@ export class SkyAgGridCellEditorNumberComponent {
|
|
|
13
24
|
agInit(params) {
|
|
14
25
|
var _a, _b;
|
|
15
26
|
this.params = params;
|
|
16
|
-
this
|
|
27
|
+
__classPrivateFieldSet(this, _SkyAgGridCellEditorNumberComponent_triggerType, SkyAgGridCellEditorUtils.getEditorInitialAction(params), "f");
|
|
28
|
+
const control = this.editorForm.get('number');
|
|
29
|
+
switch (__classPrivateFieldGet(this, _SkyAgGridCellEditorNumberComponent_triggerType, "f")) {
|
|
30
|
+
case SkyAgGridCellEditorInitialAction.Delete:
|
|
31
|
+
control.setValue(undefined);
|
|
32
|
+
break;
|
|
33
|
+
case SkyAgGridCellEditorInitialAction.Replace:
|
|
34
|
+
control.setValue(parseFloat(this.params.charPress) || undefined);
|
|
35
|
+
break;
|
|
36
|
+
case SkyAgGridCellEditorInitialAction.Highlighted:
|
|
37
|
+
case SkyAgGridCellEditorInitialAction.Untouched:
|
|
38
|
+
default:
|
|
39
|
+
control.setValue(params.value);
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
17
42
|
this.max = (_a = params.skyComponentProperties) === null || _a === void 0 ? void 0 : _a.max;
|
|
18
43
|
this.min = (_b = params.skyComponentProperties) === null || _b === void 0 ? void 0 : _b.min;
|
|
19
44
|
this.columnHeader = this.params.colDef.headerName;
|
|
@@ -27,16 +52,21 @@ export class SkyAgGridCellEditorNumberComponent {
|
|
|
27
52
|
*/
|
|
28
53
|
afterGuiAttached() {
|
|
29
54
|
this.input.nativeElement.focus();
|
|
55
|
+
if (__classPrivateFieldGet(this, _SkyAgGridCellEditorNumberComponent_triggerType, "f") === SkyAgGridCellEditorInitialAction.Highlighted) {
|
|
56
|
+
this.input.nativeElement.select();
|
|
57
|
+
}
|
|
30
58
|
}
|
|
31
59
|
/**
|
|
32
60
|
* getValue is called by agGrid when editing is stopped to get the new value of the cell.
|
|
33
61
|
*/
|
|
34
62
|
getValue() {
|
|
35
|
-
|
|
63
|
+
const val = this.editorForm.get('number').value;
|
|
64
|
+
return val !== undefined && val !== null ? val : undefined;
|
|
36
65
|
}
|
|
37
66
|
}
|
|
67
|
+
_SkyAgGridCellEditorNumberComponent_triggerType = new WeakMap();
|
|
38
68
|
SkyAgGridCellEditorNumberComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorNumberComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
39
|
-
SkyAgGridCellEditorNumberComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyAgGridCellEditorNumberComponent, selector: "sky-ag-grid-cell-editor-number", viewQueries: [{ propertyName: "input", first: true, predicate: ["skyCellEditorNumber"], descendants: true, read: ElementRef }], ngImport: i0, template: "<input\n
|
|
69
|
+
SkyAgGridCellEditorNumberComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyAgGridCellEditorNumberComponent, selector: "sky-ag-grid-cell-editor-number", viewQueries: [{ propertyName: "input", first: true, predicate: ["skyCellEditorNumber"], descendants: true, read: ElementRef }], ngImport: i0, template: "<ng-container [formGroup]=\"editorForm\">\n <input\n formControlName=\"number\"\n type=\"number\"\n [attr.aria-label]=\"\n 'sky_ag_grid_cell_editor_number_aria_label'\n | skyLibResources: columnHeader:rowNumber\n \"\n [style.width.px]=\"columnWidth\"\n [style.height.px]=\"rowHeightWithoutBorders\"\n [max]=\"max\"\n [min]=\"min\"\n #skyCellEditorNumber\n />\n</ng-container>\n", styles: ["input{border:none;text-align:right}\n"], directives: [{ type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { type: i1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }], pipes: { "skyLibResources": i2.SkyLibResourcesPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
40
70
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorNumberComponent, decorators: [{
|
|
41
71
|
type: Component,
|
|
42
72
|
args: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell-editor-number.component.js","sourceRoot":"","sources":["../../../../../../../../../../libs/components/ag-grid/src/lib/modules/ag-grid/cell-editors/cell-editor-number/cell-editor-number.component.ts","../../../../../../../../../../libs/components/ag-grid/src/lib/modules/ag-grid/cell-editors/cell-editor-number/cell-editor-number.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,UAAU,EACV,SAAS,GACV,MAAM,eAAe,CAAC;;;;
|
|
1
|
+
{"version":3,"file":"cell-editor-number.component.js","sourceRoot":"","sources":["../../../../../../../../../../libs/components/ag-grid/src/lib/modules/ag-grid/cell-editors/cell-editor-number/cell-editor-number.component.ts","../../../../../../../../../../libs/components/ag-grid/src/lib/modules/ag-grid/cell-editors/cell-editor-number/cell-editor-number.component.html"],"names":[],"mappings":";;AAAA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,UAAU,EACV,SAAS,GACV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAKxD,OAAO,EAAE,gCAAgC,EAAE,MAAM,wCAAwC,CAAC;AAE1F,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;;;;AAEzE;;GAEG;AAOH,MAAM,OAAO,kCAAkC;IAN/C;QAWS,eAAU,GAAG,IAAI,SAAS,CAAC;YAChC,MAAM,EAAE,IAAI,WAAW,EAAE;SAC1B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AC,SAAS,GAAG,CAAC,CAAC;IACvD,CAAC;IAED;;OAEG;IACI,gBAAgB;QACrB,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;QACjC,IAAI,uBAAA,IAAI,uDAAa,KAAK,gCAAgC,CAAC,WAAW,EAAE;YACtE,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;SACnC;IACH,CAAC;IAED;;OAEG;IACI,QAAQ;QACb,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC;QAChD,OAAO,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7D,CAAC;;;gIApEU,kCAAkC;oHAAlC,kCAAkC,+JAeH,UAAU,6BCvCtD,oaAeA;4FDSa,kCAAkC;kBAN9C,SAAS;mBAAC;oBACT,QAAQ,EAAE,gCAAgC;oBAC1C,WAAW,EAAE,qCAAqC;oBAClD,SAAS,EAAE,CAAC,qCAAqC,CAAC;oBAClD,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;8BAiBS,KAAK;sBADZ,SAAS;uBAAC,qBAAqB,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE","sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n ViewChild,\n} from '@angular/core';\nimport { FormControl, FormGroup } from '@angular/forms';\n\nimport { ICellEditorAngularComp } from 'ag-grid-angular';\nimport { ICellEditorParams } from 'ag-grid-community';\n\nimport { SkyAgGridCellEditorInitialAction } from '../../types/cell-editor-initial-action';\nimport { SkyCellEditorNumberParams } from '../../types/cell-editor-number-params';\nimport { SkyAgGridCellEditorUtils } from '../../types/cell-editor-utils';\n\n/**\n * @internal\n */\n@Component({\n selector: 'sky-ag-grid-cell-editor-number',\n templateUrl: './cell-editor-number.component.html',\n styleUrls: ['./cell-editor-number.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyAgGridCellEditorNumberComponent\n implements ICellEditorAngularComp\n{\n public columnHeader: string;\n public columnWidth: number;\n public editorForm = new FormGroup({\n number: new FormControl(),\n });\n public rowHeightWithoutBorders: number;\n public rowNumber: number;\n public max: number;\n public min: number;\n\n private params: ICellEditorParams;\n\n @ViewChild('skyCellEditorNumber', { read: ElementRef })\n private input: ElementRef;\n\n #triggerType: SkyAgGridCellEditorInitialAction;\n\n /**\n * agInit is called by agGrid once after the editor is created and provides the editor with the information it needs.\n * @param params The cell editor params that include data about the cell, column, row, and grid.\n */\n public agInit(params: SkyCellEditorNumberParams): void {\n this.params = params;\n\n this.#triggerType = SkyAgGridCellEditorUtils.getEditorInitialAction(params);\n const control = this.editorForm.get('number');\n switch (this.#triggerType) {\n case SkyAgGridCellEditorInitialAction.Delete:\n control.setValue(undefined);\n break;\n case SkyAgGridCellEditorInitialAction.Replace:\n control.setValue(parseFloat(this.params.charPress) || undefined);\n break;\n case SkyAgGridCellEditorInitialAction.Highlighted:\n case SkyAgGridCellEditorInitialAction.Untouched:\n default:\n control.setValue(params.value);\n break;\n }\n\n this.max = params.skyComponentProperties?.max;\n this.min = params.skyComponentProperties?.min;\n this.columnHeader = this.params.colDef.headerName;\n this.rowNumber = this.params.rowIndex + 1;\n this.columnWidth = this.params.column.getActualWidth();\n this.rowHeightWithoutBorders =\n this.params.node && this.params.node.rowHeight - 4;\n }\n\n /**\n * afterGuiAttached is called by agGrid after the editor is rendered in the DOM. Once it is attached the editor is ready to be focused on.\n */\n public afterGuiAttached(): void {\n this.input.nativeElement.focus();\n if (this.#triggerType === SkyAgGridCellEditorInitialAction.Highlighted) {\n this.input.nativeElement.select();\n }\n }\n\n /**\n * getValue is called by agGrid when editing is stopped to get the new value of the cell.\n */\n public getValue(): number | undefined {\n const val = this.editorForm.get('number').value;\n return val !== undefined && val !== null ? val : undefined;\n }\n}\n","<ng-container [formGroup]=\"editorForm\">\n <input\n formControlName=\"number\"\n type=\"number\"\n [attr.aria-label]=\"\n 'sky_ag_grid_cell_editor_number_aria_label'\n | skyLibResources: columnHeader:rowNumber\n \"\n [style.width.px]=\"columnWidth\"\n [style.height.px]=\"rowHeightWithoutBorders\"\n [max]=\"max\"\n [min]=\"min\"\n #skyCellEditorNumber\n />\n</ng-container>\n"]}
|
package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-number/cell-editor-number.module.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { NgModule } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
3
3
|
import { SkyAgGridResourcesModule } from '../../../shared/sky-ag-grid-resources.module';
|
|
4
4
|
import { SkyAgGridCellEditorNumberComponent } from '../cell-editor-number/cell-editor-number.component';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export class SkyAgGridCellEditorNumberModule {
|
|
7
7
|
}
|
|
8
8
|
SkyAgGridCellEditorNumberModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorNumberModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
9
|
-
SkyAgGridCellEditorNumberModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorNumberModule, declarations: [SkyAgGridCellEditorNumberComponent], imports: [SkyAgGridResourcesModule,
|
|
10
|
-
SkyAgGridCellEditorNumberModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorNumberModule, imports: [[SkyAgGridResourcesModule,
|
|
9
|
+
SkyAgGridCellEditorNumberModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorNumberModule, declarations: [SkyAgGridCellEditorNumberComponent], imports: [SkyAgGridResourcesModule, ReactiveFormsModule], exports: [SkyAgGridCellEditorNumberComponent] });
|
|
10
|
+
SkyAgGridCellEditorNumberModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorNumberModule, imports: [[SkyAgGridResourcesModule, ReactiveFormsModule]] });
|
|
11
11
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorNumberModule, decorators: [{
|
|
12
12
|
type: NgModule,
|
|
13
13
|
args: [{
|
|
14
|
-
imports: [SkyAgGridResourcesModule,
|
|
14
|
+
imports: [SkyAgGridResourcesModule, ReactiveFormsModule],
|
|
15
15
|
declarations: [SkyAgGridCellEditorNumberComponent],
|
|
16
16
|
exports: [SkyAgGridCellEditorNumberComponent],
|
|
17
17
|
}]
|
package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-number/cell-editor-number.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell-editor-number.module.js","sourceRoot":"","sources":["../../../../../../../../../../libs/components/ag-grid/src/lib/modules/ag-grid/cell-editors/cell-editor-number/cell-editor-number.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"cell-editor-number.module.js","sourceRoot":"","sources":["../../../../../../../../../../libs/components/ag-grid/src/lib/modules/ag-grid/cell-editors/cell-editor-number/cell-editor-number.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,kCAAkC,EAAE,MAAM,oDAAoD,CAAC;;AAOxG,MAAM,OAAO,+BAA+B;;6HAA/B,+BAA+B;8HAA/B,+BAA+B,iBAH3B,kCAAkC,aADvC,wBAAwB,EAAE,mBAAmB,aAE7C,kCAAkC;8HAEjC,+BAA+B,YAJjC,CAAC,wBAAwB,EAAE,mBAAmB,CAAC;4FAI7C,+BAA+B;kBAL3C,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,wBAAwB,EAAE,mBAAmB,CAAC;oBACxD,YAAY,EAAE,CAAC,kCAAkC,CAAC;oBAClD,OAAO,EAAE,CAAC,kCAAkC,CAAC;iBAC9C","sourcesContent":["import { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { SkyAgGridResourcesModule } from '../../../shared/sky-ag-grid-resources.module';\nimport { SkyAgGridCellEditorNumberComponent } from '../cell-editor-number/cell-editor-number.component';\n\n@NgModule({\n imports: [SkyAgGridResourcesModule, ReactiveFormsModule],\n declarations: [SkyAgGridCellEditorNumberComponent],\n exports: [SkyAgGridCellEditorNumberComponent],\n})\nexport class SkyAgGridCellEditorNumberModule {}\n"]}
|
package/esm2015/lib/modules/ag-grid/cell-editors/cell-editor-text/cell-editor-text.component.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
var _SkyAgGridCellEditorTextComponent_triggerType;
|
|
2
|
+
import { __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
|
|
1
3
|
import { ChangeDetectionStrategy, Component, ElementRef, ViewChild, } from '@angular/core';
|
|
4
|
+
import { FormControl, FormGroup } from '@angular/forms';
|
|
5
|
+
import { SkyAgGridCellEditorInitialAction } from '../../types/cell-editor-initial-action';
|
|
6
|
+
import { SkyAgGridCellEditorUtils } from '../../types/cell-editor-utils';
|
|
2
7
|
import * as i0 from "@angular/core";
|
|
3
8
|
import * as i1 from "@angular/forms";
|
|
4
9
|
import * as i2 from "@skyux/i18n";
|
|
@@ -6,6 +11,12 @@ import * as i2 from "@skyux/i18n";
|
|
|
6
11
|
* @internal
|
|
7
12
|
*/
|
|
8
13
|
export class SkyAgGridCellEditorTextComponent {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.editorForm = new FormGroup({
|
|
16
|
+
text: new FormControl(),
|
|
17
|
+
});
|
|
18
|
+
_SkyAgGridCellEditorTextComponent_triggerType.set(this, void 0);
|
|
19
|
+
}
|
|
9
20
|
/**
|
|
10
21
|
* agInit is called by agGrid once after the editor is created and provides the editor with the information it needs.
|
|
11
22
|
* @param params The cell editor params that include data about the cell, column, row, and grid.
|
|
@@ -13,7 +24,21 @@ export class SkyAgGridCellEditorTextComponent {
|
|
|
13
24
|
agInit(params) {
|
|
14
25
|
var _a;
|
|
15
26
|
this.params = params;
|
|
16
|
-
this
|
|
27
|
+
__classPrivateFieldSet(this, _SkyAgGridCellEditorTextComponent_triggerType, SkyAgGridCellEditorUtils.getEditorInitialAction(params), "f");
|
|
28
|
+
const control = this.editorForm.get('text');
|
|
29
|
+
switch (__classPrivateFieldGet(this, _SkyAgGridCellEditorTextComponent_triggerType, "f")) {
|
|
30
|
+
case SkyAgGridCellEditorInitialAction.Delete:
|
|
31
|
+
control.setValue(undefined);
|
|
32
|
+
break;
|
|
33
|
+
case SkyAgGridCellEditorInitialAction.Replace:
|
|
34
|
+
control.setValue(params.charPress);
|
|
35
|
+
break;
|
|
36
|
+
case SkyAgGridCellEditorInitialAction.Highlighted:
|
|
37
|
+
case SkyAgGridCellEditorInitialAction.Untouched:
|
|
38
|
+
default:
|
|
39
|
+
control.setValue(params.value);
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
17
42
|
this.maxlength = (_a = params.skyComponentProperties) === null || _a === void 0 ? void 0 : _a.maxlength;
|
|
18
43
|
this.columnHeader = this.params.colDef.headerName;
|
|
19
44
|
this.rowNumber = this.params.rowIndex + 1;
|
|
@@ -26,16 +51,20 @@ export class SkyAgGridCellEditorTextComponent {
|
|
|
26
51
|
*/
|
|
27
52
|
afterGuiAttached() {
|
|
28
53
|
this.input.nativeElement.focus();
|
|
54
|
+
if (__classPrivateFieldGet(this, _SkyAgGridCellEditorTextComponent_triggerType, "f") === SkyAgGridCellEditorInitialAction.Highlighted) {
|
|
55
|
+
this.input.nativeElement.select();
|
|
56
|
+
}
|
|
29
57
|
}
|
|
30
58
|
/**
|
|
31
59
|
* getValue is called by agGrid when editing is stopped to get the new value of the cell.
|
|
32
60
|
*/
|
|
33
61
|
getValue() {
|
|
34
|
-
return this.value;
|
|
62
|
+
return this.editorForm.get('text').value || undefined;
|
|
35
63
|
}
|
|
36
64
|
}
|
|
65
|
+
_SkyAgGridCellEditorTextComponent_triggerType = new WeakMap();
|
|
37
66
|
SkyAgGridCellEditorTextComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
38
|
-
SkyAgGridCellEditorTextComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyAgGridCellEditorTextComponent, selector: "sky-ag-grid-cell-editor-text", viewQueries: [{ propertyName: "input", first: true, predicate: ["skyCellEditorText"], descendants: true, read: ElementRef }], ngImport: i0, template: "<input\n
|
|
67
|
+
SkyAgGridCellEditorTextComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyAgGridCellEditorTextComponent, selector: "sky-ag-grid-cell-editor-text", viewQueries: [{ propertyName: "input", first: true, predicate: ["skyCellEditorText"], descendants: true, read: ElementRef }], ngImport: i0, template: "<ng-container [formGroup]=\"editorForm\">\n <input\n formControlName=\"text\"\n type=\"text\"\n [attr.aria-label]=\"\n 'sky_ag_grid_cell_editor_text_aria_label'\n | skyLibResources: columnHeader:rowNumber\n \"\n [style.width.px]=\"columnWidth\"\n [style.height.px]=\"rowHeightWithoutBorders\"\n [maxlength]=\"maxlength\"\n #skyCellEditorText\n />\n</ng-container>\n", styles: ["input{border:none;padding-left:11px}\n"], directives: [{ type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }], pipes: { "skyLibResources": i2.SkyLibResourcesPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
39
68
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAgGridCellEditorTextComponent, decorators: [{
|
|
40
69
|
type: Component,
|
|
41
70
|
args: [{
|