cilog-lib 0.3.7 → 0.4.1

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.
Files changed (53) hide show
  1. package/cilog-lib.d.ts +1 -3
  2. package/esm2020/cilog-lib.mjs +5 -0
  3. package/esm2020/lib/cilog-lib.component.mjs +26 -0
  4. package/esm2020/lib/cilog-lib.module.mjs +69 -0
  5. package/esm2020/lib/cilog-lib.service.mjs +14 -0
  6. package/esm2020/lib/helpers/enums/grille.enum.mjs +24 -0
  7. package/esm2020/lib/helpers/interfaces/edition.interface.mjs +2 -0
  8. package/esm2020/lib/helpers/interfaces/grille.interface.mjs +2 -0
  9. package/esm2020/lib/helpers/interfaces/message.interface.mjs +2 -0
  10. package/esm2020/lib/modules/primeng.module.mjs +72 -0
  11. package/esm2020/lib/services/message.service.mjs +27 -0
  12. package/esm2020/lib/services/table.service.mjs +14 -0
  13. package/esm2020/lib/views/message/message.component.mjs +77 -0
  14. package/esm2020/lib/views/table/table.component.mjs +312 -0
  15. package/esm2020/public-api.mjs +20 -0
  16. package/fesm2015/cilog-lib.mjs +620 -0
  17. package/fesm2015/cilog-lib.mjs.map +1 -0
  18. package/fesm2020/cilog-lib.mjs +620 -0
  19. package/fesm2020/cilog-lib.mjs.map +1 -0
  20. package/lib/cilog-lib.component.d.ts +3 -0
  21. package/lib/cilog-lib.module.d.ts +12 -0
  22. package/lib/cilog-lib.service.d.ts +3 -0
  23. package/lib/helpers/enums/grille.enum.d.ts +1 -0
  24. package/lib/helpers/interfaces/edition.interface.d.ts +1 -0
  25. package/lib/helpers/interfaces/grille.interface.d.ts +3 -0
  26. package/lib/modules/primeng.module.d.ts +18 -0
  27. package/lib/services/message.service.d.ts +3 -0
  28. package/lib/services/table.service.d.ts +3 -0
  29. package/lib/views/message/message.component.d.ts +3 -0
  30. package/lib/views/table/table.component.d.ts +11 -3
  31. package/package.json +22 -15
  32. package/public-api.d.ts +2 -0
  33. package/bundles/cilog-lib.umd.js +0 -837
  34. package/bundles/cilog-lib.umd.js.map +0 -1
  35. package/bundles/cilog-lib.umd.min.js +0 -2
  36. package/bundles/cilog-lib.umd.min.js.map +0 -1
  37. package/cilog-lib.metadata.json +0 -1
  38. package/esm2015/cilog-lib.js +0 -8
  39. package/esm2015/lib/cilog-lib.component.js +0 -18
  40. package/esm2015/lib/cilog-lib.module.js +0 -44
  41. package/esm2015/lib/cilog-lib.service.js +0 -13
  42. package/esm2015/lib/helpers/enums/grille.enum.js +0 -23
  43. package/esm2015/lib/helpers/interfaces/edition.interface.js +0 -2
  44. package/esm2015/lib/helpers/interfaces/grille.interface.js +0 -2
  45. package/esm2015/lib/helpers/interfaces/message.interface.js +0 -2
  46. package/esm2015/lib/modules/primeng.module.js +0 -39
  47. package/esm2015/lib/services/message.service.js +0 -25
  48. package/esm2015/lib/services/table.service.js +0 -13
  49. package/esm2015/lib/views/message/message.component.js +0 -76
  50. package/esm2015/lib/views/table/table.component.js +0 -260
  51. package/esm2015/public-api.js +0 -18
  52. package/fesm2015/cilog-lib.js +0 -503
  53. package/fesm2015/cilog-lib.js.map +0 -1
@@ -1,837 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('@angular/common'), require('primeng/dialog'), require('primeng/button'), require('primeng/table'), require('primeng/inputtext'), require('primeng/selectbutton'), require('primeng/dropdown'), require('primeng/inputnumber'), require('primeng/confirmdialog'), require('primeng/multiselect'), require('primeng/calendar'), require('primeng/tag'), require('primeng/tooltip'), require('@angular/platform-browser'), require('@angular/platform-browser/animations'), require('primeng/api'), require('@angular/forms'), require('@angular/common/locales/fr')) :
3
- typeof define === 'function' && define.amd ? define('cilog-lib', ['exports', '@angular/core', 'rxjs', '@angular/common', 'primeng/dialog', 'primeng/button', 'primeng/table', 'primeng/inputtext', 'primeng/selectbutton', 'primeng/dropdown', 'primeng/inputnumber', 'primeng/confirmdialog', 'primeng/multiselect', 'primeng/calendar', 'primeng/tag', 'primeng/tooltip', '@angular/platform-browser', '@angular/platform-browser/animations', 'primeng/api', '@angular/forms', '@angular/common/locales/fr'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['cilog-lib'] = {}, global.ng.core, global.rxjs, global.ng.common, global.dialog, global.button, global.table, global.inputtext, global.selectbutton, global.dropdown, global.inputnumber, global.confirmdialog, global.multiselect, global.calendar, global.tag, global.tooltip, global.ng.platformBrowser, global.ng.platformBrowser.animations, global.api, global.ng.forms, global.ng.common.locales.fr));
5
- }(this, (function (exports, i0, rxjs, common, dialog, button, table, inputtext, selectbutton, dropdown, inputnumber, confirmdialog, multiselect, calendar, tag, tooltip, platformBrowser, animations, api, forms, localeFr) { 'use strict';
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- var localeFr__default = /*#__PURE__*/_interopDefaultLegacy(localeFr);
10
-
11
- var CilogMessageService = /** @class */ (function () {
12
- function CilogMessageService() {
13
- this.message = new rxjs.BehaviorSubject(null);
14
- this.display = new rxjs.BehaviorSubject(null);
15
- }
16
- CilogMessageService.prototype.showDialog = function (pContent, pSeverity, pClosable, pRefresh) {
17
- if (pClosable === void 0) { pClosable = true; }
18
- if (pRefresh === void 0) { pRefresh = false; }
19
- this.message.next({
20
- content: pContent,
21
- severity: pSeverity,
22
- closable: pClosable,
23
- refresh: pRefresh
24
- });
25
- this.display.next(true);
26
- };
27
- CilogMessageService.prototype.closeDialog = function () {
28
- this.display.next(false);
29
- };
30
- return CilogMessageService;
31
- }());
32
- CilogMessageService.decorators = [
33
- { type: i0.Injectable }
34
- ];
35
- CilogMessageService.ctorParameters = function () { return []; };
36
-
37
- var CilogMessageComponent = /** @class */ (function () {
38
- function CilogMessageComponent(messageService) {
39
- this.messageService = messageService;
40
- }
41
- CilogMessageComponent.prototype.ngOnInit = function () {
42
- var _this = this;
43
- this.display = false;
44
- this.messageService.message.subscribe(function (message) {
45
- if (message != null) {
46
- _this.message = message;
47
- }
48
- });
49
- this.messageService.display.subscribe(function (display) {
50
- if (display != null) {
51
- _this.display = display;
52
- }
53
- });
54
- };
55
- CilogMessageComponent.prototype.headerBySeverity = function () {
56
- if (this.message != null) {
57
- switch (this.message.severity) {
58
- case 'warn':
59
- return 'Attention';
60
- case 'error':
61
- return 'Erreur';
62
- case 'success':
63
- return 'Succès';
64
- case 'info':
65
- return 'Information';
66
- }
67
- }
68
- };
69
- CilogMessageComponent.prototype.iconBySeverity = function () {
70
- if (this.message != null) {
71
- switch (this.message.severity) {
72
- case 'warn':
73
- return 'pi-exclamation-triangle';
74
- case 'error':
75
- return 'pi-exclamation-circle';
76
- case 'success':
77
- return 'pi-check';
78
- case 'info':
79
- return 'pi-info-circle';
80
- }
81
- }
82
- };
83
- CilogMessageComponent.prototype.classBySeverity = function () {
84
- if (this.message != null) {
85
- switch (this.message.severity) {
86
- case 'warn':
87
- return 'message_warn';
88
- case 'error':
89
- return 'message_error';
90
- case 'success':
91
- return 'message_success';
92
- case 'info':
93
- return 'message_info';
94
- }
95
- }
96
- };
97
- CilogMessageComponent.prototype.refreshPage = function () {
98
- window.location.reload(true);
99
- };
100
- return CilogMessageComponent;
101
- }());
102
- CilogMessageComponent.decorators = [
103
- { type: i0.Component, args: [{
104
- selector: 'cilog-message',
105
- template: "<p-dialog [styleClass]=\"classBySeverity()\"\r\n [(visible)]=\"display\"\r\n [modal]=\"true\"\r\n [baseZIndex]=\"10000\"\r\n [closable]=\"false\"\r\n [resizable]=\"false\"\r\n [draggable]=\"false\">\r\n\r\n <!-- Header -->\r\n <ng-template pTemplate=\"header\">\r\n <i class=\"pi {{ iconBySeverity() }} header_icon\"></i>\r\n <span class=\"header_text\">{{ headerBySeverity() }}</span>\r\n </ng-template>\r\n\r\n <!-- Content -->\r\n <p class=\"content\">\r\n {{ message?.content }}\r\n </p>\r\n\r\n <!-- Footer -->\r\n <ng-template pTemplate=\"footer\">\r\n <p-button *ngIf=\"message?.closable == true && message?.refresh == false\" icon=\"pi pi-check\" (click)=\"display=false\" label=\"Ok\" styleClass=\"p-button-text\"></p-button>\r\n <p-button *ngIf=\"message?.refresh == true\" icon=\"pi pi-refresh\" (click)=\"refreshPage()\" label=\"Rafra\u00EEchir\" styleClass=\"p-button-text\"></p-button>\r\n </ng-template>\r\n\r\n</p-dialog>\r\n",
106
- styles: [":host ::ng-deep .message_success :nth-child(1n){background-color:#b7fdc0}:host ::ng-deep .message_error :nth-child(1n){background-color:#fdb8b7}:host ::ng-deep .message_warn :nth-child(1n){background-color:#fff5ba}:host ::ng-deep .message_info :nth-child(1n){background-color:#b7eefd}:host ::ng-deep .p-dialog-content,:host ::ng-deep .p-dialog-footer,:host ::ng-deep .p-dialog-header{padding:10px}:host ::ng-deep .content{margin:4px}:host ::ng-deep .p-button-text{padding-bottom:3px;padding-top:0}:host ::ng-deep .header_text{font-size:1.25rem;font-weight:500;margin-left:10px}:host ::ng-deep .header_icon{font-size:1.5rem}:host ::ng-deep .p-dialog-header{justify-content:inherit}"]
107
- },] }
108
- ];
109
- CilogMessageComponent.ctorParameters = function () { return [
110
- { type: CilogMessageService }
111
- ]; };
112
-
113
- var CilogLibComponent = /** @class */ (function () {
114
- function CilogLibComponent() {
115
- }
116
- CilogLibComponent.prototype.ngOnInit = function () {
117
- };
118
- return CilogLibComponent;
119
- }());
120
- CilogLibComponent.decorators = [
121
- { type: i0.Component, args: [{
122
- selector: 'lib-cilog-lib',
123
- template: "\n <p>\n cilog-lib works!\n </p>\n "
124
- },] }
125
- ];
126
- CilogLibComponent.ctorParameters = function () { return []; };
127
-
128
- var PrimengModule = /** @class */ (function () {
129
- function PrimengModule() {
130
- }
131
- return PrimengModule;
132
- }());
133
- PrimengModule.decorators = [
134
- { type: i0.NgModule, args: [{
135
- declarations: [],
136
- exports: [
137
- dialog.DialogModule,
138
- button.ButtonModule,
139
- table.TableModule,
140
- inputtext.InputTextModule,
141
- selectbutton.SelectButtonModule,
142
- dropdown.DropdownModule,
143
- inputnumber.InputNumberModule,
144
- confirmdialog.ConfirmDialogModule,
145
- multiselect.MultiSelectModule,
146
- calendar.CalendarModule,
147
- tag.TagModule,
148
- tooltip.TooltipModule
149
- ],
150
- imports: [
151
- common.CommonModule
152
- ]
153
- },] }
154
- ];
155
-
156
- /*! *****************************************************************************
157
- Copyright (c) Microsoft Corporation.
158
-
159
- Permission to use, copy, modify, and/or distribute this software for any
160
- purpose with or without fee is hereby granted.
161
-
162
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
163
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
164
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
165
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
166
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
167
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
168
- PERFORMANCE OF THIS SOFTWARE.
169
- ***************************************************************************** */
170
- /* global Reflect, Promise */
171
- var extendStatics = function (d, b) {
172
- extendStatics = Object.setPrototypeOf ||
173
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
174
- function (d, b) { for (var p in b)
175
- if (Object.prototype.hasOwnProperty.call(b, p))
176
- d[p] = b[p]; };
177
- return extendStatics(d, b);
178
- };
179
- function __extends(d, b) {
180
- if (typeof b !== "function" && b !== null)
181
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
182
- extendStatics(d, b);
183
- function __() { this.constructor = d; }
184
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
185
- }
186
- var __assign = function () {
187
- __assign = Object.assign || function __assign(t) {
188
- for (var s, i = 1, n = arguments.length; i < n; i++) {
189
- s = arguments[i];
190
- for (var p in s)
191
- if (Object.prototype.hasOwnProperty.call(s, p))
192
- t[p] = s[p];
193
- }
194
- return t;
195
- };
196
- return __assign.apply(this, arguments);
197
- };
198
- function __rest(s, e) {
199
- var t = {};
200
- for (var p in s)
201
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
202
- t[p] = s[p];
203
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
204
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
205
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
206
- t[p[i]] = s[p[i]];
207
- }
208
- return t;
209
- }
210
- function __decorate(decorators, target, key, desc) {
211
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
212
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
213
- r = Reflect.decorate(decorators, target, key, desc);
214
- else
215
- for (var i = decorators.length - 1; i >= 0; i--)
216
- if (d = decorators[i])
217
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
218
- return c > 3 && r && Object.defineProperty(target, key, r), r;
219
- }
220
- function __param(paramIndex, decorator) {
221
- return function (target, key) { decorator(target, key, paramIndex); };
222
- }
223
- function __metadata(metadataKey, metadataValue) {
224
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
225
- return Reflect.metadata(metadataKey, metadataValue);
226
- }
227
- function __awaiter(thisArg, _arguments, P, generator) {
228
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
229
- return new (P || (P = Promise))(function (resolve, reject) {
230
- function fulfilled(value) { try {
231
- step(generator.next(value));
232
- }
233
- catch (e) {
234
- reject(e);
235
- } }
236
- function rejected(value) { try {
237
- step(generator["throw"](value));
238
- }
239
- catch (e) {
240
- reject(e);
241
- } }
242
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
243
- step((generator = generator.apply(thisArg, _arguments || [])).next());
244
- });
245
- }
246
- function __generator(thisArg, body) {
247
- var _ = { label: 0, sent: function () { if (t[0] & 1)
248
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
249
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
250
- function verb(n) { return function (v) { return step([n, v]); }; }
251
- function step(op) {
252
- if (f)
253
- throw new TypeError("Generator is already executing.");
254
- while (_)
255
- try {
256
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
257
- return t;
258
- if (y = 0, t)
259
- op = [op[0] & 2, t.value];
260
- switch (op[0]) {
261
- case 0:
262
- case 1:
263
- t = op;
264
- break;
265
- case 4:
266
- _.label++;
267
- return { value: op[1], done: false };
268
- case 5:
269
- _.label++;
270
- y = op[1];
271
- op = [0];
272
- continue;
273
- case 7:
274
- op = _.ops.pop();
275
- _.trys.pop();
276
- continue;
277
- default:
278
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
279
- _ = 0;
280
- continue;
281
- }
282
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
283
- _.label = op[1];
284
- break;
285
- }
286
- if (op[0] === 6 && _.label < t[1]) {
287
- _.label = t[1];
288
- t = op;
289
- break;
290
- }
291
- if (t && _.label < t[2]) {
292
- _.label = t[2];
293
- _.ops.push(op);
294
- break;
295
- }
296
- if (t[2])
297
- _.ops.pop();
298
- _.trys.pop();
299
- continue;
300
- }
301
- op = body.call(thisArg, _);
302
- }
303
- catch (e) {
304
- op = [6, e];
305
- y = 0;
306
- }
307
- finally {
308
- f = t = 0;
309
- }
310
- if (op[0] & 5)
311
- throw op[1];
312
- return { value: op[0] ? op[1] : void 0, done: true };
313
- }
314
- }
315
- var __createBinding = Object.create ? (function (o, m, k, k2) {
316
- if (k2 === undefined)
317
- k2 = k;
318
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
319
- }) : (function (o, m, k, k2) {
320
- if (k2 === undefined)
321
- k2 = k;
322
- o[k2] = m[k];
323
- });
324
- function __exportStar(m, o) {
325
- for (var p in m)
326
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
327
- __createBinding(o, m, p);
328
- }
329
- function __values(o) {
330
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
331
- if (m)
332
- return m.call(o);
333
- if (o && typeof o.length === "number")
334
- return {
335
- next: function () {
336
- if (o && i >= o.length)
337
- o = void 0;
338
- return { value: o && o[i++], done: !o };
339
- }
340
- };
341
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
342
- }
343
- function __read(o, n) {
344
- var m = typeof Symbol === "function" && o[Symbol.iterator];
345
- if (!m)
346
- return o;
347
- var i = m.call(o), r, ar = [], e;
348
- try {
349
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
350
- ar.push(r.value);
351
- }
352
- catch (error) {
353
- e = { error: error };
354
- }
355
- finally {
356
- try {
357
- if (r && !r.done && (m = i["return"]))
358
- m.call(i);
359
- }
360
- finally {
361
- if (e)
362
- throw e.error;
363
- }
364
- }
365
- return ar;
366
- }
367
- /** @deprecated */
368
- function __spread() {
369
- for (var ar = [], i = 0; i < arguments.length; i++)
370
- ar = ar.concat(__read(arguments[i]));
371
- return ar;
372
- }
373
- /** @deprecated */
374
- function __spreadArrays() {
375
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
376
- s += arguments[i].length;
377
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
378
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
379
- r[k] = a[j];
380
- return r;
381
- }
382
- function __spreadArray(to, from, pack) {
383
- if (pack || arguments.length === 2)
384
- for (var i = 0, l = from.length, ar; i < l; i++) {
385
- if (ar || !(i in from)) {
386
- if (!ar)
387
- ar = Array.prototype.slice.call(from, 0, i);
388
- ar[i] = from[i];
389
- }
390
- }
391
- return to.concat(ar || Array.prototype.slice.call(from));
392
- }
393
- function __await(v) {
394
- return this instanceof __await ? (this.v = v, this) : new __await(v);
395
- }
396
- function __asyncGenerator(thisArg, _arguments, generator) {
397
- if (!Symbol.asyncIterator)
398
- throw new TypeError("Symbol.asyncIterator is not defined.");
399
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
400
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
401
- function verb(n) { if (g[n])
402
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
403
- function resume(n, v) { try {
404
- step(g[n](v));
405
- }
406
- catch (e) {
407
- settle(q[0][3], e);
408
- } }
409
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
410
- function fulfill(value) { resume("next", value); }
411
- function reject(value) { resume("throw", value); }
412
- function settle(f, v) { if (f(v), q.shift(), q.length)
413
- resume(q[0][0], q[0][1]); }
414
- }
415
- function __asyncDelegator(o) {
416
- var i, p;
417
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
418
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
419
- }
420
- function __asyncValues(o) {
421
- if (!Symbol.asyncIterator)
422
- throw new TypeError("Symbol.asyncIterator is not defined.");
423
- var m = o[Symbol.asyncIterator], i;
424
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
425
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
426
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
427
- }
428
- function __makeTemplateObject(cooked, raw) {
429
- if (Object.defineProperty) {
430
- Object.defineProperty(cooked, "raw", { value: raw });
431
- }
432
- else {
433
- cooked.raw = raw;
434
- }
435
- return cooked;
436
- }
437
- ;
438
- var __setModuleDefault = Object.create ? (function (o, v) {
439
- Object.defineProperty(o, "default", { enumerable: true, value: v });
440
- }) : function (o, v) {
441
- o["default"] = v;
442
- };
443
- function __importStar(mod) {
444
- if (mod && mod.__esModule)
445
- return mod;
446
- var result = {};
447
- if (mod != null)
448
- for (var k in mod)
449
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
450
- __createBinding(result, mod, k);
451
- __setModuleDefault(result, mod);
452
- return result;
453
- }
454
- function __importDefault(mod) {
455
- return (mod && mod.__esModule) ? mod : { default: mod };
456
- }
457
- function __classPrivateFieldGet(receiver, state, kind, f) {
458
- if (kind === "a" && !f)
459
- throw new TypeError("Private accessor was defined without a getter");
460
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
461
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
462
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
463
- }
464
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
465
- if (kind === "m")
466
- throw new TypeError("Private method is not writable");
467
- if (kind === "a" && !f)
468
- throw new TypeError("Private accessor was defined without a setter");
469
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
470
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
471
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
472
- }
473
-
474
- (function (ColType) {
475
- ColType["MultiSelect"] = "MultiSelect";
476
- ColType["Dropdown"] = "Dropdown";
477
- ColType["File"] = "File";
478
- ColType["Text"] = "Text";
479
- ColType["Number"] = "Number";
480
- ColType["SelectButton"] = "SelectButton";
481
- ColType["Button"] = "Button";
482
- ColType["Image"] = "Image";
483
- ColType["Date"] = "Date";
484
- ColType["State"] = "State";
485
- })(exports.ColType || (exports.ColType = {}));
486
- (function (Severity) {
487
- Severity["Secondary"] = "secondary";
488
- Severity["Success"] = "success";
489
- Severity["Info"] = "info";
490
- Severity["Warning"] = "warning";
491
- Severity["Help"] = "help";
492
- Severity["Danger"] = "danger";
493
- })(exports.Severity || (exports.Severity = {}));
494
-
495
- var CilogTableComponent = /** @class */ (function () {
496
- function CilogTableComponent(confirmationService, filterService, cdRef) {
497
- this.confirmationService = confirmationService;
498
- this.filterService = filterService;
499
- this.cdRef = cdRef;
500
- this.onEdit = new i0.EventEmitter();
501
- this.onEditInit = new i0.EventEmitter();
502
- this.onDelete = new i0.EventEmitter();
503
- this.onSelect = new i0.EventEmitter();
504
- this.onUnselect = new i0.EventEmitter();
505
- this.onFilter = new i0.EventEmitter();
506
- this.onSort = new i0.EventEmitter();
507
- this.onPage = new i0.EventEmitter();
508
- }
509
- CilogTableComponent.prototype.ngOnInit = function () {
510
- // Date
511
- this.filterService.register('dateRangeFilter', function (cell, filter) {
512
- if (filter == null) {
513
- return true;
514
- }
515
- var start = filter[0].getTime();
516
- var end;
517
- if (filter[1]) {
518
- end = filter[1].getTime() + 86400000;
519
- }
520
- else {
521
- end = start + 86400000;
522
- }
523
- return cell.value == null ? false : cell.value.getTime() >= start && cell.value.getTime() <= end;
524
- });
525
- // Text
526
- this.filterService.register('textFilter', function (cell, filter) {
527
- if (filter == null || filter.trim() == '') {
528
- return true;
529
- }
530
- if (cell.value == null) {
531
- return false;
532
- }
533
- return cell.value.toLowerCase().includes(filter.toLowerCase());
534
- });
535
- // Number
536
- this.filterService.register('numberFilter', function (cell, filter) {
537
- if (filter == null) {
538
- return true;
539
- }
540
- if (cell.value == null) {
541
- return false;
542
- }
543
- return cell.value == filter;
544
- });
545
- // Objet
546
- this.filterService.register('objetFilter', function (cell, filter) {
547
- return (filter.indexOf(cell.value) != -1);
548
- });
549
- // Liste
550
- this.filterService.register('listeFilter', function (cell, filter) {
551
- var ok = false;
552
- filter.forEach(function (val) {
553
- if (cell.value.indexOf(val) != -1) {
554
- ok = true;
555
- }
556
- });
557
- return ok;
558
- });
559
- this.columns.forEach(function (col) {
560
- if (col.options == null) {
561
- col.options = { defaultFilters: null };
562
- }
563
- });
564
- };
565
- CilogTableComponent.prototype.ngAfterViewInit = function () {
566
- var _this = this;
567
- this.columns.forEach(function (col) {
568
- _this.filter(col, col.options.defaultFilters, _this.getFilterByCol(col), true);
569
- });
570
- this.cdRef.detectChanges();
571
- };
572
- // Sort
573
- CilogTableComponent.prototype.customSort = function (event) {
574
- var _this = this;
575
- var col = this.columns.find(function (col) { return col.id == event.field; });
576
- this.onSort.emit({ column: col, order: event.order });
577
- var typeCol = col.type;
578
- event.data.sort(function (data1, data2) {
579
- var value1 = data1[event.field].value;
580
- var value2 = data2[event.field].value;
581
- var result = null;
582
- if (value1 == null && value2 != null)
583
- result = -1;
584
- else if (value1 != null && value2 == null)
585
- result = 1;
586
- else if (value1 == null && value2 == null)
587
- result = 0;
588
- else if (typeCol == exports.ColType.Text || typeCol == exports.ColType.File)
589
- result = value1.localeCompare(value2);
590
- else if (typeCol == exports.ColType.MultiSelect) {
591
- result = _this.getMultiSelectConcat(value1, _this.getOption(col, data1, 'optionLabel')).localeCompare(_this.getMultiSelectConcat(value2, _this.getOption(col, data2, 'optionLabel')));
592
- }
593
- else if (typeCol == exports.ColType.Dropdown || typeCol == exports.ColType.SelectButton || typeCol == exports.ColType.State) {
594
- result = value1[_this.getOption(col, data1, 'optionLabel')].localeCompare(value2[_this.getOption(col, data2, 'optionLabel')]);
595
- }
596
- else if (typeCol == exports.ColType.Number || typeCol == exports.ColType.Date)
597
- result = (value1 < value2) ? -1 : (value1 > value2) ? 1 : 0;
598
- else
599
- result == 0;
600
- return (event.order * result);
601
- });
602
- };
603
- CilogTableComponent.prototype.checkType = function (typeCol, col) {
604
- return col['type'] == typeCol;
605
- };
606
- CilogTableComponent.prototype.clickById = function (id) {
607
- document.getElementById(id).click();
608
- };
609
- CilogTableComponent.prototype.onEditCell = function (row, column, value) {
610
- this.onEdit.emit({ row: row, column: column, value: value });
611
- };
612
- CilogTableComponent.prototype.onSelectRow = function (row) {
613
- this.onSelect.emit({ row: row });
614
- };
615
- CilogTableComponent.prototype.onPageTable = function (event) {
616
- this.onPage.emit(event);
617
- };
618
- CilogTableComponent.prototype.onUnselectRow = function (row) {
619
- this.onUnselect.emit({ row: row });
620
- };
621
- CilogTableComponent.prototype.onDeleteLine = function (row) {
622
- var _this = this;
623
- this.confirmationService.confirm({
624
- key: 'confirm',
625
- message: 'Êtes-vous sûr de vouloir supprimer cette ligne ?',
626
- accept: function () {
627
- _this.values.splice(_this.values.indexOf(row), 1);
628
- _this.values = __spreadArray([], __read(_this.values));
629
- _this.onDelete.emit({ row: row });
630
- }
631
- });
632
- };
633
- CilogTableComponent.prototype.onEditInitCell = function (row, column, value) {
634
- this.onEditInit.emit({ row: row, column: column, value: value });
635
- };
636
- CilogTableComponent.prototype.isModeEdition = function () {
637
- return this.options.editable;
638
- };
639
- CilogTableComponent.prototype.getOption = function (col, row, option) {
640
- if (row[col.id].options != null) {
641
- if (row[col.id].options[option] != null) {
642
- return row[col.id].options[option];
643
- }
644
- }
645
- if (col.options != null) {
646
- if (col.options[option] != null) {
647
- return col.options[option];
648
- }
649
- }
650
- return null;
651
- };
652
- CilogTableComponent.prototype.getMultiSelectConcat = function (value, label) {
653
- if (value != null) {
654
- return value.map(function (val) { return val[label]; }).join(', ');
655
- }
656
- else {
657
- return '';
658
- }
659
- };
660
- CilogTableComponent.prototype.getSelectLibelleByValue = function (row, col) {
661
- var label = '';
662
- if (row[col.id].value == null) {
663
- return label;
664
- }
665
- if (row[col.id].options != null) {
666
- label = row[col.id].options['options'].find(function (opt) { return opt.value == row[col.id].value; })[row[col.id].options.optionLabel];
667
- }
668
- else {
669
- if (col.options != null) {
670
- label = col.options['options'].find(function (opt) { return opt.value == row[col.id].value; })[col.options.optionLabel];
671
- }
672
- }
673
- return label;
674
- };
675
- CilogTableComponent.prototype.getFilterByCol = function (col) {
676
- // Dates (range)
677
- if (col.type == exports.ColType.Date) {
678
- return 'dateRangeFilter';
679
- }
680
- // Number
681
- if (col.type == exports.ColType.Number) {
682
- return 'numberFilter';
683
- }
684
- // Objet
685
- if (col.type == exports.ColType.Dropdown || col.type == exports.ColType.State || col.type == exports.ColType.SelectButton) {
686
- return 'objetFilter';
687
- }
688
- // Liste
689
- if (col.type == exports.ColType.MultiSelect) {
690
- return 'listeFilter';
691
- }
692
- // Texte
693
- if (col.type == exports.ColType.File || col.type == exports.ColType.Text) {
694
- return 'textFilter';
695
- }
696
- return null;
697
- };
698
- CilogTableComponent.prototype.onFilterCol = function (event, col) {
699
- // Dates (range)
700
- if (col.type == exports.ColType.Date) {
701
- this.filter(col, col.options.defaultFilters, 'dateRangeFilter');
702
- }
703
- // Number
704
- if (col.type == exports.ColType.Number) {
705
- this.filter(col, event.value, 'numberFilter');
706
- }
707
- // Objet
708
- if (col.type == exports.ColType.Dropdown || col.type == exports.ColType.State || col.type == exports.ColType.SelectButton) {
709
- this.filter(col, event.value, 'objetFilter');
710
- }
711
- // Liste
712
- if (col.type == exports.ColType.MultiSelect) {
713
- this.filter(col, event.value, 'listeFilter');
714
- }
715
- // Texte
716
- if (col.type == exports.ColType.File || col.type == exports.ColType.Text) {
717
- this.filter(col, event.target.value, 'textFilter');
718
- }
719
- };
720
- CilogTableComponent.prototype.filter = function (col, val, filter, init) {
721
- if (init === void 0) { init = false; }
722
- this.table.filter(val, col.id, filter);
723
- if (!init) {
724
- this.onFilter.emit({ column: col, value: val });
725
- }
726
- };
727
- return CilogTableComponent;
728
- }());
729
- CilogTableComponent.decorators = [
730
- { type: i0.Component, args: [{
731
- selector: 'cilog-table',
732
- template: "<p-table #table\r\n [columns]=\"columns\"\r\n [value]=\"values\"\r\n dataKey=\"id\"\r\n [selectionMode]=\"options.selectable && !isModeEdition() ? 'single' : null\"\r\n [(selection)]=\"selectedRow\"\r\n (onRowSelect)=\"onSelectRow($event)\"\r\n (onRowUnselect)=\"onUnselectRow($event)\"\r\n (sortFunction)=\"customSort($event)\"\r\n [customSort]=\"options.grouping == null ? true : false\"\r\n [scrollable]=\"true\"\r\n [loading]=\"loading\"\r\n [scrollHeight]=\"options.scrollHeight != null ? options.scrollHeight : null\"\r\n [rowGroupMode]=\"options.grouping != null ? 'subheader' : null\"\r\n [groupRowsBy]=\"options.grouping != null ? options.grouping.obj + '.' + options.grouping.id : null\"\r\n [virtualScroll]=\"options.virtualScroll != null && options.scrollHeight != null ? true : false\"\r\n [virtualRowHeight]=\"35\"\r\n [paginator]=\"options.paginator == null ? false : true\"\r\n [(first)]=\"options.paginatorFirst\"\r\n [rows]=\"options.paginatorRows\"\r\n (onPage)=\"onPageTable($event)\">\r\n\r\n <!-- Header -->\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <tr>\r\n <th *ngFor=\"let col of columns\"\r\n [ngClass]=\"{ 'centerText' : options.centerHeaders }\"\r\n [pSortableColumn]=\"col.id\"\r\n [pSortableColumnDisabled]=\"options.virtualScroll != null || options.grouping != null || !options.sortable\"\r\n id=\"{{ col.id }}\">\r\n <span>{{ col.libelle }}</span>\r\n <p-sortIcon *ngIf=\"options.virtualScroll == null && options.sortable && options.grouping == null\" [field]=\"col.id\"></p-sortIcon>\r\n </th>\r\n <th class=\"cellDelete\" *ngIf=\"options.rowsDeletable\"></th>\r\n </tr>\r\n <!-- FILTRES -->\r\n <tr *ngIf=\"options.filterable\">\r\n <ng-container *ngFor=\"let col of columns\">\r\n <!-- Text -->\r\n <th *ngIf=\"checkType('Text', col) || checkType('File', col)\">\r\n <input pInputText\r\n type=\"text\"\r\n (input)=\"onFilterCol($event, col)\">\r\n </th>\r\n\r\n <!-- Date -->\r\n <th *ngIf=\"checkType('Date', col)\">\r\n <p-calendar dateFormat=\"dd/mm/yy\"\r\n [inputId]=\"col.id + '_filter'\"\r\n firstDayOfWeek=\"1\"\r\n [readonlyInput]=\"true\"\r\n appendTo=\"body\"\r\n selectionMode=\"range\"\r\n (onSelect)=\"onFilterCol($event, col)\"\r\n showButtonBar=\"true\"\r\n (onClearClick)=\"onFilterCol($event, col)\"\r\n [(ngModel)]=\"col.options.defaultFilters\">\r\n </p-calendar>\r\n </th>\r\n\r\n <!-- Number -->\r\n <th *ngIf=\"checkType('Number', col)\">\r\n <p-inputNumber mode=\"decimal\"\r\n locale=\"fr-FR\"\r\n [minFractionDigits]=\"2\"\r\n [showButtons]=\"true\"\r\n (onInput)=\"onFilterCol($event, col)\"\r\n [(ngModel)]=\"col.options.defaultFilters\">\r\n </p-inputNumber>\r\n </th>\r\n\r\n <!-- Liste -->\r\n <th *ngIf=\"checkType('Dropdown', col) || checkType('MultiSelect', col) || checkType('SelectButton', col) || checkType('State', col)\">\r\n <p-multiSelect [options]=\"col.options?.options\"\r\n [filter]=\"true\"\r\n dataKey=\"ID\"\r\n [optionLabel]=\"col.options?.optionLabel\"\r\n appendTo=\"body\"\r\n emptyFilterMessage=\"Aucun r\u00E9sultat\"\r\n emptyMessage=\"Aucun r\u00E9sultat\"\r\n itemSize=\"30\"\r\n selectedItemsLabel=\"{0} selectionn\u00E9s\"\r\n (onChange)=\"onFilterCol($event, col)\"\r\n [(ngModel)]=\"col.options.defaultFilters\">\r\n </p-multiSelect>\r\n </th>\r\n\r\n <!-- Non filtrable -->\r\n <th *ngIf=\"checkType('Button', col) || checkType('Image', col)\">\r\n\r\n </th>\r\n </ng-container>\r\n <th class=\"cellDelete\" *ngIf=\"options.rowsDeletable\"></th>\r\n </tr>\r\n </ng-template>\r\n\r\n <!-- Groupheader -->\r\n <ng-template pTemplate=\"groupheader\" let-rowData>\r\n <tr pRowGroupHeader class=\"row_grouping\">\r\n <td [attr.colspan]=\"columns.length + 1\">\r\n <span class=\"text_bold\">{{ rowData[options.grouping.obj][options.grouping.libelle] }}</span>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n\r\n <!-- Body -->\r\n <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\">\r\n <tr id=\"{{ rowData.id }}\"\r\n [ngStyle]=\"{ 'background-color': rowData.color ? rowData.color : null }\"\r\n [pSelectableRow]=\"rowData\"\r\n [pSelectableRowDisabled]=\"!options.selectable || isModeEdition()\">\r\n <ng-container *ngFor=\"let col of columns\">\r\n\r\n <!-- Text -->\r\n <td *ngIf=\"checkType('Text', col) && isModeEdition() && !rowData.readonly && !rowData[col.id]?.readonly\"\r\n [ngStyle]=\"{ 'width' : col.width ? col.width : null, 'background-color': rowData[col.id].color ? rowData[col.id].color : null }\"\r\n id=\"{{ rowData[col.id] != null ? rowData[col.id].id : '' }}\"\r\n [pEditableColumn]=\"rowData\"\r\n [pEditableColumnField]=\"col.id\"\r\n [pTooltip]=\"rowData[col.id].value\"\r\n [tooltipDisabled]=\"!col.tooltip\"\r\n tooltipPosition=\"bottom\">\r\n <span class=\"p-column-title\">{{ col.libelle }} : </span>\r\n <input pInputText\r\n type=\"text\"\r\n [(ngModel)]=\"rowData[col.id].value\"\r\n (change)=\"onEditCell(rowData, col, rowData[col.id].value)\"\r\n (keyup.enter)=\"onEditCell(rowData, col, rowData[col.id].value)\"\r\n (click)=\"onEditInitCell(rowData, col, rowData[col.id].value)\" />\r\n </td>\r\n <td *ngIf=\"checkType('Text', col) && (!isModeEdition() || rowData.readonly || rowData[col.id]?.readonly)\"\r\n [ngStyle]=\"{ 'width' : col.width ? col.width : null, 'background-color': rowData[col.id].color ? rowData[col.id].color : null }\"\r\n id=\"{{ rowData[col.id] != null ? rowData[col.id].id : '' }}\"\r\n [ngClass]=\"{ 'paddingCell': rowData[col.id] != null }\"\r\n [pTooltip]=\"rowData[col.id].value\"\r\n [tooltipDisabled]=\"!col.tooltip\"\r\n tooltipPosition=\"bottom\">\r\n <span class=\"p-column-title\">{{ col.libelle }} : </span>\r\n <span *ngIf=\"rowData[col.id]\">{{ rowData[col.id].value }}</span>\r\n </td>\r\n\r\n <!-- Dropdown -->\r\n <td *ngIf=\"checkType('Dropdown', col) && isModeEdition() && !rowData.readonly && !rowData[col.id]?.readonly\"\r\n [ngStyle]=\"{ 'width' : col.width ? col.width : null, 'background-color': rowData[col.id].color ? rowData[col.id].color : null }\"\r\n id=\"{{ rowData[col.id] != null ? rowData[col.id].id : '' }}\"\r\n [ngClass]=\"rowData[col.id] != null ? 'paddingCell' : null\"\r\n [pTooltip]=\"rowData[col.id].value != null ? rowData[col.id].value[getOption(col, rowData, 'optionLabel')] : ''\"\r\n [tooltipDisabled]=\"!col.tooltip\"\r\n tooltipPosition=\"bottom\">\r\n <span class=\"p-column-title\">{{ col.libelle }} : </span>\r\n <p-dropdown *ngIf=\"rowData[col.id] != null\"\r\n dataKey=\"ID\"\r\n [options]=\"getOption(col, rowData, 'options')\"\r\n [filter]=\"getOption(col, rowData, 'filter')\"\r\n [optionLabel]=\"getOption(col, rowData, 'optionLabel')\"\r\n [(ngModel)]=\"rowData[col.id].value\"\r\n [autoDisplayFirst]=\"false\"\r\n appendTo=\"body\"\r\n emptyFilterMessage=\"Aucun r\u00E9sultat\"\r\n emptyMessage=\"Aucun r\u00E9sultat\"\r\n [baseZIndex]=\"getOption(col, rowData, 'baseZIndex')\"\r\n [virtualScroll]=\"getOption(col, rowData, 'virtualScroll')\"\r\n [readonly]=\"rowData.readonly || rowData[col.id]?.readonly\"\r\n itemSize=\"30\"\r\n (onChange)=\"onEditCell(rowData, col, rowData[col.id].value)\">\r\n </p-dropdown>\r\n </td>\r\n <td *ngIf=\"checkType('Dropdown', col) && (rowData.readonly || rowData[col.id]?.readonly || !isModeEdition())\"\r\n [ngStyle]=\"{ 'width' : col.width ? col.width : null, 'background-color': rowData[col.id].color ? rowData[col.id].color : null }\"\r\n id=\"{{ rowData[col.id] != null ? rowData[col.id].id : '' }}\"\r\n [ngClass]=\"rowData[col.id] != null ? 'paddingCell' : null\"\r\n [pTooltip]=\"rowData[col.id].value != null ? rowData[col.id].value[getOption(col, rowData, 'optionLabel')] : ''\"\r\n [tooltipDisabled]=\"!col.tooltip\"\r\n tooltipPosition=\"bottom\">\r\n <span class=\"p-column-title\">{{ col.libelle }} : </span>\r\n <span *ngIf=\"rowData[col.id]\">{{ rowData[col.id].value != null ? rowData[col.id].value[getOption(col, rowData, 'optionLabel')] : '' }}</span>\r\n </td>\r\n\r\n <!-- Number -->\r\n <td *ngIf=\"checkType('Number', col) && isModeEdition() && !rowData.readonly && !rowData[col.id]?.readonly\"\r\n [ngStyle]=\"{ 'width' : col.width ? col.width : null, 'background-color': rowData[col.id].color ? rowData[col.id].color : null }\"\r\n id=\"{{ rowData[col.id] != null ? rowData[col.id].id : '' }}\"\r\n [ngClass]=\"rowData[col.id] != null ? 'paddingCell' : null\"\r\n [pTooltip]=\"rowData[col.id].value | number\"\r\n [tooltipDisabled]=\"!col.tooltip\"\r\n tooltipPosition=\"bottom\">\r\n <span class=\"p-column-title\">{{ col.libelle }} : </span>\r\n <p-inputNumber *ngIf=\"rowData[col.id] && !rowData.readonly && !rowData[col.id]?.readonly\"\r\n mode=\"decimal\"\r\n locale=\"fr-FR\"\r\n [(ngModel)]=\"rowData[col.id].value\"\r\n [showButtons]=\"getOption(col, rowData, 'showButtons')\"\r\n [suffix]=\"getOption(col, rowData, 'suffix')\"\r\n [prefix]=\"getOption(col, rowData, 'prefix') != null ? getOption(col, rowData, 'prefix') + ' ' : null\"\r\n [minFractionDigits]=\"2\"\r\n [maxFractionDigits]=\"getOption(col, rowData, 'maxDecimales') != null ? getOption(col, rowData, 'maxDecimales') : 2 \"\r\n (ngModelChange)=\"onEditCell(rowData, col, rowData[col.id].value)\"\r\n (onFocus)=\"onEditInitCell(rowData, col, rowData[col.id].value)\">\r\n </p-inputNumber>\r\n </td>\r\n <td *ngIf=\"checkType('Number', col) && (rowData.readonly || rowData[col.id]?.readonly || !isModeEdition())\"\r\n [ngStyle]=\"{ 'width' : col.width ? col.width : null, 'background-color': rowData[col.id].color ? rowData[col.id].color : null }\"\r\n id=\"{{ rowData[col.id] != null ? rowData[col.id].id : '' }}\"\r\n [ngClass]=\"rowData[col.id] != null ? 'paddingCell' : null\"\r\n [pTooltip]=\"rowData[col.id].value | number\"\r\n [tooltipDisabled]=\"!col.tooltip\"\r\n tooltipPosition=\"bottom\">\r\n <span class=\"p-column-title\">{{ col.libelle }} : </span>\r\n <span *ngIf=\"rowData[col.id]\">{{ rowData[col.id].value | number }}</span>\r\n </td>\r\n\r\n <!-- Date -->\r\n <td *ngIf=\"checkType('Date', col) && isModeEdition() && !rowData.readonly && !rowData[col.id]?.readonly\"\r\n [ngStyle]=\"{ 'width' : col.width ? col.width : null, 'background-color': rowData[col.id].color ? rowData[col.id].color : null }\"\r\n id=\"{{ rowData[col.id] != null ? rowData[col.id].id : '' }}\"\r\n [ngClass]=\"rowData[col.id] != null ? 'paddingCell' : null\"\r\n [pTooltip]=\"rowData[col.id].value | date: 'dd/MM/yyyy'\"\r\n [tooltipDisabled]=\"!col.tooltip\"\r\n tooltipPosition=\"bottom\">\r\n <span class=\"p-column-title\">{{ col.libelle }} : </span>\r\n <p-calendar [(ngModel)]=\"rowData[col.id].value\"\r\n dateFormat=\"dd/mm/yy\"\r\n firstDayOfWeek=\"1\"\r\n (onSelect)=\"onEditCell(rowData, col, rowData[col.id].value)\"\r\n [readonlyInput]=\"true\"\r\n appendTo=\"body\">\r\n </p-calendar>\r\n </td>\r\n <td *ngIf=\"checkType('Date', col) && (rowData.readonly || rowData[col.id]?.readonly || !isModeEdition())\"\r\n [ngStyle]=\"{ 'width' : col.width ? col.width : null, 'background-color': rowData[col.id].color ? rowData[col.id].color : null }\"\r\n id=\"{{ rowData[col.id] != null ? rowData[col.id].id : '' }}\"\r\n [ngClass]=\"rowData[col.id] != null ? 'paddingCell' : null\"\r\n [pTooltip]=\"rowData[col.id].value | date: 'dd/MM/yyyy'\"\r\n [tooltipDisabled]=\"!col.tooltip\"\r\n tooltipPosition=\"bottom\">\r\n <span class=\"p-column-title\">{{ col.libelle }} : </span>\r\n <span *ngIf=\"rowData[col.id]\">{{ rowData[col.id].value | date: 'dd/MM/yyyy' }}</span>\r\n </td>\r\n\r\n <!-- MultiSelect -->\r\n <td *ngIf=\"checkType('MultiSelect', col) && isModeEdition() && !rowData.readonly && !rowData[col.id]?.readonly\"\r\n [ngStyle]=\"{ 'width' : col.width ? col.width : null, 'background-color': rowData[col.id].color ? rowData[col.id].color : null }\"\r\n id=\"{{ rowData[col.id] != null ? rowData[col.id].id : '' }}\"\r\n [ngClass]=\"rowData[col.id] != null ? 'paddingCell' : null\"\r\n [pTooltip]=\"getMultiSelectConcat(rowData[col.id].value, getOption(col, rowData, 'optionLabel'))\"\r\n [tooltipDisabled]=\"!col.tooltip\"\r\n tooltipPosition=\"bottom\">\r\n <span class=\"p-column-title\">{{ col.libelle }} : </span>\r\n <p-multiSelect *ngIf=\"rowData[col.id] != null\"\r\n [options]=\"getOption(col, rowData, 'options')\"\r\n [filter]=\"getOption(col, rowData, 'filter')\"\r\n [optionLabel]=\"getOption(col, rowData, 'optionLabel')\"\r\n [(ngModel)]=\"rowData[col.id].value\"\r\n appendTo=\"body\"\r\n dataKey=\"ID\"\r\n emptyFilterMessage=\"Aucun r\u00E9sultat\"\r\n emptyMessage=\"Aucun r\u00E9sultat\"\r\n [baseZIndex]=\"getOption(col, rowData, 'baseZIndex')\"\r\n [virtualScroll]=\"getOption(col, rowData, 'virtualScroll')\"\r\n [readonly]=\"rowData.readonly || rowData[col.id]?.readonly || !isModeEdition()\"\r\n itemSize=\"30\"\r\n selectedItemsLabel=\"{0} utilisateurs selectionn\u00E9s\"\r\n (onChange)=\"onEditCell(rowData, col, rowData[col.id].value)\"\r\n [showToggleAll]=\"false\"\r\n [showHeader]=\"getOption(col, rowData, 'filter')\"\r\n ngDefaultControl>\r\n </p-multiSelect>\r\n </td>\r\n <td *ngIf=\"checkType('MultiSelect', col) && (rowData.readonly || rowData[col.id]?.readonly || !isModeEdition())\"\r\n [ngStyle]=\"{ 'width' : col.width ? col.width : null, 'background-color': rowData[col.id].color ? rowData[col.id].color : null }\"\r\n id=\"{{ rowData[col.id] != null ? rowData[col.id].id : '' }}\"\r\n [ngClass]=\"rowData[col.id] != null ? 'paddingCell' : null\"\r\n [pTooltip]=\"getMultiSelectConcat(rowData[col.id].value, getOption(col, rowData, 'optionLabel'))\"\r\n [tooltipDisabled]=\"!col.tooltip\"\r\n tooltipPosition=\"bottom\">\r\n <span class=\"p-column-title\">{{ col.libelle }} : </span>\r\n <span *ngIf=\"rowData[col.id]\">{{ getMultiSelectConcat(rowData[col.id].value, getOption(col, rowData, 'optionLabel')) }}</span>\r\n </td>\r\n\r\n <!-- Image -->\r\n <td *ngIf=\"checkType('Image', col)\"\r\n [ngStyle]=\"{ 'width' : col.width ? col.width : null, 'background-color': rowData[col.id].color ? rowData[col.id].color : null }\"\r\n id=\"{{ rowData[col.id] != null ? rowData[col.id].id : '' }}\"\r\n [ngClass]=\"rowData[col.id] != null ? 'paddingCell' : null\"\r\n class=\"centerText\">\r\n <span class=\"p-column-title\">{{ col.libelle }} : </span>\r\n <img *ngIf=\"rowData[col.id]\" style=\"vertical-align: middle; width: 40px;\" src=\"{{ rowData[col.id].value }}\" />\r\n </td>\r\n\r\n <!-- Button -->\r\n <td *ngIf=\"checkType('Button', col)\"\r\n class=\"paddingCell centerText\"\r\n [ngStyle]=\"{ 'background-color': rowData[col.id].color ? rowData[col.id].color : null }\">\r\n <span class=\"p-column-title\">{{ col.libelle }} : </span>\r\n <button pButton\r\n [disabled]=\"rowData.readonly || rowData[col.id]?.readonly\"\r\n [ngClass]=\"'p-button-' + getOption(col, rowData, 'severity')\"\r\n [label]=\"getOption(col, rowData, 'label')\"\r\n [icon]=\"getOption(col, rowData, 'icon')\"\r\n (click)=\"rowData[col.id].value()\"\r\n [pTooltip]=\"getOption(col, rowData, 'label')\"\r\n [tooltipDisabled]=\"!col.tooltip\">\r\n </button>\r\n </td>\r\n\r\n <!-- SelectButton -->\r\n <td *ngIf=\"checkType('SelectButton', col) && isModeEdition() && !rowData.readonly && !rowData[col.id]?.readonly\"\r\n [ngStyle]=\"{ 'width' : col.width ? col.width : null, 'background-color': rowData[col.id].color ? rowData[col.id].color : null }\"\r\n id=\"{{ rowData[col.id] != null ? rowData[col.id].id : '' }}\"\r\n [ngClass]=\"rowData[col.id] != null ? 'paddingCell' : null\">\r\n <span class=\"p-column-title\">{{ col.libelle }} : </span>\r\n <p-selectButton *ngIf=\"rowData[col.id] != null\"\r\n [options]=\"getOption(col, rowData, 'options')\"\r\n [optionLabel]=\"getOption(col, rowData, 'optionLabel')\"\r\n [optionValue]=\"getOption(col, rowData, 'optionValue') != null ? getOption(col, rowData, 'optionValue') : 'value'\"\r\n [(ngModel)]=\"rowData[col.id].value\"\r\n [disabled]=\"rowData.readonly || rowData[col.id]?.readonly || !isModeEdition()\"\r\n (onChange)=\"onEditCell(rowData, col, rowData[col.id].value)\">\r\n </p-selectButton>\r\n </td>\r\n <td *ngIf=\"checkType('SelectButton', col) && (rowData.readonly || rowData[col.id]?.readonly || !isModeEdition())\"\r\n [ngStyle]=\"{ 'width' : col.width ? col.width : null, 'background-color': rowData[col.id].color ? rowData[col.id].color : null }\"\r\n id=\"{{ rowData[col.id] != null ? rowData[col.id].id : '' }}\"\r\n [ngClass]=\"rowData[col.id] != null ? 'paddingCell' : null\">\r\n <span class=\"p-column-title\">{{ col.libelle }} : </span>\r\n <span *ngIf=\"rowData[col.id]\">{{ getSelectLibelleByValue(rowData, col) }}</span>\r\n </td>\r\n\r\n <!-- File -->\r\n <td *ngIf=\"checkType('File', col) && isModeEdition() && !rowData.readonly && !rowData[col.id]?.readonly\"\r\n [ngStyle]=\"{ 'width' : col.width ? col.width : null, 'background-color': rowData[col.id].color ? rowData[col.id].color : null }\"\r\n id=\"{{ rowData[col.id] != null ? rowData[col.id].id : '' }}\"\r\n [ngClass]=\"rowData[col.id] != null ? 'paddingCell' : null\"\r\n [pTooltip]=\"rowData[col.id].value ? rowData[col.id].value : ''\"\r\n [tooltipDisabled]=\"!col.tooltip\">\r\n <span class=\"p-column-title\">{{ col.libelle }} : </span>\r\n <div class=\"p-inputgroup\" *ngIf=\"rowData[col.id] != null\">\r\n <button type=\"button\"\r\n pButton\r\n pRipple\r\n icon=\"pi pi-upload\"\r\n (click)=\"clickById('input_' + rowData[col.id].id)\"\r\n [disabled]=\"rowData.readonly || rowData[col.id]?.readonly || !isModeEdition()\">\r\n </button>\r\n <input id=\"{{'output_' + rowData[col.id].id}}\" pInputText type=\"text\" value=\"{{ rowData[col.id].value != null ? rowData[col.id].value : '' }}\" readonly>\r\n </div>\r\n <input *ngIf=\"rowData[col.id]\" id=\"{{'input_' + rowData[col.id].id}}\" #inputFile pInputText type=\"file\" hidden (change)=\"rowData[col.id].value = inputFile.files[0].name; onEditCell(rowData, col, inputFile.files[0])\">\r\n </td>\r\n <td *ngIf=\"checkType('File', col) && (rowData.readonly || rowData[col.id]?.readonly || !isModeEdition())\"\r\n [ngStyle]=\"{ 'width' : col.width ? col.width : null, 'background-color': rowData[col.id].color ? rowData[col.id].color : null }\"\r\n id=\"{{ rowData[col.id] != null ? rowData[col.id].id : '' }}\"\r\n [ngClass]=\"rowData[col.id] != null ? 'paddingCell' : null\"\r\n [pTooltip]=\"rowData[col.id].value ? rowData[col.id].value : ''\"\r\n [tooltipDisabled]=\"!col.tooltip\"\r\n tooltipPosition=\"bottom\">\r\n <span class=\"p-column-title\">{{ col.libelle }} : </span>\r\n <span *ngIf=\"rowData[col.id]\">{{ rowData[col.id].value ? rowData[col.id].value : '' }}</span>\r\n </td>\r\n\r\n <!-- State -->\r\n <td *ngIf=\"checkType('State', col)\"\r\n [ngStyle]=\"{ 'width' : col.width ? col.width : null, 'background-color': rowData[col.id].color ? rowData[col.id].color : null }\"\r\n id=\"{{ rowData[col.id] != null ? rowData[col.id].id : '' }}\"\r\n [ngClass]=\"rowData[col.id] != null ? 'paddingCell' : null\"\r\n class=\"centerText\">\r\n <span class=\"p-column-title\">{{ col.libelle }} : </span>\r\n <p-tag [value]=\"rowData[col.id].value[getOption(col, rowData, 'optionLabel')]\"\r\n [severity]=\"rowData[col.id].value.severity\"\r\n [icon]=\"rowData[col.id].value.icon\">\r\n </p-tag>\r\n </td>\r\n\r\n </ng-container>\r\n\r\n <!-- Deletion -->\r\n <td *ngIf=\"options.rowsDeletable\"\r\n class=\"cellDelete\"\r\n [ngClass]=\"rowData.deletable ? 'paddingCell' : null\">\r\n <button *ngIf=\"rowData.deletable\"\r\n pButton\r\n type=\"button\"\r\n icon=\"pi pi-times\"\r\n class=\"p-button-danger buttonDelete p-button-text\"\r\n [disabled]=\"rowData.readonly\"\r\n (click)=\"onDeleteLine(rowData)\">\r\n </button>\r\n </td>\r\n\r\n </tr>\r\n </ng-template>\r\n</p-table>\r\n",
733
- styles: ["::ng-deep .p-tooltip .p-tooltip-text{overflow-wrap:break-word!important}:host ::ng-deep .p-datatable-table{width:100%!important}:host ::ng-deep .p-datatable-tbody>tr>td>span,:host ::ng-deep .p-datatable-thead>tr>th>span{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}:host ::ng-deep .row_grouping{background:#faeada!important}:host ::ng-deep .text_bold{font-weight:700!important}:host ::ng-deep .cellDelete{flex:0 0 50px!important}:host ::ng-deep .p-datatable .p-sortable-column.p-highlight,:host ::ng-deep .p-datatable .p-sortable-column.p-highlight .p-sortable-column-icon{color:#2196f3!important}:host ::ng-deep .p-tooltip .p-tooltip-text{background-color:red!important}:host ::ng-deep .p-datatable-thead>tr>th{background:#dedddd!important;border:1px solid rgba(0,0,0,.12)!important;color:#495057!important;font-weight:600!important;overflow:hidden!important;padding-bottom:8px!important;padding-top:8px!important;text-overflow:ellipsis!important;white-space:nowrap!important}:host ::ng-deep .p-datatable-tbody>tr{height:35px!important}:host ::ng-deep .p-datatable-tbody>tr>td{border:1px solid rgba(0,0,0,.12)!important;min-width:0!important}:host ::ng-deep .centerText{justify-content:center!important}:host ::ng-deep .p-button{padding-bottom:1px;padding-top:1px}:host ::ng-deep .p-button-label{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;width:100%!important}:host ::ng-deep .p-calendar,:host ::ng-deep p-calendar,:host ::ng-deep p-dropdown,:host ::ng-deep p-inputNumber,:host ::ng-deep p-multiselect,:host ::ng-deep p-selectButton{width:100%!important}:host ::ng-deep .p-inputtext{height:25px!important;padding:4px 5px!important;width:100%!important}:host ::ng-deep .p-inputnumber{height:25px;padding:0!important;width:100%}:host ::ng-deep .p-inputnumber-input{padding:0 5px!important;width:100%}:host ::ng-deep .p-inputgroup .p-inputtext{height:25px;padding:4px 5px!important;width:100%}:host ::ng-deep .p-dropdown{vertical-align:middle;width:100%}:host ::ng-deep .p-dropdown-label{padding-bottom:2px;padding-top:2px}:host ::ng-deep .p-multiselect{vertical-align:middle;width:100%}:host ::ng-deep .p-multiselect-label{padding-bottom:2px;padding-top:2px}:host ::ng-deep .p-editable-column,:host ::ng-deep .paddingCell{padding:3px 10px!important}:host ::ng-deep .p-selectbutton>.p-button{height:25px;width:50%}:host ::ng-deep .p-inputgroup>.p-button{height:25px}:host ::ng-deep .buttonDelete{height:20px;width:100%}:host ::ng-deep .p-column-title{display:none}:host ::ng-deep .p-datatable-loading-icon{color:#fff}@media screen and (max-width:650px){:host ::ng-deep .p-datatable-tfoot>tr>td,:host ::ng-deep .p-datatable-thead>tr>th{display:none!important;width:inherit!important}:host ::ng-deep .p-datatable-tbody>tr{border:2px solid rgba(0,0,0,.12);flex-direction:column;height:inherit!important;padding-top:12px!important}:host ::ng-deep .p-datatable-tbody>tr>td{border:0!important;flex-basis:auto!important;width:100%!important}:host ::ng-deep td .p-column-title{display:inline-block!important;font-weight:700;margin:-.4rem 1rem -.4rem -.4rem;min-width:35%;padding:.4rem}:host ::ng-deep .centerText{justify-content:inherit!important}}"]
734
- },] }
735
- ];
736
- CilogTableComponent.ctorParameters = function () { return [
737
- { type: api.ConfirmationService },
738
- { type: api.FilterService },
739
- { type: i0.ChangeDetectorRef }
740
- ]; };
741
- CilogTableComponent.propDecorators = {
742
- columns: [{ type: i0.Input }],
743
- values: [{ type: i0.Input }],
744
- options: [{ type: i0.Input }],
745
- loading: [{ type: i0.Input }],
746
- onEdit: [{ type: i0.Output }],
747
- onEditInit: [{ type: i0.Output }],
748
- onDelete: [{ type: i0.Output }],
749
- onSelect: [{ type: i0.Output }],
750
- onUnselect: [{ type: i0.Output }],
751
- onFilter: [{ type: i0.Output }],
752
- onSort: [{ type: i0.Output }],
753
- onPage: [{ type: i0.Output }],
754
- table: [{ type: i0.ViewChild, args: ['table', { static: true },] }]
755
- };
756
-
757
- var CilogTableService = /** @class */ (function () {
758
- function CilogTableService() {
759
- }
760
- return CilogTableService;
761
- }());
762
- CilogTableService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CilogTableService_Factory() { return new CilogTableService(); }, token: CilogTableService, providedIn: "root" });
763
- CilogTableService.decorators = [
764
- { type: i0.Injectable, args: [{
765
- providedIn: 'root'
766
- },] }
767
- ];
768
- CilogTableService.ctorParameters = function () { return []; };
769
-
770
- common.registerLocaleData(localeFr__default['default']);
771
- var CilogLibModule = /** @class */ (function () {
772
- function CilogLibModule() {
773
- }
774
- return CilogLibModule;
775
- }());
776
- CilogLibModule.decorators = [
777
- { type: i0.NgModule, args: [{
778
- imports: [
779
- common.CommonModule,
780
- PrimengModule,
781
- platformBrowser.BrowserModule,
782
- animations.BrowserAnimationsModule,
783
- forms.FormsModule,
784
- forms.ReactiveFormsModule
785
- ],
786
- declarations: [
787
- CilogLibComponent,
788
- CilogMessageComponent,
789
- CilogTableComponent
790
- ],
791
- exports: [
792
- CilogMessageComponent,
793
- CilogTableComponent
794
- ],
795
- providers: [
796
- CilogMessageService,
797
- CilogTableService,
798
- api.ConfirmationService,
799
- { provide: i0.LOCALE_ID, useValue: 'fr-FR' },
800
- ]
801
- },] }
802
- ];
803
-
804
- var CilogLibService = /** @class */ (function () {
805
- function CilogLibService() {
806
- }
807
- return CilogLibService;
808
- }());
809
- CilogLibService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CilogLibService_Factory() { return new CilogLibService(); }, token: CilogLibService, providedIn: "root" });
810
- CilogLibService.decorators = [
811
- { type: i0.Injectable, args: [{
812
- providedIn: 'root'
813
- },] }
814
- ];
815
- CilogLibService.ctorParameters = function () { return []; };
816
-
817
- /*
818
- * Public API Surface of cilog-lib
819
- */
820
-
821
- /**
822
- * Generated bundle index. Do not edit.
823
- */
824
-
825
- exports.CilogLibComponent = CilogLibComponent;
826
- exports.CilogLibModule = CilogLibModule;
827
- exports.CilogLibService = CilogLibService;
828
- exports.CilogMessageService = CilogMessageService;
829
- exports.CilogTableService = CilogTableService;
830
- exports.ɵa = PrimengModule;
831
- exports.ɵb = CilogMessageComponent;
832
- exports.ɵc = CilogTableComponent;
833
-
834
- Object.defineProperty(exports, '__esModule', { value: true });
835
-
836
- })));
837
- //# sourceMappingURL=cilog-lib.umd.js.map