mk-ng-lib 0.0.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.
- package/README.md +63 -0
- package/fesm2022/mk-ng-lib.mjs +2097 -0
- package/fesm2022/mk-ng-lib.mjs.map +1 -0
- package/index.d.ts +587 -0
- package/package.json +34 -0
|
@@ -0,0 +1,2097 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, InjectionToken, Injectable, PLATFORM_ID, Inject, signal, input, inject, ViewChild, ContentChild, Input, SecurityContext, ViewContainerRef, Directive, Host, Optional, ElementRef, Self, HostBinding, HostListener, Pipe } from '@angular/core';
|
|
3
|
+
import * as i1$7 from '@angular/forms';
|
|
4
|
+
import { FormBuilder, FormControlName, NgControl } from '@angular/forms';
|
|
5
|
+
import { tap, switchMap, catchError, finalize, map, filter, startWith } from 'rxjs/operators';
|
|
6
|
+
import * as i1$4 from '@angular/common';
|
|
7
|
+
import { isPlatformServer, formatDate, Location, CommonModule, NgIf } from '@angular/common';
|
|
8
|
+
import * as i1$1 from '@angular/common/http';
|
|
9
|
+
import { HttpErrorResponse } from '@angular/common/http';
|
|
10
|
+
import { Subject, of, endWith, throwError, takeWhile, Observable, from, concat } from 'rxjs';
|
|
11
|
+
import * as i1 from 'ngx-toastr';
|
|
12
|
+
import * as i1$2 from '@angular/router';
|
|
13
|
+
import { Router as Router$1, ActivatedRoute, NavigationEnd } from '@angular/router';
|
|
14
|
+
import * as i1$8 from 'primeng/dynamicdialog';
|
|
15
|
+
import { DynamicDialogRef, DynamicDialogConfig } from 'primeng/dynamicdialog';
|
|
16
|
+
import { Breadcrumb } from 'primeng/breadcrumb';
|
|
17
|
+
import * as i1$3 from '@angular/material/dialog';
|
|
18
|
+
import { MatDialogTitle, MatDialogActions, MatDialogContent, MatDialogClose, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
|
19
|
+
import { MatButton } from '@angular/material/button';
|
|
20
|
+
import { trigger, state, transition, style, animate } from '@angular/animations';
|
|
21
|
+
import * as i1$5 from 'primeng/api';
|
|
22
|
+
import html2canvas from 'html2canvas';
|
|
23
|
+
import * as i1$6 from '@angular/platform-browser';
|
|
24
|
+
import { jwtDecode } from 'jwt-decode';
|
|
25
|
+
import { MatIcon } from '@angular/material/icon';
|
|
26
|
+
import { CdkDrag, CdkDragHandle } from '@angular/cdk/drag-drop';
|
|
27
|
+
import * as _ from 'lodash';
|
|
28
|
+
import { faCoffee, faHome, faUser, faEnvelope, faSearch, faHeart, faStar, faCheck, faTimes, faPlus, faMinus, faShoppingCart, faPhone, faInfoCircle, faExclamationTriangle, faThumbsUp, faThumbsDown, faLock, faUnlock, faCog, faCogs, faTrash, faTrashAlt, faEdit, faSave, faDownload, faUpload, faFile, faFileAlt, faFolder, faFolderOpen, faBell, faBellSlash, faCamera, faCameraRetro, faImage, faImages, faPlay, faPause, faStop, faForward, faBackward, faStepForward, faStepBackward, faFastForward, faFastBackward, faRedo, faUndo, faSync, faSyncAlt, faAngleUp, faAngleDown, faAngleLeft, faAngleRight, faChevronUp, faChevronDown, faChevronLeft, faChevronRight, faCaretUp, faCaretDown, faCaretLeft, faCaretRight, faArrowUp, faArrowDown, faArrowLeft, faArrowRight, faExternalLink, faExternalLinkAlt, faLink, faUnlink, faRedoAlt, faUndoAlt, faExchangeAlt, faRetweet, faRandom, faSpinner, faCircle, faSquare, faCheckCircle, faCheckSquare, faExclamation, faQuestion, faQuestionCircle, faInfo, faShare, faShareAlt, faShareSquare, faCheckDouble, faEllipsisH, faEllipsisV, faBars, faList, faListAlt, faTh, faThLarge, faThList, faTable, faTasks, faFilter, faSort, faSortUp, faSortDown } from '@fortawesome/free-solid-svg-icons';
|
|
29
|
+
|
|
30
|
+
class NgCore {
|
|
31
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: NgCore, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
32
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: NgCore, isStandalone: true, selector: "lib-ng-core", ngImport: i0, template: `
|
|
33
|
+
<p>
|
|
34
|
+
ng-core works!
|
|
35
|
+
</p>
|
|
36
|
+
`, isInline: true, styles: [""] });
|
|
37
|
+
}
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: NgCore, decorators: [{
|
|
39
|
+
type: Component,
|
|
40
|
+
args: [{ selector: 'lib-ng-core', imports: [], template: `
|
|
41
|
+
<p>
|
|
42
|
+
ng-core works!
|
|
43
|
+
</p>
|
|
44
|
+
` }]
|
|
45
|
+
}] });
|
|
46
|
+
|
|
47
|
+
// projects/z-library/src/lib/external-library/router.ts
|
|
48
|
+
class Router {
|
|
49
|
+
context_;
|
|
50
|
+
routes_;
|
|
51
|
+
constructor(context, routes) {
|
|
52
|
+
this.context_ = context || { base_url: '', prefix: '', host: '', port: '', scheme: '', locale: '' };
|
|
53
|
+
this.setRoutes(routes || {});
|
|
54
|
+
}
|
|
55
|
+
setRoutingData(data) {
|
|
56
|
+
this.setBaseUrl(data.base_url);
|
|
57
|
+
this.setRoutes(data.routes);
|
|
58
|
+
if ('prefix' in data)
|
|
59
|
+
this.setPrefix(data.prefix);
|
|
60
|
+
if ('port' in data)
|
|
61
|
+
this.setPort(data.port);
|
|
62
|
+
if ('locale' in data)
|
|
63
|
+
this.setLocale(data.locale);
|
|
64
|
+
this.setHost(data.host);
|
|
65
|
+
this.setScheme(data.scheme);
|
|
66
|
+
}
|
|
67
|
+
setRoutes(routes) {
|
|
68
|
+
this.routes_ = Object.freeze(routes);
|
|
69
|
+
}
|
|
70
|
+
getRoutes() {
|
|
71
|
+
return this.routes_;
|
|
72
|
+
}
|
|
73
|
+
setBaseUrl(baseUrl) {
|
|
74
|
+
this.context_.base_url = baseUrl;
|
|
75
|
+
}
|
|
76
|
+
getBaseUrl() {
|
|
77
|
+
return this.context_.base_url;
|
|
78
|
+
}
|
|
79
|
+
setPrefix(prefix) {
|
|
80
|
+
this.context_.prefix = prefix;
|
|
81
|
+
}
|
|
82
|
+
setScheme(scheme) {
|
|
83
|
+
this.context_.scheme = scheme;
|
|
84
|
+
}
|
|
85
|
+
getScheme() {
|
|
86
|
+
return this.context_.scheme;
|
|
87
|
+
}
|
|
88
|
+
setHost(host) {
|
|
89
|
+
this.context_.host = host;
|
|
90
|
+
}
|
|
91
|
+
getHost() {
|
|
92
|
+
return this.context_.host;
|
|
93
|
+
}
|
|
94
|
+
setPort(port) {
|
|
95
|
+
this.context_.port = port;
|
|
96
|
+
}
|
|
97
|
+
getPort() {
|
|
98
|
+
return this.context_.port;
|
|
99
|
+
}
|
|
100
|
+
setLocale(locale) {
|
|
101
|
+
this.context_.locale = locale;
|
|
102
|
+
}
|
|
103
|
+
getLocale() {
|
|
104
|
+
return this.context_.locale;
|
|
105
|
+
}
|
|
106
|
+
buildQueryParams(prefix, params, add) {
|
|
107
|
+
const rbracket = /\[\]$/;
|
|
108
|
+
if (Array.isArray(params)) {
|
|
109
|
+
params.forEach((val, i) => {
|
|
110
|
+
if (rbracket.test(prefix)) {
|
|
111
|
+
add(prefix, val);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
this.buildQueryParams(prefix + '[' + (typeof val === 'object' ? i : '') + ']', val, add);
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
else if (typeof params === 'object') {
|
|
119
|
+
for (const name in params) {
|
|
120
|
+
this.buildQueryParams(prefix + '[' + name + ']', params[name], add);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
add(prefix, params);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
getRoute(name) {
|
|
128
|
+
const prefixedName = this.context_.prefix + name;
|
|
129
|
+
const sf41i18nName = name + '.' + this.context_.locale;
|
|
130
|
+
const prefixedSf41i18nName = this.context_.prefix + name + '.' + this.context_.locale;
|
|
131
|
+
const variants = [prefixedName, sf41i18nName, prefixedSf41i18nName, name];
|
|
132
|
+
for (const variant of variants) {
|
|
133
|
+
if (variant in this.routes_) {
|
|
134
|
+
return this.routes_[variant];
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
throw new Error(`The route "${name}" does not exist.`);
|
|
138
|
+
}
|
|
139
|
+
generate(name, params = {}, absolute = false) {
|
|
140
|
+
const route = this.getRoute(name);
|
|
141
|
+
let url = '';
|
|
142
|
+
const unusedParams = { ...params };
|
|
143
|
+
let host = '';
|
|
144
|
+
const port = this.getPort() ?? '';
|
|
145
|
+
route.tokens.forEach((token) => {
|
|
146
|
+
if (token[0] === 'text') {
|
|
147
|
+
url = Router.encodePathComponent(token[1]) + url;
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
if (token[0] === 'variable') {
|
|
151
|
+
const hasDefault = route.defaults && token[3] in route.defaults;
|
|
152
|
+
const value = token[3] in params ? params[token[3]] : hasDefault ? route.defaults[token[3]] : '';
|
|
153
|
+
if (token[3] in unusedParams)
|
|
154
|
+
delete unusedParams[token[3]];
|
|
155
|
+
url = token[1] + Router.encodePathComponent(value) + url;
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
url = this.getBaseUrl() + url;
|
|
159
|
+
// Add unused query params
|
|
160
|
+
const queryParams = [];
|
|
161
|
+
const add = (k, v) => {
|
|
162
|
+
queryParams.push(`${Router.encodeQueryComponent(k)}=${Router.encodeQueryComponent(v)}`);
|
|
163
|
+
};
|
|
164
|
+
for (const k in unusedParams) {
|
|
165
|
+
this.buildQueryParams(k, unusedParams[k], add);
|
|
166
|
+
}
|
|
167
|
+
if (queryParams.length > 0) {
|
|
168
|
+
url += '?' + queryParams.join('&');
|
|
169
|
+
}
|
|
170
|
+
return url;
|
|
171
|
+
}
|
|
172
|
+
static customEncodeURIComponent(value) {
|
|
173
|
+
return encodeURIComponent(value)
|
|
174
|
+
.replace(/%2F/g, '/')
|
|
175
|
+
.replace(/%40/g, '@')
|
|
176
|
+
.replace(/%3A/g, ':')
|
|
177
|
+
.replace(/%21/g, '!')
|
|
178
|
+
.replace(/%3B/g, ';')
|
|
179
|
+
.replace(/%2C/g, ',')
|
|
180
|
+
.replace(/%2A/g, '*')
|
|
181
|
+
.replace(/\(/g, '%28')
|
|
182
|
+
.replace(/\)/g, '%29')
|
|
183
|
+
.replace(/'/g, '%27');
|
|
184
|
+
}
|
|
185
|
+
static encodePathComponent(value) {
|
|
186
|
+
return Router.customEncodeURIComponent(value).replace(/%3D/g, '=').replace(/%2B/g, '+').replace(/%21/g, '!').replace(/%7C/g, '|');
|
|
187
|
+
}
|
|
188
|
+
static encodeQueryComponent(value) {
|
|
189
|
+
return Router.customEncodeURIComponent(value).replace(/%3F/g, '?');
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
// Singleton instance
|
|
193
|
+
const Routing = new Router();
|
|
194
|
+
|
|
195
|
+
class Event {
|
|
196
|
+
static PRE_SEND_POST = 'SymfonyApiClientService_PRE_SEND_POST';
|
|
197
|
+
static POST_SEND_POST = 'SymfonyApiClientService_POST_SEND_POST';
|
|
198
|
+
static PRE_SEND_GET = 'SymfonyApiClientService_PRE_SEND_GET';
|
|
199
|
+
static POST_SEND_GET = 'SymfonyApiClientService_POST_SEND_GET';
|
|
200
|
+
static PRE_SEND = 'SymfonyApiClientService_PRE_SEND';
|
|
201
|
+
static POST_SEND = 'SymfonyApiClientService_POST_SEND';
|
|
202
|
+
static ADMINISTRATION_ELSEWHERE_CLICK = 'ADMINISTRATION_ELSEWHERE_CLICK';
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
const NG_CORE_CONFIG = new InjectionToken('NG_CORE_CONFIG');
|
|
206
|
+
|
|
207
|
+
class EventEmitterService {
|
|
208
|
+
subjectComunicators = new Map();
|
|
209
|
+
subscriptions = new Map();
|
|
210
|
+
constructor() {
|
|
211
|
+
}
|
|
212
|
+
emit(eventName, data) {
|
|
213
|
+
const subject$ = this.subjectComunicators.get(eventName);
|
|
214
|
+
if (subject$ !== undefined) {
|
|
215
|
+
subject$.next(data);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
registerCallback(eventNames, callback) {
|
|
219
|
+
if (!Array.isArray(eventNames)) {
|
|
220
|
+
eventNames = [eventNames];
|
|
221
|
+
}
|
|
222
|
+
eventNames.forEach((eventName, index) => {
|
|
223
|
+
let subject$ = this.subjectComunicators.get(eventName);
|
|
224
|
+
if (subject$ === undefined) {
|
|
225
|
+
this.subjectComunicators.set(eventName, new Subject());
|
|
226
|
+
subject$ = this.subjectComunicators.get(eventName);
|
|
227
|
+
this.subscriptions.set(eventName, new Map());
|
|
228
|
+
}
|
|
229
|
+
const subscription = subject$.subscribe((value => { callback(eventName, value); }));
|
|
230
|
+
this.subscriptions.get(eventName)?.set(callback, subscription);
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
unregisterCallback(eventNames, callback = null) {
|
|
234
|
+
if (!Array.isArray(eventNames)) {
|
|
235
|
+
eventNames = [eventNames];
|
|
236
|
+
}
|
|
237
|
+
eventNames.forEach((eventName, index) => {
|
|
238
|
+
if (!callback) {
|
|
239
|
+
this.subscriptions.get(eventName)?.forEach((value, key, map) => {
|
|
240
|
+
value.unsubscribe();
|
|
241
|
+
});
|
|
242
|
+
this.subscriptions.get(eventName)?.clear();
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
this.subscriptions.get(eventName)?.get(callback)?.unsubscribe();
|
|
246
|
+
this.subscriptions.get(eventName)?.delete(callback);
|
|
247
|
+
}
|
|
248
|
+
if (!this.subscriptions.get(eventName)?.size) {
|
|
249
|
+
this.subscriptions.delete(eventName);
|
|
250
|
+
this.subjectComunicators.delete(eventName);
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: EventEmitterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
255
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: EventEmitterService, providedIn: 'root' });
|
|
256
|
+
}
|
|
257
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: EventEmitterService, decorators: [{
|
|
258
|
+
type: Injectable,
|
|
259
|
+
args: [{
|
|
260
|
+
providedIn: 'root',
|
|
261
|
+
}]
|
|
262
|
+
}], ctorParameters: () => [] });
|
|
263
|
+
|
|
264
|
+
class NotifierService {
|
|
265
|
+
toastrService;
|
|
266
|
+
constructor(toastrService) {
|
|
267
|
+
this.toastrService = toastrService;
|
|
268
|
+
}
|
|
269
|
+
notify(message, type = 'success') {
|
|
270
|
+
switch (type) {
|
|
271
|
+
case 'error':
|
|
272
|
+
this.toastrService.error(message);
|
|
273
|
+
break;
|
|
274
|
+
case 'success':
|
|
275
|
+
this.toastrService.success(message);
|
|
276
|
+
break;
|
|
277
|
+
case 'warning':
|
|
278
|
+
this.toastrService.warning(message);
|
|
279
|
+
break;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
success(message) {
|
|
283
|
+
this.toastrService.success(message);
|
|
284
|
+
}
|
|
285
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: NotifierService, deps: [{ token: i1.ToastrService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
286
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: NotifierService, providedIn: 'root' });
|
|
287
|
+
}
|
|
288
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: NotifierService, decorators: [{
|
|
289
|
+
type: Injectable,
|
|
290
|
+
args: [{
|
|
291
|
+
providedIn: 'root'
|
|
292
|
+
}]
|
|
293
|
+
}], ctorParameters: () => [{ type: i1.ToastrService }] });
|
|
294
|
+
|
|
295
|
+
class HttpResponseToasterService {
|
|
296
|
+
notifierService;
|
|
297
|
+
constructor(notifierService) {
|
|
298
|
+
this.notifierService = notifierService;
|
|
299
|
+
}
|
|
300
|
+
showError(error, codeStatus, errorMessage) {
|
|
301
|
+
let completedMessage = '';
|
|
302
|
+
if (error instanceof HttpErrorResponse) {
|
|
303
|
+
if (error.error instanceof ErrorEvent) {
|
|
304
|
+
completedMessage = 'Nepodařilo se kontaktovat server. Zkontrolujte stav vašeho připojení.';
|
|
305
|
+
}
|
|
306
|
+
else {
|
|
307
|
+
switch (error.status) {
|
|
308
|
+
case 404:
|
|
309
|
+
completedMessage = 'Požadovaný cíl nebyl nalezen';
|
|
310
|
+
break;
|
|
311
|
+
case 500:
|
|
312
|
+
completedMessage = 'Na serveru došlo k chybě. Opakujte prosím akci později.';
|
|
313
|
+
break;
|
|
314
|
+
case 403:
|
|
315
|
+
completedMessage = 'Operace zamítnuta. Ujistěte se, že máte dostatečná práva.';
|
|
316
|
+
break;
|
|
317
|
+
case 401:
|
|
318
|
+
completedMessage = error.error.message;
|
|
319
|
+
break;
|
|
320
|
+
case 400:
|
|
321
|
+
// completedMessage = error.error ? error.error : 'Server nemůže zpracovat požadavek';
|
|
322
|
+
break;
|
|
323
|
+
case 422:
|
|
324
|
+
if (error.error instanceof Blob && error.error.type === "application/json") {
|
|
325
|
+
this.errorFromBlobResponseTYpe(error);
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
completedMessage = error.error.message;
|
|
329
|
+
}
|
|
330
|
+
break;
|
|
331
|
+
default:
|
|
332
|
+
completedMessage = 'Neočekávaná chyba serveru. Kód chyby: ' + error.status;
|
|
333
|
+
break;
|
|
334
|
+
}
|
|
335
|
+
if (codeStatus && error.status === codeStatus) {
|
|
336
|
+
completedMessage = errorMessage ?? '';
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
completedMessage = error;
|
|
342
|
+
}
|
|
343
|
+
if (completedMessage) {
|
|
344
|
+
this.notifierService.notify(completedMessage, 'error');
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
errorFromBlobResponseTYpe(error) {
|
|
348
|
+
const reader = new FileReader();
|
|
349
|
+
reader.onload = () => {
|
|
350
|
+
const errorText = reader.result;
|
|
351
|
+
try {
|
|
352
|
+
const errorJson = JSON.parse(errorText);
|
|
353
|
+
this.notifierService.notify(errorJson.message, 'error');
|
|
354
|
+
}
|
|
355
|
+
catch (e) {
|
|
356
|
+
console.error('Nelze zparsovat chybu', e);
|
|
357
|
+
}
|
|
358
|
+
};
|
|
359
|
+
reader.readAsText(error.error);
|
|
360
|
+
}
|
|
361
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: HttpResponseToasterService, deps: [{ token: NotifierService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
362
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: HttpResponseToasterService, providedIn: 'root' });
|
|
363
|
+
}
|
|
364
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: HttpResponseToasterService, decorators: [{
|
|
365
|
+
type: Injectable,
|
|
366
|
+
args: [{
|
|
367
|
+
providedIn: 'root'
|
|
368
|
+
}]
|
|
369
|
+
}], ctorParameters: () => [{ type: NotifierService }] });
|
|
370
|
+
|
|
371
|
+
class SymfonyApiClientService {
|
|
372
|
+
httpClient;
|
|
373
|
+
eventEmitterService;
|
|
374
|
+
httpResponseToasterService;
|
|
375
|
+
router;
|
|
376
|
+
platformId;
|
|
377
|
+
config;
|
|
378
|
+
status = 'none';
|
|
379
|
+
urlFetchNotification$ = new Subject();
|
|
380
|
+
counterRequest = { post: 0, get: 0, all: 0 };
|
|
381
|
+
routes;
|
|
382
|
+
constructor(httpClient, eventEmitterService, httpResponseToasterService, router, platformId, config) {
|
|
383
|
+
this.httpClient = httpClient;
|
|
384
|
+
this.eventEmitterService = eventEmitterService;
|
|
385
|
+
this.httpResponseToasterService = httpResponseToasterService;
|
|
386
|
+
this.router = router;
|
|
387
|
+
this.platformId = platformId;
|
|
388
|
+
this.config = config;
|
|
389
|
+
}
|
|
390
|
+
downloadRoutes() {
|
|
391
|
+
return of(1).pipe(tap(value => this.status = 'inProgress'), switchMap(() => {
|
|
392
|
+
return this.httpClient.get(this.config.backendUrl + this.config.backendRoutesPath, {
|
|
393
|
+
responseType: 'json', headers: { fetchRoutes: 'true' }
|
|
394
|
+
}).pipe(catchError(this.handleErrorRoute.bind(this)), tap(response => {
|
|
395
|
+
this.status = 'done';
|
|
396
|
+
this.routes = response;
|
|
397
|
+
this.urlFetchNotification$.next(response);
|
|
398
|
+
}));
|
|
399
|
+
}));
|
|
400
|
+
}
|
|
401
|
+
get(routeName, querySegmentParam, headersOptions = {}, options = {}) {
|
|
402
|
+
const routesFromBackend$ = this.tryGetRoutes('get');
|
|
403
|
+
return routesFromBackend$.pipe(switchMap(routes => {
|
|
404
|
+
Routing.setRoutingData(routes);
|
|
405
|
+
const path = Routing.generate(routeName, querySegmentParam);
|
|
406
|
+
// if (querySegmentParam) {
|
|
407
|
+
// querySegmentParam.forEach(value => {
|
|
408
|
+
// path += '/' + value;
|
|
409
|
+
// });
|
|
410
|
+
// }
|
|
411
|
+
return this.httpClient.get(this.config.backendUrl + path, {
|
|
412
|
+
observe: 'response', withCredentials: !!this.config.externalLoginPage,
|
|
413
|
+
headers: this.prepareHeader(headersOptions),
|
|
414
|
+
...options
|
|
415
|
+
}).pipe(endWith(null), catchError((err) => {
|
|
416
|
+
this.handleError(err);
|
|
417
|
+
return throwError(err);
|
|
418
|
+
}), finalize(this.generatePostSendCallbacks('post')));
|
|
419
|
+
}), takeWhile((x) => x != null));
|
|
420
|
+
}
|
|
421
|
+
post(routeName, data, querySegmentParam, headersOptions = {}, requestOptions = {}) {
|
|
422
|
+
const routesFromBackend$ = this.tryGetRoutes('post');
|
|
423
|
+
return routesFromBackend$.pipe(switchMap(routes => {
|
|
424
|
+
Routing.setRoutingData(routes);
|
|
425
|
+
const path = Routing.generate(routeName, querySegmentParam);
|
|
426
|
+
// if (querySegmentParam) {
|
|
427
|
+
// querySegmentParam.forEach(value => {
|
|
428
|
+
// path += '/' + value;
|
|
429
|
+
// });
|
|
430
|
+
// }
|
|
431
|
+
return this.httpClient.post(this.config.backendUrl + path, data, {
|
|
432
|
+
observe: 'response', withCredentials: this.config.externalLoginPage,
|
|
433
|
+
...requestOptions,
|
|
434
|
+
headers: this.prepareHeader(headersOptions)
|
|
435
|
+
}).pipe(endWith(null), catchError((err) => {
|
|
436
|
+
this.handleError(err);
|
|
437
|
+
return throwError(err);
|
|
438
|
+
}), finalize(this.generatePostSendCallbacks('post')));
|
|
439
|
+
}), takeWhile((x) => x != null));
|
|
440
|
+
}
|
|
441
|
+
getData(routeName, querySegmentParam, headersOptions = {}, options = {}) {
|
|
442
|
+
return this.get(routeName, querySegmentParam, headersOptions, options).pipe(map(value => {
|
|
443
|
+
return value.body;
|
|
444
|
+
}));
|
|
445
|
+
}
|
|
446
|
+
refreshToken(loginData, path) {
|
|
447
|
+
return this.post(path, loginData)
|
|
448
|
+
.pipe(tap((httpResponse) => {
|
|
449
|
+
this.token = httpResponse.body.token;
|
|
450
|
+
}));
|
|
451
|
+
}
|
|
452
|
+
prepareHeader(headersOptions = {}) {
|
|
453
|
+
if (!isPlatformServer(this.platformId) && this.token) {
|
|
454
|
+
headersOptions['Authorization'] = 'Bearer ' + this.token;
|
|
455
|
+
}
|
|
456
|
+
return headersOptions;
|
|
457
|
+
}
|
|
458
|
+
get token() {
|
|
459
|
+
return localStorage.getItem('token');
|
|
460
|
+
}
|
|
461
|
+
set token(value) {
|
|
462
|
+
localStorage.setItem('token', value);
|
|
463
|
+
}
|
|
464
|
+
tryGetRoutes(type) {
|
|
465
|
+
let routesFromBackend$;
|
|
466
|
+
routesFromBackend$ = new Observable(subscriber => {
|
|
467
|
+
this.emitPreSend(type);
|
|
468
|
+
if (this.routes) {
|
|
469
|
+
subscriber.next(this.routes);
|
|
470
|
+
}
|
|
471
|
+
else if (this.status === 'done' || this.status === 'none') {
|
|
472
|
+
this.downloadRoutes().subscribe(value => subscriber.next(value));
|
|
473
|
+
}
|
|
474
|
+
else {
|
|
475
|
+
const unsubscribe = this.urlFetchNotification$.subscribe(downloadedRoutes => {
|
|
476
|
+
unsubscribe.unsubscribe();
|
|
477
|
+
subscriber.next(downloadedRoutes);
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
});
|
|
481
|
+
return routesFromBackend$;
|
|
482
|
+
}
|
|
483
|
+
handleErrorRoute(error) {
|
|
484
|
+
let completedMessage = '';
|
|
485
|
+
this.status = 'none';
|
|
486
|
+
if (error.error) {
|
|
487
|
+
completedMessage = 'Nepodařilo se kontaktovat server pro získání routy';
|
|
488
|
+
}
|
|
489
|
+
else {
|
|
490
|
+
completedMessage = 'Došlo k chybě při získání routy na server. Opakute akci později. Kód chyby: ' + error.status;
|
|
491
|
+
}
|
|
492
|
+
return throwError(completedMessage);
|
|
493
|
+
}
|
|
494
|
+
emitPreSend(type) {
|
|
495
|
+
if (type === 'get') {
|
|
496
|
+
++this.counterRequest.get;
|
|
497
|
+
this.eventEmitterService.emit(Event.PRE_SEND_GET, true);
|
|
498
|
+
}
|
|
499
|
+
else {
|
|
500
|
+
++this.counterRequest.post;
|
|
501
|
+
this.eventEmitterService.emit(Event.PRE_SEND_POST, true);
|
|
502
|
+
}
|
|
503
|
+
++this.counterRequest.all;
|
|
504
|
+
this.eventEmitterService.emit(Event.PRE_SEND, true);
|
|
505
|
+
}
|
|
506
|
+
generatePostSendCallbacks(type) {
|
|
507
|
+
return () => {
|
|
508
|
+
setTimeout(() => {
|
|
509
|
+
if (type === 'get') {
|
|
510
|
+
--this.counterRequest.get;
|
|
511
|
+
if (!this.counterRequest.get) {
|
|
512
|
+
this.eventEmitterService.emit(Event.POST_SEND_GET, false);
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
else {
|
|
516
|
+
--this.counterRequest.post;
|
|
517
|
+
if (!this.counterRequest.post) {
|
|
518
|
+
this.eventEmitterService.emit(Event.POST_SEND_POST, false);
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
--this.counterRequest.all;
|
|
522
|
+
if (!this.counterRequest.all) {
|
|
523
|
+
this.eventEmitterService.emit(Event.POST_SEND, false);
|
|
524
|
+
}
|
|
525
|
+
}, 0);
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
logout() {
|
|
529
|
+
this.token = '';
|
|
530
|
+
this.router.navigate(['/'], { onSameUrlNavigation: 'reload' });
|
|
531
|
+
}
|
|
532
|
+
handleError(error) {
|
|
533
|
+
if (error instanceof HttpErrorResponse && error.status === 401) {
|
|
534
|
+
this.logout();
|
|
535
|
+
}
|
|
536
|
+
this.httpResponseToasterService.showError(error);
|
|
537
|
+
}
|
|
538
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SymfonyApiClientService, deps: [{ token: i1$1.HttpClient }, { token: EventEmitterService }, { token: HttpResponseToasterService }, { token: i1$2.Router }, { token: PLATFORM_ID }, { token: NG_CORE_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
539
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SymfonyApiClientService, providedIn: 'root' });
|
|
540
|
+
}
|
|
541
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SymfonyApiClientService, decorators: [{
|
|
542
|
+
type: Injectable,
|
|
543
|
+
args: [{
|
|
544
|
+
providedIn: 'root'
|
|
545
|
+
}]
|
|
546
|
+
}], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: EventEmitterService }, { type: HttpResponseToasterService }, { type: i1$2.Router }, { type: undefined, decorators: [{
|
|
547
|
+
type: Inject,
|
|
548
|
+
args: [PLATFORM_ID]
|
|
549
|
+
}] }, { type: undefined, decorators: [{
|
|
550
|
+
type: Inject,
|
|
551
|
+
args: [NG_CORE_CONFIG]
|
|
552
|
+
}] }] });
|
|
553
|
+
|
|
554
|
+
class ApiFormService {
|
|
555
|
+
symfonyApiClientService;
|
|
556
|
+
httpResponseToasterService;
|
|
557
|
+
isSending = signal(false, ...(ngDevMode ? [{ debugName: "isSending" }] : []));
|
|
558
|
+
constructor(symfonyApiClientService, httpResponseToasterService) {
|
|
559
|
+
this.symfonyApiClientService = symfonyApiClientService;
|
|
560
|
+
this.httpResponseToasterService = httpResponseToasterService;
|
|
561
|
+
}
|
|
562
|
+
send(path, form, querySegment, additionalPostData = {}) {
|
|
563
|
+
if (!form.valid) {
|
|
564
|
+
form.markAllAsTouched();
|
|
565
|
+
return null;
|
|
566
|
+
}
|
|
567
|
+
if (this.isSending()) {
|
|
568
|
+
return null;
|
|
569
|
+
}
|
|
570
|
+
this.isSending.set(true);
|
|
571
|
+
let data = { ...form.value, ...additionalPostData };
|
|
572
|
+
let formData = this.convertJsonToFormData(data, null, null);
|
|
573
|
+
return this.symfonyApiClientService.post(path, formData, querySegment).pipe(tap(next => {
|
|
574
|
+
this.isSending.set(false);
|
|
575
|
+
}, (err) => {
|
|
576
|
+
this.isSending.set(false);
|
|
577
|
+
if (err.status === 400 && err.headers.get('Content-Type') === 'application/invalid-form+json') {
|
|
578
|
+
this.supplyValidationErrors(err.error, form);
|
|
579
|
+
}
|
|
580
|
+
}));
|
|
581
|
+
}
|
|
582
|
+
supplyValidationErrors(validationErrors, abstractControl) {
|
|
583
|
+
const baseErrors = [];
|
|
584
|
+
const iterate = (errors, form) => {
|
|
585
|
+
Object.keys(errors).forEach(key => {
|
|
586
|
+
if (Array.isArray(errors[key])) {
|
|
587
|
+
if (typeof errors[key][0] === 'string') {
|
|
588
|
+
form.get(key)?.setErrors(errors[key], { emitEvent: true });
|
|
589
|
+
}
|
|
590
|
+
else {
|
|
591
|
+
iterate(errors[key], form.get(key));
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
else if (typeof errors[key] === 'string') {
|
|
595
|
+
baseErrors.push(errors[key]);
|
|
596
|
+
}
|
|
597
|
+
else {
|
|
598
|
+
iterate(errors[key], form.get(key));
|
|
599
|
+
}
|
|
600
|
+
});
|
|
601
|
+
};
|
|
602
|
+
iterate(validationErrors, abstractControl);
|
|
603
|
+
if (baseErrors.length) {
|
|
604
|
+
abstractControl.setErrors(baseErrors, { emitEvent: true });
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
convertJsonToFormData(jsonObject, parentKey, carryFormData) {
|
|
608
|
+
const formData = carryFormData || new FormData();
|
|
609
|
+
let index = 0;
|
|
610
|
+
for (var key in jsonObject) {
|
|
611
|
+
if (jsonObject.hasOwnProperty(key)) {
|
|
612
|
+
if (jsonObject[key] !== null && jsonObject[key] !== undefined) {
|
|
613
|
+
var propName = parentKey || key;
|
|
614
|
+
if (parentKey && this.isObject(jsonObject)) {
|
|
615
|
+
propName = parentKey + '[' + key + ']';
|
|
616
|
+
}
|
|
617
|
+
if (parentKey && this.isArray(jsonObject)) {
|
|
618
|
+
propName = parentKey + '[' + index + ']';
|
|
619
|
+
}
|
|
620
|
+
if (jsonObject[key] instanceof File) {
|
|
621
|
+
formData.append(propName, jsonObject[key]);
|
|
622
|
+
}
|
|
623
|
+
else if (jsonObject[key] instanceof FileList) {
|
|
624
|
+
for (var j = 0; j < jsonObject[key].length; j++) {
|
|
625
|
+
formData.append(propName + '[' + j + ']', jsonObject[key].item(j));
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
else if (this.isArray(jsonObject[key]) || this.isObject(jsonObject[key])) {
|
|
629
|
+
if (this.isObject(jsonObject[key])) {
|
|
630
|
+
if (jsonObject[key].hasOwnProperty('id')) {
|
|
631
|
+
formData.append(propName, jsonObject[key].id);
|
|
632
|
+
}
|
|
633
|
+
else if (jsonObject[key] instanceof Date) {
|
|
634
|
+
formData.append(propName, formatDate(jsonObject[key], 'yyyy-MM-dd HH:mm:ss', 'en-US'));
|
|
635
|
+
}
|
|
636
|
+
else {
|
|
637
|
+
this.convertJsonToFormData(jsonObject[key], propName, formData);
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
else {
|
|
641
|
+
this.convertJsonToFormData(jsonObject[key], propName, formData);
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
else if (typeof jsonObject[key] === 'boolean') {
|
|
645
|
+
formData.append(propName, +jsonObject[key] ? '1' : '0');
|
|
646
|
+
}
|
|
647
|
+
else {
|
|
648
|
+
formData.append(propName, jsonObject[key]);
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
index++;
|
|
653
|
+
}
|
|
654
|
+
return formData;
|
|
655
|
+
}
|
|
656
|
+
isArray(val) {
|
|
657
|
+
const toString = ({}).toString;
|
|
658
|
+
return toString.call(val) === '[object Array]';
|
|
659
|
+
}
|
|
660
|
+
isObject(val) {
|
|
661
|
+
return !this.isArray(val) && typeof val === 'object' && !!val;
|
|
662
|
+
}
|
|
663
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ApiFormService, deps: [{ token: SymfonyApiClientService }, { token: HttpResponseToasterService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
664
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ApiFormService, providedIn: 'root' });
|
|
665
|
+
}
|
|
666
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ApiFormService, decorators: [{
|
|
667
|
+
type: Injectable,
|
|
668
|
+
args: [{
|
|
669
|
+
providedIn: 'root'
|
|
670
|
+
}]
|
|
671
|
+
}], ctorParameters: () => [{ type: SymfonyApiClientService }, { type: HttpResponseToasterService }] });
|
|
672
|
+
|
|
673
|
+
class BaseFormEntity {
|
|
674
|
+
fileUploader;
|
|
675
|
+
entity = input(null, ...(ngDevMode ? [{ debugName: "entity" }] : []));
|
|
676
|
+
sourceEntity = input(null, ...(ngDevMode ? [{ debugName: "sourceEntity" }] : []));
|
|
677
|
+
fb = inject(FormBuilder);
|
|
678
|
+
apiForm = inject(ApiFormService);
|
|
679
|
+
notifierService = inject(NotifierService);
|
|
680
|
+
router = inject(Router$1);
|
|
681
|
+
route = inject(ActivatedRoute);
|
|
682
|
+
location = inject(Location);
|
|
683
|
+
api = inject(SymfonyApiClientService);
|
|
684
|
+
dynamicDialogRef = inject(DynamicDialogRef);
|
|
685
|
+
dynamicDialogConf = inject(DynamicDialogConfig, { optional: true });
|
|
686
|
+
form;
|
|
687
|
+
constructor() {
|
|
688
|
+
}
|
|
689
|
+
ngOnInit() {
|
|
690
|
+
this.initForm();
|
|
691
|
+
if (this.entity()) {
|
|
692
|
+
this.form.patchValue(this.entity());
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
submit() {
|
|
696
|
+
let path = this.entity() ? this.controllerBaseName + '_update' : this.controllerBaseName + '_create';
|
|
697
|
+
let params = this.dynamicDialogConf?.data?.params ?? (this.entity() ? { id: this.entity().id } : {});
|
|
698
|
+
this.apiForm.send(path, this.form, params)?.subscribe((resp) => {
|
|
699
|
+
this.fileUploader?.clear();
|
|
700
|
+
this.form.get('files')?.reset();
|
|
701
|
+
this.notifierService.success('Úspěšně provedeno');
|
|
702
|
+
if (this.dynamicDialogConf) {
|
|
703
|
+
this.dynamicDialogRef.close(resp.body);
|
|
704
|
+
}
|
|
705
|
+
else if (this.sourceEntity()) {
|
|
706
|
+
this.location.back();
|
|
707
|
+
}
|
|
708
|
+
else {
|
|
709
|
+
this.router.navigate([this.entity() ? './' : '../'], { onSameUrlNavigation: 'reload', relativeTo: this.route });
|
|
710
|
+
}
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: BaseFormEntity, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
714
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.16", type: BaseFormEntity, isStandalone: true, selector: "app-base-form-entity", inputs: { entity: { classPropertyName: "entity", publicName: "entity", isSignal: true, isRequired: false, transformFunction: null }, sourceEntity: { classPropertyName: "sourceEntity", publicName: "sourceEntity", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "fileUploader", first: true, predicate: ["files"], descendants: true }], ngImport: i0, template: "<p>base-form-entity works!</p>\n", styles: [""] });
|
|
715
|
+
}
|
|
716
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: BaseFormEntity, decorators: [{
|
|
717
|
+
type: Component,
|
|
718
|
+
args: [{ selector: 'app-base-form-entity', imports: [], template: "<p>base-form-entity works!</p>\n" }]
|
|
719
|
+
}], ctorParameters: () => [], propDecorators: { fileUploader: [{
|
|
720
|
+
type: ViewChild,
|
|
721
|
+
args: ['files']
|
|
722
|
+
}], entity: [{ type: i0.Input, args: [{ isSignal: true, alias: "entity", required: false }] }], sourceEntity: [{ type: i0.Input, args: [{ isSignal: true, alias: "sourceEntity", required: false }] }] } });
|
|
723
|
+
|
|
724
|
+
class BreadcrumbService {
|
|
725
|
+
router;
|
|
726
|
+
route;
|
|
727
|
+
constructor(router, route) {
|
|
728
|
+
this.router = router;
|
|
729
|
+
this.route = route;
|
|
730
|
+
}
|
|
731
|
+
getBreadcrumbs(route = this.route.root, url = '', breadcrumbs = []) {
|
|
732
|
+
const children = route.children;
|
|
733
|
+
if (children.length === 0) {
|
|
734
|
+
return breadcrumbs;
|
|
735
|
+
}
|
|
736
|
+
for (const child of children) {
|
|
737
|
+
const routeURL = child.snapshot.url.map(segment => segment.path).join('/');
|
|
738
|
+
if (routeURL) {
|
|
739
|
+
url += `/${routeURL}`;
|
|
740
|
+
}
|
|
741
|
+
let label = '';
|
|
742
|
+
const breadcrumb = child.snapshot.data['breadcrumb'];
|
|
743
|
+
label = typeof breadcrumb === 'object' ? breadcrumb.label : breadcrumb;
|
|
744
|
+
let link = typeof breadcrumb === 'object' ? breadcrumb.link : null;
|
|
745
|
+
const isDuplicate = breadcrumbs.length > 0 && breadcrumbs[breadcrumbs.length - 1].label === label;
|
|
746
|
+
if (label && !isDuplicate) {
|
|
747
|
+
let data = { label, url: url || '/', target: '_self' };
|
|
748
|
+
if (!breadcrumbs.length) {
|
|
749
|
+
data['icon'] = 'pi pi-home';
|
|
750
|
+
}
|
|
751
|
+
if (link) {
|
|
752
|
+
data.url = link;
|
|
753
|
+
}
|
|
754
|
+
breadcrumbs.push(data);
|
|
755
|
+
}
|
|
756
|
+
return this.getBreadcrumbs(child, url, breadcrumbs);
|
|
757
|
+
}
|
|
758
|
+
return breadcrumbs;
|
|
759
|
+
}
|
|
760
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: BreadcrumbService, deps: [{ token: i1$2.Router }, { token: i1$2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
761
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: BreadcrumbService, providedIn: 'root' });
|
|
762
|
+
}
|
|
763
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: BreadcrumbService, decorators: [{
|
|
764
|
+
type: Injectable,
|
|
765
|
+
args: [{
|
|
766
|
+
providedIn: 'root'
|
|
767
|
+
}]
|
|
768
|
+
}], ctorParameters: () => [{ type: i1$2.Router }, { type: i1$2.ActivatedRoute }] });
|
|
769
|
+
|
|
770
|
+
class BreadcrumbComponent {
|
|
771
|
+
router;
|
|
772
|
+
route;
|
|
773
|
+
breadcrumbService;
|
|
774
|
+
breadcrumbItems = [];
|
|
775
|
+
breadcrumbs;
|
|
776
|
+
constructor(router, route, breadcrumbService) {
|
|
777
|
+
this.router = router;
|
|
778
|
+
this.route = route;
|
|
779
|
+
this.breadcrumbService = breadcrumbService;
|
|
780
|
+
}
|
|
781
|
+
ngOnInit() {
|
|
782
|
+
this.router.events.pipe(filter(event => event instanceof NavigationEnd), startWith(null)).subscribe(() => {
|
|
783
|
+
this.breadcrumbItems = this.breadcrumbService.getBreadcrumbs();
|
|
784
|
+
});
|
|
785
|
+
}
|
|
786
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: BreadcrumbComponent, deps: [{ token: i1$2.Router }, { token: i1$2.ActivatedRoute }, { token: BreadcrumbService }], target: i0.ɵɵFactoryTarget.Component });
|
|
787
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: BreadcrumbComponent, isStandalone: true, selector: "app-breadcrumb", ngImport: i0, template: `<p-breadcrumb [model]="breadcrumbItems"></p-breadcrumb>`, isInline: true, styles: [""], dependencies: [{ kind: "component", type: Breadcrumb, selector: "p-breadcrumb", inputs: ["model", "style", "styleClass", "home", "homeAriaLabel"], outputs: ["onItemClick"] }] });
|
|
788
|
+
}
|
|
789
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: BreadcrumbComponent, decorators: [{
|
|
790
|
+
type: Component,
|
|
791
|
+
args: [{ selector: 'app-breadcrumb', imports: [
|
|
792
|
+
Breadcrumb
|
|
793
|
+
], template: `<p-breadcrumb [model]="breadcrumbItems"></p-breadcrumb>` }]
|
|
794
|
+
}], ctorParameters: () => [{ type: i1$2.Router }, { type: i1$2.ActivatedRoute }, { type: BreadcrumbService }] });
|
|
795
|
+
|
|
796
|
+
class DialogComponent {
|
|
797
|
+
dialogRef;
|
|
798
|
+
saveButtonShow = true;
|
|
799
|
+
saveData = true;
|
|
800
|
+
submit;
|
|
801
|
+
constructor(dialogRef) {
|
|
802
|
+
this.dialogRef = dialogRef;
|
|
803
|
+
}
|
|
804
|
+
onSubmit() {
|
|
805
|
+
if (this.submit) {
|
|
806
|
+
this.submit.nativeElement.click();
|
|
807
|
+
}
|
|
808
|
+
else {
|
|
809
|
+
this.dialogRef.close(this.saveData);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: DialogComponent, deps: [{ token: i1$3.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
813
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: DialogComponent, isStandalone: true, selector: "app-dialog", inputs: { saveButtonShow: "saveButtonShow", saveData: "saveData" }, queries: [{ propertyName: "submit", first: true, predicate: ["submit"], descendants: true }], ngImport: i0, template: "<h1 mat-dialog-title>\n <ng-content select=\"[title]\"></ng-content>\n</h1>\n<div mat-dialog-content>\n <ng-content select=\"[content]\"></ng-content>\n</div>\n<mat-dialog-actions class=\"float-end\">\n <button mat-button [mat-dialog-close] = \"false\">Zru\u0161it</button>\n <button *ngIf=\"saveButtonShow && !refCustomButton.hasChildNodes()\" (click)=\"onSubmit()\" mat-button>\n <span #ref><ng-content select=\"[save-button]\"></ng-content></span>\n <ng-container *ngIf=\"!ref.hasChildNodes()\">\n Ulo\u017Eit\n </ng-container>\n </button>\n <span #refCustomButton>\n <ng-content select=\"[custom-button]\"></ng-content>\n </span>\n\n</mat-dialog-actions>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }] });
|
|
814
|
+
}
|
|
815
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: DialogComponent, decorators: [{
|
|
816
|
+
type: Component,
|
|
817
|
+
args: [{ selector: 'app-dialog', imports: [
|
|
818
|
+
CommonModule,
|
|
819
|
+
MatDialogTitle,
|
|
820
|
+
MatDialogActions,
|
|
821
|
+
MatDialogContent,
|
|
822
|
+
MatButton,
|
|
823
|
+
MatDialogClose
|
|
824
|
+
], template: "<h1 mat-dialog-title>\n <ng-content select=\"[title]\"></ng-content>\n</h1>\n<div mat-dialog-content>\n <ng-content select=\"[content]\"></ng-content>\n</div>\n<mat-dialog-actions class=\"float-end\">\n <button mat-button [mat-dialog-close] = \"false\">Zru\u0161it</button>\n <button *ngIf=\"saveButtonShow && !refCustomButton.hasChildNodes()\" (click)=\"onSubmit()\" mat-button>\n <span #ref><ng-content select=\"[save-button]\"></ng-content></span>\n <ng-container *ngIf=\"!ref.hasChildNodes()\">\n Ulo\u017Eit\n </ng-container>\n </button>\n <span #refCustomButton>\n <ng-content select=\"[custom-button]\"></ng-content>\n </span>\n\n</mat-dialog-actions>\n" }]
|
|
825
|
+
}], ctorParameters: () => [{ type: i1$3.MatDialogRef }], propDecorators: { saveButtonShow: [{
|
|
826
|
+
type: Input
|
|
827
|
+
}], saveData: [{
|
|
828
|
+
type: Input
|
|
829
|
+
}], submit: [{
|
|
830
|
+
type: ContentChild,
|
|
831
|
+
args: ['submit']
|
|
832
|
+
}] } });
|
|
833
|
+
|
|
834
|
+
class AnimationHiderComponent {
|
|
835
|
+
show = false;
|
|
836
|
+
constructor() { }
|
|
837
|
+
ngOnInit() {
|
|
838
|
+
}
|
|
839
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AnimationHiderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
840
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: AnimationHiderComponent, isStandalone: true, selector: "app-animation-hider", inputs: { show: "show" }, ngImport: i0, template: "<div [@showHide]=\"show ? 'show' : 'hide'\" [class]=\"show ? 'show' : 'hide'\" class=\"animation-hider-container\">\n <ng-content></ng-content>\n</div>\n", styles: [".show{display:block}.hide{display:none}\n"], animations: [
|
|
841
|
+
trigger('showHide', [
|
|
842
|
+
state('show', style({
|
|
843
|
+
opacity: 1,
|
|
844
|
+
})),
|
|
845
|
+
state('hide', style({
|
|
846
|
+
opacity: 0,
|
|
847
|
+
})),
|
|
848
|
+
transition('show <=> hide', [
|
|
849
|
+
animate('0.2s')
|
|
850
|
+
]),
|
|
851
|
+
]),
|
|
852
|
+
] });
|
|
853
|
+
}
|
|
854
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AnimationHiderComponent, decorators: [{
|
|
855
|
+
type: Component,
|
|
856
|
+
args: [{ selector: 'app-animation-hider', standalone: true, animations: [
|
|
857
|
+
trigger('showHide', [
|
|
858
|
+
state('show', style({
|
|
859
|
+
opacity: 1,
|
|
860
|
+
})),
|
|
861
|
+
state('hide', style({
|
|
862
|
+
opacity: 0,
|
|
863
|
+
})),
|
|
864
|
+
transition('show <=> hide', [
|
|
865
|
+
animate('0.2s')
|
|
866
|
+
]),
|
|
867
|
+
]),
|
|
868
|
+
], template: "<div [@showHide]=\"show ? 'show' : 'hide'\" [class]=\"show ? 'show' : 'hide'\" class=\"animation-hider-container\">\n <ng-content></ng-content>\n</div>\n", styles: [".show{display:block}.hide{display:none}\n"] }]
|
|
869
|
+
}], ctorParameters: () => [], propDecorators: { show: [{
|
|
870
|
+
type: Input
|
|
871
|
+
}] } });
|
|
872
|
+
|
|
873
|
+
class HidderComponent {
|
|
874
|
+
asyncComunicatorService;
|
|
875
|
+
cd;
|
|
876
|
+
display = 'none';
|
|
877
|
+
showOn;
|
|
878
|
+
hideOn;
|
|
879
|
+
callback = this.changeStatus.bind(this);
|
|
880
|
+
constructor(asyncComunicatorService, cd) {
|
|
881
|
+
this.asyncComunicatorService = asyncComunicatorService;
|
|
882
|
+
this.cd = cd;
|
|
883
|
+
}
|
|
884
|
+
ngOnInit() {
|
|
885
|
+
this.asyncComunicatorService.registerCallback([this.showOn, this.hideOn], this.callback);
|
|
886
|
+
}
|
|
887
|
+
changeStatus(eventName, asyncPost) {
|
|
888
|
+
if (eventName === this.showOn) {
|
|
889
|
+
this.display = 'block';
|
|
890
|
+
}
|
|
891
|
+
else {
|
|
892
|
+
this.display = 'none';
|
|
893
|
+
}
|
|
894
|
+
this.cd.detectChanges();
|
|
895
|
+
}
|
|
896
|
+
ngOnDestroy() {
|
|
897
|
+
this.asyncComunicatorService.unregisterCallback([this.showOn, this.hideOn], this.callback);
|
|
898
|
+
}
|
|
899
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: HidderComponent, deps: [{ token: EventEmitterService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
900
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: HidderComponent, isStandalone: true, selector: "app-hidder", inputs: { showOn: "showOn", hideOn: "hideOn" }, ngImport: i0, template: "<ng-container *ngIf=\"display === 'block'\">\n <ng-content></ng-content>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
901
|
+
}
|
|
902
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: HidderComponent, decorators: [{
|
|
903
|
+
type: Component,
|
|
904
|
+
args: [{ selector: 'app-hidder', imports: [
|
|
905
|
+
NgIf
|
|
906
|
+
], template: "<ng-container *ngIf=\"display === 'block'\">\n <ng-content></ng-content>\n</ng-container>\n" }]
|
|
907
|
+
}], ctorParameters: () => [{ type: EventEmitterService }, { type: i0.ChangeDetectorRef }], propDecorators: { showOn: [{
|
|
908
|
+
type: Input
|
|
909
|
+
}], hideOn: [{
|
|
910
|
+
type: Input
|
|
911
|
+
}] } });
|
|
912
|
+
|
|
913
|
+
class DataTableService {
|
|
914
|
+
apiClientService;
|
|
915
|
+
constructor(apiClientService) {
|
|
916
|
+
this.apiClientService = apiClientService;
|
|
917
|
+
}
|
|
918
|
+
loadLazyTableData(url, event, urlParams) {
|
|
919
|
+
const req = {
|
|
920
|
+
page: (event.first ?? 0) / (event.rows ?? 10),
|
|
921
|
+
size: event.rows ?? 10,
|
|
922
|
+
sortField: event.sortField ?? null,
|
|
923
|
+
sortOrder: event.sortOrder ?? null,
|
|
924
|
+
filters: Object.fromEntries(Object.entries(event.filters ?? {}).map(([key, f]) => [key, f.value]))
|
|
925
|
+
};
|
|
926
|
+
return this.loadData(url, req, urlParams);
|
|
927
|
+
}
|
|
928
|
+
loadData(url, req, urlParams) {
|
|
929
|
+
let params = {
|
|
930
|
+
page: req.page.toString(),
|
|
931
|
+
size: req.size.toString(),
|
|
932
|
+
};
|
|
933
|
+
if (req.sortField) {
|
|
934
|
+
params['sortField'] = req.sortField;
|
|
935
|
+
params['sortOrder'] = String(req.sortOrder);
|
|
936
|
+
}
|
|
937
|
+
if (urlParams) {
|
|
938
|
+
params = { ...params, ...urlParams };
|
|
939
|
+
}
|
|
940
|
+
if (req.filters) {
|
|
941
|
+
Object.keys(req.filters).forEach(key => {
|
|
942
|
+
const val = req.filters[key];
|
|
943
|
+
if (val != null && val !== '') {
|
|
944
|
+
params[key] = val;
|
|
945
|
+
}
|
|
946
|
+
});
|
|
947
|
+
}
|
|
948
|
+
return this.apiClientService.getData(url, params);
|
|
949
|
+
}
|
|
950
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: DataTableService, deps: [{ token: SymfonyApiClientService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
951
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: DataTableService, providedIn: 'root' });
|
|
952
|
+
}
|
|
953
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: DataTableService, decorators: [{
|
|
954
|
+
type: Injectable,
|
|
955
|
+
args: [{
|
|
956
|
+
providedIn: 'root'
|
|
957
|
+
}]
|
|
958
|
+
}], ctorParameters: () => [{ type: SymfonyApiClientService }] });
|
|
959
|
+
|
|
960
|
+
class AresService {
|
|
961
|
+
apiClientService;
|
|
962
|
+
constructor(apiClientService) {
|
|
963
|
+
this.apiClientService = apiClientService;
|
|
964
|
+
}
|
|
965
|
+
fetch(ico) {
|
|
966
|
+
return this.apiClientService.getData('ares_basic', { ico: ico });
|
|
967
|
+
}
|
|
968
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AresService, deps: [{ token: SymfonyApiClientService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
969
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AresService, providedIn: 'root' });
|
|
970
|
+
}
|
|
971
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AresService, decorators: [{
|
|
972
|
+
type: Injectable,
|
|
973
|
+
args: [{
|
|
974
|
+
providedIn: 'root'
|
|
975
|
+
}]
|
|
976
|
+
}], ctorParameters: () => [{ type: SymfonyApiClientService }] });
|
|
977
|
+
|
|
978
|
+
class ConfirmDialogService {
|
|
979
|
+
confirmationService;
|
|
980
|
+
constructor(confirmationService) {
|
|
981
|
+
this.confirmationService = confirmationService;
|
|
982
|
+
}
|
|
983
|
+
show(header, message, acceptCallback, confirmButtonText = 'Ano') {
|
|
984
|
+
this.confirmationService.confirm({
|
|
985
|
+
header: header,
|
|
986
|
+
message: message,
|
|
987
|
+
closable: true,
|
|
988
|
+
closeOnEscape: true,
|
|
989
|
+
icon: 'pi pi-exclamation-triangle',
|
|
990
|
+
rejectButtonProps: {
|
|
991
|
+
label: 'Zrušit',
|
|
992
|
+
severity: 'secondary',
|
|
993
|
+
outlined: true,
|
|
994
|
+
},
|
|
995
|
+
acceptButtonProps: {
|
|
996
|
+
label: confirmButtonText,
|
|
997
|
+
},
|
|
998
|
+
accept: acceptCallback
|
|
999
|
+
});
|
|
1000
|
+
}
|
|
1001
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ConfirmDialogService, deps: [{ token: i1$5.ConfirmationService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1002
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ConfirmDialogService, providedIn: 'root' });
|
|
1003
|
+
}
|
|
1004
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ConfirmDialogService, decorators: [{
|
|
1005
|
+
type: Injectable,
|
|
1006
|
+
args: [{
|
|
1007
|
+
providedIn: 'root'
|
|
1008
|
+
}]
|
|
1009
|
+
}], ctorParameters: () => [{ type: i1$5.ConfirmationService }] });
|
|
1010
|
+
|
|
1011
|
+
class FileService {
|
|
1012
|
+
symfonyApiClientService;
|
|
1013
|
+
constructor(symfonyApiClientService) {
|
|
1014
|
+
this.symfonyApiClientService = symfonyApiClientService;
|
|
1015
|
+
}
|
|
1016
|
+
downloadFile(id, path = 'file_download') {
|
|
1017
|
+
let params = typeof id == 'object' ? id : { id };
|
|
1018
|
+
return this.symfonyApiClientService.get(path, params, {}, { responseType: 'blob', observe: 'response' }).pipe(tap((response) => {
|
|
1019
|
+
var blob = new Blob([response.body], { type: response.headers.get('content-type') });
|
|
1020
|
+
const contentDisposition = response.headers.get('Content-Disposition');
|
|
1021
|
+
if (contentDisposition.match(/inline/)) {
|
|
1022
|
+
window.open(URL.createObjectURL(blob));
|
|
1023
|
+
return;
|
|
1024
|
+
}
|
|
1025
|
+
else {
|
|
1026
|
+
const fileName = this.getFileNameFromContentDisposition(contentDisposition);
|
|
1027
|
+
const url = window.URL.createObjectURL(blob);
|
|
1028
|
+
const a = document.createElement('a');
|
|
1029
|
+
a.href = url;
|
|
1030
|
+
a.download = fileName;
|
|
1031
|
+
a.click();
|
|
1032
|
+
}
|
|
1033
|
+
}));
|
|
1034
|
+
}
|
|
1035
|
+
getFileNameFromContentDisposition(contentDisposition) {
|
|
1036
|
+
const fileNameMatch = contentDisposition && contentDisposition.match(/filename="(.+)"/);
|
|
1037
|
+
return fileNameMatch && fileNameMatch[1] ? fileNameMatch[1] : 'default.zip';
|
|
1038
|
+
}
|
|
1039
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: FileService, deps: [{ token: SymfonyApiClientService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1040
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: FileService, providedIn: 'root' });
|
|
1041
|
+
}
|
|
1042
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: FileService, decorators: [{
|
|
1043
|
+
type: Injectable,
|
|
1044
|
+
args: [{
|
|
1045
|
+
providedIn: 'root'
|
|
1046
|
+
}]
|
|
1047
|
+
}], ctorParameters: () => [{ type: SymfonyApiClientService }] });
|
|
1048
|
+
|
|
1049
|
+
class ImageService {
|
|
1050
|
+
constructor() { }
|
|
1051
|
+
static screenshot(ref) {
|
|
1052
|
+
let element = ref.nativeElement;
|
|
1053
|
+
return from(html2canvas(element, {
|
|
1054
|
+
useCORS: true,
|
|
1055
|
+
allowTaint: true,
|
|
1056
|
+
logging: true,
|
|
1057
|
+
}))
|
|
1058
|
+
.pipe(map(canvas => canvas.toDataURL("image/png")));
|
|
1059
|
+
}
|
|
1060
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ImageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1061
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ImageService, providedIn: 'root' });
|
|
1062
|
+
}
|
|
1063
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ImageService, decorators: [{
|
|
1064
|
+
type: Injectable,
|
|
1065
|
+
args: [{
|
|
1066
|
+
providedIn: 'root'
|
|
1067
|
+
}]
|
|
1068
|
+
}], ctorParameters: () => [] });
|
|
1069
|
+
|
|
1070
|
+
class ImportScriptService {
|
|
1071
|
+
isImported = false;
|
|
1072
|
+
constructor() { }
|
|
1073
|
+
import(...paths) {
|
|
1074
|
+
this.isImported = false;
|
|
1075
|
+
let observerables = paths.map(value => from(import(value)));
|
|
1076
|
+
return concat(...observerables).pipe(tap(value => this.isImported = true));
|
|
1077
|
+
}
|
|
1078
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ImportScriptService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1079
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ImportScriptService, providedIn: 'root' });
|
|
1080
|
+
}
|
|
1081
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ImportScriptService, decorators: [{
|
|
1082
|
+
type: Injectable,
|
|
1083
|
+
args: [{
|
|
1084
|
+
providedIn: 'root'
|
|
1085
|
+
}]
|
|
1086
|
+
}], ctorParameters: () => [] });
|
|
1087
|
+
|
|
1088
|
+
class UrlService {
|
|
1089
|
+
sanitizer;
|
|
1090
|
+
constructor(sanitizer) {
|
|
1091
|
+
this.sanitizer = sanitizer;
|
|
1092
|
+
}
|
|
1093
|
+
getYoutubeVideoUrl(videoPath) {
|
|
1094
|
+
const videoUrl = this.validateYouTubeUrl(videoPath);
|
|
1095
|
+
let result = '';
|
|
1096
|
+
if (videoUrl) {
|
|
1097
|
+
result = this.sanitizer.sanitize(SecurityContext.RESOURCE_URL, this.sanitizer.bypassSecurityTrustResourceUrl(videoUrl));
|
|
1098
|
+
}
|
|
1099
|
+
return result;
|
|
1100
|
+
}
|
|
1101
|
+
validateYouTubeUrl(url) {
|
|
1102
|
+
if (url !== undefined || url !== '') {
|
|
1103
|
+
const regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=|\?v=)([^#\&\?]*).*/;
|
|
1104
|
+
const match = url.match(regExp);
|
|
1105
|
+
if (match && match[2].length === 11) {
|
|
1106
|
+
// Do anything for being valid
|
|
1107
|
+
// if need to change the url to embed url then use below line
|
|
1108
|
+
return 'https://www.youtube.com/embed/' + match[2] + '?autoplay=0';
|
|
1109
|
+
}
|
|
1110
|
+
else {
|
|
1111
|
+
return false;
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
return false;
|
|
1115
|
+
}
|
|
1116
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: UrlService, deps: [{ token: i1$6.DomSanitizer }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1117
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: UrlService, providedIn: 'root' });
|
|
1118
|
+
}
|
|
1119
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: UrlService, decorators: [{
|
|
1120
|
+
type: Injectable,
|
|
1121
|
+
args: [{
|
|
1122
|
+
providedIn: 'root'
|
|
1123
|
+
}]
|
|
1124
|
+
}], ctorParameters: () => [{ type: i1$6.DomSanitizer }] });
|
|
1125
|
+
|
|
1126
|
+
class FormService {
|
|
1127
|
+
formBuilder;
|
|
1128
|
+
constructor(formBuilder) {
|
|
1129
|
+
this.formBuilder = formBuilder;
|
|
1130
|
+
}
|
|
1131
|
+
createForm(formFields, settings) {
|
|
1132
|
+
const form = this.formBuilder.group(formFields);
|
|
1133
|
+
if (settings) {
|
|
1134
|
+
form.patchValue(settings);
|
|
1135
|
+
}
|
|
1136
|
+
form.statusChanges.subscribe(status => {
|
|
1137
|
+
if (status === 'VALID') {
|
|
1138
|
+
const formValue = form.value;
|
|
1139
|
+
Object.assign(settings, formValue);
|
|
1140
|
+
}
|
|
1141
|
+
});
|
|
1142
|
+
return form;
|
|
1143
|
+
}
|
|
1144
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: FormService, deps: [{ token: i1$7.FormBuilder }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1145
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: FormService, providedIn: 'root' });
|
|
1146
|
+
}
|
|
1147
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: FormService, decorators: [{
|
|
1148
|
+
type: Injectable,
|
|
1149
|
+
args: [{
|
|
1150
|
+
providedIn: 'root'
|
|
1151
|
+
}]
|
|
1152
|
+
}], ctorParameters: () => [{ type: i1$7.FormBuilder }] });
|
|
1153
|
+
|
|
1154
|
+
class LoginClientService {
|
|
1155
|
+
symfonyApiClient;
|
|
1156
|
+
constructor(symfonyApiClient) {
|
|
1157
|
+
this.symfonyApiClient = symfonyApiClient;
|
|
1158
|
+
}
|
|
1159
|
+
tryLogin(loginData, path = 'login_token') {
|
|
1160
|
+
return this.symfonyApiClient.refreshToken(loginData, path);
|
|
1161
|
+
}
|
|
1162
|
+
isLoggedIn() {
|
|
1163
|
+
const decoded = this.decodeAccessToken(this.symfonyApiClient.token);
|
|
1164
|
+
if (!decoded) {
|
|
1165
|
+
return null;
|
|
1166
|
+
}
|
|
1167
|
+
if (new Date(decoded.exp * 1000) < new Date()) {
|
|
1168
|
+
return false;
|
|
1169
|
+
}
|
|
1170
|
+
return true;
|
|
1171
|
+
}
|
|
1172
|
+
logout() {
|
|
1173
|
+
if (localStorage.getItem('originToken')) {
|
|
1174
|
+
localStorage.removeItem('originToken');
|
|
1175
|
+
}
|
|
1176
|
+
this.symfonyApiClient.logout();
|
|
1177
|
+
}
|
|
1178
|
+
decodeAccessToken(token) {
|
|
1179
|
+
try {
|
|
1180
|
+
return token && jwtDecode(token);
|
|
1181
|
+
}
|
|
1182
|
+
catch (Error) {
|
|
1183
|
+
return null;
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
impersonation(id) {
|
|
1187
|
+
if (id && this.isLoggedIn()) {
|
|
1188
|
+
let origin = this.symfonyApiClient.token;
|
|
1189
|
+
return this.tryLogin({ id }, 'login_relogin').pipe(tap(response => {
|
|
1190
|
+
localStorage.setItem('originToken', origin);
|
|
1191
|
+
}));
|
|
1192
|
+
}
|
|
1193
|
+
return null;
|
|
1194
|
+
}
|
|
1195
|
+
removeImpersonation() {
|
|
1196
|
+
if (this.isImpersonation()) {
|
|
1197
|
+
this.symfonyApiClient.token = localStorage.getItem('originToken');
|
|
1198
|
+
localStorage.removeItem('originToken');
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
isImpersonation() {
|
|
1202
|
+
return !!localStorage.getItem('originToken');
|
|
1203
|
+
}
|
|
1204
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: LoginClientService, deps: [{ token: SymfonyApiClientService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1205
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: LoginClientService, providedIn: 'root' });
|
|
1206
|
+
}
|
|
1207
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: LoginClientService, decorators: [{
|
|
1208
|
+
type: Injectable,
|
|
1209
|
+
args: [{
|
|
1210
|
+
providedIn: 'root'
|
|
1211
|
+
}]
|
|
1212
|
+
}], ctorParameters: () => [{ type: SymfonyApiClientService }] });
|
|
1213
|
+
|
|
1214
|
+
class GenericResolver {
|
|
1215
|
+
symfonyApiClientService;
|
|
1216
|
+
httpResponseToasterService;
|
|
1217
|
+
constructor(symfonyApiClientService, httpResponseToasterService) {
|
|
1218
|
+
this.symfonyApiClientService = symfonyApiClientService;
|
|
1219
|
+
this.httpResponseToasterService = httpResponseToasterService;
|
|
1220
|
+
}
|
|
1221
|
+
resolve(route, state) {
|
|
1222
|
+
const config = route.data['resolverConfig'];
|
|
1223
|
+
const routeName = config.data.route;
|
|
1224
|
+
const queryMap = (config.queryDataMap ?? {});
|
|
1225
|
+
const quryParam = {};
|
|
1226
|
+
const pathFromRoot = route.pathFromRoot;
|
|
1227
|
+
for (const [key, value] of Object.entries(queryMap)) {
|
|
1228
|
+
quryParam[value] = GenericResolver.getParameterFromUrl(key, pathFromRoot);
|
|
1229
|
+
}
|
|
1230
|
+
return this.symfonyApiClientService.get(routeName, quryParam)
|
|
1231
|
+
.pipe(catchError(err => {
|
|
1232
|
+
return throwError(err);
|
|
1233
|
+
}), map(httpResponse => {
|
|
1234
|
+
return httpResponse.body;
|
|
1235
|
+
}));
|
|
1236
|
+
}
|
|
1237
|
+
static getParameterFromUrl(name, pathFromRoot) {
|
|
1238
|
+
for (const path of pathFromRoot.reverse()) {
|
|
1239
|
+
if (path.paramMap.has(name)) {
|
|
1240
|
+
return path.paramMap.get(name);
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
return 'paramNotFound';
|
|
1244
|
+
}
|
|
1245
|
+
static create(routeName, queryMap = {}) {
|
|
1246
|
+
return (route, state) => {
|
|
1247
|
+
let symfonyApiClientService = inject(SymfonyApiClientService);
|
|
1248
|
+
const queryParamResult = {};
|
|
1249
|
+
const pathFromRoot = route.pathFromRoot;
|
|
1250
|
+
for (const [key, value] of Object.entries(queryMap)) {
|
|
1251
|
+
queryParamResult[value] = this.getParameterFromUrl(key, pathFromRoot);
|
|
1252
|
+
}
|
|
1253
|
+
return symfonyApiClientService.get(routeName, queryParamResult).pipe(catchError(err => {
|
|
1254
|
+
return throwError(err);
|
|
1255
|
+
}), map(httpResponse => {
|
|
1256
|
+
return httpResponse.body;
|
|
1257
|
+
}));
|
|
1258
|
+
};
|
|
1259
|
+
}
|
|
1260
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GenericResolver, deps: [{ token: SymfonyApiClientService }, { token: HttpResponseToasterService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1261
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GenericResolver, providedIn: 'root' });
|
|
1262
|
+
}
|
|
1263
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GenericResolver, decorators: [{
|
|
1264
|
+
type: Injectable,
|
|
1265
|
+
args: [{
|
|
1266
|
+
providedIn: 'root'
|
|
1267
|
+
}]
|
|
1268
|
+
}], ctorParameters: () => [{ type: SymfonyApiClientService }, { type: HttpResponseToasterService }] });
|
|
1269
|
+
|
|
1270
|
+
class LazyBaseTable {
|
|
1271
|
+
baseTableStatePrefix = 'lazy_base_table_';
|
|
1272
|
+
stateKey = '';
|
|
1273
|
+
entities = signal([], ...(ngDevMode ? [{ debugName: "entities" }] : []));
|
|
1274
|
+
totalRecords = signal(0, ...(ngDevMode ? [{ debugName: "totalRecords" }] : []));
|
|
1275
|
+
loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
|
|
1276
|
+
tableService = inject(DataTableService);
|
|
1277
|
+
symfonyApiClientService = inject(SymfonyApiClientService);
|
|
1278
|
+
confirmDialogServiceService = inject(ConfirmDialogService);
|
|
1279
|
+
notifierService = inject(NotifierService);
|
|
1280
|
+
router = inject(Router$1);
|
|
1281
|
+
route = inject(ActivatedRoute);
|
|
1282
|
+
lastEvent;
|
|
1283
|
+
urlParams = {};
|
|
1284
|
+
ngOnInit() {
|
|
1285
|
+
this.initUrlParams();
|
|
1286
|
+
}
|
|
1287
|
+
loadEntities(event) {
|
|
1288
|
+
this.lastEvent = event;
|
|
1289
|
+
this.loading.set(true);
|
|
1290
|
+
this.tableService.loadLazyTableData(this.baseUrl + '_list', event, this.urlParams).subscribe({
|
|
1291
|
+
next: (value) => {
|
|
1292
|
+
this.loading.set(false);
|
|
1293
|
+
this.entities.set(value.data);
|
|
1294
|
+
this.totalRecords.set(value.total);
|
|
1295
|
+
},
|
|
1296
|
+
error: (error) => {
|
|
1297
|
+
this.loading.set(false);
|
|
1298
|
+
}
|
|
1299
|
+
});
|
|
1300
|
+
}
|
|
1301
|
+
refresh() {
|
|
1302
|
+
this.loadEntities(this.lastEvent);
|
|
1303
|
+
}
|
|
1304
|
+
delete(entity) {
|
|
1305
|
+
this.confirmDialogServiceService.show('Smazat entitu', 'Opravdu si přejete smazat záznam?', () => {
|
|
1306
|
+
this.symfonyApiClientService.get(this.baseUrl + '_delete', { id: entity.id }).subscribe((value) => {
|
|
1307
|
+
this.notifierService.success('Úspěšně smazáno');
|
|
1308
|
+
this.refresh();
|
|
1309
|
+
});
|
|
1310
|
+
});
|
|
1311
|
+
}
|
|
1312
|
+
initUrlParams() {
|
|
1313
|
+
if (this.stateKey) {
|
|
1314
|
+
if (localStorage.getItem(this.baseTableStatePrefix + 'url_params')) {
|
|
1315
|
+
this.urlParams = JSON.parse(localStorage.getItem(this.baseTableStatePrefix + 'url_params'));
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
setUrlParams(urlParams) {
|
|
1320
|
+
if (this.baseTableStatePrefix) {
|
|
1321
|
+
localStorage.setItem(this.baseTableStatePrefix + 'url_params', JSON.stringify(urlParams));
|
|
1322
|
+
this.urlParams = urlParams;
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: LazyBaseTable, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1326
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: LazyBaseTable, isStandalone: true, selector: "app-lazy-base-table", ngImport: i0, template: "<p>lazy-base-table works!</p>\n", styles: [""] });
|
|
1327
|
+
}
|
|
1328
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: LazyBaseTable, decorators: [{
|
|
1329
|
+
type: Component,
|
|
1330
|
+
args: [{ selector: 'app-lazy-base-table', imports: [], template: "<p>lazy-base-table works!</p>\n" }]
|
|
1331
|
+
}] });
|
|
1332
|
+
|
|
1333
|
+
class LoaderComponent {
|
|
1334
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: LoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1335
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: LoaderComponent, isStandalone: true, selector: "app-loader-component", ngImport: i0, template: "<div id=\"loader\"></div>\n", styles: [".chromeframe{margin:.2em 0;background:#ccc;color:#000;padding:.2em 0}p{line-height:1.33em;color:#7e7e7e}h1{color:#eee}#loader-wrapper{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1000}#loader{display:block;position:relative;left:50%;top:50%;width:150px;height:150px;margin:-75px 0 0 -75px;border-radius:50%;border:3px solid transparent;border-top-color:#3498db;-webkit-animation:spin 2s linear infinite;animation:spin 2s linear infinite;z-index:1001}#loader:before{content:\"\";position:absolute;inset:5px;border-radius:50%;border:3px solid transparent;border-top-color:#e74c3c;-webkit-animation:spin 3s linear infinite;animation:spin 3s linear infinite}#loader:after{content:\"\";position:absolute;inset:15px;border-radius:50%;border:3px solid transparent;border-top-color:#f9c922;-webkit-animation:spin 1.5s linear infinite;animation:spin 1.5s linear infinite}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg)}}#loader-wrapper .loader-section{position:fixed;top:0;width:51%;height:100%;background:#222;z-index:1000;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translate(0)}#loader-wrapper .loader-section.section-left{left:0}#loader-wrapper .loader-section.section-right{right:0}.loaded #loader-wrapper .loader-section.section-left{-webkit-transform:translateX(-100%);-ms-transform:translateX(-100%);transform:translate(-100%);-webkit-transition:all .7s .3s cubic-bezier(.645,.045,.355,1);transition:all .7s .3s cubic-bezier(.645,.045,.355,1)}.loaded #loader-wrapper .loader-section.section-right{-webkit-transform:translateX(100%);-ms-transform:translateX(100%);transform:translate(100%);-webkit-transition:all .7s .3s cubic-bezier(.645,.045,.355,1);transition:all .7s .3s cubic-bezier(.645,.045,.355,1)}.loaded #loader{opacity:0;-webkit-transition:all .3s ease-out;transition:all .3s ease-out}.loaded #loader-wrapper{visibility:hidden;-webkit-transform:translateY(-100%);-ms-transform:translateY(-100%);transform:translateY(-100%);-webkit-transition:all .3s 1s ease-out;transition:all .3s 1s ease-out}.no-js #loader-wrapper{display:none}.no-js h1{color:#222}#content{margin:0 auto;padding-bottom:50px;width:80%;max-width:978px}.ir{background-color:transparent;border:0;overflow:hidden;*text-indent: -9999px}.ir:before{content:\"\";display:block;width:0;height:150%}.hidden{display:none!important;visibility:hidden}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.invisible{visibility:hidden}.clearfix:before,.clearfix:after{content:\" \";display:table}.clearfix:after{clear:both}.clearfix{*zoom: 1}@media print{*{background:transparent!important;color:#000!important;box-shadow:none!important;text-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:\" (\" attr(href) \")\"}abbr[title]:after{content:\" (\" attr(title) \")\"}.ir a:after,a[href^=\"javascript:\"]:after,a[href^=\"#\"]:after{content:\"\"}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}}:host{height:150px}\n"] });
|
|
1336
|
+
}
|
|
1337
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: LoaderComponent, decorators: [{
|
|
1338
|
+
type: Component,
|
|
1339
|
+
args: [{ selector: 'app-loader-component', imports: [], template: "<div id=\"loader\"></div>\n", styles: [".chromeframe{margin:.2em 0;background:#ccc;color:#000;padding:.2em 0}p{line-height:1.33em;color:#7e7e7e}h1{color:#eee}#loader-wrapper{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1000}#loader{display:block;position:relative;left:50%;top:50%;width:150px;height:150px;margin:-75px 0 0 -75px;border-radius:50%;border:3px solid transparent;border-top-color:#3498db;-webkit-animation:spin 2s linear infinite;animation:spin 2s linear infinite;z-index:1001}#loader:before{content:\"\";position:absolute;inset:5px;border-radius:50%;border:3px solid transparent;border-top-color:#e74c3c;-webkit-animation:spin 3s linear infinite;animation:spin 3s linear infinite}#loader:after{content:\"\";position:absolute;inset:15px;border-radius:50%;border:3px solid transparent;border-top-color:#f9c922;-webkit-animation:spin 1.5s linear infinite;animation:spin 1.5s linear infinite}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg)}}#loader-wrapper .loader-section{position:fixed;top:0;width:51%;height:100%;background:#222;z-index:1000;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translate(0)}#loader-wrapper .loader-section.section-left{left:0}#loader-wrapper .loader-section.section-right{right:0}.loaded #loader-wrapper .loader-section.section-left{-webkit-transform:translateX(-100%);-ms-transform:translateX(-100%);transform:translate(-100%);-webkit-transition:all .7s .3s cubic-bezier(.645,.045,.355,1);transition:all .7s .3s cubic-bezier(.645,.045,.355,1)}.loaded #loader-wrapper .loader-section.section-right{-webkit-transform:translateX(100%);-ms-transform:translateX(100%);transform:translate(100%);-webkit-transition:all .7s .3s cubic-bezier(.645,.045,.355,1);transition:all .7s .3s cubic-bezier(.645,.045,.355,1)}.loaded #loader{opacity:0;-webkit-transition:all .3s ease-out;transition:all .3s ease-out}.loaded #loader-wrapper{visibility:hidden;-webkit-transform:translateY(-100%);-ms-transform:translateY(-100%);transform:translateY(-100%);-webkit-transition:all .3s 1s ease-out;transition:all .3s 1s ease-out}.no-js #loader-wrapper{display:none}.no-js h1{color:#222}#content{margin:0 auto;padding-bottom:50px;width:80%;max-width:978px}.ir{background-color:transparent;border:0;overflow:hidden;*text-indent: -9999px}.ir:before{content:\"\";display:block;width:0;height:150%}.hidden{display:none!important;visibility:hidden}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.invisible{visibility:hidden}.clearfix:before,.clearfix:after{content:\" \";display:table}.clearfix:after{clear:both}.clearfix{*zoom: 1}@media print{*{background:transparent!important;color:#000!important;box-shadow:none!important;text-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:\" (\" attr(href) \")\"}abbr[title]:after{content:\" (\" attr(title) \")\"}.ir a:after,a[href^=\"javascript:\"]:after,a[href^=\"#\"]:after{content:\"\"}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}}:host{height:150px}\n"] }]
|
|
1340
|
+
}] });
|
|
1341
|
+
|
|
1342
|
+
class MiniAdminComponent {
|
|
1343
|
+
content1;
|
|
1344
|
+
adminAble;
|
|
1345
|
+
selectedComponent;
|
|
1346
|
+
headerName = '';
|
|
1347
|
+
settings;
|
|
1348
|
+
admin;
|
|
1349
|
+
label = '';
|
|
1350
|
+
allowedAdminComponent = null;
|
|
1351
|
+
constructor() { }
|
|
1352
|
+
ngOnInit() {
|
|
1353
|
+
}
|
|
1354
|
+
showContent(component, label) {
|
|
1355
|
+
if (this.allowedAdminComponent && this.allowedAdminComponent != component) {
|
|
1356
|
+
return;
|
|
1357
|
+
}
|
|
1358
|
+
this.selectedComponent = component;
|
|
1359
|
+
this.content1.clear();
|
|
1360
|
+
this.admin = this.content1.createComponent(component).instance;
|
|
1361
|
+
this.admin.contextObject = this.adminAble.contextObject;
|
|
1362
|
+
this.admin.settings = this.settings;
|
|
1363
|
+
this.label = label;
|
|
1364
|
+
}
|
|
1365
|
+
set setInitParams(value) {
|
|
1366
|
+
this.adminAble = value;
|
|
1367
|
+
this.settings = value.settings;
|
|
1368
|
+
this.showContent(value.adminComponentsClass[0].component, value.adminComponentsClass[0].label);
|
|
1369
|
+
}
|
|
1370
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MiniAdminComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1371
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: MiniAdminComponent, isStandalone: true, selector: "app-mini-admin", inputs: { setInitParams: "setInitParams" }, viewQueries: [{ propertyName: "content1", first: true, predicate: ["content1"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<div class=\"container-fluid\">\n <div class=\"row sidebar-dark-primary\">\n <nav class=\"col-4\" id=\"sidebar\">\n <div class=\"brand-link mt-3\">\n <span class=\"brand-text font-weight-light\"><mat-icon class=\"align-middle\">menu</mat-icon> Menu</span>\n </div>\n <ul *ngIf=\"adminAble\" class=\"list-unstyled components mb-5\">\n <li [class]=\"{active: selectedComponent === setting.component, invisible: allowedAdminComponent && setting.component != allowedAdminComponent}\" *ngFor=\"let setting of adminAble.adminComponentsClass;\">\n <a href=\"#\" (click)=\"showContent(setting.component, setting.label);$event.preventDefault()\">\n <span class=\"fa fa-chevron-right me-3\"></span>{{setting.label}}</a>\n </li>\n </ul>\n </nav>\n\n <div id=\"content\" class=\"col\">\n <h5>{{label}}</h5>\n <div class=\"content-block\">\n <ng-container #content1></ng-container>\n </div>\n </div>\n </div>\n</div>\n\n\n\n\n\n\n", styles: ["#sidebar{min-width:250px;max-width:250px;background:#212121;color:#fff;-webkit-transition:all .3s;-o-transition:all .3s;transition:all .3s;position:relative}#sidebar h1{margin-bottom:15px;font-weight:700;font-size:16px}#sidebar ul.components{padding:0}#sidebar ul li{font-size:13px}#sidebar ul li.active>a{background:transparent;color:#fff}#sidebar ul li a{padding:9px 25px;display:block;color:#fff9;border-bottom:1px solid rgba(255,255,255,.1);margin:9px 0}#content{-webkit-transition:all .3s;-o-transition:all .3s;transition:all .3s;padding:0!important;background-color:#f4f6f9;min-height:332px}#content h5{padding:8px 18px;border-bottom:2px solid #dee2e6;cursor:all-scroll}#sidebar h1 .logo{color:#fff;display:block;padding:10px 30px;background:#2f89fc}.content-block{padding:10px 20px}.close{cursor:pointer;position:absolute;top:5%;right:0%;padding:12px 16px;transform:translateY(-46%);font-size:1.1rem}.close:hover{background:#bbb}::ng-deep .border-outer{padding-right:.25rem!important;padding-left:.25rem!important;margin-bottom:.5rem!important;margin-right:.25rem!important;margin-left:.25rem!important}::ng-deep .border-inner{padding-right:1rem!important;padding-left:1rem!important;padding-top:.25rem!important;margin-bottom:12px}::ng-deep .border.left{border-right:none!important}::ng-deep .mat-mdc-dialog-surface:has(app-mini-admin){overflow-y:hidden}::ng-deep .mat-mdc-dialog-surface .content-block{overflow-y:auto;max-height:500px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
1372
|
+
}
|
|
1373
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MiniAdminComponent, decorators: [{
|
|
1374
|
+
type: Component,
|
|
1375
|
+
args: [{ selector: 'app-mini-admin', imports: [
|
|
1376
|
+
CommonModule,
|
|
1377
|
+
MatIcon
|
|
1378
|
+
], template: "<div class=\"container-fluid\">\n <div class=\"row sidebar-dark-primary\">\n <nav class=\"col-4\" id=\"sidebar\">\n <div class=\"brand-link mt-3\">\n <span class=\"brand-text font-weight-light\"><mat-icon class=\"align-middle\">menu</mat-icon> Menu</span>\n </div>\n <ul *ngIf=\"adminAble\" class=\"list-unstyled components mb-5\">\n <li [class]=\"{active: selectedComponent === setting.component, invisible: allowedAdminComponent && setting.component != allowedAdminComponent}\" *ngFor=\"let setting of adminAble.adminComponentsClass;\">\n <a href=\"#\" (click)=\"showContent(setting.component, setting.label);$event.preventDefault()\">\n <span class=\"fa fa-chevron-right me-3\"></span>{{setting.label}}</a>\n </li>\n </ul>\n </nav>\n\n <div id=\"content\" class=\"col\">\n <h5>{{label}}</h5>\n <div class=\"content-block\">\n <ng-container #content1></ng-container>\n </div>\n </div>\n </div>\n</div>\n\n\n\n\n\n\n", styles: ["#sidebar{min-width:250px;max-width:250px;background:#212121;color:#fff;-webkit-transition:all .3s;-o-transition:all .3s;transition:all .3s;position:relative}#sidebar h1{margin-bottom:15px;font-weight:700;font-size:16px}#sidebar ul.components{padding:0}#sidebar ul li{font-size:13px}#sidebar ul li.active>a{background:transparent;color:#fff}#sidebar ul li a{padding:9px 25px;display:block;color:#fff9;border-bottom:1px solid rgba(255,255,255,.1);margin:9px 0}#content{-webkit-transition:all .3s;-o-transition:all .3s;transition:all .3s;padding:0!important;background-color:#f4f6f9;min-height:332px}#content h5{padding:8px 18px;border-bottom:2px solid #dee2e6;cursor:all-scroll}#sidebar h1 .logo{color:#fff;display:block;padding:10px 30px;background:#2f89fc}.content-block{padding:10px 20px}.close{cursor:pointer;position:absolute;top:5%;right:0%;padding:12px 16px;transform:translateY(-46%);font-size:1.1rem}.close:hover{background:#bbb}::ng-deep .border-outer{padding-right:.25rem!important;padding-left:.25rem!important;margin-bottom:.5rem!important;margin-right:.25rem!important;margin-left:.25rem!important}::ng-deep .border-inner{padding-right:1rem!important;padding-left:1rem!important;padding-top:.25rem!important;margin-bottom:12px}::ng-deep .border.left{border-right:none!important}::ng-deep .mat-mdc-dialog-surface:has(app-mini-admin){overflow-y:hidden}::ng-deep .mat-mdc-dialog-surface .content-block{overflow-y:auto;max-height:500px}\n"] }]
|
|
1379
|
+
}], ctorParameters: () => [], propDecorators: { content1: [{
|
|
1380
|
+
type: ViewChild,
|
|
1381
|
+
args: ['content1', { read: ViewContainerRef, static: true }]
|
|
1382
|
+
}], setInitParams: [{
|
|
1383
|
+
type: Input
|
|
1384
|
+
}] } });
|
|
1385
|
+
|
|
1386
|
+
class MoveableModalComponent {
|
|
1387
|
+
data;
|
|
1388
|
+
content;
|
|
1389
|
+
title = '';
|
|
1390
|
+
instanceReady$ = new Subject();
|
|
1391
|
+
constructor(data) {
|
|
1392
|
+
this.data = data;
|
|
1393
|
+
this.title = data.title;
|
|
1394
|
+
}
|
|
1395
|
+
ngOnInit() {
|
|
1396
|
+
let instance = this.content.createComponent(this.data.contentComponent).instance;
|
|
1397
|
+
if (this.data.params) {
|
|
1398
|
+
instance.setInitParams = this.data.params;
|
|
1399
|
+
}
|
|
1400
|
+
this.instanceReady$.next(instance);
|
|
1401
|
+
}
|
|
1402
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MoveableModalComponent, deps: [{ token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
1403
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: MoveableModalComponent, isStandalone: true, selector: "app-moveable-modal", viewQueries: [{ propertyName: "content", first: true, predicate: ["modalContent"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<div cdkDrag cdkDragRootElement=\".cdk-overlay-pane\" class=\"align-items-stretch\">\n <div cdkDragHandle class=\"move-line d-flex justify-content-between align-items-center\">\n <span class=\"header-title\">{{title ?? ''}}</span>\n <mat-icon [mat-dialog-close]=\"false\" class=\"close-icon\">close</mat-icon>\n </div>\n <ng-container #modalContent></ng-container>\n</div>\n", styles: [".move-line{line-height:30px;background:#2f89fc;width:100%;cursor:move;border-top-left-radius:4px;border-top-right-radius:4px;border-top:1px solid #2f89fc}.close-icon{color:#fff;cursor:pointer;margin-right:2px;vertical-align:middle}.header-title{margin-left:11px;color:#fff;vertical-align:middle}\n"], dependencies: [{ kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }] });
|
|
1404
|
+
}
|
|
1405
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MoveableModalComponent, decorators: [{
|
|
1406
|
+
type: Component,
|
|
1407
|
+
args: [{ selector: 'app-moveable-modal', imports: [
|
|
1408
|
+
CdkDrag,
|
|
1409
|
+
CdkDragHandle,
|
|
1410
|
+
MatIcon,
|
|
1411
|
+
MatDialogClose
|
|
1412
|
+
], template: "<div cdkDrag cdkDragRootElement=\".cdk-overlay-pane\" class=\"align-items-stretch\">\n <div cdkDragHandle class=\"move-line d-flex justify-content-between align-items-center\">\n <span class=\"header-title\">{{title ?? ''}}</span>\n <mat-icon [mat-dialog-close]=\"false\" class=\"close-icon\">close</mat-icon>\n </div>\n <ng-container #modalContent></ng-container>\n</div>\n", styles: [".move-line{line-height:30px;background:#2f89fc;width:100%;cursor:move;border-top-left-radius:4px;border-top-right-radius:4px;border-top:1px solid #2f89fc}.close-icon{color:#fff;cursor:pointer;margin-right:2px;vertical-align:middle}.header-title{margin-left:11px;color:#fff;vertical-align:middle}\n"] }]
|
|
1413
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1414
|
+
type: Inject,
|
|
1415
|
+
args: [MAT_DIALOG_DATA]
|
|
1416
|
+
}] }], propDecorators: { content: [{
|
|
1417
|
+
type: ViewChild,
|
|
1418
|
+
args: ['modalContent', { read: ViewContainerRef, static: true }]
|
|
1419
|
+
}] } });
|
|
1420
|
+
|
|
1421
|
+
class RemoveItemComponent {
|
|
1422
|
+
data;
|
|
1423
|
+
constructor(data) {
|
|
1424
|
+
this.data = data;
|
|
1425
|
+
}
|
|
1426
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: RemoveItemComponent, deps: [{ token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
1427
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: RemoveItemComponent, isStandalone: true, selector: "app-remove-item", ngImport: i0, template: "<app-dialog>\n <ng-container title>Smaz\u00E1n\u00ED - {{data.name}}</ng-container>\n <ng-container content>Opravdu si p\u0159ejete smazat: {{data.name}}?</ng-container>\n <ng-container save-button>Ano</ng-container>\n</app-dialog>\n", styles: [""], dependencies: [{ kind: "component", type: DialogComponent, selector: "app-dialog", inputs: ["saveButtonShow", "saveData"] }] });
|
|
1428
|
+
}
|
|
1429
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: RemoveItemComponent, decorators: [{
|
|
1430
|
+
type: Component,
|
|
1431
|
+
args: [{ selector: 'app-remove-item', imports: [
|
|
1432
|
+
DialogComponent
|
|
1433
|
+
], template: "<app-dialog>\n <ng-container title>Smaz\u00E1n\u00ED - {{data.name}}</ng-container>\n <ng-container content>Opravdu si p\u0159ejete smazat: {{data.name}}?</ng-container>\n <ng-container save-button>Ano</ng-container>\n</app-dialog>\n" }]
|
|
1434
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1435
|
+
type: Inject,
|
|
1436
|
+
args: [MAT_DIALOG_DATA]
|
|
1437
|
+
}] }] });
|
|
1438
|
+
|
|
1439
|
+
class SimpleDialogComponent {
|
|
1440
|
+
dynamicDialogConfig;
|
|
1441
|
+
dynamicDialogRef;
|
|
1442
|
+
text = '';
|
|
1443
|
+
constructor(dynamicDialogConfig, dynamicDialogRef) {
|
|
1444
|
+
this.dynamicDialogConfig = dynamicDialogConfig;
|
|
1445
|
+
this.dynamicDialogRef = dynamicDialogRef;
|
|
1446
|
+
this.text = this.dynamicDialogConfig.data.text.replace(/\r?\n/g, '<br>');
|
|
1447
|
+
;
|
|
1448
|
+
}
|
|
1449
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SimpleDialogComponent, deps: [{ token: i1$8.DynamicDialogConfig }, { token: i1$8.DynamicDialogRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1450
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: SimpleDialogComponent, isStandalone: true, selector: "app-simple-dialog-component", ngImport: i0, template: "<div [innerHTML]=\"text\">\n</div>\n", styles: [""] });
|
|
1451
|
+
}
|
|
1452
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SimpleDialogComponent, decorators: [{
|
|
1453
|
+
type: Component,
|
|
1454
|
+
args: [{ selector: 'app-simple-dialog-component', imports: [], template: "<div [innerHTML]=\"text\">\n</div>\n" }]
|
|
1455
|
+
}], ctorParameters: () => [{ type: i1$8.DynamicDialogConfig }, { type: i1$8.DynamicDialogRef }] });
|
|
1456
|
+
|
|
1457
|
+
class MoveableModalService {
|
|
1458
|
+
dialog;
|
|
1459
|
+
constructor(dialog) {
|
|
1460
|
+
this.dialog = dialog;
|
|
1461
|
+
}
|
|
1462
|
+
show(contentComponent, params, title = '') {
|
|
1463
|
+
return this.dialog.open((MoveableModalComponent), {
|
|
1464
|
+
data: {
|
|
1465
|
+
contentComponent,
|
|
1466
|
+
params,
|
|
1467
|
+
title: title,
|
|
1468
|
+
},
|
|
1469
|
+
width: '888px',
|
|
1470
|
+
maxHeight: '600px',
|
|
1471
|
+
position: { top: '110px' }
|
|
1472
|
+
});
|
|
1473
|
+
}
|
|
1474
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MoveableModalService, deps: [{ token: i1$3.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1475
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MoveableModalService, providedIn: 'root' });
|
|
1476
|
+
}
|
|
1477
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MoveableModalService, decorators: [{
|
|
1478
|
+
type: Injectable,
|
|
1479
|
+
args: [{
|
|
1480
|
+
providedIn: 'root'
|
|
1481
|
+
}]
|
|
1482
|
+
}], ctorParameters: () => [{ type: i1$3.MatDialog }] });
|
|
1483
|
+
|
|
1484
|
+
class ErrorMessageComponent {
|
|
1485
|
+
_errors = [];
|
|
1486
|
+
control;
|
|
1487
|
+
objectKeys = Object.keys;
|
|
1488
|
+
constructor() {
|
|
1489
|
+
}
|
|
1490
|
+
ngOnInit() {
|
|
1491
|
+
}
|
|
1492
|
+
getMessage(index, errors) {
|
|
1493
|
+
let message = '';
|
|
1494
|
+
switch (index) {
|
|
1495
|
+
case 'required':
|
|
1496
|
+
message = 'Toto pole je povinné';
|
|
1497
|
+
break;
|
|
1498
|
+
default:
|
|
1499
|
+
message = errors[index];
|
|
1500
|
+
break;
|
|
1501
|
+
}
|
|
1502
|
+
return message;
|
|
1503
|
+
}
|
|
1504
|
+
get errors() {
|
|
1505
|
+
return this._errors;
|
|
1506
|
+
}
|
|
1507
|
+
set errors(value) {
|
|
1508
|
+
this._errors = value;
|
|
1509
|
+
}
|
|
1510
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ErrorMessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1511
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: ErrorMessageComponent, isStandalone: true, selector: "app-error-message", ngImport: i0, template: "<div *ngFor=\"let errorKey of objectKeys(control.errors ?? [])\">\n <div class=\"validation-error-message small\">{{getMessage(errorKey, control.errors)}}</div>\n</div>\n", styles: [".validation-error-message{color:red}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
1512
|
+
}
|
|
1513
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ErrorMessageComponent, decorators: [{
|
|
1514
|
+
type: Component,
|
|
1515
|
+
args: [{ selector: 'app-error-message', imports: [
|
|
1516
|
+
CommonModule
|
|
1517
|
+
], template: "<div *ngFor=\"let errorKey of objectKeys(control.errors ?? [])\">\n <div class=\"validation-error-message small\">{{getMessage(errorKey, control.errors)}}</div>\n</div>\n", styles: [".validation-error-message{color:red}\n"] }]
|
|
1518
|
+
}], ctorParameters: () => [] });
|
|
1519
|
+
|
|
1520
|
+
class InputFormErrorGrouperDirective {
|
|
1521
|
+
groupeName;
|
|
1522
|
+
hasError = false;
|
|
1523
|
+
constructor() {
|
|
1524
|
+
}
|
|
1525
|
+
ngAfterViewChecked() {
|
|
1526
|
+
this.hasError = false;
|
|
1527
|
+
}
|
|
1528
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: InputFormErrorGrouperDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1529
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.16", type: InputFormErrorGrouperDirective, isStandalone: true, selector: "[appInputFormErrorGrouper]", inputs: { groupeName: ["appInputFormErrorGrouper", "groupeName"] }, ngImport: i0 });
|
|
1530
|
+
}
|
|
1531
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: InputFormErrorGrouperDirective, decorators: [{
|
|
1532
|
+
type: Directive,
|
|
1533
|
+
args: [{
|
|
1534
|
+
selector: '[appInputFormErrorGrouper]',
|
|
1535
|
+
standalone: true
|
|
1536
|
+
}]
|
|
1537
|
+
}], ctorParameters: () => [], propDecorators: { groupeName: [{
|
|
1538
|
+
type: Input,
|
|
1539
|
+
args: ['appInputFormErrorGrouper']
|
|
1540
|
+
}] } });
|
|
1541
|
+
|
|
1542
|
+
class GlobalFormErrorComponent {
|
|
1543
|
+
parentFormControl;
|
|
1544
|
+
inputFormErrorGrouperDirective;
|
|
1545
|
+
errors = {};
|
|
1546
|
+
objectKeys = Object.keys;
|
|
1547
|
+
constructor(parentFormControl, inputFormErrorGrouperDirective) {
|
|
1548
|
+
this.parentFormControl = parentFormControl;
|
|
1549
|
+
this.inputFormErrorGrouperDirective = inputFormErrorGrouperDirective;
|
|
1550
|
+
}
|
|
1551
|
+
ngAfterContentInit() {
|
|
1552
|
+
if (!this.parentFormControl) {
|
|
1553
|
+
return;
|
|
1554
|
+
}
|
|
1555
|
+
this.parentFormControl.statusChanges?.subscribe(status => {
|
|
1556
|
+
if (status === 'INVALID') {
|
|
1557
|
+
this.errors = this.parentFormControl?.errors ?? {};
|
|
1558
|
+
if (this.inputFormErrorGrouperDirective) {
|
|
1559
|
+
this.inputFormErrorGrouperDirective.hasError = true;
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
});
|
|
1563
|
+
}
|
|
1564
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GlobalFormErrorComponent, deps: [{ token: i1$7.FormGroupDirective, host: true, optional: true }, { token: InputFormErrorGrouperDirective, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
1565
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: GlobalFormErrorComponent, isStandalone: true, selector: "app-global-form-error", ngImport: i0, template: "<div class=\"mb-3\" *ngFor=\"let errorKey of objectKeys(errors)\">\n <div class=\"validation-error-message small\">{{errors[errorKey]}}</div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
1566
|
+
}
|
|
1567
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GlobalFormErrorComponent, decorators: [{
|
|
1568
|
+
type: Component,
|
|
1569
|
+
args: [{ selector: 'app-global-form-error', imports: [
|
|
1570
|
+
CommonModule,
|
|
1571
|
+
], template: "<div class=\"mb-3\" *ngFor=\"let errorKey of objectKeys(errors)\">\n <div class=\"validation-error-message small\">{{errors[errorKey]}}</div>\n</div>\n" }]
|
|
1572
|
+
}], ctorParameters: () => [{ type: i1$7.FormGroupDirective, decorators: [{
|
|
1573
|
+
type: Host
|
|
1574
|
+
}, {
|
|
1575
|
+
type: Optional
|
|
1576
|
+
}] }, { type: InputFormErrorGrouperDirective, decorators: [{
|
|
1577
|
+
type: Host
|
|
1578
|
+
}, {
|
|
1579
|
+
type: Optional
|
|
1580
|
+
}] }] });
|
|
1581
|
+
|
|
1582
|
+
class InputFormErrorDirective {
|
|
1583
|
+
renderer2;
|
|
1584
|
+
elementRef;
|
|
1585
|
+
selfViewContainer;
|
|
1586
|
+
cdRef;
|
|
1587
|
+
formGroup;
|
|
1588
|
+
inputFormErrorGrouperDirective;
|
|
1589
|
+
selfInput;
|
|
1590
|
+
formInput;
|
|
1591
|
+
formInputElementRef;
|
|
1592
|
+
errorFormContainer;
|
|
1593
|
+
errorMessageComonent;
|
|
1594
|
+
isError = false;
|
|
1595
|
+
rootFormGroupDirective = input(...(ngDevMode ? [undefined, { debugName: "rootFormGroupDirective" }] : []));
|
|
1596
|
+
constructor(renderer2, elementRef, selfViewContainer, cdRef, formGroup, inputFormErrorGrouperDirective, selfInput) {
|
|
1597
|
+
this.renderer2 = renderer2;
|
|
1598
|
+
this.elementRef = elementRef;
|
|
1599
|
+
this.selfViewContainer = selfViewContainer;
|
|
1600
|
+
this.cdRef = cdRef;
|
|
1601
|
+
this.formGroup = formGroup;
|
|
1602
|
+
this.inputFormErrorGrouperDirective = inputFormErrorGrouperDirective;
|
|
1603
|
+
this.selfInput = selfInput;
|
|
1604
|
+
}
|
|
1605
|
+
ngOnInit() {
|
|
1606
|
+
if (this.selfInput) {
|
|
1607
|
+
this.errorFormContainer = this.selfViewContainer;
|
|
1608
|
+
this.formInputElementRef = this.elementRef;
|
|
1609
|
+
}
|
|
1610
|
+
else {
|
|
1611
|
+
if (!this.errorFormContainer) {
|
|
1612
|
+
this.errorFormContainer = this.selfViewContainer;
|
|
1613
|
+
}
|
|
1614
|
+
this.selfInput = this.formInput;
|
|
1615
|
+
}
|
|
1616
|
+
}
|
|
1617
|
+
ngDoCheck() {
|
|
1618
|
+
if (this.rootFormGroupDirective()?.submitted || this.formGroup.submitted) {
|
|
1619
|
+
if (!this.isError && this.selfInput?.errors) {
|
|
1620
|
+
this.isError = true;
|
|
1621
|
+
this.createErrorMessage();
|
|
1622
|
+
}
|
|
1623
|
+
else if (this.isError && !this.selfInput?.errors) {
|
|
1624
|
+
this.isError = false;
|
|
1625
|
+
this.clearMessage();
|
|
1626
|
+
}
|
|
1627
|
+
}
|
|
1628
|
+
}
|
|
1629
|
+
createErrorMessage() {
|
|
1630
|
+
this.errorMessageComonent = this.errorFormContainer.createComponent(ErrorMessageComponent).instance;
|
|
1631
|
+
if (this.selfInput) {
|
|
1632
|
+
this.errorMessageComonent.errors = this.selfInput.errors;
|
|
1633
|
+
this.errorMessageComonent.control = this.selfInput;
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
clearMessage() {
|
|
1637
|
+
this.errorFormContainer.clear();
|
|
1638
|
+
}
|
|
1639
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: InputFormErrorDirective, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i0.ViewContainerRef }, { token: i0.ChangeDetectorRef }, { token: i1$7.FormGroupDirective }, { token: InputFormErrorGrouperDirective, host: true, optional: true }, { token: i1$7.FormControlName, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1640
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.16", type: InputFormErrorDirective, isStandalone: true, selector: "[appFormError]", inputs: { rootFormGroupDirective: { classPropertyName: "rootFormGroupDirective", publicName: "rootFormGroupDirective", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "formInput", first: true, predicate: FormControlName, descendants: true, read: FormControlName, static: true }, { propertyName: "formInputElementRef", first: true, predicate: NgControl, descendants: true, read: ElementRef, static: true }, { propertyName: "errorFormContainer", first: true, predicate: ["errorFormContainer"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0 });
|
|
1641
|
+
}
|
|
1642
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: InputFormErrorDirective, decorators: [{
|
|
1643
|
+
type: Directive,
|
|
1644
|
+
args: [{
|
|
1645
|
+
selector: '[appFormError]',
|
|
1646
|
+
standalone: true,
|
|
1647
|
+
}]
|
|
1648
|
+
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }, { type: i1$7.FormGroupDirective }, { type: InputFormErrorGrouperDirective, decorators: [{
|
|
1649
|
+
type: Host
|
|
1650
|
+
}, {
|
|
1651
|
+
type: Optional
|
|
1652
|
+
}] }, { type: i1$7.FormControlName, decorators: [{
|
|
1653
|
+
type: Optional
|
|
1654
|
+
}, {
|
|
1655
|
+
type: Self
|
|
1656
|
+
}] }], propDecorators: { formInput: [{
|
|
1657
|
+
type: ContentChild,
|
|
1658
|
+
args: [FormControlName, { read: FormControlName, static: true }]
|
|
1659
|
+
}], formInputElementRef: [{
|
|
1660
|
+
type: ContentChild,
|
|
1661
|
+
args: [NgControl, { read: ElementRef, static: true }]
|
|
1662
|
+
}], errorFormContainer: [{
|
|
1663
|
+
type: ContentChild,
|
|
1664
|
+
args: ['errorFormContainer', { read: ViewContainerRef, static: true }]
|
|
1665
|
+
}], rootFormGroupDirective: [{ type: i0.Input, args: [{ isSignal: true, alias: "rootFormGroupDirective", required: false }] }] } });
|
|
1666
|
+
|
|
1667
|
+
class HiderElementDirective {
|
|
1668
|
+
asyncComunicatorService;
|
|
1669
|
+
cd;
|
|
1670
|
+
showOn;
|
|
1671
|
+
hideOn;
|
|
1672
|
+
display = 'none';
|
|
1673
|
+
callback = this.changeStatus.bind(this);
|
|
1674
|
+
constructor(asyncComunicatorService, cd) {
|
|
1675
|
+
this.asyncComunicatorService = asyncComunicatorService;
|
|
1676
|
+
this.cd = cd;
|
|
1677
|
+
}
|
|
1678
|
+
ngOnInit() {
|
|
1679
|
+
this.asyncComunicatorService.registerCallback([this.showOn, this.hideOn], this.callback);
|
|
1680
|
+
}
|
|
1681
|
+
changeStatus(eventName, asyncPost) {
|
|
1682
|
+
if (eventName === this.showOn) {
|
|
1683
|
+
this.display = 'block';
|
|
1684
|
+
//this.cd.detectChanges();
|
|
1685
|
+
}
|
|
1686
|
+
else {
|
|
1687
|
+
this.display = 'none';
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
ngOnDestroy() {
|
|
1691
|
+
this.asyncComunicatorService.unregisterCallback([this.showOn, this.hideOn], this.callback);
|
|
1692
|
+
}
|
|
1693
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: HiderElementDirective, deps: [{ token: EventEmitterService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1694
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.16", type: HiderElementDirective, isStandalone: true, selector: "[appHiderElement]", inputs: { showOn: "showOn", hideOn: "hideOn" }, host: { properties: { "style.display": "this.display" } }, ngImport: i0 });
|
|
1695
|
+
}
|
|
1696
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: HiderElementDirective, decorators: [{
|
|
1697
|
+
type: Directive,
|
|
1698
|
+
args: [{
|
|
1699
|
+
selector: '[appHiderElement]',
|
|
1700
|
+
standalone: true,
|
|
1701
|
+
}]
|
|
1702
|
+
}], ctorParameters: () => [{ type: EventEmitterService }, { type: i0.ChangeDetectorRef }], propDecorators: { showOn: [{
|
|
1703
|
+
type: Input
|
|
1704
|
+
}], hideOn: [{
|
|
1705
|
+
type: Input
|
|
1706
|
+
}], display: [{
|
|
1707
|
+
type: HostBinding,
|
|
1708
|
+
args: ['style.display']
|
|
1709
|
+
}] } });
|
|
1710
|
+
|
|
1711
|
+
class LinkDeactivateService {
|
|
1712
|
+
deactivate = false;
|
|
1713
|
+
constructor() { }
|
|
1714
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: LinkDeactivateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1715
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: LinkDeactivateService, providedIn: 'root' });
|
|
1716
|
+
}
|
|
1717
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: LinkDeactivateService, decorators: [{
|
|
1718
|
+
type: Injectable,
|
|
1719
|
+
args: [{
|
|
1720
|
+
providedIn: 'root'
|
|
1721
|
+
}]
|
|
1722
|
+
}], ctorParameters: () => [] });
|
|
1723
|
+
|
|
1724
|
+
class LinkDeactivateDirective {
|
|
1725
|
+
linkDeactivateService;
|
|
1726
|
+
constructor(linkDeactivateService) {
|
|
1727
|
+
this.linkDeactivateService = linkDeactivateService;
|
|
1728
|
+
}
|
|
1729
|
+
click(event) {
|
|
1730
|
+
if (this.linkDeactivateService.deactivate) {
|
|
1731
|
+
event.preventDefault();
|
|
1732
|
+
event.stopPropagation();
|
|
1733
|
+
}
|
|
1734
|
+
}
|
|
1735
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: LinkDeactivateDirective, deps: [{ token: LinkDeactivateService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1736
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.16", type: LinkDeactivateDirective, isStandalone: true, selector: "[appLinkDeactivate]", host: { listeners: { "click": "click($event)" } }, ngImport: i0 });
|
|
1737
|
+
}
|
|
1738
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: LinkDeactivateDirective, decorators: [{
|
|
1739
|
+
type: Directive,
|
|
1740
|
+
args: [{
|
|
1741
|
+
standalone: true,
|
|
1742
|
+
selector: '[appLinkDeactivate]'
|
|
1743
|
+
}]
|
|
1744
|
+
}], ctorParameters: () => [{ type: LinkDeactivateService }], propDecorators: { click: [{
|
|
1745
|
+
type: HostListener,
|
|
1746
|
+
args: ['click', ['$event']]
|
|
1747
|
+
}] } });
|
|
1748
|
+
|
|
1749
|
+
const loginGuard = (route, state) => {
|
|
1750
|
+
let loginClient = inject(LoginClientService);
|
|
1751
|
+
let router = inject(Router$1);
|
|
1752
|
+
if (!loginClient.isLoggedIn()) {
|
|
1753
|
+
return router.parseUrl('/login');
|
|
1754
|
+
}
|
|
1755
|
+
return true;
|
|
1756
|
+
};
|
|
1757
|
+
|
|
1758
|
+
class ArrayHelper {
|
|
1759
|
+
static uniqueBy(items, key) {
|
|
1760
|
+
const map = new Map();
|
|
1761
|
+
for (const item of items) {
|
|
1762
|
+
map.set(item[key], item);
|
|
1763
|
+
}
|
|
1764
|
+
return Array.from(map.values());
|
|
1765
|
+
}
|
|
1766
|
+
static treeToPrimengTreeNode(data) {
|
|
1767
|
+
let fn = (entities) => {
|
|
1768
|
+
return entities.map((entity) => {
|
|
1769
|
+
return {
|
|
1770
|
+
key: entity.id,
|
|
1771
|
+
id: entity.id,
|
|
1772
|
+
label: entity.name,
|
|
1773
|
+
data: entity,
|
|
1774
|
+
expanded: false,
|
|
1775
|
+
children: fn(entity.children ?? [])
|
|
1776
|
+
};
|
|
1777
|
+
});
|
|
1778
|
+
};
|
|
1779
|
+
return fn(data);
|
|
1780
|
+
}
|
|
1781
|
+
static reinitArray(arrayToReinit, newValues) {
|
|
1782
|
+
arrayToReinit.length = 0;
|
|
1783
|
+
arrayToReinit.push(...newValues);
|
|
1784
|
+
}
|
|
1785
|
+
static sortTree(data, sortProperties = ['name']) {
|
|
1786
|
+
let sortFnc = (dataArray) => {
|
|
1787
|
+
let sorted = _.orderBy(dataArray, sortProperties, ['asc']);
|
|
1788
|
+
this.reinitArray(dataArray, sorted);
|
|
1789
|
+
dataArray.filter((value) => value.children ?? null).forEach(value => {
|
|
1790
|
+
sortFnc(value.children);
|
|
1791
|
+
});
|
|
1792
|
+
};
|
|
1793
|
+
sortFnc(data);
|
|
1794
|
+
}
|
|
1795
|
+
static objectWithLevelToNestedArray(objects) {
|
|
1796
|
+
const levelMap = new Map();
|
|
1797
|
+
let currentLevel = -1;
|
|
1798
|
+
const treeCallback = (data) => {
|
|
1799
|
+
data = { ...data };
|
|
1800
|
+
if (!data.hasOwnProperty('children')) {
|
|
1801
|
+
data.children = [];
|
|
1802
|
+
}
|
|
1803
|
+
if (data.level > currentLevel) {
|
|
1804
|
+
if (!data.level) {
|
|
1805
|
+
levelMap.set(data.level, []);
|
|
1806
|
+
}
|
|
1807
|
+
else {
|
|
1808
|
+
const parentLevelArray = levelMap.get(data.level - 1);
|
|
1809
|
+
if (parentLevelArray) {
|
|
1810
|
+
const lastInParentArray = parentLevelArray[parentLevelArray.length - 1];
|
|
1811
|
+
levelMap.set(data.level, lastInParentArray.children);
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1814
|
+
}
|
|
1815
|
+
const currentArray = levelMap.get(data.level);
|
|
1816
|
+
currentArray.push(data);
|
|
1817
|
+
currentLevel = data.level;
|
|
1818
|
+
};
|
|
1819
|
+
objects.forEach(treeCallback);
|
|
1820
|
+
return levelMap.get(0);
|
|
1821
|
+
}
|
|
1822
|
+
static recalculateNestedArrayObjectLevel(dataArray, clearChildren = false) {
|
|
1823
|
+
const callback = (data, currentLevel = 0) => {
|
|
1824
|
+
for (const entry of data) {
|
|
1825
|
+
if (entry.children?.length) {
|
|
1826
|
+
callback(entry.children, currentLevel + 1);
|
|
1827
|
+
if (clearChildren) {
|
|
1828
|
+
entry.children.length = 0;
|
|
1829
|
+
}
|
|
1830
|
+
}
|
|
1831
|
+
else {
|
|
1832
|
+
entry.level = currentLevel;
|
|
1833
|
+
}
|
|
1834
|
+
}
|
|
1835
|
+
};
|
|
1836
|
+
callback(dataArray);
|
|
1837
|
+
}
|
|
1838
|
+
static flatNestedArrayObject(dataArray) {
|
|
1839
|
+
const result = [];
|
|
1840
|
+
const callback = (data, currentLevel = 0) => {
|
|
1841
|
+
for (const entry of data) {
|
|
1842
|
+
const newData = { ...entry };
|
|
1843
|
+
delete newData.children;
|
|
1844
|
+
result.push(newData);
|
|
1845
|
+
if (entry?.children?.length) {
|
|
1846
|
+
callback(entry.children, currentLevel + 1);
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
};
|
|
1850
|
+
callback(dataArray);
|
|
1851
|
+
return result;
|
|
1852
|
+
}
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1855
|
+
class ElementHelper {
|
|
1856
|
+
static getCursorPosition() {
|
|
1857
|
+
const selection = window.getSelection();
|
|
1858
|
+
if (selection.rangeCount > 0) {
|
|
1859
|
+
const range = selection.getRangeAt(0);
|
|
1860
|
+
// Cursor position
|
|
1861
|
+
return range.startOffset;
|
|
1862
|
+
}
|
|
1863
|
+
else {
|
|
1864
|
+
return null;
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
static getInnerNodeFromClickPosition(event) {
|
|
1868
|
+
let range;
|
|
1869
|
+
if (document.caretRangeFromPoint) {
|
|
1870
|
+
range = document.caretRangeFromPoint(event.clientX, event.clientY);
|
|
1871
|
+
}
|
|
1872
|
+
else if (document.caretPositionFromPoint) {
|
|
1873
|
+
const pos = document.caretPositionFromPoint(event.clientX, event.clientY);
|
|
1874
|
+
range = document.createRange();
|
|
1875
|
+
range.setStart(pos.offsetNode, pos.offset);
|
|
1876
|
+
range.setEnd(pos.offsetNode, pos.offset);
|
|
1877
|
+
}
|
|
1878
|
+
if (range) {
|
|
1879
|
+
return range.startContainer;
|
|
1880
|
+
}
|
|
1881
|
+
return null;
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1884
|
+
|
|
1885
|
+
class Helper {
|
|
1886
|
+
static getTrackByFunction(propertyName = 'id') {
|
|
1887
|
+
return (index, obj) => {
|
|
1888
|
+
return obj[propertyName];
|
|
1889
|
+
};
|
|
1890
|
+
}
|
|
1891
|
+
static objectResetAssign(target, source) {
|
|
1892
|
+
target.length = 0;
|
|
1893
|
+
Object.assign(target, source);
|
|
1894
|
+
}
|
|
1895
|
+
}
|
|
1896
|
+
|
|
1897
|
+
class ObjectHelper {
|
|
1898
|
+
static reinitObject(target, source) {
|
|
1899
|
+
for (const key in target) {
|
|
1900
|
+
delete target[key];
|
|
1901
|
+
}
|
|
1902
|
+
Object.assign(target, source);
|
|
1903
|
+
}
|
|
1904
|
+
static toRaw(source) {
|
|
1905
|
+
return JSON.parse(JSON.stringify(source));
|
|
1906
|
+
}
|
|
1907
|
+
static toArray() {
|
|
1908
|
+
}
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1911
|
+
class StringHelper {
|
|
1912
|
+
constructor() { }
|
|
1913
|
+
static randomString() {
|
|
1914
|
+
return Math.random().toString(16).slice(2);
|
|
1915
|
+
}
|
|
1916
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: StringHelper, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1917
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: StringHelper, providedIn: 'root' });
|
|
1918
|
+
}
|
|
1919
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: StringHelper, decorators: [{
|
|
1920
|
+
type: Injectable,
|
|
1921
|
+
args: [{
|
|
1922
|
+
providedIn: 'root'
|
|
1923
|
+
}]
|
|
1924
|
+
}], ctorParameters: () => [] });
|
|
1925
|
+
|
|
1926
|
+
class TreeHelper {
|
|
1927
|
+
static findNodeByKey(nodes, key) {
|
|
1928
|
+
for (const node of nodes) {
|
|
1929
|
+
if (node.key === key) {
|
|
1930
|
+
return node;
|
|
1931
|
+
}
|
|
1932
|
+
if (node.children) {
|
|
1933
|
+
const found = this.findNodeByKey(node.children, key);
|
|
1934
|
+
if (found) {
|
|
1935
|
+
return found;
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1938
|
+
}
|
|
1939
|
+
return null;
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1943
|
+
class ElementPositionMessenger {
|
|
1944
|
+
_x;
|
|
1945
|
+
_y;
|
|
1946
|
+
constructor(_x, _y) {
|
|
1947
|
+
this._x = _x;
|
|
1948
|
+
this._y = _y;
|
|
1949
|
+
}
|
|
1950
|
+
get x() {
|
|
1951
|
+
return this._x;
|
|
1952
|
+
}
|
|
1953
|
+
set x(value) {
|
|
1954
|
+
this._x = value;
|
|
1955
|
+
}
|
|
1956
|
+
get y() {
|
|
1957
|
+
return this._y;
|
|
1958
|
+
}
|
|
1959
|
+
set y(value) {
|
|
1960
|
+
this._y = value;
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1964
|
+
const FontAwesomeIcons = [
|
|
1965
|
+
faCoffee,
|
|
1966
|
+
faHome,
|
|
1967
|
+
faUser,
|
|
1968
|
+
faEnvelope,
|
|
1969
|
+
faSearch,
|
|
1970
|
+
faHeart,
|
|
1971
|
+
faStar,
|
|
1972
|
+
faCheck,
|
|
1973
|
+
faTimes,
|
|
1974
|
+
faPlus,
|
|
1975
|
+
faMinus,
|
|
1976
|
+
faShoppingCart,
|
|
1977
|
+
faPhone,
|
|
1978
|
+
faInfoCircle,
|
|
1979
|
+
faExclamationTriangle,
|
|
1980
|
+
faThumbsUp,
|
|
1981
|
+
faThumbsDown,
|
|
1982
|
+
faLock,
|
|
1983
|
+
faUnlock,
|
|
1984
|
+
faCog,
|
|
1985
|
+
faCogs,
|
|
1986
|
+
faTrash,
|
|
1987
|
+
faTrashAlt,
|
|
1988
|
+
faEdit,
|
|
1989
|
+
faSave,
|
|
1990
|
+
faDownload,
|
|
1991
|
+
faUpload,
|
|
1992
|
+
faFile,
|
|
1993
|
+
faFileAlt,
|
|
1994
|
+
faFolder,
|
|
1995
|
+
faFolderOpen,
|
|
1996
|
+
faBell,
|
|
1997
|
+
faBellSlash,
|
|
1998
|
+
faCamera,
|
|
1999
|
+
faCameraRetro,
|
|
2000
|
+
faImage,
|
|
2001
|
+
faImages,
|
|
2002
|
+
faPlay,
|
|
2003
|
+
faPause,
|
|
2004
|
+
faStop,
|
|
2005
|
+
faForward,
|
|
2006
|
+
faBackward,
|
|
2007
|
+
faStepForward,
|
|
2008
|
+
faStepBackward,
|
|
2009
|
+
faFastForward,
|
|
2010
|
+
faFastBackward,
|
|
2011
|
+
faRedo,
|
|
2012
|
+
faUndo,
|
|
2013
|
+
faSync,
|
|
2014
|
+
faSyncAlt,
|
|
2015
|
+
faAngleUp,
|
|
2016
|
+
faAngleDown,
|
|
2017
|
+
faAngleLeft,
|
|
2018
|
+
faAngleRight,
|
|
2019
|
+
faChevronUp,
|
|
2020
|
+
faChevronDown,
|
|
2021
|
+
faChevronLeft,
|
|
2022
|
+
faChevronRight,
|
|
2023
|
+
faCaretUp,
|
|
2024
|
+
faCaretDown,
|
|
2025
|
+
faCaretLeft,
|
|
2026
|
+
faCaretRight,
|
|
2027
|
+
faArrowUp,
|
|
2028
|
+
faArrowDown,
|
|
2029
|
+
faArrowLeft,
|
|
2030
|
+
faArrowRight,
|
|
2031
|
+
faExternalLink,
|
|
2032
|
+
faExternalLinkAlt,
|
|
2033
|
+
faLink,
|
|
2034
|
+
faUnlink,
|
|
2035
|
+
faRedoAlt,
|
|
2036
|
+
faUndoAlt,
|
|
2037
|
+
faExchangeAlt,
|
|
2038
|
+
faRetweet,
|
|
2039
|
+
faRandom,
|
|
2040
|
+
faSpinner,
|
|
2041
|
+
faCircle,
|
|
2042
|
+
faSquare,
|
|
2043
|
+
faCheckCircle,
|
|
2044
|
+
faCheckSquare,
|
|
2045
|
+
faExclamation,
|
|
2046
|
+
faQuestion,
|
|
2047
|
+
faQuestionCircle,
|
|
2048
|
+
faInfo,
|
|
2049
|
+
faShare,
|
|
2050
|
+
faShareAlt,
|
|
2051
|
+
faShareSquare,
|
|
2052
|
+
faCheckDouble,
|
|
2053
|
+
faEllipsisH,
|
|
2054
|
+
faEllipsisV,
|
|
2055
|
+
faBars,
|
|
2056
|
+
faList,
|
|
2057
|
+
faListAlt,
|
|
2058
|
+
faTh,
|
|
2059
|
+
faThLarge,
|
|
2060
|
+
faThList,
|
|
2061
|
+
faTable,
|
|
2062
|
+
faTasks,
|
|
2063
|
+
faFilter,
|
|
2064
|
+
faSort,
|
|
2065
|
+
faSortUp,
|
|
2066
|
+
faSortDown
|
|
2067
|
+
];
|
|
2068
|
+
|
|
2069
|
+
class SafeHtmlPipe {
|
|
2070
|
+
sanitizer;
|
|
2071
|
+
constructor(sanitizer) {
|
|
2072
|
+
this.sanitizer = sanitizer;
|
|
2073
|
+
}
|
|
2074
|
+
transform(value, ...args) {
|
|
2075
|
+
return this.sanitizer.bypassSecurityTrustHtml(value);
|
|
2076
|
+
}
|
|
2077
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SafeHtmlPipe, deps: [{ token: i1$6.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2078
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.16", ngImport: i0, type: SafeHtmlPipe, isStandalone: true, name: "safeHtml" });
|
|
2079
|
+
}
|
|
2080
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SafeHtmlPipe, decorators: [{
|
|
2081
|
+
type: Pipe,
|
|
2082
|
+
args: [{
|
|
2083
|
+
name: 'safeHtml',
|
|
2084
|
+
standalone: true,
|
|
2085
|
+
}]
|
|
2086
|
+
}], ctorParameters: () => [{ type: i1$6.DomSanitizer }] });
|
|
2087
|
+
|
|
2088
|
+
/*
|
|
2089
|
+
* Public API Surface of ng-core
|
|
2090
|
+
*/
|
|
2091
|
+
|
|
2092
|
+
/**
|
|
2093
|
+
* Generated bundle index. Do not edit.
|
|
2094
|
+
*/
|
|
2095
|
+
|
|
2096
|
+
export { AnimationHiderComponent, AresService, ArrayHelper, BaseFormEntity, BreadcrumbComponent, BreadcrumbService, ConfirmDialogService, DataTableService, DialogComponent, ElementHelper, ElementPositionMessenger, ErrorMessageComponent, Event, EventEmitterService, FileService, FontAwesomeIcons, FormService, GenericResolver, GlobalFormErrorComponent, Helper, HidderComponent, HiderElementDirective, HttpResponseToasterService, ImageService, ImportScriptService, InputFormErrorDirective, InputFormErrorGrouperDirective, LazyBaseTable, LinkDeactivateDirective, LinkDeactivateService, LoaderComponent, LoginClientService, MiniAdminComponent, MoveableModalComponent, MoveableModalService, NG_CORE_CONFIG, NgCore, NotifierService, ObjectHelper, RemoveItemComponent, SafeHtmlPipe, SimpleDialogComponent, StringHelper, SymfonyApiClientService, TreeHelper, UrlService, loginGuard };
|
|
2097
|
+
//# sourceMappingURL=mk-ng-lib.mjs.map
|