@skyux/ag-grid 4.10.2 → 4.12.2
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 +17 -0
- package/bundles/skyux-ag-grid.umd.js +286 -51
- 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 +7 -3
- 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 +54 -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/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 +64 -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/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 +255 -31
- package/fesm2015/skyux-ag-grid.js.map +1 -1
- package/fesm5/skyux-ag-grid.js +272 -41
- 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;
|
|
@@ -646,25 +767,41 @@ var SkyAgGridService = /** @class */ (function () {
|
|
|
646
767
|
cellClassRules: __assign(__assign((_e = {}, _e[SkyCellClass.Currency] = cellClassRuleTrueExpression, _e), validatorCellClassRules), editableCellClassRules),
|
|
647
768
|
cellRendererSelector: getValidatorCellRendererSelector('sky-ag-grid-cell-renderer-currency-validator', { component: 'sky-ag-grid-cell-renderer-currency' }),
|
|
648
769
|
cellEditorFramework: SkyAgGridCellEditorCurrencyComponent,
|
|
770
|
+
headerClass: SkyHeaderClass.RightAligned,
|
|
649
771
|
minWidth: 185
|
|
650
772
|
},
|
|
651
773
|
_c[SkyCellType.Date] = {
|
|
652
774
|
cellClassRules: __assign((_f = {}, _f[SkyCellClass.Date] = cellClassRuleTrueExpression, _f), editableCellClassRules),
|
|
653
775
|
cellEditorFramework: SkyAgGridCellEditorDatepickerComponent,
|
|
654
776
|
comparator: dateComparator,
|
|
655
|
-
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,
|
|
656
778
|
valueFormatter: function (params) { return _this.dateFormatter(params, args.locale); }
|
|
657
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
|
+
},
|
|
658
795
|
_c[SkyCellType.Number] = {
|
|
659
|
-
cellClassRules: __assign((
|
|
796
|
+
cellClassRules: __assign((_h = {}, _h[SkyCellClass.Number] = cellClassRuleTrueExpression, _h), editableCellClassRules),
|
|
660
797
|
cellEditorFramework: SkyAgGridCellEditorNumberComponent,
|
|
661
798
|
headerClass: SkyHeaderClass.RightAligned
|
|
662
799
|
},
|
|
663
800
|
_c[SkyCellType.RowSelector] = {
|
|
664
|
-
cellClassRules: (
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
801
|
+
cellClassRules: (_j = {},
|
|
802
|
+
_j[SkyCellClass.RowSelector] = cellClassRuleTrueExpression,
|
|
803
|
+
_j[SkyCellClass.Uneditable] = cellClassRuleTrueExpression,
|
|
804
|
+
_j),
|
|
668
805
|
cellRendererFramework: SkyAgGridCellRendererRowSelectorComponent,
|
|
669
806
|
headerName: '',
|
|
670
807
|
minWidth: 55,
|
|
@@ -673,7 +810,7 @@ var SkyAgGridService = /** @class */ (function () {
|
|
|
673
810
|
width: 55
|
|
674
811
|
},
|
|
675
812
|
_c[SkyCellType.Text] = {
|
|
676
|
-
cellClassRules: __assign((
|
|
813
|
+
cellClassRules: __assign((_k = {}, _k[SkyCellClass.Text] = cellClassRuleTrueExpression, _k), editableCellClassRules),
|
|
677
814
|
cellEditorFramework: SkyAgGridCellEditorTextComponent
|
|
678
815
|
},
|
|
679
816
|
_c[SkyCellType.Validator] = {
|
|
@@ -695,7 +832,21 @@ var SkyAgGridService = /** @class */ (function () {
|
|
|
695
832
|
'sky-ag-grid-cell-renderer-currency-validator': SkyAgGridCellRendererCurrencyValidatorComponent,
|
|
696
833
|
'sky-ag-grid-cell-renderer-validator-tooltip': SkyAgGridCellRendererValidatorTooltipComponent
|
|
697
834
|
},
|
|
698
|
-
|
|
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,
|
|
699
850
|
icons: {
|
|
700
851
|
sortDescending: this.getIconTemplate('caret-down'),
|
|
701
852
|
sortAscending: this.getIconTemplate('caret-up'),
|
|
@@ -706,7 +857,7 @@ var SkyAgGridService = /** @class */ (function () {
|
|
|
706
857
|
columnMovePin: this.getIconTemplate('arrows')
|
|
707
858
|
},
|
|
708
859
|
onCellFocused: function () { return _this.onCellFocused(); },
|
|
709
|
-
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,
|
|
710
861
|
rowMultiSelectWithClick: true,
|
|
711
862
|
rowSelection: 'multiple',
|
|
712
863
|
singleClickEdit: true,
|
|
@@ -724,9 +875,12 @@ var SkyAgGridService = /** @class */ (function () {
|
|
|
724
875
|
validatorMessage: 'Please enter a valid currency'
|
|
725
876
|
}
|
|
726
877
|
} });
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
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
|
+
}
|
|
730
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: {
|
|
731
885
|
skyComponentProperties: {
|
|
732
886
|
validator: function (value, data, rowIndex) {
|
|
@@ -735,9 +889,12 @@ var SkyAgGridService = /** @class */ (function () {
|
|
|
735
889
|
validatorMessage: 'Please enter a valid number'
|
|
736
890
|
}
|
|
737
891
|
} });
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
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
|
+
}
|
|
741
898
|
return defaultSkyGridOptions;
|
|
742
899
|
};
|
|
743
900
|
SkyAgGridService.prototype.onCellFocused = function () {
|
|
@@ -756,6 +913,7 @@ var SkyAgGridService = /** @class */ (function () {
|
|
|
756
913
|
if (date && typeof date === 'string') {
|
|
757
914
|
date = new Date(params.value);
|
|
758
915
|
}
|
|
916
|
+
// @ts-ignore
|
|
759
917
|
var formattedDate = date && date.toLocaleDateString && date.toLocaleDateString(locale, dateConfig);
|
|
760
918
|
if (date && date.getTime && !isNaN(date.getTime())) {
|
|
761
919
|
return formattedDate;
|
|
@@ -888,7 +1046,7 @@ var SkyAgGridWrapperComponent = /** @class */ (function () {
|
|
|
888
1046
|
|
|
889
1047
|
var SkyAgGridResourcesProvider = /** @class */ (function () {
|
|
890
1048
|
function SkyAgGridResourcesProvider() {
|
|
891
|
-
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" } };
|
|
892
1050
|
}
|
|
893
1051
|
SkyAgGridResourcesProvider.prototype.getString = function (localeInfo, name) {
|
|
894
1052
|
return getStringForLocale(this.resources, localeInfo.locale, name);
|
|
@@ -958,6 +1116,25 @@ var SkyAgGridCellEditorDatepickerModule = /** @class */ (function () {
|
|
|
958
1116
|
return SkyAgGridCellEditorDatepickerModule;
|
|
959
1117
|
}());
|
|
960
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
|
+
|
|
961
1138
|
var SkyAgGridCellEditorNumberModule = /** @class */ (function () {
|
|
962
1139
|
function SkyAgGridCellEditorNumberModule() {
|
|
963
1140
|
}
|
|
@@ -998,6 +1175,19 @@ var SkyAgGridCellEditorTextModule = /** @class */ (function () {
|
|
|
998
1175
|
return SkyAgGridCellEditorTextModule;
|
|
999
1176
|
}());
|
|
1000
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
|
+
|
|
1001
1191
|
var SkyAgGridCellRendererRowSelectorModule = /** @class */ (function () {
|
|
1002
1192
|
function SkyAgGridCellRendererRowSelectorModule() {
|
|
1003
1193
|
}
|
|
@@ -1108,13 +1298,30 @@ var SkyAgGridDataManagerAdapterDirective = /** @class */ (function () {
|
|
|
1108
1298
|
agGrid.api.sizeColumnsToFit();
|
|
1109
1299
|
});
|
|
1110
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
|
|
1111
1314
|
.pipe(takeUntil(this.ngUnsubscribe))
|
|
1112
|
-
.subscribe(function (
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
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);
|
|
1118
1325
|
}
|
|
1119
1326
|
});
|
|
1120
1327
|
agGrid.rowSelected
|
|
@@ -1136,7 +1343,6 @@ var SkyAgGridDataManagerAdapterDirective = /** @class */ (function () {
|
|
|
1136
1343
|
agGrid.sortChanged
|
|
1137
1344
|
.pipe(takeUntil(this.ngUnsubscribe))
|
|
1138
1345
|
.subscribe(function () {
|
|
1139
|
-
var _a;
|
|
1140
1346
|
var gridSortModel = agGrid.api.getSortModel();
|
|
1141
1347
|
var sortOption;
|
|
1142
1348
|
/* istanbul ignore else */
|
|
@@ -1144,20 +1350,41 @@ var SkyAgGridDataManagerAdapterDirective = /** @class */ (function () {
|
|
|
1144
1350
|
var activeSortModel_1 = gridSortModel[0];
|
|
1145
1351
|
var activeSortColumn_1 = agGrid.columnApi.getColumn(activeSortModel_1.colId);
|
|
1146
1352
|
var dataManagerConfig = _this.dataManagerSvc.getCurrentDataManagerConfig();
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
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
|
+
}
|
|
1151
1363
|
}
|
|
1152
1364
|
_this.currentDataState.activeSortOption = sortOption;
|
|
1153
1365
|
_this.dataManagerSvc.updateDataState(_this.currentDataState, _this.viewConfig.id);
|
|
1154
1366
|
});
|
|
1155
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
|
+
};
|
|
1156
1379
|
SkyAgGridDataManagerAdapterDirective.prototype.displayColumns = function (dataState) {
|
|
1157
1380
|
var e_1, _a;
|
|
1158
1381
|
var agGrid = this.currentAgGrid;
|
|
1159
1382
|
var viewState = dataState.getViewStateById(this.viewConfig.id);
|
|
1160
|
-
var displayedColumnIds =
|
|
1383
|
+
var displayedColumnIds = [];
|
|
1384
|
+
/*istanbul ignore else*/
|
|
1385
|
+
if (viewState.displayedColumnIds) {
|
|
1386
|
+
displayedColumnIds = viewState.displayedColumnIds;
|
|
1387
|
+
}
|
|
1161
1388
|
var columns = agGrid.columnApi.getAllColumns();
|
|
1162
1389
|
try {
|
|
1163
1390
|
for (var columns_1 = __values(columns), columns_1_1 = columns_1.next(); !columns_1_1.done; columns_1_1 = columns_1.next()) {
|
|
@@ -1539,7 +1766,7 @@ var SkyAgGridRowDeleteDirective = /** @class */ (function () {
|
|
|
1539
1766
|
return this.rowDeleteConfigs.find(function (rowDelete) { return rowDelete.id === row.id; });
|
|
1540
1767
|
};
|
|
1541
1768
|
SkyAgGridRowDeleteDirective.prototype.affixToRow = function (affixer, id) {
|
|
1542
|
-
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 ");
|
|
1543
1770
|
// This covers cases where AG Grid places the column index on an inner element (such as with the `enableCellTextSelection` option)
|
|
1544
1771
|
// This appears to have been fixed by AG Grid in version 24 and so it is not testable after that version.
|
|
1545
1772
|
/* istanbul ignore if */
|
|
@@ -1676,9 +1903,11 @@ var SkyAgGridModule = /** @class */ (function () {
|
|
|
1676
1903
|
CommonModule,
|
|
1677
1904
|
SkyAgGridCellEditorAutocompleteModule,
|
|
1678
1905
|
SkyAgGridCellEditorDatepickerModule,
|
|
1906
|
+
SkyAgGridCellEditorLookupModule,
|
|
1679
1907
|
SkyAgGridCellEditorNumberModule,
|
|
1680
1908
|
SkyAgGridCellEditorCurrencyModule,
|
|
1681
1909
|
SkyAgGridCellRendererCurrencyModule,
|
|
1910
|
+
SkyAgGridCellRendererLookupModule,
|
|
1682
1911
|
SkyAgGridCellRendererRowSelectorModule,
|
|
1683
1912
|
SkyAgGridCellRendererValidatorTooltipModule,
|
|
1684
1913
|
SkyAgGridCellValidatorModule,
|
|
@@ -1701,10 +1930,12 @@ var SkyAgGridModule = /** @class */ (function () {
|
|
|
1701
1930
|
entryComponents: [
|
|
1702
1931
|
SkyAgGridCellEditorAutocompleteComponent,
|
|
1703
1932
|
SkyAgGridCellEditorDatepickerComponent,
|
|
1933
|
+
SkyAgGridCellEditorLookupComponent,
|
|
1704
1934
|
SkyAgGridCellEditorNumberComponent,
|
|
1705
1935
|
SkyAgGridCellEditorCurrencyComponent,
|
|
1706
1936
|
SkyAgGridCellRendererCurrencyComponent,
|
|
1707
1937
|
SkyAgGridCellRendererCurrencyValidatorComponent,
|
|
1938
|
+
SkyAgGridCellRendererLookupComponent,
|
|
1708
1939
|
SkyAgGridCellRendererRowSelectorComponent,
|
|
1709
1940
|
SkyAgGridCellRendererValidatorTooltipComponent,
|
|
1710
1941
|
SkyAgGridCellEditorTextComponent,
|
|
@@ -1721,5 +1952,5 @@ var SkyAgGridModule = /** @class */ (function () {
|
|
|
1721
1952
|
* Generated bundle index. Do not edit.
|
|
1722
1953
|
*/
|
|
1723
1954
|
|
|
1724
|
-
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 };
|
|
1725
1956
|
//# sourceMappingURL=skyux-ag-grid.js.map
|