wacom 20.0.1 → 20.0.3
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/fesm2022/wacom.mjs +571 -517
- package/fesm2022/wacom.mjs.map +1 -1
- package/index.d.ts +286 -231
- package/package.json +1 -1
package/fesm2022/wacom.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken,
|
|
2
|
+
import { InjectionToken, Inject, Optional, Injectable, ViewChild, Component, signal, PLATFORM_ID, inject, EventEmitter, HostListener, Output, Directive, Pipe, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/router';
|
|
4
4
|
import * as i2 from '@angular/platform-browser';
|
|
5
5
|
import * as i1$1 from '@angular/common';
|
|
6
|
-
import {
|
|
6
|
+
import { CommonModule } from '@angular/common';
|
|
7
7
|
import { Subject, firstValueFrom, Observable, ReplaySubject, EMPTY } from 'rxjs';
|
|
8
8
|
import * as i2$1 from '@angular/common/http';
|
|
9
9
|
import { HttpHeaders, HttpErrorResponse, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
|
@@ -49,6 +49,365 @@ const DEFAULT_Modal = {
|
|
|
49
49
|
closable: true,
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
+
const isDefined = (val) => typeof val !== 'undefined';
|
|
53
|
+
class MetaService {
|
|
54
|
+
router;
|
|
55
|
+
meta;
|
|
56
|
+
titleService;
|
|
57
|
+
config;
|
|
58
|
+
_meta;
|
|
59
|
+
constructor(router, meta, titleService, config) {
|
|
60
|
+
this.router = router;
|
|
61
|
+
this.meta = meta;
|
|
62
|
+
this.titleService = titleService;
|
|
63
|
+
this.config = config;
|
|
64
|
+
this.config = this.config || DEFAULT_CONFIG;
|
|
65
|
+
this._meta = this.config.meta || {};
|
|
66
|
+
this._warnMissingGuard();
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Sets the default meta tags.
|
|
70
|
+
*
|
|
71
|
+
* @param defaults - The default meta tags.
|
|
72
|
+
*/
|
|
73
|
+
setDefaults(defaults) {
|
|
74
|
+
this._meta.defaults = defaults;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Sets the title and optional title suffix.
|
|
78
|
+
*
|
|
79
|
+
* @param title - The title to set.
|
|
80
|
+
* @param titleSuffix - The title suffix to append.
|
|
81
|
+
* @returns The MetaService instance.
|
|
82
|
+
*/
|
|
83
|
+
setTitle(title, titleSuffix) {
|
|
84
|
+
let titleContent = isDefined(title)
|
|
85
|
+
? title
|
|
86
|
+
: this._meta.defaults['title'] || '';
|
|
87
|
+
if (this._meta.useTitleSuffix) {
|
|
88
|
+
titleContent += isDefined(titleSuffix)
|
|
89
|
+
? titleSuffix
|
|
90
|
+
: this._meta.defaults['titleSuffix'] || '';
|
|
91
|
+
}
|
|
92
|
+
this._updateMetaTag('title', titleContent);
|
|
93
|
+
this._updateMetaTag('og:title', titleContent);
|
|
94
|
+
this.titleService.setTitle(titleContent);
|
|
95
|
+
return this;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Sets link tags.
|
|
99
|
+
*
|
|
100
|
+
* @param links - The links to set.
|
|
101
|
+
* @returns The MetaService instance.
|
|
102
|
+
*/
|
|
103
|
+
setLink(links) {
|
|
104
|
+
Object.keys(links).forEach((rel) => {
|
|
105
|
+
let link = document.createElement('link');
|
|
106
|
+
link.setAttribute('rel', rel);
|
|
107
|
+
link.setAttribute('href', links[rel]);
|
|
108
|
+
document.head.appendChild(link);
|
|
109
|
+
});
|
|
110
|
+
return this;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Sets a meta tag.
|
|
114
|
+
*
|
|
115
|
+
* @param tag - The meta tag name.
|
|
116
|
+
* @param value - The meta tag value.
|
|
117
|
+
* @param prop - The meta tag property.
|
|
118
|
+
* @returns The MetaService instance.
|
|
119
|
+
*/
|
|
120
|
+
setTag(tag, value, prop) {
|
|
121
|
+
if (tag === 'title' || tag === 'titleSuffix') {
|
|
122
|
+
throw new Error(`Attempt to set ${tag} through 'setTag': 'title' and 'titleSuffix' are reserved tag names. Please use 'MetaService.setTitle' instead`);
|
|
123
|
+
}
|
|
124
|
+
const content = isDefined(value)
|
|
125
|
+
? value
|
|
126
|
+
: this._meta.defaults[tag] || '';
|
|
127
|
+
this._updateMetaTag(tag, content, prop);
|
|
128
|
+
if (tag === 'description') {
|
|
129
|
+
this._updateMetaTag('og:description', content, prop);
|
|
130
|
+
this._updateMetaTag('twitter:description', content, prop);
|
|
131
|
+
}
|
|
132
|
+
return this;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Updates a meta tag.
|
|
136
|
+
*
|
|
137
|
+
* @param tag - The meta tag name.
|
|
138
|
+
* @param value - The meta tag value.
|
|
139
|
+
* @param prop - The meta tag property.
|
|
140
|
+
*/
|
|
141
|
+
_updateMetaTag(tag, value, prop) {
|
|
142
|
+
prop =
|
|
143
|
+
prop ||
|
|
144
|
+
(tag.startsWith('og:') || tag.startsWith('twitter:')
|
|
145
|
+
? 'property'
|
|
146
|
+
: 'name');
|
|
147
|
+
this.meta.updateTag({ [prop]: tag, content: value });
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Removes a meta tag.
|
|
151
|
+
*
|
|
152
|
+
* @param tag - The meta tag name.
|
|
153
|
+
* @param prop - The meta tag property.
|
|
154
|
+
*/
|
|
155
|
+
removeTag(tag, prop) {
|
|
156
|
+
prop =
|
|
157
|
+
prop ||
|
|
158
|
+
(tag.startsWith('og:') || tag.startsWith('twitter:')
|
|
159
|
+
? 'property'
|
|
160
|
+
: 'name');
|
|
161
|
+
this.meta.removeTag(`${prop}="${tag}"`);
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Warns about missing meta guards in routes.
|
|
165
|
+
*/
|
|
166
|
+
_warnMissingGuard() {
|
|
167
|
+
if (isDefined(this._meta.warnMissingGuard) &&
|
|
168
|
+
!this._meta.warnMissingGuard) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
const hasDefaultMeta = !!Object.keys(this._meta.defaults).length;
|
|
172
|
+
const hasMetaGuardInArr = (it) => it && it.IDENTIFIER === 'MetaGuard';
|
|
173
|
+
let hasShownWarnings = false;
|
|
174
|
+
this.router.config.forEach((route) => {
|
|
175
|
+
const hasRouteMeta = route.data && route.data['meta'];
|
|
176
|
+
const showWarning = !isDefined(route.redirectTo) &&
|
|
177
|
+
(hasDefaultMeta || hasRouteMeta) &&
|
|
178
|
+
!(route.canActivate || []).some(hasMetaGuardInArr);
|
|
179
|
+
if (showWarning) {
|
|
180
|
+
console.warn(`Route with path "${route.path}" has ${hasRouteMeta ? '' : 'default '}meta tags, but does not use MetaGuard. Please add MetaGuard to the canActivate array in your route configuration`);
|
|
181
|
+
hasShownWarnings = true;
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
if (hasShownWarnings) {
|
|
185
|
+
console.warn(`To disable these warnings, set metaConfig.warnMissingGuard: false in your MetaConfig passed to MetaModule.forRoot()`);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: MetaService, deps: [{ token: i1.Router }, { token: i2.Meta }, { token: i2.Title }, { token: CONFIG_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
189
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: MetaService, providedIn: 'root' });
|
|
190
|
+
}
|
|
191
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: MetaService, decorators: [{
|
|
192
|
+
type: Injectable,
|
|
193
|
+
args: [{
|
|
194
|
+
providedIn: 'root',
|
|
195
|
+
}]
|
|
196
|
+
}], ctorParameters: () => [{ type: i1.Router }, { type: i2.Meta }, { type: i2.Title }, { type: undefined, decorators: [{
|
|
197
|
+
type: Inject,
|
|
198
|
+
args: [CONFIG_TOKEN]
|
|
199
|
+
}, {
|
|
200
|
+
type: Optional
|
|
201
|
+
}] }] });
|
|
202
|
+
|
|
203
|
+
class MetaGuard {
|
|
204
|
+
metaService;
|
|
205
|
+
config;
|
|
206
|
+
static IDENTIFIER = 'MetaGuard';
|
|
207
|
+
_meta;
|
|
208
|
+
constructor(metaService, config) {
|
|
209
|
+
this.metaService = metaService;
|
|
210
|
+
this.config = config;
|
|
211
|
+
this._meta = config.meta;
|
|
212
|
+
if (!this.config)
|
|
213
|
+
this.config = DEFAULT_CONFIG;
|
|
214
|
+
}
|
|
215
|
+
canActivate(route, state) {
|
|
216
|
+
this._processRouteMetaTags(route.data && route.data['meta']);
|
|
217
|
+
return true;
|
|
218
|
+
}
|
|
219
|
+
_processRouteMetaTags(meta = {}) {
|
|
220
|
+
if (meta.disableUpdate) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
if (meta.title) {
|
|
224
|
+
this.metaService.setTitle(meta.title, meta.titleSuffix);
|
|
225
|
+
}
|
|
226
|
+
if (Array.isArray(meta.links)) {
|
|
227
|
+
this.metaService.setLink(meta.links);
|
|
228
|
+
}
|
|
229
|
+
else if (typeof meta.links === 'string') {
|
|
230
|
+
this.metaService.setLink(meta.links.split(' '));
|
|
231
|
+
}
|
|
232
|
+
if (Array.isArray(this._meta.defaults?.links)) {
|
|
233
|
+
this.metaService.setLink(this._meta.defaults?.links);
|
|
234
|
+
}
|
|
235
|
+
else if (typeof this._meta.defaults?.links === 'string') {
|
|
236
|
+
this.metaService.setLink(this._meta.defaults?.links.split(' '));
|
|
237
|
+
}
|
|
238
|
+
Object.keys(meta).forEach((prop) => {
|
|
239
|
+
if (prop === 'title' ||
|
|
240
|
+
prop === 'titleSuffix' ||
|
|
241
|
+
prop === 'links') {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
Object.keys(meta[prop]).forEach((key) => {
|
|
245
|
+
this.metaService.setTag(key, meta[prop][key], prop);
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
Object.keys(this._meta.defaults).forEach((key) => {
|
|
249
|
+
if (key in meta ||
|
|
250
|
+
key === 'title' ||
|
|
251
|
+
key === 'titleSuffix' ||
|
|
252
|
+
key === 'links') {
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
this.metaService.setTag(key, this._meta.defaults[key]);
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: MetaGuard, deps: [{ token: MetaService }, { token: CONFIG_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
259
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: MetaGuard });
|
|
260
|
+
}
|
|
261
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: MetaGuard, decorators: [{
|
|
262
|
+
type: Injectable
|
|
263
|
+
}], ctorParameters: () => [{ type: MetaService }, { type: undefined, decorators: [{
|
|
264
|
+
type: Inject,
|
|
265
|
+
args: [CONFIG_TOKEN]
|
|
266
|
+
}, {
|
|
267
|
+
type: Optional
|
|
268
|
+
}] }] });
|
|
269
|
+
|
|
270
|
+
class AlertComponent {
|
|
271
|
+
alert;
|
|
272
|
+
component;
|
|
273
|
+
text = '';
|
|
274
|
+
class = '';
|
|
275
|
+
type = 'info';
|
|
276
|
+
progress = true;
|
|
277
|
+
position = 'bottomRight'; // [bottomRight, bottomLeft, topRight, topLeft, topCenter, bottomCenter or center]
|
|
278
|
+
icon = '';
|
|
279
|
+
timeout = 5000;
|
|
280
|
+
close;
|
|
281
|
+
closable = true;
|
|
282
|
+
buttons = []; /*[{text, callback}]*/
|
|
283
|
+
constructor() {
|
|
284
|
+
setTimeout(() => {
|
|
285
|
+
if (this.timeout) {
|
|
286
|
+
let remaining = JSON.parse(JSON.stringify(this.timeout));
|
|
287
|
+
let timer = setTimeout(() => {
|
|
288
|
+
this.remove();
|
|
289
|
+
}, remaining);
|
|
290
|
+
let start = new Date();
|
|
291
|
+
this.alert.nativeElement.addEventListener('mouseenter', () => {
|
|
292
|
+
clearTimeout(timer);
|
|
293
|
+
remaining -= new Date().getTime() - start.getTime();
|
|
294
|
+
}, false);
|
|
295
|
+
this.alert.nativeElement.addEventListener('mouseleave', () => {
|
|
296
|
+
start = new Date();
|
|
297
|
+
clearTimeout(timer);
|
|
298
|
+
timer = window.setTimeout(() => {
|
|
299
|
+
this.remove();
|
|
300
|
+
}, remaining);
|
|
301
|
+
}, false);
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
delete_animation = false;
|
|
306
|
+
remove() {
|
|
307
|
+
this.delete_animation = true;
|
|
308
|
+
setTimeout(() => {
|
|
309
|
+
this.close();
|
|
310
|
+
this.delete_animation = false;
|
|
311
|
+
}, 350);
|
|
312
|
+
}
|
|
313
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: AlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
314
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.0", type: AlertComponent, isStandalone: false, selector: "alert", viewQueries: [{ propertyName: "alert", first: true, predicate: ["alert"], descendants: true }], ngImport: i0, template: "<div\r\n\t*ngIf=\"text\"\r\n\t[ngClass]=\"class\"\r\n\tclass=\"waw-alert-container height\"\r\n\t[class._close]=\"delete_animation\"\r\n>\r\n\t<div\r\n\t\t[class.waw-alert-color-blue]=\"type == 'info'\"\r\n\t\t[class.waw-alert-color-red]=\"type == 'error'\"\r\n\t\t[class.waw-alert-color-green]=\"type == 'success'\"\r\n\t\t[class.waw-alert-color-orange]=\"type == 'warning'\"\r\n\t\t[class.waw-alert-color-yellow]=\"type == 'question'\"\r\n\t\tclass=\"waw-alert bounceInUp waw-alert-theme-light waw-alert-animateInside waw-alert-opened\"\r\n\t\t#alert\r\n\t>\r\n\t\t<div class=\"waw-alert__progress\" *ngIf=\"progress\">\r\n\t\t\t<span\r\n\t\t\t\t[ngStyle]=\"{\r\n\t\t\t\t\t'animation-duration': (timeout + 350) / 1000 + 's'\r\n\t\t\t\t}\"\r\n\t\t\t></span>\r\n\t\t</div>\r\n\t\t<div class=\"waw-alert-body\">\r\n\t\t\t<div *ngIf=\"!component\" class=\"waw-alert-texts\">\r\n\t\t\t\t<div *ngIf=\"icon\" class=\"{{ icon }}\"></div>\r\n\t\t\t\t<div class=\"waw-alert-message slideIn\">{{ text }}</div>\r\n\t\t\t</div>\r\n\t\t\t<div *ngIf=\"!component && type == 'question'\">\r\n\t\t\t\t<button\r\n\t\t\t\t\tclass=\"alert-btn\"\r\n\t\t\t\t\t*ngFor=\"let b of buttons\"\r\n\t\t\t\t\t(click)=\"remove(); b.callback && b.callback()\"\r\n\t\t\t\t>\r\n\t\t\t\t\t{{ b.text }}\r\n\t\t\t\t</button>\r\n\t\t\t</div>\r\n\t\t\t<div\r\n\t\t\t\tclass=\"waw-alert__close\"\r\n\t\t\t\t*ngIf=\"closable\"\r\n\t\t\t\t(click)=\"remove()\"\r\n\t\t\t></div>\r\n\t\t</div>\r\n\t</div>\r\n</div>\r\n", styles: ["@keyframes iziT-bounceInUp{0%{opacity:0;transform:translateY(200px)}50%{opacity:1;transform:translateY(-10px)}70%{transform:translateY(5px)}to{transform:translateY(0)}}@keyframes iziT-fadeIn{0%{opacity:0}to{opacity:1}}@keyframes iziT-fadeInUp{0%{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}to{opacity:1;-webkit-transform:none;transform:none}}@keyframes iziT-fadeInDown{0%{opacity:0;-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}to{opacity:1;-webkit-transform:none;transform:none}}@keyframes iziT-bounceInLeft{0%{opacity:0;transform:translate(280px)}50%{opacity:1;transform:translate(-20px)}70%{transform:translate(10px)}to{transform:translate(0)}}@keyframes iziT-bounceInDown{0%{opacity:0;transform:translateY(-200px)}50%{opacity:1;transform:translateY(10px)}70%{transform:translateY(-5px)}to{transform:translateY(0)}}.alert-wrapper{position:fixed;bottom:50px;left:0;width:100%;height:60px;overflow:hidden}.alert{display:flex;-webkit-box-align:center;align-items:center;width:auto;background:#3aed92;color:#fff;max-width:700px;margin:0 auto;transform:translateY(300px) scale(0);transition:.3s all ease-in-out}.alert._show{transform:translateY(0) scale(1);transition:.3s all ease-in-out}.alert-icon{min-width:60px;min-height:60px;position:relative;display:flex;justify-content:center;align-items:center;background-color:#2bd17d}.alert-icon:before{content:\"\";position:absolute;width:25px;height:25px;border-radius:50%;border:2px solid #fff}.alert-icon:after{content:\"\";position:absolute;top:22px;width:7px;height:11px;border:solid white;border-width:0 2px 2px 0;transform:rotate(45deg)}.alert-text{padding:0 20px;word-break:break-all;overflow:auto;height:60px}.alert-text .text-block{width:99%}.alert-text .text-block__text{text-overflow:ellipsis;overflow:hidden;white-space:pre}.alert-close{min-width:50px;margin-left:auto;font-size:25px;display:flex;justify-content:center;align-items:center}.font-bold{font-weight:700}.waw-alert__progress{bottom:0;position:absolute;width:100%;margin-bottom:0;border-radius:50px}.waw-alert__progress:hover span{animation-play-state:paused}.waw-alert__progress span{display:block;width:100%;height:2px;background-color:#a5a5a5ed;animation-name:waw-alert-progress;animation-duration:10s;border-radius:50px}.waw-alert__progress span._red{background-color:#ffafb4}.waw-alert__progress span._green{background-color:#a6efb8}.waw-alert__progress span._yellow{background-color:#fff9b2}.waw-alert__progress span._orange,.waw-alert__progress span._blue{background-color:#ffcfa5}.waw-alert__progress span._white{background-color:#fff}.waw-alert__progress span._black{background-color:#000}.waw-alert:hover .waw-alert__progress>span{animation-play-state:paused}.waw-alert__close{width:15px;height:15px;opacity:.3;position:relative;order:2}.waw-alert__close:hover{opacity:1}.waw-alert__close:before,.waw-alert__close:after{cursor:pointer;position:absolute;left:15px;content:\" \";height:12px;width:2px;background-color:#47525d}.waw-alert__close:before{transform:rotate(45deg)}.waw-alert__close:after{transform:rotate(-45deg)}@keyframes waw-alert-progress{0%{width:100%}to{width:0%}}.waw-alert-container{font-size:0;height:100px;width:100%;transform:translateZ(0);backface-visibility:hidden;transition:.3s all ease-in-out;opacity:1}.waw-alert-container._close{opacity:0;transition:.3s all ease-in-out}.waw-alert{display:inline-block;clear:both;position:relative;font-family:Lato,Tahoma,Arial;font-size:14px;padding:8px 25px 9px 0;background:#eeeeeee6;border-color:#eeeeeee6;width:100%;pointer-events:all;cursor:default;transform:translate(0);-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;min-height:54px}.waw-alert>.waw-alert-progressbar{position:absolute;left:0;bottom:0;width:100%;z-index:1;background:#fff3}.waw-alert>.waw-alert-progressbar>div{height:2px;width:100%;background:#0000004d;border-radius:0 0 3px 3px}.waw-alert>.waw-alert-close{position:absolute;right:0;top:0;border:0;padding:0;opacity:.6;width:42px;height:100%;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAJPAAACTwBcGfW0QAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAD3SURBVFiF1ZdtDoMgDEBfdi4PwAX8vLFn0qT7wxantojKupmQmCi8R4tSACpgjC2ICCUbEBa8ingjsU1AXRBeR8aLN64FiknswN8CYefBBDQ3whuFESy7WyQMeC0ipEI0A+0FeBvHUFN8xPaUhAH/iKoWsnXHGegy4J0yxialOfaHJAz4bhRzQzgDvdGnz4GbAonZbCQMuBm1K/kcFu8Mp1N2cFFpsxsMuJqqbIGExGl4loARajU1twskJLLhIsID7+tvUoDnIjTg5T9DPH9EBrz8rxjPzciAl9+O8SxI8CzJ8CxKFfh3ynK8Dyb8wNHM/XDqejx/AtNyPO87tNybAAAAAElFTkSuQmCC) no-repeat 50% 50%;background-size:8px;cursor:pointer;outline:none}.waw-alert>.waw-alert-close:hover{opacity:1}.waw-alert>.waw-alert-body{position:relative;padding:0 0 0 10px;height:auto;min-height:36px;margin:0 0 0 15px;text-align:left;display:flex;justify-content:space-between;align-items:center}.waw-alert>.waw-alert-body:after{content:\"\";display:table;clear:both}.waw-alert>.waw-alert-body .waw-alert-texts{margin:10px 0 0;padding-right:2px;display:inline-block;float:left;display:flex;justify-content:space-between;align-items:center}.waw-alert>.waw-alert-body .waw-alert-icon{height:100%;position:absolute;left:0;top:50%;display:table;font-size:23px;line-height:24px;margin-top:-12px;color:#000;width:24px;height:24px}.waw-alert>.waw-alert-body .waw-alert-title{padding:0;margin:0 10px 0 0;line-height:16px;font-size:14px;text-align:left;float:left;color:#000;white-space:normal;font-weight:700}.waw-alert>.waw-alert-body .waw-alert-message{padding:0;font-size:14px;line-height:16px;text-align:left;float:left;color:#0009;white-space:normal}@media only screen and (min-width: 568px){.waw-alert-wrapper{padding:10px 15px}.waw-alert{margin:5px;border-radius:3px;width:auto}.waw-alert:after{content:\"\";z-index:-1;position:absolute;top:0;left:0;width:100%;height:100%;border-radius:3px;box-shadow:inset 0 -10px 20px -10px #0003,inset 0 0 5px #0000001a,0 8px 8px -5px #00000040}.waw-alert:not(.waw-alert-rtl) .waw-alert-cover{border-radius:3px 0 0 3px}.waw-alert.waw-alert-rtl .waw-alert-cover{border-radius:0 3px 3px 0}.waw-alert.waw-alert-color-dark:after{box-shadow:inset 0 -10px 20px -10px #ffffff4d,0 10px 10px -5px #00000040}.waw-alert.waw-alert-balloon .waw-alert-progressbar{background:transparent}.waw-alert.waw-alert-balloon:after{box-shadow:0 10px 10px -5px #00000040,inset 0 10px 20px -5px #00000040}.waw-alert-target .waw-alert:after{box-shadow:inset 0 -10px 20px -10px #0003,inset 0 0 5px #0000001a}}.waw-alert.waw-alert-theme-dark{background:#565c70;border-color:#565c70}.waw-alert.waw-alert-theme-dark .waw-alert-title{color:#fff}.waw-alert.waw-alert-theme-dark .waw-alert-message{color:#ffffffb3;font-weight:300}.waw-alert.waw-alert-theme-dark .waw-alert-icon{color:#fff}.waw-alert.waw-alert-color-red{background:#ffafb4e6;border-color:#ffafb4e6}.waw-alert.waw-alert-color-orange{background:#ffcfa5e6;border-color:#ffcfa5e6}.waw-alert.waw-alert-color-yellow{background:#fff9b2e6;border-color:#fff9b2e6}.waw-alert.waw-alert-color-blue{background:#9ddeffe6;border-color:#9ddeffe6}.waw-alert.waw-alert-color-green{background:#a6efb8e6;border-color:#a6efb8e6}.waw-alert.slideIn,.waw-alert .slideIn{-webkit-animation:iziT-slideIn 1s cubic-bezier(.16,.81,.32,1) both;-moz-animation:iziT-slideIn 1s cubic-bezier(.16,.81,.32,1) both;animation:iziT-slideIn 1s cubic-bezier(.16,.81,.32,1) both}.waw-alert.bounceInLeft{-webkit-animation:iziT-bounceInLeft .7s ease-in-out both;animation:iziT-bounceInLeft .7s ease-in-out both}.waw-alert.bounceInRight{-webkit-animation:iziT-bounceInRight .85s ease-in-out both;animation:iziT-bounceInRight .85s ease-in-out both}.waw-alert.bounceInDown{-webkit-animation:iziT-bounceInDown .7s ease-in-out both;animation:iziT-bounceInDown .7s ease-in-out both}.waw-alert.bounceInUp{-webkit-animation:iziT-bounceInUp .7s ease-in-out both;animation:iziT-bounceInUp .7s ease-in-out both}.height{height:auto!important}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
315
|
+
}
|
|
316
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: AlertComponent, decorators: [{
|
|
317
|
+
type: Component,
|
|
318
|
+
args: [{ selector: 'alert', standalone: false, template: "<div\r\n\t*ngIf=\"text\"\r\n\t[ngClass]=\"class\"\r\n\tclass=\"waw-alert-container height\"\r\n\t[class._close]=\"delete_animation\"\r\n>\r\n\t<div\r\n\t\t[class.waw-alert-color-blue]=\"type == 'info'\"\r\n\t\t[class.waw-alert-color-red]=\"type == 'error'\"\r\n\t\t[class.waw-alert-color-green]=\"type == 'success'\"\r\n\t\t[class.waw-alert-color-orange]=\"type == 'warning'\"\r\n\t\t[class.waw-alert-color-yellow]=\"type == 'question'\"\r\n\t\tclass=\"waw-alert bounceInUp waw-alert-theme-light waw-alert-animateInside waw-alert-opened\"\r\n\t\t#alert\r\n\t>\r\n\t\t<div class=\"waw-alert__progress\" *ngIf=\"progress\">\r\n\t\t\t<span\r\n\t\t\t\t[ngStyle]=\"{\r\n\t\t\t\t\t'animation-duration': (timeout + 350) / 1000 + 's'\r\n\t\t\t\t}\"\r\n\t\t\t></span>\r\n\t\t</div>\r\n\t\t<div class=\"waw-alert-body\">\r\n\t\t\t<div *ngIf=\"!component\" class=\"waw-alert-texts\">\r\n\t\t\t\t<div *ngIf=\"icon\" class=\"{{ icon }}\"></div>\r\n\t\t\t\t<div class=\"waw-alert-message slideIn\">{{ text }}</div>\r\n\t\t\t</div>\r\n\t\t\t<div *ngIf=\"!component && type == 'question'\">\r\n\t\t\t\t<button\r\n\t\t\t\t\tclass=\"alert-btn\"\r\n\t\t\t\t\t*ngFor=\"let b of buttons\"\r\n\t\t\t\t\t(click)=\"remove(); b.callback && b.callback()\"\r\n\t\t\t\t>\r\n\t\t\t\t\t{{ b.text }}\r\n\t\t\t\t</button>\r\n\t\t\t</div>\r\n\t\t\t<div\r\n\t\t\t\tclass=\"waw-alert__close\"\r\n\t\t\t\t*ngIf=\"closable\"\r\n\t\t\t\t(click)=\"remove()\"\r\n\t\t\t></div>\r\n\t\t</div>\r\n\t</div>\r\n</div>\r\n", styles: ["@keyframes iziT-bounceInUp{0%{opacity:0;transform:translateY(200px)}50%{opacity:1;transform:translateY(-10px)}70%{transform:translateY(5px)}to{transform:translateY(0)}}@keyframes iziT-fadeIn{0%{opacity:0}to{opacity:1}}@keyframes iziT-fadeInUp{0%{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}to{opacity:1;-webkit-transform:none;transform:none}}@keyframes iziT-fadeInDown{0%{opacity:0;-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}to{opacity:1;-webkit-transform:none;transform:none}}@keyframes iziT-bounceInLeft{0%{opacity:0;transform:translate(280px)}50%{opacity:1;transform:translate(-20px)}70%{transform:translate(10px)}to{transform:translate(0)}}@keyframes iziT-bounceInDown{0%{opacity:0;transform:translateY(-200px)}50%{opacity:1;transform:translateY(10px)}70%{transform:translateY(-5px)}to{transform:translateY(0)}}.alert-wrapper{position:fixed;bottom:50px;left:0;width:100%;height:60px;overflow:hidden}.alert{display:flex;-webkit-box-align:center;align-items:center;width:auto;background:#3aed92;color:#fff;max-width:700px;margin:0 auto;transform:translateY(300px) scale(0);transition:.3s all ease-in-out}.alert._show{transform:translateY(0) scale(1);transition:.3s all ease-in-out}.alert-icon{min-width:60px;min-height:60px;position:relative;display:flex;justify-content:center;align-items:center;background-color:#2bd17d}.alert-icon:before{content:\"\";position:absolute;width:25px;height:25px;border-radius:50%;border:2px solid #fff}.alert-icon:after{content:\"\";position:absolute;top:22px;width:7px;height:11px;border:solid white;border-width:0 2px 2px 0;transform:rotate(45deg)}.alert-text{padding:0 20px;word-break:break-all;overflow:auto;height:60px}.alert-text .text-block{width:99%}.alert-text .text-block__text{text-overflow:ellipsis;overflow:hidden;white-space:pre}.alert-close{min-width:50px;margin-left:auto;font-size:25px;display:flex;justify-content:center;align-items:center}.font-bold{font-weight:700}.waw-alert__progress{bottom:0;position:absolute;width:100%;margin-bottom:0;border-radius:50px}.waw-alert__progress:hover span{animation-play-state:paused}.waw-alert__progress span{display:block;width:100%;height:2px;background-color:#a5a5a5ed;animation-name:waw-alert-progress;animation-duration:10s;border-radius:50px}.waw-alert__progress span._red{background-color:#ffafb4}.waw-alert__progress span._green{background-color:#a6efb8}.waw-alert__progress span._yellow{background-color:#fff9b2}.waw-alert__progress span._orange,.waw-alert__progress span._blue{background-color:#ffcfa5}.waw-alert__progress span._white{background-color:#fff}.waw-alert__progress span._black{background-color:#000}.waw-alert:hover .waw-alert__progress>span{animation-play-state:paused}.waw-alert__close{width:15px;height:15px;opacity:.3;position:relative;order:2}.waw-alert__close:hover{opacity:1}.waw-alert__close:before,.waw-alert__close:after{cursor:pointer;position:absolute;left:15px;content:\" \";height:12px;width:2px;background-color:#47525d}.waw-alert__close:before{transform:rotate(45deg)}.waw-alert__close:after{transform:rotate(-45deg)}@keyframes waw-alert-progress{0%{width:100%}to{width:0%}}.waw-alert-container{font-size:0;height:100px;width:100%;transform:translateZ(0);backface-visibility:hidden;transition:.3s all ease-in-out;opacity:1}.waw-alert-container._close{opacity:0;transition:.3s all ease-in-out}.waw-alert{display:inline-block;clear:both;position:relative;font-family:Lato,Tahoma,Arial;font-size:14px;padding:8px 25px 9px 0;background:#eeeeeee6;border-color:#eeeeeee6;width:100%;pointer-events:all;cursor:default;transform:translate(0);-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;min-height:54px}.waw-alert>.waw-alert-progressbar{position:absolute;left:0;bottom:0;width:100%;z-index:1;background:#fff3}.waw-alert>.waw-alert-progressbar>div{height:2px;width:100%;background:#0000004d;border-radius:0 0 3px 3px}.waw-alert>.waw-alert-close{position:absolute;right:0;top:0;border:0;padding:0;opacity:.6;width:42px;height:100%;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAJPAAACTwBcGfW0QAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAD3SURBVFiF1ZdtDoMgDEBfdi4PwAX8vLFn0qT7wxantojKupmQmCi8R4tSACpgjC2ICCUbEBa8ingjsU1AXRBeR8aLN64FiknswN8CYefBBDQ3whuFESy7WyQMeC0ipEI0A+0FeBvHUFN8xPaUhAH/iKoWsnXHGegy4J0yxialOfaHJAz4bhRzQzgDvdGnz4GbAonZbCQMuBm1K/kcFu8Mp1N2cFFpsxsMuJqqbIGExGl4loARajU1twskJLLhIsID7+tvUoDnIjTg5T9DPH9EBrz8rxjPzciAl9+O8SxI8CzJ8CxKFfh3ynK8Dyb8wNHM/XDqejx/AtNyPO87tNybAAAAAElFTkSuQmCC) no-repeat 50% 50%;background-size:8px;cursor:pointer;outline:none}.waw-alert>.waw-alert-close:hover{opacity:1}.waw-alert>.waw-alert-body{position:relative;padding:0 0 0 10px;height:auto;min-height:36px;margin:0 0 0 15px;text-align:left;display:flex;justify-content:space-between;align-items:center}.waw-alert>.waw-alert-body:after{content:\"\";display:table;clear:both}.waw-alert>.waw-alert-body .waw-alert-texts{margin:10px 0 0;padding-right:2px;display:inline-block;float:left;display:flex;justify-content:space-between;align-items:center}.waw-alert>.waw-alert-body .waw-alert-icon{height:100%;position:absolute;left:0;top:50%;display:table;font-size:23px;line-height:24px;margin-top:-12px;color:#000;width:24px;height:24px}.waw-alert>.waw-alert-body .waw-alert-title{padding:0;margin:0 10px 0 0;line-height:16px;font-size:14px;text-align:left;float:left;color:#000;white-space:normal;font-weight:700}.waw-alert>.waw-alert-body .waw-alert-message{padding:0;font-size:14px;line-height:16px;text-align:left;float:left;color:#0009;white-space:normal}@media only screen and (min-width: 568px){.waw-alert-wrapper{padding:10px 15px}.waw-alert{margin:5px;border-radius:3px;width:auto}.waw-alert:after{content:\"\";z-index:-1;position:absolute;top:0;left:0;width:100%;height:100%;border-radius:3px;box-shadow:inset 0 -10px 20px -10px #0003,inset 0 0 5px #0000001a,0 8px 8px -5px #00000040}.waw-alert:not(.waw-alert-rtl) .waw-alert-cover{border-radius:3px 0 0 3px}.waw-alert.waw-alert-rtl .waw-alert-cover{border-radius:0 3px 3px 0}.waw-alert.waw-alert-color-dark:after{box-shadow:inset 0 -10px 20px -10px #ffffff4d,0 10px 10px -5px #00000040}.waw-alert.waw-alert-balloon .waw-alert-progressbar{background:transparent}.waw-alert.waw-alert-balloon:after{box-shadow:0 10px 10px -5px #00000040,inset 0 10px 20px -5px #00000040}.waw-alert-target .waw-alert:after{box-shadow:inset 0 -10px 20px -10px #0003,inset 0 0 5px #0000001a}}.waw-alert.waw-alert-theme-dark{background:#565c70;border-color:#565c70}.waw-alert.waw-alert-theme-dark .waw-alert-title{color:#fff}.waw-alert.waw-alert-theme-dark .waw-alert-message{color:#ffffffb3;font-weight:300}.waw-alert.waw-alert-theme-dark .waw-alert-icon{color:#fff}.waw-alert.waw-alert-color-red{background:#ffafb4e6;border-color:#ffafb4e6}.waw-alert.waw-alert-color-orange{background:#ffcfa5e6;border-color:#ffcfa5e6}.waw-alert.waw-alert-color-yellow{background:#fff9b2e6;border-color:#fff9b2e6}.waw-alert.waw-alert-color-blue{background:#9ddeffe6;border-color:#9ddeffe6}.waw-alert.waw-alert-color-green{background:#a6efb8e6;border-color:#a6efb8e6}.waw-alert.slideIn,.waw-alert .slideIn{-webkit-animation:iziT-slideIn 1s cubic-bezier(.16,.81,.32,1) both;-moz-animation:iziT-slideIn 1s cubic-bezier(.16,.81,.32,1) both;animation:iziT-slideIn 1s cubic-bezier(.16,.81,.32,1) both}.waw-alert.bounceInLeft{-webkit-animation:iziT-bounceInLeft .7s ease-in-out both;animation:iziT-bounceInLeft .7s ease-in-out both}.waw-alert.bounceInRight{-webkit-animation:iziT-bounceInRight .85s ease-in-out both;animation:iziT-bounceInRight .85s ease-in-out both}.waw-alert.bounceInDown{-webkit-animation:iziT-bounceInDown .7s ease-in-out both;animation:iziT-bounceInDown .7s ease-in-out both}.waw-alert.bounceInUp{-webkit-animation:iziT-bounceInUp .7s ease-in-out both;animation:iziT-bounceInUp .7s ease-in-out both}.height{height:auto!important}\n"] }]
|
|
319
|
+
}], ctorParameters: () => [], propDecorators: { alert: [{
|
|
320
|
+
type: ViewChild,
|
|
321
|
+
args: ['alert', { static: false }]
|
|
322
|
+
}] } });
|
|
323
|
+
|
|
324
|
+
class ModalComponent {
|
|
325
|
+
class = '';
|
|
326
|
+
size = 'flex';
|
|
327
|
+
closable = true;
|
|
328
|
+
close;
|
|
329
|
+
onOpen;
|
|
330
|
+
timestart;
|
|
331
|
+
timeout;
|
|
332
|
+
showModal = false;
|
|
333
|
+
allowClose = true;
|
|
334
|
+
onClickOutside;
|
|
335
|
+
ngOnInit() {
|
|
336
|
+
if (typeof this.onClickOutside !== 'function') {
|
|
337
|
+
this.onClickOutside = this.close;
|
|
338
|
+
// this.onClickOutside = () => {
|
|
339
|
+
// if (this.allowClose) {
|
|
340
|
+
// this.close();
|
|
341
|
+
// }
|
|
342
|
+
// this.allowClose = true;
|
|
343
|
+
// };
|
|
344
|
+
}
|
|
345
|
+
if (typeof this.onOpen == 'function')
|
|
346
|
+
this.onOpen();
|
|
347
|
+
window.addEventListener('popstate', this.popStateListener.bind(this));
|
|
348
|
+
}
|
|
349
|
+
ngAfterViewInit() {
|
|
350
|
+
setTimeout(() => {
|
|
351
|
+
this.showModal = true;
|
|
352
|
+
}, this.timestart || 0);
|
|
353
|
+
}
|
|
354
|
+
ngOnDestroy() {
|
|
355
|
+
window.removeEventListener('popstate', this.popStateListener.bind(this));
|
|
356
|
+
}
|
|
357
|
+
popStateListener(e) {
|
|
358
|
+
this.close();
|
|
359
|
+
}
|
|
360
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
361
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.0", type: ModalComponent, isStandalone: false, selector: "lib-modal", ngImport: i0, template: "<div\r\n\t[hidden]=\"!showModal\"\r\n\tclass=\"modal\"\r\n\t[ngClass]=\"class + ' ' + size\"\r\n\t(click)=\"onClickOutside()\"\r\n>\r\n\t<!-- (click)=\"$event.stopPropagation()\" -->\r\n\t<!-- <div class=\"modal-content\" (mousedown)=\"allowClose = false\"> -->\r\n\t<div class=\"modal-content\" (click)=\"$event.stopPropagation()\">\r\n\t\t<div><!-- Content Will Drop Here --></div>\r\n\t\t<span class=\"close\" (click)=\"close()\" *ngIf=\"closable\">×</span>\r\n\t</div>\r\n</div>\r\n", styles: [".modal{position:fixed;z-index:9999;left:0;top:0;width:100%;height:100%;overflow-y:auto;background-color:#000;background-color:#00000080}.modal-content{position:relative;background-color:#fff;margin:15% auto;padding:20px;border:1px solid #888;min-width:20%;max-width:80%}.close{color:#aaa;position:absolute;right:10px;top:3px;font-size:32px;line-height:1}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
362
|
+
}
|
|
363
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ModalComponent, decorators: [{
|
|
364
|
+
type: Component,
|
|
365
|
+
args: [{ selector: 'lib-modal', standalone: false, template: "<div\r\n\t[hidden]=\"!showModal\"\r\n\tclass=\"modal\"\r\n\t[ngClass]=\"class + ' ' + size\"\r\n\t(click)=\"onClickOutside()\"\r\n>\r\n\t<!-- (click)=\"$event.stopPropagation()\" -->\r\n\t<!-- <div class=\"modal-content\" (mousedown)=\"allowClose = false\"> -->\r\n\t<div class=\"modal-content\" (click)=\"$event.stopPropagation()\">\r\n\t\t<div><!-- Content Will Drop Here --></div>\r\n\t\t<span class=\"close\" (click)=\"close()\" *ngIf=\"closable\">×</span>\r\n\t</div>\r\n</div>\r\n", styles: [".modal{position:fixed;z-index:9999;left:0;top:0;width:100%;height:100%;overflow-y:auto;background-color:#000;background-color:#00000080}.modal-content{position:relative;background-color:#fff;margin:15% auto;padding:20px;border:1px solid #888;min-width:20%;max-width:80%}.close{color:#aaa;position:absolute;right:10px;top:3px;font-size:32px;line-height:1}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer}\n"] }]
|
|
366
|
+
}] });
|
|
367
|
+
|
|
368
|
+
class LoaderComponent {
|
|
369
|
+
loader;
|
|
370
|
+
text = 'Loading';
|
|
371
|
+
class = '';
|
|
372
|
+
progress = true;
|
|
373
|
+
timeout = 5000;
|
|
374
|
+
close;
|
|
375
|
+
closable = true;
|
|
376
|
+
constructor() { }
|
|
377
|
+
ngOnInit() {
|
|
378
|
+
if (this.timeout) {
|
|
379
|
+
setTimeout(() => {
|
|
380
|
+
this.close();
|
|
381
|
+
}, this.timeout);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: LoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
385
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.0", type: LoaderComponent, isStandalone: false, selector: "lib-loader", viewQueries: [{ propertyName: "loader", first: true, predicate: ["loader"], descendants: true }], ngImport: i0, template: "<div\r\n\tstyle=\"\r\n\t\tposition: fixed;\r\n\t\twidth: 100%;\r\n\t\theight: 100%;\r\n\t\tleft: 0;\r\n\t\ttop: 0;\r\n\t\tbackground-color: #334d6e;\r\n\t\tdisplay: flex;\r\n\t\tjustify-content: center;\r\n\t\talign-items: center;\r\n\t\tz-index: 999999;\r\n\t\"\r\n\t#loader\r\n>\r\n\t<span class=\"close\" (click)=\"close()\" *ngIf=\"closable\">×</span>\r\n\t<span style=\"font-size: 30px; color: white\">\r\n\t\t{{ text }}\r\n\t</span>\r\n</div>\r\n", styles: [".close{color:#aaa;position:absolute;right:20px;top:20px;font-size:32px;line-height:1}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
386
|
+
}
|
|
387
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: LoaderComponent, decorators: [{
|
|
388
|
+
type: Component,
|
|
389
|
+
args: [{ selector: 'lib-loader', standalone: false, template: "<div\r\n\tstyle=\"\r\n\t\tposition: fixed;\r\n\t\twidth: 100%;\r\n\t\theight: 100%;\r\n\t\tleft: 0;\r\n\t\ttop: 0;\r\n\t\tbackground-color: #334d6e;\r\n\t\tdisplay: flex;\r\n\t\tjustify-content: center;\r\n\t\talign-items: center;\r\n\t\tz-index: 999999;\r\n\t\"\r\n\t#loader\r\n>\r\n\t<span class=\"close\" (click)=\"close()\" *ngIf=\"closable\">×</span>\r\n\t<span style=\"font-size: 30px; color: white\">\r\n\t\t{{ text }}\r\n\t</span>\r\n</div>\r\n", styles: [".close{color:#aaa;position:absolute;right:20px;top:20px;font-size:32px;line-height:1}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer}\n"] }]
|
|
390
|
+
}], ctorParameters: () => [], propDecorators: { loader: [{
|
|
391
|
+
type: ViewChild,
|
|
392
|
+
args: ['loader', { static: false }]
|
|
393
|
+
}] } });
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* BaseComponent is an abstract class that provides basic functionality for managing the current timestamp.
|
|
397
|
+
*/
|
|
398
|
+
class BaseComponent {
|
|
399
|
+
/**
|
|
400
|
+
* The current timestamp in milliseconds since the Unix epoch.
|
|
401
|
+
*/
|
|
402
|
+
now = new Date().getTime();
|
|
403
|
+
/**
|
|
404
|
+
* Refreshes the `now` property with the current timestamp.
|
|
405
|
+
*/
|
|
406
|
+
refreshNow() {
|
|
407
|
+
this.now = new Date().getTime();
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
52
411
|
// Add capitalize method to String prototype if it doesn't already exist
|
|
53
412
|
if (!String.prototype.capitalize) {
|
|
54
413
|
String.prototype.capitalize = function () {
|
|
@@ -64,48 +423,9 @@ class CoreService {
|
|
|
64
423
|
(typeof crypto?.randomUUID === 'function'
|
|
65
424
|
? crypto.randomUUID()
|
|
66
425
|
: this.UUID());
|
|
67
|
-
ssr = false;
|
|
68
|
-
localStorage; // = localStorage;
|
|
69
|
-
navigator; // = navigator;
|
|
70
|
-
document; // = document;
|
|
71
|
-
window; // = window;
|
|
72
426
|
constructor(platformId) {
|
|
73
427
|
this.platformId = platformId;
|
|
74
428
|
localStorage.setItem('deviceID', this.deviceID);
|
|
75
|
-
this.ssr = isPlatformServer(this.platformId);
|
|
76
|
-
if (isPlatformServer(this.platformId)) {
|
|
77
|
-
this.localStorage = {
|
|
78
|
-
getItem: () => { },
|
|
79
|
-
setItem: () => { },
|
|
80
|
-
removeItem: () => { },
|
|
81
|
-
clear: () => { },
|
|
82
|
-
};
|
|
83
|
-
this.document = {
|
|
84
|
-
querySelectorAll: () => { },
|
|
85
|
-
addEventListener: () => { },
|
|
86
|
-
removeEventListener: () => { },
|
|
87
|
-
documentElement: {},
|
|
88
|
-
body: {},
|
|
89
|
-
};
|
|
90
|
-
this.window = {
|
|
91
|
-
location: {
|
|
92
|
-
host: '',
|
|
93
|
-
},
|
|
94
|
-
addEventListener: () => { },
|
|
95
|
-
removeEventListener: () => { },
|
|
96
|
-
setTimeout: () => { },
|
|
97
|
-
};
|
|
98
|
-
this.navigator = {
|
|
99
|
-
userAgent: '',
|
|
100
|
-
platform: '',
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
this.localStorage = localStorage;
|
|
105
|
-
this.document = document;
|
|
106
|
-
this.window = window;
|
|
107
|
-
this.navigator = navigator;
|
|
108
|
-
}
|
|
109
429
|
this.detectDevice();
|
|
110
430
|
}
|
|
111
431
|
/**
|
|
@@ -210,12 +530,12 @@ class CoreService {
|
|
|
210
530
|
if (typeof cb === 'function' && typeof time === 'number') {
|
|
211
531
|
if (typeof doc === 'string') {
|
|
212
532
|
clearTimeout(this._afterWhile[doc]);
|
|
213
|
-
this._afterWhile[doc] =
|
|
533
|
+
this._afterWhile[doc] = window.setTimeout(cb, time);
|
|
214
534
|
}
|
|
215
535
|
else if (typeof doc === 'object') {
|
|
216
536
|
clearTimeout(doc.__afterWhile);
|
|
217
537
|
doc.__afterWhile =
|
|
218
|
-
|
|
538
|
+
window.setTimeout(cb, time);
|
|
219
539
|
}
|
|
220
540
|
else {
|
|
221
541
|
console.warn('badly configured after while');
|
|
@@ -254,9 +574,7 @@ class CoreService {
|
|
|
254
574
|
* Detects the device type based on the user agent.
|
|
255
575
|
*/
|
|
256
576
|
detectDevice() {
|
|
257
|
-
const userAgent =
|
|
258
|
-
this.navigator.vendor ||
|
|
259
|
-
this.window.opera;
|
|
577
|
+
const userAgent = navigator.userAgent || navigator.vendor || window.opera;
|
|
260
578
|
if (/windows phone/i.test(userAgent)) {
|
|
261
579
|
this.device = 'Windows Phone';
|
|
262
580
|
}
|
|
@@ -264,7 +582,7 @@ class CoreService {
|
|
|
264
582
|
this.device = 'Android';
|
|
265
583
|
}
|
|
266
584
|
else if (/iPad|iPhone|iPod/.test(userAgent) &&
|
|
267
|
-
!
|
|
585
|
+
!window.MSStream) {
|
|
268
586
|
this.device = 'iOS';
|
|
269
587
|
}
|
|
270
588
|
else {
|
|
@@ -432,436 +750,178 @@ class CoreService {
|
|
|
432
750
|
* @param which - The resource to lock, identified by a string.
|
|
433
751
|
*/
|
|
434
752
|
lock(which) {
|
|
435
|
-
this._locked[which] = true;
|
|
436
|
-
if (!this._unlockResolvers[which]) {
|
|
437
|
-
this._unlockResolvers[which] = [];
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
/**
|
|
441
|
-
* Unlocks a resource, allowing access.
|
|
442
|
-
* @param which - The resource to unlock, identified by a string.
|
|
443
|
-
*/
|
|
444
|
-
unlock(which) {
|
|
445
|
-
this._locked[which] = false;
|
|
446
|
-
if (this._unlockResolvers[which]) {
|
|
447
|
-
this._unlockResolvers[which].forEach((resolve) => resolve());
|
|
448
|
-
this._unlockResolvers[which] = [];
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
/**
|
|
452
|
-
* Returns a Promise that resolves when the specified resource is unlocked.
|
|
453
|
-
* @param which - The resource to watch for unlocking, identified by a string.
|
|
454
|
-
* @returns A Promise that resolves when the resource is unlocked.
|
|
455
|
-
*/
|
|
456
|
-
onUnlock(which) {
|
|
457
|
-
if (!this._locked[which]) {
|
|
458
|
-
return Promise.resolve();
|
|
459
|
-
}
|
|
460
|
-
return new Promise((resolve) => {
|
|
461
|
-
if (!this._unlockResolvers[which]) {
|
|
462
|
-
this._unlockResolvers[which] = [];
|
|
463
|
-
}
|
|
464
|
-
this._unlockResolvers[which].push(resolve);
|
|
465
|
-
});
|
|
466
|
-
}
|
|
467
|
-
/**
|
|
468
|
-
* Checks if a resource is locked.
|
|
469
|
-
* @param which - The resource to check, identified by a string.
|
|
470
|
-
* @returns True if the resource is locked, false otherwise.
|
|
471
|
-
*/
|
|
472
|
-
locked(which) {
|
|
473
|
-
return !!this._locked[which];
|
|
474
|
-
}
|
|
475
|
-
// Linking management
|
|
476
|
-
linkCollections = [];
|
|
477
|
-
linkRealCollectionName = {};
|
|
478
|
-
linkIds = {};
|
|
479
|
-
addLink(name, reset, realName = '') {
|
|
480
|
-
this.linkCollections.push(name);
|
|
481
|
-
this.linkRealCollectionName[name] = realName || name;
|
|
482
|
-
this.onComplete(name.toLowerCase() + '_loaded').then(() => {
|
|
483
|
-
this.linkIds[name] = reset();
|
|
484
|
-
});
|
|
485
|
-
this.on(name.toLowerCase() + '_changed').subscribe(() => {
|
|
486
|
-
this.linkIds[name].splice(0, this.linkIds[name].length);
|
|
487
|
-
this.linkIds[name].push(...reset());
|
|
488
|
-
});
|
|
489
|
-
}
|
|
490
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CoreService, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
491
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CoreService, providedIn: 'root' });
|
|
492
|
-
}
|
|
493
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CoreService, decorators: [{
|
|
494
|
-
type: Injectable,
|
|
495
|
-
args: [{
|
|
496
|
-
providedIn: 'root',
|
|
497
|
-
}]
|
|
498
|
-
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
499
|
-
type: Inject,
|
|
500
|
-
args: [PLATFORM_ID]
|
|
501
|
-
}] }] });
|
|
502
|
-
|
|
503
|
-
const isDefined = (val) => typeof val !== 'undefined';
|
|
504
|
-
class MetaService {
|
|
505
|
-
router;
|
|
506
|
-
meta;
|
|
507
|
-
core;
|
|
508
|
-
titleService;
|
|
509
|
-
config;
|
|
510
|
-
_meta;
|
|
511
|
-
constructor(router, meta, core, titleService, config) {
|
|
512
|
-
this.router = router;
|
|
513
|
-
this.meta = meta;
|
|
514
|
-
this.core = core;
|
|
515
|
-
this.titleService = titleService;
|
|
516
|
-
this.config = config;
|
|
517
|
-
this.config = this.config || DEFAULT_CONFIG;
|
|
518
|
-
this._meta = this.config.meta || {};
|
|
519
|
-
this._warnMissingGuard();
|
|
520
|
-
}
|
|
521
|
-
/**
|
|
522
|
-
* Sets the default meta tags.
|
|
523
|
-
*
|
|
524
|
-
* @param defaults - The default meta tags.
|
|
525
|
-
*/
|
|
526
|
-
setDefaults(defaults) {
|
|
527
|
-
this._meta.defaults = defaults;
|
|
528
|
-
}
|
|
529
|
-
/**
|
|
530
|
-
* Sets the title and optional title suffix.
|
|
531
|
-
*
|
|
532
|
-
* @param title - The title to set.
|
|
533
|
-
* @param titleSuffix - The title suffix to append.
|
|
534
|
-
* @returns The MetaService instance.
|
|
535
|
-
*/
|
|
536
|
-
setTitle(title, titleSuffix) {
|
|
537
|
-
let titleContent = isDefined(title)
|
|
538
|
-
? title
|
|
539
|
-
: this._meta.defaults['title'] || '';
|
|
540
|
-
if (this._meta.useTitleSuffix) {
|
|
541
|
-
titleContent += isDefined(titleSuffix)
|
|
542
|
-
? titleSuffix
|
|
543
|
-
: this._meta.defaults['titleSuffix'] || '';
|
|
544
|
-
}
|
|
545
|
-
this._updateMetaTag('title', titleContent);
|
|
546
|
-
this._updateMetaTag('og:title', titleContent);
|
|
547
|
-
this.titleService.setTitle(titleContent);
|
|
548
|
-
return this;
|
|
549
|
-
}
|
|
550
|
-
/**
|
|
551
|
-
* Sets link tags.
|
|
552
|
-
*
|
|
553
|
-
* @param links - The links to set.
|
|
554
|
-
* @returns The MetaService instance.
|
|
555
|
-
*/
|
|
556
|
-
setLink(links) {
|
|
557
|
-
Object.keys(links).forEach((rel) => {
|
|
558
|
-
let link = this.core.document.createElement('link');
|
|
559
|
-
link.setAttribute('rel', rel);
|
|
560
|
-
link.setAttribute('href', links[rel]);
|
|
561
|
-
this.core.document.head.appendChild(link);
|
|
562
|
-
});
|
|
563
|
-
return this;
|
|
564
|
-
}
|
|
565
|
-
/**
|
|
566
|
-
* Sets a meta tag.
|
|
567
|
-
*
|
|
568
|
-
* @param tag - The meta tag name.
|
|
569
|
-
* @param value - The meta tag value.
|
|
570
|
-
* @param prop - The meta tag property.
|
|
571
|
-
* @returns The MetaService instance.
|
|
572
|
-
*/
|
|
573
|
-
setTag(tag, value, prop) {
|
|
574
|
-
if (tag === 'title' || tag === 'titleSuffix') {
|
|
575
|
-
throw new Error(`Attempt to set ${tag} through 'setTag': 'title' and 'titleSuffix' are reserved tag names. Please use 'MetaService.setTitle' instead`);
|
|
576
|
-
}
|
|
577
|
-
const content = isDefined(value)
|
|
578
|
-
? value
|
|
579
|
-
: this._meta.defaults[tag] || '';
|
|
580
|
-
this._updateMetaTag(tag, content, prop);
|
|
581
|
-
if (tag === 'description') {
|
|
582
|
-
this._updateMetaTag('og:description', content, prop);
|
|
583
|
-
this._updateMetaTag('twitter:description', content, prop);
|
|
584
|
-
}
|
|
585
|
-
return this;
|
|
586
|
-
}
|
|
587
|
-
/**
|
|
588
|
-
* Updates a meta tag.
|
|
589
|
-
*
|
|
590
|
-
* @param tag - The meta tag name.
|
|
591
|
-
* @param value - The meta tag value.
|
|
592
|
-
* @param prop - The meta tag property.
|
|
593
|
-
*/
|
|
594
|
-
_updateMetaTag(tag, value, prop) {
|
|
595
|
-
prop =
|
|
596
|
-
prop ||
|
|
597
|
-
(tag.startsWith('og:') || tag.startsWith('twitter:')
|
|
598
|
-
? 'property'
|
|
599
|
-
: 'name');
|
|
600
|
-
this.meta.updateTag({ [prop]: tag, content: value });
|
|
601
|
-
}
|
|
602
|
-
/**
|
|
603
|
-
* Removes a meta tag.
|
|
604
|
-
*
|
|
605
|
-
* @param tag - The meta tag name.
|
|
606
|
-
* @param prop - The meta tag property.
|
|
607
|
-
*/
|
|
608
|
-
removeTag(tag, prop) {
|
|
609
|
-
prop =
|
|
610
|
-
prop ||
|
|
611
|
-
(tag.startsWith('og:') || tag.startsWith('twitter:')
|
|
612
|
-
? 'property'
|
|
613
|
-
: 'name');
|
|
614
|
-
this.meta.removeTag(`${prop}="${tag}"`);
|
|
615
|
-
}
|
|
616
|
-
/**
|
|
617
|
-
* Warns about missing meta guards in routes.
|
|
618
|
-
*/
|
|
619
|
-
_warnMissingGuard() {
|
|
620
|
-
if (isDefined(this._meta.warnMissingGuard) &&
|
|
621
|
-
!this._meta.warnMissingGuard) {
|
|
622
|
-
return;
|
|
623
|
-
}
|
|
624
|
-
const hasDefaultMeta = !!Object.keys(this._meta.defaults).length;
|
|
625
|
-
const hasMetaGuardInArr = (it) => it && it.IDENTIFIER === 'MetaGuard';
|
|
626
|
-
let hasShownWarnings = false;
|
|
627
|
-
this.router.config.forEach((route) => {
|
|
628
|
-
const hasRouteMeta = route.data && route.data['meta'];
|
|
629
|
-
const showWarning = !isDefined(route.redirectTo) &&
|
|
630
|
-
(hasDefaultMeta || hasRouteMeta) &&
|
|
631
|
-
!(route.canActivate || []).some(hasMetaGuardInArr);
|
|
632
|
-
if (showWarning) {
|
|
633
|
-
console.warn(`Route with path "${route.path}" has ${hasRouteMeta ? '' : 'default '}meta tags, but does not use MetaGuard. Please add MetaGuard to the canActivate array in your route configuration`);
|
|
634
|
-
hasShownWarnings = true;
|
|
635
|
-
}
|
|
636
|
-
});
|
|
637
|
-
if (hasShownWarnings) {
|
|
638
|
-
console.warn(`To disable these warnings, set metaConfig.warnMissingGuard: false in your MetaConfig passed to MetaModule.forRoot()`);
|
|
639
|
-
}
|
|
640
|
-
}
|
|
641
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: MetaService, deps: [{ token: i1.Router }, { token: i2.Meta }, { token: CoreService }, { token: i2.Title }, { token: CONFIG_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
642
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: MetaService, providedIn: 'root' });
|
|
643
|
-
}
|
|
644
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: MetaService, decorators: [{
|
|
645
|
-
type: Injectable,
|
|
646
|
-
args: [{
|
|
647
|
-
providedIn: 'root',
|
|
648
|
-
}]
|
|
649
|
-
}], ctorParameters: () => [{ type: i1.Router }, { type: i2.Meta }, { type: CoreService }, { type: i2.Title }, { type: undefined, decorators: [{
|
|
650
|
-
type: Inject,
|
|
651
|
-
args: [CONFIG_TOKEN]
|
|
652
|
-
}, {
|
|
653
|
-
type: Optional
|
|
654
|
-
}] }] });
|
|
655
|
-
|
|
656
|
-
class MetaGuard {
|
|
657
|
-
metaService;
|
|
658
|
-
config;
|
|
659
|
-
static IDENTIFIER = 'MetaGuard';
|
|
660
|
-
_meta;
|
|
661
|
-
constructor(metaService, config) {
|
|
662
|
-
this.metaService = metaService;
|
|
663
|
-
this.config = config;
|
|
664
|
-
this._meta = config.meta;
|
|
665
|
-
if (!this.config)
|
|
666
|
-
this.config = DEFAULT_CONFIG;
|
|
667
|
-
}
|
|
668
|
-
canActivate(route, state) {
|
|
669
|
-
this._processRouteMetaTags(route.data && route.data['meta']);
|
|
670
|
-
return true;
|
|
671
|
-
}
|
|
672
|
-
_processRouteMetaTags(meta = {}) {
|
|
673
|
-
if (meta.disableUpdate) {
|
|
674
|
-
return;
|
|
675
|
-
}
|
|
676
|
-
if (meta.title) {
|
|
677
|
-
this.metaService.setTitle(meta.title, meta.titleSuffix);
|
|
678
|
-
}
|
|
679
|
-
if (Array.isArray(meta.links)) {
|
|
680
|
-
this.metaService.setLink(meta.links);
|
|
681
|
-
}
|
|
682
|
-
else if (typeof meta.links === 'string') {
|
|
683
|
-
this.metaService.setLink(meta.links.split(' '));
|
|
753
|
+
this._locked[which] = true;
|
|
754
|
+
if (!this._unlockResolvers[which]) {
|
|
755
|
+
this._unlockResolvers[which] = [];
|
|
684
756
|
}
|
|
685
|
-
|
|
686
|
-
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* Unlocks a resource, allowing access.
|
|
760
|
+
* @param which - The resource to unlock, identified by a string.
|
|
761
|
+
*/
|
|
762
|
+
unlock(which) {
|
|
763
|
+
this._locked[which] = false;
|
|
764
|
+
if (this._unlockResolvers[which]) {
|
|
765
|
+
this._unlockResolvers[which].forEach((resolve) => resolve());
|
|
766
|
+
this._unlockResolvers[which] = [];
|
|
687
767
|
}
|
|
688
|
-
|
|
689
|
-
|
|
768
|
+
}
|
|
769
|
+
/**
|
|
770
|
+
* Returns a Promise that resolves when the specified resource is unlocked.
|
|
771
|
+
* @param which - The resource to watch for unlocking, identified by a string.
|
|
772
|
+
* @returns A Promise that resolves when the resource is unlocked.
|
|
773
|
+
*/
|
|
774
|
+
onUnlock(which) {
|
|
775
|
+
if (!this._locked[which]) {
|
|
776
|
+
return Promise.resolve();
|
|
690
777
|
}
|
|
691
|
-
|
|
692
|
-
if (
|
|
693
|
-
|
|
694
|
-
prop === 'links') {
|
|
695
|
-
return;
|
|
778
|
+
return new Promise((resolve) => {
|
|
779
|
+
if (!this._unlockResolvers[which]) {
|
|
780
|
+
this._unlockResolvers[which] = [];
|
|
696
781
|
}
|
|
697
|
-
|
|
698
|
-
this.metaService.setTag(key, meta[prop][key], prop);
|
|
699
|
-
});
|
|
782
|
+
this._unlockResolvers[which].push(resolve);
|
|
700
783
|
});
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
784
|
+
}
|
|
785
|
+
/**
|
|
786
|
+
* Checks if a resource is locked.
|
|
787
|
+
* @param which - The resource to check, identified by a string.
|
|
788
|
+
* @returns True if the resource is locked, false otherwise.
|
|
789
|
+
*/
|
|
790
|
+
locked(which) {
|
|
791
|
+
return !!this._locked[which];
|
|
792
|
+
}
|
|
793
|
+
// Linking management
|
|
794
|
+
linkCollections = [];
|
|
795
|
+
linkRealCollectionName = {};
|
|
796
|
+
linkIds = {};
|
|
797
|
+
addLink(name, reset, realName = '') {
|
|
798
|
+
this.linkCollections.push(name);
|
|
799
|
+
this.linkRealCollectionName[name] = realName || name;
|
|
800
|
+
this.onComplete(name.toLowerCase() + '_loaded').then(() => {
|
|
801
|
+
this.linkIds[name] = reset();
|
|
802
|
+
});
|
|
803
|
+
this.on(name.toLowerCase() + '_changed').subscribe(() => {
|
|
804
|
+
this.linkIds[name].splice(0, this.linkIds[name].length);
|
|
805
|
+
this.linkIds[name].push(...reset());
|
|
709
806
|
});
|
|
710
807
|
}
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
let timer = setTimeout(() => {
|
|
743
|
-
this.remove();
|
|
744
|
-
}, remaining);
|
|
745
|
-
let start = new Date();
|
|
746
|
-
this.alert.nativeElement.addEventListener('mouseenter', () => {
|
|
747
|
-
clearTimeout(timer);
|
|
748
|
-
remaining -= new Date().getTime() - start.getTime();
|
|
749
|
-
}, false);
|
|
750
|
-
this.alert.nativeElement.addEventListener('mouseleave', () => {
|
|
751
|
-
start = new Date();
|
|
752
|
-
clearTimeout(timer);
|
|
753
|
-
timer = core.window.setTimeout(() => {
|
|
754
|
-
this.remove();
|
|
755
|
-
}, remaining);
|
|
756
|
-
}, false);
|
|
808
|
+
// Angular Signals
|
|
809
|
+
/**
|
|
810
|
+
* Converts an array of objects into an array of Angular signals.
|
|
811
|
+
* Optionally wraps specific fields of each object as individual signals.
|
|
812
|
+
*
|
|
813
|
+
* @template Document - The type of each object in the array.
|
|
814
|
+
* @param {Document[]} arr - Array of plain objects to convert into signals.
|
|
815
|
+
* @param {Record<string, (doc: Document) => unknown>} [updatableFields={}] -
|
|
816
|
+
* Optional map where keys are field names and values are functions that extract the initial value
|
|
817
|
+
* from the object. These fields will be turned into separate signals.
|
|
818
|
+
*
|
|
819
|
+
* @returns {Signal<Document>[]} An array where each item is a signal-wrapped object,
|
|
820
|
+
* optionally with individual fields also wrapped in signals.
|
|
821
|
+
*
|
|
822
|
+
* @example
|
|
823
|
+
* toSignalsArray(users, {
|
|
824
|
+
* name: (u) => u.name,
|
|
825
|
+
* score: (u) => u.score,
|
|
826
|
+
* });
|
|
827
|
+
*/
|
|
828
|
+
toSignalsArray(arr, updatableFields = {}) {
|
|
829
|
+
return arr.map((obj) => {
|
|
830
|
+
if (Object.keys(updatableFields).length) {
|
|
831
|
+
const signalFields = {};
|
|
832
|
+
for (const key in updatableFields) {
|
|
833
|
+
signalFields[key] = signal(updatableFields[key](obj));
|
|
834
|
+
}
|
|
835
|
+
return signal({ ...obj, ...signalFields });
|
|
836
|
+
}
|
|
837
|
+
else {
|
|
838
|
+
return signal(obj);
|
|
757
839
|
}
|
|
758
840
|
});
|
|
759
841
|
}
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.0", type: AlertComponent, isStandalone: false, selector: "alert", viewQueries: [{ propertyName: "alert", first: true, predicate: ["alert"], descendants: true }], ngImport: i0, template: "<div\r\n\t*ngIf=\"text\"\r\n\t[ngClass]=\"class\"\r\n\tclass=\"waw-alert-container height\"\r\n\t[class._close]=\"delete_animation\"\r\n>\r\n\t<div\r\n\t\t[class.waw-alert-color-blue]=\"type == 'info'\"\r\n\t\t[class.waw-alert-color-red]=\"type == 'error'\"\r\n\t\t[class.waw-alert-color-green]=\"type == 'success'\"\r\n\t\t[class.waw-alert-color-orange]=\"type == 'warning'\"\r\n\t\t[class.waw-alert-color-yellow]=\"type == 'question'\"\r\n\t\tclass=\"waw-alert bounceInUp waw-alert-theme-light waw-alert-animateInside waw-alert-opened\"\r\n\t\t#alert\r\n\t>\r\n\t\t<div class=\"waw-alert__progress\" *ngIf=\"progress\">\r\n\t\t\t<span\r\n\t\t\t\t[ngStyle]=\"{\r\n\t\t\t\t\t'animation-duration': (timeout + 350) / 1000 + 's'\r\n\t\t\t\t}\"\r\n\t\t\t></span>\r\n\t\t</div>\r\n\t\t<div class=\"waw-alert-body\">\r\n\t\t\t<div *ngIf=\"!component\" class=\"waw-alert-texts\">\r\n\t\t\t\t<div *ngIf=\"icon\" class=\"{{ icon }}\"></div>\r\n\t\t\t\t<div class=\"waw-alert-message slideIn\">{{ text }}</div>\r\n\t\t\t</div>\r\n\t\t\t<div *ngIf=\"!component && type == 'question'\">\r\n\t\t\t\t<button\r\n\t\t\t\t\tclass=\"alert-btn\"\r\n\t\t\t\t\t*ngFor=\"let b of buttons\"\r\n\t\t\t\t\t(click)=\"remove(); b.callback && b.callback()\"\r\n\t\t\t\t>\r\n\t\t\t\t\t{{ b.text }}\r\n\t\t\t\t</button>\r\n\t\t\t</div>\r\n\t\t\t<div\r\n\t\t\t\tclass=\"waw-alert__close\"\r\n\t\t\t\t*ngIf=\"closable\"\r\n\t\t\t\t(click)=\"remove()\"\r\n\t\t\t></div>\r\n\t\t</div>\r\n\t</div>\r\n</div>\r\n", styles: ["@keyframes iziT-bounceInUp{0%{opacity:0;transform:translateY(200px)}50%{opacity:1;transform:translateY(-10px)}70%{transform:translateY(5px)}to{transform:translateY(0)}}@keyframes iziT-fadeIn{0%{opacity:0}to{opacity:1}}@keyframes iziT-fadeInUp{0%{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}to{opacity:1;-webkit-transform:none;transform:none}}@keyframes iziT-fadeInDown{0%{opacity:0;-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}to{opacity:1;-webkit-transform:none;transform:none}}@keyframes iziT-bounceInLeft{0%{opacity:0;transform:translate(280px)}50%{opacity:1;transform:translate(-20px)}70%{transform:translate(10px)}to{transform:translate(0)}}@keyframes iziT-bounceInDown{0%{opacity:0;transform:translateY(-200px)}50%{opacity:1;transform:translateY(10px)}70%{transform:translateY(-5px)}to{transform:translateY(0)}}.alert-wrapper{position:fixed;bottom:50px;left:0;width:100%;height:60px;overflow:hidden}.alert{display:flex;-webkit-box-align:center;align-items:center;width:auto;background:#3aed92;color:#fff;max-width:700px;margin:0 auto;transform:translateY(300px) scale(0);transition:.3s all ease-in-out}.alert._show{transform:translateY(0) scale(1);transition:.3s all ease-in-out}.alert-icon{min-width:60px;min-height:60px;position:relative;display:flex;justify-content:center;align-items:center;background-color:#2bd17d}.alert-icon:before{content:\"\";position:absolute;width:25px;height:25px;border-radius:50%;border:2px solid #fff}.alert-icon:after{content:\"\";position:absolute;top:22px;width:7px;height:11px;border:solid white;border-width:0 2px 2px 0;transform:rotate(45deg)}.alert-text{padding:0 20px;word-break:break-all;overflow:auto;height:60px}.alert-text .text-block{width:99%}.alert-text .text-block__text{text-overflow:ellipsis;overflow:hidden;white-space:pre}.alert-close{min-width:50px;margin-left:auto;font-size:25px;display:flex;justify-content:center;align-items:center}.font-bold{font-weight:700}.waw-alert__progress{bottom:0;position:absolute;width:100%;margin-bottom:0;border-radius:50px}.waw-alert__progress:hover span{animation-play-state:paused}.waw-alert__progress span{display:block;width:100%;height:2px;background-color:#a5a5a5ed;animation-name:waw-alert-progress;animation-duration:10s;border-radius:50px}.waw-alert__progress span._red{background-color:#ffafb4}.waw-alert__progress span._green{background-color:#a6efb8}.waw-alert__progress span._yellow{background-color:#fff9b2}.waw-alert__progress span._orange,.waw-alert__progress span._blue{background-color:#ffcfa5}.waw-alert__progress span._white{background-color:#fff}.waw-alert__progress span._black{background-color:#000}.waw-alert:hover .waw-alert__progress>span{animation-play-state:paused}.waw-alert__close{width:15px;height:15px;opacity:.3;position:relative;order:2}.waw-alert__close:hover{opacity:1}.waw-alert__close:before,.waw-alert__close:after{cursor:pointer;position:absolute;left:15px;content:\" \";height:12px;width:2px;background-color:#47525d}.waw-alert__close:before{transform:rotate(45deg)}.waw-alert__close:after{transform:rotate(-45deg)}@keyframes waw-alert-progress{0%{width:100%}to{width:0%}}.waw-alert-container{font-size:0;height:100px;width:100%;transform:translateZ(0);backface-visibility:hidden;transition:.3s all ease-in-out;opacity:1}.waw-alert-container._close{opacity:0;transition:.3s all ease-in-out}.waw-alert{display:inline-block;clear:both;position:relative;font-family:Lato,Tahoma,Arial;font-size:14px;padding:8px 25px 9px 0;background:#eeeeeee6;border-color:#eeeeeee6;width:100%;pointer-events:all;cursor:default;transform:translate(0);-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;min-height:54px}.waw-alert>.waw-alert-progressbar{position:absolute;left:0;bottom:0;width:100%;z-index:1;background:#fff3}.waw-alert>.waw-alert-progressbar>div{height:2px;width:100%;background:#0000004d;border-radius:0 0 3px 3px}.waw-alert>.waw-alert-close{position:absolute;right:0;top:0;border:0;padding:0;opacity:.6;width:42px;height:100%;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAJPAAACTwBcGfW0QAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAD3SURBVFiF1ZdtDoMgDEBfdi4PwAX8vLFn0qT7wxantojKupmQmCi8R4tSACpgjC2ICCUbEBa8ingjsU1AXRBeR8aLN64FiknswN8CYefBBDQ3whuFESy7WyQMeC0ipEI0A+0FeBvHUFN8xPaUhAH/iKoWsnXHGegy4J0yxialOfaHJAz4bhRzQzgDvdGnz4GbAonZbCQMuBm1K/kcFu8Mp1N2cFFpsxsMuJqqbIGExGl4loARajU1twskJLLhIsID7+tvUoDnIjTg5T9DPH9EBrz8rxjPzciAl9+O8SxI8CzJ8CxKFfh3ynK8Dyb8wNHM/XDqejx/AtNyPO87tNybAAAAAElFTkSuQmCC) no-repeat 50% 50%;background-size:8px;cursor:pointer;outline:none}.waw-alert>.waw-alert-close:hover{opacity:1}.waw-alert>.waw-alert-body{position:relative;padding:0 0 0 10px;height:auto;min-height:36px;margin:0 0 0 15px;text-align:left;display:flex;justify-content:space-between;align-items:center}.waw-alert>.waw-alert-body:after{content:\"\";display:table;clear:both}.waw-alert>.waw-alert-body .waw-alert-texts{margin:10px 0 0;padding-right:2px;display:inline-block;float:left;display:flex;justify-content:space-between;align-items:center}.waw-alert>.waw-alert-body .waw-alert-icon{height:100%;position:absolute;left:0;top:50%;display:table;font-size:23px;line-height:24px;margin-top:-12px;color:#000;width:24px;height:24px}.waw-alert>.waw-alert-body .waw-alert-title{padding:0;margin:0 10px 0 0;line-height:16px;font-size:14px;text-align:left;float:left;color:#000;white-space:normal;font-weight:700}.waw-alert>.waw-alert-body .waw-alert-message{padding:0;font-size:14px;line-height:16px;text-align:left;float:left;color:#0009;white-space:normal}@media only screen and (min-width: 568px){.waw-alert-wrapper{padding:10px 15px}.waw-alert{margin:5px;border-radius:3px;width:auto}.waw-alert:after{content:\"\";z-index:-1;position:absolute;top:0;left:0;width:100%;height:100%;border-radius:3px;box-shadow:inset 0 -10px 20px -10px #0003,inset 0 0 5px #0000001a,0 8px 8px -5px #00000040}.waw-alert:not(.waw-alert-rtl) .waw-alert-cover{border-radius:3px 0 0 3px}.waw-alert.waw-alert-rtl .waw-alert-cover{border-radius:0 3px 3px 0}.waw-alert.waw-alert-color-dark:after{box-shadow:inset 0 -10px 20px -10px #ffffff4d,0 10px 10px -5px #00000040}.waw-alert.waw-alert-balloon .waw-alert-progressbar{background:transparent}.waw-alert.waw-alert-balloon:after{box-shadow:0 10px 10px -5px #00000040,inset 0 10px 20px -5px #00000040}.waw-alert-target .waw-alert:after{box-shadow:inset 0 -10px 20px -10px #0003,inset 0 0 5px #0000001a}}.waw-alert.waw-alert-theme-dark{background:#565c70;border-color:#565c70}.waw-alert.waw-alert-theme-dark .waw-alert-title{color:#fff}.waw-alert.waw-alert-theme-dark .waw-alert-message{color:#ffffffb3;font-weight:300}.waw-alert.waw-alert-theme-dark .waw-alert-icon{color:#fff}.waw-alert.waw-alert-color-red{background:#ffafb4e6;border-color:#ffafb4e6}.waw-alert.waw-alert-color-orange{background:#ffcfa5e6;border-color:#ffcfa5e6}.waw-alert.waw-alert-color-yellow{background:#fff9b2e6;border-color:#fff9b2e6}.waw-alert.waw-alert-color-blue{background:#9ddeffe6;border-color:#9ddeffe6}.waw-alert.waw-alert-color-green{background:#a6efb8e6;border-color:#a6efb8e6}.waw-alert.slideIn,.waw-alert .slideIn{-webkit-animation:iziT-slideIn 1s cubic-bezier(.16,.81,.32,1) both;-moz-animation:iziT-slideIn 1s cubic-bezier(.16,.81,.32,1) both;animation:iziT-slideIn 1s cubic-bezier(.16,.81,.32,1) both}.waw-alert.bounceInLeft{-webkit-animation:iziT-bounceInLeft .7s ease-in-out both;animation:iziT-bounceInLeft .7s ease-in-out both}.waw-alert.bounceInRight{-webkit-animation:iziT-bounceInRight .85s ease-in-out both;animation:iziT-bounceInRight .85s ease-in-out both}.waw-alert.bounceInDown{-webkit-animation:iziT-bounceInDown .7s ease-in-out both;animation:iziT-bounceInDown .7s ease-in-out both}.waw-alert.bounceInUp{-webkit-animation:iziT-bounceInUp .7s ease-in-out both;animation:iziT-bounceInUp .7s ease-in-out both}.height{height:auto!important}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
closable = true;
|
|
783
|
-
close;
|
|
784
|
-
onOpen;
|
|
785
|
-
timestart;
|
|
786
|
-
timeout;
|
|
787
|
-
showModal = false;
|
|
788
|
-
allowClose = true;
|
|
789
|
-
onClickOutside;
|
|
790
|
-
ngOnInit() {
|
|
791
|
-
if (typeof this.onClickOutside !== 'function') {
|
|
792
|
-
this.onClickOutside = this.close;
|
|
793
|
-
// this.onClickOutside = () => {
|
|
794
|
-
// if (this.allowClose) {
|
|
795
|
-
// this.close();
|
|
796
|
-
// }
|
|
797
|
-
// this.allowClose = true;
|
|
798
|
-
// };
|
|
842
|
+
/**
|
|
843
|
+
* Adds a new object to the signals array.
|
|
844
|
+
* Optionally wraps specific fields of the object as individual signals before wrapping the whole object.
|
|
845
|
+
*
|
|
846
|
+
* @template Document - The type of the object being added.
|
|
847
|
+
* @param {WritableSignal<Document>[]} signals - The signals array to append to.
|
|
848
|
+
* @param {Document} item - The object to wrap and push as a writable signal.
|
|
849
|
+
* @param {Record<string, (doc: Document) => unknown>} [updatableFields={}] -
|
|
850
|
+
* Optional map of fields to be wrapped as signals within the object.
|
|
851
|
+
*
|
|
852
|
+
* @returns {void}
|
|
853
|
+
*/
|
|
854
|
+
pushSignal(signals, item, updatableFields = {}) {
|
|
855
|
+
if (Object.keys(updatableFields).length) {
|
|
856
|
+
const fieldSignals = {};
|
|
857
|
+
for (const key in updatableFields) {
|
|
858
|
+
fieldSignals[key] = signal(updatableFields[key](item));
|
|
859
|
+
}
|
|
860
|
+
signals.push(signal({ ...item, ...fieldSignals }));
|
|
861
|
+
}
|
|
862
|
+
else {
|
|
863
|
+
signals.push(signal(item));
|
|
799
864
|
}
|
|
800
|
-
if (typeof this.onOpen == 'function')
|
|
801
|
-
this.onOpen();
|
|
802
|
-
window.addEventListener('popstate', this.popStateListener.bind(this));
|
|
803
|
-
}
|
|
804
|
-
ngAfterViewInit() {
|
|
805
|
-
setTimeout(() => {
|
|
806
|
-
this.showModal = true;
|
|
807
|
-
}, this.timestart || 0);
|
|
808
|
-
}
|
|
809
|
-
ngOnDestroy() {
|
|
810
|
-
window.removeEventListener('popstate', this.popStateListener.bind(this));
|
|
811
865
|
}
|
|
812
|
-
|
|
813
|
-
|
|
866
|
+
/**
|
|
867
|
+
* Returns a generic trackBy function for *ngFor, tracking by the specified object field.
|
|
868
|
+
* @template Document
|
|
869
|
+
* @param {string} field - The object field to use for tracking (e.g., '_id').
|
|
870
|
+
* @returns {(index: number, sig: Signal<Document>) => unknown} TrackBy function for Angular.
|
|
871
|
+
*/
|
|
872
|
+
trackBySignalField(field) {
|
|
873
|
+
return (_, sig) => sig()[field];
|
|
814
874
|
}
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
text = 'Loading';
|
|
826
|
-
class = '';
|
|
827
|
-
progress = true;
|
|
828
|
-
timeout = 5000;
|
|
829
|
-
close;
|
|
830
|
-
closable = true;
|
|
831
|
-
constructor() { }
|
|
832
|
-
ngOnInit() {
|
|
833
|
-
if (this.timeout) {
|
|
834
|
-
setTimeout(() => {
|
|
835
|
-
this.close();
|
|
836
|
-
}, this.timeout);
|
|
837
|
-
}
|
|
875
|
+
/**
|
|
876
|
+
* Finds the first signal in the array whose object's field matches the provided value.
|
|
877
|
+
* @template Document
|
|
878
|
+
* @param {Signal<Document>[]} signals - Array of signals to search.
|
|
879
|
+
* @param {unknown} value - The value to match.
|
|
880
|
+
* @param {string} [field='_id'] - The object field to match against.
|
|
881
|
+
* @returns {Signal<Document> | undefined} The found signal or undefined if not found.
|
|
882
|
+
*/
|
|
883
|
+
findSignalByField(signals, value, field = '_id') {
|
|
884
|
+
return signals.find((sig) => sig()[field] === value);
|
|
838
885
|
}
|
|
839
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: LoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
840
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.0", type: LoaderComponent, isStandalone: false, selector: "lib-loader", viewQueries: [{ propertyName: "loader", first: true, predicate: ["loader"], descendants: true }], ngImport: i0, template: "<div\r\n\tstyle=\"\r\n\t\tposition: fixed;\r\n\t\twidth: 100%;\r\n\t\theight: 100%;\r\n\t\tleft: 0;\r\n\t\ttop: 0;\r\n\t\tbackground-color: #334d6e;\r\n\t\tdisplay: flex;\r\n\t\tjustify-content: center;\r\n\t\talign-items: center;\r\n\t\tz-index: 999999;\r\n\t\"\r\n\t#loader\r\n>\r\n\t<span class=\"close\" (click)=\"close()\" *ngIf=\"closable\">×</span>\r\n\t<span style=\"font-size: 30px; color: white\">\r\n\t\t{{ text }}\r\n\t</span>\r\n</div>\r\n", styles: [".close{color:#aaa;position:absolute;right:20px;top:20px;font-size:32px;line-height:1}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
841
|
-
}
|
|
842
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: LoaderComponent, decorators: [{
|
|
843
|
-
type: Component,
|
|
844
|
-
args: [{ selector: 'lib-loader', standalone: false, template: "<div\r\n\tstyle=\"\r\n\t\tposition: fixed;\r\n\t\twidth: 100%;\r\n\t\theight: 100%;\r\n\t\tleft: 0;\r\n\t\ttop: 0;\r\n\t\tbackground-color: #334d6e;\r\n\t\tdisplay: flex;\r\n\t\tjustify-content: center;\r\n\t\talign-items: center;\r\n\t\tz-index: 999999;\r\n\t\"\r\n\t#loader\r\n>\r\n\t<span class=\"close\" (click)=\"close()\" *ngIf=\"closable\">×</span>\r\n\t<span style=\"font-size: 30px; color: white\">\r\n\t\t{{ text }}\r\n\t</span>\r\n</div>\r\n", styles: [".close{color:#aaa;position:absolute;right:20px;top:20px;font-size:32px;line-height:1}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer}\n"] }]
|
|
845
|
-
}], ctorParameters: () => [], propDecorators: { loader: [{
|
|
846
|
-
type: ViewChild,
|
|
847
|
-
args: ['loader', { static: false }]
|
|
848
|
-
}] } });
|
|
849
|
-
|
|
850
|
-
/**
|
|
851
|
-
* BaseComponent is an abstract class that provides basic functionality for managing the current timestamp.
|
|
852
|
-
*/
|
|
853
|
-
class BaseComponent {
|
|
854
886
|
/**
|
|
855
|
-
*
|
|
887
|
+
* Updates the first writable signal in the array whose object's field matches the provided value.
|
|
888
|
+
* @template Document
|
|
889
|
+
* @param {WritableSignal<Document>[]} signals - Array of writable signals to search.
|
|
890
|
+
* @param {unknown} value - The value to match.
|
|
891
|
+
* @param {(val: Document) => Document} updater - Function to produce the updated object.
|
|
892
|
+
* @param {string} field - The object field to match against.
|
|
893
|
+
* @returns {void}
|
|
856
894
|
*/
|
|
857
|
-
|
|
895
|
+
updateSignalByField(signals, value, updater, field) {
|
|
896
|
+
const sig = this.findSignalByField(signals, value, field);
|
|
897
|
+
if (sig)
|
|
898
|
+
sig.update(updater);
|
|
899
|
+
}
|
|
858
900
|
/**
|
|
859
|
-
*
|
|
901
|
+
* Removes the first signal from the array whose object's field matches the provided value.
|
|
902
|
+
* @template Document
|
|
903
|
+
* @param {WritableSignal<Document>[]} signals - The signals array to modify.
|
|
904
|
+
* @param {unknown} value - The value to match.
|
|
905
|
+
* @param {string} [field='_id'] - The object field to match against.
|
|
906
|
+
* @returns {void}
|
|
860
907
|
*/
|
|
861
|
-
|
|
862
|
-
|
|
908
|
+
removeSignalByField(signals, value, field = '_id') {
|
|
909
|
+
const idx = signals.findIndex((sig) => sig()[field] === value);
|
|
910
|
+
if (idx > -1)
|
|
911
|
+
signals.splice(idx, 1);
|
|
863
912
|
}
|
|
913
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CoreService, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
914
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CoreService, providedIn: 'root' });
|
|
864
915
|
}
|
|
916
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CoreService, decorators: [{
|
|
917
|
+
type: Injectable,
|
|
918
|
+
args: [{
|
|
919
|
+
providedIn: 'root',
|
|
920
|
+
}]
|
|
921
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
922
|
+
type: Inject,
|
|
923
|
+
args: [PLATFORM_ID]
|
|
924
|
+
}] }] });
|
|
865
925
|
|
|
866
926
|
/**
|
|
867
927
|
* Abstract reusable base class for CRUD list views.
|
|
@@ -1423,7 +1483,7 @@ class StoreService {
|
|
|
1423
1483
|
}
|
|
1424
1484
|
else {
|
|
1425
1485
|
try {
|
|
1426
|
-
|
|
1486
|
+
localStorage.setItem(key, value);
|
|
1427
1487
|
callback();
|
|
1428
1488
|
}
|
|
1429
1489
|
catch (e) {
|
|
@@ -1445,7 +1505,7 @@ class StoreService {
|
|
|
1445
1505
|
await this.config.store.set(key, value);
|
|
1446
1506
|
}
|
|
1447
1507
|
else {
|
|
1448
|
-
|
|
1508
|
+
localStorage.setItem(key, value);
|
|
1449
1509
|
}
|
|
1450
1510
|
return true;
|
|
1451
1511
|
}
|
|
@@ -1467,7 +1527,7 @@ class StoreService {
|
|
|
1467
1527
|
this.config.store.get(key, callback, errCallback);
|
|
1468
1528
|
}
|
|
1469
1529
|
else {
|
|
1470
|
-
const value =
|
|
1530
|
+
const value = localStorage.getItem(key) || '';
|
|
1471
1531
|
callback(value);
|
|
1472
1532
|
}
|
|
1473
1533
|
}
|
|
@@ -1484,7 +1544,7 @@ class StoreService {
|
|
|
1484
1544
|
return await this.config.store.get(key);
|
|
1485
1545
|
}
|
|
1486
1546
|
else {
|
|
1487
|
-
return
|
|
1547
|
+
return localStorage.getItem(key) || '';
|
|
1488
1548
|
}
|
|
1489
1549
|
}
|
|
1490
1550
|
catch (err) {
|
|
@@ -1562,7 +1622,7 @@ class StoreService {
|
|
|
1562
1622
|
await this.config.store.remove(key, callback, errCallback);
|
|
1563
1623
|
}
|
|
1564
1624
|
else {
|
|
1565
|
-
|
|
1625
|
+
localStorage.removeItem(key);
|
|
1566
1626
|
}
|
|
1567
1627
|
callback?.();
|
|
1568
1628
|
return true;
|
|
@@ -1586,7 +1646,7 @@ class StoreService {
|
|
|
1586
1646
|
await this.config.store.clear();
|
|
1587
1647
|
}
|
|
1588
1648
|
else {
|
|
1589
|
-
|
|
1649
|
+
localStorage.clear();
|
|
1590
1650
|
}
|
|
1591
1651
|
callback?.();
|
|
1592
1652
|
return true;
|
|
@@ -2012,13 +2072,11 @@ class DomService {
|
|
|
2012
2072
|
componentFactoryResolver;
|
|
2013
2073
|
appRef;
|
|
2014
2074
|
injector;
|
|
2015
|
-
core;
|
|
2016
2075
|
providedIn = {};
|
|
2017
|
-
constructor(componentFactoryResolver, appRef, injector
|
|
2076
|
+
constructor(componentFactoryResolver, appRef, injector) {
|
|
2018
2077
|
this.componentFactoryResolver = componentFactoryResolver;
|
|
2019
2078
|
this.appRef = appRef;
|
|
2020
2079
|
this.injector = injector;
|
|
2021
|
-
this.core = core;
|
|
2022
2080
|
}
|
|
2023
2081
|
/**
|
|
2024
2082
|
* Appends a component to a specified element by ID.
|
|
@@ -2036,7 +2094,7 @@ class DomService {
|
|
|
2036
2094
|
this.appRef.attachView(componentRef.hostView);
|
|
2037
2095
|
const domElem = componentRef.hostView
|
|
2038
2096
|
.rootNodes[0];
|
|
2039
|
-
const element =
|
|
2097
|
+
const element = document.getElementById(id);
|
|
2040
2098
|
if (element && typeof element.appendChild === 'function') {
|
|
2041
2099
|
element.appendChild(domElem);
|
|
2042
2100
|
}
|
|
@@ -2053,7 +2111,7 @@ class DomService {
|
|
|
2053
2111
|
* @param element - The element to append the component to. Defaults to body.
|
|
2054
2112
|
* @returns An object containing the native element and the component reference.
|
|
2055
2113
|
*/
|
|
2056
|
-
appendComponent(component, options = {}, element =
|
|
2114
|
+
appendComponent(component, options = {}, element = document.body) {
|
|
2057
2115
|
if (options.providedIn) {
|
|
2058
2116
|
if (this.providedIn[options.providedIn]) {
|
|
2059
2117
|
return;
|
|
@@ -2106,7 +2164,7 @@ class DomService {
|
|
|
2106
2164
|
}
|
|
2107
2165
|
return component;
|
|
2108
2166
|
}
|
|
2109
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: DomService, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.ApplicationRef }, { token: i0.Injector }
|
|
2167
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: DomService, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.ApplicationRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2110
2168
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: DomService, providedIn: 'root' });
|
|
2111
2169
|
}
|
|
2112
2170
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: DomService, decorators: [{
|
|
@@ -2114,17 +2172,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
|
2114
2172
|
args: [{
|
|
2115
2173
|
providedIn: 'root',
|
|
2116
2174
|
}]
|
|
2117
|
-
}], ctorParameters: () => [{ type: i0.ComponentFactoryResolver }, { type: i0.ApplicationRef }, { type: i0.Injector }
|
|
2175
|
+
}], ctorParameters: () => [{ type: i0.ComponentFactoryResolver }, { type: i0.ApplicationRef }, { type: i0.Injector }] });
|
|
2118
2176
|
|
|
2119
2177
|
class AlertService {
|
|
2120
2178
|
dom;
|
|
2121
|
-
core;
|
|
2122
2179
|
config;
|
|
2123
2180
|
alert;
|
|
2124
2181
|
_container;
|
|
2125
|
-
constructor(dom,
|
|
2182
|
+
constructor(dom, config) {
|
|
2126
2183
|
this.dom = dom;
|
|
2127
|
-
this.core = core;
|
|
2128
2184
|
this.config = config;
|
|
2129
2185
|
if (!this.config)
|
|
2130
2186
|
this.config = DEFAULT_CONFIG;
|
|
@@ -2246,15 +2302,21 @@ class AlertService {
|
|
|
2246
2302
|
this.show(opts);
|
|
2247
2303
|
}
|
|
2248
2304
|
destroy() {
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2305
|
+
[
|
|
2306
|
+
'bottomRight',
|
|
2307
|
+
'bottomLeft',
|
|
2308
|
+
'bottomCenter',
|
|
2309
|
+
'topRight',
|
|
2310
|
+
'topLeft',
|
|
2311
|
+
'topCenter',
|
|
2312
|
+
'center',
|
|
2313
|
+
].forEach((id) => {
|
|
2314
|
+
const el = document.getElementById(id);
|
|
2315
|
+
if (el)
|
|
2316
|
+
el.innerHTML = '';
|
|
2317
|
+
});
|
|
2318
|
+
}
|
|
2319
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: AlertService, deps: [{ token: DomService }, { token: CONFIG_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2258
2320
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: AlertService, providedIn: 'root' });
|
|
2259
2321
|
}
|
|
2260
2322
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: AlertService, decorators: [{
|
|
@@ -2262,7 +2324,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
|
2262
2324
|
args: [{
|
|
2263
2325
|
providedIn: 'root',
|
|
2264
2326
|
}]
|
|
2265
|
-
}], ctorParameters: () => [{ type: DomService }, { type:
|
|
2327
|
+
}], ctorParameters: () => [{ type: DomService }, { type: undefined, decorators: [{
|
|
2266
2328
|
type: Inject,
|
|
2267
2329
|
args: [CONFIG_TOKEN]
|
|
2268
2330
|
}, {
|
|
@@ -3834,7 +3896,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
|
3834
3896
|
}] });
|
|
3835
3897
|
|
|
3836
3898
|
class HashService {
|
|
3837
|
-
core;
|
|
3838
3899
|
replacements = [
|
|
3839
3900
|
{
|
|
3840
3901
|
from: '%20',
|
|
@@ -3843,15 +3904,14 @@ class HashService {
|
|
|
3843
3904
|
];
|
|
3844
3905
|
hash = {};
|
|
3845
3906
|
done = false;
|
|
3846
|
-
constructor(
|
|
3847
|
-
this.core = core;
|
|
3907
|
+
constructor() {
|
|
3848
3908
|
this.initialize();
|
|
3849
3909
|
}
|
|
3850
3910
|
/**
|
|
3851
3911
|
* Initializes the hash service by loading the current hash from the URL.
|
|
3852
3912
|
*/
|
|
3853
3913
|
initialize() {
|
|
3854
|
-
if (!
|
|
3914
|
+
if (!window.location.hash) {
|
|
3855
3915
|
this.done = true;
|
|
3856
3916
|
return;
|
|
3857
3917
|
}
|
|
@@ -3863,7 +3923,7 @@ class HashService {
|
|
|
3863
3923
|
*/
|
|
3864
3924
|
load() {
|
|
3865
3925
|
this.hash = {};
|
|
3866
|
-
const hashArray =
|
|
3926
|
+
const hashArray = window.location.hash
|
|
3867
3927
|
.replace('#!#', '')
|
|
3868
3928
|
.replace('#', '')
|
|
3869
3929
|
.split('&');
|
|
@@ -3908,7 +3968,7 @@ class HashService {
|
|
|
3908
3968
|
const hash = Object.entries(this.hash)
|
|
3909
3969
|
.map(([key, value]) => `${key}=${value}`)
|
|
3910
3970
|
.join('&');
|
|
3911
|
-
|
|
3971
|
+
window.location.hash = hash;
|
|
3912
3972
|
}
|
|
3913
3973
|
/**
|
|
3914
3974
|
* Sets a value for a specific hash field and updates the URL.
|
|
@@ -3943,7 +4003,7 @@ class HashService {
|
|
|
3943
4003
|
}
|
|
3944
4004
|
this.save();
|
|
3945
4005
|
}
|
|
3946
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: HashService, deps: [
|
|
4006
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: HashService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3947
4007
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: HashService, providedIn: 'root' });
|
|
3948
4008
|
}
|
|
3949
4009
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: HashService, decorators: [{
|
|
@@ -3951,7 +4011,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
|
3951
4011
|
args: [{
|
|
3952
4012
|
providedIn: 'root',
|
|
3953
4013
|
}]
|
|
3954
|
-
}], ctorParameters: () => [
|
|
4014
|
+
}], ctorParameters: () => [] });
|
|
3955
4015
|
|
|
3956
4016
|
class LoaderService {
|
|
3957
4017
|
dom;
|
|
@@ -4019,7 +4079,7 @@ class SocketService {
|
|
|
4019
4079
|
if (!this._config.io) {
|
|
4020
4080
|
return;
|
|
4021
4081
|
}
|
|
4022
|
-
this._url =
|
|
4082
|
+
this._url = window.location.origin.replace('4200', '8080');
|
|
4023
4083
|
if (!this._config)
|
|
4024
4084
|
this._config = DEFAULT_CONFIG;
|
|
4025
4085
|
if (typeof this._config.socket === 'object') {
|
|
@@ -4112,12 +4172,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
|
4112
4172
|
|
|
4113
4173
|
class ModalService {
|
|
4114
4174
|
dom;
|
|
4115
|
-
core;
|
|
4116
4175
|
config;
|
|
4117
4176
|
_modal;
|
|
4118
|
-
constructor(dom,
|
|
4177
|
+
constructor(dom, config) {
|
|
4119
4178
|
this.dom = dom;
|
|
4120
|
-
this.core = core;
|
|
4121
4179
|
this.config = config;
|
|
4122
4180
|
if (!this.config)
|
|
4123
4181
|
this.config = {};
|
|
@@ -4157,7 +4215,7 @@ class ModalService {
|
|
|
4157
4215
|
}
|
|
4158
4216
|
opts.id = Math.floor(Math.random() * Date.now()) + Date.now();
|
|
4159
4217
|
this.opened[opts.id] = opts;
|
|
4160
|
-
|
|
4218
|
+
document.body.classList.add('modalOpened');
|
|
4161
4219
|
let component;
|
|
4162
4220
|
let content;
|
|
4163
4221
|
opts.close = () => {
|
|
@@ -4167,7 +4225,7 @@ class ModalService {
|
|
|
4167
4225
|
opts.onClose();
|
|
4168
4226
|
delete this.opened[opts.id];
|
|
4169
4227
|
if (!Object.keys(this.opened).length) {
|
|
4170
|
-
|
|
4228
|
+
document.body.classList.remove('modalOpened');
|
|
4171
4229
|
}
|
|
4172
4230
|
};
|
|
4173
4231
|
if (typeof opts.timeout == 'number' && opts.timeout > 0) {
|
|
@@ -4226,9 +4284,9 @@ class ModalService {
|
|
|
4226
4284
|
for (let each in this.opened) {
|
|
4227
4285
|
this.opened[each].close();
|
|
4228
4286
|
}
|
|
4229
|
-
|
|
4287
|
+
document.body.classList.remove('modalOpened');
|
|
4230
4288
|
}
|
|
4231
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ModalService, deps: [{ token: DomService }, { token:
|
|
4289
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ModalService, deps: [{ token: DomService }, { token: CONFIG_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4232
4290
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ModalService, providedIn: 'root' });
|
|
4233
4291
|
}
|
|
4234
4292
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ModalService, decorators: [{
|
|
@@ -4236,7 +4294,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
|
4236
4294
|
args: [{
|
|
4237
4295
|
providedIn: 'root',
|
|
4238
4296
|
}]
|
|
4239
|
-
}], ctorParameters: () => [{ type: DomService }, { type:
|
|
4297
|
+
}], ctorParameters: () => [{ type: DomService }, { type: undefined, decorators: [{
|
|
4240
4298
|
type: Inject,
|
|
4241
4299
|
args: [CONFIG_TOKEN]
|
|
4242
4300
|
}, {
|
|
@@ -4256,13 +4314,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
|
4256
4314
|
|
|
4257
4315
|
class FileService {
|
|
4258
4316
|
dom;
|
|
4259
|
-
core;
|
|
4260
4317
|
http;
|
|
4261
4318
|
added = {};
|
|
4262
4319
|
files = [];
|
|
4263
|
-
constructor(dom,
|
|
4320
|
+
constructor(dom, http) {
|
|
4264
4321
|
this.dom = dom;
|
|
4265
|
-
this.core = core;
|
|
4266
4322
|
this.http = http;
|
|
4267
4323
|
this.dom.appendComponent(FilesComponent, {
|
|
4268
4324
|
fs: this,
|
|
@@ -4465,8 +4521,8 @@ class FileService {
|
|
|
4465
4521
|
if (!info.resize) {
|
|
4466
4522
|
return this.update(loadEvent.target?.result, info, file);
|
|
4467
4523
|
}
|
|
4468
|
-
const canvas =
|
|
4469
|
-
const img =
|
|
4524
|
+
const canvas = document.createElement('canvas');
|
|
4525
|
+
const img = document.createElement('img');
|
|
4470
4526
|
img.onload = () => {
|
|
4471
4527
|
if (img.width <= info.resize.width &&
|
|
4472
4528
|
img.height <= info.resize.height) {
|
|
@@ -4486,7 +4542,7 @@ class FileService {
|
|
|
4486
4542
|
canvas.width = width;
|
|
4487
4543
|
canvas.height = height;
|
|
4488
4544
|
const context = canvas.getContext('2d');
|
|
4489
|
-
context
|
|
4545
|
+
context?.drawImage(img, 0, 0, width, height);
|
|
4490
4546
|
const dataUrl = canvas.toDataURL('image/jpeg', 1);
|
|
4491
4547
|
this.update(dataUrl, info, file);
|
|
4492
4548
|
};
|
|
@@ -4494,7 +4550,7 @@ class FileService {
|
|
|
4494
4550
|
};
|
|
4495
4551
|
reader.readAsDataURL(file);
|
|
4496
4552
|
}
|
|
4497
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: FileService, deps: [{ token: DomService }, { token:
|
|
4553
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: FileService, deps: [{ token: DomService }, { token: HttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4498
4554
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: FileService, providedIn: 'root' });
|
|
4499
4555
|
}
|
|
4500
4556
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: FileService, decorators: [{
|
|
@@ -4502,17 +4558,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
|
4502
4558
|
args: [{
|
|
4503
4559
|
providedIn: 'root',
|
|
4504
4560
|
}]
|
|
4505
|
-
}], ctorParameters: () => [{ type: DomService }, { type:
|
|
4561
|
+
}], ctorParameters: () => [{ type: DomService }, { type: HttpService }] });
|
|
4506
4562
|
|
|
4507
4563
|
class UiService {
|
|
4508
|
-
core;
|
|
4509
4564
|
variables = {};
|
|
4510
4565
|
_forms = {};
|
|
4511
4566
|
// global variable use for design purposes
|
|
4512
4567
|
var = {};
|
|
4513
|
-
constructor(
|
|
4514
|
-
|
|
4515
|
-
const storedVariables = this.core.localStorage.getItem('css_variables');
|
|
4568
|
+
constructor() {
|
|
4569
|
+
const storedVariables = localStorage.getItem('css_variables');
|
|
4516
4570
|
this.variables = storedVariables ? JSON.parse(storedVariables) : {};
|
|
4517
4571
|
for (const key in this.variables) {
|
|
4518
4572
|
this.setProperty(key, this.variables[key]);
|
|
@@ -4595,7 +4649,7 @@ class UiService {
|
|
|
4595
4649
|
* Saves the CSS variables to local storage.
|
|
4596
4650
|
*/
|
|
4597
4651
|
save() {
|
|
4598
|
-
|
|
4652
|
+
localStorage.setItem('css_variables', JSON.stringify(this.variables));
|
|
4599
4653
|
}
|
|
4600
4654
|
/**
|
|
4601
4655
|
* Sets a CSS variable.
|
|
@@ -4604,7 +4658,7 @@ class UiService {
|
|
|
4604
4658
|
* @param value - The CSS variable value.
|
|
4605
4659
|
*/
|
|
4606
4660
|
setProperty(key, value) {
|
|
4607
|
-
|
|
4661
|
+
document.documentElement.style.setProperty(key, value);
|
|
4608
4662
|
}
|
|
4609
4663
|
/**
|
|
4610
4664
|
* Sets multiple CSS variables.
|
|
@@ -4616,7 +4670,7 @@ class UiService {
|
|
|
4616
4670
|
if (typeof opts === 'string') {
|
|
4617
4671
|
opts = opts === 'local' ? { local: true } : { host: opts };
|
|
4618
4672
|
}
|
|
4619
|
-
if (opts.host &&
|
|
4673
|
+
if (opts.host && window.location.host !== opts.host)
|
|
4620
4674
|
return;
|
|
4621
4675
|
for (const key in variables) {
|
|
4622
4676
|
if (opts.local) {
|
|
@@ -4690,7 +4744,7 @@ class UiService {
|
|
|
4690
4744
|
}
|
|
4691
4745
|
return result;
|
|
4692
4746
|
}
|
|
4693
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: UiService, deps: [
|
|
4747
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: UiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4694
4748
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: UiService, providedIn: 'root' });
|
|
4695
4749
|
}
|
|
4696
4750
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: UiService, decorators: [{
|
|
@@ -4698,7 +4752,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
|
4698
4752
|
args: [{
|
|
4699
4753
|
providedIn: 'root',
|
|
4700
4754
|
}]
|
|
4701
|
-
}], ctorParameters: () => [
|
|
4755
|
+
}], ctorParameters: () => [] });
|
|
4702
4756
|
|
|
4703
4757
|
class TimeService {
|
|
4704
4758
|
datePipe;
|