@skyux/ag-grid 4.11.0 → 4.12.3
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/CHANGELOG.md +18 -0
- package/bundles/skyux-ag-grid.umd.js +287 -53
- package/bundles/skyux-ag-grid.umd.js.map +1 -1
- package/bundles/skyux-ag-grid.umd.min.js +2 -2
- package/bundles/skyux-ag-grid.umd.min.js.map +1 -1
- package/css/sky-ag-grid.css +56 -8
- package/esm2015/modules/ag-grid/ag-grid-data-manager-adapter.directive.js +49 -14
- package/esm2015/modules/ag-grid/ag-grid-row-delete.directive.js +5 -2
- package/esm2015/modules/ag-grid/ag-grid.module.js +9 -1
- package/esm2015/modules/ag-grid/ag-grid.service.js +53 -13
- package/esm2015/modules/ag-grid/cell-editors/cell-editor-lookup/cell-editor-lookup.component.js +68 -0
- package/esm2015/modules/ag-grid/cell-editors/cell-editor-lookup/cell-editor-lookup.module.js +25 -0
- package/esm2015/modules/ag-grid/cell-renderers/cell-renderer-lookup/cell-renderer-lookup.component.js +32 -0
- package/esm2015/modules/ag-grid/cell-renderers/cell-renderer-lookup/cell-renderer-lookup.module.js +16 -0
- package/esm2015/modules/ag-grid/cell-validator/ag-grid-cell-validator-tooltip.component.js +3 -3
- package/esm2015/modules/ag-grid/types/cell-class.js +2 -1
- package/esm2015/modules/ag-grid/types/cell-editor-lookup-params.js +1 -0
- package/esm2015/modules/ag-grid/types/cell-renderer-lookup-params.js +1 -0
- package/esm2015/modules/ag-grid/types/cell-type.js +2 -1
- package/esm2015/modules/ag-grid/types/lookup-properties.js +24 -0
- package/esm2015/plugin-resources/ag-grid-resources-provider.js +2 -2
- package/esm2015/skyux-ag-grid.js +20 -16
- package/esm5/modules/ag-grid/ag-grid-data-manager-adapter.directive.js +51 -14
- package/esm5/modules/ag-grid/ag-grid-row-delete.directive.js +2 -2
- package/esm5/modules/ag-grid/ag-grid.module.js +9 -1
- package/esm5/modules/ag-grid/ag-grid.service.js +63 -23
- package/esm5/modules/ag-grid/cell-editors/cell-editor-lookup/cell-editor-lookup.component.js +69 -0
- package/esm5/modules/ag-grid/cell-editors/cell-editor-lookup/cell-editor-lookup.module.js +28 -0
- package/esm5/modules/ag-grid/cell-renderers/cell-renderer-lookup/cell-renderer-lookup.component.js +33 -0
- package/esm5/modules/ag-grid/cell-renderers/cell-renderer-lookup/cell-renderer-lookup.module.js +19 -0
- package/esm5/modules/ag-grid/cell-validator/ag-grid-cell-validator-tooltip.component.js +3 -3
- package/esm5/modules/ag-grid/types/cell-class.js +2 -1
- package/esm5/modules/ag-grid/types/cell-editor-lookup-params.js +1 -0
- package/esm5/modules/ag-grid/types/cell-renderer-lookup-params.js +1 -0
- package/esm5/modules/ag-grid/types/cell-type.js +2 -1
- package/esm5/modules/ag-grid/types/lookup-properties.js +24 -0
- package/esm5/plugin-resources/ag-grid-resources-provider.js +2 -2
- package/esm5/skyux-ag-grid.js +20 -16
- package/fesm2015/skyux-ag-grid.js +256 -33
- package/fesm2015/skyux-ag-grid.js.map +1 -1
- package/fesm5/skyux-ag-grid.js +273 -43
- package/fesm5/skyux-ag-grid.js.map +1 -1
- package/modules/ag-grid/ag-grid-data-manager-adapter.directive.d.ts +3 -1
- package/modules/ag-grid/cell-editors/cell-editor-lookup/cell-editor-lookup.component.d.ts +22 -0
- package/modules/ag-grid/cell-editors/cell-editor-lookup/cell-editor-lookup.module.d.ts +2 -0
- package/modules/ag-grid/cell-renderers/cell-renderer-lookup/cell-renderer-lookup.component.d.ts +11 -0
- package/modules/ag-grid/cell-renderers/cell-renderer-lookup/cell-renderer-lookup.module.d.ts +2 -0
- package/modules/ag-grid/types/cell-class.d.ts +1 -0
- package/modules/ag-grid/types/cell-editor-lookup-params.d.ts +5 -0
- package/modules/ag-grid/types/cell-renderer-lookup-params.d.ts +5 -0
- package/modules/ag-grid/types/cell-type.d.ts +1 -0
- package/modules/ag-grid/types/lookup-properties.d.ts +44 -0
- package/package.json +3 -3
- package/skyux-ag-grid.d.ts +19 -15
- package/skyux-ag-grid.metadata.json +1 -1
- package/src/assets/locales/resources_en_US.json +4 -0
package/fesm5/skyux-ag-grid.js
CHANGED
|
@@ -7,13 +7,13 @@ import { SkyDataManagerService, SkyDataManagerModule } from '@skyux/data-manager
|
|
|
7
7
|
import { SkyInlineDeleteModule } from '@skyux/layout';
|
|
8
8
|
import { SkyLibResourcesService, getStringForLocale, SKY_LIB_RESOURCES_PROVIDERS, SkyI18nModule } from '@skyux/i18n';
|
|
9
9
|
import { Subject } from 'rxjs';
|
|
10
|
-
import { takeUntil } from 'rxjs/operators';
|
|
10
|
+
import { takeUntil, filter } from 'rxjs/operators';
|
|
11
11
|
import { SkyThemeService } from '@skyux/theme';
|
|
12
12
|
import { PopupComponent, RowNode, Events } from 'ag-grid-community';
|
|
13
|
-
import { FormsModule } from '@angular/forms';
|
|
14
|
-
import { SkyAutocompleteModule } from '@skyux/lookup';
|
|
13
|
+
import { FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
14
|
+
import { SkyAutocompleteModule, SkyLookupModule } from '@skyux/lookup';
|
|
15
15
|
import { SkyDatepickerModule } from '@skyux/datetime';
|
|
16
|
-
import { SkyCheckboxModule } from '@skyux/forms';
|
|
16
|
+
import { SkyInputBoxModule, SkyCheckboxModule } from '@skyux/forms';
|
|
17
17
|
import { SkyStatusIndicatorModule } from '@skyux/indicators';
|
|
18
18
|
import { SkyPopoverMessageType, SkyPopoverModule } from '@skyux/popovers';
|
|
19
19
|
import { SkyAutonumericModule } from '@skyux/autonumeric';
|
|
@@ -116,6 +116,94 @@ var SkyAgGridCellEditorDatepickerComponent = /** @class */ (function (_super) {
|
|
|
116
116
|
return SkyAgGridCellEditorDatepickerComponent;
|
|
117
117
|
}(PopupComponent));
|
|
118
118
|
|
|
119
|
+
function applySkyLookupPropertiesDefaults(skyLookupProperties) {
|
|
120
|
+
return {
|
|
121
|
+
ariaLabel: skyLookupProperties.ariaLabel || '',
|
|
122
|
+
autocompleteAttribute: skyLookupProperties.autocompleteAttribute || 'off',
|
|
123
|
+
data: skyLookupProperties.data || [],
|
|
124
|
+
debounceTime: skyLookupProperties.debounceTime || 0,
|
|
125
|
+
descriptorProperty: skyLookupProperties.descriptorProperty || 'name',
|
|
126
|
+
disabled: skyLookupProperties.disabled || false,
|
|
127
|
+
enableShowMore: skyLookupProperties.enableShowMore || false,
|
|
128
|
+
idProperty: skyLookupProperties.idProperty || undefined,
|
|
129
|
+
placeholderText: skyLookupProperties.placeholderText || '',
|
|
130
|
+
propertiesToSearch: skyLookupProperties.propertiesToSearch || undefined,
|
|
131
|
+
search: skyLookupProperties.search || undefined,
|
|
132
|
+
searchFilters: skyLookupProperties.searchFilters || [],
|
|
133
|
+
searchResultsLimit: skyLookupProperties.searchResultsLimit || undefined,
|
|
134
|
+
searchResultTemplate: skyLookupProperties.searchResultTemplate || undefined,
|
|
135
|
+
searchTextMinimumCharacters: skyLookupProperties.searchTextMinimumCharacters || 1,
|
|
136
|
+
selectMode: skyLookupProperties.selectMode || undefined,
|
|
137
|
+
showAddButton: skyLookupProperties.showAddButton || false,
|
|
138
|
+
showMoreConfig: skyLookupProperties.showMoreConfig || {},
|
|
139
|
+
wrapperClass: 'ag-custom-component-popup'
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
var SkyAgGridCellEditorLookupComponent = /** @class */ (function () {
|
|
144
|
+
function SkyAgGridCellEditorLookupComponent(changeDetector, elementRef) {
|
|
145
|
+
this.changeDetector = changeDetector;
|
|
146
|
+
this.elementRef = elementRef;
|
|
147
|
+
this.isAlive = true;
|
|
148
|
+
this.lookupForm = new FormGroup({
|
|
149
|
+
currentSelection: new FormControl({
|
|
150
|
+
value: [],
|
|
151
|
+
disabled: false
|
|
152
|
+
})
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
SkyAgGridCellEditorLookupComponent.prototype.agInit = function (params) {
|
|
156
|
+
this.params = params;
|
|
157
|
+
if (!Array.isArray(this.params.value)) {
|
|
158
|
+
throw new Error("Lookup value must be an array");
|
|
159
|
+
}
|
|
160
|
+
var control = this.lookupForm.get('currentSelection');
|
|
161
|
+
control.setValue(this.params.value);
|
|
162
|
+
if (this.params.skyComponentProperties.disabled) {
|
|
163
|
+
control.disable();
|
|
164
|
+
}
|
|
165
|
+
this.skyComponentProperties = this.updateComponentProperties(this.params);
|
|
166
|
+
this.changeDetector.markForCheck();
|
|
167
|
+
};
|
|
168
|
+
SkyAgGridCellEditorLookupComponent.prototype.isCancelAfterEnd = function () {
|
|
169
|
+
// Shut down components to commit values before final value syncs to grid.
|
|
170
|
+
this.isAlive = false;
|
|
171
|
+
this.changeDetector.detectChanges();
|
|
172
|
+
return false;
|
|
173
|
+
};
|
|
174
|
+
SkyAgGridCellEditorLookupComponent.prototype.getGui = function () {
|
|
175
|
+
return this.elementRef.nativeElement;
|
|
176
|
+
};
|
|
177
|
+
SkyAgGridCellEditorLookupComponent.prototype.getValue = function () {
|
|
178
|
+
return this.lookupForm.get('currentSelection').value;
|
|
179
|
+
};
|
|
180
|
+
SkyAgGridCellEditorLookupComponent.prototype.isPopup = function () {
|
|
181
|
+
return true;
|
|
182
|
+
};
|
|
183
|
+
/*istanbul ignore next*/
|
|
184
|
+
SkyAgGridCellEditorLookupComponent.prototype.afterGuiAttached = function () {
|
|
185
|
+
var _a;
|
|
186
|
+
(_a = this.elementRef.nativeElement.querySelector('.sky-lookup-input')) === null || _a === void 0 ? void 0 : _a.focus();
|
|
187
|
+
};
|
|
188
|
+
SkyAgGridCellEditorLookupComponent.prototype.updateComponentProperties = function (params) {
|
|
189
|
+
var skyLookupProperties = params.skyComponentProperties;
|
|
190
|
+
return applySkyLookupPropertiesDefaults(skyLookupProperties);
|
|
191
|
+
};
|
|
192
|
+
SkyAgGridCellEditorLookupComponent.ctorParameters = function () { return [
|
|
193
|
+
{ type: ChangeDetectorRef },
|
|
194
|
+
{ type: ElementRef }
|
|
195
|
+
]; };
|
|
196
|
+
SkyAgGridCellEditorLookupComponent = __decorate([
|
|
197
|
+
Component({
|
|
198
|
+
selector: 'sky-ag-grid-cell-editor-lookup',
|
|
199
|
+
template: "<sky-input-box *ngIf=\"isAlive\"\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]=\"skyComponentProperties?.searchTextMinimumCharacters\"\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",
|
|
200
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
201
|
+
styles: [":host{display:block}"]
|
|
202
|
+
})
|
|
203
|
+
], SkyAgGridCellEditorLookupComponent);
|
|
204
|
+
return SkyAgGridCellEditorLookupComponent;
|
|
205
|
+
}());
|
|
206
|
+
|
|
119
207
|
var SkyAgGridCellEditorNumberComponent = /** @class */ (function () {
|
|
120
208
|
function SkyAgGridCellEditorNumberComponent() {
|
|
121
209
|
}
|
|
@@ -239,6 +327,36 @@ var SkyAgGridCellRendererCurrencyValidatorComponent = /** @class */ (function ()
|
|
|
239
327
|
return SkyAgGridCellRendererCurrencyValidatorComponent;
|
|
240
328
|
}());
|
|
241
329
|
|
|
330
|
+
var SkyAgGridCellRendererLookupComponent = /** @class */ (function () {
|
|
331
|
+
function SkyAgGridCellRendererLookupComponent(changeDetector) {
|
|
332
|
+
this.changeDetector = changeDetector;
|
|
333
|
+
this.value = '';
|
|
334
|
+
this.summaryCount = 0;
|
|
335
|
+
}
|
|
336
|
+
SkyAgGridCellRendererLookupComponent.prototype.agInit = function (params) {
|
|
337
|
+
var _a;
|
|
338
|
+
this.summaryCount = ((_a = params.value) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
339
|
+
this.value = "" + params.valueFormatted;
|
|
340
|
+
this.changeDetector.markForCheck();
|
|
341
|
+
};
|
|
342
|
+
SkyAgGridCellRendererLookupComponent.prototype.refresh = function (params) {
|
|
343
|
+
this.agInit(params);
|
|
344
|
+
return true;
|
|
345
|
+
};
|
|
346
|
+
SkyAgGridCellRendererLookupComponent.ctorParameters = function () { return [
|
|
347
|
+
{ type: ChangeDetectorRef }
|
|
348
|
+
]; };
|
|
349
|
+
SkyAgGridCellRendererLookupComponent = __decorate([
|
|
350
|
+
Component({
|
|
351
|
+
selector: 'sky-cell-renderer-lookup',
|
|
352
|
+
template: "<ng-container *ngIf=\"summaryCount > 5; else showValue\">\n {{ 'skyux_lookup_tokens_summary' | skyLibResources:summaryCount }}\n</ng-container>\n<ng-template #showValue>{{ value }}</ng-template>\n",
|
|
353
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
354
|
+
styles: [":host{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}"]
|
|
355
|
+
})
|
|
356
|
+
], SkyAgGridCellRendererLookupComponent);
|
|
357
|
+
return SkyAgGridCellRendererLookupComponent;
|
|
358
|
+
}());
|
|
359
|
+
|
|
242
360
|
var SkyAgGridCellRendererRowSelectorComponent = /** @class */ (function () {
|
|
243
361
|
function SkyAgGridCellRendererRowSelectorComponent(changeDetection) {
|
|
244
362
|
this.changeDetection = changeDetection;
|
|
@@ -348,6 +466,7 @@ var SkyCellClass;
|
|
|
348
466
|
SkyCellClass["Date"] = "sky-ag-grid-cell-date";
|
|
349
467
|
SkyCellClass["Editable"] = "sky-ag-grid-cell-editable";
|
|
350
468
|
SkyCellClass["Invalid"] = "sky-ag-grid-cell-invalid";
|
|
469
|
+
SkyCellClass["Lookup"] = "sky-ag-grid-cell-lookup";
|
|
351
470
|
SkyCellClass["Number"] = "sky-ag-grid-cell-number";
|
|
352
471
|
SkyCellClass["RowSelector"] = "sky-ag-grid-cell-row-selector";
|
|
353
472
|
SkyCellClass["Text"] = "sky-ag-grid-cell-text";
|
|
@@ -360,6 +479,7 @@ var SkyCellType;
|
|
|
360
479
|
SkyCellType["Currency"] = "skyCellCurrency";
|
|
361
480
|
SkyCellType["CurrencyValidator"] = "skyCellCurrencyValidator";
|
|
362
481
|
SkyCellType["Date"] = "skyCellDate";
|
|
482
|
+
SkyCellType["Lookup"] = "skyCellLookup";
|
|
363
483
|
SkyCellType["Number"] = "skyCellNumber";
|
|
364
484
|
SkyCellType["NumberValidator"] = "skyCellNumberValidator";
|
|
365
485
|
SkyCellType["RowSelector"] = "skyCellRowSelector";
|
|
@@ -548,18 +668,19 @@ function dateComparator(date1, date2) {
|
|
|
548
668
|
}
|
|
549
669
|
function getValidatorCellRendererSelector(component, fallback) {
|
|
550
670
|
return function (params) {
|
|
551
|
-
var _a, _b
|
|
552
|
-
if (typeof ((
|
|
671
|
+
var _a, _b;
|
|
672
|
+
if (params.colDef && typeof ((_b = (_a = params.colDef.cellRendererParams) === null || _a === void 0 ? void 0 : _a.skyComponentProperties) === null || _b === void 0 ? void 0 : _b.validator) === 'function') {
|
|
553
673
|
if (!params.colDef.cellRendererParams.skyComponentProperties.validator(params.value, params.data, params.rowIndex)) {
|
|
554
674
|
return {
|
|
555
675
|
component: component,
|
|
556
|
-
params: __assign({},
|
|
676
|
+
params: __assign({}, params.colDef.cellRendererParams)
|
|
557
677
|
};
|
|
558
678
|
}
|
|
559
679
|
}
|
|
560
680
|
return fallback;
|
|
561
681
|
};
|
|
562
682
|
}
|
|
683
|
+
var rowNodeId = 1;
|
|
563
684
|
/**
|
|
564
685
|
* A service that provides default styling and behavior for agGrids in SKY UX SPAs.
|
|
565
686
|
*/
|
|
@@ -602,9 +723,9 @@ var SkyAgGridService = /** @class */ (function () {
|
|
|
602
723
|
return mergedGridOptions;
|
|
603
724
|
};
|
|
604
725
|
SkyAgGridService.prototype.getDefaultGridOptions = function (args) {
|
|
605
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
726
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
606
727
|
var _this = this;
|
|
607
|
-
var
|
|
728
|
+
var _l, _m, _o, _p, _q, _r;
|
|
608
729
|
// cellClassRules can be functions or string expressions
|
|
609
730
|
var cellClassRuleTrueExpression = 'true';
|
|
610
731
|
function getEditableFn(isUneditable) {
|
|
@@ -623,8 +744,8 @@ var SkyAgGridService = /** @class */ (function () {
|
|
|
623
744
|
_a);
|
|
624
745
|
function getValidatorFn() {
|
|
625
746
|
return function (param) {
|
|
626
|
-
var _a, _b
|
|
627
|
-
if (typeof ((
|
|
747
|
+
var _a, _b;
|
|
748
|
+
if (param.colDef && typeof ((_b = (_a = param.colDef.cellRendererParams) === null || _a === void 0 ? void 0 : _a.skyComponentProperties) === null || _b === void 0 ? void 0 : _b.validator) === 'function') {
|
|
628
749
|
return !param.colDef.cellRendererParams.skyComponentProperties.validator(param.value, param.data, param.rowIndex);
|
|
629
750
|
}
|
|
630
751
|
return false;
|
|
@@ -653,19 +774,34 @@ var SkyAgGridService = /** @class */ (function () {
|
|
|
653
774
|
cellClassRules: __assign((_f = {}, _f[SkyCellClass.Date] = cellClassRuleTrueExpression, _f), editableCellClassRules),
|
|
654
775
|
cellEditorFramework: SkyAgGridCellEditorDatepickerComponent,
|
|
655
776
|
comparator: dateComparator,
|
|
656
|
-
minWidth: ((
|
|
777
|
+
minWidth: ((_m = (_l = this.currentTheme) === null || _l === void 0 ? void 0 : _l.theme) === null || _m === void 0 ? void 0 : _m.name) === 'modern' ? 180 : 160,
|
|
657
778
|
valueFormatter: function (params) { return _this.dateFormatter(params, args.locale); }
|
|
658
779
|
},
|
|
780
|
+
_c[SkyCellType.Lookup] = {
|
|
781
|
+
cellClassRules: __assign((_g = {}, _g[SkyCellClass.Lookup] = cellClassRuleTrueExpression, _g), editableCellClassRules),
|
|
782
|
+
cellEditorFramework: SkyAgGridCellEditorLookupComponent,
|
|
783
|
+
cellRendererFramework: SkyAgGridCellRendererLookupComponent,
|
|
784
|
+
valueFormatter: function (params) {
|
|
785
|
+
var lookupProperties = applySkyLookupPropertiesDefaults(params);
|
|
786
|
+
return (params.value || [])
|
|
787
|
+
.map(function (value) {
|
|
788
|
+
return value[lookupProperties.descriptorProperty];
|
|
789
|
+
})
|
|
790
|
+
.filter(function (value) { return value !== '' && value !== undefined; })
|
|
791
|
+
.join('; ');
|
|
792
|
+
},
|
|
793
|
+
minWidth: 185
|
|
794
|
+
},
|
|
659
795
|
_c[SkyCellType.Number] = {
|
|
660
|
-
cellClassRules: __assign((
|
|
796
|
+
cellClassRules: __assign((_h = {}, _h[SkyCellClass.Number] = cellClassRuleTrueExpression, _h), editableCellClassRules),
|
|
661
797
|
cellEditorFramework: SkyAgGridCellEditorNumberComponent,
|
|
662
798
|
headerClass: SkyHeaderClass.RightAligned
|
|
663
799
|
},
|
|
664
800
|
_c[SkyCellType.RowSelector] = {
|
|
665
|
-
cellClassRules: (
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
801
|
+
cellClassRules: (_j = {},
|
|
802
|
+
_j[SkyCellClass.RowSelector] = cellClassRuleTrueExpression,
|
|
803
|
+
_j[SkyCellClass.Uneditable] = cellClassRuleTrueExpression,
|
|
804
|
+
_j),
|
|
669
805
|
cellRendererFramework: SkyAgGridCellRendererRowSelectorComponent,
|
|
670
806
|
headerName: '',
|
|
671
807
|
minWidth: 55,
|
|
@@ -674,7 +810,7 @@ var SkyAgGridService = /** @class */ (function () {
|
|
|
674
810
|
width: 55
|
|
675
811
|
},
|
|
676
812
|
_c[SkyCellType.Text] = {
|
|
677
|
-
cellClassRules: __assign((
|
|
813
|
+
cellClassRules: __assign((_k = {}, _k[SkyCellClass.Text] = cellClassRuleTrueExpression, _k), editableCellClassRules),
|
|
678
814
|
cellEditorFramework: SkyAgGridCellEditorTextComponent
|
|
679
815
|
},
|
|
680
816
|
_c[SkyCellType.Validator] = {
|
|
@@ -696,7 +832,21 @@ var SkyAgGridService = /** @class */ (function () {
|
|
|
696
832
|
'sky-ag-grid-cell-renderer-currency-validator': SkyAgGridCellRendererCurrencyValidatorComponent,
|
|
697
833
|
'sky-ag-grid-cell-renderer-validator-tooltip': SkyAgGridCellRendererValidatorTooltipComponent
|
|
698
834
|
},
|
|
699
|
-
|
|
835
|
+
getRowNodeId: function (data) {
|
|
836
|
+
if ('id' in data && data.id) {
|
|
837
|
+
return "" + data.id;
|
|
838
|
+
}
|
|
839
|
+
return "" + rowNodeId++;
|
|
840
|
+
},
|
|
841
|
+
getRowClass: function (params) {
|
|
842
|
+
if (params.node.id) {
|
|
843
|
+
return "sky-ag-grid-row-" + params.node.id;
|
|
844
|
+
}
|
|
845
|
+
else {
|
|
846
|
+
return undefined;
|
|
847
|
+
}
|
|
848
|
+
},
|
|
849
|
+
headerHeight: ((_p = (_o = this.currentTheme) === null || _o === void 0 ? void 0 : _o.theme) === null || _p === void 0 ? void 0 : _p.name) === 'modern' ? 60 : 37,
|
|
700
850
|
icons: {
|
|
701
851
|
sortDescending: this.getIconTemplate('caret-down'),
|
|
702
852
|
sortAscending: this.getIconTemplate('caret-up'),
|
|
@@ -707,7 +857,7 @@ var SkyAgGridService = /** @class */ (function () {
|
|
|
707
857
|
columnMovePin: this.getIconTemplate('arrows')
|
|
708
858
|
},
|
|
709
859
|
onCellFocused: function () { return _this.onCellFocused(); },
|
|
710
|
-
rowHeight: ((
|
|
860
|
+
rowHeight: ((_r = (_q = this.currentTheme) === null || _q === void 0 ? void 0 : _q.theme) === null || _r === void 0 ? void 0 : _r.name) === 'modern' ? 60 : 38,
|
|
711
861
|
rowMultiSelectWithClick: true,
|
|
712
862
|
rowSelection: 'multiple',
|
|
713
863
|
singleClickEdit: true,
|
|
@@ -725,9 +875,12 @@ var SkyAgGridService = /** @class */ (function () {
|
|
|
725
875
|
validatorMessage: 'Please enter a valid currency'
|
|
726
876
|
}
|
|
727
877
|
} });
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
878
|
+
/*istanbul ignore else*/
|
|
879
|
+
if (this.resources) {
|
|
880
|
+
this.resources.getString('sky_ag_grid_cell_renderer_currency_validator_message').subscribe(function (value) {
|
|
881
|
+
defaultSkyGridOptions.columnTypes[SkyCellType.CurrencyValidator].cellRendererParams.skyComponentProperties.validatorMessage = value;
|
|
882
|
+
});
|
|
883
|
+
}
|
|
731
884
|
defaultSkyGridOptions.columnTypes[SkyCellType.NumberValidator] = __assign(__assign(__assign({}, defaultSkyGridOptions.columnTypes[SkyCellType.Validator]), defaultSkyGridOptions.columnTypes[SkyCellType.Number]), { cellClassRules: __assign(__assign({}, defaultSkyGridOptions.columnTypes[SkyCellType.Validator].cellClassRules), defaultSkyGridOptions.columnTypes[SkyCellType.Number].cellClassRules), cellRendererParams: {
|
|
732
885
|
skyComponentProperties: {
|
|
733
886
|
validator: function (value, data, rowIndex) {
|
|
@@ -736,9 +889,12 @@ var SkyAgGridService = /** @class */ (function () {
|
|
|
736
889
|
validatorMessage: 'Please enter a valid number'
|
|
737
890
|
}
|
|
738
891
|
} });
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
892
|
+
/*istanbul ignore else*/
|
|
893
|
+
if (this.resources) {
|
|
894
|
+
this.resources.getString('sky_ag_grid_cell_renderer_number_validator_message').subscribe(function (value) {
|
|
895
|
+
defaultSkyGridOptions.columnTypes[SkyCellType.NumberValidator].cellRendererParams.skyComponentProperties.validatorMessage = value;
|
|
896
|
+
});
|
|
897
|
+
}
|
|
742
898
|
return defaultSkyGridOptions;
|
|
743
899
|
};
|
|
744
900
|
SkyAgGridService.prototype.onCellFocused = function () {
|
|
@@ -757,6 +913,7 @@ var SkyAgGridService = /** @class */ (function () {
|
|
|
757
913
|
if (date && typeof date === 'string') {
|
|
758
914
|
date = new Date(params.value);
|
|
759
915
|
}
|
|
916
|
+
// @ts-ignore
|
|
760
917
|
var formattedDate = date && date.toLocaleDateString && date.toLocaleDateString(locale, dateConfig);
|
|
761
918
|
if (date && date.getTime && !isNaN(date.getTime())) {
|
|
762
919
|
return formattedDate;
|
|
@@ -889,7 +1046,7 @@ var SkyAgGridWrapperComponent = /** @class */ (function () {
|
|
|
889
1046
|
|
|
890
1047
|
var SkyAgGridResourcesProvider = /** @class */ (function () {
|
|
891
1048
|
function SkyAgGridResourcesProvider() {
|
|
892
|
-
this.resources = { "EN-US": { "sky_ag_grid_row_selector_aria_label": "Row selector for row {0}", "sky_ag_grid_cell_editor_number_aria_label": "Editable number {0} for row {1}", "sky_ag_grid_cell_editor_text_aria_label": "Editable text {0} for row {1}", "sky_ag_grid_cell_editor_autocomplete_aria_label": "Editable autocomplete {0} for row {1}", "sky_ag_grid_cell_renderer_currency_aria_label": "Editable currency {0} for row {1}", "sky_ag_grid_cell_renderer_number_validator_message": "Please enter a valid number", "sky_ag_grid_cell_renderer_currency_validator_message": "Please enter a valid currency" } };
|
|
1049
|
+
this.resources = { "EN-US": { "sky_ag_grid_row_selector_aria_label": "Row selector for row {0}", "sky_ag_grid_cell_editor_number_aria_label": "Editable number {0} for row {1}", "sky_ag_grid_cell_editor_text_aria_label": "Editable text {0} for row {1}", "sky_ag_grid_cell_editor_autocomplete_aria_label": "Editable autocomplete {0} for row {1}", "sky_ag_grid_cell_renderer_currency_aria_label": "Editable currency {0} for row {1}", "sky_ag_grid_cell_renderer_number_validator_message": "Please enter a valid number", "sky_ag_grid_cell_renderer_currency_validator_message": "Please enter a valid currency", "skyux_lookup_tokens_summary": "{0} items selected" } };
|
|
893
1050
|
}
|
|
894
1051
|
SkyAgGridResourcesProvider.prototype.getString = function (localeInfo, name) {
|
|
895
1052
|
return getStringForLocale(this.resources, localeInfo.locale, name);
|
|
@@ -959,6 +1116,25 @@ var SkyAgGridCellEditorDatepickerModule = /** @class */ (function () {
|
|
|
959
1116
|
return SkyAgGridCellEditorDatepickerModule;
|
|
960
1117
|
}());
|
|
961
1118
|
|
|
1119
|
+
var SkyAgGridCellEditorLookupModule = /** @class */ (function () {
|
|
1120
|
+
function SkyAgGridCellEditorLookupModule() {
|
|
1121
|
+
}
|
|
1122
|
+
SkyAgGridCellEditorLookupModule = __decorate([
|
|
1123
|
+
NgModule({
|
|
1124
|
+
declarations: [SkyAgGridCellEditorLookupComponent],
|
|
1125
|
+
exports: [SkyAgGridCellEditorLookupComponent],
|
|
1126
|
+
imports: [
|
|
1127
|
+
CommonModule,
|
|
1128
|
+
ReactiveFormsModule,
|
|
1129
|
+
SkyAgGridResourcesModule,
|
|
1130
|
+
SkyInputBoxModule,
|
|
1131
|
+
SkyLookupModule
|
|
1132
|
+
]
|
|
1133
|
+
})
|
|
1134
|
+
], SkyAgGridCellEditorLookupModule);
|
|
1135
|
+
return SkyAgGridCellEditorLookupModule;
|
|
1136
|
+
}());
|
|
1137
|
+
|
|
962
1138
|
var SkyAgGridCellEditorNumberModule = /** @class */ (function () {
|
|
963
1139
|
function SkyAgGridCellEditorNumberModule() {
|
|
964
1140
|
}
|
|
@@ -999,6 +1175,19 @@ var SkyAgGridCellEditorTextModule = /** @class */ (function () {
|
|
|
999
1175
|
return SkyAgGridCellEditorTextModule;
|
|
1000
1176
|
}());
|
|
1001
1177
|
|
|
1178
|
+
var SkyAgGridCellRendererLookupModule = /** @class */ (function () {
|
|
1179
|
+
function SkyAgGridCellRendererLookupModule() {
|
|
1180
|
+
}
|
|
1181
|
+
SkyAgGridCellRendererLookupModule = __decorate([
|
|
1182
|
+
NgModule({
|
|
1183
|
+
declarations: [SkyAgGridCellRendererLookupComponent],
|
|
1184
|
+
exports: [SkyAgGridCellRendererLookupComponent],
|
|
1185
|
+
imports: [CommonModule, SkyAgGridResourcesModule]
|
|
1186
|
+
})
|
|
1187
|
+
], SkyAgGridCellRendererLookupModule);
|
|
1188
|
+
return SkyAgGridCellRendererLookupModule;
|
|
1189
|
+
}());
|
|
1190
|
+
|
|
1002
1191
|
var SkyAgGridCellRendererRowSelectorModule = /** @class */ (function () {
|
|
1003
1192
|
function SkyAgGridCellRendererRowSelectorModule() {
|
|
1004
1193
|
}
|
|
@@ -1109,13 +1298,30 @@ var SkyAgGridDataManagerAdapterDirective = /** @class */ (function () {
|
|
|
1109
1298
|
agGrid.api.sizeColumnsToFit();
|
|
1110
1299
|
});
|
|
1111
1300
|
agGrid.columnMoved
|
|
1301
|
+
.pipe(takeUntil(this.ngUnsubscribe), filter(function (event) {
|
|
1302
|
+
return ![
|
|
1303
|
+
'gridInitializing',
|
|
1304
|
+
'uiColumnResized',
|
|
1305
|
+
'uiColumnDragged',
|
|
1306
|
+
'api'
|
|
1307
|
+
].includes(event.source);
|
|
1308
|
+
}))
|
|
1309
|
+
.subscribe(function (value) {
|
|
1310
|
+
_this.updateColumnsInCurrentDataState(value.columnApi);
|
|
1311
|
+
});
|
|
1312
|
+
var currentColumns;
|
|
1313
|
+
agGrid.dragStarted
|
|
1112
1314
|
.pipe(takeUntil(this.ngUnsubscribe))
|
|
1113
|
-
.subscribe(function (
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1315
|
+
.subscribe(function (value) {
|
|
1316
|
+
currentColumns = _this.getColumnOrder(value.columnApi);
|
|
1317
|
+
});
|
|
1318
|
+
agGrid.dragStopped
|
|
1319
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
1320
|
+
.subscribe(function (value) {
|
|
1321
|
+
var newColumns = _this.getColumnOrder(value.columnApi);
|
|
1322
|
+
var hasChanged = currentColumns.findIndex(function (colId, i) { return colId !== newColumns[i]; });
|
|
1323
|
+
if (hasChanged > -1) {
|
|
1324
|
+
_this.updateColumnsInCurrentDataState(value.columnApi);
|
|
1119
1325
|
}
|
|
1120
1326
|
});
|
|
1121
1327
|
agGrid.rowSelected
|
|
@@ -1137,7 +1343,6 @@ var SkyAgGridDataManagerAdapterDirective = /** @class */ (function () {
|
|
|
1137
1343
|
agGrid.sortChanged
|
|
1138
1344
|
.pipe(takeUntil(this.ngUnsubscribe))
|
|
1139
1345
|
.subscribe(function () {
|
|
1140
|
-
var _a;
|
|
1141
1346
|
var gridSortModel = agGrid.api.getSortModel();
|
|
1142
1347
|
var sortOption;
|
|
1143
1348
|
/* istanbul ignore else */
|
|
@@ -1145,20 +1350,41 @@ var SkyAgGridDataManagerAdapterDirective = /** @class */ (function () {
|
|
|
1145
1350
|
var activeSortModel_1 = gridSortModel[0];
|
|
1146
1351
|
var activeSortColumn_1 = agGrid.columnApi.getColumn(activeSortModel_1.colId);
|
|
1147
1352
|
var dataManagerConfig = _this.dataManagerSvc.getCurrentDataManagerConfig();
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1353
|
+
/* istanbul ignore else */
|
|
1354
|
+
if (dataManagerConfig.sortOptions) {
|
|
1355
|
+
sortOption = dataManagerConfig.sortOptions.find(function (option) {
|
|
1356
|
+
return option.propertyName === activeSortColumn_1.getColDef().field &&
|
|
1357
|
+
option.descending === (activeSortModel_1.sort === 'desc');
|
|
1358
|
+
});
|
|
1359
|
+
}
|
|
1360
|
+
else {
|
|
1361
|
+
sortOption = undefined;
|
|
1362
|
+
}
|
|
1152
1363
|
}
|
|
1153
1364
|
_this.currentDataState.activeSortOption = sortOption;
|
|
1154
1365
|
_this.dataManagerSvc.updateDataState(_this.currentDataState, _this.viewConfig.id);
|
|
1155
1366
|
});
|
|
1156
1367
|
};
|
|
1368
|
+
SkyAgGridDataManagerAdapterDirective.prototype.updateColumnsInCurrentDataState = function (columnApi) {
|
|
1369
|
+
var columnOrder = this.getColumnOrder(columnApi);
|
|
1370
|
+
var viewState = this.currentDataState.getViewStateById(this.viewConfig.id);
|
|
1371
|
+
viewState.displayedColumnIds = columnOrder;
|
|
1372
|
+
this.dataManagerSvc.updateDataState(this.currentDataState.addOrUpdateView(this.viewConfig.id, viewState), this.viewConfig.id);
|
|
1373
|
+
};
|
|
1374
|
+
SkyAgGridDataManagerAdapterDirective.prototype.getColumnOrder = function (columnApi) {
|
|
1375
|
+
return columnApi
|
|
1376
|
+
.getAllDisplayedVirtualColumns()
|
|
1377
|
+
.map(function (col) { return col.getColDef().colId; });
|
|
1378
|
+
};
|
|
1157
1379
|
SkyAgGridDataManagerAdapterDirective.prototype.displayColumns = function (dataState) {
|
|
1158
1380
|
var e_1, _a;
|
|
1159
1381
|
var agGrid = this.currentAgGrid;
|
|
1160
1382
|
var viewState = dataState.getViewStateById(this.viewConfig.id);
|
|
1161
|
-
var displayedColumnIds =
|
|
1383
|
+
var displayedColumnIds = [];
|
|
1384
|
+
/*istanbul ignore else*/
|
|
1385
|
+
if (viewState.displayedColumnIds) {
|
|
1386
|
+
displayedColumnIds = viewState.displayedColumnIds;
|
|
1387
|
+
}
|
|
1162
1388
|
var columns = agGrid.columnApi.getAllColumns();
|
|
1163
1389
|
try {
|
|
1164
1390
|
for (var columns_1 = __values(columns), columns_1_1 = columns_1.next(); !columns_1_1.done; columns_1_1 = columns_1.next()) {
|
|
@@ -1251,7 +1477,7 @@ var SkyAgGridCellValidatorTooltipComponent = /** @class */ (function () {
|
|
|
1251
1477
|
var _this = this;
|
|
1252
1478
|
this.zone.run(function () {
|
|
1253
1479
|
_this.indicatorShouldShow = false;
|
|
1254
|
-
_this.changeDetector.
|
|
1480
|
+
_this.changeDetector.detectChanges();
|
|
1255
1481
|
});
|
|
1256
1482
|
};
|
|
1257
1483
|
SkyAgGridCellValidatorTooltipComponent.prototype.hidePopover = function () {
|
|
@@ -1261,7 +1487,7 @@ var SkyAgGridCellValidatorTooltipComponent = /** @class */ (function () {
|
|
|
1261
1487
|
var _this = this;
|
|
1262
1488
|
this.zone.run(function () {
|
|
1263
1489
|
_this.indicatorShouldShow = true;
|
|
1264
|
-
_this.changeDetector.
|
|
1490
|
+
_this.changeDetector.detectChanges();
|
|
1265
1491
|
});
|
|
1266
1492
|
};
|
|
1267
1493
|
SkyAgGridCellValidatorTooltipComponent.prototype.showPopover = function () {
|
|
@@ -1540,7 +1766,7 @@ var SkyAgGridRowDeleteDirective = /** @class */ (function () {
|
|
|
1540
1766
|
return this.rowDeleteConfigs.find(function (rowDelete) { return rowDelete.id === row.id; });
|
|
1541
1767
|
};
|
|
1542
1768
|
SkyAgGridRowDeleteDirective.prototype.affixToRow = function (affixer, id) {
|
|
1543
|
-
var rowElement = this.elementRef.nativeElement.querySelector(
|
|
1769
|
+
var rowElement = this.elementRef.nativeElement.querySelector("\n [row-id=\"" + id + "\"] div[aria-colindex=\"1\"],\n .ag-row.sky-ag-grid-row-" + id + " div[aria-colindex=\"1\"]\n ");
|
|
1544
1770
|
// This covers cases where AG Grid places the column index on an inner element (such as with the `enableCellTextSelection` option)
|
|
1545
1771
|
// This appears to have been fixed by AG Grid in version 24 and so it is not testable after that version.
|
|
1546
1772
|
/* istanbul ignore if */
|
|
@@ -1677,9 +1903,11 @@ var SkyAgGridModule = /** @class */ (function () {
|
|
|
1677
1903
|
CommonModule,
|
|
1678
1904
|
SkyAgGridCellEditorAutocompleteModule,
|
|
1679
1905
|
SkyAgGridCellEditorDatepickerModule,
|
|
1906
|
+
SkyAgGridCellEditorLookupModule,
|
|
1680
1907
|
SkyAgGridCellEditorNumberModule,
|
|
1681
1908
|
SkyAgGridCellEditorCurrencyModule,
|
|
1682
1909
|
SkyAgGridCellRendererCurrencyModule,
|
|
1910
|
+
SkyAgGridCellRendererLookupModule,
|
|
1683
1911
|
SkyAgGridCellRendererRowSelectorModule,
|
|
1684
1912
|
SkyAgGridCellRendererValidatorTooltipModule,
|
|
1685
1913
|
SkyAgGridCellValidatorModule,
|
|
@@ -1702,10 +1930,12 @@ var SkyAgGridModule = /** @class */ (function () {
|
|
|
1702
1930
|
entryComponents: [
|
|
1703
1931
|
SkyAgGridCellEditorAutocompleteComponent,
|
|
1704
1932
|
SkyAgGridCellEditorDatepickerComponent,
|
|
1933
|
+
SkyAgGridCellEditorLookupComponent,
|
|
1705
1934
|
SkyAgGridCellEditorNumberComponent,
|
|
1706
1935
|
SkyAgGridCellEditorCurrencyComponent,
|
|
1707
1936
|
SkyAgGridCellRendererCurrencyComponent,
|
|
1708
1937
|
SkyAgGridCellRendererCurrencyValidatorComponent,
|
|
1938
|
+
SkyAgGridCellRendererLookupComponent,
|
|
1709
1939
|
SkyAgGridCellRendererRowSelectorComponent,
|
|
1710
1940
|
SkyAgGridCellRendererValidatorTooltipComponent,
|
|
1711
1941
|
SkyAgGridCellEditorTextComponent,
|
|
@@ -1722,5 +1952,5 @@ var SkyAgGridModule = /** @class */ (function () {
|
|
|
1722
1952
|
* Generated bundle index. Do not edit.
|
|
1723
1953
|
*/
|
|
1724
1954
|
|
|
1725
|
-
export { SkyAgGridModule, SkyAgGridService, SkyCellClass, SkyCellType, SkyHeaderClass, SkyAgGridDataManagerAdapterDirective as ɵa, SkyAgGridWrapperComponent as ɵb, SkyAgGridAdapterService as ɵc, SkyAgGridRowDeleteComponent as ɵd, SkyAgGridRowDeleteDirective as ɵe, SkyAgGridCellEditorAutocompleteModule as ɵf, SkyAgGridResourcesModule as ɵg, SkyAgGridResourcesProvider as ɵh, SkyAgGridCellEditorAutocompleteComponent as ɵi, SkyAgGridCellEditorDatepickerModule as ɵj, SkyAgGridCellEditorDatepickerComponent as ɵk,
|
|
1955
|
+
export { SkyAgGridModule, SkyAgGridService, SkyCellClass, SkyCellType, SkyHeaderClass, SkyAgGridDataManagerAdapterDirective as ɵa, SkyAgGridWrapperComponent as ɵb, SkyAgGridCellRendererValidatorTooltipModule as ɵba, SkyAgGridCellRendererValidatorTooltipComponent as ɵbb, SkyAgGridCellEditorTextModule as ɵbc, SkyAgGridCellEditorTextComponent as ɵbd, SkyAgGridAdapterService as ɵc, SkyAgGridRowDeleteComponent as ɵd, SkyAgGridRowDeleteDirective as ɵe, SkyAgGridCellEditorAutocompleteModule as ɵf, SkyAgGridResourcesModule as ɵg, SkyAgGridResourcesProvider as ɵh, SkyAgGridCellEditorAutocompleteComponent as ɵi, SkyAgGridCellEditorDatepickerModule as ɵj, SkyAgGridCellEditorDatepickerComponent as ɵk, SkyAgGridCellEditorLookupModule as ɵl, SkyAgGridCellEditorLookupComponent as ɵm, SkyAgGridCellEditorNumberModule as ɵn, SkyAgGridCellEditorNumberComponent as ɵo, SkyAgGridCellEditorCurrencyModule as ɵp, SkyAgGridCellEditorCurrencyComponent as ɵq, SkyAgGridCellRendererCurrencyModule as ɵr, SkyAgGridCellValidatorModule as ɵs, SkyAgGridCellValidatorTooltipComponent as ɵt, SkyAgGridCellRendererCurrencyComponent as ɵu, SkyAgGridCellRendererCurrencyValidatorComponent as ɵv, SkyAgGridCellRendererLookupModule as ɵw, SkyAgGridCellRendererLookupComponent as ɵx, SkyAgGridCellRendererRowSelectorModule as ɵy, SkyAgGridCellRendererRowSelectorComponent as ɵz };
|
|
1726
1956
|
//# sourceMappingURL=skyux-ag-grid.js.map
|