@skyux/ag-grid 6.2.1 → 6.3.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/documentation.json +520 -329
- package/esm2020/index.mjs +3 -1
- package/esm2020/lib/modules/ag-grid/ag-grid.service.mjs +2 -2
- package/esm2020/lib/modules/ag-grid/cell-editors/cell-editor-autocomplete/cell-editor-autocomplete.component.mjs +38 -5
- package/esm2020/lib/modules/ag-grid/cell-editors/cell-editor-autocomplete/cell-editor-autocomplete.module.mjs +15 -5
- package/esm2020/lib/modules/ag-grid/cell-editors/cell-editor-currency/cell-editor-currency.component.mjs +44 -9
- package/esm2020/lib/modules/ag-grid/cell-editors/cell-editor-currency/cell-editor-currency.module.mjs +15 -5
- package/esm2020/lib/modules/ag-grid/cell-editors/cell-editor-datepicker/cell-editor-datepicker.component.mjs +60 -13
- package/esm2020/lib/modules/ag-grid/cell-editors/cell-editor-datepicker/cell-editor-datepicker.module.mjs +5 -5
- package/esm2020/lib/modules/ag-grid/cell-editors/cell-editor-lookup/cell-editor-lookup.component.mjs +37 -10
- package/esm2020/lib/modules/ag-grid/cell-editors/cell-editor-number/cell-editor-number.component.mjs +35 -5
- package/esm2020/lib/modules/ag-grid/cell-editors/cell-editor-number/cell-editor-number.module.mjs +5 -5
- package/esm2020/lib/modules/ag-grid/cell-editors/cell-editor-text/cell-editor-text.component.mjs +34 -5
- package/esm2020/lib/modules/ag-grid/cell-editors/cell-editor-text/cell-editor-text.module.mjs +5 -5
- package/esm2020/lib/modules/ag-grid/types/cell-editor-initial-action.mjs +13 -0
- package/esm2020/lib/modules/ag-grid/types/cell-editor-utils.mjs +31 -0
- package/fesm2015/skyux-ag-grid.mjs +301 -63
- package/fesm2015/skyux-ag-grid.mjs.map +1 -1
- package/fesm2020/skyux-ag-grid.mjs +299 -60
- package/fesm2020/skyux-ag-grid.mjs.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
|
@@ -9,19 +9,20 @@ import { SkyDataManagerModule } from '@skyux/data-manager';
|
|
|
9
9
|
import * as i1$2 from '@skyux/layout';
|
|
10
10
|
import { SkyInlineDeleteModule } from '@skyux/layout';
|
|
11
11
|
import { AgGridAngular, AgGridModule } from 'ag-grid-angular';
|
|
12
|
-
import { Subject } from 'rxjs';
|
|
13
|
-
import { takeUntil, filter } from 'rxjs/operators';
|
|
12
|
+
import { Subject, fromEvent } from 'rxjs';
|
|
13
|
+
import { takeUntil, filter, first } from 'rxjs/operators';
|
|
14
14
|
import * as i1$4 from '@angular/forms';
|
|
15
|
-
import {
|
|
15
|
+
import { FormGroup, FormControl, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
16
16
|
import * as i1$3 from '@skyux/lookup';
|
|
17
17
|
import { SkyAutocompleteModule, SkyLookupModule } from '@skyux/lookup';
|
|
18
18
|
import * as i3$1 from '@skyux/i18n';
|
|
19
19
|
import { getLibStringForLocale, SkyI18nModule, SKY_LIB_RESOURCES_PROVIDERS } from '@skyux/i18n';
|
|
20
|
+
import { __classPrivateFieldSet, __classPrivateFieldGet } from 'tslib';
|
|
21
|
+
import { KeyCode, PopupComponent, Events, RowNode } from 'ag-grid-community';
|
|
20
22
|
import * as i2 from '@skyux/autonumeric';
|
|
21
23
|
import { SkyAutonumericModule } from '@skyux/autonumeric';
|
|
22
24
|
import * as i2$1 from '@skyux/datetime';
|
|
23
25
|
import { SkyDatepickerModule } from '@skyux/datetime';
|
|
24
|
-
import { PopupComponent, Events, RowNode } from 'ag-grid-community';
|
|
25
26
|
import * as i1$5 from '@skyux/theme';
|
|
26
27
|
import * as i1$6 from '@skyux/forms';
|
|
27
28
|
import { SkyInputBoxModule, SkyCheckboxModule } from '@skyux/forms';
|
|
@@ -726,32 +727,103 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
726
727
|
}]
|
|
727
728
|
}] });
|
|
728
729
|
|
|
730
|
+
/** The intiial action that a cell editor should take when initialized. */
|
|
731
|
+
var SkyAgGridCellEditorInitialAction;
|
|
732
|
+
(function (SkyAgGridCellEditorInitialAction) {
|
|
733
|
+
/** The cell should be cleared. */
|
|
734
|
+
SkyAgGridCellEditorInitialAction[SkyAgGridCellEditorInitialAction["Delete"] = 0] = "Delete";
|
|
735
|
+
/** The cell value should be highlighted. */
|
|
736
|
+
SkyAgGridCellEditorInitialAction[SkyAgGridCellEditorInitialAction["Highlighted"] = 1] = "Highlighted";
|
|
737
|
+
/** The cell value should be replaced with the initializing value. */
|
|
738
|
+
SkyAgGridCellEditorInitialAction[SkyAgGridCellEditorInitialAction["Replace"] = 2] = "Replace";
|
|
739
|
+
/** The cell should not be modified and the cursor is placed at the end of the value. */
|
|
740
|
+
SkyAgGridCellEditorInitialAction[SkyAgGridCellEditorInitialAction["Untouched"] = 3] = "Untouched";
|
|
741
|
+
})(SkyAgGridCellEditorInitialAction || (SkyAgGridCellEditorInitialAction = {}));
|
|
742
|
+
|
|
743
|
+
class SkyAgGridCellEditorUtils {
|
|
744
|
+
/**
|
|
745
|
+
* Gets the intiial action that a cell editor should take when initialized.
|
|
746
|
+
* @param params The editor's initializing parameters.
|
|
747
|
+
*/
|
|
748
|
+
static getEditorInitialAction(params) {
|
|
749
|
+
if (params.cellStartedEdit) {
|
|
750
|
+
if (params.eventKey === KeyCode.BACKSPACE ||
|
|
751
|
+
params.eventKey === KeyCode.DELETE) {
|
|
752
|
+
return SkyAgGridCellEditorInitialAction.Delete;
|
|
753
|
+
}
|
|
754
|
+
else if (params.charPress) {
|
|
755
|
+
return SkyAgGridCellEditorInitialAction.Replace;
|
|
756
|
+
}
|
|
757
|
+
else {
|
|
758
|
+
if (params.eventKey !== KeyCode.F2) {
|
|
759
|
+
return SkyAgGridCellEditorInitialAction.Highlighted;
|
|
760
|
+
}
|
|
761
|
+
else {
|
|
762
|
+
return SkyAgGridCellEditorInitialAction.Untouched;
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
else {
|
|
767
|
+
return SkyAgGridCellEditorInitialAction.Untouched;
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
var _SkyAgGridCellEditorAutocompleteComponent_triggerType;
|
|
729
773
|
/**
|
|
730
774
|
* @internal
|
|
731
775
|
*/
|
|
732
776
|
class SkyAgGridCellEditorAutocompleteComponent {
|
|
733
777
|
constructor() {
|
|
778
|
+
this.editorForm = new FormGroup({
|
|
779
|
+
selection: new FormControl(),
|
|
780
|
+
});
|
|
734
781
|
this.skyComponentProperties = {};
|
|
782
|
+
_SkyAgGridCellEditorAutocompleteComponent_triggerType.set(this, void 0);
|
|
735
783
|
}
|
|
736
784
|
agInit(params) {
|
|
737
785
|
this.params = params;
|
|
738
|
-
this
|
|
786
|
+
__classPrivateFieldSet(this, _SkyAgGridCellEditorAutocompleteComponent_triggerType, SkyAgGridCellEditorUtils.getEditorInitialAction(params), "f");
|
|
787
|
+
const control = this.editorForm.get('selection');
|
|
788
|
+
switch (__classPrivateFieldGet(this, _SkyAgGridCellEditorAutocompleteComponent_triggerType, "f")) {
|
|
789
|
+
case SkyAgGridCellEditorInitialAction.Delete:
|
|
790
|
+
control.setValue(undefined);
|
|
791
|
+
break;
|
|
792
|
+
case SkyAgGridCellEditorInitialAction.Replace:
|
|
793
|
+
case SkyAgGridCellEditorInitialAction.Highlighted:
|
|
794
|
+
case SkyAgGridCellEditorInitialAction.Untouched:
|
|
795
|
+
default:
|
|
796
|
+
control.setValue(params.value);
|
|
797
|
+
break;
|
|
798
|
+
}
|
|
739
799
|
this.columnHeader = this.params.colDef && this.params.colDef.headerName;
|
|
740
800
|
this.rowNumber = this.params.rowIndex + 1;
|
|
741
801
|
this.skyComponentProperties = this.params.skyComponentProperties || {};
|
|
742
802
|
}
|
|
743
803
|
afterGuiAttached() {
|
|
744
804
|
this.input.nativeElement.focus();
|
|
805
|
+
if (__classPrivateFieldGet(this, _SkyAgGridCellEditorAutocompleteComponent_triggerType, "f") === SkyAgGridCellEditorInitialAction.Replace) {
|
|
806
|
+
this.input.nativeElement.select();
|
|
807
|
+
this.input.nativeElement.setRangeText(this.params.charPress);
|
|
808
|
+
// Ensure the cursor is at the end of the text.
|
|
809
|
+
this.input.nativeElement.setSelectionRange(this.params.charPress.length, this.params.charPress.length);
|
|
810
|
+
this.input.nativeElement.dispatchEvent(new Event('input'));
|
|
811
|
+
}
|
|
812
|
+
if (__classPrivateFieldGet(this, _SkyAgGridCellEditorAutocompleteComponent_triggerType, "f") === SkyAgGridCellEditorInitialAction.Highlighted) {
|
|
813
|
+
this.input.nativeElement.select();
|
|
814
|
+
}
|
|
745
815
|
}
|
|
746
816
|
getValue() {
|
|
747
|
-
|
|
817
|
+
const val = this.editorForm.get('selection').value;
|
|
818
|
+
return val !== undefined && val !== null ? val : undefined;
|
|
748
819
|
}
|
|
749
820
|
}
|
|
821
|
+
_SkyAgGridCellEditorAutocompleteComponent_triggerType = new WeakMap();
|
|
750
822
|
SkyAgGridCellEditorAutocompleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorAutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
751
|
-
SkyAgGridCellEditorAutocompleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: SkyAgGridCellEditorAutocompleteComponent, selector: "sky-ag-grid-cell-editor-autocomplete", viewQueries: [{ propertyName: "input", first: true, predicate: ["skyCellEditorAutocomplete"], descendants: true, read: ElementRef }], ngImport: i0, template: "<div class=\"sky-ag-grid-cell-editor-autocomplete\">\n <sky-autocomplete\n [data]=\"skyComponentProperties.data\"\n [debounceTime]=\"skyComponentProperties.debounceTime\"\n [descriptorProperty]=\"skyComponentProperties.descriptorProperty\"\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 (selectionChange)=\"\n skyComponentProperties.selectionChange &&\n skyComponentProperties.selectionChange($event)\n \"\n >\n <input\n skyAutocomplete\n #skyCellEditorAutocomplete\n type=\"text\"\n [
|
|
823
|
+
SkyAgGridCellEditorAutocompleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: SkyAgGridCellEditorAutocompleteComponent, selector: "sky-ag-grid-cell-editor-autocomplete", viewQueries: [{ propertyName: "input", first: true, predicate: ["skyCellEditorAutocomplete"], descendants: true, read: ElementRef }], ngImport: i0, template: "<div class=\"sky-ag-grid-cell-editor-autocomplete\" [formGroup]=\"editorForm\">\n <sky-autocomplete\n [data]=\"skyComponentProperties.data\"\n [debounceTime]=\"skyComponentProperties.debounceTime\"\n [descriptorProperty]=\"skyComponentProperties.descriptorProperty\"\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 (selectionChange)=\"\n skyComponentProperties.selectionChange &&\n skyComponentProperties.selectionChange($event)\n \"\n >\n <input\n formControlName=\"selection\"\n skyAutocomplete\n #skyCellEditorAutocomplete\n type=\"text\"\n [attr.aria-label]=\"\n 'sky_ag_grid_cell_editor_autocomplete_aria_label'\n | skyLibResources: columnHeader:rowNumber\n \"\n />\n </sky-autocomplete>\n</div>\n", styles: ["sky-autocomplete input{border:none;box-shadow:none}\n"], components: [{ type: i1$3.λ2, selector: "sky-autocomplete", inputs: ["ariaLabelledBy", "data", "debounceTime", "descriptorProperty", "enableShowMore", "messageStream", "wrapperClass", "propertiesToSearch", "search", "searchResultTemplate", "searchTextMinimumCharacters", "searchFilters", "searchResultsLimit", "showAddButton", "noResultsFoundText", "searchAsyncDisabled"], outputs: ["addClick", "showMoreClick", "selectionChange", "searchAsync"] }], directives: [{ type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1$4.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$3.λ1, selector: "input[skyAutocomplete], textarea[skyAutocomplete]", inputs: ["autocompleteAttribute", "disabled"] }, { type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], pipes: { "skyLibResources": i3$1.SkyLibResourcesPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
752
824
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorAutocompleteComponent, decorators: [{
|
|
753
825
|
type: Component,
|
|
754
|
-
args: [{ selector: 'sky-ag-grid-cell-editor-autocomplete', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"sky-ag-grid-cell-editor-autocomplete\">\n <sky-autocomplete\n [data]=\"skyComponentProperties.data\"\n [debounceTime]=\"skyComponentProperties.debounceTime\"\n [descriptorProperty]=\"skyComponentProperties.descriptorProperty\"\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 (selectionChange)=\"\n skyComponentProperties.selectionChange &&\n skyComponentProperties.selectionChange($event)\n \"\n >\n <input\n skyAutocomplete\n #skyCellEditorAutocomplete\n type=\"text\"\n [
|
|
826
|
+
args: [{ selector: 'sky-ag-grid-cell-editor-autocomplete', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"sky-ag-grid-cell-editor-autocomplete\" [formGroup]=\"editorForm\">\n <sky-autocomplete\n [data]=\"skyComponentProperties.data\"\n [debounceTime]=\"skyComponentProperties.debounceTime\"\n [descriptorProperty]=\"skyComponentProperties.descriptorProperty\"\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 (selectionChange)=\"\n skyComponentProperties.selectionChange &&\n skyComponentProperties.selectionChange($event)\n \"\n >\n <input\n formControlName=\"selection\"\n skyAutocomplete\n #skyCellEditorAutocomplete\n type=\"text\"\n [attr.aria-label]=\"\n 'sky_ag_grid_cell_editor_autocomplete_aria_label'\n | skyLibResources: columnHeader:rowNumber\n \"\n />\n </sky-autocomplete>\n</div>\n", styles: ["sky-autocomplete input{border:none;box-shadow:none}\n"] }]
|
|
755
827
|
}], propDecorators: { input: [{
|
|
756
828
|
type: ViewChild,
|
|
757
829
|
args: ['skyCellEditorAutocomplete', { read: ElementRef }]
|
|
@@ -760,23 +832,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
760
832
|
class SkyAgGridCellEditorAutocompleteModule {
|
|
761
833
|
}
|
|
762
834
|
SkyAgGridCellEditorAutocompleteModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorAutocompleteModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
763
|
-
SkyAgGridCellEditorAutocompleteModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorAutocompleteModule, declarations: [SkyAgGridCellEditorAutocompleteComponent], imports: [
|
|
764
|
-
|
|
835
|
+
SkyAgGridCellEditorAutocompleteModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorAutocompleteModule, declarations: [SkyAgGridCellEditorAutocompleteComponent], imports: [ReactiveFormsModule,
|
|
836
|
+
SkyAgGridResourcesModule,
|
|
837
|
+
SkyAutocompleteModule], exports: [SkyAgGridCellEditorAutocompleteComponent] });
|
|
838
|
+
SkyAgGridCellEditorAutocompleteModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorAutocompleteModule, imports: [[
|
|
839
|
+
ReactiveFormsModule,
|
|
840
|
+
SkyAgGridResourcesModule,
|
|
841
|
+
SkyAutocompleteModule,
|
|
842
|
+
]] });
|
|
765
843
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorAutocompleteModule, decorators: [{
|
|
766
844
|
type: NgModule,
|
|
767
845
|
args: [{
|
|
768
|
-
imports: [
|
|
846
|
+
imports: [
|
|
847
|
+
ReactiveFormsModule,
|
|
848
|
+
SkyAgGridResourcesModule,
|
|
849
|
+
SkyAutocompleteModule,
|
|
850
|
+
],
|
|
769
851
|
declarations: [SkyAgGridCellEditorAutocompleteComponent],
|
|
770
852
|
exports: [SkyAgGridCellEditorAutocompleteComponent],
|
|
771
853
|
}]
|
|
772
854
|
}] });
|
|
773
855
|
|
|
856
|
+
var _SkyAgGridCellEditorCurrencyComponent_triggerType;
|
|
774
857
|
/**
|
|
775
858
|
* @internal
|
|
776
859
|
*/
|
|
777
860
|
class SkyAgGridCellEditorCurrencyComponent {
|
|
778
|
-
constructor() {
|
|
861
|
+
constructor(changeDetector) {
|
|
862
|
+
this.changeDetector = changeDetector;
|
|
779
863
|
this.skyComponentProperties = {};
|
|
864
|
+
this.editorForm = new FormGroup({
|
|
865
|
+
currency: new FormControl(),
|
|
866
|
+
});
|
|
867
|
+
_SkyAgGridCellEditorCurrencyComponent_triggerType.set(this, void 0);
|
|
780
868
|
}
|
|
781
869
|
/**
|
|
782
870
|
* agInit is called by agGrid once after the editor is created and provides the editor with the information it needs.
|
|
@@ -784,7 +872,6 @@ class SkyAgGridCellEditorCurrencyComponent {
|
|
|
784
872
|
*/
|
|
785
873
|
agInit(params) {
|
|
786
874
|
this.params = params;
|
|
787
|
-
this.value = this.params.value;
|
|
788
875
|
this.columnHeader = this.params.colDef.headerName;
|
|
789
876
|
this.rowNumber = this.params.rowIndex + 1;
|
|
790
877
|
this.columnWidth = this.params.column.getActualWidth();
|
|
@@ -800,12 +887,37 @@ class SkyAgGridCellEditorCurrencyComponent {
|
|
|
800
887
|
*/
|
|
801
888
|
afterGuiAttached() {
|
|
802
889
|
this.input.nativeElement.focus();
|
|
890
|
+
// This setup is in `afterGuiAttached` due to the lifecycle of autonumeric which will highlight the initial value if it is in place when it renders.
|
|
891
|
+
// Since we don't want that, we set the initial value after autonumeric initializes.
|
|
892
|
+
__classPrivateFieldSet(this, _SkyAgGridCellEditorCurrencyComponent_triggerType, SkyAgGridCellEditorUtils.getEditorInitialAction(this.params), "f");
|
|
893
|
+
const control = this.editorForm.get('currency');
|
|
894
|
+
switch (__classPrivateFieldGet(this, _SkyAgGridCellEditorCurrencyComponent_triggerType, "f")) {
|
|
895
|
+
case SkyAgGridCellEditorInitialAction.Delete:
|
|
896
|
+
control.setValue(undefined);
|
|
897
|
+
break;
|
|
898
|
+
case SkyAgGridCellEditorInitialAction.Replace:
|
|
899
|
+
control.setValue(parseFloat(this.params.charPress) || undefined);
|
|
900
|
+
break;
|
|
901
|
+
case SkyAgGridCellEditorInitialAction.Highlighted:
|
|
902
|
+
case SkyAgGridCellEditorInitialAction.Untouched:
|
|
903
|
+
default:
|
|
904
|
+
control.setValue(parseFloat(this.params.value));
|
|
905
|
+
break;
|
|
906
|
+
}
|
|
907
|
+
this.changeDetector.markForCheck();
|
|
908
|
+
// Without the `setTimeout` there is inconsistent behavior with the highlighting when no initial value is present.
|
|
909
|
+
setTimeout(() => {
|
|
910
|
+
if (__classPrivateFieldGet(this, _SkyAgGridCellEditorCurrencyComponent_triggerType, "f") === SkyAgGridCellEditorInitialAction.Highlighted) {
|
|
911
|
+
this.input.nativeElement.select();
|
|
912
|
+
}
|
|
913
|
+
}, 100);
|
|
803
914
|
}
|
|
804
915
|
/**
|
|
805
916
|
* getValue is called by agGrid when editing is stopped to get the new value of the cell.
|
|
806
917
|
*/
|
|
807
918
|
getValue() {
|
|
808
|
-
|
|
919
|
+
const val = this.editorForm.get('currency').value;
|
|
920
|
+
return val !== undefined && val !== null ? val : undefined;
|
|
809
921
|
}
|
|
810
922
|
/**
|
|
811
923
|
* The autoNumeric library's event handler suppresses the escape key event. This additional handler re-enables AG Grid's default functionality.
|
|
@@ -815,12 +927,13 @@ class SkyAgGridCellEditorCurrencyComponent {
|
|
|
815
927
|
this.params.api.setFocusedCell(this.params.rowIndex, this.params.column);
|
|
816
928
|
}
|
|
817
929
|
}
|
|
818
|
-
|
|
819
|
-
SkyAgGridCellEditorCurrencyComponent.ɵ
|
|
930
|
+
_SkyAgGridCellEditorCurrencyComponent_triggerType = new WeakMap();
|
|
931
|
+
SkyAgGridCellEditorCurrencyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorCurrencyComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
932
|
+
SkyAgGridCellEditorCurrencyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: SkyAgGridCellEditorCurrencyComponent, selector: "sky-ag-grid-cell-editor-currency", viewQueries: [{ propertyName: "input", first: true, predicate: ["skyCellEditorCurrency"], descendants: true, read: ElementRef }], ngImport: i0, template: "<ng-container [formGroup]=\"editorForm\">\n <input\n formControlName=\"currency\"\n type=\"text\"\n [attr.aria-label]=\"\n 'sky_ag_grid_cell_editor_currency_aria_label'\n | skyLibResources: columnHeader:rowNumber\n \"\n [style.width.px]=\"columnWidth\"\n [style.height.px]=\"rowHeightWithoutBorders\"\n [skyAutonumeric]=\"skyComponentProperties\"\n [skyAutonumericFormChangesUnformatted]=\"params?.charPress\"\n (keyup.escape)=\"onPressEscape()\"\n #skyCellEditorCurrency\n />\n</ng-container>\n", styles: ["input{border:none;padding-left:11px}\n"], directives: [{ type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1$4.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: i2.λ1, selector: "input[skyAutonumeric]", inputs: ["skyAutonumeric", "skyAutonumericFormChangesUnformatted"] }, { type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], pipes: { "skyLibResources": i3$1.SkyLibResourcesPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
820
933
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorCurrencyComponent, decorators: [{
|
|
821
934
|
type: Component,
|
|
822
|
-
args: [{ selector: 'sky-ag-grid-cell-editor-currency', changeDetection: ChangeDetectionStrategy.OnPush, template: "<input\n
|
|
823
|
-
}], propDecorators: { input: [{
|
|
935
|
+
args: [{ selector: 'sky-ag-grid-cell-editor-currency', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [formGroup]=\"editorForm\">\n <input\n formControlName=\"currency\"\n type=\"text\"\n [attr.aria-label]=\"\n 'sky_ag_grid_cell_editor_currency_aria_label'\n | skyLibResources: columnHeader:rowNumber\n \"\n [style.width.px]=\"columnWidth\"\n [style.height.px]=\"rowHeightWithoutBorders\"\n [skyAutonumeric]=\"skyComponentProperties\"\n [skyAutonumericFormChangesUnformatted]=\"params?.charPress\"\n (keyup.escape)=\"onPressEscape()\"\n #skyCellEditorCurrency\n />\n</ng-container>\n", styles: ["input{border:none;padding-left:11px}\n"] }]
|
|
936
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { input: [{
|
|
824
937
|
type: ViewChild,
|
|
825
938
|
args: ['skyCellEditorCurrency', { read: ElementRef }]
|
|
826
939
|
}] } });
|
|
@@ -828,40 +941,74 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
828
941
|
class SkyAgGridCellEditorCurrencyModule {
|
|
829
942
|
}
|
|
830
943
|
SkyAgGridCellEditorCurrencyModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorCurrencyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
831
|
-
SkyAgGridCellEditorCurrencyModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorCurrencyModule, declarations: [SkyAgGridCellEditorCurrencyComponent], imports: [SkyAgGridResourcesModule,
|
|
832
|
-
|
|
944
|
+
SkyAgGridCellEditorCurrencyModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorCurrencyModule, declarations: [SkyAgGridCellEditorCurrencyComponent], imports: [SkyAgGridResourcesModule,
|
|
945
|
+
ReactiveFormsModule,
|
|
946
|
+
SkyAutonumericModule], exports: [SkyAgGridCellEditorCurrencyComponent] });
|
|
947
|
+
SkyAgGridCellEditorCurrencyModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorCurrencyModule, imports: [[
|
|
948
|
+
SkyAgGridResourcesModule,
|
|
949
|
+
ReactiveFormsModule,
|
|
950
|
+
SkyAutonumericModule,
|
|
951
|
+
]] });
|
|
833
952
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorCurrencyModule, decorators: [{
|
|
834
953
|
type: NgModule,
|
|
835
954
|
args: [{
|
|
836
|
-
imports: [
|
|
955
|
+
imports: [
|
|
956
|
+
SkyAgGridResourcesModule,
|
|
957
|
+
ReactiveFormsModule,
|
|
958
|
+
SkyAutonumericModule,
|
|
959
|
+
],
|
|
837
960
|
declarations: [SkyAgGridCellEditorCurrencyComponent],
|
|
838
961
|
exports: [SkyAgGridCellEditorCurrencyComponent],
|
|
839
962
|
}]
|
|
840
963
|
}] });
|
|
841
964
|
|
|
965
|
+
var _SkyAgGridCellEditorDatepickerComponent_triggerType;
|
|
842
966
|
/**
|
|
843
967
|
* @internal
|
|
844
968
|
*/
|
|
845
969
|
class SkyAgGridCellEditorDatepickerComponent extends PopupComponent {
|
|
846
|
-
constructor(themeSvc) {
|
|
970
|
+
constructor(changeDetector, themeSvc) {
|
|
847
971
|
super();
|
|
972
|
+
this.changeDetector = changeDetector;
|
|
848
973
|
this.themeSvc = themeSvc;
|
|
974
|
+
this.editorForm = new FormGroup({
|
|
975
|
+
date: new FormControl(),
|
|
976
|
+
});
|
|
849
977
|
this.skyComponentProperties = {};
|
|
978
|
+
_SkyAgGridCellEditorDatepickerComponent_triggerType.set(this, void 0);
|
|
850
979
|
}
|
|
851
980
|
/**
|
|
852
981
|
* agInit is called by agGrid once after the editor is created and provides the editor with the information it needs.
|
|
853
982
|
* @param params The cell editor params that include data about the cell, column, row, and grid.
|
|
854
983
|
*/
|
|
855
984
|
agInit(params) {
|
|
856
|
-
var _a;
|
|
985
|
+
var _a, _b;
|
|
857
986
|
this.params = params;
|
|
858
|
-
this
|
|
987
|
+
__classPrivateFieldSet(this, _SkyAgGridCellEditorDatepickerComponent_triggerType, SkyAgGridCellEditorUtils.getEditorInitialAction(params), "f");
|
|
988
|
+
const control = this.editorForm.get('date');
|
|
989
|
+
switch (__classPrivateFieldGet(this, _SkyAgGridCellEditorDatepickerComponent_triggerType, "f")) {
|
|
990
|
+
case SkyAgGridCellEditorInitialAction.Delete:
|
|
991
|
+
control.setValue(undefined);
|
|
992
|
+
break;
|
|
993
|
+
case SkyAgGridCellEditorInitialAction.Replace:
|
|
994
|
+
control.setValue(params.charPress);
|
|
995
|
+
break;
|
|
996
|
+
case SkyAgGridCellEditorInitialAction.Highlighted:
|
|
997
|
+
case SkyAgGridCellEditorInitialAction.Untouched:
|
|
998
|
+
default:
|
|
999
|
+
control.setValue(params.value);
|
|
1000
|
+
break;
|
|
1001
|
+
}
|
|
1002
|
+
if ((_a = this.params.skyComponentProperties) === null || _a === void 0 ? void 0 : _a.disabled) {
|
|
1003
|
+
control.disable();
|
|
1004
|
+
}
|
|
1005
|
+
this.changeDetector.markForCheck();
|
|
859
1006
|
this.skyComponentProperties = this.params.skyComponentProperties || {};
|
|
860
1007
|
this.columnWidth = this.params.column.getActualWidth();
|
|
861
1008
|
this.columnWidthWithoutBorders = this.columnWidth - 2;
|
|
862
1009
|
this.rowHeightWithoutBorders =
|
|
863
1010
|
this.params.node && this.params.node.rowHeight - 3;
|
|
864
|
-
(
|
|
1011
|
+
(_b = this.themeSvc) === null || _b === void 0 ? void 0 : _b.settingsChange.subscribe((themeSettings) => {
|
|
865
1012
|
if (themeSettings.currentSettings.theme.name === 'modern') {
|
|
866
1013
|
this.columnWidthWithoutBorders = this.columnWidth;
|
|
867
1014
|
this.rowHeightWithoutBorders =
|
|
@@ -878,26 +1025,43 @@ class SkyAgGridCellEditorDatepickerComponent extends PopupComponent {
|
|
|
878
1025
|
* 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.
|
|
879
1026
|
*/
|
|
880
1027
|
afterGuiAttached() {
|
|
881
|
-
this.
|
|
1028
|
+
const datepickerInputEl = this.datepickerInput
|
|
1029
|
+
.nativeElement;
|
|
1030
|
+
datepickerInputEl.focus();
|
|
1031
|
+
// 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.
|
|
1032
|
+
// 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.
|
|
1033
|
+
if (__classPrivateFieldGet(this, _SkyAgGridCellEditorDatepickerComponent_triggerType, "f") === SkyAgGridCellEditorInitialAction.Replace) {
|
|
1034
|
+
fromEvent(datepickerInputEl, 'blur')
|
|
1035
|
+
.pipe(first())
|
|
1036
|
+
.subscribe(() => {
|
|
1037
|
+
datepickerInputEl.dispatchEvent(new Event('change'));
|
|
1038
|
+
});
|
|
1039
|
+
datepickerInputEl.select();
|
|
1040
|
+
datepickerInputEl.setRangeText(this.params.charPress);
|
|
1041
|
+
// Ensure the cursor is at the end of the text.
|
|
1042
|
+
datepickerInputEl.setSelectionRange(this.params.charPress.length, this.params.charPress.length);
|
|
1043
|
+
}
|
|
1044
|
+
// this.changeDetector.markForCheck();
|
|
1045
|
+
if (__classPrivateFieldGet(this, _SkyAgGridCellEditorDatepickerComponent_triggerType, "f") === SkyAgGridCellEditorInitialAction.Highlighted) {
|
|
1046
|
+
datepickerInputEl.select();
|
|
1047
|
+
}
|
|
882
1048
|
}
|
|
883
1049
|
/**
|
|
884
1050
|
* getValue is called by agGrid when editing is stopped to get the new value of the cell.
|
|
885
1051
|
*/
|
|
886
1052
|
getValue() {
|
|
887
1053
|
this.datepickerInput.nativeElement.blur();
|
|
888
|
-
return this.
|
|
889
|
-
}
|
|
890
|
-
focusOnDatepickerInput() {
|
|
891
|
-
this.datepickerInput.nativeElement.focus();
|
|
1054
|
+
return this.editorForm.get('date').value;
|
|
892
1055
|
}
|
|
893
1056
|
}
|
|
894
|
-
|
|
895
|
-
SkyAgGridCellEditorDatepickerComponent.ɵ
|
|
1057
|
+
_SkyAgGridCellEditorDatepickerComponent_triggerType = new WeakMap();
|
|
1058
|
+
SkyAgGridCellEditorDatepickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorDatepickerComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$5.SkyThemeService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
1059
|
+
SkyAgGridCellEditorDatepickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", 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$1.λ2, selector: "sky-datepicker", inputs: ["pickerClass"], outputs: ["calendarDateRangeChange"] }], directives: [{ type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1$4.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$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i2$1.λ3, selector: "[skyDatepickerInput]", inputs: ["dateFormat", "disabled", "maxDate", "minDate", "skyDatepickerInput", "skyDatepickerNoValidate", "startingDay", "strict"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
896
1060
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorDatepickerComponent, decorators: [{
|
|
897
1061
|
type: Component,
|
|
898
|
-
args: [{ selector: 'sky-ag-grid-cell-editor-datepicker', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div\n class=\"sky-ag-grid-cell-editor-datepicker\"\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
|
|
1062
|
+
args: [{ selector: 'sky-ag-grid-cell-editor-datepicker', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, 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"] }]
|
|
899
1063
|
}], ctorParameters: function () {
|
|
900
|
-
return [{ type: i1$5.SkyThemeService, decorators: [{
|
|
1064
|
+
return [{ type: i0.ChangeDetectorRef }, { type: i1$5.SkyThemeService, decorators: [{
|
|
901
1065
|
type: Optional
|
|
902
1066
|
}] }];
|
|
903
1067
|
}, propDecorators: { datepickerInput: [{
|
|
@@ -908,12 +1072,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
908
1072
|
class SkyAgGridCellEditorDatepickerModule {
|
|
909
1073
|
}
|
|
910
1074
|
SkyAgGridCellEditorDatepickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorDatepickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
911
|
-
SkyAgGridCellEditorDatepickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorDatepickerModule, declarations: [SkyAgGridCellEditorDatepickerComponent], imports: [SkyDatepickerModule,
|
|
912
|
-
SkyAgGridCellEditorDatepickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorDatepickerModule, imports: [[SkyDatepickerModule,
|
|
1075
|
+
SkyAgGridCellEditorDatepickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorDatepickerModule, declarations: [SkyAgGridCellEditorDatepickerComponent], imports: [SkyDatepickerModule, ReactiveFormsModule], exports: [SkyAgGridCellEditorDatepickerComponent] });
|
|
1076
|
+
SkyAgGridCellEditorDatepickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorDatepickerModule, imports: [[SkyDatepickerModule, ReactiveFormsModule]] });
|
|
913
1077
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorDatepickerModule, decorators: [{
|
|
914
1078
|
type: NgModule,
|
|
915
1079
|
args: [{
|
|
916
|
-
imports: [SkyDatepickerModule,
|
|
1080
|
+
imports: [SkyDatepickerModule, ReactiveFormsModule],
|
|
917
1081
|
declarations: [SkyAgGridCellEditorDatepickerComponent],
|
|
918
1082
|
exports: [SkyAgGridCellEditorDatepickerComponent],
|
|
919
1083
|
}]
|
|
@@ -948,6 +1112,7 @@ function applySkyLookupPropertiesDefaults(skyLookupProperties) {
|
|
|
948
1112
|
};
|
|
949
1113
|
}
|
|
950
1114
|
|
|
1115
|
+
var _SkyAgGridCellEditorLookupComponent_triggerType;
|
|
951
1116
|
/**
|
|
952
1117
|
* @internal
|
|
953
1118
|
*/
|
|
@@ -956,21 +1121,33 @@ class SkyAgGridCellEditorLookupComponent {
|
|
|
956
1121
|
this.changeDetector = changeDetector;
|
|
957
1122
|
this.elementRef = elementRef;
|
|
958
1123
|
this.isAlive = false;
|
|
959
|
-
this.
|
|
960
|
-
|
|
1124
|
+
this.editorForm = new FormGroup({
|
|
1125
|
+
selection: new FormControl({
|
|
961
1126
|
value: [],
|
|
962
1127
|
disabled: false,
|
|
963
1128
|
}),
|
|
964
1129
|
});
|
|
965
1130
|
this.useAsyncSearch = false;
|
|
1131
|
+
_SkyAgGridCellEditorLookupComponent_triggerType.set(this, void 0);
|
|
966
1132
|
}
|
|
967
1133
|
agInit(params) {
|
|
968
1134
|
this.params = params;
|
|
969
1135
|
if (!Array.isArray(this.params.value)) {
|
|
970
1136
|
throw new Error(`Lookup value must be an array`);
|
|
971
1137
|
}
|
|
972
|
-
|
|
973
|
-
control
|
|
1138
|
+
__classPrivateFieldSet(this, _SkyAgGridCellEditorLookupComponent_triggerType, SkyAgGridCellEditorUtils.getEditorInitialAction(params), "f");
|
|
1139
|
+
const control = this.editorForm.get('selection');
|
|
1140
|
+
switch (__classPrivateFieldGet(this, _SkyAgGridCellEditorLookupComponent_triggerType, "f")) {
|
|
1141
|
+
case SkyAgGridCellEditorInitialAction.Delete:
|
|
1142
|
+
control.setValue([]);
|
|
1143
|
+
break;
|
|
1144
|
+
case SkyAgGridCellEditorInitialAction.Replace:
|
|
1145
|
+
case SkyAgGridCellEditorInitialAction.Highlighted:
|
|
1146
|
+
case SkyAgGridCellEditorInitialAction.Untouched:
|
|
1147
|
+
default:
|
|
1148
|
+
control.setValue(params.value);
|
|
1149
|
+
break;
|
|
1150
|
+
}
|
|
974
1151
|
if (this.params.skyComponentProperties.disabled) {
|
|
975
1152
|
control.disable();
|
|
976
1153
|
}
|
|
@@ -995,26 +1172,36 @@ class SkyAgGridCellEditorLookupComponent {
|
|
|
995
1172
|
return this.elementRef.nativeElement;
|
|
996
1173
|
}
|
|
997
1174
|
getValue() {
|
|
998
|
-
return this.
|
|
1175
|
+
return this.editorForm.get('selection').value;
|
|
999
1176
|
}
|
|
1000
1177
|
isPopup() {
|
|
1001
1178
|
return true;
|
|
1002
1179
|
}
|
|
1003
|
-
/*istanbul ignore next*/
|
|
1004
1180
|
afterGuiAttached() {
|
|
1005
|
-
|
|
1006
|
-
|
|
1181
|
+
const lookupInput = this.elementRef.nativeElement.querySelector('.sky-lookup-input');
|
|
1182
|
+
lookupInput.focus();
|
|
1183
|
+
if (__classPrivateFieldGet(this, _SkyAgGridCellEditorLookupComponent_triggerType, "f") === SkyAgGridCellEditorInitialAction.Replace) {
|
|
1184
|
+
lookupInput.select();
|
|
1185
|
+
lookupInput.setRangeText(this.params.charPress);
|
|
1186
|
+
// Ensure the cursor is at the end of the text.
|
|
1187
|
+
lookupInput.setSelectionRange(lookupInput.value.length, lookupInput.value.length);
|
|
1188
|
+
lookupInput.dispatchEvent(new Event('input'));
|
|
1189
|
+
}
|
|
1190
|
+
if (__classPrivateFieldGet(this, _SkyAgGridCellEditorLookupComponent_triggerType, "f") === SkyAgGridCellEditorInitialAction.Highlighted) {
|
|
1191
|
+
lookupInput.select();
|
|
1192
|
+
}
|
|
1007
1193
|
}
|
|
1008
1194
|
updateComponentProperties(params) {
|
|
1009
1195
|
const skyLookupProperties = params.skyComponentProperties;
|
|
1010
1196
|
return applySkyLookupPropertiesDefaults(skyLookupProperties);
|
|
1011
1197
|
}
|
|
1012
1198
|
}
|
|
1199
|
+
_SkyAgGridCellEditorLookupComponent_triggerType = new WeakMap();
|
|
1013
1200
|
SkyAgGridCellEditorLookupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorLookupComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1014
|
-
SkyAgGridCellEditorLookupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", 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]=\"
|
|
1201
|
+
SkyAgGridCellEditorLookupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", 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$6.λ10, selector: "sky-input-box", inputs: ["hasErrors", "disabled"] }, { type: i1$3.λ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: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1015
1202
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorLookupComponent, decorators: [{
|
|
1016
1203
|
type: Component,
|
|
1017
|
-
args: [{ selector: 'sky-ag-grid-cell-editor-lookup', changeDetection: ChangeDetectionStrategy.OnPush, template: "<sky-input-box\n *ngIf=\"isAlive && useAsyncSearch\"\n [disabled]=\"skyComponentProperties?.disabled\"\n [formGroup]=\"
|
|
1204
|
+
args: [{ selector: 'sky-ag-grid-cell-editor-lookup', changeDetection: ChangeDetectionStrategy.OnPush, 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"] }]
|
|
1018
1205
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }]; }, propDecorators: { width: [{
|
|
1019
1206
|
type: HostBinding,
|
|
1020
1207
|
args: ['style.width.px']
|
|
@@ -1050,10 +1237,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
1050
1237
|
}]
|
|
1051
1238
|
}] });
|
|
1052
1239
|
|
|
1240
|
+
var _SkyAgGridCellEditorNumberComponent_triggerType;
|
|
1053
1241
|
/**
|
|
1054
1242
|
* @internal
|
|
1055
1243
|
*/
|
|
1056
1244
|
class SkyAgGridCellEditorNumberComponent {
|
|
1245
|
+
constructor() {
|
|
1246
|
+
this.editorForm = new FormGroup({
|
|
1247
|
+
number: new FormControl(),
|
|
1248
|
+
});
|
|
1249
|
+
_SkyAgGridCellEditorNumberComponent_triggerType.set(this, void 0);
|
|
1250
|
+
}
|
|
1057
1251
|
/**
|
|
1058
1252
|
* agInit is called by agGrid once after the editor is created and provides the editor with the information it needs.
|
|
1059
1253
|
* @param params The cell editor params that include data about the cell, column, row, and grid.
|
|
@@ -1061,7 +1255,21 @@ class SkyAgGridCellEditorNumberComponent {
|
|
|
1061
1255
|
agInit(params) {
|
|
1062
1256
|
var _a, _b;
|
|
1063
1257
|
this.params = params;
|
|
1064
|
-
this
|
|
1258
|
+
__classPrivateFieldSet(this, _SkyAgGridCellEditorNumberComponent_triggerType, SkyAgGridCellEditorUtils.getEditorInitialAction(params), "f");
|
|
1259
|
+
const control = this.editorForm.get('number');
|
|
1260
|
+
switch (__classPrivateFieldGet(this, _SkyAgGridCellEditorNumberComponent_triggerType, "f")) {
|
|
1261
|
+
case SkyAgGridCellEditorInitialAction.Delete:
|
|
1262
|
+
control.setValue(undefined);
|
|
1263
|
+
break;
|
|
1264
|
+
case SkyAgGridCellEditorInitialAction.Replace:
|
|
1265
|
+
control.setValue(parseFloat(this.params.charPress) || undefined);
|
|
1266
|
+
break;
|
|
1267
|
+
case SkyAgGridCellEditorInitialAction.Highlighted:
|
|
1268
|
+
case SkyAgGridCellEditorInitialAction.Untouched:
|
|
1269
|
+
default:
|
|
1270
|
+
control.setValue(params.value);
|
|
1271
|
+
break;
|
|
1272
|
+
}
|
|
1065
1273
|
this.max = (_a = params.skyComponentProperties) === null || _a === void 0 ? void 0 : _a.max;
|
|
1066
1274
|
this.min = (_b = params.skyComponentProperties) === null || _b === void 0 ? void 0 : _b.min;
|
|
1067
1275
|
this.columnHeader = this.params.colDef.headerName;
|
|
@@ -1075,19 +1283,24 @@ class SkyAgGridCellEditorNumberComponent {
|
|
|
1075
1283
|
*/
|
|
1076
1284
|
afterGuiAttached() {
|
|
1077
1285
|
this.input.nativeElement.focus();
|
|
1286
|
+
if (__classPrivateFieldGet(this, _SkyAgGridCellEditorNumberComponent_triggerType, "f") === SkyAgGridCellEditorInitialAction.Highlighted) {
|
|
1287
|
+
this.input.nativeElement.select();
|
|
1288
|
+
}
|
|
1078
1289
|
}
|
|
1079
1290
|
/**
|
|
1080
1291
|
* getValue is called by agGrid when editing is stopped to get the new value of the cell.
|
|
1081
1292
|
*/
|
|
1082
1293
|
getValue() {
|
|
1083
|
-
|
|
1294
|
+
const val = this.editorForm.get('number').value;
|
|
1295
|
+
return val !== undefined && val !== null ? val : undefined;
|
|
1084
1296
|
}
|
|
1085
1297
|
}
|
|
1298
|
+
_SkyAgGridCellEditorNumberComponent_triggerType = new WeakMap();
|
|
1086
1299
|
SkyAgGridCellEditorNumberComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorNumberComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1087
|
-
SkyAgGridCellEditorNumberComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", 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
|
|
1300
|
+
SkyAgGridCellEditorNumberComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", 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$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1$4.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$4.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { type: i1$4.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { type: i1$4.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], pipes: { "skyLibResources": i3$1.SkyLibResourcesPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1088
1301
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorNumberComponent, decorators: [{
|
|
1089
1302
|
type: Component,
|
|
1090
|
-
args: [{ selector: 'sky-ag-grid-cell-editor-number', changeDetection: ChangeDetectionStrategy.OnPush, template: "<input\n
|
|
1303
|
+
args: [{ selector: 'sky-ag-grid-cell-editor-number', changeDetection: ChangeDetectionStrategy.OnPush, 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"] }]
|
|
1091
1304
|
}], propDecorators: { input: [{
|
|
1092
1305
|
type: ViewChild,
|
|
1093
1306
|
args: ['skyCellEditorNumber', { read: ElementRef }]
|
|
@@ -1096,21 +1309,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
1096
1309
|
class SkyAgGridCellEditorNumberModule {
|
|
1097
1310
|
}
|
|
1098
1311
|
SkyAgGridCellEditorNumberModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorNumberModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1099
|
-
SkyAgGridCellEditorNumberModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorNumberModule, declarations: [SkyAgGridCellEditorNumberComponent], imports: [SkyAgGridResourcesModule,
|
|
1100
|
-
SkyAgGridCellEditorNumberModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorNumberModule, imports: [[SkyAgGridResourcesModule,
|
|
1312
|
+
SkyAgGridCellEditorNumberModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorNumberModule, declarations: [SkyAgGridCellEditorNumberComponent], imports: [SkyAgGridResourcesModule, ReactiveFormsModule], exports: [SkyAgGridCellEditorNumberComponent] });
|
|
1313
|
+
SkyAgGridCellEditorNumberModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorNumberModule, imports: [[SkyAgGridResourcesModule, ReactiveFormsModule]] });
|
|
1101
1314
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorNumberModule, decorators: [{
|
|
1102
1315
|
type: NgModule,
|
|
1103
1316
|
args: [{
|
|
1104
|
-
imports: [SkyAgGridResourcesModule,
|
|
1317
|
+
imports: [SkyAgGridResourcesModule, ReactiveFormsModule],
|
|
1105
1318
|
declarations: [SkyAgGridCellEditorNumberComponent],
|
|
1106
1319
|
exports: [SkyAgGridCellEditorNumberComponent],
|
|
1107
1320
|
}]
|
|
1108
1321
|
}] });
|
|
1109
1322
|
|
|
1323
|
+
var _SkyAgGridCellEditorTextComponent_triggerType;
|
|
1110
1324
|
/**
|
|
1111
1325
|
* @internal
|
|
1112
1326
|
*/
|
|
1113
1327
|
class SkyAgGridCellEditorTextComponent {
|
|
1328
|
+
constructor() {
|
|
1329
|
+
this.editorForm = new FormGroup({
|
|
1330
|
+
text: new FormControl(),
|
|
1331
|
+
});
|
|
1332
|
+
_SkyAgGridCellEditorTextComponent_triggerType.set(this, void 0);
|
|
1333
|
+
}
|
|
1114
1334
|
/**
|
|
1115
1335
|
* agInit is called by agGrid once after the editor is created and provides the editor with the information it needs.
|
|
1116
1336
|
* @param params The cell editor params that include data about the cell, column, row, and grid.
|
|
@@ -1118,7 +1338,21 @@ class SkyAgGridCellEditorTextComponent {
|
|
|
1118
1338
|
agInit(params) {
|
|
1119
1339
|
var _a;
|
|
1120
1340
|
this.params = params;
|
|
1121
|
-
this
|
|
1341
|
+
__classPrivateFieldSet(this, _SkyAgGridCellEditorTextComponent_triggerType, SkyAgGridCellEditorUtils.getEditorInitialAction(params), "f");
|
|
1342
|
+
const control = this.editorForm.get('text');
|
|
1343
|
+
switch (__classPrivateFieldGet(this, _SkyAgGridCellEditorTextComponent_triggerType, "f")) {
|
|
1344
|
+
case SkyAgGridCellEditorInitialAction.Delete:
|
|
1345
|
+
control.setValue(undefined);
|
|
1346
|
+
break;
|
|
1347
|
+
case SkyAgGridCellEditorInitialAction.Replace:
|
|
1348
|
+
control.setValue(params.charPress);
|
|
1349
|
+
break;
|
|
1350
|
+
case SkyAgGridCellEditorInitialAction.Highlighted:
|
|
1351
|
+
case SkyAgGridCellEditorInitialAction.Untouched:
|
|
1352
|
+
default:
|
|
1353
|
+
control.setValue(params.value);
|
|
1354
|
+
break;
|
|
1355
|
+
}
|
|
1122
1356
|
this.maxlength = (_a = params.skyComponentProperties) === null || _a === void 0 ? void 0 : _a.maxlength;
|
|
1123
1357
|
this.columnHeader = this.params.colDef.headerName;
|
|
1124
1358
|
this.rowNumber = this.params.rowIndex + 1;
|
|
@@ -1131,19 +1365,23 @@ class SkyAgGridCellEditorTextComponent {
|
|
|
1131
1365
|
*/
|
|
1132
1366
|
afterGuiAttached() {
|
|
1133
1367
|
this.input.nativeElement.focus();
|
|
1368
|
+
if (__classPrivateFieldGet(this, _SkyAgGridCellEditorTextComponent_triggerType, "f") === SkyAgGridCellEditorInitialAction.Highlighted) {
|
|
1369
|
+
this.input.nativeElement.select();
|
|
1370
|
+
}
|
|
1134
1371
|
}
|
|
1135
1372
|
/**
|
|
1136
1373
|
* getValue is called by agGrid when editing is stopped to get the new value of the cell.
|
|
1137
1374
|
*/
|
|
1138
1375
|
getValue() {
|
|
1139
|
-
return this.value;
|
|
1376
|
+
return this.editorForm.get('text').value || undefined;
|
|
1140
1377
|
}
|
|
1141
1378
|
}
|
|
1379
|
+
_SkyAgGridCellEditorTextComponent_triggerType = new WeakMap();
|
|
1142
1380
|
SkyAgGridCellEditorTextComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1143
|
-
SkyAgGridCellEditorTextComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", 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
|
|
1381
|
+
SkyAgGridCellEditorTextComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", 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$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1$4.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$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i1$4.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }], pipes: { "skyLibResources": i3$1.SkyLibResourcesPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1144
1382
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorTextComponent, decorators: [{
|
|
1145
1383
|
type: Component,
|
|
1146
|
-
args: [{ selector: 'sky-ag-grid-cell-editor-text', changeDetection: ChangeDetectionStrategy.OnPush, template: "<input\n
|
|
1384
|
+
args: [{ selector: 'sky-ag-grid-cell-editor-text', changeDetection: ChangeDetectionStrategy.OnPush, 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"] }]
|
|
1147
1385
|
}], propDecorators: { input: [{
|
|
1148
1386
|
type: ViewChild,
|
|
1149
1387
|
args: ['skyCellEditorText', { read: ElementRef }]
|
|
@@ -1152,12 +1390,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
1152
1390
|
class SkyAgGridCellEditorTextModule {
|
|
1153
1391
|
}
|
|
1154
1392
|
SkyAgGridCellEditorTextModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorTextModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1155
|
-
SkyAgGridCellEditorTextModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorTextModule, declarations: [SkyAgGridCellEditorTextComponent], imports: [SkyAgGridResourcesModule,
|
|
1156
|
-
SkyAgGridCellEditorTextModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorTextModule, imports: [[SkyAgGridResourcesModule,
|
|
1393
|
+
SkyAgGridCellEditorTextModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorTextModule, declarations: [SkyAgGridCellEditorTextComponent], imports: [SkyAgGridResourcesModule, ReactiveFormsModule], exports: [SkyAgGridCellEditorTextComponent] });
|
|
1394
|
+
SkyAgGridCellEditorTextModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorTextModule, imports: [[SkyAgGridResourcesModule, ReactiveFormsModule]] });
|
|
1157
1395
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAgGridCellEditorTextModule, decorators: [{
|
|
1158
1396
|
type: NgModule,
|
|
1159
1397
|
args: [{
|
|
1160
|
-
imports: [SkyAgGridResourcesModule,
|
|
1398
|
+
imports: [SkyAgGridResourcesModule, ReactiveFormsModule],
|
|
1161
1399
|
declarations: [SkyAgGridCellEditorTextComponent],
|
|
1162
1400
|
exports: [SkyAgGridCellEditorTextComponent],
|
|
1163
1401
|
}]
|
|
@@ -1833,7 +2071,7 @@ class SkyAgGridService {
|
|
|
1833
2071
|
getDefaultGridOptions(args) {
|
|
1834
2072
|
var _a, _b, _c, _d, _e, _f;
|
|
1835
2073
|
// cellClassRules can be functions or string expressions
|
|
1836
|
-
const cellClassRuleTrueExpression =
|
|
2074
|
+
const cellClassRuleTrueExpression = () => true;
|
|
1837
2075
|
function getEditableFn(isUneditable) {
|
|
1838
2076
|
return function (params) {
|
|
1839
2077
|
let isEditable = params.colDef.editable;
|
|
@@ -2075,5 +2313,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
2075
2313
|
* Generated bundle index. Do not edit.
|
|
2076
2314
|
*/
|
|
2077
2315
|
|
|
2078
|
-
export { SkyAgGridModule, SkyAgGridService, SkyCellClass, SkyCellType, SkyHeaderClass, SkyAgGridCellEditorAutocompleteComponent as λ1, SkyAgGridCellRendererValidatorTooltipComponent as λ10, SkyAgGridCellValidatorTooltipComponent as λ11, SkyAgGridWrapperComponent as λ12, SkyAgGridRowDeleteDirective as λ13, SkyAgGridDataManagerAdapterDirective as λ14, SkyAgGridCellEditorLookupComponent as λ15, SkyAgGridCellRendererLookupComponent as λ16, SkyAgGridCellEditorTextComponent as λ2, SkyAgGridCellEditorCurrencyComponent as λ3, SkyAgGridCellEditorNumberComponent as λ4, SkyAgGridCellEditorDatepickerComponent as λ5, SkyAgGridRowDeleteComponent as λ6, SkyAgGridCellRendererRowSelectorComponent as λ7, SkyAgGridCellRendererCurrencyValidatorComponent as λ8, SkyAgGridCellRendererCurrencyComponent as λ9 };
|
|
2316
|
+
export { SkyAgGridCellEditorInitialAction, SkyAgGridCellEditorUtils, SkyAgGridModule, SkyAgGridService, SkyCellClass, SkyCellType, SkyHeaderClass, SkyAgGridCellEditorAutocompleteComponent as λ1, SkyAgGridCellRendererValidatorTooltipComponent as λ10, SkyAgGridCellValidatorTooltipComponent as λ11, SkyAgGridWrapperComponent as λ12, SkyAgGridRowDeleteDirective as λ13, SkyAgGridDataManagerAdapterDirective as λ14, SkyAgGridCellEditorLookupComponent as λ15, SkyAgGridCellRendererLookupComponent as λ16, SkyAgGridCellEditorTextComponent as λ2, SkyAgGridCellEditorCurrencyComponent as λ3, SkyAgGridCellEditorNumberComponent as λ4, SkyAgGridCellEditorDatepickerComponent as λ5, SkyAgGridRowDeleteComponent as λ6, SkyAgGridCellRendererRowSelectorComponent as λ7, SkyAgGridCellRendererCurrencyValidatorComponent as λ8, SkyAgGridCellRendererCurrencyComponent as λ9 };
|
|
2079
2317
|
//# sourceMappingURL=skyux-ag-grid.mjs.map
|