angular-slickgrid 3.0.4 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -20
- package/README.md +192 -181
- package/angular-slickgrid.metadata.json +1 -1
- package/app/modules/angular-slickgrid/components/angular-slickgrid.component.d.ts +11 -3
- package/app/modules/angular-slickgrid/index.d.ts +0 -1
- package/bundles/angular-slickgrid.umd.js +99 -248
- package/bundles/angular-slickgrid.umd.js.map +1 -1
- package/esm2015/app/modules/angular-slickgrid/components/angular-slickgrid.component.js +89 -70
- package/esm2015/app/modules/angular-slickgrid/constants.js +1 -1
- package/esm2015/app/modules/angular-slickgrid/extensions/index.js +1 -1
- package/esm2015/app/modules/angular-slickgrid/extensions/rowDetailViewExtension.js +2 -2
- package/esm2015/app/modules/angular-slickgrid/global-grid-options.js +4 -3
- package/esm2015/app/modules/angular-slickgrid/index.js +1 -2
- package/esm2015/app/modules/angular-slickgrid/models/angularComponentOutput.interface.js +1 -1
- package/esm2015/app/modules/angular-slickgrid/models/angularGridInstance.interface.js +1 -1
- package/esm2015/app/modules/angular-slickgrid/models/externalTestingDependencies.interface.js +1 -1
- package/esm2015/app/modules/angular-slickgrid/models/gridOption.interface.js +1 -1
- package/esm2015/app/modules/angular-slickgrid/models/index.js +1 -1
- package/esm2015/app/modules/angular-slickgrid/models/rowDetailView.interface.js +1 -1
- package/esm2015/app/modules/angular-slickgrid/models/slickGrid.interface.js +1 -1
- package/esm2015/app/modules/angular-slickgrid/modules/angular-slickgrid.module.js +1 -4
- package/esm2015/app/modules/angular-slickgrid/services/angularUtil.service.js +1 -1
- package/esm2015/app/modules/angular-slickgrid/services/bsDropdown.service.js +1 -1
- package/esm2015/app/modules/angular-slickgrid/services/container.service.js +1 -1
- package/esm2015/app/modules/angular-slickgrid/services/index.js +1 -1
- package/esm2015/app/modules/angular-slickgrid/services/translater.service.js +1 -1
- package/esm2015/app/modules/angular-slickgrid/services/utilities.js +1 -1
- package/esm2015/app/modules/angular-slickgrid/slickgrid-config.js +1 -1
- package/esm2015/public_api.js +1 -1
- package/fesm2015/angular-slickgrid.js +95 -209
- package/fesm2015/angular-slickgrid.js.map +1 -1
- package/i18n/en.json +89 -89
- package/i18n/fr.json +90 -90
- package/package.json +11 -10
- package/app/modules/angular-slickgrid/components/slick-pagination.component.d.ts +0 -42
- package/esm2015/app/modules/angular-slickgrid/components/slick-pagination.component.js +0 -137
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@slickgrid-universal/common'), require('@angular/core'), require('@ngx-translate/core'), require('slickgrid/plugins/slick.rowdetailview'), require('slickgrid/plugins/slick.rowselectionmodel'), require('@slickgrid-universal/event-pub-sub'), require('rxjs'), require('dompurify'), require('jquery-ui/ui/widgets/draggable'), require('jquery-ui/ui/widgets/droppable'), require('jquery-ui/ui/widgets/sortable'), require('slickgrid/lib/jquery.event.drag-2.3.0'), require('slickgrid/lib/jquery.mousewheel'), require('slickgrid/slick.core'), require('slickgrid/slick.grid'), require('slickgrid/slick.dataview'), require('slickgrid/slick.groupitemmetadataprovider'), require('@slickgrid-universal/custom-footer-component'), require('@slickgrid-universal/
|
|
3
|
-
typeof define === 'function' && define.amd ? define('angular-slickgrid', ['exports', '@slickgrid-universal/common', '@angular/core', '@ngx-translate/core', 'slickgrid/plugins/slick.rowdetailview', 'slickgrid/plugins/slick.rowselectionmodel', '@slickgrid-universal/event-pub-sub', 'rxjs', 'dompurify', 'jquery-ui/ui/widgets/draggable', 'jquery-ui/ui/widgets/droppable', 'jquery-ui/ui/widgets/sortable', 'slickgrid/lib/jquery.event.drag-2.3.0', 'slickgrid/lib/jquery.mousewheel', 'slickgrid/slick.core', 'slickgrid/slick.grid', 'slickgrid/slick.dataview', 'slickgrid/slick.groupitemmetadataprovider', '@slickgrid-universal/custom-footer-component', '@slickgrid-universal/
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['angular-slickgrid'] = {}, global.common, global.ng.core, global['ngx-translate-core'], null, null, global.eventPubSub, global.rxjs, global.dompurify, null, null, null, null, null, null, null, null, null, global.customFooterComponent, global.
|
|
5
|
-
}(this, (function (exports, common, core, core$1, slick_rowdetailview, slick_rowselectionmodel, eventPubSub, rxjs, DOMPurify_, draggable, droppable, sortable, jquery_event_drag2_3_0, jquery_mousewheel, slick_core, slick_grid, slick_dataview, slick_groupitemmetadataprovider, customFooterComponent,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@slickgrid-universal/common'), require('@angular/core'), require('@ngx-translate/core'), require('slickgrid/plugins/slick.rowdetailview'), require('slickgrid/plugins/slick.rowselectionmodel'), require('@slickgrid-universal/event-pub-sub'), require('rxjs'), require('dompurify'), require('jquery-ui/ui/widgets/draggable'), require('jquery-ui/ui/widgets/droppable'), require('jquery-ui/ui/widgets/sortable'), require('slickgrid/lib/jquery.event.drag-2.3.0'), require('slickgrid/lib/jquery.mousewheel'), require('slickgrid/slick.core'), require('slickgrid/slick.grid'), require('slickgrid/slick.dataview'), require('slickgrid/slick.groupitemmetadataprovider'), require('@slickgrid-universal/empty-warning-component'), require('@slickgrid-universal/custom-footer-component'), require('@slickgrid-universal/pagination-component'), require('@slickgrid-universal/rxjs-observable'), require('dequal/lite'), require('@angular/common')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('angular-slickgrid', ['exports', '@slickgrid-universal/common', '@angular/core', '@ngx-translate/core', 'slickgrid/plugins/slick.rowdetailview', 'slickgrid/plugins/slick.rowselectionmodel', '@slickgrid-universal/event-pub-sub', 'rxjs', 'dompurify', 'jquery-ui/ui/widgets/draggable', 'jquery-ui/ui/widgets/droppable', 'jquery-ui/ui/widgets/sortable', 'slickgrid/lib/jquery.event.drag-2.3.0', 'slickgrid/lib/jquery.mousewheel', 'slickgrid/slick.core', 'slickgrid/slick.grid', 'slickgrid/slick.dataview', 'slickgrid/slick.groupitemmetadataprovider', '@slickgrid-universal/empty-warning-component', '@slickgrid-universal/custom-footer-component', '@slickgrid-universal/pagination-component', '@slickgrid-universal/rxjs-observable', 'dequal/lite', '@angular/common'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['angular-slickgrid'] = {}, global.common, global.ng.core, global['ngx-translate-core'], null, null, global.eventPubSub, global.rxjs, global.dompurify, null, null, null, null, null, null, null, null, null, global.emptyWarningComponent, global.customFooterComponent, global.paginationComponent, global.rxjsObservable, global.lite, global.ng.common));
|
|
5
|
+
}(this, (function (exports, common, core, core$1, slick_rowdetailview, slick_rowselectionmodel, eventPubSub, rxjs, DOMPurify_, draggable, droppable, sortable, jquery_event_drag2_3_0, jquery_mousewheel, slick_core, slick_grid, slick_dataview, slick_groupitemmetadataprovider, emptyWarningComponent, customFooterComponent, paginationComponent, rxjsObservable, lite, common$1) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespace(e) {
|
|
8
8
|
if (e && e.__esModule) return e;
|
|
@@ -449,7 +449,7 @@
|
|
|
449
449
|
ar[i] = from[i];
|
|
450
450
|
}
|
|
451
451
|
}
|
|
452
|
-
return to.concat(ar || from);
|
|
452
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
453
453
|
}
|
|
454
454
|
function __await(v) {
|
|
455
455
|
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
@@ -1038,10 +1038,9 @@
|
|
|
1038
1038
|
syncGridSelectionWithBackendService: false, // but disable it when using backend services
|
|
1039
1039
|
},
|
|
1040
1040
|
datasetIdPropertyName: 'id',
|
|
1041
|
-
defaultColumnSortFieldId: 'id',
|
|
1042
1041
|
defaultFilter: common.Filters.input,
|
|
1043
1042
|
defaultBackendServiceFilterTypingDebounce: 500,
|
|
1044
|
-
|
|
1043
|
+
defaultColumnSortFieldId: 'id',
|
|
1045
1044
|
defaultFilterPlaceholder: '🔎︎',
|
|
1046
1045
|
defaultFilterRangeOperator: common.OperatorType.rangeInclusive,
|
|
1047
1046
|
editable: false,
|
|
@@ -1054,6 +1053,7 @@
|
|
|
1054
1053
|
enableContextMenu: true,
|
|
1055
1054
|
enableExcelExport: true,
|
|
1056
1055
|
enableExport: false,
|
|
1056
|
+
enableFilterTrimWhiteSpace: false,
|
|
1057
1057
|
enableGridMenu: true,
|
|
1058
1058
|
enableHeaderMenu: true,
|
|
1059
1059
|
enableEmptyDataWarningMessage: true,
|
|
@@ -1176,6 +1176,7 @@
|
|
|
1176
1176
|
rowHeight: 35,
|
|
1177
1177
|
topPanelHeight: 35,
|
|
1178
1178
|
translationNamespaceSeparator: ':',
|
|
1179
|
+
resetFilterSearchValueAfterOnBeforeCancellation: true,
|
|
1179
1180
|
resizeByContentOnlyOnFirstLoad: true,
|
|
1180
1181
|
resizeByContentOptions: {
|
|
1181
1182
|
alwaysRecalculateColumnWidth: false,
|
|
@@ -1309,176 +1310,6 @@
|
|
|
1309
1310
|
Constants.VALIDATION_EDITOR_TEXT_MIN_LENGTH = 'Please make sure your text is more than {{minLength}} character(s)';
|
|
1310
1311
|
Constants.VALIDATION_EDITOR_TEXT_MIN_LENGTH_INCLUSIVE = 'Please make sure your text is at least {{minLength}} character(s)';
|
|
1311
1312
|
|
|
1312
|
-
var SlickPaginationComponent = /** @class */ (function () {
|
|
1313
|
-
/** Constructor */
|
|
1314
|
-
function SlickPaginationComponent(translate) {
|
|
1315
|
-
this.translate = translate;
|
|
1316
|
-
this.subscriptions = [];
|
|
1317
|
-
this._enableTranslate = false;
|
|
1318
|
-
// text translations (handled by ngx-translate or by custom locale)
|
|
1319
|
-
this.textItemsPerPage = 'items per page';
|
|
1320
|
-
this.textItems = 'items';
|
|
1321
|
-
this.textOf = 'of';
|
|
1322
|
-
this.textPage = 'Page';
|
|
1323
|
-
}
|
|
1324
|
-
Object.defineProperty(SlickPaginationComponent.prototype, "availablePageSizes", {
|
|
1325
|
-
get: function () {
|
|
1326
|
-
return this.paginationService.availablePageSizes;
|
|
1327
|
-
},
|
|
1328
|
-
enumerable: false,
|
|
1329
|
-
configurable: true
|
|
1330
|
-
});
|
|
1331
|
-
Object.defineProperty(SlickPaginationComponent.prototype, "dataFrom", {
|
|
1332
|
-
get: function () {
|
|
1333
|
-
return this.paginationService.dataFrom;
|
|
1334
|
-
},
|
|
1335
|
-
enumerable: false,
|
|
1336
|
-
configurable: true
|
|
1337
|
-
});
|
|
1338
|
-
Object.defineProperty(SlickPaginationComponent.prototype, "dataTo", {
|
|
1339
|
-
get: function () {
|
|
1340
|
-
return this.paginationService.dataTo;
|
|
1341
|
-
},
|
|
1342
|
-
enumerable: false,
|
|
1343
|
-
configurable: true
|
|
1344
|
-
});
|
|
1345
|
-
Object.defineProperty(SlickPaginationComponent.prototype, "isLeftPaginationDisabled", {
|
|
1346
|
-
/** is the left side pagination disabled? */
|
|
1347
|
-
get: function () {
|
|
1348
|
-
return this.pageNumber === 1 || this.totalItems === 0;
|
|
1349
|
-
},
|
|
1350
|
-
enumerable: false,
|
|
1351
|
-
configurable: true
|
|
1352
|
-
});
|
|
1353
|
-
Object.defineProperty(SlickPaginationComponent.prototype, "isRightPaginationDisabled", {
|
|
1354
|
-
/** is the right side pagination disabled? */
|
|
1355
|
-
get: function () {
|
|
1356
|
-
return this.pageNumber === this.pageCount || this.totalItems === 0;
|
|
1357
|
-
},
|
|
1358
|
-
enumerable: false,
|
|
1359
|
-
configurable: true
|
|
1360
|
-
});
|
|
1361
|
-
Object.defineProperty(SlickPaginationComponent.prototype, "itemsPerPage", {
|
|
1362
|
-
get: function () {
|
|
1363
|
-
return this.paginationService.itemsPerPage;
|
|
1364
|
-
},
|
|
1365
|
-
enumerable: false,
|
|
1366
|
-
configurable: true
|
|
1367
|
-
});
|
|
1368
|
-
Object.defineProperty(SlickPaginationComponent.prototype, "pageCount", {
|
|
1369
|
-
get: function () {
|
|
1370
|
-
return this.paginationService.pageCount;
|
|
1371
|
-
},
|
|
1372
|
-
enumerable: false,
|
|
1373
|
-
configurable: true
|
|
1374
|
-
});
|
|
1375
|
-
Object.defineProperty(SlickPaginationComponent.prototype, "pageNumber", {
|
|
1376
|
-
get: function () {
|
|
1377
|
-
return this.paginationService.pageNumber;
|
|
1378
|
-
},
|
|
1379
|
-
set: function (page) {
|
|
1380
|
-
// the setter has to be declared but we won't use it, instead we will use the "changeToCurrentPage()" to only update the value after ENTER keydown event
|
|
1381
|
-
},
|
|
1382
|
-
enumerable: false,
|
|
1383
|
-
configurable: true
|
|
1384
|
-
});
|
|
1385
|
-
Object.defineProperty(SlickPaginationComponent.prototype, "totalItems", {
|
|
1386
|
-
get: function () {
|
|
1387
|
-
return this.paginationService.totalItems;
|
|
1388
|
-
},
|
|
1389
|
-
enumerable: false,
|
|
1390
|
-
configurable: true
|
|
1391
|
-
});
|
|
1392
|
-
SlickPaginationComponent.prototype.ngOnDestroy = function () {
|
|
1393
|
-
this.dispose();
|
|
1394
|
-
};
|
|
1395
|
-
SlickPaginationComponent.prototype.ngOnInit = function () {
|
|
1396
|
-
var _this = this;
|
|
1397
|
-
this._gridOptions = this.gridOptions || {};
|
|
1398
|
-
this._enableTranslate = this._gridOptions && this._gridOptions.enableTranslate || false;
|
|
1399
|
-
this._locales = this._gridOptions && this._gridOptions.locales || Constants.locales;
|
|
1400
|
-
if (this._enableTranslate && !this.translate) {
|
|
1401
|
-
throw new Error('[Angular-Slickgrid] requires "ngx-translate" to be installed and configured when the grid option "enableTranslate" is enabled.');
|
|
1402
|
-
}
|
|
1403
|
-
this.translateAllUiTexts(this._locales);
|
|
1404
|
-
// translate all the text using ngx-translate or custom locales
|
|
1405
|
-
if (this._enableTranslate && this.translate && this.translate.onLangChange) {
|
|
1406
|
-
this.subscriptions.push(this.translate.onLangChange.subscribe(function () { return _this.translateAllUiTexts(_this._locales); }));
|
|
1407
|
-
}
|
|
1408
|
-
};
|
|
1409
|
-
SlickPaginationComponent.prototype.changeToFirstPage = function (event) {
|
|
1410
|
-
if (!this.isLeftPaginationDisabled) {
|
|
1411
|
-
this.paginationService.goToFirstPage(event);
|
|
1412
|
-
}
|
|
1413
|
-
};
|
|
1414
|
-
SlickPaginationComponent.prototype.changeToLastPage = function (event) {
|
|
1415
|
-
if (!this.isRightPaginationDisabled) {
|
|
1416
|
-
this.paginationService.goToLastPage(event);
|
|
1417
|
-
}
|
|
1418
|
-
};
|
|
1419
|
-
SlickPaginationComponent.prototype.changeToNextPage = function (event) {
|
|
1420
|
-
if (!this.isRightPaginationDisabled) {
|
|
1421
|
-
this.paginationService.goToNextPage(event);
|
|
1422
|
-
}
|
|
1423
|
-
};
|
|
1424
|
-
SlickPaginationComponent.prototype.changeToPreviousPage = function (event) {
|
|
1425
|
-
if (!this.isLeftPaginationDisabled) {
|
|
1426
|
-
this.paginationService.goToPreviousPage(event);
|
|
1427
|
-
}
|
|
1428
|
-
};
|
|
1429
|
-
SlickPaginationComponent.prototype.changeToCurrentPage = function (event) {
|
|
1430
|
-
var pageNumber = 1;
|
|
1431
|
-
if (event && event.currentTarget && event.currentTarget.value) {
|
|
1432
|
-
pageNumber = +(event.currentTarget.value);
|
|
1433
|
-
}
|
|
1434
|
-
this.paginationService.goToPageNumber(pageNumber, event);
|
|
1435
|
-
};
|
|
1436
|
-
SlickPaginationComponent.prototype.changeItemPerPage = function (event) {
|
|
1437
|
-
var itemsPerPage = 1;
|
|
1438
|
-
if (event && event.currentTarget && event.currentTarget.value) {
|
|
1439
|
-
itemsPerPage = +(event.currentTarget.value);
|
|
1440
|
-
}
|
|
1441
|
-
this.paginationService.changeItemPerPage(itemsPerPage, event);
|
|
1442
|
-
};
|
|
1443
|
-
SlickPaginationComponent.prototype.dispose = function () {
|
|
1444
|
-
// also unsubscribe all Angular Subscriptions
|
|
1445
|
-
this.subscriptions = unsubscribeAllObservables(this.subscriptions);
|
|
1446
|
-
};
|
|
1447
|
-
// --
|
|
1448
|
-
// private functions
|
|
1449
|
-
// --------------------
|
|
1450
|
-
/** Translate all the texts shown in the UI, use ngx-translate service when available or custom locales when service is null */
|
|
1451
|
-
SlickPaginationComponent.prototype.translateAllUiTexts = function (locales) {
|
|
1452
|
-
if (this._enableTranslate && this.translate && this.translate.instant && this.translate.currentLang) {
|
|
1453
|
-
var translationPrefix = common.getTranslationPrefix(this._gridOptions);
|
|
1454
|
-
this.textItemsPerPage = this.translate.instant(translationPrefix + "ITEMS_PER_PAGE");
|
|
1455
|
-
this.textItems = this.translate.instant(translationPrefix + "ITEMS");
|
|
1456
|
-
this.textOf = this.translate.instant(translationPrefix + "OF");
|
|
1457
|
-
this.textPage = this.translate.instant(translationPrefix + "PAGE");
|
|
1458
|
-
}
|
|
1459
|
-
else if (locales) {
|
|
1460
|
-
this.textItemsPerPage = locales.TEXT_ITEMS_PER_PAGE || 'TEXT_ITEMS_PER_PAGE';
|
|
1461
|
-
this.textItems = locales.TEXT_ITEMS || 'TEXT_ITEMS';
|
|
1462
|
-
this.textOf = locales.TEXT_OF || 'TEXT_OF';
|
|
1463
|
-
this.textPage = locales.TEXT_PAGE || 'TEXT_PAGE';
|
|
1464
|
-
}
|
|
1465
|
-
};
|
|
1466
|
-
return SlickPaginationComponent;
|
|
1467
|
-
}());
|
|
1468
|
-
SlickPaginationComponent.decorators = [
|
|
1469
|
-
{ type: core.Component, args: [{
|
|
1470
|
-
selector: 'slick-pagination',
|
|
1471
|
-
template: "<div class=\"slick-pagination\">\n <div class=\"slick-pagination-nav\">\n <nav aria-label=\"Page navigation\">\n <ul class=\"pagination\">\n <li class=\"page-item\" [ngClass]=\"isLeftPaginationDisabled ? 'disabled' : ''\">\n <a class=\"page-link icon-seek-first fa fa-angle-double-left\" aria-label=\"First\"\n (click)=\"changeToFirstPage($event)\">\n </a>\n </li>\n <li class=\"page-item\" [ngClass]=\"isLeftPaginationDisabled ? 'disabled' : ''\">\n <a class=\"page-link icon-seek-prev fa fa-angle-left\" aria-label=\"Previous\"\n (click)=\"changeToPreviousPage($event)\">\n </a>\n </li>\n </ul>\n </nav>\n\n <div class=\"slick-page-number\">\n <span>{{textPage}}</span>\n <input type=\"text\" class=\"form-control\" data-test=\"page-number-input\" [value]=\"pageNumber\" size=\"1\"\n [readOnly]=\"totalItems === 0\" (change)=\"changeToCurrentPage($event)\">\n <span>{{textOf}}</span><span data-test=\"page-count\"> {{pageCount}}</span>\n </div>\n\n <nav aria-label=\"Page navigation\">\n <ul class=\"pagination\">\n <li class=\"page-item\" [ngClass]=\"isRightPaginationDisabled ? 'disabled' : ''\">\n <a class=\"page-link icon-seek-next text-center fa fa-lg fa-angle-right\" aria-label=\"Next\"\n (click)=\"changeToNextPage($event)\">\n </a>\n </li>\n <li class=\"page-item\" [ngClass]=\"isRightPaginationDisabled ? 'disabled' : ''\">\n <a class=\"page-link icon-seek-end fa fa-lg fa-angle-double-right\" aria-label=\"Last\"\n (click)=\"changeToLastPage($event)\">\n </a>\n </li>\n </ul>\n </nav>\n </div>\n <span class=\"slick-pagination-settings\">\n <select id=\"items-per-page-label\" (change)=\"changeItemPerPage($event)\">\n <option value=\"{{pageSize}}\" [selected]=\"pageSize === itemsPerPage\" *ngFor=\"let pageSize of availablePageSizes\">{{pageSize}}</option>\n </select>\n <span>{{textItemsPerPage}}</span>,\n <span class=\"slick-pagination-count\">\n <span *ngIf=\"totalItems\">\n <span class=\"page-info-from-to\">\n <span data-test=\"item-from\">{{dataFrom}}</span>-<span data-test=\"item-to\">{{dataTo}}</span>\n {{textOf}}\n </span>\n </span>\n <span class=\"page-info-total-items\">\n <span data-test=\"total-items\">{{totalItems}}</span> {{textItems}}\n </span>\n </span>\n </span>\n</div>\n"
|
|
1472
|
-
},] }
|
|
1473
|
-
];
|
|
1474
|
-
SlickPaginationComponent.ctorParameters = function () { return [
|
|
1475
|
-
{ type: core$1.TranslateService, decorators: [{ type: core.Optional }] }
|
|
1476
|
-
]; };
|
|
1477
|
-
SlickPaginationComponent.propDecorators = {
|
|
1478
|
-
gridOptions: [{ type: core.Input }],
|
|
1479
|
-
paginationService: [{ type: core.Input }]
|
|
1480
|
-
};
|
|
1481
|
-
|
|
1482
1313
|
var AngularSlickgridComponent = /** @class */ (function () {
|
|
1483
1314
|
function AngularSlickgridComponent(angularUtilService, appRef, cd, containerService, elm, translate, translaterService, forRootConfig, externalServices) {
|
|
1484
1315
|
var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
@@ -1524,10 +1355,10 @@
|
|
|
1524
1355
|
var autoTooltipExtension = new common.AutoTooltipExtension(this.sharedService);
|
|
1525
1356
|
var cellExternalCopyManagerExtension = new common.CellExternalCopyManagerExtension(this.extensionUtility, this.sharedService);
|
|
1526
1357
|
var cellMenuExtension = new common.CellMenuExtension(this.extensionUtility, this.sharedService, this.translaterService);
|
|
1527
|
-
var contextMenuExtension = new common.ContextMenuExtension(this.extensionUtility, this.sharedService, this.treeDataService, this.translaterService);
|
|
1358
|
+
var contextMenuExtension = new common.ContextMenuExtension(this.extensionUtility, this._eventPubSubService, this.sharedService, this.treeDataService, this.translaterService);
|
|
1528
1359
|
var columnPickerExtension = new common.ColumnPickerExtension(this.extensionUtility, this.sharedService);
|
|
1529
1360
|
var checkboxExtension = new common.CheckboxSelectorExtension(this.sharedService);
|
|
1530
|
-
var draggableGroupingExtension = new common.DraggableGroupingExtension(this.extensionUtility, this.sharedService);
|
|
1361
|
+
var draggableGroupingExtension = new common.DraggableGroupingExtension(this.extensionUtility, this._eventPubSubService, this.sharedService);
|
|
1531
1362
|
var gridMenuExtension = new common.GridMenuExtension(this.extensionUtility, this.filterService, this.sharedService, this.sortService, this.backendUtilityService, this.translaterService);
|
|
1532
1363
|
var groupItemMetaProviderExtension = new common.GroupItemMetaProviderExtension(this.sharedService);
|
|
1533
1364
|
var headerButtonExtension = new common.HeaderButtonExtension(this.extensionUtility, this.sharedService);
|
|
@@ -1574,15 +1405,15 @@
|
|
|
1574
1405
|
return this._paginationOptions;
|
|
1575
1406
|
},
|
|
1576
1407
|
set: function (newPaginationOptions) {
|
|
1577
|
-
var _a;
|
|
1408
|
+
var _a, _b, _c;
|
|
1578
1409
|
if (newPaginationOptions && this._paginationOptions) {
|
|
1579
|
-
this._paginationOptions = Object.assign(Object.assign({}, this._paginationOptions), newPaginationOptions);
|
|
1410
|
+
this._paginationOptions = Object.assign(Object.assign(Object.assign({}, this.gridOptions.pagination), this._paginationOptions), newPaginationOptions);
|
|
1580
1411
|
}
|
|
1581
1412
|
else {
|
|
1582
1413
|
this._paginationOptions = newPaginationOptions;
|
|
1583
1414
|
}
|
|
1584
|
-
this.gridOptions.pagination = this._paginationOptions;
|
|
1585
|
-
this.paginationService.updateTotalItems((
|
|
1415
|
+
this.gridOptions.pagination = (_a = this._paginationOptions) !== null && _a !== void 0 ? _a : this.gridOptions.pagination;
|
|
1416
|
+
this.paginationService.updateTotalItems((_c = (_b = this.gridOptions.pagination) === null || _b === void 0 ? void 0 : _b.totalItems) !== null && _c !== void 0 ? _c : 0, true);
|
|
1586
1417
|
},
|
|
1587
1418
|
enumerable: false,
|
|
1588
1419
|
configurable: true
|
|
@@ -1636,7 +1467,7 @@
|
|
|
1636
1467
|
},
|
|
1637
1468
|
set: function (newHierarchicalDataset) {
|
|
1638
1469
|
var _this = this;
|
|
1639
|
-
var _a, _b, _c, _d;
|
|
1470
|
+
var _a, _b, _c, _d, _f;
|
|
1640
1471
|
var isDatasetEqual = lite.dequal(newHierarchicalDataset, (_b = (_a = this.sharedService) === null || _a === void 0 ? void 0 : _a.hierarchicalDataset) !== null && _b !== void 0 ? _b : []);
|
|
1641
1472
|
var prevFlatDatasetLn = this._currentDatasetLength;
|
|
1642
1473
|
this.sharedService.hierarchicalDataset = newHierarchicalDataset;
|
|
@@ -1645,9 +1476,8 @@
|
|
|
1645
1476
|
}
|
|
1646
1477
|
// when a hierarchical dataset is set afterward, we can reset the flat dataset and call a tree data sort that will overwrite the flat dataset
|
|
1647
1478
|
if (newHierarchicalDataset && this.slickGrid && ((_d = this.sortService) === null || _d === void 0 ? void 0 : _d.processTreeDataInitialSort)) {
|
|
1648
|
-
this.dataView.setItems([], this.gridOptions.datasetIdPropertyName);
|
|
1479
|
+
this.dataView.setItems([], (_f = this.gridOptions.datasetIdPropertyName) !== null && _f !== void 0 ? _f : 'id');
|
|
1649
1480
|
this.sortService.processTreeDataInitialSort();
|
|
1650
|
-
this.sortTreeDataset([]);
|
|
1651
1481
|
// we also need to reset/refresh the Tree Data filters because if we inserted new item(s) then it might not show up without doing this refresh
|
|
1652
1482
|
// however we need 1 cpu cycle before having the DataView refreshed, so we need to wrap this check in a setTimeout
|
|
1653
1483
|
setTimeout(function () {
|
|
@@ -1656,8 +1486,8 @@
|
|
|
1656
1486
|
_this.filterService.refreshTreeDataFilters();
|
|
1657
1487
|
}
|
|
1658
1488
|
});
|
|
1489
|
+
this._isDatasetHierarchicalInitialized = true;
|
|
1659
1490
|
}
|
|
1660
|
-
this._isDatasetHierarchicalInitialized = true;
|
|
1661
1491
|
},
|
|
1662
1492
|
enumerable: false,
|
|
1663
1493
|
configurable: true
|
|
@@ -1695,6 +1525,13 @@
|
|
|
1695
1525
|
enumerable: false,
|
|
1696
1526
|
configurable: true
|
|
1697
1527
|
});
|
|
1528
|
+
Object.defineProperty(AngularSlickgridComponent.prototype, "isDatasetHierarchicalInitialized", {
|
|
1529
|
+
set: function (isInitialized) {
|
|
1530
|
+
this._isDatasetHierarchicalInitialized = isInitialized;
|
|
1531
|
+
},
|
|
1532
|
+
enumerable: false,
|
|
1533
|
+
configurable: true
|
|
1534
|
+
});
|
|
1698
1535
|
Object.defineProperty(AngularSlickgridComponent.prototype, "registeredResources", {
|
|
1699
1536
|
get: function () {
|
|
1700
1537
|
return this._registeredResources;
|
|
@@ -1719,7 +1556,7 @@
|
|
|
1719
1556
|
AngularSlickgridComponent.prototype.destroy = function (shouldEmptyDomElementContainer) {
|
|
1720
1557
|
var e_1, _s, e_2, _t, e_3, _u;
|
|
1721
1558
|
if (shouldEmptyDomElementContainer === void 0) { shouldEmptyDomElementContainer = false; }
|
|
1722
|
-
var _a, _b, _c, _d, _f, _g;
|
|
1559
|
+
var _a, _b, _c, _d, _f, _g, _h;
|
|
1723
1560
|
// dispose of all Services
|
|
1724
1561
|
this.serviceList.forEach(function (service) {
|
|
1725
1562
|
if (service && service.dispose) {
|
|
@@ -1738,21 +1575,22 @@
|
|
|
1738
1575
|
this._registeredResources = [];
|
|
1739
1576
|
}
|
|
1740
1577
|
// dispose the Components
|
|
1741
|
-
(_a = this.
|
|
1742
|
-
(_b = this.
|
|
1743
|
-
|
|
1578
|
+
(_a = this.slickEmptyWarning) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
1579
|
+
(_b = this.slickFooter) === null || _b === void 0 ? void 0 : _b.dispose();
|
|
1580
|
+
(_c = this.slickPagination) === null || _c === void 0 ? void 0 : _c.dispose();
|
|
1581
|
+
if ((_d = this._eventHandler) === null || _d === void 0 ? void 0 : _d.unsubscribeAll) {
|
|
1744
1582
|
this._eventHandler.unsubscribeAll();
|
|
1745
1583
|
}
|
|
1746
|
-
(
|
|
1584
|
+
(_f = this._eventPubSubService) === null || _f === void 0 ? void 0 : _f.unsubscribeAll();
|
|
1747
1585
|
if (this.dataView) {
|
|
1748
|
-
if ((
|
|
1586
|
+
if ((_g = this.dataView) === null || _g === void 0 ? void 0 : _g.setItems) {
|
|
1749
1587
|
this.dataView.setItems([]);
|
|
1750
1588
|
}
|
|
1751
1589
|
if (this.dataView.destroy) {
|
|
1752
1590
|
this.dataView.destroy();
|
|
1753
1591
|
}
|
|
1754
1592
|
}
|
|
1755
|
-
if ((
|
|
1593
|
+
if ((_h = this.slickGrid) === null || _h === void 0 ? void 0 : _h.destroy) {
|
|
1756
1594
|
this.slickGrid.destroy(shouldEmptyDomElementContainer);
|
|
1757
1595
|
}
|
|
1758
1596
|
if (this.backendServiceApi) {
|
|
@@ -1837,7 +1675,7 @@
|
|
|
1837
1675
|
}
|
|
1838
1676
|
};
|
|
1839
1677
|
AngularSlickgridComponent.prototype.initialization = function (eventHandler) {
|
|
1840
|
-
var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
1678
|
+
var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
1841
1679
|
this.gridOptions.translater = this.translaterService;
|
|
1842
1680
|
this._eventHandler = eventHandler;
|
|
1843
1681
|
// when detecting a frozen grid, we'll automatically enable the mousewheel scroll handler so that we can scroll from both left/right frozen containers
|
|
@@ -1907,13 +1745,14 @@
|
|
|
1907
1745
|
}
|
|
1908
1746
|
// user could show a custom footer with the data metrics (dataset length and last updated timestamp)
|
|
1909
1747
|
if (!this.gridOptions.enablePagination && this.gridOptions.showCustomFooter && this.gridOptions.customFooterOptions && this.gridContainerElement) {
|
|
1910
|
-
this.slickFooter = new customFooterComponent.SlickFooterComponent(this.slickGrid, this.gridOptions.customFooterOptions, this.translaterService);
|
|
1748
|
+
this.slickFooter = new customFooterComponent.SlickFooterComponent(this.slickGrid, this.gridOptions.customFooterOptions, this._eventPubSubService, this.translaterService);
|
|
1911
1749
|
this.slickFooter.renderFooter(this.gridContainerElement);
|
|
1912
1750
|
}
|
|
1913
1751
|
if (!this.customDataView && this.dataView) {
|
|
1752
|
+
// load the data in the DataView (unless it's a hierarchical dataset, if so it will be loaded after the initial tree sort)
|
|
1914
1753
|
var initialDataset = ((_j = this.gridOptions) === null || _j === void 0 ? void 0 : _j.enableTreeData) ? this.sortTreeDataset(this._dataset) : this._dataset;
|
|
1915
1754
|
this.dataView.beginUpdate();
|
|
1916
|
-
this.dataView.setItems(initialDataset || [], this.gridOptions.datasetIdPropertyName);
|
|
1755
|
+
this.dataView.setItems(initialDataset || [], (_k = this.gridOptions.datasetIdPropertyName) !== null && _k !== void 0 ? _k : 'id');
|
|
1917
1756
|
this.dataView.endUpdate();
|
|
1918
1757
|
// if you don't want the items that are not visible (due to being filtered out or being on a different page)
|
|
1919
1758
|
// to stay selected, pass 'false' to the second arg
|
|
@@ -1963,13 +1802,13 @@
|
|
|
1963
1802
|
this.bindResizeHook(this.slickGrid, this.gridOptions);
|
|
1964
1803
|
// bind the Backend Service API callback functions only after the grid is initialized
|
|
1965
1804
|
// because the preProcess() and onInit() might get triggered
|
|
1966
|
-
if ((
|
|
1805
|
+
if ((_l = this.gridOptions) === null || _l === void 0 ? void 0 : _l.backendServiceApi) {
|
|
1967
1806
|
this.bindBackendCallbackFunctions(this.gridOptions);
|
|
1968
1807
|
}
|
|
1969
1808
|
// local grid, check if we need to show the Pagination
|
|
1970
1809
|
// if so then also check if there's any presets and finally initialize the PaginationService
|
|
1971
1810
|
// a local grid with Pagination presets will potentially have a different total of items, we'll need to get it from the DataView and update our total
|
|
1972
|
-
if (((
|
|
1811
|
+
if (((_m = this.gridOptions) === null || _m === void 0 ? void 0 : _m.enablePagination) && this._isLocalGrid) {
|
|
1973
1812
|
this.showPagination = true;
|
|
1974
1813
|
this.loadLocalGridPagination(this.dataset);
|
|
1975
1814
|
}
|
|
@@ -1977,11 +1816,11 @@
|
|
|
1977
1816
|
// Slick Grid & DataView objects
|
|
1978
1817
|
dataView: this.dataView,
|
|
1979
1818
|
slickGrid: this.slickGrid,
|
|
1980
|
-
extensions: (
|
|
1819
|
+
extensions: (_o = this.extensionService) === null || _o === void 0 ? void 0 : _o.extensionList,
|
|
1981
1820
|
// public methods
|
|
1982
1821
|
destroy: this.destroy.bind(this),
|
|
1983
1822
|
// return all available Services (non-singleton)
|
|
1984
|
-
backendService: (
|
|
1823
|
+
backendService: (_q = (_p = this.gridOptions) === null || _p === void 0 ? void 0 : _p.backendServiceApi) === null || _q === void 0 ? void 0 : _q.service,
|
|
1985
1824
|
filterService: this.filterService,
|
|
1986
1825
|
gridEventService: this.gridEventService,
|
|
1987
1826
|
gridStateService: this.gridStateService,
|
|
@@ -2023,13 +1862,13 @@
|
|
|
2023
1862
|
* @param dataset
|
|
2024
1863
|
*/
|
|
2025
1864
|
AngularSlickgridComponent.prototype.refreshGridData = function (dataset, totalCount) {
|
|
2026
|
-
var _a, _b, _c, _d, _f;
|
|
1865
|
+
var _a, _b, _c, _d, _f, _g;
|
|
2027
1866
|
if (this.gridOptions && this.gridOptions.enableEmptyDataWarningMessage && Array.isArray(dataset)) {
|
|
2028
1867
|
var finalTotalCount = totalCount || dataset.length;
|
|
2029
1868
|
this.displayEmptyDataWarning(finalTotalCount < 1);
|
|
2030
1869
|
}
|
|
2031
1870
|
if (Array.isArray(dataset) && this.slickGrid && ((_a = this.dataView) === null || _a === void 0 ? void 0 : _a.setItems)) {
|
|
2032
|
-
this.dataView.setItems(dataset, this.gridOptions.datasetIdPropertyName);
|
|
1871
|
+
this.dataView.setItems(dataset, (_b = this.gridOptions.datasetIdPropertyName) !== null && _b !== void 0 ? _b : 'id');
|
|
2033
1872
|
if (!this.gridOptions.backendServiceApi && !this.gridOptions.enableTreeData) {
|
|
2034
1873
|
this.dataView.reSort();
|
|
2035
1874
|
}
|
|
@@ -2047,11 +1886,11 @@
|
|
|
2047
1886
|
}
|
|
2048
1887
|
// display the Pagination component only after calling this refresh data first, we call it here so that if we preset pagination page number it will be shown correctly
|
|
2049
1888
|
this.showPagination = (this.gridOptions && (this.gridOptions.enablePagination || (this.gridOptions.backendServiceApi && this.gridOptions.enablePagination === undefined))) ? true : false;
|
|
2050
|
-
if (this._paginationOptions && ((
|
|
1889
|
+
if (this._paginationOptions && ((_c = this.gridOptions) === null || _c === void 0 ? void 0 : _c.pagination) && ((_d = this.gridOptions) === null || _d === void 0 ? void 0 : _d.backendServiceApi)) {
|
|
2051
1890
|
var paginationOptions = this.setPaginationOptionsWhenPresetDefined(this.gridOptions, this._paginationOptions);
|
|
2052
1891
|
// when we have a totalCount use it, else we'll take it from the pagination object
|
|
2053
1892
|
// only update the total items if it's different to avoid refreshing the UI
|
|
2054
|
-
var totalRecords = (totalCount !== undefined) ? totalCount : ((
|
|
1893
|
+
var totalRecords = (totalCount !== undefined) ? totalCount : ((_g = (_f = this.gridOptions) === null || _f === void 0 ? void 0 : _f.pagination) === null || _g === void 0 ? void 0 : _g.totalItems);
|
|
2055
1894
|
if (totalRecords !== undefined && totalRecords !== this.totalItems) {
|
|
2056
1895
|
this.totalItems = +totalRecords;
|
|
2057
1896
|
}
|
|
@@ -2141,9 +1980,10 @@
|
|
|
2141
1980
|
if (gridOptions.enableTranslate) {
|
|
2142
1981
|
this.translateColumnHeaderTitleKeys();
|
|
2143
1982
|
this.translateColumnGroupKeys();
|
|
2144
|
-
this.translateCustomFooterTexts();
|
|
2145
1983
|
}
|
|
2146
1984
|
this.subscriptions.push(this.translate.onLangChange.subscribe(function () {
|
|
1985
|
+
// publish event of the same name that Slickgrid-Universal uses on a language change event
|
|
1986
|
+
_this._eventPubSubService.publish('onLanguageChange');
|
|
2147
1987
|
if (gridOptions.enableTranslate) {
|
|
2148
1988
|
_this.extensionService.translateCellMenu();
|
|
2149
1989
|
_this.extensionService.translateColumnHeaders();
|
|
@@ -2151,7 +1991,6 @@
|
|
|
2151
1991
|
_this.extensionService.translateContextMenu();
|
|
2152
1992
|
_this.extensionService.translateGridMenu();
|
|
2153
1993
|
_this.extensionService.translateHeaderMenu();
|
|
2154
|
-
_this.translateCustomFooterTexts();
|
|
2155
1994
|
_this.translateColumnHeaderTitleKeys();
|
|
2156
1995
|
_this.translateColumnGroupKeys();
|
|
2157
1996
|
if (gridOptions.createPreHeaderPanel && !gridOptions.enableDraggableGrouping) {
|
|
@@ -2160,32 +1999,6 @@
|
|
|
2160
1999
|
}
|
|
2161
2000
|
}));
|
|
2162
2001
|
}
|
|
2163
|
-
if (!this.customDataView) {
|
|
2164
|
-
// bind external sorting (backend) when available or default onSort (dataView)
|
|
2165
|
-
if (gridOptions.enableSorting) {
|
|
2166
|
-
// bind external sorting (backend) unless specified to use the local one
|
|
2167
|
-
if (gridOptions.backendServiceApi && !gridOptions.backendServiceApi.useLocalSorting) {
|
|
2168
|
-
this.sortService.bindBackendOnSort(grid);
|
|
2169
|
-
}
|
|
2170
|
-
else {
|
|
2171
|
-
this.sortService.bindLocalOnSort(grid);
|
|
2172
|
-
}
|
|
2173
|
-
}
|
|
2174
|
-
// bind external filter (backend) when available or default onFilter (dataView)
|
|
2175
|
-
if (gridOptions.enableFiltering) {
|
|
2176
|
-
this.filterService.init(grid);
|
|
2177
|
-
// bind external filter (backend) unless specified to use the local one
|
|
2178
|
-
if (gridOptions.backendServiceApi && !gridOptions.backendServiceApi.useLocalFiltering) {
|
|
2179
|
-
this.filterService.bindBackendOnFilter(grid);
|
|
2180
|
-
}
|
|
2181
|
-
else {
|
|
2182
|
-
this.filterService.bindLocalOnFilter(grid);
|
|
2183
|
-
}
|
|
2184
|
-
}
|
|
2185
|
-
// load any presets if any (after dataset is initialized)
|
|
2186
|
-
this.loadColumnPresetsWhenDatasetInitialized();
|
|
2187
|
-
this.loadFilterPresetsWhenDatasetInitialized();
|
|
2188
|
-
}
|
|
2189
2002
|
// if user set an onInit Backend, we'll run it right away (and if so, we also need to run preProcess, internalPostProcess & postProcess)
|
|
2190
2003
|
if (gridOptions.backendServiceApi) {
|
|
2191
2004
|
var backendApi = gridOptions.backendServiceApi;
|
|
@@ -2227,16 +2040,41 @@
|
|
|
2227
2040
|
this.gridEventService.bindOnCellChange(grid);
|
|
2228
2041
|
this.gridEventService.bindOnClick(grid);
|
|
2229
2042
|
if (dataView && grid) {
|
|
2043
|
+
// bind external sorting (backend) when available or default onSort (dataView)
|
|
2044
|
+
if (gridOptions.enableSorting) {
|
|
2045
|
+
// bind external sorting (backend) unless specified to use the local one
|
|
2046
|
+
if (gridOptions.backendServiceApi && !gridOptions.backendServiceApi.useLocalSorting) {
|
|
2047
|
+
this.sortService.bindBackendOnSort(grid);
|
|
2048
|
+
}
|
|
2049
|
+
else {
|
|
2050
|
+
this.sortService.bindLocalOnSort(grid);
|
|
2051
|
+
}
|
|
2052
|
+
}
|
|
2053
|
+
// bind external filter (backend) when available or default onFilter (dataView)
|
|
2054
|
+
if (gridOptions.enableFiltering) {
|
|
2055
|
+
this.filterService.init(grid);
|
|
2056
|
+
// bind external filter (backend) unless specified to use the local one
|
|
2057
|
+
if (gridOptions.backendServiceApi && !gridOptions.backendServiceApi.useLocalFiltering) {
|
|
2058
|
+
this.filterService.bindBackendOnFilter(grid);
|
|
2059
|
+
}
|
|
2060
|
+
else {
|
|
2061
|
+
this.filterService.bindLocalOnFilter(grid);
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
// load any presets if any (after dataset is initialized)
|
|
2065
|
+
this.loadColumnPresetsWhenDatasetInitialized();
|
|
2066
|
+
this.loadFilterPresetsWhenDatasetInitialized();
|
|
2230
2067
|
// When data changes in the DataView, we need to refresh the metrics and/or display a warning if the dataset is empty
|
|
2231
2068
|
var onRowCountChangedHandler = dataView.onRowCountChanged;
|
|
2232
2069
|
this._eventHandler.subscribe(onRowCountChangedHandler, function (_e, args) {
|
|
2233
2070
|
grid.invalidate();
|
|
2234
|
-
_this.handleOnItemCountChanged(
|
|
2071
|
+
_this.handleOnItemCountChanged(_this.dataView.getFilteredItemCount() || 0, dataView.getItemCount());
|
|
2235
2072
|
});
|
|
2236
2073
|
var onSetItemsCalledHandler = dataView.onSetItemsCalled;
|
|
2237
2074
|
this._eventHandler.subscribe(onSetItemsCalledHandler, function (_e, args) {
|
|
2238
2075
|
var _a;
|
|
2239
|
-
|
|
2076
|
+
grid.invalidate();
|
|
2077
|
+
_this.handleOnItemCountChanged(_this.dataView.getFilteredItemCount(), args.itemCount);
|
|
2240
2078
|
// when user has resize by content enabled, we'll force a full width calculation since we change our entire dataset
|
|
2241
2079
|
if (args.itemCount > 0 && (_this.gridOptions.autosizeColumnsByCellContentOnFirstLoad || _this.gridOptions.enableAutoResizeColumnsByCellContent)) {
|
|
2242
2080
|
_this.resizerService.resizeColumnsByCellContent(!((_a = _this.gridOptions) === null || _a === void 0 ? void 0 : _a.resizeByContentOnlyOnFirstLoad));
|
|
@@ -2256,7 +2094,7 @@
|
|
|
2256
2094
|
});
|
|
2257
2095
|
}
|
|
2258
2096
|
}
|
|
2259
|
-
//
|
|
2097
|
+
// did the user add a colspan callback? If so, hook it into the DataView getItemMetadata
|
|
2260
2098
|
if (gridOptions && gridOptions.colspanCallback && dataView && dataView.getItem && dataView.getItemMetadata) {
|
|
2261
2099
|
dataView.getItemMetadata = function (rowNumber) {
|
|
2262
2100
|
var callbackResult = null;
|
|
@@ -2347,7 +2185,6 @@
|
|
|
2347
2185
|
this.resizerService.resizeGrid();
|
|
2348
2186
|
}
|
|
2349
2187
|
if (options.enableAutoResize) {
|
|
2350
|
-
this.resizerService.bindAutoResizeDataGrid();
|
|
2351
2188
|
if (grid && options.autoFitColumnsOnFirstLoad && options.enableAutoSizeColumns) {
|
|
2352
2189
|
grid.autosizeColumns();
|
|
2353
2190
|
}
|
|
@@ -2399,7 +2236,10 @@
|
|
|
2399
2236
|
if ((_b = _this.gridOptions) === null || _b === void 0 ? void 0 : _b.backendServiceApi) {
|
|
2400
2237
|
(_c = _this.backendUtilityService) === null || _c === void 0 ? void 0 : _c.refreshBackendDataset(_this.gridOptions);
|
|
2401
2238
|
}
|
|
2239
|
+
_this.renderPagination(_this.showPagination);
|
|
2402
2240
|
}));
|
|
2241
|
+
// also initialize (render) the pagination component
|
|
2242
|
+
this.renderPagination();
|
|
2403
2243
|
this._isPaginationInitialized = true;
|
|
2404
2244
|
}
|
|
2405
2245
|
this.cd.detectChanges();
|
|
@@ -2595,6 +2435,27 @@
|
|
|
2595
2435
|
this.paginationService.addRxJsResource(this.rxjs);
|
|
2596
2436
|
this.containerService.registerInstance('RxJsResource', this.rxjs);
|
|
2597
2437
|
};
|
|
2438
|
+
/**
|
|
2439
|
+
* Render (or dispose) the Pagination Component, user can optionally provide False (to not show it) which will in term dispose of the Pagination,
|
|
2440
|
+
* also while disposing we can choose to omit the disposable of the Pagination Service (if we are simply toggling the Pagination, we want to keep the Service alive)
|
|
2441
|
+
* @param {Boolean} showPagination - show (new render) or not (dispose) the Pagination
|
|
2442
|
+
* @param {Boolean} shouldDisposePaginationService - when disposing the Pagination, do we also want to dispose of the Pagination Service? (defaults to True)
|
|
2443
|
+
*/
|
|
2444
|
+
AngularSlickgridComponent.prototype.renderPagination = function (showPagination) {
|
|
2445
|
+
if (showPagination === void 0) { showPagination = true; }
|
|
2446
|
+
var _a;
|
|
2447
|
+
if (((_a = this.gridOptions) === null || _a === void 0 ? void 0 : _a.enablePagination) && !this._isPaginationInitialized && showPagination) {
|
|
2448
|
+
this.slickPagination = new paginationComponent.SlickPaginationComponent(this.paginationService, this._eventPubSubService, this.sharedService, this.translaterService);
|
|
2449
|
+
this.slickPagination.renderPagination(this.gridContainerElement);
|
|
2450
|
+
this._isPaginationInitialized = true;
|
|
2451
|
+
}
|
|
2452
|
+
else if (!showPagination) {
|
|
2453
|
+
if (this.slickPagination) {
|
|
2454
|
+
this.slickPagination.dispose();
|
|
2455
|
+
}
|
|
2456
|
+
this._isPaginationInitialized = false;
|
|
2457
|
+
}
|
|
2458
|
+
};
|
|
2598
2459
|
/**
|
|
2599
2460
|
* Takes a flat dataset with parent/child relationship, sort it (via its tree structure) and return the sorted flat array
|
|
2600
2461
|
* @param {Array<Object>} flatDatasetInput - flat dataset input
|
|
@@ -2651,13 +2512,6 @@
|
|
|
2651
2512
|
return Object.assign(Object.assign({}, column), { editor: column.editor && column.editor.model, internalColumnEditor: Object.assign({}, column.editor) });
|
|
2652
2513
|
});
|
|
2653
2514
|
};
|
|
2654
|
-
/** Translate all Custom Footer Texts (footer with metrics) */
|
|
2655
|
-
AngularSlickgridComponent.prototype.translateCustomFooterTexts = function () {
|
|
2656
|
-
var _a, _b;
|
|
2657
|
-
if (this.slickFooter && ((_a = this.translaterService) === null || _a === void 0 ? void 0 : _a.translate)) {
|
|
2658
|
-
(_b = this.slickFooter) === null || _b === void 0 ? void 0 : _b.translateCustomFooterTexts();
|
|
2659
|
-
}
|
|
2660
|
-
};
|
|
2661
2515
|
AngularSlickgridComponent.prototype.translateColumnHeaderTitleKeys = function () {
|
|
2662
2516
|
// translate all columns (including hidden columns)
|
|
2663
2517
|
this.extensionUtility.translateItems(this.sharedService.allColumns, 'nameKey', 'name');
|
|
@@ -2695,7 +2549,7 @@
|
|
|
2695
2549
|
AngularSlickgridComponent.decorators = [
|
|
2696
2550
|
{ type: core.Component, args: [{
|
|
2697
2551
|
selector: 'angular-slickgrid',
|
|
2698
|
-
template: "<div id=\"slickGridContainer-{{gridId}}\" class=\"gridPane\">\n <div attr.id='{{gridId}}' class=\"slickgrid-container\" style=\"width: 100%\">\n </div>\
|
|
2552
|
+
template: "<div id=\"slickGridContainer-{{gridId}}\" class=\"gridPane\">\r\n <div attr.id='{{gridId}}' class=\"slickgrid-container\" style=\"width: 100%\">\r\n </div>\r\n</div>",
|
|
2699
2553
|
providers: [
|
|
2700
2554
|
// make everything transient (non-singleton)
|
|
2701
2555
|
AngularUtilService,
|
|
@@ -2752,11 +2606,9 @@
|
|
|
2752
2606
|
],
|
|
2753
2607
|
declarations: [
|
|
2754
2608
|
AngularSlickgridComponent,
|
|
2755
|
-
SlickPaginationComponent
|
|
2756
2609
|
],
|
|
2757
2610
|
exports: [
|
|
2758
2611
|
AngularSlickgridComponent,
|
|
2759
|
-
SlickPaginationComponent
|
|
2760
2612
|
],
|
|
2761
2613
|
entryComponents: [AngularSlickgridComponent]
|
|
2762
2614
|
},] }
|
|
@@ -2771,7 +2623,6 @@
|
|
|
2771
2623
|
exports.AngularUtilService = AngularUtilService;
|
|
2772
2624
|
exports.BsDropDownService = BsDropDownService;
|
|
2773
2625
|
exports.RowDetailViewExtension = RowDetailViewExtension;
|
|
2774
|
-
exports.SlickPaginationComponent = SlickPaginationComponent;
|
|
2775
2626
|
exports.SlickgridConfig = SlickgridConfig;
|
|
2776
2627
|
exports.unsubscribeAllObservables = unsubscribeAllObservables;
|
|
2777
2628
|
exports.ɵb = ContainerService;
|