erp-library-itdev 0.1.5

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.
@@ -0,0 +1,1289 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, Output, Input, ChangeDetectionStrategy, Component, input, signal, computed, effect, HostListener, model, Injectable, inject, makeEnvironmentProviders, importProvidersFrom } from '@angular/core';
3
+ import * as i1 from '@angular/common';
4
+ import { CommonModule, NgTemplateOutlet } from '@angular/common';
5
+ import * as i2 from '@angular/forms';
6
+ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
7
+ import * as i2$2 from '@angular/material/icon';
8
+ import { MatIcon, MatIconModule } from '@angular/material/icon';
9
+ import * as i2$1 from '@ngx-translate/core';
10
+ import { TranslateModule, TranslateService, TranslateLoader } from '@ngx-translate/core';
11
+ import * as i1$1 from '@angular/common/http';
12
+ import { HttpClient, HttpParams, HttpHeaders } from '@angular/common/http';
13
+ import Keycloak from 'keycloak-js';
14
+ import { map, catchError, of } from 'rxjs';
15
+
16
+ class ButtonComponent {
17
+ constructor() {
18
+ this.variant = 'primary';
19
+ this.size = 'md';
20
+ this.disabled = false;
21
+ this.loading = false;
22
+ this.type = 'button';
23
+ this.clicked = new EventEmitter();
24
+ }
25
+ get classes() {
26
+ return [
27
+ 'itdev-btn',
28
+ `itdev-btn--${this.variant}`,
29
+ `itdev-btn--${this.size}`,
30
+ this.loading ? 'itdev-btn--loading' : '',
31
+ ].filter(Boolean);
32
+ }
33
+ onClick(event) {
34
+ if (!this.disabled && !this.loading) {
35
+ this.clicked.emit(event);
36
+ }
37
+ }
38
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
39
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.1", type: ButtonComponent, isStandalone: true, selector: "itdev-button", inputs: { variant: "variant", size: "size", disabled: "disabled", loading: "loading", type: "type" }, outputs: { clicked: "clicked" }, ngImport: i0, template: "<button\n [type]=\"type\"\n [class]=\"classes\"\n [disabled]=\"disabled || loading\"\n (click)=\"onClick($event)\"\n>\n <span *ngIf=\"loading\" class=\"itdev-btn__spinner\" aria-hidden=\"true\"></span>\n <ng-content></ng-content>\n</button>\n", styles: [".itdev-btn{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;font-family:inherit;font-weight:500;border:none;border-radius:6px;cursor:pointer;transition:background .2s ease,opacity .2s ease;outline-offset:2px}.itdev-btn:focus-visible{outline:2px solid #3b82f6}.itdev-btn:disabled{opacity:.5;cursor:not-allowed}.itdev-btn--sm{padding:.375rem .75rem;font-size:.8125rem}.itdev-btn--md{padding:.5rem 1rem;font-size:.9375rem}.itdev-btn--lg{padding:.625rem 1.25rem;font-size:1.0625rem}.itdev-btn--primary{background:#2563eb;color:#fff}.itdev-btn--primary:hover:not(:disabled){background:#1d4ed8}.itdev-btn--secondary{background:#e5e7eb;color:#111827}.itdev-btn--secondary:hover:not(:disabled){background:#d1d5db}.itdev-btn--danger{background:#dc2626;color:#fff}.itdev-btn--danger:hover:not(:disabled){background:#b91c1c}.itdev-btn--ghost{background:transparent;color:#2563eb;border:1px solid #2563eb}.itdev-btn--ghost:hover:not(:disabled){background:#eff6ff}.itdev-btn__spinner{width:1em;height:1em;border:2px solid currentColor;border-top-color:transparent;border-radius:50%;animation:itdev-spin .6s linear infinite}@keyframes itdev-spin{to{transform:rotate(360deg)}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
40
+ }
41
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ButtonComponent, decorators: [{
42
+ type: Component,
43
+ args: [{ selector: 'itdev-button', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n [type]=\"type\"\n [class]=\"classes\"\n [disabled]=\"disabled || loading\"\n (click)=\"onClick($event)\"\n>\n <span *ngIf=\"loading\" class=\"itdev-btn__spinner\" aria-hidden=\"true\"></span>\n <ng-content></ng-content>\n</button>\n", styles: [".itdev-btn{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;font-family:inherit;font-weight:500;border:none;border-radius:6px;cursor:pointer;transition:background .2s ease,opacity .2s ease;outline-offset:2px}.itdev-btn:focus-visible{outline:2px solid #3b82f6}.itdev-btn:disabled{opacity:.5;cursor:not-allowed}.itdev-btn--sm{padding:.375rem .75rem;font-size:.8125rem}.itdev-btn--md{padding:.5rem 1rem;font-size:.9375rem}.itdev-btn--lg{padding:.625rem 1.25rem;font-size:1.0625rem}.itdev-btn--primary{background:#2563eb;color:#fff}.itdev-btn--primary:hover:not(:disabled){background:#1d4ed8}.itdev-btn--secondary{background:#e5e7eb;color:#111827}.itdev-btn--secondary:hover:not(:disabled){background:#d1d5db}.itdev-btn--danger{background:#dc2626;color:#fff}.itdev-btn--danger:hover:not(:disabled){background:#b91c1c}.itdev-btn--ghost{background:transparent;color:#2563eb;border:1px solid #2563eb}.itdev-btn--ghost:hover:not(:disabled){background:#eff6ff}.itdev-btn__spinner{width:1em;height:1em;border:2px solid currentColor;border-top-color:transparent;border-radius:50%;animation:itdev-spin .6s linear infinite}@keyframes itdev-spin{to{transform:rotate(360deg)}}\n"] }]
44
+ }], propDecorators: { variant: [{
45
+ type: Input
46
+ }], size: [{
47
+ type: Input
48
+ }], disabled: [{
49
+ type: Input
50
+ }], loading: [{
51
+ type: Input
52
+ }], type: [{
53
+ type: Input
54
+ }], clicked: [{
55
+ type: Output
56
+ }] } });
57
+
58
+ var Icons;
59
+ (function (Icons) {
60
+ Icons["ADD_ROUNDED"] = "add-rounded";
61
+ Icons["ARROW_TOP"] = "arrow-top";
62
+ Icons["ARROW_TOP_2"] = "arrow-top-2";
63
+ Icons["ARROW_TOP_ROUNDED"] = "arrow-top-rounded";
64
+ Icons["ARROW_TOP_ROUNDED_2"] = "arrow-top-rounded-2";
65
+ Icons["ARROW_BOTTOM"] = "arrow-bottom";
66
+ Icons["ARROW_BOTTOM_2"] = "arrow-bottom-2";
67
+ Icons["ARROW_BOTTOM_ROUNDED"] = "arrow-bottom-rounded";
68
+ Icons["ARROW_BOTTOM_ROUNDED_2"] = "arrow-bottom-rounded-2";
69
+ Icons["ARROW_RIGHT"] = "arrow-right";
70
+ Icons["ARROW_RIGHT_2"] = "arrow-right-2";
71
+ Icons["ARROW_RIGHT_ROUNDED"] = "arrow-right-rounded";
72
+ Icons["ARROW_RIGHT_ROUNDED_2"] = "arrow-right-rounded-2";
73
+ Icons["ARROW_LEFT"] = "arrow-left";
74
+ Icons["ARROW_LEFT_2"] = "arrow-left";
75
+ Icons["ARROW_LEFT_ROUNDED"] = "arrow-left-rounded";
76
+ Icons["ARROW_LEFT_ROUNDED_2"] = "arrow-left-rounded-2";
77
+ Icons["AWARD"] = "award";
78
+ Icons["CALENDAR"] = "calendar";
79
+ Icons["CALL_CALLING"] = "call-calling";
80
+ Icons["CALL_MUTED"] = "call-muted";
81
+ Icons["CALL_SLASH"] = "call-slash";
82
+ Icons["CAMERA_SLASH"] = "camera-slash";
83
+ Icons["CAMERA"] = "camera";
84
+ Icons["CARD"] = "card";
85
+ Icons["CHART"] = "chart";
86
+ Icons["CHECK"] = "check";
87
+ Icons["CHECK_LIST"] = "check-list";
88
+ Icons["CLOCK"] = "clock";
89
+ Icons["CLOSE"] = "close";
90
+ Icons["CLOUD"] = "cloud";
91
+ Icons["CLOUD_2"] = "cloud-1";
92
+ Icons["COMPARISON"] = "comparison";
93
+ Icons["COPY"] = "copy";
94
+ Icons["CPU"] = "cpu";
95
+ Icons["CUP"] = "cup";
96
+ Icons["DELETE"] = "delete";
97
+ Icons["DELETE_2"] = "delete-2";
98
+ Icons["DISCOVER"] = "discover";
99
+ Icons["DOCUMENT"] = "document";
100
+ Icons["DOLLAR_ROUNDED"] = "dollar-rounded";
101
+ Icons["EDIT_ROUNDED"] = "edit-rounded";
102
+ Icons["EDIT_ROUNDED_2"] = "edit-rounded-2";
103
+ Icons["EDIT_UNDERLINE"] = "edit-underline";
104
+ Icons["EDIT"] = "edit";
105
+ Icons["EXPORT"] = "export";
106
+ Icons["EYE"] = "eye";
107
+ Icons["EYE_SLASH"] = "eye-slash";
108
+ Icons["FILTER"] = "filter";
109
+ Icons["FLAG"] = "flag";
110
+ Icons["FOLDER"] = "folder";
111
+ Icons["GALLERY"] = "gallery";
112
+ Icons["GRID"] = "grid";
113
+ Icons["GRID_2"] = "grid-2";
114
+ Icons["GRID_3"] = "grid-3";
115
+ Icons["HEADPHONE_SLASH"] = "headphone-slash";
116
+ Icons["HEADPHONE"] = "headphone";
117
+ Icons["HEART"] = "heart";
118
+ Icons["HOME"] = "home";
119
+ Icons["HOME_2"] = "home-2";
120
+ Icons["INFO"] = "info";
121
+ Icons["LOADING"] = "loading";
122
+ Icons["LOCATION"] = "location";
123
+ Icons["LOCK"] = "lock";
124
+ Icons["LOCK_2"] = "lock-1";
125
+ Icons["LOGOUT"] = "logout";
126
+ Icons["MENU"] = "menu";
127
+ Icons["MENU_2"] = "menu-1";
128
+ Icons["MESSAGE"] = "message";
129
+ Icons["MESSAGES"] = "messages";
130
+ Icons["MESSAGE_2"] = "message-2";
131
+ Icons["MESSAGE_3"] = "message-3";
132
+ Icons["MESSAGE_4"] = "message-4";
133
+ Icons["MIC"] = "mic";
134
+ Icons["MINUS"] = "minus";
135
+ Icons["MOBILE"] = "mobile";
136
+ Icons["MONITOR"] = "monitor";
137
+ Icons["MOON"] = "moon";
138
+ Icons["MORE"] = "more";
139
+ Icons["MORE_2"] = "more-2";
140
+ Icons["MOUSE"] = "mouse";
141
+ Icons["NOTE"] = "note";
142
+ Icons["NOTE_2"] = "note-2";
143
+ Icons["NOTE_3"] = "note-3";
144
+ Icons["NOTE_ADD"] = "note-add";
145
+ Icons["NOTE_CHECK"] = "note-check";
146
+ Icons["NOTE_DELETE"] = "note-delete";
147
+ Icons["NOTE_MINUS"] = "note-minus";
148
+ Icons["NOTIFICATION"] = "notification";
149
+ Icons["NOTIFICATION_2"] = "notification-2";
150
+ Icons["NOTIFICATION_3"] = "notification-3";
151
+ Icons["NOTIFICATION_4"] = "notification-4";
152
+ Icons["PHONE"] = "phone";
153
+ Icons["PLAY"] = "play";
154
+ Icons["PLAY_1"] = "play-1";
155
+ Icons["PLUS"] = "plus";
156
+ Icons["PRESENTATION"] = "presentation";
157
+ Icons["PRESENTATION_2"] = "presentation-2";
158
+ Icons["QUESTION_ROUNDED"] = "question-rounded";
159
+ Icons["ROTATE_LEFT"] = "rotate-left";
160
+ Icons["ROTATE_RIGHT"] = "rotate-right";
161
+ Icons["SAVE"] = "save";
162
+ Icons["SCAN"] = "scan";
163
+ Icons["SCAN_2"] = "scan-2";
164
+ Icons["SCAN_3"] = "scan-3";
165
+ Icons["SEARCH"] = "search";
166
+ Icons["SEND"] = "send";
167
+ Icons["SETTINGS"] = "settings";
168
+ Icons["SETTINGS_2"] = "settings-2";
169
+ Icons["SETTINGS_3"] = "settings-3";
170
+ Icons["SHIELD"] = "shield";
171
+ Icons["SHIELD_CHECK"] = "shield-check";
172
+ Icons["SHIELD_CROSS"] = "shield-cross";
173
+ Icons["SHOPPING"] = "shopping";
174
+ Icons["SORT"] = "sort";
175
+ Icons["STAR"] = "star";
176
+ Icons["STARS"] = "stars";
177
+ Icons["STATUS"] = "status";
178
+ Icons["SUN"] = "sun";
179
+ Icons["SUNRISE"] = "sunrise";
180
+ Icons["SWAP"] = "swap";
181
+ Icons["TERMINAL"] = "terminal";
182
+ Icons["TEXT"] = "text";
183
+ Icons["TICK"] = "tick";
184
+ Icons["TODO"] = "todo";
185
+ Icons["TV"] = "tv";
186
+ Icons["UNLOCK"] = "unlock";
187
+ Icons["USER_ADD"] = "user-add";
188
+ Icons["USER_SCAN"] = "user-scan";
189
+ Icons["USER_TWO"] = "user-two";
190
+ Icons["USER"] = "user";
191
+ Icons["UNCHECKED"] = "unchecked";
192
+ Icons["VIDEO"] = "video";
193
+ Icons["VOLUME_CROSS"] = "volume-cross";
194
+ Icons["VOLUME_HIGH"] = "volume-high";
195
+ Icons["VOLUME_LOW"] = "volume-low";
196
+ Icons["VOLUME_MUTE"] = "volume-mute";
197
+ Icons["VOLUME_SLASH"] = "volume-slash";
198
+ Icons["WALLET"] = "wallet";
199
+ Icons["WORK"] = "work";
200
+ Icons["WEB"] = "web";
201
+ Icons["ZOOM_IN"] = "zoom-in";
202
+ Icons["ZOOM_OUT"] = "zoom-out";
203
+ })(Icons || (Icons = {}));
204
+
205
+ class ErpDate {
206
+ get fieldValue() {
207
+ return this.field.value();
208
+ }
209
+ get label() {
210
+ return this.field.label?.();
211
+ }
212
+ get placeholder() {
213
+ return this.field.placeholder?.() || "PLACEHOLDERS.DEFAULT";
214
+ }
215
+ get touched() {
216
+ return this.field.touched(); // note the () after field
217
+ }
218
+ get required() {
219
+ return this.field.required?.() ?? false;
220
+ }
221
+ constructor() {
222
+ this.Icons = Icons;
223
+ this.icon = input(Icons.CALENDAR, ...(ngDevMode ? [{ debugName: "icon" }] : []));
224
+ this.open = signal(false, ...(ngDevMode ? [{ debugName: "open" }] : []));
225
+ this.day = signal(undefined, ...(ngDevMode ? [{ debugName: "day" }] : []));
226
+ this.month = signal(undefined, ...(ngDevMode ? [{ debugName: "month" }] : [])); // 1–12
227
+ this.year = signal(undefined, ...(ngDevMode ? [{ debugName: "year" }] : []));
228
+ this.displayedValue = signal("", ...(ngDevMode ? [{ debugName: "displayedValue" }] : []));
229
+ this.calendarMatrix = computed(() => {
230
+ const month = this.month();
231
+ const year = this.year();
232
+ if (!month || !year)
233
+ return [];
234
+ return this.getCalendarMatrix(year, month);
235
+ }, ...(ngDevMode ? [{ debugName: "calendarMatrix" }] : []));
236
+ this.daysCode = [
237
+ "DAYS_SHORT.01",
238
+ "DAYS_SHORT.02",
239
+ "DAYS_SHORT.03",
240
+ "DAYS_SHORT.04",
241
+ "DAYS_SHORT.05",
242
+ "DAYS_SHORT.06",
243
+ "DAYS_SHORT.07",
244
+ ];
245
+ effect(() => {
246
+ const selectedValue = this.field.value();
247
+ if (selectedValue !== null) {
248
+ this.displayedValue.set(this.getDayNumber(selectedValue.getDate()) +
249
+ "-" +
250
+ this.getMonthNumber(selectedValue.getMonth() + 1) +
251
+ "-" +
252
+ selectedValue.getFullYear());
253
+ }
254
+ else {
255
+ this.displayedValue.set("");
256
+ }
257
+ });
258
+ }
259
+ ngOnInit() {
260
+ console.log("matrix for 02/2026", this.getCalendarMatrix(2026, 4));
261
+ this.initCurrentDate();
262
+ }
263
+ toggleOpen(event) {
264
+ event.stopPropagation();
265
+ this.open.set(!this.open());
266
+ this.field.setTouched();
267
+ }
268
+ initCurrentDate() {
269
+ const selectedValue = this.field.value();
270
+ const today = selectedValue ? selectedValue : new Date();
271
+ this.day.set(today.getDate());
272
+ this.month.set(today.getMonth() + 1); // JS months 0-11
273
+ this.year.set(today.getFullYear());
274
+ if (selectedValue !== null) {
275
+ console.log("selectedValue", selectedValue);
276
+ this.displayedValue.set(this.getDayNumber(today.getDate()) +
277
+ "-" +
278
+ this.getMonthNumber(today.getMonth() + 1) +
279
+ "-" +
280
+ today.getFullYear());
281
+ }
282
+ }
283
+ getCalendarMatrix(year, month) {
284
+ const matrix = [];
285
+ // Get first day of the month (0 = Sunday, 1 = Monday, …)
286
+ const firstDay = new Date(year, month - 1, 1).getDay();
287
+ const daysInMonth = new Date(year, month, 0).getDate();
288
+ const daysInPrevMonth = new Date(year, month - 1, 0).getDate();
289
+ let currentDay = 1;
290
+ let nextMonthDay = 1;
291
+ for (let row = 0; row < 5; row++) {
292
+ // use 6 if you want 6 rows
293
+ const week = [];
294
+ for (let col = 0; col < 7; col++) {
295
+ const cellIndex = row * 7 + col;
296
+ if (cellIndex < firstDay) {
297
+ // Previous month
298
+ week.push({
299
+ day: daysInPrevMonth - firstDay + col + 1,
300
+ currentMonth: false,
301
+ });
302
+ }
303
+ else if (currentDay <= daysInMonth) {
304
+ // Current month
305
+ week.push({
306
+ day: currentDay++,
307
+ currentMonth: true,
308
+ });
309
+ }
310
+ else {
311
+ // Next month
312
+ week.push({
313
+ day: nextMonthDay++,
314
+ currentMonth: false,
315
+ });
316
+ }
317
+ }
318
+ matrix.push(week);
319
+ }
320
+ return matrix;
321
+ }
322
+ previousMonth(event) {
323
+ event.stopPropagation();
324
+ const month = this.month();
325
+ const year = this.year();
326
+ if (!month || !year)
327
+ return;
328
+ let newMonth = month - 1;
329
+ let newYear = year;
330
+ if (newMonth < 1) {
331
+ newMonth = 12;
332
+ newYear = year - 1;
333
+ }
334
+ this.month.set(newMonth);
335
+ this.year.set(newYear);
336
+ }
337
+ nextMonth(event) {
338
+ event.stopPropagation();
339
+ const month = this.month();
340
+ const year = this.year();
341
+ if (!month || !year)
342
+ return;
343
+ let newMonth = month + 1;
344
+ let newYear = year;
345
+ if (newMonth > 12) {
346
+ newMonth = 1;
347
+ newYear = year + 1;
348
+ }
349
+ this.month.set(newMonth);
350
+ this.year.set(newYear);
351
+ }
352
+ setMonth(month) {
353
+ this.month.set(month);
354
+ }
355
+ setYear(year) {
356
+ this.year.set(year);
357
+ }
358
+ getMonthCode() {
359
+ const month = this.month();
360
+ if (!month)
361
+ return "";
362
+ return month < 10 ? `MONTHS.0${this.month()}` : `MONTHS.${this.month()}`;
363
+ }
364
+ getDayNumber(day) {
365
+ if (!day)
366
+ return "";
367
+ return day < 10 ? `0${day}` : `${day}`;
368
+ }
369
+ getMonthNumber(month) {
370
+ if (!month)
371
+ return "";
372
+ return month < 10 ? `0${month}` : `${month}`;
373
+ }
374
+ selectDate(event, day) {
375
+ event.stopPropagation();
376
+ const year = this.year();
377
+ const month = this.month();
378
+ if (!year || !month)
379
+ return;
380
+ this.day.set(day);
381
+ this.field.setValue(new Date(year, month - 1, day));
382
+ const date = `${this.getDayNumber(day)}-${this.getMonthNumber(month)}-${year}`;
383
+ this.displayedValue.set(date);
384
+ this.open.set(false);
385
+ }
386
+ dayIsCurrent(day) {
387
+ const today = new Date();
388
+ return (day === today.getDate() &&
389
+ this.month() === today.getMonth() + 1 &&
390
+ this.year() === today.getFullYear());
391
+ }
392
+ dayIsSelected(day) {
393
+ const selectedDate = this.field.value();
394
+ if (!selectedDate)
395
+ return false;
396
+ return (day === this.day() &&
397
+ this.month() === selectedDate.getMonth() + 1 &&
398
+ this.year() === selectedDate.getFullYear());
399
+ }
400
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpDate, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
401
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: ErpDate, isStandalone: true, selector: "erp-date", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, field: { classPropertyName: "field", publicName: "field", isSignal: false, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"min-w-full flex flex-col gap-1\">\n <div>\n @if (label) {\n <p>\n {{ label | translate}} @if(required === true){\n <span class=\"text-danger-600\">*</span>}\n </p>\n }\n <div\n class=\"pretty-select px-4 py-3 min-w-full text-primary-700 rounded-xl border-2 border-input-border transition-all duration-200 ease-in-out\"\n >\n <div\n class=\"flex flex-row min-w-full justify-between items-center cursor-pointer\"\n (click)=\"toggleOpen($event); $event.stopPropagation()\"\n >\n <input\n type=\"text\"\n [(ngModel)]=\"displayedValue\"\n [readOnly]=\"true\"\n (click)=\"toggleOpen($event); $event.stopPropagation()\"\n placeholder=\"Select option\"\n />\n <mat-icon\n (click)=\"toggleOpen($event); $event.stopPropagation()\"\n class=\"text-primary-700\"\n [svgIcon]=\"icon()\"\n ></mat-icon>\n </div>\n @if (open() === true && calendarMatrix().length > 0) {\n <div class=\"dropdown-container pt-2\">\n <div\n class=\"dropdown px-4 py-3 text-primary-700 rounded-xl flex flex-col gap-4\"\n >\n <!--Header-->\n <div class=\"flex flex-row justify-between items-center\">\n <mat-icon\n class=\"cursor-pointer text-primary-900\"\n [svgIcon]=\"Icons.ARROW_LEFT_ROUNDED\"\n (click)=\"previousMonth($event)\"\n ></mat-icon>\n <p class=\"text-primary-900 font-semibold\">\n {{getMonthCode()|translate}}&nbsp;{{year()}}\n </p>\n <mat-icon\n class=\"cursor-pointer text-primary-900\"\n [svgIcon]=\"Icons.ARROW_RIGHT_ROUNDED\"\n (click)=\"nextMonth($event)\"\n ></mat-icon>\n </div>\n <!-- Content -->\n <div class=\"grid grid-cols-7 grid-rows-6 gap-2\">\n @for (day of daysCode; track $index) {\n <div\n class=\"flex flex-col items-center justify-center cursor-pointer\"\n >\n <p class=\"text-neutral-300 font-semibold\">\n {{ day | translate }}\n </p>\n </div>\n } @for (row of calendarMatrix(); track $index) { @for (day of row;\n track $index) {\n <div\n class=\"flex flex-col items-center justify-center cursor-pointer rounded-full p-1\"\n [ngClass]=\"{'bg-primary-700': dayIsSelected(day.day) && day.currentMonth === true}\"\n (click)=\"selectDate($event, day.day)\"\n >\n <p\n [ngClass]=\"{\n 'text-white font-regular': dayIsSelected(day.day) && day.currentMonth === true,\n 'text-primary-600 font-semibold': dayIsCurrent(day.day) === true && day.currentMonth === true,\n 'text-primary-900 font-semibold': day.currentMonth === true && dayIsCurrent(day.day) === false,\n 'text-gray-300': day.currentMonth === false\n }\"\n >\n {{ getDayNumber(day.day) }}\n </p>\n </div>\n } }\n </div>\n </div>\n </div>\n }\n </div>\n @if (touched && field.error?.()) {\n <p class=\"text-red-700 text-xs\">{{ field.error?.() | translate }}</p>\n }\n </div>\n</div>\n", styles: ["input:focus{outline:none;box-shadow:none;border:none}.pretty-select{background:#fff;font-size:14px;outline:none;position:relative}.pretty-select:focus{box-shadow:0 0 0 2px var(--primary-200),4px 4px 12px #0000000d,-4px -4px 12px #ffffffe6}.dropdown-container{position:absolute;top:100%;left:0;z-index:9999;width:max-content;min-width:100px}.dropdown{background-color:#fff;display:block;box-shadow:0 0 0 2px var(--primary-200),4px 4px 12px #0000000d,-4px -4px 12px #ffffffe6;max-height:400px;overflow-y:auto;width:max-content}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
402
+ }
403
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpDate, decorators: [{
404
+ type: Component,
405
+ args: [{ selector: "erp-date", imports: [CommonModule, TranslateModule, MatIcon, MatIconModule, FormsModule], template: "<div class=\"min-w-full flex flex-col gap-1\">\n <div>\n @if (label) {\n <p>\n {{ label | translate}} @if(required === true){\n <span class=\"text-danger-600\">*</span>}\n </p>\n }\n <div\n class=\"pretty-select px-4 py-3 min-w-full text-primary-700 rounded-xl border-2 border-input-border transition-all duration-200 ease-in-out\"\n >\n <div\n class=\"flex flex-row min-w-full justify-between items-center cursor-pointer\"\n (click)=\"toggleOpen($event); $event.stopPropagation()\"\n >\n <input\n type=\"text\"\n [(ngModel)]=\"displayedValue\"\n [readOnly]=\"true\"\n (click)=\"toggleOpen($event); $event.stopPropagation()\"\n placeholder=\"Select option\"\n />\n <mat-icon\n (click)=\"toggleOpen($event); $event.stopPropagation()\"\n class=\"text-primary-700\"\n [svgIcon]=\"icon()\"\n ></mat-icon>\n </div>\n @if (open() === true && calendarMatrix().length > 0) {\n <div class=\"dropdown-container pt-2\">\n <div\n class=\"dropdown px-4 py-3 text-primary-700 rounded-xl flex flex-col gap-4\"\n >\n <!--Header-->\n <div class=\"flex flex-row justify-between items-center\">\n <mat-icon\n class=\"cursor-pointer text-primary-900\"\n [svgIcon]=\"Icons.ARROW_LEFT_ROUNDED\"\n (click)=\"previousMonth($event)\"\n ></mat-icon>\n <p class=\"text-primary-900 font-semibold\">\n {{getMonthCode()|translate}}&nbsp;{{year()}}\n </p>\n <mat-icon\n class=\"cursor-pointer text-primary-900\"\n [svgIcon]=\"Icons.ARROW_RIGHT_ROUNDED\"\n (click)=\"nextMonth($event)\"\n ></mat-icon>\n </div>\n <!-- Content -->\n <div class=\"grid grid-cols-7 grid-rows-6 gap-2\">\n @for (day of daysCode; track $index) {\n <div\n class=\"flex flex-col items-center justify-center cursor-pointer\"\n >\n <p class=\"text-neutral-300 font-semibold\">\n {{ day | translate }}\n </p>\n </div>\n } @for (row of calendarMatrix(); track $index) { @for (day of row;\n track $index) {\n <div\n class=\"flex flex-col items-center justify-center cursor-pointer rounded-full p-1\"\n [ngClass]=\"{'bg-primary-700': dayIsSelected(day.day) && day.currentMonth === true}\"\n (click)=\"selectDate($event, day.day)\"\n >\n <p\n [ngClass]=\"{\n 'text-white font-regular': dayIsSelected(day.day) && day.currentMonth === true,\n 'text-primary-600 font-semibold': dayIsCurrent(day.day) === true && day.currentMonth === true,\n 'text-primary-900 font-semibold': day.currentMonth === true && dayIsCurrent(day.day) === false,\n 'text-gray-300': day.currentMonth === false\n }\"\n >\n {{ getDayNumber(day.day) }}\n </p>\n </div>\n } }\n </div>\n </div>\n </div>\n }\n </div>\n @if (touched && field.error?.()) {\n <p class=\"text-red-700 text-xs\">{{ field.error?.() | translate }}</p>\n }\n </div>\n</div>\n", styles: ["input:focus{outline:none;box-shadow:none;border:none}.pretty-select{background:#fff;font-size:14px;outline:none;position:relative}.pretty-select:focus{box-shadow:0 0 0 2px var(--primary-200),4px 4px 12px #0000000d,-4px -4px 12px #ffffffe6}.dropdown-container{position:absolute;top:100%;left:0;z-index:9999;width:max-content;min-width:100px}.dropdown{background-color:#fff;display:block;box-shadow:0 0 0 2px var(--primary-200),4px 4px 12px #0000000d,-4px -4px 12px #ffffffe6;max-height:400px;overflow-y:auto;width:max-content}\n"] }]
406
+ }], ctorParameters: () => [], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], field: [{
407
+ type: Input
408
+ }] } });
409
+
410
+ class ErpInputText {
411
+ constructor() {
412
+ this.Icons = Icons;
413
+ this.icon = input(...(ngDevMode ? [undefined, { debugName: "icon" }] : []));
414
+ }
415
+ get label() {
416
+ return this.field.label?.();
417
+ }
418
+ get placeholder() {
419
+ return this.field.placeholder?.() || "PLACEHOLDERS.DEFAULT";
420
+ }
421
+ get touched() {
422
+ return this.field.touched(); // note the () after field
423
+ }
424
+ get required() {
425
+ return this.field.required?.() ?? false;
426
+ }
427
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpInputText, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
428
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: ErpInputText, isStandalone: true, selector: "erp-input-text", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, field: { classPropertyName: "field", publicName: "field", isSignal: false, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"min-w-full flex flex-col gap-1\">\n <div>\n @if (label) {\n <p class=\"font-bold\">\n {{ label | translate}}@if(required === true){\n <span class=\"text-danger-600\">*</span>}\n </p>\n }\n <div\n class=\"pretty-select px-4 py-3 min-w-full text-primary-700 rounded-xl border-2 border-input-border\"\n >\n <div\n class=\"flex flex-row min-w-full justify-between gap-4 items-center cursor-pointer\"\n >\n <input\n type=\"text\"\n class=\"flex-1\"\n [ngModel]=\"field.value()\"\n (ngModelChange)=\"field.setValue($event)\"\n (blur)=\"field.setTouched()\"\n [placeholder]=\"placeholder | translate\"\n />\n @if (icon(); as icon) {\n <mat-icon class=\"text-primary-700\" [svgIcon]=\"icon\"></mat-icon>\n }\n </div>\n </div>\n @if (touched && field.error?.()) {\n <p class=\"text-red-700 text-xs\">{{ field.error?.() | translate }}</p>\n }\n </div>\n</div>\n", styles: ["input:focus{outline:none;box-shadow:none;border:none}.pretty-select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#fff;font-size:14px;outline:none;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
429
+ }
430
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpInputText, decorators: [{
431
+ type: Component,
432
+ args: [{ selector: "erp-input-text", imports: [CommonModule, TranslateModule, MatIcon, MatIconModule, FormsModule], template: "<div class=\"min-w-full flex flex-col gap-1\">\n <div>\n @if (label) {\n <p class=\"font-bold\">\n {{ label | translate}}@if(required === true){\n <span class=\"text-danger-600\">*</span>}\n </p>\n }\n <div\n class=\"pretty-select px-4 py-3 min-w-full text-primary-700 rounded-xl border-2 border-input-border\"\n >\n <div\n class=\"flex flex-row min-w-full justify-between gap-4 items-center cursor-pointer\"\n >\n <input\n type=\"text\"\n class=\"flex-1\"\n [ngModel]=\"field.value()\"\n (ngModelChange)=\"field.setValue($event)\"\n (blur)=\"field.setTouched()\"\n [placeholder]=\"placeholder | translate\"\n />\n @if (icon(); as icon) {\n <mat-icon class=\"text-primary-700\" [svgIcon]=\"icon\"></mat-icon>\n }\n </div>\n </div>\n @if (touched && field.error?.()) {\n <p class=\"text-red-700 text-xs\">{{ field.error?.() | translate }}</p>\n }\n </div>\n</div>\n", styles: ["input:focus{outline:none;box-shadow:none;border:none}.pretty-select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#fff;font-size:14px;outline:none;position:relative}\n"] }]
433
+ }], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], field: [{
434
+ type: Input
435
+ }] } });
436
+
437
+ class ErpSelect {
438
+ get fieldValue() {
439
+ return this.field.value();
440
+ }
441
+ get label() {
442
+ return this.field.label?.();
443
+ }
444
+ get placeholder() {
445
+ return this.field.placeholder?.() || "PLACEHOLDERS.DEFAULT";
446
+ }
447
+ get options() {
448
+ return this.field.options?.() ?? [];
449
+ }
450
+ get optionValue() {
451
+ return this.field.optionValue;
452
+ }
453
+ get optionLabel() {
454
+ return this.field.optionLabel;
455
+ }
456
+ get touched() {
457
+ return this.field.touched(); // note the () after field
458
+ }
459
+ get error() {
460
+ return this.field.error?.(); // same here
461
+ }
462
+ get displayValue() {
463
+ const currentObject = this.field.value(); // Get the object from the signal
464
+ if (!currentObject)
465
+ return "";
466
+ // Access the property dynamically using the optionLabel key
467
+ return currentObject[this.field.optionLabel ?? "label"] || "";
468
+ }
469
+ get required() {
470
+ return this.field.required?.() ?? false;
471
+ }
472
+ constructor(eRef) {
473
+ this.eRef = eRef;
474
+ this.icon = input(Icons.ARROW_BOTTOM_ROUNDED, ...(ngDevMode ? [{ debugName: "icon" }] : []));
475
+ this.open = signal(false, ...(ngDevMode ? [{ debugName: "open" }] : []));
476
+ }
477
+ toggleOpen(event) {
478
+ event.stopPropagation();
479
+ this.open.set(!this.open());
480
+ this.field.setTouched();
481
+ }
482
+ select(option) {
483
+ this.field.setValue(option);
484
+ this.field.setTouched();
485
+ this.open.set(false);
486
+ }
487
+ clickOutside(event) {
488
+ if (!this.eRef.nativeElement.contains(event.target)) {
489
+ this.open.set(false);
490
+ }
491
+ }
492
+ getOptionLabel(option) {
493
+ const key = this.field.optionLabel;
494
+ if (key)
495
+ return option[key];
496
+ else
497
+ return "optionKey not defined";
498
+ }
499
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpSelect, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
500
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: ErpSelect, isStandalone: true, selector: "erp-select", inputs: { selectedTemplate: { classPropertyName: "selectedTemplate", publicName: "selectedTemplate", isSignal: false, isRequired: false, transformFunction: null }, optionTemplate: { classPropertyName: "optionTemplate", publicName: "optionTemplate", isSignal: false, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, field: { classPropertyName: "field", publicName: "field", isSignal: false, isRequired: false, transformFunction: null } }, host: { listeners: { "document:click": "clickOutside($event)" } }, ngImport: i0, template: "@if (field;as field) {\n<div class=\"min-w-full flex flex-col gap-1\">\n <div>\n @if (label) {\n <p>\n {{ label | translate}} @if(required === true){\n <span class=\"text-danger-600\">*</span>}\n </p>\n }\n <div\n class=\"pretty-select px-4 py-3 min-w-full text-primary-700 rounded-xl border-2 border-input-border transition-all duration-200 ease-in-out\"\n (click)=\"toggleOpen($event)\"\n >\n <div\n class=\"flex flex-row min-w-full justify-between items-center cursor-pointer\"\n >\n @if (selectedTemplate && field.value() !== null) {\n <ng-container\n *ngTemplateOutlet=\"selectedTemplate; context: { $implicit: field.value(), value: field.value() }\"\n ></ng-container>\n }@else {\n <input\n type=\"text\"\n [value]=\"displayValue | translate\"\n [readOnly]=\"true\"\n (click)=\"toggleOpen($event); $event.stopPropagation()\"\n [placeholder]=\"placeholder | translate\"\n />\n }\n <mat-icon\n (click)=\"toggleOpen($event); $event.stopPropagation()\"\n class=\"text-primary-700\"\n [svgIcon]=\"icon()\"\n ></mat-icon>\n </div>\n @if (open() === true) {\n <div class=\"dropdown-container pt-2\">\n <div class=\"dropdown px-4 py-3 min-w-full text-primary-700 rounded-xl\">\n @for (option of options; track $index) {\n <div\n class=\"option cursor-pointer p-2 border-lg hover:bg-primary-200 rounded-lg hover:text-primary-900 transition-all duration-200 ease-in-out\"\n [ngClass]=\"{\n 'text-primary-900 bg-primary-100': fieldValue !== null && fieldValue[optionValue] === option[optionValue],\n 'text-primary-500': fieldValue === null || fieldValue[optionValue] !== option[optionValue]\n }\"\n (click)=\"$event.stopPropagation(); select(option)\"\n >\n @if(optionTemplate) {\n <ng-container\n *ngTemplateOutlet=\"optionTemplate; context: { $implicit: option, value: option }\"\n ></ng-container>\n }@else{ {{ getOptionLabel(option) | translate}} }\n </div>\n } @if (options.length === 0) {\n <div class=\"no-results\">No results</div>\n }\n </div>\n </div>\n }\n </div>\n </div>\n @if (touched && field.error?.()) {\n <p class=\"text-red-700 text-xs\">{{ field.error?.() | translate }}</p>\n }\n</div>\n}\n", styles: ["input:focus{outline:none;box-shadow:none;border:none}.pretty-select{background:#fff;font-size:14px;outline:none;position:relative}.pretty-select:focus{box-shadow:0 0 0 2px var(--primary-200),4px 4px 12px #0000000d,-4px -4px 12px #ffffffe6}.dropdown-container{position:absolute;top:100%;left:0;right:0;z-index:9999}.dropdown{height:100%;width:100%;background-color:#fff;box-shadow:0 0 0 2px var(--primary-200),4px 4px 12px #0000000d,-4px -4px 12px #ffffffe6;max-height:200px;overflow-y:auto}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
501
+ }
502
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpSelect, decorators: [{
503
+ type: Component,
504
+ args: [{ selector: "erp-select", imports: [
505
+ FormsModule,
506
+ ReactiveFormsModule,
507
+ MatIcon,
508
+ MatIconModule,
509
+ CommonModule,
510
+ NgTemplateOutlet,
511
+ TranslateModule,
512
+ ], template: "@if (field;as field) {\n<div class=\"min-w-full flex flex-col gap-1\">\n <div>\n @if (label) {\n <p>\n {{ label | translate}} @if(required === true){\n <span class=\"text-danger-600\">*</span>}\n </p>\n }\n <div\n class=\"pretty-select px-4 py-3 min-w-full text-primary-700 rounded-xl border-2 border-input-border transition-all duration-200 ease-in-out\"\n (click)=\"toggleOpen($event)\"\n >\n <div\n class=\"flex flex-row min-w-full justify-between items-center cursor-pointer\"\n >\n @if (selectedTemplate && field.value() !== null) {\n <ng-container\n *ngTemplateOutlet=\"selectedTemplate; context: { $implicit: field.value(), value: field.value() }\"\n ></ng-container>\n }@else {\n <input\n type=\"text\"\n [value]=\"displayValue | translate\"\n [readOnly]=\"true\"\n (click)=\"toggleOpen($event); $event.stopPropagation()\"\n [placeholder]=\"placeholder | translate\"\n />\n }\n <mat-icon\n (click)=\"toggleOpen($event); $event.stopPropagation()\"\n class=\"text-primary-700\"\n [svgIcon]=\"icon()\"\n ></mat-icon>\n </div>\n @if (open() === true) {\n <div class=\"dropdown-container pt-2\">\n <div class=\"dropdown px-4 py-3 min-w-full text-primary-700 rounded-xl\">\n @for (option of options; track $index) {\n <div\n class=\"option cursor-pointer p-2 border-lg hover:bg-primary-200 rounded-lg hover:text-primary-900 transition-all duration-200 ease-in-out\"\n [ngClass]=\"{\n 'text-primary-900 bg-primary-100': fieldValue !== null && fieldValue[optionValue] === option[optionValue],\n 'text-primary-500': fieldValue === null || fieldValue[optionValue] !== option[optionValue]\n }\"\n (click)=\"$event.stopPropagation(); select(option)\"\n >\n @if(optionTemplate) {\n <ng-container\n *ngTemplateOutlet=\"optionTemplate; context: { $implicit: option, value: option }\"\n ></ng-container>\n }@else{ {{ getOptionLabel(option) | translate}} }\n </div>\n } @if (options.length === 0) {\n <div class=\"no-results\">No results</div>\n }\n </div>\n </div>\n }\n </div>\n </div>\n @if (touched && field.error?.()) {\n <p class=\"text-red-700 text-xs\">{{ field.error?.() | translate }}</p>\n }\n</div>\n}\n", styles: ["input:focus{outline:none;box-shadow:none;border:none}.pretty-select{background:#fff;font-size:14px;outline:none;position:relative}.pretty-select:focus{box-shadow:0 0 0 2px var(--primary-200),4px 4px 12px #0000000d,-4px -4px 12px #ffffffe6}.dropdown-container{position:absolute;top:100%;left:0;right:0;z-index:9999}.dropdown{height:100%;width:100%;background-color:#fff;box-shadow:0 0 0 2px var(--primary-200),4px 4px 12px #0000000d,-4px -4px 12px #ffffffe6;max-height:200px;overflow-y:auto}\n"] }]
513
+ }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { selectedTemplate: [{
514
+ type: Input
515
+ }], optionTemplate: [{
516
+ type: Input
517
+ }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], field: [{
518
+ type: Input
519
+ }], clickOutside: [{
520
+ type: HostListener,
521
+ args: ["document:click", ["$event"]]
522
+ }] } });
523
+
524
+ class ErpStatusCell {
525
+ constructor() {
526
+ this.label = input.required(...(ngDevMode ? [{ debugName: "label" }] : []));
527
+ this.textColor = undefined;
528
+ this.backgroundColor = undefined;
529
+ }
530
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpStatusCell, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
531
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.1", type: ErpStatusCell, isStandalone: true, selector: "erp-status-cell", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, textColor: { classPropertyName: "textColor", publicName: "textColor", isSignal: false, isRequired: false, transformFunction: null }, backgroundColor: { classPropertyName: "backgroundColor", publicName: "backgroundColor", isSignal: false, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"flex flex-row justify-center items-center\">\n <div\n class=\"rounded-lg p-2\"\n [style.background]=\"backgroundColor?backgroundColor:'var(--primary-500)'\"\n >\n <p class=\"text-xs\" [style.color]=\"textColor?textColor:'white'\">\n {{label()}}\n </p>\n </div>\n</div>\n", styles: [""] }); }
532
+ }
533
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpStatusCell, decorators: [{
534
+ type: Component,
535
+ args: [{ selector: "erp-status-cell", imports: [], template: "<div class=\"flex flex-row justify-center items-center\">\n <div\n class=\"rounded-lg p-2\"\n [style.background]=\"backgroundColor?backgroundColor:'var(--primary-500)'\"\n >\n <p class=\"text-xs\" [style.color]=\"textColor?textColor:'white'\">\n {{label()}}\n </p>\n </div>\n</div>\n" }]
536
+ }], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], textColor: [{
537
+ type: Input
538
+ }], backgroundColor: [{
539
+ type: Input
540
+ }] } });
541
+
542
+ class ErpTable {
543
+ constructor() {
544
+ this.Icons = Icons;
545
+ this.columns = model([], ...(ngDevMode ? [{ debugName: "columns" }] : []));
546
+ this.data = model([], ...(ngDevMode ? [{ debugName: "data" }] : []));
547
+ this.idCol = model(null, ...(ngDevMode ? [{ debugName: "idCol" }] : []));
548
+ this.selectedData = model([], ...(ngDevMode ? [{ debugName: "selectedData" }] : []));
549
+ this.rowSelection = false;
550
+ this.withPagination = false;
551
+ this.templates = {};
552
+ this.actionHeaderLabel = "LABELS.ACTIONS";
553
+ this.selectedItemsLabel = undefined;
554
+ this.selectActions = model([], ...(ngDevMode ? [{ debugName: "selectActions" }] : []));
555
+ this.perItemActions = model([], ...(ngDevMode ? [{ debugName: "perItemActions" }] : []));
556
+ this.bottomBarFading = signal(false, ...(ngDevMode ? [{ debugName: "bottomBarFading" }] : []));
557
+ this.isAllToggled = computed(() => this.data().length === this.selectedData().length, ...(ngDevMode ? [{ debugName: "isAllToggled" }] : []));
558
+ }
559
+ ngOnInit() {
560
+ if (this.rowSelection === true && this.idCol() === null) {
561
+ throw new Error("idCol is required when rowSelection is true");
562
+ }
563
+ if (this.idCol() && this.data().length > 0) {
564
+ const key = this.idCol();
565
+ const ids = this.data().map((d) => d[key]);
566
+ if (new Set(ids).size !== ids.length) {
567
+ throw new Error("idCol must be unique");
568
+ }
569
+ }
570
+ }
571
+ getTemplate(key) {
572
+ return this.templates[key];
573
+ }
574
+ toggleAll() {
575
+ if (this.isAllToggled() === true) {
576
+ this.bottomBarFading.set(true);
577
+ setTimeout(() => {
578
+ this.selectedData.set([]);
579
+ this.bottomBarFading.set(false);
580
+ }, 220);
581
+ }
582
+ else {
583
+ this.selectedData.set([...this.data()]);
584
+ }
585
+ }
586
+ toggleRow(row) {
587
+ if (this.isRowSelected(row) === true) {
588
+ if (this.selectedData().length === 1) {
589
+ this.bottomBarFading.set(true);
590
+ setTimeout(() => {
591
+ this.selectedData.set(this.selectedData().filter((d) => d[this.idCol()] !== row[this.idCol()]));
592
+ this.bottomBarFading.set(false);
593
+ }, 220);
594
+ }
595
+ else {
596
+ this.selectedData.set(this.selectedData().filter((d) => d[this.idCol()] !== row[this.idCol()]));
597
+ }
598
+ }
599
+ else {
600
+ this.selectedData.set([...this.selectedData(), row]);
601
+ }
602
+ }
603
+ isRowSelected(row) {
604
+ const selected = this.selectedData().find((d) => d[this.idCol()] === row[this.idCol()]);
605
+ if (selected)
606
+ return true;
607
+ return false;
608
+ }
609
+ clearSelectedData() {
610
+ this.bottomBarFading.set(true);
611
+ setTimeout(() => {
612
+ this.selectedData.set([]);
613
+ this.bottomBarFading.set(false);
614
+ }, 220);
615
+ }
616
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpTable, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
617
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: ErpTable, isStandalone: true, selector: "erp-table", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, idCol: { classPropertyName: "idCol", publicName: "idCol", isSignal: true, isRequired: false, transformFunction: null }, selectedData: { classPropertyName: "selectedData", publicName: "selectedData", isSignal: true, isRequired: false, transformFunction: null }, rowSelection: { classPropertyName: "rowSelection", publicName: "rowSelection", isSignal: false, isRequired: false, transformFunction: null }, withPagination: { classPropertyName: "withPagination", publicName: "withPagination", isSignal: false, isRequired: false, transformFunction: null }, templates: { classPropertyName: "templates", publicName: "templates", isSignal: false, isRequired: false, transformFunction: null }, actionHeaderLabel: { classPropertyName: "actionHeaderLabel", publicName: "actionHeaderLabel", isSignal: false, isRequired: false, transformFunction: null }, selectedItemsLabel: { classPropertyName: "selectedItemsLabel", publicName: "selectedItemsLabel", isSignal: false, isRequired: false, transformFunction: null }, selectActions: { classPropertyName: "selectActions", publicName: "selectActions", isSignal: true, isRequired: false, transformFunction: null }, perItemActions: { classPropertyName: "perItemActions", publicName: "perItemActions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { columns: "columnsChange", data: "dataChange", idCol: "idColChange", selectedData: "selectedDataChange", selectActions: "selectActionsChange", perItemActions: "perItemActionsChange" }, ngImport: i0, template: "@if (columns() && columns().length > 0) {\n<table class=\"app-table min-w-full\">\n <thead>\n <tr>\n @if( rowSelection === true){\n <th>\n <span\n style=\"\n display: flex;\n align-items: center;\n justify-content: start;\n cursor: pointer;\n \"\n (click)=\"toggleAll()\"\n >\n @if (isAllToggled()=== true) {\n <mat-icon class=\"text-white\" [svgIcon]=\"Icons.CHECK\"></mat-icon>\n }@else {\n <mat-icon class=\"text-white\" [svgIcon]=\"Icons.UNCHECKED\"></mat-icon>\n }\n </span>\n </th>\n } @for (col of columns(); track col.key) {\n <th>\n <p\n class=\"text-white\"\n [ngClass]=\"{'text-center':col.cellAlignment && col.cellAlignment === 'CENTER',\n 'text-start':!col.cellAlignment || col.cellAlignment === 'START',\n 'text-end':col.cellAlignment && col.cellAlignment === 'END'\n }\"\n >\n {{ col.header }}\n </p>\n </th>\n } @if(perItemActions().length > 0){\n <th><p class=\"text-center text-white\">{{actionHeaderLabel}}</p></th>\n }\n </tr>\n </thead>\n\n <tbody>\n @for (row of data(); track row) {\n <tr>\n @if(rowSelection){\n <td class=\"nowrap-cell\">\n <span\n style=\"\n display: flex;\n align-items: center;\n justify-content: start;\n cursor: pointer;\n \"\n (click)=\"toggleRow(row)\"\n >\n @if (isRowSelected(row) === true) {\n <mat-icon class=\"text-primary-700\" [svgIcon]=\"Icons.CHECK\"></mat-icon>\n }@else {\n <mat-icon\n class=\"text-primary-700\"\n [svgIcon]=\"Icons.UNCHECKED\"\n ></mat-icon>\n }\n </span>\n </td>\n } @for (col of columns(); track col.key) {\n <td>\n @if (getTemplate(col.key); as tpl) {\n\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: row, row: row }\"\n >\n </ng-container>\n } @else {\n <p\n [ngClass]=\"{'text-center':col.cellAlignment && col.cellAlignment === 'CENTER',\n 'text-start':!col.cellAlignment || col.cellAlignment === 'START',\n 'text-end':col.cellAlignment && col.cellAlignment === 'END'\n }\"\n >\n {{ row[col.key] }}\n </p>\n }\n </td>\n } @if (perItemActions().length > 0) {\n <td>\n <div class=\"flex flex-row justify-center items-center gap-2\">\n @for (action of perItemActions(); track $index) { @if\n (action.hasRole()) {\n <mat-icon\n [svgIcon]=\"action.icon\"\n style=\"cursor: pointer\"\n [style.color]=\"action.status?.textColor ? action.status!.textColor : 'var(--primary-700)'\"\n (click)=\"action.execute([row])\"\n ></mat-icon>\n } }\n </div>\n </td>\n }\n </tr>\n }\n </tbody>\n</table>\n} @else {\n<div class=\"app-table-empty\">No data available.</div>\n} @if (selectedData().length >0) {\n<div\n class=\"slide-in-top fixed inset-x-0 bottom-0 bg-primary-700 h-[70px] px-8 flex flex-row justify-between items-center gap-8\"\n [ngClass]=\"{'slide-out-top':bottomBarFading()===true}\"\n>\n <p class=\"text-white\">\n @if (!selectedItemsLabel) { Nombre d'items selectionn\u00E9es:&nbsp; {{\n selectedData().length}} } @else { {{selectedItemsLabel}} }\n </p>\n <div class=\"flex flex-row justify-end items-center gap-4\">\n @for (action of selectActions(); track $index) { @if (action.hasRole()) {\n <div\n class=\"flex flex-row gap-2 items-center cursor-pointer border border-white rounded-xl py-2 px-4\"\n (click)=\"action.execute(selectedData())\"\n >\n <mat-icon class=\"text-white\" [svgIcon]=\"action.icon\"></mat-icon>\n <p class=\"text-white\">{{action.title |translate}}</p>\n </div>\n } }\n <div\n (click)=\"clearSelectedData()\"\n class=\"flex flex-row justify-center items-center cursor-pointer\"\n >\n <mat-icon [svgIcon]=\"Icons.CLOSE\" class=\"text-white\"></mat-icon>\n </div>\n </div>\n</div>\n\n}\n", styles: [".slide-in-top{animation:slideInTop .22s ease-out}.slide-out-top{animation:slideOutTop .22s ease-out}.slide-in-top.removing{animation:slide-in-top-leave .2s ease-in forwards}.slide-in-right{animation:slide-in-right-animation .22s ease-out}.slide-out-left{animation:slideOutLeft .22s forwards}.slide-in-left{animation:slide-in-left-animation .2s ease-in forwards}@keyframes slideInTop{0%{opacity:0;transform:translateY(24px)}to{opacity:1;transform:translateY(0)}}@keyframes slideOutTop{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(24px)}}@keyframes slide-in-top-animation{0%{opacity:0;transform:translateY(24px)}to{opacity:1;transform:translateY(0)}}@keyframes slide-in-right-animation{0%{opacity:0;transform:translate(-24px)}to{opacity:1;transform:translate(0)}}@keyframes slideOutLeft{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(-200px)}}@keyframes slide-in-left-animation{0%{opacity:0;transform:translate(24px)}to{opacity:1;transform:translate(0)}}@keyframes fade-out-animation{0%{opacity:1}to{opacity:0}}@keyframes fade-in-animation{0%{opacity:0}to{opacity:1}}.fade-in{animation:fade-in-animation .22s ease-out}.fade-out{animation:fade-out-animation .2s ease-in forwards}.floating-up-down{z-index:2;animation:floatUpDown 3s ease-in-out infinite}@keyframes floatUpDown{0%,to{transform:translateY(0)}50%{transform:translateY(-15px)}}.app-table{border-radius:15px;border-collapse:separate;border-spacing:0;overflow:hidden}.app-table thead{background:transparent}.app-table thead tr th{background:var(--primary-700)}.app-table th,.app-table td{text-align:left;font-weight:400;padding:1rem 1.5rem}.app-table thead tr:first-child th:first-child{border-top-left-radius:15px;border-bottom-left-radius:15px}.app-table thead tr:first-child th:last-child{border-top-right-radius:15px;border-bottom-right-radius:15px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
618
+ }
619
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpTable, decorators: [{
620
+ type: Component,
621
+ args: [{ selector: "erp-table", imports: [
622
+ CommonModule,
623
+ NgTemplateOutlet,
624
+ MatIconModule,
625
+ MatIcon,
626
+ TranslateModule,
627
+ ], template: "@if (columns() && columns().length > 0) {\n<table class=\"app-table min-w-full\">\n <thead>\n <tr>\n @if( rowSelection === true){\n <th>\n <span\n style=\"\n display: flex;\n align-items: center;\n justify-content: start;\n cursor: pointer;\n \"\n (click)=\"toggleAll()\"\n >\n @if (isAllToggled()=== true) {\n <mat-icon class=\"text-white\" [svgIcon]=\"Icons.CHECK\"></mat-icon>\n }@else {\n <mat-icon class=\"text-white\" [svgIcon]=\"Icons.UNCHECKED\"></mat-icon>\n }\n </span>\n </th>\n } @for (col of columns(); track col.key) {\n <th>\n <p\n class=\"text-white\"\n [ngClass]=\"{'text-center':col.cellAlignment && col.cellAlignment === 'CENTER',\n 'text-start':!col.cellAlignment || col.cellAlignment === 'START',\n 'text-end':col.cellAlignment && col.cellAlignment === 'END'\n }\"\n >\n {{ col.header }}\n </p>\n </th>\n } @if(perItemActions().length > 0){\n <th><p class=\"text-center text-white\">{{actionHeaderLabel}}</p></th>\n }\n </tr>\n </thead>\n\n <tbody>\n @for (row of data(); track row) {\n <tr>\n @if(rowSelection){\n <td class=\"nowrap-cell\">\n <span\n style=\"\n display: flex;\n align-items: center;\n justify-content: start;\n cursor: pointer;\n \"\n (click)=\"toggleRow(row)\"\n >\n @if (isRowSelected(row) === true) {\n <mat-icon class=\"text-primary-700\" [svgIcon]=\"Icons.CHECK\"></mat-icon>\n }@else {\n <mat-icon\n class=\"text-primary-700\"\n [svgIcon]=\"Icons.UNCHECKED\"\n ></mat-icon>\n }\n </span>\n </td>\n } @for (col of columns(); track col.key) {\n <td>\n @if (getTemplate(col.key); as tpl) {\n\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: row, row: row }\"\n >\n </ng-container>\n } @else {\n <p\n [ngClass]=\"{'text-center':col.cellAlignment && col.cellAlignment === 'CENTER',\n 'text-start':!col.cellAlignment || col.cellAlignment === 'START',\n 'text-end':col.cellAlignment && col.cellAlignment === 'END'\n }\"\n >\n {{ row[col.key] }}\n </p>\n }\n </td>\n } @if (perItemActions().length > 0) {\n <td>\n <div class=\"flex flex-row justify-center items-center gap-2\">\n @for (action of perItemActions(); track $index) { @if\n (action.hasRole()) {\n <mat-icon\n [svgIcon]=\"action.icon\"\n style=\"cursor: pointer\"\n [style.color]=\"action.status?.textColor ? action.status!.textColor : 'var(--primary-700)'\"\n (click)=\"action.execute([row])\"\n ></mat-icon>\n } }\n </div>\n </td>\n }\n </tr>\n }\n </tbody>\n</table>\n} @else {\n<div class=\"app-table-empty\">No data available.</div>\n} @if (selectedData().length >0) {\n<div\n class=\"slide-in-top fixed inset-x-0 bottom-0 bg-primary-700 h-[70px] px-8 flex flex-row justify-between items-center gap-8\"\n [ngClass]=\"{'slide-out-top':bottomBarFading()===true}\"\n>\n <p class=\"text-white\">\n @if (!selectedItemsLabel) { Nombre d'items selectionn\u00E9es:&nbsp; {{\n selectedData().length}} } @else { {{selectedItemsLabel}} }\n </p>\n <div class=\"flex flex-row justify-end items-center gap-4\">\n @for (action of selectActions(); track $index) { @if (action.hasRole()) {\n <div\n class=\"flex flex-row gap-2 items-center cursor-pointer border border-white rounded-xl py-2 px-4\"\n (click)=\"action.execute(selectedData())\"\n >\n <mat-icon class=\"text-white\" [svgIcon]=\"action.icon\"></mat-icon>\n <p class=\"text-white\">{{action.title |translate}}</p>\n </div>\n } }\n <div\n (click)=\"clearSelectedData()\"\n class=\"flex flex-row justify-center items-center cursor-pointer\"\n >\n <mat-icon [svgIcon]=\"Icons.CLOSE\" class=\"text-white\"></mat-icon>\n </div>\n </div>\n</div>\n\n}\n", styles: [".slide-in-top{animation:slideInTop .22s ease-out}.slide-out-top{animation:slideOutTop .22s ease-out}.slide-in-top.removing{animation:slide-in-top-leave .2s ease-in forwards}.slide-in-right{animation:slide-in-right-animation .22s ease-out}.slide-out-left{animation:slideOutLeft .22s forwards}.slide-in-left{animation:slide-in-left-animation .2s ease-in forwards}@keyframes slideInTop{0%{opacity:0;transform:translateY(24px)}to{opacity:1;transform:translateY(0)}}@keyframes slideOutTop{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(24px)}}@keyframes slide-in-top-animation{0%{opacity:0;transform:translateY(24px)}to{opacity:1;transform:translateY(0)}}@keyframes slide-in-right-animation{0%{opacity:0;transform:translate(-24px)}to{opacity:1;transform:translate(0)}}@keyframes slideOutLeft{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(-200px)}}@keyframes slide-in-left-animation{0%{opacity:0;transform:translate(24px)}to{opacity:1;transform:translate(0)}}@keyframes fade-out-animation{0%{opacity:1}to{opacity:0}}@keyframes fade-in-animation{0%{opacity:0}to{opacity:1}}.fade-in{animation:fade-in-animation .22s ease-out}.fade-out{animation:fade-out-animation .2s ease-in forwards}.floating-up-down{z-index:2;animation:floatUpDown 3s ease-in-out infinite}@keyframes floatUpDown{0%,to{transform:translateY(0)}50%{transform:translateY(-15px)}}.app-table{border-radius:15px;border-collapse:separate;border-spacing:0;overflow:hidden}.app-table thead{background:transparent}.app-table thead tr th{background:var(--primary-700)}.app-table th,.app-table td{text-align:left;font-weight:400;padding:1rem 1.5rem}.app-table thead tr:first-child th:first-child{border-top-left-radius:15px;border-bottom-left-radius:15px}.app-table thead tr:first-child th:last-child{border-top-right-radius:15px;border-bottom-right-radius:15px}\n"] }]
628
+ }], ctorParameters: () => [], propDecorators: { columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }, { type: i0.Output, args: ["columnsChange"] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }, { type: i0.Output, args: ["dataChange"] }], idCol: [{ type: i0.Input, args: [{ isSignal: true, alias: "idCol", required: false }] }, { type: i0.Output, args: ["idColChange"] }], selectedData: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedData", required: false }] }, { type: i0.Output, args: ["selectedDataChange"] }], rowSelection: [{
629
+ type: Input
630
+ }], withPagination: [{
631
+ type: Input
632
+ }], templates: [{
633
+ type: Input
634
+ }], actionHeaderLabel: [{
635
+ type: Input
636
+ }], selectedItemsLabel: [{
637
+ type: Input
638
+ }], selectActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectActions", required: false }] }, { type: i0.Output, args: ["selectActionsChange"] }], perItemActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "perItemActions", required: false }] }, { type: i0.Output, args: ["perItemActionsChange"] }] } });
639
+
640
+ class ErpUserCell {
641
+ constructor() {
642
+ this.firstName = "";
643
+ this.lastName = "";
644
+ this.email = "";
645
+ }
646
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpUserCell, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
647
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.1", type: ErpUserCell, isStandalone: true, selector: "erp-user-cell", inputs: { firstName: "firstName", lastName: "lastName", email: "email" }, ngImport: i0, template: "<div class=\"min-w-full flex flex-row items-center gap-2\">\n <div class=\"h-[15px] w-[15px] rounded-full bg-primary-400\"></div>\n <div class=\"\">\n <p class=\"text-primary-900\">{{firstName}}&nbsp;{{lastName}}</p>\n <p class=\"text-gray-400\">{{email}}</p>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }] }); }
648
+ }
649
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpUserCell, decorators: [{
650
+ type: Component,
651
+ args: [{ selector: "erp-user-cell", imports: [CommonModule], template: "<div class=\"min-w-full flex flex-row items-center gap-2\">\n <div class=\"h-[15px] w-[15px] rounded-full bg-primary-400\"></div>\n <div class=\"\">\n <p class=\"text-primary-900\">{{firstName}}&nbsp;{{lastName}}</p>\n <p class=\"text-gray-400\">{{email}}</p>\n </div>\n</div>\n" }]
652
+ }], ctorParameters: () => [], propDecorators: { firstName: [{
653
+ type: Input
654
+ }], lastName: [{
655
+ type: Input
656
+ }], email: [{
657
+ type: Input
658
+ }] } });
659
+
660
+ class ErpConfigService {
661
+ constructor() {
662
+ this.hostOrigin = signal("", ...(ngDevMode ? [{ debugName: "hostOrigin" }] : []));
663
+ this.remoteOrigin = signal("", ...(ngDevMode ? [{ debugName: "remoteOrigin" }] : []));
664
+ this.backOrigin = signal("", ...(ngDevMode ? [{ debugName: "backOrigin" }] : []));
665
+ }
666
+ setConfig(config) {
667
+ this.hostOrigin.set(config.hostOrigin);
668
+ this.remoteOrigin.set(config.remoteOrigin);
669
+ this.backOrigin.set(config.backOrigin);
670
+ }
671
+ setHostOrigin(origin) {
672
+ this.hostOrigin.set(origin);
673
+ }
674
+ setRemoteOrigin(origin) {
675
+ this.remoteOrigin.set(origin);
676
+ }
677
+ setBackOrigin(origin) {
678
+ this.backOrigin.set(origin);
679
+ }
680
+ getConfig() {
681
+ return {
682
+ hostOrigin: this.hostOrigin(),
683
+ remoteOrigin: this.remoteOrigin(),
684
+ backOrigin: this.backOrigin(),
685
+ };
686
+ }
687
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpConfigService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
688
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpConfigService, providedIn: "root" }); }
689
+ }
690
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpConfigService, decorators: [{
691
+ type: Injectable,
692
+ args: [{ providedIn: "root" }]
693
+ }], ctorParameters: () => [] });
694
+
695
+ class ErpApiService {
696
+ constructor() {
697
+ this.http = inject(HttpClient);
698
+ this.config = inject(ErpConfigService);
699
+ this.baseUrl = "";
700
+ this.baseUrl = this.config.getConfig().backOrigin;
701
+ }
702
+ get(endpoint, params) {
703
+ const httpParams = params
704
+ ? new HttpParams({ fromObject: params })
705
+ : undefined;
706
+ return this.http.get(`${this.baseUrl}${endpoint}`, {
707
+ params: httpParams,
708
+ });
709
+ }
710
+ getPaginated(endpoint, params) {
711
+ const httpParams = params
712
+ ? new HttpParams({ fromObject: params })
713
+ : undefined;
714
+ return this.http.get(`${this.baseUrl}${endpoint}`, {
715
+ params: httpParams,
716
+ });
717
+ }
718
+ getByID(endpoint, id, params) {
719
+ const httpParams = params
720
+ ? new HttpParams({ fromObject: params })
721
+ : undefined;
722
+ return this.http.get(`${this.baseUrl}${endpoint}/${id}`, {
723
+ params: httpParams,
724
+ });
725
+ }
726
+ post(endpoint, body) {
727
+ return this.http.post(`${this.baseUrl}${endpoint}`, body, {
728
+ headers: new HttpHeaders({ "Content-Type": "application/json" }),
729
+ });
730
+ }
731
+ put(endpoint, body) {
732
+ return this.http.put(`${this.baseUrl}${endpoint}`, body, {
733
+ headers: new HttpHeaders({ "Content-Type": "application/json" }),
734
+ });
735
+ }
736
+ patch(endpoint, body) {
737
+ return this.http.patch(`${this.baseUrl}${endpoint}`, body);
738
+ }
739
+ delete(endpoint) {
740
+ return this.http.delete(`${this.baseUrl}${endpoint}`);
741
+ }
742
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
743
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpApiService, providedIn: "root" }); }
744
+ }
745
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpApiService, decorators: [{
746
+ type: Injectable,
747
+ args: [{ providedIn: "root" }]
748
+ }], ctorParameters: () => [] });
749
+
750
+ class ErpAuthService {
751
+ constructor() {
752
+ this.keycloak = inject(Keycloak);
753
+ // ── Reactive state ────────────────────────────────────────────────────────
754
+ /** True when the user has an active Keycloak session */
755
+ this.isAuthenticated = signal(this.keycloak.authenticated ?? false, ...(ngDevMode ? [{ debugName: "isAuthenticated" }] : []));
756
+ /** Decoded token payload as a signal */
757
+ this.tokenParsed = signal(this.keycloak.tokenParsed, ...(ngDevMode ? [{ debugName: "tokenParsed" }] : []));
758
+ /** Convenience: logged-in username */
759
+ this.username = computed(() => this.tokenParsed()
760
+ ?.preferred_username ?? "", ...(ngDevMode ? [{ debugName: "username" }] : []));
761
+ /** Convenience: user's realm roles */
762
+ this.roles = computed(() => this.keycloak.realmAccess?.roles ?? [], ...(ngDevMode ? [{ debugName: "roles" }] : []));
763
+ }
764
+ // ── Actions ───────────────────────────────────────────────────────────────
765
+ /**
766
+ * Redirect to the Keycloak login page.
767
+ * @param redirectUri Where to return after login. Defaults to current URL.
768
+ */
769
+ login(redirectUri) {
770
+ return this.keycloak.login({
771
+ redirectUri: redirectUri ?? window.location.href,
772
+ });
773
+ }
774
+ /**
775
+ * Logout and redirect.
776
+ * @param redirectUri Where to redirect after logout. Defaults to current origin.
777
+ */
778
+ logout(redirectUri) {
779
+ return this.keycloak.logout({
780
+ redirectUri: redirectUri ?? window.location.origin,
781
+ });
782
+ }
783
+ /**
784
+ * Redirect to Keycloak's account management page.
785
+ */
786
+ manageAccount() {
787
+ return this.keycloak.accountManagement();
788
+ }
789
+ /**
790
+ * Get the current bearer token string (for manual use if needed).
791
+ */
792
+ getToken() {
793
+ return this.keycloak.token
794
+ ? Promise.resolve(this.keycloak.token)
795
+ : Promise.reject("No token available");
796
+ }
797
+ /**
798
+ * Check if the user has a specific realm role.
799
+ */
800
+ hasRole(role) {
801
+ return this.keycloak.hasRealmRole(role);
802
+ }
803
+ /**
804
+ * Check if the user has a specific resource (client) role.
805
+ */
806
+ hasResourceRole(role, resource) {
807
+ return this.keycloak.hasResourceRole(role, resource);
808
+ }
809
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpAuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
810
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpAuthService, providedIn: "root" }); }
811
+ }
812
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpAuthService, decorators: [{
813
+ type: Injectable,
814
+ args: [{ providedIn: "root" }]
815
+ }] });
816
+
817
+ class ErpNotificationService {
818
+ constructor() {
819
+ this.notifications = signal([], ...(ngDevMode ? [{ debugName: "notifications" }] : []));
820
+ }
821
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpNotificationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
822
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpNotificationService, providedIn: "root" }); }
823
+ }
824
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpNotificationService, decorators: [{
825
+ type: Injectable,
826
+ args: [{ providedIn: "root" }]
827
+ }] });
828
+
829
+ class ErpTranslationService {
830
+ constructor(http) {
831
+ this.http = http;
832
+ this.translate = inject(TranslateService);
833
+ this.config = inject(ErpConfigService);
834
+ }
835
+ getHostTranslationForKey(key, lang = "fr") {
836
+ return this.http
837
+ .get(`${this.config.getConfig().hostOrigin}/assets/i18n/${lang}.json`)
838
+ .pipe(map((data) => data[key] ?? ""), // pick the key
839
+ catchError(() => of("")));
840
+ }
841
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpTranslationService, deps: [{ token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
842
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpTranslationService, providedIn: "root" }); }
843
+ }
844
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpTranslationService, decorators: [{
845
+ type: Injectable,
846
+ args: [{
847
+ providedIn: "root",
848
+ }]
849
+ }], ctorParameters: () => [{ type: i1$1.HttpClient }] });
850
+
851
+ class ErpI18nService {
852
+ constructor() {
853
+ this.translate = inject(TranslateService);
854
+ /** Reactive signal of the currently active language */
855
+ this.currentLang = signal(this.translate.currentLang ?? this.translate.defaultLang, ...(ngDevMode ? [{ debugName: "currentLang" }] : []));
856
+ // Keep the signal in sync when language changes externally
857
+ this.translate.onLangChange.subscribe(({ lang }) => {
858
+ this.currentLang.set(lang);
859
+ });
860
+ }
861
+ /**
862
+ * Switch the active language and persist the choice to localStorage.
863
+ */
864
+ use(lang) {
865
+ localStorage.setItem("itdev_erp_lang", lang);
866
+ return this.translate.use(lang);
867
+ }
868
+ /**
869
+ * Restore the persisted language on app startup.
870
+ * Call this in your root component's ngOnInit or APP_INITIALIZER.
871
+ */
872
+ restorePersistedLang() {
873
+ const saved = localStorage.getItem("itdev_erp_lang");
874
+ if (saved) {
875
+ this.translate.use(saved);
876
+ }
877
+ }
878
+ /**
879
+ * Translate a key instantly (synchronous).
880
+ */
881
+ instant(key, params) {
882
+ return this.translate.instant(key, params);
883
+ }
884
+ /**
885
+ * Translate a key reactively (observable — auto-updates on lang change).
886
+ */
887
+ get(key, params) {
888
+ return this.translate.get(key, params);
889
+ }
890
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpI18nService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
891
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpI18nService, providedIn: "root" }); }
892
+ }
893
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ErpI18nService, decorators: [{
894
+ type: Injectable,
895
+ args: [{ providedIn: "root" }]
896
+ }], ctorParameters: () => [] });
897
+
898
+ /**
899
+ * Call once in your app.config.ts providers array.
900
+ *
901
+ * @example
902
+ * export const appConfig: ApplicationConfig = {
903
+ * providers: [
904
+ * provideHttpClient(),
905
+ * provideErpTranslate({ defaultLang: 'fr' }),
906
+ * ],
907
+ * };
908
+ */
909
+ function provideErpTranslate(config = {}) {
910
+ const path = config.translationsPath ?? "assets/i18n/";
911
+ const defaultLang = config.defaultLang ?? "fr";
912
+ return makeEnvironmentProviders([
913
+ importProvidersFrom(TranslateModule.forRoot({
914
+ // ❌ No isolate:true — library components must share
915
+ // the same TranslateService instance as the app
916
+ defaultLanguage: defaultLang,
917
+ useDefaultLang: true, // fallback to defaultLang if key is missing
918
+ loader: {
919
+ provide: TranslateLoader,
920
+ useFactory: HttpLoaderFactory,
921
+ deps: [HttpClient],
922
+ },
923
+ })),
924
+ ]);
925
+ }
926
+ class CustomTranslateLoader {
927
+ constructor(http) {
928
+ this.http = http;
929
+ }
930
+ getTranslation(lang) {
931
+ return this.http.get(`assets/i18n/${lang}.json`);
932
+ }
933
+ }
934
+ function HttpLoaderFactory(http) {
935
+ return new CustomTranslateLoader(http);
936
+ }
937
+
938
+ var InputTypes;
939
+ (function (InputTypes) {
940
+ InputTypes["GROUP"] = "GROUP";
941
+ InputTypes["TEXT"] = "TEXT";
942
+ InputTypes["TEXT_AR"] = "TEXT_AR";
943
+ InputTypes["STATUS"] = "STATUS";
944
+ InputTypes["DATE"] = "DATE";
945
+ InputTypes["NUMBER"] = "NUMBER";
946
+ InputTypes["CURRENCY"] = "CURRENCY";
947
+ InputTypes["BIG_INT_CURRENCY"] = "BIG_INT_CURRENCY";
948
+ InputTypes["MULTI_DATE"] = "MULTI_DATE";
949
+ InputTypes["SELECT"] = "SELECT";
950
+ InputTypes["MULTI_SELECT"] = "MULTI_SELECT";
951
+ InputTypes["PHONE_NUMBER"] = "PHONE_NUMBER";
952
+ InputTypes["FAX"] = "FAX";
953
+ InputTypes["EMAIL"] = "EMAIL";
954
+ InputTypes["PASSWORD"] = "PASSWORD";
955
+ InputTypes["AUTOCOMPLETE"] = "AUTOCOMPLETE";
956
+ InputTypes["TEXT_AREA"] = "TEXT_AREA";
957
+ InputTypes["MASK"] = "MASK";
958
+ InputTypes["CHECKBOX"] = "CHECK_BOX";
959
+ })(InputTypes || (InputTypes = {}));
960
+
961
+ /** parametters for pagination (e.g. ) toPageParams({ page: 0, size: 10, sort: 'createdAt' })*/
962
+ function toPageParams(req) {
963
+ const params = {};
964
+ if (req.page !== undefined)
965
+ params["page"] = req.page.toString();
966
+ if (req.size !== undefined)
967
+ params["size"] = req.size.toString();
968
+ if (req.sort)
969
+ params["sort"] = req.sort;
970
+ return params;
971
+ }
972
+
973
+ // base-entity.model.ts
974
+ class BaseEntity {
975
+ constructor() {
976
+ this.archived = false;
977
+ }
978
+ }
979
+
980
+ class CategorieSocioProfRequest {
981
+ constructor(data = {}) {
982
+ Object.assign(this, data);
983
+ }
984
+ }
985
+
986
+ class CategorieSocioProf extends BaseEntity {
987
+ toJson() {
988
+ return new CategorieSocioProfRequest({
989
+ libelleFr: this.libelleFr,
990
+ libelleAr: this.libelleAr,
991
+ libelleEn: this.libelleEn,
992
+ });
993
+ }
994
+ static fromJson(data) {
995
+ const obj = new CategorieSocioProf();
996
+ obj.id = data.id;
997
+ obj.libelleFr = data.libelleFr;
998
+ obj.libelleAr = data.libelleAr;
999
+ obj.libelleEn = data.libelleEn;
1000
+ obj.createdAt = data.createdAt ? new Date(data.createdAt) : undefined;
1001
+ obj.updatedAt = data.updatedAt ? new Date(data.updatedAt) : undefined;
1002
+ obj.createdBy = data.createdBy;
1003
+ obj.updatedBy = data.updatedBy;
1004
+ obj.archived = data.archived ?? false;
1005
+ obj.attributes = data.attributes;
1006
+ return obj;
1007
+ }
1008
+ }
1009
+
1010
+ class GrilleRequest {
1011
+ constructor(data = {}) {
1012
+ Object.assign(this, data);
1013
+ }
1014
+ }
1015
+
1016
+ class Grille extends BaseEntity {
1017
+ toJson() {
1018
+ return new GrilleRequest({
1019
+ section: this.section,
1020
+ indice: this.indice,
1021
+ sbase: this.sbase,
1022
+ statut: this.statut,
1023
+ });
1024
+ }
1025
+ static fromJson(data) {
1026
+ const obj = new Grille();
1027
+ obj.id = data.id;
1028
+ obj.section = data.section;
1029
+ obj.indice = data.indice;
1030
+ obj.sbase = data.sbase;
1031
+ obj.statut = data.statut;
1032
+ obj.createdAt = data.createdAt ? new Date(data.createdAt) : undefined;
1033
+ obj.updatedAt = data.updatedAt ? new Date(data.updatedAt) : undefined;
1034
+ obj.createdBy = data.createdBy;
1035
+ obj.updatedBy = data.updatedBy;
1036
+ obj.archived = data.archived ?? false;
1037
+ obj.attributes = data.attributes;
1038
+ return obj;
1039
+ }
1040
+ }
1041
+
1042
+ class FichePosteRequest {
1043
+ constructor(data = {}) {
1044
+ Object.assign(this, data);
1045
+ }
1046
+ }
1047
+
1048
+ class FichePoste extends BaseEntity {
1049
+ toJson() {
1050
+ return new FichePosteRequest({
1051
+ libelleFr: this.libelleFr,
1052
+ libelleAr: this.libelleAr,
1053
+ libelleEn: this.libelleEn,
1054
+ grilleId: this.grille?.id,
1055
+ });
1056
+ }
1057
+ static fromJson(data) {
1058
+ const obj = new FichePoste();
1059
+ obj.id = data.id;
1060
+ obj.libelleFr = data.libelleFr;
1061
+ obj.libelleAr = data.libelleAr;
1062
+ obj.libelleEn = data.libelleEn;
1063
+ obj.grille = data.grille ? Grille.fromJson(data.grille) : undefined;
1064
+ obj.createdAt = data.createdAt ? new Date(data.createdAt) : undefined;
1065
+ obj.updatedAt = data.updatedAt ? new Date(data.updatedAt) : undefined;
1066
+ obj.createdBy = data.createdBy;
1067
+ obj.updatedBy = data.updatedBy;
1068
+ obj.archived = data.archived ?? false;
1069
+ obj.attributes = data.attributes;
1070
+ return obj;
1071
+ }
1072
+ }
1073
+
1074
+ class PlanComptableRequest {
1075
+ constructor(data = {}) {
1076
+ Object.assign(this, data);
1077
+ }
1078
+ }
1079
+
1080
+ class PlanComptable extends BaseEntity {
1081
+ toJson() {
1082
+ return new PlanComptableRequest({
1083
+ id: this.id,
1084
+ libelleFr: this.libelleFr,
1085
+ libelleAr: this.libelleAr,
1086
+ libelleEn: this.libelleEn,
1087
+ sens: this.sens,
1088
+ });
1089
+ }
1090
+ static fromJson(data) {
1091
+ const obj = new PlanComptable();
1092
+ obj.id = data.id;
1093
+ obj.libelleFr = data.libelleFr;
1094
+ obj.libelleAr = data.libelleAr;
1095
+ obj.libelleEn = data.libelleEn;
1096
+ obj.sens = data.sens;
1097
+ obj.createdAt = data.createdAt ? new Date(data.createdAt) : undefined;
1098
+ obj.updatedAt = data.updatedAt ? new Date(data.updatedAt) : undefined;
1099
+ obj.createdBy = data.createdBy;
1100
+ obj.updatedBy = data.updatedBy;
1101
+ obj.archived = data.archived ?? false;
1102
+ obj.attributes = data.attributes;
1103
+ return obj;
1104
+ }
1105
+ }
1106
+
1107
+ var SensComptable;
1108
+ (function (SensComptable) {
1109
+ SensComptable["DEBIT"] = "DEBIT";
1110
+ SensComptable["CREDIT"] = "CREDIT";
1111
+ })(SensComptable || (SensComptable = {}));
1112
+ const SensComptableList = Object.entries(SensComptable).map(([key, value]) => ({ key, value }));
1113
+
1114
+ class PlanRubriqueRequest {
1115
+ constructor(data = {}) {
1116
+ Object.assign(this, data);
1117
+ }
1118
+ }
1119
+
1120
+ class PlanRubrique extends BaseEntity {
1121
+ toJson() {
1122
+ return new PlanRubriqueRequest({
1123
+ codeRubrique: this.codeRubrique,
1124
+ libelleFr: this.libelleFr,
1125
+ libelleAr: this.libelleAr,
1126
+ libelleEn: this.libelleEn,
1127
+ sens: this.sens,
1128
+ modeCalcul: this.modeCalcul,
1129
+ typeRubrique: this.typeRubrique,
1130
+ });
1131
+ }
1132
+ static fromJson(data) {
1133
+ const obj = new PlanRubrique();
1134
+ obj.id = data.id;
1135
+ obj.codeRubrique = data.codeRubrique;
1136
+ obj.libelleFr = data.libelleFr;
1137
+ obj.libelleAr = data.libelleAr;
1138
+ obj.libelleEn = data.libelleEn;
1139
+ obj.sens = data.sens;
1140
+ obj.modeCalcul = data.modeCalcul;
1141
+ obj.typeRubrique = data.typeRubrique;
1142
+ obj.createdAt = data.createdAt ? new Date(data.createdAt) : undefined;
1143
+ obj.updatedAt = data.updatedAt ? new Date(data.updatedAt) : undefined;
1144
+ obj.createdBy = data.createdBy;
1145
+ obj.updatedBy = data.updatedBy;
1146
+ obj.archived = data.archived ?? false;
1147
+ obj.attributes = data.attributes;
1148
+ return obj;
1149
+ }
1150
+ }
1151
+
1152
+ var TypeRubrique;
1153
+ (function (TypeRubrique) {
1154
+ TypeRubrique["FIXE"] = "FIXE";
1155
+ TypeRubrique["VARIABLE"] = "VARIABLE";
1156
+ })(TypeRubrique || (TypeRubrique = {}));
1157
+ const TypeRubriqueList = Object.entries(TypeRubrique).map(([key, value]) => ({ key, value }));
1158
+
1159
+ class TypeCongeRequest {
1160
+ constructor(data = {}) {
1161
+ Object.assign(this, data);
1162
+ }
1163
+ }
1164
+
1165
+ class TypeConge extends BaseEntity {
1166
+ toJson() {
1167
+ return new TypeCongeRequest({
1168
+ libelleFr: this.libelleFr,
1169
+ libelleAr: this.libelleAr,
1170
+ libelleEn: this.libelleEn,
1171
+ });
1172
+ }
1173
+ static fromJson(data) {
1174
+ const obj = new TypeConge();
1175
+ obj.id = data.id;
1176
+ obj.libelleFr = data.libelleFr;
1177
+ obj.libelleAr = data.libelleAr;
1178
+ obj.libelleEn = data.libelleEn;
1179
+ obj.createdAt = data.createdAt ? new Date(data.createdAt) : undefined;
1180
+ obj.updatedAt = data.updatedAt ? new Date(data.updatedAt) : undefined;
1181
+ obj.createdBy = data.createdBy;
1182
+ obj.updatedBy = data.updatedBy;
1183
+ obj.archived = data.archived ?? false;
1184
+ obj.attributes = data.attributes;
1185
+ return obj;
1186
+ }
1187
+ }
1188
+
1189
+ class TypeContratRequest {
1190
+ constructor(data = {}) {
1191
+ Object.assign(this, data);
1192
+ }
1193
+ }
1194
+
1195
+ class TypeContrat extends BaseEntity {
1196
+ toJson() {
1197
+ return new TypeContratRequest({
1198
+ libelleEn: this.libelleEn,
1199
+ libelleFr: this.libelleFr,
1200
+ libelleAr: this.libelleAr,
1201
+ });
1202
+ }
1203
+ static fromJson(data) {
1204
+ const obj = new TypeContrat();
1205
+ obj.id = data.id;
1206
+ obj.libelleEn = data.libelleEn;
1207
+ obj.libelleFr = data.libelleFr;
1208
+ obj.libelleAr = data.libelleAr;
1209
+ obj.createdAt = data.createdAt ? new Date(data.createdAt) : undefined;
1210
+ obj.updatedAt = data.updatedAt ? new Date(data.updatedAt) : undefined;
1211
+ obj.createdBy = data.createdBy;
1212
+ obj.updatedBy = data.updatedBy;
1213
+ obj.archived = data.archived ?? false;
1214
+ obj.attributes = data.attributes;
1215
+ return obj;
1216
+ }
1217
+ }
1218
+
1219
+ class TypeFormationRequest {
1220
+ constructor(data = {}) {
1221
+ Object.assign(this, data);
1222
+ }
1223
+ }
1224
+
1225
+ class TypeFormation extends BaseEntity {
1226
+ toJson() {
1227
+ return new TypeFormationRequest({
1228
+ libelleFr: this.libelleFr,
1229
+ libelleAr: this.libelleAr,
1230
+ libelleEn: this.libelleEn,
1231
+ });
1232
+ }
1233
+ static fromJson(data) {
1234
+ const obj = new TypeFormation();
1235
+ obj.id = data.id;
1236
+ obj.libelleFr = data.libelleFr;
1237
+ obj.libelleAr = data.libelleAr;
1238
+ obj.libelleEn = data.libelleEn;
1239
+ obj.createdAt = data.createdAt ? new Date(data.createdAt) : undefined;
1240
+ obj.updatedAt = data.updatedAt ? new Date(data.updatedAt) : undefined;
1241
+ obj.createdBy = data.createdBy;
1242
+ obj.updatedBy = data.updatedBy;
1243
+ obj.archived = data.archived ?? false;
1244
+ obj.attributes = data.attributes;
1245
+ return obj;
1246
+ }
1247
+ }
1248
+
1249
+ class TypeSanctionRequest {
1250
+ constructor(data = {}) {
1251
+ Object.assign(this, data);
1252
+ }
1253
+ }
1254
+
1255
+ class TypeSanction extends BaseEntity {
1256
+ toJson() {
1257
+ return new TypeSanctionRequest({
1258
+ libelleFr: this.libelleFr,
1259
+ libelleAr: this.libelleAr,
1260
+ libelleEn: this.libelleEn,
1261
+ });
1262
+ }
1263
+ static fromJson(data) {
1264
+ const obj = new TypeSanction();
1265
+ obj.id = data.id;
1266
+ obj.libelleFr = data.libelleFr;
1267
+ obj.libelleAr = data.libelleAr;
1268
+ obj.libelleEn = data.libelleEn;
1269
+ obj.createdAt = data.createdAt ? new Date(data.createdAt) : undefined;
1270
+ obj.updatedAt = data.updatedAt ? new Date(data.updatedAt) : undefined;
1271
+ obj.createdBy = data.createdBy;
1272
+ obj.updatedBy = data.updatedBy;
1273
+ obj.archived = data.archived ?? false;
1274
+ obj.attributes = data.attributes;
1275
+ return obj;
1276
+ }
1277
+ }
1278
+
1279
+ /*
1280
+ * Public API Surface of @itdev/erp
1281
+ */
1282
+ // Components (standalone)
1283
+
1284
+ /**
1285
+ * Generated bundle index. Do not edit.
1286
+ */
1287
+
1288
+ export { BaseEntity, ButtonComponent, CategorieSocioProf, CategorieSocioProfRequest, CustomTranslateLoader, ErpApiService, ErpAuthService, ErpConfigService, ErpDate, ErpI18nService, ErpInputText, ErpNotificationService, ErpSelect, ErpStatusCell, ErpTable, ErpTranslationService, ErpUserCell, FichePoste, FichePosteRequest, Grille, GrilleRequest, HttpLoaderFactory, Icons, InputTypes, PlanComptable, PlanComptableRequest, PlanRubrique, PlanRubriqueRequest, SensComptable, SensComptableList, TypeConge, TypeCongeRequest, TypeContrat, TypeContratRequest, TypeFormation, TypeFormationRequest, TypeRubrique, TypeRubriqueList, TypeSanction, TypeSanctionRequest, provideErpTranslate, toPageParams };
1289
+ //# sourceMappingURL=erp-library-itdev.mjs.map