@tilde-nlp/ngx-common 8.1.57 → 8.1.58
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/tilde-nlp-ngx-common.mjs +144 -186
- package/fesm2022/tilde-nlp-ngx-common.mjs.map +1 -1
- package/index.d.ts +13 -24
- package/package.json +1 -1
|
@@ -8504,13 +8504,6 @@ class SubscriptionComponent {
|
|
|
8504
8504
|
}], null, { token: [{ type: i0.Input, args: [{ isSignal: true, alias: "token", required: true }] }], subscription: [{ type: i0.Input, args: [{ isSignal: true, alias: "subscription", required: true }] }], quota: [{ type: i0.Input, args: [{ isSignal: true, alias: "quota", required: true }] }], visibleQuotaTypes: [{ type: i0.Input, args: [{ isSignal: true, alias: "visibleQuotaTypes", required: false }] }], contactUsUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "contactUsUrl", required: false }] }], chargebeeSettings: [{ type: i0.Input, args: [{ isSignal: true, alias: "chargebeeSettings", required: false }] }], manageClick: [{ type: i0.Output, args: ["manageClick"] }], contactUsClick: [{ type: i0.Output, args: ["contactUsClick"] }] }); })();
|
|
8505
8505
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SubscriptionComponent, { className: "SubscriptionComponent", filePath: "lib/subscription/subscription.component.ts", lineNumber: 26 }); })();
|
|
8506
8506
|
|
|
8507
|
-
var AccessibilityFontSizes;
|
|
8508
|
-
(function (AccessibilityFontSizes) {
|
|
8509
|
-
AccessibilityFontSizes["BASE"] = "1rem";
|
|
8510
|
-
AccessibilityFontSizes["L"] = "1.25rem";
|
|
8511
|
-
AccessibilityFontSizes["XL"] = "1.5rem";
|
|
8512
|
-
})(AccessibilityFontSizes || (AccessibilityFontSizes = {}));
|
|
8513
|
-
|
|
8514
8507
|
var AccessibilityContrasts;
|
|
8515
8508
|
(function (AccessibilityContrasts) {
|
|
8516
8509
|
AccessibilityContrasts["BASE"] = "base";
|
|
@@ -8519,88 +8512,21 @@ var AccessibilityContrasts;
|
|
|
8519
8512
|
AccessibilityContrasts["BLACK_YELLOW"] = "black-yellow";
|
|
8520
8513
|
})(AccessibilityContrasts || (AccessibilityContrasts = {}));
|
|
8521
8514
|
|
|
8522
|
-
|
|
8523
|
-
|
|
8524
|
-
|
|
8525
|
-
|
|
8526
|
-
|
|
8527
|
-
|
|
8528
|
-
|
|
8529
|
-
|
|
8530
|
-
|
|
8531
|
-
|
|
8532
|
-
|
|
8533
|
-
|
|
8534
|
-
|
|
8535
|
-
|
|
8536
|
-
|
|
8537
|
-
this.magnifiedText = document.createElement('div');
|
|
8538
|
-
this.magnifiedText.classList.add('magnified-text');
|
|
8539
|
-
document.body.appendChild(this.magnifiedText);
|
|
8540
|
-
let positionTop;
|
|
8541
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8542
|
-
this.mouseoverHandler = (event) => {
|
|
8543
|
-
if (event.target && event.target.nodeType === Node.ELEMENT_NODE) {
|
|
8544
|
-
const targetElementClassList = event.target?.classList;
|
|
8545
|
-
if (targetElementClassList.contains('mat-icon') || targetElementClassList.contains('material-icons')) {
|
|
8546
|
-
return;
|
|
8547
|
-
}
|
|
8548
|
-
const textContent = this.getFirstTextContent(event.target);
|
|
8549
|
-
if (!textContent || !textContent.trim().length) {
|
|
8550
|
-
this.magnifiedText.style.display = 'none';
|
|
8551
|
-
return;
|
|
8552
|
-
}
|
|
8553
|
-
this.magnifiedText.style.display = 'block';
|
|
8554
|
-
this.magnifiedText.textContent = textContent;
|
|
8555
|
-
positionTop = event.pageY - this.magnifiedText.clientHeight - 25 > 0 ? event.pageY - this.magnifiedText.clientHeight - 25 : 0;
|
|
8556
|
-
this.magnifiedText.style.left = `${event.pageX - 35}px`;
|
|
8557
|
-
this.magnifiedText.style.top = `${positionTop}px`;
|
|
8558
|
-
}
|
|
8559
|
-
};
|
|
8560
|
-
document.addEventListener('mouseover', this.mouseoverHandler);
|
|
8561
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8562
|
-
this.mousemoveHandler = (event) => {
|
|
8563
|
-
if (this.magnifiedText) {
|
|
8564
|
-
this.magnifiedText.style.left = `${event.pageX - 35}px`;
|
|
8565
|
-
this.magnifiedText.style.top = `${positionTop}px`;
|
|
8566
|
-
}
|
|
8567
|
-
};
|
|
8568
|
-
document.addEventListener('mousemove', this.mousemoveHandler);
|
|
8569
|
-
}
|
|
8570
|
-
removeMagnifier() {
|
|
8571
|
-
if (this.magnifiedText) {
|
|
8572
|
-
document.body.removeChild(this.magnifiedText);
|
|
8573
|
-
this.magnifiedText = null;
|
|
8574
|
-
}
|
|
8575
|
-
if (this.mouseoverHandler) {
|
|
8576
|
-
document.removeEventListener('mouseover', this.mouseoverHandler);
|
|
8577
|
-
this.mouseoverHandler = null;
|
|
8578
|
-
}
|
|
8579
|
-
if (this.mousemoveHandler) {
|
|
8580
|
-
document.removeEventListener('mousemove', this.mousemoveHandler);
|
|
8581
|
-
this.mousemoveHandler = null;
|
|
8582
|
-
}
|
|
8583
|
-
}
|
|
8584
|
-
getFirstTextContent(element) {
|
|
8585
|
-
let textContent = '';
|
|
8586
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8587
|
-
for (const child of element.childNodes) {
|
|
8588
|
-
if (child.nodeType === Node.TEXT_NODE) {
|
|
8589
|
-
textContent = child.textContent || null;
|
|
8590
|
-
break;
|
|
8591
|
-
}
|
|
8592
|
-
}
|
|
8593
|
-
return textContent;
|
|
8594
|
-
}
|
|
8595
|
-
static { this.ɵfac = function AccessibilityTextMagnifierService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AccessibilityTextMagnifierService)(); }; }
|
|
8596
|
-
static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AccessibilityTextMagnifierService, factory: AccessibilityTextMagnifierService.ɵfac, providedIn: 'root' }); }
|
|
8597
|
-
}
|
|
8598
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AccessibilityTextMagnifierService, [{
|
|
8599
|
-
type: Injectable,
|
|
8600
|
-
args: [{
|
|
8601
|
-
providedIn: 'root',
|
|
8602
|
-
}]
|
|
8603
|
-
}], null, null); })();
|
|
8515
|
+
const DEFAULT_ACCESSIBILITY_PREFERENCES = {
|
|
8516
|
+
fontSizeIndex: 0,
|
|
8517
|
+
contrast: AccessibilityContrasts.BASE,
|
|
8518
|
+
textMagnifierEnabled: false,
|
|
8519
|
+
screenMaskEnabled: false,
|
|
8520
|
+
};
|
|
8521
|
+
|
|
8522
|
+
const USER_CONFIG_STORAGE = new InjectionToken('USER_CONFIG_STORAGE');
|
|
8523
|
+
|
|
8524
|
+
var AccessibilityFontSizes;
|
|
8525
|
+
(function (AccessibilityFontSizes) {
|
|
8526
|
+
AccessibilityFontSizes["BASE"] = "1rem";
|
|
8527
|
+
AccessibilityFontSizes["L"] = "1.25rem";
|
|
8528
|
+
AccessibilityFontSizes["XL"] = "1.5rem";
|
|
8529
|
+
})(AccessibilityFontSizes || (AccessibilityFontSizes = {}));
|
|
8604
8530
|
|
|
8605
8531
|
class AccessibilityScreenMaskService {
|
|
8606
8532
|
constructor() {
|
|
@@ -8695,64 +8621,123 @@ class AccessibilityScreenMaskService {
|
|
|
8695
8621
|
}]
|
|
8696
8622
|
}], null, null); })();
|
|
8697
8623
|
|
|
8624
|
+
class AccessibilityTextMagnifierService {
|
|
8625
|
+
constructor() {
|
|
8626
|
+
this.magnifiedText = null;
|
|
8627
|
+
this.mousemoveHandler = null;
|
|
8628
|
+
this.mouseoverHandler = null;
|
|
8629
|
+
}
|
|
8630
|
+
toggleTextMagnifier(isDisabled) {
|
|
8631
|
+
if (isDisabled) {
|
|
8632
|
+
this.addMagnifier();
|
|
8633
|
+
}
|
|
8634
|
+
else {
|
|
8635
|
+
this.removeMagnifier();
|
|
8636
|
+
}
|
|
8637
|
+
}
|
|
8638
|
+
addMagnifier() {
|
|
8639
|
+
this.magnifiedText = document.createElement('div');
|
|
8640
|
+
this.magnifiedText.classList.add('magnified-text');
|
|
8641
|
+
document.body.appendChild(this.magnifiedText);
|
|
8642
|
+
let positionTop;
|
|
8643
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8644
|
+
this.mouseoverHandler = (event) => {
|
|
8645
|
+
if (event.target && event.target.nodeType === Node.ELEMENT_NODE) {
|
|
8646
|
+
const targetElementClassList = event.target?.classList;
|
|
8647
|
+
if (targetElementClassList.contains('mat-icon') || targetElementClassList.contains('material-icons')) {
|
|
8648
|
+
return;
|
|
8649
|
+
}
|
|
8650
|
+
const textContent = this.getFirstTextContent(event.target);
|
|
8651
|
+
if (!textContent || !textContent.trim().length) {
|
|
8652
|
+
this.magnifiedText.style.display = 'none';
|
|
8653
|
+
return;
|
|
8654
|
+
}
|
|
8655
|
+
this.magnifiedText.style.display = 'block';
|
|
8656
|
+
this.magnifiedText.textContent = textContent;
|
|
8657
|
+
positionTop = event.pageY - this.magnifiedText.clientHeight - 25 > 0 ? event.pageY - this.magnifiedText.clientHeight - 25 : 0;
|
|
8658
|
+
this.magnifiedText.style.left = `${event.pageX - 35}px`;
|
|
8659
|
+
this.magnifiedText.style.top = `${positionTop}px`;
|
|
8660
|
+
}
|
|
8661
|
+
};
|
|
8662
|
+
document.addEventListener('mouseover', this.mouseoverHandler);
|
|
8663
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8664
|
+
this.mousemoveHandler = (event) => {
|
|
8665
|
+
if (this.magnifiedText) {
|
|
8666
|
+
this.magnifiedText.style.left = `${event.pageX - 35}px`;
|
|
8667
|
+
this.magnifiedText.style.top = `${positionTop}px`;
|
|
8668
|
+
}
|
|
8669
|
+
};
|
|
8670
|
+
document.addEventListener('mousemove', this.mousemoveHandler);
|
|
8671
|
+
}
|
|
8672
|
+
removeMagnifier() {
|
|
8673
|
+
if (this.magnifiedText) {
|
|
8674
|
+
document.body.removeChild(this.magnifiedText);
|
|
8675
|
+
this.magnifiedText = null;
|
|
8676
|
+
}
|
|
8677
|
+
if (this.mouseoverHandler) {
|
|
8678
|
+
document.removeEventListener('mouseover', this.mouseoverHandler);
|
|
8679
|
+
this.mouseoverHandler = null;
|
|
8680
|
+
}
|
|
8681
|
+
if (this.mousemoveHandler) {
|
|
8682
|
+
document.removeEventListener('mousemove', this.mousemoveHandler);
|
|
8683
|
+
this.mousemoveHandler = null;
|
|
8684
|
+
}
|
|
8685
|
+
}
|
|
8686
|
+
getFirstTextContent(element) {
|
|
8687
|
+
let textContent = '';
|
|
8688
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8689
|
+
for (const child of element.childNodes) {
|
|
8690
|
+
if (child.nodeType === Node.TEXT_NODE) {
|
|
8691
|
+
textContent = child.textContent || null;
|
|
8692
|
+
break;
|
|
8693
|
+
}
|
|
8694
|
+
}
|
|
8695
|
+
return textContent;
|
|
8696
|
+
}
|
|
8697
|
+
static { this.ɵfac = function AccessibilityTextMagnifierService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AccessibilityTextMagnifierService)(); }; }
|
|
8698
|
+
static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AccessibilityTextMagnifierService, factory: AccessibilityTextMagnifierService.ɵfac, providedIn: 'root' }); }
|
|
8699
|
+
}
|
|
8700
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AccessibilityTextMagnifierService, [{
|
|
8701
|
+
type: Injectable,
|
|
8702
|
+
args: [{
|
|
8703
|
+
providedIn: 'root',
|
|
8704
|
+
}]
|
|
8705
|
+
}], null, null); })();
|
|
8706
|
+
|
|
8698
8707
|
class AccessibilityService {
|
|
8708
|
+
#textMagnifier;
|
|
8709
|
+
#screenMask;
|
|
8710
|
+
#storage;
|
|
8699
8711
|
constructor() {
|
|
8700
|
-
this.fontSizeLocalStorageKey = 'ACCESSIBILITY_FONT_SIZE_IX';
|
|
8701
|
-
this.contrastLocalStorageKey = 'ACCESSIBILITY_CONTRAST';
|
|
8702
|
-
this.textMagnifierLocalStorageKey = 'TEXT_MAGNIFIER';
|
|
8703
|
-
this.screenMaskLocalStorageKey = 'SCREEN_MASK';
|
|
8704
8712
|
this.sizeIncreaseSubject = new Subject();
|
|
8705
8713
|
this.contrastSubject = new Subject();
|
|
8706
8714
|
this.#textMagnifier = inject(AccessibilityTextMagnifierService);
|
|
8707
8715
|
this.#screenMask = inject(AccessibilityScreenMaskService);
|
|
8716
|
+
this.#storage = inject(USER_CONFIG_STORAGE, { optional: true });
|
|
8717
|
+
this.preferences = signal(DEFAULT_ACCESSIBILITY_PREFERENCES, ...(ngDevMode ? [{ debugName: "preferences" }] : []));
|
|
8718
|
+
this.#readStorage();
|
|
8708
8719
|
}
|
|
8709
|
-
#textMagnifier;
|
|
8710
|
-
#screenMask;
|
|
8711
8720
|
toggleScreenMask() {
|
|
8712
|
-
const
|
|
8713
|
-
|
|
8714
|
-
this.#
|
|
8715
|
-
localStorage.setItem(this.screenMaskLocalStorageKey, oppositeStatus);
|
|
8721
|
+
const updatedStatus = !this.preferences().screenMaskEnabled;
|
|
8722
|
+
this.#screenMask.toggleScreenMask(updatedStatus);
|
|
8723
|
+
this.#updateConfig({ screenMaskEnabled: updatedStatus });
|
|
8716
8724
|
}
|
|
8717
8725
|
closeFocusBar() {
|
|
8718
8726
|
this.#screenMask.closeFocusBar();
|
|
8719
8727
|
}
|
|
8720
8728
|
toggleTextMagnifier() {
|
|
8721
|
-
const
|
|
8722
|
-
|
|
8723
|
-
this.#
|
|
8724
|
-
localStorage.setItem(this.textMagnifierLocalStorageKey, oppositeStatus);
|
|
8725
|
-
}
|
|
8726
|
-
getSavedTextMagnifierStatus() {
|
|
8727
|
-
const savedTextMagnifierStatus = JSON.parse(localStorage.getItem(this.textMagnifierLocalStorageKey) ?? 'false');
|
|
8728
|
-
return savedTextMagnifierStatus;
|
|
8729
|
-
}
|
|
8730
|
-
getSavedScreenMaskStatus() {
|
|
8731
|
-
const savedScreenMaskStatus = JSON.parse(localStorage.getItem(this.screenMaskLocalStorageKey) ?? 'false');
|
|
8732
|
-
return savedScreenMaskStatus;
|
|
8729
|
+
const updatedStatus = !this.preferences().textMagnifierEnabled;
|
|
8730
|
+
this.#textMagnifier.toggleTextMagnifier(updatedStatus);
|
|
8731
|
+
this.#updateConfig({ textMagnifierEnabled: updatedStatus });
|
|
8733
8732
|
}
|
|
8734
8733
|
setSavedTextMagnifierStatus() {
|
|
8735
|
-
const currnetStatus = this.
|
|
8734
|
+
const currnetStatus = this.preferences().textMagnifierEnabled;
|
|
8736
8735
|
this.#textMagnifier.toggleTextMagnifier(currnetStatus);
|
|
8737
8736
|
}
|
|
8738
8737
|
setSavedScreenMaskStatus() {
|
|
8739
|
-
const currnetStatus = this.
|
|
8738
|
+
const currnetStatus = this.preferences().screenMaskEnabled;
|
|
8740
8739
|
this.#screenMask.toggleScreenMask(currnetStatus);
|
|
8741
8740
|
}
|
|
8742
|
-
saveContrast(contrast) {
|
|
8743
|
-
localStorage.setItem(this.contrastLocalStorageKey, contrast);
|
|
8744
|
-
}
|
|
8745
|
-
getSavedContrast() {
|
|
8746
|
-
const savedContrast = localStorage.getItem(this.contrastLocalStorageKey);
|
|
8747
|
-
return savedContrast ?? AccessibilityContrasts.BASE;
|
|
8748
|
-
}
|
|
8749
|
-
getSavedFontSize() {
|
|
8750
|
-
const savedFontSizeIx = localStorage.getItem(this.fontSizeLocalStorageKey);
|
|
8751
|
-
return JSON.parse(savedFontSizeIx ?? '0');
|
|
8752
|
-
}
|
|
8753
|
-
saveFontSize(ix) {
|
|
8754
|
-
localStorage.setItem(this.fontSizeLocalStorageKey, ix.toString());
|
|
8755
|
-
}
|
|
8756
8741
|
setFontSize(fontSizeIx) {
|
|
8757
8742
|
const sizes = Object.values(AccessibilityFontSizes);
|
|
8758
8743
|
if (fontSizeIx > 0) {
|
|
@@ -8762,10 +8747,26 @@ class AccessibilityService {
|
|
|
8762
8747
|
this.sizeIncreaseSubject.next(false);
|
|
8763
8748
|
}
|
|
8764
8749
|
document.querySelector('html').style.fontSize = sizes[fontSizeIx];
|
|
8750
|
+
this.#updateConfig({ fontSizeIndex: fontSizeIx });
|
|
8765
8751
|
}
|
|
8766
8752
|
setContrast(contrast) {
|
|
8767
8753
|
this.contrastSubject.next(contrast);
|
|
8768
8754
|
document.querySelector('html').className = contrast;
|
|
8755
|
+
this.#updateConfig({ contrast: contrast });
|
|
8756
|
+
}
|
|
8757
|
+
reset() {
|
|
8758
|
+
this.#updateConfig({ ...DEFAULT_ACCESSIBILITY_PREFERENCES });
|
|
8759
|
+
}
|
|
8760
|
+
#updateConfig(updates) {
|
|
8761
|
+
this.preferences.set({ ...this.preferences(), ...updates });
|
|
8762
|
+
this.#storage?.write({ accessibility: this.preferences() }).subscribe();
|
|
8763
|
+
}
|
|
8764
|
+
#readStorage() {
|
|
8765
|
+
this.#storage?.read().subscribe(config => {
|
|
8766
|
+
if (config?.accessibility) {
|
|
8767
|
+
this.preferences.set({ ...config.accessibility });
|
|
8768
|
+
}
|
|
8769
|
+
});
|
|
8769
8770
|
}
|
|
8770
8771
|
static { this.ɵfac = function AccessibilityService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AccessibilityService)(); }; }
|
|
8771
8772
|
static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AccessibilityService, factory: AccessibilityService.ɵfac, providedIn: 'root' }); }
|
|
@@ -8775,7 +8776,7 @@ class AccessibilityService {
|
|
|
8775
8776
|
args: [{
|
|
8776
8777
|
providedIn: 'root',
|
|
8777
8778
|
}]
|
|
8778
|
-
}],
|
|
8779
|
+
}], () => [], null); })();
|
|
8779
8780
|
|
|
8780
8781
|
const _forTrack0 = ($index, $item) => $item.text;
|
|
8781
8782
|
function AccessibilityDialogComponent_For_18_Template(rf, ctx) { if (rf & 1) {
|
|
@@ -8789,7 +8790,7 @@ function AccessibilityDialogComponent_For_18_Template(rf, ctx) { if (rf & 1) {
|
|
|
8789
8790
|
const contrast_r2 = ctx.$implicit;
|
|
8790
8791
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
8791
8792
|
i0.ɵɵclassMap(contrast_r2);
|
|
8792
|
-
i0.ɵɵclassProp("active", contrast_r2 === ctx_r2.
|
|
8793
|
+
i0.ɵɵclassProp("active", contrast_r2 === ctx_r2.accessabilityPreferences().contrast);
|
|
8793
8794
|
} }
|
|
8794
8795
|
function AccessibilityDialogComponent_For_32_Template(rf, ctx) { if (rf & 1) {
|
|
8795
8796
|
i0.ɵɵelementStart(0, "a", 14);
|
|
@@ -8806,54 +8807,38 @@ function AccessibilityDialogComponent_For_32_Template(rf, ctx) { if (rf & 1) {
|
|
|
8806
8807
|
} }
|
|
8807
8808
|
class AccessibilityDialogComponent {
|
|
8808
8809
|
constructor() {
|
|
8809
|
-
this.currentContrast = AccessibilityContrasts.BASE;
|
|
8810
8810
|
this.#accessibility = inject(AccessibilityService);
|
|
8811
8811
|
this.contrasts = Object.values(AccessibilityContrasts);
|
|
8812
8812
|
this.data = inject(MAT_DIALOG_DATA);
|
|
8813
8813
|
this.featureSources = [];
|
|
8814
8814
|
}
|
|
8815
|
+
get accessabilityPreferences() {
|
|
8816
|
+
return this.#accessibility.preferences;
|
|
8817
|
+
}
|
|
8815
8818
|
#accessibility;
|
|
8816
8819
|
ngOnInit() {
|
|
8817
|
-
this
|
|
8818
|
-
this.currentContrast = this.#accessibility.getSavedContrast();
|
|
8819
|
-
this.isTextMagnifierEnabled = this.#accessibility.getSavedTextMagnifierStatus();
|
|
8820
|
-
this.isScreenMaskEnabled = this.#accessibility.getSavedScreenMaskStatus();
|
|
8821
|
-
this.setFeatureSources();
|
|
8820
|
+
this.#setFeatureSources();
|
|
8822
8821
|
}
|
|
8823
8822
|
changeContrast(contrast) {
|
|
8824
|
-
this.currentContrast = contrast;
|
|
8825
|
-
this.#accessibility.saveContrast(contrast);
|
|
8826
8823
|
this.#accessibility.setContrast(contrast);
|
|
8827
8824
|
}
|
|
8828
8825
|
changeFontSize(e) {
|
|
8829
|
-
|
|
8830
|
-
this.#accessibility.
|
|
8831
|
-
this.#accessibility.setFontSize(this.selectedFontSizeIndex);
|
|
8826
|
+
const fontSizeIndex = e.index;
|
|
8827
|
+
this.#accessibility.setFontSize(fontSizeIndex);
|
|
8832
8828
|
}
|
|
8833
8829
|
toggleTextMagnifier() {
|
|
8834
8830
|
this.#accessibility.toggleTextMagnifier();
|
|
8835
|
-
this.isTextMagnifierEnabled = this.#accessibility.getSavedTextMagnifierStatus();
|
|
8836
8831
|
}
|
|
8837
8832
|
toggleScreenMask() {
|
|
8838
8833
|
this.#accessibility.toggleScreenMask();
|
|
8839
|
-
this.isScreenMaskEnabled = this.#accessibility.getSavedScreenMaskStatus();
|
|
8840
8834
|
}
|
|
8841
8835
|
closeFocusBar() {
|
|
8842
8836
|
this.#accessibility.closeFocusBar();
|
|
8843
8837
|
}
|
|
8844
8838
|
reset() {
|
|
8845
|
-
|
|
8846
|
-
this.toggleTextMagnifier();
|
|
8847
|
-
}
|
|
8848
|
-
if (this.isScreenMaskEnabled) {
|
|
8849
|
-
this.toggleScreenMask();
|
|
8850
|
-
}
|
|
8851
|
-
this.changeContrast(AccessibilityContrasts.BASE);
|
|
8852
|
-
this.selectedFontSizeIndex = 0;
|
|
8853
|
-
this.#accessibility.saveFontSize(this.selectedFontSizeIndex);
|
|
8854
|
-
this.#accessibility.setFontSize(this.selectedFontSizeIndex);
|
|
8839
|
+
this.#accessibility.reset();
|
|
8855
8840
|
}
|
|
8856
|
-
setFeatureSources() {
|
|
8841
|
+
#setFeatureSources() {
|
|
8857
8842
|
this.featureSources = [
|
|
8858
8843
|
{
|
|
8859
8844
|
text: 'ACCESSIBILITY.EASY_TO_READ',
|
|
@@ -8923,7 +8908,7 @@ class AccessibilityDialogComponent {
|
|
|
8923
8908
|
i0.ɵɵadvance(5);
|
|
8924
8909
|
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(7, 18, "ACCESSIBILITY.FONT_SIZE_LABEL"), " ");
|
|
8925
8910
|
i0.ɵɵadvance(2);
|
|
8926
|
-
i0.ɵɵproperty("selectedIndex", ctx.
|
|
8911
|
+
i0.ɵɵproperty("selectedIndex", ctx.accessabilityPreferences().fontSizeIndex);
|
|
8927
8912
|
i0.ɵɵadvance();
|
|
8928
8913
|
i0.ɵɵproperty("label", "100%");
|
|
8929
8914
|
i0.ɵɵadvance();
|
|
@@ -8937,11 +8922,11 @@ class AccessibilityDialogComponent {
|
|
|
8937
8922
|
i0.ɵɵadvance(4);
|
|
8938
8923
|
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(22, 22, "ACCESSIBILITY.VISUAL_TOOLS_LABEL"), " ");
|
|
8939
8924
|
i0.ɵɵadvance(2);
|
|
8940
|
-
i0.ɵɵclassProp("active", ctx.
|
|
8925
|
+
i0.ɵɵclassProp("active", ctx.accessabilityPreferences().textMagnifierEnabled);
|
|
8941
8926
|
i0.ɵɵadvance();
|
|
8942
8927
|
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(25, 24, "ACCESSIBILITY.TEXT_MAGNIFIER"), " ");
|
|
8943
8928
|
i0.ɵɵadvance(2);
|
|
8944
|
-
i0.ɵɵclassProp("active", ctx.
|
|
8929
|
+
i0.ɵɵclassProp("active", ctx.accessabilityPreferences().screenMaskEnabled);
|
|
8945
8930
|
i0.ɵɵadvance();
|
|
8946
8931
|
i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(28, 26, "ACCESSIBILITY.SCREEN_MASK"), " ");
|
|
8947
8932
|
i0.ɵɵadvance(4);
|
|
@@ -8954,12 +8939,10 @@ class AccessibilityDialogComponent {
|
|
|
8954
8939
|
}
|
|
8955
8940
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AccessibilityDialogComponent, [{
|
|
8956
8941
|
type: Component,
|
|
8957
|
-
args: [{ selector: 'lib-accessibility-dialog', imports: [MatDialogModule, TranslateModule, MatButtonModule, MatTabsModule, MatIconModule], template: "<h1 mat-dialog-title class=\"text-2-xl\">{{ \"ACCESSIBILITY.TITLE\" | translate }}</h1>\r\n\r\n<div mat-dialog-content>\r\n\t<div class=\"font-size-wrapper\">\r\n\t\t<p class=\"settings-title\">\r\n\t\t\t{{ \"ACCESSIBILITY.FONT_SIZE_LABEL\" | translate }}\r\n\t\t</p>\r\n\r\n\t\t<mat-tab-group [selectedIndex]=\"
|
|
8942
|
+
args: [{ selector: 'lib-accessibility-dialog', imports: [MatDialogModule, TranslateModule, MatButtonModule, MatTabsModule, MatIconModule], template: "<h1 mat-dialog-title class=\"text-2-xl\">{{ \"ACCESSIBILITY.TITLE\" | translate }}</h1>\r\n\r\n<div mat-dialog-content>\r\n\t<div class=\"font-size-wrapper\">\r\n\t\t<p class=\"settings-title\">\r\n\t\t\t{{ \"ACCESSIBILITY.FONT_SIZE_LABEL\" | translate }}\r\n\t\t</p>\r\n\r\n\t\t<mat-tab-group [selectedIndex]=\"accessabilityPreferences().fontSizeIndex\" (selectedTabChange)=\"changeFontSize($event)\" animationDuration=\"0ms\">\r\n\t\t\t<mat-tab [label]=\"'100%'\"></mat-tab>\r\n\t\t\t<mat-tab [label]=\"'150%'\"></mat-tab>\r\n\t\t\t<mat-tab [label]=\"'200%'\"></mat-tab>\r\n\t\t</mat-tab-group>\r\n\t</div>\r\n\r\n\t<div class=\"contrast-wrapper\">\r\n\t\t<p class=\"settings-title\">\r\n\t\t\t{{ \"ACCESSIBILITY.CONTRAST_LABEL\" | translate }}\r\n\t\t</p>\r\n\r\n\t\t<div class=\"contrast-option-wrapper\">\r\n\t\t\t@for (contrast of contrasts; track contrast) {\r\n\t\t\t<button (click)=\"changeContrast(contrast)\" [class]=\"contrast\" [class.active]=\"contrast === accessabilityPreferences().contrast\" class=\"contrast-option\">\r\n\t\t\t\t<mat-icon class=\"material-icons-outlined\">visibility</mat-icon>\r\n\t\t\t</button>\r\n\t\t\t}\r\n\t\t</div>\r\n\t</div>\r\n\r\n\t<div class=\"visual-tools-wrapper\">\r\n\t\t<p class=\"settings-title\">\r\n\t\t\t{{ \"ACCESSIBILITY.VISUAL_TOOLS_LABEL\" | translate }}\r\n\t\t</p>\r\n\r\n\t\t<button mat-stroked-button [class.active]=\"accessabilityPreferences().textMagnifierEnabled\" (click)=\"toggleTextMagnifier()\">\r\n\t\t\t{{ \"ACCESSIBILITY.TEXT_MAGNIFIER\" | translate }}\r\n\t\t</button>\r\n\r\n\t\t<button class=\"screen-mask-btn\" mat-stroked-button [class.active]=\"accessabilityPreferences().screenMaskEnabled\" (click)=\"toggleScreenMask()\">\r\n\t\t\t{{ \"ACCESSIBILITY.SCREEN_MASK\" | translate }}\r\n\t\t</button>\r\n\t</div>\r\n\r\n\t<div class=\"divider\"></div>\r\n\r\n\t<div class=\"feature-links-wrapper\">\r\n\t\t@for (feature of featureSources; track feature.text) {\r\n\t\t\t<a [href]=\"feature.link\" class=\"feature-link\">\r\n\t\t\t\t{{ feature.text | translate }} \r\n\t\t\t\t<mat-icon>arrow_forward_ios</mat-icon>\r\n\t\t\t</a>\r\n\t\t}\r\n\t</div>\r\n</div>\r\n\r\n<div mat-dialog-actions>\r\n\t<button mat-stroked-button (click)=\"reset()\">{{ \"ACCESSIBILITY.RESET\" | translate }}</button>\r\n\t<button mat-flat-button mat-dialog-close>{{ \"ACCESSIBILITY.CLOSE\" | translate }}</button>\r\n</div>\r\n", styles: [".settings-title{color:var(--base-30);font-weight:600;font-size:.8125rem;margin-bottom:12px}.contrast-wrapper{margin-top:24px}.contrast-wrapper .contrast-option-wrapper{display:flex;gap:12px}.contrast-wrapper .contrast-option-wrapper .contrast-option{display:flex;justify-content:center;align-items:center;padding:8px 24px;color:#000!important;background-color:#fff!important;border-radius:8px;width:100%;border:2px solid transparent}.contrast-wrapper .contrast-option-wrapper .contrast-option.black-white{background-color:#000!important;color:#fff!important}.contrast-wrapper .contrast-option-wrapper .contrast-option.yellow-black{background-color:#f9f150!important;color:#000!important}.contrast-wrapper .contrast-option-wrapper .contrast-option.black-yellow{background-color:#000!important;color:#f9f150!important}.contrast-wrapper .contrast-option-wrapper .contrast-option.active{border:2px solid;border-color:var(--base-0)}.visual-tools-wrapper{margin-top:24px}.visual-tools-wrapper .screen-mask-btn{margin-left:8px}.divider{margin:24px 0;border:1px solid var(--base-70)}.feature-links-wrapper{display:flex;flex-direction:column;gap:12px}.feature-link{width:100%;display:flex;align-items:center;justify-content:space-between;color:var(--base-40)}.feature-link mat-icon{scale:.75}:host ::ng-deep .mdc-tab--active{background-color:var(--mat-sys-primary-container)!important}:host ::ng-deep .mdc-tab--active .mdc-tab__text-label{color:var(--primary-accent)!important}:host ::ng-deep .mat-mdc-tab{width:50px;border:1px solid var(--base-70)}:host ::ng-deep .mat-mdc-tab:first-child{border-bottom-left-radius:16px;border-top-left-radius:16px}:host ::ng-deep .mat-mdc-tab:last-child{border-bottom-right-radius:16px;border-top-right-radius:16px}:host ::ng-deep .mdc-tab-indicator__content--underline{display:none}:host ::ng-deep .mat-mdc-tab-label-container{border-bottom-width:0!important}:host ::ng-deep .active .mdc-button__ripple{background-color:var(--primary-accent)!important;opacity:var(--mat-button-outlined-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}\n"] }]
|
|
8958
8943
|
}], null, null); })();
|
|
8959
8944
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(AccessibilityDialogComponent, { className: "AccessibilityDialogComponent", filePath: "lib/accessibility/accessibility-dialog.component.ts", lineNumber: 16 }); })();
|
|
8960
8945
|
|
|
8961
|
-
const USER_CONFIG_STORAGE = new InjectionToken('USER_CONFIG_STORAGE');
|
|
8962
|
-
|
|
8963
8946
|
class MatomoService {
|
|
8964
8947
|
setCookies() {
|
|
8965
8948
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -9483,13 +9466,6 @@ class CookieConsentComponent {
|
|
|
9483
9466
|
}] }); })();
|
|
9484
9467
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CookieConsentComponent, { className: "CookieConsentComponent", filePath: "lib/analytics/cookie-consent/cookie-consent.component.ts", lineNumber: 18 }); })();
|
|
9485
9468
|
|
|
9486
|
-
const DEFAULT_ACCESSIBILITY_PREFERENCES = {
|
|
9487
|
-
fontSizeIndex: 0,
|
|
9488
|
-
contrast: AccessibilityContrasts.BASE,
|
|
9489
|
-
textMagnifierEnabled: false,
|
|
9490
|
-
screenMaskEnabled: false,
|
|
9491
|
-
};
|
|
9492
|
-
|
|
9493
9469
|
const DEFAULT_COOKIE_CONSENT_PREFERENCES = {
|
|
9494
9470
|
accepted: false,
|
|
9495
9471
|
};
|
|
@@ -9808,15 +9784,9 @@ class UILanguageService {
|
|
|
9808
9784
|
* - If a preferred language is found, calls `useLanguage` to set the current language.
|
|
9809
9785
|
*/
|
|
9810
9786
|
initialize() {
|
|
9811
|
-
console.log('Initializing UILanguageService');
|
|
9812
9787
|
this.#translateService.setFallbackLang(this.#getDefaultLanguage());
|
|
9813
|
-
console.log(`Default language set to ${this.#getDefaultLanguage()}`);
|
|
9814
|
-
console.log('Fetching language from storage');
|
|
9815
9788
|
this.#getFromStore()
|
|
9816
|
-
.pipe(tap(language =>
|
|
9817
|
-
console.log(`Language fetched from storage: ${language}`);
|
|
9818
|
-
this.useLanguage(language);
|
|
9819
|
-
})).subscribe();
|
|
9789
|
+
.pipe(tap(language => this.useLanguage(language))).subscribe();
|
|
9820
9790
|
}
|
|
9821
9791
|
/**
|
|
9822
9792
|
* Sets the current language for the application.
|
|
@@ -9831,7 +9801,6 @@ class UILanguageService {
|
|
|
9831
9801
|
* It updates UI language and stores the value in store.
|
|
9832
9802
|
*/
|
|
9833
9803
|
useLanguage(languageCode) {
|
|
9834
|
-
console.log(`Setting language to ${languageCode}`);
|
|
9835
9804
|
if (!this.languages.includes(languageCode)) {
|
|
9836
9805
|
console.error(`Language with code '${languageCode}' not supported`);
|
|
9837
9806
|
languageCode = this.#getDefaultLanguage();
|
|
@@ -9842,34 +9811,23 @@ class UILanguageService {
|
|
|
9842
9811
|
this.updateStore();
|
|
9843
9812
|
}
|
|
9844
9813
|
updateStore() {
|
|
9845
|
-
console.log('Updating language in store');
|
|
9846
9814
|
if (!this.#storage) {
|
|
9847
|
-
console.warn('UserConfigStorage not available, cannot update language in store');
|
|
9848
9815
|
return;
|
|
9849
9816
|
}
|
|
9850
|
-
console.log(`Storing language ${this.currentLanguage()} in storage`);
|
|
9851
9817
|
this.#storage.write({ language: { locale: this.currentLanguage() } }).subscribe();
|
|
9852
9818
|
}
|
|
9853
9819
|
#getFromStore() {
|
|
9854
|
-
console.log('Getting language from store');
|
|
9855
9820
|
const defaultLanguage = this.#getDefaultLanguage();
|
|
9856
|
-
console.log(`Default language is ${defaultLanguage}`);
|
|
9857
9821
|
if (!this.#storage) {
|
|
9858
|
-
console.warn('UserConfigStorage not available, returning default language');
|
|
9859
9822
|
return of(defaultLanguage);
|
|
9860
9823
|
}
|
|
9861
9824
|
return this.#storage.read()
|
|
9862
|
-
.pipe(map(config =>
|
|
9863
|
-
console.log(`Language read from storage: ${config?.language.locale}`);
|
|
9864
|
-
return config?.language.locale ?? defaultLanguage;
|
|
9865
|
-
}));
|
|
9825
|
+
.pipe(map(config => config?.language.locale ?? defaultLanguage));
|
|
9866
9826
|
}
|
|
9867
9827
|
#getDefaultLanguage() {
|
|
9868
|
-
console.log(`Getting default language - ${this.#configuration.uiLanguagesConfiguration.defaultLanguage}`);
|
|
9869
9828
|
return this.#configuration.uiLanguagesConfiguration.defaultLanguage;
|
|
9870
9829
|
}
|
|
9871
9830
|
#updateDocumentLangAttribute() {
|
|
9872
|
-
console.log(`Updating document lang attribute to ${this.currentLanguage()}`);
|
|
9873
9831
|
const doc = document.documentElement;
|
|
9874
9832
|
doc.lang = this.currentLanguage().split('-')[0];
|
|
9875
9833
|
}
|