@tilde-nlp/ngx-common 8.1.21 → 8.1.22
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.
|
@@ -9035,11 +9035,11 @@ const translations = {
|
|
|
9035
9035
|
PURPOSE: 'Mērķis',
|
|
9036
9036
|
CATEGORY: 'Kategorija',
|
|
9037
9037
|
DURATION: 'Apstrādes termiņš',
|
|
9038
|
-
ALLOW_COOKIES: '
|
|
9038
|
+
ALLOW_COOKIES: 'mtm_cookie_consent',
|
|
9039
9039
|
ALLOW_COOKIES_PURPOSE: 'Saglabā lietotāja piekrišanu sīkdatņu izmantošanai un statistikas ieguvei.',
|
|
9040
9040
|
FUNCTIONAL_COOKIES: 'Funkcionālās sīkdatnes',
|
|
9041
9041
|
ONE_YEAR: '1 gads',
|
|
9042
|
-
CULTURE: '
|
|
9042
|
+
CULTURE: 'language',
|
|
9043
9043
|
CULTURE_PURPOSE: 'Saglabā lietotāja izvēlēto valodu, lai lietotājam katru reizi nav jāpārslēdz.',
|
|
9044
9044
|
ONE_MONTH: '1 mēnesis',
|
|
9045
9045
|
PK_ID: '_pk_id',
|
|
@@ -9066,11 +9066,11 @@ const translations = {
|
|
|
9066
9066
|
PURPOSE: 'Purpose',
|
|
9067
9067
|
CATEGORY: 'Category',
|
|
9068
9068
|
DURATION: 'Duration',
|
|
9069
|
-
ALLOW_COOKIES: '
|
|
9069
|
+
ALLOW_COOKIES: 'mtm_cookie_consent',
|
|
9070
9070
|
ALLOW_COOKIES_PURPOSE: 'Saves user consent for cookie usage and statistics gathering.',
|
|
9071
9071
|
FUNCTIONAL_COOKIES: 'Functional cookies',
|
|
9072
9072
|
ONE_YEAR: '1 year',
|
|
9073
|
-
CULTURE: '
|
|
9073
|
+
CULTURE: 'language',
|
|
9074
9074
|
CULTURE_PURPOSE: "Saves user selected language so it doesn't need to be switched every time.",
|
|
9075
9075
|
ONE_MONTH: '1 month',
|
|
9076
9076
|
PK_ID: '_pk_id',
|
|
@@ -9309,6 +9309,7 @@ class CookieConsentComponent {
|
|
|
9309
9309
|
this.isDetailsVisible = false;
|
|
9310
9310
|
this.#COOKIE_CONSENT_ACCEPTED_KEY = 'cookie-consent-accepted';
|
|
9311
9311
|
this.#COOKIE_CONSENT_DECLINED_KEY = 'cookie-consent-declined';
|
|
9312
|
+
this.destroy = new Subject();
|
|
9312
9313
|
}
|
|
9313
9314
|
#analytics;
|
|
9314
9315
|
#translate;
|
|
@@ -9326,18 +9327,30 @@ class CookieConsentComponent {
|
|
|
9326
9327
|
}
|
|
9327
9328
|
const currentLang = this.#translate.getCurrentLang();
|
|
9328
9329
|
this.#translate.setTranslation(currentLang, translations[currentLang.split('-')[0]], true);
|
|
9330
|
+
this.#translate.onLangChange.pipe(takeUntil(this.destroy)).subscribe((langChangeEvent) => {
|
|
9331
|
+
const newLang = langChangeEvent.lang;
|
|
9332
|
+
this.#translate.setTranslation(newLang, translations[newLang.split('-')[0]], true);
|
|
9333
|
+
});
|
|
9334
|
+
}
|
|
9335
|
+
ngOnDestroy() {
|
|
9336
|
+
this.removeListeners();
|
|
9329
9337
|
}
|
|
9330
9338
|
toggleDetails() {
|
|
9331
9339
|
this.isDetailsVisible = !this.isDetailsVisible;
|
|
9332
9340
|
}
|
|
9333
9341
|
accept() {
|
|
9334
|
-
this.isClosed = true;
|
|
9335
9342
|
this.#analytics.cookieConsentGiven(true);
|
|
9336
9343
|
localStorage.setItem(this.#COOKIE_CONSENT_ACCEPTED_KEY, 'true');
|
|
9344
|
+
this.removeListeners();
|
|
9337
9345
|
}
|
|
9338
9346
|
decline() {
|
|
9339
|
-
this.isClosed = true;
|
|
9340
9347
|
localStorage.setItem(this.#COOKIE_CONSENT_DECLINED_KEY, 'true');
|
|
9348
|
+
this.removeListeners();
|
|
9349
|
+
}
|
|
9350
|
+
removeListeners() {
|
|
9351
|
+
this.isClosed = true;
|
|
9352
|
+
this.destroy.next();
|
|
9353
|
+
this.destroy.complete();
|
|
9341
9354
|
}
|
|
9342
9355
|
isCookieConsentConfigured() {
|
|
9343
9356
|
const isAccepted = localStorage.getItem(this.#COOKIE_CONSENT_ACCEPTED_KEY) === 'true';
|
|
@@ -9362,7 +9375,7 @@ class CookieConsentComponent {
|
|
|
9362
9375
|
}], privacyPolicyUrl: [{
|
|
9363
9376
|
type: Input
|
|
9364
9377
|
}] }); })();
|
|
9365
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CookieConsentComponent, { className: "CookieConsentComponent", filePath: "lib/analytics/cookie-consent/cookie-consent.component.ts", lineNumber:
|
|
9378
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CookieConsentComponent, { className: "CookieConsentComponent", filePath: "lib/analytics/cookie-consent/cookie-consent.component.ts", lineNumber: 16 }); })();
|
|
9366
9379
|
|
|
9367
9380
|
/*
|
|
9368
9381
|
* Public API Surface of ngx-common
|