angular-slickgrid 3.1.0 → 3.3.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/README.md +20 -24
- 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 +63 -212
- package/bundles/angular-slickgrid.umd.js.map +1 -1
- package/esm2015/app/modules/angular-slickgrid/components/angular-slickgrid.component.js +56 -36
- package/esm2015/app/modules/angular-slickgrid/extensions/rowDetailViewExtension.js +2 -2
- package/esm2015/app/modules/angular-slickgrid/index.js +1 -2
- package/esm2015/app/modules/angular-slickgrid/modules/angular-slickgrid.module.js +1 -4
- package/fesm2015/angular-slickgrid.js +59 -173
- package/fesm2015/angular-slickgrid.js.map +1 -1
- package/package.json +18 -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;
|
|
@@ -596,7 +596,7 @@
|
|
|
596
596
|
return subscriptions;
|
|
597
597
|
}
|
|
598
598
|
|
|
599
|
-
var DOMPurify = DOMPurify___namespace; // patch to fix rollup to work
|
|
599
|
+
var DOMPurify = DOMPurify___namespace['default'] || DOMPurify___namespace; // patch to fix rollup to work
|
|
600
600
|
var ROW_DETAIL_CONTAINER_PREFIX = 'container_';
|
|
601
601
|
var PRELOAD_CONTAINER_PREFIX = 'container_loading';
|
|
602
602
|
var RowDetailViewExtension = /** @class */ (function () {
|
|
@@ -1310,176 +1310,6 @@
|
|
|
1310
1310
|
Constants.VALIDATION_EDITOR_TEXT_MIN_LENGTH = 'Please make sure your text is more than {{minLength}} character(s)';
|
|
1311
1311
|
Constants.VALIDATION_EDITOR_TEXT_MIN_LENGTH_INCLUSIVE = 'Please make sure your text is at least {{minLength}} character(s)';
|
|
1312
1312
|
|
|
1313
|
-
var SlickPaginationComponent = /** @class */ (function () {
|
|
1314
|
-
/** Constructor */
|
|
1315
|
-
function SlickPaginationComponent(translate) {
|
|
1316
|
-
this.translate = translate;
|
|
1317
|
-
this.subscriptions = [];
|
|
1318
|
-
this._enableTranslate = false;
|
|
1319
|
-
// text translations (handled by ngx-translate or by custom locale)
|
|
1320
|
-
this.textItemsPerPage = 'items per page';
|
|
1321
|
-
this.textItems = 'items';
|
|
1322
|
-
this.textOf = 'of';
|
|
1323
|
-
this.textPage = 'Page';
|
|
1324
|
-
}
|
|
1325
|
-
Object.defineProperty(SlickPaginationComponent.prototype, "availablePageSizes", {
|
|
1326
|
-
get: function () {
|
|
1327
|
-
return this.paginationService.availablePageSizes;
|
|
1328
|
-
},
|
|
1329
|
-
enumerable: false,
|
|
1330
|
-
configurable: true
|
|
1331
|
-
});
|
|
1332
|
-
Object.defineProperty(SlickPaginationComponent.prototype, "dataFrom", {
|
|
1333
|
-
get: function () {
|
|
1334
|
-
return this.paginationService.dataFrom;
|
|
1335
|
-
},
|
|
1336
|
-
enumerable: false,
|
|
1337
|
-
configurable: true
|
|
1338
|
-
});
|
|
1339
|
-
Object.defineProperty(SlickPaginationComponent.prototype, "dataTo", {
|
|
1340
|
-
get: function () {
|
|
1341
|
-
return this.paginationService.dataTo;
|
|
1342
|
-
},
|
|
1343
|
-
enumerable: false,
|
|
1344
|
-
configurable: true
|
|
1345
|
-
});
|
|
1346
|
-
Object.defineProperty(SlickPaginationComponent.prototype, "isLeftPaginationDisabled", {
|
|
1347
|
-
/** is the left side pagination disabled? */
|
|
1348
|
-
get: function () {
|
|
1349
|
-
return this.pageNumber === 1 || this.totalItems === 0;
|
|
1350
|
-
},
|
|
1351
|
-
enumerable: false,
|
|
1352
|
-
configurable: true
|
|
1353
|
-
});
|
|
1354
|
-
Object.defineProperty(SlickPaginationComponent.prototype, "isRightPaginationDisabled", {
|
|
1355
|
-
/** is the right side pagination disabled? */
|
|
1356
|
-
get: function () {
|
|
1357
|
-
return this.pageNumber === this.pageCount || this.totalItems === 0;
|
|
1358
|
-
},
|
|
1359
|
-
enumerable: false,
|
|
1360
|
-
configurable: true
|
|
1361
|
-
});
|
|
1362
|
-
Object.defineProperty(SlickPaginationComponent.prototype, "itemsPerPage", {
|
|
1363
|
-
get: function () {
|
|
1364
|
-
return this.paginationService.itemsPerPage;
|
|
1365
|
-
},
|
|
1366
|
-
enumerable: false,
|
|
1367
|
-
configurable: true
|
|
1368
|
-
});
|
|
1369
|
-
Object.defineProperty(SlickPaginationComponent.prototype, "pageCount", {
|
|
1370
|
-
get: function () {
|
|
1371
|
-
return this.paginationService.pageCount;
|
|
1372
|
-
},
|
|
1373
|
-
enumerable: false,
|
|
1374
|
-
configurable: true
|
|
1375
|
-
});
|
|
1376
|
-
Object.defineProperty(SlickPaginationComponent.prototype, "pageNumber", {
|
|
1377
|
-
get: function () {
|
|
1378
|
-
return this.paginationService.pageNumber;
|
|
1379
|
-
},
|
|
1380
|
-
set: function (page) {
|
|
1381
|
-
// 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
|
|
1382
|
-
},
|
|
1383
|
-
enumerable: false,
|
|
1384
|
-
configurable: true
|
|
1385
|
-
});
|
|
1386
|
-
Object.defineProperty(SlickPaginationComponent.prototype, "totalItems", {
|
|
1387
|
-
get: function () {
|
|
1388
|
-
return this.paginationService.totalItems;
|
|
1389
|
-
},
|
|
1390
|
-
enumerable: false,
|
|
1391
|
-
configurable: true
|
|
1392
|
-
});
|
|
1393
|
-
SlickPaginationComponent.prototype.ngOnDestroy = function () {
|
|
1394
|
-
this.dispose();
|
|
1395
|
-
};
|
|
1396
|
-
SlickPaginationComponent.prototype.ngOnInit = function () {
|
|
1397
|
-
var _this = this;
|
|
1398
|
-
this._gridOptions = this.gridOptions || {};
|
|
1399
|
-
this._enableTranslate = this._gridOptions && this._gridOptions.enableTranslate || false;
|
|
1400
|
-
this._locales = this._gridOptions && this._gridOptions.locales || Constants.locales;
|
|
1401
|
-
if (this._enableTranslate && !this.translate) {
|
|
1402
|
-
throw new Error('[Angular-Slickgrid] requires "ngx-translate" to be installed and configured when the grid option "enableTranslate" is enabled.');
|
|
1403
|
-
}
|
|
1404
|
-
this.translateAllUiTexts(this._locales);
|
|
1405
|
-
// translate all the text using ngx-translate or custom locales
|
|
1406
|
-
if (this._enableTranslate && this.translate && this.translate.onLangChange) {
|
|
1407
|
-
this.subscriptions.push(this.translate.onLangChange.subscribe(function () { return _this.translateAllUiTexts(_this._locales); }));
|
|
1408
|
-
}
|
|
1409
|
-
};
|
|
1410
|
-
SlickPaginationComponent.prototype.changeToFirstPage = function (event) {
|
|
1411
|
-
if (!this.isLeftPaginationDisabled) {
|
|
1412
|
-
this.paginationService.goToFirstPage(event);
|
|
1413
|
-
}
|
|
1414
|
-
};
|
|
1415
|
-
SlickPaginationComponent.prototype.changeToLastPage = function (event) {
|
|
1416
|
-
if (!this.isRightPaginationDisabled) {
|
|
1417
|
-
this.paginationService.goToLastPage(event);
|
|
1418
|
-
}
|
|
1419
|
-
};
|
|
1420
|
-
SlickPaginationComponent.prototype.changeToNextPage = function (event) {
|
|
1421
|
-
if (!this.isRightPaginationDisabled) {
|
|
1422
|
-
this.paginationService.goToNextPage(event);
|
|
1423
|
-
}
|
|
1424
|
-
};
|
|
1425
|
-
SlickPaginationComponent.prototype.changeToPreviousPage = function (event) {
|
|
1426
|
-
if (!this.isLeftPaginationDisabled) {
|
|
1427
|
-
this.paginationService.goToPreviousPage(event);
|
|
1428
|
-
}
|
|
1429
|
-
};
|
|
1430
|
-
SlickPaginationComponent.prototype.changeToCurrentPage = function (event) {
|
|
1431
|
-
var pageNumber = 1;
|
|
1432
|
-
if (event && event.currentTarget && event.currentTarget.value) {
|
|
1433
|
-
pageNumber = +(event.currentTarget.value);
|
|
1434
|
-
}
|
|
1435
|
-
this.paginationService.goToPageNumber(pageNumber, event);
|
|
1436
|
-
};
|
|
1437
|
-
SlickPaginationComponent.prototype.changeItemPerPage = function (event) {
|
|
1438
|
-
var itemsPerPage = 1;
|
|
1439
|
-
if (event && event.currentTarget && event.currentTarget.value) {
|
|
1440
|
-
itemsPerPage = +(event.currentTarget.value);
|
|
1441
|
-
}
|
|
1442
|
-
this.paginationService.changeItemPerPage(itemsPerPage, event);
|
|
1443
|
-
};
|
|
1444
|
-
SlickPaginationComponent.prototype.dispose = function () {
|
|
1445
|
-
// also unsubscribe all Angular Subscriptions
|
|
1446
|
-
this.subscriptions = unsubscribeAllObservables(this.subscriptions);
|
|
1447
|
-
};
|
|
1448
|
-
// --
|
|
1449
|
-
// private functions
|
|
1450
|
-
// --------------------
|
|
1451
|
-
/** Translate all the texts shown in the UI, use ngx-translate service when available or custom locales when service is null */
|
|
1452
|
-
SlickPaginationComponent.prototype.translateAllUiTexts = function (locales) {
|
|
1453
|
-
if (this._enableTranslate && this.translate && this.translate.instant && this.translate.currentLang) {
|
|
1454
|
-
var translationPrefix = common.getTranslationPrefix(this._gridOptions);
|
|
1455
|
-
this.textItemsPerPage = this.translate.instant(translationPrefix + "ITEMS_PER_PAGE");
|
|
1456
|
-
this.textItems = this.translate.instant(translationPrefix + "ITEMS");
|
|
1457
|
-
this.textOf = this.translate.instant(translationPrefix + "OF");
|
|
1458
|
-
this.textPage = this.translate.instant(translationPrefix + "PAGE");
|
|
1459
|
-
}
|
|
1460
|
-
else if (locales) {
|
|
1461
|
-
this.textItemsPerPage = locales.TEXT_ITEMS_PER_PAGE || 'TEXT_ITEMS_PER_PAGE';
|
|
1462
|
-
this.textItems = locales.TEXT_ITEMS || 'TEXT_ITEMS';
|
|
1463
|
-
this.textOf = locales.TEXT_OF || 'TEXT_OF';
|
|
1464
|
-
this.textPage = locales.TEXT_PAGE || 'TEXT_PAGE';
|
|
1465
|
-
}
|
|
1466
|
-
};
|
|
1467
|
-
return SlickPaginationComponent;
|
|
1468
|
-
}());
|
|
1469
|
-
SlickPaginationComponent.decorators = [
|
|
1470
|
-
{ type: core.Component, args: [{
|
|
1471
|
-
selector: 'slick-pagination',
|
|
1472
|
-
template: "<div class=\"slick-pagination\">\r\n <div class=\"slick-pagination-nav\">\r\n <nav aria-label=\"Page navigation\">\r\n <ul class=\"pagination\">\r\n <li class=\"page-item\" [ngClass]=\"isLeftPaginationDisabled ? 'disabled' : ''\">\r\n <a class=\"page-link icon-seek-first fa fa-angle-double-left\" aria-label=\"First\"\r\n (click)=\"changeToFirstPage($event)\">\r\n </a>\r\n </li>\r\n <li class=\"page-item\" [ngClass]=\"isLeftPaginationDisabled ? 'disabled' : ''\">\r\n <a class=\"page-link icon-seek-prev fa fa-angle-left\" aria-label=\"Previous\"\r\n (click)=\"changeToPreviousPage($event)\">\r\n </a>\r\n </li>\r\n </ul>\r\n </nav>\r\n\r\n <div class=\"slick-page-number\">\r\n <span>{{textPage}}</span>\r\n <input type=\"text\" class=\"form-control\" data-test=\"page-number-input\" [value]=\"pageNumber\" size=\"1\"\r\n [readOnly]=\"totalItems === 0\" (change)=\"changeToCurrentPage($event)\">\r\n <span>{{textOf}}</span><span data-test=\"page-count\"> {{pageCount}}</span>\r\n </div>\r\n\r\n <nav aria-label=\"Page navigation\">\r\n <ul class=\"pagination\">\r\n <li class=\"page-item\" [ngClass]=\"isRightPaginationDisabled ? 'disabled' : ''\">\r\n <a class=\"page-link icon-seek-next text-center fa fa-lg fa-angle-right\" aria-label=\"Next\"\r\n (click)=\"changeToNextPage($event)\">\r\n </a>\r\n </li>\r\n <li class=\"page-item\" [ngClass]=\"isRightPaginationDisabled ? 'disabled' : ''\">\r\n <a class=\"page-link icon-seek-end fa fa-lg fa-angle-double-right\" aria-label=\"Last\"\r\n (click)=\"changeToLastPage($event)\">\r\n </a>\r\n </li>\r\n </ul>\r\n </nav>\r\n </div>\r\n <span class=\"slick-pagination-settings\">\r\n <select id=\"items-per-page-label\" (change)=\"changeItemPerPage($event)\">\r\n <option value=\"{{pageSize}}\" [selected]=\"pageSize === itemsPerPage\" *ngFor=\"let pageSize of availablePageSizes\">{{pageSize}}</option>\r\n </select>\r\n <span>{{textItemsPerPage}}</span>,\r\n <span class=\"slick-pagination-count\">\r\n <span *ngIf=\"totalItems\">\r\n <span class=\"page-info-from-to\">\r\n <span data-test=\"item-from\">{{dataFrom}}</span>-<span data-test=\"item-to\">{{dataTo}}</span>\r\n {{textOf}}\r\n </span>\r\n </span>\r\n <span class=\"page-info-total-items\">\r\n <span data-test=\"total-items\">{{totalItems}}</span> {{textItems}}\r\n </span>\r\n </span>\r\n </span>\r\n</div>\r\n"
|
|
1473
|
-
},] }
|
|
1474
|
-
];
|
|
1475
|
-
SlickPaginationComponent.ctorParameters = function () { return [
|
|
1476
|
-
{ type: core$1.TranslateService, decorators: [{ type: core.Optional }] }
|
|
1477
|
-
]; };
|
|
1478
|
-
SlickPaginationComponent.propDecorators = {
|
|
1479
|
-
gridOptions: [{ type: core.Input }],
|
|
1480
|
-
paginationService: [{ type: core.Input }]
|
|
1481
|
-
};
|
|
1482
|
-
|
|
1483
1313
|
var AngularSlickgridComponent = /** @class */ (function () {
|
|
1484
1314
|
function AngularSlickgridComponent(angularUtilService, appRef, cd, containerService, elm, translate, translaterService, forRootConfig, externalServices) {
|
|
1485
1315
|
var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
@@ -1529,7 +1359,7 @@
|
|
|
1529
1359
|
var columnPickerExtension = new common.ColumnPickerExtension(this.extensionUtility, this.sharedService);
|
|
1530
1360
|
var checkboxExtension = new common.CheckboxSelectorExtension(this.sharedService);
|
|
1531
1361
|
var draggableGroupingExtension = new common.DraggableGroupingExtension(this.extensionUtility, this._eventPubSubService, this.sharedService);
|
|
1532
|
-
var gridMenuExtension = new common.GridMenuExtension(this.extensionUtility, this.filterService, this.sharedService, this.sortService, this.backendUtilityService, this.translaterService);
|
|
1362
|
+
var gridMenuExtension = new common.GridMenuExtension(this.extensionUtility, this.filterService, this._eventPubSubService, this.sharedService, this.sortService, this.backendUtilityService, this.translaterService);
|
|
1533
1363
|
var groupItemMetaProviderExtension = new common.GroupItemMetaProviderExtension(this.sharedService);
|
|
1534
1364
|
var headerButtonExtension = new common.HeaderButtonExtension(this.extensionUtility, this.sharedService);
|
|
1535
1365
|
var headerMenuExtension = new common.HeaderMenuExtension(this.extensionUtility, this.filterService, this._eventPubSubService, this.sharedService, this.sortService, this.translaterService);
|
|
@@ -1637,7 +1467,7 @@
|
|
|
1637
1467
|
},
|
|
1638
1468
|
set: function (newHierarchicalDataset) {
|
|
1639
1469
|
var _this = this;
|
|
1640
|
-
var _a, _b, _c, _d;
|
|
1470
|
+
var _a, _b, _c, _d, _f;
|
|
1641
1471
|
var isDatasetEqual = lite.dequal(newHierarchicalDataset, (_b = (_a = this.sharedService) === null || _a === void 0 ? void 0 : _a.hierarchicalDataset) !== null && _b !== void 0 ? _b : []);
|
|
1642
1472
|
var prevFlatDatasetLn = this._currentDatasetLength;
|
|
1643
1473
|
this.sharedService.hierarchicalDataset = newHierarchicalDataset;
|
|
@@ -1646,9 +1476,8 @@
|
|
|
1646
1476
|
}
|
|
1647
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
|
|
1648
1478
|
if (newHierarchicalDataset && this.slickGrid && ((_d = this.sortService) === null || _d === void 0 ? void 0 : _d.processTreeDataInitialSort)) {
|
|
1649
|
-
this.dataView.setItems([], this.gridOptions.datasetIdPropertyName);
|
|
1479
|
+
this.dataView.setItems([], (_f = this.gridOptions.datasetIdPropertyName) !== null && _f !== void 0 ? _f : 'id');
|
|
1650
1480
|
this.sortService.processTreeDataInitialSort();
|
|
1651
|
-
this.sortTreeDataset([]);
|
|
1652
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
|
|
1653
1482
|
// however we need 1 cpu cycle before having the DataView refreshed, so we need to wrap this check in a setTimeout
|
|
1654
1483
|
setTimeout(function () {
|
|
@@ -1657,8 +1486,8 @@
|
|
|
1657
1486
|
_this.filterService.refreshTreeDataFilters();
|
|
1658
1487
|
}
|
|
1659
1488
|
});
|
|
1489
|
+
this._isDatasetHierarchicalInitialized = true;
|
|
1660
1490
|
}
|
|
1661
|
-
this._isDatasetHierarchicalInitialized = true;
|
|
1662
1491
|
},
|
|
1663
1492
|
enumerable: false,
|
|
1664
1493
|
configurable: true
|
|
@@ -1696,6 +1525,13 @@
|
|
|
1696
1525
|
enumerable: false,
|
|
1697
1526
|
configurable: true
|
|
1698
1527
|
});
|
|
1528
|
+
Object.defineProperty(AngularSlickgridComponent.prototype, "isDatasetHierarchicalInitialized", {
|
|
1529
|
+
set: function (isInitialized) {
|
|
1530
|
+
this._isDatasetHierarchicalInitialized = isInitialized;
|
|
1531
|
+
},
|
|
1532
|
+
enumerable: false,
|
|
1533
|
+
configurable: true
|
|
1534
|
+
});
|
|
1699
1535
|
Object.defineProperty(AngularSlickgridComponent.prototype, "registeredResources", {
|
|
1700
1536
|
get: function () {
|
|
1701
1537
|
return this._registeredResources;
|
|
@@ -1720,7 +1556,7 @@
|
|
|
1720
1556
|
AngularSlickgridComponent.prototype.destroy = function (shouldEmptyDomElementContainer) {
|
|
1721
1557
|
var e_1, _s, e_2, _t, e_3, _u;
|
|
1722
1558
|
if (shouldEmptyDomElementContainer === void 0) { shouldEmptyDomElementContainer = false; }
|
|
1723
|
-
var _a, _b, _c, _d, _f, _g;
|
|
1559
|
+
var _a, _b, _c, _d, _f, _g, _h;
|
|
1724
1560
|
// dispose of all Services
|
|
1725
1561
|
this.serviceList.forEach(function (service) {
|
|
1726
1562
|
if (service && service.dispose) {
|
|
@@ -1739,21 +1575,22 @@
|
|
|
1739
1575
|
this._registeredResources = [];
|
|
1740
1576
|
}
|
|
1741
1577
|
// dispose the Components
|
|
1742
|
-
(_a = this.
|
|
1743
|
-
(_b = this.
|
|
1744
|
-
|
|
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) {
|
|
1745
1582
|
this._eventHandler.unsubscribeAll();
|
|
1746
1583
|
}
|
|
1747
|
-
(
|
|
1584
|
+
(_f = this._eventPubSubService) === null || _f === void 0 ? void 0 : _f.unsubscribeAll();
|
|
1748
1585
|
if (this.dataView) {
|
|
1749
|
-
if ((
|
|
1586
|
+
if ((_g = this.dataView) === null || _g === void 0 ? void 0 : _g.setItems) {
|
|
1750
1587
|
this.dataView.setItems([]);
|
|
1751
1588
|
}
|
|
1752
1589
|
if (this.dataView.destroy) {
|
|
1753
1590
|
this.dataView.destroy();
|
|
1754
1591
|
}
|
|
1755
1592
|
}
|
|
1756
|
-
if ((
|
|
1593
|
+
if ((_h = this.slickGrid) === null || _h === void 0 ? void 0 : _h.destroy) {
|
|
1757
1594
|
this.slickGrid.destroy(shouldEmptyDomElementContainer);
|
|
1758
1595
|
}
|
|
1759
1596
|
if (this.backendServiceApi) {
|
|
@@ -1838,7 +1675,7 @@
|
|
|
1838
1675
|
}
|
|
1839
1676
|
};
|
|
1840
1677
|
AngularSlickgridComponent.prototype.initialization = function (eventHandler) {
|
|
1841
|
-
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;
|
|
1842
1679
|
this.gridOptions.translater = this.translaterService;
|
|
1843
1680
|
this._eventHandler = eventHandler;
|
|
1844
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
|
|
@@ -1908,13 +1745,14 @@
|
|
|
1908
1745
|
}
|
|
1909
1746
|
// user could show a custom footer with the data metrics (dataset length and last updated timestamp)
|
|
1910
1747
|
if (!this.gridOptions.enablePagination && this.gridOptions.showCustomFooter && this.gridOptions.customFooterOptions && this.gridContainerElement) {
|
|
1911
|
-
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);
|
|
1912
1749
|
this.slickFooter.renderFooter(this.gridContainerElement);
|
|
1913
1750
|
}
|
|
1914
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)
|
|
1915
1753
|
var initialDataset = ((_j = this.gridOptions) === null || _j === void 0 ? void 0 : _j.enableTreeData) ? this.sortTreeDataset(this._dataset) : this._dataset;
|
|
1916
1754
|
this.dataView.beginUpdate();
|
|
1917
|
-
this.dataView.setItems(initialDataset || [], this.gridOptions.datasetIdPropertyName);
|
|
1755
|
+
this.dataView.setItems(initialDataset || [], (_k = this.gridOptions.datasetIdPropertyName) !== null && _k !== void 0 ? _k : 'id');
|
|
1918
1756
|
this.dataView.endUpdate();
|
|
1919
1757
|
// if you don't want the items that are not visible (due to being filtered out or being on a different page)
|
|
1920
1758
|
// to stay selected, pass 'false' to the second arg
|
|
@@ -1964,13 +1802,13 @@
|
|
|
1964
1802
|
this.bindResizeHook(this.slickGrid, this.gridOptions);
|
|
1965
1803
|
// bind the Backend Service API callback functions only after the grid is initialized
|
|
1966
1804
|
// because the preProcess() and onInit() might get triggered
|
|
1967
|
-
if ((
|
|
1805
|
+
if ((_l = this.gridOptions) === null || _l === void 0 ? void 0 : _l.backendServiceApi) {
|
|
1968
1806
|
this.bindBackendCallbackFunctions(this.gridOptions);
|
|
1969
1807
|
}
|
|
1970
1808
|
// local grid, check if we need to show the Pagination
|
|
1971
1809
|
// if so then also check if there's any presets and finally initialize the PaginationService
|
|
1972
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
|
|
1973
|
-
if (((
|
|
1811
|
+
if (((_m = this.gridOptions) === null || _m === void 0 ? void 0 : _m.enablePagination) && this._isLocalGrid) {
|
|
1974
1812
|
this.showPagination = true;
|
|
1975
1813
|
this.loadLocalGridPagination(this.dataset);
|
|
1976
1814
|
}
|
|
@@ -1978,11 +1816,11 @@
|
|
|
1978
1816
|
// Slick Grid & DataView objects
|
|
1979
1817
|
dataView: this.dataView,
|
|
1980
1818
|
slickGrid: this.slickGrid,
|
|
1981
|
-
extensions: (
|
|
1819
|
+
extensions: (_o = this.extensionService) === null || _o === void 0 ? void 0 : _o.extensionList,
|
|
1982
1820
|
// public methods
|
|
1983
1821
|
destroy: this.destroy.bind(this),
|
|
1984
1822
|
// return all available Services (non-singleton)
|
|
1985
|
-
backendService: (
|
|
1823
|
+
backendService: (_q = (_p = this.gridOptions) === null || _p === void 0 ? void 0 : _p.backendServiceApi) === null || _q === void 0 ? void 0 : _q.service,
|
|
1986
1824
|
filterService: this.filterService,
|
|
1987
1825
|
gridEventService: this.gridEventService,
|
|
1988
1826
|
gridStateService: this.gridStateService,
|
|
@@ -2024,13 +1862,13 @@
|
|
|
2024
1862
|
* @param dataset
|
|
2025
1863
|
*/
|
|
2026
1864
|
AngularSlickgridComponent.prototype.refreshGridData = function (dataset, totalCount) {
|
|
2027
|
-
var _a, _b, _c, _d, _f;
|
|
1865
|
+
var _a, _b, _c, _d, _f, _g;
|
|
2028
1866
|
if (this.gridOptions && this.gridOptions.enableEmptyDataWarningMessage && Array.isArray(dataset)) {
|
|
2029
1867
|
var finalTotalCount = totalCount || dataset.length;
|
|
2030
1868
|
this.displayEmptyDataWarning(finalTotalCount < 1);
|
|
2031
1869
|
}
|
|
2032
1870
|
if (Array.isArray(dataset) && this.slickGrid && ((_a = this.dataView) === null || _a === void 0 ? void 0 : _a.setItems)) {
|
|
2033
|
-
this.dataView.setItems(dataset, this.gridOptions.datasetIdPropertyName);
|
|
1871
|
+
this.dataView.setItems(dataset, (_b = this.gridOptions.datasetIdPropertyName) !== null && _b !== void 0 ? _b : 'id');
|
|
2034
1872
|
if (!this.gridOptions.backendServiceApi && !this.gridOptions.enableTreeData) {
|
|
2035
1873
|
this.dataView.reSort();
|
|
2036
1874
|
}
|
|
@@ -2048,11 +1886,11 @@
|
|
|
2048
1886
|
}
|
|
2049
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
|
|
2050
1888
|
this.showPagination = (this.gridOptions && (this.gridOptions.enablePagination || (this.gridOptions.backendServiceApi && this.gridOptions.enablePagination === undefined))) ? true : false;
|
|
2051
|
-
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)) {
|
|
2052
1890
|
var paginationOptions = this.setPaginationOptionsWhenPresetDefined(this.gridOptions, this._paginationOptions);
|
|
2053
1891
|
// when we have a totalCount use it, else we'll take it from the pagination object
|
|
2054
1892
|
// only update the total items if it's different to avoid refreshing the UI
|
|
2055
|
-
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);
|
|
2056
1894
|
if (totalRecords !== undefined && totalRecords !== this.totalItems) {
|
|
2057
1895
|
this.totalItems = +totalRecords;
|
|
2058
1896
|
}
|
|
@@ -2142,9 +1980,10 @@
|
|
|
2142
1980
|
if (gridOptions.enableTranslate) {
|
|
2143
1981
|
this.translateColumnHeaderTitleKeys();
|
|
2144
1982
|
this.translateColumnGroupKeys();
|
|
2145
|
-
this.translateCustomFooterTexts();
|
|
2146
1983
|
}
|
|
2147
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');
|
|
2148
1987
|
if (gridOptions.enableTranslate) {
|
|
2149
1988
|
_this.extensionService.translateCellMenu();
|
|
2150
1989
|
_this.extensionService.translateColumnHeaders();
|
|
@@ -2152,7 +1991,6 @@
|
|
|
2152
1991
|
_this.extensionService.translateContextMenu();
|
|
2153
1992
|
_this.extensionService.translateGridMenu();
|
|
2154
1993
|
_this.extensionService.translateHeaderMenu();
|
|
2155
|
-
_this.translateCustomFooterTexts();
|
|
2156
1994
|
_this.translateColumnHeaderTitleKeys();
|
|
2157
1995
|
_this.translateColumnGroupKeys();
|
|
2158
1996
|
if (gridOptions.createPreHeaderPanel && !gridOptions.enableDraggableGrouping) {
|
|
@@ -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\">\r\n <div attr.id='{{gridId}}' class=\"slickgrid-container\" style=\"width: 100%\">\r\n </div>\r\n
|
|
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;
|