@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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
# 4.12.2 (2021-12-02)
|
|
2
|
+
|
|
3
|
+
- Added bug fixes and features from the `master` branch. [#173](https://github.com/blackbaud/skyux-ag-grid/pull/173)
|
|
4
|
+
|
|
5
|
+
# 4.12.1 (2021-11-10)
|
|
6
|
+
|
|
7
|
+
- Added bug fixes and features from the `master` branch. [#165](https://github.com/blackbaud/skyux-ag-grid/pull/165)
|
|
8
|
+
|
|
9
|
+
# 4.12.0 (2021-11-04)
|
|
10
|
+
|
|
11
|
+
- Added bug fixes and features from the `master` branch. [#161](https://github.com/blackbaud/skyux-ag-grid/pull/161)
|
|
12
|
+
- Added AG Grid 26 support. [#162](https://github.com/blackbaud/skyux-ag-grid/pull/162)
|
|
13
|
+
|
|
14
|
+
# 4.11.0 (2021-09-24)
|
|
15
|
+
|
|
16
|
+
- Fixed the currency column type so the values are right-aligned. [#147](https://github.com/blackbaud/skyux-ag-grid/pull/147)
|
|
17
|
+
|
|
1
18
|
# 4.10.2 (2021-09-20)
|
|
2
19
|
|
|
3
20
|
- Fixed the cell renderer to refresh when the validator status changes. [#143](https://github.com/blackbaud/skyux-ag-grid/pull/143) (Thanks @[blackbaud-jeremymorgan](https://github.com/blackbaud-jeremymorgan)!)
|
|
@@ -321,6 +321,94 @@
|
|
|
321
321
|
return SkyAgGridCellEditorDatepickerComponent;
|
|
322
322
|
}(agGridCommunity.PopupComponent));
|
|
323
323
|
|
|
324
|
+
function applySkyLookupPropertiesDefaults(skyLookupProperties) {
|
|
325
|
+
return {
|
|
326
|
+
ariaLabel: skyLookupProperties.ariaLabel || '',
|
|
327
|
+
autocompleteAttribute: skyLookupProperties.autocompleteAttribute || 'off',
|
|
328
|
+
data: skyLookupProperties.data || [],
|
|
329
|
+
debounceTime: skyLookupProperties.debounceTime || 0,
|
|
330
|
+
descriptorProperty: skyLookupProperties.descriptorProperty || 'name',
|
|
331
|
+
disabled: skyLookupProperties.disabled || false,
|
|
332
|
+
enableShowMore: skyLookupProperties.enableShowMore || false,
|
|
333
|
+
idProperty: skyLookupProperties.idProperty || undefined,
|
|
334
|
+
placeholderText: skyLookupProperties.placeholderText || '',
|
|
335
|
+
propertiesToSearch: skyLookupProperties.propertiesToSearch || undefined,
|
|
336
|
+
search: skyLookupProperties.search || undefined,
|
|
337
|
+
searchFilters: skyLookupProperties.searchFilters || [],
|
|
338
|
+
searchResultsLimit: skyLookupProperties.searchResultsLimit || undefined,
|
|
339
|
+
searchResultTemplate: skyLookupProperties.searchResultTemplate || undefined,
|
|
340
|
+
searchTextMinimumCharacters: skyLookupProperties.searchTextMinimumCharacters || 1,
|
|
341
|
+
selectMode: skyLookupProperties.selectMode || undefined,
|
|
342
|
+
showAddButton: skyLookupProperties.showAddButton || false,
|
|
343
|
+
showMoreConfig: skyLookupProperties.showMoreConfig || {},
|
|
344
|
+
wrapperClass: 'ag-custom-component-popup'
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
var SkyAgGridCellEditorLookupComponent = /** @class */ (function () {
|
|
349
|
+
function SkyAgGridCellEditorLookupComponent(changeDetector, elementRef) {
|
|
350
|
+
this.changeDetector = changeDetector;
|
|
351
|
+
this.elementRef = elementRef;
|
|
352
|
+
this.isAlive = true;
|
|
353
|
+
this.lookupForm = new forms.FormGroup({
|
|
354
|
+
currentSelection: new forms.FormControl({
|
|
355
|
+
value: [],
|
|
356
|
+
disabled: false
|
|
357
|
+
})
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
SkyAgGridCellEditorLookupComponent.prototype.agInit = function (params) {
|
|
361
|
+
this.params = params;
|
|
362
|
+
if (!Array.isArray(this.params.value)) {
|
|
363
|
+
throw new Error("Lookup value must be an array");
|
|
364
|
+
}
|
|
365
|
+
var control = this.lookupForm.get('currentSelection');
|
|
366
|
+
control.setValue(this.params.value);
|
|
367
|
+
if (this.params.skyComponentProperties.disabled) {
|
|
368
|
+
control.disable();
|
|
369
|
+
}
|
|
370
|
+
this.skyComponentProperties = this.updateComponentProperties(this.params);
|
|
371
|
+
this.changeDetector.markForCheck();
|
|
372
|
+
};
|
|
373
|
+
SkyAgGridCellEditorLookupComponent.prototype.isCancelAfterEnd = function () {
|
|
374
|
+
// Shut down components to commit values before final value syncs to grid.
|
|
375
|
+
this.isAlive = false;
|
|
376
|
+
this.changeDetector.detectChanges();
|
|
377
|
+
return false;
|
|
378
|
+
};
|
|
379
|
+
SkyAgGridCellEditorLookupComponent.prototype.getGui = function () {
|
|
380
|
+
return this.elementRef.nativeElement;
|
|
381
|
+
};
|
|
382
|
+
SkyAgGridCellEditorLookupComponent.prototype.getValue = function () {
|
|
383
|
+
return this.lookupForm.get('currentSelection').value;
|
|
384
|
+
};
|
|
385
|
+
SkyAgGridCellEditorLookupComponent.prototype.isPopup = function () {
|
|
386
|
+
return true;
|
|
387
|
+
};
|
|
388
|
+
/*istanbul ignore next*/
|
|
389
|
+
SkyAgGridCellEditorLookupComponent.prototype.afterGuiAttached = function () {
|
|
390
|
+
var _a;
|
|
391
|
+
(_a = this.elementRef.nativeElement.querySelector('.sky-lookup-input')) === null || _a === void 0 ? void 0 : _a.focus();
|
|
392
|
+
};
|
|
393
|
+
SkyAgGridCellEditorLookupComponent.prototype.updateComponentProperties = function (params) {
|
|
394
|
+
var skyLookupProperties = params.skyComponentProperties;
|
|
395
|
+
return applySkyLookupPropertiesDefaults(skyLookupProperties);
|
|
396
|
+
};
|
|
397
|
+
SkyAgGridCellEditorLookupComponent.ctorParameters = function () { return [
|
|
398
|
+
{ type: core.ChangeDetectorRef },
|
|
399
|
+
{ type: core.ElementRef }
|
|
400
|
+
]; };
|
|
401
|
+
SkyAgGridCellEditorLookupComponent = __decorate([
|
|
402
|
+
core.Component({
|
|
403
|
+
selector: 'sky-ag-grid-cell-editor-lookup',
|
|
404
|
+
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",
|
|
405
|
+
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
406
|
+
styles: [":host{display:block}"]
|
|
407
|
+
})
|
|
408
|
+
], SkyAgGridCellEditorLookupComponent);
|
|
409
|
+
return SkyAgGridCellEditorLookupComponent;
|
|
410
|
+
}());
|
|
411
|
+
|
|
324
412
|
var SkyAgGridCellEditorNumberComponent = /** @class */ (function () {
|
|
325
413
|
function SkyAgGridCellEditorNumberComponent() {
|
|
326
414
|
}
|
|
@@ -444,6 +532,36 @@
|
|
|
444
532
|
return SkyAgGridCellRendererCurrencyValidatorComponent;
|
|
445
533
|
}());
|
|
446
534
|
|
|
535
|
+
var SkyAgGridCellRendererLookupComponent = /** @class */ (function () {
|
|
536
|
+
function SkyAgGridCellRendererLookupComponent(changeDetector) {
|
|
537
|
+
this.changeDetector = changeDetector;
|
|
538
|
+
this.value = '';
|
|
539
|
+
this.summaryCount = 0;
|
|
540
|
+
}
|
|
541
|
+
SkyAgGridCellRendererLookupComponent.prototype.agInit = function (params) {
|
|
542
|
+
var _a;
|
|
543
|
+
this.summaryCount = ((_a = params.value) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
544
|
+
this.value = "" + params.valueFormatted;
|
|
545
|
+
this.changeDetector.markForCheck();
|
|
546
|
+
};
|
|
547
|
+
SkyAgGridCellRendererLookupComponent.prototype.refresh = function (params) {
|
|
548
|
+
this.agInit(params);
|
|
549
|
+
return true;
|
|
550
|
+
};
|
|
551
|
+
SkyAgGridCellRendererLookupComponent.ctorParameters = function () { return [
|
|
552
|
+
{ type: core.ChangeDetectorRef }
|
|
553
|
+
]; };
|
|
554
|
+
SkyAgGridCellRendererLookupComponent = __decorate([
|
|
555
|
+
core.Component({
|
|
556
|
+
selector: 'sky-cell-renderer-lookup',
|
|
557
|
+
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",
|
|
558
|
+
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
559
|
+
styles: [":host{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}"]
|
|
560
|
+
})
|
|
561
|
+
], SkyAgGridCellRendererLookupComponent);
|
|
562
|
+
return SkyAgGridCellRendererLookupComponent;
|
|
563
|
+
}());
|
|
564
|
+
|
|
447
565
|
var SkyAgGridCellRendererRowSelectorComponent = /** @class */ (function () {
|
|
448
566
|
function SkyAgGridCellRendererRowSelectorComponent(changeDetection) {
|
|
449
567
|
this.changeDetection = changeDetection;
|
|
@@ -553,6 +671,7 @@
|
|
|
553
671
|
SkyCellClass["Date"] = "sky-ag-grid-cell-date";
|
|
554
672
|
SkyCellClass["Editable"] = "sky-ag-grid-cell-editable";
|
|
555
673
|
SkyCellClass["Invalid"] = "sky-ag-grid-cell-invalid";
|
|
674
|
+
SkyCellClass["Lookup"] = "sky-ag-grid-cell-lookup";
|
|
556
675
|
SkyCellClass["Number"] = "sky-ag-grid-cell-number";
|
|
557
676
|
SkyCellClass["RowSelector"] = "sky-ag-grid-cell-row-selector";
|
|
558
677
|
SkyCellClass["Text"] = "sky-ag-grid-cell-text";
|
|
@@ -565,6 +684,7 @@
|
|
|
565
684
|
SkyCellType["Currency"] = "skyCellCurrency";
|
|
566
685
|
SkyCellType["CurrencyValidator"] = "skyCellCurrencyValidator";
|
|
567
686
|
SkyCellType["Date"] = "skyCellDate";
|
|
687
|
+
SkyCellType["Lookup"] = "skyCellLookup";
|
|
568
688
|
SkyCellType["Number"] = "skyCellNumber";
|
|
569
689
|
SkyCellType["NumberValidator"] = "skyCellNumberValidator";
|
|
570
690
|
SkyCellType["RowSelector"] = "skyCellRowSelector";
|
|
@@ -753,18 +873,19 @@
|
|
|
753
873
|
}
|
|
754
874
|
function getValidatorCellRendererSelector(component, fallback) {
|
|
755
875
|
return function (params) {
|
|
756
|
-
var _a, _b
|
|
757
|
-
if (typeof ((
|
|
876
|
+
var _a, _b;
|
|
877
|
+
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') {
|
|
758
878
|
if (!params.colDef.cellRendererParams.skyComponentProperties.validator(params.value, params.data, params.rowIndex)) {
|
|
759
879
|
return {
|
|
760
880
|
component: component,
|
|
761
|
-
params: __assign({},
|
|
881
|
+
params: __assign({}, params.colDef.cellRendererParams)
|
|
762
882
|
};
|
|
763
883
|
}
|
|
764
884
|
}
|
|
765
885
|
return fallback;
|
|
766
886
|
};
|
|
767
887
|
}
|
|
888
|
+
var rowNodeId = 1;
|
|
768
889
|
/**
|
|
769
890
|
* A service that provides default styling and behavior for agGrids in SKY UX SPAs.
|
|
770
891
|
*/
|
|
@@ -807,9 +928,9 @@
|
|
|
807
928
|
return mergedGridOptions;
|
|
808
929
|
};
|
|
809
930
|
SkyAgGridService.prototype.getDefaultGridOptions = function (args) {
|
|
810
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
931
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
811
932
|
var _this = this;
|
|
812
|
-
var
|
|
933
|
+
var _l, _m, _o, _p, _q, _r;
|
|
813
934
|
// cellClassRules can be functions or string expressions
|
|
814
935
|
var cellClassRuleTrueExpression = 'true';
|
|
815
936
|
function getEditableFn(isUneditable) {
|
|
@@ -828,8 +949,8 @@
|
|
|
828
949
|
_a);
|
|
829
950
|
function getValidatorFn() {
|
|
830
951
|
return function (param) {
|
|
831
|
-
var _a, _b
|
|
832
|
-
if (typeof ((
|
|
952
|
+
var _a, _b;
|
|
953
|
+
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') {
|
|
833
954
|
return !param.colDef.cellRendererParams.skyComponentProperties.validator(param.value, param.data, param.rowIndex);
|
|
834
955
|
}
|
|
835
956
|
return false;
|
|
@@ -851,25 +972,41 @@
|
|
|
851
972
|
cellClassRules: __assign(__assign((_e = {}, _e[exports.SkyCellClass.Currency] = cellClassRuleTrueExpression, _e), validatorCellClassRules), editableCellClassRules),
|
|
852
973
|
cellRendererSelector: getValidatorCellRendererSelector('sky-ag-grid-cell-renderer-currency-validator', { component: 'sky-ag-grid-cell-renderer-currency' }),
|
|
853
974
|
cellEditorFramework: SkyAgGridCellEditorCurrencyComponent,
|
|
975
|
+
headerClass: exports.SkyHeaderClass.RightAligned,
|
|
854
976
|
minWidth: 185
|
|
855
977
|
},
|
|
856
978
|
_c[exports.SkyCellType.Date] = {
|
|
857
979
|
cellClassRules: __assign((_f = {}, _f[exports.SkyCellClass.Date] = cellClassRuleTrueExpression, _f), editableCellClassRules),
|
|
858
980
|
cellEditorFramework: SkyAgGridCellEditorDatepickerComponent,
|
|
859
981
|
comparator: dateComparator,
|
|
860
|
-
minWidth: ((
|
|
982
|
+
minWidth: ((_m = (_l = this.currentTheme) === null || _l === void 0 ? void 0 : _l.theme) === null || _m === void 0 ? void 0 : _m.name) === 'modern' ? 180 : 160,
|
|
861
983
|
valueFormatter: function (params) { return _this.dateFormatter(params, args.locale); }
|
|
862
984
|
},
|
|
985
|
+
_c[exports.SkyCellType.Lookup] = {
|
|
986
|
+
cellClassRules: __assign((_g = {}, _g[exports.SkyCellClass.Lookup] = cellClassRuleTrueExpression, _g), editableCellClassRules),
|
|
987
|
+
cellEditorFramework: SkyAgGridCellEditorLookupComponent,
|
|
988
|
+
cellRendererFramework: SkyAgGridCellRendererLookupComponent,
|
|
989
|
+
valueFormatter: function (params) {
|
|
990
|
+
var lookupProperties = applySkyLookupPropertiesDefaults(params);
|
|
991
|
+
return (params.value || [])
|
|
992
|
+
.map(function (value) {
|
|
993
|
+
return value[lookupProperties.descriptorProperty];
|
|
994
|
+
})
|
|
995
|
+
.filter(function (value) { return value !== '' && value !== undefined; })
|
|
996
|
+
.join('; ');
|
|
997
|
+
},
|
|
998
|
+
minWidth: 185
|
|
999
|
+
},
|
|
863
1000
|
_c[exports.SkyCellType.Number] = {
|
|
864
|
-
cellClassRules: __assign((
|
|
1001
|
+
cellClassRules: __assign((_h = {}, _h[exports.SkyCellClass.Number] = cellClassRuleTrueExpression, _h), editableCellClassRules),
|
|
865
1002
|
cellEditorFramework: SkyAgGridCellEditorNumberComponent,
|
|
866
1003
|
headerClass: exports.SkyHeaderClass.RightAligned
|
|
867
1004
|
},
|
|
868
1005
|
_c[exports.SkyCellType.RowSelector] = {
|
|
869
|
-
cellClassRules: (
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
1006
|
+
cellClassRules: (_j = {},
|
|
1007
|
+
_j[exports.SkyCellClass.RowSelector] = cellClassRuleTrueExpression,
|
|
1008
|
+
_j[exports.SkyCellClass.Uneditable] = cellClassRuleTrueExpression,
|
|
1009
|
+
_j),
|
|
873
1010
|
cellRendererFramework: SkyAgGridCellRendererRowSelectorComponent,
|
|
874
1011
|
headerName: '',
|
|
875
1012
|
minWidth: 55,
|
|
@@ -878,7 +1015,7 @@
|
|
|
878
1015
|
width: 55
|
|
879
1016
|
},
|
|
880
1017
|
_c[exports.SkyCellType.Text] = {
|
|
881
|
-
cellClassRules: __assign((
|
|
1018
|
+
cellClassRules: __assign((_k = {}, _k[exports.SkyCellClass.Text] = cellClassRuleTrueExpression, _k), editableCellClassRules),
|
|
882
1019
|
cellEditorFramework: SkyAgGridCellEditorTextComponent
|
|
883
1020
|
},
|
|
884
1021
|
_c[exports.SkyCellType.Validator] = {
|
|
@@ -900,7 +1037,21 @@
|
|
|
900
1037
|
'sky-ag-grid-cell-renderer-currency-validator': SkyAgGridCellRendererCurrencyValidatorComponent,
|
|
901
1038
|
'sky-ag-grid-cell-renderer-validator-tooltip': SkyAgGridCellRendererValidatorTooltipComponent
|
|
902
1039
|
},
|
|
903
|
-
|
|
1040
|
+
getRowNodeId: function (data) {
|
|
1041
|
+
if ('id' in data && data.id) {
|
|
1042
|
+
return "" + data.id;
|
|
1043
|
+
}
|
|
1044
|
+
return "" + rowNodeId++;
|
|
1045
|
+
},
|
|
1046
|
+
getRowClass: function (params) {
|
|
1047
|
+
if (params.node.id) {
|
|
1048
|
+
return "sky-ag-grid-row-" + params.node.id;
|
|
1049
|
+
}
|
|
1050
|
+
else {
|
|
1051
|
+
return undefined;
|
|
1052
|
+
}
|
|
1053
|
+
},
|
|
1054
|
+
headerHeight: ((_p = (_o = this.currentTheme) === null || _o === void 0 ? void 0 : _o.theme) === null || _p === void 0 ? void 0 : _p.name) === 'modern' ? 60 : 37,
|
|
904
1055
|
icons: {
|
|
905
1056
|
sortDescending: this.getIconTemplate('caret-down'),
|
|
906
1057
|
sortAscending: this.getIconTemplate('caret-up'),
|
|
@@ -911,7 +1062,7 @@
|
|
|
911
1062
|
columnMovePin: this.getIconTemplate('arrows')
|
|
912
1063
|
},
|
|
913
1064
|
onCellFocused: function () { return _this.onCellFocused(); },
|
|
914
|
-
rowHeight: ((
|
|
1065
|
+
rowHeight: ((_r = (_q = this.currentTheme) === null || _q === void 0 ? void 0 : _q.theme) === null || _r === void 0 ? void 0 : _r.name) === 'modern' ? 60 : 38,
|
|
915
1066
|
rowMultiSelectWithClick: true,
|
|
916
1067
|
rowSelection: 'multiple',
|
|
917
1068
|
singleClickEdit: true,
|
|
@@ -929,9 +1080,12 @@
|
|
|
929
1080
|
validatorMessage: 'Please enter a valid currency'
|
|
930
1081
|
}
|
|
931
1082
|
} });
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
1083
|
+
/*istanbul ignore else*/
|
|
1084
|
+
if (this.resources) {
|
|
1085
|
+
this.resources.getString('sky_ag_grid_cell_renderer_currency_validator_message').subscribe(function (value) {
|
|
1086
|
+
defaultSkyGridOptions.columnTypes[exports.SkyCellType.CurrencyValidator].cellRendererParams.skyComponentProperties.validatorMessage = value;
|
|
1087
|
+
});
|
|
1088
|
+
}
|
|
935
1089
|
defaultSkyGridOptions.columnTypes[exports.SkyCellType.NumberValidator] = __assign(__assign(__assign({}, defaultSkyGridOptions.columnTypes[exports.SkyCellType.Validator]), defaultSkyGridOptions.columnTypes[exports.SkyCellType.Number]), { cellClassRules: __assign(__assign({}, defaultSkyGridOptions.columnTypes[exports.SkyCellType.Validator].cellClassRules), defaultSkyGridOptions.columnTypes[exports.SkyCellType.Number].cellClassRules), cellRendererParams: {
|
|
936
1090
|
skyComponentProperties: {
|
|
937
1091
|
validator: function (value, data, rowIndex) {
|
|
@@ -940,9 +1094,12 @@
|
|
|
940
1094
|
validatorMessage: 'Please enter a valid number'
|
|
941
1095
|
}
|
|
942
1096
|
} });
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
1097
|
+
/*istanbul ignore else*/
|
|
1098
|
+
if (this.resources) {
|
|
1099
|
+
this.resources.getString('sky_ag_grid_cell_renderer_number_validator_message').subscribe(function (value) {
|
|
1100
|
+
defaultSkyGridOptions.columnTypes[exports.SkyCellType.NumberValidator].cellRendererParams.skyComponentProperties.validatorMessage = value;
|
|
1101
|
+
});
|
|
1102
|
+
}
|
|
946
1103
|
return defaultSkyGridOptions;
|
|
947
1104
|
};
|
|
948
1105
|
SkyAgGridService.prototype.onCellFocused = function () {
|
|
@@ -961,6 +1118,7 @@
|
|
|
961
1118
|
if (date && typeof date === 'string') {
|
|
962
1119
|
date = new Date(params.value);
|
|
963
1120
|
}
|
|
1121
|
+
// @ts-ignore
|
|
964
1122
|
var formattedDate = date && date.toLocaleDateString && date.toLocaleDateString(locale, dateConfig);
|
|
965
1123
|
if (date && date.getTime && !isNaN(date.getTime())) {
|
|
966
1124
|
return formattedDate;
|
|
@@ -1093,7 +1251,7 @@
|
|
|
1093
1251
|
|
|
1094
1252
|
var SkyAgGridResourcesProvider = /** @class */ (function () {
|
|
1095
1253
|
function SkyAgGridResourcesProvider() {
|
|
1096
|
-
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" } };
|
|
1254
|
+
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" } };
|
|
1097
1255
|
}
|
|
1098
1256
|
SkyAgGridResourcesProvider.prototype.getString = function (localeInfo, name) {
|
|
1099
1257
|
return i18n.getStringForLocale(this.resources, localeInfo.locale, name);
|
|
@@ -1163,6 +1321,25 @@
|
|
|
1163
1321
|
return SkyAgGridCellEditorDatepickerModule;
|
|
1164
1322
|
}());
|
|
1165
1323
|
|
|
1324
|
+
var SkyAgGridCellEditorLookupModule = /** @class */ (function () {
|
|
1325
|
+
function SkyAgGridCellEditorLookupModule() {
|
|
1326
|
+
}
|
|
1327
|
+
SkyAgGridCellEditorLookupModule = __decorate([
|
|
1328
|
+
core.NgModule({
|
|
1329
|
+
declarations: [SkyAgGridCellEditorLookupComponent],
|
|
1330
|
+
exports: [SkyAgGridCellEditorLookupComponent],
|
|
1331
|
+
imports: [
|
|
1332
|
+
common.CommonModule,
|
|
1333
|
+
forms.ReactiveFormsModule,
|
|
1334
|
+
SkyAgGridResourcesModule,
|
|
1335
|
+
forms$1.SkyInputBoxModule,
|
|
1336
|
+
lookup.SkyLookupModule
|
|
1337
|
+
]
|
|
1338
|
+
})
|
|
1339
|
+
], SkyAgGridCellEditorLookupModule);
|
|
1340
|
+
return SkyAgGridCellEditorLookupModule;
|
|
1341
|
+
}());
|
|
1342
|
+
|
|
1166
1343
|
var SkyAgGridCellEditorNumberModule = /** @class */ (function () {
|
|
1167
1344
|
function SkyAgGridCellEditorNumberModule() {
|
|
1168
1345
|
}
|
|
@@ -1203,6 +1380,19 @@
|
|
|
1203
1380
|
return SkyAgGridCellEditorTextModule;
|
|
1204
1381
|
}());
|
|
1205
1382
|
|
|
1383
|
+
var SkyAgGridCellRendererLookupModule = /** @class */ (function () {
|
|
1384
|
+
function SkyAgGridCellRendererLookupModule() {
|
|
1385
|
+
}
|
|
1386
|
+
SkyAgGridCellRendererLookupModule = __decorate([
|
|
1387
|
+
core.NgModule({
|
|
1388
|
+
declarations: [SkyAgGridCellRendererLookupComponent],
|
|
1389
|
+
exports: [SkyAgGridCellRendererLookupComponent],
|
|
1390
|
+
imports: [common.CommonModule, SkyAgGridResourcesModule]
|
|
1391
|
+
})
|
|
1392
|
+
], SkyAgGridCellRendererLookupModule);
|
|
1393
|
+
return SkyAgGridCellRendererLookupModule;
|
|
1394
|
+
}());
|
|
1395
|
+
|
|
1206
1396
|
var SkyAgGridCellRendererRowSelectorModule = /** @class */ (function () {
|
|
1207
1397
|
function SkyAgGridCellRendererRowSelectorModule() {
|
|
1208
1398
|
}
|
|
@@ -1313,13 +1503,30 @@
|
|
|
1313
1503
|
agGrid.api.sizeColumnsToFit();
|
|
1314
1504
|
});
|
|
1315
1505
|
agGrid.columnMoved
|
|
1506
|
+
.pipe(operators.takeUntil(this.ngUnsubscribe), operators.filter(function (event) {
|
|
1507
|
+
return ![
|
|
1508
|
+
'gridInitializing',
|
|
1509
|
+
'uiColumnResized',
|
|
1510
|
+
'uiColumnDragged',
|
|
1511
|
+
'api'
|
|
1512
|
+
].includes(event.source);
|
|
1513
|
+
}))
|
|
1514
|
+
.subscribe(function (value) {
|
|
1515
|
+
_this.updateColumnsInCurrentDataState(value.columnApi);
|
|
1516
|
+
});
|
|
1517
|
+
var currentColumns;
|
|
1518
|
+
agGrid.dragStarted
|
|
1316
1519
|
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
1317
|
-
.subscribe(function (
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1520
|
+
.subscribe(function (value) {
|
|
1521
|
+
currentColumns = _this.getColumnOrder(value.columnApi);
|
|
1522
|
+
});
|
|
1523
|
+
agGrid.dragStopped
|
|
1524
|
+
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
1525
|
+
.subscribe(function (value) {
|
|
1526
|
+
var newColumns = _this.getColumnOrder(value.columnApi);
|
|
1527
|
+
var hasChanged = currentColumns.findIndex(function (colId, i) { return colId !== newColumns[i]; });
|
|
1528
|
+
if (hasChanged > -1) {
|
|
1529
|
+
_this.updateColumnsInCurrentDataState(value.columnApi);
|
|
1323
1530
|
}
|
|
1324
1531
|
});
|
|
1325
1532
|
agGrid.rowSelected
|
|
@@ -1341,7 +1548,6 @@
|
|
|
1341
1548
|
agGrid.sortChanged
|
|
1342
1549
|
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
1343
1550
|
.subscribe(function () {
|
|
1344
|
-
var _a;
|
|
1345
1551
|
var gridSortModel = agGrid.api.getSortModel();
|
|
1346
1552
|
var sortOption;
|
|
1347
1553
|
/* istanbul ignore else */
|
|
@@ -1349,20 +1555,41 @@
|
|
|
1349
1555
|
var activeSortModel_1 = gridSortModel[0];
|
|
1350
1556
|
var activeSortColumn_1 = agGrid.columnApi.getColumn(activeSortModel_1.colId);
|
|
1351
1557
|
var dataManagerConfig = _this.dataManagerSvc.getCurrentDataManagerConfig();
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1558
|
+
/* istanbul ignore else */
|
|
1559
|
+
if (dataManagerConfig.sortOptions) {
|
|
1560
|
+
sortOption = dataManagerConfig.sortOptions.find(function (option) {
|
|
1561
|
+
return option.propertyName === activeSortColumn_1.getColDef().field &&
|
|
1562
|
+
option.descending === (activeSortModel_1.sort === 'desc');
|
|
1563
|
+
});
|
|
1564
|
+
}
|
|
1565
|
+
else {
|
|
1566
|
+
sortOption = undefined;
|
|
1567
|
+
}
|
|
1356
1568
|
}
|
|
1357
1569
|
_this.currentDataState.activeSortOption = sortOption;
|
|
1358
1570
|
_this.dataManagerSvc.updateDataState(_this.currentDataState, _this.viewConfig.id);
|
|
1359
1571
|
});
|
|
1360
1572
|
};
|
|
1573
|
+
SkyAgGridDataManagerAdapterDirective.prototype.updateColumnsInCurrentDataState = function (columnApi) {
|
|
1574
|
+
var columnOrder = this.getColumnOrder(columnApi);
|
|
1575
|
+
var viewState = this.currentDataState.getViewStateById(this.viewConfig.id);
|
|
1576
|
+
viewState.displayedColumnIds = columnOrder;
|
|
1577
|
+
this.dataManagerSvc.updateDataState(this.currentDataState.addOrUpdateView(this.viewConfig.id, viewState), this.viewConfig.id);
|
|
1578
|
+
};
|
|
1579
|
+
SkyAgGridDataManagerAdapterDirective.prototype.getColumnOrder = function (columnApi) {
|
|
1580
|
+
return columnApi
|
|
1581
|
+
.getAllDisplayedVirtualColumns()
|
|
1582
|
+
.map(function (col) { return col.getColDef().colId; });
|
|
1583
|
+
};
|
|
1361
1584
|
SkyAgGridDataManagerAdapterDirective.prototype.displayColumns = function (dataState) {
|
|
1362
1585
|
var e_1, _a;
|
|
1363
1586
|
var agGrid = this.currentAgGrid;
|
|
1364
1587
|
var viewState = dataState.getViewStateById(this.viewConfig.id);
|
|
1365
|
-
var displayedColumnIds =
|
|
1588
|
+
var displayedColumnIds = [];
|
|
1589
|
+
/*istanbul ignore else*/
|
|
1590
|
+
if (viewState.displayedColumnIds) {
|
|
1591
|
+
displayedColumnIds = viewState.displayedColumnIds;
|
|
1592
|
+
}
|
|
1366
1593
|
var columns = agGrid.columnApi.getAllColumns();
|
|
1367
1594
|
try {
|
|
1368
1595
|
for (var columns_1 = __values(columns), columns_1_1 = columns_1.next(); !columns_1_1.done; columns_1_1 = columns_1.next()) {
|
|
@@ -1744,7 +1971,7 @@
|
|
|
1744
1971
|
return this.rowDeleteConfigs.find(function (rowDelete) { return rowDelete.id === row.id; });
|
|
1745
1972
|
};
|
|
1746
1973
|
SkyAgGridRowDeleteDirective.prototype.affixToRow = function (affixer, id) {
|
|
1747
|
-
var rowElement = this.elementRef.nativeElement.querySelector(
|
|
1974
|
+
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 ");
|
|
1748
1975
|
// This covers cases where AG Grid places the column index on an inner element (such as with the `enableCellTextSelection` option)
|
|
1749
1976
|
// This appears to have been fixed by AG Grid in version 24 and so it is not testable after that version.
|
|
1750
1977
|
/* istanbul ignore if */
|
|
@@ -1881,9 +2108,11 @@
|
|
|
1881
2108
|
common.CommonModule,
|
|
1882
2109
|
SkyAgGridCellEditorAutocompleteModule,
|
|
1883
2110
|
SkyAgGridCellEditorDatepickerModule,
|
|
2111
|
+
SkyAgGridCellEditorLookupModule,
|
|
1884
2112
|
SkyAgGridCellEditorNumberModule,
|
|
1885
2113
|
SkyAgGridCellEditorCurrencyModule,
|
|
1886
2114
|
SkyAgGridCellRendererCurrencyModule,
|
|
2115
|
+
SkyAgGridCellRendererLookupModule,
|
|
1887
2116
|
SkyAgGridCellRendererRowSelectorModule,
|
|
1888
2117
|
SkyAgGridCellRendererValidatorTooltipModule,
|
|
1889
2118
|
SkyAgGridCellValidatorModule,
|
|
@@ -1906,10 +2135,12 @@
|
|
|
1906
2135
|
entryComponents: [
|
|
1907
2136
|
SkyAgGridCellEditorAutocompleteComponent,
|
|
1908
2137
|
SkyAgGridCellEditorDatepickerComponent,
|
|
2138
|
+
SkyAgGridCellEditorLookupComponent,
|
|
1909
2139
|
SkyAgGridCellEditorNumberComponent,
|
|
1910
2140
|
SkyAgGridCellEditorCurrencyComponent,
|
|
1911
2141
|
SkyAgGridCellRendererCurrencyComponent,
|
|
1912
2142
|
SkyAgGridCellRendererCurrencyValidatorComponent,
|
|
2143
|
+
SkyAgGridCellRendererLookupComponent,
|
|
1913
2144
|
SkyAgGridCellRendererRowSelectorComponent,
|
|
1914
2145
|
SkyAgGridCellRendererValidatorTooltipComponent,
|
|
1915
2146
|
SkyAgGridCellEditorTextComponent,
|
|
@@ -1924,6 +2155,10 @@
|
|
|
1924
2155
|
exports.SkyAgGridService = SkyAgGridService;
|
|
1925
2156
|
exports.ɵa = SkyAgGridDataManagerAdapterDirective;
|
|
1926
2157
|
exports.ɵb = SkyAgGridWrapperComponent;
|
|
2158
|
+
exports.ɵba = SkyAgGridCellRendererValidatorTooltipModule;
|
|
2159
|
+
exports.ɵbb = SkyAgGridCellRendererValidatorTooltipComponent;
|
|
2160
|
+
exports.ɵbc = SkyAgGridCellEditorTextModule;
|
|
2161
|
+
exports.ɵbd = SkyAgGridCellEditorTextComponent;
|
|
1927
2162
|
exports.ɵc = SkyAgGridAdapterService;
|
|
1928
2163
|
exports.ɵd = SkyAgGridRowDeleteComponent;
|
|
1929
2164
|
exports.ɵe = SkyAgGridRowDeleteDirective;
|
|
@@ -1933,21 +2168,21 @@
|
|
|
1933
2168
|
exports.ɵi = SkyAgGridCellEditorAutocompleteComponent;
|
|
1934
2169
|
exports.ɵj = SkyAgGridCellEditorDatepickerModule;
|
|
1935
2170
|
exports.ɵk = SkyAgGridCellEditorDatepickerComponent;
|
|
1936
|
-
exports.ɵl =
|
|
1937
|
-
exports.ɵm =
|
|
1938
|
-
exports.ɵn =
|
|
1939
|
-
exports.ɵo =
|
|
1940
|
-
exports.ɵp =
|
|
1941
|
-
exports.ɵq =
|
|
1942
|
-
exports.ɵr =
|
|
1943
|
-
exports.ɵs =
|
|
1944
|
-
exports.ɵt =
|
|
1945
|
-
exports.ɵu =
|
|
1946
|
-
exports.ɵv =
|
|
1947
|
-
exports.ɵw =
|
|
1948
|
-
exports.ɵx =
|
|
1949
|
-
exports.ɵy =
|
|
1950
|
-
exports.ɵz =
|
|
2171
|
+
exports.ɵl = SkyAgGridCellEditorLookupModule;
|
|
2172
|
+
exports.ɵm = SkyAgGridCellEditorLookupComponent;
|
|
2173
|
+
exports.ɵn = SkyAgGridCellEditorNumberModule;
|
|
2174
|
+
exports.ɵo = SkyAgGridCellEditorNumberComponent;
|
|
2175
|
+
exports.ɵp = SkyAgGridCellEditorCurrencyModule;
|
|
2176
|
+
exports.ɵq = SkyAgGridCellEditorCurrencyComponent;
|
|
2177
|
+
exports.ɵr = SkyAgGridCellRendererCurrencyModule;
|
|
2178
|
+
exports.ɵs = SkyAgGridCellValidatorModule;
|
|
2179
|
+
exports.ɵt = SkyAgGridCellValidatorTooltipComponent;
|
|
2180
|
+
exports.ɵu = SkyAgGridCellRendererCurrencyComponent;
|
|
2181
|
+
exports.ɵv = SkyAgGridCellRendererCurrencyValidatorComponent;
|
|
2182
|
+
exports.ɵw = SkyAgGridCellRendererLookupModule;
|
|
2183
|
+
exports.ɵx = SkyAgGridCellRendererLookupComponent;
|
|
2184
|
+
exports.ɵy = SkyAgGridCellRendererRowSelectorModule;
|
|
2185
|
+
exports.ɵz = SkyAgGridCellRendererRowSelectorComponent;
|
|
1951
2186
|
|
|
1952
2187
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
1953
2188
|
|