@universis/ngx-tables 0.6.7 → 0.6.11
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 +252 -84
- 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-select/advanced-select.component.js +2 -2
- package/esm2015/lib/components/advanced-table/advanced-table-search.component.js +3 -3
- package/esm2015/lib/components/advanced-table/advanced-table.component.js +18 -6
- package/esm2015/lib/components/advanced-table/advanced-table.formatters.interface.js +4 -2
- package/esm2015/lib/components/advanced-table/advanced-table.formatters.js +195 -58
- package/esm2015/lib/components/advanced-table-modal/advanced-table-modal-base.component.js +17 -10
- package/esm2015/lib/tables.module.js +1 -3
- package/esm5/lib/components/advanced-select/advanced-select.component.js +2 -2
- package/esm5/lib/components/advanced-table/advanced-table-search.component.js +3 -3
- package/esm5/lib/components/advanced-table/advanced-table.component.js +18 -6
- package/esm5/lib/components/advanced-table/advanced-table.formatters.interface.js +4 -2
- package/esm5/lib/components/advanced-table/advanced-table.formatters.js +202 -67
- package/esm5/lib/components/advanced-table-modal/advanced-table-modal-base.component.js +12 -5
- package/esm5/lib/tables.module.js +1 -3
- package/fesm2015/universis-ngx-tables.js +233 -77
- package/fesm2015/universis-ngx-tables.js.map +1 -1
- package/fesm5/universis-ngx-tables.js +233 -81
- package/fesm5/universis-ngx-tables.js.map +1 -1
- package/lib/components/advanced-table/advanced-table.formatters.d.ts +15 -0
- package/lib/components/advanced-table/advanced-table.formatters.interface.d.ts +3 -1
- package/lib/components/advanced-table-modal/advanced-table-modal-base.component.d.ts +5 -1
- package/package.json +1 -1
- package/universis-ngx-tables.metadata.json +1 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getNativeName } from 'iso-639-1/build';
|
|
2
|
-
import { Dropdown } from 'bootstrap';
|
|
3
2
|
import * as jQuery_ from 'jquery';
|
|
4
3
|
import 'datatables.net';
|
|
5
4
|
import { template, at } from 'lodash';
|
|
@@ -20,7 +19,6 @@ import { ServiceUrlPreProcessor, TranslatePreProcessor, AdvancedFormsModule } fr
|
|
|
20
19
|
import { FormioModule } from 'angular-formio';
|
|
21
20
|
import { ActivatedRoute, Router, NavigationStart, RouterModule } from '@angular/router';
|
|
22
21
|
import { BsModalRef, BsModalService, ModalModule } from 'ngx-bootstrap/modal';
|
|
23
|
-
import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
|
|
24
22
|
import { ProgressbarModule } from 'ngx-bootstrap/progressbar';
|
|
25
23
|
import { GroupByPipe, NgPipesModule } from 'ngx-pipes';
|
|
26
24
|
|
|
@@ -36,6 +34,68 @@ var AdvancedColumnFormatter = /** @class */ (function () {
|
|
|
36
34
|
AdvancedColumnFormatter.templateCache.set(expr, result);
|
|
37
35
|
return result;
|
|
38
36
|
};
|
|
37
|
+
AdvancedColumnFormatter.prototype.createUrlTree = function (data, options) {
|
|
38
|
+
if (Array.isArray(options.commands)) {
|
|
39
|
+
var activatedRoute = this.injector.get(ActivatedRoute);
|
|
40
|
+
var router = this.injector.get(Router);
|
|
41
|
+
var commands = options.commands.map(function (command) {
|
|
42
|
+
if (typeof command === 'string') {
|
|
43
|
+
return AdvancedColumnFormatter.template(command)(data);
|
|
44
|
+
}
|
|
45
|
+
if (command.outlets) {
|
|
46
|
+
var commandOutlets_1 = {};
|
|
47
|
+
Object.keys(command.outlets).forEach(function (key) {
|
|
48
|
+
if (Object.prototype.hasOwnProperty.call(command.outlets, key)) {
|
|
49
|
+
var outlet = command.outlets[key];
|
|
50
|
+
if (Array.isArray(outlet)) {
|
|
51
|
+
Object.defineProperty(commandOutlets_1, key, {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
configurable: true,
|
|
54
|
+
writable: true,
|
|
55
|
+
value: outlet.map(function (x) {
|
|
56
|
+
return AdvancedColumnFormatter.template(x)(data);
|
|
57
|
+
}),
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
Object.defineProperty(commandOutlets_1, key, {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
configurable: true,
|
|
64
|
+
writable: true,
|
|
65
|
+
value: outlet,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
return {
|
|
71
|
+
outlets: commandOutlets_1,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
return command;
|
|
75
|
+
});
|
|
76
|
+
var queryParams_1 = {};
|
|
77
|
+
var replaceUrl = true;
|
|
78
|
+
if (options.navigationExtras && options.navigationExtras.queryParams) {
|
|
79
|
+
Object.keys(options.navigationExtras.queryParams).map(function (key) {
|
|
80
|
+
var text = options.navigationExtras.queryParams[key];
|
|
81
|
+
queryParams_1[key] = AdvancedColumnFormatter.template(text)(data);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
if (options.navigationExtras && typeof options.navigationExtras.replaceUrl !== 'undefined') {
|
|
85
|
+
replaceUrl = options.navigationExtras.replaceUrl;
|
|
86
|
+
}
|
|
87
|
+
var skipLocationChange = false;
|
|
88
|
+
if (options.navigationExtras && typeof options.navigationExtras.skipLocationChange !== 'undefined') {
|
|
89
|
+
skipLocationChange = options.navigationExtras.skipLocationChange;
|
|
90
|
+
}
|
|
91
|
+
return router.createUrlTree(commands, {
|
|
92
|
+
relativeTo: activatedRoute,
|
|
93
|
+
queryParams: queryParams_1,
|
|
94
|
+
replaceUrl: replaceUrl,
|
|
95
|
+
skipLocationChange: skipLocationChange,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
};
|
|
39
99
|
AdvancedColumnFormatter.templateCache = new Map();
|
|
40
100
|
return AdvancedColumnFormatter;
|
|
41
101
|
}());
|
|
@@ -60,7 +120,6 @@ var ButtonFormatter = /** @class */ (function (_super) {
|
|
|
60
120
|
return _super.call(this) || this;
|
|
61
121
|
}
|
|
62
122
|
ButtonFormatter.prototype.render = function (data, type, row, meta) {
|
|
63
|
-
var _this = this;
|
|
64
123
|
if (data == null) {
|
|
65
124
|
return '';
|
|
66
125
|
}
|
|
@@ -83,63 +142,7 @@ var ButtonFormatter = /** @class */ (function (_super) {
|
|
|
83
142
|
buttonTitle = this.injector.get(TranslateService).instant(formatOptions.buttonTitle);
|
|
84
143
|
}
|
|
85
144
|
if (Array.isArray(this.formatOptions.commands)) {
|
|
86
|
-
var
|
|
87
|
-
var router = this.injector.get(Router);
|
|
88
|
-
var commands = this.formatOptions.commands.map(function (command) {
|
|
89
|
-
if (typeof command === 'string') {
|
|
90
|
-
return AdvancedColumnFormatter.template(command)(row);
|
|
91
|
-
}
|
|
92
|
-
if (command.outlets) {
|
|
93
|
-
var commandOutlets_1 = {};
|
|
94
|
-
Object.keys(command.outlets).forEach(function (key) {
|
|
95
|
-
if (Object.prototype.hasOwnProperty.call(command.outlets, key)) {
|
|
96
|
-
var outlet = command.outlets[key];
|
|
97
|
-
if (Array.isArray(outlet)) {
|
|
98
|
-
Object.defineProperty(commandOutlets_1, key, {
|
|
99
|
-
enumerable: true,
|
|
100
|
-
configurable: true,
|
|
101
|
-
writable: true,
|
|
102
|
-
value: outlet.map(function (x) {
|
|
103
|
-
return AdvancedColumnFormatter.template(x)(row);
|
|
104
|
-
}),
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
Object.defineProperty(commandOutlets_1, key, {
|
|
109
|
-
enumerable: true,
|
|
110
|
-
configurable: true,
|
|
111
|
-
writable: true,
|
|
112
|
-
value: outlet,
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
return {
|
|
118
|
-
outlets: commandOutlets_1,
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
return command;
|
|
122
|
-
});
|
|
123
|
-
var queryParams_1 = {};
|
|
124
|
-
var replaceUrl = true;
|
|
125
|
-
if (this.formatOptions.navigationExtras && this.formatOptions.navigationExtras.queryParams) {
|
|
126
|
-
Object.keys(this.formatOptions.navigationExtras.queryParams).map(function (key) {
|
|
127
|
-
queryParams_1[key] = AdvancedColumnFormatter.template(_this.formatOptions.navigationExtras.queryParams[key])(row);
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
if (this.formatOptions.navigationExtras && typeof this.formatOptions.navigationExtras.replaceUrl !== 'undefined') {
|
|
131
|
-
replaceUrl = this.formatOptions.navigationExtras.replaceUrl;
|
|
132
|
-
}
|
|
133
|
-
var skipLocationChange = false;
|
|
134
|
-
if (this.formatOptions.navigationExtras && typeof this.formatOptions.navigationExtras.skipLocationChange !== 'undefined') {
|
|
135
|
-
skipLocationChange = this.formatOptions.navigationExtras.skipLocationChange;
|
|
136
|
-
}
|
|
137
|
-
var routerLink = router.createUrlTree(commands, {
|
|
138
|
-
relativeTo: activatedRoute,
|
|
139
|
-
queryParams: queryParams_1,
|
|
140
|
-
replaceUrl: replaceUrl,
|
|
141
|
-
skipLocationChange: skipLocationChange,
|
|
142
|
-
}).toString();
|
|
145
|
+
var routerLink = this.createUrlTree(row, this.formatOptions);
|
|
143
146
|
return "<a class=\"" + formatOptions.buttonClass + "\" title=\"" + buttonTitle + "\" href=\"#" + routerLink + "\">" + buttonText + "</a>";
|
|
144
147
|
}
|
|
145
148
|
// and return button
|
|
@@ -193,10 +196,14 @@ var ActionLinkFormatter = /** @class */ (function (_super) {
|
|
|
193
196
|
finally { if (e_1) throw e_1.error; }
|
|
194
197
|
}
|
|
195
198
|
// return the dropdown menu with 3 dots
|
|
196
|
-
return "<div class='dropdown details-control' data-id='" + data + "' data-type='student' >\n
|
|
199
|
+
return "<div class='dropdown details-control' data-id='" + data + "' data-type='student' >\n <a id=\"dropdownMenuButton-" + data + "\"\n data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n <span class=\"fa-2x text-dots\"></span>\n </a>\n <div class=\"dropdown-menu\" aria-labelledby=\"dropdownMenuButton-" + data + "\">\n " + actions.map(function (x) {
|
|
197
200
|
if (x.type === 'divider') {
|
|
198
201
|
return "<div class=\"dropdown-divider\"></div>";
|
|
199
202
|
}
|
|
203
|
+
if (x.formatOptions && x.formatOptions.commands) {
|
|
204
|
+
var urlTree = _this.createUrlTree(row, x.formatOptions);
|
|
205
|
+
return "<a data-name='" + x.name + "' class=\"dropdown-item\" href=\"" + urlTree.toString() + "\">\n " + _this.injector.get(TranslateService).instant(x.title) + "\n </a>";
|
|
206
|
+
}
|
|
200
207
|
return "<a data-name='" + x.name + "' class=\"dropdown-item\" href=\"" + AdvancedColumnFormatter.template(x.href)(row) + "\">\n " + _this.injector.get(TranslateService).instant(x.title) + "\n </a>";
|
|
201
208
|
})
|
|
202
209
|
.join('') + "\n </div>\n </div>";
|
|
@@ -204,12 +211,137 @@ var ActionLinkFormatter = /** @class */ (function (_super) {
|
|
|
204
211
|
return data;
|
|
205
212
|
};
|
|
206
213
|
ActionLinkFormatter.prototype.afterRender = function (cell, cellData, rowData, rowIndex, colIndex) {
|
|
207
|
-
// assign bootstrap dropdown
|
|
208
|
-
// tslint:disable-next-line: no-unused-expression
|
|
209
|
-
new Dropdown(cell);
|
|
214
|
+
// assign bootstrap dropdown (?)
|
|
210
215
|
};
|
|
211
216
|
return ActionLinkFormatter;
|
|
212
217
|
}(AdvancedColumnFormatter));
|
|
218
|
+
var ActionButtonFormatter = /** @class */ (function (_super) {
|
|
219
|
+
__extends(ActionButtonFormatter, _super);
|
|
220
|
+
function ActionButtonFormatter() {
|
|
221
|
+
return _super.call(this) || this;
|
|
222
|
+
}
|
|
223
|
+
ActionButtonFormatter.prototype.render = function (data, type, row, meta) {
|
|
224
|
+
var _this = this;
|
|
225
|
+
var e_2, _a;
|
|
226
|
+
// get column
|
|
227
|
+
var column = meta.settings.aoColumns[meta.col];
|
|
228
|
+
if (column && column.data) {
|
|
229
|
+
var actions = this.actions || [];
|
|
230
|
+
var index = 1;
|
|
231
|
+
try {
|
|
232
|
+
for (var actions_2 = __values(actions), actions_2_1 = actions_2.next(); !actions_2_1.done; actions_2_1 = actions_2.next()) {
|
|
233
|
+
var action = actions_2_1.value;
|
|
234
|
+
Object.assign(action, {
|
|
235
|
+
name: action.name || "action" + index,
|
|
236
|
+
});
|
|
237
|
+
index += 1;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
241
|
+
finally {
|
|
242
|
+
try {
|
|
243
|
+
if (actions_2_1 && !actions_2_1.done && (_a = actions_2.return)) _a.call(actions_2);
|
|
244
|
+
}
|
|
245
|
+
finally { if (e_2) throw e_2.error; }
|
|
246
|
+
}
|
|
247
|
+
var buttonText = void 0;
|
|
248
|
+
if (this.formatOptions && this.formatOptions.buttonText) {
|
|
249
|
+
// if button text is a literal expression
|
|
250
|
+
if (this.formatOptions.buttonText.includes('${')) {
|
|
251
|
+
// use template
|
|
252
|
+
buttonText = AdvancedColumnFormatter.template(this.formatOptions.buttonText)(row);
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
// otherwise translate it
|
|
256
|
+
buttonText = this.injector.get(TranslateService).instant(this.formatOptions.buttonText);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
var buttonTitle = void 0;
|
|
260
|
+
if (this.formatOptions && this.formatOptions.buttonTitle) {
|
|
261
|
+
buttonTitle = this.injector.get(TranslateService).instant(this.formatOptions.buttonTbuttonTitleext);
|
|
262
|
+
}
|
|
263
|
+
var buttonClass = (this.formatOptions && this.formatOptions.buttonClass) || 'btn btn-light';
|
|
264
|
+
// return the dropdown menu with 3 dots
|
|
265
|
+
return "<div class='dropdown details-control' data-id='" + data + "'>\n <a class=\"" + buttonClass + " dropdown-toggle\" href=\"#\" role=\"button\" title=\"" + buttonTitle + "\"\n id=\"dropdownMenuButton-" + data + "\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n " + buttonText + "\n </a>\n <div class=\"dropdown-menu\" aria-labelledby=\"dropdownMenuButton-" + data + "\">\n " + actions.map(function (x) {
|
|
266
|
+
if (x.type === 'divider') {
|
|
267
|
+
return "<div class=\"dropdown-divider\"></div>";
|
|
268
|
+
}
|
|
269
|
+
if (x.commands) {
|
|
270
|
+
var urlTree = _this.createUrlTree(row, x);
|
|
271
|
+
return "<a class=\"dropdown-item\" href=\"" + urlTree.toString() + "\">\n " + _this.injector.get(TranslateService).instant(x.title) + "\n </a>";
|
|
272
|
+
}
|
|
273
|
+
return "<a class=\"dropdown-item\" href=\"" + AdvancedColumnFormatter.template(x.href)(row) + "\">\n " + _this.injector.get(TranslateService).instant(x.title) + "\n </a>";
|
|
274
|
+
})
|
|
275
|
+
.join('') + "\n </div>\n </div>";
|
|
276
|
+
}
|
|
277
|
+
return data;
|
|
278
|
+
};
|
|
279
|
+
ActionButtonFormatter.prototype.afterRender = function (cell, cellData, rowData, rowIndex, colIndex) {
|
|
280
|
+
// assign bootstrap dropdown (?)
|
|
281
|
+
};
|
|
282
|
+
return ActionButtonFormatter;
|
|
283
|
+
}(AdvancedColumnFormatter));
|
|
284
|
+
var ActionSplitButtonFormatter = /** @class */ (function (_super) {
|
|
285
|
+
__extends(ActionSplitButtonFormatter, _super);
|
|
286
|
+
function ActionSplitButtonFormatter() {
|
|
287
|
+
return _super.call(this) || this;
|
|
288
|
+
}
|
|
289
|
+
ActionSplitButtonFormatter.prototype.render = function (data, type, row, meta) {
|
|
290
|
+
var _this = this;
|
|
291
|
+
var e_3, _a;
|
|
292
|
+
// get column
|
|
293
|
+
var column = meta.settings.aoColumns[meta.col];
|
|
294
|
+
if (column && column.data) {
|
|
295
|
+
var actions = this.actions || [];
|
|
296
|
+
var index = 1;
|
|
297
|
+
try {
|
|
298
|
+
for (var actions_3 = __values(actions), actions_3_1 = actions_3.next(); !actions_3_1.done; actions_3_1 = actions_3.next()) {
|
|
299
|
+
var action = actions_3_1.value;
|
|
300
|
+
Object.assign(action, {
|
|
301
|
+
name: action.name || "action" + index,
|
|
302
|
+
});
|
|
303
|
+
index += 1;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
307
|
+
finally {
|
|
308
|
+
try {
|
|
309
|
+
if (actions_3_1 && !actions_3_1.done && (_a = actions_3.return)) _a.call(actions_3);
|
|
310
|
+
}
|
|
311
|
+
finally { if (e_3) throw e_3.error; }
|
|
312
|
+
}
|
|
313
|
+
if (actions.length === 0) {
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
var buttonClass = (this.formatOptions && this.formatOptions.buttonClass) || 'btn btn-light';
|
|
317
|
+
// return the dropdown menu with 3 dots
|
|
318
|
+
var defaultAction = actions[0];
|
|
319
|
+
var defaultActionHref = void 0;
|
|
320
|
+
if (defaultAction && defaultAction.commands) {
|
|
321
|
+
defaultActionHref = this.createUrlTree(row, defaultAction).toString();
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
defaultActionHref = AdvancedColumnFormatter.template(defaultAction.href)(row);
|
|
325
|
+
}
|
|
326
|
+
return "<div class=\"btn-group\">\n <a type=\"button\" class=\"" + buttonClass + "\" href=\"" + defaultActionHref + "\">\n " + this.injector.get(TranslateService).instant(defaultAction.title) + "\n </a>\n <button type=\"button\" class=\"" + buttonClass + " dropdown-toggle dropdown-toggle-split\"\n data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n <span class=\"sr-only\">" + this.injector.get(TranslateService).instant('Toggle Dropdown') + "</span>\n </button>\n <div class=\"dropdown-menu\" aria-labelledby=\"dropdownMenuButton-" + data + "\">\n " + actions.map(function (x) {
|
|
327
|
+
if (x.title === '-') {
|
|
328
|
+
return "<div class=\"dropdown-divider\"></div>";
|
|
329
|
+
}
|
|
330
|
+
if (x.commands) {
|
|
331
|
+
var urlTree = _this.createUrlTree(row, x);
|
|
332
|
+
return "<a class=\"dropdown-item\" href=\"" + urlTree.toString() + "\">\n " + _this.injector.get(TranslateService).instant(x.title) + "\n </a>";
|
|
333
|
+
}
|
|
334
|
+
return "<a class=\"dropdown-item\" href=\"" + AdvancedColumnFormatter.template(x.href)(row) + "\">\n " + _this.injector.get(TranslateService).instant(x.title) + "\n </a>";
|
|
335
|
+
})
|
|
336
|
+
.join('') + "\n </div>\n </div>";
|
|
337
|
+
}
|
|
338
|
+
return data;
|
|
339
|
+
};
|
|
340
|
+
ActionSplitButtonFormatter.prototype.afterRender = function (cell, cellData, rowData, rowIndex, colIndex) {
|
|
341
|
+
// assign bootstrap dropdown (?)
|
|
342
|
+
};
|
|
343
|
+
return ActionSplitButtonFormatter;
|
|
344
|
+
}(AdvancedColumnFormatter));
|
|
213
345
|
var SelectRowFormatter = /** @class */ (function (_super) {
|
|
214
346
|
__extends(SelectRowFormatter, _super);
|
|
215
347
|
function SelectRowFormatter() {
|
|
@@ -294,7 +426,7 @@ var NgClassFormatter = /** @class */ (function (_super) {
|
|
|
294
426
|
return _super.call(this) || this;
|
|
295
427
|
}
|
|
296
428
|
NgClassFormatter.prototype.render = function (data, type, row, meta) {
|
|
297
|
-
var
|
|
429
|
+
var e_4, _a;
|
|
298
430
|
// get column
|
|
299
431
|
var column = meta.settings.aoColumns[meta.col];
|
|
300
432
|
if (column && column.data) {
|
|
@@ -314,12 +446,12 @@ var NgClassFormatter = /** @class */ (function (_super) {
|
|
|
314
446
|
}
|
|
315
447
|
}
|
|
316
448
|
}
|
|
317
|
-
catch (
|
|
449
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
318
450
|
finally {
|
|
319
451
|
try {
|
|
320
452
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
321
453
|
}
|
|
322
|
-
finally { if (
|
|
454
|
+
finally { if (e_4) throw e_4.error; }
|
|
323
455
|
}
|
|
324
456
|
}
|
|
325
457
|
return data;
|
|
@@ -463,7 +595,7 @@ var AdvancedTableComponent = /** @class */ (function () {
|
|
|
463
595
|
this.configChanges = new BehaviorSubject(null);
|
|
464
596
|
this.height = 800;
|
|
465
597
|
this.showActions = true;
|
|
466
|
-
this.autoLoad =
|
|
598
|
+
this.autoLoad = true;
|
|
467
599
|
this.load = new EventEmitter();
|
|
468
600
|
this.init = new EventEmitter();
|
|
469
601
|
this.reload = new EventEmitter();
|
|
@@ -923,7 +1055,7 @@ var AdvancedTableComponent = /** @class */ (function () {
|
|
|
923
1055
|
});
|
|
924
1056
|
if (items_1.length > 0) {
|
|
925
1057
|
Object.assign(columnDefinition, {
|
|
926
|
-
|
|
1058
|
+
createdCell: function (cell, cellData, rowData, rowIndex, colIndex) {
|
|
927
1059
|
items_1.forEach(function (columnFormatter) {
|
|
928
1060
|
var formatter = self._columnFormatters[columnFormatter.formatter];
|
|
929
1061
|
if (formatter && typeof formatter.afterRender === 'function') {
|
|
@@ -941,6 +1073,14 @@ var AdvancedTableComponent = /** @class */ (function () {
|
|
|
941
1073
|
render: formatter.render.bind(column),
|
|
942
1074
|
});
|
|
943
1075
|
}
|
|
1076
|
+
if (formatter && typeof formatter.afterRender === 'function') {
|
|
1077
|
+
Object.assign(columnDefinition, {
|
|
1078
|
+
render: formatter.render.bind(column),
|
|
1079
|
+
});
|
|
1080
|
+
Object.assign(columnDefinition, {
|
|
1081
|
+
createdCell: formatter.afterRender.bind(column),
|
|
1082
|
+
});
|
|
1083
|
+
}
|
|
944
1084
|
}
|
|
945
1085
|
return columnDefinition;
|
|
946
1086
|
});
|
|
@@ -1000,7 +1140,8 @@ var AdvancedTableComponent = /** @class */ (function () {
|
|
|
1000
1140
|
self.select.emit(row);
|
|
1001
1141
|
});
|
|
1002
1142
|
}
|
|
1003
|
-
tableElement_1.find('input.s-row')
|
|
1143
|
+
var elements = tableElement_1.find('input.s-row');
|
|
1144
|
+
elements.off('click').on('click', _this.onSelectionChange.bind(_this));
|
|
1004
1145
|
// make selection on current page
|
|
1005
1146
|
var key = _this.config.columns[0].property;
|
|
1006
1147
|
if (_this.selected.length > 0) {
|
|
@@ -1212,6 +1353,7 @@ var AdvancedTableComponent = /** @class */ (function () {
|
|
|
1212
1353
|
}
|
|
1213
1354
|
else {
|
|
1214
1355
|
Object.assign(settings, {
|
|
1356
|
+
scrollY: this.scrollY,
|
|
1215
1357
|
paging: this.paging,
|
|
1216
1358
|
pageLength: this.pageLength,
|
|
1217
1359
|
});
|
|
@@ -1323,7 +1465,7 @@ var AdvancedTableComponent = /** @class */ (function () {
|
|
|
1323
1465
|
if (item) {
|
|
1324
1466
|
// redraw row
|
|
1325
1467
|
row.data(item);
|
|
1326
|
-
jQuery(row.node()).find(':checkbox').on('click', _this.onSelectionChange.bind(_this));
|
|
1468
|
+
jQuery(row.node()).find(':checkbox').off('click').on('click', _this.onSelectionChange.bind(_this));
|
|
1327
1469
|
// if row is already selected
|
|
1328
1470
|
if (checked) {
|
|
1329
1471
|
_this.selectRow(row, true);
|
|
@@ -1361,6 +1503,7 @@ var AdvancedTableComponent = /** @class */ (function () {
|
|
|
1361
1503
|
if (findItemIndex < 0) {
|
|
1362
1504
|
// add row to selected rows
|
|
1363
1505
|
this.selected.push(row);
|
|
1506
|
+
this.selectedItems.emit(this.selected);
|
|
1364
1507
|
}
|
|
1365
1508
|
}
|
|
1366
1509
|
else {
|
|
@@ -1374,6 +1517,7 @@ var AdvancedTableComponent = /** @class */ (function () {
|
|
|
1374
1517
|
});
|
|
1375
1518
|
if (findItemIndex < 0) {
|
|
1376
1519
|
this.unselected.push(row);
|
|
1520
|
+
this.selectedItems.emit(this.selected);
|
|
1377
1521
|
}
|
|
1378
1522
|
}
|
|
1379
1523
|
}
|
|
@@ -1441,7 +1585,7 @@ var AdvancedTableComponent = /** @class */ (function () {
|
|
|
1441
1585
|
selector: 'app-advanced-table',
|
|
1442
1586
|
template: "\n <table #table class=\"dataTable\">\n </table>\n <div #emptyTable class=\"d-none\">\n <div>\n <div class=\"mt-4\">\n <div class=\"icon-circle bg-gray-300 border-gray-100\"></div>\n </div>\n <div class=\"mt-4\">\n <h4 class=\"font-3xl text-dark\" [translate]=\"'Tables.EmptyTableTitle'\"></h4>\n <p class=\"font-lg text-dark\" [translate]=\"'Tables.EmptyTableMessage'\"></p>\n </div>\n </div>\n </div>\n ",
|
|
1443
1587
|
encapsulation: ViewEncapsulation.None,
|
|
1444
|
-
styles: ["table.dataTable thead .sorting{background-image:none}table.dataTable thead .sorting_asc{background-position:95% 60%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAACXBIWXMAAAsSAAALEgHS3X78AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAEtJREFUKJFjYBgywAOKMQALFjE/BgaGTCibjYGBYRM+kz0ZGBh2MTAw8DAwMHAxMDBsY2BgCCBGMQzg1IRNMV5NuVAJXIALqmYwAgBBkAlPRCLcLwAAAABJRU5ErkJggg==)}table.dataTable thead .sorting_desc{background-position:95% 60%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAACXBIWXMAAArzAAAK8wHvFRX1AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAFNJREFUKJHVzTEKgDAQRNGHZfBg2sSTeDMLKwXPYuVJbBKQQEyrH6bZ+cPyWWaElz4kR5cOJ1b0FXnBVRYjjmIUsGGqvX6OmnImYk+JLTkzpPyBGwrtCvfBe56nAAAAAElFTkSuQmCC)}table.dataTable thead th{color:#73818e;font-size:.75rem;font-weight:600;padding-top:16px;padding-bottom:4px;border-bottom:none;padding-left:8px}table.dataTable tbody tr:first-child td:first-child{border-radius:6px 0}table.dataTable tbody tr:first-child td:last-child{border-radius:0 6px}table.dataTable tbody tr{border-radius:6px}table.dataTable tbody tr td:first-child{border-left:1px solid #c2cfd6}table.dataTable tbody tr td:last-child{border-right:1px solid #c2cfd6}table.dataTable tbody tr td{padding-top:
|
|
1588
|
+
styles: ["table.dataTable thead .sorting{background-image:none}table.dataTable thead .sorting_asc{background-position:95% 60%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAACXBIWXMAAAsSAAALEgHS3X78AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAEtJREFUKJFjYBgywAOKMQALFjE/BgaGTCibjYGBYRM+kz0ZGBh2MTAw8DAwMHAxMDBsY2BgCCBGMQzg1IRNMV5NuVAJXIALqmYwAgBBkAlPRCLcLwAAAABJRU5ErkJggg==)}table.dataTable thead .sorting_desc{background-position:95% 60%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAACXBIWXMAAArzAAAK8wHvFRX1AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAFNJREFUKJHVzTEKgDAQRNGHZfBg2sSTeDMLKwXPYuVJbBKQQEyrH6bZ+cPyWWaElz4kR5cOJ1b0FXnBVRYjjmIUsGGqvX6OmnImYk+JLTkzpPyBGwrtCvfBe56nAAAAAElFTkSuQmCC)}table.dataTable thead th{color:#73818e;font-size:.75rem;font-weight:600;padding-top:16px;padding-bottom:4px;border-bottom:none;padding-left:8px}table.dataTable tbody tr:first-child td:first-child{border-radius:6px 0}table.dataTable tbody tr:first-child td:last-child{border-radius:0 6px}table.dataTable tbody tr{border-radius:6px}table.dataTable tbody tr td:first-child{border-left:1px solid #c2cfd6}table.dataTable tbody tr td:last-child{border-right:1px solid #c2cfd6}table.dataTable tbody tr td{padding-top:8px;padding-bottom:8px;border-top:1px solid #c2cfd6}table.dataTable tbody tr:last-child td:first-child{border-radius:0 0 0 6px}table.dataTable tbody tr:last-child td:last-child{border-radius:0 0 6px}table.dataTable tbody tr:last-child td{border-bottom:1px solid #c2cfd6}table.dataTable td.dataTables_empty{border:none!important}table.dataTable.no-footer{border-bottom:none}.dataTables_paginate .btn.previous{margin-right:8px}.dataTables_paginate .btn.next{margin-left:8px}.dataTables_info,.dataTables_paginate{margin-top:1rem}.dataTables_paginate span .btn{border-radius:1.5rem}.dataTables_filter{display:none}.dataTables_wrapper.no-footer .dataTables_scrollBody{border-bottom:0;overflow:auto}.dataTables_paginate{display:none}.dataTable.processing{opacity:15%}.dataTables_wrapper .dataTables_processing{background:0 0;position:absolute;display:inline-block;top:25%;z-index:5;color:#73818e}.text-decoration-line-through{text-decoration:line-through!important}tr.removed .checkbox+label{visibility:hidden}"]
|
|
1445
1589
|
}] }
|
|
1446
1590
|
];
|
|
1447
1591
|
/** @nocollapse */
|
|
@@ -1492,7 +1636,7 @@ var AdvancedTableComponent = /** @class */ (function () {
|
|
|
1492
1636
|
|
|
1493
1637
|
// important: export this const due to AOT compilation errors
|
|
1494
1638
|
// see more https://angular.io/guide/aot-metadata-errors#only-initialized-variables
|
|
1495
|
-
var AdvancedTableModalBaseTemplate = "\n<div>\n <!-- search -->\n <div class=\"row mt-3\">\n <div class=\"col-12 col-lg-3\">\n <div class=\"input-group mb-3\">\n <input spellcheck=\"false\" type=\"text\"\n (keyup)=\"onKeyUp($event)\" [(ngModel)]=\"searchText\"\n class=\"form-control bg-gray-100 border-0\"\n placeholder=\"{{'Tables.SearchPlaceholder' | translate}}\" aria-label=\"Search\" aria-describedby=\"basic-addon2\">\n <div class=\"input-group-append\">\n <button class=\"btn btn-default bg-gray-100 border-0\" type=\"button\">\n <i class=\"fa fa-search text-secondary\"></i>\n </button>\n </div>\n </div>\n </div>\n <div #emptyTable class=\"d-none\">\n <div>\n <div class=\"mt-4\">\n <div class=\"icon-circle bg-gray-300 border-gray-100\"></div>\n </div>\n <div class=\"mt-4\">\n <h4 class=\"font-3xl text-dark\" [translate]=\"'Tables.EmptyTableTitle'\"></h4>\n <p class=\"font-lg text-dark\" [translate]=\"'Tables.EmptyTableMessage'\"></p>\n </div>\n\n </div>\n </div>\n <div class=\"col-12 col-lg-5\">\n <div class=\"btn-toolbar\">\n <button class=\"btn btn-gray-100\">\n <i class=\"fa fa-sliders-h pr-2 text-secondary\" aria-hidden=\"true\"></i>{{'Tables.Filters' | translate}}\n </button>\n <div #dropdownFilter class=\"dropdown ml-3\"
|
|
1639
|
+
var AdvancedTableModalBaseTemplate = "\n<div>\n <!-- search -->\n <div class=\"row mt-3\">\n <div class=\"col-12 col-lg-3\">\n <div class=\"input-group mb-3\">\n <input spellcheck=\"false\" type=\"text\"\n (keyup)=\"onKeyUp($event)\" [(ngModel)]=\"searchText\"\n class=\"form-control bg-gray-100 border-0\"\n placeholder=\"{{'Tables.SearchPlaceholder' | translate}}\" aria-label=\"Search\" aria-describedby=\"basic-addon2\">\n <div class=\"input-group-append\">\n <button class=\"btn btn-default bg-gray-100 border-0\" type=\"button\">\n <i class=\"fa fa-search text-secondary\"></i>\n </button>\n </div>\n </div>\n </div>\n <div #emptyTable class=\"d-none\">\n <div>\n <div class=\"mt-4\">\n <div class=\"icon-circle bg-gray-300 border-gray-100\"></div>\n </div>\n <div class=\"mt-4\">\n <h4 class=\"font-3xl text-dark\" [translate]=\"'Tables.EmptyTableTitle'\"></h4>\n <p class=\"font-lg text-dark\" [translate]=\"'Tables.EmptyTableMessage'\"></p>\n </div>\n\n </div>\n </div>\n <div class=\"col-12 col-lg-5\">\n <div class=\"btn-toolbar\">\n <button class=\"btn btn-gray-100\">\n <i class=\"fa fa-sliders-h pr-2 text-secondary\" aria-hidden=\"true\"></i>{{'Tables.Filters' | translate}}\n </button>\n <div #dropdownFilter class=\"dropdown ml-3\">\n <button class=\"btn btn-gray-100 dropdown-toggle\"\n type=\"button\" id=\"dropdownDefaultFilters\"\n data-toggle=\"dropdown\" dropdownToggle>\n {{ this.defaultFilter.name | translate }}\n </button>\n <div class=\"dropdown-menu\" aria-labelledby=\"dropdownDefaultFilters\">\n <button type=\"button\" class=\"dropdown-item\" *ngFor=\"let filter of defaultFilters\" (click)=\"onFilterSelect(filter)\">\n {{ filter.name | translate }}\n </button>\n </div>\n </div>\n </div>\n </div>\n <div class=\"col text-lg-right mt-3 mt-lg-0\">\n <button [disabled]=\"true\" class=\"btn rounded-pill btn-outline-theme\">\n <span class=\"pr-2 font-lg\">+</span><span [translate]=\"'Tables.AddItem'\"></span>\n </button>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\" [ngClass]=\"{ 'component-loading': loading}\">\n <app-advanced-table #advancedTable (init)=\"onTableInit($event)\"\n (load)=\"onDataLoad($event)\"\n [selectable]=\"true\"\n [multipleSelect]=\"true\"\n [scrollX]=\"false\" [scrollY]=\"320\"\n [pageLength]=\"pageLength\"\n [scrollable]=\"false\" [showFooter]=\"false\"\n [showActions]=\"false\" [lengthMenu]=\"lengthMenu\"\n [config]=\"tableConfig\" [configSrc]=\"tableConfigSrc\"></app-advanced-table>\n </div>\n </div>\n <div class=\"row mt-3 table-custom-pager\">\n <div class=\"col-12 d-flex\" *ngIf=\"recordsTotal\">\n <div class=\"mt-2 ml-auto mr-3 text-secondary\" [translate]=\"'Tables.RecordsPerPage'\"></div>\n <div #dropdownLength class=\"dropdown mr-3\">\n <button class=\"btn btn-gray-100 dropdown-toggle\"\n type=\"button\" id=\"dropdownPageSize\" data-toggle=\"dropdown\"\n dropdownToggle>\n {{pageLength}}\n </button>\n <div class=\"dropdown-menu\" aria-labelledby=\"dropdownPageSize\">\n <button (click)=\"setLength(item)\"\n class=\"dropdown-item dropdown-item-theme\"\n type=\"button\" *ngFor=\"let item of lengthMenu\">{{item}}</button>\n </div>\n </div>\n <div class=\"mt-2 mr-2\" [translate]=\"'Tables.PageInfo'\" [translateParams]=\"pageInfo\"></div>\n <button [disabled]=\"pageInfo && pageInfo.page === 0\" class=\"btn text-nowrap\" (click)=\"firstPage()\">\n <i class=\"fa fa-chevron-left text-color-theme\"></i>\n <i class=\"fa fa-chevron-left text-color-theme\"></i>\n </button>\n <button [disabled]=\"pageInfo && pageInfo.page===0\" class=\"btn\" (click)=\"previousPage()\">\n <i class=\"fa fa-chevron-left text-color-theme\"></i>\n </button>\n <button [disabled]=\"pageInfo && pageInfo.page===pageInfo.pages-1\" class=\"btn\" (click)=\"nextPage()\">\n <i class=\"fa fa-chevron-right text-color-theme\"></i>\n </button>\n <button [disabled]=\"pageInfo && pageInfo.page===pageInfo.pages-1\" class=\"btn text-nowrap\" (click)=\"lastPage()\">\n <i class=\"fa fa-chevron-right text-color-theme\"></i>\n <i class=\"fa fa-chevron-right text-color-theme\"></i>\n </button>\n </div>\n </div>\n </div>\n";
|
|
1496
1640
|
var AdvancedTableModalBaseComponent = /** @class */ (function (_super) {
|
|
1497
1641
|
__extends(AdvancedTableModalBaseComponent, _super);
|
|
1498
1642
|
function AdvancedTableModalBaseComponent(_router, _activatedRoute, _context, advancedFilterValueProvider, datePipe) {
|
|
@@ -1659,15 +1803,18 @@ var AdvancedTableModalBaseComponent = /** @class */ (function (_super) {
|
|
|
1659
1803
|
if (defaultFilterValues === void 0) { defaultFilterValues = {}; }
|
|
1660
1804
|
// Do nothing in absence of configuration.
|
|
1661
1805
|
if (!tableConfig || !Array.isArray(tableConfig.criteria)) {
|
|
1662
|
-
|
|
1806
|
+
return [];
|
|
1807
|
+
}
|
|
1808
|
+
if (searchItem.filter == null) {
|
|
1663
1809
|
return [];
|
|
1664
1810
|
}
|
|
1665
1811
|
var matchedCriterion = tableConfig.criteria.find(function (criterion) {
|
|
1666
1812
|
return Object.prototype.hasOwnProperty.call(searchItem.filter, criterion.name);
|
|
1667
1813
|
});
|
|
1668
|
-
if (
|
|
1814
|
+
if (matchedCriterion == null) {
|
|
1669
1815
|
return [];
|
|
1670
1816
|
}
|
|
1817
|
+
var value = searchItem.filter[matchedCriterion.name];
|
|
1671
1818
|
var criterionSafeName = matchedCriterion.name !== null
|
|
1672
1819
|
? matchedCriterion.name.toString()
|
|
1673
1820
|
: '';
|
|
@@ -1681,7 +1828,7 @@ var AdvancedTableModalBaseComponent = /** @class */ (function (_super) {
|
|
|
1681
1828
|
}
|
|
1682
1829
|
else if (criterionSafeName !== 'undefined') {
|
|
1683
1830
|
applicableFilter = (this._template.transform(matchedCriterion.filter, Object.assign({
|
|
1684
|
-
value:
|
|
1831
|
+
value: value
|
|
1685
1832
|
}, defaultFilterValues)));
|
|
1686
1833
|
}
|
|
1687
1834
|
else {
|
|
@@ -1689,6 +1836,9 @@ var AdvancedTableModalBaseComponent = /** @class */ (function (_super) {
|
|
|
1689
1836
|
}
|
|
1690
1837
|
return [applicableFilter];
|
|
1691
1838
|
};
|
|
1839
|
+
AdvancedTableModalBaseComponent.prototype.onFilterSelect = function (value) {
|
|
1840
|
+
this.advancedSearch(value);
|
|
1841
|
+
};
|
|
1692
1842
|
/**
|
|
1693
1843
|
*
|
|
1694
1844
|
* Runs a filter against the modal table
|
|
@@ -1745,6 +1895,7 @@ var AdvancedTableModalBaseComponent = /** @class */ (function (_super) {
|
|
|
1745
1895
|
};
|
|
1746
1896
|
AdvancedTableModalBaseComponent.decorators = [
|
|
1747
1897
|
{ type: Component, args: [{
|
|
1898
|
+
// tslint:disable-next-line: component-selector
|
|
1748
1899
|
selector: 'app-advanced-table-modal',
|
|
1749
1900
|
template: AdvancedTableModalBaseTemplate,
|
|
1750
1901
|
styles: ["\n\n "]
|
|
@@ -2770,7 +2921,7 @@ var AdvancedSelectComponent = /** @class */ (function (_super) {
|
|
|
2770
2921
|
{ type: Component, args: [{
|
|
2771
2922
|
// tslint:disable-next-line: component-selector
|
|
2772
2923
|
selector: 'app-advanced-select',
|
|
2773
|
-
template: "<div class=\"modal-header\" *ngIf=\"modalTitle\">\n <h5 class=\"modal-title\">{{modalTitle | translate}}</h5>\n <button [disabled]=\"cancelButtonDisabled\" (click)=\"cancel()\" type=\"button\" class=\"close\" data-dismiss=\"modal\"\n aria-label=\"Cancel\">\n <span aria-hidden=\"true\">×</span>\n </button>\n</div>\n<div class=\"modal-body\">\n <div>\n <!-- search -->\n <div class=\"row mt-3\">\n <div class=\"col-12 col-lg-3\">\n <div class=\"input-group mb-3\">\n <input spellcheck=\"false\" type=\"text\" (keyup)=\"onKeyUp($event)\" [(ngModel)]=\"searchText\"\n class=\"form-control bg-gray-100 border-0\" placeholder=\"{{'Tables.SearchPlaceholder' | translate}}\"\n aria-label=\"Search\" aria-describedby=\"basic-addon2\">\n <div class=\"input-group-append\">\n <button class=\"btn btn-default bg-gray-100 border-0\" type=\"button\">\n <i class=\"fa fa-search text-secondary\"></i>\n </button>\n </div>\n </div>\n </div>\n <div #emptyTable class=\"d-none\">\n <div>\n <div class=\"mt-4\">\n <div class=\"icon-circle bg-gray-300 border-gray-100\"></div>\n </div>\n <div class=\"mt-4\">\n <h4 class=\"font-3xl text-dark\" [translate]=\"'Tables.EmptyTableTitle'\"></h4>\n <p class=\"font-lg text-dark\" [translate]=\"'Tables.EmptyTableMessage'\"></p>\n </div>\n\n </div>\n </div>\n <div class=\"col-12 col-lg-5\">\n <div class=\"btn-toolbar\">\n <button class=\"btn btn-gray-100\">\n <i class=\"fa fa-sliders-h pr-2 text-secondary\" aria-hidden=\"true\"></i>{{'Tables.Filters' | translate}}\n </button>\n <div class=\"dropdown ml-3\"
|
|
2924
|
+
template: "<div class=\"modal-header\" *ngIf=\"modalTitle\">\n <h5 class=\"modal-title\">{{modalTitle | translate}}</h5>\n <button [disabled]=\"cancelButtonDisabled\" (click)=\"cancel()\" type=\"button\" class=\"close\" data-dismiss=\"modal\"\n aria-label=\"Cancel\">\n <span aria-hidden=\"true\">×</span>\n </button>\n</div>\n<div class=\"modal-body\">\n <div>\n <!-- search -->\n <div class=\"row mt-3\">\n <div class=\"col-12 col-lg-3\">\n <div class=\"input-group mb-3\">\n <input spellcheck=\"false\" type=\"text\" (keyup)=\"onKeyUp($event)\" [(ngModel)]=\"searchText\"\n class=\"form-control bg-gray-100 border-0\" placeholder=\"{{'Tables.SearchPlaceholder' | translate}}\"\n aria-label=\"Search\" aria-describedby=\"basic-addon2\">\n <div class=\"input-group-append\">\n <button class=\"btn btn-default bg-gray-100 border-0\" type=\"button\">\n <i class=\"fa fa-search text-secondary\"></i>\n </button>\n </div>\n </div>\n </div>\n <div #emptyTable class=\"d-none\">\n <div>\n <div class=\"mt-4\">\n <div class=\"icon-circle bg-gray-300 border-gray-100\"></div>\n </div>\n <div class=\"mt-4\">\n <h4 class=\"font-3xl text-dark\" [translate]=\"'Tables.EmptyTableTitle'\"></h4>\n <p class=\"font-lg text-dark\" [translate]=\"'Tables.EmptyTableMessage'\"></p>\n </div>\n\n </div>\n </div>\n <div class=\"col-12 col-lg-5\">\n <div class=\"btn-toolbar\">\n <button class=\"btn btn-gray-100\">\n <i class=\"fa fa-sliders-h pr-2 text-secondary\" aria-hidden=\"true\"></i>{{'Tables.Filters' | translate}}\n </button>\n <div class=\"dropdown ml-3\">\n <button dropdownToggle class=\"btn btn-gray-100 dropdown-toggle\" type=\"button\" id=\"dropdownDefaultFilters\"\n data-toggle=\"dropdown\">\n {{ this.defaultFilter.name | translate }}\n </button>\n <div class=\"dropdown-menu\" aria-labelledby=\"dropdownDefaultFilters\">\n <a class=\"dropdown-item\" *ngFor=\"let filter of defaultFilters\"\n (click)=\"advancedSearch(filter.filter ? filter : '')\">\n {{ filter.name | translate }}\n </a>\n </div>\n </div>\n </div>\n </div>\n <div class=\"col text-lg-right mt-3 mt-lg-0\">\n <button [disabled]=\"true\" class=\"btn rounded-pill btn-outline-theme\">\n <span class=\"pr-2 font-lg\">+</span><span [translate]=\"'Tables.AddItem'\"></span>\n </button>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\" [ngClass]=\"{ 'component-loading': loading}\">\n <app-advanced-table #advancedTable (init)=\"onTableInit($event)\" (load)=\"onDataLoad($event)\"\n [autoLoad]=\"true\"\n [selectable]=\"true\" [multipleSelect]=\"true\" [scrollX]=\"false\" [scrollY]=\"320\" [pageLength]=\"pageLength\"\n [scrollable]=\"false\" [showFooter]=\"false\" [showActions]=\"false\" [lengthMenu]=\"lengthMenu\"\n [config]=\"tableConfig\" [configSrc]=\"tableConfigSrc\"></app-advanced-table>\n </div>\n </div>\n <div class=\"row mt-3 table-custom-pager\">\n <div class=\"col-12 d-flex\" *ngIf=\"recordsTotal\">\n <div class=\"mt-2 ml-auto mr-3 text-secondary\" [translate]=\"'Tables.RecordsPerPage'\"></div>\n <div class=\"dropdown mr-3\">\n <button dropdownToggle class=\"btn btn-gray-100 dropdown-toggle\" type=\"button\" id=\"dropdownPageSize\"\n data-toggle=\"dropdown\">\n {{pageLength}}\n </button>\n <div class=\"dropdown-menu\" aria-labelledby=\"dropdownPageSize\">\n <button (click)=\"setLength(item)\" class=\"dropdown-item dropdown-item-theme\" type=\"button\"\n *ngFor=\"let item of lengthMenu\">{{item}}</button>\n </div>\n </div>\n <div class=\"mt-2 mr-2\" [translate]=\"'Tables.PageInfo'\" [translateParams]=\"pageInfo\"></div>\n <button [disabled]=\"pageInfo && pageInfo.page === 0\" class=\"btn text-nowrap\" (click)=\"firstPage()\">\n <i class=\"fa fa-chevron-left text-color-theme\"></i>\n <i class=\"fa fa-chevron-left text-color-theme\"></i>\n </button>\n <button [disabled]=\"pageInfo && pageInfo.page===0\" class=\"btn\" (click)=\"previousPage()\">\n <i class=\"fa fa-chevron-left text-color-theme\"></i>\n </button>\n <button [disabled]=\"pageInfo && pageInfo.page===pageInfo.pages-1\" class=\"btn\" (click)=\"nextPage()\">\n <i class=\"fa fa-chevron-right text-color-theme\"></i>\n </button>\n <button [disabled]=\"pageInfo && pageInfo.page===pageInfo.pages-1\" class=\"btn text-nowrap\"\n (click)=\"lastPage()\">\n <i class=\"fa fa-chevron-right text-color-theme\"></i>\n <i class=\"fa fa-chevron-right text-color-theme\"></i>\n </button>\n </div>\n </div>\n </div>\n</div>\n<div class=\"modal-footer justify-content-end\">\n <button [disabled]=\"okButtonDisabled\" (click)=\"ok()\" type=\"button\" [ngClass]=\"okButtonClass\">\n {{okButtonText | translate}}\n </button>\n <button [disabled]=\"cancelButtonDisabled\" (click)=\"cancel()\" type=\"button\" [ngClass]=\"cancelButtonClass\"\n data-dismiss=\"modal\">\n {{ cancelButtonText | translate}}\n </button>\n</div>\n",
|
|
2774
2925
|
encapsulation: ViewEncapsulation.None,
|
|
2775
2926
|
styles: ["\n .modal-table .dataTables_wrapper {\n height: 50vh;\n overflow-y: auto;\n }\n "]
|
|
2776
2927
|
}] }
|
|
@@ -3027,7 +3178,7 @@ var AdvancedTableSearchComponent = /** @class */ (function (_super) {
|
|
|
3027
3178
|
_this.collapsed = true;
|
|
3028
3179
|
_this.allowSave = true;
|
|
3029
3180
|
_this.showMore = true;
|
|
3030
|
-
_this.mergeQueryParams =
|
|
3181
|
+
_this.mergeQueryParams = false;
|
|
3031
3182
|
_this.viewChange = new EventEmitter();
|
|
3032
3183
|
_this.userSearchList = [];
|
|
3033
3184
|
_this.selectedList = null;
|
|
@@ -3523,7 +3674,7 @@ var AdvancedTableSearchComponent = /** @class */ (function (_super) {
|
|
|
3523
3674
|
{ type: Component, args: [{
|
|
3524
3675
|
// tslint:disable-next-line: component-selector
|
|
3525
3676
|
selector: 'app-advanced-table-search',
|
|
3526
|
-
template: "<div class=\"s--list-navbar d-none d-sm-block\">\n\n <div id=\"collapse-header\" [ngClass]=\"{'show':collapsed}\" class=\"collapse multi-collapse\">\n <form class=\"form-inline p-3 col\">\n <div class=\"form-group col-7\" [ngClass]= \"{ 'col-12': !showMore }\">\n <label class=\"pr-3\" for=\"searchText\" [translate]=\"'Tables.Search'\"></label>\n <input (keydown)=\"onSearchKeyDown($event)\" spellcheck=\"false\" type=\"text\" id=\"searchText\" name=\"searchText\"\n class=\"form-control col text-left\" placeholder=\"{{ 'Tables.SearchPlaceholder' | translate }}\" #searchText>\n </div>\n <div *ngIf=\"showMore\" class=\"col-5 text-right text-secondary\" id=\"heading3\">\n <button class=\"d-inline-block btn btn-link collapsed float-right text-secondary text-decoration-none\"\n type=\"button\" (click)=\"toggleView();\">\n <span class=\"d-none d-sm-inline\" [translate]=\"'AdvancedSearch.More'\"></span>\n <i class=\"ml-2 pt-1 fa fa-chevron-down\"></i>\n </button>\n </div>\n </form>\n </div>\n\n <div id=\"collapse3\" [ngClass]=\"{'show':!collapsed}\" class=\"collapse multi-collapse\" aria-labelledby=\"heading3\">\n <div class=\"row\">\n <div class=\"col-sm-12\">\n <div id=\"advanced-form\">\n <ng-content select=\"advanced-search\"></ng-content>\n <hr class=\"mt-0 mb-0\" width=\"97%\">\n <div class=\"row\">\n <div class=\"col-sm-12\">\n <div class=\"form-inline pb-3 pt-3 pr-1 pl-1 col\">\n\n <div class=\"form-group col-4\">\n <div class=\"d-flex flex-row w-100\" *ngIf=\"allowSave\">\n <label class=\"pr-3 d-none\" [translate]=\"'AdvancedSearch.SavedSearches'\"></label>\n <select *ngIf=\"userSearchList\" class=\"custom-select text-secondary flex col-12\" (change)=\"onSelectUserSearch($event)\" [(ngModel)]=\"selectedList\">\n <option [ngValue]=\"null\" [translate]=\"'AdvancedSearch.Choose'\"></option>\n <option *ngFor=\"let item of userSearchList\" [ngValue]=\"item\">{{ item.name }}</option>\n </select>\n <select *ngIf=\"!userSearchList\" class=\"custom-select flex col-6\">\n <option [value]=\"null\" [translate]=\"'AdvancedSearch.Choose'\"></option>\n </select>\n </div>\n </div>\n\n <div class=\"col-3 d-flex flex-row w-100\">\n <div class=\"btn-group\" *ngIf=\"allowSave\"
|
|
3677
|
+
template: "<div class=\"s--list-navbar d-none d-sm-block\">\n\n <div id=\"collapse-header\" [ngClass]=\"{'show':collapsed}\" class=\"collapse multi-collapse\">\n <form class=\"form-inline p-3 col\">\n <div class=\"form-group col-7\" [ngClass]= \"{ 'col-12': !showMore }\">\n <label class=\"pr-3\" for=\"searchText\" [translate]=\"'Tables.Search'\"></label>\n <input (keydown)=\"onSearchKeyDown($event)\" spellcheck=\"false\" type=\"text\" id=\"searchText\" name=\"searchText\"\n class=\"form-control col text-left\" placeholder=\"{{ 'Tables.SearchPlaceholder' | translate }}\" #searchText>\n </div>\n <div *ngIf=\"showMore\" class=\"col-5 text-right text-secondary\" id=\"heading3\">\n <button class=\"d-inline-block btn btn-link collapsed float-right text-secondary text-decoration-none\"\n type=\"button\" (click)=\"toggleView();\">\n <span class=\"d-none d-sm-inline\" [translate]=\"'AdvancedSearch.More'\"></span>\n <i class=\"ml-2 pt-1 fa fa-chevron-down\"></i>\n </button>\n </div>\n </form>\n </div>\n\n <div id=\"collapse3\" [ngClass]=\"{'show':!collapsed}\" class=\"collapse multi-collapse\" aria-labelledby=\"heading3\">\n <div class=\"row\">\n <div class=\"col-sm-12\">\n <div id=\"advanced-form\">\n <ng-content select=\"advanced-search\"></ng-content>\n <hr class=\"mt-0 mb-0\" width=\"97%\">\n <div class=\"row\">\n <div class=\"col-sm-12\">\n <div class=\"form-inline pb-3 pt-3 pr-1 pl-1 col\">\n\n <div class=\"form-group col-4\">\n <div class=\"d-flex flex-row w-100\" *ngIf=\"allowSave\">\n <label class=\"pr-3 d-none\" [translate]=\"'AdvancedSearch.SavedSearches'\"></label>\n <select *ngIf=\"userSearchList\" class=\"custom-select text-secondary flex col-12\" (change)=\"onSelectUserSearch($event)\" [(ngModel)]=\"selectedList\">\n <option [ngValue]=\"null\" [translate]=\"'AdvancedSearch.Choose'\"></option>\n <option *ngFor=\"let item of userSearchList\" [ngValue]=\"item\">{{ item.name }}</option>\n </select>\n <select *ngIf=\"!userSearchList\" class=\"custom-select flex col-6\">\n <option [value]=\"null\" [translate]=\"'AdvancedSearch.Choose'\"></option>\n </select>\n </div>\n </div>\n\n <div class=\"col-3 d-flex flex-row w-100\">\n <div class=\"btn-group\" *ngIf=\"allowSave\">\n <button type=\"button\" class=\"btn btn-sm btn-primary\" (click)=\"saveSearch(templateToUse, ( (selectedList && selectedList.readOnly) ? true : false ) )\" [translate]=\"'AdvancedSearch.SaveCurrentSearch'\"></button>\n <button type=\"button\" dropdownToggle class=\"btn btn-sm btn-primary dropdown-toggle dropdown-toggle-split\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n <span class=\"sr-only\" [translate]=\"'AdvancedSearch.ToggleDropdown'\"></span>\n </button>\n\n <div class=\"dropdown-menu\">\n <a [ngClass]=\"{'disabled': selectedList && selectedList.readOnly}\" class=\"dropdown-item\" (click)=\"saveSearch(templateToUse, false)\" [translate]=\"'AdvancedSearch.Save'\" href=\"javascript:void(0)\"></a>\n <a class=\"dropdown-item\" (click)=\"saveSearch(templateToUse)\" [translate]=\"'AdvancedSearch.SaveAs'\" href=\"javascript:void(0)\"></a>\n <div class=\"dropdown-divider\"></div>\n <a [ngClass]=\"{'disabled': selectedList && selectedList.readOnly}\" class=\"dropdown-item\" (click)=\"deleteItemFromSavedSearchListByObject(selectedList)\" [translate]=\"'AdvancedSearch.Delete'\" href=\"javascript:void(0)\"></a>\n </div>\n </div>\n </div>\n\n <div class=\"col-5 text-right text-secondary\">\n <button type=\"button\" class=\"btn btn-light text-secondary pl-2 pr-2 mr-2\" (click)=\"clear()\">\n <i class=\"fa fa-eraser\"></i>\n </button>\n <button type=\"button\" class=\"btn btn-success pl-4 pr-4 mr-2\" (click)=\"advancedSearch($event);\"\n [translate]=\"'Tables.Search'\"></button>\n <button class=\"d-inline-block btn btn-link collapsed float-right text-secondary text-decoration-none\"\n type=\"button\" (click)=\"toggleView();\">\n <span class=\"d-none d-sm-inline\" [translate]=\"'AdvancedSearch.Less'\"></span>\n <i class=\"ml-2 pt-1 fa fa-chevron-up\"></i>\n </button>\n </div>\n\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <ng-template #templateToUse>\n <div class=\"modal-header\">\n <h4 class=\"modal-title pull-left\" [translate]=\"'AdvancedSearch.Modal.Title'\"></h4>\n <button type=\"button\" class=\"close pull-right\" aria-label=\"Close\" (click)=\"modalRef.hide()\">\n <span aria-hidden=\"true\">×</span>\n </button>\n </div>\n <div class=\"modal-body mt-0 mb-0 text-center\">\n <div>\n <p class=\"text-secondary text-left\" [translate]=\"'AdvancedSearch.Modal.Help'\"></p>\n </div>\n <form class=\"p-3 text-center\" #newListForm=\"ngForm\" >\n <div [ngVar]=\"{ name: ( selectedList?.name ? ( selectedList?.name + ' (1)' ) : null ) }\" #model=\"ngVar\">\n <input [(ngModel)]=\"model.value.name\" [required]=\"true\" id=\"newListName\" name=\"newListName\" type=\"text\" class=\"form-control\" placeholder=\"{{ 'AdvancedSearch.Modal.SaveNamePlaceholder' | translate }}\"/>\n <div class=\"btn-group mt-4\">\n <button [disabled]=\"newListForm.invalid\" type=\"button\" class=\"btn btn-primary\" (click)=\"confirmModal(model.value.name)\" [translate]=\"'AdvancedSearch.Modal.Accept'\"></button>\n <button type=\"button\" class=\"btn btn-gray-300 text-white\" (click)=\"closeModal()\" [translate]=\"'AdvancedSearch.Modal.Close'\"></button>\n </div>\n </div>\n </form>\n </div>\n </ng-template>\n\n</div>\n",
|
|
3527
3678
|
encapsulation: ViewEncapsulation.None
|
|
3528
3679
|
}] }
|
|
3529
3680
|
];
|
|
@@ -3564,6 +3715,8 @@ var FORMATTERS = {
|
|
|
3564
3715
|
TemplateFormatter: new TemplateFormatter(),
|
|
3565
3716
|
TranslationFormatter: new TranslationFormatter(),
|
|
3566
3717
|
TrueFalseFormatter: new TrueFalseFormatter(),
|
|
3718
|
+
ActionButtonFormatter: new ActionButtonFormatter(),
|
|
3719
|
+
ActionSplitButtonFormatter: new ActionSplitButtonFormatter(),
|
|
3567
3720
|
};
|
|
3568
3721
|
|
|
3569
3722
|
var SimpleHeaderToolsComponent = /** @class */ (function () {
|
|
@@ -4370,7 +4523,6 @@ var TablesModule = /** @class */ (function () {
|
|
|
4370
4523
|
AdvancedFormsModule,
|
|
4371
4524
|
SharedModule,
|
|
4372
4525
|
ModalModule,
|
|
4373
|
-
BsDropdownModule,
|
|
4374
4526
|
ProgressbarModule,
|
|
4375
4527
|
NgPipesModule
|
|
4376
4528
|
],
|
|
@@ -4445,6 +4597,6 @@ var TablesModule = /** @class */ (function () {
|
|
|
4445
4597
|
* Generated bundle index. Do not edit.
|
|
4446
4598
|
*/
|
|
4447
4599
|
|
|
4448
|
-
export { AddItemsComponent, AdvancedAggregatorComponent, AdvancedAggregatorListComponent, AdvancedListComponent, AdvancedRowActionComponent, AdvancedSearchFormComponent, AdvancedSelectComponent, AdvancedSelectService, AdvancedTableConfigurationResolver, AdvancedSearchConfigurationResolver, AdvancedColumnFormatter, NestedPropertyFormatter, ButtonFormatter, LinkFormatter, ActionLinkFormatter, SelectRowFormatter, TemplateFormatter, TrueFalseFormatter, TranslationFormatter, DateTimeFormatter, NgClassFormatter, LanguageFormatter, COLUMN_FORMATTERS, AdvancedTableConfiguration, AdvancedTableComponent, AdvancedTableSettingsComponent, AdvancedTableSearchBaseComponent, AdvancedTableSearchComponent, FORMATTERS, AdvancedFilterValueProvider, AdvancedTableModalBaseTemplate, AdvancedTableModalBaseComponent, SimpleHeaderToolsComponent, TableSimpleHeaderComponent, AdvancedTableNotNullError, AdvancedTableEditorDirective, BtnExpDirective, AdvancedAggregatorPipe, ParseTitlePipe, AdvancedAggregatorService, TablesModule, ɵ0, ActivatedTableService };
|
|
4600
|
+
export { AddItemsComponent, AdvancedAggregatorComponent, AdvancedAggregatorListComponent, AdvancedListComponent, AdvancedRowActionComponent, AdvancedSearchFormComponent, AdvancedSelectComponent, AdvancedSelectService, AdvancedTableConfigurationResolver, AdvancedSearchConfigurationResolver, AdvancedColumnFormatter, NestedPropertyFormatter, ButtonFormatter, LinkFormatter, ActionLinkFormatter, ActionButtonFormatter, ActionSplitButtonFormatter, SelectRowFormatter, TemplateFormatter, TrueFalseFormatter, TranslationFormatter, DateTimeFormatter, NgClassFormatter, LanguageFormatter, COLUMN_FORMATTERS, AdvancedTableConfiguration, AdvancedTableComponent, AdvancedTableSettingsComponent, AdvancedTableSearchBaseComponent, AdvancedTableSearchComponent, FORMATTERS, AdvancedFilterValueProvider, AdvancedTableModalBaseTemplate, AdvancedTableModalBaseComponent, SimpleHeaderToolsComponent, TableSimpleHeaderComponent, AdvancedTableNotNullError, AdvancedTableEditorDirective, BtnExpDirective, AdvancedAggregatorPipe, ParseTitlePipe, AdvancedAggregatorService, TablesModule, ɵ0, ActivatedTableService };
|
|
4449
4601
|
|
|
4450
4602
|
//# sourceMappingURL=universis-ngx-tables.js.map
|