@universis/ngx-tables 0.6.20 → 0.6.21
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/bundles/universis-ngx-tables.umd.js +47 -14
- package/bundles/universis-ngx-tables.umd.js.map +1 -1
- package/bundles/universis-ngx-tables.umd.min.js +1 -1
- package/bundles/universis-ngx-tables.umd.min.js.map +1 -1
- package/esm2015/lib/components/advanced-table/advanced-table.component.js +51 -18
- package/esm5/lib/components/advanced-table/advanced-table.component.js +49 -16
- package/fesm2015/universis-ngx-tables.js +49 -16
- package/fesm2015/universis-ngx-tables.js.map +1 -1
- package/fesm5/universis-ngx-tables.js +47 -14
- package/fesm5/universis-ngx-tables.js.map +1 -1
- package/lib/components/advanced-table/advanced-table.component.d.ts +8 -0
- package/package.json +1 -1
- package/universis-ngx-tables.metadata.json +1 -1
|
@@ -600,6 +600,9 @@ var AdvancedTableComponent = /** @class */ (function () {
|
|
|
600
600
|
this.init = new EventEmitter();
|
|
601
601
|
this.reload = new EventEmitter();
|
|
602
602
|
this.select = new EventEmitter();
|
|
603
|
+
this.draw = new EventEmitter();
|
|
604
|
+
this.page = new EventEmitter();
|
|
605
|
+
this.scroll = new EventEmitter();
|
|
603
606
|
this.selectedItems = new EventEmitter();
|
|
604
607
|
this.scrollable = true;
|
|
605
608
|
this.serverSide = true;
|
|
@@ -1124,6 +1127,20 @@ var AdvancedTableComponent = /** @class */ (function () {
|
|
|
1124
1127
|
}, 0);
|
|
1125
1128
|
}
|
|
1126
1129
|
});
|
|
1130
|
+
tableElement_1.on('draw.dt', function (event) {
|
|
1131
|
+
_this.draw.emit();
|
|
1132
|
+
if (_this.dataTable) {
|
|
1133
|
+
var info = _this.dataTable.page.info();
|
|
1134
|
+
_this.page.emit(info);
|
|
1135
|
+
try {
|
|
1136
|
+
_this.dataTable.columns.adjust();
|
|
1137
|
+
}
|
|
1138
|
+
catch (err) {
|
|
1139
|
+
console.error('ERROR', 'An error occurred while adjusting table columns');
|
|
1140
|
+
console.error(err);
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
});
|
|
1127
1144
|
// allow selection
|
|
1128
1145
|
if (this.selectable) {
|
|
1129
1146
|
// get first column (as row primary key)
|
|
@@ -1148,10 +1165,6 @@ var AdvancedTableComponent = /** @class */ (function () {
|
|
|
1148
1165
|
// user interface additions
|
|
1149
1166
|
// handle page change event (a trick for firing draw.dt events)
|
|
1150
1167
|
tableElement_1
|
|
1151
|
-
// for each page
|
|
1152
|
-
.on('page.dt', function ($event) {
|
|
1153
|
-
var info = _this.dataTable.page.info();
|
|
1154
|
-
})
|
|
1155
1168
|
// handle draw events
|
|
1156
1169
|
.on('draw.dt', function () {
|
|
1157
1170
|
if (_this.customSelect) {
|
|
@@ -1256,7 +1269,7 @@ var AdvancedTableComponent = /** @class */ (function () {
|
|
|
1256
1269
|
// get page size param
|
|
1257
1270
|
var top = aoData[4].value;
|
|
1258
1271
|
// get search value
|
|
1259
|
-
var
|
|
1272
|
+
var search = aoData[5].value;
|
|
1260
1273
|
// get data queryable
|
|
1261
1274
|
var q = self._query instanceof ClientDataQueryable ? self._query : self._context.model(self.config.model).asQueryable();
|
|
1262
1275
|
// apply paging params
|
|
@@ -1383,15 +1396,22 @@ var AdvancedTableComponent = /** @class */ (function () {
|
|
|
1383
1396
|
}
|
|
1384
1397
|
if (this.selectable) ;
|
|
1385
1398
|
// handle init.dt event and emit local event
|
|
1386
|
-
this.dataTable = tableElement_1.
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1399
|
+
this.dataTable = tableElement_1.on('init.dt', function (event) {
|
|
1400
|
+
var scroller = jQuery(event.target).parent();
|
|
1401
|
+
// handle scrolling
|
|
1402
|
+
scroller.on('scroll', function (scrollEvent) {
|
|
1403
|
+
var target = jQuery(scrollEvent.target);
|
|
1404
|
+
var top = target.scrollTop();
|
|
1405
|
+
var left = target.scrollLeft();
|
|
1406
|
+
if (_this.dataTable) {
|
|
1407
|
+
_this.scroll.emit({
|
|
1408
|
+
top: top,
|
|
1409
|
+
left: left
|
|
1410
|
+
});
|
|
1411
|
+
}
|
|
1412
|
+
});
|
|
1413
|
+
_this.init.emit();
|
|
1414
|
+
}).DataTable(settings);
|
|
1395
1415
|
// show or hide header
|
|
1396
1416
|
if (!this.showHeader) {
|
|
1397
1417
|
this._element.nativeElement
|
|
@@ -1410,6 +1430,16 @@ var AdvancedTableComponent = /** @class */ (function () {
|
|
|
1410
1430
|
}
|
|
1411
1431
|
}
|
|
1412
1432
|
};
|
|
1433
|
+
AdvancedTableComponent.prototype.scrollTop = function (value) {
|
|
1434
|
+
if (this.dataTable) {
|
|
1435
|
+
this.dataTable.parent().scrollTop(value);
|
|
1436
|
+
}
|
|
1437
|
+
};
|
|
1438
|
+
AdvancedTableComponent.prototype.scrollLeft = function (value) {
|
|
1439
|
+
if (this.dataTable) {
|
|
1440
|
+
this.dataTable.parent().scrollLeft(value);
|
|
1441
|
+
}
|
|
1442
|
+
};
|
|
1413
1443
|
Object.defineProperty(AdvancedTableComponent.prototype, "lastQuery", {
|
|
1414
1444
|
get: function () {
|
|
1415
1445
|
var _this = this;
|
|
@@ -1640,6 +1670,9 @@ var AdvancedTableComponent = /** @class */ (function () {
|
|
|
1640
1670
|
init: [{ type: Output, args: ['init',] }],
|
|
1641
1671
|
reload: [{ type: Input, args: ['reload',] }],
|
|
1642
1672
|
select: [{ type: Output, args: ['select',] }],
|
|
1673
|
+
draw: [{ type: Output, args: ['draw',] }],
|
|
1674
|
+
page: [{ type: Output, args: ['page',] }],
|
|
1675
|
+
scroll: [{ type: Output, args: ['scroll',] }],
|
|
1643
1676
|
selectedItems: [{ type: Output, args: ['selectedItems',] }],
|
|
1644
1677
|
scrollable: [{ type: Input }],
|
|
1645
1678
|
serverSide: [{ type: Input }],
|