@den4ik92/ng2-smart-table 2.0.2 → 2.0.4
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/esm2020/lib/lib/data-set/data-set.mjs +4 -6
- package/esm2020/lib/lib/grid.mjs +1 -1
- package/esm2020/lib/lib/interfaces/smart-table.models.mjs +1 -1
- package/esm2020/lib/ng2-smart-table.component.mjs +4 -17
- package/fesm2015/den4ik92-ng2-smart-table.mjs +6 -21
- package/fesm2015/den4ik92-ng2-smart-table.mjs.map +1 -1
- package/fesm2020/den4ik92-ng2-smart-table.mjs +6 -21
- package/fesm2020/den4ik92-ng2-smart-table.mjs.map +1 -1
- package/lib/lib/data-set/data-set.d.ts +3 -3
- package/lib/lib/interfaces/smart-table.models.d.ts +3 -5
- package/lib/ng2-smart-table.component.d.ts +1 -6
- package/package.json +1 -1
|
@@ -316,11 +316,9 @@ class DataSet {
|
|
|
316
316
|
* @private
|
|
317
317
|
*/
|
|
318
318
|
createColumns(settings) {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
}
|
|
323
|
-
}
|
|
319
|
+
settings.forEach((columnSettings) => {
|
|
320
|
+
this.columns.push(new Column(columnSettings.key, columnSettings, this));
|
|
321
|
+
});
|
|
324
322
|
}
|
|
325
323
|
/**
|
|
326
324
|
* Create rows based on current data prepared in data source
|
|
@@ -2961,7 +2959,6 @@ class Ng2SmartTableComponent {
|
|
|
2961
2959
|
constructor() {
|
|
2962
2960
|
this.multiRowSelect = new EventEmitter();
|
|
2963
2961
|
this.rowClicked = new EventEmitter();
|
|
2964
|
-
this.listScrollEnd = new EventEmitter();
|
|
2965
2962
|
this.delete = new EventEmitter();
|
|
2966
2963
|
this.edit = new EventEmitter();
|
|
2967
2964
|
this.editCancel = new EventEmitter();
|
|
@@ -2978,13 +2975,11 @@ class Ng2SmartTableComponent {
|
|
|
2978
2975
|
this.isHideSubHeader = false;
|
|
2979
2976
|
this.isPagerDisplay = false;
|
|
2980
2977
|
this.rowClassFunction = () => '';
|
|
2981
|
-
this.currentScrollTop = 0;
|
|
2982
2978
|
this.defaultSettings = {
|
|
2983
2979
|
mode: 'inline',
|
|
2984
2980
|
selectMode: 'single',
|
|
2985
2981
|
selectedRowIndex: -1,
|
|
2986
2982
|
switchPageToSelectedRowPage: false,
|
|
2987
|
-
bodyHeight: '85vh',
|
|
2988
2983
|
hideHeader: false,
|
|
2989
2984
|
hideSubHeader: false,
|
|
2990
2985
|
actions: {
|
|
@@ -3021,7 +3016,7 @@ class Ng2SmartTableComponent {
|
|
|
3021
3016
|
class: '',
|
|
3022
3017
|
},
|
|
3023
3018
|
noDataMessage: 'No data found',
|
|
3024
|
-
columns:
|
|
3019
|
+
columns: [],
|
|
3025
3020
|
pager: false,
|
|
3026
3021
|
rowClassFunction: () => '',
|
|
3027
3022
|
};
|
|
@@ -3065,14 +3060,6 @@ class Ng2SmartTableComponent {
|
|
|
3065
3060
|
source: this.source,
|
|
3066
3061
|
});
|
|
3067
3062
|
}
|
|
3068
|
-
onScroll(event) {
|
|
3069
|
-
const { scrollHeight, scrollTop, clientHeight } = event.target;
|
|
3070
|
-
const isListEnd = (clientHeight + Math.round(scrollTop)) >= scrollHeight;
|
|
3071
|
-
if (isListEnd && this.currentScrollTop < scrollTop) {
|
|
3072
|
-
this.listScrollEnd.emit(true);
|
|
3073
|
-
}
|
|
3074
|
-
this.currentScrollTop = scrollTop;
|
|
3075
|
-
}
|
|
3076
3063
|
initGrid() {
|
|
3077
3064
|
this.source = this.prepareSource();
|
|
3078
3065
|
this.grid = new Grid(this.source, this.prepareSettings());
|
|
@@ -3096,10 +3083,10 @@ class Ng2SmartTableComponent {
|
|
|
3096
3083
|
}
|
|
3097
3084
|
}
|
|
3098
3085
|
Ng2SmartTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: Ng2SmartTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3099
|
-
Ng2SmartTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: Ng2SmartTableComponent, selector: "ng2-smart-table", inputs: { source: "source", settings: "settings" }, outputs: { multiRowSelect: "multiRowSelect", rowClicked: "rowClicked",
|
|
3086
|
+
Ng2SmartTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: Ng2SmartTableComponent, selector: "ng2-smart-table", inputs: { source: "source", settings: "settings" }, outputs: { multiRowSelect: "multiRowSelect", rowClicked: "rowClicked", delete: "delete", edit: "edit", editCancel: "editCancel", create: "create", custom: "custom", deleteConfirm: "deleteConfirm", editConfirm: "editConfirm", createConfirm: "createConfirm", rowHover: "rowHover" }, usesOnChanges: true, ngImport: i0, template: "<table [id]=\"tableId\" [ngClass]=\"tableClass\">\n\n <thead ng2-st-thead *ngIf=\"!isHideHeader || !isHideSubHeader\"\n [grid]=\"grid\"\n [source]=\"source\"\n [createConfirm]=\"createConfirm\"\n (create)=\"create.emit($event)\"\n (selectAllRows)=\"onSelectAllRows()\">\n </thead>\n\n <tbody ng2-st-tbody [grid]=\"grid\"\n [source]=\"source\"\n [deleteConfirm]=\"deleteConfirm\"\n [editConfirm]=\"editConfirm\"\n [rowClassFunction]=\"rowClassFunction\"\n (edit)=\"edit.emit($event)\"\n (editCancel)=\"editCancel.emit($event)\"\n (delete)=\"delete.emit($event)\"\n (custom)=\"custom.emit($event)\"\n (userClickedRow)=\"emitUserRowClicked($event)\"\n (multipleSelectRow)=\"multipleSelectRow($event)\">\n </tbody>\n\n</table>\n\n<ng2-smart-table-pager *ngIf=\"isPagerDisplay\"\n [source]=\"source\"\n [perPageSelect]=\"perPageSelect\">\n</ng2-smart-table-pager>\n", styles: [":host{font-size:1rem}:host ::ng-deep *{box-sizing:border-box}:host ::ng-deep button,:host ::ng-deep input,:host ::ng-deep optgroup,:host ::ng-deep select,:host ::ng-deep textarea{color:inherit;font:inherit;margin:0}:host ::ng-deep table{line-height:1.5em;border-collapse:collapse;border-spacing:0;display:table;width:100%;max-width:100%;word-break:normal;word-break:keep-all;overflow:auto}:host ::ng-deep table tr th{font-weight:700}:host ::ng-deep table tr section{font-size:.75em;font-weight:700}:host ::ng-deep table tr td,:host ::ng-deep table tr th{font-size:.875em;margin:0;padding:.5em 1em}:host ::ng-deep a{color:#1e6bb8;text-decoration:none}:host ::ng-deep a:hover{text-decoration:underline}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: PagerComponent, selector: "ng2-smart-table-pager", inputs: ["source", "perPageSelect"], outputs: ["changePage"] }, { kind: "component", type: Ng2SmartTableTbodyComponent, selector: "[ng2-st-tbody]", inputs: ["grid", "source", "deleteConfirm", "editConfirm", "rowClassFunction"], outputs: ["save", "cancel", "edit", "editCancel", "delete", "custom", "edited", "userSelectRow", "userClickedRow", "editRowSelect", "multipleSelectRow"] }, { kind: "component", type: Ng2SmartTableTheadComponent, selector: "[ng2-st-thead]", inputs: ["grid", "source", "createConfirm"], outputs: ["sort", "selectAllRows", "create", "filter"] }] });
|
|
3100
3087
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: Ng2SmartTableComponent, decorators: [{
|
|
3101
3088
|
type: Component,
|
|
3102
|
-
args: [{ selector: 'ng2-smart-table', template: "<table [id]=\"tableId\" [ngClass]=\"tableClass\">\n\n <thead ng2-st-thead *ngIf=\"!isHideHeader || !isHideSubHeader\"\n [grid]=\"grid\"\n [source]=\"source\"\n [createConfirm]=\"createConfirm\"\n (create)=\"create.emit($event)\"\n (selectAllRows)=\"onSelectAllRows()\">\n </thead>\n\n <tbody ng2-st-tbody [
|
|
3089
|
+
args: [{ selector: 'ng2-smart-table', template: "<table [id]=\"tableId\" [ngClass]=\"tableClass\">\n\n <thead ng2-st-thead *ngIf=\"!isHideHeader || !isHideSubHeader\"\n [grid]=\"grid\"\n [source]=\"source\"\n [createConfirm]=\"createConfirm\"\n (create)=\"create.emit($event)\"\n (selectAllRows)=\"onSelectAllRows()\">\n </thead>\n\n <tbody ng2-st-tbody [grid]=\"grid\"\n [source]=\"source\"\n [deleteConfirm]=\"deleteConfirm\"\n [editConfirm]=\"editConfirm\"\n [rowClassFunction]=\"rowClassFunction\"\n (edit)=\"edit.emit($event)\"\n (editCancel)=\"editCancel.emit($event)\"\n (delete)=\"delete.emit($event)\"\n (custom)=\"custom.emit($event)\"\n (userClickedRow)=\"emitUserRowClicked($event)\"\n (multipleSelectRow)=\"multipleSelectRow($event)\">\n </tbody>\n\n</table>\n\n<ng2-smart-table-pager *ngIf=\"isPagerDisplay\"\n [source]=\"source\"\n [perPageSelect]=\"perPageSelect\">\n</ng2-smart-table-pager>\n", styles: [":host{font-size:1rem}:host ::ng-deep *{box-sizing:border-box}:host ::ng-deep button,:host ::ng-deep input,:host ::ng-deep optgroup,:host ::ng-deep select,:host ::ng-deep textarea{color:inherit;font:inherit;margin:0}:host ::ng-deep table{line-height:1.5em;border-collapse:collapse;border-spacing:0;display:table;width:100%;max-width:100%;word-break:normal;word-break:keep-all;overflow:auto}:host ::ng-deep table tr th{font-weight:700}:host ::ng-deep table tr section{font-size:.75em;font-weight:700}:host ::ng-deep table tr td,:host ::ng-deep table tr th{font-size:.875em;margin:0;padding:.5em 1em}:host ::ng-deep a{color:#1e6bb8;text-decoration:none}:host ::ng-deep a:hover{text-decoration:underline}\n"] }]
|
|
3103
3090
|
}], propDecorators: { source: [{
|
|
3104
3091
|
type: Input
|
|
3105
3092
|
}], settings: [{
|
|
@@ -3108,8 +3095,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
|
3108
3095
|
type: Output
|
|
3109
3096
|
}], rowClicked: [{
|
|
3110
3097
|
type: Output
|
|
3111
|
-
}], listScrollEnd: [{
|
|
3112
|
-
type: Output
|
|
3113
3098
|
}], delete: [{
|
|
3114
3099
|
type: Output
|
|
3115
3100
|
}], edit: [{
|